(function(g){var f=window.AmazonUIPageJS||window.P,n=f._namespace||f.attributeErrors,a=n?n("CommonDetailPageScripts",""):f;a.guardFatal?a.guardFatal(g)(a,window):a.execute(function(){g(a,window)})})(function(g,f,n){g.when("jQuery","jumpLink").execute(function(a,b){var f=a("#miniATFUDP"),k=0;0<f.length&&(k=f.height()+9);0<a("#reviewStarsLinkedCustomerReviews").length&&b.bind("#reviewStarsLinkedCustomerReviews",10,k);0<a("#askATFLink").length&&b.bind("#askATFLink",10,k);g.when("cf").execute(function(g){0<
a("#important-information a[href\x3d'#legal-disclaimer']").length&&b.bind("#important-information a[href\x3d'#legal-disclaimer']",10,k,!0)});b.bind("#seeMoreDetailsLink",300,k)});"use strict";g.when("A","jQuery","ImageBlockATF","jumpLink","cf").register("miniATFUtils",function(a,b,n,k){function x(e){r&&!e||t||(e=(new Date).getTime()-y,e=50>e?50-e:10,r=1,r=0,y=(new Date).getTime(),setTimeout(function(){var e=u.scrollTop(),a=b("#miniATFUDP");if(0<a.length){var c=z;if("T1"===c){c=b("#sims_fbt");if(0>=
c.length||0>=c.height())c=b("#buyxgety_feature_div");var d=c;c=Number.MAX_VALUE;if(d&&0<d.length){var l=d.height();d=d.offset();l&&d&&(c=d.top+l)}c=Math.min(c,1200)}else if("T2"===c){c="#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(" ");
d=Number.MAX_VALUE;for(l=0;l<c.length;l++){var h=b(c[l]);if(h&&0<h.length&&0<h.height()){var m=Number.MAX_VALUE;h&&0<h.length&&(h=h.offset())&&(m=h.top);m<d&&(d=m)}}c=Math.min(d,1700)-100}else c=void 0;e>c?!v&&a.is(":hidden")&&(a.removeClass("a-hidden"),a.slideDown(200)):(a.slideUp(200),v=0)}},e))}k=b("#miniATFUDP");var A=b("#miniATFPartialSelection")[0],p=b(".twister-dropdown-highlight")[0];if(!(0>=k.length)){var v=0,y=0,r=0,q={},t=0,w=0,z="T2";q.setMiniATFShowHeight=function(b){z=b};q.setMiniATFScrollUpHeight=
function(a){w=0;"T1"===a&&(a=b("#productTitle"),0<a.length&&(a=a.offset())&&(w=a.top-20))};b("body").delegate(".go-to-top","click",function(){b("body, html").animate({scrollTop:w},300);v=1;A&&p&&(b(p).removeClass("transparentTwisterDropdownBorder"),b(p).addClass("highlightTwisterDropdownBorder"));return!1});A&&p&&b(p).click(function(){b(this).addClass("transparentTwisterDropdownBorder");b(this).removeClass("highlightTwisterDropdownBorder")});var u=b(f);u.scroll(function(){x(0)});u.resize(function(){x(1)});
g.when("ImageBlockBTF").execute(function(e){var g=function(a){var m=a.getState().selected_variations;if(m){var c="",d=a.getState().variation_display_labels;b.each(e.visualDimensions,function(a,b){a=1===e.gIsNewTwister?b:d[b];m[a]&&(c+=" "+m[a])});return c&&c.substring(1)}},f=e.defaultColor,c=f,d=e.landingAsinColor,l,h=b("#miniATF_image");0<h.length&&(l=h.attr("src"));q.updateMiniATFDiv=function(){t=0;var a=b("#miniATF_image");0<a.length&&l&&a.attr("src",l)};a.on("image-block-twister-swatch-click",
function(a,b,h,k){t=1;a=(a=k?k:g(b))&&""!==a?a:f;a===d&&(a=f);a!==c&&(l=(b=a!==f&&a!==d?e:n)&&b.colorImages&&b.colorImages[a]&&0<b.colorImages[a].length&&b.colorImages[a][0]?b.colorImages[a][0].large:null,c=a)})});return q}});"use strict";g.when("ueCount","jQuery").execute(function(a,b){b("#miniATF_BackToTopLink").click(function(){a.incrementCounterByOne("sl_back_to_top_button_click_count")})});"use strict";g.when("jQuery","dp-util-cookie","cf").execute(function(a,b){"000-0000000-8675309"===a("#addToCart").find('input[name\x3d"session-id"]').val()&&
a("#addToCart").find('input[name\x3d"session-id"]').val(b("session-id"))})});
/* ******** */
(function(e){var g=window.AmazonUIPageJS||window.P,q=g._namespace||g.attributeErrors,a=q?q("DetailPageCommonScripts",""):g;a.guardFatal?a.guardFatal(e)(a,window):a.execute(function(){e(a,window)})})(function(e,g,q){e.when("A","jQuery").register("jumpLink",function(a,b){return{bind:function(a,f,d,u){try{f=f||1E3,d=d||0,b("body").delegate(a,"click",function(c){try{var e=b(a);if(e.get(0)){var h=e.attr("href");h&&"#"===h.charAt(0)&&(h=u&&0===b(h).length?"[name\x3d'"+h.substring(1)+"']":h,0!==b(h).length&&
(c.preventDefault(),b("html, body").animate({scrollTop:b(h).offset().top-d},f)))}}catch(m){g.ueLogError&&g.ueLogError(m,{logLevel:"FATAL",attribution:"jumpLink",message:"[JumpLink - Error in executing click handler]"})}})}catch(k){g.ueLogError&&g.ueLogError(k,{logLevel:"FATAL",attribution:"jumpLink",message:"[JumpLink - Error in binding click handler]"})}}}});"use strict";e.when("A").execute(function(a){a.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(a){a.on("dpLogFatalsEvent",function(a,c,f){g.ueLogError&&g.ueLogError({message:a},{logLevel:c,attribution:f})})});"use strict";e.register("dp-client-counter",function(){var a=function(){};g.ue&&g.ue.count&&"function"===typeof g.ue.count&&(a=g.ue.count);return{set:function(b,c){"undefined"!==typeof c&&a(b,c)},get:function(b){return a(b)},inc:function(b){a(b,(a(b)||0)+1)}}});"use strict";e.when("dp-client-counter").register("dp-click-counter",
function(a){return{record:function(b,c){b&&b.addEventListener("click",function(){a.inc(c+"-clicked")})}}});"use strict";e.when("A").register("cache",function(a){function b(){this.data={}}function c(b){var f=b;if("object"===typeof b){var c="";f="";a.each(b,function(a,b){f+=c+b+"\x3d"+a;c="\x26"})}return f}b.prototype={put:function(a,b){a=c(a);this.data[a]=b},get:function(a){a=c(a);return this.data[a]},exists:function(a){return c(a)in this.data}};return b});"use strict";e.register("dp-util-cookie",
function(){return function(a){a+="\x3d";for(var b=decodeURIComponent(document.cookie).split(";"),c=0;c<b.length;c++){var f=b[c];f=f.replace(/^\s+/,"");if(0===f.indexOf(a))return f.substring(a.length,f.length)}return""}});e.when("jQuery").register("quanityChangePriceUpdate",function(a){return{ajaxCall:function(a){}}});"use strict";e.when("A","jQuery","a-popover","a-dropdown","ready").register("moq-core",function(a,b,c,f){function d(a){return 0<a.length&&0<a.find("div[data-name\x3d'quantity.improvedMOQ']").length}
function e(){return b(n.join(", "))}function k(a){return"locked"===a.find("div[data-name\x3d'quantity.improvedMOQ']").attr("moq-lock")}function g(){return(b(h.join(", ")).length?h:b(m.join(", ")).length?m:b(t.join(", ")).length?t:["#buybox"]).map(function(a){return b(a)}).filter(d)}var h=["div[id^\x3dnewAccordionRow]","#snsAccordionRowMiddle","#snsAccordionRowMobileMiddle","#snsAccordionRowMobileAppMiddle"],m=["#oneTimeBuyBox","#snsBuyBox"],t=["#toggleBuyBox \x3e #sns","#toggleBuyBox \x3e #onetime"],
n=["#snsBuyBox","#toggleBuyBox \x3e #sns","#snsAccordionRowMiddle","#snsAccordionRowMobileMiddle","#snsAccordionRowMobileAppMiddle"],p="#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=e();return k(a)},isLocked:k,getSnsSubscriptionContainer:e,offerContainerHasMoq:d,findMoqOfferContainers:g,findMoqOfferContainerWithDomElement:function(a){var b=
g().filter(function(b){return b[0].contains(a)});return 0===b.length?null:b[0]},tweakDisplayTextForMoqQuantityDropdown:function(a){var b=f.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(a,c,f){var d=a.find(p.join(", ")),e=a.find("div[data-name\x3d'quantity.improvedMOQ']");d.each(function(){"hidden"!==b(this).prop("type")&&(this.hasAttribute("moq-original-button-type")||
b(this).attr("moq-original-button-type",b(this).prop("type")),e.attr("moq-lock","locked"),b(this).prop("type","button"),b(this).bind("click.moq",c),"function"===typeof f&&f(b(this)))})},unlockSubmission:function(a,c){var f=a.find(p.join(", ")),d=a.find("div[data-name\x3d'quantity.improvedMOQ']");f.each(function(){"button"===b(this).prop("type")&&(d.attr("moq-lock","unlocked"),b(this).prop("type",b(this).attr("moq-original-button-type")),b(this).unbind("click.moq"),"function"===typeof c&&c(b(this)))})}}});
"use strict";e.when("A","dp-pre-atc-monitor").execute("dp-pre-atc-execution",function(a,b){a.declarative("dp-pre-atc-declarative","click",function(c){var f=b.getInstance();a.$.isEmptyObject(f.preAddToCartHeroFunctionRegister.heroFunctionMap)||a.$.isEmptyObject(f.getHeroName())||f.triggerHeroFunction(c)})});"use strict";e.when("A","ready").register("dp-pre-atc-hero-candidates",function(a){var b=a.state("dp-pre-atc-hero")===q?"":a.state("dp-pre-atc-hero").heroName;return{getHeroName:function(){return b},
setHeroName:function(a){a&&(b=a)},hasHeroName:function(){return!a.$.isEmptyObject(b)},getHeroCandidates:a.state("dp-pre-atc-hero-candidates")===q?[]:a.state("dp-pre-atc-hero-candidates")}});"use strict";e.when("A").register("dp-pre-atc-hero-function-register",function(a){function b(){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 b);return c}}});"use strict";e.when("A","dp-pre-atc-hero-candidates","dp-pre-atc-hero-function-register").register("dp-pre-atc-monitor",function(a,b,c){function f(a,b){this.preAddToCartHeroCandidates=a;this.preAddToCartHeroFunctionRegister=b;this.logAttribution="dp_pre_atc_monitor"}f.prototype={getHeroName:function(){return this.preAddToCartHeroCandidates.getHeroName()},updateHero:function(b){b?-1<this.preAddToCartHeroCandidates.getHeroCandidates.indexOf(b)?
(this.preAddToCartHeroCandidates.setHeroName(b),a.state.replace("dp-pre-atc-hero",null),b=g.ue,"undefined"!==typeof b&&"undefined"!==typeof b.count&&b.count("dpOffers:preatc:updateHero",(b.count("dpOffers:preatc:updateHero")||0)+1)):a.trigger("dpLogFatalsEvent","PRE-ATC-ERROR-MONITOR-1 Failed to update Hero to "+b+" as it is not registered on DPX side.","ERROR",this.logAttribution):a.trigger("dpLogFatalsEvent","PRE-ATC-ERROR-MONITOR-2 Empty Hero name, Hero has been deleted.","WARN",this.logAttribution)},
triggerHeroFunction:function(b){if(!a.$.isEmptyObject(this.preAddToCartHeroFunctionRegister.heroFunctionMap)&&this.preAddToCartHeroCandidates.hasHeroName()){var c=this.getHeroName();try{this.preAddToCartHeroFunctionRegister.heroFunctionMap[c](b)}catch(v){a.trigger("dpLogFatalsEvent","PRE-ATC-ERROR-MONITOR-3 PreAddToCartMonitor could not find Hero's function.","ERROR",this.logAttribution)}}else a.trigger("dpLogFatalsEvent","PRE-ATC-ERROR-MONITOR-4 PreAddToCartMonitor tried to trigger Hero function when Hero does not exist.",
"ERROR",this.logAttribution)}};f.prototype.constructor=f;var d;return{getInstance:function(){d||(d=new f(b,c.getInstance()));return d}}});"use strict";e.when("dp-accordion-click-counter").execute("gsbb-accordion-click-counter-desktop",function(a){a.recordAccordionClick("gsbb","desktop")});"use strict";e.when("dp-button-click-counter").execute("gsbb-button-click-counter-desktop",function(a){a.recordButtonClick("desktop_buybox","gsbb","desktop")});"use strict";e.when("A","dp-client-counter","dp-get-buybox-element-ids",
"ready").register("dp-accordion-click-counter",function(a,b,c){return{recordAccordionClick:function(c,d){var f=c+":"+d+":";a.on("a:accordion:buybox-accordion:select",function(a){b.inc(f+a.selectedRow.rowName+":click")})}}});"use strict";e.when("A","dp-client-counter","dp-get-buybox-element-ids","ready").register("dp-button-click-counter",function(a,b,c){var f=a.$;return{recordButtonClick:function(a,e,g){(a=c.getAccordionRowIds(a))&&a.length&&a.forEach(function(a){var d=c.getButtonIds(a);d&&d.length&&
d.forEach(function(c){var d=e+":"+g+":"+a+":"+c+":click";f("#"+c).click(function(){b.inc(d)})})})},recordSingleOfferButtonClick:function(a,e,g){if(a){var d=c.getButtonIds(a);d&&d.length&&d.forEach(function(c){var d=e+":"+g+":"+a+":"+c+":click";f("#"+c).click(function(){b.inc(d)})})}}}});"use strict";e.when("A","ready").register("dp-get-buybox-element-ids",function(a){function b(a){return c(a).length?c(a).map(function(){return this.id}).get():[]}var c=a.$;return{getAccordionRowIds:function(a){return b("#"+
a+" [data-a-accordion-row-name]")},getButtonIds:function(a){return b("#"+a+" .a-button-input")}}});"use strict";e.when("A","ready").register("dp-get-offerDisplay-container",function(a){var b=a.$;return{getOfferDisplayContainerByElement:function(a){var c=["#buyBoxAccordion [data-a-accordion-row-name]","[id^\x3dgsod_singleOfferDisplay]","[id^\x3dtab_][id*\x3d_buybox_group_]","#buybox"],d=b("body");a&&a.closest&&(d=a.closest(c.join(",")));return d.length?d:b("body")}}});"use strict";e.register("dp-csm-metrics",
function(){return{updateCount:function(a){var b=g.ue;b&&b.count&&"string"===typeof a&&b.count(a,(b.count(a)||0)+1)},startLatencyTime:function(a){"function"===typeof uet&&"string"===typeof a&&uet("bb",a,{wb:1})},recordLatencyTime:function(a){"function"===typeof uex&&"string"===typeof a&&uex("ld",a,{wb:1})}}});"use strict";e.register("add-to-cart-constants",function(){return{PREFIX:"items",ITEM_TYPES:{BASE:"base"},PARAMETER_PATHS:{ASIN:["asin"],OFFER_LISTING_ID:["offerListingId"],QUANTITY:["quantity"],
GIFTOPTIONS:["additionalParameters","giftOptions","includeGiftReceipt"],DEVICEPREREGISTRATION:["additionalParameters","devicePreregistration","selected"]},CLIENT_NAME:"clientName",CSRF_TOKEN:"anti-csrftoken-a2z"}});"use strict";e.when("A","add-to-cart-constants").register("add-to-cart-parameter-name",function(a,b){return{constructParameterName:function(c,f,d){if("string"===typeof c&&"number"===typeof f&&0<=f&&Array.isArray(d)){var e=b.PREFIX;e+="["+(f+"."+c)+"]";d.forEach(function(a){e+="["+a+"]"});
return e}a.trigger("dpLogFatalsEvent","[Invalid parameters used to construct add to cart parameter]","WARN","addtocart_construct_parameter_error")}}});"use strict";e.when("add-to-cart-constants").register("offersx-csrf-utils",function(a){function b(b){var c="input[name\x3d'"+a.CSRF_TOKEN+"']";return(c=b?c+"[id\x3d'"+b+"']":c)?(b=document.querySelector(c))?b.value:"":""}function c(b,c){c instanceof Object||(c={});b&&""!==b&&(c[a.CSRF_TOKEN]=b);return c}return{getCSRFToken:b,setCSRFHeader:c,setCSRFHeaderFromId:function(a,
d){a=b(a);return c(a,d)}}});"use strict";e.when("A","hdp-invite-button-ajax-handler","atf").execute("hdp-invite-button-action-handler",function(a,b){a.declarative("invite-button","click",function(a){a.$event.preventDefault();b.hdpInviteButtonAjaxHandle(a.data,a.action)});a.declarative("request-invite","click",function(a){a.$event.preventDefault();b.hdpInviteButtonAjaxHandle(a.data,a.action)});a.declarative("notify-details","click",function(a){a.$event.preventDefault();b.hdpInviteButtonAjaxHandle(a.data,
a.action)})});"use strict";e.when("A","dp-client-counter","hdp-ajax-success-dialog-handler","a-button","atf").register("hdp-invite-button-ajax-handler",function(a,b,c,e){var d=a.$,f,k,q;c.initialize();return{hdpInviteButtonAjaxHandle:function(c,m){c=d("#hdp-ib-ajax-endpoint");var h=d("#hdp-ib-csrf-token"),n=d("#hdp-ib-signedIn"),p=d("#hdp-sign-in-url"),r=d("#hdp-language"),l=d("#hdp-ib-post-click-display-string");p=p?p.val():"/gp/sign-in.html";n=n?"true"===n.val():!1;r=r?r.val():"en_US";"notify-details"===
m?(f="iod:prime:signup:details:click",k="notify-program-details"):(f="hdp:request:invitation:click",k="request-invite");q=l?l.val():"Details emailed";if(n&&c&&h){c.val()&&(l=c.val().split("/"))&&4<l.length&&b.inc(f+":"+l[l.length-1]);b.inc(f);h={"Accept-Language":r,Accept:'application/vnd.com.amazon.api+json; type\x3d"aapi.highdemandproductcontracts.'+k+'/v1"',"x-api-csrf-token":h.val()};if(l=document.querySelector('meta[name\x3d"encrypted-slate-token"]'))h["x-amzn-encrypted-slate-token"]=l.content;
d.ajax({url:"https://"+c.val(),type:"POST",contentType:'application/vnd.com.amazon.api+json; type\x3d"aapi.highdemandproductcontracts.'+k+'.request/v1"',headers:h,data:JSON.stringify({}),xhrFields:{withCredentials:!0},timeout:1E4,success:function(b){if("request-invite"===m||"invite-button"===m){b=d("#shippingMessageInsideBuyBox_feature_div");var c=d("#availabilityInsideBuyBox_feature_div"),f=d("#tabular_feature_div"),g=d("#hdp-detail-no-requested-id"),h=d("#hdp-invite-button"),k=d("#hdp-detail-expired-id"),
l=d("#hdp-detail-requested-id"),n=d("#iod-request-invite-success-message-trigger"),p=d("#hdpInviteButton_feature_div").attr("data-csa-c-asin");"invite-button"===m&&f&&f.hide();b&&b.hide();c&&c.hide();g&&g.hide();h&&h.hide();k&&k.hide();l&&l.removeClass("aok-hidden");n.length&&n.click();a.trigger("updateCustomPageRefreshParams",p,"hdpCustomerAction","requestInvite")}else"notify-details"===m&&(b=d("#hdpInviteButton_feature_div").attr("data-csa-c-asin"),c=e("#hdp-invite-button"),c.isEmpty()||(c.disable().text(q),
a.trigger("updateCustomPageRefreshParams",b,"hdpCustomerAction","notifyDetails")))},error:function(){a.trigger("dpLogFatalsEvent","HDP Invite Button Ajax call failed","ERROR","HDPAjaxFailure");var b=d("#hdp-ajax-failure-modal");b&&b.click()}})}else n?a.trigger("dpLogFatalsEvent","HDP Invite Button Ajax data is missing","ERROR","HDPAjaxFailure"):g.location.href=p}}});"use strict";e.when("dp-button-click-counter").execute("hdp-button-click-counter-desktop",function(a){a.recordSingleOfferButtonClick("hdp_buybox_desktop",
"hdp","desktop")});e.when("A","a-modal").register("hdp-ajax-success-dialog-handler",function(a,b){return{initialize:function(){var b=this;a.declarative("close-iod-request-invite-success-dialog","click",function(){b.hide()})},hide:function(){var a=b.get("iodRequestInviteSuccessMessageModal");a&&a.hide()}}})});
/* ******** */
(function(n){var l=window.AmazonUIPageJS||window.P,p=l._namespace||l.attributeErrors,g=p?p("DetailPageLatencyAssets",""):l;g.guardFatal?g.guardFatal(n)(g,window):g.execute(function(){n(g,window)})})(function(n,l,p){n.when("dp-interactive-feature-component-base","dp-click-to-ci-utils","A").register("dp-interactive-feature",function(g,d,a){function e(a,f){this.name=a;this._baseComponents={};this.getComponent("default",f)}function m(a){return k.isPlainObject(a)&&a.hasComponents&&k.isArray(a.components)}
var k=a.$;e.prototype={getTimeToInteractivity:function(h,f){h=h||{};var c,b,e=0,g=!1,l=[];m(h)?(a.each(h.components,function(a){k.isPlainObject(a)&&d.isValidNonEmptyString(a.name)&&(c=this.getComponent(a.name,f),(b=c.getTimeToInteractivity(f,a.events))&&b.interactive?b.interactiveTime>e&&(e=b.interactiveTime):l.push(a.name))},this),l.length||(g=!0)):(b=this.getComponent("default",f).getTimeToInteractivity(f,h.events),g=b.interactive,e=b.interactiveTime);return{interactive:g,interactiveTime:g?e:0}},
getComponent:function(a,f){a=a.toLowerCase();this._baseComponents[a]||(this._baseComponents[a]=new g(a,f));return this._baseComponents[a]},updateFeatureInformation:function(h,f){var c={timestamp:h.timestamp,type:h.type,options:{}},b=!1;m(h.options)?a.each(h.options.components,function(a){k.isPlainObject(a)&&d.isValidNonEmptyString(a.name)&&(c.options=a,a=this.getComponent(a.name,f).updateComponentInformation(c,f),b=b||a)},this):(c.options=h.options||{},b=this.getComponent("default",f).updateComponentInformation(c,
f));return b},updateRenderTime:function(h,f,c){h=h||{};var b;m(h)?a.each(h.components,function(a){k.isPlainObject(a)&&d.isValidNonEmptyString(a.name)&&(b=this.getComponent(a.name))&&c&&b.updateRenderTime(c,f)},this):this.getComponent("default",c).updateRenderTime(c,f)},resetFeatureInfo:function(h,f){h=h||{};var c;m(h)?a.each(h.components,function(b){k.isPlainObject(b)&&d.isValidNonEmptyString(b.name)&&(c=this.getComponent(b.name))&&f&&c.resetComponentInfo(f)},this):this.getComponent("default",f).resetComponentInfo(f)}};
return e});n.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(g,d,a,e,m,k){var h=g.$;return{_features:{},criticalFeatures:{},_clickToCI:{},pageType:"glance",getTimeToInteractivity:function(a,c){a=a||{};var b={features:a,longPoleFeatureName:"",interactiveTime:0,allFeaturesInteractive:!1,nonInteractiveFeatures:[]},e=[];h.isPlainObject(a)&&!h.isEmptyObject(a)&&(g.each(a,function(c,a){a=a.toLowerCase();
var f=this._features[a];f?(f=f.getTimeToInteractivity(c,this.pageType),f.interactive?(c.interactiveTime=f.interactiveTime,f.interactiveTime>b.interactiveTime&&(b.interactiveTime=f.interactiveTime,b.longPoleFeatureName=a)):e.push(a)):e.push(a)},this),e.length||(b.allFeaturesInteractive=!0),b.nonInteractiveFeatures=e);return b},updateFeatures:function(a){a=a||[];var c=!1;h.isArray(a)&&(g.each(a,function(b){var a=!1;h.isPlainObject(b)&&k.isValidNonEmptyString(b.name)&&b.timestamp&&(a=this.getFeatureObject(b.name).updateFeatureInformation(b,
this.pageType));c=c||a},this),this._getClickToCIObj(this.pageType).getMetricInfo().allFeaturesInteractive||this.updateMetricInfo());return c},getFeatureObject:function(a){a=a.toLowerCase();this._features[a]||(this._features[a]=new d(a,this.pageType));return this._features[a]},updateRenderTime:function(a){if(a&&"twisterupdate"===this.pageType){var c=this.getCriticalFeatureObj().getCriticalFeaturesPromise(),b=this._getClickToCIObj(this.pageType).getMetricInfo(),e=this;c&&c.then(function(c){h.isPlainObject(c)&&
!h.isEmptyObject(c)&&g.each(c,function(c,b){b=b.toLowerCase();(b=e._features[b])&&b.updateRenderTime(c,a,e.pageType)},this);b.allFeaturesInteractive||e.updateMetricInfo(!0)})}},updatePage:function(f){if(f){var c=this.pageType;this.pageType=f.toLowerCase();var b=this.getCriticalFeatureObj().getCriticalFeatures();k.logCounter("ClickToCITwisterUpdateTotalCount");b&&this._clickToCI[c]&&!this._clickToCI[c].isResolved()&&this._clickToCI[c].reject(Error("ClicktoCI not available "));this._resetFeatureInfo(b,
f);this._clickToCI[this.pageType]=new a;this.criticalFeatures=new e;"twisterupdate"===this.pageType&&this.criticalFeatures.setIgnoreCriticalFeatures("twister")}},_resetFeatureInfo:function(a,c){c=c.toLowerCase();a=a||{};h.isPlainObject(a)&&!h.isEmptyObject(a)&&g.each(a,function(a,f){f=f.toLowerCase();(f=this._features[f])&&f.resetFeatureInfo(a,c)},this)},_getClickToCIObj:function(f){f=f.toLowerCase();this._clickToCI[f]||(this._clickToCI[f]=new a);return this._clickToCI[f]},getCriticalFeatureObj:function(){h.isEmptyObject(this.criticalFeatures)&&
(this.criticalFeatures=new e);return this.criticalFeatures},updateMetricInfo:function(a){var c=this._getClickToCIObj(this.pageType),b=this,e=this.getCriticalFeatureObj();e.getCriticalFeaturesPromise().then(function(h){e.isCriticalFeaturesKnown&&!c.getMetricInfo().allFeaturesInteractive&&c.setMetricInfo(b.getTimeToInteractivity(h,b.pageType));c.getMetricInfo().allFeaturesInteractive&&b._clickToCI[b.pageType]&&!b._clickToCI[b.pageType].isResolved()?(b._clickToCI[b.pageType].resolve(c.getMetricInfo()),
b._clickToCI[b.pageType].setResolved(!0),a&&k.logCounter("ClickToCITwisterUpdateSuccessCount"),n.now("dp-critical-features-interactive-marker").execute(function(a){a||n.register("dp-critical-features-interactive-marker",function(){return c.getMetricInfo().allFeaturesInteractive})})):a&&!c.getMetricInfo().allFeaturesInteractive&&k.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()}}});n.when("A").register("dp-interactive-feature-component",function(g){function d(a){if(a instanceof d){var m={};this._renderTime=0;this._isInteractive=a._isInteractive;g.each(a._events,function(a){a.alwaysInteractive&&(m[a.name]={name:a.name,interactiveTime:a.interactiveTime,alwaysInteractive:!0})},this);this._events=m}else this._renderTime=0,this._isInteractive=!0,this._events=
{}}var a=g.$;d.prototype={updateComponentInformation:function(e){var d=!1;if(a.isPlainObject(e))switch(e.type){case "render":d=this._updateRenderInformation(e);break;case "interactive":d=this._updateInteractiveInformation(e)}return d},_updateRenderInformation:function(a){var d=!1,g=a.options||{};this._renderTime||(this._renderTime=a.timestamp,this._isInteractive=g.isInteractive===p?!0:g.isInteractive,d=!0);return d},_updateInteractiveInformation:function(a){var d;d=a.options||{};var k=d.alwaysInteractive||
!1,h=!1;this._isInteractive&&(d=d.events||["click"],g.each(d,function(f){this._events[f]||(this._events[f]={name:f,interactiveTime:a.timestamp,alwaysInteractive:k},h=!0)},this));return h},getTimeToInteractivity:function(e){var d=0,k=!1,h=[];this.isRendered()&&(this._isInteractive?(a.isArray(e)||(e=["click"]),g.each(e,function(a){var c=this._events[a];c?c.interactiveTime>d&&(d=c.interactiveTime):h.push(a)},this),h.length||(k=!0,this._renderTime>d&&(d=this._renderTime))):(k=!0,d=this._renderTime));
return{interactive:k,interactiveTime:k?d:0}},isRendered:function(){return!!this._renderTime},updateRenderTime:function(a){a&&!this.isRendered()&&(this._renderTime=a);return this._renderTime}};return d});n.when("dp-time-to-interactive").register("dp-interactive-page-refresh-handler",function(g){return{twisterStartTime:null,createInteractivityObjectForTwisterUpdate:function(){this.twisterStartTime=l.parseInt((new Date).getTime());g.updatePage("twisterUpdate")},updateCriticalFeatures:function(){g.updateCriticalFeatures()},
updateRenderTime:function(){g.updateRenderTime(this.twisterStartTime)},getClickToCIMetric:function(){return g.getClickToCIPromise("twisterUpdate")}}});n.when("dp-interactive-feature-component").register("dp-interactive-feature-component-base",function(g){function d(a,d){this.compName=a;this._pageType={};this.getComponentByPageType(d)}d.prototype={getComponentByPageType:function(a){if(a)return this._pageType[a]||(this._pageType[a]=this.getComponent(a)),this._pageType[a]},updateComponentInformation:function(a,
d){return this.getComponentByPageType(d).updateComponentInformation(a)},getTimeToInteractivity:function(a,d){return a?this.getComponentByPageType(a).getTimeToInteractivity(d):{interactive:!1,interactiveTime:0}},resetComponentInfo:function(a){a&&this._pageType[a]&&(this._pageType[a]=this.getComponent(a))},updateRenderTime:function(a,d){return this.getComponentByPageType(a).updateRenderTime(d)},getComponent:function(a){return this._pageType[a]?new g(this._pageType[a]):this._pageType.glance?new g(this._pageType.glance):
new g}};return d});n.when("3p-promise").register("dp-click-to-ci",function(g){function d(){this.reject=this.resolve=null;this.resolved=!1;var a=this;this.promiseObject=new g(function(d,g){a.resolve=d;a.reject=g});this.metricInfo={features:{},longPoleFeatureName:"",interactiveTime:0,allFeaturesInteractive:!1}}d.prototype={getMetricInfo:function(){return this.metricInfo},setMetricInfo:function(a){this.metricInfo=a},getPromiseObject:function(){return this.promiseObject},isResolved:function(){return this.resolved},
setResolved:function(a){this.resolved=a}};return d});n.when("A","dp-time-to-interactive","dp-click-to-ci-utils").register("dp-clicktoci-metric-for-glanceview",function(g,d,a){function e(){var c=d.getClickToCIPromise("GLANCE");c&&c.then(function(a){k(a.features);h(a.features);m(a)}).catch(function(c){a.logCounter("ClickToCIFailureCount")})}function m(c){a.addTag("DPCIFLongPole"+c.longPoleFeatureName);a.widgetTime("cf","clickToCI",{wb:1},c.interactiveTime);a.widgetTime("fn",p,p,c.interactiveTime);a.postCSMMetrics("ld",
"clickToCI",{wb:1});l.ue&&ue.isl&&a.postCSMMetrics("at")}function k(c){f.isPlainObject(c.atc)?(c=c.atc,a.addTag("DPCIFBuyable"),a.widgetTime("cf","dpATCTTI",{wb:1},c.interactiveTime),a.postCSMMetrics("ld","dpATCTTI",{wb:1}),c.hasComponents&&f.isArray(c.components)&&(c=c.components[0],f.isPlainObject(c)&&a.isValidNonEmptyString(c.name)&&a.addTag("DPCIFBuyable-"+c.name))):a.addTag("DPCIFNonBuyable")}function h(c){if(f.isPlainObject(c)){var b=l.performance;"object"===typeof b&&"object"===typeof b.timing&&
g.each(c,function(c,f){var d="DP"+f+"TTI";a.logCounter("DPCF"+f+"TTI",c.interactiveTime-b.timing.navigationStart);a.widgetTime("cf",d,{wb:1},c.interactiveTime);a.postCSMMetrics("ld",d,{wb:1})})}}var f=g.$;a.widgetTime("bb","dpATCTTI",{wb:1});e();n.when("atf").execute("dp-get-critical-interactive-features",function(){d.updateCriticalFeatures()});return{markClickToCI:e,publishTTIOfCriticalFeatures:h,tagBuyablibity:k,publishTimeToInteractive:m}});n.when("A").register("dp-click-to-ci-utils",function(g){return{widgetTime:function(d,
a,e,g){"function"===typeof uet&&uet(d,a,e,g)},addTag:function(d){l.ue&&l.ue.tag&&l.ue.tag(d)},logCounter:function(d,a){l.ue&&g.$.isFunction(l.ue.count)&&(a=a||(l.ue.count(d)||0)+1,l.ue.count(d,a))},isValidNonEmptyString:function(d){return"string"===typeof d&&0<d.length},postCSMMetrics:function(d,a,e){"function"===typeof uex&&uex(d,a,e)}}});n.when("A","3p-promise","dp-click-to-ci-utils").register("dp-critical-features",function(g,d,a){function e(){this._resolve;this._reject=null;var a=this;this._promiseObj=
new d(function(f,c){a._resolve=f;a._reject=c});this._features=null;this.isCriticalFeaturesKnown=!1}var m=g.$,k=[];e.prototype={getCriticalFeatures:function(){return this._features},getCriticalFeaturesPromise:function(){return this._promiseObj},setCriticalFeatures:function(a){m.isPlainObject(a)&&!m.isEmptyObject(a)&&(this._features=a,this._resolve(a),this.isCriticalFeaturesKnown=!0)},setIgnoreCriticalFeatures:function(a){k.push(a)},updateCriticalInteractiveFeatures:function(){var d={},f=m(".dp-cif");
f.length?(f.each(function(){var c=(m(this).data()||{}).featureDetails;if(m.isPlainObject(c)&&a.isValidNonEmptyString(c.name)){var b;b=k.length&&k.includes(c.name)?!1:!0;b&&(d[c.name]=c)}else a.logCounter("DPCIFInvalidData")}),this._parseCriticalFeatures(d)):a.addTag("DPCIFNoData")},_parseCriticalFeatures:function(d){var f={};m.isPlainObject(d)?(g.each(d,function(a,b){f[b]={};m.isPlainObject(a)&&(f[b]=a)}),m.isEmptyObject(f)?a.addTag("DPCIFNoData"):this.setCriticalFeatures(f)):a.addTag("DPCIFNoData")},
resetIgnoreCriticalFeatures:function(){k=[]}};return e});n.when("dp-critical-features-interactive-marker").register("dp-latency-marker",function(g){});"use strict";n.when("A","load").execute("logDpAssetInjectionMetric",function(g){var d=g.state("dp_injected_meta_assets");if("undefined"!=typeof performance&&"undefined"!=typeof performance.getEntries){for(var a=0,e=0,m=0,k=0,h=performance.getEntries(),f=0;f<h.length;f++){var c=h[f],b=c.initiatorType;c.name.match(/\.css\?AUIClients\/AmazonUI/g)&&b&&
"link"===b&&c.duration+c.startTime>a+e&&(a=c.duration,e=c.startTime);if("undefined"!=typeof d&&"undefined"!=typeof d.assetNames&&0<d.assetNames.length)for(var q=0;q<d.assetNames.length;q++)if(c.name.match(new RegExp("\\.css\\?AUIClients/"+d.assetNames[q]))&&b&&"link"===b){if(0===m||m>c.startTime)m=c.startTime;k<c.startTime&&(k=c.startTime);break}}l.ue&&g.$.isFunction(l.ue.count)&&(l.ue.count("aui.auiDuration",a),l.ue.count("aui.auiStartTime",e),0!==m&&0!==k&&(l.ue.count("dpcss.dpStartTimeMin",m),
l.ue.count("dpcss.dpStartTimeMax",k),l.ue.count("dpcss.auiDiffMin",m-e),l.ue.count("dpcss.auiDiffMax",k-e)))}});n.when("A","load").execute("dp-asset-metric-logging",function(g){function d(a){l.ue&&ue.tag&&ue.tag(a)}function a(a,d){l.ue&&ue.count&&a&&ue.count(a,d)}function e(d,f,c){0<f&&(a(d+"EncodeSize",Math.round(f/1024)),a(d+"DecodeSize",Math.round(c/1024)))}function m(a,d,c){return g.filter(a,function(a){if(a&&a.initiatorType===c&&a.name&&a.name.match(d))return!0})}function k(d,f,c,b){var e={encodedSize:0,
decodedSize:0,httpProtocol:"",count:0};g.each(f,function(f){var k=m(d,new RegExp("\\."+c+"\\?AUIClients/"+f),b)||[];e.count+=k.length;g.each(k,function(b,g){g=f+(g+1);if(b&&0<b.encodedBodySize){var k;k=b&&0===b.transferSize?!0:void 0;k?a("DP"+c+"Cached"+g,1):a("DP"+c+"NotCached"+g,1)}g=e.encodedSize;k=b&&b.encodedBodySize?b.encodedBodySize:0;e.encodedSize=g+k;g=e.decodedSize;b=b&&b.decodedBodySize?b.decodedBodySize:0;e.decodedSize=g+b;e.httpProtocol=d.nextHopProtocol||""})});return e}(function(){if(l.performance&&
performance.getEntriesByType){var e=performance.getEntriesByType("navigation")[0];e&&(0<e.encodedBodySize&&(a("DPEncodedSize",Math.round(e.encodedBodySize/1024)),a("DPDecodedSize",Math.round(e.decodedBodySize/1024))),e.nextHopProtocol&&d("DPhttpProtocol"+e.nextHopProtocol))}})();(function(){if(l.performance&&performance.getEntries){var h=performance.getEntries(),f=g.state("dp_injected_meta_assets"),c=[];f&&f.assetNames&&(c=f.assetNames||[]);var f=k(h,c,"js","script"),b=k(h,["AmazonUI","AmazonUIjQuery"],
"js","script"),c=k(h,c,"css","link"),h=k(h,["AmazonUI"],"css","link");e("DPJS",f.encodedSize,f.decodedSize);e("AUIJS",b.encodedSize,b.decodedSize);e("DPCSS",c.encodedSize,c.decodedSize);e("AUICSS",h.encodedSize,h.decodedSize);a("DPCSSResourceCount",c.count);a("DPJSResourceCount",f.count);f.httpProtocol&&d("DPJSHttpProtocal"+f.httpProtocol);c.httpProtocol&&d("DPCSSHttpProtocal"+c.httpProtocol)}})()});n.when("A","load").execute("dp-asset-connection-metric-logging",function(g){function d(a){l.ue&&ue.tag&&
ue.tag(a)}(function(){if(l.navigator&&l.navigator.connection){var a=1024*l.navigator.connection.downlink,e=l.navigator.connection.rtt,g=l.navigator.connection.effectiveType;e&&(l.ue&&ue.count&&ue.count("rtt",e),0<=e&&100>e?d("rtt:0_100"):100<=e&&200>=e&&d("rtt:100_200"));a&&(l.ue&&ue.count&&ue.count("downlink",a),0<=a&&5120>a?d("downlink:0_5"):5120<=a&&10240>=a&&d("downlink:5_10"));d("EffectiveConnectionType:"+g)}})()});n.when("A").register("get-resource-time",function(g){return{getResourceTimeByName:function(d,
a){var e=[];l.performance&&performance.getEntries&&d&&g.$.isArray(a)&&0<a.length&&(e=performance.getEntries(),e=g.filter(e,function(e){return e&&e.initiatorType===d?-1<g.indexOfArray(a,e.name):!1}));return e}}});n.when("A","dp-interactivity-metric-utils").execute("dp-non-critical-tti",function(g,d){var a=g.$;(function(){a(".a-container").click(function(a){d.calculateInteractivity(a)})})()});n.when("A").register("dp-log-critical-asset-source-details",function(g){function d(a){l.ue&&ue.tag&&ue.tag(a)}
function a(a){return a&&0<a.encodedBodySize}function e(d,c,b,e){var h=[];g.each(c,function(c){var k=new RegExp("\\."+b+"\\?AUIClients/"+c+"([^a-zA-Z]|$)");c=g.filter(d,function(c){return c&&c.initiatorType===e&&c.name&&c.name.match(k)&&a(c)?!0:!1});h=h.concat(c)});return h}function m(a){for(var c in a){var b=a[c];if(b&&0!==b.transferSize)return!1}return!0}var k=["DPMobileAppCriticalFeatureMetaAsset","DetailPageMobileWebCriticalFeatureAsset","DetailPageDesktopImageBlockMetaAsset"],h=["AmazonUI"];return{logAssetCacheSourceDetails:function(a){var c=
e(a,k,"js","script"),c=c.concat(e(a,k,"js","link"));a=e(a,h,"css","link");var b="";0<c.length&&0<a.length&&(b+="dpcriticaljs_",b=m(c)?b+"cached":b+"not_cached",b+=":auicss_",b=m(a)?b+"cached":b+"not_cached",d(b));return b},checkEncodedBodySize:a,getFilteredResources:e,isResourceCached:m,logTag:d}});n.when("dp-log-critical-asset-source-details","ready").execute("dp-log-critical-asset-source-details_execute",function(g){if(l.performance&&performance.getEntries){var d=performance.getEntries();g.logAssetCacheSourceDetails(d)}});
n.when("A","dp-click-to-ci-utils").register("dp-interactivity-metric-utils",function(g,d){var a=g.$;return{calculateInteractivity:function(e){var g=e.type,k=a(e.target),h=k.closest("div[id$\x3d'_feature_div']");d.logCounter("Total-"+g);h&&((h=a(h).data("feature-name"))?d.logCounter(h+"-"+g):d.logCounter(e.target.id+"-"+g));(e=k.closest(".a-declarative"))&&(e=a(e).data("action"))&&d.logCounter(e+"-"+g+"-dec-action")}}});n.when("A","dp-log-critical-asset-source-details").register("logging-asset-metrics",
function(g,d){function a(a){var b="numCSSAssets_",b=20>=a?b.concat("0-20"):40>=a?b.concat("21-40"):60>=a?b.concat("41-60"):80>=a?b.concat("61-80"):100>=a?b.concat("81-100"):b.concat("\x3e100");d.logTag(b);return b}function e(a){var b="numJSAssets_",b=25>=a?b.concat("0-25"):50>=a?b.concat("26-50"):75>=a?b.concat("51-75"):100>=a?b.concat("76-100"):125>=a?b.concat("101-125"):b.concat("\x3e125");d.logTag(b);return b}function l(a,b){a=a/b*100;b="cachedAssetPercent_";b=10>=a?b.concat("0-10"):20>=a?b.concat("11-20"):
30>=a?b.concat("21-30"):40>=a?b.concat("31-40"):50>=a?b.concat("41-50"):60>=a?b.concat("51-60"):70>=a?b.concat("61-70"):80>=a?b.concat("71-80"):90>=a?b.concat("81-90"):b.concat("91-100");d.logTag(b);return b}function k(a){var b="numImageAssets_",b=20>=a?b.concat("0-20"):40>=a?b.concat("21-40"):60>=a?b.concat("41-60"):80>=a?b.concat("61-80"):100>=a?b.concat("81-100"):b.concat("\x3e100");d.logTag(b);return b}function h(a){a/=1E6;var b="MBsDownloaded_",b=10>=a?b.concat("0-10"):20>=a?b.concat("11-20"):
30>=a?b.concat("21-30"):40>=a?b.concat("31-40"):50>=a?b.concat("41-50"):60>=a?b.concat("51-60"):70>=a?b.concat("61-70"):80>=a?b.concat("71-80"):90>=a?b.concat("81-90"):100>=a?b.concat("91-100"):b.concat("\x3e100");d.logTag(b);return b}function f(a){var b=[],d=[],e=[],f=0,h=0,k=/\.css([^a-zA-Z]|$)/,l=/\.js([^a-zA-Z]|$)/;g.each(a,function(a){a&&(a.transferSize&&(0===a.transferSize&&(f+=1),h+=a.transferSize),a.name&&(a.name.match(l)?d.push(a):a.name.match(k)?e.push(a):-1!==a.name.indexOf(".jpg",a.name.length-
4)&&b.push(a)))});return{imageAssets:b,JSAssets:d,CSSAssets:e,cachedAssets:f,bytesDownloaded:h}}return{classifyAndLog:function(c){var b=f(c),d;d="".concat(e(b.JSAssets.length));d=d.concat(":",a(b.CSSAssets.length));d=d.concat(":",k(b.imageAssets.length));d=d.concat(":",l(b.cachedAssets,c.length));return d=d.concat(":",h(b.bytesDownloaded))},classifyResources:f,logBytesDownloaded:h,logImageAssets:k,logCSSAssets:a,logJSAssets:e,logCachedAssetsPercent:l}});n.when("logging-asset-metrics","ready").execute("logging-asset-metrics-execute",
function(g){if(l.performance&&performance.getEntries){var d=performance.getEntries();g.classifyAndLog(d)}})});
/* ******** */
(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(d){var f=window.AmazonUIPageJS||window.P,k=f._namespace||f.attributeErrors,a=k?k("ListsCommonUtilityAssets",""):f;a.guardFatal?a.guardFatal(d)(a,window):a.execute(function(){d(a,window)})})(function(d,f,k){d.when("A").register("al-ajax-response-state-parser",function(a){var b=a.$;return{getState:function(c){c=b(c).filter("#listsAjaxResponseStateSection");var e=b("#listsAjaxResponseStateSection");e&&0<=e.length&&e.remove();b(c).appendTo("body");a.state.parse();c=a.state("listsAjaxResponseState")||
{};return{hasError:c.hasError,authRequired:c.authRequired,authUrl:c.authUrl,error:c.error}}}});"use strict";d.when("A","al-bottomsheet-with-fallback","iphone-x-detector").register("bottom-sheet-utils",function(a,b,c){var e=a.$;a.declarative("al-sheet-with-fallback","click",function(e){e.$event.preventDefault();var a=e.data;e=b.create(b.buildComponentParams(a.componentName,a.showCloseButton,c.getAdjustedHeightPx(a.bottomsheetHeight),a.popoverHeight,a.popoverWidth,a.headerForPopover,a.viewLabel,a.viewDescription?
a.viewDescription:a.viewLabel,a.paddingForPopover,a.closeMessage),e.$target);b.show(e)});return{raiseBottomsheet:function(b){b=e(b).parents(".a-sheet-web-container");b.css("z-index",1E4);b.siblings(".a-sheet-lightbox").css("z-index",8E3)}}});"use strict";d.when("A").register("al-bottomsheet-with-fallback",function(a){function b(b){f.ueLogError&&f.ueLogError({logLevel:"ERROR",message:b})}var c,e;d.when("a-sheet").execute(function(b){c=b});d.when("a-modal").execute(function(b){e=b});var g=function(a){if(a)return c?
c.get(a.name):e.get(a.name);b("No ComponentParams specified. Please generate componentParams using .create(component)")},n={IS_POPOVER_LABEL:"IS_POPOVER",IS_BOTTOMSHEET_LABEL:"IS_BOTTOMSHEET"};return{create:function(a,p){if(a)return c?c.create(a):e.create(p,a),a;b("No ComponentParams specified. Please generate componentParams using .create(component)")},show:function(a){(a=g(a))?a.show():b("No View Created. Please create a view first by calling .create(component)")},hide:function(a){(a=g(a))?a.hide():
b("No View Created. Please create a view first by calling .create(component)")},changeHeight:function(a,e,d){var l=g(a);l?c?(l.changeHeight({height:e,duration:d}),a.bottomsheetHeight=e):(l.update({height:e}),a.popoverHeight=e):b("No View Found. Please create a view first by calling .create(component)")},remove:function(a){(a=g(a))?a.$container.remove():b("No View Created. Please create a view first by calling .create(component)")},exists:function(a){return g(a)?!0:!1},onCloseExecute:function(e,d,
g){if("function"!==typeof d)b("Expected onCloseFunction to be of type function");else if(e)a.on((c?"a:sheet":"a:popover")+":"+(g?"beforeHide":"afterHide")+":"+e.name,d);else b("No ComponentParams specified. Please generate componentParams using .create(component)")},onOpenExecute:function(e,d,g){if("function"!==typeof d)b("Expected onOpenFunction to be of type function");else if(e)a.on((c?"a:sheet":"a:popover")+":"+(g?"beforeShow":"afterShow")+":"+e.name,d);else b("No ComponentParams specified. Please generate componentParams using .create(component)")},
buildComponentParams:function(a,b,e,d,g,f,u,v,w,x){var l=c!==k,h={viewTypeLabel:l?n.IS_BOTTOMSHEET_LABEL:n.IS_POPOVER_LABEL,name:a};l?(h.closeType=b?"icon":x?"message":k,h.closeMessage=x,h.height=e,h.sheetLabel=u,h.sheetDescription=v,h.preloadDomId=a):(h.closeButton=b,h.height=d,h.width=g,h.dataStrategy="preload",h.header=f,h.hideHeader=f===k,h.padding=w!==k?w:"none",h.popoverLabel=u);return h},VIEW_TYPE_LABELS:n}});"use strict";d.when("A").register("lists-dpx-common-utils",function(a){return{urlParamValue:function(a){for(var b=
f.location.search.substring(1).split("\x26"),e=0;e<b.length;e++){var d=b[e].split("\x3d");if(d[0]===a)return d[1]}}}});"use strict";d.when("A").register("iphone-x-detector",function(){function a(){try{var a=b();c.forEach(function(b){if(-1<a.indexOf(b))return!0})}catch(g){}return!1}function b(){try{a:{for(var a=document.cookie.split(";"),b=0;b<a.length;b++){for(var c=a[b];" "===c.charAt(0);)c=c.substring(1,c.length);if(0===c.indexOf("amzn-app-ctxt\x3d")){var d=c.substring(14,c.length);break a}}d=null}if(d){var f=
d.match(/"v":.*%2C*/);if(f)return f.toString().toLowerCase()}}catch(m){}return""}var c=["iphone10","iphone11"];return{isIphoneX:a,getDeviceType:b,getAdjustedHeightPx:function(b){try{if(b=parseInt(b,10),a())return b+40}catch(g){}return b}}});"use strict";d.when("A","lists-metric-logger").register("amazon-lists-csrf-utils",function(a,b){var c=a.$;return{addCsrfToken:function(a){0!==c('meta[id\x3d"lists-sp-csrf-meta-token"]').length?a["anti-csrftoken-a2z"]=c('meta[id\x3d"lists-sp-csrf-meta-token"]').attr("content"):
0!==c('input[id\x3d"lists-sp-csrf-form-token"]').length?a["anti-csrftoken-a2z"]=c('input[id\x3d"lists-sp-csrf-form-token"]').attr("value"):0!==c('input[id\x3d"lists-sp-csrf-input-token"]').length?a["anti-csrftoken-a2z"]=c('input[id\x3d"lists-sp-csrf-input-token"]').attr("value"):b.incrementMetricCountByOne("Lists:CSRF:UnableToRetrieveToken")},hasCsrfToken:function(a){a=a["anti-csrftoken-a2z"];return""!==a&&a!==k}}});"use strict";d.when("A","lists-metric-logger").register("idea-list-csrf-utils",function(a,
b){var c=a.$;return{addIdeaListCsrfToken:function(a){0!==c('input[id\x3d"creator-sp-csrf-form-token"]').length?a["anti-csrftoken-a2z"]=c('input[id\x3d"creator-sp-csrf-form-token"]').attr("value"):b.incrementMetricCountByOne("Lists:CSRF:UnableToRetrieveToken")}}});"use strict";d.when("A","amazon-lists-csrf-utils").register("lists-ajax-handler",function(a,b){function c(a){b.hasCsrfToken(a)||b.addCsrfToken(a)}function d(a,b){"function"===typeof a?a(b):r("callableFunction passed in is not callable: "+
a)}function g(a,b,c){m(a);c&&m(p(a,c));b&&m(p(a,b));b&&c&&m(p(a,b,c))}function n(a){m("lists_ajax_before_send");a&&m(p("lists_ajax_before_send",a))}function l(a){try{return a.replaceAll("/","_")}catch(v){r("Replace all failed for URL: "+a)}}function p(a,b,c){return[a,b,c].filter(function(a){return""!==a&&a!==k}).join(":")}function m(a){q&&q.count(a,(q.count(a)||0)+1)}function r(a){f.ueLogError(k,{logLevel:"ERROR",attribution:"ListsCommonUtilityAssets::ListsAjaxHandler",message:a})}var t=a.$,q=f.ue;
return{post:function(a){var b=a.headers||[];c(b);var e=l(a.url);n(e);return t.ajax({type:"POST",url:a.url,cache:a.isCached,headers:b,data:a.params,timeout:a.timeout,success:function(b,c){g("lists_ajax_success",e,c);d(a.successCallback,b)},error:function(b,c){g("lists_ajax_error",e,c);d(a.errorCallback)}})},get:function(a){var b=l(a.url);n(b);return t.ajax({type:"GET",url:a.url,headers:a.headers,cache:a.isCached,data:a.params,timeout:a.timeout,success:function(c,e){g("lists_ajax_success",b,e);d(a.successCallback,
c)},error:function(c,e){g("lists_ajax_error",b,e);d(a.errorCallback)}})}}});"use strict";d.when("A").register("lists-mash-overlay-helper",function(){function a(a){return b&&b.dispatchEvent&&"function"===typeof b.dispatchEvent?(b.dispatchEvent({type:a}),!0):!1}var b;d.when("mash").execute("amazon-lists-mash-api-registration",function(a){b=a});return{hideGLOWOverlay:function(){return a("appOverlays.Hide")},showGLOWOverlay:function(){return a("appOverlays.Show")}}});"use strict";d.when("A").register("al-client-side-widget-latency-helper",
function(){var a={wb:1};return{emitFeatureBegin:function(b){b&&"function"==typeof f.uet&&f.uet("bb",b,a)},emitFeatureLoaded:function(b){b&&"function"==typeof f.uet&&f.uet("cf",b,a);b&&"function"==typeof f.uex&&f.uex("ld",b,a)}}});"use strict";d.when("A").register("lists-update-cart-count",function(a){return{updateCartCount:function(a){d.when("mash").execute(function(b){b.cart.didUpdate({newCartQuantity:a,successCallback:function(){f.amazon.cordova.notification.vibrate(50)},failCallback:null})});d.when("nav.setCartCount").execute(function(b){b(a)})}}});
"use strict";d.register("lists-metric-logger",function(){return{incrementMetricCountByOne:function(a){var b=f.ue;b&&b.count(a,(b.count(a)||0)+1)}}})});
/* ******** */
(function(l){var k=window.AmazonUIPageJS||window.P,n=k._namespace||k.attributeErrors,e=n?n("ListsCreateAssets",""):k;e.guardFatal?e.guardFatal(l)(e,window):e.execute(function(){l(e,window)})})(function(l,k,n){l.when("A","al-bottomsheet-with-fallback","al-ajax-response-state-parser","create-new-list-hz","bottom-sheet-utils","lists-dpx-common-utils","lists-mash-overlay-helper").execute(function(e,d,r,q,C,x,z){function t(a){var c=a.data||{};"HEARTS_V2_SELECT_HEARTING_BOTTOMSHEET"===h()&&u&&f&&d.remove(f);
f=d.create(d.buildComponentParams(c.componentName,!0,v,430,400,n,c.viewName,c.viewDescription,n,c.closeMessage),a.$target);z.hideGLOWOverlay();d.show(f);"DETAIL_PAGE"===h()&&w&&(d.onOpenExecute(f,g),d.onCloseExecute(f,function(){z.showGLOWOverlay()},!1))}function g(){C.raiseBottomsheet("#create-list-form-wrapper");d.changeHeight(f,v,0)}function D(a){var c=k.ue?k.ue.rid:n;a={createIngressName:a.ingressName,isHearts:!1,sourceVendorId:a.sourceVendorId};c&&(a.relatedRequestID=c);"HEARTS_V2_SELECT_HEARTING_BOTTOMSHEET"===
h()&&u&&(a.isHearts=!0);m.ajax({type:"GET",url:"/hz/wishlist/create",data:a,success:E,error:function(a,c,b){A("Failed to fetch CreateList-Form. Status: "+c+"; Error: "+b)},timeout:2E4})}function E(a){var c=m(a).filter("#createlist-form-container");a=r.getState(a);a.authRequired&&a.authUrl?k.location.href=a.authUrl:a.hasError?A("CreateList form has error \x3d "+a.error):(c.find("#bottomSheetSize").length&&(v=c.find("#bottomSheetSize").val(),d.changeHeight(f,v,0)),m("#create-list-form-wrapper").html(c),
b("#create-list-form-spinner"),B("#create-list-form-wrapper"))}function b(a){m(a).addClass("aok-hidden")}function B(a){m(a).removeClass("aok-hidden")}function A(a){d.changeHeight(f,110);b("#create-list-form-spinner");b("#create-list-form-wrapper");B("#createlist-form-loading-error-section");k.ueLogError&&k.ueLogError({logLevel:"FATAL",message:a});if("DETAIL_PAGE"!==h()||!w)d.onCloseExecute(f,H,!1)}function H(){b("#createlist-form-loading-error-section");b("#create-list-form-wrapper");B("#create-list-form-spinner");
k.location.reload()}function I(a,c,b){A("List creation failed. Status: "+c+"; Error: "+b)}function p(a){a.hasError?A("List creation failed with Error: "+a.error):"YOUR_STUFF_LISTS_CAROUSEL"===h()&&F?(d.onCloseExecute(f,function(){F.bufferReloadOnBackNavigation();k.location="/hz/wishlist/ls/"+a.listExternalId},!1),d.hide(f)):(d.hide(f),k.location="/hz/wishlist/ls/"+a.listExternalId)}function h(){return(e.state("createListIngressState")||{}).ingressName}function y(){m("#createlist-list-name-textinput").parent("div").addClass("a-form-error");
m("#mobile-alert-list-name").removeClass("aok-hidden");m("#createlist-list-name-textinput").attr("aria-describedby","mobile-alert-list-name").attr("aria-invalid",!0).focus()}function G(){m("#createlist-list-name-textinput").parent("div").removeClass("a-form-error");m("#mobile-alert-list-name").addClass("aok-hidden");m("#createlist-list-name-textinput").removeAttr("aria-describedby").removeAttr("aria-invalid")}var m=e.$,v=380,w,u,F,f;e.declarative("awl-create-list-bottomsheet","click",function(a){var c=
a.data||{};e.state("createListIngressState",{ingressName:c.ingressName});var b=c.componentName;b&&"function"==typeof uet&&uet("bb",b,{wb:1});t(a);D(c);(a=c.componentName)&&"function"==typeof uet&&uet("cf",a,{wb:1});a&&"function"==typeof uex&&uex("ld",a,{wb:1})});e.declarative("list-name-toggle","click",function(a){if("input"===a.targetTag){var c=m("span[data-action\x3dcreate-list-bottomsheet-submit]")[0],b=JSON.parse(c.getAttribute("data-create-list-bottomsheet-submit")),d=document.getElementById("createlist-list-name-textinput");
b.persistence=a.data.persistence;c.setAttribute("data-create-list-bottomsheet-submit",JSON.stringify(b));d.value=a.data.name}});e.declarative("create-list-bottomsheet-submit","click",function(a){a=a.data||{};var c=k.ue?k.ue.rid:n;c&&(a.relatedRequestID=c);c=m("#createlist-list-name-textinput").val();c===n||0===c.length?y():(G(),b("#createlist-form-loading-error-section"),b("#create-list-form-wrapper"),B("#create-list-form-spinner"),a.listName=c,(c=x.urlParamValue("createAndAddAsin"))&&0<c.length&&
(a.asin=c),"DETAIL_PAGE"===h()&&w?((c=w.getAsin())&&0<c.length&&(a.asin=c),q(a,w.handleSuccess,w.handleError)):"HEARTS_V2_SELECT_HEARTING_BOTTOMSHEET"===h()&&u?((c=u.getAsin())&&0<c.length&&(a.asin=c),d.hide(f),q(a,u.onCreateSuccess,u.onCreateError)):(c=e.state("atwl"),c!==n&&c.asin!==n&&0<c.asin.length&&(a.asin=m.trim(c.asin)),q(a,p,I)))});l.when("dp-create-list-handler").execute(function(a){w=a});l.when("hearts-v2-create-list-handler").execute(function(a){u=a});l.when("lists-your-saves-refresh-utils").execute(function(a){F=
a});e.on("a:expander:create-list-learn-more-popover:toggle:expand",function(){f.viewTypeLabel===d.VIEW_TYPE_LABELS.IS_BOTTOMSHEET_LABEL?d.changeHeight(f,v+165):d.changeHeight(f,580)});e.on("a:expander:create-list-learn-more-popover:toggle:collapse",function(){d.changeHeight(f,v);f.viewTypeLabel===d.VIEW_TYPE_LABELS.IS_BOTTOMSHEET_LABEL?d.changeHeight(f,v):d.changeHeight(f,430)});e.declarative("createlist-list-name-validation",["keyup"],function(a){a=a.$target.context.value;0!==a.length&&m("#createlist-list-name-textinput").parent("div").hasClass("a-form-error")&&
m("#mobile-alert-list-name").is(":visible")?G():0===a.length&&y()})});"use strict";l.when("A","create-new-list-hz","a-modal","a-toggle-button-group","lists-dpx-common-utils","create-list-state-util","lists-metric-logger").register("create-utils",function(e,d,r,l,C,x,z){function q(b){b&&"function"==typeof uet&&uet("cf",b,{wb:1});b&&"function"==typeof uex&&uex("ld",b,{wb:1})}var g=e.$,D=function(b){b="#"+(b.formId||"addToCart");0===g(b).length&&(b="#atwl-form");return b};e.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}),r.create(b.$target,d).show({padding:"none"}),q("create-list-dp-widget");e.on("a:popover:afterHide:create-list",function(){r.remove("create-list");d.url.includes("DESKTOP_DETAIL_PAGE")&&(l("#add-to-wishlist-button-group").setSelected("#wishListDropDown"),g("#add-to-wishlist-button").focus())});e.on("a:popover:show:create-list",function(b){E(b.popover.$popover)});
d.createAndAddAsin&&x.saveCreateAndAddAsin(d.createAndAddAsin)});e.declarative("list-name-validation",["keyup"],function(b){0!==b.$target.context.value.length&&g("#alert-list-name").is(":visible")&&(g("#alert-list-name").addClass("aok-hidden"),g("#alert-list-name").parent("div").find("input").each(function(){g(this).removeClass("a-form-error")}),g("#list-name").removeAttr("aria-describedby").removeAttr("aria-invalid"))});var E=function(b){b.delegate("input:text","keypress",function(b){13===b.which&&
b.preventDefault()})};return{submitCreate:function(b,l,r){b.$event.preventDefault();var q=g("#create-list-form").closest(".a-popover"),t=g("#list-name").val();if(""===t)g("#alert-list-name").removeClass("aok-hidden"),g("#alert-list-name").parent("div").find("input").each(function(){g(this).addClass("a-form-error")}),g("#list-name").attr("aria-describedby","#alert-list-name".replace("#","")).attr("aria-invalid",!0).focus();else{g("#list-name").removeAttr("aria-describedby").removeAttr("aria-invalid");
var p={},h=e.state("popoverState")||{};h=D(h);var y=C.urlParamValue("createAndAddAsin");y&&1<y.length&&(p.asin=y);"1"===g("#is-create-and-add").val()&&(h=g(h).find("#ASIN, [name^\x3d'ASIN'], [name\x3d'a'], [name\x3d'asin']").val(),""===h&&(h=e.state("atwl").asin,z.incrementMetricCountByOne("Lists:CreateListAndAddItem:FallbackToGiftingModuleASIN")),"undefined"!==h&&(p.asin=g.trim(h)));(h=x.getCreateAndAddAsin())&&"undefined"!==h&&(p.asin=h);g("#create-list-loading").removeClass("aok-hidden");q.find("#popover-spinner .a-popover-loading").show();
g("#create-list-form").addClass("aok-hidden");p.listName=t;p.sid=b.data.sessionId;p.vendorId=b.data.sourceVendorId;p.privacyStatus=b.data.privacyStatus;p.listType=b.data.listType;if(b=k.ue?k.ue.rid:n)p.relatedRequestID=b;d(p,l,r)}}}});"use strict";l.when("A","amazon-lists-csrf-utils").register("create-new-list-hz",function(e,d){var l=e.$;return function(e,r,x){var q=[];d.addCsrfToken(q);var t=k.ue?k.ue.rid:n;t&&(e.relatedRequestID=t);e.isJson=!0;return l.ajax("/hz/wishlist/create/newlist",{type:"POST",
headers:q,data:e,success:r,error:x,timeout:1E4})}});"use strict";l.when("A").register("create-list-state-util",function(e){var d=e.$;(function(){var e=d('\x3cinput type\x3d"hidden"\x3e');e.attr("id","lists-createlist-createAndAddAsin");e.appendTo("body")})();return{getCreateAndAddAsin:function(){return d("#lists-createlist-createAndAddAsin").val()},saveCreateAndAddAsin:function(e){d("#lists-createlist-createAndAddAsin").val(e)}}})});
/* ******** */
(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);var 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;a:{var 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(g){var h=window.AmazonUIPageJS||window.P,v=h._namespace||h.attributeErrors,b=v?v("RegistryDPAssets",""):h;b.guardFatal?b.guardFatal(g)(b,window):b.execute(function(){g(b,window)})})(function(g,h,v){g.when("A","b2b-lists-detail").execute(function(b,c){function e(){var a=b.$("#free-form-quantity-dropdown"),d=b.$("#quantity-update-text"),e=b.$("#quantity"),c=1;0<a.length&&a.is(":visible")?(c=a.val(),0===c.length&&(c=d.val())):0<d.length&&d.is(":visible")?c=d.val():0<e.length&&e.is(":visible")&&
(c=e.val());return c}c.isEnabled()&&(b.on("a:dropdown:selected:quantity",function(a){c.updateQuantity(a.value)}),b.on("a:dropdown:selected:free-form-quantity-dropdown",function(a){0<a.value.length?c.updateQuantity(a.value):c.updateQuantity(b.$("#quantity-update-text").val())}),b.$(document).delegate("#quantity-update-text","change",function(a){c.updateQuantity(a.target.value)}),b.on("a:pageUpdate",function(){var a=b.$("#ASIN").val();c.updateQuantityAndAsin(e(),a)}))});g.when("A","a-modal").register("b2b-lists-detail",
function(b,c){function e(){return c.get(b.$("#business-list-modal"))}function a(a,b,e){var d=new RegExp("([?\x26])"+b+"\x3d.*?(\x26|$)","i"),c=a;a.match(d)&&(c=a.replace(d,"$1"+b+"\x3d"+e+"$2"));return c}return{updateQuantityAndAsin:function(d,c){var r=(b.state("businessListPageState")||{}).businessListUrl;r&&(r=a(r,"quantity",d),d=r=a(r,"asin",c),e().update({url:d}))},updateQuantity:function(c){var d=(b.state("businessListPageState")||{}).businessListUrl;d&&(c=d=a(d,"quantity",c),e().update({url:c}))},
isEnabled:function(){return 0<b.$("#add-business-list-button").length}}});"use strict";g.when("A","a-popover","atwl-common-util","atwl-dropdown-util","atwl-util","atwl-inline-util","add-to-wish-list:plugin-registry","lists-ajax-handler","atwl-ready").register("add-to-wish-list",function(b,c,e,a,d,l,r,t){"undefined"!==typeof b.state.parse&&b.state.parse();var f=b.$;e.getState("atwl");var k=e.getState("popoverState");e.atwlFormSelector();var n=h.currentType;h.setRegistryId=e.setRegistryId;var q=[],
g=function(a){"undefined"!==typeof a&&a.preventDefault();p();var c=function(){var c=e.getState("wishlistDPState").isFirstCreate?"create":"add";"add"===c&&f("html").hasClass("a-lt-ie9")?(h.atwlLoaded=!1,atwlEarlyClick(a)):(n="wishlist",h.currentType=n,b.state("wishlistDPState",{action:c,type:n}),f("#add-wishlist-declarative").trigger("click"))},d=r.getPlugin();d&&d.addToList?d.addToList(c):c()};b.on("addFormSubmit",g);var p=function(){var a=e.getState("wishlistDPState");delete a.customizationToken;
delete a.customizedPrice;b.state.replace("wishlistDPState",a)};c=function(){(k.showWishListDropDown||k.showBabyRegDropdown||k.isAddToWishListDropDownAuiEnabled||k.showPopover)&&k.showPopover&&(f("#add-to-wishlist-button-submit").unbind("click").bind("click",g),b.declarative("add-wishlist-declarative",["click"],function(a){a=e.getState("wishlistDPState");d.parsePostData(a.action,a.type);(a=h.ue)&&a.count("lists:dp:addtolist:click",(a.count("lists:dp:addtolist:click")||0)+1)}))};c();b.on("atwl-trigger-onload-bindings",
c);return{setPostAddSuccess:function(a){q.push(a)}}});"use strict";g.when("A","a-popover","atwl-common-util").register("atwl-dropdown-util",function(b,c,e){var a=b.$;e.getState("popoverState");var d=0,l,r=e.CONST,t=e.ie8NoScroll,f=e.setAtwlState,k=function(){a("#wishListDropDown").removeClass("a-button-selected");a("#wishListMainButton").removeClass("a-button-selected")},n=function(){var a=e.getState("atwl"),b=a.activePopoverButtonId;return"undefined"!==b&&"add-to-baby-button-group"===b?a.babyDropDownHtml:
a.dropDownHtml},q=function(a){var b=e.getState("atwl").activePopoverButtonId;"undefined"!==b&&"add-to-baby-button-group"===b?f({babyDropDownHtml:a}):f({dropDownHtml:a})},g=function(){var b=a("#atwl-dd-ul").parent();if(b&&b.get(0)){var c=b.get(0).scrollHeight,d=b.height();b=2*parseInt(b.css("padding-top"),10);return c>d+b}return!1},p=function(c){0!==a(".atl-keyboard-a11y").length&&(c=c.find(".a-button-close"),a(".atl-keyboard-a11y").each(function(b){a(this).attr("tabindex","-1");a(this).find(".a-declarative").eq(0).attr("tabindex",
"0")}),c.show(),c.addClass("atwl-hz-button-close"),document.querySelectorAll('[id^\x3d"atwl-link-to-list"]').forEach(function(a){a.addEventListener("click",function(a){a=a.currentTarget.querySelector('span[data-action\x3d"atwl-dd"]');null!==a&&a.click()})}),c=document.querySelector('[data-action^\x3d"show-create-list"]'),null!==c&&(c.setAttribute("tabindex","0"),c.setAttribute("role","button"),c.addEventListener("keydown",function(a){if(a.which===b.constants.keycodes.ENTER||a.which===b.constants.keycodes.SPACE)a=
a.currentTarget.children[1],null!==a&&a.click()})))},w=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"});p(c);setTimeout(function(){c.find(".a-arrow-border").addClass("aok-hidden");a("#atwl-rich-content").css({"margin-bottom":"0px",width:"auto"});var d=e.getState("atwl");if(d.hzPopover){var f=document.getElementById(d.activePopoverButtonId);if(null!==f&&"undefined"!==typeof f){var m=
f.getBoundingClientRect().left;b.capabilities.rtl&&(m=a(h).width()-f.getBoundingClientRect().right);c.css({left:m+"px"})}}a.browser.msie&&(m=a("#"+d.wishlistButtonSubmitId),d=m.offset(),f=m.height(),m=d.left,d=d.top+f,t()&&(m+=document.body.parentElement.scrollLeft,d+=document.body.parentElement.scrollTop),g()&&(m-=17),c.css({left:m+"px",top:d+"px"}))},50)},x=function(b){var c=t()?50:0;setTimeout(function(){var c=a("#atwl-popover-inner"),d=c.width(),f=e.getState("atwl"),m=document.getElementById(f.activePopoverButtonId);
f.hzPopover&&null!==m&&"undefined"!==typeof m?d=m.getBoundingClientRect().width:g()?d+=r.overflowWidth:a(".atwl-dd-list-name").each(function(b){b=a(this);b.width(b.width()+r.noOverflowWidth)});f=b.find("ul li a.a-active").first();f.css("margin-left","1px");f.parent().focus();c.width(d)},c)},u=function(){if(l){var a=c.get(l);a&&a.hide()}},m=function(b){var d=r.widthStaticPopovers;try{d=document.getElementById("add-to-wishlist-button-group").clientWidth}catch(F){}a("#"+b).children().first().width(d);
u();if(c){var f=c.get(l),m=e.getState("atwl");f=f?c.get(l):c.create(a("#"+m.activePopoverButtonId),{content:a("#"+b).html(),name:"atwl",skin:function(a){return a},activate:"onmouseclick",width:d,position:m.dropDownPosition||"triggerBottom",closeButtonLabel:m.closeButtonAriaLabel,popoverLabel:m.dropdownAriaLabel});f.update({width:d,content:a("#"+b).html()});l=f.id;f.show().updatePosition();w(f.$popover)}},y=function(){k();d++;u();m("atwl-dd-error-holder")},B=function(){var b=e.getState("atwl");return c.create(a("#"+
b.activePopoverButtonId),{content:n(),name:"atwl",skin:function(a){return a},activate:"onmouseclick",position:b.dropDownPosition||"triggerBottom",closeButtonLabel:b.closeButtonAriaLabel,popoverLabel:b.dropdownAriaLabel})},v=function(a){a.update({content:n(),width:"auto"});a.show();w(a.$popover);x(a.$popover)},C=function(){var d=c.get("atwl");d&&d.isActive()?d.hide():(d=B(),c.remove(d),d=B(),v(d),b.capabilities.touch&&setTimeout(function(){var b=a("#wishlistButtonStack"),c=b.clone(),d=b.parent();b.remove();
d.append(c)},300),"function"===typeof h.uet&&h.uet("cf","addToListDropdown",{wb:1}),"function"===typeof h.uex&&h.uex("ld","addToListDropdown",{wb:1}))},D=function(){var a=c.get("atwl");a&&a.isActive()&&a.hide()},z=function(a,b,c){a.append('\x3cinput type\x3d"hidden" id\x3d"'+b+'" name\x3d"'+b+'" value\x3d"'+c+'"\x3e')};return{makeDropDownArrowInactive:k,getDropDownHtml:n,setDropDownHtml:q,resetDropDownHtml:function(){q("")},resetAjaxFailCount:function(){this.ajaxFailCount=0},hideDropdown:D,hideError:function(){u();
var a=e.getState("atwl");return d>=a.maxAjaxFailureCount},showUnavail:function(){u();u();m("atwl-dd-unavail-holder")},showSpinner:function(){m("atwl-dd-spinner-holder")},parseAjaxResponse:function(c){k();u();if("object"===typeof c)var d=c;else try{d=b.parseJSON(c)}catch(E){y();return}"undefined"!==typeof d.html&&"undefined"!==d.css?(q(d.html),c=d.css,a("body").append(c),C()):y()},showError:y,showDropDown:C,removeDropdownButtonAriaControls:function(){a("#add-to-wishlist-button").removeAttr("aria-controls")},
setDropdownButtonAriaControls:function(){var b=c.get("atwl");b.$container&&b.$container[0]&&a("#add-to-wishlist-button").attr("aria-controls",b.$container[0].id)},setInputRegistryId:function(c,d){"undefined"===typeof d&&(d="wishlist");var m="pop_"+c+"_"+d,k=a(e.atwlFormSelector()),p=k.find(e.popCommandSelector);p.length?p.attr("value",m):z(k,"sourceCustomerOrgListID",m);m=k.find("[name\x3d'registryID']");m.length?m.attr("value",c):z(k,"registryID",c);c=k.find("[name\x3d'registryType']");c.length?
c.attr("value",d):z(k,"registryType",d);f({inSubmit:!0});d=k.find("[name\x3d'submit.add-to-registry.wishlist'],[name\x3d'submit.add-to-wishlist']").eq(0);d.length?d.click():b.trigger("addFormSubmit");D();return!1}}});"use strict";g.when("A","a-popover","atwl-dropdown-util","atwl-common-util","atwl-inline-util","kbp","idea-list-csrf-utils","add-to-list-modal-util","lists-ajax-handler","atwl-ready").execute("atwl-dropdown",function(b,c,e,a,d,l,r,t,f){var k=b.$,n=a.getState("popoverState"),q=a.getState("atwl"),
g=q.wireDeclaratives,p=function(){var a=k("#"+q.wishlistButtonId),c=k("#"+q.wishlistButtonSubmitId);b.on("wl-drop-down",function(a){x(a)});c.addClass("a-declarative");c.attr("data-action","atwl-splitbutton-main");k("#wishListMainButton").addClass("a-declarative").attr("data-action","add-wishlist-declarative");h.atwlEc&&setTimeout(function(){a.click();k("#atwl-dd-spinner-holder").addClass("a-hidden");h.atwlEc=!1},1);h.atwlLoaded=!0};b.on("a:pageUpdate",function(){k("#wishListMainButton").hasClass("a-declarative")||
(p(),b.trigger("atwl-trigger-onload-bindings"))});var w=function(){var a=h.atwlEc?"lists:dp:ech:early":"lists:dp:ech:late";var b=h.ue;b&&b.count(a,(b.count(a)||0)+1)},x=function(b){b.$event&&b.$event.originalEvent&&b.$event.originalEvent.acknowledge&&b.$event.originalEvent.acknowledge(b.$currentTarget.get(0));"function"===typeof h.uet&&h.uet("bb","addToListDropdown",{wb:1});w();a.setAtwlState({activePopoverButtonId:"add-to-wishlist-button-group"});b.$event?b.$event.preventDefault():b.preventDefault();
setTimeout(function(){e.makeDropDownArrowInactive()},0);if("not-allowed"===(b.$target?b.$target:k(b.target)).css("cursor"))return!1;if(e.hideError())return e.showUnavail(),!1;if((b=e.getDropDownHtml())&&b.length)e.showDropDown();else{e.showSpinner();b=a.getState("wishlistDPState");var c="website.wishlist.detail.add";"undefined"!==typeof b.vendorId&&(c=b.vendorId);b="/hz/wishlist/addtolist?"+k.param({sortMethod:q.sortMethod||0,type:"wishlist",useAll:q.showAllTypes||0,sourceVendorId:c});k.ajax({url:b,
cache:!1,success:e.parseAjaxResponse,error:e.showError})}return!1};if(n.showWishListDropDown||n.isAddToWishListDropDownAuiEnabled||n.showPopover)p(),a.setAtwlState({resetDropDownHtml:e.resetDropDownHtml}),g||(b.declarative("atwl-splitbutton-arrow","click",x),b.declarative("atwl-dd","click",function(c){c.$event.preventDefault();u();e.hideDropdown();var d=c.data;t.show(c.$target,{height:d.height,width:d.width,name:d.name,popoverLabel:d.header,closeButtonLabel:d.closeButtonLabel,header:d.header,padding:d.padding});
c={asin:a.getAsin(),vendorId:"website.wishlist.detail.add",listExternalId:d.listExternalId,listType:d.listType,isAjax:"1"};b.state.replace("atwl-huc-recommendation-state",{listId:c.listExternalId,listType:c.listType});f.post({url:"/hz/wishlist/additemtolist",params:c,successCallback:function(a){t.updateHtmlContent(a)},errorCallback:function(a){}})}),b.declarative("atwl-dd","keydown",function(a){var d=b.constants.keycodes,f=a.$event;f.which===d.ENTER||f.which===d.SPACE?(f.preventDefault(),a.$target.click()):
f.which===d.ESCAPE&&(f.preventDefault(),a=c.get("atwl").$container.find(".a-button-close"),a.focus(),a.eq(0).trigger("click"))}),b.declarative("atwl-dd-dl","click",function(c){c.$event.preventDefault();e.hideDropdown();d.showSpinner();var f=a.getAsin(),p=a.getSid();f=k.extend({},{asin:f,sid:p},c.data);p=[];r.addIdeaListCsrfToken(p);b.post("/create/api/addToList?ref\x3didea_dp_ai",{params:f,headers:p,success:function(a){a.registryName=c.data.listName;d.addItemResponseHandler(a)},error:d.showError,
abort:d.showError});return!1}),b.declarative("atwl-kbp-landing","click",function(b){b=b.data;var c=a.getAsin();h.open(b.url+("\x26asin\x3d"+c));return!1}),b.on("a:popover:hide:atwl",function(){e.removeDropdownButtonAriaControls()}),b.on("a:popover:show:atwl",function(){e.setDropdownButtonAriaControls()})),q&&"kbp"===q.sortMethod&&(b.state("atwl",{kbpPromo:{mouseOver:!1,countDown:!1}}),b.ajax("/gp/toys/birthday/atwl-dpx.html",{method:"get",cache:!1,params:{isAUI:1},success:l.showKbpPromoPopover,error:function(){}}),
g||(b.declarative("atwl-kbp-promo-mouseover","mouseleave",function(){var d=a.getState("atwl").kbpPromo;d.mouseOver=!1;if(d.countDown){var f=c.get("kbpPromoPopover");f&&(f.unlock().hide(),c.remove(f))}b.state("atwl",{kbpPromo:d})}),b.declarative("atwl-kbp-promo-mouseover","mouseenter",function(){var c=a.getState("atwl").kbpPromo;c.mouseOver=!0;b.state("atwl",{kbpPromo:c})}),b.on("a:popover:hide:kbpPromoPopover",function(){var a=c.get("kbpPromoPopover");a.unlock().hide();c.remove(a)}))),a.setAtwlState({wireDeclaratives:!0});
var u=function(){var a=h.ue;a&&a.count("lists:dp:addtolist:dropdownentry:click",(a.count("lists:dp:addtolist:dropdownentry:click")||0)+1)}});"use strict";(function(){var b=!1;g.when("cf").execute(function(){b||(b=!0,c())});g.when("atwl-cf").execute(function(){b||(b=!0,c())});var c=function(){g.now("cf-or-atwl-cf").execute(function(b){"undefined"===typeof b&&h.P.register("cf-or-atwl-cf")})}})();g.when("A","cf-or-atwl-cf").register("atwl-common-util",function(b){var c=b.$,e=function(){return"#"+(a("popoverState").formId||
"addToCart")+",#addToWL"},a=function(a){b.state.parse();return 0===c('script[data-a-state\x3d"{"key":"'+a+'"}"]').length?{}:b.state(a)||JSON.parse(c('script[data-a-state\x3d"{"key":"'+a+'"}"]').text())||{}};return{CONST:{widthStaticPopovers:230,overflowWidth:10,noOverflowWidth:10,scrollbarWidth:17},getAsin:function(){var b=c(e()).find("#ASIN").val();return"undefined"===typeof b?c(e()).find("[name^\x3d'ASIN'],[name^\x3d'ASIN.0']").val():""===b?a("atwl").asin:b},getSid:function(){var a=c(e()).find("#session-id").val();
"undefined"===typeof a&&(a=c(e()).find("[name\x3d'session-id']").val());return a},ie8NoScroll:function(){return 9>parseInt(c.browser.version,10)&&document.body&&document.body.parentElement?!(!document.body.parentElement.scrollLeft&&!document.body.parentElement.scrollTop):!1},setRegistryID:function(a){var b=c(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(a){b.state("atwl",c.extend(b.state("atwl")||{},a))},getState:a,clearText:function(a){a.value===a.defaultValue&&(a.value="")},forceFormSubmit:function(a){var b=a.attr("name");a=a.parents("form");b=c('\x3cinput type\x3d"hidden" /\x3e').attr("name",b).val("1");a.append(c(b));a.submit()},clearPopCommandFields:function(){for(var a=["wlPopCommand","sourceCustomerOrgListID"],b=0;b<a.length;b++){var e=c('[name^\x3d"'+a[b]+'"]');e&&e.length&&e.val("")}},atwlFormSelector:e,popCommandSelector:"[name\x3d'sourceCustomerOrgListID'],[name\x3d'colid'],[name\x3d'wlPopCommand']"}});
"use strict";g.when("A","a-popover","atwl-common-util").register("kbp",function(b,c,e){var a=b.$,d=e.getState("atwl"),l=a("#"+d.wishlistButtonSubmitId);return{showKbpPromoPopover:function(a){if(a&&a.promoEnabled){var d=a.html;if(d){var f=c.create(l.parent(),{name:"kbpPromoPopover",content:d,position:"triggerBottom",width:a.width});f.show().lock();b.delay(function(){var a=e.getState("atwl").kbpPromo||{};a.mouseOver?a.countDown=!0:(f.unlock().hide(),c.remove(f));b.state("atwl",{kbpPromo:a})},1E4)}}}}});
"use strict";g.when("A","atwl-util","atwl-dropdown-util","atwl-common-util","lists-ajax-handler","atwl-ready").execute("atwl-huc",function(b,c,e,a,d){var l=b.$;e=a.getState("popoverState");var r=a.getState("createInfo")||{},t="addCreateToWishlist";r.isHorizonte&&(t="reg-create");if(e.showWishListDropDown||e.showBabyRegDropdown||e.isAddToWishListDropDownAuiEnabled||e.showPopover)b.on("a:popover:show:"+t,function(f){var e=f.popover,n=e.$popover;f=a.getState("wishlistDPState");var l=f.action;n.addClass("pop-huc-"+
l);var t=e.$trigger.closest(".a-button").find("input");n=f.type;t.closest(".a-button-selected").removeClass("a-button-selected");n=c.parsePostData(l,n);f.customizationToken&&(n.customizationToken=f.customizationToken);f=n.url;var p=n.streaming,g="ajax_"+p,x=new Date;h.ue&&h.uet("tc",g);var u=function(){e.hide();a.forceFormSubmit(t)},m=function(){e.$popover.find("#popover-spinner").addClass("a-hidden");a.clearPopCommandFields()};"create"!==l&&p?(f=c.buildAddItemToDefaultListParams(n),b.state.replace("atwl-huc-recommendation-state",
{listId:"",listType:f.listType}),d.post({url:"/hz/wishlist/additemtolist",params:f,successCallback:function(a){m();e.$popover.find("#WLHUC_result").html(a).removeClass("a-hidden");e.updatePosition()},errorCallback:u})):r.isHorizonte?b.ajax(f,{method:"get",success:function(a){e.$popover.find("#popover-spinner").addClass("a-hidden");e.$popover.find("#WLHUC_result").html(a).removeClass("a-hidden");e.updatePosition()},error:u}):b.ajax(f,{method:"post",params:n,success:function(b){b&&b.html?(h.ue&&(h.ues("id",
g,b.requestId),h.ues("t0",g,x),h.ues("ctb",g,"1")),b.status&&"no-asins"===b.status?u():(m(),"add"===l?e.$popover.find("#WLHUC_result").html(b.html).removeClass("a-hidden"):(e.$popover.find("#WLNEW_main").html(b.html).removeClass("a-hidden"),(b=a.getState("atwl"))&&b.resetDropDownHtml&&b.resetDropDownHtml()),e.updatePosition()),h.ue&&(h.uet("be",g),h.uex("ld",g))):("create"===l&&a.forceFormSubmit(t),e.hide())},error:u})}),b.on("a:popover:beforeShow:"+t,function(b){b=b.popover;var c=a.getState("wishlistDPState");
b.$popover.find("#popover-spinner").removeClass("a-hidden");b.$popover.find(".wlAddCreatePop").html("").addClass("a-hidden");var d=c.action,e=d+"Header";"create"===d&&c.isFirstCreate&&(e="first"+e);b.update({header:c[e]});"create"===d&&b.update({width:c[d+"Width"],height:c[d+"Height"]});b.updatePosition()}),b.on("a:popover:hide:"+t,function(b){l(".a-modal-scroller").css({visibility:"hidden"});a.clearPopCommandFields()})});"use strict";g.when("A","atwl-common-util","add-to-wish-list:plugin-registry").register("atwl-util",
function(b,c,e){var a=b.$;return{parsePostData:function(a,b){var d=c.getState("popoverState");d=document.getElementById(d.formId||"addToCart");if("undefined"===typeof d||null===d)d=document.getElementById("addToWL");var l=[];if("undefined"!==typeof d&&null!==d){var f=[];l=!1;var k=d.elements;k||(k=d.querySelectorAll("input"),l=!0);for(var g=0;g<k.length;g++){var h;if(!(h=l)){h=k[g];var v=/^(?:checkbox|radio)$/i,p=/^(?:submit|button|image|reset|file)$/i,w=/^(?:input|select|textarea|keygen)/i;if(h){var x=
h.type;h=h.name&&!h.disabled&&w.test(h.nodeName)&&!p.test(x)&&(h.checked||!v.test(x))}else h=!1}h&&f.push(k[g])}l=f}f={};k=c.getState("wishlistDPState");for(g=0;g<l.length;g++)"submit"!==l[g].type&&(f[l[g].name]=l[g].value);f.requestedQty=f.quantity=null!==d&&"undefined"!==typeof d.quantity?d.quantity.value:1;f.sid="undefined"!==typeof f["session-id"]?f["session-id"]:k.sid;f.cache=!1;f.url=k[a+"Url"];f.action=a;f.type=f.registryType||"wishlist";"add"===a?(f.type=f.registryType||b,f.caller="aui",f.streaming=
k.streaming,f.sourceVendorId="undefined"!==typeof k.vendorId?k.vendorId:"website.wishlist.detail.add"):"create"===a&&(f.create_sid=f.sid,f.create_type=f.registryType||b,f.create_nextAction="add",f.create_includeEmptyList=1,f.create_isFirst=k.isFirstCreate?1:0,f.caller="aui",f.create_sourceVendorId="undefined"!==typeof k.vendorId?k.vendorId:"website.wishlist.detail.add");(a=e.getPlugin())&&a.filterFormData&&a.filterFormData(f);return f},hideAddToListButtonStack:function(){a("#add-to-wishlist-button-group").hasClass("a-hidden")||
a("#add-to-wishlist-button-group").addClass("a-hidden")},showAddToListButtonStack:function(){a("#add-to-wishlist-button-group").hasClass("a-hidden")&&a("#add-to-wishlist-button-group").removeClass("a-hidden")},buildAddItemToDefaultListParams:function(a){return{asin:c.getAsin(),vendorId:"website.wishlist.detail.add",listType:a.type,isAjax:"1"}}}});"use strict";g.when("A","atwl-util","atwl-dropdown-util","cf").register("atwl-inline-util",function(b,c,e){var a=b.$,d=function(){a("#atwl-inline-spinner").addClass("a-hidden")},
l=function(){c.hideAddToListButtonStack();a("#atwl-inline-spinner").removeClass("a-hidden")},g=function(){d();a("#atwl-inline").addClass("a-hidden");c.showAddToListButtonStack();e.makeDropDownArrowInactive();a("#atwl-inline-error").removeClass("a-hidden")},h=function(b){a("#atwl-inline-error-msg").empty();a("#atwl-inline-error-msg").html(b)},f=function(b,c){b=c&&"giftlist"===c?"/gp/registry/giftlist/"+b+"/ref\x3dwl_inline_title":c&&"discoverlist"===c?"/create/collection?id\x3damzn1.ideas."+b+"\x26ref_\x3didea_dp_inline":
"/gp/registry/wishlist/"+b+"/ref\x3dwl_inline_title";a("#atwl-inline-link").attr("href",b)},k=function(b){a("#atwl-inline-link-text").empty();a("#atwl-inline-link-text").text(b)},n=function(){d();a("#atwl-inline-error").addClass("a-hidden");a("#atwl-inline").removeClass("a-hidden")},q=function(b){b&&b.message&&h(b.message);g();a(".reg-create-form").closest(".a-popover").find(".a-button-close").click()},A=function(b){l();a(".reg-create-form").closest(".a-popover").find(".a-button-close").click();k(b.listName)};
return{showSpinner:l,showError:g,showErrorClosePopover:q,parseParams:function(a,b){a=c.parsePostData(a,b);b=a.ASIN||a["ASIN.0"];var d=a["session-id"],e=a.sourceVendorId,f=a.type||"wishlist";var g="create"===a.action?"newsl":a.wlPopCommand?a.wlPopCommand.split("_")[1]:a.sourceCustomerOrgListID?a.sourceCustomerOrgListID.split("_")[1]:"default";return{asin:b,sid:d,sourceVendorId:e,type:f,registryID:g,pcomp:0,action:a.action}},addItemResponseHandler:function(a){try{typeof a!==v?1===a.isValid||!0===a.updateSuccessful?
(f(a.registryID,a.registryType),k(a.registryName),n()):typeof a.message!==v&&(h(a.message),g()):g()}catch(w){g()}},addItemResponseHandlerHZ:function(a){try{typeof a!==v&&!1===a.hasError?(A(a),f(a.listExternalId,a.listType),n()):g()}catch(w){g()}},addItemResponseHandlerHZIdeaList:function(a){try{typeof a!==v&&a.updateSuccessful?(A(a),f(a.listId,"discoverlist"),n()):q(a)}catch(w){q(a)}}}});"use strict";g.register("add-to-wish-list:plugin-registry",function(){var b=null;return{registerPlugin:function(c){if(null!==
b)throw Error("Only a single plugin can be registered.");b=c},getPlugin:function(){return b}}});"use strict";g.when("A","a-modal").register("add-to-list-modal-util",function(b,c){b.declarative("continue-shopping-submit","click",function(a){e("reg-create","hide");e("add-item-to-list-modal","remove")});var e=function(a,b){var d=c.get(a);d&&("hide"==b?d.hide():c.remove(a))};return{show:function(a,b){e("add-item-to-list-modal","remove");c.create(a,b).show()},updateHtmlContent:function(a){c.get("add-item-to-list-modal").update({content:a})}}});
"use strict";g.when("A","atwl-common-util","amazon-lists-csrf-utils").register("add-to-list-from-huc-recs",function(b,c,e){var a=b.$,d=function(a){var b=h.ue;b&&b.count(a,(b.count(a)||0)+1)};b.on("lists:widget:add_card_item_to_list_requested",function(g,h){var l=b.state("atwl-huc-recommendation-state");h={listId:l.listId,listType:l.listType,asin:g,sid:c.getSid(),tags:JSON.stringify(h)};var f=function(){d("lists:dp:card:addtolist:failed");b.trigger("lists:widget:add_card_item_to_list_failed",g)};l=
[];e.addCsrfToken(l);a.ajax({type:"POST",url:"/hz/wishlist/addasin",data:h,headers:l,success:function(a){a&&!1===a.hasError?(d("lists:dp:card:addtolist:succeeded"),b.trigger("lists:widget:add_card_item_to_list_succeeded",g)):f()},error:f})})});"use strict";g.when("A","legacy-create-utils","atwl-inline-util").execute(function(b,c,e){var a=b.$;b.state.parse();if((b.state("createInfo")||{}).isHorizonte){var d=function(){a("#WLNEW_error").removeClass("a-hidden")},g=function(b){try{if(typeof b!==v&&!1===
b.hasError){a("#WLNEW_loading").addClass("a-hidden");var c=a(".reg-create-form");c.addClass("a-hidden");b.htmlMessage?c.parent().append(b.htmlMessage):d()}else d()}catch(f){d()}};b.declarative("reg-create-submit",["click"],function(a){c.submitCreate(a,g,d,e.addItemResponseHandlerHZIdeaList,e.showErrorClosePopover)})}});"use strict";g.when("A","jQuery").execute(function(b,c){b.declarative("remaining-customizations-action","click",function(b){var a=b.$currentTarget.parent().find(".remaining_customization_info");
a.show();a.removeClass("aok-hidden");b.$currentTarget.hide();b.$event.preventDefault()})});"use strict";g.when("A","create-utils").execute(function(b,c){var e=b.$,a=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):h.ueLogError&&h.ueLogError({message:"Redesigned Create List failed.",logLevel:"FATAL"})},d=function(b){b&&!b.hasError?b.htmlMessage?(e("#create-list-loading").addClass("aok-hidden"),
e("#create-list-form").parent().append(b.htmlMessage)):a():a()};b.declarative("create-list-submit",["click"],function(b){c.submitCreate(b,d,a)})})});
/* ******** */
(function(A){var f=window.AmazonUIPageJS||window.P,p=f._namespace||f.attributeErrors,B=p?p("GenericRegistryDPXAssets",""):f;B.guardFatal?B.guardFatal(A)(B,window):B.execute(function(){A(B,window)})})(function(A,f,p){"use strict";A.when("A","a-modal","a-popover","a-checkbox","a-dropdown","a-splitdropdown","ready").register("add-to-br-util",function(c,u,q,h,k){function r(){return encodeURIComponent(b("#ASIN").val())}function v(a){var e=c.state("atbrState"),l=e.hasBabyReg||!1,g="true"===b("#is-fully-selected-baby-reg").val()||
!1,h=r();h!==p&&g&&(g=encodeURIComponent(e.sessionId),l?d(e,"C",a):f.location.href="/baby-reg/signup/ref\x3ddp_create_br_desktop?asin\x3d"+h+"\x26sessionId\x3d"+g)}function d(a,e,d){var l=r();a=encodeURIComponent(a.sessionId);var g={};g.asin=l;g.sid=a;g.vendorId=d||"website.dpx.atbr";c.post("/baby-reg/button-action/atbr-dpx/ref\x3ddpx_atbr_dsk",{params:g,timeout:5E3,success:function(a){a!==p&&"failure"!==a.result?("duplicate"===a.result?(b("#br-dp-post-atbr-status-add-to-registry-success").addClass("a-hidden"),
b("#br-dp-post-atbr-status-add-to-registry-dup").removeClass("a-hidden")):(b("#br-dp-post-atbr-status-add-to-registry-dup").addClass("a-hidden"),b("#br-dp-post-atbr-status-add-to-registry-success").removeClass("a-hidden")),h("#br_dp_post_atbr_manage_must_have_item").hide(),h("#br_dp_post_atbr_manage_group_gifting_item").hide(),h("#br_dp_post_atbr_manage_private_item").hide(),document.getElementById("dp-br-post-atbr-header-checklist-text-circle").style.paddingLeft=460-b("#dp-br-post-atbr-header-text").width()+
"px",b("#br-dp-post-atbr-light-box").removeClass("a-hidden"),b("#br-dp-post-atbr-container").removeClass("a-hidden"),b("body").addClass("br-dp-post-atbr-no-scroll"),b("#br-dp-post-atbr-container").removeClass("br-dp-post-atbr-container-hide"),b("#br-dp-post-atbr-container").addClass("br-dp-post-atbr-container-show"),n(),G(e)):f.location.href="/baby-reg/ref\x3ddpx_atbr_dsk_hp?asin\x3d"+l},error:function(){f.location.href="/baby-reg/ref\x3ddpx_atbr_dsk_er?asin\x3d"+l}})}function G(a){b("#br-dp-post-atbr-recommadation").html("\x3cspan\x3e\x3c/span\x3e");
b("#br-dp-post-atbr-spinner").removeClass("a-hidden");a={asin:r(),treatment:a};c.get("/baby-reg/dp-post-atbr-recommendation",{params:a,success:function(e){b("#br-dp-post-atbr-spinner").addClass("a-hidden");b("#br-dp-post-atbr-recommadation").html(e)},failure:function(){}})}function n(){var a={asin:r()};c.get("/baby-reg/dp-post-atbr-status",{params:a,success:function(e){b("#br-dp-post-atbr-status-add-to-registry-item-img").attr("src",e.result.newAddedItemImgUrl);null!=e.result.checklistPercent&&(b("#dp-br-post-atbr-header-checklist-percent").html(e.result.checklistPercent+
'\x3cspan class\x3d"smaller"\x3e%\x3c/span\x3e'),b("#dp-br-post-atbr-header-checklist-pie").addClass("progress-"+e.result.checklistPercent),b("#dp-br-post-atbr-header-checklist-pie").removeClass("progress-0"),b("#dp-br-post-atbr-header-checklist-text-circle").removeClass("a-hidden"));b("#dp-br-post-atbr-header-checklist-link").attr("href",e.result.checklistLink);b("#dp-br-post-atbr-header-registry-link").attr("href",e.result.registryLink);if(e.result.hasMustHave){w=!0;var a=h("#br_dp_post_atbr_manage_must_have_item");
a.show();e.result.isMustHaveItem&&a.check()}e.result.hasGroupGifting&&(t=!0,a=h("#br_dp_post_atbr_manage_group_gifting_item"),a.show(),g=e.result.helpInfoLinkGroupGifting,e.result.isGroupGiftingItem&&a.check());e.result.hasPrivate&&(x=!0,a=h("#br_dp_post_atbr_manage_private_item"),a.show(),e.result.isPrivateItem&&a.check());e=e.result.itemRequestedCount;!Number.isInteger(e)||0>=e||(10<e?(e=k.getSelect("br-dp-post-atbr-header-registry-request").getOption("br-dp-post-atbr-dropdown-tenPlusOpt"),e.info()[0]===
p?k.getSelect("br-dp-post-atbr-header-registry-request").appendOption({text:"10+",value:"10+Opt",native_id:"br-dp-post-atbr-dropdown-tenPlusOpt",selected:"true",css_class:"br-dp-post-atbr-dropdown-option-disabled",native_css_class:"br-dp-post-atbr-dropdown-option-disabled"}):e.update({selected:"true",text:"10+"})):(k.getSelect("br-dp-post-atbr-header-registry-request").getOption(e-1).update({selected:"true",text:e}),m()))},error:function(){}})}function m(){k.getSelect("br-dp-post-atbr-header-registry-request").removeOption("br-dp-post-atbr-dropdown-tenPlusOpt")}
var b=c.$,t=!1,w=!1,x=!1,g="",y=(c.state("atbrState")||{}).token;c.declarative("dpx-add-to-baby-registry-action",["click"],function(a){v()});c.declarative("br_dp_post_atbr_close",["click"],function(a){document.getElementById("br-dp-post-atbr-container").classList.remove("br-dp-post-atbr-container-show");document.getElementById("br-dp-post-atbr-container").classList.add("br-dp-post-atbr-container-hide");document.getElementById("br-dp-post-atbr-light-box").classList.add("a-hidden");document.body.classList.remove("br-dp-post-atbr-no-scroll");
c.get("/baby-reg/dp-post-atbr-close/ref\x3dbr_dsk_dpx_patr_hdr_close",{})});c.declarative("br-dp-post-atbr-status-manage-info-popover",["click"],function(a){q.create(a.$target,{inlineContent:a.data.popoverContent,position:"triggerBottom",activate:"onclick"}).show();!1===w&&(b("#br-manage-popover-content-section-title-must-have").addClass("a-hidden"),b("#br-manage-popover-content-section-content-must-have").addClass("a-hidden"));!1===t?(b("#br-manage-popover-content-section-title-group").addClass("a-hidden"),
b("#br-manage-popover-content-section-content-group").addClass("a-hidden")):b("#br-manage-popover-content-section-content-group-link").attr("href",g);!1===x&&(b("#br-manage-popover-content-section-title-private").addClass("a-hidden"),b("#br-manage-popover-content-section-content-private").addClass("a-hidden"));c.get("/baby-reg/dp-post-atbr-manage-help-info/ref\x3dbr_dsk_dpx_patr_mgmt_info",{})});c.declarative("post-atbr-item-atbr-button-action",["click"],function(a){var e=a.data.reftag,d=a.data.asin;
a=a.data.sid;var g={};g.asin=d;g.sid=a;g.vendorId="website.dpx.post-atbr";c.post("/baby-reg/button-action/atbr-dpx/ref\x3d"+e,{params:g,timeout:5E3,success:function(a){a!==p&&"failure"!==a.result?(b("#post-atbr-item-atbr-success-"+d).removeClass("a-hidden"),b("#post-atbr-item-button-"+d).addClass("a-hidden"),b("#post-atbr-item-atbr-failure-"+d).addClass("a-hidden")):b("#post-atbr-item-atbr-failure-"+d).removeClass("a-hidden")},error:function(){b("#post-atbr-item-atbr-failure-"+d).removeClass("a-hidden")}})});
c.declarative("post-atbr-item-see-all-button-action",["click"],function(a){f.location.href=a.data.link});c.declarative("br_dp_post_atbr_manage_must_have_item_action","change",function(a){a.$event.preventDefault();a={isMustHaveItem:b("#br_dp_post_atbr_manage_must_have_item").is(":checked"),asin:r(),token:y};c.post("/baby-reg/dp-post-atbr-status-manage-must-have/ref\x3dbr_dsk_dpx_patr_mgmt_mh",{params:a,success:function(a){},error:function(a){}})});c.declarative("br_dp_post_atbr_manage_group_gifting_item_action",
"change",function(a){a.$event.preventDefault();a={isGroupGiftingItem:b("#br_dp_post_atbr_manage_group_gifting_item").is(":checked"),asin:r(),token:y};c.post("/baby-reg/dp-post-atbr-status-manage-group-gifting/ref\x3dbr_dsk_dpx_patr_mgmt_gg",{params:a,success:function(a){},error:function(a){}})});c.declarative("br_dp_post_atbr_manage_private_item_action","change",function(a){a={isPrivateItem:b("#br_dp_post_atbr_manage_private_item").is(":checked"),asin:r(),token:y};c.post("/baby-reg/dp-post-atbr-status-manage-private/ref\x3dbr_dsk_dpx_patr_mgmt_pvt",
{params:a,success:function(a){},error:function(a){}})});c.declarative("br_dp_post_atbr_manage_request_quantity_item_action","change",function(a){a={requestQuantity:b("#br-dp-post-atbr-header-registry-request").val(),asin:r(),token:y};c.post("/baby-reg/dp-post-atbr-status-manage-request-quantity/ref\x3dbr_dsk_dpx_patr_mgmt_qty",{params:a,success:function(a){m()},error:function(a){}})});return{addToBabyRegistryFromDPX:v}});"use strict";A.when("A","a-button","a-modal","ready").register("dpx-modal-add-to-wr-declarative-actions",
function(c,u,q){var h=c.$,k=c.state("modal-add-to-wedding-registry-status");if(k&&k.weddingButtonId&&h("#"+k.weddingButtonId).length){var r={name:"wr-modal-add-to-reg-wedding-registry",header:k.modalHeader,url:""};h(document).delegate("#"+k.weddingButtonId,"click",function(c){c.preventDefault();if(k.userSignedIn){var d=h("#quantity").val();d||(d=1);c=q.create(h("#"+k.weddingButtonId),r);var u=encodeURIComponent(h("#ASIN").val());d=encodeURIComponent(d);var n=k.token?"\x26token\x3d"+encodeURIComponent(k.token):
"";k.hasWeddingRegistry?(c.update({cache:!1,url:"/wedding/modal/external-add-to-registry?asin\x3d"+u+"\x26quantity\x3d"+d+n+"\x26ref_\x3dhit_wr_dp_dp_mdl_pop"}).show(),"undefined"!==typeof f.ue&&f.ue.count("wrAddToRegModalPopup",(f.ue.count("wrAddToRegModalPopup")||0)+1)):f.location.href="/wedding/new-registry?asin."+u+"\x3d"+d+"\x26vendorId\x3dgr-dpx-new-reg\x26associateId\x3d\x26associateSubId\x3d"}else f.location.href="/wedding/nosignin"});c.declarative("wr-modal-add-to-reg-rec-add-to-registry-action",
"click",function(k){var d=k.data;k=h("#wr-modal-add-to-reg-wrapper").data("token");var q=u("#wr-modal-add-to-reg-add-to-wr-"+d.recItemAsin);q.isEnabled()&&(q.disable(),!0===h("#wr-modal-add-to-reg-rec-product-card-"+d.recItemAsin).data("exist-in-registry")?(q.hide(),h("#wr-modal-add-to-reg-item-exist-message-"+d.recItemAsin).removeClass("aok-hidden")):(k={items:JSON.stringify([{asin:d.recItemAsin,requestedQuantity:1}]),token:k},c.post("/wedding/registry-items/addItems?ref_\x3dhit_wr_dp_dp_mdl_sa",
{params:k,contentType:"application/x-www-form-urlencoded; charset\x3dUTF-8",success:function(c){q.hide();c.success?h("#wr-modal-add-to-reg-item-added-message-"+d.recItemAsin).removeClass("aok-hidden"):"ITEM_ALREADY_EXIST"===c.errorCode?h("#wr-modal-add-to-reg-item-exist-message-"+d.recItemAsin).removeClass("aok-hidden"):h("#wr-modal-add-to-reg-item-added-error-"+d.recItemAsin).removeClass("aok-hidden")},error:function(){h("#wr-modal-add-to-reg-item-added-error-"+d.recItemAsin).removeClass("aok-hidden");
"undefined"!==typeof f.ue&&f.ue.count("wrAddToRegModalAddFromSimilaritiesError",(f.ue.count("wrAddToRegModalAddFromSimilaritiesError")||0)+1)}})),"undefined"!==typeof f.ue&&f.ue.count("wrAddToRegModalAddFromSimilarities",(f.ue.count("wrAddToRegModalAddFromSimilarities")||0)+1))});c.on("a:popover:beforeHide:wr-modal-add-to-reg-wedding-registry",function(){"undefined"!==typeof f.ue&&f.ue.count("wrAddToRegModalDismissed",(f.ue.count("wrAddToRegModalDismissed")||0)+1)});c.declarative("wr-modal-add-to-reg-view-registry-action",
"click",function(c){"undefined"!==typeof f.ue&&f.ue.count("wrAddToRegModalViewRegistry",(f.ue.count("wrAddToRegModalViewRegistry")||0)+1);f.location.href="/wedding/organize-registry?ref_\x3dhit_wr_dp_dp_mdl_vr"})}});"use strict";var B="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(c){return typeof c}:function(c){return c&&"function"===typeof Symbol&&c.constructor===Symbol&&c!==Symbol.prototype?"symbol":typeof c};A.when("A","a-button","a-modal","a-dropdown","a-splitdropdown",
"dpx-gift-tag-modal","add-to-br-util","ready").register("ggr-add-to-registry-desktop-util",function(c,u,q,h,k,r,A){function d(){null==F&&e.ajax({dataType:"json",url:"/registries/dpx/desktop/list-registry?"+e.param({asin:encodeURIComponent(e("#ASIN").val())}),cache:!1}).done(function(a){F=a;G(a)}).fail(b)}function G(c){c=n(c);if(null===c)b();else{var d=[];d.unshift({html_content:e(D.registryDropdownCreateRegistryTemplateId).html(),css_class:H.registryDropdownItemWrapper,native_id:v.newRegistryType,
value:JSON.stringify({regType:v.newRegistryType})});e.each(c,function(a,b){d.unshift({html_content:m(b),text:g(b.name),value:JSON.stringify({regType:b.type,regName:b.name,regId:b.id}),css_class:H.registryDropdownItemWrapper})});l.showOneClickSplitDropdown?a(k,C.oneClickSplitDropdownId,d):a(h,C.registryDropdownId,d)}}function n(a){var b=void 0;if("object"===("undefined"===typeof a?"undefined":B(a)))b=a.result;else try{b=c.parseJSON(a)}catch(I){b=null}return e.isArray(b)?b:null}function m(a){var b=
e(D.registryDropdownItemTemplateId).html();b=b.replace("{imgTag}",v.imgTag);var c={registryType:a.typeText,registryName:a.name,imgUrl: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 b(){e(D.registryDropdownSpinnerId).addClass("aok-hidden");t(D.registryDropdownErrorBoxId)}function t(a){e(a).removeClass("aok-hidden")}function w(a){var b=e("#quantity").val()||1,c=JSON.parse(a.value);if(c.regId||c.regType){a=c.regType;
var d=c.regId,g=c.regName;c=encodeURIComponent(e("#ASIN").val());b=encodeURIComponent(b);var z=encodeURIComponent(l.sessionId);y(E.dropdownItemClicked+":"+a.toLowerCase());a===v.newRegistryType?f.location.href="/registries?ref\x3ddpx_create_registry_desktop\x26sessionId\x3d"+z:"Wedding"===a?(g={name:p.popoverModalName,header:v.addToRegistryModalHeaderText,url:""},(z=q.get(g.name))||(z=q.create(e("#GR-DROPDOWN-MODAL-TRIGGER"),g)),z.update(x(a,g.header,d,c,b,l.token)).show()):"Baby"===a?A.addToBabyRegistryFromDPX(v.addToBabyRegistryVendorId):
(z={name:p.popoverModalName,header:v.addToRegistryModalHeaderText,url:""},"Custom"!==a&&"Birthday"!==a&&"Pet"!==a?r.renderDPXGiftTagModal(a,d,g,c,b,l.token):((g=q.get(z.name))||(g=q.create(e("#GR-DROPDOWN-MODAL-TRIGGER"),z)),g.update(x(a,z.header,d,c,b,l.token)).show()))}}function x(a,b,c,e,d,g){var z="Wedding"===a?a:"GGR";a={Wedding:"/wedding/modal/external-add-to-registry",GGR:"/registries/dpx-add-to-registry/"+a.toLowerCase()+"/"+c};g=g?"\x26token\x3d"+encodeURIComponent(g):"";e=a[z]+"?asin\x3d"+
e+"\x26quantity\x3d"+d+g+"\x26ref_\x3dhit_wr_dp_dp_mdl_pop";"Wedding"===z?e+="\x26sourceVendorId\x3damazon.wedding_registry.add.dpx.desktop":"GGR"===z&&(e+="\x26sourceid\x3damazon.ggr.add.dpx.desktop");return{header:b,cache:!1,url:e}}function g(a){var b=document.createElement("textarea");b.innerHTML=a;return b.value}function y(a){a=E.deviceType+":"+a;f.ue&&f.ue.count(a,(f.ue.count(a)||0)+1)}function a(a,b,c){var d=a.getSelect(b).getOptions().options.elements;e.each(d,function(c,e){a.getSelect(b).removeOption(e)});
a.getSelect(b).getOption("defaultSpinnner").remove();a.getSelect(b).addOptions(c);a.getSelect(b).setValue("");e("#"+b).click()}var e=c.$,l=c.state("modal-add-to-registry-dropdown-state"),F=null;if(l){var E={deviceType:"desktop",dropdownClicked:"dpx-ggr-dropdown-clicked",dropdownItemClicked:"dpx-ggr-dropdown-item-clicked",similarityClicked:"dpx-ggr-dropdown-similarity-clicked"},H={registryDropdownItemWrapper:"agr-add-to-registry-dropdown-item-wrapper"},C={registryDropdownId:"add-to-registry-dropdown",
oneClickSplitDropdownId:"add-to-registry-one-click-dropdown"},D={registryDropdownId:"#"+C.registryDropdownId,registryDropdownErrorBoxId:"#agr-registry-dropdown-error",registryDropdownSpinnerId:"#agr-registry-dropdown-spinner",oneClickSplitDropdownId:"#"+C.oneClickSplitDropdownId,registryDropdownItemTemplateId:"#agr-registry-dropdown-item-template",registryDropdownCreateRegistryTemplateId:"#agr-registry-dropdown-create-registry-template"},p={addToRegistrySuccessClass:".gr-add-success-message",addToRegistryErrorClass:".gr-add-error-message",
addToRegistryDuplicateClass:".gr-already-exist-message",popoverModalName:"wr-modal-add-to-reg-wedding-registry",splitDropdownAnnounce:"add-to-registry-one-click-dropdown-announce"},v={newRegistryType:"new",imgTag:'\x3cimg src\x3d"{imgUrl}" alt\x3d"{registryName}" class\x3d"agr-add-to-registry-dropdown-registry-icon" /\x3e',ariaPressedProperty:"aria-pressed",addToBabyRegistryVendorId:"amazon.ggr.baby.add.dpx.desktop",addToRegistryModalHeaderText:l.addToRegistryModalHeaderText};c.on("a:dropdown:"+C.registryDropdownId+
":select",function(a){w(a);h.getSelect(C.registryDropdownId).setValue("")});c.on("a:splitdropdown:"+C.oneClickSplitDropdownId+":select",function(a){w(a)});e(document).delegate(".gr-modal-add-to-reg-rec-add-to-registry-action","click",function(a){var b=e(a.currentTarget);a=b.attr("data-asin");var d=u("#gr-modal-add-to-reg-add-to-wr-"+a);if(d.isEnabled()){d.disable();if(!0===b.data("exist"))d.hide(),t(b.find(p.addToRegistryDuplicateClass));else{var g=void 0,l=void 0;g=b.data("type");l=e("#gr-modal-add-to-reg-wrapper").data("token");
g&&"Wedding"!==g?(g={asin:a,desiredQuantity:1,registryId:b.data("id"),registryType:b.data("type"),itemType:"AMAZON_ITEM",vendorId:"amazon.ggr.add.dpx.desktop",token:l},l="/registries/registry-products/addProduct"):(g={token:l,items:JSON.stringify([{asin:a,requestedQuantity:1}])},l="/wedding/registry-items/addItems?ref_\x3dhit_wr_dp_dp_mdl_sa");c.post(l,{params:g,contentType:"application/x-www-form-urlencoded; charset\x3dUTF-8",success:function(a){d.hide();a.success?t(b.find(p.addToRegistrySuccessClass)):
"ITEM_ALREADY_EXIST"===a.errorCode&&t(b.find(p.addToRegistryDuplicateClass))},error:function(){d.hide();t(b.find(p.addToRegistryErrorClass))}})}y(E.similarityClicked)}});(function(){l.showOneClickSplitDropdown?d():e(document).delegate(D.registryDropdownId,"click",function(a){d();y(E.dropdownClicked)})})();c.on("a:pageUpdate",function(){F=null;l.showOneClickSplitDropdown&&d()});c.declarative("gr-modal-add-to-reg-view-registry-action","click",function(a){f.location.href=a.data&&a.data.type&&a.data.id?
"/registries/gl/owner-view/"+a.data.id+"?ref_\x3dhit_gr_from_dpx":"/wedding/organize-registry?ref_\x3dhit_wr_dp_dp_mdl_vr"});c.declarative("wr-modal-add-to-reg-view-registry-action","click",function(a){f.location.href="/wedding/organize-registry?ref_\x3dhit_wr_dp_dp_mdl_vr"})}});"use strict";A.when("A","a-modal","a-button","a-alert","message-render","create-gift-tag-modal","ready").register("dpx-gift-tag-modal",function(c,f,q,h,k,r){function p(){n(t.giftTagErrorBoxId).removeClass("aok-hidden")}function d(c){n(b.tagListWrapper).html("");
n(b.tagListWrapper).html(c)}function u(b,c,a,e,d,f,k,h){b="/registries/dpx-add-to-registry/"+b.toLowerCase()+"/"+a;h=h?"\x26token\x3d"+encodeURIComponent(h):"";e=b+"?asin\x3d"+f+"\x26quantity\x3d"+k+"\x26tagId\x3d"+e+"\x26tagName\x3d"+encodeURIComponent(d)+h+"\x26ref_\x3dhit_wr_dp_dp_mdl_pop";return{header:c,cache:!1,url:e+"\x26sourceid\x3damazon.ggr.add.dpx.desktop"}}var n=c.$;if(c=c.state("modal-view-gift-tags-state")){var m={selectedRegistryType:"",selectedRegistryId:"",selectedAsin:"",selectedQuantity:"",
selectedToken:""},b={tagModalTrigger:".gr-dpx-tag-modal-trigger",tagModalContent:".gr-dpx-tag-modal",tagTextContent:"#gr-tag-modal-name-input",tagListContainer:".gr-dpx-tag-modal-your-tags-container",tooManyTagsAlert:"#gr-tag-modal-too-many-tags-alert",invalidInputAlert:"#gr-tag-modal-invalid-input-alert",hiddenClass:"aok-hidden",tagListWrapper:".gr-dpx-tag-modal-taglist-wrapper",tagModalChangeover:"#tagModalChangeover",tagHeading:".gr-tag-modal-your-tags-header",closeButton:".gr-tag-modal-back-button",
saveButton:".gr-dpx-tag-modal-save-wrapper"},t={registryTitleComponent:".gr-dpx-tag-modal-header-main",giftTagErrorBoxId:"#"+c.giftTagErrorBoxId,popoverModalName:"wr-modal-add-to-reg-wedding-registry"},w=c.addToHGLModalHeaderText,x=c.addToGiftListModalHeaderText;n(document).delegate(".gr-dpx-add-new-tag","click",function(b){r.renderCreateTagModal(m.selectedRegistryType,m.selectedRegistryId)});n(document).delegate(".gr-tag-modal-back-button","click",function(b){(b=f.get("dpxTagModal"))&&b.show()});
n(document).delegate(".gr-dpx-tag-modal-your-tags-wrapper","click",function(b){b=n(this).attr("tagid");var c=n(this).text(),a={name:t.popoverModalName,header:!0===m.internationalGiftTagsEnabled?x:w,url:""},d=f.get(a.name);d||(d=f.create(n("#GR-DROPDOWN-MODAL-TRIGGER"),a));d.update(u(m.selectedRegistryType,a.header,m.selectedRegistryId,b,c,m.selectedAsin,m.selectedQuantity,m.selectedToken)).show()});return{renderDPXGiftTagModal:function(c,h,a,e,l,q){m.selectedRegistryType=c;m.selectedRegistryId=h;
m.selectedAsin=e;m.selectedQuantity=l;m.selectedToken=q;c=f.get("dpxTagModal");c||(c=b.tagModalTrigger,h={name:"dpxTagModal",width:800,cache:!1,header:x,inlineContent:n(b.tagModalContent)},c=f.create(c,h));h=m.selectedRegistryType;a=m.selectedRegistryId;h&&a?n.ajax({url:"/registries/"+h+"/"+a+"/dpx-get-registry-tags",timeout:5E3}).done(d).fail(p):k.showChangeOver(b.tagModalChangeover,void 0);c.show()}}}});"use strict";A.when("A","a-modal","a-button","a-alert","message-render","ready").register("create-gift-tag-modal",
function(c,f,q,h,k){function r(a,e){c.get("/registries/"+a+"/"+e+"/dpx-get-registry-tags",{cache:!1,success:function(a){d(b.renderModalTagListWrapper).html("");d(b.renderModalTagListWrapper).html(a)},error:function(){x(t.ADD_TAG_FAILURE)}})}function v(a,c){n=a;u=c;var e=f.get("tagModal");if(!e){e=b.tagModalTrigger;var h={name:"tagModal",width:800,cache:!1,hideHeader:!0,inlineContent:d(b.tagModalContent)};e=f.create(e,h)}g({updateType:w.render,token:m},a,c);y();e.show()}var d=c.$,u="",n="",m=c.state("modal-add-to-registry-dropdown-state")?
c.state("modal-add-to-registry-dropdown-state").token:p,b={tagModalTrigger:".gr-tag-modal-trigger",tagModalContent:".gr-tag-modal-container",tagModalMainContent:".gr-tag-modal",tagModalDeleteContent:".gr-tag-modal-delete-flow",tagTextContent:"#gr-tag-modal-name-input",tagListContainer:".gr-tag-modal-your-tags-container",tooManyTagsAlert:"#gr-tag-modal-too-many-tags-alert",invalidInputAlert:"#gr-tag-modal-invalid-input-alert",hiddenClass:"aok-hidden",tagListWrapper:".gr-tag-modal-taglist-wrapper",
tagModalChangeover:"#tagModalChangeover",deleteFlowReplacementSelector:".gr-tag-modal-delete-this-tag",deleteFlowButtonReplacementSelector:".gr-tag-modal-delete-this-button",deleteFlowDeleteButton:".gr-tag-modal-delete-confirm",onOwnerViewSelector:".gr-tag-summary-container-owner",productListExpander:".gr-product-list-expander",productListExpanderSection:"gr-product-list-expander-section",tagSectionTemplate:"#gr-product-list-section-template",tagIdFinderSelector:".gr-tag-modal-your-tags-tag",renderModalTagListWrapper:".gr-dpx-tag-modal-taglist-wrapper"},
t={ADD_TAG_SUCCESS:"ADD_TAG_SUCCESS",REMOVE_TAG_SUCCESS:"REMOVE_TAG_SUCCESS",ADD_TAG_FAILURE:"ADD_TAG_FAILURE",REMOVE_TAG_FAILURE:"REMOVE_TAG_FAILURE"},w={add:"add",remove:"remove",render:"render"},x=function(a){var d="";"ADD_TAG_SUCCESS"===a?d=c.state("tagModalChangeoverStrings").addSuccess:"REMOVE_TAG_SUCCESS"===a?d=c.state("tagModalChangeoverStrings").removeSuccess:"ADD_TAG_FAILURE"===a?d=c.state("tagModalChangeoverStrings").addFailure:"REMOVE_TAG_FAILURE"===a&&(d=c.state("tagModalChangeoverStrings").removeFailure);
k.showChangeOver(b.tagModalChangeover,d)},g=function(a,e,f,h,g){e&&f?(a.ref_="gr-dpx-modal",c.post("/registries/"+e+"/"+f+"/update-tag",{params:a,timeout:5E3,cache:!1,success:function(c){h&&x(h);if(a.updateType===w.remove)r(e,f),v(e,f);else if(d(b.tagListWrapper).html(c),a.updateType===w.add){r(e,f);var g=a.tagName,k=d(d(b.tagSectionTemplate).html()).clone();c=d(c).find(b.tagIdFinderSelector).last().attr("id");k.attr("data-section-id",c);k.find(".gr-product-list-expander-section-name").text(g);d(b.productListExpander).append(k)}},
error:function(){x(g)}})):x(g)},y=function(){d(b.tooManyTagsAlert).hasClass(b.hiddenClass)||d(b.tooManyTagsAlert).addClass(b.hiddenClass);d(b.invalidInputAlert).hasClass(b.hiddenClass)||d(b.invalidInputAlert).addClass(b.hiddenClass);d(b.tagModalMainContent).hasClass(b.hiddenClass)&&d(b.tagModalMainContent).removeClass(b.hiddenClass);d(b.tagModalDeleteContent).hasClass(b.hiddenClass)||d(b.tagModalDeleteContent).addClass(b.hiddenClass);d(b.tagTextContent).val()&&d(b.tagTextContent).val("");k.closeChangeOver(b.tagModalChangeover)};
d(document).delegate(".gr-tag-modal-create-button","click",function(a){a.preventDefault();a=d(b.tagTextContent).val();y();15<=d(b.tagListContainer).children().length?d(b.tooManyTagsAlert).removeClass(b.hiddenClass):a?g({updateType:w.add,tagName:a,token:m},n,u,t.ADD_TAG_SUCCESS,t.ADD_TAG_FAILURE):d(b.invalidInputAlert).removeClass(b.hiddenClass)});d(document).delegate(".gr-tag-modal-your-tags-tag","click",function(a){a.preventDefault();a=d(this).attr("id");var c=d(this).text();d(b.deleteFlowDeleteButton).attr("id",
a);d(b.deleteFlowReplacementSelector).text(c);d(b.deleteFlowButtonReplacementSelector).text(c);d(b.tagModalMainContent).addClass(b.hiddenClass);d(b.tagModalDeleteContent).removeClass(b.hiddenClass)});d(document).delegate(".gr-tag-modal-delete-go-back","click",function(a){a.preventDefault();d(b.tagModalDeleteContent).addClass(b.hiddenClass);d(b.tagModalMainContent).removeClass(b.hiddenClass)});d(document).delegate(".gr-tag-modal-delete-confirm","click",function(a){a.preventDefault();a=d(this).attr("id");
g({updateType:w.remove,tagId:a,token:m},n,u,t.REMOVE_TAG_SUCCESS,t.REMOVE_TAG_FAILURE);d(b.tagModalDeleteContent).addClass(b.hiddenClass);d(b.tagModalMainContent).removeClass(b.hiddenClass)});d(document).delegate(".gr-tag-modal-back-button","click",function(a){a.preventDefault();if(a=f.get("tagModal"))y(),a.hide()});return{renderCreateTagModal:v}});"use strict";A.when("A","ready").register("message-render",function(c){var f=c.$;return{showChangeOver:function(c,h,k){c=f(c);c.stop(!0,!0);c.find("strong").text(h);
c.is(":visible")||c.fadeIn(400);c.delay(2E3).fadeOut(800,function(){k&&k()})},closeChangeOver:function(c){f(c).hide()}}})});
/* ******** */
(function(c){var b=window.AmazonUIPageJS||window.P,g=b._namespace||b.attributeErrors,a=g?g("AudibleDetailPageAssets",""):b;a.guardFatal?a.guardFatal(c)(a,window):a.execute(function(){c(a,window)})})(function(c,b,g){"use strict";c.when("A","jQuery").register("AudibleAddToLibrary",function(a,h){var b=0;return{bindAddToLibrary:function(d){var c=h("#"+d.addToLibrarySectionId),k=h("#"+d.addToLibrarySuccessId),e=h("#"+d.addToLibraryFailureId);a.declarative(d.actionName,"click",function(f){f.$event.preventDefault();
e.hasClass("a-hidden")||e.addClass("a-hidden");f=f.data;h("#"+d.buttonId);0===b&&(b=1,a.ajax(d.ajaxUrl,{method:"post",dataType:"json",params:f,success:function(a){a&&a.code&&"success"===a.code?(b=0,c.hide(),k.removeClass("a-hidden")):e.removeClass("a-hidden")},error:function(){e.removeClass("a-hidden");b=0}}))})}}});c.execute(function(){var a=document.querySelector("#audibleCashSingleOffer .a-box-inner"),b=document.querySelector("#dp.audible #Northstar-Buybox");a?(a=document.querySelector("#dp.audible #Northstar-Buybox #mediamatrix_feature_div"))&&
b&&(a.classList.add("suppress-box-shadow"),b.classList.add("add-box-shadow")):b&&b.classList.add("suppress-box-shadow")});c.when("A","a-accordion","a-carousel-framework","ready").execute(function(a,c,g){function d(){for(var a=g.getAllCarousels(),b=0;b<a.length;b++){var c=a[b];c.__initialized&&c.resize(c)}}a=new b.ResizeObserver(d);c=new b.ResizeObserver(d);var l=new b.ResizeObserver(d),k=document.querySelectorAll("#AudibleBuyboxContainer")[0],e=document.querySelectorAll("#dp.audible #pInfoTabsContainer")[0],
f=document.querySelectorAll("#dp.audible #bookDescription_feature_div")[0];k&&a.observe(k);e&&c.observe(e);f&&l.observe(f)})});
/* ******** */
(function(l){var e=window.AmazonUIPageJS||window.P,m=e._namespace||e.attributeErrors,f=m?m("AudibleSamplePlayerAssets",""):e;f.guardFatal?f.guardFatal(l)(f,window):f.execute(function(){l(f,window)})})(function(l,e,m){"use strict";l.when("A","jQuery").register("AudibleAudioPlayer",function(f,h){function w(b){b.startedListen||(m(b,"StartListening",b.playingStartTimestamp,null),b.startedListen=1);b.isPlaying||m(b,"Listening",b.playingStartTimestamp,b.playingEndTimestamp);b.isEnded&&m(b,"MarkAsFinished",
b.playingEndTimestamp,null)}function m(b,k,a,p){var d={};d.eventType=k;d.asin=b.asin;d.eventTimeStamp=a;p&&(d.eventEndTimeStamp=p);h.ajax("/hz/audible/sampleplayer/stats",{type:"POST",data:d,success:function(a){},error:function(a){}})}function l(b,k){var a="adbl_smpl_";"Play"===k?b.logFirstPlay?(b.logFirstPlay=0,k="FirstPlay",a+="frst_play"):a+="play":"Paused"===k?a+="paus":"Ended"===k&&(a+="endd");h.post("/hz/audible/sampleplayer?s\x3d"+k+"\x26ref\x3d"+a)}function u(b){h.post("/hz/audible/sampleplayer?s\x3d"+
b+"\x26ref\x3dinit")}function e(b){function k(){a.audioObj.addEventListener("ended",function(){a.audioId.trigger("audioEnded");a.isPlaying=0;a.isEnded=1;a.playingEndTimestamp=Date.now();l(a,"Ended");w(a)});a.audioObj.addEventListener("playing",function(){a.audioId.trigger("audioPlaying");a.isPlaying=1;a.playingStartTimestamp=Date.now();l(a,"Play");w(a)});a.audioObj.addEventListener("pause",function(){a.audioId.trigger("audioPaused");a.isPlaying=0;a.playingEndTimestamp=Date.now();l(a,"Paused");w(a)});
a.audioObj.addEventListener("loadstart",function(){a.audioId.trigger("audioLoad");a.isPlaying=0})}var a={initializePlayer:function(b){a.options=b;a.isFirstPlay=1;a.logFirstPlay=1;a.startedListen=0;a.asin=b.asin},play:function(){if(a.isFirstPlay){var p=a.options,d=h("\x3caudio /\x3e");d.attr("id",p.audioId);d.attr("src",p.audioSrc);h("body").append(d);a.audioObj=h("#"+p.audioId).get(0);a.audioId=h("#"+p.audioId);k();"function"===typeof b.bindEventsCallback&&b.bindEventsCallback(a.audioId);a.isFirstPlay=
0;q.push(a)}a.audioObj.play()},pause:function(){a.audioObj.pause()}};return a}var q=[];return function(){var b={init:function(k){if("undefined"!==typeof k.audioSrc&&"undefined"!==typeof k.audioId&&"undefined"!==typeof k.audioControllerId){var a=k.audioSrc,h=document.createElement("audio"),d,a=a.match("[^.]+$");null!==a&&0<a.length&&(a=a[0],"mp3"===a?d="audio/mpeg":"ogg"===a?d="audio/ogg":"wav"===a&&(d="audio/wav"));a=0;h&&h.canPlayType&&h.canPlayType(d)&&h.canPlayType(d).replace(/no/,"")&&(a=1);a?
(u("HTML5Player"),b.player=new e(k),b.player.initializePlayer(k),b.isPlayerAvailable=1):u("InvalidPlayerType")}else u("MissingInitParams")},pause:function(){"undefined"!==typeof b.player&&b.player.pause()},play:function(){if("undefined"!==typeof b.player){b.player.play();for(var h=b.player.options.audioId,a=0;a<q.length;a++){var f=q[a];h!==f.options.audioId&&f.pause()}}}};return b}});"use strict";l.when("A","jQuery","AudibleAudioPlayer","a-popover").register("AudibleSamplePlayer",function(f,h,w,l){function F(){if(t){var a=
Math.round((f.now()-t)/1E3);t=f.now();q("adbl-smpl-played-seconds",a)}else t=f.now()}function u(a){var b=C(v.duration-v.currentTime);h(a+" .time-remaining_text").html(b);var b=1-(v.duration-v.currentTime)/v.duration,d=42*Math.PI;h(a+" .progressCircle").attr("stroke-dashoffset",(1-b)*d);h(a+" .activeProgressBar").attr("x2",100*b+"%")}function C(a){var b=Math.round(a%60);return Math.floor(a/60)%60+":"+(10>b?"0"+b:b)}function q(a,b){d&&d.count&&d.count(a,(d.count(a)||0)+(b||1))}function b(a,b,d){a.player.removeClass("audioPlaySample audioPlaying audioLoading audioPaused");
a.player.addClass(b);d.isAOASamplePlayer?(a.aoaSamplePlayerSprite.removeClass("sampleAudioListen sampleAudioPlaying sampleAudioLoading sampleAudioPaused"),d.isAOAMFPDPVirtualVoiceAsin&&("audioPlaySample"===b?(a.aoaMFPDPVirtualVoiceAsinSampleIcon.attr("width","50px"),a.aoaMFPDPVirtualVoiceAsinSampleIcon.attr("margin-left","-50px")):(a.aoaMFPDPVirtualVoiceAsinSampleIcon.attr("width","66px"),a.aoaMFPDPVirtualVoiceAsinSampleIcon.attr("margin-left","-66px")))):d.isSamplePlayerForBooksAsin?a.sampleTextLong.addClass("a-hidden"):
(a.playSampleText.addClass("a-hidden"),a.playingSampleText.addClass("a-hidden"),a.pausedSampleText.addClass("a-hidden"))}function k(a,b){a.aoaPlaySampleText.addClass("a-hidden");a.aoaPlayingSampleText.addClass("a-hidden");a.aoaPausedSampleText.addClass("a-hidden");a.aoaLoadingSampleText.addClass("a-hidden");b.removeClass("a-hidden")}function a(a,d){b(a,"audioPlaySample",d);d.isAOASamplePlayer?(a.aoaSamplePlayerSprite.addClass("sampleAudioListen"),k(a,a.aoaPlaySampleText)):(a.playButton.removeClass("a-hidden"),
a.pauseButton.addClass("a-hidden"),a.loadingSpinner.addClass("a-hidden"),a.progressBar.addClass("a-hidden"),a.timeRemainingText.addClass("a-hidden"),a.statusButtonContainer.removeClass("status-container-margin"),a.buttonWithData.attr("data-test","sampleAudioListen"),a.buttonWithData.attr("aria-label",a.buttonWithData.attr("data-init-text")),d.isSamplePlayerForBooksAsin?(a.audibleMediaControlHeightLong.removeClass("a-hidden"),a.audibleMediaControlHeightShort.removeClass("a-hidden"),a.sampleTextLong.removeClass("a-hidden")):
a.playSampleText.removeClass("a-hidden"))}var p=[],d=e.ue,t=null,v=null;"object"===typeof d&&"function"===typeof d.count&&d.count("audible-sample-player-js",1);var x="";return{init:function(f){if(f&&f.flashPlayerUrl&&f.container){var e=h(f.container),B=f.container,D=f.pauseCallback,E=f.playCallback,y,z;e.each(function(){var g=h(this);if("undefined"!==typeof g){var e=new w;p.push(e);var r={},A=g.prev();r.audioSrc=A.data("audiosource");r.audioId=A.data("audioid");r.asin=A.data("asin");r.flashPlayerUrl=
f.flashPlayerUrl;r.audioControllerId=g;A=C(0);h(B+" .time-remaining_text").html(A);var c={player:g.find(".clickablePlayer"),sampleTextLong:g.find("#sampleTextLong"),playSampleText:g.find("#playSampleText"),playingSampleText:g.find("#playingSampleText"),pausedSampleText:g.find("#pausedSampleText"),playButton:g.find("#audioSamplePlayButton"),pauseButton:g.find("#audioSamplePauseButton"),loadingSpinner:g.find("#audioSampleLoadingSpinner"),progressBar:g.find(".status-bar-container"),timeRemainingText:g.find(".time-remaining_text"),
statusButtonContainer:g.find(".status-button-container"),buttonWithData:g.find(".a-button-input"),audibleMediaControlHeightLong:g.find(".audibleMediaControlHeightLong"),audibleMediaControlHeightShort:g.find(".audibleMediaControlHeightShort"),aoaSamplePlayerSprite:g.find("#samplePlayerSprite"),aoaPlaySampleText:g.find("#aoaPlaySampleText"),aoaPlayingSampleText:g.find("#aoaPlayingSampleText"),aoaPausedSampleText:g.find("#aoaPausedSampleText"),aoaLoadingSampleText:g.find("#aoaLoadingSampleText"),aoaMFPDPVirtualVoiceAsinSampleIcon:g.find("#mfpdpSampleIconForVirtualVoiceAsin")},
n={isSamplePlayerForBooksAsin:0<g.find("#evoExpBooksSamplePlayerID").length,isAOASamplePlayer:c.aoaPlaySampleText!==m&&0<c.aoaPlaySampleText.length,isAOAMFPDPVirtualVoiceAsin:c.aoaMFPDPVirtualVoiceAsinSampleIcon!==m&&0<c.aoaMFPDPVirtualVoiceAsinSampleIcon.length};n.isAOASamplePlayer&&(c.player=g.find(".audioPlayer"));x=c.player.attr("data-scope");r.bindEventsCallback=function(e){e.bind("audioEnded",function(){a(c,n);f.showPopover&&l.remove(g);q("adbl-smpl-play-ended");d&&d.tag&&d.tag("FinishedAudibleSample");
y&&(t=null,clearInterval(y));z&&clearInterval(z);var b=C(0);h(B+" .time-remaining_text").html(b)});e.bind("audioPlaying",function(){b(c,"audioPlaying",n);n.isAOASamplePlayer?(c.aoaSamplePlayerSprite.addClass("sampleAudioPlaying"),k(c,c.aoaPlayingSampleText)):(c.playButton.addClass("a-hidden"),c.pauseButton.removeClass("a-hidden"),c.loadingSpinner.addClass("a-hidden"),c.progressBar.removeClass("a-hidden"),c.timeRemainingText.removeClass("a-hidden"),c.statusButtonContainer.addClass("status-container-margin"),
c.buttonWithData.attr("data-test","sampleAudioPlaying"),c.buttonWithData.attr("aria-label",c.buttonWithData.attr("data-playing-text")),n.isSamplePlayerForBooksAsin?(c.audibleMediaControlHeightLong.removeClass("a-hidden"),c.audibleMediaControlHeightShort.removeClass("a-hidden")):c.playingSampleText.removeClass("a-hidden"));if(f.showPopover){var a=f.popoverOptions;g&&a&&a.inlineContent&&(a.inlineContent=a.inlineContent.replace(/\/dp\/[a-zA-Z0-9]*\//g,"/dp/"+g.data("asin")+"/"),(a=l.create(g,a))&&a.show())}q("adbl-smpl-play");
d&&d.tag&&d.tag("PlayedAudibleSample");y=setInterval(F,5E3);v=this;u(B);z=setInterval(u.bind(null,B),1E3)});e.bind("audioPaused",function(){b(c,"audioPaused",n);n.isAOASamplePlayer?(c.aoaSamplePlayerSprite.addClass("sampleAudioPaused"),k(c,c.aoaPausedSampleText)):(c.playButton.removeClass("a-hidden"),c.pauseButton.addClass("a-hidden"),c.loadingSpinner.addClass("a-hidden"),c.progressBar.removeClass("a-hidden"),c.timeRemainingText.removeClass("a-hidden"),c.buttonWithData.attr("aria-label",c.buttonWithData.attr("data-paused-text")),
c.statusButtonContainer.addClass("status-container-margin"),n.isSamplePlayerForBooksAsin?(c.audibleMediaControlHeightLong.removeClass("a-hidden"),c.audibleMediaControlHeightShort.removeClass("a-hidden")):c.pausedSampleText.removeClass("a-hidden"));f.showPopover&&l.remove(g);q("adbl-smpl-pause");y&&(t=null,clearInterval(y));z&&clearInterval(z)});e.bind("audioLoad",function(){b(c,"audioLoading",n);n.isAOASamplePlayer?(c.aoaSamplePlayerSprite.addClass("sampleAudioLoading"),k(c,c.aoaLoadingSampleText)):
(c.playButton.addClass("a-hidden"),c.pauseButton.addClass("a-hidden"),c.loadingSpinner.removeClass("a-hidden"),c.progressBar.addClass("a-hidden"),c.timeRemainingText.addClass("a-hidden"),c.statusButtonContainer.removeClass("status-container-margin"),n.isSamplePlayerForBooksAsin&&(c.audibleMediaControlHeightLong.addClass("a-hidden"),c.audibleMediaControlHeightShort.addClass("a-hidden")));f.showPopover&&l.remove(g);q("adbl-smpl-audio-loaded")})};e.init(r);e&&e.isPlayerAvailable&&(a(c,n),g.removeClass("a-hidden"),
g.children().click(function(){e.player.isPlaying?(e.pause(),"undefined"!==typeof D&&D()):(e.play(),"undefined"!==typeof E&&E())}))}});x!==m&&0<x.length&&("function"===typeof uet&&uet("cf",x,{wb:1}),"function"===typeof uex&&uex("ld",x,{wb:1}))}},pause:function(){p.forEach(function(a){a.player.isPlaying&&a.pause()})}}});"use strict";l.when("A","jQuery","AudibleSamplePlayer").execute("AudibleEvoSamplePlayerDynamicSizing",function(f,h,e){f=150;e=h(".audible-sample-evo-container .audioPlaySample .sample-player-width");
e!==m&&0<e.length&&e[0].style!==m&&(e[0].style.width="fit-content",f=Math.max(f,e[0].offsetWidth));f+=1;h=h(".sample-player-width");for(e=0;e<h.length;e++)h[e].style.width=f+"px"})});
/* ******** */
(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(m){var p=window.AmazonUIPageJS||window.P,q=p._namespace||p.attributeErrors,a=q?q("DetailPageDesktopOffersAssets",""):p;a.guardFatal?a.guardFatal(m)(a,window):a.execute(function(){m(a,window)})})(function(m,p,q){m.when("A").register("add-to-form",function(a){return{addInputToForm:function(a,d,k,b){var e=document.createElement("input");e.id=a;e.type="hidden";e.name=k;e.value=b;d.appendChild(e)}}});"use strict";m.when("A","add-to-cart-parameter-name","add-to-cart-constants","add-to-form","afterLoad").execute("giftOptions-autoUpdate",
function(a,f,d,k){var b=a.$;b("input[type\x3d'checkbox'][id\x3d'gift-wrap']").each(function(){if(b(this).is(":checked")){var a=f.constructParameterName(d.ITEM_TYPES.BASE,0,d.PARAMETER_PATHS.GIFTOPTIONS),g=b(this).get(0).form;g&&k.addInputToForm("giftCheckBoxInput",g,a,"true")}})});"use strict";m.when("A","add-to-cart-parameter-name","add-to-cart-constants","add-to-form").execute("giftOptions-update",function(a,f,d,k){function b(){e("input[type\x3d'checkbox'][id\x3d'gift-wrap']").each(function(){e(this).change(function(){if(e(this).is(":checked")){var a=
f.constructParameterName(d.ITEM_TYPES.BASE,0,d.PARAMETER_PATHS.GIFTOPTIONS),b=e(this).get(0).form;b&&k.addInputToForm("giftCheckBoxInput",b,a,"true")}else(a=e('[id\x3d"giftCheckBoxInput"]'))&&a.remove()})})}var e=a.$;b();a.on("a:pageUpdate",function(){b()})});"use strict";m.when("A","add-to-cart-parameter-name","add-to-cart-constants","dp-get-offerDisplay-container").execute("quantity-update",function(a,f,d,k){function b(c){if(c&&c.value!==q&&c.nativeItemNode&&c.nativeItemNode.form!==q){var a=g(c.nativeItemNode.form);
a&&(a=a.find(h))&&a.val(c.value);a=k.getOfferDisplayContainerByElement(g(c.nativeItemNode));e(a,"form#addToCart",l,c.value);e(a,"form#buyNow","quantity",c.value)}}function e(a,b,d,e){0<a.length&&b&&(a=a.find(b+" input[name\x3d'"+d+"']"),0<a.length&&a.val(e))}var g=a.$,l=f.constructParameterName(d.ITEM_TYPES.BASE,0,d.PARAMETER_PATHS.QUANTITY),h='input[name\x3d"'+l+'"]';a.on("addToCartQuantityChange",b);a.on("a:dropdown:quantity:select",b)});"use strict";m.when("jQuery","a-popover","A","a-dropdown",
"moq-core","ready").register("moq",function(a,f,d,k,b){function e(n,c){0===k.getSelect(c).val().length?b.lockSubmission(n,a.noop,u):b.unlockSubmission(n,m)}function g(n){n=b.findMoqOfferContainerWithDomElement(n.nativeItemNode);if(null!==n){var a=n.find("#quantity, #rcxsubsQuan");e(n,a);b.tweakDisplayTextForMoqQuantityDropdown(a)}}function l(n){return b.findMoqOfferContainerWithDomElement(n.popover.$trigger[0]).find("#quantity, #rcxsubsQuan")}function h(){t||(d.on("a:popover:beforeShow:moqAtcPopover",
function(n){var a=l(n);0!==a.length&&(q(a),setTimeout(function(){a.addClass("highlightQuantityDropdownBorder")},20))}),d.on("a:popover:afterHide:moqAtcPopover",function(a){a=l(a);0!==a.length&&(a.removeClass("highlightQuantityDropdownBorder"),p(a))}),d.on("a:popover:beforeShow:MOQPreLoadPopOver",function(a){a=l(a);0!==a.length&&q(a)}),d.on("a:popover:afterHide:MOQPreLoadPopOver",function(a){a=l(a);0!==a.length&&p(a)}),d.on("a:dropdown:rcxsubsQuan:select",g),d.on("a:dropdown:quantity:select",g),t=
!0)}function c(a){var c=a.parent().parent("div").innerWidth()-a.prev("label").outerWidth()-5;100<c&&a.width(c)}function u(a){if(null===f.get(a)){var c=b.findMoqOfferContainerWithDomElement(a[0]).find("script#moqPopoverContent");0!==c.length&&(c=c.html(),a.addClass("cursorDisabled"),f.create(a,{name:"moqAtcPopover",position:"triggerLeft",closeButton:"false",inlineContent:c}))}}function m(a){null!==f.get(a)&&(a.removeClass("cursorDisabled"),f.remove(a))}function p(a){setTimeout(function(){r--;0<r||
(a.prop("disabled",!1),a.removeClass("quantityBarGrayOut"))},370)}function q(a){r++;0===k.getSelect(a).val().length&&(a.prop("disabled",!0),a.addClass("quantityBarGrayOut"))}function v(a){var b=a.find("#quantity, #rcxsubsQuan");if(0!==b.length&&!b.hasClass("aok-hidden")){var d=k.getSelect(b);d.setValue("");null===d.val()&&d.setValue(d.options.$select[0].options[0].value);c(b);w(a);e(a,b)}}function w(a){if(0!==a.length){var b=a.find("#quantity, #rcxsubsQuan");a.click(function(){setTimeout(function(){c(b)},
20)})}}var t=!1,r=0;return{initializeQuantitySelect:function(){var a=b.findMoqOfferContainers();0!==a.length&&(a.forEach(v),h())}}});"use strict";m.when("dp-click-counter").execute("dp-desktop-atc-click-counter",function(a){var f=document.getElementById("add-to-cart-button");f&&a.record(f,"dp-desktop-atc")});"use strict";m.when("A","ready").execute(function(a){function f(){for(var c=a.$(".offersConsistencyEnabled"),b=[],d=0;d<c.length;d++)"undefined"!=typeof c[d]&&null!=c[d]&&b.push(c[d].children);
return b}function d(c){c.length&&(e=a.$("#buybox .a-accordion-active"),e.length&&(g=e.index()));g=k(g)}function k(c){var b=a.$("#offerDisplayGroupTabSet #tab_heading_desktop_buybox_group_2");b.length&&0===b.index()&&(c+=1);return c}function b(){var c=a.$("#offerDisplayGroupTabSet #tab_heading_desktop_buybox_group_2");c.length&&h.length&&(c=c.index(),h[0].length&&(0===c?l=0:l=h[0].length-1))}var e,g=0,l=0,h=f();d(h);b();a.on("a:pageUpdate",function(){h=f();d(h);b()});a.on("a:accordion:buybox-accordion:select",
function(c){c=a.$(c.selectedRow.$row).index();c=k(c);for(var b=0;b<h.length;b++)h[b][g].style.display="none",h[b][c].style.display="block";g=c});a.on("a:tabs:offerDisplayGroup_tabs:select",function(b){b=a.$(b.selectedTab.$tab).index();for(var c=0;c<h.length;c++)h[c][0===l?l:g].style.display=0===b?"block":"none",h[c][0===l?g:l].style.display=0===b?"none":"block"})});m.when("A","ready").execute("quantity-selector-metrics",function(a){function f(a){p.ue&&p.ue.count(a,(ue.count(a)||0)+1)}a.on("a:dropdown:select",
function(a){try{var d=a.name,b=a.value;if("quantity"===d||"rcxsubsQuan"===d)f("desktop:quantitySelected_"+b),1<b&&f("desktop:quantitySelected:moreThanOne")}catch(e){f("desktop:quantitySelected:error")}})})});
/* ******** */
(function(f){var h=window.AmazonUIPageJS||window.P,n=h._namespace||h.attributeErrors,b=n?n("GoldboxUDPAssets",""):h;b.guardFatal?b.guardFatal(f)(b,window):b.execute(function(){f(b,window)})})(function(f,h,n){f.when("A").execute("dealsx-constants",function(b){h.DealsX||(h.DealsX={});DealsX.constants={AAPI_V1_QUANTITY_RESTRICTION_VIOLATION_ERROR:"deal.claim.quantity-restriction-violation.error/v1",AAPI_V1_ERROR_TYPE:"error/v1"};DealsX.CustomerStates={NONE:"NONE",IN_CART:"IN_CART",PENDING_ADD_TO_CART:"PENDING_ADD_TO_CART",
CLAIMED:"CLAIMED",EXPIRED:"EXPIRED",UNKNOWN:"UNKNOWN"};DealsX.DealStates={AVAILABLE:"AVAILABLE",UPCOMING:"UPCOMING",WAITLISTFULL:"WAITLISTFULL",UNKNOWN:"UNKNOWN"};DealsX.Events={DEAL_TIMER_EXPIRED:"dealsx:gsod:buybox:deal-timer-expired"};DealsX.ApiNames={CLAIM_AND_ADD_TO_CART:"ClaimAndAddToCart",CART_COUNT:"CartCount",CART_ADD_ITEMS:"CartAddToCart"};DealsX.RenderingPlatform={MOBILE_WEB:"MOBILE_WEB",SHOPPING_APP:"SHOPPING_APP",DESKTOP:"DESKTOP"};DealsX.AppAccessRenderingComponent={APP_DOWNLOAD_BUTTON:"APP_DOWNLOAD_BUTTON",
LEARN_MORE_MESSAGE:"LEARN_MORE_MESSAGE",NOTHING:"NOTHING"};DealsX.DeviceAttributes={SHOPPING_APP:"APP,APP_MASH",MOBILE_WEB:"MOBILE",DESKTOP:"DESKTOP"}});f.when("A").execute("dealsx-timer-ticker",function(b){b.interval(function(){b.trigger("dealsx-timer-tick")},1E3)});f.when("A").register("dealsx-productv2-service",function(b){return b.createClass({endpointUrl:null,offerListingID:null,headers:null,_request:null,setup:function(b){this.abortRequest();this.endpointUrl=b.aapiEndpoint;this.offerListingId=
b.offerListingId;this.headers=this.getHeaders(b)},callProductV2:function(c,a,d){var e=this;e._request=b.$.ajax({url:this.endpointUrl+"?buyingOptionTypes\x3dLIGHTNING_DEAL\x26offerListingId\x3d"+this.offerListingId,type:"GET",headers:this.headers,xhrFields:{withCredentials:!0},success:c,error:a,complete:function(){e._request=null;d&&d()}})},abortRequest:function(){this._request&&this._request.abort()},getDeviceAttributes:function(b){return b.app?DealsX.DeviceAttributes.SHOPPING_APP:b.mobile?DealsX.DeviceAttributes.MOBILE_WEB:
DealsX.DeviceAttributes.DESKTOP},getHeaders:function(b){var a={"Accept-Language":b.languageOfPreference,Accept:'application/vnd.com.amazon.api+json; type\x3d"product/v2"; expand\x3d"buyingOptions[].dealDetails(product.deal-details/v1),buyingOptions[].callToAction(product.call-to-action/v1),buyingOptions[].dealCustomerStatus(product.deal-customer-status/v1)"',"x-api-csrf-token":b.aapiCsrfToken,"x-amzn-device-attributes":this.getDeviceAttributes(b)};b.slateToken&&(a["x-amzn-encrypted-slate-token"]=
b.slateToken);return a}})});f.when("A","dealsx-productv2-service").register("dealsx-poller-service",function(b,c){return b.createClass({statusCallbackHandler:null,productV2Service:null,pollingIntervalMs:null,continuePolling:!0,init:function(){this.productV2Service=new c},setup:function(a){this.productV2Service.setup(a);this.pollingIntervalMs=a.pollingIntervalMs;this.continuePolling=!0},callProductV2:function(a,b){var d=this;d.productV2Service.callProductV2(function(b){d.provideBuyingOptionToSuccessCallback(b,
a)},b)},connect:function(a,d,e){var g=this,c=function(){g.productV2Service.callProductV2(function(b){g.provideBuyingOptionToSuccessCallback(b,a)},function(a){d&&d(a)},function(){e&&e();g.continuePolling&&(g.statusCallbackHandler=b.delay(c,g.pollingIntervalMs))})};c()},disconnect:function(){this.continuePolling=!1;null!==this.statusCallbackHandler&&(clearTimeout(this.statusCallbackHandler),this.statusCallbackHandler=null)},provideBuyingOptionToSuccessCallback:function(a,b){a=this.extractLightningDealBuyingOption(a);
b&&b(a)},extractLightningDealBuyingOption:function(a){if(a&&a.entity&&a.entity.buyingOptions)for(var b=0;b<a.entity.buyingOptions.length;b++){var e=a.entity.buyingOptions[b];if("LIGHTNING_DEAL"===e.type)return e}return null}})});f.when("A","dealsx-model","dealsx-deal-redemption-service","dealsx-redemption-view","dealsx-quantity-view","dealsx-progress-view","dealsx-timer-view","dealsx-header-view","dealsx-prime-access-view","dealsx-app-access-view","dealsx-cart-aapi-service","dealsx-warranty-view").register("dealsx-deal-controller",
function(b,c,a,d,e,g,m,k,l,h,p,q){return b.createClass({dealPollerController:null,dealRedemptionService:null,views:[],headerView:null,redemptionView:null,quantityView:null,timerView:null,primeAccessView:null,appAccessView:null,warrantyView:null,dealModel:null,buying:!1,cartAAPIService:null,init:function(a){},getSlateToken:function(){var a=b.$('meta[name\x3d"encrypted-slate-token"]');if(a.length&&a.attr("content"))return a.attr("content");DealsX.recordAPIMetrics({apiName:"getSlateToken",isSuccess:!1})},
setup:function(b){if(b){b.slateToken=this.getSlateToken();var d=b.systemTime?Date.now()-b.systemTime:0;this.dealModel=new c({setupData:b,clockOffset:d});this.setupDealPollerController(b);this.dealRedemptionService=new a(b);this.cartAAPIService=new p(b);this.setupBuyboxViews(b);this.onModelUpdate(this.dealModel);this.subscribeToAccordionEvents()}else f.log("No setupData passed for setup method of deal controller","ERROR","DealController")},setupDealPollerController:function(a){var d=this;f.when("dealsx-poller-service").execute(function(e){d.dealPollerController?
d.dealPollerController.disconnect():d.dealPollerController=new e;d.dealPollerController.setup(a);d.dealPollerController.connect(function(a){a?(d.dealModel.updateDealModelContent(a),d.onModelUpdate(d.dealModel)):d.headerView&&(d.dealPollerController.disconnect(),d.headerView.showDealUnavailableView())});b.off(DealsX.Events.DEAL_TIMER_EXPIRED);b.on(DealsX.Events.DEAL_TIMER_EXPIRED,function(){d.dealPollerController.callProductV2(function(a){a?(d.redemptionView.hideProcessingView(),d.dealModel.updateDealModelContent(a),
d.onModelUpdate(d.dealModel)):d.headerView&&(d.dealPollerController.disconnect(),d.headerView.showDealUnavailableView())})})})},setupBuyboxViews:function(a){var c=this,f=b.$("#dealsAccordionRow");f=0<f.length?f:b.$("#dealsx-single-offer-display-box");c.primeAccessView=l.getView({rootContainer:f,dealModel:c.dealModel});c.redemptionView=d.getView({rootContainer:f,setupData:a});c.appAccessView=h.getView({rootContainer:f,dealModel:c.dealModel,setupData:a});c.timerView=m.getView({rootContainer:f,clockOffset:c.dealModel.clockOffset,
startTime:c.dealModel.dealDetails.startTime,endTime:c.dealModel.dealDetails.endTime});c.redemptionView.initializeButtons(function(a){if(a){var d=c.quantityView.getQuantity();c.buying=!0;c.dealRedemptionService.claimDeal(a.dealId,a.itemId,a.purchaseRefTag,d,function(a,d){a&&(a&&a.dealAsinState&&a.customerState&&(c.dealModel.translateClaimDealResponse({customerState:a.customerState,itemState:a.dealAsinState,msToCustomerStateExpiry:a.msUntilExpiration}),c.buying=!1),c.redemptionView.hideProcessingView(),
c.updateNavigationCartQuantity(),c.onModelUpdate(c.dealModel),b.trigger("deals_claimDealSuccess"))},function(a,d){c.redemptionView.hideProcessingView();d===DealsX.constants.AAPI_V1_QUANTITY_RESTRICTION_VIOLATION_ERROR?(c.dealModel.canCustomerClaimPrimeOnlyDOTD=!1,c.redemptionView.showPodotdQuantityLimitExceeded()):c.redemptionView.showRedemptionFailed();b.trigger("deals_claimDealError")})}});c.quantityView=e.getView({rootContainer:f,setupData:a});c.headerView=k.getView({rootContainer:f});c.progressView=
g.getView({rootContainer:f});c.warrantyView=q.getView({rootContainer:f});c.addView(c.headerView);c.addView(c.progressView);c.addView(c.primeAccessView);c.addView(c.quantityView);c.addView(c.timerView);c.addView(c.redemptionView);c.addView(c.appAccessView);c.addView(c.warrantyView)},onModelUpdate:function(a){this.buying||this.views.forEach(function(b){return b.onModelUpdate(a)})},updateNavigationCartQuantity:function(){var a=this;a.cartAAPIService.getCount(function(b,d){(b=a.retrieveQuantity(b))&&
a.displayQuantity(b)},function(a){})},retrieveQuantity:function(a){return a&&a.entity?a.entity.items:null},displayQuantity:function(a){f.when("nav.setCartCount").execute(function(b){b(a)});f.when("mash").execute(function(b){b.cart.didUpdate({newCartQuantity:parseInt(a,10)})})},addView:function(a){null!==a&&this.views.push(a)},subscribeToAccordionEvents:function(){b.on("a:accordion:buybox-accordion:select",function(a){a&&a.selectedRow&&("dealsAccordionRow"===a.selectedRow.rowName?b.trigger("deals_onSelectLDBuybox"):
b.trigger("deals_onSelectRegularBuybox"))})},addItemsToCart:function(a,b){var d=this;d.cartAAPIService.addItems(a,b,function(a,b){a&&"cart.add-items/v1"===a.type&&(a=a.entity.count.entity.items)&&d.displayQuantity(a)},function(a){})}})});f.when("A").register("dealsx-model",function(b){var c=b.$;return b.createClass({callToAction:null,dealDetails:null,dealCustomerStatus:null,deviceType:null,canCustomerClaimPrimeOnlyDOTD:!0,hasPrimeSavingsBenefit:!1,clockOffset:0,init:function(a){if(a&&a.setupData){var b=
a.setupData.itemCustomerState;b&&(b.dealDetails&&(this.dealDetails=JSON.parse(b.dealDetails)),b.dealCustomerStatus&&(this.dealCustomerStatus=JSON.parse(b.dealCustomerStatus)),b.callToAction&&(this.callToAction=JSON.parse(b.callToAction)));this.hasPrimeSavingsBenefit=a.setupData.hasPrimeSavingsBenefit||!1;this.clockOffset=a.clockOffset;this.deviceType={isMobile:a.setupData.mobile,isApp:a.setupData.app}}},updateDealModelContent:function(a){this.callToAction=a.callToAction?a.callToAction.entity:null;
this.dealDetails=a.dealDetails?a.dealDetails.entity:null;this.dealCustomerStatus=a.dealCustomerStatus?a.dealCustomerStatus.entity:null},translateClaimDealResponse:function(a){a&&(c.extend(this.dealDetails,this.buildDealState(a)),c.extend(this.dealCustomerStatus,this.buildDealCustomerState(a)),this.isCustomerStateIsEqualTo("IN_CART")&&(this.callToAction={}))},buildDealCustomerState:function(a){if(!a.customerState)return{};var b=new Date((new Date).getTime()+parseInt(a.msToCustomerStateExpiry));return{state:this.convertClaimDealCustomerStateToProductV2CompatibleCustomerState(a.customerState),
expiryTime:b.toISOString()}},buildDealState:function(a){return{state:this.convertClaimDealDealStateToProductV2CompatibleDealState(a)}},isCustomerStateInCart:function(){return this.isCustomerStateIsEqualTo(DealsX.CustomerStates.IN_CART)},isCustomerStatePendingATC:function(){return this.isCustomerStateIsEqualTo(DealsX.CustomerStates.PENDING_ADD_TO_CART)},isDealStateIsEqualTo:function(a){return this.dealDetails?this.dealDetails.state===a:!1},isCustomerStateIsEqualTo:function(a){return this.dealCustomerStatus?
this.dealCustomerStatus.state===a:!1},getCurrentServerTime:function(){return new Date(Date.now()-this.clockOffset)},isDealInPrimeEarlyAccessWindowForPrimeCustomer:function(){if(!this.dealDetails||!this.dealDetails.startTime||null===this.dealDetails.earlyAccessDurationInMilliseconds)return!1;var a=this.getCurrentServerTime(),b=Date.parse(this.dealDetails.startTime),c=b+this.dealDetails.earlyAccessDurationInMilliseconds;a=b<=a&&a<c;return this.isDealPrimeEarlyAccess()&&a},isDealInPrimeEarlyAccessWindowForNonPrimeCustomer:function(){if(!this.dealDetails||
!this.dealDetails.startTime||null===this.dealDetails.earlyAccessDurationInMilliseconds)return!1;var a=this.getCurrentServerTime(),b=Date.parse(this.dealDetails.startTime);a=b-this.dealDetails.earlyAccessDurationInMilliseconds<=a&&a<b;return this.isDealPrimeEarlyAccess()&&a},isDealInPrimeEarlyAccessWindow:function(){return this.hasPrimeSavingsBenefit?this.isDealInPrimeEarlyAccessWindowForPrimeCustomer():this.isDealInPrimeEarlyAccessWindowForNonPrimeCustomer()},isDealPrimeEarlyAccess:function(){return this.dealDetails&&
"PRIME_EARLY_ACCESS"===this.dealDetails.accessBehavior},isDealAppOnly:function(){return this.dealDetails&&"APP_ONLY_LD"===this.dealDetails.accessBehavior},isDealPrimeOnly:function(){return this.dealDetails&&"PRIME_ONLY"===this.dealDetails.accessBehavior},isDealPrimeOnlyDotd:function(){return this.isDealPrimeOnly()&&"DEAL_OF_THE_DAY"===this.dealDetails.type},isDealAccessibleToCustomer:function(){return this.hasPrimeSavingsBenefit||!this.isDealInPrimeEarlyAccessWindowForNonPrimeCustomer()&&!this.isDealPrimeOnly()},
getCustomerStateExpiryTime:function(){return this.dealCustomerStatus?this.dealCustomerStatus.expiryTime:null},convertClaimDealCustomerStateToProductV2CompatibleCustomerState:function(a){switch(a){case "NONE":return DealsX.CustomerStates.NONE;case "INCART":return DealsX.CustomerStates.IN_CART;case "PENDINGATC":return DealsX.CustomerStates.PENDING_ADD_TO_CART;case "CLAIMED":return DealsX.CustomerStates.CLAIMED;case "EXPIRED":return DealsX.CustomerStates.EXPIRED;default:return DealsX.CustomerStates.UNKNOWN}},
convertClaimDealDealStateToProductV2CompatibleDealState:function(a){switch(a){case "AVAILABLE":return DealsX.DealStates.AVAILABLE;case "UPCOMING":return DealsX.DealStates.UPCOMING;case "WAITLISTFULL":return DealsX.DealStates.WAITLISTFULL;default:return DealsX.DealStates.UNKNOWN}},getRenderingPlatform:function(){return this.deviceType.isApp?DealsX.RenderingPlatform.SHOPPING_APP:this.deviceType.isMobile?DealsX.RenderingPlatform.MOBILE_WEB:DealsX.RenderingPlatform.DESKTOP}})});f.when("A").register("dealsx-prime-access-view",
function(b){var c=b.createClass({primeAccessMessageView:null,init:function(a){this.primeAccessMessageView=a.rootContainer.find("#dealsx_prime_access_view")},onModelUpdate:function(a){a.isDealInPrimeEarlyAccessWindow()?b.show(this.primeAccessMessageView):b.hide(this.primeAccessMessageView)}});return{getView:function(a){return a.dealModel.isDealPrimeEarlyAccess()?new c(a):null}}});f.when("A").register("dealsx-app-access-view",function(b){var c=b.createClass({learnMoreMessage:null,appDownloadButton:null,
addToCartButton:null,renderingPlatform:null,init:function(a){this.appDownloadButton=a.rootContainer.find("#app-download-button");this.learnMoreMessage=a.rootContainer.find("#app-only-deal-learn-more-message");this.addToCartButton=a.rootContainer.find("#dealsx_atc_btn");this.renderingPlatform=a.dealModel.getRenderingPlatform()},onModelUpdate:function(a){a=this.getRenderingComponent()[this.renderingPlatform](a);this.renderComponent(a)},renderComponent:function(a){switch(a){case DealsX.AppAccessRenderingComponent.APP_DOWNLOAD_BUTTON:b.show(this.appDownloadButton);
b.hide(this.learnMoreMessage);b.hide(this.addToCartButton);break;case DealsX.AppAccessRenderingComponent.LEARN_MORE_MESSAGE:b.show(this.learnMoreMessage);b.hide(this.appDownloadButton);break;default:b.hide(this.appDownloadButton),b.hide(this.learnMoreMessage)}},getRenderingComponent:function(){return{SHOPPING_APP:function(){return DealsX.AppAccessRenderingComponent.LEARN_MORE_MESSAGE},MOBILE_WEB:function(a){return a.isCustomerStateIsEqualTo(DealsX.CustomerStates.IN_CART)?DealsX.AppAccessRenderingComponent.LEARN_MORE_MESSAGE:
DealsX.AppAccessRenderingComponent.APP_DOWNLOAD_BUTTON},DESKTOP:function(a){return a.isCustomerStateIsEqualTo(DealsX.CustomerStates.IN_CART)?DealsX.AppAccessRenderingComponent.NOTHING:DealsX.AppAccessRenderingComponent.APP_DOWNLOAD_BUTTON}}}});return{getView:function(a){return a.setupData.showAppOnlyDealCx?new c(a):null}}});f.when("A","dealsx-processing-view","dealsx-redemption-countdown-timer","a-button").register("dealsx-redemption-view",function(b,c,a,d){var e=b.createClass({addToCartButton:null,
processingView:null,inCartView:null,inCartTimer:null,pendingAddToCartView:null,pendingAddToCartTimer:null,waitlistFullMessageView:null,itemQuantityView:null,podotdQuantityLimitMessageView:null,redemptionFailedMessageView:null,pushNotificationInfo:null,init:function(d){var e=d.rootContainer,g=this;g.processingView=c.getView(d);g.inCartView=e.find("#dealsx_incart");g.pendingAddToCartView=e.find("#dealsx_pending_atc");g.waitlistFullMessageView=e.find("#dealsx_waitlist_full_message");g.itemQuantityView=
e.find("#dealsx_quantity_view");g.redemptionFailedMessageView=e.find("#dealsx_redemption_failed");g.podotdQuantityLimitMessageView=e.find("#dealsx_podotd_quantitylimit_message");g.inCartTimer=a.getView({timerView:e.find("#dealsx_checkout_timer"),onTimeoutCallback:function(){g.processingView.showClaimingProgress();b.hide(g.inCartView);b.delay(function(){b.trigger(DealsX.Events.DEAL_TIMER_EXPIRED)},1E3)}});this.pendingAddToCartTimer=a.getView({timerView:e.find("#dealsx_pending_atc_timer"),onTimeoutCallback:function(){b.hide(g.pendingAddToCartView)}})},
initializeButtons:function(a){var c=this;c.addToCartButton=d("#dealsx_atc_btn");c.addToCartButton.enable();b.declarative("dealsx-addtocart-button-action","click",function(b){b.data&&b.data.actionEnabled&&(delete b.data.actionEnabled,c.addToCartButton.hide(),c.processingView.showClaimingProgress(),a(b.data))})},onModelUpdate:function(a){var c=!0;a.dealCustomerStatus&&"IN_CART"===a.dealCustomerStatus.state?(this.inCartTimer.targetDate||(c=new Date(Date.parse(a.dealCustomerStatus.expiryTime)),this.inCartTimer.setTargetDate(c)),
b.show(this.inCartView),c=!1):(this.inCartTimer.stop(),b.hide(this.inCartView));a.dealCustomerStatus&&"PENDING_ADD_TO_CART"===a.dealCustomerStatus.state?(b.show(this.pendingAddToCartView),this.pendingAddToCartTimer.targetDate||(c=new Date(Date.parse(a.dealCustomerStatus.expiryTime)),this.pendingAddToCartTimer.setTargetDate(c)),c=!0):(this.pendingAddToCartTimer.stop(),b.hide(this.pendingAddToCartView));a.dealDetails&&"WAITLISTFULL"===a.dealDetails.state&&a.isDealAccessibleToCustomer()?(b.show(this.waitlistFullMessageView),
c=!1):b.hide(this.waitlistFullMessageView);a.callToAction&&a.callToAction.addToCart?this.addToCartButton.show():this.addToCartButton.hide();c?b.show(this.itemQuantityView):b.hide(this.itemQuantityView)},showRedemptionFailed:function(){b.show(this.redemptionFailedMessageView)},showPodotdQuantityLimitExceeded:function(){b.show(this.podotdQuantityLimitMessageView)},hideProcessingView:function(){this.processingView.hide()}});return{getView:function(a){return new e(a)}}});f.when("A").register("dealsx-redemption-countdown-timer",
function(b){var c=b.createClass({targetDate:null,timerView:null,onTimeoutCallback:null,init:function(a){var c=this;c.timerView=a.timerView;c.targetDate=a.targetDate;c.onTimeoutCallback=a.onTimeoutCallback;b.on("dealsx-timer-tick",function(){c.render()})},setTargetDate:function(a){this.targetDate=a;this.render()},stop:function(){this.targetDate=null},render:function(){if(this.targetDate){var a=this.targetDate.getTime()-(new Date).getTime(),b=Math.floor(a/6E4%60);a=Math.floor(a/1E3%60);var c=b+":"+
("0"+a).slice(-2);this.timerView&&this.timerView.html(c);if(0===b&&0==a){if(this.onTimeoutCallback)this.onTimeoutCallback();this.stop()}}}});return{getView:function(a){return new c(a)}}});f.when("A").register("dealsx-quantity-view",function(b){var c=b.createClass({quantity:1,init:function(a){this.subscribeToQuantityChangeEvents()},getQuantity:function(){return this.quantity},onModelUpdate:function(a){},subscribeToQuantityChangeEvents:function(){var a=this;b.on("a:dropdown:selected:dealx_quantity_dropdown",
function(b){a.quantity=b.value})}});return{getView:function(a){return new c(a)}}});f.when("A").register("dealsx-processing-view",function(b){var c=b.createClass({processingView:null,processingMessage:null,init:function(a){this.processingView=a.rootContainer.find("#dealsx_processing_view");this.processingMessage=this.processingView.find("#dealsx_processing_msg")},hide:function(){b.hide(this.processingView);b.hide(this.processingMessage)},showClaimingProgress:function(){b.show(this.processingMessage);
b.show(this.processingView)}});return{getView:function(a){return new c(a)}}});f.when("A","dealsx-timer-countdown").register("dealsx-timer-view",function(b,c){var a=b.$,d=b.createClass({startTimerView:null,endTimerView:null,clockOffset:0,startTime:null,endTime:null,init:function(a){this.clockOffset=a.clockOffset;this.startTime=Date.parse(a.startTime);this.endTime=Date.parse(a.endTime);var d=b.$(a.rootContainer);this.isDealStarted()||(this.startTimerView=c.getView({timerView:d.find("#dealsx-start-timer"),
targetTime:Date.parse(a.startTime),clockOffset:a.clockOffset,onTimerExpired:this.onTimerExpired}));this.endTimerView=c.getView({timerView:d.find("#dealsx-end-timer"),targetTime:Date.parse(a.endTime),clockOffset:a.clockOffset,onTimerExpired:this.onTimerExpired})},onTimerExpired:function(){b.delay(function(){b.trigger(DealsX.Events.DEAL_TIMER_EXPIRED)},1E3)},onModelUpdate:function(b){b.dealDetails&&(b.isCustomerStateInCart()||b.isCustomerStatePendingATC()?this.endTimerView.hide():this.startTimerView?
(a("#dealsx-start-timer").addClass("a-color-success"),this.isDealStarted()&&(this.startTimerView.hide(),this.endTimerView.show())):(this.endTimerView.show(),this.isDealEnding()&&a("#dealsx-end-timer").addClass("a-color-success")))},isDealStarted:function(){return Date.now()-this.clockOffset>this.startTime},isDealEnding:function(){var a=Date.now()-this.clockOffset;return 18E5>this.endTime-a}});return{getView:function(a){return new d(a)}}});f.when("A","dealsx-polyfills").register("dealsx-timer-countdown",
function(b,c){c.padStart();var a=b.createClass({init:function(a){this.timerView=a.timerView;this.targetTime=a.targetTime;this.clockOffset=a.clockOffset;this.onTimerExpired=a.onTimerExpired;var c=this;b.on("dealsx-timer-tick",b.$.proxy(function(){c.countdown()},this))},countdown:function(){var a=Date.now()-this.clockOffset;a=(this.targetTime-a)/1E3|0;if(!(0>a))if(0===a)this.onTimerExpired();else{var b=Math.floor(a/86400),c=Math.floor(a/3600),f=Math.floor(a/60%60),k=Math.floor(a%60);a=this.timerView.find(".timer-days");
var l=this.timerView.find(".timer-precise");if(0<b)c=a.find(".singular"),f=a.find(".plural"),k=f.find(".value"),a.show(),l.hide(),1===b?(c.show(),f.hide()):(c.hide(),f.show(),k.text(b));else{b=l.find(".timer-hours \x3e .value");var h=l.find(".timer-minutes \x3e .value"),p=l.find(".timer-seconds \x3e .value");a.hide();l.show();b.text(c.toString().padStart(2,"0"));h.text(f.toString().padStart(2,"0"));p.text(k.toString().padStart(2,"0"))}}},hide:function(){b.hide(this.timerView)},show:function(){b.show(this.timerView)}});
return{getView:function(b){return new a(b)}}});f.when("A").register("dealsx-progress-view",function(b){var c=b.createClass({progressView:null,progressBarBase:null,progressBarTick:null,claimedMessage:null,init:function(a){a=a.rootContainer;this.progressView=a.find("#dealsx_progress_view");this.progressBarBase=a.find("#dealsx_progress_bar \x3e .progbar");this.progressBarTick=a.find("#dealsx_progress_bar \x3e .progbartick");this.claimedMessage=a.find("#dealsx_percent_message")},onModelUpdate:function(a){if(a.dealDetails&&
null!=a.dealDetails.percentClaimed&&a.dealDetails.percentClaimedMessage){!a.dealCustomerStatus||"IN_CART"!==a.dealCustomerStatus.state&&"PENDING_ADD_TO_CART"!==a.dealCustomerStatus.state?b.show(this.progressView):b.hide(this.progressView);var c=a.dealDetails.percentClaimed;this.progressBarBase.css("width",c+"%");this.progressBarTick.css("width",c+"%");this.claimedMessage.text(a.dealDetails.percentClaimedMessage);89>=c?this.claimedMessage.removeClass("a-color-error").removeClass("a-color-success").addClass("a-color-base"):
99>=c?this.claimedMessage.removeClass("a-color-base").removeClass("a-color-error").addClass("a-color-success"):this.claimedMessage.removeClass("a-color-base").removeClass("a-color-success").addClass("a-color-error")}}});return{getView:function(a){var b=a.rootContainer;return b.find("#dealsx_progress_view").length&&b.find("#dealsx_progress_bar \x3e .progbar").length&&b.find("#dealsx_progress_bar \x3e .progbartick").length&&b.find("#dealsx_percent_message").length?new c(a):null}}});f.when("A").register("dealsx-header-view",
function(b){var c=b.createClass({dealUnavailableView:null,claimedMessageView:null,headerStateView:null,init:function(a){a=a.rootContainer;this.headerStateView=a.find("#dealsx_header_message");this.claimedMessageView=a.find("#dealsx-claimed-message");this.dealUnavailableView=a.find("#dealsx-unavailable-message")},onModelUpdate:function(a){a.isCustomerStateIsEqualTo(DealsX.CustomerStates.CLAIMED)&&this.claimedMessageView&&(b.show(this.claimedMessageView),b.hide(this.claimedMessageView.siblings()));
this.updateHeaderStateMessage(a)},showDealUnavailableView:function(){this.dealUnavailableView&&(b.show(this.dealUnavailableView),b.hide(this.dealUnavailableView.siblings()))},updateHeaderStateMessage:function(a){a.isCustomerStateIsEqualTo(DealsX.CustomerStates.IN_CART)?this.hideHeaderStateViewChildrenExceptProvidedView(this.headerStateView.find("#dealsx_header_message_incart")):a.isCustomerStateIsEqualTo(DealsX.CustomerStates.PENDING_ADD_TO_CART)?this.hideHeaderStateViewChildrenExceptProvidedView(this.headerStateView.find("#dealsx_header_message_pendingatc")):
a.isCustomerStateIsEqualTo(DealsX.CustomerStates.CLAIMED)?this.hideHeaderStateViewChildrenExceptProvidedView(this.headerStateView.find("#dealsx_header_message_claimed")):a.isDealStateIsEqualTo(DealsX.DealStates.WAITLISTFULL)?this.hideHeaderStateViewChildrenExceptProvidedView(this.headerStateView.find("#dealsx_header_message_waitlistfull")):this.hideHeaderStateViewChildrenExceptProvidedView(null)},hideHeaderStateViewChildrenExceptProvidedView:function(a){a?(b.show(a),b.hide(a.siblings())):b.hide(this.headerStateView.children())}});
return{getView:function(a){return a.rootContainer.find("#dealsx_header_message").length?new c(a):null}}});f.when("A").register("dealsx-warranty-view",function(b){var c=b.createClass({warrantyViewSelector:null,init:function(a){a=a.rootContainer;this.isMobile()?this.warrantyViewSelector=a.find("#warrantyCheckBoxLD"):this.warrantyViewSelector=a.find("#abbWrapper")},onModelUpdate:function(a){null!==this.warrantyViewSelector&&(a.dealCustomerStatus&&a.dealCustomerStatus.state===DealsX.CustomerStates.IN_CART?
b.hide(this.warrantyViewSelector):this.warrantyViewSelector.removeClass("a-hidden"))},isMobile:function(){var a=b.$;return 0<a("#warrantyCheckBoxLD_feature_div").find('input[name\x3d"mbba-ld"][type\x3d"checkbox"]').length}});return{getView:function(a){return new c(a)}}});f.when("A").execute("dealsx-metrics-utilities",function(b){DealsX.incrementCounter=function(b){b&&h.ue&&"function"===typeof h.ue.count&&ue.count(b,(ue.count(b)||0)+1)};DealsX.setCounter=function(b,a){b&&h.ue&&"function"===typeof h.ue.count&&
ue.count(b,a)};DealsX.generateAPIMetricName=function(b){if(!b)return null;var a="dealsx";b.apiName&&(a+=":"+b.apiName,b.apiVersion&&(a+=":"+b.apiVersion));a+=":"+(b.isSuccess?"success":"error");b.clientId&&(a+=":"+b.clientId);b.errorCode&&(a+=":"+b.errorCode);b.isRobot&&(a+=":robot");return a.toLowerCase()};DealsX.recordAPIMetrics=function(b){if(b){var a=DealsX.generateAPIMetricName(b);DealsX.incrementCounter(a);b.latency&&DealsX.setCounter(a+":time",b.latency)}};DealsX.callIfFunctionWithMetrics=
function(){if(!(2>arguments.length)){var b=[];Array.prototype.push.apply(b,arguments);var a=b.shift(),d=b.shift();"function"==typeof d?(DealsX.recordAPIMetrics(a),d.apply(null,b)):(a.isRobot=!0,DealsX.recordAPIMetrics(a))}}});f.when("A").register("dealsx-polyfills",function(){return{padStart:function(b){!b&&String.prototype.padStart||Object.defineProperty(String.prototype,"padStart",{configurable:!0,writable:!0,value:function(b,a){a=a||" ";if(this.length>=b)return String(this);b-=this.length;for(var c=
"",e=0;e<b;e+=a.length)c+=a;return c.slice(0,b)+String(this)}})}}});f.when("A").register("deals-custom-integration-base",function(b){return b.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");}})});f.when("A","deals-custom-integration-base").register("deals-custom-integration-installments",function(b,c){var a=b.$;return c.extend({init:function(){this._super()},isIntegrationActive:function(){var b=a('.installments-checkbox-wrapper input[name\x3d"installments-payment-checkbox"]'),
c=a('.installments-checkbox-wrapper input[name\x3d"installments-programId"]');this.isActive=b.length&&c.length},appendArgumentsToEndpoint:function(){var b="",c=a('.installments-checkbox-wrapper input[name\x3d"installments-payment-checkbox"]'),g=a('.installments-checkbox-wrapper input[name\x3d"installments-programId"]');g.length&&c.length&&c.is(":checked")&&(b="\x26installmentsProgramId\x3d"+g.val());return b},getRequestDataParameter:function(){var b={},c=a('.installments-checkbox-wrapper input[name\x3d"installments-payment-checkbox"]'),
g=a('.installments-checkbox-wrapper input[name\x3d"installments-programId"]');g.length&&c.length&&c.is(":checked")&&(b={installmentsProgramId:g.val()});return b},handleClaimDealSuccess:function(){a(".installments-checkbox-wrapper").hide()},handleClaimDealError:function(){},handleClaimDealRetry:function(){},handleLDBuyBoxSelected:function(){var b=a(".installments-deal-breakdown");b.length&&b.addClass("aok-hidden");b=a(".price-installment-payment");b.length&&b.removeClass("aok-hidden")},handleRegularBuyBoxSelected:function(){var b=
a(".installments-deal-breakdown");b.length&&b.removeClass("aok-hidden");b=a(".price-installment-payment");b.length&&b.addClass("aok-hidden")}})});f.when("A","deals-custom-integration-base").register("dealsx-deal-custom-integration-preRegistration",function(b,c){function a(){var a=d('#preRegistration-container-deals input[name\x3d"account-linking-deals"]'),b=d('#preRegistration-container-mobile-deals input[name\x3d"account-linking-deals"]');return 0<a.length?a:0<b.length?b:null}var d=b.$;return c.extend({init:function(){this._super()},
isIntegrationActive:function(){this.isActive=null!==a()},appendArgumentsToEndpoint:function(){var b="",c=a();null!==c&&(b=c.is(":checked")&&!c.prop("disabled")?"\x26isDevicePreRegistered\x3dtrue":"\x26isDevicePreRegistered\x3dfalse");return b},getRequestDataParameter:function(){var b={},c=a();0<c.length&&(b={devicePreRegistered:c.is(":checked")&&!c.prop("disabled")});return b},handleClaimDealSuccess:function(){h.dealController&&h.dealController.dealModel&&!h.dealController.dealModel.isDealPrimeOnlyDotd()&&
(d("#preRegistration-container-deals").hide(),d("#preRegistration-container-mobile-deals").hide())},handleClaimDealError:function(){},handleClaimDealRetry:function(){},handleLDBuyBoxSelected:function(){},handleRegularBuyBoxSelected:function(){}})});f.when("A","deals-custom-integration-base","ready").register("dealsx-deal-custom-integration-warranty",function(b,c){function a(){var a=e('div[id\x3d"warrantyCheckBoxLD_feature_div"] input[name\x3d"mbba-ld"][type\x3d"checkbox"]'),b=document.querySelectorAll('div[id\x3d"mbbLD_feature_div"] [id^\x3d"mbb-offeringID-3"]');
return 0<a.length?a:b}function d(){return 0<e('div[id\x3d"warrantyCheckBoxLD_feature_div"] input[name\x3d"mbba-ld"][type\x3d"checkbox"]').length}var e=b.$;return c.extend({init:function(){this._super()},isIntegrationActive:function(){this.isActive=0<a().length},appendArgumentsToEndpoint:function(){},getRequestDataParameter:function(){},handleClaimDealSuccess:function(){var c=a();if(0<c.length){if(d()){if(c.prop("checked")){var f=e('div[id\x3d"warrantyCheckBoxLD_feature_div"] input[name\x3d"mbba-ld"]').val();
var k=e('div[id\x3d"warrantyCheckBoxLD_feature_div"] input[name\x3d"mbboid-ld"]').val()}}else for(var l=0;l<c.length;l++)if(c[l].checked){f=e('div[id\x3d"mbbLD_feature_div"] input[name\x3d"asin.3'+l+'"]').val();k=e('div[id\x3d"mbbLD_feature_div"] input[name\x3d"offeringID.3'+l+'"]').val();break}f!==n&&k!==n&&(c=k,k=d()?b.state("hlcx-mbb-state").baseAsin:e('#ASIN,input[name\x3d"items[0.base][asin]"]').val(),c={asin:f,offerListingId:c,quantity:Number(e("#dealx_quantity_dropdown").val())||1,additionalParameters:{itemAssociation:{associatedItemId:k,
renderType:"renderAll",programType:"AmazonProtect",deleteConstraint:{mutuallyInclusive:!1}}}},k=(d()?"wty_ld_m_mbb":"wty_ld_d_mbb")+"_"+k+"_"+f,h.dealController.addItemsToCart([c],k))}},handleClaimDealError:function(){},handleClaimDealRetry:function(){},handleLDBuyBoxSelected:function(){var a=e(".a-section.mbb__tld");a.length&&a.removeClass("a-hidden")},handleRegularBuyBoxSelected:function(){var a=e(".a-section.mbb__tld");a.length&&a.addClass("a-hidden")}})});f.when("A").register("dealsx-cart-aapi-service",
function(b){return b.createClass({countEndpointUrl:null,addItemsEndpointUrl:null,headers:null,init:function(b){this.countEndpointUrl=b.cartCountAapiEndpoint;this.addItemsEndpointUrl=b.cartAddItemsAapiEndpoint;this.headers={"Accept-Language":b.languageOfPreference,"x-api-csrf-token":b.aapiCsrfToken};b.slateToken&&(this.headers["x-amzn-encrypted-slate-token"]=b.slateToken)},getCount:function(c,a){var d=this,e={apiName:DealsX.ApiNames.CART_COUNT};d._request=b.$.ajax({url:this.countEndpointUrl,type:"GET",
dataType:"json",headers:b.$.extend({},d.headers,{Accept:'application/vnd.com.amazon.api+json; type\x3d"cart.count/v1"',"Content-Type":'application/vnd.com.amazon.api+json; type\x3d"cart.count.request/v1"'}),xhrFields:{withCredentials:!0},success:function(a){e.isSuccess=!0;DealsX.recordAPIMetrics(e);c(a,d._request)},error:function(b){e.isSuccess=!1;DealsX.recordAPIMetrics(e);e.errorCode=JSON.parse(b.responseText).entity.status;DealsX.recordAPIMetrics(e);a(b)},complete:function(){d._request=null}})},
addItems:function(c,a,d,e){var f=this,m={apiName:DealsX.ApiNames.CART_ADD_ITEMS};f._request=b.$.ajax({url:this.addItemsEndpointUrl+"?ref\x3d"+a,type:"POST",dataType:"json",headers:b.$.extend({},f.headers,{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"'}),data:JSON.stringify({items:c}),xhrFields:{withCredentials:!0},success:function(a){m.isSuccess=!0;DealsX.callIfFunctionWithMetrics(m,
d,a,f._request)},error:function(a){m.isSuccess=!1;DealsX.recordAPIMetrics(m);if(a.hasOwnProperty("responseText")){var b=JSON.parse(a.responseText);b.hasOwnProperty("type")&&b.type===DealsX.constants.AAPI_V1_ERROR_TYPE&&(m.errorCode=b.entity.status)}m.errorCode||(m.errorCode=a.status);DealsX.callIfFunctionWithMetrics(m,e,a)},complete:function(){f._request=null}})}})});f.when("A","dealsx-deal-custom-integration-service").register("dealsx-deal-redemption-service",function(b,c){return b.createClass({endPoint:null,
dealCustomIntegrationService:null,init:function(a){this.dealCustomIntegrationService=new c;this.endPoint=a.claimDealAapiEndpoint;this.headers={"Accept-Language":a.languageOfPreference,Accept:'application/vnd.com.amazon.api+json; type\x3d"deals.claim.response/v1"',"x-api-csrf-token":a.aapiCsrfToken};a.slateToken&&(this.headers["x-amzn-encrypted-slate-token"]=a.slateToken)},claimDeal:function(a,c,f,g,m,k){var d=this,e={apiName:DealsX.ApiNames.CLAIM_AND_ADD_TO_CART,isRetry:!1};d._request=b.$.ajax({url:d.endPoint+
a+"/claim-and-add-to-cart?ref_\x3d"+f,type:"POST",dataType:"json",data:d.generateRequestData(c,g),contentType:'application/vnd.com.amazon.api+json; type\x3d"deals.claim.request/v1"',headers:d.headers,xhrFields:{withCredentials:!0},success:function(a){e.isSuccess=!0;DealsX.callIfFunctionWithMetrics(e,m,a.entity,d._request)},error:function(a){e.isSuccess=!1;DealsX.recordAPIMetrics(e);var b=null;if(a.hasOwnProperty("responseText")&&""!==a.responseText){var c=JSON.parse(a.responseText);c.hasOwnProperty("type")&&
(b=c.type,b===DealsX.constants.AAPI_V1_QUANTITY_RESTRICTION_VIOLATION_ERROR||b===DealsX.constants.AAPI_V1_ERROR_TYPE)&&(e.errorCode=c.entity.status)}e.errorCode||(e.errorCode=a.status);DealsX.callIfFunctionWithMetrics(e,k,a,b)},complete:function(){d._request=null}})},generateRequestData:function(a,b){var c=this.dealCustomIntegrationService.getRequestDataParameters();c.asin=a;c.quantity=parseInt(b);return JSON.stringify(c)}})});f.when("A","deals-custom-integration-installments","dealsx-deal-custom-integration-preRegistration",
"dealsx-deal-custom-integration-warranty").register("dealsx-deal-custom-integration-service",function(b,c,a,d){var e=b.$;return b.createClass({requiredFunctions:"isIntegrationActive appendArgumentsToEndpoint handleClaimDealSuccess handleClaimDealError handleClaimDealRetry handleLDBuyBoxSelected handleRegularBuyBoxSelected".split(" "),registeredIntegrations:[new c,new a,new d],init:function(){this.bindEvents()},bindEvents:function(){b.on("deals_claimDealSuccess",e.proxy(function(){this.executeEventHandler("handleClaimDealSuccess")},
this));b.on("deals_claimDealError",e.proxy(function(){this.executeEventHandler("handleClaimDealError")},this));b.on("deals_claimDealRetry",e.proxy(function(){this.executeEventHandler("handleClaimDealRetry")},this));b.on("deals_onSelectLDBuybox",e.proxy(function(){this.executeEventHandler("handleLDBuyBoxSelected")},this));b.on("deals_onSelectRegularBuybox",e.proxy(function(){this.executeEventHandler("handleRegularBuyBoxSelected")},this))},appendCustomArgumentsToEndpoint:function(a){var b=a;e.each(this.registeredIntegrations,
function(a,c){c.isIntegrationActive();c.isActive&&(b+=c.appendArgumentsToEndpoint())});return b},getRequestDataParameters:function(){var a={};e.each(this.registeredIntegrations,function(b,c){c.isIntegrationActive();if(c.isActive){b=c.getRequestDataParameter();for(var d in b)a[d]=b[d]}});return a},executeEventHandler:function(a){e.each(this.registeredIntegrations,function(b,c){c.isIntegrationActive();if(c.isActive)c[a]()})}})})});
/* ******** */
(function(b){var c=window.AmazonUIPageJS||window.P,d=c._namespace||c.attributeErrors,a=d?d("DeliveryStaticPackard",""):c;a.guardFatal?a.guardFatal(b)(a,window):a.execute(function(){b(a,window)})})(function(b,c,d){b.when("A","GLUXWidget").execute(function(a,b){a.on("packard:glow:destinationChangeAll",function(){c.location.reload()})});b.when("A","GlowTriggerMetrics","a-modal").register("dpContextualIngressPtTrigger",function(a,c,f){function b(d){c.logGLOWTriggerCountFromIngress(c.getEvents().cip.desktop);
var e=f.get(a.$("#nav-global-location-slot"));e&&(d.$event.preventDefault(),e.show())}a.declarative("dpContextualIngressPt","click",function(a){b(a)});return{showGlowModal:b}});b.when("A").register("GlowTriggerMetrics",function(a){var b={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 b},logGLOWTriggerCountFromIngress:function(a){a="GLOWTrigger."+a;c.ue?c.ue.count(a,1):(a="Failed to increment metrics counter: "+a+" because window.ue is not present.",c.ueLogError&&a&&c.ueLogError({message:a},{logLevel:"ERROR",attribution:"GLOWTrigger"}))}}});b.when("BottomSheetPlugin").register("GlowOpener",function(a){return{openGlow:function(b){a.ShowBottomSheet(b)}}})});
/* ******** */
(function(l){var n=window.AmazonUIPageJS||window.P,q=n._namespace||n.attributeErrors,c=q?q("DeliveryStatic",""):n;c.guardFatal?c.guardFatal(l)(c,window):c.execute(function(){l(c,window)})})(function(l,n,q){l.when("A","jQuery","ready").register("DeliveryCountdownComponent",function(c,b){function e(b,c,d,a,g){this.strings=b;this.asin=c;this.deliveryMessageSectionId=d;this.countdownElementId=a;this.secondsLeft=g;this.intervalHandle=null}n.DeliveryCountdownHandler=function(b){var c=b.strings,d=b.asin,
a=b.deliveryMessageSectionId,g=b.fastCountdownElementId,m=b.cheapCountdownElementId;this.cheapCountdownTimer=this.fastCountdownTimer=null;this.start=function(b,f){0<b&&(this.fastCountdownTimer=new e(c,d,a,g,b),this.fastCountdownTimer.start());0<f&&(this.cheapCountdownTimer=new e(c,d,a,m,f),this.cheapCountdownTimer.start())};this.stop=function(){this.fastCountdownTimer&&(this.fastCountdownTimer.stop(),this.fastCountdownTimer=null);this.cheapCountdownTimer&&(this.cheapCountdownTimer.stop(),this.cheapCountdownTimer=
null)}};e.prototype.start=function(){var b=this;this.intervalHandle=c.interval(function(){b&&b.updateCountdownText()},1E3)};e.prototype.stop=function(){this.intervalHandle&&n.clearInterval(this.intervalHandle)};e.prototype.updateCountdownText=function(){this.secondsLeft--;if(0<this.secondsLeft){var c=Math.floor(this.secondsLeft/60),f=c%60;c=Math.floor(c/60);var d=this.secondsLeft%60,a=this.strings.inNext,g=1<c?this.strings.hours:this.strings.hour,m=1<f?this.strings.minutes:this.strings.minute,p=1<
d?this.strings.seconds:this.strings.second,e=this.strings.timeSeperator;f=0<c&&0<f?c+e+g+e+f+e+m+e+a:0<c&&0===f?c+e+g+a:0===c&&0<f?f+e+m+a:d+e+p+a;b(this.countdownElementId).html(f)}else this.stop(),f="\x3ca href\x3d'javacript:window.location.reload();'\x3e"+this.strings.refreshTimeout+"\x3c/a\x3e",b(this.deliveryMessageSectionId).html(f)}});l.when("A","jQuery","LUXContext").register("LUXController",function(c,b,e){function k(){return{addressLabel:m,addressId:p,obfuscatedId:r,countryCode:h,zipCode:w,
state:u,city:v,district:t,locationType:q}}function f(a){m=a.addressLabel;p=a.addressId;r=a.obfuscatedId;h=a.countryCode;w=a.zipCode;u=a.state;v=a.city;t=a.district;q=a.locationType}function d(a,b,h){a=c.copy(a);a.deviceType=e.deviceType;a.pageType=g;a.actionSource="locux";c.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&&f(a.address);var d=k();e.fullPageRefresh?(l.when("LUXMetrics").execute(function(a){a.logLocationChange(d.locationType)}),
n.location.reload()):(c.trigger("DeliveryAddressDropdown_OnSembuUpdateSuccess",d),c.trigger("DeliveryAddressDropdown_OnAddressChange",d),b&&b(),l.when("LUXMetrics").execute(function(a){a.logLocationChange(d.locationType)}))}else h&&h()},error:function(){c.trigger("DeliveryAddressDropdown_OnSembuUpdateFail",k());h&&h()}})}var a=!1,g=null,m,p,r,h,w,u,v,t,q;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(b){l.when("LUXResponder").execute(function(h){a?c.equals(b,k())||(f(b),h.refresh()):(f(b),h.activate(),a=!0)});l.when("LUXCustom").execute(function(a){a.activate()});l.when("LUXMetrics").execute(function(a){g=a.getPageType()})},getLocationData:function(){return k()},changeLocation:function(a,b,h){d(a,b,h)}}});l.when("A","LUXDPOnly").register("LUXDPRefreshController",
function(c){function b(b){g=b;e({addressId:g.addressId,zipCode:g.zipCode,city:g.city,state:g.state,district:g.district,countryCode:g.countryCode,relatedRequestId:g.relatedRequestId});var c={asin:g.asin,merchantId:g.merchantId,deviceType:g.deviceType,smid:g.smid,wdg:g.wdg,exMerchId:g.exMerchId,oneClick:g.oneClick};l.when("UnifiedLocationUpdateHandler").execute(function(b){b.init(c);a=b});k(g.obfuscatedId);f(g.obfuscatedId)}function e(a){var b=d('#buybox select[name\x3d"quantity"]').val()||1;c.state("unifiedLocation",
{addressId:a.addressId,zipCode:a.zipCode,city:a.city,state:a.state,district:a.district,countryCode:a.countryCode,quantity:b,relatedRequestId:a.relatedRequestId})}function k(a){if(g&&g.oneClick){var b="unifiedLocation1ClickAddress";g.deviceType&&"mobileApp"===g.deviceType&&(b="addressID");a||(a=d("#"+b).data("addnewaddress"))||(a="new");b='[id\x3d"'+b+'"]';0<d(b).length&&d(b).val(a);if(g.deviceType&&g.deviceType in m&&(b=c.state("buyNowInfo"))){var h=b.urlParams;h=0<h.indexOf("addressID\x3d")?h.replace(/(addressID=)[^&]*/,
"$1"+a):h+"\x26addressID\x3d"+a;b.urlParams=h;c.state("buyNowInfo",b)}}}function f(a){g&&!g.oneClick&&"T1"===g.updateAddressForNon1Click&&(a||(a=d("#unifiedLocationAddress").data("addnewaddress")),1===d("#unifiedLocationAddress").length&&d("#unifiedLocationAddress").val(a))}var d=c.$,a=null,g=null,m={tabletApp:1,tabletLargeApp:1,iPad:1};c.on("DeliveryAddressDropdown_OnAddressChange",function(b){var d=c.state("unifiedLocation")?c.state("unifiedLocation").relatedRequestId:q;b.relatedRequestId=d;e(b);
k(b.obfuscatedId);f(b.obfuscatedId);null!==a&&(a.refresh(),c.trigger("LocationUX_OnAddressChange",b))});c.on("UnifiedLocationPostRefresh",function(){c.trigger("diodeAjaxRefreshed")});return{init:function(a){b(a)},updateFeaturesForNewQuantitySelection:function(b){e(b);null!==a&&(a.refresh(),c.trigger("LocationUX_OnAddressChange",b))}}});l.when("A","LUXController","LUXDPRefreshController","LUXDPOnly").register("LUXDPQuantityRefresh",function(c,b,e){c.declarative("quantity-dropdown","change",function(c){c=
b.getLocationData();e.updateFeaturesForNewQuantitySelection(c)})});l.when("A","detailPage:RefreshHandler","LUXDPOnly","a-state").execute(function(c,b){l.register("TwisterUpdateHandler",function(){return{init:function(b){c.state("unifiedLocation",b)},refresh:function(){var e=b.getHandlerInstance("LocationUX"),k=[],f="addressId zipCode city state district countryCode relatedRequestId".split(" ");if(e){var d=c.state("unifiedLocation"),a;for(a in d)if(d.hasOwnProperty(a)&&-1<c.$.inArray(a,f)){var g=typeof d[a];
("number"===g||"boolean"===g||"string"===g||d[a]instanceof String)&&k.push(e.getURLParamObject(a,null===d[a]?"":d[a],1))}}0<k.length&&e.doPageRefresh(k)}}})});l.when("A","LUXDPOnly","a-state").execute(function(c){l.register("UnifiedLocationUpdateHandler",function(){return{init:function(a){c.state("unifiedLocation",a)},refresh:function(){b=2;e()}}});var b=0,e=function(){var a=c.state("unifiedLocation");a.urlParams=JSON.stringify(a.urlParams);for(var b in a)if(a.hasOwnProperty(b)){var m=typeof a[b];
"number"===m||"boolean"===m||"string"===m||a[b]instanceof String||(null===a[b]?a[b]="":delete a[b])}a&&a.asin&&a.merchantId&&(c.trigger("UnifiedLocationPreRefresh"),c.ajax("/gp/product/features/unified-location/udp/refresh-features.html?_encoding\x3dUTF-8",{params:a,method:"POST",success:k,error:f,abort:d}))},k=function(){c.trigger("UnifiedLocationPostRefresh",!0)},f=function(){c.trigger("UnifiedLocationPostRefresh",!1);0<--b&&e()},d=function(a){c.trigger("UnifiedLocationPostRefresh",!1)}});l.when("A",
"jQuery","LUXContext","LUXWidgetConfig","LUXUtils","LUXController","LUXMetrics","ready").register("LUXResponder",function(c,b,e,k,f,d,a){function g(a){b("#unifiedLocationAddrInput").trigger("updateAlerts",[a]);1===a?(b("#unifiedLocationAddrInput").addClass("a-form-error"),b("#LUXInvalidZipCodeAlert").width(b("#LUXInvalidZipCodeAlert").parent().width()).removeClass("aok-hidden"),b("#LUXMilitaryZipCodeAlert").addClass("aok-hidden")):2===a?(b("#unifiedLocationAddrInput").removeClass("a-form-error"),
b("#LUXInvalidZipCodeAlert").addClass("aok-hidden"),b("#LUXMilitaryZipCodeAlert").width(b("#LUXMilitaryZipCodeAlert").parent().width()).removeClass("aok-hidden")):3===a&&(b("#unifiedLocationAddrInput").removeClass("a-form-error"),b("#LUXInvalidZipCodeAlert").addClass("aok-hidden"),b("#LUXMilitaryZipCodeAlert").addClass("aok-hidden"))}function m(a){b(".lux-location-label").html(f.generateLocationLabel(a))}function p(a){b("#LUXAddressSelections input[type\x3dradio]:checked").attr("checked",!1);var h=
b("#LUXAddressSelections .a-declarative").has(".a-radio input[type\x3dradio]");a=a.addressId;for(var d=h.length-1;0<=d;d--)if(c.parseJSON(h[d].getAttribute("data-lux-address-selection")).addressId===a){b(".a-radio input[type\x3dradio]",h[d]).attr("checked",!0);break}}function r(a){a=a.locationType===d.locationTypes.locationInput&&a.zipCode?a.zipCode:"";b("#unifiedLocationAddrInput").trigger("updateZipCodeField",a);b("#unifiedLocationAddrInput").val(a);g(3)}function h(a){l.when("a-dropdown").execute(function(b){b=
b.getSelect(k.countrySelectorComponentName);c.objectIsEmpty(b)||(a.locationType===d.locationTypes.country||a.locationType===d.locationTypes.region||a.locationType===d.locationTypes.ip2location&&!a.state?b.setValue(f.mapLocationDataToCode(a)):b.setValue(""))})}function q(){c.post("/gp/delivery/ajax/get-country-selections.html",{contentType:"application/x-www-form-urlencoded;charset\x3dutf-8",params:f.prepareCountrySelectionGeneratorInput(),success:function(a){b("#unifiedLocationCountrySelectionDiv").html(a);
h(d.getLocationData())}})}function u(a){d.changeLocation(a.data,null,function(){p(d.getLocationData())})}function v(a){d.changeLocation(f.mapCodeToLocationData(a.value),null,function(){h(d.getLocationData())})}function t(){var a=b("#unifiedLocationAddrInput").val();f.validateZipCode(a)?d.changeLocation({zipCode:f.preprocessZipCode(a),locationType:d.locationTypes.locationInput},function(){g(3)},function(){g(1)}):f.isMilitaryZipCode(a)?g(2):g(1)}function z(){l.when(k.addressSelectorComponentType).execute(function(a){a.get(k.addressSelectorComponentName)&&
a.get(k.addressSelectorComponentName).hide()})}function x(){var h=b("#LUXAddressSelections .a-radio"),c=b("#LUXAddressSelections .a-radio.aok-hidden");h=h.length===c.length;c.slice(0,h?k.initialAddressLoadCount:k.addressReloadCount).removeClass("aok-hidden");0===b("#LUXAddressSelections .a-radio.aok-hidden").length&&(b("#LUXSeeMoreAddressLink").addClass("aok-hidden"),b("#LUXAddressActionSeparator").addClass("aok-hidden"));h||a.logEvent(a.getEvents().click.seeMore)}function y(a){m(a);p(a);r(a);f.shouldPopulateCountrySelector()&&
h(a);z()}function A(){var h=d.getLocationData();r(h);e.isRecognizedCustomer&&0===b("#LUXAddressSelections .a-radio").length&&0===b("#LUXNoAddressNote").length&&c.get("/gp/delivery/ajax/get-address-selections.html",{params:{currentAddressId:h.addressId,deviceType:e.deviceType,isOneClickFromContext:e.isOneClick,clientPage:e.clientPage},success:function(a){a&&(b("#unifiedLocationTitleNoAddress").remove(),b("#unifiedLocationAccountAddrList").remove(),b("#unifiedLocationSeeMoreDiv").remove(),b("#unifiedLocationTitleSelectAddress").remove(),
b(".lux-address-selector-divider").before(a),x())}});!b.trim(b("#unifiedLocationCountrySelectionDiv").html()).length&&f.shouldPopulateCountrySelector()&&q(h);a.logWidgetView(a.getEvents().view.addressSelector)}return{activate:function(){var h=d.getLocationData();a.logPageView(h.locationType);h.locationType===d.locationTypes.region&&m(h);c.on("a:popover:beforeShow:"+k.addressSelectorComponentName,A);r(h);c.on(d.locationChangeEventName,y);c.declarative("lux-address-selection",["change"],u);b(document).delegate("#unifiedLocationAddrInput",
"keypress",function(a){13===a.which&&t()});b(document).delegate("#unifiedLocationAddrInput","focus",function(){g(3)});b(document).delegate("#unifiedLocationAddrUpdate","click",t);b(document).delegate("#unifiedLocationSignIn","click",function(){a.logEvent(a.getEvents().click.signIn);var b=k.signInURL+n.location.pathname;"Search"===a.getPageType()&&(b+=n.location.search);n.location.href=b});b(document).delegate("#LUXSeeMoreAddressLink","click",x);b(document).delegate(".lux-manage-address-link","click",
function(b){a.logEvent(a.getEvents().click.manageAddressBook);return!0});c.on("a:dropdown:"+k.countrySelectorComponentName+":select",v)},refresh:function(a){y(d.getLocationData())}}});l.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"});
l.when("A","jQuery","LUXController","RegionNames","ready").register("LUXRegionData",function(c,b,e,k){function f(a){if(c.objectIsEmpty(a)||!a.countryCode||!a.zipCode)return null;for(var b in d)if(d.hasOwnProperty(b)&&c.reduce(d[b],function(m,f,e){return m&&!c.objectIsEmpty(a[e])&&c.equals(a[e],d[b][e])},!0))return b;return null}var d={"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 d},mapLocationDataToRegionCode:function(a){return f(a)},mapRegionCodeToLocationData:function(a){a=d.hasOwnProperty(a)?b.extend({},{addressLabel:k[a],countryCode:d[a].countryCode,zipCode:d[a].zipCode,state:d[a].state,city:d[a].city,locationType:e.locationTypes.region}):null;return a}}});l.when("A","jQuery","ready").register("LUXRegionConfig",function(c,b){var e=[],k="AE AR AS AT AU BE BG BH BR CA CH CL CN CO CR CY CZ DE DK EE EG ES FI FM FR GB GR GU HK HU ID IE IL IN IT JO JP KR KW LI LT LU LV MH MP MT MX MY NL NO NZ OM PA PE PH PL PR PT PW QA RO SA SE SG SI SK TH TR TW UM US UY VE VI ZA".split(" "),
f=/^[\s]*\d{3}([ \-]{0,1}\d{4})?[\s]*$/,d=/(?!.*)/;return{getPrimarySelections:function(){return e},getSecondarySelections:function(){return k},getZipCodePattern:function(){return f},getMilitaryZipCodePattern:function(){return d},preprocessZipCode:function(a){return a.toUpperCase().trim()},generateDiffLocationLabelForZip:function(a){return(a.state?a.state+" ":"")+(a.city?a.city+" ":"")+a.zipCode}}});l.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"});l.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"});l.when("A","jQuery","LUXController","LUXRegionData","LUXRegionConfig","LUXContext","CountryNames","RegionNames").register("LUXUtils",
function(c,b,e,k,f,d,a,g){function m(b){return!c.objectIsEmpty(b)&&b.countryCode&&a.hasOwnProperty(b.countryCode)?c.equals(b.locationType,e.locationTypes.country)?b.countryCode:c.equals(b.locationType,e.locationTypes.region)?k.mapLocationDataToRegionCode(b):k.mapLocationDataToRegionCode(b)||b.countryCode:null}function p(b){return a.hasOwnProperty(b)?a[b]:g.hasOwnProperty(b)?g[b]:null}function l(a){var b={};if(!c.objectIsEmpty(a))for(var h=a.length,d=0;d<h;d++)b[p(a[d])]=a[d];return b}return{getNameForCode:function(a){return p(a)},
mapCodeToLocationData:function(b){b=b?a.hasOwnProperty(b)?{countryCode:b,locationType:e.locationTypes.country,district:b}:k.mapRegionCodeToLocationData(b):null;return b},mapLocationDataToCode:function(a){return m(a)},generateLocationLabel:function(a){a.addressLabel?a=a.addressLabel:a.locationType!==e.locationTypes.region&&a.locationType!==e.locationTypes.country&&a.zipCode?(f.formatZipCodeForAddressLabel&&(a.zipCode=f.formatZipCodeForAddressLabel(a.zipCode)),a=a.city||a.state?f.generateDiffLocationLabelForZip?
f.generateDiffLocationLabelForZip(a):(a.city?a.city+", ":"")+(a.state?a.state+" ":"")+a.zipCode:f.formatZipCodeForAddressLabel?a.zipCode:p(m(a))):a=p(m(a));return a},prepareCountrySelectionGeneratorInput:function(){return{deviceType:d.deviceType,primarySelections:JSON.stringify(l(f.getPrimarySelections())),primarySelectionsOrder:JSON.stringify(f.getPrimarySelections()),secondarySelections:JSON.stringify(l(f.getSecondarySelections()))}},validateZipCode:function(a){return!c.objectIsEmpty(a)&&f.getZipCodePattern().test(a.toUpperCase())},
preprocessZipCode:function(a){return f.preprocessZipCode(a)},isMilitaryZipCode:function(a){return!c.objectIsEmpty(a)&&f.getMilitaryZipCodePattern().test(a.toUpperCase())},shouldPopulateCountrySelector:function(){var a=!0;"undefined"!==typeof d.shouldPopulateCountrySelector&&(a=d.shouldPopulateCountrySelector);return a}}});l.when("A","jQuery","LUXContext","ready").register("LUXMetrics",function(c,b,e){function k(a,b){n.ueLogError&&a&&n.ueLogError({message:a},{logLevel:b||"ERROR",attribution:"LocationUX"})}
function f(a){n.ue?n.ue.count(a,(n.ue.count(a)||0)+1):k("Failed to increment metrics counter: "+a+" because window.ue is not present.","ERROR")}function d(){var b;if(b=n.ue_pty)a:{b=n.ue_pty;for(var d in a)if(a.hasOwnProperty(d)&&-1!==c.indexOfArray(a[d],b)){b=!0;break a}b=!1}return b?n.ue_pty:"unrecognizedPage"}var a={detail:["Detail","DetailAW","DetailWebView","TabletUDP"],search:["Search","SearchAW"],offerListing:["OfferListing","OfferListingAW","OfferListingMobileAppAW"]},g={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 d()},getEvents:function(){return g},logLocationChange:function(b){l.when("LUXController").execute(function(m){var k=d(),h="LocationUX."+k;h=c.equals(b,m.locationTypes.locationInput)||c.equals(b,m.locationTypes.realmDefault)||c.equals(b,m.locationTypes.ip2location)?
h+("."+g.override+"."+b):h+("."+g.selection+"."+b);c.equals(b,m.locationTypes.defaultAddress)||c.equals(b,m.locationTypes.accountAddress)||c.equals(b,m.locationTypes.lockerAddress)||(h+="."+(e.isRecognizedCustomer?"recognized":"unrecognized"));-1!==c.indexOfArray(a.detail,k)&&e.isRecognizedCustomer&&(h+="."+(e.isOneClick?"1Click":"Non1Click"));f(h)})},logPageView:function(b){l.when("LUXController").execute(function(k){var m=d(),h="LocationUX."+m+"."+g.view.page+"."+b;c.equals(b,k.locationTypes.defaultAddress)||
c.equals(b,k.locationTypes.accountAddress)||c.equals(b,k.locationTypes.lockerAddress)||(h+="."+(e.isRecognizedCustomer?"recognized":"unrecognized"));-1!==c.indexOfArray(a.detail,m)&&e.isRecognizedCustomer&&(h+="."+(e.isOneClick?"1Click":"Non1Click"));f(h)})},logWidgetView:function(b){var g=d();b="LocationUX."+g+"."+b+"."+(e.isRecognizedCustomer?"recognized":"unrecognized");-1!==c.indexOfArray(a.detail,g)&&e.isRecognizedCustomer&&(b+="."+(e.isOneClick?"1Click":"Non1Click"));f(b)},logEvent:function(a){a=
"LocationUX."+d()+"."+a;f(a)},logError:function(a,b){k(a,b)}}});l.when("A","jQuery","LUXContext").register("LUXCustom",function(c,b,e){function k(c){1===c?(b("#unifiedLocationAddrInput1").addClass("a-form-error"),b("#unifiedLocationAddrInput2").addClass("a-form-error"),b("#LUXInvalidZipCodeAlert").width(b("#LUXInvalidZipCodeAlert").parent().width()).removeClass("aok-hidden"),b("#LUXMilitaryZipCodeAlert").addClass("aok-hidden")):2===c?(b("#unifiedLocationAddrInput1").removeClass("a-form-error"),b("#unifiedLocationAddrInput2").removeClass("a-form-error"),
b("#LUXInvalidZipCodeAlert").addClass("aok-hidden"),b("#LUXMilitaryZipCodeAlert").width(b("#LUXMilitaryZipCodeAlert").parent().width()).removeClass("aok-hidden")):3===c&&(b("#unifiedLocationAddrInput1").removeClass("a-form-error"),b("#unifiedLocationAddrInput2").removeClass("a-form-error"),b("#LUXInvalidZipCodeAlert").addClass("aok-hidden"),b("#LUXMilitaryZipCodeAlert").addClass("aok-hidden"))}function f(){var c=b("#unifiedLocationAddrInput1").val()+"-"+b("#unifiedLocationAddrInput2").val();b("#unifiedLocationAddrInput").val(c)}
return{activate:function(){b(document).delegate("#unifiedLocationAddrInput1","input",function(c){(c=b("#unifiedLocationAddrInput1").val())&&3===c.length&&b("#unifiedLocationAddrInput2").focus();f()});b(document).delegate("#unifiedLocationAddrInput1, #unifiedLocationAddrInput2","focus",function(){k(3)});b(document).delegate("#unifiedLocationAddrInput2","input",function(b){f()});b(document).delegate("#unifiedLocationAddrInput","updateAlerts",function(b,a){k(a)});b(document).delegate("#unifiedLocationAddrInput",
"updateZipCodeField",function(c,a){c=(a=a.split("-"))&&1<=a.length?a[0]:"";a=a&&2<=a.length?a[1]:"";b("#unifiedLocationAddrInput1").val(c);b("#unifiedLocationAddrInput2").val(a)})}}})});
/* ******** */
(function(f){var h=window.AmazonUIPageJS||window.P,l=h._namespace||h.attributeErrors,c=l?l("DetailPageMobileIconFarmAssets@common","DetailPageMobileIconFarm"):h;c.guardFatal?c.guardFatal(f)(c,window):c.execute(function(){f(c,window)})})(function(f,h,l){f.when("A","ready").register("get-icon-farm-page-state",function(c){return{parseJSON:function(e,b){b="iconfarm-state-"+b;var d='script[data-a-state\x3d"{"key":"'+b+'"}"]',a;try{a=c.$("#"+e).find(d).html()}catch(k){console.log(k.message)}a?e=c.$.parseJSON(a):
(c.state.parse(),e=c.state(b));return e}}});f.declare("icon-farm-mod-constants",{selector:{BUYBOX_ACCORDION:"#buybox .a-accordion",BUYBOX_ACCORDION_ACTIVE:"#buybox .a-accordion-active",iconfarm:"#iconfarmv2_feature_div .offersConsistencyEnabled"}});f.declare("iconfarm-metrics-constants",{ICON_FARM_FEATURE_DIV:"iconFarm_feature_div",ICON_FARM_PAGE_STATE_HOLDER_DIV:"iconfarm-pagestate-holder",METRIC_TYPE:{GLANCE_VIEW:"GLANCE_VIEW",ICON_CLICK:"ICON_CLICK",SECONDARY_PAGE_OPEN:"SECONDARY_PAGE_OPEN",SECONDARY_PAGE_CLOSE:"SECONDARY_PAGE_CLOSE",
FULL_RETURN_POLICY:"FULL_RETURN_POLICY",PAGE_DATA_MISSING:"PAGE_DATA_MISSING",ABSENT:"ABSENT",EXPANDER_OPEN:"EXPANDER_OPEN"},REF_MARKER_PREFIX:{ICON_FARM_WIDGET:"iconfarm_wid",AMAZON_DELIVERED:"iconfarm_ad",RETURNS_POLICY:"iconfarm_rp",PAY_ON_DELIVERY:"iconfarm_pod",WARRANTY:"iconfarm_wr",EASY_CARE:"iconfarm_ec",AMAZON_PROTECT:"iconfarm_ap",NO_CONTACT_DELIVERY:"iconfarm_ncd",GENERIC_RETURN_POLICY:"iconfarm_grp",MULTIPLE_SPECIFIC_RETURN_POLICY:"iconfarm_msrp",SINGLE_SPECIFIC_RETURN_POLICY:"iconfarm_ssrp",
PAYMENTS_AND_SECURITY:"iconfarm_ps",PAY_ON_DELIVERY_ACTIVE:"iconfarm_pod_active",PAY_ON_DELIVERY_INACTIVE:"iconfarm_pod_inactive",WARRANTY_EU:"iconfarm_wr_eu",AMAZON_MANAGED_DELIVERY:"iconfarm_amd",AMAZON_DELIVERED_MENA:"iconfarm_ad_mena",SAFE_PAYMENTS:"iconfarm_sp",STATIC_RETURNS_POLICY:"iconfarm_srp",GENERIC_RETURNS_POLICY:"iconfarm_grp",SUPPORT_POLICY:"iconfarm_supp",WARRANTY360:"iconfarm_wr360",WORRY_FREE_GUARANTEE_JP:"iconfarm_wfg_jp",WARRANTY_JP:"iconfarm_wr_jp",DELIVERY_JP:"iconfarm_dl_jp",
RETURN_POLICY_JP:"iconfarm_rp_jp",SMALL_BUSINESS_JP:"iconfarm_sb_jp",DELIVERY_HIT:"iconfarm_dh",WARRANTY_HIT:"iconfarm_wh",RETURN_POLICY_HIT:"iconfarm_rph",CUSTOMER_SUPPORT:"iconfarm_cs",SERVICE:"iconfarm_serv",FREE_DELIVERY:"iconfarm_fd",FREE_DELIVERY_V2:"iconfarm_fdv2",TOP_BRAND:"iconfarm_tb",AUTHENTICITY:"iconfarm_auth"},REF_MARKER_SUFFIX:{GLANCE_VIEW:"_gv",ICON_CLICK:"_clk",SECONDARY_PAGE_OPEN:"_sp_op",SECONDARY_PAGE_CLOSE:"_sp_cl",FULL_RETURN_POLICY:"_frp",EXPANDER_OPEN:"_exp_op",ABSENT:"_noavail"},
NEXUS_CONFIG:{NEXUS_PRODUCER_ID:"a2i-dpx",NEXUS_SCHEMA_ID:"a2i.dpx.WidgetImpressions.3"},LOGGER_CONFIG:{NEXUS_LOGGER:"nexus"}});f.when("A","iconfarm-return-policy-metric-logger","iconfarm-pay-on-delivery-metric-logger","iconfarm-default-metric-logger").register("iconfarm-icon-metric-factory",function(c,e,b,d){return{getIconMetric:function(a){switch(a){case "RETURNS_POLICY":return e;case "PAY_ON_DELIVERY":return b;default:return d}}}});f.when("A","iconfarm-metrics-constants","get-icon-farm-page-state",
"iconfarm-icon-metric-factory","ready").register("iconfarm-metricLogger",function(c,e,b,d){return{log:function(a,k,m,g){if(a&&k&&null!==m&&e.REF_MARKER_PREFIX[a]&&e.REF_MARKER_SUFFIX[k]){var f=c.$("#icon-farm-widget-"+m),h=b.parseJSON(e.ICON_FARM_PAGE_STATE_HOLDER_DIV+"-"+m,m);h?d.getIconMetric(a).log(a,k,m,c.$.extend(!0,{asin:h.asin,merchantId:h.merchantId,remoteAddress:h.remoteAddress,isInternal:h.isInternal,isRobot:h.isRobot,numOfShownIcons:h.numOfShownIcons,buyingOptionIndex:m},g)):f.length&&
console.warn("iconfarm state may not be available")}}}});f.when("A","ready").register("iconfarm-postmetric",function(){return{postCountMetric:function(c){if("undefined"!==typeof c){var e=h.ue;if(e){var b=e.count(c)||0;e.count(c,b+1)}}},postTimeMetric:function(c,e){if("undefined"!==typeof c&&"undefined"!==typeof e){var b=h.ue;b&&b.count(c,e)}}}});f.when("A","ready").register("iconfarm-metric-cache",function(c){var e=[],b=function(a){if(!d(a))return!1;var b=!1;c.each(e,function(c,d){c.asin===a.asin&&
c.merchantId===a.merchantId&&c.ref===a.ref&&c.loggerType===a.loggerType&&c.buyingOptionIndex===a.buyingOptionIndex&&(b=!0)});return b},d=function(a){return a&&a.asin&&a.merchantId&&a.ref&&a.loggerType&&null!==a.buyingOptionIndex};return{isPresent:b,add:function(a){return d(a)?b(a)?!1:(e.push(a),!0):!1},reset:function(){e=[]}}});"use strict";f.when("A","iconfarm-metric-cache","iconfarm-metrics-constants","ready").register("iconfarm-Nexus-Service",function(c,e,b){return{log:function(d){if(e.add(d)){var a=
{};a.producerId=b.NEXUS_CONFIG.NEXUS_PRODUCER_ID;a.schemaId=b.NEXUS_CONFIG.NEXUS_SCHEMA_ID;a.refMarker=d.ref;a.pageAsin=d.asin;a.pageType=c.capabilities?c.capabilities.mobile?c.capabilities.isAmazonApp?"DetailWebView":"DetailAW":"Detail":"";a.subPageType="IconFarm";a.server=h?h.ue_sn:"";a.merchantId=d.merchantId;a.remoteAddress=d.remoteAddress;a.isInternal=d.isInternal?1:0;a.isRobot=d.isRobot?1:0;var k={};k.numOfShownIcons=d.numOfShownIcons;k.buyingOptionIndex=d.buyingOptionIndex;d=JSON.stringify(k);
a.additionalRequestData=d;if(d=h.ue)try{d.event&&d.event(a,b.NEXUS_CONFIG.NEXUS_PRODUCER_ID,b.NEXUS_CONFIG.NEXUS_SCHEMA_ID)}catch(f){d.count("NexusLoggerFailure",1)}}}}});f.when("A","iconfarm-Nexus-Service","iconfarm-metrics-constants","iconfarm-postmetric","ready").register("iconfarm-default-metric-logger",function(c,e,b,d){return{log:function(a,k,f,g){f=JSON.parse(JSON.stringify(g));e.log(c.$.extend(!0,f,{ref:b.REF_MARKER_PREFIX[a]+b.REF_MARKER_SUFFIX[k],loggerType:b.LOGGER_CONFIG.NEXUS_LOGGER}));
d.postCountMetric(b.REF_MARKER_PREFIX[a]+b.REF_MARKER_SUFFIX[k])}}});f.when("A","iconfarm-Nexus-Service","iconfarm-metrics-constants","iconfarm-postmetric","get-icon-farm-page-state","ready").register("iconfarm-return-policy-metric-logger",function(c,e,b,d,a){return{log:function(k,f,g,h){a:{if((g=a.parseJSON(b.ICON_FARM_PAGE_STATE_HOLDER_DIV+"-"+g,g))&&g.RETURNS_POLICY&&g.RETURNS_POLICY.secondaryViewData&&g.RETURNS_POLICY.secondaryViewData.glLevelReturnPolicies)switch(g.RETURNS_POLICY.secondaryViewData.glLevelReturnPolicies.length){case 0:g=
"GENERIC_RETURN_POLICY";break a;case 1:g="SINGLE_SPECIFIC_RETURN_POLICY";break a;default:g="MULTIPLE_SPECIFIC_RETURN_POLICY";break a}g=void 0}k=g||k;h=JSON.parse(JSON.stringify(h));e.log(c.$.extend(!0,h,{ref:b.REF_MARKER_PREFIX[k]+b.REF_MARKER_SUFFIX[f],loggerType:b.LOGGER_CONFIG.NEXUS_LOGGER}));d.postCountMetric(b.REF_MARKER_PREFIX[k]+b.REF_MARKER_SUFFIX[f])}}});f.when("A","iconfarm-Nexus-Service","iconfarm-metrics-constants","iconfarm-postmetric","get-icon-farm-page-state","ready").register("iconfarm-pay-on-delivery-metric-logger",
function(c,e,b,d,a){return{log:function(f,h,g,l){g=(g=a.parseJSON(b.ICON_FARM_PAGE_STATE_HOLDER_DIV+"-"+g,g))&&g.PAY_ON_DELIVERY&&g.PAY_ON_DELIVERY.isEligible?g.PAY_ON_DELIVERY.isEligible?"PAY_ON_DELIVERY_ACTIVE":"PAY_ON_DELIVERY_INACTIVE":void 0;f=g||f;l=JSON.parse(JSON.stringify(l));e.log(c.$.extend(!0,l,{ref:b.REF_MARKER_PREFIX[f]+b.REF_MARKER_SUFFIX[h],loggerType:b.LOGGER_CONFIG.NEXUS_LOGGER}));d.postCountMetric(b.REF_MARKER_PREFIX[f]+b.REF_MARKER_SUFFIX[h])}}})});
/* ******** */
(function(e){var k=window.AmazonUIPageJS||window.P,g=k._namespace||k.attributeErrors,a=g?g("DetailPageMobileIconFarmAssets@desktop","DetailPageMobileIconFarm"):k;a.guardFatal?a.guardFatal(e)(a,window):a.execute(function(){e(a,window)})})(function(e,k,g){e.when("A","a-popover","icon-farm-constants","iconfarm-metricLogger","iconfarm-metrics-constants","icon-farm-web-mod-util","ready").register("icon-farm-desktop-popover",function(a,l,b,c,d,f){var h=function(b){var h=b.data("name");a.off("a:popover:beforeShow:"+
h);a.on("a:popover:beforeShow:"+h,function(a){a=f.getCurrentBuyingOptionIndex();c.log(h,d.METRIC_TYPE.ICON_CLICK,a);c.log(h,d.METRIC_TYPE.SECONDARY_PAGE_OPEN,a)});a.off("a:popover:beforeHide:"+h);a.on("a:popover:beforeHide:"+h,function(a){a=f.getCurrentBuyingOptionIndex();c.log(h,d.METRIC_TYPE.SECONDARY_PAGE_CLOSE,a)})};return{init:function(){for(var c=a.$(b.ICON_FARM_CONTAINER_CLASS),f=0;f<c.length;f++){var d=a.$(c[f]),e=d.data(b.TYPE_PARAM);if(e&&e===b.TYPE_PARAM_VALUE_CUSTOM_POP_OVER){var e=d,
g=a.$("#"+e.data(b.POPOVER_CONTENT_PARAM)),g={activate:b.POPOVER_ACTIVATION,position:b.POPOVER_POSITION,width:b.POPOVER_WIDTH,inlineContent:g.html(),name:e.data("name")};l.create(e,g);h(d)}}}}});e.when("A","get-icon-farm-page-state","icon-farm-constants","iconfarm-metricLogger","iconfarm-metrics-constants","icon-farm-web-mod-util","ready").register("icon-farm-desktop-returns-policy",function(a,l,b,c,d,f){a.declarative("returns-policy-url","click",function(a){a=f.getCurrentBuyingOptionIndex();c.log("RETURNS_POLICY",
d.METRIC_TYPE.FULL_RETURN_POLICY,a);a=l.parseJSON(b.ICON_FARM_PAGE_STATE_HOLDER_DIV+"-"+a,a);k.open(a.RETURNS_POLICY.genericReturnPolicyURL,"_blank")});a.off("a:popover:beforeShow:return-policy-secondary-view");a.on("a:popover:beforeShow:return-policy-secondary-view",function(a){a=f.getCurrentBuyingOptionIndex();c.log("RETURNS_POLICY",d.METRIC_TYPE.ICON_CLICK,a);c.log("RETURNS_POLICY",d.METRIC_TYPE.SECONDARY_PAGE_OPEN,a)});a.off("a:popover:beforeHide:return-policy-secondary-view");a.on("a:popover:beforeHide:return-policy-secondary-view",
function(a){a=f.getCurrentBuyingOptionIndex();c.log("RETURNS_POLICY",d.METRIC_TYPE.SECONDARY_PAGE_CLOSE,a)});return{init:function(){}}});e.when("A","IconFarmPageStateParserService","icon-farm-desktop-popover","icon-farm-desktop-returns-policy","iconfarm-metricLogger","icon-farm-constants","iconfarm-metrics-constants","iconfarm-metric-cache","icon-farm-web-mod-util","icon-farm-change-buying-option","atf","ready").execute(function(a,l,b,c,d,f,h,g,k,q){function m(){g.reset();b.init();c.init();q.init();
for(var a=0;a<n;a++)r(a)}var n=k.getBuyingOptionCounts(),r=function(b){var c="#icon-farm-widget-"+b,f=a.$(c);f&&f.length?d.log("ICON_FARM_WIDGET",h.METRIC_TYPE.GLANCE_VIEW,b):d.log("ICON_FARM_WIDGET",h.METRIC_TYPE.ABSENT,b);(c=a.$(c+" .icon-container"))&&c.length&&c.each(function(){d.log(a.$(this).data("name"),h.METRIC_TYPE.GLANCE_VIEW,b)})};m();a.on("a:pageUpdate",function(){var b;a:{try{if(a.$("#"+f.ICON_FARM_V2_FEATURE_DIV).find("script").length){b=f.ICON_FARM_V2_FEATURE_DIV;break a}if(a.$("#"+
f.ICON_FARM_V2_PRIMARY_FEATURE_DIV).find("script").length){b=f.ICON_FARM_V2_PRIMARY_FEATURE_DIV;break a}d.log("ICON_FARM_WIDGET",h.PAGE_DATA_MISSING,0)}catch(c){e.log(c,"ERROR","DetailPageMobileIconFarm")}b=void 0}if(b){for(var g=0;g<n;g++)if(l.isNewState(b,f.ICON_FARM_STATE+"-"+g)){var p=l.processState(b,f.ICON_FARM_STATE+"-"+g);if(a.objectIsEmpty(p))return}m()}})});e.declare("icon-farm-constants",{ICON_FARM_FEATURE_DIV:"iconFarm_feature_div",ICON_FARM_V2_FEATURE_DIV:"iconfarmv2_feature_div",ICON_FARM_V2_PRIMARY_FEATURE_DIV:"iconFarmV2InsidePrimary_feature_div",
ICON_FARM_PAGE_STATE_HOLDER_DIV:"iconfarm-pagestate-holder",ICON_FARM_CONTAINER_CLASS:".icon-container",ICON_FARM_SECONDARY_VIEW_HOLDER_ID:"#icon-farm-secondary-view-holder",ICON_FARM_STATE:"iconfarm-state",POPOVER_ACTIVATION:"onclick",POPOVER_POSITION:"triggerBottom",POPOVER_WIDTH:"533",POPOVER_CONTENT_PARAM:"iconContent",TYPE_PARAM:"type",TYPE_PARAM_VALUE:"bottom-sheet",TYPE_PARAM_VALUE_CUSTOM_POP_OVER:"custom-pop-over"});(function(){e.when("A","atf","ready").register("IconFarmPageStateParserService",
function(a){function l(b,c){c='script[data-a-state\x3d"'+JSON.stringify({key:c})+'"]';return a.$("#"+b).find(c)}return{processState:function(b,c){var d;try{var f=l(b,c),h=f[0];d=f.html();var e=a.parseJSON(d);a.state(c,e);a.$.data(h,"state_processed",!0);return e}catch(g){console.log(g)}return a.state(c)},isNewState:function(b,c){try{return!a.$.data(l(b,c)[0],"state_processed")}catch(d){console.warn("Unable to determine state status",d)}return!1}}})})();"use strict";e.when("A","icon-farm-mod-constants").register("icon-farm-web-mod-util",
function(a,e){return{getBuyingOptionCounts:function(){if(!a.$(e.selector.iconfarm).length)return 1;var b=a.$(e.selector.BUYBOX_ACCORDION);if(0===b.length)return 1;b=b[0];if(a.$(e.selector.iconfarm).length){for(var b=b.children,c=0,d=0;d<b.length;d++)var f=a.$(b[d]).attr("data-buying-option-index"),c=Math.max(c,f);b=c}else b=0;return b+1},getCurrentBuyingOptionIndex:function(){var b=0;if(!a.$(e.selector.iconfarm).length)return 0;var c=a.$(e.selector.BUYBOX_ACCORDION_ACTIVE);c.length&&(b=c.index());
return b}}});e.when("A","icon-farm-mod-constants","icon-farm-web-mod-util","ready").register("icon-farm-change-buying-option",function(a,e,b){var c=b.getCurrentBuyingOptionIndex(),d=function(b){var d=a.$(e.selector.iconfarm);if(d.length){var k=d[0].children;k.length&&(d=k[c],b!==g&&b.selectedRow!==g&&b.selectedRow.$row!==g&&a.$(b.selectedRow.$row)!==g&&(b=a.$(b.selectedRow.$row).index(),b!==c&&(k=k[b],d.style.display="none",k.style.display="block",c=b)))}};return{init:function(){a.on("a:pageUpdate",
d);a.on("PageRefresh:ATF",d);a.on("a:accordion:buybox-accordion:select",d)}}});e.when("A","atf").execute(function(a){function e(){a.loadImageManually(a.$(".icon-box"));var b=a.$(".icon-farm-image-skeleton");b.length&&b.css("background-color","inherit")}e();a.on("a:pageUpdate",function(){e()})})});
/* ******** */
(function(d){var f=window.AmazonUIPageJS||window.P,g=f._namespace||f.attributeErrors,b=g?g("DetailPageSocialProofingAssets@common","DetailPageSocialProofing"):f;b.guardFatal?b.guardFatal(d)(b,window):b.execute(function(){d(b,window)})})(function(d,f,g){d.declare("socialProofingConstants",{socialProofingAUIState:"social-proofing-page-state-cache",socialProofingState:"social-proofing-page-state",socialProofingTriggeredAsinsState:"social-proofing-triggered-asins-page-state",socialProofingBadgeClass:".social-proofing-badge",
socialProofingFaceoutClass:".social-proofing-faceout",socialProofingBadgeWeblabDivId:"#social-proofing-badge-weblab-data",MOBILE_APP:"mobileApp",ATTRIBUTION:"SocialProofing"});"use strict";d.when("A","socialProofingConstants","socialProofingPageState","ready").register("socialProofingUtil",function(b,e,h){function k(b,a){f.ue&&f.ue.trigger?f.ue.trigger(b,a):d.log("Failed to get ue and ue.trigger for weblab: "+b+"and treatment: "+a,"WARN",e.ATTRIBUTION)}return{getAttributeFromPageState:function(c){var a=
b.state(e.socialProofingState);if(a)return a[c]},triggerWebLab:k,triggerWeblabsBySectionId:function(c){c=b.$(c);if(c.length){if(!h.isWeblabTriggered()&&(c=c[0])){c=c.dataset;for(var a in c)k(a.toString().toUpperCase(),c[a]);h.updateWeblabTriggeredToTrue()}}else b.state.replace(e.socialProofingTriggeredAsinsState,{})}}});"use strict";d.when("A","socialProofingConstants","ready").register("socialProofingPageState",function(b,e){function d(){var a=b.state(c);if(a)return a.asin}function f(){var a=b.state(e.socialProofingTriggeredAsinsState);
return a?!0===a.weblabTriggered:(b.state.replace(e.socialProofingTriggeredAsinsState,{weblabTriggered:!1}),!1)}var c=e.socialProofingState;return{reloadPageState:function(){b.each(b.$(".social-proofing-badge").siblings("[data-a-state]"),function(a){b.parseJSON(b.$(a).attr("data-a-state")).key===c&&(a=b.parseJSON(b.$(a).html()))&&a.asin!==d()&&(b.state.replace(c,a,!0),b.state.replace(e.socialProofingTriggeredAsinsState,{}))});b.each(b.$(".social-proofing-faceout").siblings("[data-a-state]"),function(a){b.parseJSON(b.$(a).attr("data-a-state")).key===
c&&(a=b.parseJSON(b.$(a).html()))&&a.asin!==d()&&b.state.replace(c,a,!0)})},isMobileApp:function(){var a=b.state(c);if(a)return a.deviceType===e.MOBILE_APP},getAsin:d,getMerchantId:function(){var a=b.state(c);if(a)return a.merchantId},getRemoteAddress:function(){var a=b.state(c);if(a)return a.remoteAddress},getIsInternal:function(){var a=b.state(c);if(a)return a.isInternal},getIsRobot:function(){var a=b.state(c);if(a)return a.isRobot},getAvailableBadges:function(){var a=b.state(c);if(a)return a.availableBadges},
getAvailableFaceouts:function(){var a=b.state(c);if(a)return a.availableFaceouts},isWeblabTriggered:f,updateWeblabTriggeredToTrue:function(){var a=b.state(e.socialProofingTriggeredAsinsState);a&&!f()&&(a.weblabTriggered=!0,b.state.replace(e.socialProofingTriggeredAsinsState,a))}}})});
/* ******** */
(function(f){var c=window.AmazonUIPageJS||window.P,e=c._namespace||c.attributeErrors,d=e?e("DetailPageSocialProofingAssets@logger","DetailPageSocialProofing"):c;d.guardFatal?d.guardFatal(f)(d,window):d.execute(function(){f(d,window)})})(function(f,c,e){f.when("A","ready").register("socialProofingNexusLogger",function(d){function f(b){var a=c.ue;if(a)try{a.event&&a.event(b,b.producerId,b.schemaId)}catch(d){a.count("NexusLoggerFailure",1)}}var a={};return{createEvent:function(b){a.producerId=b.producerId;
a.schemaId=b.schemaId;a.pageAsin=b.pageAsin;a.pageType=b.pageType;a.subPageType=b.subPageType;a.merchantId=b.merchantId;a.remoteAddress=b.remoteAddress;a.isInternal=b.isInternal?1:0;a.isRobot=b.isRobot?1:0;a.server=c?c.ue_sn:""},logNexusEvent:function(b,c){if(0!==Object.keys(a).length){var e=JSON.parse(JSON.stringify(a));e.refMarker=b;d.objectIsEmpty(c)||Object.keys(c).forEach(function(a){e[a]=c[a]});f(e)}}}})});
/* ******** */
(function(a){var c=window.AmazonUIPageJS||window.P,e=c._namespace||c.attributeErrors,b=e?e("DetailPageSocialProofingAssets@badges","DetailPageSocialProofing"):c;b.guardFatal?b.guardFatal(a)(b,window):b.execute(function(){a(b,window)})})(function(a,c,e){a.when("A","socialProofingConstants","ready").register("socialProofingBadgeUtil",function(b,d){return{isSocialProofingBadgePresent:function(){return 0<b.$(d.socialProofingBadgeClass).length}}});"use strict";a.declare("socialProofingBadgeMetricConstants",
{NEXUS_PRODUCER_ID:"a2i-dpx",NEXUS_SCHEMA_ID:"a2i.dpx.WidgetImpressions.3",pageTypeWebview:"DetailWebview",pageTypeAW:"DetailAW",subPageType:"INAffordability",refMarker:{glanceView:"social_proofing_badge_present"}});"use strict";a.when("A","socialProofingPageState","socialProofingBadgeMetricConstants","socialProofingNexusLogger").register("socialProofingBadgeNexusLogger",function(b,d,a,c){return{createSocialProofingBadgeNexusEvent:function(){c.createEvent({producerId:a.NEXUS_PRODUCER_ID,schemaId:a.NEXUS_SCHEMA_ID,
pageType:d.isMobileApp()?a.pageTypeWebview:a.pageTypeAW,subPageType:a.subPageType,pageAsin:d.getAsin(),merchantId:d.getMerchantId(),remoteAddress:null,isInternal:d.getIsInternal(),isRobot:d.getIsRobot()})},logGlanceViewData:function(){var b=d.getAvailableBadges();b&&c.logNexusEvent(a.refMarker.glanceView,{additionalRequestData:b})},logMetrics:function(a,b){c.logNexusEvent(a,b)}}})});
/* ******** */
(function(a){var c=window.AmazonUIPageJS||window.P,e=c._namespace||c.attributeErrors,b=e?e("DetailPageSocialProofingAssets@faceouts","DetailPageSocialProofing"):c;b.guardFatal?b.guardFatal(a)(b,window):b.execute(function(){a(b,window)})})(function(a,c,e){a.when("A","socialProofingConstants","ready").register("socialProofingFaceoutUtil",function(b,d){return{isSocialProofingFaceoutPresent:function(){return 0<b.$(d.socialProofingFaceoutClass).length}}});"use strict";a.declare("socialProofingFaceoutMetricConstants",
{NEXUS_PRODUCER_ID:"a2i-dpx",NEXUS_SCHEMA_ID:"a2i.dpx.WidgetImpressions.3",pageTypeWebview:"DetailWebview",pageTypeAW:"DetailAW",subPageType:"INAffordability",refMarker:{glanceView:"social_proofing_faceout_present"}});"use strict";a.when("A","socialProofingPageState","socialProofingFaceoutMetricConstants","socialProofingNexusLogger").register("socialProofingFaceoutNexusLogger",function(b,d,a,c){return{createSocialProofingFaceoutNexusEvent:function(){c.createEvent({producerId:a.NEXUS_PRODUCER_ID,schemaId:a.NEXUS_SCHEMA_ID,
pageType:d.isMobileApp()?a.pageTypeWebview:a.pageTypeAW,subPageType:a.subPageType,pageAsin:d.getAsin(),merchantId:d.getMerchantId(),remoteAddress:null,isInternal:d.getIsInternal(),isRobot:d.getIsRobot()})},logGlanceViewData:function(){var b=d.getAvailableFaceouts();b&&c.logNexusEvent(a.refMarker.glanceView,{additionalRequestData:b})},logMetrics:function(a,b){c.logNexusEvent(a,b)}}})});
/* ******** */
(function(b){var a=window.AmazonUIPageJS||window.P,d=a._namespace||a.attributeErrors,c=d?d("DetailPageSocialProofingAssets@desktop","DetailPageSocialProofing"):a;c.guardFatal?c.guardFatal(b)(c,window):c.execute(function(){b(c,window)})})(function(b,a,d){b.when("A","socialProofingPageState","socialProofingBadgeNexusLogger","socialProofingFaceoutNexusLogger","socialProofingBadgeUtil","socialProofingFaceoutUtil","socialProofingUtil","socialProofingConstants","atf","ready").execute(function(c,b,a,e,d,
f,g,h){c.on("a:pageUpdate",function(){d.isSocialProofingBadgePresent()&&(b.reloadPageState(),a.createSocialProofingBadgeNexusEvent(),a.logGlanceViewData());g.triggerWeblabsBySectionId(h.socialProofingBadgeWeblabDivId);f.isSocialProofingFaceoutPresent()&&(b.reloadPageState(),e.createSocialProofingFaceoutNexusEvent(),e.logGlanceViewData())});d.isSocialProofingBadgePresent()&&(a.createSocialProofingBadgeNexusEvent(),a.logGlanceViewData());g.triggerWeblabsBySectionId(h.socialProofingBadgeWeblabDivId);
f.isSocialProofingFaceoutPresent()&&(e.createSocialProofingFaceoutNexusEvent(),e.logGlanceViewData())})});
/* ******** */
(function(b){var c=window.AmazonUIPageJS||window.P,e=c._namespace||c.attributeErrors,a=e?e("DigitalDashDetailPageAssets",""):c;a.guardFatal?a.guardFatal(b)(a,window):a.execute(function(){b(a,window)})})(function(b,c,e){b.register("DigitalDashUtils",function(){return{redirect:function(a){if(!a)throw"Must pass a target URL.";c.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();
if(a.$target.data("DigitalDashCreateForm"))var d=a.$target.data("DigitalDashCreateForm");else d=new b({el:a.data.el,href:a.data.href}),a.$target.data("DigitalDashCreateForm",d);d.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,c){function d(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=c(this.$el.find(this.errorAlertSelector));this.baseErrorText=this.$errorAlert.text();this.$changeover=this.$el.find(this.changeoverSelector);this.$updatingEls=Array.prototype.slice.call(document.querySelectorAll(this.buttonSuccessClass))}var f=a.$,h={errorAlertSelector:"#digital-dash-create-error-message",ajaxFieldName:"isAjax",changeoverSelector:"#digital-dash-create-success-changeover",buttonSuccessClass:".digital-dash-create-button-success-display"};
d.prototype.submit=function(b){this.$updatingEls.forEach(function(a){a.classList.remove("success");a.classList.remove("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)})};d.prototype.handleAjaxSuccess=function(a){a.success||510===a.error.errorCode?(this.$changeover.show(),this.$updatingEls.forEach(function(a){a.classList.add("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.$updatingEls.forEach(function(a){a.classList.add("error")}))};d.prototype.handleAjaxError=function(a){if(401===a.http.status)try{return g.redirect(a.http.responseText)}catch(k){b.log("Error parsing unauth response: "+k,"ERROR","DigitalDashCreateForm")}else b.log("Create dash button call failed, could not recognize response from server.","FATAL","DigitalDashCreateForm");this.$updatingEls.forEach(function(a){a.classList.add("error")})};
return d});"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(c){a.trigger(b.actionName,a.state("digital-dash-auto-action").data)})});"use strict";b.when("A","a-popover").execute("DigitalDashPopoverManager",function(a,c){var e=a.$,d=a.throttle(function(a){a.updatePosition()},500,{trailing:!1});a.on("a:popover:ajaxContentLoaded:dd-create-learn-more",
function(a){var c=a.popover;a=e(c.getContent());a.html()?a.find("img").each(function(){e(this).bind("load",function(){d(c)})}):b.log("dd-create-learn-more lazyPositionPopover popover content not ready","WARN","DigitalDashPopoverManager")})})});
/* ******** */
(function(m){var A=window.AmazonUIPageJS||window.P,C=A._namespace||A.attributeErrors,b=C?C("ProductBundleUIAssets",""):A;b.guardFatal?b.guardFatal(m)(b,window):b.execute(function(){m(b,window)})})(function(m,A,C){m.when("A","bundle-constants","bundle-logger","a-carousel-framework","a-carousel-constants","p-detect").register("bundles-card",function(b,c,e,d,a,k){function x(a){var f=a.getAttr(t.ATTR_MAX_HEIGHT);f&&b.isFiniteNumber(f)||(f=1);var p=f;a.dom.$carousel.children("li").not("."+t.EMPTY_CARD_CLASS).each(function(a,
f){a=r(f).outerHeight();p=Math.max(a,p)});p>f&&(a.setAttr(t.ATTR_MAX_HEIGHT,p),k.capabilities.transition?1===f?a.dom.$viewport.height(p):b.animate(a.dom.$viewport,{height:p},a.getAttr(t.ATTR_HEIGHT_ANIMATION_SPEED),"linear"):a.dom.$viewport.height(p),a.updateDimensionsCache({viewport:{height:p,outerHeight:p}}))}function q(f){var r=f.getAttr(a.PAGE_NUMBER),p=f.getAttr(a.TOTAL_PAGES),v=f.dom.$container.find(t.prevButton);f=f.dom.$container.find(t.nextButton);v.css("visibility",1===r?"hidden":"visible");
f.css("visibility",r>=p?"hidden":"visible")}function u(){d.onInit("bundle-drawer-carousel",function(a){x(a);q(a);b.on(t.pageChangeEvent,function(a){y||(y=!0,e.logCount(g.SCROLL,1),f.isDevices&&e.logRefTag(h.INGRESS_SCROLLED+f.landingAsin,f.landingAsin));q(a.carousel)});b.on(t.repaintEvent,function(a){q(a.carousel)})})}function m(){var a=r(w.bundlesCardBundles),f=0,p=0,v=0;b.each(a,function(a,b){a=r(a);b=a.find(w.bundleTitle);b.height()>f&&(f=b.height());b=a.find(w.bundleImage);b.height()>p&&(p=b.height());
a=a.find(w.bundleSavings);a.height()>v&&(v=a.height())});b.each(a,function(a,b){r(a).find(w.bundleTitle).height(f);r(a).find(w.bundleImage).height(p);r(a).find(w.bundleSavings).height(v)})}var r=b.$,f={},y=!1,t={pageChangeEvent:"a:carousel:bundle-drawer-carousel:change:pageNumber",repaintEvent:"a:carousel:bundle-drawer-carousel:repaint",prevButton:".a-carousel-goto-prevpage",nextButton:".a-carousel-goto-nextpage",ATTR_MAX_HEIGHT:"maxHeight",ATTR_HEIGHT_ANIMATION_SPEED:"height_animation_speed",EMPTY_CARD_CLASS:"a-carousel-card-empty"},
w={alexaBadgeContainer:".amazon-certified-badge-container",bundlesBottomDivider:".bundles-bottom-divider",bundlesCardCarousel:"#bundles-card .a-carousel-viewport",bundlesCardBundles:".bundles-carousel .bundle",bundlesCardState:"#bundles-card-state",bundlesFeature:"#bundles-feature",bundleSavings:".bundle-savings-line",bundleImage:".bundle-image",bundleTitle:".bundle-title",inlineTwister:"#twister-plus-mobile-inline-twister-container",vas:"#vas-ppd-fake-twister-mobile",kso:"#special-offers-information",
devices_mc6:"#atfCenter10_feature_div"},g={SCROLL:"bundlesCard.desktop.ingress.scroll",WIDGET_SHOWN:"bundlesCard.desktop.ingress.shown"},h={INGRESS_SHOWN:"amzdv_tplus_dp_dsk_imp_",INGRESS_SCROLLED:"amzdv_tplus_dp_dsk_scroll_"};b.on(c.BUNDLES_CARD_READY,function(){y=!1;var a=r(w.bundlesCardState);f.currency=a.data("currencysymbol");f.aapiEndpoint=a.data("aapiendpoint");f.language=a.data("language");f.csrfToken=a.data("csrftoken");f.marketplaceId=a.data("marketplaceid");f.sessionId=a.data("sessionid");
f.landingAsin=a.data("landingasin");f.isDevices=a.data("isdevices");f.currencyOfPreference=a.data("currencyofpreference");f.isUnifiedCxView=a.data("isunifiedcxview");m();u();e.logCount(g.WIDGET_SHOWN,1);f.isDevices&&e.logRefTag(h.INGRESS_SHOWN+f.landingAsin,f.landingAsin);r(w.alexaBadgeContainer).length&&r(w.bundlesBottomDivider).addClass("aok-hidden")});return f});"use strict";m.when("A").register("aapi-add-to-cart-helper",function(b){var c=b.$,e=["true","false"],d=b.createClass({init:function(a,
b,c){this.csrfToken=a||"";this.marketplace=b||"";this.ajaxEndpoint=c||"";this.asinDataList=[];this.refTag=""},setAsinDataList:function(a){if(Array.isArray(a))return this.asinDataList=a,this},addSingleAsinData:function(a){if(a.asin&&a.offerId&&a.quantity)return this.asinDataList.push(a),this;m.log("asin, offerListingId or quantity of single asinData is empty","WARN")},setRefTag:function(a){this.refTag=a;return this},sendRequest:function(a,b){var d=this;this.asinDataList.length?c.ajax({url:this.constructAjaxUrl(),
type:"POST",data:this.constructAddToCartRequest(this.asinDataList),xhrFields:{withCredentials:!0},headers:{"Content-Type":'application/vnd.com.amazon.api+json; type\x3d"cart.add-items.request/v1"',Accept:'application/vnd.com.amazon.api+json; type\x3d"cart.add-items/v1"',"Accept-Language":"en-US","x-api-csrf-token":this.csrfToken,"x-amzn-encrypted-slate-token":c('meta[name\x3d"encrypted-slate-token"]').prop("content")},success:function(c){d.verifyCartApiResponse(c)?a(c):b()},error:b}):(m.log("Invalid request with an empty asin list to CartAPI",
"WARN"),b())},verifyCartApiResponse:function(a){return"cart.add-items/v1"===a.type&&"items"in a.entity&&0<a.entity.items.length&&"id"in a.entity.items[0]&&this.isCartCountResponseValid(a.entity.count)},isCartCountResponseValid:function(a){return a&&"cart.count/v1"===a.type&&"items"in a.entity},constructAjaxUrl:function(){var a="https://"+this.ajaxEndpoint+"/api/marketplaces/"+this.marketplace+"/cart/carts/retail/items";this.refTag&&(a+="?ref_\x3d"+this.refTag);return a},constructAddToCartRequest:function(a){for(var b=
[],c=0;c<a.length;c++){var d=a[c],e={asin:d.asin,offerListingId:d.offerId,quantity:d.quantity},d=this.formatBooleanParams(d);e.additionalParameters=this.constructAdditionalParameters(d);b.push(e)}return JSON.stringify({items:b})},constructAdditionalParameters:function(a){var b={};a.hasOwnProperty("isToBeGiftWrapped")&&"boolean"===typeof a.isToBeGiftWrapped&&(b.giftOptions={includeGiftReceipt:a.isToBeGiftWrapped});a.hasOwnProperty("isDevicePreRegistered")&&"boolean"===typeof a.isDevicePreRegistered&&
(b.devicePreregistration={selected:a.isDevicePreRegistered});a.hasOwnProperty("programId")&&a.programId.length&&(b.installments={programId:a.programId});a.hasOwnProperty("incentivizedCart")&&a.incentivizedCart.length&&(b.incentivizedCart=a.incentivizedCart);a.hasOwnProperty("paymentOfferInfo")&&a.paymentOfferInfo.length&&(b.paymentOfferInfo=a.paymentOfferInfo);return b},formatBooleanParams:function(a){for(var b in a)if(a.hasOwnProperty(b)&&"string"===typeof a[b]){var c=a[b].toLowerCase();-1!==e.indexOf(c)&&
(a[b]="true"===c)}return a}});return{createRequest:function(a,b,c){return new d(a,b,c)}}});"use strict";m.when("A","bundles-card").register("bundles-secondary-view-item-models",function(b,c){function e(a){try{var b=x.grep(a.entity.images,function(a){return"MAIN"===a.variant});b&&b.length||(b=a.entity.images);return"https://m.media-amazon.com/images/I/"+b[0].lowRes.physicalId+"."+b[0].lowRes.extension}catch(c){m.log("Unable to fetch main image for asin","ERROR")}}function d(a){try{return a.entity.displayString}catch(b){m.log("Unable to fetch title for asin",
"ERROR")}}function a(a,b){try{if(a[0].price&&a[0].price.entity[""+b]){var c=a[0].price.entity[""+b];if(c)return c.moneyValueOrRange.value.amount}}catch(d){m.log("Unable to fetch "+JSON.stringify(b)+" price for asin","ERROR")}}function k(a,b){q||(q=new Intl.NumberFormat(a,{style:"currency",currency:b}));return q}var x=b.$,q,u=function(a,b){try{return"stars"===b?a.rating.hasHalfStar?a.rating.fullStarCount+.5:a.rating.fullStarCount:a.count.displayString}catch(c){m.log("Unable to fetch star rating/review count for asin",
"ERROR")}},z=function(a,b,c){a=a.parameters;if(a.length)for(var d=0;d<a.length;d++)if(a[d].name===b)return a[d].value;return c};return{validateProductV2Entity:function(a){return a.asin&&a.productImages.entity.images.length&&a.title.entity.displayString&&a.buyingOptions.length?!0:!1},componentData:function(b,f){this.detailPageUrl="/dp/"+b.asin;this.imageUrl=e(b.productImages);this.itemTitle=d(b.title);if(f=a(b.buyingOptions,"basisPrice"))this.basisPrice=k(c.language,c.currencyOfPreference).format(f);
b.customerReviewsSummary&&(this.starRating=u(b.customerReviewsSummary.entity,"stars"),this.ratingCount=u(b.customerReviewsSummary.entity,"count"))},recommendationItemData:function(b,f){this.asin=b.asin;this.detailPageUrl="/dp/"+b.asin;this.imageUrl=e(b.productImages);this.itemTitle=d(b.title);b.customerReviewsSummary&&(this.starRating=u(b.customerReviewsSummary.entity,"stars"),this.ratingCount=u(b.customerReviewsSummary.entity,"count"));f=a(b.buyingOptions,"basisPrice");var q=k(c.language,c.currencyOfPreference);
f&&(this.basisPrice=q.format(f));this.buyingPrice=q.format(a(b.buyingOptions,"priceToPay"));b.featureBullets&&(this.featureBullets=b.featureBullets.entity.featureBullets);b.buyingOptions[0].callToAction&&b.buyingOptions[0].callToAction.entity&&b.buyingOptions[0].callToAction.entity.addToCart&&b.buyingOptions[0].callToAction.entity.addToCart.data&&(f=b.buyingOptions[0].callToAction.entity.addToCart.data,this.canAddToCart=z(f,"canAddToCart",!1),this.offerListingId=z(f,"offerListingId",""));b.buyingOptions[0].quantity&&
b.buyingOptions[0].quantity.entity&&(this.quantityLimit=b.buyingOptions[0].quantity.entity.maxOrderQuantity)}}});"use strict";m.when("A","ready").register("bundle-state",function(b){var c=b.$,e={bundleState:"#bundle-state"};return{elements:e,getBundleASIN:function(){var b=c(e.bundleState);if(b.length)return b.data("asin")}}});"use strict";m.when("A").register("bundles-aapi-util",function(b){var c=b.$;return{getAAPIProductData:function(b,d,a,k,x,q,m){return c.ajax({url:"https://"+b+"/api/marketplaces/"+
q+"/products/"+k,type:"GET",headers:{Accept:x,"x-api-csrf-token":a,"Accept-Language":d,"x-cc-currency-of-preference":m,"x-amzn-encrypted-slate-token":c('meta[name\x3d"encrypted-slate-token"]').prop("content")},xhrFields:{withCredentials:!0}})},getProductV2ResourceInclusions:function(b){return'application/vnd.com.amazon.api+json; type\x3d"collection(product/v2)/v1"; expand\x3d"'+b.join(",")+'"'},getCartData:function(b,d,a){return c.ajax({cache:!1,url:"https://"+b+"/api/marketplaces/"+a+"/cart/items",
type:"GET",data:{filter:"RETAIL"},headers:{Accept:'application/vnd.com.amazon.api+json; type\x3d"cart.items/v1"',"Content-Type":'application/vnd.com.amazon.api+json; type\x3d"cart.items.request/v1"',"x-api-csrf-token":d,"x-amzn-encrypted-slate-token":c('meta[name\x3d"encrypted-slate-token"]').prop("content")},xhrFields:{withCredentials:!0}})},getFullCartCount:function(b,d,a){return c.ajax({cache:!1,url:"https://"+b+"/api/marketplaces/"+a+"/cart/count",type:"GET",headers:{Accept:'application/vnd.com.amazon.api+json; type\x3d"cart.count/v1"',
"Content-Type":'application/vnd.com.amazon.api+json; type\x3d"cart.count.request/v1"',"x-api-csrf-token":d,"x-amzn-encrypted-slate-token":c('meta[name\x3d"encrypted-slate-token"]').prop("content")},xhrFields:{withCredentials:!0}})},getCartSummary:function(b,d,a){return c.ajax({cache:!1,url:"https://"+b+"/api/marketplaces/"+a+"/cart/summary",type:"GET",data:{cartTypes:"RETAIL"},headers:{Accept:'application/vnd.com.amazon.api+json; type\x3d"cart.summary/v1"',"Content-Type":'application/vnd.com.amazon.api+json; type\x3d"cart.summary.request/v1"',
"x-api-csrf-token":d,"x-amzn-encrypted-slate-token":c('meta[name\x3d"encrypted-slate-token"]').prop("content")},xhrFields:{withCredentials:!0}})}}});"use strict";m.when("A").register("bundle-logger",function(b){var c=b.$;b=A.ue||!1;var e=b.count||!1,d=b.log||!1,a=A.ueLogError||!1,k=function(b,c,e,k){"INFO"!==c&&a?(null!==k&&"object"===typeof k?k.message="["+b+"] "+k.message:k={message:"["+b+"]"},a(k,{logLevel:c,attribution:e,message:b})):"INFO"===c&&d&&d(b,e)};return{logCount:function(a,b){if(e)return e(a,
b),e(a)},logInfo:function(a,b){k(a,"INFO",b,null)},logWarning:function(a,b,c){k(a,"WARN",b,c)},logError:function(a,b,c){k(a,"ERROR",b,c)},logFatal:function(a,b,c){k(a,"FATAL",b,c)},logRefTag:function(a,b){c.get("/hctp/log/refMarker?ref_\x3d"+a)}}});"use strict";m.when("A").register("bundle-constants",function(){return{BUNDLE_LISTING_V2_READY_EVENT:"bundle-listing-V2:widget:ready",BUNDLE_LISTING_BOTTOM_SHEET_READY_EVENT:"bundle-listing:sheet:ready",BUNDLES_CARD_READY:"bundles-card-ready",BUNDLES_CARD_SECONDARY_VIEW_READY:"bundles-card-secondary-view-ready",
BUNDLES_DRAWER_SIDE_SHEET_READY:"bundles-drawer-side-sheet-ready",BUNDLES_CARD_SECONDARY_VIEW_ATC_READY:"bundles-card-secondary-view-atc-ready",BUNDLES_CARD_RENDER_SECONDARY_VIEW:"bundles-card-render-secondary-view",BUNDLES_COMPONENTS_EXPANDER_READY:"a:expander:bundle-components-expander",BUNDLES_POPOVER_BEFORE_SHOW:"a:popover:beforeShow:bundles_secondary_view",BUNDLES_POPOVER_AFTER_HIDE:"a:popover:afterHide:bundles_secondary_view",BUNDLES_TOGGLE_EXPANDER:"toggle-bundle-cards-expander",AJAX_URL:"/gp/product/ajax/bundlesAjaxExperience?asin\x3d"}});
"use strict";m.when("A","bundles-card","bundle-constants","bundles-secondary-view-item-models","bundles-aapi-util","bundles-side-sheet-cart-data","a-truncate","bundles-drawer-side-sheet","bundle-logger","ready").register("bundles-desktop-secondary-view",function(b,c,e,d,a,k,x,q,u){function z(a){q.reset();g.post(e.AJAX_URL+a).done(function(a){a=g(E.ajaxDataWrapper).html(a);q.initialize(a)}).done(function(){b.trigger(e.BUNDLES_CARD_SECONDARY_VIEW_ATC_READY);b.trigger(e.BUNDLES_DRAWER_SIDE_SHEET_READY);
g(n.bundleTitle).live("click",function(){if(c.isDevices){var a=g(this).closest(n.bundleExpander).find(n.bundleAsin).val();u.logRefTag(B.BUNDLE_TITLE_CLICKED_DESKTOP+c.landingAsin+v.UNDERSCORE+a,c.landingAsin)}});g(n.bundleGetDealButton).live("click",function(){if(c.isDevices){var a=g(this).closest(n.bundleExpander).find(n.bundleAsin).val();u.logRefTag(B.GET_DEAL_BUNDLE_CLICKED_DESKTOP+c.landingAsin+v.UNDERSCORE+a,c.landingAsin)}})}).fail(function(){m.log("Fail to render secondary view for "+a,"ERROR")})}
function r(b,p,k){var e=g(n.bundleComponentsExpander+b),t=!1;e.length&&a.getAAPIProductData(c.aapiEndpoint,c.language,c.csrfToken,p,h,c.marketplaceId,c.currencyOfPreference).done(function(a){a=a.entities;for(var b=0;b<a.length;b++){var p=a[b].entity;if(d.validateProductV2Entity(p)){var k=p.asin,p=new d.componentData(p,c.currency),k=e.find(n.bundleComponentCard+k);f(k,p);y(k,p);k.find(l.productBuyingPriceBase).text()&&p.basisPrice&&k.find(l.productFullPrice).text(p.basisPrice)}else{t=!0;break}}e.toggleClass(v.AUI_HIDDEN_CLASS,
t);q.updateContent(g(n.bundlesSecondaryViewSideSheet).html())})}function f(a,b){a.find(l.productImageUrl).attr("src",b.imageUrl);a=a.find(l.productTitle);a.attr("href",b.detailPageUrl);a.find(l.productTitleText).append(b.itemTitle);x.get(a.find(l.productTitleTruncate)).update()}function y(a,b){if(b.starRating&&b.ratingCount){var c=b.starRating.toString().replace(".","-");a.find(l.productRatingStars).removeClass("a-star-0").addClass("a-star-"+c);a.find(l.productRatingCount).text(b.ratingCount)}}function t(a,
b){var c=g(n.bundlesSecondaryView+" .primary-bundles").children("div");c.length&&(c=c.eq(0).offset().top,b=b.offset().top,a.animate({scrollTop:b-c},2E3))}function w(b,e){var t=g(n.bundlesSecondaryView).find(p.upsellRecommendation+b),B=0;a.getAAPIProductData(c.aapiEndpoint,c.language,c.csrfToken,e,h,c.marketplaceId,c.currencyOfPreference).done(function(a){a=a.entities;for(var b=0;b<a.length;b++){var e=a[b].entity;if(d.validateProductV2Entity(e)){var h=new d.recommendationItemData(e,c.currency),e=t.find(p.accessoryAtcCard+
e.asin);f(e,h);y(e,h);h.buyingPrice&&e.find(l.productBuyingPriceBase).text(h.buyingPrice);h.fullPrice&&e.find(l.productFullPrice).text(h.fullPrice);if(h.featureBullets)for(var m=0;m<h.featureBullets.length;m++)e.find(l.featureBullet).append("\x3cli\x3e"+h.featureBullets[m]+"\x3c/li\x3e");h.quantityLimit&&k.setItemQuantityLimit(h.asin,h.quantityLimit);h.offerListingId&&h.canAddToCart&&(e.find(p.individualRecommendationAtc).find(p.accessoryOfferListingId).val(h.offerListingId),e.toggleClass(v.AUI_HIDDEN_CLASS),
B++)}}0<B&&(a=t.find(p.accessoryAtcHeader),a.text(a.text().replace(v.ITEM_COUNT_PLACEHOLDER,B)),a.toggleClass(v.AUI_HIDDEN_CLASS));q.updateContent(g(n.bundlesSecondaryViewSideSheet).html())}).fail(function(){t.toggleClass(v.AUI_HIDDEN_CLASS,!0);m.log("An error has occurred while getting accessory recommendations sub total","WARN")})}var g=b.$,h=a.getProductV2ResourceInclusions("productImages(product.product-images/v2) title(product.offer.title/v1) buyingOptions[].price(product.price/v1) customerReviewsSummary(product.customer-reviews-summary/v1) featureBullets(product.offer.feature-bullets/v1) buyingOptions[].quantity(product.quantity/v2) buyingOptions[].callToAction(product.call-to-action/v1)".split(" ")),
l={productImageUrl:".item-image",productTitle:".item-title",productTitleText:".a-truncate-full",productTitleTruncate:".a-truncate",productRatingStars:".a-star-0",productRatingCount:".component-rating-count",productBuyingPriceBase:".buying-item-price-base",productFullPrice:".full-item-price",featureBullet:".feature-bullet"},n={bundlesSecondaryView:"#bundles-secondary-view",bundleAsin:"[name\x3d'bundle-asin']",bundleExpanders:"#bundle-expander-content-",bundleExpander:".secondary-bundle-container",
bundleExpanderContent:".bundle-expander-content",bundleExpanderHeader:".bundle-expander-header",bundleComponentsExpander:".bundle-components-expander-",bundleComponentsExpanderHeader:".bundle-components-expander-header",bundleComponentsExpanderContent:".bundle-components-expander-content",bundleComponentCard:".bundle-component-card-",componentAsins:"[name\x3d'component-asins']",expanderAsins:".bundles-secondary-expander-asins",expanderComponentAsins:".bundles-secondary-expander-component-asins",bundlesSecondaryViewSideSheet:"#bundles-desktop-side-sheet",
bundleCardAsin:"input[name\x3d'bundle-card-asin']",bundleTitle:".bundle-details-title",bundleGetDealButton:".bundle-get-deal-button",relatedBundlesDivider:".related-bundles-divider"},p={individualRecommendationAtc:".bundles-drawer-individual-recommendation-add-to-cart",accessoryAtcHeader:".bundles-drawer-accessory-atc-header",accessoryOfferListingId:'[name\x3d"accessory-offer-listing-id"]',upsellRecommendation:"#bundle-upsell-recommendations-",accessoryAtcCard:"#bundle-upsell-accessory-atc-card-",
bundleAsin:".bundles-sideSheet-accessory-atc-asins",bundleAccessoryAsins:".bundles-sideSheet-accessory-atc-recommendation-asins"},v={AUI_HIDDEN_CLASS:"aok-hidden",SIDE_SHEET:"side-sheet",BUNDLES_CARD_SELECTOR:"div[id^\x3d'bundle-card']",ITEM_COUNT_PLACEHOLDER:"{NUM_OF_ITEMS}",BUNDLE_EXPANDER_HEADING_HIGHLIGHTED_CLASS:"bundle-expander-header-highlighted",BUNDLE_EXPANDER_HEADING_CLASS:"bundle-expander-header",BUNDLE_CARD_CLICKED_REFTAG:"amzdv_tplus_dp_dsk_card_clicked_",UNDERSCORE:"_",INGRESS_CARD_REFTAG:"amzdv_tplus_dp_dsk_expl_simlr_bdl_"},
E={ajaxDataWrapper:'\x3cdiv id\x3d"bundles-desktop-side-sheet-wrapper"\x3e\x3c/div\x3e'},B={BUNDLE_TITLE_CLICKED_DESKTOP:"amzdv_tplus_dp_dsk_bdp_",GET_DEAL_BUNDLE_CLICKED_DESKTOP:"amzdv_tplus_dp_dsk_bgd_"};b.on(e.BUNDLES_CARD_RENDER_SECONDARY_VIEW,function(){z(c.landingAsin)});b.on(e.BUNDLES_DRAWER_SIDE_SHEET_READY,function(){var a=g(n.bundlesSecondaryView),b=a.find(n.expanderComponentAsins),d=a.find(n.expanderAsins);b.length&&b.each(function(c){r(d[c].textContent.trim(),b[c].textContent.trim(),a)});
var f=a.find(p.bundleAsin),e=a.find(p.bundleAccessoryAsins);e.length&&e.each(function(a){w(f[a].textContent.trim(),e[a].textContent.trim())});a=g(n.bundlesSecondaryViewSideSheet);g(".ingress-card").unbind("click").click(function(b){b.preventDefault();c.isDevices&&u.logRefTag(v.INGRESS_CARD_REFTAG+c.landingAsin,c.landingAsin);q.show(function(){var b=g(n.relatedBundlesDivider);t(a,b)},!0)});c.isUnifiedCxView||g(".bundle-box-link").unbind("click").click(function(b){b.preventDefault();var p=g(this).siblings(n.bundleCardAsin).val();
c.isDevices&&(b=g(".bundle-box-link").index(b.target),u.logRefTag(v.BUNDLE_CARD_CLICKED_REFTAG+b+v.UNDERSCORE+c.landingAsin,c.landingAsin));q.show(function(b){var c=g(n.bundlesSecondaryView).find(".secondary-bundle-container input[value\x3d'"+b+"']").closest(n.bundleExpander);"false"===c.find(n.bundleExpanderContent).attr("aria-expanded")&&c.find(n.bundleExpanderHeader).click();"false"===c.find(n.bundleComponentsExpanderContent).attr("aria-expanded")&&c.find(n.bundleComponentsExpanderHeader).click();
c.find(n.bundleExpanderHeader).removeClass(v.BUNDLE_EXPANDER_HEADING_CLASS).addClass(v.BUNDLE_EXPANDER_HEADING_HIGHLIGHTED_CLASS);b=a.find(".secondary-bundle-container input[value\x3d'"+b+"']").closest(n.bundleExpander);t(a,b)},!1,p)})})});"use strict";m.when("A","MakoAmazonApiAddToCartHelper","bundle-constants","bundles-aapi-util","bundles-card","bundles-side-sheet-cart-data","bundle-logger","a-checkbox").execute("register-bundles-add-to-cart-declarative-actions",function(b,c,e,d,a,k,x,q){function u(a){a&&
a.items&&a.items.forEach(function(a){k.setCartItemQuantity(a.asin,a.quantity)})}function z(a){k.setCartTotalCount(a);m.when("nav.setCartCount").execute(function(b){b(a)})}function r(a){g(h.postAddToCartContent).find(n.subTotalContainer).toggleClass(l.AUI_HIDDEN_CLASS,!a)}function f(){d.getCartSummary(a.aapiEndpoint,a.csrfToken,a.marketplaceId).done(function(a){r(!0);a.entity&&a.entity.summary&&0<a.entity.summary.length&&g(h.postAddToCartContent).find(n.subTotalPrice).text(a.entity.summary[0].subtotal.displayString)}).fail(function(){r(!1);
m.log("An error has occurred while getting cart sub total","WARN")})}function y(a){var b=a.asin;if(g(h.atcButton+b).length){var c=q(h.accountLinkingCheckbox+b);c&&(a.isDevicePreRegistered=c.isChecked())}g(h.installmentsCheckbox+b).length&&(c=q(h.installmentsCheckbox+b))&&c.isChecked()&&(a.programId=g(h.installmentsCheckbox+b).val());return a}function t(a){var b=g(h.postAddToCartContent).find(n.proceedToCheckoutText);b.text().includes(l.ITEM_COUNT_PLACEHOLDER)?b.text(b.text().replace(l.ITEM_COUNT_PLACEHOLDER,
a)):b.text(b.text().replace(/\d+/,a))}function w(a,b,c,d){b.text(c);a.toggleClass(l.AUI_HIDDEN_CLASS,!0);d.toggleClass(l.AUI_HIDDEN_CLASS,!1)}var g=b.$,h={reachCartLimitMessage:"#bundle-reach-cart-limit-message-",atcButton:"#bundle-ajax-atc-button-",atcErrorBlock:"#bundle-ajax-atc-error-block-",bundlesDrawerSideSheet:"#bundles-desktop-side-sheet",natcForm:"#bundles-drawer-natc-form-",accountLinkingCheckbox:"#bundles-desktop-side-sheet #bundle-account-linking-",accountLinkingHiddenInput:"#bundles-drawer-natc-accountLinking-",
installmentsCheckbox:"#bundles-desktop-side-sheet #bundle-account-installments-",installmentsHiddenInput:"#bundles-drawer-natc-installments-",installmentsMessage:"#bundles-desktop-side-sheet #bundles-drawer-installments-message",installmentsMessageText:"#bundles-desktop-side-sheet #bundles-drawer-installments-message-text",bundleExpanders:"#bundle-expander-content-",bundleImage:".bundle-image",bundleContent:"#bundles-desktop-side-sheet .bundle-content",postAddToCartContent:"#bundles-desktop-side-sheet .post-add-to-cart"},
l={AUI_HIDDEN_CLASS:"aok-hidden",UNDERSCORE:"_",HIDDEN_TYPE:"hidden",BUNDLE_AJAX_ATC_DECLARATIVE_ACTION:"bundles-ajax-add-to-cart",BUNDLE_NATC_ACCOUNT_LINKING_DECLARATIVE_ACTION:"bundles-account-linking-checkbox",ACCOUNT_LINKING_INPUT_NAME_NATC:"items[0.base][additionalParameters][devicePreregistration][selected]",BUNDLE_NATC_INSTALLMENTS_DECLARATIVE_ACTION:"bundles-installments-checkbox",INSTALLMENTS_INPUT_NAME_NATC:"items[0.base][additionalParameters][installments][programId]",ACCOUNT_LINKING_INPUT_ID_PREFIX:"bundles-drawer-natc-accountLinking-",
INSTALLMENTS_INPUT_ID_PREFIX:"bundles-drawer-natc-installments-",ACCESSORY_ATC_DECLARATIVE_ACTION:"bundles-ajax-accessory-atc",ITEM_COUNT_PLACEHOLDER:"{NUM_OF_ITEMS}"},n={accessoryAtcButton:".bundles-drawer-ajax-accessory-atc-button",accessoryAtcCard:".bundles-drawer-accessory-atc-card",accessoryAtcErrorContent:".bundles-drawer-accessory-atc-error-content",accessoryAtcSpinner:".bundles-drawer-accessory-atc-spinner",accessoryAtcSuccessContainer:".bundles-drawer-accessory-atc-success-container",accessoryAtcSuccessContent:".bundles-drawer-accessory-atc-success-content",
accessoryOfferListingId:'[name\x3d"accessory-offer-listing-id"]',upsellRecommendationSection:"#bundle-upsell-recommendations-",successCount:".bundles-drawer-success-count",proceedToCheckoutText:".bundles-drawer-proceed-to-checkout-text",addedItemImage:".bundles-drawer-added-item-image",subTotalPrice:".bundles-drawer-accessory-sub-total-price",subTotalContainer:".bundles-drawer-accessory-sub-total-container"};b.on(e.BUNDLES_CARD_SECONDARY_VIEW_ATC_READY,function(){k.resetData();d.getCartData(a.aapiEndpoint,
a.csrfToken,a.marketplaceId).done(function(a){u(a.entity)});d.getFullCartCount(a.aapiEndpoint,a.csrfToken,a.marketplaceId).done(function(a){a.entity&&k.setCartTotalCount(a.entity.items)})});b.declarative(l.BUNDLE_AJAX_ATC_DECLARATIVE_ACTION,"click",function(b){b=b.data;var d=b.asin,e=g(h.bundlesDrawerSideSheet),B=e.find(h.atcButton+d),w=e.find(h.reachCartLimitMessage+d),r=e.find(h.atcErrorBlock+d);k.cartContainsItem(d)?(B.addClass(l.AUI_HIDDEN_CLASS),w.removeClass(l.AUI_HIDDEN_CLASS)):(e=c.createRequest(b.csrfToken,
b.marketplaceId,b.aapiEndpoint),b={asin:d,offerId:b.offerListingId,quantity:1},b=y(b),e.addSingleAsinData(b),e.setRefTag("bundles_dsk_sec_view_bundle_atc"),x.logCount("bundlesDrawerBundleCartApiSent",1),e.sendRequest(function(b){k.setCartItemQuantity(d,1);var c=k.getCartTotalCount();z(b.entity.count.entity.items);a.isDevices&&x.logRefTag("amzdv_tplus_dp_dsk_atc_"+a.landingAsin+l.UNDERSCORE+d,a.landingAsin);f();t(k.getCartTotalCount());b=g(h.bundlesDrawerSideSheet).find(h.bundleExpanders+d).find(h.bundleImage).attr("src");
var e=0;g(h.installmentsCheckbox+d).length&&q(h.installmentsCheckbox+d).isChecked()&&(e=k.getCartTotalCount()-c);c=g(h.installmentsMessageText).text();0<e?(g(h.installmentsMessageText).text(c.replace(l.ITEM_COUNT_PLACEHOLDER,e)),g(h.installmentsMessage).toggleClass(l.AUI_HIDDEN_CLASS,!1)):g(h.installmentsMessage).toggleClass(l.AUI_HIDDEN_CLASS,!0);g(n.addedItemImage).attr("src",b);g(h.bundlesDrawerSideSheet).scrollTop(0);g(h.bundleContent).toggleClass(l.AUI_HIDDEN_CLASS,!0);g(h.postAddToCartContent).find(n.upsellRecommendationSection+
d).toggleClass(l.AUI_HIDDEN_CLASS);g(h.postAddToCartContent).toggleClass(l.AUI_HIDDEN_CLASS)},function(){x.logCount("bundlesDrawerBundleCartApiFailed",1);m.log("An error has occurred with Cart API addItems request when add "+d+" from Secondary View.","WARN");a.isDevices&&x.logRefTag("amzdv_tplus_dp_dsk_failed_atc_"+a.landingAsin+l.UNDERSCORE+d,a.landingAsin);B.addClass(l.AUI_HIDDEN_CLASS);r.removeClass(l.AUI_HIDDEN_CLASS)}))});b.declarative(l.ACCESSORY_ATC_DECLARATIVE_ACTION,"click",function(d){var e=
d.data;x.logCount("bundlesDrawerSideSheetAccessoryAtcClicked",1);var h=e.bundleAsin,g=e.asin,q=d.$target.closest(n.accessoryAtcButton);q.toggleClass(l.AUI_HIDDEN_CLASS,!0);var r=q.closest(n.accessoryAtcCard),u=r.find(n.accessoryAtcSpinner);u.toggleClass(l.AUI_HIDDEN_CLASS);var y=r.find(n.accessoryAtcSuccessContent).find(n.accessoryAtcButton),A=r.find(n.accessoryAtcErrorContent);d=r.find(n.accessoryOfferListingId).val();var C=r.find(n.accessoryAtcSuccessContainer),D=C.find(n.successCount),e=c.createRequest(e.csrfToken,
e.marketplaceId,e.aapiEndpoint);e.addSingleAsinData({asin:g,offerId:d,quantity:1});e.setRefTag("bundles_dsk_sec_view_acc_atc");e.sendRequest(function(c){z(c.entity.count.entity.items);A.toggleClass(l.AUI_HIDDEN_CLASS,!0);k.cartContainsItem(g)?k.setCartItemQuantity(g,k.getCartItemQuantity(g)+1):k.setCartItemQuantity(g,1);!k.getItemQuantityLimit(g)||k.getCartItemQuantity(g)<k.getItemQuantityLimit(g)?b.delay(function(){f();t(k.getCartTotalCount());w(u,D,k.getCartItemQuantity(g),C);q.toggleClass(l.AUI_HIDDEN_CLASS,
!1);y.toggleClass(l.AUI_HIDDEN_CLASS,!1)},3E3):(f(),t(k.getCartTotalCount()),w(u,D,k.getCartItemQuantity(g),C));a.isDevices&&x.logRefTag("amzdv_tplus_dp_dsk_patc_"+a.landingAsin+l.UNDERSCORE+h+l.UNDERSCORE+g,a.landingAsin)},function(){x.logCount("bundlesDrawerSideSheetAccessoryAtcFailed",1);u.toggleClass(l.AUI_HIDDEN_CLASS,!0);q.toggleClass(l.AUI_HIDDEN_CLASS,!1);y.toggleClass(l.AUI_HIDDEN_CLASS,!0);A.toggleClass(l.AUI_HIDDEN_CLASS,!1);m.log("An error has occurred with desktop post atc screen add to cart request handler for "+
g,"WARN");a.isDevices&&x.logRefTag("amzdv_tplus_dp_dsk_failed_patc_"+a.landingAsin+l.UNDERSCORE+h+l.UNDERSCORE+g,a.landingAsin)})});b.declarative(l.BUNDLE_NATC_ACCOUNT_LINKING_DECLARATIVE_ACTION,"change",function(a){var b=a.data.asin,c=q(h.accountLinkingCheckbox+b).isChecked();a=g(h.bundlesDrawerSideSheet).find(h.natcForm+b);var d=a.find(h.accountLinkingHiddenInput+b);d&&d.length&&d.remove();b=g("\x3cinput\x3e",{type:l.HIDDEN_TYPE,name:l.ACCOUNT_LINKING_INPUT_NAME_NATC,value:c,id:l.ACCOUNT_LINKING_INPUT_ID_PREFIX+
b});a.append(b)});b.declarative(l.BUNDLE_NATC_INSTALLMENTS_DECLARATIVE_ACTION,"change",function(a){a=a.data.asin;var b=q(h.installmentsCheckbox+a),c=g(h.installmentsCheckbox+a).val(),d=b.isChecked(),b=g(h.bundlesDrawerSideSheet).find(h.natcForm+a),e=b.find(h.installmentsHiddenInput+a);e&&e.length&&e.remove();d&&(a=g("\x3cinput\x3e",{type:l.HIDDEN_TYPE,name:l.INSTALLMENTS_INPUT_NAME_NATC,value:c,id:l.INSTALLMENTS_INPUT_ID_PREFIX+a}),b.append(a))})});"use strict";m.when("A","bundles-focus-management",
"ready").register("bundles-drawer-side-sheet",function(b,c){function e(a,b){u=document.activeElement;if(a)d("#bundle-expander-header-"+a).focus();else{if(b&&(a=d(f.SIDE_SHEET_CONTAINER).find(f.RELATED_BUNDLES),a.length))return a.find('[id^\x3d"bundle-expander-header-"]:first').focus(),y;d(f.SIDE_SHEET_CONTAINER).find('[id^\x3d"bundle-expander-header-"]:first').focus()}}var d=b.$,a,k,m,q=!1,u,z,r,f={SIDE_SHEET_MODAL_LAYER:"#bundles-desktop-side-sheet-modal-wrapper",SIDE_SHEET_CONTAINER:"#bundles-desktop-side-sheet",
SIDE_SHEET_DARK_BACKGROUND:"#bundles-side-sheet-bg",PAGE_BODY:"body",RELATED_BUNDLES:".related-bundles"},y={initialize:function(b){m=b;d(f.SIDE_SHEET_CONTAINER).html(m);a=this.close},onKeyDown:function(b){27===b.which&&a()},close:function(){b.delay(function(){b.hide(f.SIDE_SHEET_DARK_BACKGROUND)},400);d(f.SIDE_SHEET_CONTAINER).animate({right:k},{duration:500,complete:function(){d(f.SIDE_SHEET_CONTAINER).addClass("aok-hidden");d(f.SIDE_SHEET_MODAL_LAYER).addClass("aok-hidden");d(document).unbind("keydown",
this.onKeyDown);d(f.PAGE_BODY).removeClass("bundles-scroll-disabled");q=!1;u.focus()}})},show:function(a,c,g){d(f.SIDE_SHEET_CONTAINER).html(m);d(f.SIDE_SHEET_CONTAINER).scrollTop(0);d(f.SIDE_SHEET_MODAL_LAYER).removeClass("aok-hidden");d(f.SIDE_SHEET_CONTAINER).removeClass("aok-hidden");d(f.SIDE_SHEET_CONTAINER).animate({right:"0"},500,"linear");b.delay(function(){b.show(f.SIDE_SHEET_DARK_BACKGROUND)},400);d(f.PAGE_BODY).addClass("bundles-scroll-disabled");d(document).unbind("keydown",this.onKeyDown);
d(document).keydown(this.onKeyDown);a&&"function"===typeof a&&a(g);k=d(f.SIDE_SHEET_CONTAINER).css("right");q=!0;e(g,c)},reset:function(){m=null;q=!1;u=null;z=!1;r=null},isReadyToShow:function(){return null!==m},updateContent:function(a){m=a}};document.addEventListener("focus",function(a){if(q&&!z){var b=d(f.SIDE_SHEET_MODAL_LAYER).get(0);b.contains(a.target)?r=a.target:(z=!0,c.focusDescendant(b,"first"),r===document.activeElement&&c.focusDescendant(b,"last"),z=!1,r=document.activeElement)}},!0);
return y});"use strict";m.register("bundles-side-sheet-cart-data",function(){var b={},c={},e;return{resetData:function(){b={};c={}},setCartItemQuantity:function(c,a){b[c]=a},getCartItemQuantity:function(c){return b[c]},cartContainsItem:function(c){return c in b},setCartTotalCount:function(b){e=b},getCartTotalCount:function(){return e},getItemQuantityLimit:function(b){return c[b]},setItemQuantityLimit:function(b,a){c[b]=a}}});"use strict";m.when("A","bundles-drawer-side-sheet","bundles-card","bundle-logger").execute("register-bundles-side-sheet-declarative-actions",
function(b,c,e,d){var a=b.$;b.declarative("open-bundles-drawer-side-sheet","click",function(a){c.isReadyToShow()&&(e.isDevices&&d.logRefTag("amzdv_tplus_dp_dsk_shown_all_"+e.landingAsin,e.landingAsin),c.show())});b.declarative("close-bundles-side-sheet","click",function(a){c.close()});b.on("a:expander:bundle-components-expander:toggle:expand",function(b){a("#bundles-secondary-view .bundle-expander-header-highlighted").removeClass("bundle-expander-header-highlighted").addClass("bundle-expander-header");
e.isDevices&&(b=b.expander.$expander.closest(".secondary-bundle-container").find("[name\x3d'bundle-asin']").val(),d.logRefTag("amzdv_tplus_dp_dsk_witb_"+e.landingAsin+"_"+b,e.landingAsin))})});"use strict";m.register("bundles-focus-management",function(){return{attemptFocus:function(b){try{b.focus()}catch(c){}return b===document.activeElement},focusDescendant:function(b,c){if(b&&b.children)for(var e=0;e<b.children.length;e++){var d=b.children.item("last"===c?b.children.length-e-1:e);if(this.attemptFocus(d)||
this.focusDescendant(d,c))return!0}return!1}}})});
/* ******** */
(function(d){var f=window.AmazonUIPageJS||window.P,h=f._namespace||f.attributeErrors,a=h?h("FreshDetailPageDesktopAssets",""):f;a.guardFatal?a.guardFatal(d)(a,window):a.execute(function(){d(a,window)})})(function(d,f,h){d.when("A","afx-update-cart-count","fresh-dp-prevent-atc-default","ready").register("fresh-dp-add-to-cart",function(a,c,b){var e=!1;return{init:function(a){e||(d.when("fresh-atc-handler").execute(function(a){a.addToFreshCart({success:function(a){},error:function(a,e,g,c){d.log("Error adding to Cart on Fresh Detail Page",
"Error")}})}),e=!0);b.init()}}});d.when("A","afx-utils","ready").register("fresh-show-atc-changeover",function(a,c){var b=a.$,e=b("#afx-atc-changeover");return function(b){if(b&&0<e.length&&c.isFunction(e.find)){var g=a.state("fresh-atc-toast-text");g&&g.atcToastTextString&&(b=g.atcToastTextString.replace("FreshATCToastQuantity",b),(g=e.find(".a-changeover-inner"))&&c.isFunction(g.text)&&(g.text(b),c.isFunction(e.show)&&e.show()))}}});d.when("A","afx-utils","ready").register("fresh-show-atl-changeover",
function(a,c){a=a.$;var b=a("#afx-atl-changeover");return function(){0<b.length&&c.isFunction(b.show)&&b.show()}});"use strict";d.when("jQuery","ready").register("fresh-featurebullets",function(a){var c=function(){var a=!1;return{getIsExpanded:function(){return a},toggleExpanded:function(b){a=!a;b&&b(a)}}}(),b=function(b){var c=function(){var c=a("#fbSection");c.fadeTo(200,.75,null,function(){b.toggleExpanded(function(b){if(b){b=a("#fbSection");var d=a("#feature-bullets");d.find(".a-vertical").removeClass("collapsedFeatureBullets");
b.addClass("expandedFeatureBullets");a("#fbExpandableSection").addClass("expanded");b.find("h1").addClass("expandedFBHeader");a("#featureBulletsPlaceholder").addClass("FBplaceholder");d.find("#fbExpanderMoreButtonSection").hide();a("#feature-bullets")[0].offsetHeight<a("#feature-bullets")[0].scrollHeight&&(a(".fadeTextTopforFB").show(),a(".fadeTextBottomforFB").show());b.find(".closeFB").removeClass("aok-hidden")}else b=a("#fbSection"),d=a("#feature-bullets"),b.find(".closeFB").addClass("aok-hidden"),
a("#featureBulletsPlaceholder").removeClass("FBplaceholder"),d.find(".a-vertical").addClass("collapsedFeatureBullets"),a("#fbExpandableSection").removeClass("expanded"),b.removeClass("expandedFeatureBullets"),b.find("h1").removeClass("expandedFBHeader"),a(".fadeTextTopforFB").hide(),a(".fadeTextBottomforFB").hide(),d.find("#fbExpanderMoreButtonSection").show();c.fadeTo(200,1)})})};return{init:function(){a(".fadeTextTopforFB").hide();a(".fadeTextBottomforFB").hide();var d=a("#fbExpandableSection"),
f=a("#fbExpandableSectionContent");f.height()>d.height()&&(f.addClass("expandableSection"),f.click(c),a("#fbExpanderMoreButtonSection").removeClass("aok-hidden"),a("#feature-bullets").find(".moreFB").click(c),d=a("#fbSection"),d.find(".closeFB").click(c),d.hover(null,function(){b.getIsExpanded()&&c()}))}}};return{init:function(){(new b(c)).init()}}});d.when("A","a-modal","ready").execute(function(a,c){var b=a.$;a=a.state("glowEligibilityState");a!==h&&a.glowModalDisplayEligible&&"desktop"===a.deviceType&&
(c=c.get(b("#dpGlowModal")),c.attrs("ajaxHeaders",{"anti-csrftoken-a2z":b("#glowValidationToken").val()||""}),c.show())})});
/* ******** */
(function(f){var d=window.AmazonUIPageJS||window.P,F=d._namespace||d.attributeErrors,a=F?F("FreshDetailPageCommonAssets",""):d;a.guardFatal?a.guardFatal(f)(a,window):a.execute(function(){f(a,window)})})(function(f,d,F){f.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,e,d,c,u,m,n,b,r,q,g){var p;f.when("EWC").execute(function(b){p=
b});f.when("nav.getFlyout").execute(function(b){b("ewc")});var A={"itemPrice:priceUnavailable:1":"PRICE_UNAVAILABLE","itemDeleted:itemCountOverflow:6":"QUANTITY_OVERFLOW"};return{addToFreshCart:function(m){function h(b,a,k,l){x(b);m.error(b,a,k,l)}function x(l,c){c=c||{};var g=l.data.sessionID;c.title=D(l.data.title);c.asin=l.data.asin;c.offerListingID=l.data.offerListingID;c.sessionID=g;switch(c.reasonCode?c.reasonCode:F){case y.itemNotAvailable:b.increment(k.freshUATCItemNotAvailableErrorCountMetric);
break;case y.itemPartiallyAvailable:b.increment(k.freshUATCItemPartiallyAvailableErrorCountMetric);break;case y.itemPartiallyAvailableForReservation:b.increment(k.freshUATCItemPartiallyAvailableForReservationErrorCountMetric);break;case y.itemNotAvailableForReservation:b.increment(k.freshUATCItemNotAvailableForReservationErrorCountMetric);break;case y.itemPriceUnavailable:b.increment(k.freshUATCItemPriceUnavailableErrorCountMetric);break;case y.itemCountOverflow:b.increment(k.freshUATCItemCountOverflowErrorCountMetric);
break;default:b.increment(k.freshUATCEmptyItemStatusCodeErrorCountMetric),f.log("fresh-atc-handler: No error status code.","ERROR")}c=e.param(c);d.create(l.$currentTarget,{name:"fresh-add-to-cart-modal",sessionID:g,url:"/afx/cart/reservation_conflict?"+c}).show();a.on("a:popover:afterHide:fresh-add-to-cart-modal",function(b){v(g);d.remove(b.popover)})}function D(b){var a={"\x26amp;":"\x26"},l;for(l in a)a.hasOwnProperty(l)&&(b=b.replace(l,a[l]));return b}function B(b){return b.filter(function(b){return b.statusKey in
A})}function l(b,l,a){a+=" returned by UATC is not an array";f.log(a,"Error",l);h(b,"","",a)}function t(e,g,d){d||(d=function(){});try{var m=e.data.asin;if(m)if(e.data.title){var z=e.data.offerListingID;if(z){var r=e.data.sessionID;if(r){var n=q.val();n||(f.log('fresh-atc-handler: "quantity" action parameter is missing.',"ERROR"),n=1);b.setWidgetClickTimestamp(k.freshUATCTCallScope);c({asin:m,offerListingID:z,sessionID:r,quantity:n,reftag:"afx-dp-addtocart",success:function(c){try{b.sendWidgetMetrics(k.freshUATCTCallScope);
var m;if(c&&c.isOK){var z=c.extraErrorInfos;if(z&&z.constructor===Array&&0<z.length)m=!0;else{var q=c.statusList,C;if(q&&q.constructor===Array&&0<q.length){var y=B(q);C=y&&0<y.length}else C=!1;m=C?!0:!1}}else m=!0;if(m)if(b.increment(k.freshUATCInvalidErrorResponseCountMetric),c)if(c.isOK){var v=c.extraErrorInfos,t=c.statusList;if(v&&v.constructor!==Array)l(e,v,"extraErrorInfos");else if(0<v.length){if(v&&!(0>=v.length)){var u=v[0];"ADDRESS_NOT_SELECTED"===u.statusCode?(b.increment(k.freshUATCAddressNotSelectedErrorCountMetric),
f.log("fresh-atc-handler: Address is not selected.","INFO")):x(e,{reasonCode:u.itemStatusCode,quantityAdded:u.availableQuantity,quantityRequested:u.requestedQuantity})}}else if(t&&t.constructor!==Array)l(e,t,"statusList");else if(0<t.length&&t&&!(0>=t.length)){var p=B(t);p&&0<p.length&&x(e,{reasonCode:A[p[0].statusKey]})}}else b.increment(k.freshUATCFailureCountMetric),h(e,"","","isOK returned by UATC is false");else b.increment(k.freshUATCFailureCountMetric),h(e,"","","No response from UATC");else b.increment(k.freshUATCSuccessCountMetric),
g(c,r,n)}catch(w){b.increment(k.freshAddToCartExceptionCountMetric),f.log("fresh-atc-handler exception: "+w,"ERROR")}finally{a.delay(d,E.reEnableDelay)}},error:function(l,c,g){try{b.sendWidgetMetrics(k.freshUATCTCallScope),b.increment(k.freshUATCFailureCountMetric),h(e,l,c,g)}catch(m){b.increment(k.freshAddToCartExceptionCountMetric),f.log("fresh-atc-handler exception: "+m,"ERROR")}finally{a.delay(d,E.reEnableDelay)}}})}else f.log('fresh-atc-handler: Required "sessionID" action parameter is missing.',
"ERROR"),b.increment(k.freshAddToCartMissingParameterCountMetric),h(e)}else f.log('fresh-atc-handler: Required "offerListingID" action parameter is missing.',"ERROR"),b.increment(k.freshAddToCartMissingParameterCountMetric),h(e)}else f.log('fresh-atc-handler: Required "title" action parameter is missing.',"ERROR"),b.increment(k.freshAddToCartMissingParameterCountMetric),h(e);else f.log('fresh-atc-handler: Required "asin" action parameter is missing.',"ERROR"),b.increment(k.freshAddToCartMissingParameterCountMetric),
h(e)}catch(C){b.increment(k.freshAddToCartExceptionCountMetric),f.log("fresh-atc-handler exception: "+C,"ERROR"),a.delay(d,E.reEnableDelay)}}function v(b){p&&"function"===typeof p.refresh?p.refresh():u(b)}var E={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"},y={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"},C=function(b,l,a){r(a);v(l);m.success(b)};a.declarative("fresh-atc-handler","click",n(function(l,a){q.valid()?(g.vibrate(),b.increment(k.freshAddToCartClickCountMetric),t(l,C,a)):a()}))}}});"use strict";f.when("A","jQuery","a-button","fresh-show-atl-changeover","ready").register("FreshAddToShoppingList",function(a,e,d,c){function u(b){e("#"+b.asin+"-afx-atl-dropdown").change(function(a){b.$alreadyInMessage.addClass("aok-hidden");
b.$errorMessage.addClass("aok-hidden")})}function m(b){var e=(a.state("baseWidgetState")||{}).csrfToken;a.post("/afx/lists/json/shoppinglists/additem",{cache:!1,timeout:5E3,params:{asin:b.asin,listID:b.shoppingListID,token:e},success:function(a){b.addButtonInstance.enable();a.successful?(b.$modalParent.find("#"+b.cancelButtonID).click(),c()):1===a.errorCodes[0]?b.$alreadyInMessage.removeClass("aok-hidden"):n(b)},error:function(){b.addButtonInstance.enable();n(b)}})}function n(b){b.$errorMessage.removeClass("aok-hidden");
f.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)f.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?(f.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:
(f.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"),u(b),m(b)))}})});"use strict";f.when("A",
"jQuery","fresh-add-to-cart","fresh-dp-quantity","fresh-show-atc-changeover").execute(function(a,e,d,c,u){d.addToFreshCart({success:function(a,c){u(a.data.renderableSellingQuantity?a.data.renderableSellingQuantity:a.data.quantity);a=c.couponClipStatus;if("CLIP_SUCCESSFUL"===a||"ALREADY_CLIPPED"===a)e("#unclippedCoupon").hide(),e("#clippedCoupon").show()},error:function(a,c,b,e){}});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())});f.when("fresh-atfc-hook").execute(function(a){a.callback()})});f.when("A","jQuery","a-dropdown","fresh-dp-constants","fresh-add-to-cart","a-button").register("fresh-dp-quantity",function(a,e,d,c,f,m){return function(){var n,b,r,q,g,p,A,w,h,x,D,B,l,t=function(){if(!n){b=e(c.addToCartButtonSelector);g=d.getSelect(c.dropdownID);if(r=!!g){q=e(c.dropdownDivSelector);var a=g.getOptions().size();
a&&(A=a-1)}w=e(c.freeTextDivSelector);if(p=0!==w.length)h=e(c.freeTextInputSelector),x=e(c.freeTextErrorDivsSelector),D=e(c.freeTextErrorMsgMin),B=e(c.freeTextErrorMsgMax)}},v=function(){a.on(c.dropdownSelectedID,function(a){e(a.nativeItemNode).index()===A?(h.attr("validValue",l),h.val(l),w.show(),x.hide(),q.hide(),h.focus().select(),g.val("1")):l=g.val()});var k=function(){var a=h.attr("validValue");a&&(g.val(a),g.val()===a?(l=a,q.show(),w.hide()):(f.updateQuantity("freshAddToCartButton",a),b.focus()))},
d=function(){var a=E(h.val());h.attr("validValue",a?a:"")};h.change(d);h.keyup(d);h.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&&(k(),b.click());return!1});h.blur(k)},E=function(){var a;a:{a=h.val();if(c.rxNumbersOnly.test(a)&&(a=parseInt(a,10),!isNaN(a)))break a;a=!1}x.hide();var b=m(c.addToCartButtonSelector);if(!1===a||0>=a)D.show(),b.isEnabled()&&b.disable();else if(1E3<=a)B.show();else return b.isEnabled()||
b.enable(),String(a);return!1};return{init:function(){n=!1;t();n=!0;if(p){w.hide().removeClass(c.auiHiddenClass);x.hide().removeClass(c.auiHiddenClass);var a=g.getOption(A),b=a.info()[0].text;a.update({value:"0",text:e.trim(b)+"+"});l=g.val();v()}},valid:function(){t();return p&&w.is(":visible")?!1!==E():!0},val:function(){t();return p&&w.is(":visible")?h.attr("validValue"):r?g.val():1}}}()});f.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"}});
f.when("A","afx-dp-csm-metrics-utils","ready").execute(function(a,e){a.on("a:expander:ingredients-expander:toggle:expand",function(a){e.increment("almIngredientsExpand")});a.on("a:expander:ingredients-expander:toggle:collapse",function(a){e.increment("almIngredientsCollapse")})});f.when("A","ready").register("fresh-dp-prevent-atc-default",function(a){return{init:function(){a.$("#addToFreshCart").submit(function(a){a.preventDefault()})}}});"use strict";f.when("A","jQuery","a-button","ready").register("fresh-multiselleroffers-pagination-handler",
function(a,e,d){function c(a){var c=parseInt(n.attr("data-currentPage"),10),d=parseInt(n.attr("data-pageCount"),10),c="next"===a?c+1:c-1;n.attr("data-currentPage",c);0===c?b.disable():b.enable();c===d-1?r.disable():r.enable();e(".freshMultiSellerOffer").addClass("hidden");e('.freshMultiSellerOffer[data-page\x3d"'+c+'"]').removeClass("hidden")}var f=e("#freshMultiSellerOffersPreviousPage"),m=e("#freshMultiSellerOffersNextPage"),n=e("#freshMultiSellerOffersPagination"),b=d(f),r=d(m);a.declarative.create(f,
"fresh-multiselleroffers-previous-page",{});a.declarative.create(m,"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){r.isEnabled()&&c("next")})});"use strict";f.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,e){d.ue&&d.uet&&a&&
e&&d.uet(a,e,{wb:1})},increment:function(a){d.ue&&d.ue.count&&a&&d.ue.count(a,(d.ue.count(a)||0)+1)},setCount:function(a,e){d.ue&&d.ue.count&&a&&e&&d.ue.count(a,e)},sendWidgetMetrics:function(a){d.ue&&d.uex&&a&&d.uex("ld",a,{wb:1})}}});"use strict";f.when("A","jQuery","a-button","ready").register("fresh-dp-double-click",function(a,e,d){return function(c){var e={disabled:"true"},d={};return function(f){var b=a.state("fresh-atc-status");b&&b.disabled||(b&&a.state("fresh-atc-status",e),c(f,function(){(b=
a.state("fresh-atc-status"))&&a.state.replace("fresh-atc-status",d)}))}}});"use strict";f.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";f.when("A","jQuery","fresh-show-atl-changeover","afx-dp-csm-metrics-utils","ready").register("FreshAddToAlexaLists",
function(a,e,z,c){function u(a){c.increment(g.countAddToAlexaList);a.data.isAlmInStoreMode&&c.increment(g.countISMAddToAlexaList);c.setWidgetClickTimestamp(g.addToAlexaListCallTime);r(a);var b=Date.now(),h=n(a);e.ajax({url:a.data.url,type:"POST",contentType:"application/json",Accept:"application/json",timeout:5E3,dataType:"json",data:JSON.stringify(a.data.alexaListV2Payload),headers:{"x-amzn-as-metadata":JSON.stringify(h)},success:function(e){c.sendWidgetMetrics(g.addToAlexaListCallTime);c.increment(g.addToAlexaListCallSuccess);
if(a.data.isUnifiedMobileCx){a.$currentTarget.find(".afx-dp-add-to-alexa-list-unified-mobile-text").addClass("aok-hidden");a.$currentTarget.find(".afx-dp-added-to-alexa-list-unified-mobile-text").removeClass("aok-hidden");var d=a.$currentTarget.find("button");d.prop("disabled",!0);a.data.isMobileWfm?d.addClass("afx-dp-add-to-alexa-list-unified-mobile-wfm-success"):d.addClass("afx-dp-add-to-alexa-list-unified-mobile-success")}else z();m(b,Date.now(),a,e);q(a)},error:function(b,e,h){c.sendWidgetMetrics(g.addToAlexaListCallTime);
c.increment(g.addToAlexaListCallFail);f.log("Error response: "+b.responseText,"ERROR");b.status===B?a&&a.data&&a.data.signInURL&&(d.location=a.data.signInURL):f.log("Failed to add item to shopping list "+a.data.title+", url : "+a.data.url,"ERROR");q(a)}})}function m(a,c,d,g){a=0<g.itemInfoList.length?b(a,c,d.data.underscoredBrandName,d.data.sessionId,g.itemInfoList[0]):{eventName:p+w,eventType:h,eventVersion:1,pageName:h+x+d.data.underscoredBrandName,eventStartTime:a,delay:c-a,listType:"SHOP",isDefaultList:!0,
sessionId:d.data.sessionId};d=n(d);e.ajax({url:D,type:"POST",contentType:"application/json",Accept:"application/json",timeout:5E3,dataType:"json",data:JSON.stringify(a),headers:{"x-amzn-as-metadata":JSON.stringify(d)},error:function(a,b,c){f.log("Error response: "+a.responseText,"ERROR")}})}function n(a){var b=a.data.alexaListV2Payload.items[0];return{requestType:a.data.requestType,applicationName:"unknown",applicationVersion:"unknown",ssnapVersion:0,rnVersion:"unknown",osName:"unknown",osVersion:"unknown",
appId:"unknown",bundleVersion:"unknown",isBeta:!1,localeInfo:{marketplaceId:a.data.marketplaceCountryCode,localeId:b.locale,marketplaceObfuscatedId:b.marketplaceId},deviceInfo:{model:"unknown",manufacturer:"unknown"},stage:"Prod"}}function b(a,b,c,e,d){return{eventName:p+A,eventType:h,eventVersion:1,pageName:h+x+c,eventStartTime:a,delay:b-a,listId:d.listId,listType:"SHOP",isDefaultList:!0,sessionId:e,item:{id:d.itemId,listId:d.listId,value:d.itemName,encryptedValue:d.encryptedItemName,updatedDateTime:d.updateAt,
createdDateTime:d.createAt,customerId:d.customerId,version:1,itemType:d.itemType}}}function r(a){a.data.isUnifiedMobileCx?(a.$currentTarget.addClass("aok-hidden"),a.$currentTarget.siblings(".afx-dp-add-to-alexa-list-unified-mobile-spinner").removeClass("aok-hidden")):(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 q(a){a.data.isUnifiedMobileCx?(a.$currentTarget.siblings(".afx-dp-add-to-alexa-list-unified-mobile-spinner").addClass("aok-hidden"),
a.$currentTarget.removeClass("aok-hidden")):(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"))}a.declarative("add-to-alexa-lists","click",function(a){q(a);u(a)});var g={countAddToAlexaList:"countAddToAlexaList",addToAlexaListCallTime:"addToAlexaListCallTime",addToAlexaListCallSuccess:"addToAlexaListCallSuccess",addToAlexaListCallFail:"addToAlexaListCallFail",countISMAddToAlexaList:"countISMAddToAlexaList"},
p="ADD_ITEM_",A="SUCCESS",w="FAILURE",h="F3_Detail_Page",x="_",D="/alexashoppinglists/api/logevents",B=401});f.when("A","afx-dp-csm-metrics-utils","ready").execute(function(a,d){a.on("a:expander:alm-nutrition-information-expander:toggle:expand",function(){document.querySelectorAll(".js-hide-when-nutrition-info-expanded").forEach(function(a){a.style.display="none"});d.increment("almNutritionalInformationExpand")});a.on("a:expander:alm-nutrition-information-expander:toggle:collapse",function(){document.querySelectorAll(".js-hide-when-nutrition-info-expanded").forEach(function(a){a.style.display=
""});d.increment("almNutritionalInformationCollapse")})});f.when("A","afx-dp-csm-metrics-utils","ready").execute(function(a,d){a.declarative("almCRIngress-click-metrics","click",{allowLinkDefault:!0},function(a){d.increment("almCustomerReviewsATF")})})});
/* ******** */
(function(e){var g=window.AmazonUIPageJS||window.P,l=g._namespace||g.attributeErrors,b=l?l("DetailPageOffersDPv2Assets",""):g;b.guardFatal?b.guardFatal(e)(b,window):b.execute(function(){e(b,window)})})(function(e,g,l){e.when("A","jQuery","a-popover","cf").register("actionpanel-modified-popover",function(b,d,c){return function(f,e){function l(){b.on.scroll(function(){var a=c.get(f);if(a&&a.isActive()){var b=a.$container.get(0).getBoundingClientRect();if(0>b.bottom||0>b.right)a.attrs("originalFocus",
null),a.hide()}})}function p(){var a=d(e);m.popoverHandle=c.create(a,{closeButton:!1,closeButtonLabel:a.attr("data-close-button-label")||"close",position:"triggerBottom",name:f,popoverLabel:a.attr("data-popover-label")||f,width:"400",activate:b.capabilities.touch?"onmouseover":"onclick"});b.capabilities.touch&&a.bind("touchend",function(b){m.popoverHandle.isActive()||a.trigger("mouseenter")});b.on("a:popover:afterShow:"+f,q);b.on("a:popover:afterHide:"+f,r);b.on("a:popover:afterUpdatePosition:"+f,
t)}function u(){k=d("#actionPanelOverlay");if(!k.length){var a=document.createElement("div");h.length&&(a.id="actionPanelOverlay",k=d(a).addClass("action-panel-overlay").css({width:h.outerWidth(),top:h.position().top}).bind("touchend click",function(a){return!1}),h.append(a))}}function t(a){var b,c=a.popover.$trigger.get(0).getBoundingClientRect();b=g.pageYOffset?g.pageYOffset:"CSS1Compat"===(document.compatMode||"")?document.documentElement.scrollTop:document.body.scrollTop;var d=h.get(0).getBoundingClientRect().left+
8;a.popover.$container.css({top:c.top+b+"px",left:d+"px"})}function n(){var a=h.get(0).getBoundingClientRect();k.css("height",a.bottom-a.top+"px")}function q(a){n();k.show();a.popover.$container.hasClass("burj-action-panel-modified-popover")||a.popover.$container.addClass("burj-action-panel-modified-popover");a.popover.$trigger.trigger("ActionPanelModifiedPopover.showPopover",a)}function r(a){k.hide();a.popover.$trigger.trigger("ActionPanelModifiedPopover.hidePopover",a)}var h=d("#actionPanel"),k,
m=this;h.length&&(p(),u(),l(),d(g).resize(n))}});e.when("jQuery").register("action-panel",function(b){var d="ap-onetime ap-sns ap-deal ap-pospromo ap-mom ap-fresh ap-oos ap-b2brd ap-used ap-sampling".split(" ");return{setPanelState:function(c){if(c.mode){for(var f=b("#actionPanel"),e=0;e<d.length;e++)f.removeClass(d[e]);c="ap-"+c.mode;0<=b.inArray(c,d)&&f.addClass(c)}}}});e.when("jQuery","action-panel").register("toggleBB",function(b,d){return{init:function(){b('input[name\x3d"toggleBuyBox"]:radio').change(function(){var c=
b(this).attr("value");d.setPanelState({mode:c});"onetime"===c||"used"===c?b("#csffsFeaturecontainer").removeClass("a-hidden"):b("#csffsFeaturecontainer").addClass("a-hidden")})}}})});
/* ******** */
(function(e){var h=window.AmazonUIPageJS||window.P,n=h._namespace||h.attributeErrors,a=n?n("DetailPagePInfoDPv2Assets",""):h;a.guardFatal?a.guardFatal(e)(a,window):a.execute(function(){e(a,window)})})(function(e,h,n){e.when("jQuery","ready").register("burj-featurebullets",function(a){var f=!1,b,c,d=function(){c.fadeTo(200,.75,null,function(){f?(c.find(".closeFB").addClass("aok-hidden"),a("#featureBulletsPlaceholder").removeClass("FBplaceholder"),b.find(".a-vertical").addClass("collapsedFeatureBullets"),
a("#fbExpandableSection").removeClass("expanded"),c.removeClass("expandedFeatureBullets"),c.find("h1").removeClass("expandedFBHeader"),a(".fadeTextTopforFB").hide(),a(".fadeTextBottomforFB").hide(),b.find("#fbExpanderMoreButtonSection").show(),f=!1):(b.find(".a-vertical").removeClass("collapsedFeatureBullets"),c.addClass("expandedFeatureBullets"),a("#fbExpandableSection").addClass("expanded"),c.find("h1").addClass("expandedFBHeader"),a("#featureBulletsPlaceholder").addClass("FBplaceholder"),b.find("#fbExpanderMoreButtonSection").hide(),
a("#feature-bullets")[0].offsetHeight<a("#feature-bullets")[0].scrollHeight&&(a(".fadeTextTopforFB").show(),a(".fadeTextBottomforFB").show()),c.find(".closeFB").removeClass("aok-hidden"),f=!0);c.fadeTo(200,1)})};return{init:function(){b=a("#feature-bullets");c=a("#fbSection");a(".fadeTextTopforFB").hide();a(".fadeTextBottomforFB").hide();var k=a("#fbExpandableSection"),g=a("#fbExpandableSectionContent");g.height()>k.height()&&(g.addClass("expandableSection"),g.click(function(){d()}),a("#fbExpanderMoreButtonSection").removeClass("aok-hidden"),
b.find(".moreFB").click(function(){d()}),c.find(".closeFB").click(function(){d()}),c.hover(null,function(){f&&d()}))}}});e.when("jQuery","atf").register("title-burj",function(a){var f,b,c,d,k,g,q,n,r,l,m,p,u,v=function(){k.text(g);if(m&&f.height()<b.height()){l.removeClass("aok-hidden");if(r){n=g;for(var a=0,d=g.length-1;a<d;){k.text(g);var e=g,h=a+Math.floor((d-a)/2),p=e.indexOf(" ",h);e=e.substring(0,-1!==p?p:e.length-1);k.text(e+"...");f.height()<b.height()?d=h-1:(a=h+1,n=k.text())}r=!1}k.text(n);
c.addClass("showPointerOnHover");q=!0}else m&&(l.addClass("aok-hidden"),c.removeClass("showPointerOnHover"),q=!1)},t=function(){if(q){var a=f.position().top;b.fadeTo(200,.75,function(){m?(u(),l.removeClass("expand").addClass("collapse titleToggleClickedState"),f.addClass("expandedTitle"),b.css("top",a),d.css("top",a-8)):(p(),l.removeClass("collapse").addClass("expand titleToggleClickedState"),f.removeClass("expandedTitle"),b.css("top",""),d.css("top",""));m=!m;v();d.height(b.height()+16);b.fadeTo(200,
1,function(){l.removeClass("titleToggleClickedState")})})}},x=function(){m||t()},w=function(){r=!0;v()};return{init:function(){f=a("#title_feature_div");b=a("#titleSection");c=a("#title");d=a("#titleOverlay");k=a("#productTitle");g=k.text();q=!1;m=!0;l=a("#expandTitleToggle");e.when("A","a-tooltip","atf").execute(function(a,b){p=function(){b.create(l,{content:a.state("titleExpanderTooltipState").content,position:"triggerTop"})};u=function(){b.remove(l)};m&&p()});a("#socialFabric").append(a('\x3chr class\x3d"a-spacing-medium a-divider-normal"\x3e'));
w();a(h).resize(w);c.click(t);l.click(t);b.hover(null,x)}}})});
/* ******** */
(function(g){var e=window.AmazonUIPageJS||window.P,h=e._namespace||e.attributeErrors,d=h?h("DetailPageFeaturesAssets",""):e;d.guardFatal?d.guardFatal(g)(d,window):d.execute(function(){g(d,window)})})(function(g,e,h){e.P&&(g.when("A","jQuery","atf").execute(function(d,b){e.registeredDPApplicablePromotionListComponent||g.register("DPApplicablePromotionListComponent",function(){return{recordImpressions:function(){},adjustPromotionMessageWidth:function(){var a=b(".apl_popover_hover").width()+b(".apl_label").width()+
10;if(a){var c=b(".apl_popover_hover").parent().parent().width();if(c&&!(c<=a)){var d=b(".apl_popover_hover .apl_message").width();d&&(a=c-a+d,c=parseInt(b(".apl_popover_hover .apl_message").css("max-width"),10),!isNaN(c)&&c!==a&&60<=a&&b(".apl_popover_hover .apl_message").css("max-width",a+"px"))}}}}});e.registeredDPApplicablePromotionListComponent=!0}),g.when("A","ready").execute(function(d){var b=d.$("#applicable_promotion_list_sec"),a=d.$("#mediaTabsGroup #mediaAccordion");a&&a.length&&b&&b.length&&
((a=d.$("#mediaTabsGroup #newOfferAccordionRow"))&&a.length||b.addClass("a-hidden"),d.on("a:accordion:media-accordion:select",function(a){"media-newOffer-accordion"===a.selectedRow.rowName?b.removeClass("a-hidden"):b.addClass("a-hidden")}))}));"use strict";e.P&&g.when("A","ready").execute(function(d){var b=d.$;e.registeredDPApplicablePromotionListClaimCodeButtonComponent||g.register("registeredDPApplicablePromotionListClaimCodeButtonComponent",function(){return{init:function(){e.registeredDPApplicablePromotionListClaimCodeButtonPageStates||
(d.state("aplDetailPageRedemption",{redeemedCoupons:[]}),d.state("aplDetailpageStateData",{visitedAsins:[]}),e.registeredDPApplicablePromotionListClaimCodeButtonPageStates=!0)},isAplVisitedAsins:function(a){var c=d.state("aplDetailpageStateData"),f=c?c.visitedAsins:null;if(f)if(-1<b.inArray(a,f)){if(a=(a=d.state("aplDetailPageRedemption"))?a.redeemedCoupons:null)for(c=0;c<a.length;c++)f=a[c],b("#RedeemB_"+f).addClass("a-hidden"),b("#RedeemM_"+f).removeClass("a-hidden"),0!==b("#hvaCoupon .apl_badgeHvaCoupon").length&&
b("#hvaCoupon .apl_badgeHvaCoupon").addClass("apl_badgeHvaCoupon_redeemed")}else f.push(a),c.visitedAsins=f,d.state("aplDetailpageStateData",c)},bindClaimPromoEvent:function(){b(".apl_redeem").click(function(){var a=d.$(this).attr("id");b("#RedeemB_"+a).addClass("a-button-disabled");b.ajax({url:"/gp/collect-coupon/handler/redeem-coupon-detailpage.html?ref_\x3dapl_redeem_coupon",type:"POST",data:{encryptedPromotionId:a},dataType:"json",success:function(c){if(1==c.status){b("#RedeemB_"+a).addClass("a-hidden");
b("#RedeemM_"+a).removeClass("a-hidden");g.when("PromotionUpellComponent").execute(function(b){b.showRedeemedNote(a)});var f=(c=d.state("aplDetailPageRedemption"))?c.redeemedCoupons:null;if(f){for(var k=!1,l=f.length;l--;)if(f[l]===a){k=!0;break}k||(f.push(a),c.redeemedCoupons=f,d.state("aplDetailPageRedemption",c))}}else e.location.reload()},error:function(){e.location.reload()}})});b(".apl_login").click(function(){var a=b(this).attr("id"),c=encodeURIComponent(e.location.pathname);e.location.href=
"/gp/collect-coupon/handler/redeem_coupon_after_login.html?path\x3d"+c+"\x26encryptedPromotionId\x3d"+a})},showRedeemedNote:function(a){if(b("#RedeemB_"+a).length){b("#RedeemB_"+a).addClass("a-hidden");b("#RedeemM_"+a).removeClass("a-hidden");var c=d.state("aplDetailPageRedemption"),f=c?c.redeemedCoupons:null;if(f){for(var e=!1,g=f.length;g--;)if(f[g]===a){e=!0;break}e||(f.push(a),c.redeemedCoupons=f,d.state("aplDetailPageRedemption",c))}}}}});e.registeredDPApplicablePromotionListClaimCodeButtonComponent=
!0})});
/* ******** */
(function(g){var n=window.AmazonUIPageJS||window.P,v=n._namespace||n.attributeErrors,b=v?v("ProductAdsDetailPageAssets",""):n;b.guardFatal?b.guardFatal(g)(b,window):b.execute(function(){g(b,window)})})(function(g,n,v){g.when("A","a-carousel-framework","a-carousel-ajax-standard").register("AmazonClicks",function(b,n,t){function q(c,a,k,f){var l=c.getAttr("pageNumber"),w;w=c.getAttr("initialSeenAsins");for(var r=c.getAttr("fetchedItems").slice(w.length),p=0;p<r.length;p++)r[p]&&r[p].oid&&w.push(r[p].oid);
r=c.getAttr("filteredItems");for(p=0;p<r.length;p++)r[p]&&w.push(r[p]);w=w.join("");k.pg=l;k.tot=c.getAttr("set_size");k.start=k.offset;k.num=k.count;k.cc=1===l?0:k.offset;k.oData=w;l=c.getAttr("ajax");c.setAttr("requestTimer",b.delay(d,l.fetch_delay,c,a,k,f))}function d(c,a,k,f){c.triggerEvent("beforeAjax",{url:a,params:k});b.get(a,{cache:!1,success:function(l){l=C(l,a);if(null===l)g.error("Invalid JSON returned to carousel from "+a+" - see http://tiny/c1mr5h0u for details.","a-carousel-ajax-standard",
"sendRequest");else{k.needSetSize&&(l&&l.length||g.error("Carousel requires a set_size and none was returned by the fallback AJAX request at: "+a,"a-carousel-ajax-standard","sendRequest"),c.setAttr("set_size",l[0].setSize?l[0].setSize:l.length));for(var f=c.getAttr("fetchedItems"),r=c.getAttr("filteredItems"),p=c.getAttr("ajax"),d=[],e,h=l.length,m=0;h--;)e=l[h],null===e&&d.push(h),e&&e.isFilteredItem&&"true"===e.isFilteredItem?(r.push(e.oid),m++):(e&&(e.content||""===e.content?e.content=b.trim(e.content):
e=b.trim(e)),f[k.offset+h]=e);z=1*m/l.length;p.remove_nulls&&p.id_list&&d.length&&(b.each(d,function(c){p.id_list.splice(k.offset+c,1)}),c.setAttr("ajax",p));k.needSetSize&&c.init();c.setAttr("fetchedItems",f);c.setAttr("filteredItems",r);c.setAttr("ajaxLock",!1);c.getAttr("pageSize")*c.getAttr("pageNumber")>=f.length&&c.strategies.ajax.wantCurrentPage(c);c.triggerEvent("ajaxSuccess",{url:a,params:k})}},error:function(){b.delay(function(){var a=b.$("#"+c.dom.$container[0].id+" li.a-carousel-card-empty");
0<a.length&&(c.setAttr("set_size",a[0].getAttribute("aria-posinset")-1),a.removeClass("a-carousel-card-empty"))},200)},params:k,headers:f})}function C(c,a){return b.isArray(c)?c:c!==v&&null!==c&&!b.objectIsEmpty(c)&&c.hasOwnProperty("data")&&b.isArray(c.data)?c.data:null}function e(c,B){Array.isArray(c)&&b.each(c,function(c){a[c]=B})}function h(c){b.each(a,function(b,k){b===c&&delete a[k]})}var A={},a={},m={},u={},y=[],z=0,x=b.extend([],t),D=function(c,b,a){return function(){c.apply(b,a)}};x.init=
function(c){var a=c.getAttr("ajax");if(a&&a.params){var k=a.params;if((a=c.getAttr("fetchedItems"))&&a.length!==k.start){var f=0;a.forEach(function(c){c&&f++});var l=[];c.dom.$carousel.children("li").each(function(c,a){if(c>=k.start)return!1;l.push(b.trim(a.innerHTML))});f!==l.length&&(k.offset=l.length,c.setAttr("fetchedItems",l))}}t.init(c)};x.getItems=function(c,a,k,f){var l=!1,e=c.getAttr("name");b.each(u,function(c,a){a!==e&&(l=l||c)});c=D(q,this,[c,a,k,f]);(a=m[e]!==v)&&l?y.push(c):(a&&(u[e]=
!0),c())};x.want=function(c,a,b){var f=Math.ceil(10*z);b=Math.max(b,c.getAttr("pageSize")*f);b=Math.min(b,30);if(!c.getAttr("ajaxLock")){if(f=c.getAttr("requestTimer"))clearTimeout(f),c.setAttr("requestTimer",null);var f=c.getAttr("ajax"),e=c.getAttr("set_size");if(f.url){var d=c.getAttr("fetchedItems"),h=f.id_list;h||(h=[]);var p=-1<a?a:0;a=a+b-1;var m=f.params||{},g=f.headers||{},u=[],q=[];0===e&&(h.length&&(e=h),m.needSetSize="true",c.setAttr("ajaxLock",!0));for(-1===b&&e&&(a=e);p<=a;)d[p]||((b=
h[p])&&u.push(b),q.push(p)),p++;c.setAttr("fetchedItems",d,{silent:!0});m.count=q.length;m.offset=q[0]||0;0<u.length&&(m[f.id_param_name]=u.join(","));(0<q.length||m.needSetSize)&&this.getItems(c,f.url,m,g)}}};n.registerStrategy("ajax","clicksCustomAjax",x);return{registerFeedbackEvents:function(c,a,e,f,l){var d=!0,h=function(){b.$("#"+a).text(f);d=!1;b.$("."+l).each(function(){b.$(this).show()})},m=function(){b.$("#"+a).text(e);d=!0;b.$("."+l).each(function(){b.$(this).hide()})};b.$("#"+a).click(function(){d?
h():m()});b.on("a:carousel:"+c+":change:pageNumber",m);m()},registerFeedbackEventsWithSponsoredLabel:function(a,e,k,f){var d=!0,h=function(){b.$("#"+k).show();d=!1;b.$("."+f).each(function(){b.$(this).show()})},m=function(){b.$("#"+k).hide();d=!0;b.$("."+f).each(function(){b.$(this).hide()})};b.$("#"+e).click(function(){d?h():m()});b.on("a:carousel:"+a+":change:pageNumber",m);m()},truncateTitles:function(a){b.$("."+a).each(function(){var e=b.$(this);if("hidden"===e.css("overflow")){var d=e.html(),
f=b.$(this.cloneNode(!0)).hide().css("position","absolute").css("overflow","visible").width(e.width()).height("auto");e.after(f);for(f.html(d);0<d.length&&f.height()>e.height();)d=d.substr(0,d.length-1),f.html(d+"\x26#133;");e.html(f.html()).height("auto").removeClass(a);f.remove()}})},preventSpinners:function(a,e){A[a]===v&&(b.on("a:carousel:"+a+":ajaxSuccess",function(a){b.delay(function(){var c=b.$("#"+e+" li.a-carousel-card-empty");0<c.length&&(a.carousel.setAttr("set_size",c[0].getAttribute("aria-posinset")-
1),c.removeClass("a-carousel-card-empty"))},200)}),A[a]="defined")},registerCarouselToSaveAsins:function(a,d,k){h(a);e(k,a);u[a]=!1;m[a]===v&&(b.on("a:carousel:"+a+":ajaxSuccess",function(d){var h=d.carousel.getAttr("fetchedItems").slice(-1*d.params.count),m=[];b.each(h,function(a){m.push(a.oid)});e(m,a);u[d.carousel.getAttr("name")]=!1;0<y.length&&y.shift()()}),m[a]=d)}}});(function(b,n,t){function q(){return b.P&&b.P.AUI_BUILD_DATE}q()?(g.when("jQuery").register("sponsored-products-truncator-jQuery",
function(b){return b}),g.when("ready").register("sponsored-products-truncator-ready",function(){})):b.amznJQ&&(b.amznJQ.available("jQuery",function(){g.register("sponsored-products-truncator-jQuery",function(){return b.amznJQ.jQuery})}),b.amznJQ.onReady("jQuery",function(){g.register("sponsored-products-truncator-ready",function(){})}),b.amznJQ.available("amazonShoveler",function(){g.register("sponsored-products-truncator-amznJQ-shoveler",function(){})}));g.register("sponsored-products-truncator-util",
function(){function d(b,d){g({logLevel:b,attribution:"ProductAdsDetailPageAssets",message:"[sponsored-products-truncator] "+d})}var g=b.ueLogError;"function"!==typeof g&&(g=function(b,d){if(d&&d.message)throw Error(d.message);if(b&&b.message)throw Error(b.message);});return{constants:{FEATURE_NAME:"SponsoredProductsTitleTruncation"},count:b.ue&&b.ue.count||function(){},isAUI:q,log:{warn:function(b){d("WARN",b)},error:function(b){d("ERROR",b)}}}})})(n,document);(function(b,n,t){g.when("A","sponsored-products-truncator-jQuery",
"sponsored-products-truncator-util").register("sponsored-products-truncator-line-truncator",function(b,d,g){function e(a){this.$element=a;this.$experimentElement=d("\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||g.log.error("Truncation element missing necessary line number data")}var h,n;h=/(?=[ \-\/])|(?=[\u3105-\u312F])|(?=[\u31A0-\u31BA])|(?=[\u4E00-\u9FD5])|(?=[\u3400-\u4DB5])|(?=[\uF900-\uFAFF])|(?=[\u3040-\u309F])|(?=[\u30A0-\u30FF])|(?=[\u3190-\u319F])/;
n=/[^\/\-\[\]():\s]/;e.prototype.truncate=function(){var a=this.text,b,a=d.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})):g.log.error("Unable to successfully truncate line "+a);this.$experimentElement.remove()};e.prototype.getLineHeight=function(){var a=this.$element.html(),b;this.$element.html("\x26hellip;");b=this.$element.innerHeight();
this.$element.html(a);return b};e.prototype.checkLineFit=function(a){this.$experimentElement.html(a);a=this.$experimentElement.get(0).clientHeight/this.lineHeight;return Math.round(a)<=this.maxRows};e.prototype.truncateByToken=function(a){a=a.split(this.getTokenSeparatorRegex());var b=a.length,d=0,e,h,g;for(g=1;g!==b;)if(e=Math.floor((b+g)/2),h=a.slice(0,e).join("")+"\x26hellip;",this.checkLineFit(h)){if(1>=b-e){for(d=e;0<d&&!n.test(a[d-1]);)d--;break}g=e}else b=e;if(0!==d)return a.slice(0,d).join("")+
"\x26hellip;"};e.prototype.getTokenSeparatorRegex=function(){return this.$element.attr("data-truncate-by-character")?"":h};return{truncateLines:function(a){a.find(".sponsored-products-truncator-truncate:visible, .sponsored-products-truncator-truncate-medium:visible").each(function(){(new e(d(this))).truncate();d(this).addClass("sponsored-products-truncator-truncated").removeClass("sponsored-products-truncator-truncate sponsored-products-truncator-truncate-medium");d(this).removeClass(function(a,b){return(b.match(/sponsored-products-truncator-line-clamp-\d/g)||
[]).join(" ")})});b.trigger("sponsored-products-truncator:linestruncated")}}});g.when("jQuery","A","sponsored-products-truncator-line-truncator","a-carousel-framework").register("sp-dp-carousel-truncation",function(b,d,g,e){function h(a){"string"===typeof a?(g.truncateLines(d.$("#"+a)),e.getCarouselByName(a+"_carousel")&&d.trigger("spTruncationComplete",e.getCarouselByName(a+"_carousel"))):(g.truncateLines(a.carousel.dom.$container),d.trigger("spTruncationComplete",a.carousel))}var n="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(" ");
d.on("spCarouselNoTruncationRegistration",function(){var a=d.state("spTruncatorStatus");if(!a||!a.truncationInitialized){for(a=n.length-1;0<=a;a--)h(n[a]),d.on("a:carousel:"+n[a]+"_carousel:change:animating",h),d.on("a:carousel:"+n[a]+"_carousel:change:loading",h),d.on("a:carousel:"+n[a]+"_carousel:change:pageSize",h);d.state("spTruncatorStatus",{truncationInitialized:!0})}});d.on("spMobileCarouselAjaxComplete",h);return{setUpTruncation:function(a){h(a);d.on("a:carousel:"+a+"_carousel:change:animating",
h);d.on("a:carousel:"+a+"_carousel:change:loading",h);d.on("a:carousel:"+a+"_carousel:change:pageSize",h)}}})})(n,document);g.execute("ClickLoggingUrlParamRemover",function(){if(history&&history.replaceState){var b=n.location.href,b=b.split("?");if(2<=b.length){for(var g=encodeURIComponent("spc")+"\x3d",t=b[1].split(/[&;]/g),q=t.length;0<q--;)-1!==t[q].lastIndexOf(g,0)&&t.splice(q,1);b=b[0]+(0<t.length?"?"+t.join("\x26"):"");n.history.replaceState({},document.title,b)}}})});
/* ******** */
(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(b){var e=window.AmazonUIPageJS||window.P,g=e._namespace||e.attributeErrors,d=g?g("SponsoredProductsAddToCartAssets",""):e;d.guardFatal?d.guardFatal(b)(d,window):d.execute(function(){b(d,window)})})(function(b,e,g){b.when("A").register("sp-atc-config",function(){return{getClientID:function(){return"sspa-dp-desktop"}}});"use strict";b.when("sp-atc-config","fresh-add-to-cart","A").execute(function(d,b,k){var h={},f=function(a,c){var b=k.capabilities.mobile?"mobile":"desktop";a="spF3Atc."+b+
"."+a+"."+c;e.ue&&e.ue.count(a,(ue.count(a)||0)+1)},l=function(a){var c=a&&a.additionalParams?a.additionalParams.loggingUrl:g;c&&!h[c]?k.post(c,{success:function(a){h[c]=!0;f("logClick","success")},error:function(a,c,b){f("logClick","failure")}}):h[c]?f("logClick","duplicate"):c||f("logClick","missingData")};b.addToFreshCart({clientID:d.getClientID(),success:function(a,c){l(a.data);f("addToCart","success")},error:function(a,c,b,d){f("addToCart","failure")}})})});
/* ******** */
(function(m){var l=window.AmazonUIPageJS||window.P,t=l._namespace||l.attributeErrors,d=t?t("DetailPageSnSAssets@dpxAssets","DetailPageSnSAssets"):l;d.guardFatal?d.guardFatal(m)(d,window):d.execute(function(){m(d,window)})})(function(m,l,t){m.when("sns-join-prime-endpoint","sns-subscribe-constants").register("sns-buybox-constants",function(d,b){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_SELECTED_FREQUENCY:"#rcxOrdFreqSns",ONML_SELECTED_FREQUENCY:"#rcxOrdFreqOnml",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_DELIVERY_OPTION_CHANGE_CHECKBOX_ID:"#delivery-option-change-checkbox",ONML_SELECTED_DELIVERY_OPTION_STATE:"onml-selected-delivery-option-state",RCX_ORD_FREQ_ONML_WRAPPER:"#rcxOrdFreqOnmlWrapper",RCX_ORD_FREQ_SNS_WRAPPER:"#rcxOrdFreqSnsWrapper",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_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",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_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:b.SUBSCRIBE_FORM_ATTRIBUTES,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:d.endpoint},SUBSCRIBE_FORM_ATTRIBUTES:b.SUBSCRIBE_ADD_TO_CART_FORM_ATTRIBUTES,SNS_ATC_DECLARATIVE:"#addToCart_feature_div #atc-declarative",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",SNS_DELIVERY_OPTION_SNS_LINK_TEXT_IDENTIFIER:"#snsDeliveryChangeLinkText",ACCORDION_HEADER_DELIVERY_OPTION_SNS_LINK:"#accordion-header-sns-delivery-link",SNS_DELIVERY_OPTION_ONML_LINK:"#onml-delivery-link",SNS_DELIVERY_OPTION_ONML_LINK_TEXT_IDENTIFIER:"#onmlDeliveryChangeLinkText",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",DISCOUNT_TYPE_ZERO_STATIC:"ZERO_STATIC",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",SNS_ONML_MONTH:"M|onml",SUBSCRIBE_FORM_FIELDS:b.FORM_FIELDS,SNS_ONML_SELECTED_FREQUENCY_TEXT:'select[name\x3d"rcxOrdFreqOnml"] option:selected',SNS_ONML_NEXT_RECURRING_DELIVERY_DATE_TEXT:".sns-onmlv2-frdd:first",SNS_BASE_DISCOUNT_MESSAGE:".sns-base-discount-message",SNS_TIERED_DISCOUNT_MESSAGE:".sns-tiered-discount-message",SNS_SUBSCRIBER_DISCOUNT_MESSAGE_STATE_ID:"sns-subscriber-discount-message-data",SUBSCRIBER_DISCOUNT_MESSAGE_EXPERIMENT_ID:"CONSUMABLES_DP_SNS_APEX_SUBSCRIBER_DISCOUNT_MESSAGE_921625",
REPLENISHMENT_SNS_FREQUENCY_POPOVER_ID:"#replenishment-sns-frequency-popover",REPLENISHMENT_ONML_FREQUENCY_POPOVER_ID:"#replenishment-onml-frequency-popover",REPLENISHMENT_ONML_FREQUENCY_INFO_POPOVER_ID:"#replenishment-onml-frequency-info-popover",REPLENISHMENT_SNS_FREQUENCY_INFO_POPOVER_ID:"#replenishment-sns-frequency-info-popover"}});m.when("A","sns-utils","sns-constants","sns-buybox-constants","sns-messaging-utils","sns-atc-utils").register("sns-frequency-bottom-sheet",function(d,b,a,c,g,e){return{init:function(){function f(){var a=
k(c.SNS_FREQUENCY_FORM_FIELD).val();k(c.SNS_FREQ_BOTTOMSHEET_SELECTOR).find("button[value\x3d"+a+"]").click()}var k=d.$;b.isMobileDevice()&&(b.registerCallbackForNameSpace(a.EVENT_NAMESPACE.FREQUENCY_HIDDEN_INPUT_CHANGE,f),b.registerCallbackForNameSpace(a.EVENT_NAMESPACE.PAGE_UPDATE,f),d.declarative("sns-frequency-selected","click",function(f){var h=k(c.SNS_FREQUENCY_FORM_FIELD);f=f.$target;var n=f.val(),p={};p[c.SNS_FREQUENCY_NAME]=n;e.setOnmlDeclaratives(p);h.val(n);l.setTimeout(function(){d.trigger(c.SNS_DATA_UPDATE_EVENT)},
0);k(c.SNS_FIRST_RECURRING_DELIVERY_DATE).html(f.data("frdd-label"));k(c.SNS_SELECTED_FREQUENCY_LABEL).html(f.data("freq-button-label"));g.updateMessages(n);b.setOnmlUserPref(a.USER_PREFS_KEYS.SNS_FREQUENCY,n)}))}}});m.when("A","sns-constants","sns-utils","sns-buybox-constants","sns-messaging-utils","sns-atc-utils").register("sns-frequency-popover",function(d,b,a,c,g,e){return{init:function(){function f(){var a=k(c.SNS_FREQUENCY_FORM_FIELD).val();k("[data-a-accordion-row-name\x3dfrequencyAccordionRow"+
(a-1)+"] a").click()}var k=d.$;a.isMobileDevice()||(a.registerCallbackForNameSpace(b.EVENT_NAMESPACE.FREQUENCY_HIDDEN_INPUT_CHANGE,f),d.on("a:accordion:sns-dp-frequency-accordion:select",function(f){var h=k(c.SNS_FREQUENCY_FORM_FIELD),n=k(c.SNS_DP_FREQUENCY_TRIGGER),p=k(f.selectedRow.$row[0]);f=p.data().frequencyLabel;var p=p.data().frequencyValue,r={};r[c.SNS_FREQUENCY_NAME]=p;e.setOnmlDeclaratives(r);h.val(p);l.setTimeout(function(){d.trigger(c.SNS_DATA_UPDATE_EVENT)},0);n.text(f);g.updateMessages(p);
a.setOnmlUserPref(b.USER_PREFS_KEYS.SNS_FREQUENCY,p)}))}}});m.when("A","sns-utils","sns-constants","sns-buybox-utils","sns-buybox-constants","sns-atc-utils").register("sns-opt-in-checkbox",function(d,b,a,c,g,e){return{init:function(){function f(f){var h=d.$(g.SNS_OPT_IN_CHECKBOX).is(":checked");f=d.$(g.SNS_OPT_IN_FORM_FIELD);h&&(b.isMobileApp()||b.isTabletApp())&&e.getAddToCartStrings();var k={};k[g.SNS_OPT_IN_NAME]=h;e.setOnmlDeclaratives(k);f.val(h);l.setTimeout(function(){d.trigger(g.SNS_DATA_UPDATE_EVENT)},
0);l.setTimeout(function(){c.updateAddToCartButtonLabel(h);c.updateOneClickButtonLabel(h);c.updateBuyNowButtonLabel(h)},0);c.showSnSMerchantInfoIfSnSOptInChecked(h);c.showGoldBoxDiscountMessageIfSnSOptInChecked(h);c.showSubscribeOnlyButtonIfSnSOptInChecked(h);b.setOnmlUserPref(a.USER_PREFS_KEYS.SNS_OPT_IN,h)}function k(){var a=function(){var a=d.$("#buybox").find(".a-declarative").has("#add-to-cart-button");if(1===a.length)return a;a=d.$("#atc-declarative");return 1===a.length?a:null}();a&&a.click(function(){var c=
e.getAddToCartData();if(c.inputs[g.SNS_OPT_IN_NAME]!==t){var f=b.getAStateFromDom(g.SNS_OPT_IN_FEATURE_DIV,"sns-add-to-cart-params","addToCartParams"),k=d.$(g.SNS_OPT_IN_CHECKBOX).is(":checked"),r={},r=f||{};r[g.SNS_OPT_IN_NAME]=k;var y=a.data("awMash");Object.keys(r).forEach(function(a){y.inputs[a]!==c.inputs[a]&&(y.inputs[a]=c.inputs[a])})}})}b.isSnSEligible()&&f({snsOnLoad:!0});d.declarative("sns-opt-in-checked","change",f);b.registerCallbackForNameSpace(a.EVENT_NAMESPACE.PAGE_UPDATE,f);b.registerCallbackForNameSpace(a.EVENT_NAMESPACE.PAGE_UPDATE,
b.enableSnSOptIn);b.isMobileApp()&&(b.registerCallbackForNameSpace(a.EVENT_NAMESPACE.PAGE_UPDATE,k),k());b.enableSnSOptIn()}}});m.when("A","sns-constants","sns-buybox-constants","sns-utils").register("sns-messaging-utils",function(d,b,a,c){var g=function(b,c){var g=b.firstRecurringDeliveryDates[c-1];d.$(a.SNS_ONML_FRDD).each(function(){d.$(this).html(g)})};return{updateMessages:function(e){var f=c.getAStateFromDom(a.SNS_OPT_IN_FEATURE_DIV,"sns-buybox-message-params","buyboxMessageParamsMap");if(f){var k=
d.$(a.SNS_ONML_BUYBOX_UPSELL_MESSAGE_NON_TIERED),q=d.$(a.SNS_ONML_BUYBOX_UPSELL_MESSAGE_TIERED);f.tieredStatusOnRecurringDeliveryDates[e-1]===b.TIERED?(k.addClass("aok-hidden"),q.removeClass("aok-hidden")):(k.removeClass("aok-hidden"),q.addClass("aok-hidden"));k=f.discountType;q=d.$(a.SNS_DISCOUNT_PILL);f.tieredStatusOnRecurringDeliveryDates[e-1]===b.TIERED?(q.attr("data-tiered-level",b.PREMIUM),k===b.ZERO_BASE&&q.removeClass("aok-hidden")):(q.attr("data-tiered-level",b.BASE),k===b.ZERO_BASE&&q.addClass("aok-hidden"));
g(f,e)}}}});m.when("A","sns-buybox-constants","sns-onmlv2-utils","sns-moq-helper").register("sns-buy-now",function(d,b,a,c){var g=d.$;d.declarative("sns-buy-now","click",function(e){if(!c.isSnsLocked()&&!c.isSnsLocked()){e=g("\x3cform\x3e",{method:b.BUY_NOW_FORM_ATTRIBUTES.method,action:"/gp/subscribe-and-save/buynow/buy-now.html?ref\x3ddp_sns_bb_bn",id:b.BUY_NOW_FORM_ATTRIBUTES.id,name:b.BUY_NOW_FORM_ATTRIBUTES.name});var f="";if(a.isCbbTemplateEnabled())for(var k=[{name:"ASIN"},{name:"offerListingID",
fieldName:"snsOfferListingID"},{name:"snsAddressId"},{name:"snsOnmlOfferId"},{name:"snsMostCommonFrequency"},{name:"rcxOrdFreq"},{name:"quantity"}],d=0;d<k.length;d++)var h=k[d].name,n=k[d].fieldName?k[d].fieldName:h,n=a.getOnmlv2FormValueByName(n),f=f+a.createHiddenInput(h,n);else{a.removeFormFieldsIntroducedByCbb();k=[{name:"ASIN"},{name:"offerListingID",fieldName:"snsOfferListingID"},{name:"rcxOrdFreq"},{name:"snsOnmlOfferId"},{name:"snsMostCommonFrequency"},{name:"snsAddressId"}];for(d=0;d<k.length;d++)h=
k[d].name,n=k[d].fieldName?k[d].fieldName:h,n=a.isMobileDevice()?g(b.MOBILE_ADD_TO_CART_DIV+" [name\x3d"+n+"]").val():a.isWeb()?g(b.ADD_TO_CART_DIV+" [name\x3d"+n+"]").val():g(b.TABLET_ADD_TO_CART_DIV+" [name\x3d"+n+"]").val(),f+=a.createHiddenInput(h,n);k=a.isMobileDevice()?g(b.SNS_MOBILE_QUANTITY):g(b.QUANTITY_CONTAINER).find(b.SNS_QUANTITY);f+=a.createHiddenInput("quantity",k.val())}f+=a.createHiddenInput("submit.buy-now","1");e.html(f);g("body").append(e);g(b.BUY_NOW_FORM).submit();g(b.BUY_NOW_FORM).remove()}})});
m.when("sns-join-prime-endpoint").register("sns-subscribe-constants",function(d){return{SUBSCRIBE_ADD_TO_CART_FORM_ATTRIBUTES:{name:"sns-onmlv2-add-to-cart",id:"sns-onmlv2-add-to-cart",method:"GET",action:"/auto-deliveries/checkout/subscribe"},SUBSCRIBE_FORM_ATTRIBUTES:{name:"sns-onmlv2-subscribe",id:"sns-onmlv2-subscribe",method:"GET",action:"/auto-deliveries/checkout/subscribe"},FORM_FIELDS:[{name:"snsAsin"},{name:"rcxOrdFreqOnml"},{name:"rcxOrdFreqSns"},{name:"offerListingID",fieldName:"snsOfferListingId"},
{name:"isTangoCheckoutEligible"}]}});m.when("A","sns-buybox-constants","sns-onmlv2-utils","sns-moq-helper").register("sns-subscribe-only",function(d,b,a,c){var g=d.$;d.declarative("sns-subscribe-only","click",function(e){if(!c.isSnsLocked()){e=g("\x3cform\x3e",{method:b.JUST_SUBSCRIBE_FORM_ATTRIBUTES.method,action:b.JUST_SUBSCRIBE_FORM_ATTRIBUTES.action,id:b.JUST_SUBSCRIBE_FORM_ATTRIBUTES.id,name:b.JUST_SUBSCRIBE_FORM_ATTRIBUTES.name});var f="";if(a.isCbbTemplateEnabled())for(var k=[{name:"ASIN"},
{name:"snsMerchantID"},{name:"offerListingID",fieldName:"snsOfferListingID"},{name:"longShipAddressId",fieldName:"snsAddressId"},{name:"rcxOrdFreq"},{name:"quantity"}],d=0;d<k.length;d++)var h=k[d].name,n=k[d].fieldName?k[d].fieldName:h,n=a.getOnmlv2FormValueByName(n),f=f+a.createHiddenInput(h,n);else{a.removeFormFieldsIntroducedByCbb();k=[{name:"ASIN"},{name:"offerListingID",fieldName:"snsOfferListingID"},{name:"rcxOrdFreq"},{name:"snsMerchantID"},{name:"longShipAddressId",fieldName:"snsAddressId"}];
for(d=0;d<k.length;d++)h=k[d].name,n=k[d].fieldName?k[d].fieldName:h,n=a.isMobileDevice()?g(b.MOBILE_ADD_TO_CART_DIV+" [name\x3d"+n+"]").val():a.isWeb()?g(b.ADD_TO_CART_DIV+" [name\x3d"+n+"]").val():g(b.TABLET_ADD_TO_CART_DIV+" [name\x3d"+n+"]").val(),f+=a.createHiddenInput(h,n);k=a.isMobileDevice()?g(b.SNS_MOBILE_QUANTITY):g(b.QUANTITY_CONTAINER).find(b.SNS_QUANTITY);f+=a.createHiddenInput("quantity",k.val())}f+=a.createHiddenInput("ref","sns-subscribe-only");f+=a.createHiddenInput("submit.subscribe-only",
"1");e.html(f);g("body").append(e);g(b.JUST_SUBSCRIBE_FORM).submit();g(b.JUST_SUBSCRIBE_FORM).remove()}})});m.when("A","a-dropdown","a-modal","sns-vmf-utils","sns-onmlv2-utils","sns-buybox-constants","sns-constants").register("sns-select-delivery",function(d,b,a,c,g,e,f){function k(){h("#sns-only-delivery-option-text").length&&(h("#sns-only-delivery-option-text").html(h("#sns-only-delivery-option-text").html().replace(/%_date_%/g,"\x3cspan class \x3d'sns-only-date'\x3e\x3c/span\x3e")),h("#sns-only-delivery-option-text").html(h("#sns-only-delivery-option-text").html().replace(/%_discount_%/g,
"\x3cspan class \x3d'sns-only-discount'\x3e\x3c/span\x3e")),h("#onml-later-delivery-option-text").html(h("#onml-later-delivery-option-text").html().replace(/%_date-more-later_%/g,"\x3cspan class \x3d'sns-ml-date'\x3e\x3c/span\x3e")),h("#onml-later-delivery-option-text").html(h("#onml-later-delivery-option-text").html().replace(/%_discount-more-later_%/g,"\x3cspan class \x3d'sns-ml-discount'\x3e\x3c/span\x3e")),h("#onml-now-delivery-option-text").html(h("#onml-now-delivery-option-text").html().replace(/%_date-one-now_%/g,
"\x3cspan class \x3d'sns-one-now-date'\x3e\x3c/span\x3e")),h("#onml-now-delivery-option-text").html(h("#onml-now-delivery-option-text").html().replace(/%_discount-one-now_%/g,"\x3cspan class \x3d'sns-one-now-discount'\x3e\x3c/span\x3e")));var a=g.getDeliveryInfoParam(),b=g.getDiscountOptionsParam(),d=g.getDiscountTypeParam(),k=g.getSnsFrequencyParam(),q=g.getOnmlFrequencyParam(),n=g.getOnmlDateParam(),r=c.getFrequencyIndex(f.DELIVERY_OPTION.SNS),p=c.getFrequencyIndex(f.DELIVERY_OPTION.ONML);if("true"===
h("#firstDeliveryOptionMessagesV2").val())h("#sns-only-delivery-option-text").html(k[r].firstDeliveryOptions[0].text),h("#onml-later-delivery-option-text").html(q[p].firstDeliveryOptions[0].text);else{var q=a.snsDates[r],a=a.onmlDates[p],r=k[r].highlightedDiscount,l=b[r],k=k[p].highlightedDiscount,p=b[k];d===e.DISCOUNT_TYPE_ZERO_BASE&&0===k?(h(".onmlNextDeliveryDate").addClass("aok-hidden"),h(".onmlNextDeliveryDateNoDiscount").removeClass("aok-hidden")):d===e.DISCOUNT_TYPE_ZERO_STATIC?(h(".onmlNextDeliveryDate").addClass("aok-hidden"),
h(".onmlNextDeliveryDateNoDiscount").removeClass("aok-hidden")):(h(".onmlNextDeliveryDate").removeClass("aok-hidden"),h(".onmlNextDeliveryDateNoDiscount").addClass("aok-hidden"));d===e.DISCOUNT_TYPE_ZERO_BASE&&0===r?(h(".snsDeliveryDate").addClass("aok-hidden"),h(".snsDeliveryDateNoDiscount").removeClass("aok-hidden")):d===e.DISCOUNT_TYPE_ZERO_STATIC?(h(".snsDeliveryDate").addClass("aok-hidden"),h(".snsDeliveryDateNoDiscount").removeClass("aok-hidden")):(h(".snsDeliveryDate").removeClass("aok-hidden"),
h(".snsDeliveryDateNoDiscount").addClass("aok-hidden"));h(".sns-only-date").html(q);h(".sns-only-discount").html(l);h(".sns-ml-date").html(a);h(".sns-ml-discount").html(p)}b=b[0];h(".sns-one-now-date").html(n);h(".sns-one-now-discount").html(b)}function q(){var a,b,d;h(e.SNS_DELIVERY_OPTION_DIV).is(":checked")?(a=c.getFrequencyIndex(f.DELIVERY_OPTION.SNS),b=g.getSnsFrequencyParam(),h("#rcxOrdFreqSnsWrapper").removeClass("aok-hidden"),h("#rcxOrdFreqOnmlWrapper").addClass("aok-hidden"),h(e.REPLENISHMENT_SNS_FREQUENCY_POPOVER_ID).removeClass("aok-hidden"),
h(e.REPLENISHMENT_ONML_FREQUENCY_POPOVER_ID).addClass("aok-hidden"),h(e.REPLENISHMENT_SNS_FREQUENCY_INFO_POPOVER_ID).removeClass("aok-hidden"),h(e.REPLENISHMENT_ONML_FREQUENCY_INFO_POPOVER_ID).addClass("aok-hidden"),d=f.DELIVERY_OPTION.SNS):(a=c.getFrequencyIndex(f.DELIVERY_OPTION.ONML),b=g.getOnmlFrequencyParam(),h("#rcxOrdFreqOnmlWrapper").removeClass("aok-hidden"),h("#rcxOrdFreqSnsWrapper").addClass("aok-hidden"),h(e.REPLENISHMENT_ONML_FREQUENCY_POPOVER_ID).removeClass("aok-hidden"),h(e.REPLENISHMENT_SNS_FREQUENCY_POPOVER_ID).addClass("aok-hidden"),
h(e.REPLENISHMENT_ONML_FREQUENCY_INFO_POPOVER_ID).removeClass("aok-hidden"),h(e.REPLENISHMENT_SNS_FREQUENCY_INFO_POPOVER_ID).addClass("aok-hidden"),d=f.DELIVERY_OPTION.ONML);c.selectFrequency(b[a],d)}var h=d.$,n,p,r;m.when("a-sheet").execute("sns-mobile-sheet",function(a){p=a});d.declarative("sns-delivery-date-bottom-sheet","click",function(a){c.setFrequencyIndexForDeliveryOption();k();n||(a={name:"sns_delivery_bottom_sheet",preloadDomId:"snsDeliveryDateBottomSheet",height:270,closeType:"message",
closeMessage:h("#bottomSheetClose").val(),sheetType:"web"},n=p.create(a));p.showSheet(n)});d.declarative("sns-delivery-date","click",function(b){c.setFrequencyIndexForDeliveryOption();k();b=h(e.SNS_SUBMIT_SECTION_ID);var f={dataStrategy:"preload",header:h("#deliveryModalTitle").val(),name:"sns-delivery-modal"};r||(r=a.create(b,f));r.show()});d.declarative("sns-delivery-cancel-btn","click",function(a){r.hide()});d.declarative("sns-delivery-change-btn","click",function(a){q();r.hide()});d.on("a:sheet:beforeHide:sns_delivery_bottom_sheet",
function(){q()});d.on("a:sheet:beforeShow:sns_delivery_bottom_sheet",function(){var a=n.getContentContainer().find(e.SNS_DELIVERY_BOTTOM_SHEET),b=h("#a-popover-sns-delivery-modal").find(e.SNS_DELIVERY_BOTTOM_SHEET);b.html()!==t&&null!==b.html()&&a.replaceWith(b)})});m.when("A","a-checkbox","sns-vmf-utils","sns-onmlv2-utils","sns-buybox-constants","sns-constants","sns-onmlv2-cache").execute("sns-select-delivery-checkbox",function(d,b,a,c,g,e,f){var k=d.$;c.isDeliveryChangeCheckboxVisible()&&b(g.SNS_DELIVERY_OPTION_CHANGE_CHECKBOX_ID).enable();
d.declarative("delivery-option-change-checkbox","change",function(b){var h,d;b=e.DELIVERY_OPTION.ONML===c.getSelectedDeliveryOption();a.setFrequencyIndexForDeliveryOption();b?(b=a.getFrequencyIndex(e.DELIVERY_OPTION.ONML),h=c.getOnmlFrequencyParam(),k(g.RCX_ORD_FREQ_ONML_WRAPPER).removeClass("aok-hidden"),k(g.RCX_ORD_FREQ_SNS_WRAPPER).addClass("aok-hidden"),d=e.DELIVERY_OPTION.ONML,f.incrementDeliveryOptionSwitchToOnmlCounter()):(b=a.getFrequencyIndex(e.DELIVERY_OPTION.SNS),h=c.getSnsFrequencyParam(),
k(g.RCX_ORD_FREQ_SNS_WRAPPER).removeClass("aok-hidden"),k(g.RCX_ORD_FREQ_ONML_WRAPPER).addClass("aok-hidden"),d=e.DELIVERY_OPTION.SNS,f.incrementDeliveryOptionSwitchToSnsCounter());c.updatePrimeShippingMessage();a.selectFrequency(h[b],d)});d.on("PageRefresh:Success",function(){c.isDeliveryChangeCheckboxVisible()&&b(g.SNS_DELIVERY_OPTION_CHANGE_CHECKBOX_ID).enable()})});m.when("A","sns-buybox-constants","sns-priceblock-constants").register("sns-onmlv2-priceblock-utils",function(d,b,a){var c=d.$;return{updateDesktopPriceBlock:function(d){if(d){var e=
d.zeroBaseDiscount,f=0<c(b.SNS_TOGGLE_BUY_BOX).length,k=0<c(a.DP_STRIKE_PRICE).length;c(b.SNS_DELIVERY_OPTION_DIV).is(":checked")?(c(a.ONE_NOW_SHIPPING_MESSAGE).addClass("aok-hidden"),d.justSubscribeTieredStatus?(c(a.SNS_TIERED_PRICE).removeClass("aok-hidden"),c(a.SNS_BASED_PRICE).addClass("aok-hidden"),c(a.SNS_TIERED_SAVINGS).removeClass("aok-hidden"),c(a.SNS_BASED_SAVINGS).addClass("aok-hidden"),c(a.SNS_SAVINGS_LABEL).removeClass("aok-hidden"),c(a.SNS_SAVINGS_ROW).removeClass("aok-hidden")):e?(c(a.SNS_TIERED_PRICE).addClass("aok-hidden"),
c(a.SNS_BASED_PRICE).removeClass("aok-hidden"),c(a.SNS_SAVINGS_ROW).addClass("aok-hidden")):(c(a.SNS_TIERED_PRICE).addClass("aok-hidden"),c(a.SNS_BASED_PRICE).removeClass("aok-hidden"),c(a.SNS_TIERED_SAVINGS).addClass("aok-hidden"),c(a.SNS_BASED_SAVINGS).removeClass("aok-hidden"),c(a.SNS_SAVINGS_LABEL).removeClass("aok-hidden"),c(a.SNS_SAVINGS_ROW).removeClass("aok-hidden"))):c(b.ONML_DELIVERY_OPTION_DIV).is(":checked")&&(c(a.ONE_NOW_SHIPPING_MESSAGE).removeClass("aok-hidden"),e?(c(a.SNS_TIERED_PRICE).addClass("aok-hidden"),
c(a.SNS_BASED_PRICE).removeClass("aok-hidden"),c(a.SNS_SAVINGS_ROW).addClass("aok-hidden"),k&&(c(b.SNS_TIERED_PRICE).hasClass("aok-hidden")?(c(a.SNS_SAVINGS_ROW).removeClass("aok-hidden"),c(a.SNS_SAVINGS_LABEL).removeClass("aok-hidden"),c(a.SNS_BASED_SAVINGS).removeClass("aok-hidden"),c(a.SNS_TIERED_SAVINGS).addClass("aok-hidden")):c(b.SNS_BASE_PRICE).hasClass("aok-hidden")&&(c(a.SNS_SAVINGS_ROW).removeClass("aok-hidden"),c(a.SNS_SAVINGS_LABEL).removeClass("aok-hidden"),c(a.SNS_TIERED_SAVINGS).removeClass("aok-hidden"),
c(a.SNS_BASED_SAVINGS).addClass("aok-hidden")))):(c(a.SNS_TIERED_PRICE).addClass("aok-hidden"),c(a.SNS_BASED_PRICE).removeClass("aok-hidden"),c(a.SNS_TIERED_SAVINGS).addClass("aok-hidden"),c(a.SNS_BASED_SAVINGS).removeClass("aok-hidden"),c(a.SNS_SAVINGS_LABEL).removeClass("aok-hidden"),c(a.SNS_SAVINGS_ROW).removeClass("aok-hidden")));f&&c(a.SNS_SAVINGS_ROW).addClass("aok-hidden")}},updateBuyboxPriceBlock:function(d){d&&(c(b.SNS_DELIVERY_OPTION_DIV).is(":checked")?(d.oneNowDiscountEligible||c(a.SNS_STRIKETHROUGH_PRICE).removeClass("aok-hidden"),
d.justSubscribeTieredStatus?(c(b.SNS_BASE_PRICE).addClass("aok-hidden"),c(b.SNS_TIERED_PRICE).removeClass("aok-hidden")):(c(b.SNS_BASE_PRICE).removeClass("aok-hidden"),c(b.SNS_TIERED_PRICE).addClass("aok-hidden"))):c(b.ONML_DELIVERY_OPTION_DIV).is(":checked")&&(c(b.SNS_BASE_PRICE).removeClass("aok-hidden"),c(b.SNS_TIERED_PRICE).addClass("aok-hidden"),d.oneNowDiscountEligible||(c(a.SNS_STRIKETHROUGH_PRICE).addClass("aok-hidden"),c(a.SNS_BASED_SAVINGS).addClass("aok-hidden"))))}}});m.when("A","sns-buybox-constants",
"sns-constants","sns-onmlv2-utils").register("sns-onmlv2-message-utils",function(d,b,a,c){function g(){f("#sns-delivery-buybox-upsell-message").find([b.SNS_DELIVERY_NEW_OR_UNRECOGNIZED_UPSELL,b.SNS_DELIVERY_NON_TIERED_UPSELL,b.SNS_DELIVERY_TIERED_UPSELL].join()).addClass("aok-hidden");f("#onml-delivery-buybox-upsell-message").find([b.ONML_DELIVERY_NEW_OR_UNRECOGNIZED_UPSELL,b.ONML_DELIVERY_NON_TIERED_UPSELL,b.ONML_DELIVERY_TIERED_UPSELL].join()).addClass("aok-hidden")}function e(){f("#sns-delivery-pill").find([b.SNS_DELIVERY_NEW_OR_UNRECOGNIZED_PILL,
b.SNS_DELIVERY_NON_TIERED_PILL,b.SNS_DELIVERY_TIERED_PILL].join()).addClass("aok-hidden");f("#onml-delivery-pill").find([b.ONML_DELIVERY_NEW_OR_UNRECOGNIZED_PILL,b.ONML_DELIVERY_NON_TIERED_PILL,b.ONML_DELIVERY_TIERED_PILL].join()).addClass("aok-hidden")}var f=d.$;return{updateFirstRecurringDeliveryDate:function(a,e){if(a&&e){var c=a.firstRecurringDeliveryDates[e-1];f(b.SNS_ONMLV2_FRDD).each(function(){f(this).html(c)})}},updateUpsellMessages:function(e,c,h){if(e&&c&&h){var d=c.snsCustomer,p=null==
c.snsJustSubscribeOptionEnabled?c.snsCustomer||!1:c.snsJustSubscribeOptionEnabled||!1,r=f(b.SNS_DELIVERY_NEW_OR_UNRECOGNIZED_UPSELL).length?!0:!1,l=c.suppressSnSOneNowOption||!1,w=c.justSubscribeTieredStatus;c=c.tieredStatusOnRecurringDeliveryDates[h-1]===a.TIERED;e===a.DELIVERY_OPTION.SNS?(f(b.SNS_DELIVERY_UPSELL).removeClass("aok-hidden"),f(b.ONML_DELIVERY_UPSELL).addClass("aok-hidden"),p||l?r&&!d?(g(),f(b.SNS_DELIVERY_NEW_OR_UNRECOGNIZED_UPSELL).removeClass("aok-hidden")):w?(g(),f(b.SNS_DELIVERY_TIERED_UPSELL).removeClass("aok-hidden")):
(g(),f(b.SNS_DELIVERY_NON_TIERED_UPSELL).removeClass("aok-hidden")):g()):e===a.DELIVERY_OPTION.ONML?(f(b.SNS_DELIVERY_UPSELL).addClass("aok-hidden"),f(b.ONML_DELIVERY_UPSELL).removeClass("aok-hidden"),p?r&&!d?(g(),f(b.ONML_DELIVERY_NEW_OR_UNRECOGNIZED_UPSELL).removeClass("aok-hidden")):c?(g(),f(b.ONML_DELIVERY_TIERED_UPSELL).removeClass("aok-hidden")):(g(),f(b.ONML_DELIVERY_NON_TIERED_UPSELL).removeClass("aok-hidden")):(g(),f(b.ONML_DELIVERY_NEW_OR_UNRECOGNIZED_UPSELL).removeClass("aok-hidden"))):
(f(b.SNS_DELIVERY_UPSELL).addClass("aok-hidden"),f(b.ONML_DELIVERY_UPSELL).addClass("aok-hidden"),g())}},updateDiscountPill:function(c,d,h){if(c&&d&&h){var g=d.snsCustomer,p=null==d.snsJustSubscribeOptionEnabled?d.snsCustomer||!1:d.snsJustSubscribeOptionEnabled||!1,r=f(b.SNS_DELIVERY_NEW_OR_UNRECOGNIZED_PILL).length?!0:!1,l=d.suppressSnSOneNowOption||!1,w=d.justSubscribeTieredStatus;h=d.tieredStatusOnRecurringDeliveryDates[h-1]===a.TIERED;d=d.zeroBaseDiscount;c===a.DELIVERY_OPTION.SNS?(f(b.SNS_DELIVERY_PILL).removeClass("aok-hidden"),
f(b.ONML_DELIVERY_PILL).addClass("aok-hidden"),p||l?r&&!g?(e(),d||f(b.SNS_DELIVERY_NEW_OR_UNRECOGNIZED_PILL).removeClass("aok-hidden")):w?(e(),f(b.SNS_DELIVERY_TIERED_PILL).removeClass("aok-hidden")):(e(),d||f(b.SNS_DELIVERY_NON_TIERED_PILL).removeClass("aok-hidden")):e()):c===a.DELIVERY_OPTION.ONML?(f(b.SNS_DELIVERY_PILL).addClass("aok-hidden"),f(b.ONML_DELIVERY_PILL).removeClass("aok-hidden"),p?r&&!g?(e(),d||f(b.ONML_DELIVERY_NEW_OR_UNRECOGNIZED_PILL).removeClass("aok-hidden")):h?(e(),f(b.ONML_DELIVERY_TIERED_PILL).removeClass("aok-hidden")):
(e(),d||f(b.ONML_DELIVERY_NON_TIERED_PILL).removeClass("aok-hidden")):(e(),d||f(b.ONML_DELIVERY_NEW_OR_UNRECOGNIZED_PILL).removeClass("aok-hidden"))):(e(),f(b.SNS_DELIVERY_PILL).addClass("aok-hidden"),f(b.ONML_DELIVERY_PILL).addClass("aok-hidden"))}},updateBuyboxDeliveryOption:function(){f(b.SNS_DELIVERY_OPTION_DIV).is(":checked")?(d.declarative.remove(b.SNS_DECLARATIVE_ACTION),d.declarative.create(b.SNS_DECLARATIVE_ACTION,b.SNS_SUBSCRIBE_ONLY_ACTION),f(b.SNS_ONMLV2_DELIVERY_OPTION_FORM_FIELD).val(b.SNS_DELIVERY_OPTION_SNS),
f(b.SNS_SUBSCRIBE_BUTTON_DELIVERY_OPTION_FORM_FIELD).val(b.SNS_DELIVERY_OPTION_SNS),f(b.SNS_DELIVERY_OPTION_ONML_LINK).addClass("aok-hidden"),f(b.SNS_DELIVERY_OPTION_SNS_LINK).removeClass("aok-hidden"),f(b.ACCORDION_HEADER_DELIVERY_OPTION_ONML_LINK).addClass("aok-hidden"),f(b.ACCORDION_HEADER_DELIVERY_OPTION_SNS_LINK).removeClass("aok-hidden")):f(b.ONML_DELIVERY_OPTION_DIV).is(":checked")&&(d.declarative.remove(b.SNS_DECLARATIVE_ACTION),d.declarative.create(b.SNS_DECLARATIVE_ACTION,c.getOnmlDeclarativeAction()),
f(b.SNS_ONMLV2_DELIVERY_OPTION_FORM_FIELD).val(b.SNS_DELIVERY_OPTION_ONML),f(b.SNS_SUBSCRIBE_BUTTON_DELIVERY_OPTION_FORM_FIELD).val(b.SNS_DELIVERY_OPTION_ONML),f(b.SNS_DELIVERY_OPTION_SNS_LINK).addClass("aok-hidden"),f(b.SNS_DELIVERY_OPTION_ONML_LINK).removeClass("aok-hidden"),f(b.ACCORDION_HEADER_DELIVERY_OPTION_SNS_LINK).addClass("aok-hidden"),f(b.ACCORDION_HEADER_DELIVERY_OPTION_ONML_LINK).removeClass("aok-hidden"))}}});m.when("A","a-dropdown","sns-vmf-utils","sns-onmlv2-utils","sns-metrics-constants",
"sns-annual-savings","sns-constants","sns-buybox-constants","a-popover","ready").execute("sns-onmlv2-frequency-update",function(d,b,a,c,g,e,f,k,q){function h(b,h){var d=h+"FrequencySelectedIndex",n=k.SNS_FREQUENCY_NAME+h+"V2";if(b&&b.selectedRow&&b.selectedRow.$row&&b.selectedRow.$row.length&&b.selectedRow.$row[0]&&b.selectedRow.$row[0].dataset){var p=b.selectedRow.$row[0].dataset.frequencyValue,l=b.selectedRow.$row[0].dataset.selectedIndex;b=b.selectedRow.$row[0].dataset.frequencyLabel;p!==t&&l!==
t?(r("input[name\x3d'"+n+"']").val(p),r("input[name\x3d'"+d+"']").val(l),r("#replenishment-"+h+"-frequency-trigger").text(b),h===f.DELIVERY_OPTION.ONML?(d=c.getOnmlFrequencyParam(),c.emitMetric(g.SNS_ONML_FREQUENCY_POPOVER_SELECTED+"-"+p)):(d=c.getSnsFrequencyParam(),c.emitMetric(g.SNS_FREQUENCY_POPOVER_SELECTED+"-"+p)),a.selectFrequency(d[l],h),p=a.getFrequencyValueExcludingDeliveryType(p),e.checkPreConditionsAndUpdateAnnualSavings(p)):c.emitMetric(g.SNS_INVALID_FREQUENCY_POPOVER_INPUTS)}else c.emitMetric(g.SNS_INVALID_FREQUENCY_POPOVER_DATA_STRUCTURE);
h=q.get("replenishment"+h+"FrequencyPopover");null!==h&&h!==t&&h.hide()}function n(b){var e=a.getFrequencyIndex(b);b=d.$("[data-a-accordion-name\x3d'"+("replenishment-"+b+"-frequency-accordion")+"'] [data-a-accordion-row-name\x3d'"+(b+"FrequencyAccordionRow-"+e)+"'] a");b.length?b.click():c.emitMetric(g.SNS_INVALID_FREQUENCY_ACCORDION_ROW)}function p(a){l.ue&&l.ue.count(a,(ue.count(a)||0)+1)}var r=d.$;d.on("a:dropdown:rcxOrdFreqSns:select",function(b){b=a.getFrequencyIndex(f.DELIVERY_OPTION.SNS);
a.updateFrequencyIndex(b);var h=c.getSnsFrequencyParam();a.selectFrequency(h[b],f.DELIVERY_OPTION.SNS);b=a.getFrequencyValue(f.DELIVERY_OPTION.SNS);h=a.getFrequencyValueExcludingDeliveryType(b);0<b.search("W")?p(g.SNS_LEGACY_WEEKLY_FREQUENCY_SELECT_METRICS):p(g.SNS_LEGACY_MONTHLY_FREQUENCY_SELECT_METRICS);e.checkPreConditionsAndUpdateAnnualSavings(h)});d.on("a:dropdown:rcxOrdFreqOnml:select",function(b){b=a.getFrequencyIndex(f.DELIVERY_OPTION.ONML);a.updateFrequencyIndex(b);var h=c.getOnmlFrequencyParam();
a.selectFrequency(h[b],f.DELIVERY_OPTION.ONML);b=a.getFrequencyValue(f.DELIVERY_OPTION.ONML);h=a.getFrequencyValueExcludingDeliveryType(b);0<b.search("W")?p(g.SNS_ONML_WEEKLY_FREQUENCY_SELECT_METRICS):p(g.SNS_ONML_MONTHLY_FREQUENCY_SELECT_METRICS);e.checkPreConditionsAndUpdateAnnualSavings(h)});d.on("a:accordion:replenishment-sns-frequency-accordion:select",function(a){h(a,f.DELIVERY_OPTION.SNS);c.emitMetric(g.SNS_FREQUENCY_POPOVER_SELECTED)});d.on("a:accordion:replenishment-onml-frequency-accordion:select",
function(a){h(a,f.DELIVERY_OPTION.ONML);c.emitMetric(g.SNS_ONML_FREQUENCY_POPOVER_SELECTED)});d.on("a:popover:beforeShow:replenishmentsnsFrequencyPopover",function(){n(f.DELIVERY_OPTION.SNS)});d.on("a:popover:beforeShow:replenishmentonmlFrequencyPopover",function(){n(f.DELIVERY_OPTION.ONML)})});m.when("A","sns-buybox-constants").execute("sns-onmlv2-quantity-update",function(d,b){var a=d.$;d.on(b.SNS_ONMLV2_QUANTITY_TRIGGER_DROPDOWN,function(c){c=c.value;a(b.SNS_ONMLV2_QUANTITY_FORM_FIELD).val(c);
a(b.SNS_SUBSCRIBE_BUTTON_QUANTITY_FORM_FIELD).val(c)});a(b.SNS_ONMLV2_QUANTITY_TRIGGER_RADIO_BUTTON).change(function(c){c=c.target.value;a(b.SNS_ONMLV2_QUANTITY_FORM_FIELD).val(c);a(b.SNS_SUBSCRIBE_BUTTON_QUANTITY_FORM_FIELD).val(c)})});m.when("A","sns-onmlv2-utils").execute("sns-accordion-content-update",function(d,b){d.declarative("sns-delivery-change-btn","click",function(a){b.updatePrimeShippingMessage()});d.on("a:sheet:beforeHide:sns_delivery_bottom_sheet",function(){b.updatePrimeShippingMessage()})});
"use strict";m.register("sns-join-prime-endpoint",function(){return{endpoint:"/amazonprime/"}});m.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"}});m.when("A","sns-utils","sns-constants","sns-price-utils","sns-buybox-constants","sns-priceblock-constants").register("sns-price-refresh",function(d,b,a,c,g,e){return{init:function(){d.declarative("sns-opt-in-checked","change",function(){c.showSnSPriceIfSnSOptInChecked()});b.registerCallbackForNameSpace(a.EVENT_NAMESPACE.PAGE_UPDATE,c.showSnSPriceIfSnSOptInChecked);c.showSnSPriceIfSnSOptInChecked();d.$(g.SNS_BUY_USED_BUTTON).click(function(){var c=
g.SNS_OPT_IN_CHECKBOX,k=b.getOnmlUserPref(a.USER_PREFS_KEYS.SNS_OPT_IN),q=e.SNS_UPSELL,h=e.SNS_PITCH_PRICE_UPSELL_TEXT,n=e.ONML_ATF_REDESIGN_UPSELL;!0===k&&(d.$(c).click(),b.setOnmlUserPref(a.USER_PREFS_KEYS.SNS_OPT_IN,!0));d.$(n).addClass("aok-hidden");d.$(q).addClass("aok-hidden");d.$(h).addClass("aok-hidden")})}}});m.when("A","sns-utils","sns-priceblock-constants","sns-buybox-constants").register("sns-price-utils",function(d,b,a,c){var g=d.$,e=a.SNS_PITCH_PRICE_UPSELL_TEXT,f=a.SNS_PITCH_PRICE_FEATURE,
k=a.NEW_PITCH_PRICE_FEATURE,q=a.PRICEBLOCK_SNSPRICE_ROW,h=c.SNS_OPT_IN_CHECKBOX,n=a.SNS_UPSELL,p=a.SNS_SAVINGS,r=a.DP_OUR_PRICE,l=a.DP_OUR_PRICE_LABEL,m=a.DP_OUR_PRICE_SAVINGS,t=a.DP_OUR_PRICE_BADGING,x=a.DP_OUR_PRICE_SHIPPING,A=a.DP_SALE_PRICE,B=a.DP_SALE_PRICE_LABEL,C=a.DP_SALE_PRICE_SHIPPING,D=a.DP_DEAL_PRICE,E=a.DP_DEAL_PRICE_SAVINGS,v=a.DP_DEAL_PRICE_SHIPPING,z=a.MOBILE_OUR_PRICE_SHIPPING,F=a.SHIPPING_DETAILS,G=c.SNS_BUY_NEW_PRICE,H=c.NON_CBB_BUY_NEW_PRICE,I=c.CBB_BUY_NEW_PRICE,J=c.SNS_PRICE_IN_BUY_USED_SECTION,
K=c.CBB_SNS_BUY_NEW_PRICE,L=c.DPV2_BUY_NEW_PRICE,M=a.SNS_ATF_REDESIGN_UPSELL_CHECKED,N=a.SNS_ATF_REDESIGN_UPSELL_UNCHECKED;return{showSnSPriceIfSnSOptInChecked:function(){b.isSnSEligible()&&(g(h).is(":checked")?b.shouldShowPrice()&&(g(q).length?(g(q).removeClass("aok-hidden"),g(p).removeClass("a-hidden"),g(n).addClass("aok-hidden"),g(m).addClass("a-hidden"),g(t).addClass("a-hidden"),g(x).addClass("a-hidden"),g(z).addClass("a-hidden"),g(r).addClass("a-text-strike a-size-base a-color-secondary onml-price-inactive").removeClass("a-size-medium a-color-price"),
g(l).addClass("onml-price-inactive"),g(A).addClass("a-text-strike a-size-base a-color-secondary onml-price-inactive").removeClass("a-size-medium a-color-price "),g(B).addClass("onml-price-inactive"),g(C).addClass("a-hidden"),g(D).addClass("a-text-strike a-size-base a-color-secondary onml-price-inactive").removeClass("a-size-medium a-color-price"),g(E).addClass("a-hidden"),g(v).addClass("a-hidden"),g(q).css({display:"table-row",visibility:"visible"}),g(q).prev().has(F).addClass("aok-hidden"),g(H).addClass("aok-hidden"),
g(G).removeClass("aok-hidden"),g(I).addClass("aok-hidden"),g(J).addClass("aok-hidden"),g(K).removeClass("aok-hidden"),g(L).addClass("aok-hidden")):(g(e).addClass("aok-hidden"),g(k).addClass("aok-hidden"),g(f).removeClass("aok-hidden"),g(f).css({display:"block",visibility:"visible"}),g(M).removeClass("aok-hidden"),g(N).addClass("aok-hidden"))):g(q).length?(g(q).addClass("aok-hidden"),g(p).addClass("a-hidden"),g(n).removeClass("aok-hidden"),g(m).removeClass("a-hidden"),g(t).removeClass("a-hidden"),
g(x).removeClass("a-hidden"),g(z).removeClass("a-hidden"),g(r).addClass("a-size-medium a-color-price").removeClass("a-text-strike a-size-base a-color-secondary onml-price-inactive"),g(l).removeClass("onml-price-inactive"),g(A).addClass("a-size-medium a-color-price").removeClass("a-text-strike a-size-base a-color-secondary onml-price-inactive"),g(B).removeClass("onml-price-inactive"),g(C).removeClass("a-hidden"),g(D).addClass("a-size-medium a-color-price").removeClass("a-text-strike a-size-base a-color-secondary onml-price-inactive"),
g(E).removeClass("a-hidden"),g(v).removeClass("a-hidden"),g(q).prev().has(F).removeClass("aok-hidden"),g(H).removeClass("aok-hidden"),g(G).addClass("aok-hidden"),g(I).removeClass("aok-hidden"),g(J).addClass("aok-hidden"),g(K).addClass("aok-hidden"),g(L).removeClass("aok-hidden")):(g(e).removeClass("aok-hidden"),g(k).removeClass("aok-hidden"),g(f).addClass("aok-hidden"),g(e).css({display:"block",visibility:"visible"}),g(N).removeClass("aok-hidden"),g(M).addClass("aok-hidden")))}}});m.when("A","sns-constants",
"sns-buybox-constants","sns-states-loaded-in-dom").register("sns-utils",function(d,b,a){var c=d.$,g={},e={},f=function(a,b,e){var f,d=function(a){if(!a||"object"===typeof a)return a;var e=c.parseJSON;l.JSON&&l.JSON.parse&&(e=JSON.parse);try{return"string"===typeof a?e(a):null}catch(f){return l.ueLogError&&l.ueLogError(f,{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=d(a.first().text()),d("object"===typeof f?f[e]:null)):f},k=function(b){var e=f(a.SNS_OPT_IN_FEATURE_DIV,"sns-onml-params","onmlParams");return b?e&&e[b]:e},q=function(){var a=k("deviceType"),c=e[b.USER_PREFS_KEYS.ONML_PARAMS],c=c&&c.deviceType;return a||c};return{isSnSEligible:function(){return k("snsEligible")},getAStateFromDom:f,getOnmlParam:k,shouldShowPrice:function(){return k("showPrice")},getDeviceType:q,registerCallbackForNameSpace:function(a,b){g[a]||(g[a]=[]);-1===
g[a].indexOf(b)&&g[a].push(b)},executeCallbacksForNameSpace:function(a){if((a=g[a])&&a.constructor===Array)for(var b=0;b<a.length;b++)a[b]()},setOnmlUserPref:function(a,b){e[a]=b},getOnmlUserPref:function(a){return e[a]},deleteOnmlUserPref:function(a){delete e[a]},isMobileDevice:function(){var a=q();return"mobile"===a||"mobileApp"===a},isMobileApp:function(){return"mobileApp"===q()},isTabletApp:function(){var a=q();return"iPad"===a||"tabletApp"===a||"tabletLargeApp"===a},isVerucaBuyNowEnabled:function(){return k("verucaBuyNowEnabled")},
isVerucaOneClickEnabled:function(){return k("verucaOneClickEnabled")},enableSnSOptIn:function(){c(a.SNS_OPT_IN_CHECKBOX).removeAttr("disabled")},isSnsCustomer:function(){return k("snsCustomer")}}});m.when("A","a-checkbox","sns-buybox-constants","sns-constants").register("sns-onmlv2-utils",function(d,b,a,c){function g(a,b){return![0,1,3,4,5].includes(b)}var e=d.$,f,k=function(a,b,c){var f,d=function(a){if(!a||"object"===typeof a)return a;var c=e.parseJSON;l.JSON&&l.JSON.parse&&(c=JSON.parse);try{return"string"===
typeof a?c(a):null}catch(f){return v("snsGetAStateException","NotDefined"),l.ueLogError&&l.ueLogError(f,{logLevel:"ERROR",attribution:"sns",message:"An error occurred when getting onml parameters from page-state. a-state: "+b+" with string: "+a}),null}};a=e(a||"html");return 1<=a.length&&(a=a.find("script[data-a-state*\x3d'"+b+"']"))&&1<=a.length?(f=d(a.first().text()),d("object"===typeof f?f[c]:null)):f},q=function(a,b,c){var f,d=function(a){if(null===a||"object"===typeof a||"boolean"===typeof a)return a;
var c=e.parseJSON;l.JSON&&l.JSON.parse&&(c=JSON.parse);try{return"string"===typeof a?c(a):null}catch(f){return v("b2bGetAStateException","NotDefined"),l.ueLogError&&l.ueLogError(f,{logLevel:"ERROR",attribution:"b2b",message:"An error occurred when getting onml parameters from page-state. a-state: "+b+" with string: "+a}),null}};a=e(a||"html");return 1<=a.length&&(a=a.find("script[data-a-state*\x3d'"+b+"']"))&&1<=a.length?(f=d(a.first().text()),d("object"===typeof f?f[c]:null)):f},h=function(a,b,c){var f;
a=e(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 d=e.parseJSON;l.JSON&&l.JSON.parse&&(d=JSON.parse);try{f="string"===typeof a?d(a):null}catch(h){v("snsGetAStateWithoutJsonException","NotDefined"),l.ueLogError&&l.ueLogError(h,{logLevel:"ERROR",attribution:"sns",message:"An error occurred when getting onml parameters from page-state. a-state: "+b+" with string: "+a}),f=null}}else f=a;return c="object"===typeof f?
f[c]:null}return f},n=function(){return k(t,a.SNS_BUY_BOX_PARAMS,a.SNS_BUY_BOX_PARAM_MAP)},p=function(){return k(t,"sns-frequency-params","snsFrequencyParamsMap")},r=function(){return k(t,"sns-frequency-params","onmlFrequencyParamsMap")},m=function(){var e=b(a.SNS_DELIVERY_OPTION_CHANGE_CHECKBOX_ID);return e&&e._$element&&0<e._$element.length},w=function(){var c;if(m()){var f=b(a.SNS_DELIVERY_OPTION_CHANGE_CHECKBOX_ID);c=u();f=f.isChecked();c=c?f:!f}else c=e(a.SNS_DELIVERY_OPTION_DIV).is(":checked");
return c?a.SNS_DELIVERY_OPTION_SNS:a.SNS_DELIVERY_OPTION_ONML},u=function(){var a=null,b=r();b&&Array.isArray(b)&&(a=b.find(function(a){if(!0===a.isDefault)return a}));return a?!0===a.isDefault:!1},x=function(a){var b=n();return b?b.deviceType===a:!1},A=function(){return x("mobile")||x("mobileApp")},B=function(){return x("web")},C=function(){return document.querySelector(a.SNS_ACCORDION_HEADER_RADIO_BUTTON)},D=function(a,b){return a&&b?a.tieredStatusOnRecurringDeliveryDates[b-1]===c.TIERED:!1},E=
function(a,b){return a&&b?a.firstRecurringDeliveryDates[b-1]:""},v=function(a,b){l.ue&&l.ue.count(a,(ue.count(a)||0)+1);l.uet&&l.uet("cf",b,{wb:1})},z=function(a){l.ue&&l.ue.count(a,(ue.count(a)||0)+1)};return{getAStateFromDom:k,getAStateFromDomWithoutJson:h,getDeliveryOption:function(){return e(a.SNS_ONMLV2_DELIVERY_OPTION_FORM_FIELD).val()},getSwitchDeliveryOption:function(){if(!f){var a=n();a&&(f=a.deliveryOption)}return f},getBuyboxMessageParam:n,isMobileDevice:A,isMobileWeb:function(){return x("mobile")},
isMobileApp:function(){return x("mobileApp")},isTabletApp:function(){return x("iPad")||x("tabletApp")||x("tabletLargeApp")},isWeb:B,getSnsFrequencyParam:p,getSnsFrequencyParamForB2B:function(){return q(t,"sns-frequency-params","snsFrequencyParamsMap")},getOnmlFrequencyParam:r,getOnmlFrequencyParamForB2B:function(){return q(t,"sns-frequency-params","onmlFrequencyParamsMap")},getIsCustomerPrimeMap:function(){return q(t,"is-prime-customer","IsPrime")},getIsB2bDiscountWinningMap:function(){return q(t,
"is-b2b-discount-winning","isB2bDiscountWinning")},getIsRDProgramWinner:function(){return q(t,"rd-program-params","isRDProgramWinner")},getDeliveryInfoParam:function(){var a;a=e("#replenishment-onml-frequency-accordion");var b=e("#replenishment-sns-frequency-accordion");a=0!==a.length||0!==b.length?Math.max(a.children().length,b.children().length):Math.max(e("[name\x3drcxOrdFreqSns]").children("option").length,e("[name\x3drcxOrdFreqOnml]").children("option").length);b=k(t,"sns-frequency-params","deliveryInfoParamsMap");
6===a&&b.snsDates&&6<b.snsDates.length&&(a=b,a.snsDates=a.snsDates.filter(g),a.onmlDates=a.onmlDates.filter(g),z("filteringWeeklyDeliveryInfoWhenGranularDisabled"),b=a);return b},getDiscountOptionsParam:function(){return k(t,"sns-frequency-params","discountOptionsParamsMap")},getDiscountTypeParam:function(){return h(t,"sns-frequency-params","deliveryTypeParamsMap")},getOnmlDateParam:function(){return h(t,"sns-frequency-params","onmlDateParamsMap")},createHiddenInput:function(a,b){return'\x3cinput type\x3d"hidden" name\x3d"'+
a+'" value\x3d"'+b+'"\x3e'},getBuyNowAction:function(){return A()?e(a.MOBILE_ADD_TO_CART_DIV).attr("action"):B()?e(a.ADD_TO_CART_DIV).attr("action"):e(a.TABLET_ADD_TO_CART_DIV).attr("action")},getOnmlv2FormValueByName:function(b){return e(a.SNS_ONMLV2_FORM_FIELDS+" [name\x3d'"+b+"']").val()},getSubscribeButtonFormValueByName:function(b){return e(a.SUBSCRIBE_BUTTON_FORM_FIELDS+" [name\x3d'"+b+"']").val()},isCbbTemplateEnabled:function(){return e(a.SNS_CBB_ACCORDION_ROW).length},removeFormFieldsIntroducedByCbb:function(){e(a.SNS_ONMLV2_FORM_FIELDS+
" #ASIN").remove();e(a.SNS_ONMLV2_FORM_FIELDS+" #offerListingID").remove();e(a.SNS_ONMLV2_FORM_FIELDS+" #snsOfferListingID").remove();e(a.SNS_ONMLV2_FORM_FIELDS+" #snsMerchantID").remove();e(a.SNS_ONMLV2_FORM_FIELDS+" #rcxOrdFreq").remove();e(a.SNS_ONMLV2_FORM_FIELDS+" #quantity").remove()},getCbbSnsAccordionRowRadioButton:C,isCbbSnsAccordionRowExpanded:function(){return"true"===C().getAttribute("aria-checked")},isTiered:D,getOnmlFirstRecurringDeliveryDate:E,getOnmlDeclarativeAction:function(){return e("#onmlDeclarativeAction").val()},
generateUrlParams:function(b){if(!b){var c=a.SNS_SELECT_DELIVERY_URL;return c}var f=(A()?e(a.SNS_FREQUENCY_FORM_FIELD_MOBILE):e(a.SNS_FREQUENCY_FORM_FIELD)).val(),d=[];d.subscribeOnlyDate=b.justSubscribeDeliveryDate;d.subscribeOnlyDateShort=b.justSubscribeShortDeliveryDate;d.subscribeOnlyDiscount=b.justSubscribeTieredStatus?b.tieredDiscountPercent:b.baseDiscountPercent;d.onmlDate=b.oneTimeDeliveryDate;d.onmlDateShort=b.oneTimeShortDeliveryDate;d.onmlDiscount=b.baseDiscountPercent;d.onmlNextDate=E(b,
f);d.onmlNextDiscount=D(b,f)?b.tieredDiscountPercent:b.baseDiscountPercent;d.snsDeliveryOption=e(a.SNS_SELECT_DELIVERY_OPTION_ID).val();d.isMobile=A();d.snscsrf=b.deliveryModalCSRFToken;c=a.SNS_SELECT_DELIVERY_URL;Object.keys(d).forEach(function(a){c+="\x26"+a+"\x3d"+encodeURI(d[a])});return c},createUrlParameter:function(a,b){b=encodeURIComponent(b);return a+"\x3d"+b+"\x26"},getDefaultDeliveryOption:function(){return u()?a.SNS_DELIVERY_OPTION_ONML:a.SNS_DELIVERY_OPTION_SNS},isONMLDefault:u,getSelectedDeliveryOption:w,
updatePrimeShippingMessage:function(){w()===a.SNS_DELIVERY_OPTION_SNS?e(a.SNS_CBB_PRIME_SHIPPING).addClass("aok-hidden"):e(a.SNS_CBB_PRIME_SHIPPING).removeClass("aok-hidden")},isDeliveryChangeCheckboxVisible:m,getDefaultFrequency:function(a){var b=null;(a=a?p():r())&&Array.isArray(a)&&(b=a.find(function(a){if(!0===a.isDefault)return a}));return b?b.value.split("|")[0]:null},getCurrencyCode:function(){return h(t,"sns-huc-data","currencyCode")},emitSsbMetrics:v,emitInvalidFrequencyMetric:function(a,
b){var c=e("input[name\x3drcxOrdFreqOnml]").val(),f=e("input[name\x3drcxOrdFreqSns]").val(),d=/^[0-9][M|W]\|onml$/,h=/^[0-9][M|W]\|sns$/;c===t||null===c||d.test(c)||z(a);f===t||null===f||h.test(f)||z(b)},emitMetric:z,getAnnualSavingsParamMap:function(){return k(t,"sns-upsell-params","annualSavingsParamsMap")},getAnnualSavingsWeblabTreatment:function(){return h(t,"sns-upsell-params","annualSavingsWeblabTreatment")},getDefaultSavingsValue:function(){return h(t,"sns-upsell-params","defaultAnnualSavingsValue")},
recordWeblabTriggers:function(a,b){try{l.ue&&"function"===typeof l.ue.trigger&&l.ue.trigger(a,b)}catch(c){z("snsWeblabTriggeringException")}},logErrorWithAttribution:function(a,b){l.ueLogError&&l.ueLogError(b,{logLevel:"ERROR",attribution:a})},getSubscriberDiscountMessageWeblabTreatment:function(){return h(t,a.SNS_SUBSCRIBER_DISCOUNT_MESSAGE_STATE_ID,"subscriberDiscountMessageTreatment")},isSnSAccordionActive:function(){var a=d.$(c.ACTIVE_ACCORDION_SELECTOR).data(c.ACCORDION_ROW_NAME_SELECTOR);return a===
c.SNS_ACCORDION_ROW_NAME_DESKTOP||a===c.SNS_ACCORDION_ROW_NAME_MOBILE||a===c.SNS_ACCORDION_ROW_NAME_MOBILE_APP},isSnSSelectedAccordion:function(a){a=a.selectedRow.rowName;return a===c.SNS_ACCORDION_ROW_NAME_DESKTOP||a===c.SNS_ACCORDION_ROW_NAME_MOBILE||a===c.SNS_ACCORDION_ROW_NAME_MOBILE_APP},isSnSAccordionActiveForDeviceType:function(a){var b=d.$(c.ACTIVE_ACCORDION_SELECTOR).data(c.ACCORDION_ROW_NAME_SELECTOR);return a===c.DEVICE_TYPE.DESKTOP?b===c.SNS_ACCORDION_ROW_NAME_DESKTOP:a===c.DEVICE_TYPE.MOBILE?
b===c.SNS_ACCORDION_ROW_NAME_MOBILE:a===c.DEVICE_TYPE.MOBILE_APP?b===c.SNS_ACCORDION_ROW_NAME_MOBILE_APP:!1},isSnSSelectedAccordionForDeviceType:function(a,b){a=a.selectedRow.rowName;return b===c.DEVICE_TYPE.DESKTOP?a===c.SNS_ACCORDION_ROW_NAME_DESKTOP:b===c.DEVICE_TYPE.MOBILE?a===c.SNS_ACCORDION_ROW_NAME_MOBILE:b===c.DEVICE_TYPE.MOBILE_APP?a===c.SNS_ACCORDION_ROW_NAME_MOBILE_APP:!1}}});m.when("A","a-dropdown","sns-onmlv2-utils","sns-buybox-constants","sns-constants").register("sns-vmf-utils",function(d,
b,a,c,g){var e=d.$,f=function(a){var c=e("[name\x3drcxOrdFreqSns]"),f=e("[name\x3drcxOrdFreqOnml]");0!==c.length&&0!==f.length&&(c=c[0].options[a].value,a=f[0].options[a].value,b.getSelect(e("[name\x3drcxOrdFreqSns]")).setValue(c),b.getSelect(e("[name\x3drcxOrdFreqOnml]")).setValue(a))},k=function(a){var b=e("input[name\x3d'"+("rcxOrdFreq"+a+"V2")+"']");return b!==t&&null!==b&&0!==b.length?b.val():a===g.DELIVERY_OPTION.SNS?e("[name\x3drcxOrdFreqSns]").val():e("[name\x3drcxOrdFreqOnml]").val()};return{updateFrequencyIndex:f,
selectFrequency:function(b,f){e(".sns-delivery-buybox-upsell-message").html(b.upsellInformation.message);e(".sns-delivery-buybox-upsell-additional-message-title").html(b.upsellInformation.additionalMessageTitle);e(".sns-delivery-buybox-upsell-additional-message").html(b.upsellInformation.additionalMessage);if("sns"===f){e(".onml-delivery-link").addClass("aok-hidden");if(-1<b.value.indexOf("W|")){e(".sns-delivery-link").addClass("aok-hidden");e(".sns-delivery-link-weekly").removeClass("aok-hidden");
var d=e(".sns-delivery-link-weekly").html()}else e(".sns-delivery-link").removeClass("aok-hidden"),e(".sns-delivery-link-weekly").addClass("aok-hidden"),d=e(".sns-delivery-link").html();e(c.ACCORDION_HEADER_DELIVERY_OPTION_SNS_LINK).html(d);e(c.ACCORDION_HEADER_DELIVERY_OPTION_ONML_LINK).addClass("aok-hidden");e(c.ACCORDION_HEADER_DELIVERY_OPTION_SNS_LINK).removeClass("aok-hidden");e(c.SNS_DELIVERY_OPTION_SNS_LINK_TEXT_IDENTIFIER).removeClass("aok-hidden");e(c.SNS_DELIVERY_OPTION_ONML_LINK_TEXT_IDENTIFIER).addClass("aok-hidden")}else e(".sns-delivery-link").addClass("aok-hidden"),
e(".sns-delivery-link-weekly").addClass("aok-hidden"),e(".onml-delivery-link").removeClass("aok-hidden"),e(c.ACCORDION_HEADER_DELIVERY_OPTION_ONML_LINK).removeClass("aok-hidden"),e(c.ACCORDION_HEADER_DELIVERY_OPTION_SNS_LINK).addClass("aok-hidden"),e(c.SNS_DELIVERY_OPTION_SNS_LINK_TEXT_IDENTIFIER).addClass("aok-hidden"),e(c.SNS_DELIVERY_OPTION_ONML_LINK_TEXT_IDENTIFIER).removeClass("aok-hidden");b=b.highlightedDiscount;var d=a.getDiscountTypeParam(),g=null!=a.getIsB2bDiscountWinningMap()&&!0===a.getIsB2bDiscountWinningMap()[0],
k=null!=a.getIsB2bDiscountWinningMap()&&!0===a.getIsB2bDiscountWinningMap()[1];0===b?(e("#subscriptionPrice \x3e #sns-base-price").removeClass("aok-hidden"),e("#subscriptionPrice \x3e #sns-tiered-price").addClass("aok-hidden"),e("#snsDetailPagePrice \x3e #sns-base-price").removeClass("aok-hidden"),e("#snsDetailPagePrice \x3e #sns-tiered-price").addClass("aok-hidden"),e(c.SNS_BASE_DISCOUNT_MESSAGE).removeClass("aok-hidden"),e(c.SNS_TIERED_DISCOUNT_MESSAGE).addClass("aok-hidden"),e(".discountPillLeft").addClass("pillLightUp"),
e(".discountPillRight").removeClass("pillLightUp"),d===c.DISCOUNT_TYPE_ZERO_BASE||g?e("#snsDiscountPill").addClass("aok-hidden"):e("#snsDiscountPill").removeClass("aok-hidden"),g?(e(".sns-ab-price-win-delivery-buybox-upsell-message").removeClass("aok-hidden"),e(".sns-delivery-buybox-upsell-message").addClass("aok-hidden"),e(".sns-delivery-buybox-upsell-additional-message-title").addClass("aok-hidden"),e(".sns-delivery-buybox-upsell-additional-message").addClass("aok-hidden")):(e(".sns-ab-price-win-delivery-buybox-upsell-message").addClass("aok-hidden"),
e(".sns-delivery-buybox-upsell-message").removeClass("aok-hidden"),e(".sns-delivery-buybox-upsell-additional-message-title").removeClass("aok-hidden"),e(".sns-delivery-buybox-upsell-additional-message").removeClass("aok-hidden"))):(e("#subscriptionPrice \x3e #sns-base-price").addClass("aok-hidden"),e("#subscriptionPrice \x3e #sns-tiered-price").removeClass("aok-hidden"),e("#snsDetailPagePrice \x3e #sns-base-price").addClass("aok-hidden"),e("#snsDetailPagePrice \x3e #sns-tiered-price").removeClass("aok-hidden"),
e(c.SNS_BASE_DISCOUNT_MESSAGE).addClass("aok-hidden"),e(c.SNS_TIERED_DISCOUNT_MESSAGE).removeClass("aok-hidden"),e(".discountPillLeft").removeClass("pillLightUp"),e(".discountPillRight").addClass("pillLightUp"),d===c.DISCOUNT_TYPE_ZERO_BASE&&"onml"===f||k?e("#snsDiscountPill").addClass("aok-hidden"):e("#snsDiscountPill").removeClass("aok-hidden"),k?(e(".sns-ab-price-win-delivery-buybox-upsell-message").removeClass("aok-hidden"),e(".sns-delivery-buybox-upsell-message").addClass("aok-hidden"),e(".sns-delivery-buybox-upsell-additional-message-title").addClass("aok-hidden"),
e(".sns-delivery-buybox-upsell-additional-message").addClass("aok-hidden")):(e(".sns-ab-price-win-delivery-buybox-upsell-message").addClass("aok-hidden"),e(".sns-delivery-buybox-upsell-message").removeClass("aok-hidden"),e(".sns-delivery-buybox-upsell-additional-message-title").removeClass("aok-hidden"),e(".sns-delivery-buybox-upsell-additional-message").removeClass("aok-hidden")),d===c.DISCOUNT_TYPE_ZERO_BASE&&"sns"===f&&(f=a.getSubscriberDiscountMessageWeblabTreatment(),"undefined"===typeof f||
null===f?a.emitMetric("snsSdmExperimentTreatmentUndefined"):(a.recordWeblabTriggers(c.SUBSCRIBER_DISCOUNT_MESSAGE_EXPERIMENT_ID,f),a.emitMetric("snsSdmExperimentTriggeringSuccess"))))},getFrequencyValueExcludingDeliveryType:function(a){if(null!==a&&"string"===typeof a)return a.replace(/\|(.*)/,"")},getQuantityIndex:function(){var a=d.$(c.SNS_QUANTITY);try{var b=a.prop("selectedIndex");if(0===b)return b;if(0<b)return b-("a-prompt"===a[0].options[0].className?1:0)}catch(e){l.ue&&l.ue.count("snsQuantityIndexException",
(ue.count("snsQuantityIndexException")||0)+1)}},getFrequencyIndex:function(a){var b=e("input[name\x3d'"+(a+"FrequencySelectedIndex")+"']");return b!==t&&null!==b&&0!==b.length?b.val():a===g.DELIVERY_OPTION.SNS?e("[name\x3drcxOrdFreqSns]").prop("selectedIndex"):e("[name\x3drcxOrdFreqOnml]").prop("selectedIndex")},setFrequencyIndexForDeliveryOption:function(){e(c.RCX_ORD_FREQ_ONML_WRAPPER).hasClass("aok-hidden")?f(e("[name\x3drcxOrdFreqSns]").prop("selectedIndex")):f(e("[name\x3drcxOrdFreqOnml]").prop("selectedIndex"))},
getFrequencyValue:k,isSelectedFreqSameAsDefaultFreq:function(){var b=a.getDefaultFrequency(!0),c=a.getDefaultFrequency(!1),b=null!==b?b:c,c=(c=a.getSelectedDeliveryOption()===g.DELIVERY_OPTION.SNS?k(g.DELIVERY_OPTION.SNS):k(g.DELIVERY_OPTION.ONML))?c.split("|")[0]:null;return b===c}}});m.when("ready").register("sns-stringify-util",function(){return JSON&&"function"===typeof JSON.stringify?JSON.stringify:function(){var d={'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t"},
b=/[\\"\u0000-\u001F\u2028\u2029]/g,a=Object.prototype.toString,c=Array.isArray||function(b){return"[object Array]"===a.call(b)},g=function(a){return d[a]||"\\u"+(a.charCodeAt(0)+65536).toString(16).substr(1)};return function f(d){if(null===d)return"null";if("number"===typeof d)return isFinite(d)?d.toString():"null";if("boolean"===typeof d)return d.toString();if("object"===typeof d){if("function"===typeof d.toJSON)return f(d.toJSON());if(c(d)){for(var q="[",h=0;h<d.length;h++)q+=(h?", ":"")+f(d[h]);
return q+"]"}if("[object Object]"===a.call(d)){q=[];for(h in d)d.hasOwnProperty(h)&&q.push(f(h)+": "+f(d[h]));return"{"+q.join(", ")+"}"}}return'"'+d.toString().replace(b,g)+'"'}}()});m.when("A","sns-stringify-util","ready").register("sns-declarative-util",function(d,b){function a(a){return a&&("object"===typeof a||"object"===typeof a.prototype)}function c(){for(var a=0;a<arguments.length;a++)if("string"!==typeof arguments[a])throw"Function parameter must be of type string.";}function g(){for(var a=
Object.prototype.toString,b=Array.isArray||function(b){return"[object Array]"===a.call(b)},e=0;e<arguments.length;e++){var d=arguments[e];if(b(d)&&0<d.length)for(var g=0;g<d.length;g++)c(d[g]);else throw"Function parameter must be a non empty array.";}}function e(c){var e="data-"+c.getAttribute("data-action"),g=function(){var a=c.getAttribute(e),g=a?d.parseJSON(a):{};g.save=function(){var a=g.save;delete g.save;var d=b(g);c.setAttribute(e,d);g.save=a};return g};return{hasExactKeyHeirarchy:function(b,
c){var e=g();b=b.split(".");for(var d=0<b.length,f=0;f<b.length&&d;f++)var k=b[f],d=a(e)&&e.hasOwnProperty(k),e=e[k];d&&c!==t&&(d=e===c);return d},hasParsableJSON:function(){try{return g().save(),!0}catch(a){return!1}},put:function(b){var c=g();a(c.inputs)||(c.inputs={});d.$.each(b,function(a,b){c.inputs[a]=b});c.save()},getData:g}}return{query:function(b){g(b);var k=[],q=[],h=[],n,p,r=function(){return{numberOfMatchingActions:k.length,allMatchKeyValue:function(a,b){c(a);for(var e=0<this.numberOfMatchingActions,
d=0;d<this.numberOfMatchingActions&&e;d++)e=(e=k[d])&&e.hasExactKeyHeirarchy(a,b);return e},putAll:function(a){for(var b=0;b<this.numberOfMatchingActions;b++)k[b].put(a)},getStrings:function(){for(var a=0;a<this.numberOfMatchingActions;a++){var b=k[a];if(b.getData().strings)return b.getData().strings}return[]},getData:function(){for(var a=0;a<this.numberOfMatchingActions;a++){var b=k[a];if(b.getData())return b.getData()}return[]}}},l=function(){for(var c=d.$("#buybox").find(".a-declarative").get(),
g=0<q.length,n=0;n<c.length;n++){var p=c[n],l;a:{l=p;for(var m=b,t=0;t<m.length;t++){var y;var v=l;y=m[t];a(v)&&"string"===typeof y?(v=v.getAttribute("data-action")||"",y=0===y.localeCompare(v)):y=!1;if(y){l=!0;break a}}l=!1}if(l&&(p=e(p),p.hasParsableJSON()))if(g){l=!0;for(m=0;m<q.length&&l;m++)l=p.hasExactKeyHeirarchy(q[m],h[m]);l&&k.push(p)}else k.push(p)}return r()};n=function(a){c(a);q.push(a);return{equals:p,equalsAny:function(){return p(t)}}};p=function(a){h.push(a);return{where:n,execute:l}};
return{where:n,execute:l}}}});m.when("A","sns-utils","sns-buybox-constants","sns-declarative-util").register("sns-atc-utils",function(d,b,a,c){var g=d.$,e=["aw-mash","add-to-cart","one-click","show-services-interstitial"],f=function(a){c.query(e).where("buttonID").equals("add-to-cart").execute().putAll(a);c.query(e).where("buttonID").equals("buy-now").execute().putAll(a);c.query(e).where("buttonID").equals("buy-now-one-click").execute().putAll(a)};return{initializeOnmlDeclaratives:function(){if(b.isSnSEligible()){var c=
b.getAStateFromDom(a.SNS_OPT_IN_FEATURE_DIV,"sns-add-to-cart-params","addToCartParams");f(c||{});g("\x3cinput type\x3dhidden value\x3dtrue \x3e").prop("id",a.SNS_ONML_INIT_INPUT_ID).appendTo(a.SNS_OPT_IN_FEATURE_DIV)}},setOnmlDeclaratives:f,getAddToCartStrings:function(){return c.query(e).where("buttonID").equals("add-to-cart").execute().getStrings()},getAddToCartData:function(){return c.query(e).where("buttonID").equals("add-to-cart").execute().getData()}}});m.when("A","sns-utils","sns-constants",
"sns-atc-utils").register("sns-atc",function(d,b,a,c){return{init:function(){b.registerCallbackForNameSpace(a.EVENT_NAMESPACE.PAGE_UPDATE,c.initializeOnmlDeclaratives);c.initializeOnmlDeclaratives()}}});m.when("A","sns-buybox-constants","sns-onmlv2-utils","sns-moq-helper").register("sns-onmlv2-atc",function(d,b,a,c){function g(d){if(c.isSnsLocked())a.emitMetric("sns-onmlv2-atc-sns-locked-moq");else{var g=e("\x3cform\x3e",{method:b.SUBSCRIBE_ADD_TO_CART_FORM_ATTRIBUTES.method,action:b.SUBSCRIBE_ADD_TO_CART_FORM_ATTRIBUTES.action,
id:b.SUBSCRIBE_ADD_TO_CART_FORM_ATTRIBUTES.id,name:b.SUBSCRIBE_ADD_TO_CART_FORM_ATTRIBUTES.name}),q="";if(a.isCbbTemplateEnabled()){a.emitMetric("sns-onmlv2-atc-cbb-template-enabled");for(var h=[{name:"ASIN"},{name:"offerListingID",fieldName:"snsOfferListingID"},{name:"snsAddressId"},{name:"snsOnmlOfferId"},{name:"snsMostCommonFrequency"},{name:"rcxOrdFreq"},{name:"quantity"}],n=0;n<h.length;n++)var p=h[n].name,r=h[n].fieldName?h[n].fieldName:p,r=a.getOnmlv2FormValueByName(r),q=q+a.createHiddenInput(p,
r)}else{a.emitMetric("sns-onmlv2-atc-cbb-template-not-enabled");a.removeFormFieldsIntroducedByCbb();h=[{name:"ASIN"},{name:"offerListingID",fieldName:"snsOfferListingID"},{name:"rcxOrdFreq"},{name:"snsOnmlOfferId"},{name:"snsMostCommonFrequency"},{name:"snsAddressId"}];for(n=0;n<h.length;n++)p=h[n].name,r=h[n].fieldName?h[n].fieldName:p,r=a.isMobileDevice()?e(b.MOBILE_ADD_TO_CART_DIV+" [name\x3d"+r+"]").val():a.isWeb()?e(b.ADD_TO_CART_DIV+" [name\x3d"+r+"]").val():e(b.TABLET_ADD_TO_CART_DIV+" [name\x3d"+
r+"]").val(),q+=a.createHiddenInput(p,r);h=a.isMobileDevice()?e(b.SNS_MOBILE_QUANTITY):e(b.QUANTITY_CONTAINER).find(b.SNS_QUANTITY);q+=a.createHiddenInput("quantity",h.val())}q+=a.createHiddenInput("ref",d);q+=a.createHiddenInput("submit.add-to-cart","1");g.html(q);e("body").append(g);e(b.SNS_ADD_TO_CART_FORM).submit();e(b.SNS_ADD_TO_CART_FORM).remove()}}var e=d.$;d.declarative("sns-add-to-cart","click",function(b){a.emitMetric("sns-onmlv2-atc-sns-add-to-cart");g("onmlv2_atc")});return{createAndSubmitAddToCartForm:g}});
m.when("A","sns-utils","sns-constants","sns-buybox-constants","sns-atc-utils").register("sns-buybox-utils",function(d,b,a,c){var g=function(a){if(0<a.length)return a.innerWidth()<a[0].scrollWidth},e=function(c,e,g){e=c+"_"+(g?"checkedLabel":"uncheckedLabel")+"_"+("oneClick"===c?e:"all");c=b.getOnmlParam(e);e=(g=b.getOnmlUserPref(a.USER_PREFS_KEYS.ONML_PARAMS))&&g[e];if(c=c||e)return d.$("\x3cp\x3e"+c+"\x3c/p\x3e").text()};return{updateOneClickButtonLabel:function(a){if(b.isVerucaOneClickEnabled()){a=
"boolean"===typeof a?a:d.$(c.SNS_OPT_IN_CHECKBOX).is(":checked");var k=d.$(c.ONE_CLICK_BUTTON),q=d.$(c.ONE_CLICK_BUTTON_ICON),h=d.$(c.ONE_CLICK_BUTTON_TEXT),n=b.getDeviceType(),p=e("oneClick",n,!0),n=e("oneClick",n,!1);p&&n&&(a?(h.text(p),g(h)&&(q.addClass("aok-hidden"),k.removeClass("a-button-icon"))):(h.text(n),q.length&&(k.addClass("a-button-icon"),q.removeClass("aok-hidden"))))}},updateBuyNowButtonLabel:function(a){if(b.isVerucaBuyNowEnabled()){a="boolean"===typeof a?a:d.$(c.SNS_OPT_IN_CHECKBOX).is(":checked");
var k=d.$(c.BUY_NOW_BUTTON),q=d.$(c.BUY_NOW_BUTTON_ICON),h=d.$(c.BUY_NOW_BUTTON_TEXT),n=b.getDeviceType(),p=e("buyNow",n,!0),n=e("buyNow",n,!1);p&&n&&(a?(h.text(p),g(h)&&(q.addClass("aok-hidden"),k.removeClass("a-button-icon"))):(h.text(n),q.length&&(k.addClass("a-button-icon"),q.removeClass("aok-hidden"))))}},updateAddToCartButtonLabel:function(a){a="boolean"===typeof a?a:d.$(c.SNS_OPT_IN_CHECKBOX).is(":checked");var k=d.$(c.ADD_TO_CART_BUTTON).closest(".a-button"),q=k.find(".a-button-inner"),h=
k.find("i.a-icon"),n=k.find("span.a-button-text"),p=b.getDeviceType(),r=e("addToCart",p,!0),p=e("addToCart",p,!1);r&&p&&(a?(n.text(r),q.addClass("sns-onml-sky-button-inner"),n.addClass("sns-onml-sky-button-text"),g(n)&&(h.addClass("aok-hidden"),k.removeClass("a-button-icon"))):(n.text(p),q.removeClass("sns-onml-sky-button-inner"),n.removeClass("sns-onml-sky-button-text"),h.length&&(k.addClass("a-button-icon"),h.removeClass("aok-hidden"))))},showSnSMerchantInfoIfSnSOptInChecked:function(a){var b=d.$(c.SNS_ONML_MERCHANT_INFO);
a="boolean"===typeof a?a:d.$(c.SNS_OPT_IN_CHECKBOX).is(":checked");b.toggleClass("aok-hidden",!a)},showGoldBoxDiscountMessageIfSnSOptInChecked:function(a){var b=d.$(c.GOLDBOX_DISCOUNT_MESSAGE);a="boolean"===typeof a?a:d.$(c.SNS_OPT_IN_CHECKBOX).is(":checked");b.toggleClass("aok-hidden",!a)},showSubscribeOnlyButtonIfSnSOptInChecked:function(a){var b=d.$(c.JUST_SUBSCRIBE_DIV);a="boolean"===typeof a?a:d.$(c.SNS_OPT_IN_CHECKBOX).is(":checked");b.toggleClass("aok-hidden",!a)},logError:function(a,b){l.ueLogError&&
l.ueLogError(a,{logLevel:"ERROR",attribution:b,message:a})}}});m.when("A","sns-buybox-constants","sns-onmlv2-utils","ready").execute("sns-onmlv2-join-prime",function(d,b,a){var c=d.$,g=function(){c(b.SNS_ONMLV2_JOIN_PRIME_CHECKBOX).length&&(c(b.SNS_ONMLV2_JOIN_PRIME_UPSELL).removeClass("aok-hidden"),c(b.SNS_ONMLV2_JOIN_PRIME_CHECKBOX).is(":checked")?(c(b.SNS_ONMLV2_JOIN_PRIME_BUTTON).removeClass("aok-hidden"),c(b.SNS_SUBSCRIBE_SUBMIT_BUTTON).addClass("aok-hidden")):(c(b.SNS_ONMLV2_JOIN_PRIME_BUTTON).addClass("aok-hidden"),
c(b.SNS_SUBSCRIBE_SUBMIT_BUTTON).removeClass("aok-hidden")))};g();c(document).delegate(b.SNS_ONMLV2_JOIN_PRIME_CHECKBOX,"change",function(a){g()});d.declarative("sns-join-prime","click",function(e){e=d.state("momJoinPrimeEndpointState");e=c("\x3cform\x3e",{method:b.SNS_JOIN_PRIME_FORM_ATTRIBUTES.method,action:e&&e.endpoint?e.endpoint:"/gp/prime/pipeline/membersignup/",id:b.SNS_JOIN_PRIME_FORM_ATTRIBUTES.id,name:b.SNS_JOIN_PRIME_FORM_ATTRIBUTES.name});for(var f="",g=[{name:"session-id"},{name:"momAsin"},
{name:"ref"}],q=0;q<g.length;q++)var h=g[q].name,n=a.getSubscribeButtonFormValueByName(h),f=f+a.createHiddenInput(h,n);e.html(f);c("body").append(e);c(b.SNS_JOIN_PRIME_FORM).submit();c(b.SNS_JOIN_PRIME_FORM).remove()})});m.when("A","ready").execute("sns-load-static-images",function(d){var b=d.$;b("#learnMoreBottomSheet .a-manually-loaded").each(function(){d.loadImageManually(b(this))})});m.when("A","sns-buybox-constants","sns-onmlv2-utils").execute("sns-legacy-subscribe",function(d,b,a){var c=d.$;
d.declarative("sns-legacy-subscribe","click",function(d){d=c("\x3cform\x3e",{method:b.SNS_LEGACY_SUBSCRIBE_FORM_ATTRIBUTES.method,action:b.SNS_LEGACY_SUBSCRIBE_FORM_ATTRIBUTES.action,id:b.SNS_LEGACY_SUBSCRIBE_FORM_ATTRIBUTES.id,name:b.SNS_LEGACY_SUBSCRIBE_FORM_ATTRIBUTES.name});for(var e="",f=[{name:"ASIN"},{name:"offerListingID"},{name:"merchantID"},{name:"snsOfferListingID"},{name:"snsMerchantID"},{name:"rcxOrdFreq"},{name:"quantity"}],k=0;k<f.length;k++)var q=f[k].name,h=a.getSubscribeButtonFormValueByName(q),
e=e+a.createHiddenInput(q,h);e+=a.createHiddenInput("ref","sns-legacy-subscribe");e+=a.createHiddenInput("submit.rcx-subscribe","1");d.html(e);c("body").append(d);c(b.SNS_LEGACY_SUBSCRIBE_FORM).submit();c(b.SNS_LEGACY_SUBSCRIBE_FORM).remove()})});m.when("A","sns-subscribe-button-trigger-handler","sns-subscribe-button-utils","sns-constants").execute("sns-subscribe-button",function(d,b,a,c){d.declarative("sns-submit-btn-declarative","click",function(d){a.emitMetric("sns-subscribe-button-sns-submit-btn-declarative-called");
b.triggerInterstitialWeblabIfEligible(c.WEBLAB_TREATMENT.C);a.createAndSubmitSubscribeNowForm("sns-subscribe-btn-dp-vmf-")});d.declarative("sns-subscribe-poi-declarative","click",function(b){a.emitMetric("sns-subscribe-button-sns-subscribe-poi-declarative-called");a.createAndSubmitSubscribeNowForm(b.data.refTag)});d.declarative("sns-mom-submit-btn-declarative","click",function(b){a.emitMetric("sns-subscribe-button-sns-mom-submit-btn-declarative-called");a.createAndSubmitSubscribeNowForm("sns-mom-btn-dp-vmf-")})});
m.when("A","sns-onmlv2-utils","sns-metrics-constants","ready").register("sns-subscribe-button-trigger-handler",function(d,b,a){var c=!1;return{triggerInterstitialWeblabIfEligible:function(g){var e;try{e=d.state("subscribe-now-interstitial-experience-enabled")}catch(f){b.logErrorWithAttribution("sns-subscribe-button-trigger-handler","Exception "+f+" caught while getting subscribe-now-interstitial-experience-enabled page state")}if(null==e)b.emitMetric(a.SNS_SUBSCRIBE_NOW_INTERSTITIAL_ELIGIBLE_STATE_EXCEPTION_METRICS);
else if(!0===e.value)return c||(b.recordWeblabTriggers("A2I_SNS_DP_SUBSCRIBE_NOW_INTERSTITIAL_830984",g),b.emitMetric("A2I_SNS_DP_SUBSCRIBE_NOW_INTERSTITIAL_830984"+a.METRIC_DELIMITER+g+a.METRIC_DELIMITER+"WeblabTriggered"),c=!0),!0;return!1}}});m.when("A","sns-buybox-constants","sns-onmlv2-utils","sns-moq-helper","sns-metrics-constants","sns-vmf-utils","sns-constants").register("sns-subscribe-button-utils",function(d,b,a,c,g,e,f){var k=d.$;return{emitMetric:function(a){l.ue&&l.ue.count(a,(ue.count(a)||
0)+1)},createAndSubmitSubscribeNowForm:function(l){if(!c.isSnsLocked()){var h,n;k("#chkMom").length&&k("#chkMom").is(":checked")?(h=k("\x3cform\x3e",{method:b.SNS_JOIN_PRIME_FORM_ATTRIBUTES_VMF.method,action:b.SNS_JOIN_PRIME_FORM_ATTRIBUTES_VMF.action,id:b.SNS_JOIN_PRIME_FORM_ATTRIBUTES_VMF.id,name:b.SNS_JOIN_PRIME_FORM_ATTRIBUTES_VMF.name}),n=b.SNS_JOIN_PRIME_FORM_ATTRIBUTES_VMF.id):(h=k("\x3cform\x3e",{method:b.SUBSCRIBE_FORM_ATTRIBUTES.method,action:b.SUBSCRIBE_FORM_ATTRIBUTES.action,id:b.SUBSCRIBE_FORM_ATTRIBUTES.id,
name:b.SUBSCRIBE_FORM_ATTRIBUTES.name}),n=b.SUBSCRIBE_FORM_ATTRIBUTES.id);for(var p="",r=b.SUBSCRIBE_FORM_FIELDS,m=0;m<r.length;m++){var w=r[m].name,u=r[m].fieldName?r[m].fieldName:w;"rcxOrdFreqSns"===u?(u=e.getFrequencyValue(f.DELIVERY_OPTION.SNS),a.emitMetric(g.SNS_CREATE_SUBSCRIPTION_WITH_FREQUENCY+u)):"rcxOrdFreqOnml"===u?(u=e.getFrequencyValue(f.DELIVERY_OPTION.ONML),a.emitMetric(g.SNS_CREATE_SUBSCRIPTION_WITH_FREQUENCY+u)):u=k("[name\x3d'"+u+"']").val();p+=a.createHiddenInput(w,u)}r=d.$(b.SNS_MOBILE_QUANTITY);
if(r===t||r.val()===t)if(r=k("[name\x3d'rcxsubsQuan']"),r===t||r.val()===t)r=k("[id\x3d'rcxsubsQuan']");m=0!==k(b.REPLENISHMENT_ONML_FREQUENCY_POPOVER_ID).length?!k(b.REPLENISHMENT_ONML_FREQUENCY_POPOVER_ID).hasClass("aok-hidden"):0!==k(b.REPLENISHMENT_ONML_FREQUENCY_INFO_POPOVER_ID).length?!k(b.REPLENISHMENT_ONML_FREQUENCY_INFO_POPOVER_ID).hasClass("aok-hidden"):!k("#rcxOrdFreqOnmlWrapper").hasClass("aok-hidden");m||(w=a.getDeliveryInfoParam().snsDates[e.getFrequencyIndex(f.DELIVERY_OPTION.SNS)],
p+=a.createHiddenInput("snsDate",w));p+=a.createHiddenInput("onmlSelected",m);p+=a.createHiddenInput("vmfEnabled","true");p+=a.createHiddenInput("quantity",r.val());p+=a.createHiddenInput("ref",l+(m?"onml":"sns"));p+=a.createHiddenInput("submit.subscribe","1");h.html(p);k("body").append(h);a.emitInvalidFrequencyMetric(g.SNS_ONML_INVALID_FREQUENCY_SELECT_METRICS,g.SNS_LEGACY_INVALID_FREQUENCY_SELECT_METRICS);k("#"+n).submit();k("#"+n).remove()}}}});"use strict";m.when("A").register("sns-upsell-message-trigger-handler",
function(d){function b(){var a=d.$(".a-accordion-active").data("a-accordion-row-name");return"snsAccordionRowMiddle"===a||"snsAccordionRowMobileMiddle"===a||"snsAccordionRowMobileAppMiddle"===a}var a=!1,c=function(a,b){l.ue&&"function"===typeof l.ue.trigger&&l.ue.trigger(a,b)},g=function(a){l.ue&&l.ue.count(a,(ue.count(a)||0)+1)};return{handleAnnualSavingsExperimentTriggering:function(e,f){try{a||null===e||0===e.length||(b()?(c("CONSUMABLES_SNS_DP_ANNUAL_SAVINGS_EXPERIMENT_ITERATION_1127144",f),a=
!0,g("snsAnnualSavingsReIterationWeblabTriggeringSuccess")):g("snsAccordionNotActiveForAnnualSavingsExperiment"))}catch(k){g("snsAnnualSavingsReIterationWeblabTriggeringFailure")}d.on("a:accordion:buybox-accordion:select",function(b){try{if(!a&&null!==e&&0!==e.length){var d=b.selectedRow.rowName;"snsAccordionRowMiddle"===d||"snsAccordionRowMobileMiddle"===d||"snsAccordionRowMobileAppMiddle"===d?(c("CONSUMABLES_SNS_DP_ANNUAL_SAVINGS_EXPERIMENT_ITERATION_1127144",f),a=!0,g("snsAnnualSavingsReIterationWeblabTriggeringSuccess")):
g("snsAccordionNotSelectedForAnnualSavingsExperiment")}}catch(h){g("snsAnnualSavingsReIterationWeblabTriggeringFailure")}})}}});m.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"},WEBLAB_TREATMENT:{C:"C",
T1:"T1",T2:"T2"},DEVICE_TYPE:{DESKTOP:"desktop",MOBILE:"mobile",MOBILE_APP:"mobile_app"},ACCORDION_ROW_NAME_SELECTOR:"a-accordion-row-name",ACTIVE_ACCORDION_SELECTOR:".a-accordion-active",SNS_ACCORDION_ROW_NAME_DESKTOP:"snsAccordionRowMiddle",SNS_ACCORDION_ROW_NAME_MOBILE:"snsAccordionRowMobileMiddle",SNS_ACCORDION_ROW_NAME_MOBILE_APP:"snsAccordionRowMobileAppMiddle"}});m.when("A","sns-utils","sns-constants","sns-buybox-constants").register("sns-event-handler",function(d,b,a,c){return{init:function(){function g(a){for(var b=
d.$("\x3cform\x3e",{method:c.SUBSCRIBE_ONLY_FORM_ATTRIBUTES.method,action:c.SUBSCRIBE_ONLY_FORM_ATTRIBUTES.action,id:c.SUBSCRIBE_ONLY_FORM_ATTRIBUTES.id,name:c.SUBSCRIBE_ONLY_FORM_ATTRIBUTES.name}),g=[{name:"ASIN"},{name:"offerListingID"},{name:"merchantID"},{name:"rcxOrdFreq"},{name:"snsOfferListingID"},{name:"snsMerchantID"}],l="",h=0;h<g.length;h++)var n=g[h].name,p=d.$("[name\x3d"+n+"]").val(),l=l+('\x3cinput type\x3d"hidden" name\x3d"'+n+'" value\x3d"'+p+'"\x3e');l=l+('\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=d.$(c.QUANTITY_CONTAINER).find(c.QUANTITY);l+='\x3cinput type\x3d"hidden" name\x3d"quantity" value\x3d"'+a.val()+'"\x3e';b.html(l);d.$("body").append(b);d.$(c.SUBSCRIBE_ONLY_FORM).submit()}b.isSnSEligible()&&b.setOnmlUserPref(a.USER_PREFS_KEYS.ONML_PARAMS,b.getOnmlParam());b.registerCallbackForNameSpace(a.EVENT_NAMESPACE.PAGE_UPDATE,function(){var e=b.getOnmlUserPref(a.USER_PREFS_KEYS.ONML_PARAMS)||{},f=e.asin,
g=b.getOnmlParam("asin");e.asin=g;b.setOnmlUserPref(a.USER_PREFS_KEYS.ONML_PARAMS,e);e=f!==g;f=b.getOnmlUserPref(a.USER_PREFS_KEYS.SNS_OPT_IN);"undefined"!==typeof f&&d.$(c.SNS_OPT_IN_CHECKBOX).is(":checked")!==f&&(b.enableSnSOptIn(),d.$(c.SNS_OPT_IN_CHECKBOX).click());(f=b.getOnmlUserPref(a.USER_PREFS_KEYS.SNS_FREQUENCY))&&!e?b.isMobileDevice()?d.$(c.SNS_FREQ_BOTTOMSHEET_SELECTOR).find("button[value\x3d"+f+"]").click():d.$("[data-a-accordion-row-name\x3dfrequencyAccordionRow"+(f-1)+"] a").click():
b.deleteOnmlUserPref(a.USER_PREFS_KEYS.SNS_FREQUENCY)});d.$(c.SNS_FREQUENCY_FORM_FIELD).change(function(){b.executeCallbacksForNameSpace(a.EVENT_NAMESPACE.FREQUENCY_HIDDEN_INPUT_CHANGE)});d.on("a:pageUpdate",function(){b.executeCallbacksForNameSpace(a.EVENT_NAMESPACE.PAGE_UPDATE)});d.declarative("subscribe-only","click",function(a){g("onml_so_l")});d.declarative("just-subscribe","click",function(a){g("onml_justsub_l")})}}});m.register("sns-metrics-constants",function(){return{METRIC_DELIMITER:".",
B2B_BUY_BOX_MESSAGE_UPDATE_SUCCESSFUL:"b2bBuyBoxMessageUpdateSuccessful",B2B_BUY_BOX_MESSAGE_UPDATE_FAILED:"b2bBuyBoxMessageUpdateFailed",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_ONML_INVALID_FREQUENCY_SELECT_METRICS:"snsOnmlInvalidFrequencySelectMetrics",B2B_ONML_WEEKLY_FREQUENCY_SELECT_METRICS:"b2bOnmlWeeklyFrequencySelectMetrics",B2B_ONML_MONTHLY_FREQUENCY_SELECT_METRICS:"b2bOnmlMonthlyFrequencySelectMetrics",
SNS_LEGACY_WEEKLY_FREQUENCY_SELECT_METRICS:"snsLegacyWeeklyFrequencySelectMetrics",SNS_LEGACY_MONTHLY_FREQUENCY_SELECT_METRICS:"snsLegacyMonthlyFrequencySelectMetrics",SNS_LEGACY_INVALID_FREQUENCY_SELECT_METRICS:"snsLegacyInvalidFrequencySelectMetrics",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",SNS_SUBSCRIBE_NOW_INTERSTITIAL_BOTTOMSHEET_SWITCH_OFFER_METRICS:"snsSubscribeNowInterstitialBottomsheetSwitchOfferCount",
SNS_SUBSCRIBE_NOW_INTERSTITIAL_BOTTOMSHEET_SHOW_METRICS:"snsSubscribeNowInterstitialBottomsheetShowCount",SNS_SUBSCRIBE_NOW_INTERSTITIAL_BOTTOMSHEET_SUBSCRIBE_BUTTON_CLICK_METRIC:"snsSubscribeNowInterstitialBottomsheetSubscribeButtonClick",SNS_SUBSCRIBE_NOW_INTERSTITIAL_BOTTOMSHEET_CLOSE_METRICS:"snsSubscribeNowInterstitialBottomsheetCloseCount",SNS_SUBSCRIBE_NOW_INTERSTITIAL_ELIGIBLE_STATE_EXCEPTION_METRICS:"snsSubscribeNowInterstitialEligibleStateExceptionCount",SNS_ONMLV2_SUBSCRIBE_NOW_WITH_SAME_FREQ_AS_DEFAULT_FREQ:"snsOnmlv2SubscribeNowWithSameFreq",
SNS_ONMLV2_SUBSCRIBE_NOW_WITH_DIFFERENT_FREQUENCY_OTHER_THAN_DEFAULT_FREQ:"snsOnmlv2SubscribeNowWithDifferentFreq",SNS_INVALID_FREQUENCY_ACCORDION_ROW:"snsInvalidFrequencyAccordionRow",SNS_ONML_FREQUENCY_POPOVER_SELECTED:"snsOnmlFrequencyPopoverSelected",SNS_FREQUENCY_POPOVER_SELECTED:"snsFrequencyPopoverSelected",SNS_ONML_FREQUENCY_LABEL_INGRESS_CLICKED:"snsOnmlFrequencyLabelIngressClicked",SNS_FREQUENCY_LABEL_INGRESS_CLICKED:"snsFrequencyLabelIngressClicked",SNS_ONML_FREQUENCY_INFO_LABEL_INGRESS_CLICKED:"snsOnmlFrequencyInfoLabelIngressClicked",
SNS_FREQUENCY_INFO_LABEL_INGRESS_CLICKED:"snsFrequencyInfoLabelIngressClicked",SNS_INVALID_FREQUENCY_POPOVER_INPUTS:"snsInvalidFrequencyPopoverInputs",SNS_INVALID_FREQUENCY_POPOVER_DATA_STRUCTURE:"snsInvalidFrequencyPopoverDataStructure",SNS_CREATE_SUBSCRIPTION_WITH_FREQUENCY:"snsCreateSubscriptionWithFrequency-"}});m.when("A","sns-utils","sns-metrics-constants","sns-buybox-constants").register("sns-metrics-helper",function(d,b,a,c){return{init:function(){d.declarative("sns-opt-in-checked","change",
function(){var g=d.$(c.SNS_OPT_IN_CHECKBOX).is(":checked");l.ue&&(g?b.isSnsCustomer()?l.ue.count(a.SNS_ONML_EXISTING_SNS_CUSTOMER_CHECK_METRICS,(ue.count(a.SNS_ONML_EXISTING_SNS_CUSTOMER_CHECK_METRICS)||0)+1):l.ue.count(a.SNS_ONML_NEW_SNS_CUSTOMER_CHECK_METRICS,(ue.count(a.SNS_ONML_NEW_SNS_CUSTOMER_CHECK_METRICS)||0)+1):b.isSnsCustomer()?l.ue.count(a.SNS_ONML_EXISTING_SNS_CUSTOMER_UNCHECK_METRICS,(ue.count(a.SNS_ONML_EXISTING_SNS_CUSTOMER_UNCHECK_METRICS)||0)+1):l.ue.count(a.SNS_ONML_NEW_SNS_CUSTOMER_UNCHECK_METRICS,
(ue.count(a.SNS_ONML_NEW_SNS_CUSTOMER_UNCHECK_METRICS)||0)+1))});d.$(document).delegate(".sns-buybox-upsell-trigger","click",function(b){l.ue&&l.ue.count(a.SNS_ONML_UPSELL_MESSAGE_METRICS,(ue.count(a.SNS_ONML_UPSELL_MESSAGE_METRICS)||0)+1)});d.$(document).delegate("#sns-dp-frequency-trigger","click",function(b){l.ue&&l.ue.count(a.SNS_ONML_FREQUENCY_LABEL_CLICK_METRICS,(ue.count(a.SNS_ONML_FREQUENCY_LABEL_CLICK_METRICS)||0)+1)});d.$(document).delegate("#snsSelectedFrequencyLabel","click",function(b){l.ue&&
l.ue.count(a.SNS_ONML_FREQUENCY_LABEL_CLICK_METRICS,(ue.count(a.SNS_ONML_FREQUENCY_LABEL_CLICK_METRICS)||0)+1)});d.on("a:accordion:sns-dp-frequency-accordion:select",function(){l.ue&&l.ue.count(a.SNS_ONML_FREQUENCY_CHANGE_METRICS,(ue.count(a.SNS_ONML_FREQUENCY_CHANGE_METRICS)||0)+1)});d.$(document).delegate("#snsFrequencyBottomSheet button","click",function(b){l.ue&&l.ue.count(a.SNS_ONML_FREQUENCY_CHANGE_METRICS,(ue.count(a.SNS_ONML_FREQUENCY_CHANGE_METRICS)||0)+1)});d.$(document).delegate("#subscribe-only",
"click",function(b){l.ue&&l.ue.count(a.SNS_ONML_SUBSCRIBE_ONLY_METRICS,(ue.count(a.SNS_ONML_SUBSCRIBE_ONLY_METRICS)||0)+1)});d.$(document).delegate("#replenishment-onml-frequency-popover","click",function(b){l.ue&&l.ue.count(a.SNS_ONML_FREQUENCY_LABEL_INGRESS_CLICKED,(ue.count(a.SNS_ONML_FREQUENCY_LABEL_INGRESS_CLICKED)||0)+1)});d.$(document).delegate("#replenishment-sns-frequency-popover","click",function(b){l.ue&&l.ue.count(a.SNS_FREQUENCY_LABEL_INGRESS_CLICKED,(ue.count(a.SNS_FREQUENCY_LABEL_INGRESS_CLICKED)||
0)+1)});d.$(document).delegate("#replenishment-onml-frequency-info-popover","click",function(b){l.ue&&l.ue.count(a.SNS_ONML_FREQUENCY_INFO_LABEL_INGRESS_CLICKED,(ue.count(a.SNS_ONML_FREQUENCY_INFO_LABEL_INGRESS_CLICKED)||0)+1)});d.$(document).delegate("#replenishment-sns-frequency-info-popover","click",function(b){l.ue&&l.ue.count(a.SNS_FREQUENCY_INFO_LABEL_INGRESS_CLICKED,(ue.count(a.SNS_FREQUENCY_INFO_LABEL_INGRESS_CLICKED)||0)+1)})}}});m.when("A","sns-onmlv2-utils","sns-metrics-constants","sns-buybox-constants",
"sns-constants","sns-onmlv2-cache","sns-vmf-utils").register("sns-onmlv2-metrics-helper",function(d,b,a,c,g,e,f){var k=d.$,q="",h="";a.SNS_ONMLV2_POPOVER_TRIGGERS.forEach(function(a){q+=" a:popover:beforeShow:"+a});a.SNS_ONMLV2_BOTTOMSHEET_TRIGGERS.forEach(function(a){h+=" a:sheet:beforeShow:"+a});d.declarative("sns-delivery-date","click",function(a){e.incrementDeliveryOptionClickCounter()});d.declarative("sns-delivery-date-bottom-sheet","click",function(a){e.incrementDeliveryOptionClickCounterMobile()});
d.declarative("sns-delivery-change-btn","click",function(a){k(c.SNS_DELIVERY_OPTION_DIV).is(":checked")?e.incrementDeliveryOptionSwitchToSnsCounter():k(c.ONML_DELIVERY_OPTION_DIV).is(":checked")&&e.incrementDeliveryOptionSwitchToOnmlCounter()});d.on("a:popover:beforeHide:sns-delivery-modal",function(b){p(a.SNS_ONMLV2_DELIVERY_OPTION_CLICK_METRICS,e.getDeliveryOptionClickCounter());p(a.SNS_ONMLV2_SWITCH_TO_SNS_METRICS,e.getDeliveryOptionSwitchToSnsCounter());p(a.SNS_ONMLV2_SWITCH_TO_ONML_METRICS,e.getDeliveryOptionSwitchToOnmlCounter());
p(a.SNS_QUANTITY_SELECT_DESKTOP,e.getQuantityClickCounterDesktop())});d.on("a:sheet:beforeHide:sns_delivery_bottom_sheet",function(){p(a.SNS_ONMLV2_DELIVERY_OPTION_CLICK_MOBILE_METRICS,e.getDeliveryOptionClickCounterMobile());k(c.SNS_DELIVERY_OPTION_DIV).is(":checked")?e.incrementDeliveryOptionSwitchToSnsCounterMobile():k(c.ONML_DELIVERY_OPTION_DIV).is(":checked")&&e.incrementDeliveryOptionSwitchToOnmlCounterMobile();p(a.SNS_ONMLV2_SWITCH_TO_SNS_MOBILE_METRICS,e.getDeliveryOptionSwitchToSnsCounterMobile());
p(a.SNS_ONMLV2_SWITCH_TO_ONML_MOBILE_METRICS,e.getDeliveryOptionSwitchToOnmlCounterMobile());p(a.SNS_QUANTITY_SELECT_MOBILE,e.getQuantityClickCounterMobile())});d.on(q,function(){n(a.SNS_ONMLV2_DESKTOP_POPOVER_SHOW_METRICS)});d.on(h,function(){n(a.SNS_ONMLV2_MOBILE_BOTTOMSHEET_SHOW_METRICS)});d.$(document).delegate("#sns-submit-declarative","click",function(c){c=e.getDeliveryOption();var d=b.isMobileDevice();c===g.DELIVERY_OPTION.SNS?d?n(a.SNS_ONMLV2_SUBSCRIBE_NOW_WITH_SNS_DELIVERY_MOBILE_METRICS):
n(a.SNS_ONMLV2_SUBSCRIBE_NOW_WITH_SNS_DELIVERY_METRICS):c===g.DELIVERY_OPTION.ONML&&(d?n(a.SNS_ONMLV2_SUBSCRIBE_NOW_WITH_ONML_DELIVERY_MOBILE_METRICS):n(a.SNS_ONMLV2_SUBSCRIBE_NOW_WITH_ONML_DELIVERY_METRICS))});d.$(document).delegate("#sns-submit-btn-declarative","click",function(c){c=b.getSelectedDeliveryOption();c=b.isDeliveryChangeCheckboxVisible()?"defaultedWith"+a.METRIC_DELIMITER+b.getDefaultDeliveryOption()+a.METRIC_DELIMITER+"signUpWith"+a.METRIC_DELIMITER+c+a.METRIC_DELIMITER+"CheckBoxExperience":
"defaultedWith"+a.METRIC_DELIMITER+b.getDefaultDeliveryOption()+a.METRIC_DELIMITER+"signUpWith"+a.METRIC_DELIMITER+c+a.METRIC_DELIMITER+"EnhancedDeliveryChangeLinkExperience";b.emitMetric(c);f.isSelectedFreqSameAsDefaultFreq()?b.emitMetric(a.SNS_ONMLV2_SUBSCRIBE_NOW_WITH_SAME_FREQ_AS_DEFAULT_FREQ):b.emitMetric(a.SNS_ONMLV2_SUBSCRIBE_NOW_WITH_DIFFERENT_FREQUENCY_OTHER_THAN_DEFAULT_FREQ)});d.$(document).delegate(c.SNS_ONMLV2_QUANTITY_TRIGGER_DESKTOP,"change",function(b){e.incrementQuantityClickCounterDesktop();
p(a.SNS_QUANTITY_SELECT_DESKTOP,e.getQuantityClickCounterDesktop())});d.$(document).delegate(c.SNS_ONMLV2_QUANTITY_TRIGGER_MOBILE,"change",function(b){e.incrementQuantityClickCounterMobile();p(a.SNS_QUANTITY_SELECT_MOBILE,e.getQuantityClickCounterMobile())});var n=function(a){l.ue&&l.ue.count(a,(ue.count(a)||0)+1)},p=function(a,b){l.ue&&l.ue.count(a,b)}});m.when("A","sns-onmlv2-utils","sns-buybox-constants").register("sns-onmlv2-cache",function(d,b,a){var c=d.$,g=0,e=0,f=0,k=0,l=0,h=0,n=0,p=0;return{getDeliveryOptionClickCounter:function(){return g},
incrementDeliveryOptionClickCounter:function(){g++},getDeliveryOptionClickCounterMobile:function(){return e},incrementDeliveryOptionClickCounterMobile:function(){e++},getDeliveryOptionSwitchToSnsCounter:function(){return f},incrementDeliveryOptionSwitchToSnsCounter:function(){f++},getDeliveryOptionSwitchToSnsCounterMobile:function(){return k},incrementDeliveryOptionSwitchToSnsCounterMobile:function(){k++},getDeliveryOptionSwitchToOnmlCounterMobile:function(){return h},incrementDeliveryOptionSwitchToOnmlCounterMobile:function(){h++},
getDeliveryOptionSwitchToOnmlCounter:function(){return l},incrementDeliveryOptionSwitchToOnmlCounter:function(){l++},getDeliveryOption:function(){return c(a.SNS_ONMLV2_DELIVERY_OPTION_FORM_FIELD).val()},getQuantityClickCounterDesktop:function(){return n},incrementQuantityClickCounterDesktop:function(a){n++},getQuantityClickCounterMobile:function(){return p},incrementQuantityClickCounterMobile:function(a){p++}}});m.when("A","ready").execute("sns-detail-page-impressions",function(d){function b(a){l.ue&&
l.ue.count(a,(ue.count(a)||0)+1)}var a=d.$;d.on.load(function(){if(a("#snsAccordionRowMiddle").length)try{b("snsBuyBoxVisibleOnDetailPage"),a("#sns-pill").length&&a("#sns-pill").text().trim()&&b("snsBuyBoxPillVisibleOnDetailPage"),a("#snsAccordionRowMiddle #a-popover-learnMorePopover").length&&a("#snsAccordionRowMiddle #a-popover-learnMorePopover").text().trim()&&b("snsBuyBoxLearnMoreVisibleOnDetailPage"),a("#sns-base-price").length&&a("#sns-base-price").text().trim()&&b("snsBuyBoxPriceVisibleOnDetailPage"),
a("#sns-delivery-buybox-upsell").length&&a("#sns-delivery-buybox-upsell").text().trim()&&b("snsBuyBoxDeliveryUpsellVisibleOnDetailPage"),a("#sns-delivery-buybox-upsell").length&&a("#sns-delivery-buybox-upsell").text().trim().includes("1 more")?b("snsBuyBoxDeliveryUpsell_2_MoreSubsToGo"):a("#sns-delivery-buybox-upsell").length&&a("#sns-delivery-buybox-upsell").text().trim().includes("2 more")?b("snsBuyBoxDeliveryUpsell_3_MoreSubsToGo"):a("#sns-delivery-buybox-upsell").length&&a("#sns-delivery-buybox-upsell").text().trim().includes("3 more")?
b("snsBuyBoxDeliveryUpsell_4_MoreSubsToGo"):a("#sns-delivery-buybox-upsell").length&&a("#sns-delivery-buybox-upsell").text().trim().includes("Unlock extra savings")?b("snsBuyBoxDeliveryUpsellAlmostTieredCustomer"):a("#sns-delivery-buybox-upsell").length&&a("#sns-delivery-buybox-upsell").text().trim().includes("You've unlocked extra savings")?b("snsBuyBoxDeliveryUpsellTieredCustomer"):a("#sns-delivery-buybox-upsell").length&&(a("#sns-delivery-buybox-upsell").text().trim().includes("No fees")||a("#sns-delivery-buybox-upsell").text().trim().includes("Cancel anytime"))&&
b("snsBuyBoxDeliveryUpsellNewOrUnrecognizedCustomer"),a(".sns-delivery-link").length&&a(".sns-delivery-link").text().trim()&&b("snsBuyBoxFRDDVisibleOnDetailPage"),a("#snsAccordionRowMiddle #availability").length&&a("#snsAccordionRowMiddle #availability").text().trim()&&a("#snsAccordionRowMiddle #availability").text().trim().includes("In Stock")&&b("snsBuyBoxAvailabilityInStockVisibleOnDetailPage"),(a("#rcxOrdFreqSnsWrapper").length&&a("#rcxOrdFreqSnsWrapper").text().trim()||a("#replenishment-sns-frequency-accordion").length)&&
b("snsBuyBoxFrequencySelectorVisibleOnDetailPage"),a("#rcx-subscribe-submit-button").length&&a("#rcx-subscribe-submit-button").text().trim()?b("snsBuyBoxSubscribeNowButtonVisibleOnDetailPage"):b("snsBuyBoxSubscribeNowButtonNotVisibleOnDetailPage")}catch(c){b("snsBuyBoxImpressionMetricException")}else if(a("#snsAccordionRowMobileMiddle").length)try{b("snsBuyBoxVisibleOnDetailPageMobile"),a("#sns-pill").length&&a("#sns-pill").text().trim()&&b("snsBuyBoxPillVisibleOnDetailPageMobile"),a("#snsAccordionRowMobileMiddle #a-popover-learnMorePopover").length&&
a("#snsAccordionRowMobileMiddle #a-popover-learnMorePopover").text().trim()&&b("snsBuyBoxLearnMoreVisibleOnDetailPageMobile"),a("#sns-base-price").length&&a("#sns-base-price").text().trim()&&b("snsBuyBoxPriceVisibleOnDetailPageMobile"),a("#sns-delivery-buybox-upsell").length&&a("#sns-delivery-buybox-upsell").text().trim()&&b("snsBuyBoxDeliveryUpsellVisibleOnDetailPageMobile"),a("#sns-delivery-buybox-upsell").length&&a("#sns-delivery-buybox-upsell").text().trim().includes("1 more")?b("snsBuyBoxDeliveryUpsell_2_MoreSubsToGoMobile"):
a("#sns-delivery-buybox-upsell").length&&a("#sns-delivery-buybox-upsell").text().trim().includes("2 more")?b("snsBuyBoxDeliveryUpsell_3_MoreSubsToGoMobile"):a("#sns-delivery-buybox-upsell").length&&a("#sns-delivery-buybox-upsell").text().trim().includes("3 more")?b("snsBuyBoxDeliveryUpsell_4_MoreSubsToGoMobile"):a("#sns-delivery-buybox-upsell").length&&a("#sns-delivery-buybox-upsell").text().trim().includes("Unlock extra savings")?b("snsBuyBoxDeliveryUpsellAlmostTieredCustomerMobile"):a("#sns-delivery-buybox-upsell").length&&
a("#sns-delivery-buybox-upsell").text().trim().includes("You've unlocked extra savings")?b("snsBuyBoxDeliveryUpsellTieredCustomerMobile"):a("#sns-delivery-buybox-upsell").length&&(a("#sns-delivery-buybox-upsell").text().trim().includes("No fees")||a("#sns-delivery-buybox-upsell").text().trim().includes("Cancel anytime"))&&b("snsBuyBoxDeliveryUpsellNewOrUnrecognizedCustomerMobile"),a(".sns-delivery-link").length&&a(".sns-delivery-link").text().trim()&&b("snsBuyBoxFRDDVisibleOnDetailPageMobile"),a("#snsAccordionRowMobileMiddle #availability").length&&
a("#snsAccordionRowMobileMiddle #availability").text().trim()&&a("#snsAccordionRowMobileMiddle #availability").text().trim().includes("In Stock")&&b("snsBuyBoxAvailabilityInStockVisibleOnDetailPageMobile"),(a("#rcxOrdFreqSnsWrapper").length&&a("#rcxOrdFreqSnsWrapper").text().trim()||a("#replenishment-sns-frequency-accordion").length)&&b("snsBuyBoxFrequencySelectorVisibleOnDetailPageMobile"),a("#rcx-subscribe-submit-button").length&&a("#rcx-subscribe-submit-button").text().trim()?b("snsBuyBoxSubscribeNowButtonVisibleOnDetailPageMobile"):
b("snsBuyBoxSubscribeNowButtonNotVisibleOnDetailPageMobile")}catch(c){b("snsBuyBoxImpressionMetricExceptionMobile")}else b("snsBuyBoxNotVisibleOnDetailPage")})});m.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(d,b,a,c,g,e,f){d.init();b.init();a.init();c.init();g.init();e.init();f.init()});m.when("moq-core").register("sns-moq-helper",function(d){return{isSnsLocked:d.isSnsLocked}});
m.when("A","sns-buybox-constants","sns-onmlv2-utils","sns-vmf-utils","sns-constants").register("sns-dp-widget-utils",function(d,b,a,c,g){function e(a){for(var b=[];b.length<a;){var c=Math.floor(Math.random()*a);-1===b.indexOf(c)&&b.push(c)}return b}var f=d.$,k=!1,l;return{getSnSRecommendations:function(){var c=a.getCurrencyCode();f.ajax({url:b.GET_MYD_RECOMMENDATIONS_URL,type:"GET",data:{currencyCode:c,shipId:"undef",sourcePage:b.SOURCE_PAGE},dataType:"json",success:function(a){l=e(20);f("#snsHighUpsellCartRecs").replaceWith(a.recommendationsDiv);
for(a=0;3>a;a++)f("#recItem"+l[a]).removeClass("aok-hidden")},error:function(b){a.emitSsbMetrics("ssb-get-recs-ajax-error","snsHighUpsellCartRecs");f("#snsHighUpsellCartRecs").remove()}})},createImage:function(a){return'\x3cimg id\x3d"hucATCProductImage" src\x3d"'+a+'" class\x3d"'+(d.capabilities.mobile?"huc-confirmation-image-mobile":"huc-confirmation-image")+'"/\x3e'},isSSBDataPresent:function(){return null!=a.getAStateFromDomWithoutJson(t,"sns-huc-data","currencyCode")},updateDeliveryOptionWidget:function(){k||
(k=!0,f("#sns-only-delivery-option-text").html(f("#sns-only-delivery-option-text").html().replace(/%_month_%/g,"\x3cspan class \x3d'sns-only-month'\x3e\x3c/span\x3e")),f("#sns-only-delivery-option-text").html(f("#sns-only-delivery-option-text").html().replace(/%_day_%/g,"\x3cspan class \x3d'sns-only-day'\x3e\x3c/span\x3e")),f("#sns-only-delivery-option-text").html(f("#sns-only-delivery-option-text").html().replace(/%_upsell_information_%/g,"\x3cspan class \x3d'sns-upsell-message'\x3e\x3c/span\x3e")),
f("#onml-later-delivery-option-text").html(f("#onml-later-delivery-option-text").html().replace(/%_frequency_%/g,"\x3cspan class \x3d'sns-frequency'\x3e\x3c/span\x3e")),f("#onml-later-delivery-option-text").html(f("#onml-later-delivery-option-text").html().replace(/%_date-more-later_%/g,"\x3cspan class \x3d'sns-ml-date'\x3e\x3c/span\x3e")));var b=a.getDeliveryInfoParam(),d=a.getSnsFrequencyParam(),e=a.getOnmlFrequencyParam(),l=c.getFrequencyIndex(g.DELIVERY_OPTION.SNS),q=c.getFrequencyIndex(g.DELIVERY_OPTION.ONML),
m=b.snsDates[l].split(" "),t=m[0],m=m[1],d=d[l].upsellInformation.message,b=b.onmlDates[q],e=e[l].label.split(" "),e=e[0]+" "+e[1];f(".sns-ml-date").html(b);f(".sns-frequency").html(e);f(".sns-only-month").html(t);f(".sns-only-day").html(m);f(".sns-upsell-message").html(d)},isDeliveryOptionEnabled:function(){return!1},getRandomizeRecList:function(){return 0!==l.length?l:e(20)},disableButton:function(a){m.when("a-button").execute(function(b){b("#"+a).disable()})},enableButton:function(a){m.when("a-button").execute(function(b){b("#"+
a).enable()})},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"},SUBSCRIBE_FORM_ATTRIBUTES:{name:"sns-onmlv2-subscribe",id:"sns-onmlv2-subscribe",method:"POST",action:"/gp/subscribe-and-save/atc/sns-atc.html"}}});m.when("A","sns-buybox-constants","sns-onmlv2-utils","sns-dp-widget-utils").register("sns-high-upsell-cart-widget",function(d,b,a,c){function g(d){var g,l;g=e("\x3cform\x3e",{method:c.SUBSCRIBE_FORM_ATTRIBUTES.method,
action:c.SUBSCRIBE_FORM_ATTRIBUTES.action,id:c.SUBSCRIBE_FORM_ATTRIBUTES.id,name:c.SUBSCRIBE_FORM_ATTRIBUTES.name});l=c.SUBSCRIBE_FORM_ATTRIBUTES.id;var m="";d="#hucRecFields"+d;var t=e(d+" [name\x3d'snsRecsMcf']").val()+b.SNS_ONML_MONTH,m=m+a.createHiddenInput("snsAsin",e(d+" [name\x3d'snsRecsAsin']").val()),m=m+a.createHiddenInput("rcxOrdFreqOnml",t),m=m+a.createHiddenInput("onmlSelected","true"),m=m+a.createHiddenInput("vmfEnabled","true"),m=m+a.createHiddenInput("quantity","1"),m=m+a.createHiddenInput("ref",
"sns-subscribe-btn-dp-vmf-onml"),m=m+a.createHiddenInput("submit.subscribe","1"),m=m+a.createHiddenInput("merchantId",e(d+" [name\x3d'snsRecsMerchantID']").val()),m=m+a.createHiddenInput("offerListingID",e(d+" [name\x3d'snsRecsOfferListingID']").val()),m=m+a.createHiddenInput("hucWidgetEnabled","1");g.html(m);e("body").append(g);g=e("#"+l).serialize();e.ajax({url:c.SUBSCRIBE_FORM_ATTRIBUTES.action,type:c.SUBSCRIBE_FORM_ATTRIBUTES.method,data:g,success:function(a){a=c.getRandomizeRecList();e("#hucATCProductImage").replaceWith(c.createImage(q));
e("#"+k).addClass("aok-hidden");e("#recItem"+a[f]).insertAfter("#"+k);e("#recItem"+a[f]).removeClass("aok-hidden");f++},error:function(){a.emitSsbMetrics("ssb-rec-atc-ajax-error","sns-huc-add-to-cart")}});e("#"+l).remove()}var e=d.$,f=3,k,q;d.declarative("sns-huc-add-to-cart","click",function(b){a.emitSsbMetrics(d.capabilities.mobile?"ssb_recs_atc_mobile":"ssb_recs_atc_desktop","sns-huc-add-to-cart");k=b.data.recId;var e=b.data.recIndex;q=b.data.productImageURL;c.disableButton((d.capabilities.mobile?
"recs-atc-mobile":"recs-atc-desktop")+e);g(e)});d.declarative("sns-huc-go-to-cart","click",function(c){a.emitSsbMetrics(d.capabilities.mobile?"ssb_go_to_cart_mobile":"ssb_go_to_cart_desktop","sns-huc-go-to-cart");l.location.href=b.VIEW_CART_URL});d.declarative("sns-huc-go-to-checkout","click",function(c){a.emitSsbMetrics(d.capabilities.mobile?"ssb_go_to_checkout_mobile":"ssb_go_to_checkout_desktop","sns-huc-go-to-checkout");l.location.href=b.GO_TO_CHECKOUT_URL})});m.when("A","a-dropdown","sns-vmf-utils",
"sns-onmlv2-utils","sns-metrics-constants","ready").execute("b2b-onmlv2-frequency-update",function(d,b,a,c,g){function e(a){l.ue&&l.ue.count(a,(ue.count(a)||0)+1)}var f=d.$;f("#rcxOrdFreq").change(function(){if(f("#b2brd").length&&!0===c.getIsRDProgramWinner()&&"rcxOrdFreqOnml"===f("#rcxOrdFreq").attr("name")!==!1){var a;a=!0===c.getIsCustomerPrimeMap()?c.getOnmlFrequencyParamForB2B():c.getSnsFrequencyParamForB2B();var b=f("[name\x3drcxOrdFreqOnml]").prop("selectedIndex"),d=f("[name\x3drcxOrdFreqOnml]")[0].options[b].value;
f('[name\x3d"rcxOrdFreqOnml"]').val(d);a=a[b];f(".b2brd-delivery-buybox-upsell-message").html(a.upsellInformation.message);f(".b2brd-delivery-buybox-upsell-additional-message-title").html(a.upsellInformation.additionalMessageTitle);f(".b2brd-delivery-buybox-upsell-additional-message").html(a.upsellInformation.additionalMessage);0===a.highlightedDiscount?(f("#rd-base-price").removeClass("aok-hidden"),f("#rd-tiered-price").addClass("aok-hidden")):(f("#rd-base-price").addClass("aok-hidden"),f("#rd-tiered-price").removeClass("aok-hidden"));
a=f("[name\x3drcxOrdFreqOnml]").val();e(g.B2B_BUY_BOX_MESSAGE_UPDATE_SUCCESSFUL);0<a.search("W")?e(g.B2B_ONML_WEEKLY_FREQUENCY_SELECT_METRICS):e(g.B2B_ONML_MONTHLY_FREQUENCY_SELECT_METRICS)}}).error(function(){e(g.B2B_BUY_BOX_MESSAGE_UPDATE_FAILED)})});m.when("A","sns-onmlv2-utils","sns-vmf-utils","sns-upsell-message-trigger-handler").register("sns-annual-savings",function(d,b,a,c){function g(a){l.ue&&l.ue.count(a,(ue.count(a)||0)+1)}return{checkPreConditionsAndUpdateAnnualSavings:function(e){var f=
d.$("#sns-annual-savings");if("undefined"===typeof e||null===e)g("snsFrequencyValueAbsent"),f.addClass("aok-hidden");else{var k=b.getAnnualSavingsParamMap(),l=b.getAnnualSavingsWeblabTreatment(),h=a.getQuantityIndex();if("undefined"===typeof k||0===Object.keys(k).length)g("snsAnnualSavingsMapIsNotPresent"),f.addClass("aok-hidden");else if("undefined"===typeof h||null===h)g("snsQuantityIndexAbsent"),f.addClass("aok-hidden");else if("undefined"===typeof l)g("snsAnnualSavingsWeblabTreatmentAbsent"),
f.addClass("aok-hidden");else{var m;k.hasOwnProperty(e)&&k[e][h]!==t&&(m=k[e][h]);e=m;f=d.$("#sns-annual-savings");"undefined"!==typeof e?(c.handleAnnualSavingsExperimentTriggering(e,l),"T1"===l&&(l=null!==e&&0!==e.length,d.$("#sns-annual-savings-value").text(e),f.toggleClass("aok-hidden",!l),l&&g("snsAnnualSavingsShown"))):(g("snsAnnualSavingsValueAbsent"),f.addClass("aok-hidden"))}}}}});m.when("A","a-dropdown","sns-vmf-utils","sns-annual-savings","sns-constants","sns-buybox-constants","ready").execute("sns-quantity-update",
function(d,b,a,c,g,e){var f=d.$;d.on("a:dropdown:rcxsubsQuan:select",function(b){b=f("#rcxOrdFreqOnmlWrapper").hasClass("aok-hidden")||f(e.REPLENISHMENT_ONML_FREQUENCY_POPOVER_ID).hasClass("aok-hidden")||f(e.REPLENISHMENT_ONML_FREQUENCY_INFO_POPOVER_ID).hasClass("aok-hidden")?a.getFrequencyValue(g.DELIVERY_OPTION.SNS):a.getFrequencyValue(g.DELIVERY_OPTION.ONML);b=a.getFrequencyValueExcludingDeliveryType(b);c.checkPreConditionsAndUpdateAnnualSavings(b)})});m.when("A","sns-onmlv2-utils","sns-upsell-message-trigger-handler",
"ready").execute("sns-annual-savings-trigger",function(d,b,a){d=b.getDefaultSavingsValue();b=b.getAnnualSavingsWeblabTreatment();a.handleAnnualSavingsExperimentTriggering(d,b)});m.when("A","sns-onmlv2-utils","ready").execute("sns-udm-delivery-block-styling",function(d,b){function a(){try{var a=c("div[id^\x3d'snsAccordionRow'] div#mir-layout-DELIVERY_BLOCK");a&&a.each(function(){var a=c(this).find("div:last");a&&a.removeClass(function(a,b){return(b.match(/(^|\s)a-spacing-\S+/g)||[]).join(" ")}).addClass("a-spacing-none")})}catch(d){b.emitMetric("snsUdmDeliveryBlockSpacingAdjustmentFailed"),
b.logErrorWithAttribution("sns-delivery-block-apply-styling","Error occurred while applying delivery block styling "+d)}}var c=d.$;a();d.on("a:pageUpdate",function(b){a()})})});
/* ******** */
(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(g){var h=window.AmazonUIPageJS||window.P,l=h._namespace||h.attributeErrors,b=l?l("DetailPageFluxComponents",""):h;b.guardFatal?b.guardFatal(g)(b,window):b.execute(function(){g(b,window)})})(function(g,h,l){g.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});g.when("dp-flux-utils").register("dp-flux-attribution",function(b){function e(d,a,c,f){if(b.isNonEmptyString(d)&&b.isNonEmptyString(a)&&b.isNonEmptyString(c)&&b.isNonEmptyString(f))this._name=d,this._category=a,this._type=c,this._item=f;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});g.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 f="ID_"+this._lastID++;this._callbacks[f]={attribution:a,callback:b,_isCallbackExecutionStarted:!1,_isCallbackExecutionCompleted:!1};return f},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 f=a[b];if(!this._callbacks[f])throw Error("Dispatcher.waitFor(...): "+f+" does not map to a registered callback. ");
if(this._callbacks[f]._isCallbackExecutionStarted)if(this._callbacks[f]._isCallbackExecutionCompleted)continue;else throw Error("Dispatcher.waitFor(...): Circular dependency detected while waiting for "+f);this._invokeCallback(f)}},_invokeCallback:function(a){this._callbacks[a]._isCallbackExecutionStarted=!0;try{this._callbacks[a].callback(this._pendingAction)}catch(k){g.log("Dispatcher._invokeCallback(...): Error while calling dispatcher callback: error message \x3d "+k.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});g.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(b,d){if(e.isNonEmptyString(b)&&a.isFunction(d)){if(b=this._subscriptions[b])d=a.inArray(d,
b),-1!==d&&b.splice(d,1)}else throw Error("Emitter.removeListener()...: Invalid arguments - eventType must be a non empty string \x26 callback must be a function");}};return d});g.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,f,k,h){if(!(b instanceof d))throw Error("storeAttribution should be instance of Attribution");if(!(k instanceof a))throw Error("dispatcher must be an instance of Dispatcher");if(!g.isFunction(f))throw Error("Store must provide a reduce callback method");
this.reduce=f;this.dispatcher=k;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 g=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});g.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});g.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){g.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});g.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}}});g.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(k){var g=window.AmazonUIPageJS||window.P,m=g._namespace||g.attributeErrors,a=m?m("DetailPageMobileAppAssets",""):g;a.guardFatal?a.guardFatal(k)(a,window):a.execute(function(){k(a,window)})})(function(k,g,m){k.when("A","aw-mash","a-popover-base").register("aw-mash-popover-nav",function(a,e,c){var f=c.show,d=c.hide;c.show=function(a,c){c?f(a,!0):e.navigate({url:null,transitionEffect:"slide",successCallback:function(){f(a,!1)}})};c.hide=function(a,c){c?d(a,!0):e.goBack({successCallback:function(){d(a,
!1)}})}});"use strict";k.when("jQuery","aw-mash-handler","dp-instant-map","dp-client-counter").execute("dp-instant-atc-handler",function(a,e,c,f){Object.keys(c).forEach(function(d){var e=c[d].instant,k=c[d].triggerButton,g=e.getShouldTrigger();e.disable();g&&(f.inc("dp-instant-"+d+"-clicked"),a(k).trigger("click"))})});"use strict";k.register("dp-mash-pre-registry-handler");k.when("A","aw-mash","dp-util-cookie","mobile-app-atc-action","mobile-app-gift","mobile-app-device-prereg","natc-check","atc-metrics",
"update-atc-data","atc-data-validation","aw-mbb-checkbox-helper","offersx-csrf-utils","patc-csm-init","atc-eligibility","sns-buybox-validation-on-patc","atc-constants","dp-csm-metrics").register("aw-mash-handler",function(a,e,c,f,d,h,u,B,p,q,w,E,C,x,r,y,z){function Q(b){b.preventDefault();b.stopPropagation()}function R(){v("#atc-toast-overlay").css("display","");F.addClass("udp-stop-scrolling");F.bind("touchmove touchstart touchend touchcancel",Q)}function S(){F.removeClass("udp-stop-scrolling");
F.unbind("touchmove touchstart touchend touchcancel",Q);v("#atc-toast-overlay").css("display","none")}function n(b){b="."+b;var a=v(b);0<v("#buybox .a-accordion-active").length&&(a=v("#buybox .a-accordion-active "+b));return a}function ba(){R();var b=n("atc-button"),a=n("atc-button-text"),c=n("inst-button-space"),d=n("inst-indicator");b.addClass("inst-btn-opacity");a.hide();c.removeClass("aok-hidden");d.removeClass("aok-hidden")}function L(b){var a=n("atc-toast"),c=n("atc-success"),d=n("atc-failed"),
e=n("atc-failed-deals"),f=n("inst-indicator"),h=n("inst-button-space"),q=n("atc-button-text"),E=n("atc-button");g.requestAnimationFrame(function(){E.removeClass("inst-btn-opacity");f.addClass("aok-hidden");h.addClass("aok-hidden");q.show();a.css("display","");0===b?(c.css("display",""),a.addClass("atc-toast-success-styles")):-1===b?(d.css("display",""),a.addClass("atc-toast-failure-styles")):-2===b&&(e.css("display",""),a.addClass("atc-toast-failure-styles"))})}function D(b){var a=n("atc-toast"),
c=n("atc-success"),d=n("atc-failed"),e=n("atc-failed-deals"),f=n("inst-indicator"),h=n("inst-button-space"),q=n("atc-button-text"),E=n("atc-button");g.requestAnimationFrame(function(){E.removeClass("inst-btn-opacity");f.addClass("aok-hidden");h.addClass("aok-hidden");q.show();a.removeClass("atc-toast-failure-styles");a.removeClass("atc-toast-success-styles");d.css("display","none");e.css("display","none");c.css("display","none");a.css("display","none");setTimeout(function(){S()},b)})}function U(b,
a,c){D(1E3);e.showAlert({title:a,message:b,buttonTitles:[c],successCallback:function(b){},failCallback:function(b){console.log(b)}})}function H(b){b=parseInt(b,10);e.cart.didUpdate({newCartQuantity:b});amazon.cordova.notification.vibrate(50)}function M(b,c,d){function f(b){var a=[];b.usGlExclusionPatcExperimental&&a.push(b.usGlExclusionPatcExperimental);return JSON.stringify(a)}function h(){var e=u.getAtcEndpoint(b),h=u.getShouldUseNatc()&&b.queryString!==m&&""!==b.queryString?"?"+b.queryString:"";
q.validateData(b);var l=w();b.inputs.experimentalIDs=f(b);l&&V?(b.queryParameters={customizers:"BOTTOM_SHEET",isUssEligible:K()&&p()&&x()&&r(),hasSubSameDayOffer:!!b.hasSubSameDayOffer},k.when("action-executor").execute(function(a){a.executeAddToCart(b,S,R)})):(l=E.setCSRFHeaderFromId("mobile-app-atc-anti-csrf-token"),V&&C.initialize(),B.recordAtcAjaxCall(),a.ajax(e+"/ref\x3d"+b.reftag+h,{method:"post",params:b.inputs,headers:l,timeout:b.timeout,success:function(a,d,e){B.recordAtcAjaxSuccess();u.getShouldUseNatc()?
(a&&a.successful?Y(a):(a&&a.count&&H(a.count),z.updateCount(y.NATC_AJAX_RESPONSE_FAILURE),A("[Detail Page Mobile App Add to Cart failed due to failure message from NeoAddToCart]"),G()),C.recordAXControlMetric(e)):a&&a.ok?Y(a):a&&a.isDeal?P(a):a&&"perOfferingRestrictionViolated"===a.error?(z.updateCount(y.ATC_AJAX_RESPONSE_OFFERING_RESTRICTION_VIOLATED),A("[Detail Page Mobile App Add to Cart Offer Restriction Failure]"),c(b,a)):a&&a.isCartServiceFailed?(z.updateCount(y.ATC_AJAX_RESPONSE_CART_SERVICE_FAILURE),
A("[Detail Page Mobile App Add to Cart failed due to Cart Service Failure]",a)):W(a)},error:function(a,c,e){B.recordAtcAjaxFailure();u.getShouldUseNatc()?(A("[Detail Page Mobile App Add to Cart failed due to AJAX Error when calling NeoAddToCart]"),G()):(a="[Detail Page Mobile App Add to Cart Error Status: "+c+"]",b.inputs.isUSSAjax?t.aa_mash_add_to_cart_lost_connection_message&&t.aa_mash_add_to_cart_lost_connection_title?A(a):(d(),I()):t.aa_mash_add_to_cart_lost_connection_message&&t.aa_mash_add_to_cart_lost_connection_title?
(U(t.aa_mash_add_to_cart_lost_connection_message,t.aa_mash_add_to_cart_lost_connection_title,t.aa_mash_ok),A(a)):I())}}))}function w(){if(K()&&p()&&x()&&r()&&Z){var c="";g.ue&&(c=g.ue.id);var d=X+"weblabValue\x3d"+Z+"\x26requestId\x3d"+c;navigator&&navigator.sendBeacon?(c=navigator.sendBeacon(d))||a.$.ajax({url:d}):a.$.ajax({url:d})}return u.getShouldUseNatc()&&!N&&(!K()&&b.showBottomSheetDefaultAddToCartExperience||K()&&p()&&x()&&r()&&("T1"===b.ussConvergenceExperimentTreatment||"T2"===b.ussConvergenceExperimentTreatment))}
function K(){return"true"===a.$("#uss-mobileApp").val()&&a.$("#ussEligible").length&&"1"===a.$("#ussEligible").val()}function r(){return ca.test(a.$("#uss-weblabTreatment").val())}function p(){return"true"===a.$("#uss-serverPreconditionsPassed").val()}function x(){var b;if(b=a.capabilities.transform&&a.capabilities.transition)b=a.$("\x3cdiv\x3e\x3c/div\x3e")[0],b=""===b.style.flex||""===b.style.webkitFlex||""===b.style.msFlex||""===b.style.MozBoxFlex||""===b.style.webkitBoxFlex?!0:!1;if(b=b&&!T("scheduledDelivery")&&
!T("partialStateBuyBox")&&!T("snsInterstitialWidget"))b=a.$("#add-to-cart-button"),b=b.length&&"submit"==b.prop("type");return b&&!(a.$("#attach-accessory-card-deck").length&&("true"===a.$("#uss-mobileApp").val()||a.$("#attach-accessory-mobile-web-mbs").length))}function T(b){b=a.$("#"+b+"_feature_div").html();null!==b&&(b=b.trim());return null!==b&&0<b.length}function G(){d&&b.inputs.isUSSAjax?d():(L(-1),setTimeout(function(){D(0)},2E3))}function M(){var c=v("#cps-atc-changeover");if(0<c.length){var d=
a.state("cps-atc-toast-text");if(d&&d.atcToastTextString){d=d.atcToastTextString.replace("FreshATCToastQuantity",b.inputs.quantity);var e=c.find(".a-changeover-inner");e&&(e.text(d),c.show())}}}function O(){F.addClass("udp-stop-scrolling");F.bind("touchmove touchstart touchend touchcancel",Q);var b=n("atc-button"),a=n("atc-button-text"),c=n("inst-button-space"),d=n("inst-indicator");b.addClass("inst-btn-opacity");a.hide();c.removeClass("aok-hidden");d.removeClass("aok-hidden")}function W(c){a.trigger("dpx:add-to-cart:error");
z.updateCount(y.ATC_AJAX_RESPONSE_FAILURE);b.inputs.isUSSAjax?t.aa_mash_failed_add_to_cart&&t.aa_mash_encounter_problem&&t.aa_mash_ok?A("[Detail Page Mobile App Add to Cart Mash Failure]",c):(d(c),I()):t.aa_mash_failed_add_to_cart&&t.aa_mash_encounter_problem&&t.aa_mash_ok?(U(t.aa_mash_failed_add_to_cart,t.aa_mash_encounter_problem,t.aa_mash_ok),A("[Detail Page Mobile App Add to Cart Mash Failure]")):(L(-1),setTimeout(function(){D(0)},2E3),I())}function A(c,e){a.trigger("dpLogFatalsEvent",c,"ERROR",
"mobileApp_addtocart_fatal");b.inputs.isUSSAjax&&d(e)}function I(){a.trigger("dpLogFatalsEvent","[Detail Page Mobile App Add to cart String error]","ERROR","mobileApp_addtocart_string_error")}function P(a){z.updateCount(y.ATC_AJAX_RESPONSE_DEAL_NOT_AVAILABLE);A("[Detail Page Mobile App Add to Cart Unavailable Deal Failure]");b.inputs.isUSSAjax?d(a):t.aa_mash_deal_not_available?(D(1E3),e.showAlert({title:t.aa_mash_deal_not_available,message:"",successCallback:function(b){},buttonTitles:[t.aa_mash_ok],
failCallback:function(b){console.log(b)}})):I()}function Y(c){a.trigger("dpx:add-to-cart:success",c);N||(aa?M():L(0),setTimeout(function(){D(0)},2E3));u.getShouldUseNatc()?(z.updateCount(y.NATC_AJAX_RESPONSE_SUCCESS),c&&c.count&&H(c.count)):(z.updateCount(y.ATC_AJAX_RESPONSE_SUCCESS),H(c.numActiveItemsInCart));d&&(b.inputs.isUSSAjax?d(c):d())}var J=v("#add-to-cart-button");if(!J.length||"submit"===J.prop("type")){var aa=0<v("#cps-atc-changeover").length,t=b.strings,N=d!==m;l&&l.count&&(l.count("dp-mobile-app-doatc",
(l.count("dp-mobile-app-doatc")||0)+1),N&&l.count("dp-mobile-app-doatc-skiptoast",(l.count("dp-mobile-app-doatc-skiptoast")||0)+1));J=v("#subscribeToApubPrimeFirstEmailList");"use strict";var V=function(){var b=!1;k.now("action-executor").execute(function(a){a!==m?b=!0:l&&l.count&&l.count("ax_bottom_sheet_not_ready",(l.count("ax_bottom_sheet_not_ready")||0)+1)});return b}();"use strict";"use strict";"use strict";var X="/ussx/weblab-trigger?",Z="CONSUMABLES_CSE_USS_SW_CONVERGENCE_692339",ca=/^T[0-9]+$/;
"use strict";N||w()&&V||(aa?O():ba());J.length?(J.is(":checked")&&(b.inputs.subscribeToApubPrimeFirstEmailList=1),b.requiresSignIn&&!g.apubPrimeFirstSignInSuccessful?(g.apubPrimeFirstSignInSuccessful=1,e.showLoginDialog({successCallback:function(){h(b)},failCallback:function(b){g.apubPrimeFirstSignInSuccessful=0;"CANCELED"!==b&&W(b)}})):h(b)):b.requiresSignIn?e.showLoginDialog({successCallback:function(){h()},failCallback:function(b){"CANCELED"!==b&&W(b)}}):h()}}function X(b){M(b,function(b,a){D(1E3);
H(a.numActiveItemsInCart);e.showAlert({message:b.strings.aa_mash_some_out_of_stock,buttonTitles:[b.strings.multi_aa_mash_go_to_cart,b.strings.multi_aa_mash_continue_shopping],successCallback:function(b){0===b&&(g.location="/gp/cart/view.html")},failCallback:function(b){console.log(b)}})})}function G(b,a){b=JSON.parse(JSON.stringify(b));if("undefined"===typeof b.inputs.isSecondaryAtc||1!==b.inputs.isSecondaryAtc)"true"!==v("#twister-plus-mbb-selected").val()&&(b=p.updateQuantity(b)),"undefined"===
typeof b.inputs.isUsedBuyBox||"1"!==b.inputs.isUsedBuyBox?("reftag"in b||(b.reftag="undefined"!==typeof b.isMobbSecondNew&&b.isMobbSecondNew?"dp_atc_ma_secondnew":"mw_pa_dp_buy_crt"),"000-0000000-8675309"===b.inputs.verificationSessionID&&(b.inputs.verificationSessionID=c("session-id")),w.mbbCheckboxIsChecked()&&!u.getShouldUseNatc()&&w.updateData(b)):"reftag"in b||(b.reftag="dp_uatc_ma");b=d.updateData(b);b=h.updateData(b);b=x.updateEligibilityData(b);r!==m&&(b=r.updateSnSBuyingOptionData(b));M(b,
function(b,c){b.inputs.isUSSAjax?a(c):U(b.strings.aa_mash_add_to_cart_failed_quantity_message,b.strings.aa_mash_add_to_cart_failed_quantity_title,b.strings.aa_mash_ok);H(c.numActiveItemsInCart)},a)}function O(b){return{asin:b.a,offerId:b.oid,listId:b.colid,listItemId:b.coliid,dealId:b.di,clickStream:""}}var v=a.$;a.state("a-page-options");var F=v("body");"use strict";var l=g.ue;"use strict";var P={"add-to-cart":function(b){l&&l.count&&l.count("mobileAppAddToCartMash",(l.count("mobileAppAddToCartMash")||
0)+1);f.atcAction(b,G)},"add-multiple-to-cart":function(b){l&&l.count&&l.count("mobileAppAddMultipleToCartMash",(l.count("mobileAppAddMultipleToCartMash")||0)+1);X(b)},"add-to-wish-list":function(b){l&&l.count&&l.count("mobileAppAddToWishListMash",(l.count("mobileAppAddToWishListMash")||0)+1);R();e.addToWishList({asin:b.inputs.a});S()},"buy-now":function(b){l&&l.count&&l.count("mobileAppBuyNowMash",(l.count("mobileAppBuyNowMash")||0)+1);var a=document.getElementById("same-day-swatches-shipping-speed");
b=O(b.inputs);b.shippingSpeed=a&&a.value||"default";e.buyNow(b)},"buy-now-one-click":function(b){l&&l.count&&l.count("mobileAppBuyNowOneClickMash",(l.count("mobileAppBuyNowOneClickMash")||0)+1);var a=document.getElementById("prime-toggle-main");b=O(b.inputs);b.oneClickShippingSpeed=a&&a.name||"default";e.buyNowWithOneClick(b)}};v.isFunction(g.markFeatureInteractive)&&g.markFeatureInteractive("atc",{hasComponents:!0,components:[{name:"aw-mash",alwaysInteractive:!0}]});a.declarative("aw-mash",["click"],
function(b){var a=g.ue;b&&b.data&&u.setShouldUseNatc(b.data);a&&a.count&&b&&b.data&&"add-to-cart"===b.data.buttonID&&a.count("DetailPage_MobileApp_AddToCart",(a.count("DetailPage_MobileApp_AddToCart")||0)+1);"undefined"!==typeof b.$target.context.id&&"mobb.addToCart"===b.$target.context.id&&(b.data.isMobbSecondNew=!0);b=p.setNatcQuantityFromDom(b);"object"===typeof b&&"object"===typeof b.data&&"string"===typeof b.data.buttonID&&"function"===typeof P[b.data.buttonID]&&P[b.data.buttonID](b.data)});
a.declarative("aw-mash",["touchstart"],function(b){var a=b.$event.originalEvent,c=g.ue;a.acknowledge&&(a.acknowledge(0<b.$currentTarget.length?b.$currentTarget[0]:m),c&&c.count&&c.count("tnr-post-ack-atc",(c.count("tnr-post-ack-atc")||0)+1))});a.on("js-trigger-aw-mash",function(b,a){u.setShouldUseNatc(b);G(b,a)});return{addToCart:G,hideAtcToast:D,updateAtcToast:L}});"use strict";k.when("A","aw-mash").register("aw-mash-open-external-url",function(a,e){a.declarative("aw-mash-open-external-url",["click"],
function(a){e.openInExternalBrowser({url:a.data.url});return!1})});"use strict";k.when("A").register("mobileiv-images",function(){return{imageArray:[]}});k.when("A","jQuery","a-carousel-framework","atf","mobileiv-images").execute(function(a,e,c,f,d){function h(a,c,d){amazon.mash.showImageGallery({title:a,startIndex:c,imageUrls:d});k.when("mobileIBmetricCollectionWeblab").execute(function(a){if(a.isMobileIBmetricCollectionEnabled)if(a.onPrimaryImg)if(a.IVReqCount>a.IVSuccessCount){a.logCountAndTime("dpmob_primaryImageImmersiveViewRequestServed");
a.IVSuccessCount++;var c=a.IVCountsDiff;a.IVCountsDiff=a.IVReqCount-a.IVSuccessCount;a.IVCountsDiff>c&&(a.logSpecificCount("dpmob_primaryImageImmersiveViewRequestFailed",1),a.logSpecificCount("dpmob_primaryImageInteractionFailed",1))}else a.logCountAndTime("dpmob_primaryImageImmersiveViewRequestServedWithoutPlaced");else a.logCountAndTime("dpmob_altImagesImmersiveViewRequestServed")})}function u(a){var d=c.getCarouselByName(a);if("undefined"===typeof d)for(var e=c.getAllCarousels(),f=0;f<e.length;f++){var h=
e[f];if(h.getAttr("name")===a){d=h;break}}return d}function B(a){var c=1;if("undefined"!==typeof a.dom&&"undefined"!==typeof a.dom.$carousel)a=a.dom.$carousel;else if(!(0<a.length)){a=e;return}a.children("li").each(function(a,d){(a=e(d).find(".a-declarative"))&&a.length&&"undefined"!==typeof a.data&&a.data("a-secondary-view-native")!==m&&"immersive-view-app"==a.data("a-secondary-view-native").name&&!a.find(".ar-ib-ingress-overlay").length?(p.push(c),c++):p.push(null)})}var p=[null];g.ue&&g.ue.count&&
g.performance&&g.performance.now&&ue.count("immersive_view_mobile_app_time",performance.now());a.on("image-block-refresh",function(){p=[null]});a.declarative("a-secondary-view-native",["click"],function(c){var f=c.data&&c.data.titleText?c.data.titleText:"Product Image Gallery",q=0<e(".lookbook \x3e .lookbook-container .a-carousel").length?!1:0<e(".lookbook \x3e .lookbook-container").length,C=q?e(".lookbook \x3e .lookbook-container"):u("image-block-carousel"),x=0,r=0;"undefined"!==typeof C&&(1>=p.length&&
B(C),q=q?C.parent().find("progress").prop("value"):C.getAttr("pageNumber"),(r=a.state("sneakPeekStateData"))&&r.sneakPeekEnabled&&r.lastPageClicked!==m&&(q=r.lastPageClicked),(r=a.state("putbPageState"))&&r.putbEnabled&&r.lastPageClicked!==m&&(q=r.lastPageClicked),"number"===typeof q&&(x=p[q],r=d.imageArray?d.imageArray.length:0,x>r&&(x=q)));if(0<e("#swf-share-icon.android").length&&c.data.shareParams){r=c.data.shareParams;var y={apply:function(a,c){}},z={title:f,startIndex:x,imageUrls:d.imageArray,
messagePlain:r.messagePlain,subject:r.subject,imageUrl:r.imageURL,url:r.url};k.when("immersiveViewWithShare").execute(function(a){(g.cordova&&g.cordova.require("cordova/exec"))(y,y,"ShowImageGallerySocial","ShowImageGalleryWithShare",z)})}else h(f,x-1||0,d.imageArray);c.$event.preventDefault()})});"use strict";k.when("A","aw-mash").execute(function(a,e){var c={offers:function(a){var c=a.asin||a.inputs.asin;"1"===a.nativePage?e.showOfferListingPage({asin:c}):g.location.href="/gp/aw/ol/"+c}};a.declarative("aw-mash",
["click"],function(a){"object"===typeof a&&"object"===typeof a.data&&"string"===typeof a.data.buttonID&&"function"===typeof c[a.data.buttonID]&&c[a.data.buttonID](a.data)})});"use strict";k.when("A","a-checkbox").register("aw-mbb-checkbox-helper",function(a,e){var c=a.$;return{updateData:function(a){var d=0<c(".a-accordion-active ").length?".a-accordion-active ":"";a.inputs.a+="|"+c(d+"#mbb-checkbox-input").val();a.inputs.oid+="|"+c(d+"#mbb-offering-id").val();a.inputs.quantity+="|"+c(d+"#mbb-quantity").val();
return a},mbbCheckboxIsChecked:function(){var a=e(".mbb-checkbox");return 0<a.size()&&a.isChecked()}}});"use strict";k.when("a-checkbox","add-to-cart-parameter-name","add-to-cart-constants","natc-check").register("mobile-app-gift",function(a,e,c,f){return{updateData:function(d){var h=a("#gift-wrap");0<h.size()&&h.isChecked()&&(f.getShouldUseNatc()?(h=e.constructParameterName(c.ITEM_TYPES.BASE,0,c.PARAMETER_PATHS.GIFTOPTIONS),d.inputs[h]="true"):d.inputs.isToBeGiftWrapped=!0);return d}}});"use strict";
k.when("A").register("mobile-app-atc-action",function(a){return{atcAction:function(e,c){var f=a.state("program-winner");null!=f&&"undefined"!==typeof f&&"Pantry"===f.Type?k.when("pantry-mobile-app-atc-setup").execute(function(a){a.addToCart(e)}):c(e)}}});"use strict";k.when("A").register("natc-check",function(a){var e=!1;return{setShouldUseNatc:function(a){e=!0},getShouldUseNatc:function(){return e},getAtcEndpoint:function(a){e=!0;return a.addToCartUrl}}});"use strict";k.when("natc-check","dp-csm-metrics",
"atc-constants").register("atc-metrics",function(a,e,c){function f(a,c){e.updateCount(c);e.recordLatencyTime(a)}return{recordAtcAjaxCall:function(){if(a.getShouldUseNatc()){var d=c.NATC_AJAX_LATENCY;e.updateCount(c.NATC_AJAX_COUNT);e.startLatencyTime(d)}else d=c.ATC_AJAX_LATENCY,e.updateCount(c.ATC_AJAX_COUNT),e.startLatencyTime(d)},recordAtcAjaxSuccess:function(){a.getShouldUseNatc()?f(c.NATC_AJAX_LATENCY,c.NATC_AJAX_SUCCESS_COUNT):f(c.ATC_AJAX_LATENCY,c.ATC_AJAX_SUCCESS_COUNT)},recordAtcAjaxFailure:function(){a.getShouldUseNatc()?
f(c.NATC_AJAX_LATENCY,c.NATC_AJAX_FAILURE_COUNT):f(c.ATC_AJAX_LATENCY,c.ATC_AJAX_FAILURE_COUNT)}}});"use strict";k.register("atc-constants",function(){return{ATC_AJAX_COUNT:"mobileApp:atc:ajax",ATC_AJAX_SUCCESS_COUNT:"mobileApp:atc:ajax:success",ATC_AJAX_FAILURE_COUNT:"mobileApp:atc:ajax:failure",ATC_AJAX_LATENCY:"mobileapp:atc:ajax",ATC_AJAX_RESPONSE_SUCCESS:"mobileApp:atc:ajax:response:success",ATC_AJAX_RESPONSE_DEAL_NOT_AVAILABLE:"mobileApp:atc:ajax:response:dealNotAvailable",ATC_AJAX_RESPONSE_OFFERING_RESTRICTION_VIOLATED:"mobileApp:atc:ajax:response:perOfferingRestrictionViolated",
ATC_AJAX_RESPONSE_CART_SERVICE_FAILURE:"mobileApp:atc:ajax:response:cartServiceFailure",ATC_AJAX_RESPONSE_FAILURE:"mobileApp:atc:ajax:response:failure",NATC_AJAX_COUNT:"mobileApp:atc:ajax:natc",NATC_AJAX_SUCCESS_COUNT:"mobileApp:atc:ajax:success:natc",NATC_AJAX_FAILURE_COUNT:"mobileApp:atc:ajax:failure:natc",NATC_AJAX_LATENCY:"mobileapp:atc:ajax:natc",NATC_AJAX_RESPONSE_SUCCESS:"mobileApp:atc:ajax:response:success:natc",NATC_AJAX_RESPONSE_FAILURE:"mobileApp:atc:ajax:response:failure:natc",ADD_TO_CART_INPUT_VALIDATION_SUCCESS:"mobileApp:addToCart:inputValidation:success",
ADD_TO_CART_INPUT_VALIDATION_FAILURE:"mobileApp:addToCart:inputValidation:failure"}});"use strict";k.when("A","add-to-cart-parameter-name","add-to-cart-constants").register("update-atc-data",function(a,e,c){var f=a.$;return{updateQuantity:function(a){var d=e.constructParameterName(c.ITEM_TYPES.BASE,0,c.PARAMETER_PATHS.QUANTITY);a.inputs[d]?a.inputs.quantity=a.inputs[d]:f("#mobileQuantityDropDown").length&&(f(".a-accordion-active select.mobileQuantityDropDown").length?a.inputs[d]=f(".a-accordion-active select.mobileQuantityDropDown").val():
a.inputs[d]=f("#mobileQuantityDropDown").val(),a.inputs.quantity=a.inputs[d]);return a},setNatcQuantityFromDom:function(a){var d=JSON.parse(a.$currentTarget.attr("data-aw-mash")).inputs.quantity,f=e.constructParameterName(c.ITEM_TYPES.BASE,0,c.PARAMETER_PATHS.QUANTITY);d&&(a.data.inputs[f]=d);return a}}});"use strict";k.when("A","atc-constants","add-to-cart-constants","add-to-cart-parameter-name","dp-csm-metrics").register("atc-data-validation",function(a,e,c,f,d){var h=a.$;return{validateData:function(k){var g=
m;0<h("#buybox .a-accordion-active #atc-declarative").length?g=h("#buybox .a-accordion-active #atc-declarative")[0]:0<h("#buybox #atc-declarative").length&&(g=h("#buybox #atc-declarative")[0]);var p=m;if(g!==m&&g.dataset!=m)for(q in g.dataset)try{p=JSON.parse(String(g.dataset[q]));break}catch(E){}var q=p;if(q!==m){if(g=[c.CSRF_TOKEN,c.CLIENT_NAME,f.constructParameterName(c.ITEM_TYPES.BASE,0,c.PARAMETER_PATHS.ASIN),f.constructParameterName(c.ITEM_TYPES.BASE,0,c.PARAMETER_PATHS.OFFER_LISTING_ID)],q!==
m&&q.inputs!==m&&k!==m&&k.inputs!==m&&Array.isArray(g))for(p=0;p<g.length;p++){var w=g[p];q.inputs[w]!==k.inputs[w]?(d.updateCount(e.ADD_TO_CART_INPUT_VALIDATION_FAILURE),a.trigger("dpLogFatalsEvent",'ERROR: Add To Cart Input Validation Failed for "'+w+'". Expected "'+q.inputs[w]+'", but received "'+k.inputs[w]+'".',"ERROR","mobileApp_addtocart_fatal")):d.updateCount(e.ADD_TO_CART_INPUT_VALIDATION_SUCCESS)}}else a.trigger("dpLogFatalsEvent","WARNING: Could not validate add to cart parameters. Could not fetch expected data",
"WARN","mobileApp_addtocart_fatal")}}});"use strict";k.when("a-checkbox","add-to-cart-parameter-name","add-to-cart-constants","natc-check").register("mobile-app-device-prereg",function(a,e,c,f){return{updateData:function(d){var h=a("#account-linking");if(f.getShouldUseNatc()&&0<h.size()){var g=e.constructParameterName(c.ITEM_TYPES.BASE,0,c.PARAMETER_PATHS.DEVICEPREREGISTRATION);d.inputs[g]=h.isChecked()?"true":"false"}return d}}});"use strict";k.when("add-to-cart-parameter-name","add-to-cart-constants").register("atc-eligibility",
function(a,e){var c={};return{updateEligibilityData:function(f){var d=a.constructParameterName(e.ITEM_TYPES.BASE,0,e.PARAMETER_PATHS.ASIN),h=a.constructParameterName(e.ITEM_TYPES.BASE,0,e.PARAMETER_PATHS.OFFER_LISTING_ID);f.inputs.programEligibility=JSON.stringify({primaryAsinData:{asin:f.inputs[d],offerListingId:f.inputs[h]},eligibility:c});return f},registerProgramEligibility:function(a,d){a&&(c[a]=d)}}});"use strict";k.when("A","aw-mash").register("patc-csm-init",function(a,e){function c(){return"true"===
a.$("#uss-mobileApp").val()&&a.$("#ussEligible").length&&"1"===a.$("#ussEligible").val()}var f;"use strict";return{initialize:function(){c()||k.when("ax:csm-metrics","ax:constants").execute(function(a,c){a.initLatencyTime(c.CSM_PREFIX);f=a})},recordAXControlMetric:function(a){!c()&&f&&((a=a.http.getResponseHeader("x-amz-rid"))?f.mapRequestToLatencyMetrics(a):f.updateCount("no-rid"),f.recordLatencyTime("ld"))}}});"use strict";k.when("A","mash").register("aw-mash",function(a,e){return e});"use strict";
k.when("A").execute("tnr-hack-acknowledgement",function(a){function e(){}function c(c,d){a.trigger("dp:click-to-buyable",{featureName:d});c.addEventListener("touchstart",function(a){var c="tnr-post-ack-"+d;a.ack&&(a.ack(),h(c,h(c)||1))})}function f(a,c,d){m("tnr-"+a+"-marked");m("tnr-"+a+"-"+c+"-seen");h("tnr-features-tracked",h("tnr-features-tracked")||1);d?h("tnr-"+a+"-element-exist",1):h("tnr-"+a+"-element-does-not-exist",1)}var d=g.ue,h=d&&d.count||e,m=d&&d.tag||e,B={imageBlock:"tnr-imageblock",
mobile_buybox:"tnr-mobile_buybox",buybox:"tnr-buybox",buyBoxAccordion:"tnr-buyboxaccordion",buyBoxAccordionApp:"tnr-buyboxaccordionapp",mobileapp_buybox:"tnr-mobileapp_buybox",pantryBuyBox:"tnr-pantrybuybox",agsTips:"tnr-agstips"};a.each({imageBlock:["imageBlock"],buybox:"mobile_buybox buybox buyBoxAccordion buyBoxAccordionApp mobileapp_buybox pantryBuyBox agsTips".split(" ")},function(d,e){a.each(d,function(a){var d=a+"_feature_div",g=document.getElementById(d);g?(c(g,e),f(e,a,!0)):B[a]&&k.when(B[a]).execute(function(){var g=
document.getElementById(d);g?(c(g,e),f(e,a,!1)):h("tnr-"+e+"-element-not-available",1)})})});var p=a.$;a.each(["#atc-declarative","#atc-twister-declarative","#prohibitedBuyBox-popover"],function(c){p(c).each(function(){var d=p(this).attr("id")||"unknown-id",e=p(this).data("action")||"unknown-action";m("tnr-atc-marked");"#atc-twister-declarative"===c&&a.trigger("dp:click-to-buyable",{featureName:"atc"});m("tnr-atc-"+d+"-"+e+"-seen");h("tnr-features-tracked",h("tnr-features-tracked")||1)})});(d=document.getElementById("#prohibited-buybox-addToCart"))&&
d.addEventListener("touchstart",function(a){a.ack&&(a.ack(),h("tnr-post-ack-atc",h("tnr-post-ack-atc")||1))})});"use strict";"use strict";"use strict";k.when("A").register("sns-buybox-validation-on-patc",function(a){function e(a){g.ue&&g.ue.count(a,(ue.count(a)||0)+1)}return{updateSnSBuyingOptionData:function(c){try{var f=!1;if(0<a.$("#snsAccordionRowMobileAppMiddle").length){e("snsBuyBoxPresentInDetailPageMobileApp");var d=!0;a.state.parse();var g=a.state("sns-defaulting-status");a.state.replace("sns-defaulting-status",
{});g!==m&&"boolean"===typeof g.value?(f=g.value)?e("snsIsDefaultBuyingOptionInDetailPageMobileApp"):e("snsIsNotDefaultBuyingOptionInDetailPageMobileApp"):e("snsDefaultingStatusMissingInDetailPageMobileApp")}else e("snsBuyBoxAbsentInDetailPageMobileApp"),d=!1;c.inputs.isSnSBuyingOptionPresent=d;c.inputs.isSnSDefaultBuyingOption=f;return c}catch(u){return e("updatingSnSBuyBoxDataExceptionMetric"),c}}}})});
/* ******** */
(function(r){var x=window.AmazonUIPageJS||window.P,E=x._namespace||x.attributeErrors,A=E?E("QuantitySelectorAssets",""):x;A.guardFatal?A.guardFatal(r)(A,window):A.execute(function(){r(A,window)})})(function(r,x,E){function A(n){var f=!1;r.now(n).execute("qsAssetDuplicationGuard",function(a){f=!!a});return f}function L(n,f){if(!A(n))try{r.register(n,f)}catch(a){if(!a.message.includes("reregistered by QuantitySelectorAssets"))throw a;}}function Da(){var n=arguments;return{register:function(f,a){if(!A(f))try{r.when.apply(r,
n).register(f,a)}catch(c){if(!c.message.includes("reregistered by QuantitySelectorAssets"))throw c;}},execute:function(f,a){r.when.apply(r,n).execute(f,a)}}}L("QSAssetDuplicationGuard",function(){return{register:L,when:Da}});"use strict";r.when("QSAssetDuplicationGuard").execute("qsAUIDeps-main-duplication-guard",function(n){n.when("A","QuantitySelectorConstants","a-util").execute("qsAUIDeps-main",function(f,a,c){function h(){w&&w.enableCheckoutCompatibility&&g()}function g(){f.$('span[id^\x3d"'+
a.getQsWidgetSummaryPriceId("")+'"][data-a-color\x3d"price"]').each(function(){f.$(this)[0].style.color="#B12704"});f.$('span[id^\x3d"'+a.getQsWidgetButtonId("")+'"]').each(function(){var a=f.$(this);a.hasClass("a-button-dropdown")&&a.hasClass("a-button-small")&&(a=a.attr("id"),f.$('button[id^\x3d"'+a+'-announce"]').each(function(){f.$(this)[0].style.paddingRight="17px"}))})}function k(a){function c(a){return f.$(a+"-announce")}return function(a){return new c(a)}}function F(c){var d=function(a,d){var e=
a+"-extradata",k=c.state(e);if(null==d)return e=c.state(a),d=f.$.extend({},e,k);k=f.$.extend({},k,d);c.state(e,k)};d.parse=function(){for(var d=f.$(a.getQsWidgetGenericStateSelectorQuery()),k=a.getQsWidgetConfigurationId(""),e=0;e<d.length;e++)try{var l=d[e].getAttribute("data-a-state"),q=JSON.parse(l).key;if(q&&q.substring(0,k.length)==k){var t=c.state(q);if(!t||!t.id){var g=JSON.parse(d[e].innerHTML);c.state(q,g)}}}catch(N){var F=a.getQsWidgetConfigurationJsonString(),w=a.getQsWidgetStateAttributeJsonString();
if(l.includes(w)||d[e].innerHTML.includes(F))throw N;}};d.replace=function(a,d){a+="-extradata";"function"===typeof c.state.replace?c.state.replace(a,d):c.state(a,d)};return{state:d}}var w;r.when("QuantitySelectorAUIDeps_AState","QuantitySelectorAUIDeps_AButton").execute("qsAUIDeps-register",function(a,d){n.register("QuantitySelectorAUIDeps",function(){return{aUtil:c,aState:a.object,aButton:d.object,initialize:h}})});(function(){for(var c=f.$(a.getQsWidgetGenericStateSelectorQuery()),d=a.getQsWidgetGlobalConfigurationId(),
k=0;k<c.length;k++)try{var g=c[k].getAttribute("data-a-state"),e=JSON.parse(g).key;if(e&&e.substring(0,d.length)==d){w=JSON.parse(c[k].innerHTML);break}}catch(t){var l=a.getQsWidgetConfigurationJsonString(),q=a.getQsWidgetStateAttributeJsonString();if(g.includes(q)||c[k].innerHTML.includes(l))throw t;}})();(function(){w&&w.enableCheckoutCompatibility?(r.when("a-state").execute("qsAUIDeps-checkout-compat-a-state-register",function(a){n.register("QuantitySelectorAUIDeps_AState",function(){return{object:F(a)}})}),
r.when("a-buttons").execute("qsAUIDeps-checkout-compat-a-button-register",function(a){n.register("QuantitySelectorAUIDeps_AButton",function(){return{object:k(a)}})}),f.on("checkout:afterReload",function(){f.trigger(a.getQsWidgetEventInitialize(),!1)})):(r.when("a-state").execute("qsAUIDeps-a-state-register",function(a){n.register("QuantitySelectorAUIDeps_AState",function(){return{object:a}})}),r.when("a-button").execute("qsAUIDeps-a-button-register",function(a){n.register("QuantitySelectorAUIDeps_AButton",
function(){return{object:a}})}));f.on("a:pageUpdate ready",function(){f.trigger(a.getQsWidgetEventInitialize(),!1)})})();h()})});"use strict";r.when("QSAssetDuplicationGuard").execute("qsConstants-duplication-guard",function(n){n.when("A").register("QuantitySelectorConstants",function(f){function a(a){return"qs-widget-configuration-"+a}var c={height:358,heightWithAtc:410,disclaimerTextAdjustment:41,disclaimerTextAdjustmentWithAtc:40},h={height:303,heightWithAtc:355,disclaimerTextAdjustment:41,disclaimerTextAdjustmentWithAtc:40},
g={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"},getQsWidgetEventSelectQuantityClientUpdate:function(){return"quantity-selector-widget:selectQuantity:clientUpdate"},getQsWidgetEventHideDropdown:function(){return"quantity-selector-widget:hideDropdown"},getQsWidgetEventSyncStepperQuantity:function(){return"quantity-selector-widget:sync-stepper-quantity"},
getQsWidgetEventSyncStepperQuantityFromIcdpToHostPage:function(){return"quantity-selector-widget:sync-stepper-quantity:icdp-to-host"},getQsWidgetEventInitialized:function(){return"quantity-selector-widget:initialized"},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"},
getQsWidgetInitialViewChooseQuantity:function(){return"choose_quantity"},getQsWidgetActionTriggerOnConfirmation:function(){return"on_confirmation"},getQsWidgetActionTriggerOnSelect:function(){return"on_select"},getQsWidgetGlobalConfigurationId:function(){return"qs-widget-global-configuration"},getQsWidgetConfigurationId:a,getQsWidgetStateScriptSelectorQuery:function(c){return"script[data-a-state*\x3d'"+a(c)+"'], "+("div[data-a-state*\x3d'"+a(c)+"']")},getQsWidgetGenericStateSelectorQuery:function(){return"script[type\x3d'a-state'], div[data-a-state]"},
getQsWidgetStateAttributeJsonString:function(){return"qs-widget-"},getQsWidgetConfigurationJsonString:function(){return"qsItems"},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},getQsWidgetStepperId:function(a){return"qs-widget-stepper-"+a},getQsWidgetAtcButtonId:function(a){return"qs-widget-atc-button-"+a},getQsWidgetPlusButtonId:function(a){return"qs-widget-plus-button-"+a},getQsWidgetMinusButtonId:function(a){return"qs-widget-minus-button-"+
a},getQsWidgetDropdownContainerGenericId:function(){return"qs-widget-dropdown-container-"},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},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},getQsWidgetBottomSheetPriceTextId:function(a){return"qs-widget-bottom-sheet-price-text-"+
a},getQsWidgetBottomSheetContainerId:function(a){return"qs-widget-bottom-sheet-container-"+a},getQsWidgetBottomSheetQuantitySuffixId:function(a){return"qs-widget-bottom-sheet-quantitySuffix-"+a},getQsWidgetBottomSheetBackButtonId:function(a){return"qs-widget-bottom-sheet-back-button-"+a},getQsWidgetBottomSheetBackButtonDecl:function(){return"qs-widget-bottom-sheet-back-button-decl"},getQsWidgetSummaryDisclaimerId:function(a){return"qs-widget-summary-disclaimer-"+a},getQsWidgetSummaryDisclaimerContainerId:function(a){return"qs-widget-summary-disclaimer-container-"+
a},getQsWidgetBottomSheetTemplateId:function(){return"qs-widget-bottom-sheet-container-qsUID"},getQsWidgetBottomSheetSelectQuantityTextId:function(a){return"qs-widget-bottom-sheet-select-quantity-text-"+a},getQsWidgetBottomSheetImageId:function(a){return"qs-widget-bottom-sheet-image-"+a},getQsWidgetBottomSheetUnitTextId:function(a){return"qs-widget-bottom-sheet-unit-text-"+a},getQsWidgetBottomSheetTableId:function(a){return"qs-widget-bottom-sheet-table-"+a},getQsWidgetBottomSheetPpuTextId:function(a){return"qs-widget-bottom-sheet-ppu-text-"+
a},getQsWidgetInitialViewTextLinkId:function(a){return"qs-widget-link-"+a},getQsWidgetBottomSheetHeightConfig:function(a){return a?c:h},getQsWidgetBottomSheetDropDownScrollFactor:function(){return g},getQsWidget1DBottomSheetSelectorCssClass:function(){return"qs-widget-new-1d-dropdown-li"},getQsWidget2DBottomSheetQuantitySelectorCssClass:function(){return"qs-widget-new-2d-dropdown-qs-li"},getQsWidget2DBottomSheetVariationSelectorCssClass:function(){return"qs-widget-new-2d-dropdown-vs-li"},getQsWidgetVariationSelectorListMapKey:function(){return"variationSelectorListsMap"},
getQsWidgetVariationSelectorSelectedIdKey:function(){return"selectedId"},getQsWidgetVariationSelectorDisplayTextKey:function(){return"displayText"},getQsWidgetVariationSelectorDisplayTextWithQuantityKey:function(){return"displayTextWithQuantity"},getQsWidgetStepperIncrementDecl:function(){return"qs-widget-increment-decl"},getQsWidgetStepperDecrementDecl:function(){return"qs-widget-decrement-decl"},getQsWidgetStepperDecrementMinusIconId:function(a){return"qs-widget-decrement-minus-icon-"+a},getQsWidgetStepperDecrementTrashIconId:function(a){return"qs-widget-decrement-trash-icon-"+
a},getQsWidgetStepperAddToCartReftag:function(){return"_qs_atc"},getQsWidgetStepperDecrementReftag:function(){return"_qs_rm"},getQsWidgetStepperIncrementReftag:function(){return"_qs_add"},getQsWidgetBottomSheetReftag:function(){return"_qs_udt"},getQsWidgetStepperShapeType:function(){return"QUANTITY_STEPPER"},getQsWidgetSimplifiedStepperShapeType:function(){return"SIMPLIFIED_QUANTITY_STEPPER"},getQsWidgetDropdownItemIdPrefix:function(){return"qs-widget-dropdown-item-"},getQsWidgetCadenceDropdownItemId:function(a,
c){return"qs-widget-cadence-dropdown-item-"+c+"-"+a},getTabKeyCode:function(){return 9},getReturnKeyCode:function(){return 13}}})});"use strict";r.when("QSAssetDuplicationGuard").execute("qsMetadata-duplication-guard",function(n){n.when("A","QuantitySelectorState","QuantitySelectorAUIDeps").register("QuantitySelectorMetadata",function(f,a,c){function h(c){return(c=a.getQsWidgetConfiguration(c).metadata)?JSON.parse(c):null}return{isWeblabEnabled:function(a,c,f){a:{if((a=h(a))&&a.weblabs)for(var g=
0;g<a.weblabs.length;g++){var k=a.weblabs[g];if(k.weblabName==c){c=k.treatment;break a}}c=null}return null==c?f:"T1"==c?!0:!1},getMetaConfiguration:function(a,c){return(a=h(a))?a[c]:null}}})});"use strict";r.when("A","QSAssetDuplicationGuard").execute("qsMetrics-duplication-guard",function(n,f){f.when("A","QuantitySelectorAUIDeps","QuantitySelectorConstants").register("QuantitySelectorMetrics",function(a,c,f){function g(a){x.ue&&x.ue.count&&a&&ue.count(a,(ue.count(a)||0)+1)}r.when("ready").execute(function(){a.now()});
return{incrementInitializeCount:function(a,c){var f="QuantitySelector-Initialize";f=a?f+"-Success-Count":f+"-Failed-Count";g(c?f+":mobile":f+":desktop")},incrementInvalidIdCount:function(){g("QuantitySelector-InvalidID")},incrementTriggerActionCount:function(a,c,f){a="QuantitySelector-TriggerAction-"+a;a=c?a+"-Success-Count":a+"-Failed-Count";g(f?a+":mobile":a+":desktop")},incrementChangeLinkCount:function(){g("QuantitySelector-ChangeLink-Count")},incrementShowPopup:function(a){var c="QuantitySelector-ShowPopup-Count";
g(a?c+":mobile":c+":desktop")},incrementQsItemNotFound:function(a,c){var f="QuantitySelector-QsItemNotFound-Count";g(a?f+":mobile:"+c:f+":desktop:"+c)},logLatencyMetric:function(a,c,f){a="QuantitySelector-TimeTo-"+a;x.ue&&x.ue.count&&a&&"undefined"!==typeof x.ue_t0&&(c-=x.ue_t0,ue.count(a,c),ue.count(a+"Hundredths",Math.floor(c/10)))},incrementQsWidgetFailToRender:function(){g("QuantitySelector-QsWidgetFailToRender-Count")},logCsm:function(a,g){var h=c.aState.state(f.getQsWidgetConfigurationId(a));
if(h&&(a="mobile"==h.viewType.toLowerCase()?"mob":"dsk",(h=h.qsCsm)&&h.almBrandRefMarker&&h.pageRefMarker)){a:{var k=h.sellingUomDimension;var d=h.pricingUomDimension;if(k&&d){var m="s";switch(k){case "count":m+="u";break;case "weight":m+="w";break;default:k=void 0;break a}m+="p";switch(d){case "count":m+="u";break;case "weight":m+="w";break;default:k=void 0;break a}k=m}else k=void 0}k&&(g={pageType:h.pageType,subPageType:h.subPageType,pageTypeId:h.pageTypeId,storeName:h.tabId,programRegionId:h.programRegionId,
hitType:h.hitType,refMarker:h.almBrandRefMarker+"_"+a+"_"+h.pageRefMarker+"_qs_"+g+"_"+k,fromTabName:h.fromTabName,toTabName:h.toTabName},x.ue&&x.ue.event&&ue.event(g,"quantityselector_attr","quantityselector.QuantityselectorMetrics.2"))}}}})});"use strict";r.when("QSAssetDuplicationGuard").execute("qsState-duplication-guard",function(n){n.when("A","QuantitySelectorConstants","QuantitySelectorMetrics","QuantitySelectorAUIDeps").register("QuantitySelectorState",function(f,a,c,h){function g(c){var d=
h.aState.state(a.getQsWidgetConfigurationId(c));F(c)||(k(c),d=h.aState.state(a.getQsWidgetConfigurationId(c)));return d}function k(c){if(c){var d=a.getQsWidgetConfigurationId(c),e=a.getQsWidgetStateScriptSelectorQuery(c);try{var l=f.$(e).first(),q=JSON.parse(l.html());h.aState.state(d,q);if(q&&q.staticData){var m=JSON.parse(q.staticData).asin;v(m,c)}}catch(O){if(c=a.getQsWidgetConfigurationJsonString(),l.html().includes(c))throw O;}}}function F(c){return(c=h.aState.state(a.getQsWidgetConfigurationId(c)))&&
c.id?!0:!1}function w(a){var c=g(a),e=c.selectedId;c=c.selectedQuantity;0==c||c?d(a,c):e&&p(a,e)}function p(c,d){d={previousSelectedId:d,previousSelectedQuantity:null};h.aState.state(a.getQsWidgetConfigurationId(c),d)}function d(c,d){d={previousSelectedQuantity:d,previousSelectedId:null};h.aState.state(a.getQsWidgetConfigurationId(c),d)}function m(){for(var c=[],d=f.$(a.getQsWidgetGenericStateSelectorQuery()),e=a.getQsWidgetConfigurationId(""),l=0;l<d.length;l++)try{var m=d[l].getAttribute("data-a-state"),
g=JSON.parse(m).key;if(g&&g.substring(0,e.length)==e){var h=g.substring(e.length);c.push(h)}}catch(D){var k=a.getQsWidgetStateAttributeJsonString();if(m.includes(k))throw D;}return c}function v(a,c){var d;if(d=a&&c)d="f3cart"!==g(c).clientId;d&&e(c)&&(l[a]||(l[a]=new Set),l[a].add(c))}function e(c){c=g(c);return c.shapeType===a.getQsWidgetStepperShapeType()||c.shapeType===a.getQsWidgetSimplifiedStepperShapeType()}var l={};f.on(a.getQsWidgetEventConfigureList(),function(a){"function"===typeof a&&a(m())});
f.on(a.getQsWidgetEventConfigureGet(),function(a,c){a=g(a);"function"===typeof c&&c(a)});f.on(a.getQsWidgetEventConfigureSet(),function(c,d){h.aState.state.replace(a.getQsWidgetConfigurationId(c),d);f.trigger(a.getQsWidgetEventInitialize(),!0,c)});return{getQsWidgetConfiguration:g,loadQsWidgetStateConfiguration:function(a){if(!F(a))k(a);else if(a)try{var c=g(a),d=JSON.parse(c.staticData).asin;v(d,a)}catch(y){}},reloadQsWidgetStateConfiguration:k,saveOriginalSettings:function(a){},setEnable:function(c,
d){d={enable:d};h.aState.state(a.getQsWidgetConfigurationId(c),d)},setInitialized:function(c){h.aState.state(a.getQsWidgetConfigurationId(c),{initialized:!0})},setSelectedId:function(c,d,e){"SIMPLIFIED_QUANTITY_STEPPER"!==g(c).shapeType&&(e||w(c),d={selectedId:d,selectedQuantity:null},h.aState.state(a.getQsWidgetConfigurationId(c),d))},setSelectedQuantity:function(c,d,e){e||w(c);d={selectedId:null,selectedQuantity:d};h.aState.state(a.getQsWidgetConfigurationId(c),d)},setPreviousSelectedId:p,setPreviousSelectedQuantity:d,
setData:function(c,d){h.aState.state(a.getQsWidgetConfigurationId(c),d)},getQsUIDs:m,getQsWidgetMapSet:function(a){return l[a]},isStepper:e}})});"use strict";r.when("QSAssetDuplicationGuard").execute("qsTemplates-duplication-guard",function(n){n.when("A","QuantitySelectorState","QuantitySelectorConstants","QuantitySelectorAUIDeps","QuantitySelectorUtils").register("QuantitySelectorTemplates",function(f,a,c,h,g){function k(a,c){f.$("#"+a+" .replace-qsUID").each(function(){var a=f.$(this).attr("id");
f.$(this).attr("id",a.replace("qsUID",c))})}return{generateBottomSheet:function(h){var w=g.getQsWidgetBottomSheetTemplateElement().clone(!0);w.appendTo(g.getQsWidgetContainer(h));w.attr("id",c.getQsWidgetBottomSheetContainerId(h));var p=a.getQsWidgetConfiguration(h);w.attr("cel_widget_id","qs-widget-metric-"+p.qsMetricID+"-bottomsheet");w.addClass(p.cssClass);k(c.getQsWidgetBottomSheetContainerId(h),h);g.getQsWidgetBottomSheetSelectQuantityTextElement(h).text(g.replaceNbspWithPlainTextNbsp(p.bottomSheetSelectQuantityText));
g.getQsWidgetBottomSheetUnitTextElement(h).text(g.replaceNbspWithPlainTextNbsp(p.bottomSheetSelectQuantityUnitText));g.getQsWidgetBottomSheetUnitTextElement(h).attr("aria-label",p.bottomSheetSelectQuantityUnitAriaLabelText);g.getQsWidgetBottomSheetPpuTextElement(h).text(g.replaceNbspWithPlainTextNbsp(p.bottomSheetPricePerUnitText));g.getQsWidgetBottomSheetPriceTextElement(h).text(g.replaceNbspWithPlainTextNbsp(p.estTotalPriceText));g.getQsWidgetBottomSheetImageElement(h).attr("src",p.bottomSheetImageUrl);
p.summaryDisclaimerText?g.getQsWidgetSummaryDisclaimerElement(h).text(g.replaceNbspWithPlainTextNbsp(p.summaryDisclaimerText)):(g.getQsWidgetBottomSheetTableElement(h).attr("style","border-bottom: 0px solid !important;"),g.getQsWidgetSummaryDisclaimerContainerElement(h).remove());"right"===p.currencySymbolPosition&&g.getQsWidgetSummaryPriceSymbolElement(h).insertAfter(g.getQsWidgetSummaryPriceFractionElement(h));w=g.getQsWidgetSummaryAtcButtonAsComponent(h);a.isStepper(h)?w.text(g.replaceNbspWithPlainTextNbsp(p.bottomSheetUpdateCartText)):
w.text(g.replaceNbspWithPlainTextNbsp(p.bottomSheetAddToCartText));f.declarative.create(g.getQsWidgetSummaryAtcButton(h),c.getQsWidgetSummaryAtcDecl(),{qsUID:h})}}})});"use strict";r.when("QSAssetDuplicationGuard").execute("qsUtils-duplication-guard",function(n){n.when("A","QuantitySelectorState","QuantitySelectorConstants","QuantitySelectorAUIDeps","QuantitySelectorMetrics").register("QuantitySelectorUtils",function(f,a,c,h,g){function k(b){return"true"==b||1==b?!0:!1}function n(b){b=a.getQsWidgetConfiguration(b);
return b.clientId?b.clientId:"unrec-client"}function w(b){return"mobile"==a.getQsWidgetConfiguration(b).viewType.toLowerCase()?!0:!1}function p(b){return a.getQsWidgetConfiguration(b).shapeType===c.getQsWidgetSimplifiedStepperShapeType()}function d(b){var c=a.getQsWidgetConfiguration(b);return p(b)||"undefined"!=typeof c.showATCButtonWhenZeroQuantity&&c.showATCButtonWhenZeroQuantity?!0:!1}function m(b){b=a.getQsWidgetConfiguration(b);return k(b.showConfirmationView)?!0:!1}function v(b){b=a.getQsWidgetConfiguration(b);
return k(b.allowZeroQuantity)?!0:!1}function e(b){return a.getQsWidgetConfiguration(b).initialView.toLowerCase()==c.getQsWidgetInitialViewChooseQuantity()?!0:!1}function l(b){b=y(b);return null==b||1>b.length?!1:!0}function q(b){if(b)try{var c=a.getQsWidgetConfiguration(b);return JSON.parse(c.staticData).storeId}catch(P){}}function t(b){b=a.getQsWidgetConfiguration(b).variationSelectorListsMap;if(null==b)return null;b=Object.keys(b);return null==b||1>b.length?null:b[0]}function r(b,c){var u=a.getQsWidgetConfiguration(b).variationSelectorListsMap;
if(null==u)return null;null==c&&(c=t(b));return null==c?null:u[c]}function y(b,a){b=r(b,a);return null==b?null:b.selectorItems}function A(b){return a.getQsWidgetConfiguration(b).bottomSheetChangeCurrentQuantityText}function N(b,a){b=B(b,a).quantityText;return"+"==b.substr(b.length-1)?{result:!0,initialQuantityText:b.substr(0,b.length-1)}:{result:!1}}function O(b,c){var u=a.getQsWidgetConfiguration(b),d=u.qsItems.length;u=u.allowZeroQuantity;if(D(b)){if(1==c||u&&2==c)return!0}else if(c==d||c==d-1&&
u)return!0;return!1}function E(b,c){var u=a.getQsWidgetConfiguration(b).qsItems;if(D(b)){if(c==u.length)return!0}else if(1==c)return!0;return!1}function D(b){b=a.getQsWidgetConfiguration(b).qsItems;return z(b[b.length-1])>z(b[0])?!0:!1}function L(b){var a=Q(b);a&&f.trigger(c.getQsWidgetEventSelectQuantity(),b,a,!1);T(b);f.trigger(c.getQsWidgetEventInitialized(),b)}function U(b){b.removeClass("aok-hidden")}function ha(b){var a=f.$("#"+c.getQsWidgetQuantityChangelinkId(b));b=f.$("#"+c.getQsWidgetTextInputUpdateButtonId(b));
a.attr("draggable","false");b.attr("draggable","false")}function I(b){return f.$("#"+c.getQsWidgetContainerId(b))}function ia(b){return f.$("#"+c.getQsWidgetButtonContainerId(b))}function J(b){return h.aButton("#"+c.getQsWidgetButtonId(b))}function V(b){return f.$("#"+c.getQsWidgetStepperId(b))}function W(b){return h.aButton("#"+c.getQsWidgetAtcButtonId(b))}function X(b){return h.aButton("#"+c.getQsWidgetPlusButtonId(b))}function R(b){return f.$("#"+c.getQsWidgetButtonId(b)+"-announce")}function ja(b){return f.$("#"+
c.getQsWidgetDropdownContainerId(b))}function ka(b){return f.$("#"+c.getQsWidgetDropdownViewId(b))}function S(b){return f.$("#"+c.getQsWidgetVariationDropdownViewId(b))}function Y(b){return f.$("#"+c.getQsWidgetDropdownUnorderedListId(b))}function la(b){return f.$("#"+c.getQsWidgetTextInputContainerId(b))}function K(b){return f.$("#"+c.getQsWidgetTextInputId(b))}function ma(b){return f.$("#"+c.getQsWidgetTextInputUpdateButtonContainerId(b))}function na(b){return f.$("#"+c.getQsWidgetSummaryAtcId(b))}
function oa(b){return h.aButton("#"+c.getQsWidgetSummaryAtcId(b))}function pa(b){return f.$("#"+c.getQsWidgetBottomSheetPriceTextId(b))}function Z(b){return f.$("#"+c.getQsWidgetStepperDecrementMinusIconId(b))}function aa(b){return f.$("#"+c.getQsWidgetStepperDecrementTrashIconId(b))}function B(b,c){try{var d=a.getQsWidgetConfiguration(b);if(d.qsItems){var u=d.qsItems[parseInt(c)-1];return u.id===c?u:qa(b,c)}}catch(C){return qa(b,c)}}function qa(b,c){b=a.getQsWidgetConfiguration(b);for(var d=0;d<
b.qsItems.length;d++)if(b.qsItems[d].id==c)return b.qsItems[d]}function z(b){return parseFloat(JSON.parse(b.data).quantity)}function ra(b,a){var d=r(b,a);if(null==d)return null;d=d[c.getQsWidgetVariationSelectorSelectedIdKey()];if(null==d)return sa(b);b=y(b,a);if(null==b)return null;for(a=0;a<b.length;a++)if(b[a].id==d)return b[a];return null}function sa(b,a){b=y(b,a);if(null==b)return null;for(a=0;a<b.length;a++)if(k(b[a].isSelected))return b[a];return null}function ba(b){var c=a.getQsWidgetConfiguration(b).selectedId;
return c?c:ta(b)}function ta(b){b=a.getQsWidgetConfiguration(b);if(b.qsItems&&0!=b.qsItems.length){for(var c=0;c<b.qsItems.length;c++)if(k(b.qsItems[c].isSelected))return b.qsItems[c].id;return b.qsItems[0].id}}function ua(b,a){var d=r(b,a);if(null==d)return null;d=d[c.getQsWidgetVariationSelectorSelectedIdKey()];return null!=d?d:va(b,a)}function va(b,a){b=sa(b);return null==b?null:b.id}function Q(b){return a.getQsWidgetConfiguration(b).selectedQuantity}function wa(b,a){return 0>a?b[0].id:a>=b.length?
b[b.length-1].id:b[a].id}function xa(b,a){if(null==b)return 0;for(var c=0;c<b.length;c++)if(a==b[c].id)return c}function ca(b,a){return(b=A(b))?a+b:"Current quantity "+a}function da(b,a){return(v(b)?/^(([0-9]\d{0,2}))$/:/^(([1-9]\d{0,2})|(0[1-9]\d?)|(00[1-9]))$/).test(a)}function ya(b,a){var c=la(b),d=ma(b);ia(b).addClass("aok-hidden");U(c);var e=K(b);a&&e.val(a);a=e.val();da(b,a)&&Q(b)!==a?U(d):d.addClass("aok-hidden");w(b)?e.focus():setTimeout(function(){e.focus()},200)}function T(b){if(b){var a=
f.$("#"+c.getQsWidgetCheckboxId(b)),d=I(b);b=f.$("#"+c.getQsWidgetSpinnerId(b))}else a=f.$(c.getQsWidgetInputSelectorQueryForCheckboxes()),b=f.$(c.getQsWidgetDivSelectorQueryForSpinners()),d=f.$(c.getQsWidgetDivSelectorQueryForWidgetContainers());a.remove();b.remove();d.removeClass("qs-widget-hidden")}function za(b,c){c=c.displayTextWithQuantityList;var d=a.getQsWidgetConfiguration(b).qsItems;b=ba(b);for(var e=0;e<d.length;e++)if(d[e].id==b)return c[e];return null}function Aa(b,a){null==a&&(a=t(b));
if(null==a)return{};var d=ra(b,a);if(null==d)return{};var e=w(b)?d.displayTextForMobile:d.dissplayTextForDesktop;b=za(b,d);var u={};u[a]=JSON.parse(d.data);u[a][c.getQsWidgetVariationSelectorDisplayTextKey()]=e;u[a][c.getQsWidgetVariationSelectorDisplayTextWithQuantityKey()]=b;return u}function Ba(b,a){b=r(b,a);return null==b||null==b.actionTriggerId||""==b.actionTriggerId?null:b.actionTriggerId}function ea(b,d,e,h,m){m=a.getQsWidgetConfiguration(b);var u=m.selectedId,P=m.selectedQuantity,g=a.isStepper(b);
h=g&&h!=c.getQsWidgetStepperAddToCartReftag();var q=a.getQsWidgetConfiguration(b);var H=q.previousSelectedQuantity;q=q.previousSelectedId;H=H?H:q?z(B(b,q)):null;q=JSON.parse(m.staticData);var k=m.sellingUnit,v=m.sellingDimension;if(u)for(var t=0;t<m.qsItems.length;t++)if(m.qsItems[t].id==u){var C=JSON.parse(m.qsItems[t].data);C=f.$.extend({qsUID:b,prevSelectedQty:H,isStepperFlag:g,setQuantityFlag:h,tunneledData:d,quantityData:C,sellingUnit:k,sellingDimension:v},q,C);l(b)&&(C=f.$.extend(C,Aa(b,e)))}if(P||
0==P)C=f.$.extend({qsUID:b,prevSelectedQty:H,isStepperFlag:g,setQuantityFlag:h,tunneledData:d,sellingUnit:k,sellingDimension:v},q,{quantity:P}),l(b)&&(C=f.$.extend(C,Aa(b,e)));return C}function Ca(b){var c=a.getQsWidgetConfiguration(b);if(p(b))return c.pricePerUnitText?c.pricePerUnitText:"bcPrice";b=B(b,1);if(!b||!b.price)return"";b=b.price;return b.currencySymbol+b.wholeValue+b.decimalSeparator+b.fractionValue}function fa(b){return b.replace(/&nbsp;/g," ")}var G=[];f.on(c.getQsWidgetEventTriggerAction(),
function(b,d,e,l,m){var u=a.getQsWidgetConfiguration(b);d||(d=u.actionId);u="mobile"==u.viewType.toLowerCase();var h=!1;(b=ea(b,e,null,l,m))&&b.ref&&null!=l&&(b.reftag=b.ref+l);b&&(f.trigger(c.getQsWidgetEventAction(d),b),g.incrementTriggerActionCount(d,!0,u),h=!0);h||g.incrementTriggerActionCount(d,!1,u)});f.on(c.getQsWidgetVariationEventTriggerAction(),function(b,d,e,l){var u="mobile"==a.getQsWidgetConfiguration(b).viewType.toLowerCase();e=ea(b,e);null==d&&(d=Ba(b,l));null!=d&&(f.trigger(c.getQsWidgetEventAction(d),
e),g.incrementTriggerActionCount(d,!1,u))});return{isInitialized:function(b){return(b=a.getQsWidgetConfiguration(b))?b.initialized:!1},isMobile:w,isSimplifiedStepper:p,isQsWidgetEnabled:function(b){b=a.getQsWidgetConfiguration(b);return b.hasOwnProperty("enable")?k(b.enable):!0},isQsWidgetQuantityZero:function(b){var c=a.getQsWidgetConfiguration(b);return c.selectedId&&0==z(B(b,c.selectedId))||c.selectedQuantity&&"0"==c.selectedQuantity?!0:!1},isConfirmationViewEnabled:m,isAllowZeroQuantityEnabled:v,
isInitialViewDropdown:function(b){return a.getQsWidgetConfiguration(b).initialView.toLowerCase()==c.getQsWidgetInitialViewDropdown()?!0:!1},isInitialViewTextLink:function(b){return a.getQsWidgetConfiguration(b).initialView.toLowerCase()==c.getQsWidgetInitialViewTextLink()?!0:!1},isInitialViewChooseQuantity:e,isVariationSelectorEnabled:l,getVariationSelectorItemList:r,getQsWidgetBottomSheetConfig:function(b){var d=a.getQsWidgetConfiguration(b),e=c.getQsWidgetBottomSheetHeightConfig(d.enabledBottomSheetWith2DSupport),
f=0;d.summaryDisclaimerText||(f=m(b)?e.disclaimerTextAdjustmentWithAtc:e.disclaimerTextAdjustment);return m(b)?{closeMessage:d.bottomSheetCancelText,height:e.heightWithAtc-f}:{closeMessage:d.bottomSheetDoneText,height:e.height-f}},getQsWidgetBottomSheetChangeCurrentQuantityText:A,isActionTriggerOnConfirmation:function(b){return a.getQsWidgetConfiguration(b).actionTrigger.toLowerCase()==c.getQsWidgetActionTriggerOnConfirmation()?!0:!1},isActionTriggerOnSelect:function(b){return a.getQsWidgetConfiguration(b).actionTrigger.toLowerCase()==
c.getQsWidgetActionTriggerOnSelect()?!0:!1},isVariationSelectorTriggerOnSelect:function(b){return null==b?!1:b.actionTriggerType.toLowerCase()==c.getQsWidgetActionTriggerOnSelect()},isVariationSelectorTriggerOnConfirmation:function(b){return null==b?!1:b.actionTriggerType.toLowerCase()==c.getQsWidgetActionTriggerOnConfirmation()},isTextInputRequired:N,isOrderMin:O,isOrderMax:E,isAscending:D,initializeWidget:function(b){if(p(b))L(b);else{var d=ba(b),e=Q(b),m=a.getQsWidgetConfiguration(b);if(m.qsItems)for(var h=
0;h<m.qsItems.length;h++)parseFloat(e)===z(m.qsItems[h])&&(d=m.qsItems[h].id,e=null);e?f.trigger(c.getQsWidgetEventSelectQuantity(),b,e,!1,function(){ha(b)}):d&&f.trigger(c.getQsWidgetEventSelectId(),b,d,!1,function(){ha(b)});l&&(d=ua(b),null!=d&&f.trigger(c.getQsWidgetVariationEventSelectId(),b,d,!1,function(){}));T(b);f.trigger(c.getQsWidgetEventInitialized(),b)}},activateWidget:function(b){var a=G.indexOf(b);-1<a&&G.splice(a,1);setTimeout(function(){G.push(b)},c.getQsWidgetActivateDebounce())},
deactivateWidget:function(b){b=G.indexOf(b);-1<b&&G.splice(b,1)},getActivatedQsWidgets:function(){return G},hideComponent:function(b,a){b.addClass("aok-hidden")},showComponent:U,isComponentVisible:function(b){return!b.hasClass("aok-hidden")},isElementVisible:function(b){return"hidden"!==b.css("visibility")},setElementVisibility:function(b,a){a?b.css("visibility","visible"):b.css("visibility","hidden")},setHtml:function(b,a){b.html(a)},setAtcButtonStepperText:function(b){if(a.isStepper(b)&&e(b)){var c=
a.getQsWidgetConfiguration(b),d=oa(b);d.text(fa(c.bottomSheetUpdateCartText));(c.selectedId&&0==z(B(b,c.selectedId))||"0"==c.selectedQuantity)&&d.text(fa(c.bottomSheetAddToCartText))}},setQsWidgetContainerMinWidthAndHeight:function(b){b=I(b);b.css("min-width",b.width()+"px");b.css("min-height",b.height()+"px")},resetQsWidgetContainerMinWidthAndHeight:function(b){b=I(b);b.css("min-width","0px");b.css("min-height","0px")},enableQsWidget:function(b){a.setEnable(b,!0);if(!p()){var c=J(b);b=K(b);c.enable();
b.removeClass("a-form-disabled");b.addClass("a-form-normal");b.removeAttr("disabled")}},disableQsWidget:function(b){a.setEnable(b,!1);if(!p()){var c=J(b);b=K(b);c.disable();b.removeClass("a-form-normal");b.addClass("a-form-disabled");b.attr("disabled","disabled")}},popOutDropDownContainer:function(b){var c=I(b),d=c.offset(),e=ja(b),l=d.left,m=d.top,h="unset",g=f.$(x).height(),q=a.getQsWidgetConfiguration(b).dropdownAnchorId;b=q.startsWith("qs-widget-container")?c:f.$("#"+q);if(q&&b.length){for(q=
b;!q.is(document)&&"static"===q.css("position");)q=q.parent();m-=null===q.offset()?0:q.offset().top;l-=null===q.offset()?0:q.offset().left;e.appendTo(b);q.is(document)||(g=q.height())}else e.appendTo(document.body);l+e.width()>x.scrollX+f.$(x).width()&&(l=l+c.width()-e.width());d.top-x.scrollY+e.height()>f.$(x).height()&&(h=g-m-c.height(),m="unset");e.css({left:l,top:m,bottom:h})},getQsWidgetContainer:I,getQsWidgetButtonContainer:ia,getQsWidgetButtonAsComponent:J,getQsWidgetStepperElement:V,getQsWidgetAtcButtonAsComponent:W,
getQsWidgetButton:R,getQsWidgetDropdownContainer:ja,getQsWidgetDropdownElement:function(b){return f.$("#"+c.getQsWidgetDropdownId(b))},getQsWidgetDropdownViewSelector:ka,getQsWidgetVariationDropdownViewSelector:S,getQsWidgetDropdownUnorderedListElement:Y,getQsWidgetDropdownVariationUnorderedListElement:function(b){return f.$("#"+c.getQsWidgetDropdownVariationUnorderedListId(b))},getQsWidgetDropdownItemElement:function(b,a){return f.$("#"+c.getQsWidgetDropdownItemAriaId(b,a))},getQsWidgetPlusButtonAsComponent:X,
getQsWidgetTextInputContainer:la,getQsWidgetTextInputElement:K,getQsWidgetTextInputUpdateButtonContainer:ma,getQsWidgetQuantityContainer:function(b){return f.$("#"+c.getQsWidgetQuantityContainerId(b))},getQsWidgetQuantityElement:function(b){return f.$("#"+c.getQsWidgetQuantityId(b))},getQsWidgetQuantitySuffixElement:function(b){return f.$("#"+c.getQsWidgetQuantitySuffixId(b))},getQsWidgetInitialViewSuffixElement:function(b){return f.$("#"+c.getQsWidgetInitialViewSuffixId(b))},getQsWidgetSummaryAtcButton:na,
getQsWidgetSummaryAtcButtonAsComponent:oa,getQsWidgetSummaryPriceContainerElement:function(b){return f.$("#"+c.getQsWidgetSummaryPriceId(b))},getQsWidgetSummaryPriceSymbolElement:function(b){return f.$("#"+c.getQsWidgetSummaryPriceSymbolId(b))},getQsWidgetSummaryPriceWholeElement:function(b){return f.$("#"+c.getQsWidgetSummaryPriceWholeId(b))},getQsWidgetSummaryPriceFractionElement:function(b){return f.$("#"+c.getQsWidgetSummaryPriceFractionId(b))},getQsWidgetSummaryPriceDecimalElement:function(b){return f.$("#"+
c.getQsWidgetSummaryPriceDecimalId(b))},getQsWidgetSummaryDisclaimerElement:function(b){return f.$("#"+c.getQsWidgetSummaryDisclaimerId(b))},getQsWidgetSummaryDisclaimerContainerElement:function(b){return f.$("#"+c.getQsWidgetSummaryDisclaimerContainerId(b))},getQsWidgetFooterPriceContainer:function(b){return f.$("#"+c.getQsWidgetFooterPriceContainerId(b))},getQsWidgetFooterPriceSymbolElement:function(b){return f.$("#"+c.getQsWidgetFooterPriceSymbolId(b))},getQsWidgetFooterPriceWholeElement:function(b){return f.$("#"+
c.getQsWidgetFooterPriceWholeId(b))},getQsWidgetFooterPriceFractionElement:function(b){return f.$("#"+c.getQsWidgetFooterPriceFractionId(b))},getQsWidgetFooterPriceDecimalElement:function(b){return f.$("#"+c.getQsWidgetFooterPriceDecimalId(b))},getQsWidgetFooterQuantitySuffixContainer:function(b){return f.$("#"+c.getQsWidgetFooterQuantitySuffixContainerId(b))},getQsWidgetFooterQuantitySuffixElement:function(b){return f.$("#"+c.getQsWidgetFooterQuantitySuffixId(b))},getQsWidgetBottomSheetQuantitySuffixElement:function(b){return f.$("#"+
c.getQsWidgetBottomSheetQuantitySuffixId(b))},getQsWidgetBottomSheetPriceTextElement:pa,getQsWidgetBottomSheetTemplateElement:function(){return f.$("#"+c.getQsWidgetBottomSheetTemplateId())},getQsWidgetBottomSheetSelectQuantityTextElement:function(b){return f.$("#"+c.getQsWidgetBottomSheetSelectQuantityTextId(b))},getQsWidgetBottomSheetImageElement:function(b){return f.$("#"+c.getQsWidgetBottomSheetImageId(b))},getQsWidgetBottomSheetUnitTextElement:function(b){return f.$("#"+c.getQsWidgetBottomSheetUnitTextId(b))},
getQsWidgetBottomSheetTableElement:function(b){return f.$("#"+c.getQsWidgetBottomSheetTableId(b))},getQsWidgetBottomSheetPpuTextElement:function(b){return f.$("#"+c.getQsWidgetBottomSheetPpuTextId(b))},getQsWidgetInitialViewTextLinkElement:function(b){return f.$("#"+c.getQsWidgetInitialViewTextLinkId(b))},getQsWidgetAtcButton:function(b){return f.$("#"+c.getQsWidgetAtcButtonId(b))},getQsWidgetPlusButton:function(b){return f.$("#"+c.getQsWidgetPlusButtonId(b))},getQsWidgetMinusButton:function(b){return f.$("#"+
c.getQsWidgetMinusButtonId(b))},getQsWidgetStepperDecrementMinusIconElement:Z,getQsWidgetStepperDecrementTrashIconElement:aa,getQsItem:B,getQsItemQuantity:z,getClientId:n,getClosestDecrementalQsItem:function(b,c){b=a.getQsWidgetConfiguration(b).qsItems;for(var d=Number.MAX_SAFE_INTEGER,e=0,f=0;f<b.length;f++){var l=c-z(b[f]);0<=l&&l<d&&(d=l,e=f)}return b[e]},getClosestIncrementalQsItem:function(b,c){b=a.getQsWidgetConfiguration(b).qsItems;for(var d=Number.MAX_SAFE_INTEGER,e=0,f=0;f<b.length;f++){var l=
z(b[f])-c;0<=l&&l<d&&(d=l,e=f)}return b[e]},getNextDecrementQsItem:function(b,c){var d=a.getQsWidgetConfiguration(b).qsItems;c=parseInt(c);D(b)&&0<c-1?--c:!D(b)&&c+1<=d.length&&(c+=1);return B(b,c)},getNextIncrementQsItem:function(b,c){var d=a.getQsWidgetConfiguration(b).qsItems;c=parseInt(c);D(b)&&c+1<=d.length?c+=1:!D(b)&&0<c-1&&--c;return B(b,c)},getVariationSelectorItemById:function(b,a,c){b=y(b,c);if(null==b)return null;for(c=0;c<b.length;c++)if(b[c].id==a)return b[c];return null},getSelectedVariationSelectorItem:ra,
getSelectedQsItemId:ba,getInitialSelectedQsItemId:ta,getSelectedQuantity:Q,getInitialSelectedVariationSelectorItemId:va,getSelectedVariationSelectorItemIdData:function(b,a,d){null==d&&(d=t(b));if(null==d)return null;b={};b[c.getQsWidgetVariationSelectorSelectedIdKey()]=a;a={};a[c.getQsWidgetVariationSelectorListMapKey()]={};a[c.getQsWidgetVariationSelectorListMapKey()][d]=b;return a},getSelectedVariationSelectorItemId:ua,getQsItemFromQuantityTextOrQuantity:function(b,c){b=a.getQsWidgetConfiguration(b).qsItems;
if(!b)return null;for(var d=0;d<b.length;d++)if("string"===typeof c&&c.toLowerCase()==b[d].quantityText.toLowerCase()||parseFloat(c)==z(b[d]))return b[d]},getQsItemFromQuantity:function(b,c){b=a.getQsWidgetConfiguration(b);b=b.qsItems?b.qsItems:{};c=parseFloat(c);for(var d=0;d<b.length;d++)if(z(b[d])==c)return b[d]},getFocusedQsItemIdInBottomSheet:function(b){var d=ka(b).scrollTop(),e=c.getQsWidgetBottomSheetDropDownScrollFactor();d=parseInt((d-e.constant+e.adjustment)/e.increment);b=a.getQsWidgetConfiguration(b).qsItems;
return wa(b,d)},getFocusedVariationSelectorItemIdInBottomSheet:function(a,d){var b=S(a);if(null==b)return null;b=b.scrollTop();var e=c.getQsWidgetBottomSheetDropDownScrollFactor();b=parseInt((b-e.constant+e.adjustment)/e.increment);a=y(a,d);return wa(a,b)},getIndexFromIdInBottomSheet:function(b,c){b=a.getQsWidgetConfiguration(b).qsItems;return xa(b,c)},getAriaLabelTextForSelectOption:ca,getVariationSelectorIndexFromIdInBottomSheet:function(a,c,d){a=y(a,d);return xa(a,c)},saveQsWidgetDropdownTopPosition:function(b){var c=
Y(b);c&&c.position()&&(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 d=Y(b);return d?(d=d.position().top,(b=a.getQsWidgetConfiguration(b).scrollTop)?Math.abs(d-b)>c.getQsWidgetDropdownScrollMetricThreshold():!1):!1},generateQsDropdownDOM:function(b){var d="",e=
a.getQsWidgetConfiguration(b),f=e.qsItems;e=e.selectedId;var m=w(b);if(!f)return g.incrementQsWidgetFailToRender(),"";for(var h=0;h<f.length;h++){var q=f[h].id,k=f[h].quantityText,v=f[h].quantityTextAbbreviatedSuffix;if(m){var t=b;var n=v,p=B(t,q);v=k;if(n){var r=n.indexOf("\x3c");if(-1!=r){var y=n.indexOf("\x3c",r+1);if(n=n.substring(r,y))n=n.split("\x3e")[1],v+=". ",r=n,n=a.getQsWidgetConfiguration(t).estText,v+=n?n+" "+r:"Total est. "+r}else v=v+"."+n}p=p.price;n=pa(t).html();v=v+". "+n+" "+(p.currencySymbol+
p.wholeValue+p.decimalSeparator+p.fractionValue);p=l(t)?c.getQsWidget2DBottomSheetQuantitySelectorCssClass():c.getQsWidget1DBottomSheetSelectorCssClass();n=c.getQsWidgetDropdownItemId(t,q);r=c.getQsWidgetDropdownItemDecl();y="0";l(t)&&(y="-1");t='\x3cspan class\x3d"a-declarative" data-action\x3d"'+r+'" data-'+r+'\x3d"{\x26quot;qsUID\x26quot;:\x26quot;'+t+"\x26quot;,\x26quot;id\x26quot;:"+q+'}"\x3e\x3cli tabindex\x3d"'+y+'" role\x3d"option" id\x3d"'+n+'" aria-label\x3d"'+v+'" class\x3d"'+p+'"\x3e'+
k+"\x3c/li\x3e\x3c/span\x3e"}else{t=b;var x=v;v=f[h].id==e;p=c.getQsWidgetDropdownItemId(t,q);n=c.getQsWidgetDropdownItemAriaId(t,q);var M=c.getQsWidgetDropdownItemQuantitySuffixId(t,q);r=c.getQsWidgetDropdownDecl(t);y="";x&&(y='\x3cspan id\x3d"'+M+'" class\x3d"a-size-mini a-color-tertiary"\x3e'+x+"\x3c/span\x3e");x="false";M="qs-widget-dropdown-link";v&&(x="true",M+=" qs-widget-dropdown-link-active aok-block aok-nowrap");t='\x3cspan class\x3d"a-declarative" data-action\x3d"'+r+'" data-'+r+'\x3d"{\x26quot;qsUID\x26quot;:\x26quot;'+
t+"\x26quot;,\x26quot;id\x26quot;:"+q+'}"\x3e\x3cli tabindex\x3d"-1" role\x3d"option" id\x3d"'+p+'" aria-labelledby\x3d"'+n+'" aria-checked\x3d"'+x+'" class\x3d"qs-widget-dropdown-item"\x3e\x3ca tabindex\x3d"0" href\x3d"javascript:void(0)" draggable\x3d"false" id\x3d"'+n+'" class\x3d"'+M+'"\x3e'+k+"\x26nbsp;\x26nbsp;"+y+"\x3c/a\x3e\x3c/li\x3e\x3c/span\x3e"}d+=t}return d},generateVariationSelectorDOM:function(a,d){if(!w(a))return"";d=y(a,d);for(var b="",e=0;e<d.length;e++){var f=a,l=d[e].id,h=d[e].displayTextForMobile,
m=d[e].ariaLabelText,g=c.getQsWidget2DBottomSheetVariationSelectorCssClass(),q=c.getQsWidgetCadenceDropdownItemId(f,l);c.getQsWidgetDropdownItemAriaId(f,l);var u=c.getQsWidgetVariationDropdownItemDecl();b+='\x3cspan class\x3d"a-declarative" data-action\x3d"'+u+'" data-'+u+'\x3d"{\x26quot;qsUID\x26quot;:\x26quot;'+f+"\x26quot;,\x26quot;id\x26quot;:\x26quot;"+l+'\x26quot;}"\x3e\x3cli tabindex\x3d"-1" role\x3d"option" id\x3d"'+q+'" aria-label\x3d"'+m+'" class\x3d"'+g+'"\x3e'+h+"\x3c/li\x3e\x3c/span\x3e"}return b},
isQsWidgetTextInputValid:da,validateQsWidgetTextInput:function(a){var b=K(a),d=b.val();a=da(a,d);var e=b.parent().hasClass(c.getQsWidgetAuiInputTextWrapperClass())?b.parent():b;if(a)return b.val(d.replace(/^0{2,}$/,"0").replace(/^0+(\d+)/g,"$1")),e.removeClass("a-form-error"),e.addClass("a-form-normal"),!0;e.removeClass("a-form-normal");e.addClass("a-form-error");return!1},isUserClickInDropdown:function(a){var b=c.getQsWidgetDropdownContainerGenericId();for(a=null==a?null:a.target;null!=a;){if(a.id.substring(0,
b.length)===b)return!0;a=a.parentElement}return!1},updateQsWidgetStepper:function(b,c){if(a.isStepper(b)){var e=B(b,c),f=e.selectedText;J(b).text(f);R(b).attr("aria-label",ca(b,f));var l=Z(b),h=aa(b),m=X(b);f=V(b);var g=W(b);O(b,c)||0==z(e)?(l.addClass("aok-hidden"),h.removeClass("aok-hidden")):(l.removeClass("aok-hidden"),h.addClass("aok-hidden"));E(b,c)?(c=N(b,c),c.result?ya(b,c.initialQuantityText):"icdp"==n(b)?m.hide():m.disable()):"icdp"==n(b)?m.show():m.enable();c=a.getQsWidgetConfiguration(b);
d(b)&&(0==z(e)||"0"==c.selectedQuantity?(f.addClass("aok-hidden"),g.show()):(g.hide(),f.removeClass("aok-hidden")))}},updateSimplifiedQsWidgetStepper:function(b,c){if(p(b)){var d=a.getQsWidgetConfiguration(b);J(b).text(c);R(b).attr("aria-label",ca(b,c));var e=Z(b),f=aa(b),l=X(b),m=V(b);b=W(b);0==c||1==c?(e.addClass("aok-hidden"),f.removeClass("aok-hidden")):(e.removeClass("aok-hidden"),f.addClass("aok-hidden"));c>=d.maxQuantity?l.disable():l.enable();0==c?(m.addClass("aok-hidden"),b.show()):(b.hide(),
m.removeClass("aok-hidden"))}},showTextInput:ya,hideSpinner:T,EnableVariationSelector:function(a){a&&S(a).removeClass("qs-widget-disable")},DisableVariationSelector:function(a){a&&S(a).addClass("qs-widget-disable")},getVariationSelectorDisplayTextWithQuantity:za,getVariationSelectorActionTriggerId:Ba,getQsWidgetSelectionPayload:ea,isSUPU:function(b){var c=a.getQsWidgetConfiguration(b).qsCsm;if(c&&(b=c.sellingUomDimension,c=c.pricingUomDimension,b&&c))return"count"==b&&"count"==c?!0:!1},showATCButtonWhenZeroQuantity:d,
isConfirmationVisible:function(a){return na(a).is(":visible")},isBottomSheetExist:function(a){return h.aSheet.get(c.getQsWidgetBottomSheetId(a))?!0:!1},getStoreId:q,syncStepperQuantities:function(b,d,e,l,m,h,g){(b=a.getQsWidgetMapSet(b))&&(d||0==d)&&b.forEach(function(b){var t=q(b),v=n(b).includes("fresh-dp"),k=a.isStepper(b)&&(g||l!=b),p;if(!(p=v||!l))a:{if(l&&b){p=Ca(l);var u=Ca(b);if("bcPrice"==p||"bcPrice"==u){p=!0;break a}if(p&&u){p=p===u;break a}}p=!1}k&&p&&(e&&t&&!v?e==t&&f.trigger(c.getQsWidgetEventSelectQuantityClientUpdate(),
b,d,m,h):f.trigger(c.getQsWidgetEventSelectQuantityClientUpdate(),b,d,m,h))})},isStepper:function(b){return a.isStepper(b)},replaceNbspWithPlainTextNbsp:fa,getQsUidsFromDom:function(){var a=[],c=document.querySelectorAll('[id^\x3d"qs-widget-container-"]');if(c)for(var d=0;d<c.length;d++)a.push(c[d].id.replace("qs-widget-container-",""));return a},setAriaExpanded:function(a,c){R(a).attr("aria-expanded",c)},parseQsItemIdFromDropdownItemId:function(a){var b=c.getQsWidgetDropdownItemIdPrefix().length,
d=a.indexOf("-",b);a=a.substring(b,d);a=parseInt(a,10);return isNaN(a)?null:a},getQsWidgetMobileDropdownItemElement:function(a,d){return f.$("#"+c.getQsWidgetDropdownItemId(a,d))},getQsWidgetCadenceMobileDropdownItemElement:function(a,d){return f.$("#"+c.getQsWidgetCadenceDropdownItemId(a,d))}}})});"use strict";r.when("QSAssetDuplicationGuard").execute("qsWidget-duplication-guard",function(n){n.when("A","QuantitySelectorUtils","QuantitySelectorState","QuantitySelectorConstants","QuantitySelectorMetrics").register("QuantitySelectorWidget",
function(f,a,c,h,g){function k(c){a.deactivateWidget(c);a.setAriaExpanded(c,!1);var d=a.getQsWidgetButtonContainer(c),g=a.getQsWidgetDropdownContainer(c),e=a.getQsWidgetDropdownElement(c),l=a.getQsWidgetQuantityContainer(c),q=a.getQsWidgetSummaryAtcButton(c),t=a.getQsWidgetFooterPriceContainer(c),k=a.getQsWidgetFooterQuantitySuffixContainer(c);a.setElementVisibility(t,!0);a.setElementVisibility(k,!0);t=a.getQsWidgetTextInputContainer(c);a.isComponentVisible(t)||a.showComponent(d);a.hideComponent(g);
a.hideComponent(e);a.hideComponent(l);a.hideComponent(q);a.resetQsWidgetContainerMinWidthAndHeight(c);f.trigger(h.getQsWidgetEventHideDropdown(),c);c=a.getQsWidgetButton(c);c.length&&c.focus()}function n(d,m,g){var e=a.getQsItem(d,m),l=e.quantityText,q=e.quantityTextAbbreviatedSuffix,t=e.quantityTextFullSuffix,k=e.selectedText;e=e.price;var v=a.getQsWidgetSummaryPriceSymbolElement(d),n=a.getQsWidgetSummaryPriceWholeElement(d),p=a.getQsWidgetSummaryPriceFractionElement(d),r=a.getQsWidgetSummaryPriceDecimalElement(d);
a.setHtml(v,e.currencySymbol);a.setHtml(n,e.wholeValue);a.setHtml(p,e.fractionValue);a.setHtml(r,e.decimalSeparator);v=a.getQsWidgetQuantityElement(d);a.setHtml(v,l);l=a.getQsWidgetQuantitySuffixElement(d);q&&t?(a.setHtml(l,q),q=a.getQsWidgetInitialViewSuffixElement(d),a.setHtml(q,t)):a.setHtml(l,"");q=a.getQsWidgetFooterPriceSymbolElement(d);l=a.getQsWidgetFooterPriceWholeElement(d);v=a.getQsWidgetFooterPriceFractionElement(d);n=a.getQsWidgetFooterPriceDecimalElement(d);a.setHtml(q,e.currencySymbol);
a.setHtml(l,e.wholeValue);a.setHtml(v,e.fractionValue);a.setHtml(n,e.decimalSeparator);t&&(e=a.getQsWidgetFooterQuantitySuffixElement(d),a.setHtml(e,t));t="Current quantity "+k;a.isInitialViewDropdown(d)?(a.getQsWidgetButtonAsComponent(d).text(k),a.getQsWidgetButton(d).attr("aria-label",t+NaN)):a.isInitialViewTextLink(d)&&(e=a.getQsWidgetInitialViewTextLinkElement(d),e.text(k),e.attr("aria-label",t));a.setAtcButtonStepperText(d);c.setPreviousSelectedId(d,c.getQsWidgetConfiguration(d).selectedId);
c.setSelectedId(d,m);c.isStepper(d)&&a.updateQsWidgetStepper(d,m);g&&f.trigger(h.getQsWidgetEventTriggerAction(),d)}function r(d,m){if(!a.isSimplifiedStepper(d)){var g=a.getQsWidgetTextInputElement(d),e=g.val(),l=a.getQsWidgetButtonContainer(d),q=a.getQsWidgetTextInputContainer(d),k=a.getQsWidgetTextInputUpdateButtonContainer(d),p=a.getQsItemFromQuantityTextOrQuantity(d,e),r=c.isStepper(d);a.hideComponent(k);r&&a.getQsWidgetButtonAsComponent(d).text(e);p?(a.hideComponent(q),a.showComponent(l),n(d,
p.id,m)):(a.hideComponent(l),a.showComponent(q),g.blur(),c.setSelectedQuantity(d,e),g=c.getQsWidgetConfiguration(d),r&&a.isInitialViewChooseQuantity(d)&&0==g.selectedQuantity&&(g=a.getQsWidgetStepperElement(d),k=a.getQsWidgetAtcButtonAsComponent(d),a.hideComponent(q),a.showComponent(l),a.hideComponent(g),k.show()),m&&f.trigger(h.getQsWidgetEventTriggerAction(),d));r&&a.isInitialViewChooseQuantity(d)&&0<e&&(g=a.getQsWidgetStepperElement(d),k=a.getQsWidgetAtcButtonAsComponent(d),d=a.getQsWidgetAtcButton(d),
a.isComponentVisible(d)&&(a.showComponent(g),k.hide()))}}var p=null;f.on(h.getQsWidgetEventSelectId(),function(c,f,h,e){n(c,f,h);f=a.getQsWidgetButtonContainer(c);h=a.getQsWidgetTextInputContainer(c);c=a.getQsWidgetTextInputUpdateButtonContainer(c);a.hideComponent(c);a.hideComponent(h);a.showComponent(f);e&&e()});f.on(h.getQsWidgetEventSelectQuantity(),function(d,f,h,e){a.isSimplifiedStepper(d)?(f=f.toString(),c.setSelectedQuantity(d,f),a.updateSimplifiedQsWidgetStepper(d,f)):(g.incrementQsItemNotFound(!0,
a.getClientId(d)),a.getQsWidgetTextInputElement(d).val(f),r(d,h));e&&e()});f.on(h.getQsWidgetEventSyncStepperQuantity(),function(c,f,h,e,l,g,k){a.syncStepperQuantities(c,f,h,e,l,g,k)});f.on("commit-c5d19d5c",function(){});f.on(h.getQsWidgetEventSelectQuantityClientUpdate(),function(d,m,k,e){var l=a.getQsItemFromQuantityTextOrQuantity(d,m);l?f.trigger(h.getQsWidgetEventSelectId(),d,l.id,k,e):a.isSimplifiedStepper(d)?(m=m.toString(),c.setSelectedQuantity(d,m),a.updateSimplifiedQsWidgetStepper(d,m)):
(g.incrementQsItemNotFound(!0,a.getClientId(d)),a.getQsWidgetTextInputElement(d).val(m),r(d,k));e&&e()});return{hideAllPopover:function(){for(var c=a.getActivatedQsWidgets(),f=0;f<c.length;f++)k(c[f])},showPopover:function(d){a.activateWidget(d);a.setQsWidgetContainerMinWidthAndHeight(d);a.setAriaExpanded(d,!0);var f=a.getQsWidgetDropdownUnorderedListElement(d),h=a.getQsWidgetButtonContainer(d),e=a.getQsWidgetDropdownContainer(d),l=a.getQsWidgetDropdownElement(d),g=a.getQsWidgetQuantityContainer(d),
k=a.getQsWidgetSummaryAtcButton(d);a.setHtml(f,a.generateQsDropdownDOM(d));f=a.getQsWidgetFooterPriceContainer(d);var n=a.getQsWidgetFooterQuantitySuffixContainer(d);a.setElementVisibility(f,!1);a.setElementVisibility(n,!1);a.showComponent(l);a.hideComponent(g);a.hideComponent(k);a.showComponent(e);a.hideComponent(h);a.popOutDropDownContainer(d);e=c.getQsWidgetConfiguration(d);if((h=e.qsItems)||0!==h.length)e=e.selectedId,null===e&&(e=h[0].id),a.getQsWidgetDropdownItemElement(d,e).focus()},showConfirmation:function(c){a.activateWidget(c);
var d=a.getQsWidgetButtonContainer(c),f=a.getQsWidgetDropdownContainer(c),e=a.getQsWidgetDropdownElement(c),l=a.getQsWidgetQuantityContainer(c);c=a.getQsWidgetSummaryAtcButton(c);a.hideComponent(e);a.showComponent(l);a.showComponent(c);c.find("button").focus();a.showComponent(f);a.hideComponent(d)},showPrice:function(c,f){f=a.getQsItem(c,f).price;var d=a.getQsWidgetSummaryPriceSymbolElement(c),e=a.getQsWidgetSummaryPriceWholeElement(c),l=a.getQsWidgetSummaryPriceFractionElement(c);c=a.getQsWidgetSummaryPriceDecimalElement(c);
a.setHtml(d,f.currencySymbol);a.setHtml(e,f.wholeValue);a.setHtml(l,f.fractionValue);a.setHtml(c,f.decimalSeparator)},selectOption:n,validateAndSelectQuantity:r,selectConfirmation:function(d){if(a.isActionTriggerOnConfirmation(d)){if(c.isStepper(d)){var g=a.getSelectedQsItemId(d);a.updateQsWidgetStepper(d,g)}f.trigger(h.getQsWidgetEventTriggerAction(),d)}k(d)},stepperIncrement:function(d){var g=c.getQsWidgetConfiguration(d),k=a.isQsWidgetQuantityZero(d);if(a.isSimplifiedStepper(d)){var e=g.selectedQuantity;
if(!e)return;e=(parseInt(e)+1).toString();c.setSelectedQuantity(d,e);a.updateSimplifiedQsWidgetStepper(d,e)}else{if(g.selectedId){e=g.selectedId;var l=a.getNextIncrementQsItem(d,g.selectedId).id}else g.selectedQuantity||"0"==g.selectedQuantity?(e=g.selectedQuantity,l=a.getClosestIncrementalQsItem(d,g.selectedQuantity).id,a.getQsItemQuantity(a.getQsItem(d,l))==g.selectedQuantity&&(l=a.getNextIncrementQsItem(d,l).id)):l=a.getSelectedQsItemId(d);if(e===l)return;c.setSelectedId(d,l);a.updateQsWidgetStepper(d,
l)}if(a.showATCButtonWhenZeroQuantity(d)&&(e=a.getQsWidgetButton(d),a.getClientId(d).includes("p13n-buyagain-cards")&&(a.getQsWidgetPlusButton(d).find('input[type\x3d"submit"]').is(":focus")||e.length&&e.focus()),k)){c.isStepper(d)?(f.trigger(h.getQsWidgetEventTriggerAction(),d,null,null,h.getQsWidgetStepperAddToCartReftag()),e.length&&e.focus()):f.trigger(h.getQsWidgetEventTriggerAction(),d);return}null!=p&&clearTimeout(p);p=setTimeout(function(){f.trigger(h.getQsWidgetEventTriggerAction(),d)},g.stepperDebounceTime)},
stepperDecrement:function(d){var g=c.getQsWidgetConfiguration(d);if(a.isSimplifiedStepper(d)){var k=g.selectedQuantity;if(!k)return;k=parseInt(k)-1;var e=k.toString();if(0>=k){c.setSelectedQuantity(d,"0");f.trigger(h.getQsWidgetEventTriggerAction(),d);g=a.getQsWidgetStepperElement(d);g.addClass("aok-hidden");g=a.getQsWidgetAtcButtonAsComponent(d);g.show();return}c.setSelectedQuantity(d,e);a.updateSimplifiedQsWidgetStepper(d,e)}else{if(g.selectedId){if(k=a.getNextDecrementQsItem(d,g.selectedId).id,
k==g.selectedId){c.setSelectedId(d,null);c.setSelectedQuantity(d,"0");f.trigger(h.getQsWidgetEventTriggerAction(),d);a.showATCButtonWhenZeroQuantity(d)&&(g=a.getQsWidgetStepperElement(d),g.addClass("aok-hidden"),g=a.getQsWidgetAtcButtonAsComponent(d),g.show());return}}else if(g.selectedQuantity||"0"==g.selectedQuantity){if(k=a.getClosestDecrementalQsItem(d,g.selectedQuantity).id,"0"==g.selectedQuantity){c.setSelectedQuantity(d,"0");f.trigger(h.getQsWidgetEventTriggerAction(),d);a.showATCButtonWhenZeroQuantity(d)&&
(g=a.getQsWidgetStepperElement(d),g.addClass("aok-hidden"),g=a.getQsWidgetAtcButtonAsComponent(d),g.show());return}}else k=a.getSelectedQsItemId(d);a.updateQsWidgetStepper(d,k);c.setSelectedId(d,k)}null!=p&&clearTimeout(p);p=setTimeout(function(){f.trigger(h.getQsWidgetEventTriggerAction(),d)},g.stepperDebounceTime)}}})});"use strict";r.when("QSAssetDuplicationGuard").execute("QuantitySelector-duplication-guard",function(n){n.when("A","QuantitySelectorWidget","QuantitySelectorUtils","QuantitySelectorState",
"QuantitySelectorConstants","QuantitySelectorMetrics","QuantitySelectorAUIDeps","QuantitySelectorMetadata","QuantitySelectorTemplates").register("QuantitySelector",function(f,a,c,h,g,k,n,w,p){function d(a,d){try{var e=c.isMobile(d)}catch(t){t instanceof TypeError&&k.incrementInvalidIdCount();return}try{if(!c.isInitialized(d)||a)eval(w.getMetaConfiguration(d,"script")),h.setInitialized(d),c.initializeWidget(d),c.isQsWidgetEnabled(d)?c.enableQsWidget(d):c.disableQsWidget(d),k.incrementInitializeCount(!0,
e)}catch(t){k.incrementInitializeCount(!1,e)}}function m(a){h.loadQsWidgetStateConfiguration(a);d(!0,a)}function v(){for(var a=h.getQsUIDs(),d=0;d<a.length;d++){var f=a[d];c.isInitialized(f)||m(f)}}f.declarative(g.getQsWidgetButtonDecl(),"click",function(d){var e=d.data.qsUID;d=c.isMobile(e);var f=h.isStepper(e),g=c.isSimplifiedStepper(e),m=c.isSUPU(e),n=h.getQsWidgetConfiguration(e).selectedId,p=c.isElementVisible(c.getQsWidgetAtcButton(e));if(g||m&&f&&!n){if(c.showATCButtonWhenZeroQuantity(e)&&
!p)return;d&&!c.isBottomSheetExist(e)&&a.getBottomSheet(e);a.stepperIncrement(e)}else d?a.showBottomSheet(e):a.showPopover(e);k.incrementShowPopup(d);c.isInitialViewDropdown(e)?k.logCsm(e,"cqd"):k.logCsm(e,"ccq");setTimeout(function(){c.saveQsWidgetDropdownTopPosition(e)},250)});f.declarative(g.getQsWidgetDropdownDecl(),"click",function(d){var e=d.data.qsUID;d=d.data.id;var f=c.isActionTriggerOnSelect(e),g=c.isTextInputRequired(e,d),h=c.isConfirmationViewEnabled(e),m=c.isQsWidgetDropdownScrolled(e);
h?m?(c.setQsWidgetDropdownScrolled(e),k.logCsm(e,"dcq_scl")):(c.clearQsWidgetDropdownScrolled(e),k.logCsm(e,"dcq")):m?k.logCsm(e,"dsq_scl"):k.logCsm(e,"dsq");a.selectOption(e,d,f&&!g.result);g.result?(c.showTextInput(e,g.initialQuantityText),a.hideAllPopover()):h?a.showConfirmation(e):a.hideAllPopover()});f.declarative(g.getQsWidgetStepperIncrementDecl(),"click",function(d){d=d.data.qsUID;var e=c.getQsWidgetPlusButtonAsComponent(d),f=c.getQsWidgetPlusButton(d);c.isElementVisible(f)&&e.isEnabled()&&
a.stepperIncrement(d)});f.declarative(g.getQsWidgetStepperDecrementDecl(),"click",function(d){d=d.data.qsUID;var e=c.getQsWidgetMinusButton(d);c.isElementVisible(e)&&a.stepperDecrement(d)});f.declarative(g.getQsWidgetDropdownItemDecl(),"click",function(d){var e=d.data.qsUID;a.alignQsItem(e,d.data.id);c.isConfirmationViewEnabled(e)?c.getQsWidgetSummaryAtcButton(e).attr("tabindex","-1").focus():a.getBottomSheetContainer(e).attr("tabindex","-1").focus()});f.declarative(g.getQsWidgetDropdownItemDecl(),
"keydown",function(d){var e=d.data.qsUID,f=d.$event.which;f===g.getTabKeyCode()&&setTimeout(function(){var d=document.activeElement;d&&d.id&&d.id.startsWith("qs-widget-dropdown-item")&&(d=c.parseQsItemIdFromDropdownItemId(d.id))&&a.alignQsItem(e,d)},50);f===g.getReturnKeyCode()&&(a.alignQsItem(e,d.data.id),c.isConfirmationViewEnabled(e)?c.getQsWidgetSummaryAtcButton(e).find("button").focus():a.getBottomSheetContainer(e).attr("tabindex","-1").focus())});f.declarative(g.getQsWidgetVariationDropdownItemDecl(),
"click",function(c){a.alignVariationSelectorItem(c.data.qsUID,c.data.id)});f.declarative(g.getQsWidgetDropdownDecl(),"focusin",function(c){a.showPrice(c.data.qsUID,c.data.id)});f.declarative(g.getQsWidgetDropdownDecl(),"mouseenter",function(c){a.showPrice(c.data.qsUID,c.data.id)});f.declarative(g.getQsWidgetDropdownDecl(),"mouseleave",function(d){d=d.data.qsUID;var e=c.getSelectedQsItemId(d);a.showPrice(d,e)});f.declarative(g.getQsWidgetQuantityChangelinkDecl(),"click",function(d){d=d.data.qsUID;
h.setSelectedId(d,h.getQsWidgetConfiguration(d).previousSelectedId);a.showPopover(d);k.incrementChangeLinkCount();c.saveQsWidgetDropdownTopPosition(d);k.logCsm(d,"ccl")});f.declarative(g.getQsWidgetSummaryAtcDecl(),"click",function(d){d=d.data.qsUID;a.selectConfirmation(d);c.isQsWidgetDropdownScrolled(d)?k.logCsm(d,"atc_scl"):k.logCsm(d,"atc")});f.declarative(g.getQsWidgetTextInputDecl(),"keydown",function(a){var d=a.data.qsUID,e=a.$event.which;8==e||9==e||13==e||37<=e&&40>=e||46==e||(!(48<=e&&57>=
e||96<=e&&105>=e)||a.$event.shiftKey||a.$event.altKey||a.$event.ctrlKey||a.$event.metaKey?a.$event.preventDefault():3<=c.getQsWidgetTextInputElement(d).val().length&&a.$event.preventDefault())});f.declarative(g.getQsWidgetTextInputDecl(),"keyup",function(d){var e=d.data.qsUID;c.validateQsWidgetTextInput(e)&&13==d.$event.keyCode?(d=c.isActionTriggerOnSelect(e)||h.isStepper(e),a.validateAndSelectQuantity(e,d)):c.showTextInput(e)});f.declarative(g.getQsWidgetTextInputDecl(),"focusout",function(a){a=
a.data.qsUID;if(""===c.getQsWidgetTextInputElement(a).val()){var d=(d=h.getQsWidgetConfiguration(a).selectedId)?c.getQsItem(a,d).selectedText:c.getSelectedQuantity(a);c.showTextInput(a,d);c.validateQsWidgetTextInput(a)}});f.declarative(g.getQsWidgetTextInputDecl(),"change",function(a){c.showTextInput(a.data.qsUID)});f.declarative(g.getQsWidgetTextInputUpdateButtonDecl(),"click",function(d){var e=d.data.qsUID;c.validateQsWidgetTextInput(e)&&(e=d.data.qsUID,d=c.isActionTriggerOnSelect(e)||c.isActionTriggerOnConfirmation(e),
a.validateAndSelectQuantity(e,d))});f.$(document).click(function(d){0==c.getActivatedQsWidgets().length||c.isUserClickInDropdown(d)||(d=c.getActivatedQsWidgets()[0],c.isConfirmationVisible(d)&&h.setSelectedId(d,h.getQsWidgetConfiguration(d).previousSelectedId),a.hideAllPopover())});f.$(x).resize(function(){a.hideAllPopover()});f.on(g.getQsWidgetEventInitialize(),function(a,c){n.initialize();if("string"==typeof c)d(a,c);else{c=h.getQsUIDs();for(var e=0;e<c.length;e++)d(a,c[e])}});f.on(g.getQsWidgetEventLoadStatesAndInitialize(),
function(){try{v()}catch(e){if(e instanceof SyntaxError)f.delay(function(){try{v()}catch(l){r.logError(l)}},200);else throw e;}});f.on(g.getQsWidgetEventConfigureEnable(),function(a){c.enableQsWidget(a)});f.on(g.getQsWidgetEventConfigureDisable(),function(a){c.disableQsWidget(a)});f.on(g.getQsWidgetEventConfigureReset(),function(a){for(var c=h.getQsUIDs(),d=0;d<c.length;d++){var e=c[d];if("string"!==typeof a||a==e)h.reloadQsWidgetStateConfiguration(e),f.trigger(g.getQsWidgetEventInitialize(),!0,e)}});
c.hideSpinner();p=f.now();k.logLatencyMetric("JSReady",p);return{loadStateAndInitializeWidget:m}})})});
/* ******** */
(function(m){var r=window.AmazonUIPageJS||window.P,w=r._namespace||r.attributeErrors,q=w?w("QuantitySliderAssets@slider","QuantitySliderAssets"):r;q.guardFatal?q.guardFatal(m)(q,window):q.execute(function(){m(q,window)})})(function(m,r,w){function q(t,n){try{m.register(t,n)}catch(f){if(-1===f.message.indexOf("reregistered by QuantitySliderAssets"))throw f;}}function y(){var t=arguments;return{register:function(n,f){try{m.when.apply(m,t).register(n,f)}catch(h){if(-1===h.message.indexOf("reregistered by QuantitySliderAssets"))throw h;
}}}}m.when("QuantitySliderAssetDuplicationGuard").execute(function(t){t.when("A","quantity-slider-utils","qs-cart-update-utils").register("qs-cart-update-handler",function(n,f,h){function l(a){p||(p="quantity-slider-widget-"+a);return p}function e(a,b){if(!b.atcFormSubmitDisabled){if((a=a.$target&&a.$target.closest(".qs-atc-form"))&&0!==a.length)return a;m.log("Missing $form object","ERROR",l(b.clientName))}}function b(b,x,k){n.trigger(f.ACTIONS.ADD_TO_CART_SUBMIT_START,{asin:b,cartType:x.cartType,
clientName:x.clientName,isQSAction:k,request:x});a(b,x,!0,k)}function a(a,b,k,e){var p=b.cartType,c=JSON.stringify(e?h.getQSRequestObject(b,k,p):h.getATCRequestObject(b,p)),d=h.getAjaxUrl(b,k,p);d&&g.ajax({url:d,type:h.getHttpMethodType(k,p),data:c,headers:h.getHeadersForRequest(b,k,p),xhrFields:{withCredentials:!0},success:function(d,c,g){d.jqXHR=g;delete u[a];(d=h.adaptResponseObject(d,b,k,b.cartType))?(f.setUpdatedQSParamsForAsinOffer(a,b.additionalParams&&b.additionalParams.storeId,{quantityInCart:d.quantity,
cartItemId:d.itemId}),n.trigger(k?f.ACTIONS.ADD_TO_CART_SUBMIT_SUCCESS:f.ACTIONS.REMOVE_FROM_CART_SUBMIT_SUCCESS,{asin:a,cartType:b.cartType,request:b,response:d,clientName:b.clientName,attribution:l(b.clientName),isQSAction:e,isDecreaseQuantityAction:!k}),f.logUrl(b.loggingUrl)):m.log("Invalid Response from the server","ERROR",l(b.clientName))},error:function(d){delete u[a];d=d||{};m.log("Ajax request failed with type: "+(k?"addItems":"modifyItems")+", status code: "+d.status+", error: "+d.responseText,
"ERROR",l(b.clientName));n.trigger(f.ACTIONS.QS_CART_SUBMIT_ERROR,{asin:a,cartType:p,clientName:b.clientName,isQSAction:e,isDecreaseQuantityAction:!k,isMaxOrderQuantityReached:b.quantityInCart>=b.maxOrderQuantity,response:d,request:b});k&&b.$form&&b.$form.submit()}})}var g=n.$,p="",u={};n.declarative("qs-add-to-cart-trigger","click",function(a){var g=a.data&&a.data.asin,k=f.getQsParamsFromTargetAsinOffer(a,g);a.$event&&a.$event.preventDefault();u[g]||(u[g]=!0,k.isMultipleAsinsSubmitting=1<Object.keys(u).length,
k.$form=e(a,k),k.triggeringEvent=a,b(g,k,!1))});n.declarative("qs-slider-widget-trigger","click",function(g){var h=g.data&&g.data.asin,k=f.getQsParamsFromTargetAsinOffer(g,h),l=g.$target[0]&&g.$target[0].className||"",p=n.contains(l,"qs-increase-quantity")||n.contains(l,"qs-decrease-quantity");l=n.contains(l,"qs-decrease-quantity");g.$event&&g.$event.preventDefault();p&&!u[h]&&(u[h]=!0,k.isMultipleAsinsSubmitting=1<Object.keys(u).length,k.triggeringEvent=g,l?(n.trigger(f.ACTIONS.REMOVE_FROM_CART_SUBMIT_START,
{asin:h,cartType:k.cartType,clientName:k.clientName,isQSAction:!0,isDecreaseQuantityAction:!0,request:k}),a(h,k,!1,!0)):(k.$form=e(g,k),b(h,k,!0)))});return{setAttribution:function(a){p=a}}})});"use strict";m.when("QuantitySliderAssetDuplicationGuard").execute(function(m){m.when("A","qs-fresh-cart-update-utils").register("qs-cart-update-utils",function(n,f){function h(d){var c=d.quantityInCart||0;return{items:[{asin:d.asinId,offerListingId:d.offerListingId,quantity:c<d.minOrderQuantity?d.minOrderQuantity-
c:1}]}}function l(d,c,a){return(e.isFunction(c[a])?c[a]:c.DEFAULT)(d)}var e=n.$,b={DEFAULT:h,UFG:f.getUfgCartRequestObject},a={DEFAULT:h,UFG:f.getUfgCartRequestObject},g={DEFAULT:function(d){var c=d.quantityInCart||0;var a=d.cartItemId;a=!a||"C"!==a[0]&&"S"!==a[0]?a:a.substring(1);return{items:[{id:a,quantity:c<=d.minOrderQuantity?0:c-1}]}},UFG:f.getUfgCartRequestObject},p={DEFAULT:function(d){return d.ajaxCartUrl},UFG:function(d){return d.addToCartUrl}},u={DEFAULT:function(d){return d.ajaxCartUrl}},
m={DEFAULT:function(d){return(d=d.entity&&d.entity.items&&d.entity.items[0])?{itemId:d.id,quantity:d.quantity,isTotal:!0}:null},UFG:f.ufgCartResponseAdapter},t={DEFAULT:function(d,c){d=(c.quantityInCart||0)-1;return 0>d?null:{itemId:d?c.cartItemId:"",quantity:d,isTotal:!0}},UFG:f.ufgCartResponseAdapter},k={DEFAULT:"POST",UFG:"POST"},q={DEFAULT:"PUT",UFG:"POST"},r={DEFAULT:function(d){return{"x-api-csrf-token":d.csrfToken,"x-amzn-encrypted-slate-token":e('meta[name\x3d"encrypted-slate-token"]').prop("content"),
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(d){return{"Content-Type":"application/json","x-amzn-encrypted-slate-token":e('meta[name\x3d"encrypted-slate-token"]').prop("content")}}},c={DEFAULT:function(d){return{"x-api-csrf-token":d.csrfToken,"x-amzn-encrypted-slate-token":e('meta[name\x3d"encrypted-slate-token"]').prop("content"),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(d){return{"Content-Type":"application/json","x-amzn-encrypted-slate-token":e('meta[name\x3d"encrypted-slate-token"]').prop("content")}}};return{getATCRequestObject:function(d,c){return l(d,b,c)},getQSRequestObject:function(d,c,b){return l(d,c?a:g,b)},adaptResponseObject:function(d,c,a,b){a=a?m:t;return(e.isFunction(a[b])?a[b]:a.DEFAULT)(d,c)},getHttpMethodType:function(c,a){c=c?k:q;return c[a]?
c[a]:c.DEFAULT},getHeadersForRequest:function(d,a,b){a=a?r:c;return(e.isFunction(a[b])?a[b]:a.DEFAULT)(d)},getAjaxUrl:function(c,a,b){return l(c,a?p:u,b)}}})});"use strict";m.when("QuantitySliderAssetDuplicationGuard").execute(function(m){m.when("A").register("qs-fresh-cart-update-utils",function(n){function f(f,l){return l&&l.items?l.items.find(function(e){return e.ASIN===f}):null}return{getUfgCartRequestObject:function(f){return f.additionalInput},ufgCartResponseAdapter:function(h,l){return(l=f(l.asinId,
h.clientResponseModel))?{itemId:l.itemId,quantity:l.quantity,isTotal:!0,rawResponse:h}:{itemId:"invalidItemId",quantity:0,isTotal:!0,rawResponse:h}}}})});"use strict";m.when("QuantitySliderAssetDuplicationGuard").execute(function(m){m.when("A","quantity-slider-utils").register("quantity-slider-metrics-handler",function(n,f){function h(a,b){return"QuantitySliderWidget::"+a+"::"+(b?b+"::":"")}function l(a){var b=r.ue;"undefined"!==typeof b&&b.count(a,1)}function e(a,g){f.assert(a&&g.clientName,"Missing required properties while logging metrics");
if(g.isQSAction)if(g.isDecreaseQuantityAction){var e=b.QS_DECREASE;a=h(g.clientName,g.cartType)+a+"::"+e;l(a)}else e=b.QS_INCREASE,a=h(g.clientName,g.cartType)+a+"::"+e,l(a);else e=b.ATC,a=h(g.clientName,g.cartType)+a+"::"+e,l(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=
h(a.clientName,a.cartType)+"MaxQuantityReached";l(a)},logMultipleAsinsSubmittingMetric:function(a){a=h(a.clientName,a.cartType)+"MultipleAsinsSubmitting";l(a)}}})});"use strict";m.when("QuantitySliderAssetDuplicationGuard").execute(function(m){m.when("A","quantity-slider-utils","qs-cart-update-handler","quantity-slider-metrics-handler").register("quantity-slider-widget",function(n,f,h,l){function e(c,a,b,e){c=k(c,a,e);b?f.disableButton(c):f.enableButton(c)}function b(c,a,b){e("."+c+"-qs-slider-button .qs-decrease-quantity",
c,a,b)}function a(c,a,b){e("."+c+"-qs-slider-button .qs-increase-quantity",c,a,b)}function g(c,a,b){e("."+c+"-qs-add-to-cart-button .qs-slider-atc-button",c,a,b)}function p(c){if(c.isQSAction){var a=c.asin,b=m(c);c.isDecreaseQuantityAction?f.deselectButton(k("."+a+"-qs-slider-button .qs-decrease-quantity",a,b)):f.deselectButton(k("."+a+"-qs-slider-button .qs-increase-quantity",a,b))}}function m(a){return(a=(a=a.request)&&a.additionalInput)&&a.storeId}function q(c){var d=c.asin,e=m(c),h=k("."+d+"-qs-slider-spinner",
d,e);f.toggleDomNodeVisibility(h,!1);c.isQSAction?(b(d,!1,e),a(d,!1,e)):g(d,!1,e);p(c);d=c.asin;f.assert(d&&c.request&&c.response&&c.response.quantity!==w,"Required properties missing in payload object for UpdateQSWidget");e=m(c);t(d,c.response.quantity,c.request.maxOrderQuantity,e);c.request.enableQuantityLimitMessage&&(d=k("."+d+"-qs-quantity-limit-message",d,e),f.toggleDomNodeVisibility(d,c.response.quantity>=c.request.maxOrderQuantity));f.updateTotalCartCountOnUI(c,c.cartType);l.logRequestSuccessMetrics(c)}
function r(c){var d=c.asin,e=m(c),h=k("."+d+"-qs-slider-spinner",d,e);f.toggleDomNodeVisibility(h,!0);c.isQSAction?(b(d,!0,e),a(d,!0,e)):g(d,!0,e);l.logRequestStartMetrics(c);c.request&&c.request.isMultipleAsinsSubmitting&&l.logMultipleAsinsSubmittingMetric(c)}function k(a,b,e){if(!e)return v(a);b="."+b+"-qs-slider-data";a=document.querySelectorAll(a);for(var c=[],d=0;d<a.length;d++){var f=a[d],g=f&&v(f).closest(".qs-widget-container");(g=(g=g&&v(g).children(b))&&v(g).data("qs-model"))&&g.additionalInput&&
g.additionalInput.storeId===e&&c.push(f)}return v(c)}function t(c,b,e,g){var d=k("."+c+"-qs-add-to-cart-button",c,g),h=k("."+c+"-qs-slider-button",c,g);0<b?(f.changeATCtoQS(d,h),d=Math.min(b,e),h=k("."+c+"-qs-qty-present-in-cart",c,g),Number.isInteger(d)&&h.html(d),a(c,b>=e,g)):(f.changeQStoATC(d,h),a(c,!1,g))}var v=n.$;Number.isInteger||(Number.isInteger=function(a){return"number"===typeof a&&isFinite(a)&&-9007199254740992<a&&9007199254740992>a&&Math.floor(a)===a});n.on(f.ACTIONS.ADD_TO_CART_SUBMIT_START,
function(a){r(a)});n.on(f.ACTIONS.ADD_TO_CART_SUBMIT_SUCCESS,function(a){q(a);a.response.quantity===a.request.maxOrderQuantity&&l.logMaxQuantityReachedMetric(a)});n.on(f.ACTIONS.REMOVE_FROM_CART_SUBMIT_START,function(a){r(a)});n.on(f.ACTIONS.REMOVE_FROM_CART_SUBMIT_SUCCESS,function(a){q(a)});n.on(f.ACTIONS.QS_CART_SUBMIT_ERROR,function(c){var d=c.asin,e=m(c),h=k("."+d+"-qs-slider-spinner",d,e);f.toggleDomNodeVisibility(h,!1);c.isQSAction&&c.isMaxOrderQuantityReached?b(d,!1,e):c.isQSAction?(b(d,!1,
e),a(d,!1,e)):g(d,!1,e);p(c);l.logRequestErrorMetrics(c)});return{ACTIONS:f.ACTIONS,setAttribution:h.setAttribution,updateQuantitySliderWidget:t}})});"use strict";m.when("QuantitySliderAssetDuplicationGuard").execute(function(q){q.when("A","a-button").register("quantity-slider-utils",function(n,f){function h(b){return e("."+b+"-qs-slider-data").first().data("qs-model")}function l(b,a){var g=h(b);e("."+b+"-qs-slider-data").data(n.extend(g,a))}var e=n.$;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(b,a){if(!b)throw Error(a);},changeATCtoQS:function(b,a){e(b).hasClass("aok-hidden")||(e(b).addClass("aok-hidden"),e(a).removeClass("aok-hidden"))},changeQStoATC:function(b,a){e(a).hasClass("aok-hidden")||(e(a).addClass("aok-hidden"),
e(b).removeClass("aok-hidden"))},disableButton:function(b){f(e(b)).disable()},deselectButton:function(b){b=f(e(b));b.isEnabled()&&b.setStatus("normal")},enableButton:function(b){f(e(b)).enable()},getQSParamsForAsin:h,getQsParamsFromTargetAsinOffer:function(b,a){var g="."+a+"-qs-slider-data";return(g=(b=b.$event&&e(b.$event.target).closest(".qs-widget-container"))&&b.children(g).data("qs-model"))?g:h(a)},setUpdatedQSParamsForAsin:l,setUpdatedQSParamsForAsinOffer:function(b,a,g){a?e("."+b+"-qs-slider-data").map(function(b,
f){b=e(f);(f=b.data("qs-model"))&&f.storeId===a&&b.data(n.extend(f,g))}):l(b,g)},toggleDomNodeVisibility:function(b,a){a?e(b).removeClass("aok-hidden"):e(b).addClass("aok-hidden")},updateTotalCartCountOnUI:function(b,a){n.extend({},b).onSuccess=function(a){r.$Nav&&r.$Nav.when("api.setCartCount").run(function(b){b(a)});m.when("mash").execute("quantity-slider-mash-update",function(b){b.cart&&e.isFunction(b.cart.didUpdate)&&b.cart.didUpdate({newCartQuantity:a})})}},logUrl:function(b){b&&n.post(b)}}})});
"use strict";q("QuantitySliderAssetDuplicationGuard",function(){return{register:q,when:y}})});
/* ******** */
(function(e){var h=window.AmazonUIPageJS||window.P,n=h._namespace||h.attributeErrors,r=n?n("ALMCartActionAssets",""):h;r.guardFatal?r.guardFatal(e)(r,window):r.execute(function(){e(r,window)})})(function(e,h,n){function r(c,b){try{e.register(c,b)}catch(d){if(!d.message.includes("reregistered by ALMCartActionAssets"))throw d;}}function E(){var c=arguments;return{register:function(b,d){try{e.when.apply(e,c).register(b,d)}catch(a){if(!a.message.includes("reregistered by ALMCartActionAssets"))throw a;
}}}}e.when("ALMCartActionAssetDuplicationGuard").execute(function(c){c.when("A","afx-csm-metrics-utils").register("alm-cart-action-query-string-utils",function(b,d){function a(a,d){var k=f(a),c=g(a);k?d["discoveredAsins.0"]=a.asin:c&&(a=b.filter(a.items,function(a){return f(a)}),a=b.map(a,function(a){return a.asin}),b.each(a,function(a,b){d["discoveredAsins."+b.toString()]=a}));return d}function g(a){return a&&a.items&&b.$.isArray(a.items)&&0<a.items.length}function f(a){return a&&a.asin&&"string"===
typeof a.asin&&""!==a.asin}return{addQueryStringParamsToUrl:function(g,f){var c={};if(f&&f.reftag){var k=f.reftag;"string"===typeof k&&""!==k&&(c.ref_=k)}if(f&&f.queryLogInfoParams){k=f.queryLogInfoParams;for(var e in k)k.hasOwnProperty(e)&&"string"===typeof e&&""!==e&&"string"===typeof k[e]&&""!==k[e]&&(c[e]=k[e])}a(f,c);try{var l=(new URLSearchParams(h.location.search)).get("almBrandId");l&&(c.almBrandId=l)}catch(v){d.increment("ATFC_INVALID_URL_ALMBRANDID")}try{var q=(new URLSearchParams(h.location.search)).get("gsc");
q&&(c.gsc=q)}catch(v){d.increment("ATFC_INVALID_URL_GSC")}(f=b.$.param(c))&&"string"===typeof f&&""!==f&&(g+="?"+f);return g}}})});"use strict";e.when("ALMCartActionAssetDuplicationGuard").execute(function(c){c.when("A","jQuery").register("afx-add-all-helper",function(b,d){return{updateQuantityForAsin:function(a,b,f){a&&b&&!isNaN(f)&&d("#"+a).closest("form").find("#afx-add-all-"+b+"-quantity").attr("value",f)}}})});"use strict";e.when("ALMCartActionAssetDuplicationGuard").execute(function(c){c.when("A",
"jQuery","a-button").register("fx-atfc-button-utils",function(b,d,a){function g(a){return"atfc-spinner-"+(a.asin?a.asin:a.clientId?a.clientId:"noAsin")}var f=!1;return{hideButtonAndRenderSpinner:function(a){var b=a.$currentTarget.find(".a-button");if(b&&b.length){f=!0;a=g(a.data);var c=b.not(".aok-hidden").not(".non-spinner");c&&a.length&&(c.wrap('\x3cdiv id\x3d"'+a+'" class\x3d"atfc-spinner"\x3e\x3c/div\x3e'),d("#"+a).css({width:c.outerWidth()+"px"}),d("#"+a).css({height:c.outerHeight()+"px"}));
b.css("visibility","hidden")}},showButtonAndRemoveSpinner:function(a){var b=a.$currentTarget.find(".a-button"),c=g(a.data);c=d("#"+c);b&&b.length&&c&&c.length&&(f=!1,b.each(function(){d(this).parent().hasClass("atfc-spinner")&&d(this).unwrap()}),b.css("visibility","visible"));a.data&&a.data.qsUID&&!1===a.data.setQuantityFlag&&e.when("QuantitySelectorUtils").execute(function(b){b=b.getQsWidgetButton(a.data.qsUID);b.length&&b.focus()})},shouldDisableButtonClicks:function(){return f}}})});"use strict";
e.when("ALMCartActionAssetDuplicationGuard").execute(function(c){c.when("fresh-shared-add-to-cart-v2","qs-fresh-shared-add-to-cart").register("fresh-add-to-cart",function(b,d){function a(a){b.attachCallbacks(a)}b.initialize("desktop");d.initialize("desktop");return{addToFreshCart:function(b){a(b)},attachCallbacks:a,attachPrehooks:function(a){b.attachPrehooks(a)},updateAddAllQuantityForAsin:b.updateAddAllQuantityForAsin,updateQuantity:b.updateQuantity}})});e.when("ALMCartActionAssetDuplicationGuard").execute(function(c){c.when("A",
"alm-cart-action-assets-device","afx-metrics-helper","afx-csm-metrics-utils").register("alm-cart-action-assets-metrics",function(b,d,a,g){b=a.getMetricsForDevice(d.getDevice());g.increment(b.ATFC_ASSET_LOAD);return{}})});"use strict";e.when("ALMCartActionAssetDuplicationGuard").execute(function(c){c.when("shared-alm-multi-add-to-cart").register("alm-multi-add-to-cart",function(b){function d(a){b.attachCallbacks(a)}b.initialize("desktop");return{multiAddToCart:function(a){d(a)},attachCallbacks:d,attachPreHandler:function(a){b.attachPreHandler(a)}}})});
"use strict";e.when("ALMCartActionAssetDuplicationGuard").execute(function(c){c.when("A","alm-cart-action-query-string-utils").register("afx-atfc-v2-proxy",function(b,d){return{addToFreshCart:function(a){var g=d.addQueryStringParamsToUrl("/alm/addtofreshcart",a.data);b.$.ajax(g,{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";e.when("ALMCartActionAssetDuplicationGuard").execute(function(c){c.when("A").register("fx-atfo-proxy",function(b){return{addToFreshOrder:function(d){var a="/fom/add-to-fresh-order";d.reftag!==n&&(a+="/ref\x3d"+d.reftag);d.data!==n&&d.data.csrfToken&&(a+="?csrf\x3d"+encodeURIComponent(d.data.csrfToken));b.post(a,{success:d.success,error:d.error,params:JSON.stringify(d.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";e.when("ALMCartActionAssetDuplicationGuard").execute(function(c){c.when("A").register("afx-atfc-cart-conflicts-proxy",function(b){function d(a){a.ref=a.reftag;a.client="atfc";return a}return{getConflictSummary:function(a){var g=d(a.data);b.post("/afx/cartconflicts/getconflictsummary",{timeout:5E3,success:a.success,error:a.error,params:g})},resolve:function(a){var g=d(a.data);b.post("/afx/cartconflicts/resolve",{timeout:5E3,success:a.success,error:a.error,params:g})},substitute:function(a){a=
d(a.data);a.sourceUrl=h.location.pathname+h.location.search;a=b.$.param(a);h.location.href="/afx/cartconflicts/resolve/substitute?"+a}}})});"use strict";e.when("ALMCartActionAssetDuplicationGuard").execute(function(c){c.when("A").register("afx-get-cart-count",function(b){return function(d){b.get("/alm/addtofreshcart/cartcount",{timeout:5E3,success:function(a){d.success&&d.success({isOK:!0,total:{numActiveItem:a.cartCount}})},error:function(a){d.error&&d.error(a)}})}})});"use strict";e.when("ALMCartActionAssetDuplicationGuard").execute(function(c){c.when("A",
"alm-cart-action-query-string-utils").register("alm-multi-add-to-cart-proxy",function(b,d){return{multiAddToCart:function(a){var g=d.addQueryStringParamsToUrl("/alm/addtocart/multiple",a.data);b.$.ajax(g,{type:"POST",contentType:"application/json",data:JSON.stringify(a.data)}).done(a.success).fail(a.error)}}})});"use strict";r("ALMCartActionAssetDuplicationGuard",function(){return{register:r,when:E}});"use strict";e.when("ALMCartActionAssetDuplicationGuard").execute(function(c){c.register("afx-callbacks-helper",
function(b){function d(b){var g=b in a;!g&&e.log("Unable to retrieve callback for "+b,"Error");return g}var a={};return{addCallbacks:function(b){a[b.clientID||"default"]=b},success:function(b,c,e){b=b in a?b:"default";d(b)&&a[b].success&&a[b].success(c,e)},error:function(b,c,e,l){b=b in a?b:"default";d(b)&&a[b].error&&a[b].error(c,e,l)}}})});"use strict";e.when("ALMCartActionAssetDuplicationGuard").execute(function(c){c.when("A").register("alm-cart-action-assets-device",function(b){return{getDevice:function(){return"desktop"}}})});
"use strict";e.when("ALMCartActionAssetDuplicationGuard").execute(function(c){c.register("afx-preHandler-helper",function(b){var d={};return{addPreHandler:function(a){d[a.clientID||"default"]=a},getPreHandler:function(a){return d[a]}}})});"use strict";e.when("ALMCartActionAssetDuplicationGuard").execute(function(c){c.register("afx-prehooks-helper",function(b){function d(b){var d=b in a?b:"default";d=d in a&&a[d].invoke;!d&&e.log("Unable to retrieve prehook for "+b,"Error");return d}var a={};return{addPrehooks:function(b){a[b.clientID||
"default"]=b},invoke:function(b,c){var g=b.clientId in a?b.clientId:"default";d(b.clientId)&&a[g].invoke(b.triggerEvent,c,b.scope,b.success,b.failure,b.device)},validatePrehook:d,prehooksWeblabEnabled:!1}})});"use strict";e.when("ALMCartActionAssetDuplicationGuard").execute(function(c){c.register("afx-csm-metrics-utils",function(){var b={},d=function(a,b){h.ue&&h.ue.count&&a&&b&&h.ue.count(a,b)};return{startWidgetTimer:function(a){b[a]=Date.now()},endWidgetTimer:function(a,c){a=Date.now()-b[a];d(c,
a)},setWidgetClickTimestamp:function(a){h.ue&&h.uet&&a&&h.uet("tc",a,{wb:1})},setWidgetTimestamp:function(a,b){h.ue&&h.uet&&a&&b&&h.uet(a,b,{wb:1})},increment:function(a){h.ue&&h.ue.count&&a&&h.ue.count(a,(h.ue.count(a)||0)+1)},setCount:d,sendWidgetMetrics:function(a){h.ue&&h.uex&&a&&h.uex("ld",a,{wb:1})}}})});"use strict";e.when("ALMCartActionAssetDuplicationGuard").execute(function(c){c.register("add-to-cart-common-utils",function(){return{vibrate:function(){return h.amazon&&h.amazon.cordova&&h.amazon.cordova.notification&&
h.amazon.cordova.notification.vibrate&&h.amazon.cordova.notification.vibrate(50)}}})});"use strict";e.when("ALMCartActionAssetDuplicationGuard").execute(function(c){c.when("A","a-modal").register("fresh-atfc-modal-utils",function(b,d){return{removeModal:function(){var a=d.get("fresh-add-to-cart-modal");a&&d.remove(a)},showModal:function(a,c,e){c&&(c={name:"fresh-add-to-cart-modal",header:c.header,inlineContent:c.body,footer:c.footer},"desktop"===e&&(c.width=325),d.create(a.$currentTarget,c).show(),
b.on("a:popover:afterHide:".concat("fresh-add-to-cart-modal"),function(a){d.remove(a.popover)}))}}})});"use strict";e.when("ALMCartActionAssetDuplicationGuard").execute(function(c){c.when("A","jQuery","afx-atfc-v2-proxy","afx-csm-metrics-utils","afx-metrics-helper","afx-quantity-helper","fresh-atfc-ewc-helper","fresh-atfc-fallback-error-modal-helper").register("fresh-atfc-error-modal-utils",function(b,d,a,c,f,k,l,h){function g(a,c,d,f){e.when("a-modal").execute("showModal",function(w){c||m(a);a.data.quantity&&
(k.updateQuantity("fresh-clear-slot-button",a.data.quantity),k.updateQuantity("alcohol-warning-fresh-add-to-cart-button",a.data.quantity),k.updateQuantity("regions-out-of-sync-inline-fresh-add-to-cart-button",a.data.quantity));var e={name:"fresh-add-to-cart-error-modal",header:c.header,inlineContent:c.errorMessage,footer:c.footer,data:{event:a,response:f}};"desktop"===d&&(e.width=325);w.create(a.$currentTarget,e).show();b.on("a:popover:afterHide:".concat("fresh-add-to-cart-error-modal"),function(b){l.refreshCart(a.data.sessionID);
w.remove(b.popover)})})}function m(c,w){a.showGenericErrorModal({success:function(a,b,e){a&&(a=d.parseJSON(e.http.response),q(c,a,w))},error:function(){e.log("Failed to get the generic error modal","Error");var a=h.getFallbackErrorModal();c.data.qsUID&&c.data.prevSelectedQty&&c.data.isStepperFlag&&(b.isListening("quantity-selector-widget:sync-stepper-quantity")?b.trigger("quantity-selector-widget:sync-stepper-quantity",c.data.asin,c.data.prevSelectedQty,c.data.storeId):b.trigger("quantity-selector-widget:selectQuantity:clientUpdate",
c.data.qsUID,c.data.prevSelectedQty,!1));g(c,a,w)}})}function t(a,b){if(a.data.asin&&a.data.storeId&&b.clientResponseModel&&b.clientResponseModel.items){var c=b.clientResponseModel.items.filter(function(b){return b.ASIN===a.data.asin});1<c.length&&(c=c.filter(function(b){return b.ASIN===a.data.asin&&b.storeId===a.data.storeId}));if(1===c.length&&c[0].hasOwnProperty("amountInCart"))return parseFloat(c[0].amountInCart);if(b.clientResponseModel.uberCartStatus&&a.data.prevSelectedQty&&"INTERNAL_SERVER_ERROR"===
b.clientResponseModel.uberCartStatus.errorStatusCode)return parseFloat(a.data.prevSelectedQty)}return 0}function q(a,d,e){var w=d.errorModalHtml,k=f.getMetricsForDevice(e);d.clientResponseModel&&d.clientResponseModel.uberCartStatus&&d.clientResponseModel.uberCartStatus.errorStatusCode in k&&c.increment(k[d.clientResponseModel.uberCartStatus.errorStatusCode]);a.data.qsUID&&(k=t(a,d),null!=k&&a.data.isStepperFlag&&(b.isListening("quantity-selector-widget:sync-stepper-quantity")?b.trigger("quantity-selector-widget:sync-stepper-quantity",
a.data.asin,k,a.data.storeId):b.trigger("quantity-selector-widget:selectQuantity:clientUpdate",a.data.qsUID,k,!1)));g(a,w,e,d)}return{removeModal:function(){e.when("a-modal").execute("removeModal",function(a){var b=a.get("fresh-add-to-cart-error-modal");b&&a.remove(b)})},showModal:g,showGenericErrorModal:m,parseResponseAndShowErrorModal:q,getItemInCartQuantityFromResponse:t}})});"use strict";e.when("ALMCartActionAssetDuplicationGuard").execute(function(c){c.when("A","jQuery","afx-atfc-v2-proxy","afx-get-cart-count").register("fresh-atfc-ewc-helper",
function(b,c,a,g){function d(a){g({sessionID:a,success:function(a){a&&a.isOK&&a.total&&k(a.total.numActiveItem)},error:function(){e.log("Failed to get cart count","Error",a)}})}function k(a){e.when("nav.setCartCount").execute(function(b){b(a)});e.when("mash").execute(function(b){b.cart&&"function"===typeof b.cart.didUpdate&&b.cart.didUpdate({newCartQuantity:a})})}var l;e.when("EWC").execute("add-to-cart-refresh",function(a){l=a});e.when("nav.getFlyout").execute(function(a){a("ewc")});return{refreshCart:function(a){l!==
n&&"function"===typeof l.refresh?l.refresh():d(a)}}})});"use strict";e.when("ALMCartActionAssetDuplicationGuard").execute(function(c){c.when("A","afx-storeIntroductionSheet-helper","afx-cpi-helper","afx-notification-helper").register("f3-consumables-atc-helper",function(b,c,a,e){return{handleAddToCart:function(d,g,l){g.storeIntroductionSheetHtml&&g.storeIntroductionSheetHtml.content||d.additionalParams&&d.additionalParams.shouldRenderSIS?c.render(d,g,l):g.renderUFGCartProgressIndicator?a.render(d):
b.trigger("fresh-atfc:success","false",{almBrandId:d.brandId});e.handleAddToCart(g,l)}}})});"use strict";e.when("ALMCartActionAssetDuplicationGuard").execute(function(c){c.register("afx-metrics-helper",function(){var b={ATFC_COUNT:"afxAddToFreshCartCount",ALM_MULTI_ATC_COUNT:"almMultiAddToCartCount",ATFC_ASSET_LOAD:"almAssetLoadCount",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",ATFC_NOTIFICATION_RETRY:"afxAddToCartNotificationRetryCount",ATFC_NOTIFICATION_FAILURE:"afxAddToCartNotificationFailureCount",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(d){a[d]=b[d]+":"+c});return a}}})});"use strict";e.when("ALMCartActionAssetDuplicationGuard").execute(function(c){c.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";e.when("ALMCartActionAssetDuplicationGuard").execute(function(c){c.when("A","afx-csm-metrics-utils","afx-metrics-helper","f3-glowchangeaddress").register("afx-storeIntroductionSheet-helper",function(b,c,a,g){function d(a){e.when("a-sheet").execute(function(b){b.create({inlineContent:a,
closeType:"icon",height:190}).show();h("mobile",!1)})}function k(a,c,d){var f=a.additionalParams;if(a.asin&&a.brandId&&a.offerListingDiscriminator&&a.storeId){var g={almBrandId:a.brandId,almStoreId:a.storeId,asin:a.asin,isDelivery:c.delivery,offerListingDiscriminator:a.offerListingDiscriminator,isAlmDetailPageBopis:c.almDetailPageBopis};c.newGlowAddressId&&(g.newGlowAddressId=c.newGlowAddressId);a.clientID&&(g.clientId=a.clientID);f&&f.sisDeliveryMessage&&(g.deliveryMessage="DELIVERY_MESSAGE_PLACEHOLDER");
b.get("/fmc/sis",{params:g,accepts:"text/html; charset\x3dutf-8",timeout:3E3,success:function(a){var b=document.getElementById("almStoreIntroductionSheet");b||(b=document.createElement("div"),b.setAttribute("id","almStoreIntroductionSheet"),document.body.appendChild(b));l(b,a,f.sisDeliveryMessage);h(d,!0)},error:function(a,b,c){e.log("Failed to render store introduction sheet: "+c,"Error")}})}else e.log("Failed to render store introduction sheet: Missing Parameters","Error")}function l(a,b,c){a.innerHTML=
b;if(b=a.querySelector("#store-introduction-sheet-delivery-message span"))b.innerHTML=c;a.querySelectorAll("script").forEach(function(a){var b=document.createElement("script");Array.from(a.attributes).forEach(function(a){b.setAttribute(a.name,a.value)});b.appendChild(document.createTextNode(a.innerHTML));a.parentNode.replaceChild(b,a)})}function h(b,d){b=a.getMetricsForDevice(b);d?c.increment(b.ATFC_OCX_STORE_INTRODUCTION_SHEET):c.increment(b.ATFC_STORE_INTRODUCTION_SHEET)}function n(a,c){var d=a.newGlowAddressId,
e=a.storeFrontUrl,f=a.isAlmDetailPageBopis;if(d)if(g.setAddress({addressId:d,almBrandId:a.almBrandId}),b.capabilities.isAmazonApp)m(e,f,c);else b.on("packard:glow:destinationChangeNavAck",function(){m(e,f,c)});else m(e,f,c)}function m(a,b,c){b?c?q():p():a&&(location.href=a)}function p(){e.when("a-sheet").execute(function(a){var b=a.get("alm-store-introduction-sheet");a.hideSheet(b);b.destroy()})}function q(){var a=b.$("#store-introduction-sheet-side-sheet-container").width()+30;v({right:"-"+a+"px"},
function(){b.$("#store-introduction-sheet-side-sheet-container").remove()});b.$("body").css({overflow:"visible"});b.hide(b.$("#store-introduction-sheet-background"));b.$("#store-introduction-sheet-background").remove()}function v(a,c){b.animate(b.$("#store-introduction-sheet-side-sheet-container"),a,300,"ease-out",c)}b.declarative("sis-storefront-button-action","click",function(a){n(a.data,!0)});b.declarative("sis-storefront-button-action-mobile","click",function(a){n(a.data,!1)});return{render:function(a,
b,c){a.additionalParams&&a.additionalParams.shouldRenderSIS?b&&b.storeIntroductionSheetEnabled&&k(a,b,c):"mobile"===c&&d(b.storeIntroductionSheetHtml.content)}}})});"use strict";e.when("ALMCartActionAssetDuplicationGuard").execute(function(c){c.when("A").register("afx-cpi-helper",function(b){return{render:function(b){}}})});"use strict";e.when("ALMCartActionAssetDuplicationGuard").execute(function(c){c.when("A").register("f3-glowchangeaddress",function(b){function c(c,d){var f={};c=g(c);""==c?e.log("CSRF Token not available in response from get-rendered-address-selections response",
"Error"):(f.addressId=d.addressId,f.almBrandId=d.almBrandId,f.actionSource="f3-pickup-conflict",f.locationType="ACCOUNT_ADDRESS",f.deviceType="web",f.pageType=h.ue_pty,b.post("/portal-migration/hz/glow/address-change?actionSource\x3dglow",{headers:{"Content-Type":"application/json","anti-csrftoken-a2z":c},params:f,paramsFormat:"json",success:function(b){a()},error:function(){e.log("Unable to set GLOW address","ERROR")}}))}function a(){b.capabilities.isAmazonApp?e.when("BottomSheetPlugin").execute(function(a){a.UpdateGlowIngress({})}.bind(this)):
b.trigger("packard:glow:destinationChangeNav")}function g(a){var b=a.indexOf('"',a.indexOf("CSRF_TOKEN"))+1;if(0!=b){var c=a.indexOf('"',b);return a.substring(b,c)}return""}return{setAddress:function(a){b.get("/portal-migration/hz/glow/get-rendered-address-selections?deviceType\x3ddesktop\x26pageType\x3dDetail\x26storeContext\x3dgrocery\x26actionSource\x3ddesktop-modal",{headers:{"Content-Type":"application/json","anti-csrftoken-a2z":b.$("#glowValidationToken").val()||""},success:function(b){c(b,
a)},error:function(){e.log("Unable to get rendered address content","ERROR")}})},refreshGlowIngress:a}})});"use strict";e.when("ALMCartActionAssetDuplicationGuard").execute(function(c){c.when("A").register("search-add-to-cart-helper",function(b){return{start:function(){e.now("rush-framework","rush-dispatcher").execute(function(b,a){b!==n&&a!==n&&a.trigger("search-add-to-cart:start",{})})},success:function(b,a){e.now("rush-framework","rush-dispatcher").execute(function(c,d){c!==n&&d!==n&&d.trigger("search-add-to-cart:success",
{response:a,event:b})})},error:function(){e.now("rush-framework","rush-dispatcher").execute(function(b,a){b!==n&&a!==n&&a.trigger("search-add-to-cart:error",{})})}}})});"use strict";e.when("ALMCartActionAssetDuplicationGuard").execute(function(c){c.when("A","afx-csm-metrics-utils","afx-metrics-helper").register("afx-notification-helper",function(b,c,a){return{handleAddToCart:function(a,b){}}})});"use strict";e.when("ALMCartActionAssetDuplicationGuard").execute(function(c){c.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(d,e,k){!0===d.isSuccess?!0===d.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(k,e,"Failed to call getconflictsummary")},error:a.error})}}})});"use strict";e.when("ALMCartActionAssetDuplicationGuard").execute(function(c){c.when("A","afx-atfc-v2-proxy","fx-atfo-proxy","fx-atfc-button-utils",
"afx-csm-metrics-utils","afx-metrics-helper","afx-quantity-helper","afx-prehooks-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","f3-glowchangeaddress","search-add-to-cart-helper").register("fresh-shared-add-to-cart-v2",function(b,c,a,g,f,k,h,t,y,m,p,q,v,w,r,F,A){return{updateQuantity:h.updateQuantity,attachPrehooks:t.addPrehooks,attachCallbacks:y.addCallbacks,
updateAddAllQuantityForAsin:v.updateQuantityForAsin,initialize:function(d){function l(a){return a.isItemSoldByCount?!JSON.parse(a.isItemSoldByCount):a.pickingStrategy?"bulk"===a.pickingStrategy||"catch"===a.pickingStrategy:!1}function v(a,b,c,e){r.vibrate();a.data.amountInUom===n&&l(a.data)&&(a.data.amountInUom=a.data.quantity,a.data.quantity=1);var u={clientId:a.data.clientID,triggerEvent:a,scope:b,success:c,failure:e,device:d},g=C(a,b,e);t&&t.prehooksWeblabEnabled&&t.validatePrehook(u.clientId)?
t.invoke(u,{success:D,error:function(a,b,c){g(a,b,c)}}):D(a,b,c,e)}function C(a,b,c){return function(e,u,h){var k=x.ATFC_CTCF,m=e.responseText;p.removeModal();if(m){var l=JSON.parse(m);k=x.ATFC_CTCF+":lineItemBucket:"+B(l.clientResponseModel)}400===e.status&&l?(f.increment(x.ATFC_ERROR_MODAL_COUNT),p.parseResponseAndShowErrorModal(a,l,d)):403===e.status?location.reload():(f.increment(x.ATFC_UNEXPECTED_ERROR_COUNT),p.showGenericErrorModal(a,d),y.error(a.data.clientID,a,e,u,h),A.error());f.endWidgetTimer(b,
k);a.data.setQuantityFlag||g.showButtonAndRemoveSpinner(a);c&&c()}}function D(a,e,h,k){var u=C(a,e,k);A.start();c.addToFreshCart({data:a.data,success:function(c,u,k){if(200===k.status)if(f.increment(x.ATFC_SUCCESSFUL_ADD_COUNT),u=x.ATFC_CTCF+":lineItemBucket:"+B(c),f.endWidgetTimer(e,u),u=p.getItemInCartQuantityFromResponse(a,c),b.isListening("commit-c5d19d5c")&&a.data.setQuantityFlag!==n&&a.data.qsUID?b.trigger("quantity-selector-widget:sync-stepper-quantity",a.data.asin,u,a.data.storeId,a.data.qsUID,
!1,!1,!a.data.setQuantityFlag,a.data.clientID):a.data.setQuantityFlag&&a.data.qsUID?b.trigger("quantity-selector-widget:sync-stepper-quantity",a.data.asin,u,a.data.storeId,a.data.qsUID):b.trigger("quantity-selector-widget:sync-stepper-quantity",a.data.asin,u,a.data.storeId),q.refreshCart(a.data.sessionID),y.success(a.data.clientID,a,c.clientResponseModel),A.success(a,c.clientResponseModel),c.refreshGlowLabel){if(F.refreshGlowIngress(),c.storefrontUrl)if(b.capabilities.isAmazonApp)location.href=c.storefrontUrl;
else b.on("packard:glow:destinationChangeNavAck",function(){location.href=c.storefrontUrl})}else c.shouldRedirectToOgs?c.ogsUrl?setTimeout(function(){location.href=c.ogsUrl},3E3):location.reload():w.handleAddToCart(a.data,c,d);p.removeModal();a.data.setQuantityFlag||g.showButtonAndRemoveSpinner(a);h&&h()},error:function(a,b,c){u(a,b,c)}})}function G(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);v(a,c,function(){location.reload()})},error:function(){e.log("Failed to clear reservation");p.showGenericErrorModal(a,d)}})}function B(a){return a.items&&Math.ceil(a.items.length/5)}var x=k.getMetricsForDevice(d),z=x.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}),c.data.setQuantityFlag||g.hideButtonAndRenderSpinner(c);v(c,z)});b.declarative("fresh-clear-slot","click",function(a){a.$currentTarget.context.disabled=!0;G(a,z)});b.declarative("fresh-add-to-cart","click",function(a){f.startWidgetTimer(z);
f.increment(x.ATFC_COUNT);g.shouldDisableButtonClicks()||a.$currentTarget.find("input").is(":disabled")||(a.data.setQuantityFlag||g.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),v(a,z)))});b.declarative("fresh-add-to-cart-alcohol","click",function(a){a.$currentTarget.context.disabled=!0;f.startWidgetTimer(z);a.data.quantity=h.getQuantity(a.$target);b.trigger("quantity-selector-widget:sync-stepper-quantity",
a.data.asin,a.data.quantity);v(a,z)});b.declarative("fresh-add-to-cart-regions-resolve","click",function(a){a.$currentTarget.context.disabled=!0;p.removeModal();m.execute({data:a.data,error:function(b,c,e){p.showGenericErrorModal(a,d);y.error(a.data.clientID,a,b,c,e)}})});b.declarative("fresh-add-to-order","click",function(b){g.shouldDisableButtonClicks()||(g.hideButtonAndRenderSpinner(b),r.vibrate(),a.addToFreshOrder({data:b.data,success:function(a,c,d){200===d.http.status&&y.success(b.data.clientID,
b,a.clientResponseModel);g.showButtonAndRemoveSpinner(b)},error:function(c,e,f){p.removeModal();if(400===c.http.status)c=JSON.parse(c.responseText),p.parseResponseAndShowErrorModal(b,c,d);else if(401===c.http.status)location.reload();else{var h=a.getFallbackErrorModalHtml();p.showModal(b,h,d);y.error(b.data.clientID,b,c,e,f)}g.showButtonAndRemoveSpinner(b)}}))})}}})});"use strict";e.when("ALMCartActionAssetDuplicationGuard").execute(function(c){c.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,f,h,l,t,r,m,p){return{attachCallbacks:h.addCallbacks,attachPreHandler:l.addPreHandler,initialize:function(d){function g(f,g,l,q){p.vibrate();c.multiAddToCart({data:f.data,success:function(c,g,p){200===p.status&&(e.increment(k.ALM_MULTI_ATC_COUNT_SUCCESS),
r.refreshCart(f.data.sessionID),b.trigger("multipleAddToCart:success",f.data),h.success(f.data.clientId,f,c),m.handleAddToCart(f.data,c,d));t.removeModal();a.showButtonAndRemoveSpinner(f);l&&l()},error:function(b,c,g){a.showButtonAndRemoveSpinner(f);t.removeModal();if(b.responseText)try{var m=JSON.parse(b.responseText)}catch(B){m=n}400===b.status&&m?(e.increment(k.ALM_MULTI_ATC_COUNT_ERROR_MODAL),t.parseResponseAndShowErrorModal(f,m,d)):403===b.status?location.reload():(e.increment(k.ALM_MULTI_ATC_COUNT_ERROR_UNEXPECTED),
t.showGenericErrorModal(f,d));h.error(f.data.clientId,f,b,c,g);q&&q()}})}var k=f.getMetricsForDevice(d),q=k.ATFC_LATENCY_SCOPE+Date.now();b.declarative("alm-multi-add-to-cart","click",function(b){e.increment(k.ALM_MULTI_ATC_COUNT);var c=l.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),g(b,q))})}}})});e.when("ALMCartActionAssetDuplicationGuard").execute(function(c){c.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,f,h){return{initialize:function(d){function g(a){return"UFG"==a.cartType&&a.response&&a.request&&a.request.additionalInput?!0:!1}function k(b){if(g(b)&&b.response.rawResponse){var h=b.response.rawResponse,k=h.jqXHR,m=b.request,l=m.triggeringEvent;l.data=m.additionalInput;l.data&&(l.data.isDecreaseQuantityAction=
b.isDecreaseQuantityAction);200===k.status&&(a.refreshCart(m.sessionId),e.success(b.clientName,l,h.clientResponseModel),c.handleAddToCart(l.data,h,d));f.removeModal()}}b.on("quantity-slider:add-to-cart-start",function(a){h.vibrate()});b.on("quantity-slider:remove-from-cart-start",function(a){h.vibrate()});b.on("quantity-slider:remove-from-cart-success",function(a){k(a)});b.on("quantity-slider:add-to-cart-success",function(a){k(a)});b.on("quantity-slider:cart-submit-error",function(a){if(g(a)){var b=
a.request.triggeringEvent,c=a.response,h=c.responseText,k;f.removeModal();h&&(k=JSON.parse(h));b.data=a.request.additionalInput;400===c.status&&k?f.showModal(b,k.errorModalHtml,d):403===c.status?location.reload():(f.showGenericErrorModal(b,d),e.error(a.clientName,b,c,"error",c.statusText))}})}}})});"use strict";e.when("ALMCartActionAssetDuplicationGuard").execute(function(c){var b={en:{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'},es:{header:"Producto no añadido a la cesta",errorMessage:"Se ha producido un error y este producto \x3cb\x3eno se ha añadido a tu cesta.\x3c/b\x3e Inténtalo de nuevo.",
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"\x3eAceptar\n    \x3c/span\x3e\x3c/span\x3e\x3c/span\x3e\n\x3c/span\x3e'},ar:{header:"لم تتم إضافة السلعة إلى عربة التسوق",errorMessage:"عذرًا، حدث خطأ ولم تتم إضافة هذه السلعة إلى عربة التسوق الخاصة بك. يرجى المحاولة مرة أخرى",
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"\x3e\nموافق \x3c/span\x3e\x3c/span\x3e\x3c/span\x3e\n\x3c/span\x3e'},bn:{header:"কার্টে আইটেম যোগ করা হয়নি",errorMessage:"আমরা দুঃখিত, একটি ত্রুটি ছিল এবং এই আইটেমটি আপনার কার্টে যোগ করা হয় নি। অনুগ্রহ করে পুনরায় চেষ্টা করুন।",
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"\x3eঠিক আছে\n    \x3c/span\x3e\x3c/span\x3e\x3c/span\x3e\n\x3c/span\x3e'},cs:{header:"Artikel nicht zum Einkaufswagen hinzufgefügt",errorMessage:"Leider ist ein Fehler aufgetreten und dieser Artikel wurde nicht zu Ihrem Einkaufswagen hinzugefügt. Bitte versuchen Sie es erneut.",
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'},da:{header:"Artikel nicht zum Einkaufswagen hinzufgefügt",errorMessage:"Leider ist ein Fehler aufgetreten und dieser Artikel wurde nicht zu Ihrem Einkaufswagen hinzugefügt. Bitte versuchen Sie es erneut.",
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'},de:{header:"Artikel nicht zum Einkaufswagen hinzufgefügt",errorMessage:"Leider ist ein Fehler aufgetreten und dieser Artikel wurde nicht zu Ihrem Einkaufswagen hinzugefügt. Bitte versuchen Sie es erneut.",
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'},fr:{header:"Article non ajouté au panier",errorMessage:"Nous sommes désolés, il y a eu une erreur et cet article n'a pas été ajouté à votre panier. Veuillez réessayer.",
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'},hi:{header:"आइटम कार्ट से नहीं जोड़ा गया",errorMessage:"हमें खेद है, एक त्रुटि हुई थी और यह आइटम आपके कार्ट में जोड़ा नहीं गया था. कृपया फिर से कोशिश करें।",
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"\x3eठीक है\n    \x3c/span\x3e\x3c/span\x3e\x3c/span\x3e\n\x3c/span\x3e'},it:{header:"Articolo non aggiunto al carrello",errorMessage:"Desculpe, ocorreu um erro e este item \x3cb\x3enão foi adicionado ao seu carrinho.\x3c/b\x3e Por favor, tente novamente.",
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'},ja:{header:"商品がカートに追加されていません",errorMessage:"申し訳ございません。エラーが発生したため、\x3cb\x3eこの商品はカートに追加されませんでした。\x3c/b\x3eもう一度お試しください。",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'},
kn:{header:"ಐಟಂ ಅನ್ನು ಕಾರ್ಟ್‍ಗೆ ಸೇರಿಸಿಲ್ಲ",errorMessage:"ನಮ್ಮನ್ನು ಕ್ಷಮಿಸಿ, ಇದರಲ್ಲಿ ಒಂದು ದೋಷವಿದೆ ಮತ್ತು ಈ ಐಟಂ ಅನ್ನು ನಿಮ್ಮ ಕಾರ್ಟ್‍ಗೆ ಸೇರಿಸಿಲ್ಲ. ದಯವಿಟ್ಟು ಪುನಃ ಪ್ರಯತ್ನಿಸಿ.",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"\x3eಸರಿ\n    \x3c/span\x3e\x3c/span\x3e\x3c/span\x3e\n\x3c/span\x3e'},
ml:{header:"ബാസ്കറ്റിൽ ചേർക്കാത്ത ഇനം",errorMessage:"ക്ഷമിക്കണം,ഒരു പിശക് ഉണ്ടായി,നിങ്ങളുടെ കാർട്ടിൽ ഈ ഇനം ചേർത്തിട്ടില്ല. വീണ്ടും ശ്രമിക്കുക.",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"\x3eശരി\n    \x3c/span\x3e\x3c/span\x3e\x3c/span\x3e\n\x3c/span\x3e'},
mr:{header:"आयटम कार्टला जोडले गेलेले नाही",errorMessage:"आम्ही दिलगीर आहोत, एक चूक झाली आणि हे आयटम आपल्या कार्टमध्ये जोडले गेले नाही. कृपया पुन्हा प्रयत्न करा.",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"\x3eठीक\n    \x3c/span\x3e\x3c/span\x3e\x3c/span\x3e\n\x3c/span\x3e'},
nl:{header:"Artikel nicht zum Einkaufswagen hinzufgefügt",errorMessage:"Leider ist ein Fehler aufgetreten und dieser Artikel wurde nicht zu Ihrem Einkaufswagen hinzugefügt. Bitte versuchen Sie es erneut.",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'},
pl:{header:"Artikel nicht zum Einkaufswagen hinzufgefügt",errorMessage:"Leider ist ein Fehler aufgetreten und dieser Artikel wurde nicht zu Ihrem Einkaufswagen hinzugefügt. Bitte versuchen Sie es erneut.",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'},
pt:{header:"O item não foi adicionado ao carrinho",errorMessage:"Desculpe, ocorreu um erro e este item \x3cb\x3enão foi adicionado ao seu carrinho.\x3c/b\x3e Por favor, tente novamente.",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'},
ta:{header:"பொருள் கார்ட்டில் சேர்க்கப்படவில்லை",errorMessage:"மன்னிக்கவும், பிழை ஏற்பட்டது, இந்த உருப்படி உங்கள் கார்ட்டில் சேர்க்கப்படவில்லை. மீண்டும் முயற்சிக்கவும்.",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"\x3eசரி\n    \x3c/span\x3e\x3c/span\x3e\x3c/span\x3e\n\x3c/span\x3e'},
te:{header:"వస్తువుని బాస్కెట్‌లో చేర్చలేదు",errorMessage:"మమ్మల్ని క్షమించండి, అక్కడ ఏదో ఎర్రర్ ఏర్పడింది అందుచేత మీ బాస్కెట్‌లో ఈ వస్తువును జోడించలేదు. దయచేసి మళ్లీ ప్రయత్నించండి.",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"\x3eసరే\n    \x3c/span\x3e\x3c/span\x3e\x3c/span\x3e\n\x3c/span\x3e'},
tr:{header:"Artikel nicht zum Einkaufswagen hinzufgefügt",errorMessage:"Leider ist ein Fehler aufgetreten und dieser Artikel wurde nicht zu Ihrem Einkaufswagen hinzugefügt. Bitte versuchen Sie es erneut.",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'},
zh:{header:"商品未加入购物车",errorMessage:"很抱歉，出现错误，\x3cb\x3e该商品未添加至您的购物车。\x3c/b\x3e请重试。",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"\x3e好\n    \x3c/span\x3e\x3c/span\x3e\x3c/span\x3e\n\x3c/span\x3e'}};c.when("A").register("fresh-atfc-fallback-error-modal-helper",
function(c){return{getFallbackErrorModal:function(){var a=document.querySelector("html[lang]");return a&&(a=a.getAttribute("lang"),a!==n&&(a=a.split("-"),a.length))?b[a[0]]:b.en}}})})});
/* ******** */
(function(b){var c=window.AmazonUIPageJS||window.P,d=c._namespace||c.attributeErrors,a=d?d("USSAlmCartActionAssets",""):c;a.guardFatal?a.guardFatal(b)(a,window):a.execute(function(){b(a,window)})})(function(b,c,d){"use strict";b.when("A").register("uss-alm-atc-constants",function(a){return{clientIdList:{USS_ALM_WIDGET_DP_MOBILE:"uss-alm-widget-dp-mobile",USS_ALM_WIDGET_DP_DESKTOP:"uss-alm-widget-dp-desktop",USS_ALM_WIDGET_SEARCH_MOBILE:"uss-alm-widget-search-mobile",USS_ALM_WIDGET_SEARCH_DESKTOP:"uss-alm-widget-search-desktop"},
metrics:{SECONDARY_ALM_ADD_TO_CART_CLICK_SUCCESS_COUNTER:"secondaryAlmAtcClickSuccess",SECONDARY_ALM_ADD_TO_CART_CLICK_ERROR_COUNTER:"secondaryAlmAtcClickError"}}})});
/* ******** */
(function(c){var b=window.AmazonUIPageJS||window.P,d=b._namespace||b.attributeErrors,a=d?d("DetailPageUSSPromotionNudgesAssets",""):b;a.guardFatal?a.guardFatal(c)(a,window):a.execute(function(){c(a,window)})})(function(c,b,d){});
/* ******** */
(function(f){var r=window.AmazonUIPageJS||window.P,t=r._namespace||r.attributeErrors,e=t?t("DetailPageUSSAssets",""):r;e.guardFatal?e.guardFatal(f)(e,window):e.execute(function(){f(e,window)})})(function(f,r,t){f.when("A").register("uss-constants-common",function(e){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:"uss-mobile-atc-success",ATC_ERROR:"atc-error",ITEM_IN_CART:"item-in-cart",SHIPPING_DETAILS:"uss-c-shipping-details",SHIPPING_MESSAGE_PLACEHOLDER:"shipping-message-placeholder",MAIN_IMAGE:"main-image",FACEOUT_IMAGE:"p13n-sc-list-image-container",FACEOUT_TITLE:"uss-asin-title",FACEOUT_REVIEW_STARS:"uss-review-stars",FACEOUT_BEST_SELLER:"p13n-best-seller",
FACEOUT_PRICE:"uss-price",ADDITIONAL_RECOMMENDATIONS_TOGGLE_ACTION:"uss-additional-recommendations-toggle-button",CONTINUE_SHOPPING_LINK:"continue-shopping",SUCCESS_ELEMENT:".p13n-sc-atc-success",ERROR_ELEMENT:".p13n-sc-atc-error",REMOVE_FROM_CART_ERROR_ELEMENT:".p13n-sc-remove-from-cart-error",BUTTON_ELEMENT:".a-button-primary",DISABLE_BUTTON:"a-button-disabled",QS_GRID_ELEMENT:".uss-qs-widget-container",QS_INC_BUTTON:".qs-increase-quantity",QS_DEC_BUTTON:".qs-decrease-quantity",QS_LABEL_ELEMENT:".qs-quantity-label-text",
QS_MAX_ORDER_LIMIT:".max-order-quantity-message",QS_OPACITY:"uss-qs-opacity",QS_TRASH_CAN:".qs-decrease-quantity-trash-can",QS_DEC_BUTTON_HYPHEN:".uss-qs-decrease-quantity-hyphen"},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."},quantityStepperUpdateType:{INCREMENT:"increment",DECREMENT:"decrement"},pageType:{detailPage:{mobileApp:"DetailWebView",
mobileWeb:"DetailAW"}},subPageType:"mobile-uss",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"},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"},quantityStepper:{CONTAINER_ID_PREFIX:"#uss-qs-container-"}},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:{CART_API_PROMISE_RESOLVED_TIMER:"cartApiPromiseResolve",PRODUCTV2IMAGES_API_PROMISE_RESOLVED_TIMER:"productV2ImagesApiPromiseResolve",
ATC_PROMISE_RESOLVED_TIMER:"atcPromiseResolve",SECONDARY_ATC_PROMISE_RESOLVED_TIMER:"secondaryAtcPromiseResolve",PRIMARY_ATC_STATUS_PROMISE_RESOLVED_TIMER:"primaryAtcStatusPromiseResolve",SECONDARY_ATC_STATUS_PROMISE_RESOLVED_TIMER:"secondaryAtcStatusPromiseResolve",PRIMARY_ADDITEMS_API_PROMISE_RESOLVED_TIMER:"primaryAddItemsApiPromiseResolve",SECONDARY_ADDITEMS_API_PROMISE_RESOLVED_TIMER:"secondaryAddItemsApiPromiseResolve",PERCOLATE_DATA_PROMISE_RESOLVED_TIMER:"percolateDataPromiseResolve",PERCOLATE_DATA_PROMISE_RESOLVED_LONG_TIME_COUNTER:"percolateDataPromiseResolveLongTime",
USS_PRIMARY_ATC_TIMER:"ussPrimaryAtc",USS_AFTER_PRIMARY_ATC_TIMER:"ussAfterPrimaryAtc",CART_API_PROMISE_REJECTED_COUNTER:"cartApiPromiseRejected",PRODUCTV2IMAGES_API_PROMISE_REJECTED_COUNTER:"productV2ImagesApiPromiseRejected",USS_PRIMARY_ADD_ITEMS_API_CALL_COUNTER:"ussPrimaryAddItemsApiCall",USS_PRIMARY_ATC_MASON_CALL_COUNTER:"ussPrimaryAtcMasonCall",USS_PRIMARY_ATC_AW_MASH_CALL_COUNTER:"ussPrimaryAtcAwMashCall",USS_PRIMARY_AW_MASH_GURUPA_COUNTER:"ussPrimaryAtcAwMashCallGurupa",USS_PRIMARY_AW_MASH_NATC_COUNTER:"ussPrimaryAtcAwMashCallNatc",
USS_PRIMARY_AW_MASH_SERVER_FAILURE_COUNTER:"ussPrimaryAtcAwMashServerFailure",USS_PRIMARY_AW_MASH_NATC_FAILURE_COUNTER:"ussPrimaryAtcAwMashNatcFailure",USS_PRIMARY_AW_MASH_GURUPA_FAILURE_COUNTER:"ussPrimaryAtcAwMashGurupaFailure",PRIMARY_ATC_NATC_PARAM_V1_COUNTER:"primaryAtcNatcParamV1",PRIMARY_ATC_NATC_PARAM_V2_COUNTER:"primaryAtcNatcParamV2",PRIMARY_ATC_NATC_PARAM_INVALID_COUNTER:"primaryAtcNatcParamInvalid",ATC_PROMISE_REJECTED_COUNTER:"atcPromiseRejected",PRIMARY_ATC_STATUS_PROMISE_REJECTED_COUNTER:"primaryAtcStatusPromiseRejected",
PRIMARY_ATC_MASON_CALL_REJECTED_COUNTER:"primaryAtcMasonCallRejected",SECONDARY_ATC_STATUS_PROMISE_REJECTED_COUNTER:"secondaryAtcStatusPromiseRejected",PRIMARY_ADDITEMS_API_PROMISE_REJECTED_COUNTER:"primaryAddItemsApiPromiseRejected",SECONDARY_ADDITEMS_API_PROMISE_REJECTED_COUNTER:"secondaryAddItemsApiPromiseRejected",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",CONTINUE_SHOPPING_CLICK:"continueShoppingClick",PAGE_LANDING_PRECONDITIONS_PASSED:"pageLandingPreconditionsPassed",
POST_ATC_PRECONDITIONS_FAILED:"postATCPreconditionsFailed",PROGRAM_ELIGIBILITY_REGISTRY_OVERWRITTEN:"programEligibilityRegistryOverwritten",USS_WEBLAB_IN_TREATMENT:"ussWeblabInTreatment",POST_ATC_WARRANTY_SELECTED_OR_INVALID_ACTION:"postATCFailedForWarrantyOrInvalidAction",POST_ATC_WEBLAB_DISABLED:"postATCFailedWeblabIsDisabled",PRIMARY_ADD_TO_CART_CLICK_COUNTER:"primaryAtcClick",USS_PRIMARY_ATC_DEFAULT_ENDPOINT_SUCCESS_RESPONSE:"primaryAtcSuccessMobileWebUsingDefaultEndpoint",USS_PRIMARY_ATC_DEFAULT_ENDPOINT_FAIL_RESPONSE:"primaryAtcFailureMobileWebUsingDefaultEndpoint",
PRIMARY_ATC_SUCCESS_COUNTER:"ussAtcSuccess",PRIMARY_ATC_SUCCESS_USS_ELIGIBLE_COUNTER:"ussAtcSuccessWithUssEligibleTrue",PRIMARY_ATC_WARRANTY_SELECTED_USS_ELIGIBLE:"PrimaryAtcWarrantySelectedInBuyboxAndUssEligible",PRIMARY_ADD_TO_CART_SUCCESS_METHOD_CALLED:"onPrimaryAddToCartSuccessCalled",AFTER_PRIMARY_ATC_ACTION_METHOD_CALLED:"callAfterPrimaryATCActionCalled",QUANTITY_STEPPER_CLICK:"ussQuantityStepperClick",QUANTITY_STEPPER_INCREMENT_CLICK:"ussQuantityStepperIncrementClick",QUANTITY_STEPPER_DECREMENT_CLICK:"ussQuantityStepperDecrementClick",
QUANTITY_STEPPER_QUANTITY_UPDATE_FAILURE:"ussQuantityStepperQuantityUpdateFailure",QUANTITY_STEPPER_MODIFY_ITEMS_API_PROMISE_RESOLVED_TIMER:"ussQuantityStepperModifyItemsApiPromiseResolve",QUANTITY_STEPPER_MAX_ORDER_QUANTITY_REACHED:"ussQuantityStepperMaxOrderQuantityReached",QUANTITY_STEPPER_SUMMARY_API_CALL_FAILURE:"ussQuantityStepperSummaryApiCallFailure",EMPTY_SLATE_TOKEN:"emptySlateToken"},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"},nexusConstants:{PRODUCER_ID:"uss",SCHEMA_ID:"uss.CounterData.",SCHEMA_VERSION:"3"},cartApiConstants:{USS_CART_TYPE:"RETAIL",USS_SHIPPING_MESSAGE:'\n\n      \n\n\n\n  \x3cdiv class\x3d"a-row a-spacing-base"\x3e\n    \n\n  \x3c/div\x3e\n',USS_ENVIRONMENT_PROD:"prod",USS_ENVIRONMENT_DEV:"dev",USS_PRODUCTV2IMAGES_PROD_URL_PATH:"https://m.media-amazon.com/images/I/",
USS_PRODUCTV2IMAGES_DEV_URL_PATH:"https://media-origin-na-ssl.integ.amazon.com/images/I/",USS_PRODUCTV2IMAGES_DIMENSIONS:"._SS40_.",USS_SECONDARY_ATC_QUANTITY:1,USS_PRIMARY_ATC_REFTAG:"mw_pa_dp_buy_crt",BASE_10:10},queryStrings:{qid:"qid",sr:"sr"},events:{PRIMARY_ATC_SUCCESS_EVENT:"dpx:add-to-cart:success",QUANTITY_STEPPER_UPDATE_EVENT:"uss-qs-update-quantity"}}});f.when("dp-flux-attribution","uss-constants-common").register("uss-constants",function(e,f){f.ussCTI={CATEGORY:"Website",TYPE:"Detail Page",
ITEM:"USS"};f.metrics.PREFIX="uss:";f.ajaxParams={BASE_URL:"/gp/product/handle-buy-box",REFTAG:"dp_start-bbf_1_glance",ASIN:"ASIN",OFFER_LISTING_ID:"offerListingID",AJAX_TIMEOUT:1E4};f.actionSources.SHEET_CLOSE_BUTTON_CLICK="sheet-close-button-click";f.ussCommonAttribution=new e("uss-common",f.ussCTI.CATEGORY,f.ussCTI.TYPE,f.ussCTI.ITEM);f.defaultAtcAnimationType=f.animationType.FADE_IN;f.atcAnimationStatusEvent="uss:atc:animation:status:resolved";return f});f.when("dp-flux-utils","uss-constants",
"nexus-util","uss-utils").register("uss-logger-service",function(e,f,m,n){function d(a,b){if(e.isNonEmptyString(a))a=n.getMetricsPrefix()+a,ue&&ue.count&&(b===t&&(b=1),ue.count(a,b),m.emitCounterData(a,b));else throw Error("counterKey must be non empty string");}function a(a){if(e.isNonEmptyString(a))this._timerName=a,this._startTime=0;else throw Error("timerName must be non empty string");}a.prototype={start:function(){this._startTime=Date.now()},stop:function(){this._startTime&&d(this._timerName,
Date.now()-this._startTime)},stopWithCounter:function(a,b,h){if(this._startTime){var l=Date.now()-this._startTime;d(this._timerName,l);l>a&&d(b,h)}}};return{logCounter:d,Timer:a}});f.when("A","uss-utils","uss-logger-service","uss-constants").register("uss-preconditions",function(e,f,m,n){function d(a){a=e.$("#"+a+"_feature_div").html();null!==a&&(a=a.trim());return null!==a&&0<a.length}function a(){return e.capabilities.transform&&e.capabilities.transition&&f.isFlexBoxSupported()}function c(){return e.$("#uss-weblabTreatment").val()}
var b=/^T[0-9]+$/;a()?m.logCounter(n.metrics.COMPATIBLE_BROWSER_COUNTER):m.logCounter(n.metrics.NON_COMPATIBLE_BROWSER_COUNTER);return{isUssConditionsPassed:function(){var b;if(b="true"===e.$("#uss-serverPreconditionsPassed").val()){if(b=a()&&!d("scheduledDelivery")&&!d("partialStateBuyBox"))b=e.$("#add-to-cart-button"),b=b.length&&"submit"==b.prop("type");b=b&&!(e.$("#attach-accessory-card-deck").length&&(f.isMobileApp()||e.$("#attach-accessory-mobile-web-mbs").length))}return b},isUssWeblabInTreatment:function(){return b.test(c())},
triggerUSSWeblabValue:function(){return b.test(e.$("#uss-miniFrameworkWeblabTreatment").val())?e.$("#uss-weblabValue").val():1},ussWeblabTreatmentValue:c,checkIfSnsInterstitialExists:function(){return d("snsInterstitialWidget")},getSnsInterstitialTrigger:function(){return"show-sns-interstitial"},isBrowserUssCompatible:a,isMobileAppUssEligible:function(){return e.$("#ussEligible").length&&"1"===e.$("#ussEligible").val()}}});f.when("A","3p-promise","uss-constants").register("uss-utils",function(e,f,
m){function n(){return"true"===e.$("#uss-mobileApp").val()}function d(a){var b=null;k.hasOwnProperty(a)&&(b=k[a]);return b}function a(){}function c(a){}var b=e.$,h=m.classList,l=m.pageType,g=m.subPageType,p=b("body"),k={},u=["isPreview","forceWidgets","previewCampaigns","auditEnabled"];(function(){var a=r.location.search,a=a.substr(1);a.split("\x26").forEach(function(a){a=a.split("\x3d");2===a.length&&(k[a[0]]=a[1])})})();return{loadImage:function(a,k){return new f(function(g,c){k=k||"";var l=b("\x3cimg src\x3d'"+
a+"' alt\x3d'"+k+"'\x3e");l.load(function(){g(l)});l.error(function(a){c(a)});l[0].complete&&g(l)})},isFlexBoxSupported:function(){var a=e.$("\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(){p.addClass(h.STOP_SCROLLING)},enablePageScroll:function(){p.removeClass(h.STOP_SCROLLING)},isMobileApp:n,getPageType:function(){return!1===n()?l.detailPage.mobileWeb:l.detailPage.mobileApp},
getSubPageType:function(){return g},getDebugParams:function(){var a={};u.forEach(function(k){var b=d(k);b&&(a[k]=b)});return a},shouldFireAndForgetWeblabTrigger:function(){var a=!1;0!=b("#uss-shouldFireAndForgetWeblabTrigger").length&&(a="true"===b("#uss-shouldFireAndForgetWeblabTrigger").val());return a},fireAndForgetWeblabTrigger:function(a,k){var b="/ussx/weblab-trigger?",b=/^T[0-9]+$/.test(e.$("#uss-miniFrameworkWeblabTreatment").val())?b+("weblabValue\x3d"+a+"\x26treatment\x3d"+k):b+("triggerWeblab\x3d"+
a+"\x26treatment\x3d"+k);r.navigator&&navigator.sendBeacon?navigator.sendBeacon(b)||e.$.ajax({url:b}):e.$.ajax({url:b})},showATCSuccess:function(){e.$("#atc-toast").length&&e.$("#atc-success").length&&(e.$("#atc-toast").css("display","block"),e.$("#atc-toast").addClass("atc-toast-success-styles"),e.$("#atc-success").css("display","block"),setTimeout(function(){e.$("#atc-success").css("display","none");e.$("#atc-toast").css("display","none");e.$("#atc-toast").removeClass("atc-toast-success-styles")},
1500))},showATCFailure:function(){e.$("#atc-toast").length&&e.$("#atc-failed").length&&(e.$("#atc-toast").css("display","block"),e.$("#atc-toast").addClass("atc-toast-failure-styles"),e.$("#atc-failed").css("display","block"),setTimeout(function(){e.$("#atc-failed").css("display","none");e.$("#atc-toast").css("display","none");e.$("#atc-toast").removeClass("atc-toast-failure-styles")},1500))},vibrateMobileApp:function(){return r.amazon&&r.amazon.cordova&&r.amazon.cordova.notification&&r.amazon.cordova.notification.vibrate&&
r.amazon.cordova.notification.vibrate(50)},handleATCAnimationEnd:function(){e.$(".inst-button-space").length&&e.$(".inst-indicator").length&&(e.$(".inst-button-space").addClass("aok-hidden"),e.$(".inst-indicator").addClass("aok-hidden"),e.$(".atc-button-text").removeClass("aok-hidden"),e.$("#add-to-cart-button").removeAttr("disabled"),e.$("body").removeClass("inst-btn-opacity"))},handleATCAnimationEndWeb:function(){e.$("#add-to-cart-button").removeAttr("disabled");var a=e.$("#a-page");0!==a.length&&
a[0].style.removeProperty("opacity")},updateCartCount:function(b){r.amazon&&r.amazon.mash&&r.amazon.mash.cart&&r.amazon.mash.cart.didUpdate&&"function"===typeof r.amazon.mash.cart.didUpdate&&r.amazon.mash.cart.didUpdate({newCartQuantity:b,successCallback:a,failCallback:c})},getUrlParameter:d,getQuantityStepperContainer:function(a,b){return document.querySelector(b?m.layout.quantityStepper.CONTAINER_ID_PREFIX+a+"-"+b:m.layout.quantityStepper.CONTAINER_ID_PREFIX+a)},getMetricsPrefix:function(){return n()?
"uss:mobileApp:":"uss:mobile:"}}});f.when("A","atf","uss-utils").register("uss-init-helper",function(e,q,m,n){return{loadUssCommonAssetsAfterPreload:function(){f.when("uss-constants","dp-flux-action","uss-dispatcher","uss-utils").register("uss-action-creator-helper",function(d,a,c,b){function h(){e.$("#add-to-cart-button").removeAttr("disabled")}return{primaryATCClick:function(l,g){var p=new a(d.actions.USS_OPEN,d.actionSources.DP_ATC_CLICK,{recommendationBaseIdentifier:l});g.percolateData.then(function(b){var u=
{isContainsRecommendation:!1,widgets:[]};b.recommendationData&&(u.widgets=b.recommendationData.widgets||[]);h();u.widgets.length||(u.widgets.push({widgetType:d.widgetType.NO_RECOMMENDATION_WIDGET}),u.recommendationBaseIdentifier=l);c.dispatch(p);g.atcData.then(function(b){var k={};1===b.isOk?k=b.atcStatusData:k.isAtcGenericError=!0;b=new a(d.actions.ATC_RECEIVE,d.actionSources.DP_ATC_CLICK,k);c.dispatch(b)},function(){var b=new a(d.actions.ATC_RECEIVE,d.actionSources.DP_ATC_CLICK,{isAtcGenericError:!0});
c.dispatch(b)});u.recommendationBaseIdentifier=l;b=new a(d.actions.RECOMMENDATION_DATA_RECEIVE,d.actionSources.DP_ATC_CLICK,u);c.dispatch(b)},function(){g.atcData.then(function(a){h();1===a.isOk?b.showATCSuccess():b.showATCFailure()},function(){b.showATCFailure()})})},secondaryATCClick:function(b,g){b.atcData.then(function(b){var k={};1===b.isOk?k=b.atcStatusData:k.isAtcGenericError=!0;k.params=g;b=new a(d.actions.ATC_RECEIVE,d.actionSources.USS_INLINE_ATC_CLICK,k);c.dispatch(b)},function(){})}}})},
loadUssCommonAssets:function(){f.when("dp-flux-dispatcher").register("uss-dispatcher",function(d){return new d});f.when("A","uss-constants").register("promising-ui-element",function(d,a){var c=a.classList;return d.createClass({_element:null,_uiPromiseElement:null,_uiValueElement:null,_isResolved:!1,init:function(a){var d=a.find("."+c.UI_PROMISE),l=a.find("."+c.UI_VALUE);if((a.hasClass(c.PROMISING_UI_ELEMENT)||a.hasClass(c.PROMISING_UI_ELEMENT_ANIMATION))&&d.length&&l.length)this._uiPromiseElement=
d,this._uiValueElement=l,this._element=a,this.showUIPromise();else throw Error("PromisingUIElement.init()...: HTML structure is not compatible with PromisingUIElement");},showUIPromise:function(){this._element.addClass(c.IS_LOADING);this._element.removeClass(c.IS_RESOLVED);this._isResolved=!1},showUIValue:function(){this._element.addClass(c.IS_RESOLVED);this._element.removeClass(c.IS_LOADING);this._isResolved=!0},getValueElement:function(){return this._uiValueElement},getElement:function(){return this._element},
isResolved:function(){return this._isResolved}})});f.when("A","uss-sheet-component","uss-constants","uss-logger-service","uss-store-repository","dp-flux-attribution","uss-final-layout","dp-flux-view","widget-creation-helper","dp-flux-action","uss-dispatcher").register("uss-sheet-view",function(d,a,c,b,h,l,g,p,k,u,v){function e(){F=!0;var A=c.classList,m=c.ussCTI,q=h.getStore(c.stores.USS_SHEET_STORE),n=h.getStore(c.stores.RECOMMENDATION_DATA_STORE),r=[q,n],m=new l("uss-sheet-view",m.CATEGORY,m.TYPE,
m.ITEM);d.declarative(A.ADDITIONAL_RECOMMENDATIONS_TOGGLE_ACTION,"click",function(a){a=a.$target;var k=f(a.context.parentElement.parentElement.parentElement.childNodes.item(3)),g=a.context.nextElementSibling.nextElementSibling.nextElementSibling;"false"===g.value?(g.value="true",g=a.context.nextElementSibling,k.context.classList.remove(A.HIDE_ELEMENT),a.context.textContent=g.value,b.logCounter(c.metrics.SEE_MORE_CLICK_COUNTER)):(g.value="false",g=a.context.nextElementSibling.nextElementSibling,k.context.classList.add(A.HIDE_ELEMENT),
a.context.textContent=g.value,b.logCounter(c.metrics.SEE_LESS_CLICK_COUNTER))});d.on("a:expander:ussWidgetExpander:toggle:expand",function(a){b.logCounter(c.metrics.SEE_MORE_CLICK_COUNTER);a.expander.$expander.find("li:eq(3)").focus()});d.on("a:expander:ussWidgetExpander:toggle:collapse",function(a){b.logCounter(c.metrics.SEE_LESS_CLICK_COUNTER);a.expander.$expander.focus()});var w=new a(A.USS_SHEET_VIEW_IDENTIFIER,{beforeClose:function(){v.dispatch(new u(c.actions.USS_CLOSE,c.actionSources.SHEET_CLOSE_BUTTON_CLICK))}}),
E=w.getSheetElement(),y=new g(E);new p(m,r,function(a){var b;if(-1!==f.inArray(q,a))if(b=q.getState(),b.isSheetOpen()){if(b.getActionSource()===c.actionSources.DP_ATC_CLICK){y.reset();var g=k.createAtcStatusWidget();b=k.createIMBWidget(b.getActionSource());y.renderWidgets([g,b])}w.open()}else b.getActionSource()!==c.actionSources.SHEET_CLOSE_BUTTON_CLICK&&w.close();-1!==f.inArray(n,a)&&y.renderWidgets(k.createRecommendationWidget(n))})}var f=d.$,F=!1;return{initializeUSSSheetView:function(){F||e()}}});
f.when("A","uss-constants","uss-template-store","uss-widget-factory").register("widget-creation-helper",function(d,a,c,b){return{createAtcStatusWidget:function(){var d={content:c.getTemplate(a.widgetType.ATCStatusWidget),widgetType:a.widgetType.ATCStatusWidget};return b.getWidget(d)},createRecommendationWidget:function(a){var c,g=[];a=a.getState().getNewRecommendations();d.each(a,function(a){(c=b.getWidget(a))&&g.push(c)});return g},createIMBWidget:function(){return b.getWidget({content:"\x3cdiv\x3e\x3c/div\x3e",
widgetType:a.widgetType.ATC_STATUS_IMB_WIDGET})}}});f.when("A","dp-flux-store","uss-dispatcher").register("uss-store-repository",function(d,a,c){var b={};return{registerStore:function(d,l,g){l=new a(d,l,c,g);return b[d.getName()]=l},getStore:function(a){return b[a]},getDispatcher:function(){return c}}});f.when("A","uss-store-repository","dp-flux-attribution","uss-sheet-store","uss-constants").register("uss-recommendation-data-store",function(d,a,c,b,h){function l(a,b,g){this._unprocessedChunkIndex=
g||0;this._recommendationBaseIdentifier=a;this._dataChunks=b||[]}var g=d.$,p=h.ussCTI;c=new c(h.stores.RECOMMENDATION_DATA_STORE,p.CATEGORY,p.TYPE,p.ITEM);b=a.getStore(h.stores.USS_SHEET_STORE);l.prototype={_getRecommendations:function(a){var b=[];a<this._dataChunks.length&&d.each(this._dataChunks,function(g,c){c>=a&&d.each(g,function(a){b.push(a)})});return b},getAllRecommendations:function(){return this._getRecommendations(0)},getNewRecommendations:function(){return this._getRecommendations(this._unprocessedChunkIndex)},
getRecommendationBaseIdentifier:function(){return this._recommendationBaseIdentifier},addRecommendationChunk:function(a){var b=[];d.each(a,function(a){a.widgetType=a.widgetType||h.widgetType.RECOMMENDATION_WIDGET});b=g.merge(b,this._dataChunks);b=g.merge(b,[a]);return new l(this._recommendationBaseIdentifier,b,this._dataChunks.length)}};p=new l;return a.registerStore(c,function(k,g){var c=k,d=h.actions;switch(g.getName()){case d.USS_OPEN:a.getDispatcher().waitFor([b.getDispatchToken()]);b.getState().getActionSource()===
h.actionSources.DP_ATC_CLICK&&(c=new l(b.getState().getRecommendationBaseIdentifier()));break;case d.RECOMMENDATION_DATA_RECEIVE:d=b.getState().getRecommendationBaseIdentifier(),g=g._metadata,g.recommendationBaseIdentifier===d&&(c=k.addRecommendationChunk(g.widgets))}return c},p)});f.when("uss-store-repository","dp-flux-attribution","uss-constants").register("uss-sheet-store",function(d,a,c){function b(a,b,k){this._isSheetOpen=a||!1;this._actionSource=b;this._recommendationBaseIdentifier=k}var h=
c.actions,l=c.ussCTI;a=new a(c.stores.USS_SHEET_STORE,l.CATEGORY,l.TYPE,l.ITEM);b.prototype={isSheetOpen:function(){return this._isSheetOpen},getActionSource:function(){return this._actionSource},getRecommendationBaseIdentifier:function(){return this._recommendationBaseIdentifier}};l=new b(!1);return d.registerStore(a,function(a,d){var k=a;switch(d.getName()){case h.USS_OPEN:a.isSheetOpen()||(d.getSource()===c.actionSources.DP_ATC_CLICK?k=new b(!0,d.getSource(),d.getMetaData().recommendationBaseIdentifier):
d.getSource()===c.actionSources.USS_INGRESS_CLICK&&a.getRecommendationBaseIdentifier()&&(k=new b(!0,d.getSource(),a.getRecommendationBaseIdentifier())));break;case h.USS_CLOSE:a.isSheetOpen()&&(k=new b(!1,d.getSource(),a.getRecommendationBaseIdentifier()))}return k},l)});f.when("A","uss-store-repository","dp-flux-attribution","uss-constants","dp-flux-utils").register("uss-atc-status-store",function(d,a,c,b,h){function l(){this.status=t;this.mainImage={};this.isAtcGenericError=this.shippingMessageHTML=
this.imbHTML=t}d=new c("uss-atc-status-store",b.ussCTI.CATEGORY,b.ussCTI.TYPE,b.ussCTI.ITEM);l.prototype={setStatus:function(a){this.status=1===a||a===b.classList.ATC_SUCCESS?b.classList.ATC_SUCCESS:b.classList.ATC_ERROR},setMainImage:function(a,b){h.isNonEmptyString(a)&&(this.mainImage.src=a,h.isNonEmptyString(b)?this.mainImage.altText:this.mainImage.altText="")},setImbHTML:function(a){h.isNonEmptyString(a)&&(this.imbHTML=a)},setShippingMessageHTML:function(a){h.isNonEmptyString(a)&&(this.shippingMessageHTML=
a)},setIsAtcGenericError:function(a){this.isAtcGenericError=a}};c=new l;a.registerStore(d,function(a,d){var k=a;switch(d.getName()){case b.actions.ATC_RECEIVE:var c=d.getMetaData();d.getSource()===b.actionSources.DP_ATC_CLICK?(k=new l,c.isAtcGenericError?k.setIsAtcGenericError(!0):(k.setStatus(c.status),k.setMainImage(c.mainImage.src,c.mainImage.altText),k.setImbHTML(c.imbHTML),k.setShippingMessageHTML(c.shippingMessageHTML))):d.getSource()!==b.actionSources.USS_INLINE_ATC_CLICK||c.isAtcGenericError||
(k=new l,k.setStatus(a.status),k.setMainImage(a.mainImage.src,a.mainImage.altText),k.setImbHTML(a.imbHTML),k.setShippingMessageHTML(a.shippingMessageHTML));break;case b.actions.USS_OPEN:d.getSource()===b.actionSources.DP_ATC_CLICK&&(k=new l)}return k},c)});f.when("A","uss-constants").register("uss-template-store",function(d,a){var c=d.$,b=a.classList,h={};return{init:function(){var a=c("."+b.TEMPLATE_STORE),d;1===a.length&&a.find("."+b.TEMPLATE).each(function(a,k){d=c("\x3cdiv\x3e\x3c/div\x3e");k=
c(k);d.append(k);(a=k.data(b.TEMPLATE_NAME))&&(h[a]=d.html())})},getTemplate:function(a){return h[a]},_nameToTemplateMap:h}});f.when("A","dp-flux-attribution","dp-flux-utils","uss-store-repository","uss-widget","uss-constants").register("uss-widget-factory",function(d,a,c,b,h,l){var g=d.$,p={};p[l.widgetType.WIDGET]=h;d=l.ussCTI;var k=new a("uss-widget-factory",d.CATEGORY,d.TYPE,d.ITEM);return{registerWidgetType:function(a,b){if(!c.isNonEmptyString(a))throw Error("uss-widget-factory.registerWidgetType()... : name parameter must be valid string. provided name param is \x3d "+
a);if(!(b.prototype instanceof h))throw Error("uss-widget-factory.registerWidgetType()... : constructor.prototype must be instance of Widget. provided constructor param is \x3d "+b);p[a]=b},getWidgetType:function(a){return p[a]},getWidget:function(b){var d,c=k;try{var h=b.widgetType||l.widgetType.WIDGET,e=p[h];if(!e)return f.log("Widget.getWidget()... : Constructor not exist for type : "+h,"FATAL",c.getAttribution()),d;var m=e.getAttribution&&e.getAttribution();m&&(c=m);if(b.attribution)var q=b.attribution,
c=new a(q.name,q.category,q.type,q.item);var n=g(b.content),r=g("\x3cdiv\x3e\x3c/div\x3e");r.append(n);d=new e(c,r)}catch(t){f.log("Widget.getWidget()... : "+t.message,"FATAL",c.getAttribution&&c.getAttribution())}return d}}});f.when("A","uss-constants","dp-flux-view","uss-store-repository","uss-dispatcher").register("uss-widget",function(d,a,c,b,h){function l(a){var c=[];d.each(a,function(a){var k=b.getStore(a);if(k)c.push(k);else throw Error("Widget.getWidget().getStores()... : store with name \x3d "+
a+" not exists");});return c}var g=a.classList,p=a.widgetType;return d.createClass({init:function(a,b){this._element=b;this._element.addClass(p.WIDGET);this._element.addClass(g.HIDE_ELEMENT);this._attribution=a;this._dispacther=h;this.getStoreNames().length&&(b=l(this.getStoreNames()),this._fluxView=new c(a,b,this.update.bind(this)),this.update(b))},show:function(b){b=b||{};b=b.showWidgetAnimation||{};var c=a.animationType;b.animationType=b.animationType||c.NO_ANIMATION;switch(b.animationType){case c.FADE_IN:d.fadeIn(this._element,
b.timeDuration||100,b.transitionTimingFunction||a.transitionTimingFunction.EVEN_EASE);break;case c.NO_ANIMATION:this._element.addClass(g.SHOW_ELEMENT),this._element.removeClass(g.HIDE_ELEMENT)}},hide:function(){this._element.addClass(g.HIDE_ELEMENT);this._element.removeClass(g.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()}})});f.when("A","uss-constants","uss-widget-factory","uss-logger-service").register("uss-recommendation-widget",function(d,a,c,b){var h=a.widgetType,l=c.getWidgetType(h.WIDGET),g=a.metrics;a=l.extend({init:function(a,b){this._super(a,b);this._element.addClass(h.RECOMMENDATION_WIDGET)}});(function(){d.declarative(g.FACEOUT_IMAGE_CLICK_COUNTER,"click",function(a){b.logCounter(g.FACEOUT_IMAGE_CLICK_COUNTER)});
d.declarative(g.FACEOUT_REVIEW_STARS_CLICK_COUNTER,"click",function(a){b.logCounter(g.FACEOUT_REVIEW_STARS_CLICK_COUNTER)});d.declarative(g.FACEOUT_PRICE_CLICK_COUNTER,"click",function(a){b.logCounter(g.FACEOUT_PRICE_CLICK_COUNTER)});d.declarative(g.FACEOUT_TITLE_CLICK_COUNTER,"click",function(a){b.logCounter(g.FACEOUT_TITLE_CLICK_COUNTER)});d.declarative(g.FACEOUT_BEST_SELLER_CLICK_COUNTER,"click",function(a){b.logCounter(g.FACEOUT_BEST_SELLER_CLICK_COUNTER)})})();c.registerWidgetType(h.RECOMMENDATION_WIDGET,
a);return a});f.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(d,a,c,b,h,l,g){var p=a.widgetType;d=c.getWidgetType(p.WIDGET);var k=a.ussCTI,u=new b(a.widgetType.NO_RECOMMENDATION_WIDGET,k.CATEGORY,k.TYPE,k.ITEM);b=d.extend({init:function(b,c){this._super(b,c);this._element.addClass(p.NO_RECOMMENDATION_WIDGET);b=h.getTemplate(a.widgetType.NO_RECOMMENDATION_WIDGET);this._element.append(b);
this._continueShoppingLink=this._element.find("."+a.classList.CONTINUE_SHOPPING_LINK);this._continueShoppingLink.click(function(b){b.preventDefault();g.logCounter(a.metrics.CONTINUE_SHOPPING_CLICK);this.getDispatcher().dispatch(new l(a.actions.USS_CLOSE,a.actionSources.CONTINUE_SHOPPING_CLICK))}.bind(this))}});b.getAttribution=function(){return u};c.registerWidgetType(p.NO_RECOMMENDATION_WIDGET,b);return b});f.when("A","uss-constants","uss-widget-factory").register("primary-action-status-widget",
function(d,a,c){var b=a.widgetType;d=c.getWidgetType(b.WIDGET).extend({init:function(a,c){this._super(a,c);this.getElement().addClass(b.PRIMARY_ACTION_STATUS_WIDGET)}});c.registerWidgetType(b.PRIMARY_ACTION_STATUS_WIDGET,d);return d});f.when("A","promising-ui-element","uss-utils","uss-constants").register("promising-image",function(d,a,c,b){var h=d.$,l=b.classList;return a.extend({init:function(a,b){this._element=h(b);this._attribution=a;this._super(this._element);this._eventHandle=t},_showTickMarkImage:function(a){switch(a){case l.ATC_SUCCESS:this._showSuccessTickMark();
break;case l.ATC_ERROR:this._showErrorTickMark();break;default:return}d.off(this._eventHandle.event,this._eventHandle.callback)},_showSuccessTickMark:function(){h(".main-image").find(".success-tick-mark-placeholder").addClass("success-tick-mark-image")},_showErrorTickMark:function(){var a=h(".main-image").find(".error-tick-mark-placeholder");a.addClass("error-tick-mark-image");d.fadeIn(a,200,b.transitionTimingFunction.EASE_OUT)},showUIValue:function(a,l,k){var u=this,e=b.defaultAtcAnimationType,m=
this._super.bind(this);e===b.animationType.FADE_IN&&(this._eventHandle=d.on(b.atcAnimationStatusEvent,this._showTickMarkImage.bind(this,k)));return c.loadImage(a,l).then(function(a){if(e===b.animationType.FADE_IN){var c=h(".main-image").find(".ui-promise");d.fadeOut(c,200,b.transitionTimingFunction.EASE_IN,function(){u._appendImageToUIValue(a);m();var c=h(".main-image").find(".ui-value");d.fadeIn(c,200,b.transitionTimingFunction.EASE_OUT)})}else this._appendImageToUIValue(a),m();return!0}.bind(this),
function(){f.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)}})});f.when("A","promising-ui-element","uss-constants").register("atc-status-msg",function(d,a,c){var b=c.classList;return a.extend({init:function(a){this._atcStatusElement=a;this._super(this._atcStatusElement)},_showSuccessMessage:function(){this._atcStatusElement.addClass(b.ATC_SUCCESS);
this._atcStatusElement.removeClass(b.ATC_ERROR);this._atcStatusElement.removeClass(b.ITEM_IN_CART)},_showSuccessMessageDesktop:function(){this._atcStatusElement.addClass(b.ATC_SUCCESS_DESKTOP);this._atcStatusElement.removeClass(b.ATC_ERROR);this._atcStatusElement.removeClass(b.ITEM_IN_CART)},_showFailureMessage:function(){this._atcStatusElement.addClass(b.ATC_ERROR);this._atcStatusElement.removeClass(b.ATC_SUCCESS);this._atcStatusElement.removeClass(b.ITEM_IN_CART)},_showItemInCartMessage:function(){this._atcStatusElement.addClass(b.ITEM_IN_CART);
this._atcStatusElement.removeClass(b.ATC_ERROR);this._atcStatusElement.removeClass(b.ATC_SUCCESS)},showUIValue:function(a){var l=this,g=c.defaultAtcAnimationType;switch(a){case b.ATC_SUCCESS:this._showSuccessMessage();break;case b.ATC_SUCCESS_DESKTOP:this._showSuccessMessageDesktop();break;case b.ATC_ERROR:this._showFailureMessage();break;case b.ITEM_IN_CART:this._showItemInCartMessage();break;default:return}this._super();g===c.animationType.FADE_IN&&(a=this._atcStatusElement.find("."+b.UI_PROMISE),
d.fadeOut(a,200,c.transitionTimingFunction.EASE_IN,function(){var a=l._atcStatusElement.find("."+b.UI_VALUE);d.fadeIn(a,200,c.transitionTimingFunction.EASE_OUT,function(){d.trigger(c.atcAnimationStatusEvent)})}))}})});f.when("A","uss-constants").register("uss-shipping-details",function(d,a){var c=d.$;return{getInstance:function(b){var h=b.find("."+a.classList.SHIPPING_DETAILS),l=h.find("."+a.classList.SHIPPING_MESSAGE_PLACEHOLDER),g=a.defaultAtcAnimationType,p=t,k=function(){var a=l.find(".a-row").find("a"),
b=a.attr("onclick");if("undefined"!==typeof b&&b.includes("amz_js_PopWin")){var d=[];c.each(a[0].attributes,function(a,b){d.push(b.name)});c.each(d,function(b,c){a.removeAttr(c)});a.attr("href","/gp/help/customer/display.html?nodeId\x3d527692")}},e={hide:function(){h.addClass(a.classList.HIDE_ELEMENT);h.removeClass(a.classList.SHOW_ELEMENT)},atcAnimationStatusResolved:function(){setTimeout(function(){h.addClass("uss-c-shipping-details-transition");d.off(p.event,p.callback)}.bind(),200)},show:function(b){l.empty();
l.append(d.$(b));k();h.addClass(a.classList.SHOW_ELEMENT);h.removeClass(a.classList.HIDE_ELEMENT);g===a.animationType.FADE_IN&&(p=d.on(a.atcAnimationStatusEvent,e.atcAnimationStatusResolved.bind()))}};e.hide();return e}}});f.when("A","uss-constants","primary-action-status-widget","dp-flux-attribution","uss-widget-factory","atc-status-msg","promising-image","uss-shipping-details").register("atc-status-widget",function(d,a,c,b,h,l,g,p){var k=a.ussCTI,e=a.widgetType,v=a.classList,f=new b(a.widgetType.ATCStatusWidget,
k.CATEGORY,k.TYPE,k.ITEM);c=c.extend({init:function(a,b){this._atcGenericError=b.find("."+v.ATC_GENERIC_ERROR);this._atcAcknowledgementMessage=b.find("."+v.ATC_ACKNOWLEDGEMENT_MESSAGE);this._mainImage=new g(a,this._atcAcknowledgementMessage.find("."+v.MAIN_IMAGE));this._atcStatusMessage=new l(this._atcAcknowledgementMessage.find("."+v.ATC_STATUS_MESSAGE_COMPONENT));this._shippingDetails=p.getInstance(this._atcAcknowledgementMessage);this._viewState={};this._super(a,b)},update:function(b){var c;d.each(b,
function(b){b.getStoreAttribution().getName()===a.stores.ATC_STATUS_STORE&&(c=b.getState(),c.isAtcGenericError?this.showGenericError():(b=d.diff(this._viewState,c),b.status&&c.status&&this._atcStatusMessage.showUIValue(c.status),b.mainImage.src&&c.mainImage.src&&this._mainImage.showUIValue(c.mainImage.src,c.mainImage.altText,c.status),b.shippingMessageHTML&&c.shippingMessageHTML&&this._shippingDetails.show(c.shippingMessageHTML)),this._viewState=c)}.bind(this))},showGenericError:function(){this._atcAcknowledgementMessage.addClass(v.HIDE_ELEMENT);
this._atcAcknowledgementMessage.removeClass(v.SHOW_ELEMENT);this._atcGenericError.removeClass(v.HIDE_ELEMENT);this._atcGenericError.addClass(v.SHOW_ELEMENT)},getStoreNames:function(){return[a.stores.ATC_STATUS_STORE]}});c.getAttribution=function(){return f};h.registerWidgetType(e.ATCStatusWidget,c);return c});f.when("A","uss-constants","dp-flux-attribution","uss-widget-factory").register("atc-status-imb-widget",function(d,a,c,b){var h=b.getWidgetType(a.widgetType.WIDGET),l=a.ussCTI,g=new c("atc-status-imb-widget",
l.CATEGORY,l.TYPE,l.ITEM);c=h.extend({init:function(b,c){c.addClass(a.widgetType.ATC_STATUS_IMB_WIDGET);this._super(b,c)},update:function(b){var c;d.each(b,function(b){if(b.getStoreAttribution().getName()===a.stores.ATC_STATUS_STORE)if(c=b.getState(),c.imbHTML){this.getElement().empty();b=d.$(c.imbHTML);var l=b.children().length;if(1<=l){b.find(".a-declarative a").unwrap();var h=b.find(".a-declarative span");h.removeClass("a-color-link huc-cursor-pointer");h.unwrap();this.getElement().append(b);this.show();
1<l&&f.log("ImbWidget.update(...): More than one IMB message exist : html \x3d "+c.imbHTML,"WARN",g.getAttribution())}else this.hide()}else this.hide()}.bind(this))},afterRender:function(){this.hide()},getStoreNames:function(){return[a.stores.ATC_STATUS_STORE]}});c.getAttribution=function(){return g};b.registerWidgetType(a.widgetType.ATC_STATUS_IMB_WIDGET,c);return c});f.when("A").register("uss-base-layout",function(d){return d.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}})});f.when("A","uss-base-layout","promising-ui-element","uss-constants","primary-action-status-widget","atc-status-imb-widget").register("uss-default-layout",function(d,a,c,b,h,l){var g=b.layout.defaultLayout;return a.extend({init:function(a){this._super(a);this._element=a.find("."+g.DEFAULT_LAYOUT);this._ussHead=this._element.find("."+g.HEAD);this._ussBody=
this._element.find("."+g.BODY);this._widgetList=[];this._recommendationLoader=d.$("."+g.SKELETON_LOADER);this._recommendationLoadingMessage=d.$("."+g.RECOMMENDATION_LOADING_MESSAGE);this._recommendationLoadedMessage=d.$("."+g.RECOMMENDATION_LOADED_MESSAGE);this._ussBody.append(this._recommendationLoader);this._recommendationLoaderFadeOutOptions={timeDuration:200,transitionTimingFunction:b.transitionTimingFunction.EASE_IN};this._recommendationLoaderFadeInOptions={timeDuration:200,transitionTimingFunction:b.transitionTimingFunction.EASE_OUT};
this._recommendationWidgetOptions={showWidgetAnimation:{animationType:b.animationType.FADE_IN,timeDuration:200,transitionTimingFunction:b.transitionTimingFunction.EASE_OUT}}},renderWidgets:function(a){var b,c=!1;d.each(a,function(a){b={};a.beforeRender();this._widgetList.push(a);if(a instanceof h)this._ussHead.prepend(a.getElement());else if(a.getElement().addClass(g.BOTTOM_MARGIN_BETWEEN_WIDGETS),a.getElement().addClass(g.TOP_MARGIN_BETWEEN_WIDGETS),a instanceof l)this._ussBody.prepend(a.getElement());
else{if(!c){c=!0;var e=this;d.fadeOut(this._recommendationLoader,this._recommendationLoaderFadeOutOptions.timeDuration,this._recommendationLoaderFadeOutOptions.transitionTimingFunction,function(){d.fadeIn(e._recommendationLoadedMessage,e._recommendationLoaderFadeInOptions.timeDuration,e._recommendationLoaderFadeInOptions.transitionTimingFunction)})}b=this._recommendationWidgetOptions;this._ussBody.append(a.getElement())}a.show(b);a.afterRender()}.bind(this))},reset:function(){d.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)}})});f.when("uss-constants","dp-flux-action","uss-dispatcher","uss-utils").register("uss-action-creator-helper",
function(d,a,c,b){function h(){e.$("#add-to-cart-button").removeAttr("disabled")}return{primaryATCClick:function(l,g){var e=new a(d.actions.USS_OPEN,d.actionSources.DP_ATC_CLICK,{recommendationBaseIdentifier:l});g.percolateData.then(function(b){var f={isContainsRecommendation:!1,widgets:[]};b.recommendationData&&(f.widgets=b.recommendationData.widgets||[]);h();f.widgets.length||(f.widgets.push({widgetType:d.widgetType.NO_RECOMMENDATION_WIDGET}),f.recommendationBaseIdentifier=l);c.dispatch(e);g.atcData.then(function(b){var k=
{};1===b.isOk?k=b.atcStatusData:k.isAtcGenericError=!0;b=new a(d.actions.ATC_RECEIVE,d.actionSources.DP_ATC_CLICK,k);c.dispatch(b)},function(){var b=new a(d.actions.ATC_RECEIVE,d.actionSources.DP_ATC_CLICK,{isAtcGenericError:!0});c.dispatch(b)});f.recommendationBaseIdentifier=l;b=new a(d.actions.RECOMMENDATION_DATA_RECEIVE,d.actionSources.DP_ATC_CLICK,f);c.dispatch(b)},function(){g.atcData.then(function(a){h();1===a.isOk?b.showATCSuccess():b.showATCFailure()},function(){b.showATCFailure()})})},secondaryATCClick:function(b,
g){b.atcData.then(function(b){var k={};1===b.isOk?k=b.atcStatusData:k.isAtcGenericError=!0;k.params=g;b=new a(d.actions.ATC_RECEIVE,d.actionSources.USS_INLINE_ATC_CLICK,k);c.dispatch(b)},function(){})}}})},initializeUSSComponents:function(){f.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-final-layout").register("uss-framework-ready",
function(d){d.init()});f.when("uss-sheet-view","uss-framework-ready").register("uss-sheet-view-ready",function(d){d.initializeUSSSheetView()})},initializeAtcInterceptor:function(){f.when("uss-atc-interceptor","atc-status-widget","atc-status-imb-widget","uss-atc-status-store","uss-framework-ready","uss-sheet-view-ready").execute(function(d){d.init()})},initializeBuyBox:function(){f.when("buy-box-override","atc-status-widget","atc-status-imb-widget","uss-atc-status-store","uss-framework-ready","uss-sheet-view-ready").execute(function(d){d.init()})}}});
f.when("A","uss-constants","uss-logger-service").register("uss-eligibility",function(e,f,m){var n=e.$,d=f.metrics,a={};return{getUssEligibility:function(c,b){var d=n("#uss-isPrimaryAsinVirtualBundle").val();return{primaryAsinData:d?{asin:c,offerListingId:b,isVirtualBundle:d}:{asin:c,offerListingId:b},eligibility:a}},registerProgramEligibility:function(c,b){c&&(a[c]&&m.logCounter(d.PROGRAM_ELIGIBILITY_REGISTRY_OVERWRITTEN+"."+programName),a[c]=b)}}});f.when("A","atf","uss-init-helper","uss-preconditions",
"uss-logger-service","uss-constants").register("uss-init",function(e,q,m,n,d,a){function c(){m.loadUssCommonAssets();f.when("A","3p-promise","uss-light-box","uss-constants","uss-logger-service").register("uss-sheet-component",function(a,b,c,d,h){function e(b,g){if(!(this instanceof e))throw Error(n.INVALID_CONSTRUCTOR_USAGE);if("string"===typeof b)if(this._sheet=f("#"+b),1===this._sheet.length)this._sheetID=b,this._sheet.addClass(m.RIGHT_SIDE_SHEET),this._sheet.addClass(m.RIGHT_SIDE_SHEET_LAYOUT),
this._sheet.addClass(m.SHEET_CLOSE),this._sheet.attr("role","dialog"),this._sheet.appendTo(G),this._closeIcon=this._createCloseIcon(),this._closeIcon.click(function(){var a=this.close();g.beforeClose&&g.beforeClose(a);h.logCounter(this._sheetID+":closeIconClick")}.bind(this)),this._sheet.append(this._closeIcon),c.getElement().click(function(){var a=this.close();g.beforeClose&&g.beforeClose(a);h.logCounter(this._sheetID+":lightBoxClick")}.bind(this)),this._sheet.removeClass(m.HIDE_ELEMENT),a.on(d.atcAnimationStatusEvent,
function(){t.is(":visible")&&a.fadeIn(C,200,q.EASE_OUT)});else throw Error("Unique element with id '"+b+"' must exist inside a DOM");else throw Error(n.INVALID_SHEET_ID);}var f=a.$,m=d.classList,q=d.transitionTimingFunction,n=d.fatalMessagesList,r=d.layout.defaultLayout,G=f("body"),t=f("."+r.SKELETON_LOADER),C=f("."+r.RECOMMENDATION_LOADING_MESSAGE);e.prototype.open=function(){var d=this;return new b(function(b){var k=d._getSheetSize();d._sheet.css({right:"-"+k+"px"});c.show();a.animationFrameDelay(function(){a.animate(d._sheet,
{right:0},400,q.ENTER_EASE,function(){d._sheet.removeClass(m.SHEET_CLOSE);d._sheet.addClass(m.SHEET_OPEN);d.showCloseIcon();b(!0);h.logCounter(d._sheetID+":open")})});d._closeIcon.css({right:k+15+"px"})})};e.prototype.close=function(){return new b(function(b){var d="-"+this._getSheetSize()+"px";a.animate(this._sheet,{right:d},300,q.EXIT_EASE,function(){this._sheet.removeClass(m.SHEET_OPEN);this._sheet.addClass(m.SHEET_CLOSE);b(!0);h.logCounter(this._sheetID+":close")}.bind(this));this.hideCloseIcon();
c.hide()}.bind(this))};e.prototype.getSheetElement=function(){return this._sheet};e.prototype._getSheetSize=function(){return this._sheet.outerWidth()};e.prototype._createCloseIcon=function(){return f("\x3cdiv class \x3d '"+(m.CLOSE_ICON+" "+m.CLOSE_ICON_MEDIUM+"  "+m.HIDE_ELEMENT)+"'\x3e\x3c/div\x3e")};e.prototype.showCloseIcon=function(){a.fadeIn(this._closeIcon,200,q.EVEN_EASE)};e.prototype.hideCloseIcon=function(){a.fadeOut(this._closeIcon,200,q.EVEN_EASE)};return e});f.when("A","uss-constants",
"uss-utils").register("uss-light-box",function(a,b,c){var d=a.$,h=b.classList,e=d("\x3cdiv class\x3d'"+h.LIGHT_BOX_IDENTIFIER+" "+h.LIGHT_BOX_JS_HOOK+" "+h.HIDE_ELEMENT+"'\x3e\x3c/div\x3e");d("body").append(e);return{show:function(){e.addClass(h.SHOW_ELEMENT);e.removeClass(h.HIDE_ELEMENT);c.disablePageScroll();a.animationFrameDelay(function(){a.animate(e,{opacity:.6},400,b.transitionTimingFunction.EVEN_EASE)})},hide:function(){e.removeClass(h.SHOW_ELEMENT);a.animate(e,{opacity:0},300,b.transitionTimingFunction.EVEN_EASE,
function(){e.addClass(h.HIDE_ELEMENT);e.removeClass(h.SHOW_ELEMENT);c.enablePageScroll()})},getElement:function(){return e}}});f.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,h,e){var f=a.$;a=b.ussCTI;c=new c("nav-bar-cart-count-view",a.CATEGORY,a.TYPE,a.ITEM);e=h.getStore(b.stores.ATC_STATUS_STORE);new d(c,[e],function(a){if(-1!==f.inArray(e,a)){var b=e.getState();r.$Nav.when("api.setCartCount").run(function(a){b.cart.count&&
a(b.cart.count)})}})});f.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}}});f.when("A","uss-action-creator-helper","uss-preconditions","uss-logger-service","uss-constants","uss-utils","uss-eligibility","uss.cart.add-items","aapi-handler","percolateUI-ajax-utility").register("uss-atc",function(a,b,c,d,h,e,f,m,q,n){function r(){a.$("#add-to-cart-button").attr("disabled",
!0);var b=a.$("#a-page");0!==b.length&&(b[0].style.opacity=.3)}function t(a){this.widgetName=a;this.isPrimaryAtc="DetailPageBuyBox"===a}function H(){var b=a.$("body");return(b=a.parseJSON(b.find("[data-a-state*\x3datc-page-state]").html()))&&b.shouldUseNatc?b.shouldUseNatc:!1}function C(){var a="",b=w("#addToCart");0!=b.length&&(a=b.attr("action"));return a}var w=a.$,E=h.ajaxParams.AJAX_TIMEOUT,y={},x=h.metrics,B=h.queryStrings;t.prototype._addQueryParams=function(a){var b="",c=e.getUrlParameter(B.qid),
d=e.getUrlParameter(B.sr);null!=c&&null!=d&&(b=B.qid+"\x3d"+c+"\x26"+B.sr+"\x3d"+d);a.queryString=b;return a};t.prototype._addUssParameters=function(a){a.params.isUSSAjax=1;this.isPrimaryAtc&&(a.params.isPrimaryATC=1,e.shouldFireAndForgetWeblabTrigger()||(a.params.triggerUSSWeblab=c.triggerUSSWeblabValue()));a=this._addEligibilityParameters(a);var b=e.getDebugParams();Object.keys(b).forEach(function(c){a.params[c]=b[c]});return a};t.prototype._addEligibilityParameters=function(a){var b=f.getUssEligibility(a.params[h.ajaxParams.ASIN],
a.params[h.ajaxParams.OFFER_LISTING_ID]);a.params.ussEligibility=JSON.stringify(b);return a};t.prototype._callback=function(){var a=arguments[0],b=Array.prototype.slice.call(arguments,1);"function"===typeof a&&a.apply(this,b)};var D=function(a,c,h,e,l,f){e?(d.logCounter(x.PRIMARY_ADD_TO_CART_CLICK_COUNTER),f=n.callPercolateUI(a,c),l.percolateData=f,b.primaryATCClick(a,l)):(c={},c.baseAsin=a,c.baseReftag=h,d.logCounter(x.SECONDARY_ADD_TO_CART_CLICK_COUNTER),b.secondaryATCClick(l,c))},z=function(a,
b,c,d,k,h,g,l){q.atcStatusDataByApi(a,d).then(function(e){e.atcStatusData.status=g;h.resolve(e);D(a,b,c,d,k,l)}).catch(function(f){h.reject();d&&g?(e.handleATCAnimationEndWeb(),e.showATCSuccess()):D(a,b,c,d,k,l)});k.atcData=h},I=function(b,c,h,e,g,f,p,m,u){var q=0;a.post(u,{params:f.params,success:function(a,l,u){f.hasOwnProperty("success")&&self._callback(f.success,a,l,u);d.logCounter(x.USS_PRIMARY_ATC_DEFAULT_ENDPOINT_SUCCESS_RESPONSE);q=1;z(b,c,h,e,p,g,q,m)},error:function(a,l,u){f.hasOwnProperty("error")&&
self._callback(f.error,a,l,u);d.logCounter(x.USS_PRIMARY_ATC_DEFAULT_ENDPOINT_FAIL_RESPONSE);z(b,c,h,e,p,g,q,m)},abort:function(a){f.hasOwnProperty("abort")&&self._callback(f.abort,a);z(b,c,h,e,p,g,q,m)},timeout:f.timeout||E})},J=function(a,b,c,h,e,g,l,f,p){var u=0,q=new d.Timer(x.SECONDARY_ADDITEMS_API_PROMISE_REJECTED_COUNTER);q.start();f.done(function(a){q.stop()});f.fail(function(){d.logCounter(x.SECONDARY_ADDITEMS_API_PROMISE_REJECTED_COUNTER);q.stop()});g.inputs=g.params;var n=g.inputs;n&&n["items[0.base][additionalParameters][giftOptions][includeGiftReceipt]"]&&
(n["items[0.base][additionalParameters][giftOptions][includeGiftReceipt]"]="true"===n["items[0.base][additionalParameters][giftOptions][includeGiftReceipt]"]);m.addItems(g,h).then(function(a){f.resolve(a)}).catch(function(a){f.reject(a)});l.addItems=f;l.addItems.then(function(d){u=1;z(a,b,c,h,l,e,u,p)},function(d){z(a,b,c,h,l,e,u,p)})};t.prototype._addToCart=function(a,b){this.isPrimaryAtc&&c.isUssWeblabInTreatment()&&r();b=this._addUssParameters(b);b=this._addQueryParams(b);var e=w.Deferred(),g=
w.Deferred(),l=w.Deferred(),f={},m=b.params.a;a=a.ref;var q=b.params[h.ajaxParams.OFFER_LISTING_ID],n=this.isPrimaryAtc,v=C();f.atcData=e;var t=new d.Timer(n?x.PRIMARY_ATC_STATUS_PROMISE_RESOLVED_TIMER:x.SECONDARY_ATC_STATUS_PROMISE_RESOLVED_TIMER);t.start();e.done(function(a){t.stop()});e.fail(function(){t.stop()});n&&!H()?I(m,q,a,n,e,b,f,l,v):J(m,q,a,n,e,b,f,l,g);return f};return{addToCart:function(a,b,c){if(!a||!a.trim().length||"object"!==typeof b)throw h.fatalMessagesList.INCORRECT_PARAMETER_PASSED;
y[a]||(y[a]=new t(a));return y[a]._addToCart(c,b)},callToActionCreator:D}});f.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,e,h,f,m){var q=a.$;a={actionButton:null,AllowedActions:{"submit.add-to-cart":1},init:function(){this.checkPreconditionsAndManipulateBuyBox()},checkPreconditionsAndManipulateBuyBox:function(){this.buyBoxForm=q("#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.AllowedActions},submitForm:function(a){if(!f.isWarrantySelectedInBuyBox()&&this.isValidAction())if(d.isUssWeblabInTreatment()){a.preventDefault();a={params:this.getAddToCartParameters()};
var c={ref:h.ajaxParams.REFTAG};m.shouldFireAndForgetWeblabTrigger()&&m.fireAndForgetWeblabTrigger(d.triggerUSSWeblabValue(),d.ussWeblabTreatmentValue());b.addToCart("DetailPageBuyBox",a,c)}else e.logCounter(h.metrics.POST_ATC_WEBLAB_DISABLED),m.shouldFireAndForgetWeblabTrigger()?m.fireAndForgetWeblabTrigger(d.triggerUSSWeblabValue(),d.ussWeblabTreatmentValue()):this.addHiddenUSSField("triggerUSSWeblab",d.triggerUSSWeblabValue());else e.logCounter(h.metrics.POST_ATC_WARRANTY_SELECTED_OR_INVALID_ACTION)},
addHiddenUSSField:function(a,b){q("\x3cinput\x3e").attr({type:"hidden",id:a,name:a,value:b}).appendTo(this.buyBoxForm)},getAddToCartParameters:function(){var a={},b=this.buyBoxForm.serializeArray();q.each(b,function(b,c){a[c.name]=c.value});return a}};return{init:a.init.bind(a)}});f.when("A","uss-constants","uss-logger-service","uss-eligibility","uss-utils").register("percolateUI-ajax-utility",function(a,b,c,d,h){var e=b.ajaxParams.AJAX_TIMEOUT,f=h.getPageType(),m=h.getSubPageType(),q=b.metrics;return{callPercolateUI:function(b,
g){var n={pageType:f,baseAsin:b,subPageType:m,ussEligibility:JSON.stringify(d.getUssEligibility(b,g))};b=a.$("#uss-mraiCategory").val();g=a.$("#uss-mraiGl").val();b&&(n.mraiCategory=b);g&&(n.mraiGl=g);var r=h.getDebugParams();Object.keys(r).forEach(function(a){n[a]=r[a]});var t=a.$.Deferred(),w=new c.Timer(q.PERCOLATE_DATA_PROMISE_RESOLVED_TIMER);w.start();a.post("/ussx",{params:n,success:function(a,b,c){t.resolve(a)},error:function(a,b){t.reject()},timeout:e});t.done(function(a){w.stopWithCounter(2E3,
q.PERCOLATE_DATA_PROMISE_RESOLVED_LONG_TIME_COUNTER,1)});t.fail(function(){c.logCounter(q.PERCOLATE_DATA_PROMISE_REJECTED_COUNTER)});return t.promise()}}})}function b(){n.isUssConditionsPassed()&&(d.logCounter(a.metrics.PAGE_LANDING_PRECONDITIONS_PASSED),h||(c(),h=!0,m.initializeUSSComponents()),m.initializeBuyBox())}var h=!1;e.on("PageRefresh:ATF",function(){b()});b()});"use strict";f.when("jQuery","A","a-component","uss-widget-footer","uss-widget-partial-content","uss-widget-full-content","p13n-sc-call-on-visible",
"p13n-sc-logger").register("uss-list-widget",function(e,f,m,n,d,a,c,b){function h(a){var b="a:expandControl:"+a._$footer.getName()+":toggle";f.on(b,function(){var b=!a.isExpanded();a._$element.attr("data-a-expanded",b);g(a,b);a._$firstToggleEvent&&0<a._$widgetImpressionElement.length&&(a._$firstToggleEvent=0,l(a._$widgetImpressionElement,a._$fullContent._$element,{action:"see_more"}))})}function l(a,d,h){c.register(a,function(){b.logAsyncAction(e.extend(!0,{},{featureElement:a,isEventComplete:function(){return d.is(":visible")},
logOnlyNew:!0,replicateAsinImpressions:!0},h))},{distance:10})}function g(a,b){a._$footer.toggleExpansion(b,!a.isExpanded(),a._$firstToggleEvent);a._$fullContent.toggleExpansion(b);a._$partialContent.toggleExpansion(b)}var p=m.create({_componentName:"ussListWidget",init:function(c,e){this._super(c,e);this._$partialContent=d(this._$element.find(".uss-partial-list-container"));this._$fullContent=a(this._$element.find(".uss-full-list-container"));this._$footer=n(this._$element.find(".uss-widget-footer"));
this._$firstToggleEvent=1;this._$widgetImpressionElement=this._$element.find(".p13n-sc-static-list");0<this._$widgetImpressionElement.length&&("function"===typeof b.resetImpressions&&b.resetImpressions(this._$widgetImpressionElement.attr("data-p13n-feature-name")),l(this._$widgetImpressionElement,this._$partialContent._$element,{action:"view",initialDelay:0}));h(this);g(this,this.isExpanded())},isExpanded:function(){return"true"===this._$element.attr("data-a-expanded")}});return function(a,b){return new p(a,
b)}});f.when("jQuery","A").execute("uss-sp-help-link",function(e,f){f.on("a:popover:beforeShow:uss-sp-help-link-popover",function(e){e.popover.$container.css("z-index",501)})});"use strict";f.when("jQuery","A","p13n-sc-line-truncator","a-component").register("uss-widget-partial-content",function(e,f,m,n){var d=n.create({_componentName:"ussWidgetPartialContent",init:function(a,c){this._super(a,c);this._$element.find(".p13n-sc-truncate").toggleClass("uss-asin-title");m.truncateLines(this._$element);
f.loadDynamicImage(this._$element.find(".p13n-sc-list-image-container"))},toggleExpansion:function(a){var c=this;c._$element.attr("data-a-expanded",a);a?c._$element.hide():f.delay(function(){c._$element.show()},50)}});return function(a,c){return new d(a,c)}});"use strict";f.when("jQuery","A","p13n-sc-line-truncator","a-component").register("uss-widget-full-content",function(e,f,m,n){var d=n.create({_componentName:"ussWidgetFullcontent",init:function(a,c){this._super(a,c);this._$dynamicImagesLoaded=
this._$isTitleTruncated=!1;a=this._$element.find(".p13n-sc-truncate");a.toggleClass("uss-asin-title");a.attr("data-rows","4")},toggleExpansion:function(a){var c=this;c._$element.attr("data-a-expanded",a);a?f.delay(function(){c._$element.show();m.truncateLines(c._$element);c._$dynamicImagesLoaded||(f.loadDynamicImage(c._$element.find(".p13n-sc-list-image-container")),c._$dynamicImagesLoaded=!0)},50):c._$element.hide()}});return function(a,c){return new d(a,c)}});"use strict";f.when("jQuery","A","a-component",
"uss-widget-see-more","uss-widget-expander-icon","uss-constants","uss-logger-service").register("uss-widget-footer",function(e,f,m,n,d,a,c){function b(a){var b=a.getName();a=a.isExpanded();f.trigger("a:expandControl:"+b+":toggle");a?(c.logCounter(h.SEE_LESS_CLICK_COUNTER),c.logCounter(h.SEE_LESS_CLICK_COUNTER+":"+b)):(c.logCounter(h.SEE_MORE_CLICK_COUNTER),c.logCounter(h.SEE_MORE_CLICK_COUNTER+":"+b))}var h=a.metrics,l=function(a,b){return a+":"+b},g=m.create({_componentName:"ussWidgetFooter",init:function(a,
e){var g=this;g._super(a,e);g._$expanderIcon=d(g._$element.find(".uss-expander-icon-container"));g._$seeMore=n(g._$element.find(".uss-see-more"));g._$element.length&&(c.logCounter(h.SEE_MORE_EXISTENCE_COUNTER),c.logCounter(l(h.SEE_MORE_EXISTENCE_COUNTER,g.getName())));g._$element.click(function(){b(g)});g._$element.keypress(function(a){var c=f.constants.keycodes;a=a.which;a!==c.ENTER&&a!==c.SPACE||b(g)})},toggleExpansion:function(a,b,c){var d=this;d._$element.attr("data-a-expanded",a);f.fadeOut(d._$element,
200,"linear",function(){d._$seeMore.toggleSeeMore(a);d._$expanderIcon.toggleExpanderIcon(a);f.fadeIn(d._$element,200)});a||!b||c||d._$element.parent().get(0).scrollIntoView(!0)},isExpanded:function(){return"true"===this._$element.attr("data-a-expanded")},getName:function(){return this._$element.attr("data-name")}});return function(a,b){return new g(a,b)}});"use strict";f.when("jQuery","A","a-component").register("uss-widget-see-more",function(e,f,m){var n=m.create({_componentName:"ussWidgetSeeMore",
init:function(d,a){this._super(d,a);this._$seeMoreText=this._$element.find(".uss-see-more-text");this._$seeLessText=this._$element.find(".uss-see-less-text")},toggleSeeMore:function(d){this._$seeMoreText.toggle(!d);this._$seeLessText.toggle(d)}});return function(d,a){return new n(d,a)}});"use strict";f.when("jQuery","A","a-component").register("uss-widget-expander-icon",function(e,f,m){var n=m.create({_componentName:"ussWidgetExpanderIcon",init:function(d,a){this._super(d,a);this._$icon=this._$element.find(".uss-expander-icon")},
toggleExpanderIcon:function(d){this._$icon.toggleClass("a-css-icon-expand",!d).toggleClass("a-css-icon-collapse",d)}});return function(d,a){return new n(d,a)}});"use strict";f.when("jQuery","A","uss-atc").execute("uss-inline-atc",function(e,f,m){function n(a){var c={};a.find("input[type\x3dhidden]").each(function(a,d){c[d.name]=e(d).val()});return c}function d(a,c,b,d){a.atcData.then(function(a){d.hide();1===a.isOk?c.show():b.show()},function(){d.hide();b.show()})}(function(){e("body").delegate(".uss-list-widget .uss-add-to-cart-button",
"click",function(a){a=e(a.currentTarget);var c=a.parent().find("input[name\x3dASIN]").val(),b=e(".uss-add-to-cart-form-"+c),c=b.siblings(".uss-atc-success"),h=b.siblings(".uss-atc-error"),f=b.siblings(".uss-atc-spinner");b.hide();f.show();var g={params:n(b)},p=JSON.parse(b.attr("data-link-params")),b={linkParams:e.param(p),ref:b.attr("data-ref")};a=m.addToCart(a.parents(".uss-widget-body").attr("data-p13n-feature-name"),g,b);d(a,c,h,f)})})()});f.when("uss-constants-common").register("nexus-util",
function(e){return{emitCounterData:function(f,m){f={counterName:f,counterValue:m};r.ue&&ue.event&&r.ue.event(f,e.nexusConstants.PRODUCER_ID,e.nexusConstants.SCHEMA_ID+e.nexusConstants.SCHEMA_VERSION)}}});f.when("A","3p-promise","uss-constants","uss-constants-common","uss-logger-service").register("uss-amazonapi-client",function(e,f,m,n,d){function a(a){var c=e.$(b.ENDPOINT).val()+"/"+a.apiPath,d=[];if(a.additionalParameters)for(var f in a.additionalParameters)a.additionalParameters.hasOwnProperty(f)&&
d.push(f+"\x3d"+encodeURIComponent(a.additionalParameters[f]));d.length&&(c+="?"+d.join("\x26"));return c}function c(a){var c=e.$(b.CSRF_TOKEN).val(),g=e.$('meta[name\x3d"encrypted-slate-token"]').prop("content"),f;f=["application/vnd.com.amazon.api+json",'type\x3d"'+a.responseType+'"'];a.resourceInclusions&&f.push('expand\x3d"'+a.resourceInclusions.join(",")+'"');f=f.join("; ");var k;k=e.$(b.LANGUAGE_OF_PREFERENCE).val();a.languageOfPreference&&(k=a.languageOfPreference);k=k.replace(/_/g,"-");c=
{Accept:f,"Accept-Language":k,"x-api-csrf-token":c,"x-amzn-encrypted-slate-token":g};g!==t&&null!==g&&""!==g||d.logCounter(n.metrics.EMPTY_SLATE_TOKEN,1);a.requestType&&(c["Content-Type"]='application/vnd.com.amazon.api+json; type\x3d"'+a.requestType+'"');return c}var b={CSRF_TOKEN:"#uss-amazonApiAjaxCsrfToken",ENDPOINT:"#uss-amazonApiAjaxEndpoint",LANGUAGE_OF_PREFERENCE:"#uss-languagePreference"};return{makeRequest:function(d){return new f(function(f,g){var m=a(d),k=c(d),n=d.data?JSON.stringify(d.data):
t,q;q="integ.amazon.com"!==e.$(b.ENDPOINT).val().split("/")[2].substring(8,24)?"prod":void 0;return e.$.ajax({type:d.method,url:m,headers:k,data:n,xhrFields:{withCredentials:!0},dataType:"json",success:function(a){a.environment=q;f(a)},error:function(a){var b={statusCode:a.status,xhr:a};if(a.responseText)try{b.data=JSON.parse(a.responseText)}catch(c){b.data=a.responseText}g(b)}})})}}});f.when("productV2Images-api","3p-promise","uss-constants","uss-logger-service").register("aapi-handler",function(e,
f,m,n){var d=m.metrics,a=m.cartApiConstants,c=new n.Timer(d.PRODUCTV2IMAGES_API_PROMISE_RESOLVED_TIMER),b=function(b,f){b=e.productV2Images(b);b.then(function(b){if(!(b&&b.entity&&b.entity.productImages&&b.entity.productImages.entity&&b.entity.productImages.entity.images))throw b;var d=b.entity.productImages.entity.images[0].lowRes.physicalId,e=b.entity.productImages.entity.images[0].lowRes.extension,h=b.entity.productImages.entity.altText;b=b.environment===a.USS_ENVIRONMENT_PROD?a.USS_PRODUCTV2IMAGES_PROD_URL_PATH+
d+a.USS_PRODUCTV2IMAGES_DIMENSIONS+e:a.USS_PRODUCTV2IMAGES_DEV_URL_PATH+d+a.USS_PRODUCTV2IMAGES_DIMENSIONS+e;f.mainImage.altText=h;f.mainImage.src=b;c.stop()}).catch(function(a){n.logCounter(d.PRODUCTV2IMAGES_API_PROMISE_REJECTED_COUNTER);c.stop();return a});return b};return{atcStatusDataByApi:function(e,l){return new f(function(g,m){var k={imbHTML:"",mainImage:{altText:{},src:{}},shippingMessageHTML:a.USS_SHIPPING_MESSAGE,status:1},r=[];if(!0===l){c.start();var t=b(e,k);r.push(t)}f.all(r).then(function(){g({atcStatusData:k,
isOk:1})}).catch(function(){n.logCounter(d.CART_API_PROMISE_REJECTED_COUNTER);m()})})}}});f.when("A","uss-amazonapi-client","natc-utils","buy-box-utility","uss-constants").register("uss.cart.add-items",function(e,f,m,n,d){function a(a,c){c.reftag&&(a.additionalParameters.ref_=c.reftag);(c.queryString!==t&&""!==c.queryString?c.queryString:"").split("\x26").forEach(function(c){c=c.split("\x3d");2===c.length&&(a.additionalParameters[c[0]]=c[1])})}var c=d.cartApiConstants;return{addItems:function(b,d){var e;
if(d){e=m.constructAddItemsRequest(b);b.reftag=c.USS_PRIMARY_ATC_REFTAG;var g=e.items,p=b.inputs.a;if(g)for(var k=0;k<g.length;++k)if(p&&p===g[k].asin){var r=n.getSelectedQuantityInMobileAppBuyBox();r&&!isNaN(r)?g[k].quantity=Number(r):g[k].quantity=1}}else b?(e=b.cartArgs.offerListingID,g=c.USS_SECONDARY_ATC_QUANTITY,p=b.inputs.additionalParameters,k={},k.asin=b.inputs.a,k.offerListingId=e,k.quantity=g,p&&(k.additionalParameters=p),e={items:[k]}):e={};g=!d&&b&&b.reftag?"cart/carts/retail/items?ref_\x3d"+
b.reftag.replace("?","\x26"):"cart/carts/retail/items";e={apiPath:g,requestType:"cart.add-items.request/v1",responseType:"cart.add-items/v1",method:"POST",data:e,additionalParameters:{}};d&&b&&a(e,b);return f.makeRequest(e)}}});f.when("A","uss-amazonapi-client").register("uss.cart.modify-items",function(e,f){return{modifyItems:function(e,n){return f.makeRequest({apiPath:"cart/carts/retail/items?ref_\x3d"+n,requestType:"cart.modify-items.request/v1",responseType:"cart.modify-items/v1",method:"PUT",
data:{items:e}})}}});f.when("uss-amazonapi-client").register("productV2Images-api",function(e){"use-strict";return{productV2Images:function(f){return e.makeRequest({apiPath:"products/"+f,responseType:"product/v2",method:"GET",resourceInclusions:["productImages(product.product-images/v2)"]})}}});f.when("A").register("natc-utils",function(e){function f(a){if(!a||!a.inputs)return d.INVALID;a=a.inputs;for(var c in a){if(c.startsWith("items[0.base][asin]"))return d.V2;if(c.startsWith("item[0].asin"))return d.V1}return d.INVALID}
function m(a){var c=a.inputs;a={};for(var b in c){var d=b.replace("items[","").slice(0,-1).split("][");d.reduce(function(a,e,f){return a[e]||(a[e]=d.length-1===f?c[b]:{})},a)}return a}function n(a){var c=a.inputs;a={};for(var b in c){var d=b.replace(/item\[(\d+)\]/,"$1").split(".");d.reduce(function(a,e,f){return a[e]||(a[e]=d.length-1===f?c[b]:{})},a)}return a}var d={V1:"NATC_Params_Version_1",V2:"NATC_Params_Version_2",INVALID:"NATC_Params_Version_Invalid"};String.prototype.startsWith||Object.defineProperty(String.prototype,
"startsWith",{value:function(a,c){c=0<c?c|0:0;return this.substring(c,c+a.length)===a}});return{constructAddItemsRequest:function(a){switch(f(a)){case d.V2:a=m(a);break;case d.V1:a=n(a);break;default:throw Error("Could not determine or invalid NATC params version");}var c=[],b;for(b in a)"object"===typeof a[b]&&a[b].asin&&c.push(a[b]);return{items:c}},determineNATCParamsVersion:f,PARAM_VERSIONS:d}});f.when("uss-default-layout").register("uss-final-layout",function(e){return e})});
/* ******** */
(function(p){var u=window.AmazonUIPageJS||window.P,r=u._namespace||u.attributeErrors,b=r?r("DetailPagePaymentOptionsJavascript",""):u;b.guardFatal?b.guardFatal(p)(b,window):b.execute(function(){p(b,window)})})(function(p,u,r){"use strict";p.when("A","payment-options-constants").register("payment-options-client-side-metric",function(b,d){function e(){return Date.now().toString(10)+Math.random().toString(16).substring(2,13)}function f(c,a){g(d.metricPrefix,c,a)}function l(c,a){g(d.metricPrefixUFO,c,
a)}function g(c,a,b){if("undefined"!==typeof h&&"undefined"!==typeof h.count&&a&&c){if(b===r||null===b)b=1;c+=a;h.count(c,(h.count(c)||0)+b);"undefined"!==typeof u.csa&&(b=u.csa("Events",{producerId:"dp-rpcx"}),a=h.count(c),b("log",{schemaId:"dpRpcx.CSALoggingSchema.5",eventName:c,valueToLog:a},{ent:"all"}))}}function k(c){if(c)this.timerName=c,this.startTime=0;else throw Error("timerName must be non empty string");}function m(c){if(c)this.timerName=c,this.startTime=0;else throw Error("timerName must be non empty string");
}var h=u.ue;k.prototype={isStarted:!1,start:function(){this.isStarted=!0;this.startTime=Date.now()},stop:function(){this.startTime&&f(this.timerName,Date.now()-this.startTime)}};m.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(c){f(c,1)},incrementWithValue:f,incrementWithValuePriceBlockMessaging:function(c,a){g(d.metricPrefixPriceblock,c,a)},logNexusEventForMonthlyPaymentSelection:function(c){if(u.ue&&
h.event){var a={};a.requestId=c.data.requestId;a.sessionId=c.data.sessionId;a.marketplaceId=c.data.marketplaceId;a.customerId=c.data.customerId;a.asin=c.data.asin;a.websiteDisplayGroup=c.data.websiteDisplayGroup;a.parentAsin=c.data.parentASIN;a.buyingOptionType=c.data.buyingOptionType;a.financingId=c.data.optionId;a.ranking=parseInt(c.data.executionInfo.offerRank);a.isRender=!0;a.deviceType=c.data.deviceType;a.isUfoSwatchExpanded=!0;a.isOfferSelected=!0;a.isOfferAddedToCart=!1;a.isOfferUsedWithBuyNow=
!1;a.schemaId=d.nexus.schemaId;a.producerId=d.nexus.producerId;a.messageId=e();a.trackingId="undef";a.isPreselection=null;a.sellerId="undef";a.asinExperience="undef";a.variantRendered="undef";a.locale="undef";a.isSelectFromPlansClicked=!1;a.isOfferSelectionClicked=!1;a.isOfferGroupingSelected=!1;a.isConfirmPlanSelectionClicked=!0;a.isChangePlanClicked=!1;a.isCheckboxSelected=!1;a.isCheckboxDeselected=!1;a.isCancelPlanClicked=!1;h.event(a,d.nexus.producerId,d.nexus.schemaId,{ssd:!0});l("MonthlyPaymentSelection",
1)}},logNexusEventForComparePlansLink:function(c){if(u.ue&&h.event){var a={};a.requestId=c.data.requestId;a.sessionId=c.data.sessionId;a.marketplaceId="undef";a.customerId=c.data.customerId;a.asin="undef";a.websiteDisplayGroup="undef";a.parentAsin="undef";a.buyingOptionType="undef";a.financingId="undef";a.ranking=-1;a.isRender=!0;a.deviceType="undef";a.isUfoSwatchExpanded=!1;a.isOfferSelected=!1;a.isOfferAddedToCart=!1;a.isOfferUsedWithBuyNow=!1;a.schemaId=d.nexus.schemaId;a.producerId=d.nexus.producerId;
a.messageId=e();a.trackingId="undef";a.isPreselection=null;a.sellerId="undef";a.asinExperience="undef";a.variantRendered="undef";a.locale="undef";a.isSelectFromPlansClicked=!0;a.isOfferSelectionClicked=!1;a.isOfferGroupingSelected=!1;a.isConfirmPlanSelectionClicked=!1;a.isChangePlanClicked=!1;a.isCheckboxSelected=!1;a.isCheckboxDeselected=!1;a.isCancelPlanClicked=!1;h.event(a,d.nexus.producerId,d.nexus.schemaId,{ssd:!0});l("ComparePlansLink",1)}},logNexusEventForSwatchExpansion:function(c){if(u.ue&&
h.event){var a={};a.requestId=c.data.requestId;a.sessionId=c.data.sessionId;a.marketplaceId=c.data.marketplaceId;a.customerId=c.data.customerId;a.asin=c.data.asin;a.websiteDisplayGroup=c.data.websiteDisplayGroup;a.parentAsin=c.data.parentASIN;a.buyingOptionType=c.data.buyingOptionType;a.financingId="undef";a.ranking=-1;a.isRender=!0;a.deviceType=c.data.deviceType;a.isUfoSwatchExpanded=!0;a.isOfferSelected=!1;a.isOfferAddedToCart=!1;a.isOfferUsedWithBuyNow=!1;a.schemaId=d.nexus.schemaId;a.producerId=
d.nexus.producerId;a.messageId=e();a.trackingId="undef";a.isPreselection=null;a.sellerId="undef";a.asinExperience="undef";a.variantRendered="undef";a.locale="undef";a.isSelectFromPlansClicked=!1;a.isOfferSelectionClicked=!1;a.isOfferGroupingSelected=!1;a.isConfirmPlanSelectionClicked=!1;a.isChangePlanClicked=!1;a.isCheckboxSelected=!1;a.isCheckboxDeselected=!1;a.isCancelPlanClicked=!1;h.event(a,d.nexus.producerId,d.nexus.schemaId,{ssd:!0});l("SwatchExpansion",1)}},logNexusEventForComparePlansOfferSelection:function(c){if(u.ue&&
h.event){var a={};a.requestId=c.data.requestId;a.sessionId=c.data.sessionId;a.marketplaceId=c.data.marketplaceId;a.customerId=c.data.customerId;a.asin=c.data.asin;a.websiteDisplayGroup=c.data.websiteDisplayGroup;a.parentAsin=c.data.parentASIN;a.buyingOptionType=c.data.buyingOptionType;a.financingId=c.data.optionId;a.ranking=-1;a.isRender=!0;a.deviceType=c.data.deviceType;a.isUfoSwatchExpanded=!1;a.isOfferSelected=!1;a.isOfferAddedToCart=!1;a.isOfferUsedWithBuyNow=!1;a.schemaId=d.nexus.schemaId;a.producerId=
d.nexus.producerId;a.messageId=e();a.trackingId="undef";a.isPreselection=null;a.sellerId="undef";a.asinExperience="undef";a.variantRendered="undef";a.locale="undef";a.isSelectFromPlansClicked=!1;a.isOfferSelectionClicked=!0;a.isOfferGroupingSelected=!1;a.isConfirmPlanSelectionClicked=!1;a.isChangePlanClicked=!1;a.isCheckboxSelected=!1;a.isCheckboxDeselected=!1;a.isCancelPlanClicked=!1;h.event(a,d.nexus.producerId,d.nexus.schemaId,{ssd:!0});l("ComparePlansOfferSelection",1)}},logNexusEventForChangePlansLink:function(c){if(u.ue&&
h.event){var a={};a.requestId=c.data.requestId;a.sessionId=c.data.sessionId;a.marketplaceId="undef";a.customerId=c.data.customerId;a.asin="undef";a.websiteDisplayGroup="undef";a.parentAsin="undef";a.buyingOptionType="undef";a.financingId="undef";a.ranking=-1;a.isRender=!0;a.deviceType="undef";a.isUfoSwatchExpanded=!1;a.isOfferSelected=!1;a.isOfferAddedToCart=!1;a.isOfferUsedWithBuyNow=!1;a.schemaId=d.nexus.schemaId;a.producerId=d.nexus.producerId;a.messageId=e();a.trackingId="undef";a.isPreselection=
null;a.sellerId="undef";a.asinExperience="undef";a.variantRendered="undef";a.locale="undef";a.isSelectFromPlansClicked=!1;a.isOfferSelectionClicked=!1;a.isOfferGroupingSelected=!1;a.isConfirmPlanSelectionClicked=!1;a.isChangePlanClicked=!0;a.isCheckboxSelected=!1;a.isCheckboxDeselected=!1;a.isCancelPlanClicked=!1;h.event(a,d.nexus.producerId,d.nexus.schemaId,{ssd:!0});l("ComparePlansChangePlan",1)}},logNexusEventForCancelPlan:function(c){if(u.ue&&h.event){var a={};a.requestId=c.data.requestId;a.sessionId=
c.data.sessionId;a.marketplaceId=c.data.marketplaceId;a.customerId=c.data.customerId;a.asin=c.data.asin;a.websiteDisplayGroup=c.data.websiteDisplayGroup;a.parentAsin=c.data.parentASIN;a.buyingOptionType=c.data.buyingOptionType;a.financingId="undef";a.ranking=-1;a.isRender=!0;a.deviceType=c.data.deviceType;a.isUfoSwatchExpanded=!1;a.isOfferSelected=!1;a.isOfferAddedToCart=!1;a.isOfferUsedWithBuyNow=!1;a.schemaId=d.nexus.schemaId;a.producerId=d.nexus.producerId;a.messageId=e();a.trackingId="undef";
a.isPreselection=null;a.sellerId="undef";a.asinExperience="undef";a.variantRendered="undef";a.locale="undef";a.isSelectFromPlansClicked=!1;a.isOfferSelectionClicked=!1;a.isOfferGroupingSelected=!1;a.isConfirmPlanSelectionClicked=!1;a.isChangePlanClicked=!1;a.isCheckboxSelected=!1;a.isCheckboxDeselected=!1;a.isCancelPlanClicked=!0;h.event(a,d.nexus.producerId,d.nexus.schemaId,{ssd:!0});l("ComparePlansCancelPlan",1)}},Timer:k,TimerPriceBlockMessaging:m}});"use strict";p.when("A","payment-options-constants",
"payment-options-expander-actions","payment-options-client-side-metric").register("multi-card-exp-payment-options",function(b,d,e,f){function l(){f.increment("Expander:Auto:Collapse");var d=b.$("[data-toggle-payment-options-expander]").data("toggle-payment-options-expander").renderPreselection;e.collapsePaymentOptions(d);b.$("[data-toggle-payment-options-expander]").data("toggle-payment-options-expander").isExpand=!1}function g(){if(document.getElementById("payment-options-expander-header")){var d=
JSON.parse(b.$("[data-toggle-payment-options-expander]").attr("data-toggle-payment-options-expander"));d.isAutoExpand=!0;d.forceExpand=!0;b.trigger("a:declarative:expand-payment-options-expander",{data:d})}}return function(){var e=b.$(d.selector.multiCardExperimentElement).data(d.selector.multiCardExperimentData);if(!e||!e.treatment)return{};var f=b.$(d.selector.activeTPlusCards).val();if(!f||!f.length)return{};f=f.split(",");return{expTreatment:e.treatment,isFirstCard:f[0]===d.featureRegistration.featureName,
collapseCard:l,autoExpandCard:g}}()});"use strict";p.when("A").register("payment-options-constants",function(b){return{featureRegistration:{featureName:"paymentOptions",featureAttribution:"C/T/I"},nexus:{producerId:"ufo-dev",schemaId:"ufo_dev.DPXAwarenessAndConversion.6"},validators:{itemType:"paymentOfferInfo",offerTypes:["EQUAL_PAY","ONE_TIME_PAYMENT"],cartTypes:["ADD_TO_CART"],cardTypes:["PLCC"]},metricConstants:{skipLearnMoreMetricForDesktop:"skipLearnMoreMetricForDesktop"},parameters:{itemType:"paymentOfferInfo",
selectionType:{ADD:"add",DELETE:"delete"},offerTypes:{equalPay:"EQUAL_PAY",oneTimePayment:"ONE_TIME_PAYMENT"},cartTypes:{addToCart:"ADD_TO_CART",buyNow:"BUY_NOW"},cardTypes:{plcc:"PLCC"}},paymentOfferInputElement:{inputType:"hidden",name:"paymentOfferInfo"},imagesToLoad:".payment-options-financing-option-card-image .payment-options-expander-heading-image-container .payment-options-side-sheet-header .payment-options-side-sheet-option-summary .payment-options-side-sheet-comparison-group-container .payment-options-comparison-sheet-comparison-card-option".split(" "),
ajaxStatusText:{timeout:"Request Timeout"},selector:{expanderContainer:".payment-options-container",skeletonLoader:".payment-option-skeleton-loader",twisterPlusFadeIn:"twister-plus-cc-card-fadeIn",paymentOptionExpand:"payment-options-expander-content-expand",skeletonLoaderExpand:"payment-option-skeleton-loader-expand",checkmark:".payment-options-selected-checkmark",subtitle:".payment-options-subtitle",subtitleText:".payment-options-subtitle-text",cardImage:".payment-options-selected-card-image",expanderIcon:".payment-options-expander-icon",
toggleButton:"#payment-options-toggle-button",expanderContent:".payment-options-expander-content",swatch:".payment-options-swatch",oneTimePaymentOption:".payment-options-default-option",financingOptions:".payment-options-financing-option",financingOptionTitle:".payment-options-financing-option-title",swatchOption:".payment-options-option",swatchHeading:".payment-options-option-heading",selectedHeading:"payment-options-selected-heading",selectedOption:"payment-options-selected-option",unavailableOption:"payment-options-unavailable-option",
unselectedHeading:"payment-options-unselected-heading",swatchDetail:".payment-options-option-detail",refreshCCText:"#payment_options_refresh_cc_text",refreshToggle:"#payment_options_refresh_cc_text_container",multiCardExperimentData:"wireless-multi-card",multiCardExperimentElement:"[data-wireless-multi-card]",activeTPlusCards:"#twister-plus-active-cards",sideSheetButton:".payment-option-side-sheet-comparison-button",selectedButton:"payment-option-side-sheet-comparison-button-selected",unselectedButton:"payment-option-side-sheet-comparison-button-unselected",
disabledSwatch:"payment-option-disabled",monthlyPaymentAction:"payment-options-monthly-payment-action",paymentOptionsWeblabs:"#payment-options-weblabs",paymentOptionsWeblabsAttribute:"data-enabled-weblabs",paymentOptionsDefaultPickupBuyingOptionData:"#payment-options-default-buyingOption-pickup",isBuyingOptionOverridePresentAttribute:"data-is-pickup-buying-option-override-present",pickUpBuyingOptionIndex:"data-pickup-buying-option-index",payPlanColumnSelector:".payment-plan-column-selector",paymentDetailColumnSelector:".payment-details-column-selector",
interestColumnSelector:".interest-column-selector",payPlanAplliesSelector:".pay-plan-applies-to-column-selector",cardRewardColumnSelector:".card-reward-column-selector",oneTimePaymentHeadButton:".payment-option-onetimepayment-button",paymentOptionApplicabilityMessageLayout:".payment-option-applicibility-message-layout",paymentOptionApplicabilityMessage:".payment-option-applicibility-message-layout .payment-option-applicibility-message"},comparePlansSelector:{comparePlansSidesheetSelector:"#compare-all-plans-sideSheet",
comparePlansContentSelector:"#compare-all-plans-content",viewModelFailedSelector:"#payment-options-viewmodel-failed",preselectiedOptionSelector:"#payment-options-preselected",paymentOptionsCountSelector:"#compare-all-plans-options-count",firsOfferIdSelector:"#payment-options-first-offer-id",ajaxErrorMessageSelector:".compare-plans-sidesheet-ajax-error",skeletonLoaderClass:".compare-plans-sidesheet-skeleton-loader",comparePlansPaymentOptionSelector:".payment-plan-",comparePlansPaymentOptionWithLearnMoreSelector:".payment-plan-column-",
comparePlansButtonIdSelector:"#monthlyPaymentOption",comparePlansColumnSelector:".payment-option-table-column",comparePlansColumnWithLearnMoreSelector:".payment-option-table-monthly-payments-column",comparePlansButtonSelector:".payment-option-side-sheet-comparison-button"},learnMoreSelector:{learnMoreSidesheetSelector:"#payment-option-learn-more-sideSheet",learnMoreContentSelector:"#payment-options-learn-more-ajax",viewModelFailedSelector:"#payment-options-viewmodel-failed",preselectiedOptionSelector:"#payment-options-preselected",
paymentOptionsCountSelector:"#payment-options-learn-more-options-count",firsOfferIdSelector:"#payment-options-first-offer-id",ajaxErrorMessageSelector:".learn-more-sidesheet-ajax-error",skeletonLoaderClass:".learn-more-sidesheet-skeleton-loader"},ajaxErrorReasons:{timeoutStatus:"Request Timeout"},classes:{hideSwatchMainViewClass:"payment-option-list-item-hidden",paymentOptionsList:".payment-options-list",unavailableCompareAllPlansOption:"payment-options-comparison-sheet-unavailable-option",disabledComparisonPlanButton:"payment-option-comparison-sheet-disabled",
auiDisabledButtonClass:"a-button-disabled",auiEnabledButtonClass:"a-button-normal",popOverHideClass:"popover-hide",popOverShowClass:"popover-show",colLeftRightBorder:"Payment-option-side-sheet-left-right-column-border",colTopBorder:"Payment-option-side-sheet-top-border",colBottomBorder:"Payment-option-side-sheet-bottom-border",cardRewardHideClass:"payment-options-card-reward-hide",normalLeftBorder:"payment-option-column-normal-left-border",normalRightBorder:"payment-option-column-normal-right-border",
selectedPaymentOptionBorder:"payment-option-selected-column-border",normalPaymentOptionBorder:"payment-option-column-normal-border",selectedButtonClass:"payment-option-side-sheet-comparison-button-selected",unselectedButtonClass:"payment-option-side-sheet-comparison-button-unselected",disabledPaymentOptionOrder:"payment-option-disabled-column-order",disabledPaymentOptionClass:"payment-option-disabled-column"},animationTimeoutUnit:200,metricPrefix:"DPX:TwisterPlusCCCard:PaymentOptions:",metricPrefixPriceblock:"DPX:PriceBlockMessaging:PaymentOptions:",
metricPrefixUFO:"DPX:UnifiedFinancingOffers:PaymentOptions:",classSelector:".",disabledPaymentOptionSelecter:"titleSupplement",popOverText:"popover"}});"use strict";p.when("A","cc-manager","payment-options-constants","payment-options-expander-state","payment-options-expander-actions","payment-options-client-side-metric","multi-card-exp-payment-options","payment-plan-state").register("payment-options-registration",function(b,d,e,f,l,g,k,m){function h(a){return"string"===typeof a}function c(a){for(var c=
a.length-1;0<=c;c--){var b=a.get(c).id;if(b!==r&&!t("#"+b).parent().parent().parent().hasClass(e.classes.hideSwatchMainViewClass)){t("#"+b).parent().parent().parent().addClass(e.classes.hideSwatchMainViewClass);break}}}function a(){var a;var c=(a=t(e.selector.paymentOptionsDefaultPickupBuyingOptionData))&&"true"===a.attr(e.selector.isBuyingOptionOverridePresentAttribute);a=a&&c?(a=a.attr(e.selector.pickUpBuyingOptionIndex))?a:r:void 0;return"#paymentOption_"+(a?a:b.$("#buyBoxAccordion .a-accordion-active").attr("data-buying-option-index")||
0)}function n(a){var c=a.executionInfo;c.cartType=e.parameters.cartTypes.addToCart;return{itemType:e.parameters.itemType,price:a.price,selectionType:e.parameters.selectionType.ADD,enableIA:!1,priceAndTermCountDisplayString:a.priceAndTermCountDisplayString,interestDisplayString:a.interestDisplayString,interestAmount:a.interestAmount,orderSummaryDisplayString:a.orderSummaryDisplayString,invalidSelectionTitle:a.cardName,isOrderLevel:a.isOrderLevel,bottomSheetFootnoteDisplayString:a.bottomSheetFootnoteDisplayString,
termCount:a.termCount,termType:a.termType,formData:[{inputType:e.paymentOfferInputElement.inputType,inputName:e.paymentOfferInputElement.name,inputValue:c}]}}var t=b.$;k=k.expTreatment;var q="T2"!==k&&"T3"!==k,v=e.featureRegistration.featureName;d.registerFeature(e.featureRegistration,{init:function(c){b.$(a()).removeClass("a-hidden")},validateInputParams:function(a){return a&&a.formData&&1===a.formData.length&&a.itemType===e.validators.itemType&&h(a.priceAndTermCountDisplayString)&&h(a.orderSummaryDisplayString)&&
h(a.interestDisplayString)&&"number"===typeof a.price&&"number"===typeof a.interestAmount&&h(a.bottomSheetFootnoteDisplayString)?!0:!1},cardCollapse:function(){var a=m.paymentOptionSelected.paymentOptionClickedFromSideSheet;q&&!a&&(g.increment("Expander:Auto:Collapse"),a=b.$("[data-toggle-payment-options-expander]").data("toggle-payment-options-expander").renderPreselection,l.collapsePaymentOptions(a),b.$("[data-toggle-payment-options-expander]").data("toggle-payment-options-expander").isExpand=!1)},
refreshCard:function(){b.$(e.selector.refreshToggle).removeClass("refresh-toggle");b.$("[data-toggle-payment-options-expander]").data("toggle-payment-options-expander").isExpand&&b.$(e.selector.refreshCCText).removeClass("a-hidden")},switchBuyingOption:function(a,g,k,m,q,h){m=h&&-1!==h?h:a;b.$("[id^\x3dpaymentOption_]").addClass("a-hidden");a=b.$(".payment-options-selected-option").closest("[data-action\x3d'payment-options-monthly-payment-action']").data("payment-options-monthly-payment-action");
var p;b.$("[data-toggle-payment-options-expander]").data("toggle-payment-options-expander")!==r&&(g=b.$("[data-toggle-payment-options-expander]").data("toggle-payment-options-expander").renderPreselection,a===r&&!0===g&&(p=b.$("[data-payment-options-emp-action]").data("payment-options-emp-action")));var u;a&&(u=a.offerGroup);b.$("#paymentOption_"+m).removeClass("a-hidden");var x=t("#paymentOption_"+m).find("[data-toggle-payment-options-expander]").data("toggle-payment-options-expander");g=t("#paymentOption_"+
m+" #oneTimePaymentOptionSwatch");b.$(g).click();b.delay(function(){x.isExpand||t(e.selector.subtitleText).text(x.collapseSubtitle)},100);k=g=!1;d.ccRemovedSelectionsClear(v);a===r&&p!==r&&(q=b.$("#paymentOption_"+m+" [data-payment-options-emp-action]").data("payment-options-emp-action"),g=q!==r,!0===g&&(t(e.selector.subtitleText).text(q.preselectionSubtitle),f.expanderSubtitle.monthlyPaymentOptionsCollapsedSubtitle=q.preselectionSubtitle,f.expanderSubtitle.monthlyPaymentOptionsExpandedSubtitle=q.preselectionSubtitle),
!1===g&&d.ccRemovedSelectionUpdate(v,n(p)));if(u){p=t("#paymentOption_"+m+" .payment-options-financing-option");m=p.length;g=0<m;for(q=0;q<m;q++){h=p.get(q);var y=b.$(h).closest("[data-action\x3d'payment-options-monthly-payment-action']").data("payment-options-monthly-payment-action"),z=t("#"+h.id).parent().parent().parent(),A=z.hasClass(e.classes.hideSwatchMainViewClass);if(y&&u===y.offerGroup){k=!0;A&&(c(p),z.removeClass(e.classes.hideSwatchMainViewClass));b.$(h).click();var B=b.$("[data-toggle-payment-options-expander]").data("toggle-payment-options-expander").renderPreselection}}(!g||
g&&!k)&&d.ccRemovedSelectionUpdate(v,n(a));l.collapsePaymentOptions(B)}}})});"use strict";p.when("A","cc-manager","payment-options-constants","payment-options-registration").register("cc-payment-options",function(b,d,e){function f(c){var a=k("form#buyNowCheckout");if(0<a.length){var b=a.find("input[name\x3d"+e.parameters.itemType+"]");c=c.executionInfo;c.cartType=e.parameters.cartTypes.buyNow;c=JSON.stringify(c);1>b.length?k("\x3cinput\x3e").attr({type:e.paymentOfferInputElement.inputType,name:e.paymentOfferInputElement.name,
value:c,id:"bnMshopPaymentOfferInfo"}).appendTo(a):(a=k("#bnMshopPaymentOfferInfo"),1<b.length?a.detach():a.val(c))}}function l(c){var a=c.executionInfo;a.sessionId=c.sessionId;a.customerId=c.customerId;a.marketplaceId=c.marketplaceId;a.requestId=c.requestId;a.deviceType=c.deviceType;a.asin=c.asin;a.buyingOptionType=c.buyingOptionType;a.parentASIN=c.parentASIN;a.websiteDisplayGroup=c.websiteDisplayGroup}function g(c,a){return{itemType:e.parameters.itemType,price:c.price,selectionType:e.parameters.selectionType.ADD,
enableIA:!1,priceAndTermCountDisplayString:c.priceAndTermCountDisplayString,interestDisplayString:c.interestDisplayString,interestAmount:c.interestAmount,orderSummaryDisplayString:c.orderSummaryDisplayString,isOrderLevel:c.isOrderLevel,bottomSheetFootnoteDisplayString:c.bottomSheetFootnoteDisplayString,termCount:c.termCount,termType:"mo",formData:a}}var k=b.$,m=e.featureRegistration.featureName,h;return{updatePaymentOptionSelection:function(c){if(!c)return!1;d.ccSelectionsClear(m);clearTimeout(h);
k("#bnMshopPaymentOfferInfo").detach();var a=[],b;if(c.hasOwnProperty("executionDetails")&&0!==Object.keys(c.executionDetails).length){var t=c.executionDetails;Object.keys(t).forEach(function(b){if("paymentOfferInfoType"===b){var d=JSON.parse(c.executionDetails.paymentOfferInfoType);d.sessionId=c.sessionId;d.customerId=c.customerId;d.marketplaceId=c.marketplaceId;d.requestId=c.requestId;d.deviceType=c.deviceType;d.asin=c.asin;d.buyingOptionType=c.buyingOptionType;d.parentASIN=c.parentASIN;d.websiteDisplayGroup=
c.websiteDisplayGroup;c.executionDetails.paymentOfferInfoType=JSON.stringify(d);a.push([{inputType:e.paymentOfferInputElement.inputType,inputName:e.paymentOfferInputElement.name,inputValue:JSON.parse(t[b])}])}else a.push([{inputType:e.paymentOfferInputElement.inputType,inputName:b,inputValue:t[b]}])});for(var q=0;q<a.length;q++)if(b=g(c,a[q]),b=d.ccSelectionUpdate(m,b),!b)return!1}else if(c.hasOwnProperty("executionInfo")&&0!==Object.keys(c.executionInfo).length)l(c),a.push([{inputType:e.paymentOfferInputElement.inputType,
inputName:e.paymentOfferInputElement.name,inputValue:c.executionInfo}]),b=g(c,a[0]),b=d.ccSelectionUpdate(m,b);else return!0;f(c);h=setTimeout(function(){f(c)},1E3);return b}}});"use strict";p.when("A","cc-payment-options").register("payment-options-actions",function(b,d){b.declarative("select-payment-option","click",function(b){d.updatePaymentOptionSelection(b.data)})});"use strict";p.when("A","po-sidesheet-ajax-state","payment-plan-state","payment-options-constants","payment-options-state","payment-options-client-side-metric").register("po-compare-plans-actions",
function(b,d,e,f,l,g){function k(){d.resetComparePlansState();n(f.comparePlansSelector.skeletonLoaderClass).addClass("aok-hidden");n(f.comparePlansSelector.ajaxErrorMessageSelector).removeClass("aok-hidden")}function m(a,b){a=n(a);var d=f.comparePlansSelector.viewModelFailedSelector,e=f.comparePlansSelector.preselectiedOptionSelector,l=f.comparePlansSelector.paymentOptionsCountSelector,k=f.comparePlansSelector.firsOfferIdSelector,m=c(),e=e+"-"+m,l=l+"-"+m,k=k+"-"+m;return 0!==a.filter(d+"-"+m).length?
(g.incrementWithValue("Ajax:Inconsistency:ViewModelFailed",1),!0):0!==a.filter(e).length?(g.incrementWithValue("Ajax:Inconsistency:PreselectionPresent",1),!0):a.filter(l).data("paymentPlansCount")!==b.numberOfPaymentOptions?(g.incrementWithValue("Ajax:Inconsistency:OffersCountNotSame",1),!0):a.filter(k).data("firstOfferId")!==b.firstOfferId?(g.incrementWithValue("Ajax:Inconsistency:OfferIdNotSame",1),!0):!1}function h(g){n(f.comparePlansSelector.comparePlansSidesheetSelector).html(d.getComparePlansState("ajaxContent"));
var e=f.comparePlansSelector.comparePlansContentSelector+"-"+c();n(e).removeClass("aok-hidden");b.loadDescendantImagesManually(n(".payment-options-side-sheet-header"));b.loadDescendantImagesManually(n(".payment-options-side-sheet-option-summary"));b.loadDescendantImagesManually(n(".payment-options-side-sheet-comparison-group-container"));b.loadDescendantImagesManually(n(".payment-options-comparison-sheet-comparison-card-option"));a(g)}function c(){return b.$("#buyBoxAccordion .a-accordion-active").attr("data-buying-option-index")||
0}function a(a){var b=e.paymentOptionSelected.paymentOptionSelectedButtonId,c=e.paymentOptionSelected.paymentOptionDisabledButtonId,d=a.data.selectText;n(t.oneTimePaymentHeadButton).removeClass(t.selectedButton);n(t.oneTimePaymentHeadButton).addClass(t.unselectedButton);n(t.oneTimePaymentHeadButton).text(d);n(f.comparePlansSelector.comparePlansColumnSelector).removeClass(f.classes.selectedPaymentOptionBorder);n(f.comparePlansSelector.comparePlansColumnSelector).addClass(f.classes.normalPaymentOptionBorder);
n(f.comparePlansSelector.comparePlansColumnSelector).removeClass(f.classes.disabledPaymentOptionClass);n(f.comparePlansSelector.comparePlansColumnWithLearnMoreSelector).removeClass(f.classes.disabledPaymentOptionOrder);n(f.comparePlansSelector.comparePlansButtonSelector).removeClass(f.classes.selectedButtonClass);n(f.comparePlansSelector.comparePlansButtonSelector).removeClass(f.classes.auiDisabledButtonClass);n(f.comparePlansSelector.comparePlansButtonSelector).addClass(f.classes.unselectedButtonClass);
n(f.comparePlansSelector.comparePlansButtonSelector).text(d);a=a.data.selectedText;""!==b&&("oneTimePaymentOption"===b?(n(t.oneTimePaymentHeadButton).addClass(t.selectedButton),n(t.oneTimePaymentHeadButton).removeClass(t.unselectedButton),n(t.oneTimePaymentHeadButton).text(a)):(d=f.comparePlansSelector.comparePlansPaymentOptionSelector+b.match(/\d+/g)[0],n(d).addClass(f.classes.selectedPaymentOptionBorder),n(d).removeClass(f.classes.normalPaymentOptionBorder),n("#"+b).addClass(f.classes.selectedButtonClass),
n("#"+b).removeClass(f.classes.unselectedButtonClass),n("#"+b).text(a)));c&&""!==c&&(b=c.match(/\d+/g)[0],n("#"+f.disabledPaymentOptionSelecter+b).text("("+e.paymentOptionSelected.paymentOptionUnAvailableMsg+")"),c=f.comparePlansSelector.comparePlansPaymentOptionSelector+b,a=f.comparePlansSelector.comparePlansPaymentOptionWithLearnMoreSelector+b,n(f.comparePlansSelector.comparePlansButtonIdSelector+b).addClass(f.classes.auiDisabledButtonClass),n(a).addClass(f.classes.disabledPaymentOptionOrder),n(c).addClass(f.classes.disabledPaymentOptionClass),
n("[id\x3d"+f.popOverText+b+"cell]").addClass(f.classes.popOverShowClass),n("[id\x3d"+f.popOverText+b+"cell]").removeClass(f.classes.popOverHideClass))}var n=b.$,t=f.selector;b.on("PageRefresh:ATF",function(){d.resetComparePlansState()});return{loadAjaxContent:function(a){var c=n("#twister-plus-asin").val();if(null===c||""===c)g.incrementWithValue("Ajax:Inconsistency:AsinEmpty",1),k();else if(d.getComparePlansState("isAjaxContentLoaded")&&!d.checkInconsistentState())h(a);else{var e=new g.Timer("Ajax:Loading:Time");
e.start();n(f.comparePlansSelector.skeletonLoaderClass).removeClass("aok-hidden");n(f.comparePlansSelector.ajaxErrorMessageSelector).addClass("aok-hidden");b.ajax("/gp/product/ajax?",{method:"get",timeout:1E4,params:{asin:c,showFeatures:"compareAllPlansSidesheetAjax,paymentOptions",experienceId:"paymentOptionsAjaxExperience"},success:function(b){null===b||/^\s*$/.test(b)?(g.incrementWithValue("Ajax:Inconsistency:EmptyResponse",1),k()):m(b,a.data)?k():(d.setComparePlansState("ajaxContent",b),d.setComparePlansState("isAjaxContentLoaded",
!0),d.setComparePlansState("ajaxContentAsin",c),h(a),e.stop())},error:function(a,b){b===f.ajaxErrorReasons.timeoutStatus?g.incrementWithValue("Ajax:Failure:Timeout",1):g.incrementWithValue("Ajax:Failure",1);k()}})}},renderPreselection:a}});"use strict";p.when("A").register("po-sidesheet-ajax-state",function(b){var d=b.$,e={ajaxContent:"",isAjaxContentLoaded:!1,ajaxContentAsin:""},f={ajaxContent:"",isAjaxContentLoaded:!1,ajaxContentAsin:""};return{getComparePlansState:function(b){return e[b]},setComparePlansState:function(b,
d){e[b]=d},getLearnMoreState:function(b){return f[b]},setLearnMoreState:function(b,d){f[b]=d},checkInconsistentState:function(){if(e.isAjaxContentLoaded&&f.isAjaxContentLoaded){if(e.ajaxContentAsin!==f.ajaxContentAsin)return this.resetComparePlansState(),this.resetLearnMoreState(),!0;var b=d("#twister-plus-asin").val();if(e.ajaxContentAsin!==b)return this.resetComparePlansState(),this.resetLearnMoreState(),!0}return!1},resetComparePlansState:function(){this.setComparePlansState("ajaxContent","");
this.setComparePlansState("isAjaxContentLoaded",!1);this.setComparePlansState("ajaxContentAsin","")},resetLearnMoreState:function(){this.setLearnMoreState("ajaxContent","");this.setLearnMoreState("isAjaxContentLoaded",!1);this.setLearnMoreState("ajaxContentAsin","")}}});"use strict";p.when("A","payment-options-state","po-compare-plans-actions").register("ufo-compare-payment-plans",function(b,d,e){var f=b.$;b.declarative("compare-payment-plans","click",function(f){b.trigger("a:declarative:side-sheet:click",
f);d.getWeblabData().isDesktopComparePlansAjaxEnabled?b.trigger("a:declarative:compare-payment-plans-ajax:click",f):e.renderPreselection(f)});b.declarative("price-block-compare-payment-plans","click",function(f){b.trigger("a:declarative:open-payment-options-side-sheet:click",f);d.getWeblabData().isDesktopComparePlansAjaxEnabled?b.trigger("a:declarative:compare-payment-plans-ajax:click",f):e.renderPreselection(f)});b.declarative("compare-payment-plans-ajax","click",function(b){e.loadAjaxContent(b)});
b.declarative("overflow-sidesheet","click",function(d){var e=f(d.$currentTarget);e!==r&&null!==e&&(f("#"+d.data.paymentOptionSelectButtonId)[0].classList.contains("a-button-disabled")||b.trigger("a:declarative:monthly-payment-option-selection:click",d))})});"use strict";p.when("A","po-sidesheet-ajax-state","payment-options-constants","payment-options-state","payment-options-client-side-metric","payment-plan-state").register("po-learn-more-actions",function(b,d,e,f,l,g){function k(){d.resetLearnMoreState();
q(e.learnMoreSelector.skeletonLoaderClass).addClass("aok-hidden");q(e.learnMoreSelector.ajaxErrorMessageSelector).removeClass("aok-hidden")}function m(a,b){a=q(a);var d=c(),f=e.learnMoreSelector.preselectiedOptionSelector+"-"+d,g=e.learnMoreSelector.paymentOptionsCountSelector+"-"+d,k=e.learnMoreSelector.firsOfferIdSelector+"-"+d;return 0!==a.filter(e.learnMoreSelector.viewModelFailedSelector+"-"+d).length?(l.incrementWithValue("Ajax:Inconsistency:ViewModelFailed",1),!0):0!==a.filter(f).length?(l.incrementWithValue("Ajax:Inconsistency:PreselectionPresent",
1),!0):a.filter(g).data("paymentPlansCount")!==b.numberOfPaymentOptions?(l.incrementWithValue("Ajax:Inconsistency:OffersCountNotSame",1),!0):a.filter(k).data("firstOfferId")!==b.firstOfferId?(l.incrementWithValue("Ajax:Inconsistency:OfferIdNotSame",1),!0):!1}function h(f,g,k){q(e.learnMoreSelector.learnMoreSidesheetSelector).html(d.getLearnMoreState("ajaxContent"));k=e.learnMoreSelector.learnMoreContentSelector+"-"+k;k+=c();q(k).removeClass("aok-hidden");b.loadDescendantImagesManually(q(".payment-options-side-sheet-header"));
b.loadDescendantImagesManually(q(".payment-options-side-sheet-option-summary"));b.loadDescendantImagesManually(q(".payment-options-side-sheet-comparison-group-container"));b.loadDescendantImagesManually(q(".payment-options-comparison-sheet-comparison-card-option"));a(f,g)}function c(){return b.$("#buyBoxAccordion .a-accordion-active").attr("data-buying-option-index")||0}function a(a,b){n(g.paymentOptionSelected.paymentOptionSelectedButtonId,a,b)}function n(a,b,c){t(b);q(function(){q("[id\x3d"+a+"]").removeClass(v.unselectedButton);
q("[id\x3d"+a+"]").addClass(v.selectedButton);q("[id\x3d"+a+"]").children(0).children(0).text(c);q("[id\x3d"+a+"]").text(c)})}function t(a){q(v.sideSheetButton).removeClass(v.selectedButton);q(v.sideSheetButton).addClass(v.unselectedButton);q(v.sideSheetButton).text(a);q(v.oneTimePaymentHeadButton).removeClass(v.selectedButton);q(v.oneTimePaymentHeadButton).addClass(v.unselectedButton);q(v.oneTimePaymentHeadButton).text(a)}var q=b.$,v=e.selector;b.on("PageRefresh:ATF",function(){d.resetLearnMoreState()});
return{loadAjaxContent:function(a){var c=a.data.selectText,f=a.data.selectedText,g=q("#twister-plus-asin").val();null===g||""===g?(l.incrementWithValue("Ajax:Inconsistency:AsinEmpty",1),k()):d.getLearnMoreState("isAjaxContentLoaded")&&!d.checkInconsistentState()?h(c,f,a.data.index):(q(e.learnMoreSelector.skeletonLoaderClass).removeClass("aok-hidden"),q(e.learnMoreSelector.ajaxErrorMessageSelector).addClass("aok-hidden"),b.ajax("/gp/product/ajax?",{method:"get",timeout:1E4,params:{asin:g,showFeatures:"paymentOptionsLearnMoreSidesheetAjax,paymentOptions",
experienceId:"paymentOptionsAjaxExperience"},success:function(b){null===b||/^\s*$/.test(b)?(l.incrementWithValue("Ajax:Inconsistency:EmptyResponse",1),k()):m(b,a.data)?k():(d.setLearnMoreState("ajaxContent",b),d.setLearnMoreState("isAjaxContentLoaded",!0),d.setLearnMoreState("ajaxContentAsin",g),h(c,f,a.data.index))},error:function(a,b){b===e.ajaxErrorReasons.timeoutStatus?l.incrementWithValue("Ajax:Failure:Timeout",1):l.incrementWithValue("Ajax:Failure",1);k()}}))},stopEventPropagation:function(a){a.$event.preventDefault();
a.$event.stopImmediatePropagation()},preRenderSelectedFinancingOption:a}});"use strict";p.when("A","payment-options-state","po-learn-more-actions","payment-options-client-side-metric","payment-options-constants").register("payment-options-learn-more-events",function(b,d,e,f,l){b.declarative("payment-options-learn-more","click",function(g){f.increment("SideSheet:Link:Click");e.stopEventPropagation(g);b.trigger("a:declarative:side-sheet:click",g);!g.data.isComparePlansEvent&&d.getWeblabData().isDesktopLearnMoreAjaxEnabled?
b.trigger("a:declarative:payment-options-learn-more-ajax:click",g):e.preRenderSelectedFinancingOption(g.data.selectText,g.data.selectedText)});b.declarative("payment-options-gil-skip-learn-more","click",function(b){f.incrementWithValue(l.metricConstants.skipLearnMoreMetricForDesktop,1);u.open(b.data.partnerUrl,"_blank","noopener")});b.declarative("payment-options-learn-more-ajax","click",function(b){e.loadAjaxContent(b)})});"use strict";p.when("A","payment-options-expander-actions","payment-options-expander-state",
"payment-options-client-side-metric","multi-card-exp-payment-options").execute(function(b,d,e,f,l){function g(b){if(a===r||null===a||null===b.data.isExpand||b.data.isExpand===r){if(null===b.data.isExpand||b.data.isExpand===r)m("[data-toggle-payment-options-expander]").data("toggle-payment-options-expander").isExpand=!1,b.data.isExpand=!1;d.initSubtitle(b);n&&d.hideLoaderAnimation(b.data.isExpand)}}function k(b){a=!0;var c=b.data.renderPreselection;e.autoScroll=!b.data.isAutoExpand;c||n?d.expandPaymentOptions(n,
c):(t.isStarted||t.start(),d.expandSkeletonLoader(c));f.logNexusEventForSwatchExpansion(b)}var m=b.$,h=l.expTreatment,c=l.isFirstCard&&"T1"===h||"T2"===h||"T3"===h,a,n=e.isLoaded,t=new f.Timer("Desktop:Expander:Loading:UserWaiting:Time"),q=new f.Timer("Desktop:Expander:Loading:Time");q.start();p.when("cc-payment-options").execute(function(){q.stop();t.isStarted&&t.stop();n=!0;d.hideLoaderAnimation(a);f.incrementWithValue("Container:Swatch:Amount",m(".payment-options-list-item").length)});b.declarative("toggle-payment-options-expander",
"click",function(c){g(c);a=c.data.isExpand;var e=c.data.renderPreselection;!0===a?(a=!1,f.increment("Desktop:Expander:Click:Collapse"),d.collapsePaymentOptions(e)):!1===a&&k(c);m("[data-toggle-payment-options-expander]").each(function(){m(this).data("toggle-payment-options-expander").isExpand=a});b.trigger("a:declarative:expander-update-visible-payment-options:click",c)});b.declarative("expand-payment-options-expander",function(a){if(!h||a.data.forceExpand)g(a),k(a),m("[data-toggle-payment-options-expander]").each(function(){m(this).data("toggle-payment-options-expander").isExpand=
!0})});c&&l.autoExpandCard()});"use strict";p.when("A","payment-options-expander-state","payment-options-constants","payment-options-client-side-metric","payment-options-swatch-actions","cc-manager").register("payment-options-expander-actions",function(b,d,e,f,l,g){function k(){if(d.autoScroll){var b=c(a.expanderContainer),e=b.offset().top+b.outerHeight();if(c(u).scrollTop()+c(u).height()<e){var e=b.offset().top,f=c(u).height(),b=b.height(),b=e-(f-b)/2;c("html, body").animate({scrollTop:b},d.animationTimeoutUnit)}}}
function m(b,d){b=b?n.monthlyPaymentOptionsExpandedSubtitle:d?n.monthlyPaymentOptionsExpandedSubtitle:n.loadingSubtitle;c(a.subtitleText).text(b);!1===d&&c(a.cardImage).fadeOut(e.animationTimeoutUnit)}function h(b){""!==n.monthlyPaymentOptionsCollapsedSubtitle&&c(a.subtitleText).text(n.monthlyPaymentOptionsCollapsedSubtitle);!1===b&&c(a.cardImage).fadeIn(e.animationTimeoutUnit)}var c=b.$,a=e.selector,n=d.expanderSubtitle;return{initSubtitle:function(a){var b=a.data.expandSubtitle;n.monthlyPaymentOptionsCollapsedSubtitle=
a.data.collapseSubtitle;n.monthlyPaymentOptionsExpandedSubtitle=b},expandPaymentOptions:function(d,n){f.increment("Desktop:Expander:Click:Expand");f.increment("Desktop:Expander:Click:Expand:loading");c(a.expanderContent).addClass(a.paymentOptionExpand);c(a.expanderIcon).addClass("rotate");g.cardExpanded(e.featureRegistration.featureName);b.delay(function(){c(a.swatch).addClass(a.twisterPlusFadeIn);m(d,n);k()},e.animationTimeoutUnit);b.$(a.refreshToggle).hasClass("refresh-toggle")||b.$(a.refreshCCText).removeClass("a-hidden")},
expandSkeletonLoader:function(d){f.increment("Desktop:Expander:Click:Expand");c(a.expanderContent).addClass(a.skeletonLoaderExpand);c(a.expanderIcon).addClass("rotate");b.delay(function(){d||(c(a.skeletonLoader).addClass(a.twisterPlusFadeIn),m(!1,d),k())},e.animationTimeoutUnit)},hideLoaderAnimation:function(d,f){d&&c(a.skeletonLoader).removeClass(a.twisterPlusFadeIn);b.delay(function(){c(a.skeletonLoader).hide();c(a.swatch).removeClass("invisible");d&&(c(a.subtitleText).text(n.monthlyPaymentOptionsExpandedSubtitle),
c(a.expanderContent).addClass(a.paymentOptionExpand),b.delay(function(){c(a.swatch).addClass(a.twisterPlusFadeIn);m(!0,f);k()},e.animationTimeoutUnit))},e.animationTimeoutUnit)},collapsePaymentOptions:function(f){c(a.swatch).removeClass(a.twisterPlusFadeIn);d.isLoaded||f||c(a.skeletonLoader).removeClass(a.twisterPlusFadeIn);c(a.expanderIcon).removeClass("rotate");b.delay(function(){c(a.expanderContent).removeClass(a.paymentOptionExpand);c(a.expanderContent).removeClass(a.skeletonLoaderExpand);h(f)},
e.animationTimeoutUnit);b.$(a.refreshCCText).hasClass("a-hidden")||b.$(a.refreshCCText).addClass("a-hidden")},showSubtitleInCollapsedView:h,showSubtitleInExpandedView:m,scrollToShowCompleteExpander:k}});"use strict";p.when("A","payment-options-state","payment-options-client-side-metric","cc-manager","payment-options-constants","payment-options-actions").register("payment-options-auto-expand",function(b,d,e,f,l){var g=!1,k=function(){var k=document.getElementById("payment-options-expander-header"),
h=d.getWeblabData().isAutoExpandWeblabInT1||d.getWeblabData().isAutoExpandWeblabInT2;if(k){if(k=h)k=f.getRenderedFeaturesList(),h=k[0]===l.featureRegistration.featureName,k=1===k.length&&h;k&&(k=JSON.parse(b.$("[data-toggle-payment-options-expander]").attr("data-toggle-payment-options-expander")),k.isAutoExpand=!0,b.trigger("a:declarative:expand-payment-options-expander",{data:k}),e.increment("Expander:AutoExpanded"),g=!0)}};k();b.on("a:pageUpdate",k);return{isAutoExpanded:g}});"use strict";p.when("A").register("payment-options-expander-state",
function(b){return{expanderSubtitle:{monthlyPaymentOptionsCollapsedSubtitle:"",monthlyPaymentOptionsExpandedSubtitle:"",loadingSubtitle:"Loading options..."},get isLoaded(){return this.property},set isLoaded(b){this.property=b}}});"use strict";p.when("A","payment-options-swatch-actions","payment-options-client-side-metric","multi-card-exp-payment-options").execute(function(b,d,e,f){var l=b.$,g=!f.expTreatment||"T3"===f.expTreatment;b.declarative("payment-options-otp-action","click",function(k){e.increment("Swatch:OneTimePayment:Click");
b.trigger("a:declarative:select-payment-option:click",{data:{}});var m=l(k.$currentTarget);m!==r&&null!==m&&(d.updateDefaultOptionSubtitle(k.data.defaultPOSubtitle,k.data.oneTimePaymentPOSubtitle),b.trigger("a:declarative:otp-selection:click",k),g||f.collapseCard())});b.declarative("payment-options-monthly-payment-action","click",function(d){var m=l(d.$currentTarget);m!==r&&null!==m&&(b.trigger("a:declarative:monthly-payment-option-selection:click",d),g||f.collapseCard(),e.logNexusEventForMonthlyPaymentSelection(d))});
b.declarative("payment-options-overflow","click",function(b){d.manageOverflow(b)});b.declarative("expander-update-visible-payment-options","click",function(b){var e=l(b.$currentTarget);e!==r&&null!==e&&d.resetOverflowDefaultOptions(b)});b.declarative("update-swatch","click",function(b){"oneTimePaymentOption"===b.data.selectedPaymentOptionId?d.updateSwatchStyle(b.data.selectedPaymentOptionId):(d.updateSwatchStyle(b.data.selectedPaymentOptionId),d.updateFinancingOptionSubtitle(b.data.subtitleMessage,
b.data.cardImageUrl))});b.declarative("disable-swatch","click",function(b){d.disableSwatch(b.$currentTarget)});b.declarative("enable-swatch","click",function(b){d.enableSwatch(b.$currentTarget)})});"use strict";p.when("A","payment-options-expander-state","payment-options-constants","payment-plan-state").register("payment-options-swatch-actions",function(b,d,e,f){function l(a){m(h.swatchOption).removeClass(h.selectedOption);("oneTimePaymentOption"===a?m(h.oneTimePaymentOption):m("#"+a+"Swatch")).addClass(h.selectedOption)}
function g(a){a.addClass(c.hideSwatchMainViewClass)}function k(a,b){a.removeClass(c.hideSwatchMainViewClass);l(b);f.paymentOptionSelected.paymentOptionSelectedButtonId=b;f.paymentOptionSelected.paymentOptionClickedFromSideSheet=!0}var m=b.$,h=e.selector,c=e.classes,a=d.expanderSubtitle;return{updateSwatchStyle:l,updateDefaultOptionSubtitle:function(b,c){a.monthlyPaymentOptionsCollapsedSubtitle=b;a.monthlyPaymentOptionsExpandedSubtitle=c;m(h.subtitleText).text(c);m(h.subtitle).removeClass("a-color-success");
m(h.subtitle).addClass("a-color-tertiary");m(h.checkmark).addClass("a-hidden");m(h.cardImage).attr("src","https://images-na.ssl-images-amazon.com/images/G/01/x-locale/common/transparent-pixel._V192234675_.gif")},updateFinancingOptionSubtitle:function(b,c){a.monthlyPaymentOptionsCollapsedSubtitle=b;a.monthlyPaymentOptionsExpandedSubtitle=b;m(h.subtitleText).text(b);m(h.subtitle).removeClass("a-color-tertiary");m(h.subtitle).addClass("a-color-success");m(h.checkmark).removeClass("a-hidden");m(h.cardImage).attr("src",
c)},disableSwatch:function(a){var b=a.find(h.financingOptions);b.removeClass(h.selectedOption);b.addClass(h.unavailableOption);a.addClass(h.disabledSwatch)},enableSwatch:function(a){a.find(h.financingOptions).removeClass(h.unavailableOption);a.removeClass(h.disabledSwatch)},manageOverflow:function(a){f.paymentOptionSelected.paymentOptionUnAvailableMsg=a.data.unAvailableMsg;var b=m("#"+a.data.paymentOptionSelectButtonId+"Swatch").parent().parent().parent();if(b.hasClass(c.hideSwatchMainViewClass)){for(var d=
m(c.paymentOptionsList)[0].children,e="",h=d.length-2;0<=h;h--)if(!m(d[h]).hasClass(c.hideSwatchMainViewClass)){e=m(d[h]);break}g(e);k(b,a.data.paymentOptionSelectButtonId)}else l(a.data.paymentOptionSelectButtonId),f.paymentOptionSelected.paymentOptionSelectedButtonId=a.data.paymentOptionSelectButtonId,f.paymentOptionSelected.paymentOptionClickedFromSideSheet=!0},hideLastSwatch:g,unhideCorrespondingSwatch:k,resetOverflowDefaultOptions:function(a){if(!(3>=parseInt(a.data.numberOfPaymentOptions))){var b=
m(c.paymentOptionsList)[0].children;a="";for(var d=b.length-2;0<=d;d--)if(!m(b[d]).hasClass(c.hideSwatchMainViewClass)){a=m(b[d]);break}b=m(m(m(a.children()[0]).children()[0]).children()[0])[0];b.classList.contains(h.selectedOption)||"3"===b.id.match(/\d+/g)[0]||(g(a),m("#monthlyPaymentOption03Swatch").parent().parent().parent().removeClass(c.hideSwatchMainViewClass))}}}});"use strict";p.when("A").register("payment-plan-state",function(b){return{paymentOptionSelected:{paymentOptionSelectedButtonId:"oneTimePaymentOption",
paymentOptionClickedFromSideSheet:!1,paymentOptionDisabledButtonId:"",paymentOptionDisabledTitleSuppliment:"",paymentOptionUnAvailableMsg:""},get isSelected(){return this.property},set isSelected(b){this.property=b}}});"use strict";p.when("A","payment-plan-state","payment-options-constants","payment-options-client-side-metric").execute(function(b,d,e,f){var l=b.$;b.declarative("otp-selection","click",function(e){var k=l(e.$currentTarget[0].parentNode);e=e.data.paymentOptionSelectButtonId;"payment-options-list-item"===
k[0].parentNode.className?d.paymentOptionSelected.paymentOptionClickedFromSideSheet=!1:(f.increment("SideSheet:OneTimePayment:Click"),d.paymentOptionSelected.paymentOptionClickedFromSideSheet=!0);d.paymentOptionSelected.paymentOptionSelectedButtonId=e;b.trigger("a:declarative:update-swatch:click",{data:{selectedPaymentOptionId:d.paymentOptionSelected.paymentOptionSelectedButtonId}})});b.declarative("monthly-payment-option-selection","click",function(e){e.data.hasOwnProperty("optionId")&&""!==e.data.optionId&&
f.increment("Swatch:Financing:"+e.data.optionId+":Click");f.increment("Swatch:MonthlyPayment:Click");b.trigger("a:declarative:select-payment-option:click",e);var k=l(e.$currentTarget);if(k!==r&&null!==k){var k=e.data.posubtitle,m=e.data.cardImageUrl,h=l(e.$currentTarget[0].parentNode),c=e.data.paymentOptionSelectButtonId;"payment-options-list-item"===h[0].parentNode.className?d.paymentOptionSelected.paymentOptionClickedFromSideSheet=!1:(e.data.hasOwnProperty("optionId")&&""!==e.data.optionId?f.increment("SideSheet:Financing:"+
e.data.optionId+":Click"):f.increment("SideSheet:Financing:"+e.data.executionInfo.offerType+":"+e.data.termType+":"+e.data.termCount+":Click"),d.paymentOptionSelected.paymentOptionClickedFromSideSheet=!0);d.paymentOptionSelected.paymentOptionSelectedButtonId=c;b.trigger("a:declarative:update-swatch:click",{data:{selectedPaymentOptionId:d.paymentOptionSelected.paymentOptionSelectedButtonId,subtitleMessage:k,cardImageUrl:m}});b.trigger("a:declarative:payment-options-overflow:click",e)}});b.declarative("compare-payment-plans-disable",
"click",function(b){d.paymentOptionSelected.paymentOptionUnAvailableMsg=b.data.paymentOptionUnAvailableMsg;b=b.data.disabledPaymentOptionId;var f=b.match(/\d+/g)[0],f="#"+e.disabledPaymentOptionSelecter+f;d.paymentOptionSelected.paymentOptionDisabledButtonId=b;d.paymentOptionSelected.paymentOptionDisabledTitleSuppliment=l(f).text()});b.declarative("compare-payment-plans-enable","click",function(b){(b=b.data.enablePaymentOptionId)&&""!==b&&(b=b.match(/\d+/g)[0],d.paymentOptionSelected.paymentOptionDisabledButtonId=
"",l("#"+e.disabledPaymentOptionSelecter+b).text(d.paymentOptionSelected.paymentOptionDisabledTitleSuppliment),d.paymentOptionSelected.paymentOptionDisabledTitleSuppliment="",l("[id\x3d"+e.popOverText+b+"cell]").removeClass(e.classes.popOverShowClass),l("[id\x3d"+e.popOverText+b+"cell]").addClass(e.classes.popOverHideClass))})});"use strict";p.when("A","cc-payment-options","payment-options-client-side-metric").execute(function(b,d,e){b.declarative("payment-options-emp-action","change",function(b){d.updatePaymentOptionSelection(b.data)});
var f=b.debounce(function(){var d=b.$,f=d("#PaymentOptionsEmpAction");0<f.length&&f.trigger("change");0<d("#monthly-payments-not-applicable").length&&e.increment("Container:Render:Error");0<d(".payment-options-container").length&&e.increment("Container:Render:Success")},100);f();b.on("PageRefresh:ATF",f)});"use strict";p.when("A","payment-options-client-side-metric","cc-payment-options","payment-options-constants").execute(function(b,d,e,f){var l=b.$;d=new d.Timer("Expander:Loading:Images:Time");
d.start();e=function(){b.loadDescendantImagesManually(l(".payment-options-financing-option-card-image"));b.loadDescendantImagesManually(l(".payment-options-expander-heading-image-container"));b.loadDescendantImagesManually(l(".payment-option-detailed-feature-scroll"));b.loadDescendantImagesManually(l(".payment-options-side-sheet-header"));b.loadDescendantImagesManually(l(".payment-options-side-sheet-option-summary"));b.loadDescendantImagesManually(l(".payment-options-side-sheet-comparison-group-container"));
b.loadDescendantImagesManually(l(".payment-options-comparison-sheet-comparison-card-option"))};e();b.on("a:pageUpdate",e);d.stop()});"use strict";p.when("A","payment-options-swatch-actions","payment-options-constants","payment-options-state","cc-manager").execute(function(b,d,e,f,l){function g(a){var b=a.executionInfo;b.cartType=e.parameters.cartTypes.addToCart;return{itemType:e.parameters.itemType,price:a.price,selectionType:e.parameters.selectionType.ADD,enableIA:!1,priceAndTermCountDisplayString:a.priceAndTermCountDisplayString,
interestDisplayString:a.interestDisplayString,interestAmount:a.interestAmount,orderSummaryDisplayString:a.orderSummaryDisplayString,invalidSelectionTitle:a.cardName,isOrderLevel:!0,bottomSheetFootnoteDisplayString:a.bottomSheetFootnoteDisplayString,termCount:a.termCount,termType:a.termType,maxQuantity:a.maxQuantity,displayQuantityMessage:!0,formData:[{inputType:e.paymentOfferInputElement.inputType,inputName:e.paymentOfferInputElement.name,inputValue:b}]}}var k=b.$,m=e.selector,h=e.featureRegistration.featureName,
c;b.on("a:dropdown:selected:quantity",function(a){var n=k("#buyBoxAccordion .a-accordion-active").attr("data-buying-option-index")||0,p=k("#paymentOption_"+n+" .payment-options-list-item"),n=k("#paymentOption_"+n+" #oneTimePaymentOptionSwatch");a=a.value;for(var q=b.$(e.classSelector+m.selectedOption).closest(".payment-options-list-item").find("span.a-declarative").data(m.monthlyPaymentAction),u=1;u<p.length;u++){var r=p.eq(u).find("span.a-declarative").data(m.monthlyPaymentAction),w=r.maxQuantity;
w&&(a>w?(d.disableSwatch(p.eq(u)),w={data:{paymentOptionUnAvailableMsg:r.unAvailableText,numberOfPaymentOptions:r.numberOfPaymentOptions,disabledPaymentOptionId:r.paymentOptionSelectButtonId}},f.getWeblabData().isComparePlansRefactorWeblabInT1?b.trigger("a:declarative:compare-payment-plans-disable:click",w):d.disableOptionInCompareAllPlans(w),q&&r.offerGroup===q.offerGroup&&(k(n).click(),l.ccRemovedSelectionUpdate(h,g(r)),c=r.offerGroup)):(d.enableSwatch(p.eq(u)),f.getWeblabData().isComparePlansRefactorWeblabInT1?
b.trigger("a:declarative:compare-payment-plans-enable:click",{data:{enablePaymentOptionId:r.paymentOptionSelectButtonId}}):d.enableOptionInCompareAllPlans(r.numberOfPaymentOptions),c&&r.offerGroup===c&&(k(".tp-bbm-info-message-quantity-restriction-container").hasClass("tp-bbm-info-message-displayable")&&b.trigger("a:declarative:payment-options-monthly-payment-action:click",{$currentTarget:p.eq(u).find("span.a-declarative"),data:r}),l.ccRemovedSelectionsClear(h))))}})});"use strict";p.when("A","payment-options-constants").register("payment-options-state",
function(b,d){function e(){if(!l||0===Object.keys(l).length){var b=f(d.selector.paymentOptionsWeblabs).attr(d.selector.paymentOptionsWeblabsAttribute);b&&(l=JSON.parse(b))}return l}var f=b.$,l={};b={getWeblabData:e};e();return b});"use strict";p.when("A").register("payment-options-opt-out-state",function(b){return{paymentOptionOptOutSelected:{isOneTimePaymentPreferenceSet:!1,changePlanEventData:""},secondaryViewInstance:null}});"use strict";p.when("A","a-modal","payment-options-opt-out-state","price-block-messaging-constants",
"payment-options-client-side-metric","ready").execute("payment-options-modal",function(b,d,e,f,l){var g={};b.declarative("open-priceblock-change-plan-modal","click",function(b){l.incrementWithValuePriceBlockMessaging("Modal:PaymentOptions:Optout:Link:Click");var e="priceblock-change-plan-modal-"+b.data.buyingOptionIndex;Object.hasOwn(g,e)||(g[e]=d.create(b.$target,{header:b.data.optOutModalHeader,name:e,dataStrategy:"preload",width:484}));g[e].show()});b.declarative("priceblock-change-plan-modal-cancel-button",
"click",function(b){l.incrementWithValuePriceBlockMessaging("Modal:PaymentOptions:Optout:CancelButton:Click");g["priceblock-change-plan-modal-"+b.data.buyingOptionIndex].hide()});b.declarative("priceblock-change-plan-modal-continue-button","click",function(k){l.incrementWithValuePriceBlockMessaging("Modal:PaymentOptions:Optout:ContinueButton:Click");k=e.paymentOptionOptOutSelected.changePlanEventData;for(var m=Object.keys(g),h=0;h<m.length;++h){var c=m[h];d.remove(c);delete g[c]}e.paymentOptionOptOutSelected.isOneTimePaymentPreferenceSet=
!0;m=b.copy(k);m.data.paymentOptionSelectButtonId=f.ONE_TIME_PAYMENT_OPTION_ID;b.trigger("a:declarative:price-block-otp-action:click",m);k=b.copy(k);b.trigger("a:declarative:price-block-compare-payment-plans:click",k)})});"use strict";p.when("A","price-block-messaging-constants","payment-options-client-side-metric").register("price-block-landing-page-events",function(b,d,e){b.declarative("acquisition-offer-see-details","click",function(b){e.incrementWithValuePriceBlockMessaging(d.metrics.ACQUISITION_OFFER_SEE_DETAILS_BUTTON_CLICK,
1);u.open(b.data.landingPageUrl,"_blank")});b.declarative("acquisition-offer-learn-more","click",function(b){e.incrementWithValuePriceBlockMessaging(d.metrics.ACQUISITION_OFFER_LEARN_MORE_CLICK,1);u.open(b.data.landingPageUrl,"_blank")})});"use strict";p.when("A","price-block-messaging-constants","payment-options-client-side-metric").register("checkbox-price-block-actions",function(b,d,e){function f(b){l(g.CHECKBOX_PRICE_BLOCK).data(g.CHECKBOX_PRICE_BLOCK_DATA_KEY,b)}var l=b.$,g=d.selector;return{getComparePlansV1SelectedOfferButtonId:function(){var b=
g.COMPARE_PLAN_OFFER_BUTTON_ID_PREFIX,d=l(g.CHECKBOX_PRICE_BLOCK).data(g.CHECKBOX_PRICE_BLOCK_DATA_KEY);d||(d=b+"01",f(d));return d},getComparePlansV2SelectedOfferButtonId:function(){var b=l(g.CHECKBOX_PRICE_BLOCK).data(g.CHECKBOX_PRICE_BLOCK_DATA_KEY);b||(b=g.CHECKBOX_PRICE_BLOCK_INITIAL_CP2_BUTTON,f(b));return b},getOptionNotSelectedString:function(){return l(g.CHECKBOX_PRICE_BLOCK).data(g.CHECKBOX_PRICE_BLOCK_DATA_OPTION_NOT_SELECTED_STRING_KEY)},updateCheckboxPriceblockData:f,updateCheckboxPriceblockOptionNotSelectedString:function(b){l(g.CHECKBOX_PRICE_BLOCK).data(g.CHECKBOX_PRICE_BLOCK_DATA_OPTION_NOT_SELECTED_STRING_KEY,
b)},markCheckboxPriceblock:function(){document.getElementById(g.CHECKBOX_PRICE_BLOCK_INPUT_ID).checked=!0},unmarkCheckboxPriceblock:function(){document.getElementById(g.CHECKBOX_PRICE_BLOCK_INPUT_ID).checked=!1},triggerCheckboxSelectedActions:function(d,e){b.defer(function(){l(d).click();l(e).click()})},triggerCheckboxUnCheckedActions:function(b){l(b).click()},hasCheckboxPriceblock:function(){return l(g.CHECKBOX_PRICE_BLOCK).length}}})});
/* ******** */
(function(f){var g=window.AmazonUIPageJS||window.P,k=g._namespace||g.attributeErrors,a=k?k("DetailPageUssStrxAssets",""):g;a.guardFatal?a.guardFatal(f)(a,window):a.execute(function(){f(a,window)})})(function(f,g,k){f.when("A","atf").register("uss-strx-toggle",function(a,d){return{}});f.when("A","uss-strx-toggle","uss-strx-constants","uss-strx-metrics").register("uss-strx-eligibility-data",function(a,d,e,b){function c(c,h){typeof c!==typeof k&&!1!==c||b.updateAndLogCounter(h,1)}var m=a.$,l=e.metrics;
b.init();return{getEligibilityData:function(){var b=null,h=m("#strx-uss-widget-container");if(h.length){var b=h.attr("data-asin"),a=h.attr("data-displayable"),e=h.attr("data-offer-listing-id"),d=h.attr("data-marketplace-id"),f=h.attr("data-language-header"),g=h.attr("data-opt-strx-experiments"),k=h.attr("data-is-prime-customer"),h=h.attr("data-promo-id");c(b,l.MISSING_ASIN);c(a,l.MISSING_DISPLAYABLE);c(e,l.MISSING_OFFERLISTING);c(d,l.MISSING_MARKETPLACE);c(f,l.MISSING_LANGUAGE_HEADER);c(g,l.MISSING_STRX_EXPERIMENTS);
c(k,l.MISSING_IS_CUSTOMER_PRIME);c(h,l.MISSING_PROMO_ID);b={asin:b,displayable:a,offerListingId:e,marketplaceId:d,languageHeader:f,optStrxExperiments:g,isCustomerPrime:k,promoId:h}}return b}}});f.when("A","uss-strx-toggle").register("uss-strx-reftag",function(a,d){function e(b){for(var c=/([^&=]+)=([^&]*)/g,a=g.location.search.substring(1),e={},d;null!==(d=c.exec(a));){var h=d[1];d=d[2];try{e[decodeURIComponent(h)]=decodeURIComponent(d)}catch(f){}}return e[b]}return{getRefTagInURL:function(){var b=
e("ref_");b||(b=e("ref"));b||(b=encodeURI(g.location.href),b=b.split("?")[0],b=b.split("ref\x3d")[1]);return b?b:null}}});f.when("A","uss-strx-toggle","uss-strx-constants","uss-strx-metrics-logger","atf").register("uss-strx-metrics",function(a,d,e,b){var c;return{init:function(){c=new b(e.logging.METRIC_PREFIX)},updateAndLogCounter:function(b,e){c.updateAndLogCounter(b,e)},logCounter:function(b,e){c.logCounter(b,e)},logNexusMetric:function(b,e,a){c.logNexusMetric(b,e,a)}}});f.when("A","uss-strx-toggle",
"atf").register("uss-strx-metrics-logger",function(a,d,e){return function(b){function c(b,c){null!==c&&"number"===typeof c&&g.ue&&g.ue.count&&g.ue.count(a.attribution+b,c)}function e(b){var c=0;g.ue&&g.ue.count&&(c=g.ue.count(a.attribution+b));return c}var a=this;a.attribution=b||"";a.logCounter=c;a.getCounter=e;a.updateAndLogCounter=function(b,a){var d=e(b);null!==d&&"number"===typeof d?c(b,d+a):c(b,a)};a.logNexusMetric=function(b,c,a){}}});f.when("A","uss-strx-toggle","atf").register("uss-strx-constants",
function(a,d,e){return{strxCTI:{CATEGORY:"Website",TYPE:"STRX",ITEM:"UPO"},eligibility:{ELIGIBILITY_TYPE:"STRX"},ussStores:{USS_STRX_STORE:"uss-strx-store"},logging:{METRIC_PREFIX:"USS.STRX."},metrics:{MISSING_ASIN:"MissingASIN",MISSING_DISPLAYABLE:"MissingDisplayableFlag",MISSING_OFFERLISTING:"MissingOfferListingId",MISSING_MARKETPLACE:"MissingMarketplaceId",MISSING_LANGUAGE_HEADER:"MissingLanguageHeader",MISSING_STRX_EXPERIMENTS:"MissingStrxExperiments",MISSING_IS_CUSTOMER_PRIME:"MissingIsCustomerPrime",
MISSING_PROMO_ID:"MissingPromoId",BENEFIT_ACTIVATION_SUCCESS:"BenefitActivationSuccess",BENEFIT_ACTIVATION_FAILURE:"BenefitActivationFailure",PROMOTION_ACTIVATION_ON_LOAD:"PromotionActivationOnLoad",PROMOTION_ACTIVATION_ON_ATC:"PromotionActivationOnATC"}}});f.when("A","uss-strx-toggle","uss-strx-constants","uss-eligibility","uss-strx-eligibility-data").register("uss-strx-eligibility",function(a,d,e,b,c){(a=c.getEligibilityData())&&"function"===typeof b.registerProgramEligibility&&b.registerProgramEligibility(e.eligibility.ELIGIBILITY_TYPE,
a);return{}});f.when("A","uss-strx-constants","uss-strx-metrics","uss-strx-reftag","uss-strx-eligibility-data").register("uss-strx-page-load-promo-trigger",function(a,d,e,b,c){a=b.getRefTagInURL();c=c.getEligibilityData();a&&c&&c.asin&&e.updateAndLogCounter(d.metrics.PROMOTION_ACTIVATION_ON_LOAD,1);return{}});f.when("uss-store-repository","dp-flux-attribution","uss-constants","uss-strx-constants","uss-strx-metrics").register("uss-strx-store",function(a,d,e,b,c){function f(){}var g=e.actions,k=b.strxCTI;
d=new d(b.ussStores.USS_STRX_STORE,k.CATEGORY,k.TYPE,k.ITEM);c.init();f.prototype={};k=new f;return a.registerStore(d,function(a,d){var f=d.getMetaData();switch(d.getName()){case g.ATC_RECEIVE:(d.getSource()===e.actionSources.DP_ATC_CLICK||d.getSource()===e.actionSources.USS_INLINE_ATC_CLICK)&&!0!==f.isAtcGenericError&&f&&f.params&&f.params.baseReftag&&f&&f.params&&f.params.baseAsin&&c.updateAndLogCounter(b.metrics.PROMOTION_ACTIVATION_ON_ATC,1)}return a},k)});f.when("A","cid-strx-toggle").register("strx-reftag",
function(a,d){function e(){var a=b("ref_");a||(a=b("ref"));a||(a=encodeURI(g.location.href),a=a.split("?")[0],a=a.split("ref\x3d")[1]);c=a?a:null}function b(a){for(var b=/([^&=]+)=([^&]*)/g,c=g.location.search.substring(1),e={},d;null!==(d=b.exec(c));){var f=d[2];e[decodeURIComponent(d[1])]=decodeURIComponent(f)}return e[a]}var c;c||e();return{getRefTagInURL:function(){return c}}});f.when("A","uss-strx-metrics-logger","atf").register("strx-metrics",function(a,d){var e;return{init:function(a){e=new d(a)},
updateAndLogCounter:function(a,c){e.updateAndLogCounter(a,c)},logCounter:function(a,c){e.logCounter(a,c)},logNexusMetric:function(a,c,d){e.logNexusMetric(a,c,d)}}});f.when("A","cid-strx-toggle","atf").register("cid-strx-constants",function(a,d,e){return{logging:{METRIC_PREFIX:"CID.STRX."}}});f.when("A","cid-strx-toggle","atf").register("strx-constants",function(a,d,e){return{metrics:{BENEFIT_ACTIVATION_SUCCESS:"BenefitActivationSuccess",BENEFIT_ACTIVATION_FAILURE:"BenefitActivationFailure"}}});f.when("A",
"strx-reftag","strx-metrics","cid-strx-constants").register("cid-strx-page-load-promo-trigger",function(a,d,e,b){var c=a.$;a=/strx-cid/g;d=d.getRefTagInURL();c=c("#main-image");d&&d.match(a)&&c.length&&e.init(b.logging.METRIC_PREFIX);return{}});f.when("uss-strx-constants","uss-strx-eligibility-data","atc-eligibility").register("atc-strx-eligibility",function(a,d,e){(d=d.getEligibilityData())&&"function"===typeof e.registerProgramEligibility&&e.registerProgramEligibility(a.eligibility.ELIGIBILITY_TYPE,
d);return{}})});
/* ******** */
(function(g){var e=window.AmazonUIPageJS||window.P,m=e._namespace||e.attributeErrors,a=m?m("DetailPageClimatePledgeFriendlyNewAssets",""):e;a.guardFatal?a.guardFatal(g)(a,window):a.execute(function(){g(a,window)})})(function(g,e,m){g.when("A","climate-pledge-friendly-csm-counters").register("cpf-dpx-handlers",function(a,c){function d(){return a.capabilities.isAmazonApp?"map":a.capabilities.tablet?"twb":a.capabilities.mobile?"mwb":"dsk"}a.declarative("CPF-ATF-LandingPageLink","click",{allowLinkDefault:!0},
function(a){c.incrementCounter("cpf_dp_"+d()+"_dpcd_aflk")});a.declarative("CPF-BTF-LandingPageLink","click",{allowLinkDefault:!0},function(a){c.incrementCounter("cpf_dp_"+d()+"_dpcd_bflk")});a.declarative("CPF-OpenExternalLink","click",function(p){var h=p.$currentTarget[0].firstChild.href;c.incrementCounter("cpf_dp_"+d()+"_dpcd_excf");a.capabilities.isAmazonApp?g.when("mash").execute(function(a){e.location=h}):e.open(h,"_blank")});g.when("A").execute(function(a){a.on("a:image:lazyLoaded",function(a){a.hasClass("climatePledgeFriendlyLazyload")&&
c.recordLazyLoad()});a.on("a:image:load:cpf-leaf",function(){c.recordImageLoad()})});c.recordLatency()});"use strict";g.when("dp-latency-marker").register("climate-pledge-friendly-csm-counters",function(){return{incrementCounter:function(a,c){c=c||1;c=(ue.count(a)||0)+c;ue.count(a,c)},recordLatency:function(){"function"===typeof e.uet&&e.uet("bb","climate-pledge-friendly-dpx",{wb:1});"function"===typeof e.uet&&e.uet("x1","climate-pledge-friendly-dpx",{wb:1});"function"===typeof e.uex&&e.uex("ld",
"climate-pledge-friendly-dpx",{wb:1})},recordClick:function(){"function"===typeof e.uet&&e.uet("af","climate-pledge-friendly-dpx-click",{wb:1});"function"===typeof e.uex&&e.uex("ld","climate-pledge-friendly-dpx-click",{wb:1})},recordImageLoad:function(){"function"===typeof e.uet&&e.uet("be","climate-pledge-friendly-dpx-image-loading",{wb:1});"function"===typeof e.uex&&e.uex("ld","climate-pledge-friendly-dpx-image-loading",{wb:1})},recordLazyLoad:function(){"function"===typeof e.uet&&e.uet("cf","climate-pledge-friendly-dpx-image-loading",
{wb:1});"function"===typeof e.uex&&e.uex("ld","climate-pledge-friendly-dpx-image-loading",{wb:1})}}});g.when("dp-latency-marker").register("cpf-dpx-common-constants",function(){return{ATTRIBUTION_STRING:"DetailPageClimatePledgeFriendly",EVENT_ID_BOTTOM_SHEET_SHOW:"cpf-dpx-sheet",EVENT_ID_BOTTOM_SHEET_SECONDARY_SHOW:"cpf-dpx-sheet-secondary",EVENT_ID_BOTTOM_SHEET_SECONDARY_BACK:"cpf-dpx-sheet-secondary-back",EVENT_ID_SIDE_SHEET_SHOW:"cpf-dpx-sidesheet-open",EVENT_ID_SIDE_SHEET_HIDE:"cpf-dpx-sidesheet-close",
EVENT_ID_SIDE_SHEET_CAPTURE:"cpf-dpx-sidesheet-capture",EVENT_ID_SIDE_SHEET_SECONDARY_SHOW:"cpf-dpx-sidesheet-secondary",EVENT_ID_SIDE_SHEET_SECONDARY_BACK:"cpf-dpx-sidesheet-secondary-back",SELECTOR_BOTTOM_SHEET_CONTAINER:".cpf-dpx-container-bottom-sheet",SELECTOR_BOTTOM_SHEET_CONTAINER_SECONDARY:".cpf-dpx-container-bottom-sheet-secondary",SELECTOR_BOTTOM_SHEET_SECONDARY_BACK_BUTTON:".cpf-dpx-detail-view-secondary-back",SELECTOR_BOTTOM_SHEET_CAROUSEL:".cpf-dpx-bottom-sheet-carousel",SELECTOR_PROGRAM_STICKY_FOOTER:".cpf-dpx-sticky-footer",
SELECTOR_SIDE_SHEET_SECONDARY_BACK_BUTTON:".cpf-dpx-detail-view-secondary-back",SIDE_SHEET_CONTAINER_ID:"cpf-dpx-sidesheet-container",SIDE_SHEET_START_ANCHOR_CLASSNAME:"cpf-dpx-sidesheet-anchor-start",SIDE_SHEET_END_ANCHOR_CLASSNAME:"cpf-dpx-sidesheet-anchor-end",CAROUSEL_INITIALIZED_CLASS:"a-carousel-initialized",CAROUSEL_NOT_INITIALIZED_CLASS:"a-carousel-static",KEYCODE_ESCAPE:27,KEYCODE_TAB:9,SCROLL_CORRECTION_OFFSET:5,SCROLL_EVENT_THROTTLE_MS:150,BOTTOM_SHEET_HEIGHT_CHANGE_DURATION:.3,SCROLL_EVENT_DELAY_MS:1E3,
SIDE_SHEET_OPEN_ANIMATION_DELAY_MS:300,SIDE_SHEET_CLOSE_ANIMATION_DELAY_MS:200,MS_CONVERT:1E3,TRIGGER_URI:"/ussx/weblab-trigger?",QC_WEBLAB:"CONSUMABLES_CPF_QUANTIFIABLE_CLAIMS_1080213"}});g.when("A","cpf-dpx-common-constants","cpf-dpx-sidesheet-util","cpf-dpx-trigger-utils","ready").execute("cpf-dpx-sidesheet",function(a,c,d,p){var h=e.ue&&e.ue.count||function(){};a.declarative(c.EVENT_ID_SIDE_SHEET_SHOW,"click",function(b){var e=b.$currentTarget,k;b.data.preloadDomId?(b.data.ctMetric&&h(b.data.ctMetric,
1),b.data.qcTrigger&&p.triggerQCWeblab(b.data.qcTrigger,c.QC_WEBLAB),d.preloadSheet(b.data.preloadDomId,b.data.popoverLabel,b.data.closeButtonLabel,!!b.data.removeBackButton),d.showSheet(),a.one("cpf-dpx-sidesheet:afterShow",function(b){a.loadDescendantImagesManually(b.sheet);k=a.now()}),a.one("cpf-dpx-sidesheet:afterHide",function(){var d;e&&e.length&&(d=e.find("a").first())&&d.length&&d.focus();b.data.dwellMetric&&k&&h(b.data.dwellMetric,(a.now()-k)/c.MS_CONVERT)})):g.log("Sidesheet show error: missing DOM ID for loading",
"ERROR",c.ATTRIBUTION_STRING)});a.declarative(c.EVENT_ID_SIDE_SHEET_SECONDARY_SHOW,"click",function(b){b.data.preloadDomId&&b.data.previousPreloadDomId?a.$("#"+b.data.preloadDomId).length?(b.data.ctMetric&&h(b.data.ctMetric,1),d.preloadSecondaryContent(b.data.preloadDomId),d.addBackActionData(b.data.ctDwellMetric,0!==b.$target.length?b.$target.attr("id"):b.data.previousPreloadDomId),d.showSecondaryContent()):(b.data.delayMetric&&h(b.data.delayMetric,1),g.log("Can not find secondary sheetContent by preloadDomId in desktop side sheet",
"INFO",c.ATTRIBUTION_STRING)):g.log("Sidesheet secondary show error: missing DOM ID for loading","ERROR",c.ATTRIBUTION_STRING)});a.declarative(c.EVENT_ID_SIDE_SHEET_SECONDARY_BACK,"click",function(b){b.data&&b.data.returnFocusId?d.hideSecondaryContent(b.data.returnFocusId):d.hideSecondaryContent();b.data&&b.data.ctDwellMetric&&b.data.ctDwellStart&&h(b.data.ctDwellMetric,(a.now()-b.data.ctDwellStart)/c.MS_CONVERT)});a.declarative(c.EVENT_ID_SIDE_SHEET_HIDE,"click",function(){d.hideSheet()});a.declarative(c.EVENT_ID_SIDE_SHEET_CAPTURE,
"keydown",function(a){"keydown"!==a.type||a.$event.keyCode!==c.KEYCODE_ESCAPE&&a.$event.key!==c.KEYCODE_ESCAPE||d.hideSheet()});a.declarative(c.EVENT_ID_SIDE_SHEET_CAPTURE,"focusin",function(b){b.$target.length&&b.$target.hasClass(c.SIDE_SHEET_END_ANCHOR_CLASSNAME)&&a.delay(function(){d.focusOnFirst()},0)});a.declarative(c.EVENT_ID_SIDE_SHEET_CAPTURE,"focusout",function(b){b.$target.length&&a.delay(function(){a.$(document.activeElement).hasClass(c.SIDE_SHEET_START_ANCHOR_CLASSNAME)&&d.focusOnLast()},
0)});a.on("a:expander:pc_sidesheet_expander:toggle:expand",function(a){a.expander&&a.expander.$expander&&a.expander.$expander.data("eometric")&&h(a.expander.$expander.data("eometric"),1)})});"use strict";g.when("A","jQuery","cpf-dpx-common-constants").register("cpf-dpx-sidesheet-util",function(a,c,d){function e(){return c("#"+d.SIDE_SHEET_CONTAINER_ID)}function h(a){return a.find("#cpf-dpx-sidesheet-content-container")}function b(a){return a.find("#cpf-dpx-sidesheet-background")}function n(a){return a.find("#cpf-dpx-sidesheet-content")}
function k(a){return a.find("#cpf-dpx-sidesheet-secondary-content")}function m(b){var d=e(),f=n(d),h=k(d);a.hide(h);a.show(f);h.attr("aria-hidden","true");f.attr("aria-hidden","false");d.find(".cpf-dpx-sidesheet-anchor-start").focus();b&&(b=c("#"+b),b.length&&b.focus())}return{preloadSheet:function(b,h,l,k){var f=e();b=c("#"+b);f&&0!==f.length||(f=c(document.createElement("div")),f.attr("id",d.SIDE_SHEET_CONTAINER_ID),f.addClass("a-section a-spacing-none"),f.append('\x3cspan class\x3d"a-declarative" data-action\x3d"'+
d.EVENT_ID_SIDE_SHEET_CAPTURE+'"\x3e\x3cspan class\x3d"a-declarative" data-action\x3d"cpf-dpx-sidesheet-close" aria-label\x3d"'+l+'" tabindex\x3d"0"\x3e\x3cdiv id\x3d"cpf-dpx-sidesheet-background" class\x3d"cpf-dpx-sidesheet-background" aria-hidden\x3d"true"\x3e\x3c/div\x3e\x3c/span\x3e\x3cdiv id\x3d"cpf-dpx-sidesheet-content-container" class\x3d"cpf-dpx-sidesheet" aria-modal\x3d"true" role\x3d"dialog" aria-labelledby\x3d"cpf-dpx-sidesheet-label" aria-hidden\x3d"true"\x3e\x3cspan tabindex\x3d"0" class\x3d"'+
d.SIDE_SHEET_START_ANCHOR_CLASSNAME+' cpf-dpx-sidesheet-a11y-label"\x3e\x3c/span\x3e\x3cheader\x3e\x3cspan id\x3d"cpf-dpx-sidesheet-label" class\x3d"cpf-dpx-sidesheet-a11y-label aok-block" aria-hidden\x3d"true"\x3e'+h+'\x3c/span\x3e\x3cbutton class\x3d"a-declarative cpf-dpx-sidesheet-close-button" data-action\x3d"cpf-dpx-sidesheet-close" aria-label\x3d"'+l+'"\x3e\x3cdiv class\x3d"a-icon cpf-dpx-sidesheet-close-icon"\x3e\x3c/div\x3e\x3c/button\x3e\x3c/header\x3e\x3cdiv id\x3d"cpf-dpx-sidesheet-content" aria-hidden\x3d"true"\x3e\x3c/div\x3e\x3cdiv id\x3d"cpf-dpx-sidesheet-secondary-content" aria-hidden\x3d"true"\x3e\x3c/div\x3e\x3cspan tabindex\x3d"0" class\x3d"'+
d.SIDE_SHEET_END_ANCHOR_CLASSNAME+' cpf-dpx-sidesheet-a11y-label"\x3e\x3c/span\x3e\x3c/div\x3e\x3c/span\x3e'),c("body").prepend(f));b&&0!==b.length?(n(f).html(b.html()),k&&n(f).find(d.SELECTOR_SIDE_SHEET_SECONDARY_BACK_BUTTON).parent().remove(),a.loadDescendantImagesManually(f)):g.log("Can not find the sheetContent by preloadDomId in desktop side sheet","ERROR",d.ATTRIBUTION_STRING)},showSheet:function(){var f=e(),g=b(f),l=h(f),k=n(f);a.show(f);m();l.attr("aria-hidden","false");k.attr("aria-hidden",
"false");f.find(".cpf-dpx-sidesheet-close-button").focus();c("#a-page").attr("aria-hidden","true");c("body").css("overflow","hidden");a.show(g);l.show(function(){a.animate(l,{right:"0"},d.SIDE_SHEET_ANIMATION_DELAY_MS,"ease-out",function(){a.trigger("cpf-dpx-sidesheet:afterShow",{sheet:f})})})},hideSheet:function(){var f=e(),g=b(f),l=h(f);l.attr("aria-hidden","true");c("#a-page").attr("aria-hidden","false");c("body").css("overflow","");a.hide(g);a.animate(l,{right:"-500px"},d.SIDE_SHEET_ANIMATION_DELAY_MS,
"ease-out",function(){a.hide(f);a.trigger("cpf-dpx-sidesheet:afterHide",{sheet:f})})},addBackActionData:function(b,c){var f=e();f=k(f).find(d.SELECTOR_SIDE_SHEET_SECONDARY_BACK_BUTTON).parent();b={returnFocusId:c,ctDwellMetric:b,ctDwellStart:a.now()};a.declarative.create(f,d.EVENT_ID_SIDE_SHEET_SECONDARY_BACK,b);f.attr("data-action",d.EVENT_ID_SIDE_SHEET_SECONDARY_BACK);f.attr("data-"+d.EVENT_ID_SIDE_SHEET_SECONDARY_BACK,JSON.stringify(b));f.removeAttr("action-name");f.removeAttr("action-params")},
preloadSecondaryContent:function(b){var f=e();b=c("#"+b);f=k(f);b&&0!==b.length?(f.html(b.html()),a.loadDescendantImagesManually(f)):g.log("Can not find secondary sheetContent by preloadDomId in desktop side sheet","ERROR",d.ATTRIBUTION_STRING)},hideSecondaryContent:m,showSecondaryContent:function(){var b=e(),c=n(b),d=k(b);a.hide(c);a.show(d);d.attr("aria-hidden","false");c.attr("aria-hidden","true");b.find(".cpf-dpx-sidesheet-anchor-start").focus()},focusOnFirst:function(){var a=e();h(a).find("a[href], button").first().focus()},
focusOnLast:function(){var a=e();h(a).find("a[href], button").last().focus()}}});g.when("A","cpf-dpx-common-constants").register("cpf-dpx-trigger-utils",function(a,c){return{triggerQCWeblab:function(d,g){var h="";e.ue&&(h=e.ue.id);d=c.TRIGGER_URI+"weblabValue\x3d"+g+"\x26treatment\x3d"+d+"\x26requestId\x3d"+h;navigator&&navigator.sendBeacon?navigator.sendBeacon(d):a.$.ajax({url:d})}}})});
/* ******** */
(function(g){var k=window.AmazonUIPageJS||window.P,l=k._namespace||k.attributeErrors,b=l?l("PulseStaplesActionAssets",""):k;b.guardFatal?b.guardFatal(g)(b,window):b.execute(function(){g(b,window)})})(function(g,k,l){String.prototype.startsWith||Object.defineProperty(String.prototype,"startsWith",{value:function(b,f){f=0<f?f|0:0;return this.substring(f,f+b.length)===b}});"use strict";g.when("A","pulse-staple-action-constants").register("pulse-staples-action-proxy",function(b,f){var c=function(a,d){var c=
a.success,e=a.error;b.$.ajax({url:d,type:"POST",data:JSON.stringify(a.data),contentType:"application/json; charset\x3dutf-8",dataType:"json",success:c,error:e,timeout:1E4})};return{addStaples:function(a){var d=f.addStaplesBaseUrl+"?"+b.$.param({reftag_:a.data.reftag});c(a,d)},updateStaple:function(a){var d=f.updateStapleBaseUrl+"?"+b.$.param({reftag_:a.data.reftag});c(a,d)}}});"use strict";g.when("A","a-dropdown","pulse-staple-action-error-modal-utils","pulse-staple-action-constants").register("pulse-add-action-state-util",
function(b,f,c,a){var d=function(a){return a.prop("enabled")===l||!0===a.prop("enabled")},g=function(e,c){return setTimeout(function(){var d=e.$currentTarget.closest(a.stapleActionRowSelector),h=d.nextAll(a.eduContentInitialViewSelector);h=0<h.length?b.$.makeArray(d,h):d;b.fadeOut(h,150,a.auiEaseOutAnimation,function(){var e=b.$(c);e.height(d.outerHeight());var h=e.filter(a.stapleActionRowSelector),g=d.nextAll(a.eduContentManageStaplesViewSelector);h=0<g.length?b.$.makeArray(h,g):h;d.replaceWith(e);
e=e.find(".a-dropdown-container select");(e=f.getSelect(e))&&e.val(e.val());b.fadeIn(h,150,a.auiEaseOutAnimation)})},1E3)};return{addActionSuccessTransition:function(e,d){var c=e.$currentTarget.nextAll(a.spinnerSelector),h=e.$currentTarget.nextAll(a.successSelector);e.data&&Array.isArray(e.data.templates)&&e.data.templates.includes("DO_NOT_RENDER_QUANTITY_CADENCE_SELECTOR")?g(e,d):b.fadeOut(c,150,a.auiEaseOutAnimation,function(){b.fadeIn(h,150,a.auiEaseOutAnimation,function(){return g(e,d)})})},addActionFailureTransition:function(e,
b){var h=e.$currentTarget.nextAll(a.spinnerSelector),f=e.$currentTarget.find(a.auiButtonSelector);d(f)||(h.toggleClass(a.auiHiddenCssClass),f.prop("enabled",!0),f.show(),c.showModal(e.$target,b))},addActionInProgressTransition:function(b){var e=b.$currentTarget.nextAll(a.spinnerSelector),c=b.$currentTarget.find(a.auiButtonSelector);if(d(c)){var f=b.$currentTarget.find(a.auiButtonSelector).outerHeight();b.$currentTarget.closest(a.stapleActionRowSelector).height(f);e.toggleClass(a.auiHiddenCssClass);
c.prop("enabled",!1);c.hide()}},itemAlreadyRepeatedTransition:function(e,d){var c=e.$currentTarget.closest(a.stapleActionRowSelector);e=c.nextAll(a.eduContentInitialViewSelector);e=b.$.makeArray(c,e);b.fadeOut(e,150,a.auiEaseOutAnimation,function(){var e=b.$(d);e.height(c.outerHeight());c.replaceWith(e);b.fadeIn(e,150,a.auiEaseOutAnimation)})},isAddActionInProgress:function(b){return!d(b.$currentTarget.find(a.auiButtonSelector))}}});"use strict";g.when("A","pulse-staple-action-error-modal-utils",
"pulse-staple-action-constants").register("pulse-update-action-state-util",function(b,f,c){return{renderUpdatedNextDropDate:function(a,d){d&&b.$(c.nextAddDateRowTextSelectorPrefix+"-"+a).text(d)},showErrorModalOnFailure:function(a,b){return f.showModal(a,b)},renderUpdatedQuantityAndCadence:function(a,d){d&&b.$(c.cadenceRowTextSelectorPrefix+"-"+a).text(d)},toggleInProgressCx:function(a){var d=b.$(c.updateStapleComponentSelectorPrefix+"-"+a),f=d.outerHeight();d.height(f);b.$(c.updateSpinnerContainerSelectorPrefix+
"-"+a).add(c.updateActionRowSelectorPrefix+"-"+a).toggleClass(c.auiHiddenCssClass)}}});"use strict";g.when("A","a-modal").register("pulse-staple-action-error-modal-utils",function(b,f){b.on("a:popover:afterHide:pulse-staple-action-error-modal",function(b){f.remove(b.popover)});var c=function(a){try{return JSON.parse(a.responseText).errorModalHtml}catch(d){return b.state("pulse-staple-action-error-messages").generic}};return{removeModal:function(){var b=f.get("pulse-staple-action-error-modal");b&&
f.remove(b)},showModal:function(b,d){f.create(b,{name:"pulse-staple-action-error-modal",inlineContent:c(d)}).show()}}});"use strict";g.when("A","a-popover","pulse-staple-action-constants").register("pulse-staple-action-educational-content",function(b,f,c){b.declarative(c.educationalContentLearnMoreDecAction,["click","mouseenter"],function(b){f.create(b.$target,{url:c.educationalContentBaseUrl+"?learnMoreManageStaplesLink\x3d"+b.data.learnMoreManageStaplesLink,position:"triggerLeft",width:320,closeButton:!1,
padding:"none"}).show()})});"use strict";g.when("A").register("pulse-staple-action-constants",function(){return{addStaplesBaseUrl:"/repeatitems/psa/v1/add",updateStapleBaseUrl:"/repeatitems/psa/v1/update",educationalContentBaseUrl:"/repeatitems/psa/v1/educontent",educationalContentLearnMoreDecAction:"pulse-staple-action-learn-more",educationalContentBottomSheetName:"pulse-staple-action-learn-more-bottom-sheet",spinnerSelector:".atsl-spinner-element",successSelector:".atsl-success-element",stapleActionRowSelector:".staple-action-row",
eduContentInitialViewSelector:".staple-action-learn-more-initial-view",eduContentManageStaplesViewSelector:".update-staple-action-manage-staples-link",auiButtonSelector:".a-button",auiHiddenCssClass:"aok-hidden",auiEaseOutAnimation:"ease-out",nextAddDateRowTextSelectorPrefix:"#pulse-staples-action-next-add-date-row-text",cadenceRowTextSelectorPrefix:"#pulse-staple-action-qty-cadence-row-text",updateSpinnerContainerSelectorPrefix:"#pulse-staple-update-spinner-container",updateActionRowSelectorPrefix:"#pulse-staple-update-action-row",
updateStapleComponentSelectorPrefix:"#update-staple-component",updateStapleSuccessfulEventId:"UpdateStapleSuccessfulEvent"}});"use strict";g.when("A").register("pulse-staple-action-metric-util",function(){return{logAddStapleLatencyMetric:function(b,f){k.ue&&k.ue.count&&"undefined"!==typeof k.ue_t0&&ue.count("AddStaple-TimeTo-"+b,f-k.ue_t0)}}});"use strict";g.when("A","pulse-staples-action-proxy","pulse-add-action-state-util","pulse-staple-action-metric-util").register("pulse-add-staple-action",function(b,
f,c,a){var d=function(a){return b.$.extend({},a,{clientContext:a,asins:[a.asin]})};b.declarative("pulse-add-to-staples-action","click",function(a){c.isAddActionInProgress(a)||(c.addActionInProgressTransition(a),f.addStaples({data:d(a.data),success:function(d){"ItemAlreadyRepeated"===d.addOperationStatus?c.itemAlreadyRepeatedTransition(a,d.nextViewHtml):(c.addActionSuccessTransition(a,d.nextViewHtml),b.trigger("AddToStaplesSuccessfulEvent",a.data.asin))},error:function(b){return c.addActionFailureTransition(a,
b)}}))});var g=b.now();a.logAddStapleLatencyMetric("JSReady",g)});"use strict";g.when("A","pulse-staples-action-proxy","pulse-update-action-state-util","QuantitySelectorWidget","QuantitySelectorConstants","QuantitySelectorState","QuantitySelectorUtils","QuantitySelectorAUIDeps","a-dropdown","a-modal","pulse-staple-action-constants").register("pulse-update-staple-action",function(b,f,c,a,d,g,e,h,k,l,m){var n=function(b){return k.getSelect("pulse-staple-cadence-selector-desktop-"+b)},q=function(a){var d=
g.getQsWidgetConfiguration(a).selectedId;d=e.getQsItem(a,d);d=JSON.parse(d.data);var c=g.getQsWidgetConfiguration(a);c=JSON.parse(c.staticData);return b.$.extend({},c,d,{quantity:{quantity:d.quantity,unit:c.quantityUnit},cadence:JSON.parse(n(a).val()),clientContext:c})},p=function(a){var c=b.state("pulse-original-cadence-"+a);n(a).val(JSON.stringify(c));c=d.getQsWidgetConfigurationId(a)+"-original";(c=h.aState.state(c))&&c.id&&h.aState.state.replace(d.getQsWidgetConfigurationId(a),c);b.trigger(d.getQsWidgetEventInitialize(),
!0,a)};b.on("a:popover:afterShow",function(a){if((a=a.popover)&&a.name&&a.name.startsWith("pulse-staple-action-qs")){a=a.name.replace("pulse-staple-action-qs-","");var c=d.getQsWidgetConfigurationId(a)+"-original";h.aState.state(c);var e=g.getQsWidgetConfiguration(a);h.aState.state(c,e);b.state("pulse-original-cadence-"+a,JSON.parse(n(a).val()))}});b.on("a:popover:hide",function(a){(a=a.popover)&&a.name&&a.name.startsWith("pulse-staple-action-qs")&&(a=a.name.replace("pulse-staple-action-qs-",""),
b.$(m.updateSpinnerContainerSelectorPrefix+"-"+a).hasClass(m.auiHiddenCssClass)&&p(a))});b.declarative("pulse-update-staple-action","click",function(a){var d=a.data.qsUID,e=a.$currentTarget.closest(".a-popover-modal");e=l.get(e);c.toggleInProgressCx(d);e.hide();f.updateStaple({data:q(d),success:function(a){c.renderUpdatedQuantityAndCadence(d,a.renderableQuantityCadence);c.renderUpdatedNextDropDate(d,a.renderableNextDropDate);b.trigger(m.updateStapleSuccessfulEventId);c.toggleInProgressCx(d)},error:function(b){c.showErrorModalOnFailure(a.$target,
b);p(d);c.toggleInProgressCx(d)}})})})});
/* ******** */
(function(c){var b=window.AmazonUIPageJS||window.P,e=b._namespace||b.attributeErrors,a=e?e("ALMCustomizationAssets",""):b;a.guardFatal?a.guardFatal(c)(a,window):a.execute(function(){c(a,window)})})(function(c,b,e){c.when("fresh-add-to-cart","customization-service","fresh-atfc-error-modal-utils","fx-atfc-button-utils").execute(function(a,c,e,q){var g=/^(?:[a-zA-Z0-9 .!$&?]{1,30})?$/,f=document.getElementById("customTextArea"),h=document.getElementById("customCakeProfanityMessage"),r=document.getElementById("customCakeSpecialCharErrorMessage"),
t=document.getElementById("customCakeErrorPopupTitle");f&&a.attachPrehooks({invoke:function(d,a,l,k,m,p){function n(a){b.ue&&b.ue.count&&a&&b.ue.count("WFMOAC_CakeCustomization_ATC",a)}"a-form-error"===f.getAttribute("class")?(a=g.test(f.value)?h.innerHTML:r.innerHTML,e.showModal(d,{header:t.innerHTML,errorMessage:a,footer:'\x3cspan class\x3d"a-declarative" data-action\x3d"a-popover-close"data-a-popover-close\x3d"{}"\x3e\n\x3cspan class\x3d"a-button a-button-primary"\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'},
p),q.showButtonAndRemoveSpinner(d)):f.value?(n(1),c.saveCustomization(a,{asin:d.data.asin,almStoreId:d.data.storeId,price:d.data.price,personalizedMessage:f.value,csrfToken:d.data.csrfToken},d,l,function(){f.value="";k&&k()},m)):(n(0),a.success(d,l,k,m))}})});"use strict";c.when("A").register("customization-service",function(a){return{saveCustomization:function(c,b,e,g,f,h){a.post("/alm/customization",{success:function(a){e.data.additionalParams=Object.assign(e.data.additionalParams||{},{customizationToken:a.customizationToken});
c.success(e,g,f,h)},error:function(a,b,d){c.error(a,b,d)},contentType:"application/json",params:b,paramsFormat:"json"})}}})});
/* ******** */
(function(e){var g=window.AmazonUIPageJS||window.P,m=g._namespace||g.attributeErrors,a=m?m("F3GLOWAssets",""):g;a.guardFatal?a.guardFatal(e)(a,window):a.execute(function(){e(a,window)})})(function(e,g,m){e.when("f3-glow-utils","f3-glow-url-utils","f3-glow-constants","f3-glow-window-utils").register("f3-glow-manager",function(a,d,b,h){var c=function(){var c="true"===d.getUrlParameter(b.OPEN_GLOW),f=d.getUrlParameter(b.ACTIVE_TAB),l=d.getUrlParameter(b.STORE_CONTEXT);return c&&null!==f?(a.openGlowToActiveTab(f,
l),h.ue.count(b.OPENING_GLOW_METRIC,1),!0):c?(a.openGlowToActiveTab(b.DELIVERY,l),h.ue.count(b.OPENING_GLOW_METRIC,1),!0):!1};if(c()){var f=d.getUrlWithoutParameters(b.OPEN_GLOW,b.ACTIVE_TAB,b.STORE_CONTEXT);g.history.replaceState(null,null,f)}return{openGlowGivenUrlParameters:c}});"use strict";e.register("f3-glow-constants",function(){var a=["FreshMerchandisedContent","FreshMerchandisedContentMobile","Detail","DetailAW","DetailWebView"],d={nowstore:a},b={amazonfresh:a,dia:a},h={amazonfresh:a,u2supermercato:a,
pampanorama:a},c={amazonfresh:a,watsons:a,littlefarms:a};return{OPEN_GLOW:"openGlow",ACTIVE_TAB:"activeTab",GLOW_CLASS_NAME:"#nav-global-location-slot",STORE_CONTEXT:"storeContext",DELIVERY:"deliveryTab",WAITING_FOR_STORE_CONTEXT_EVENT:"glow.waitingForStoreContext",STORE_CONTEXT_EVENT:"glow.storeContext",GLUX_BOTTOMSHEET_NAME:"glux_bottom_sheet",GET_ADDRESS_SELECTIONS_ENDPOINT:"/gp/glow/get-address-selections.html",GLOW_BOTTOMSHEET_ID:"#glow-bottom-sheet",OPENING_GLOW_METRIC:"f3glowassets.glow.open",
ALM_BRAND_ID:"almBrandId",MAP_BRAND_ID_TO_ALIAS:{ctnow:"nowstore",QW1hem9uIEZyZXNo:"amazonfresh",TGEgUGxhemEgZGUgRGlh:"dia",VTIgU3VwZXJtZXJjYXRv:"u2supermercato",UGFtIFBBTk9SQU1B:"pampanorama",TW9ub3ByaXg:"monoprix",Q2FzaW5v:"casino",TW9ycmlzb25z:"morrisons",Q29vcA:"co-op",ejEjkXsQmO:"iceland",dGVndXQuLi4:"tegut","5oiQ5Z1O551z5LqV":"seijoishii","44OQ44Ot44O8":"valor","44Op44Kk44OV":"life",KQENHJywk4:"watsons",WDpqStVxNA:"littlefarms",VUZHIFdob2xlIEZvb2Rz:"wholefoods"},CLOSING_BRACES:"}",WEBLAB_MAP_KEY:"WEBLABS",
PROGRAM_SPECIFIC_MODAL_NAME:"program_specific_modal",PROGRAM_SPECIFIC_SHEET_NAME:"program_specific_bottom_sheet",PROGRAM_SPECIFIC_MODAL_WIDTH:475,PROGRAM_SPECIFIC_SHEET_DEFAULT_HEIGHT:400,GLOW_DESTINATION_TYPE_ID:"#glowDestinationType",CONDO_DIV_ID:"#Condo",NO_PAGE_TYPE:"NoPageType",WEBLAB_TREATMENTS:{C:"C",T1:"T1",T2:"T2"},PROGRAM_SPECIFIC_SHEET_ENABLED_PAGES:{A21TJRUUN4KGV:d,A2XZLSVIQ0F4JT:d,A1RKKUPIHCS9HS:b,AJZF8LZ1EJVJN:b,APJ6JRA9NG5V4:h,A3HOBANJMCMD83:h,A13V1IB3VIYZZH:{monoprix:a,casino:a},A1F83G8C2ARO7P:{amazonfresh:a,
morrisons:a,"co-op":a,iceland:a},A1PA6795UKMFR9:{amazonfresh:a,tegut:a},A1VC38T7YXB528:{amazonfresh:a,seijoishii:a,valor:a,life:a},A19VAU5U5O7RUS:c,A1DQ6JV7I20JSG:c,ATVPDKIKX0DER:{amazonfresh:a,wholefoods:a}},PROGRAM_SPECIFIC_SHEET_ENABLED_PAGE_TYPES_BASED_ON_URL:["storefront","dp","gp/product"],GLOW_NOT_SET_LOCATION_TYPES:["IP2LOCATION","REALM_DEFAULT","COUNTRY"],GET_LOCATION_LABEL_ENDPOINT:"/portal-migration/hz/glow/get-location-label",PROGRAM_SPECIFIC_SHEET_LOCAL_STORAGE_KEY:"programSpecificSheetGenerationTime",
PROGRAM_SPECIFIC_SHEET_TTL:2592E6,CURRENT_TIME:(new Date).getTime(),SKIP_ID:"GLUXProgramSpecificSheetSkipLink",DEVICE_TYPE:{DESKTOP:"desktop",WEBVIEW:"webview",APP:"mobile"},PROGRAM_SPECIFIC_ACTION_SOURCE:{DESKTOP:"desktop-programspecific-modal",WEBVIEW:"mweb-programspecific-bottomsheet",APP:"mobile-app-programspecific-bottomsheet"},GLOW_ACTION_SOURCE:"glow",GET_REQUEST_TYPE:"GET",ADDRESS_SELECTIONS_VIEW_MODEL_ENDPOINT:"/portal-migration/hz/glow/get-address-selections-view-model",UNREC_ALM_BOTTOM_SHEET_WEBLAB:"UNREC_BOTTOM_SHEET_ALM_516161",
PROGRAM_SPECIFIC_SHEET_OPEN_METRICS:"f3glowassets.programspecificsheet.open",PROGRAM_SPECIFIC_SHEET_SKIP_METRICS:"f3glowassets.programspecificsheet.skip",ADDRESS_SELECTION_AJAX_CALL_FAILED_METRICS:"f3glowassets.programspecificsheet.addressselectionscall.failed",PROGRAM_SPECIFIC_MODAL_CLOSE_EVENT:"a:popover:afterHide:program_specific_modal",PROGRAM_SPECIFIC_SHEET_CLOSE_EVENT:"a:sheet:afterHide:program_specific_bottom_sheet",PROGRAM_SPECIFIC_SHEET_AFTER_OPEN_EVENT:"a:sheet:afterShow:program_specific_bottom_sheet"}});
"use strict";e.when("A","mash","f3-glow-constants").execute(function(a,d,b){function h(b){var a=!1;e.now(b).execute(function(b){a=!!b});return a}d.addEventListener(b.STORE_CONTEXT_EVENT,function(b){h("store-context")||e.register("store-context",function(){return{getStoreContext:function(){return b.detail.storeContext}}})});d.dispatchEvent({type:b.WAITING_FOR_STORE_CONTEXT_EVENT})});"use strict";e.when("f3-glow-common-utils","f3-glow-program-specific-sheet-utils","f3-glow-program-specific-sheet-renderer").execute("f3-glow-program-specific-sheet-manager",
function(a,d,b){a.getStoreContext(b.DEVICE_TYPE).then(function(a){a&&d.shouldRender(a).then(function(c){c&&b.renderSheet(a)})})});"use strict";e.when("A").register("f3-glow-address-selections-constants",function(a){return{REQUEST_TYPE:"GET",ENDPOINT:"/portal-migration/hz/glow/get-rendered-address-selections"}});"use strict";e.when("3p-promise","f3-glow-constants","f3-glow-window-utils").register("f3-glow-common-utils",function(a,d,b){return{getPageType:function(){return b.ue_pty?b.ue_pty:d.NO_PAGE_TYPE},
getStoreContext:function(b){return new a(function(a){switch(b){case d.DEVICE_TYPE.DESKTOP:e.when("packardGlowStoreName").execute(function(b){a(b)});break;case d.DEVICE_TYPE.WEBVIEW:e.when("glowMobileStoreName").execute(function(b){a(b)});break;case d.DEVICE_TYPE.APP:e.when("store-context").execute(function(b){a(b.getStoreContext())});e.when("f3-glow-url-utils").execute(function(b){a(d.MAP_BRAND_ID_TO_ALIAS[b.getUrlParameter(d.ALM_BRAND_ID)])});break;default:e.log("Invalid device type: "+b,"ERROR",
"F3GLOWAssets"),a(null)}})},logEvent:function(a){b.ue&&b.ue.count(a,(b.ue.count(a)||0)+1)}}});"use strict";e.when("A","a-modal","f3-glow-constants").register("f3-glow-utils",function(a,d,b){return{openGlowToActiveTab:function(h){var c=a.$(b.GLOW_CLASS_NAME),f=d.get(c);if(null===f||0===c.length)e.log("Unable to get GLOW on Desktop","ERROR","F3GLOWAssets");else try{var n=f.attributes.url;f.attributes.url+="\x26"+b.ACTIVE_TAB+"\x3d"+h;f.show();f.attributes.url=n}catch(k){e.log("Unable to open GLOW on Desktop: "+
k,"ERROR","F3GLOWAssets")}}}});"use strict";e.when("A","a-modal","f3-glow-address-selections-constants","f3-glow-common-utils","f3-glow-constants","f3-glow-program-specific-sheet-utils","f3-glow-window-utils").register("f3-glow-program-specific-sheet-renderer",function(a,d,b,e,c,f,n){return{DEVICE_TYPE:c.DEVICE_TYPE.DESKTOP,renderSheet:function(k){f.getResponse(b.ENDPOINT,b.REQUEST_TYPE,c.DEVICE_TYPE.DESKTOP,k,c.PROGRAM_SPECIFIC_ACTION_SOURCE.DESKTOP).then(function(b){var a=f.getWeblabTreatment(b,
c.UNREC_ALM_BOTTOM_SHEET_WEBLAB);!b||a!==c.WEBLAB_TREATMENTS.T1&&a!==c.WEBLAB_TREATMENTS.T2?a===c.WEBLAB_TREATMENTS.C&&f.storeSheetGenerationTime():(b={name:c.PROGRAM_SPECIFIC_MODAL_NAME,inlineContent:b,hideHeader:!0,width:c.PROGRAM_SPECIFIC_MODAL_WIDTH,closeButton:!1},d.create(document.createElement("span"),b).show(),f.storeSheetGenerationTime(),e.logEvent(c.PROGRAM_SPECIFIC_SHEET_OPEN_METRICS+":"+c.DEVICE_TYPE.DESKTOP))});a.declarative(c.SKIP_ID,"click touchend",function(){d.get(c.PROGRAM_SPECIFIC_MODAL_NAME).hide();
e.logEvent(c.PROGRAM_SPECIFIC_SHEET_SKIP_METRICS+":"+c.DEVICE_TYPE.DESKTOP)});a.on(c.PROGRAM_SPECIFIC_MODAL_CLOSE_EVENT,function(){n.refresh()})}}});"use strict";e.when("A","3p-promise","f3-glow-constants","f3-glow-common-utils","f3-glow-window-utils").register("f3-glow-program-specific-sheet-utils",function(a,d,b,g,c){var f=function(a,d){return d!==b.NO_PAGE_TYPE?a.includes(d):c.location.href?b.PROGRAM_SPECIFIC_SHEET_ENABLED_PAGE_TYPES_BASED_ON_URL.some(function(b){return c.location.href.includes(b)}):
!1};return{getResponse:function(c,f,l,h,p){return new d(function(d){a.ajax(c,{method:f,params:{deviceType:l,pageType:g.getPageType(),storeContext:h,actionSource:p,showProgramSpecificSheet:!0},headers:{"anti-csrftoken-a2z":a.$("#glowValidationToken").val()||""},success:function(b){d(b)},error:function(a){e.log("Unable to get response from "+c+" : "+a,"ERROR","F3GLOWAssets");g.logEvent(b.ADDRESS_SELECTION_AJAX_CALL_FAILED_METRICS+":"+l);d(null)}})})},getWeblabTreatment:function(a,c){if(a&&-1===a.indexOf(b.WEBLAB_MAP_KEY)&&
-1===a.indexOf(c))return null;var d=a.indexOf(b.WEBLAB_MAP_KEY)+b.WEBLAB_MAP_KEY.length,f=a.substring(d).indexOf(b.CLOSING_BRACES);try{return JSON.parse(a.substring(d+3,d+f+1))[c]}catch(p){return e.log("Failed to fetch the "+c+" weblab treatment : "+a,"ERROR","F3GLOWAssets"),null}},shouldRender:function(h){var k=b.PROGRAM_SPECIFIC_SHEET_ENABLED_PAGES[c.ue_mid];return new d(function(d){if(k&&k[h]&&f(k[h],g.getPageType()))if(c.isLocalStorageEnabled())if(b.CURRENT_TIME-c.localStorage.getItem(b.PROGRAM_SPECIFIC_SHEET_LOCAL_STORAGE_KEY)<
b.PROGRAM_SPECIFIC_SHEET_TTL)d(!1);else if(!a.capabilities.isAmazonApp&&a.$(b.GLOW_DESTINATION_TYPE_ID).length){var l=a.$(b.GLOW_DESTINATION_TYPE_ID).val()||"";d(b.GLOW_NOT_SET_LOCATION_TYPES.includes(l))}else a.get(b.GET_LOCATION_LABEL_ENDPOINT,{path:b.GET_LOCATION_LABEL_ENDPOINT,success:function(a){a.customerIntent?d(b.GLOW_NOT_SET_LOCATION_TYPES.includes(a.customerIntent.locationType)):(e.log("LocationType is not present","ERROR","F3GLOWAssets"),d(!1))},error:function(a){e.log("Unable to get response from get-location-label: "+
a,"ERROR","F3GLOWAssets");d(!1)}});else d(!1);else d(!1)})},storeSheetGenerationTime:function(){c.isLocalStorageEnabled()&&c.localStorage.setItem(b.PROGRAM_SPECIFIC_SHEET_LOCAL_STORAGE_KEY,b.CURRENT_TIME)}}});"use strict";e.when("A","f3-glow-window-utils").register("f3-glow-url-utils",function(a,d){return{getUrlParameter:function(a){a=(new RegExp("[?\x26]"+a+"\x3d([^\x26#]*)")).exec(d.location.href);return null===a?null:decodeURI(a[1])||0},getUrlWithoutParameters:function(){for(var a=arguments.length,
e=Array(a),c=0;c<a;c++)e[c]=arguments[c];return e.reduce(function(a,b){var d=a.split("?")[0];a=-1!==a.indexOf("?")?a.split("?")[1]:"";if(""!==a){var c=a.split("\x26");for(var e=c.length-1;0<=e;--e)a=c[e].split("\x3d")[0],a===b&&c.splice(e,1);d=d+"?"+c.join("\x26")}return d},d.location.href)}}});"use strict";e.when("A").register("f3-glow-window-utils",function(){var a=function(){try{var a=g.localStorage;a.setItem("__storage_test__","__storage_test__");a.removeItem("__storage_test__");return!0}catch(b){return e.log("Unable to access localStorage",
"WARN","F3GLOWAssets"),!1}};return{ue_pty:g.ue_pty,ue_mid:g.ue_mid,location:{href:g.location.href},lang:function(){if(g.top&&g.top.document&&g.top.document.documentElement)return g.top.document.documentElement.lang},ue:{count:g.ue.count},isLocalStorageEnabled:a,localStorage:a()?g.localStorage:null,refresh:function(){g.location.reload()}}})});
/* ******** */
(function(b){var c=window.AmazonUIPageJS||window.P,f=c._namespace||c.attributeErrors,a=f?f("DetailPageICartAssets",""):c;a.guardFatal?a.guardFatal(b)(a,window):a.execute(function(){b(a,window)})})(function(b,c,f){b.when("A","uss-eligibility","atf").register("uss-bmsm-eligibility",function(a,b){a=a.$;if((a=a("#bmsm-uss-widget-container"))&&a.length){var g=a.attr("data-merchant-id"),d=a.attr("data-fulfillment-manager-id"),e=a.attr("data-sku"),c=a.attr("data-price");a=a.attr("data-is-customer-prime");
g={merchantId:g,fulfillmentManagerId:d,sku:e,price:c,isCustomerPrime:a}}(a=g)&&b.registerProgramEligibility("BMSM",a)});"use strict";"use strict";b.when("A").register("bmsm-kvp-utils",function(a){var b=a.$;return{updateBMSMKVPByFormId:function(a){a=b("#"+a);if(1<a.find("input[name\x3dcustom-name\\.1\\.1]").length&&0<a.find("input[name\x3dcustom-name\\.1\\.1][value\x3dincentivizedCart]").length){var d=0;a.find("input[name^\x3d'custom-name\\.1\\.']").each(function(a,b){a=Number(b.name.split(".")[2]);
!isNaN(a)&&0<a&&(d=a>d?a:d)});if(0<d){var e=parseInt(d)+1,c="custom-name.1."+e,e="custom-value.1."+e;a.find("input[name\x3dcustom-name\\.1\\.1][value\x3dincentivizedCart]").attr("id",c).attr("name",c);a.find("input[name\x3dcustom-value\\.1\\.1][class\x3dbmsmKVP]").attr("id",e).attr("name",e)}}}}});"use strict"});
/* ******** */
(function(e){var g=window.AmazonUIPageJS||window.P,h=g._namespace||g.attributeErrors,l=h?h("AllOffersDisplayIngressAssets",""):g;l.guardFatal?l.guardFatal(e)(l,window):l.execute(function(){e(l,window)})})(function(e,g,h){e.execute("all-offers-display-ingress-init",function(){var l=g.uet,n=g.uex;"function"===typeof l&&l("bb","aod-ingress-assets-load-time",{wb:1});e.when("A","jQuery","all_offers_display_ingress_utils","all-offers-display-register-state","all_offers_display_ingress_csm_counters").execute("all_offers_display_ingress_load_AOD_assets",
function(b,a,c,f,d){function k(c){e.now().execute(function(a){a!==h||f.isMarkerOverrideRegistered()||("function"===typeof p&&p("bb","aod-main-assets-injection",{wb:1}),e.register("aodIngressClick"),e.register("aodDeclarativeEvent",function(){return c}),f.setMarkerOverrideTriggered())})}var p=g.uet;b.state("aod:assetsLoaded",{isAodAssetsLoaded:!0});d.triggerUnitCounter("aodIngressAssetsLoadCtr");b.declarative("show-all-offers-display","click",function(a){a.$event.preventDefault();a.$event.stopPropagation();
a&&a.data&&a.data.ingressName&&d.incrementAndTriggerCounter(a.data.ingressName+"LoadAod");!b.state("aod:assets2Loaded")&&c.isClickOnAODIngressSupported(a)&&(k(a),e.when("aod-load-event-handler","aodDeclarativeEvent").execute(function(a,c){c&&c.data&&(c.data.pc="dp");a.renderAodAction(c)}))});b.declarative("s-show-all-offers-display","click",function(a){a.$event.preventDefault();a.$event.stopPropagation();!b.state("aod:assets2Loaded")&&c.isClickOnAODIngressSupported(a)&&(k(a),e.when("search-all-offers-display-util",
"aodDeclarativeEvent").execute(function(a,c){a.searchOnClickHandler(c)}))});b.declarative("all-offers-display-show-from-morpheus","click",function(a){a.$event.preventDefault();a.$event.stopPropagation();!b.state("aod:assets2Loaded")&&c.isClickOnAODIngressSupported(a)&&(k(a),e.when("all-offers-display-morpheus-util","aodDeclarativeEvent").execute(function(a,c){a.openAODFromMorpheus(c)}))})});e.when("A","jQuery","all-offers-display-register-state","all_offers_display_ingress_csm_counters").execute("all-offers-display-enable-compare",
function(b,a,c,f){var d=g.uet;b.state("aod:assets2Loaded")||(b=g.location.href.split("?"),1<b.length&&(b=b[1].toLowerCase().split(/[&,#]/))&&-1!==b.indexOf("aod\x3d1")&&e.now().execute(function(a){a===h&&(c.isMarkerOverrideRegistered()?f.incrementAndTriggerCounter("aodAutoLoadMarkerOverrideSetCtr"):(f.triggerUnitCounter("aodAutoLoadAssetsRequestedCtr"),"function"===typeof d&&d("bb","aod-main-assets-injection-auto-load",{wb:1}),e.register("aodIngressClick"),c.setMarkerOverrideTriggered()))}))});e.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}}});e.register("all_offers_display_ingress_csm_counters",function(){var b=g.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)}}});e.when("all_offers_display_ingress_csm_counters").register("all_offers_display_ingress_aod_supported",
function(b){return{isPropertySupported:function(a,c,f){var d=typeof a[c]===f;if(!d){var k={};a.tagName&&(k.tagName=a.tagName);a.getAttribute&&"function"===typeof a.getAttribute&&(a.getAttribute("id")&&(k.id=a.getAttribute("id")),a.getAttribute("class")&&(k.class=a.getAttribute("class")),a.getAttribute("href")&&(k.href=a.getAttribute("href")));a="aodPropertyUnsupportedMessage, element: "+JSON.stringify(k);e.log(a+(", propertyName: "+c+", propertyType: "+f),"WARN","aodPropertyUnsupportedMessage");b.triggerUnitCounter("aodPropertyUnsupportedMessage")}return d}}});
e.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}}});e.when().register("all-offers-display-register-state",function(){var b=!1;return{isMarkerOverrideRegistered:function(){return b},
setMarkerOverrideTriggered:function(){b=!0}}});"use strict";e.when("A","mbc_constants","all_offers_display_ingress_csm_counters").register("mbc_atc_cart_api_ajax_controller",function(b,a,c){var f=h,d;return{mbcAtcAjaxCall:function(d){f?c.incrementAndTriggerCounter(a.MBC_ATC_CLICK_CANCELLED_CSM_METRIC):f=b.$.ajax({url:d.url,type:d.type,data:d.data,cache:!1,headers:d.headers,xhrFields:d.xhrFields,success:d.successHandler,error:d.errorHandler,timeout:d.timeout||1E4})},updateCartCount:function(b){e.when("EWC").execute(function(a){d=
a});d!==h&&"function"===typeof d.refresh?(d.refresh(),c.triggerUnitCounter(a.MBC_EWC_REFRESH_API_CSM_METRIC_SCOPE_NAME)):(e.when("nav.setCartCount").execute(function(a){a(b)}),c.triggerUnitCounter(a.MBC_NAV_API_CSM_METRIC_SCOPE_NAME))},resetAjaxHandler:function(){f=h}}});"use strict";e.when("A","mbc_constants","mbc_cart_api_handler").execute("mbc_atc_action_handler",function(b,a,c){b.declarative("mbc-atc-action",a.MBC_WIDGET_TRIGGER_EVENTS,function(a){c.addToCart(a.data,!0)})});"use strict";e.when("A",
"jQuery","mbc_constants","all_offers_display_ingress_csm_counters","mbc_atc_cart_api_ajax_controller").register("mbc_cart_api_handler",function(b,a,c,e,d){function f(b){e.triggerUnitCounter(c.MBC_CART_API_ATC_CSM_FAILURE_METRIC_SCOPE_NAME);var d=b.offerIndex;a(c.MBC_OFFER_ADDED_TO_CART+d).addClass(c.AUI_HIDE_ELEMENT_CSS_NAME);a(c.MBC_OFFER_NOT_ADDED_TO_CART+d).removeClass(c.AUI_HIDE_ELEMENT_CSS_NAME);g(b.offerIndex)}function g(b){a(c.MBC_OFFER_VIEW_CART_BUTTON+b).removeClass(c.AUI_HIDE_ELEMENT_CSS_NAME);
a(c.MBC_OFFER_ATC_BUTTON_ID+b).addClass(c.AUI_HIDE_ELEMENT_CSS_NAME)}return{addToCart:function(b,k){var h=a(c.MBC_ATC_AJAX_ENDPOINT).val(),l=a(c.MBC_ATC_CSRF_TOKEN).val(),n=a(c.MBC_LANGUAGE_HEADER).val(),p={items:[{asin:b.asin,offerListingId:b.oid,quantity:b.minQty}]},q=document.querySelector('meta[name\x3d"encrypted-slate-token"]');h={url:"https://"+h+"?ref\x3d"+b.refTag+"\x26sr\x3d"+b.sr+"\x26qid\x3d"+b.qid,type:"POST",data:JSON.stringify(p),headers:{"Accept-Language":n,Accept:c.MBC_ATC_CART_API_HEADER_ACCEPT,
"x-api-csrf-token":l,"Content-Type":c.MBC_ATC_CART_API_HEADER_CONTENT_TYPE,"x-amzn-encrypted-slate-token":q&&q.content?q.content:""},xhrFields:{withCredentials:!0},timeout:1E4,successHandler:function(m){m&&m.entity&&m.entity.items&&m.entity.items[0]&&0<m.entity.items[0].quantity?(m.entity.count&&m.entity.count.entity&&m.entity.count.entity.items?d.updateCartCount(m.entity.count.entity.items):(e.triggerUnitCounter(c.MBC_CART_API_SUCCESS_COUNT_FAILURE_CSM_METRIC),d.updateCartCount(m.entity.items[0].quantity)),
e.triggerUnitCounter(c.MBC_CART_API_ATC_CSM_SUCCESS_METRIC_SCOPE_NAME),k&&a(c.MBC_OFFER_ADDED_TO_CART+b.offerIndex).removeClass(c.AUI_HIDE_ELEMENT_CSS_NAME),g(b.offerIndex)):f(b);d.resetAjaxHandler()},errorHandler:function(a){422===a.status&&(a=JSON.parse(a.responseText))&&a.entity&&a.entity.items&&a.entity.items[0]&&(a.entity.count&&a.entity.count.entity&&a.entity.count.entity.items?d.updateCartCount(a.entity.count.entity.items):(e.triggerUnitCounter(c.MBC_CART_API_ERROR_COUNT_FAILURE_CSM_METRIC),
d.updateCartCount(a.entity.items[0].quantity)));f(b);d.resetAjaxHandler()}};d.mbcAtcAjaxCall(h)}}});e.register("mbc_constants",function(){return{MBC_ATC_AJAX_ENDPOINT:"#mbc-atc-ajax-endpoint",MBC_ATC_CSRF_TOKEN:"#mbc-atc-csrf-token",MBC_LANGUAGE_HEADER:"#mbc-language",MBC_OFFER_ADDED_TO_CART:"#mbc-offer-added-to-cart-",MBC_OFFER_NOT_ADDED_TO_CART:"#mbc-offer-not-added-to-cart-",MBC_OFFER_VIEW_CART_BUTTON:"#mbc-offer-view-cart-",MBC_OFFER_ATC_BUTTON_ID:"#mbc-buybutton-addtocart-",MBC_ATC_CLICK_CANCELLED_CSM_METRIC:"mbc-atc-click-cancelled",
MBC_ATC_CART_API_HEADER_ACCEPT:'application/vnd.com.amazon.api+json; type\x3d"cart.add-items/v1"',MBC_ATC_CART_API_HEADER_CONTENT_TYPE:'application/vnd.com.amazon.api+json; type\x3d"cart.add-items.request/v1"',MBC_NAV_API_CSM_METRIC_SCOPE_NAME:"mbc-nav-api-called",MBC_EWC_REFRESH_API_CSM_METRIC_SCOPE_NAME:"mbc-ewc-refresh-api-called",MBC_CART_API_SUCCESS_COUNT_FAILURE_CSM_METRIC:"mbc-cart-api-success-response-count-failure",MBC_CART_API_ERROR_COUNT_FAILURE_CSM_METRIC:"mbc-cart-api-error-response-count-failure",
MBC_CART_API_ATC_CSM_SUCCESS_METRIC_SCOPE_NAME:"mbc-cart-api-atc-success",MBC_CART_API_ATC_CSM_FAILURE_METRIC_SCOPE_NAME:"mbc-cart-api-atc-failure",MBC_WIDGET_TRIGGER_EVENTS:"click",AUI_HIDE_ELEMENT_CSS_NAME:"aok-hidden"}});"function"===typeof n&&n("ld","aod-ingress-assets-load-time",{wb:1})})});
/* ******** */
(function(l){var m=window.AmazonUIPageJS||window.P,h=m._namespace||m.attributeErrors,g=h?h("DetailPageTwisterPlusSubAssets@utils","DetailPageTwisterPlusSubAssets"):m;g.guardFatal?g.guardFatal(l)(g,window):g.execute(function(){l(g,window)})})(function(l,m,h){"use strict";l.when("A").register("twister-plus-constants",function(g){return{ASIN:"asin",PRICE:"price",SAVINGS:"savings",TOTAL_PRICE:"totalPrice",YOU_SAVE:"youSave",CASHBACK:"cashback",PRICE_UNIT:"priceUnit",OFFER_LISTING_ID:"offerListingId",
QUANTITY:"quantity",TWISTER_REFRESH_EVENT:"twister-refresh",CC_SELECTION_UPDATE_EVENT:"cc-selection-update",TWISTER_PLUS_FRAMEWORK:"TwisterPlusFramework",UNKNOWN:"UNKNOWN",DEVICE_TYPE_WEB:"web",DEFAULT_BUYING_OPTION_POSITION:0,SPACE:" ",OPENING_BRACKET:"(",CLOSING_BRACKET:")",TP_AFTER_BUYBOX_UPDATE_EVENT:"twisterPlus:selection:afterBuyBox:update",ATTRIBUTION:"Website/ DetailPage/ TwisterPlus",DEFAULT_WEB_GROUP_NAME:"desktop_buybox_group_1",DEFAULT_MOBILE_WEB_GROUP_NAME:"mobile_buybox_group_1",DEFAULT_MOBILE_APP_GROUP_NAME:"mobileapp_buybox_group_1",
registrationMap:{CALLBACKS:"callbacks",FEATURE_ATTRIBUTION:"featureAttribution",IS_MULTI_SELECTION:"isMultiSelection",UPDATE_QTY_AS_BASE_ITEM:"updateQtyAsBaseItem",INCLUDE_SAVINGS_CALCULATION_IN_SUBTOTAL:"includeSavingsCalculationInSubtotal",DISPLAY_SAVINGS_ROW_IN_BOTTOM_SHEET:"displaySavingsRowInBottomSheet",BASE_ITEM_SAVINGS:"baseItemSavings"},TWISTER_PLUS_VIEW_REGISTRATION:{viewAttribution:"DetailPage",viewName:"MobileTwisterPlusFramework"},ccManager:{FEATURE_NAME:"ccManager",ACTIVE_CARDS:"twisterPlusActiveCards",
FEATURE_ATTRIBUTION:"Website/ DetailPage/ TwisterPlus",UNSUPPORTED_BUYING_OPTION_LIST:["ALM","SNS","UNKNOWN"]},itemAssociation:{KEY_BUYBACK:"buyback",CUSTOM_NAME_STRING:"custom-name",CUSTOM_VALUE_STRING:"custom-value",CUSTOM_DATA_KEY:"customData",INPUT_TYPE_HIDDEN:"hidden",ENCODED_ITEM_ASSOC_VAL:"encodedItemAssocVal",ITEM_ASSOCIATION_GROUP_KEY:"ItemAssociationGroupKey",ITEM_ASSOCIATION_GROUP_VAL:"itemAssociationGroup",ASIN_KEY:"asin",QUANTITY_KEY:"quantity",OFFERING_ID_KEY:"offeringID",OFFER_LISTING_ID_KEY:"offerListingId",
FORM_DATA_ASIN_KEY:"a",FORM_DATA_OID_KEY:"oid",FIRST_INDEX:".1",DEVICE_TYPE_MOBILE_WEB:"mWeb",DEVICE_TYPE_MOBILE_APP:"mApp",IS_BUYBACK_INPUT_FLAG:"isBuyBack",IS_BUYBACK_INPUT_FLAG_VALUE:"1",PIPE_SEPARATOR:"|",FEATURE_NAME_KEY:"featureName",BASE_ASIN_INDEX:1,BASE_ASIN_INDEX_FOR_NATC:0,BASE_ASIN_ITEM_TYPE:"base",ITEMS_PREFIX:"items",PARAM_NAMES:{ASIN:["asin"],QUANTITY:["quantity"],OFFER_LISTING_ID:["offerListingId"],ITEM_ASSOCIATION:["additionalParameters","itemAssociation"],ASSOCIATED_ITEM_ID:["associatedItemId"],
DELETE_CONSTRAINT:["deleteConstraint","mutuallyInclusive"],PROGRAM_TYPE:["programType"],RENDER_TYPE:["renderType"],ACCESSORY_TYPE:["properties","accessoryType"],CUSTOMER_APPOINTMENT_TYPE:["properties","customerAppointmentType"],paymentOfferInfo:["additionalParameters","paymentOfferInfo"],inHouseInstallments:["additionalParameters","installments","programId"],buybackOfferSelectionKey:["additionalParameters","buybackOfferSelectionKey"],wirelessPromotionId:["additionalParameters","wirelessPromotionId"]},
OPENING_SQUARE_BRACKET:"[",CLOSING_SQUARE_BRACKET:"]"},htmlTags:{INPUT:"input",FIELDSET:"fieldset"},selectors:{DECLARATIVE_CLASS:".a-declarative",BUYBOX_ACCORDION:"#buybox .a-accordion",BUYBOX_ACCORDION_ACTIVE:"#buybox .a-accordion-active",BUYBOX:"#buybox",ACTIVE_ACCORDION:".a-accordion-active",ACCORDION:".a-accordion",TAB_PREFIX:"#tab_",BUYBOX_TAB_ACTIVE:"#buybox .a-tab-heading.a-active",NO_TABS_GROUP_DESKTOP:"#buybox div:first-child",NO_TABS_GROUP_MOBILE:"#buybox div:first-child div:first-child",
TAB_GROUP_NAME:"data-csa-c-content-id",OFFER_DISPLAY_GROUP:"#offerDisplayGroup",MOBILEAPP_TABS_ELEMENT_ID:"[id^\x3dtab_mobileapp_buybox_group]",MOBILEAPP_ACCORDION_OR_SINGLEOFFER_ELEMENT_ID:".accordion-row, [id^\x3dgsod_singleOfferDisplay]",BUYNOW_ELEMENT_ID:"form#buyNow, form#buyNowCheckout",BUYNOW_CHECKOUT_ELEMENT_ID:"#buyNowCheckout",BUYNOW_BUTTON_ID:"#buy-now-button",ADD_TO_CART_BUTTON_ID:"#add-to-cart-button, #installments-button, #add-to-cart-button-ubb-mobile, #pickup-add-to-cart-button",ADD_TO_CART_ELEMENT_ID:"#addToCart, #mobile-installments",
ITEM_ASSOCIATION_INPUTS_CLASS:".itemAssocInputs",ITEM_ASSOCIATION_INPUTS_CLASS_NAME:"itemAssocInputs",DATA_ATTRIBUTE_ACTION:"action",PPD_RIGHT_COL_ID:"#rightCol",BUYING_OPTIONS_PRICE_DATA_CLASS:".twister-plus-buying-options-price-data",ACCORDION_ROW_CLASS:".accordion-row"},ccFeatures:{PAYMENT_OPTIONS_FEATURE:"paymentOptions",PAYMENT_OPTIONS_BUY_NOW_CART_TYPE:"BUY_NOW",PAYMENT_OPTIONS_ATC_CART_TYPE:"ADD_TO_CART",WIRELESS_PROMOTIONS_FEATURE:"wirelessPromotions",CART_TYPE:"cartType",IS_BUYBACK_KEY:"isBuyBackKey",
IS_BUYBACK_FEE:"isBuyBackFee",BUY_NOW_DATA:"buynowData",COUPONS_FEATURE:"couponsCard",PAYMENT_OFFER_INPUT_NAME:"paymentOfferInfo"},bottomSheet:{FEATURE_NAME:"bottomSheet",EVENT_NAME:"cc-selection-update",FEATURE_ATTRIBUTION:"Website/ DetailPage/ TwisterPlus",BOTTOM_SHEET_NAME:"twisterPlusBottomSheet",RESIZE_DURATION:.3,BOTTOM_SPACING:21,ITEM_COUNT_SINGULAR_TEMPLATE:"item-count-singular-template",ITEM_COUNT_PLURAL_TEMPLATE:"item-count-plural-template",ITEM_COUNT_PLACEHOLDER:"###itemQuantity",DEFAULT_DISCOUNT_STRING:"default-discount-string",
MONTHLY_PAYMENTS_FOOTNOTE_TEMPLATE:"monthly-payment-footnote-template"},unavailableMessage:{ACTIVE_ACCORDION:".a-accordion-active",CLASS:".",DISPLAYABLE_MESSAGE:"tp-bbm-info-message-displayable",HIDDEN:"aok-hidden",MESSAGE_ITEM:"twister-plus-unavailable-message-item",MULTIPLE:".tp-bbm-info-message-container",SINGLE:".tp-bbm-info-message-with-card-name-container",TEMPLATE:"twister-plus-unavailable-message-item-template",QUANTITY_RESTRICTION:".tp-bbm-info-message-quantity-restriction-container",BUYBOX_ACCORDION_ROWS:"#buyBoxAccordion"},
sideSheet:{FEATURE_NAME:"sideSheet",EVENT_NAME:"cc-selection-update",FEATURE_ATTRIBUTION:"Website/ DetailPage/ TwisterPlus",RESIZE_DURATION:300,SYMBOL_HASH:"#",DISPLAY:"display",INLINE:"inline",CAROUSEL_CONTAINER_CLASS:".a-carousel-container",CAROUSEL_CONTAINER_CLASS_NAME:"a-carousel-container",CAROUSEL_INITIALIZED_CLASS_NAME:"a-carousel-initialized",CAROUSEL_NOT_INITIALIZED_CLASS_NAME:"a-carousel-static",SIDE_SHEET_AJAX_SUCCESS:"twister-plus:side-sheet:ajax:success"},ccCardsRefresh:{SINGLE_CARD_INVALID:"single-card-invalid-message",
SINGLE_SELECTION_INVALID:"single-selection-invalid-message",SINGLE_DETAILS_UPDATE:"single-details-update-message",MULTIPLE_DETAILS_UPDATE_OR_CARD_REFRESH:"multiple-details-update-or-cards-refresh-message",MULTIPLE_CARD_INVALID_OR_SELECTION_INVALID:"multiple-card-invalid-or-selection-invalid-message",CARD_NAME_PLACEHOLDER:"###cardName"},metrics:{CC_CARD_COUNT:"ccCardCount",TWISTER_PLUS_TTI:"TTI",BOTTOM_SHEET_GV:"priceBottomSheetGV",BOTTOM_SHEET_TIMER:"priceBottomSheetTimer",CC_REMOVAL:"ccRemoval",
CC_SELECTION:"ccSelection",PREFIX:"twisterPlus.",FEATURE_NAME:"twisterPlus",TWISTER_PLUS_TWISTER_REFRESH_GV:"twisterPlusTwisterRefreshGV"},toolTip:{FEATURE_NAME:"toolTip",EVENT_NAME:"cc-selection-update",FEATURE_ATTRIBUTION:"Website/ DetailPage/ TwisterPlus",TOOL_TIP_NAME:"twisterPlusPopOver",ITEM_COUNT_SINGULAR_TEMPLATE:"item-count-singular-template",ITEM_COUNT_PLURAL_TEMPLATE:"item-count-plural-template",ITEM_COUNT_PLACEHOLDER:"###itemQuantity",MONTHLY_PAYMENTS_FOOTNOTE_TEMPLATE:"monthly-payment-footnote-template"}}});
"use strict";l.when("A").register("twister-plus-preconditions",function(g){return{isTwisterPlusEligible:function(){return"true"===g.$("#twister-plus-eligible").val()},isCcCardsRendered:function(){return"true"===g.$("#ccCardsRendered").val()}}});"use strict";l.when("A","twister-plus-constants").register("utils",function(g,e){var f=g.$,c={},d=e.selectors;c.isEmpty=function(a){for(var b in a)if(a.hasOwnProperty(b))return!1;return!0};c.capitalizeFirstLetter=function(a){return a.charAt(0).toUpperCase()+
a.slice(1)};c.convertHTMLDataAttributesToKeys=function(a){a=a.split("-");for(var b=a[0],k=1;k<a.length;k++)b+=c.capitalizeFirstLetter(a[k]);return b};c.getBaseItemQuantity=function(a){var b;a=this.getDeviceType();var k,e=c.getActiveGroupName(),g=f(d.BUYBOX_TAB_ACTIVE);k=1===g.length?f(d.TAB_PREFIX+e+" "+d.ACTIVE_ACCORDION):f(d.BUYBOX_ACCORDION_ACTIVE);var h;if("web"===a){if(1===k.length)return f(".a-accordion-active #quantity").val();h=1===g.length?d.TAB_PREFIX+e+" #quantity":"#quantity"}else f("#mobileQuantityDropDown").length&&
(1===k.length?b=f(".a-accordion-active select.mobileQuantityDropDown").val():h=1===g.length?d.TAB_PREFIX+e+" #mobileQuantityDropDown":"#mobileQuantityDropDown");f(h).length&&(b=f(h).val());return b};c.getDeviceType=function(){var a=f("#twister-plus-device-type").val();return"web"===a?"web":"mobile"===a?"mWeb":"mApp"};c.isMbbCheckboxChecked=function(){return 0<f("input[id|\x3dmbb-checkbox-input]").filter(":checked").length};c.isFeatureSelectionPresent=function(a){var b=!1,c;for(c in a)if(0<a[c].length){b=
!0;break}return b};c.isValidNumber=function(a){var b=!1;null===a||isNaN(a)||(b=!0);return b};c.getBuyingOptionPosition=function(a){var b=e.DEFAULT_BUYING_OPTION_POSITION;1===f(d.BUYBOX_TAB_ACTIVE).length?(a===h&&(a=c.getActiveGroupName()),a=f(d.BUYBOX+" "+d.TAB_PREFIX+a+" "+d.ACTIVE_ACCORDION)):a=f(d.BUYBOX_ACCORDION_ACTIVE);a.length&&(b=a.index());return b};c.getBuyingOptionPriceDataMap=function(){var a,b=f(d.BUYING_OPTIONS_PRICE_DATA_CLASS).html();if(b)try{a=JSON.parse(b)}catch(c){l.log("Error ( "+
c+" ) while parsing twister plus price json: "+b,"ERROR",e.TWISTER_PLUS_FRAMEWORK)}return a};c.getActiveGroupName=function(){var a;a=f(d.BUYBOX_TAB_ACTIVE);var b=this.getDeviceType();1!==a.length&&(a="web"===b?f(d.NO_TABS_GROUP_DESKTOP):f(d.NO_TABS_GROUP_MOBILE));a=a.attr(d.TAB_GROUP_NAME);a&&-1!==a.indexOf("_buybox_group")||(b===e.DEVICE_TYPE_WEB?a=e.DEFAULT_WEB_GROUP_NAME:b===e.itemAssociation.DEVICE_TYPE_MOBILE_WEB?a=e.DEFAULT_MOBILE_WEB_GROUP_NAME:b===e.itemAssociation.DEVICE_TYPE_MOBILE_APP&&
(a=e.DEFAULT_MOBILE_APP_GROUP_NAME));return a};c.getBuyingOptionType=function(a,b){b===h&&(b=c.getActiveGroupName());var k,d=c.getBuyingOptionPriceDataMap();d&&(Array.isArray(d)?d&&d[a]&&(k=d[a].buyingOptionType):(b=d[b],b===h&&(b=d[Object.keys(d)[0]]),b!==h&&b[a]!==h&&(k=b[a].buyingOptionType)));return k};c.getAAPIBuyingOptionIndex=function(a,b){b===h&&(b=c.getActiveGroupName());var d,e=c.getBuyingOptionPriceDataMap();e&&(b=e[b],b===h&&(b=e[Object.keys(e)[0]]),b!==h&&b[a]!==h&&(d=b[a].aapiBuyingOptionIndex));
return d};c.getAccordionRowBuyingOptionType=function(a,b){var d;a.length&&(a=a.index(),d=c.getBuyingOptionType(a,b));return d};c.getActiveAccordionRow=function(a,b){if(c.isValidNumber(a)){var k,g=f(d.BUYBOX_TAB_ACTIVE);1===g.length?(b===h&&(b=c.getActiveGroupName()),k=f(d.TAB_PREFIX+b+" "+e.unavailableMessage.BUYBOX_ACCORDION_ROWS)):k=f(e.unavailableMessage.BUYBOX_ACCORDION_ROWS);if(1===k.length)return k.children().eq(a);if(1===g.length)return f(d.TAB_PREFIX+b)}return null};return c});l.when("twister-plus-constants").register("twister-plus-logger-service",
function(g){function e(c,d){if(c!==h&&""!==c)c=g.metrics.PREFIX+c,ue&&ue.count&&(d===h&&(d=(ue.count(c)||0)+1),ue.count(c,d),"undefined"!=typeof m.csa&&(d=ue.count(c),m.csa("Events",{producerId:"dp-rpcx"})("log",{schemaId:"dpRpcx.CSALoggingSchema.5",eventName:c,valueToLog:d},{ent:"all"})));else throw Error("counterKey must be non empty string");}function f(c){if(c!==h&&""!==c)this._timerName=c,this._startTime=0;else throw Error("timerName must be non empty string");}f.prototype={start:function(){this._startTime=
Date.now()},stop:function(){this._startTime&&e(this._timerName,Date.now()-this._startTime)}};return{Timer:f,logCounter:e}});"use strict";l.when("A","twister-plus-logger-service","ready").execute("adaptive-experience-metrics-logger",function(g,e){function f(){var a=c("#twister-plus-card .a-expander-container");return a&&0<a.length&&"twister-plus-expander"===a.data("aExpanderName")?!0:!1}try{var c=g.$;f()&&(e.logCounter("TwisterPlusCollapsed.GV"),g.on("a:expander:twister-plus-expander:toggle:expand",
function(a){e.logCounter("TwisterPlusExpanded.Action")}),g.on("a:expander:twister-plus-expander:toggle:collapse",function(a){e.logCounter("TwisterPlusCollapsed.Action")}));var d=c("#short-title-rendered"),a=c("#title_feature_div"),b=0<a.length?a.height():0;0<b&&(0<d.length&&"true"===d.val()?(e.logCounter("ShortTitle.height",b),e.logCounter("ShortTitle.GV")):(e.logCounter("Title.height",b),e.logCounter("Title.GV")))}catch(k){l.log("Adaptive Experience metric logging failed with error: ( "+k+" )","ERROR",
"TwisterPlusAdaptiveExperience")}});"use strict";l.when("A","dp-time-to-interactive","twister-plus-logger-service","twister-plus-constants","ready","twister-plus-init").register("twister-plus-tti-logger",function(g,e,f,c){function d(){var a=c.metrics,b=e.getTimeToInteractivity({twisterPlus:{name:"twisterPlus"}});if(b&&b.interactiveTime){var d=m.performance;"object"===typeof d&&"object"===typeof d.timing&&f.logCounter(a.TWISTER_PLUS_TTI,b.interactiveTime-d.timing.navigationStart)}}d();return{logTTI:d}})});
/* ******** */
(function(h){var C=window.AmazonUIPageJS||window.P,g=C._namespace||C.attributeErrors,c=g?g("DetailPageTwisterPlusSubAssets@twisterPlusFramework","DetailPageTwisterPlusSubAssets"):C;c.guardFatal?c.guardFatal(h)(c,window):c.execute(function(){h(c,window)})})(function(h,C,g){"use strict";h.when("A").register("turbo-checkout-handler",function(c){var d=c.$,g;return{updateInputCheckbox:function(c){var p;c=c.ccFeaturesState;var q=!1;for(p in c)if(0<c[p].length){q=!0;break}p=q;g=d("#twister-plus-checkbox");
c=g.prop("checked");p&&!c?g.prop("checked","true").trigger("change"):!p&&c&&g.click()}}});"use strict";h.when("A","twister-plus-constants").register("twister-plus-feature-registration",function(c,d){var g={},y=[d.TWISTER_REFRESH_EVENT,d.CC_SELECTION_UPDATE_EVENT];(function(){for(var d=0;d<y.length;d++)g[y[d]]=[]})();return{registerFeature:function(d,c,f){var r;r=!0;d.hasOwnProperty("featureName")&&d.hasOwnProperty("featureAttribution")||(r=!1,h.log("Feature Registration does not contain valid featureName or featureAttribution",
"ERROR",d.featureName+": "+d.featureAttribution));r&&(r=!0,-1===y.indexOf(c)&&(h.log("Feature passed invalid event name while registering to Twister+: "+c,"ERROR",d.featureName+": "+d.featureAttribution),r=!1));if(r){r=d.featureName;for(var a=!1,l=0;l<g[c].length;l++)if(g[c][l].featureName===r){a=!0;break}a?h.log("Feature already registered to TwisterPlus for the event: "+c,"ERROR",r):(a={},a.featureName=r,a.featureAttribution=d.featureAttribution,a.callback=f,g[c].push(a))}},callRegisteredFeaturesCallback:function(d){for(var c=
0;c<g[d].length;c++)g[d][c].callback.apply()}}});"use strict";h.when("A","twister-plus-feature-state","twister-plus-feature-registration","twister-plus-constants","priceUpdate","itemAssociation","buy-box-price-update","twister-plus-unavailable-message","turbo-checkout-handler","utils").register("twister-plus-framework",function(c,d,x,y,p,q,f,r,a,l){function u(){var b=l.getBuyingOptionPriceDataMap(),I=e;if(b){var a=w;if(Array.isArray(b))return b[a]===g&&h.log("Buying option data missing for the selected offer at position: "+
JSON.stringify(a),"FATAL",y.TWISTER_PLUS_FRAMEWORK),b[a];var d=b[I];d===g&&(d=b[Object.keys(b)[0]]);if(d===g||d[a]===g)h.log("Buying option data missing for the selected offer at position: "+JSON.stringify(a)+" and groupName: "+JSON.stringify(I),"FATAL",y.TWISTER_PLUS_FRAMEWORK);else return d[a]}}function v(){e=l.getActiveGroupName();w=l.getBuyingOptionPosition(e);D=H();A=K();var b=c.$("#twister-plus-asin");F=b?b.val():g;d.initialize(k())}function t(){E(document).delegate("#quantity","change",function(b){b=
J();G=!0;d.updateTwisterPlusFeatureStateForQuantity(b,z);m();G=!1})}function H(){var b=u();if(b)return{price:b.priceAmount,savings:0,priceUnit:b.currencySymbol};var b=(b=c.$("#twister-plus-price-data-price"))?b.val():g,e=c.$("#twister-plus-price-data-savings"),e=e?e.val():g,a=c.$("#twister-plus-price-data-price-unit"),a=a?a.val():g;return{price:parseFloat(b),savings:parseFloat(e),priceUnit:a}}function K(){var b=u();return b?b.offerListingId:(b=c.$("#twister-plus-offer-listing-id"))?b.val():g}function k(){var b=
B(),a={};a[n.TOTAL_PRICE]=D.price;a[n.YOU_SAVE]=D.savings;return{twisterState:b,priceData:a,currentBuyingOptionPosition:w,currentGroupName:e}}function B(){var b={};b[n.ASIN]=F;b[n.PRICE]=D.price;b[n.SAVINGS]=D.savings;b[n.PRICE_UNIT]=D.priceUnit;b[n.OFFER_LISTING_ID]=A;b[n.QUANTITY]=J();return b}function J(){var b=l.getBaseItemQuantity();b===g&&(b=1);return b}function m(){D=H();A=K();d.setTwisterState(B());var b=d.getTwisterPlusFeaturesState(),I=p.getTotalPriceAndYouSave(b,z);d.updatePriceData(I);
d.updateCurrentBuyingOptionPosition(w);d.updateGroupName(e);f.updatePriceSubtotalFeature(b);r.update(d);l.getBuyingOptionType(w,e)===y.UNKNOWN||G&&!l.isFeatureSelectionPresent(d.getCCFeaturesState())||q.addItemAssociationBundleData(d.getTwisterPlusFeaturesState(),!0);x.callRegisteredFeaturesCallback(n.CC_SELECTION_UPDATE_EVENT);a.updateInputCheckbox(b)}var n=y,D,A,F,E=c.$,z,G=!1,w,e;return{initializeTwisterPlus:function(){v();t()},refreshTwisterPlusData:function(){v();t();x.callRegisteredFeaturesCallback(n.TWISTER_REFRESH_EVENT)},
ccSelectionFetch:function(b){return d.getCCFeaturesState()[b]},ccRemovedSelectionFetch:function(b){return d.getCCRemovedSelections()[b]},ccSelectionUpdate:function(b,e){b=d.updateCCFeatureState(b,e,z);m();return b},ccRemovedSelectionUpdate:function(b,e){b=d.updateCCRemovedSelections(b,e);m();return b},ccSelectionsClear:function(b){b=d.clearCCFeatureSelections(b);m();return b},ccRemovedSelectionsClear:function(b){b=d.clearCCRemovedSelections(b);m();return b},setFeatureRegistrationMap:function(b){z=
b},setCurrentBuyingOptionPosition:function(b){w=b;d.updateCurrentBuyingOptionPosition(b);q.reInitialiseItemCountVal()},setCurrentGroupName:function(b){e=b;d.updateGroupName(b);q.reInitialiseItemCountVal()},getCurrentBuyingOptionPosition:function(){return w},getCurrentGroupName:function(){return e},updateTwisterPlusComponents:function(){m()},getTwisterPlusState:function(){return c.copy(d.getTwisterPlusFeaturesState())},registerFeature:function(b,e,a){try{"function"===typeof a?x.registerFeature(b,e,
a):h.log("Registering function should provide callback as a function","ERROR",b.featureName)}catch(d){C.ueLogError&&C.ueLogError(d,{logLevel:"ERROR",attribution:b.featureName,message:"TwisterPlus Framework: Error caused by the feature: "+b.featureName+" (C/T/I: "+b.featureAttribution+") while registering to TwisterPlus to listen to "+e+" event"+d})}}}});h.when("A","twister-plus-framework","twister-plus-constants","twister-plus-logger-service","utils").register("cc-manager",function(c,d,x,y,p){function q(e){return k[e].hasOwnProperty(m.IS_MULTI_SELECTION)&&
k[e][m.IS_MULTI_SELECTION]}function f(e){var b=n.indexOf(e);if(-1!==b&&b!==n.length-1&&(b=r(b),!(0>b))){var a=B(".cc-card-"+e);e=n[b];var d=k[e]&&k[e].callbacks;setTimeout(function(){a[0]&&B("html, body").animate({scrollTop:a.offset().top},500);d&&d.hasOwnProperty("cardExpand")&&d.cardExpand()},800)}}function r(e){var b=p.getActiveGroupName(),a=p.getBuyingOptionPosition(b),d=p.getBuyingOptionType(a,b),c=B(x.selectors.BUYBOX_TAB_ACTIVE),l=p.getAAPIBuyingOptionIndex(a,b);for(e+=1;e<n.length;e++){var f=
n[e];if((f=k[f]&&k[f].callbacks)&&f.hasOwnProperty("isBuyingOptionUnsupported")){if(!f.isBuyingOptionUnsupported(a,d,1===c.length?b:g,l!==g?l:a))return e}else return e}return-1}function a(e,b){z=d.getTwisterPlusState();b=d.ccSelectionUpdate(e,b);d.ccRemovedSelectionsClear(e);return b}function l(e){z=d.getTwisterPlusState();return d.ccSelectionsClear(e)}function u(e){var b=!0,a=e;n=v();k.hasOwnProperty(e)?-1===n.indexOf(e)&&(b=!1,a=k[e][m.FEATURE_ATTRIBUTION],h.log("CC selection update called for non rendered feature",
"ERROR",a)):(b=!1,h.log("CC selection update called for unregistered feature","ERROR",a));return b}function v(){var e=B("#twister-plus-active-cards"),e=e.length?e.val():"";return(e=e.trim())?e.split(","):[]}function t(e,b){var a={},d;for(d in n){var c=n[d];if(c!==b&&k.hasOwnProperty(c)){var l=k[c];l[m.CALLBACKS].hasOwnProperty("refreshCard")&&(l=l[m.CALLBACKS].refreshCard(e,b),"NO_CHANGE"!==l&&e.ccFeaturesState[c]!==g&&0<e.ccFeaturesState[c].length&&(a[l]===g&&(a[l]=[]),a[l].push(c)))}}e=k[b][m.CALLBACKS];
c=Object.keys(a).length;if(e.hasOwnProperty("ccCardsRefreshNotification")&&0<c){var f;b=B("#tp-cc-cards-refresh-strings");d=!0;if(1===c)if(c=Object.keys(a)[0],a=a[c],1===a.length){switch(c){case "CARD_INVALID":f=b.data(A.SINGLE_CARD_INVALID);break;case "SELECTION_INVALID":f=b.data(A.SINGLE_SELECTION_INVALID);break;case "DETAILS_UPDATE":f=b.data(A.SINGLE_DETAILS_UPDATE),d=!1}f=f.replace(A.CARD_NAME_PLACEHOLDER,a[0])}else switch(c){case "CARD_INVALID":f=b.data(A.MULTIPLE_CARD_INVALID_OR_SELECTION_INVALID);
break;case "SELECTION_INVALID":f=b.data(A.MULTIPLE_CARD_INVALID_OR_SELECTION_INVALID);break;case "DETAILS_UPDATE":f=b.data(A.MULTIPLE_DETAILS_UPDATE_OR_CARD_REFRESH),d=!1}else 1<c&&(f=b.data(A.MULTIPLE_DETAILS_UPDATE_OR_CARD_REFRESH));a=d?B("#tp-cc-cards-refresh-red-notification"):B("#tp-cc-cards-refresh-green-notification");a.find(".a-alert-content").text(f);f=a.html();e.ccCardsRefreshNotification(f)}else 0<c&&h.log("Feature callback ccCardsRefreshNotification() missing for the feature","ERROR",
k[b][m.FEATURE_ATTRIBUTION])}function H(e,b,a){for(var d in n){var c=n[d];if(c!==a&&k.hasOwnProperty(c)){var f=k[c];f[m.CALLBACKS].hasOwnProperty("restorePreviousSelection")&&f[m.CALLBACKS].restorePreviousSelection(e.ccFeaturesState[c],b.ccFeaturesState[c],a)}}}function C(e,b){var a=!1;if(E&&E===e&&z.ccFeaturesState!==g&&z.ccFeaturesState[E]!==g)if("SELECTION_CLEAR_ITEM_DATA"===b)a=0===z.ccFeaturesState[E].length?!0:!1;else{e=z.ccFeaturesState[E];for(var d=b.itemType,c=0;c<e.length;c++){var f=e[c].itemType;
if(f===d&&e[c][f]===b[d]){a=!0;break}}}return a}var k={},B=c.$,J=x.ccManager,m=x.registrationMap,n,D=x.metrics,A=x.ccCardsRefresh,F,E,z,G="",w;return{registerFeature:function(e,b){var a=!0;e.hasOwnProperty("featureName")&&e.hasOwnProperty(m.FEATURE_ATTRIBUTION)||(h.log("Properties missing in feature registration passed","ERROR",e.featureAttribution||e.featureName),a=!1);a&&(a=!0,b.hasOwnProperty("init")&&b.hasOwnProperty("validateInputParams")||(h.log("Functions missing in callbacks passed","ERROR",
e.featureAttribution||e.featureName),a=!1),a&&(a=e.featureName,k[a]={},k[a][m.CALLBACKS]=b,k[a][m.FEATURE_ATTRIBUTION]=e.featureAttribution,k[a][m.IS_MULTI_SELECTION]=e.isMultiSelection,k[a][m.UPDATE_QTY_AS_BASE_ITEM]=e.updateQtyAsBaseItem,k[a][m.BASE_ITEM_SAVINGS]=e.baseItemSavings,k[a][m.DISPLAY_SAVINGS_ROW_IN_BOTTOM_SHEET]=e.displaySavingsRowInBottomSheet,k[a][m.INCLUDE_SAVINGS_CALCULATION_IN_SUBTOTAL]=e.includeSavingsCalculationInSubtotal,b.init()))},ccSelectionUpdate:function(e,b,c){var l=!1;
if(u(e))if(k[e][m.CALLBACKS].validateInputParams(b)){if("T2"===w||"T3"===w)if(f(e),c)return;C(e,b)?(l=a(e,b),H(d.getTwisterPlusState(),z,e)):(E=e,l=a(e,b),t(d.getTwisterPlusState(),e));b=q(e);G===x.DEVICE_TYPE_WEB&&l&&!b&&(b=k[e][m.CALLBACKS],b.hasOwnProperty("cardCollapse")?b.cardCollapse():h.log("Feature callback cardCollapse() missing for the feature","ERROR",k[e][m.FEATURE_ATTRIBUTION]))}else h.log("Validation failed for the passed itemData","ERROR",k[e][m.FEATURE_ATTRIBUTION]);return l},ccRemovedSelectionUpdate:function(a,
b){var c=!1;u(a)&&(k[a][m.CALLBACKS].validateInputParams(b)?c=d.ccRemovedSelectionUpdate(a,b):h.log("Validation failed for the passed itemData","ERROR",k[a][m.FEATURE_ATTRIBUTION]));return c},ccSelectionsClear:function(a,b){var c=!1;u(a)&&(!b||"T2"!==w&&"T3"!==w||f(a),C(a,"SELECTION_CLEAR_ITEM_DATA")?(c=l(a),H(d.getTwisterPlusState(),z,a)):(E=a,c=l(a),t(d.getTwisterPlusState(),a)));return c},ccRemovedSelectionsClear:function(a){var b=!1;u(a)&&(b=d.ccRemovedSelectionsClear(a));return b},getFeatureRegistrationDetails:function(){return k},
init:function(){G=p.getDeviceType();n=v();d.setFeatureRegistrationMap(k);for(var a in n){var b=n[a];k.hasOwnProperty(b)&&k[b][m.CALLBACKS].init()}y.logCounter(D.CC_CARD_COUNT,n.length);if(a=B("[data-wireless-multi-card]").data("wireless-multi-card"))w=a.enhancementTreatment},getRenderedFeaturesList:v,cardExpanded:function(a){var b=u(a),d=F;b&&(c.trigger("twisterPlus-removeCCCardNotification"),d&&d!==a?(F=a,a=k[d][m.CALLBACKS],a.hasOwnProperty("cardCollapse")?"T3"!==w&&a.cardCollapse():h.log("Feature callback cardCollapse() missing for the feature",
"ERROR",k[d][m.FEATURE_ATTRIBUTION])):F=a)},switchBuyingOption:function(a,b){var c=p.getBuyingOptionType(a,b);d.setCurrentBuyingOptionPosition(a);d.setCurrentGroupName(b);var f=B(x.selectors.BUYBOX_TAB_ACTIVE),l=p.getAAPIBuyingOptionIndex(a,b),v;for(v in n){var h=n[v];if(k.hasOwnProperty(h)){var t=k[h];t[m.CALLBACKS].hasOwnProperty("switchBuyingOption")&&t[m.CALLBACKS].switchBuyingOption(a,d.ccSelectionFetch(h),d.ccRemovedSelectionFetch(h),c,1===f.length?b:g,l!==g?l:a,J.UNSUPPORTED_BUYING_OPTION_LIST.includes(c))}}n&&
n.length&&d.updateTwisterPlusComponents()},getFeatureCurrentlyExpanded:function(){return F},isMultiSelectionFeature:q}});"use strict";h.when("A","twister-plus-constants","twister-plus-logger-service","twister-plus-preconditions","buy-box-price-update","cc-manager","itemAssociation","twister-plus-framework","twister-plus-price-tool-tip","twister-plus-side-sheet","twister-plus-pinning").register("twister-plus-init",function(c,d,g,h,p,q,f,r,a,l,u){function v(){f.init();a.init();l.init();p.init();q.init()}
var t=d.metrics;c.on("PageRefresh:Success",function(){h.isTwisterPlusEligible()&&(r.refreshTwisterPlusData(),v(),h.isCcCardsRendered()&&g.logCounter(t.TWISTER_PLUS_TWISTER_REFRESH_GV))});h.isTwisterPlusEligible()&&(r.initializeTwisterPlus(),v(),"function"===typeof C.markFeatureInteractive&&C.markFeatureInteractive(t.FEATURE_NAME,{}))});"use strict";h.when("A","cc-manager","utils","twister-plus-constants").register("twister-plus-mod",function(c,d,g,h){function p(){a=q("#twister-plus-feature",a);l=
q("#twister-plus-below-od-feature",l)}function q(a,d){a=c.$(a);return!d&&0<a.length&&!a.is(":hidden")?(c.on("a:accordion:buybox-accordion:select",r),c.on("a:tabs:offerDisplayGroup_tabs:select",f),!0):d&&(0===a.length||a.is(":hidden"))?(c.off("a:accordion:buybox-accordion:select",r),c.off("a:tabs:offerDisplayGroup_tabs:select",f),!1):d}function f(a){var f=a.selectedTab.$tab.attr(u.TAB_GROUP_NAME);a=c.$("#"+a.selectedTab.tabName+" "+u.ACTIVE_ACCORDION);a=a.length?a.index():0;d.switchBuyingOption(a,
f)}function r(a){a=a.selectedRow.$row.index();var c=g.getActiveGroupName();d.switchBuyingOption(a,c)}var a=!1,l=!1,u=h.selectors;p();c.on("PageRefresh:ATF",function(){p()});c.on("twisterPlus:visibility:change",function(){p()})});"use strict";h.when("A","twister-plus-logger-service","twister-plus-constants").register("twister-plus-feature-state",function(c,d,x){function y(a){f.currentBuyingOptionPosition=a||0}function p(a){return f.ccFeaturesState[a]}function q(a){return f.ccRemovedSelections[a]}var f=
{},r=x.metrics;return{initialize:function(a){f.twisterState=a.twisterState||{};f.priceData=a.priceData||{};y(a.currentBuyingOptionPosition);f.currentGroupName=a.currentGroupName||"";f.ccFeaturesState=a.ccFeaturesState||{};f.ccRemovedSelections=a.ccRemovedSelections||{}},getTwisterPlusFeaturesState:function(){return f},getTwisterState:function(){return f.twisterState},setTwisterState:function(a){f.twisterState=a||{}},getCCFeaturesState:function(){return f.ccFeaturesState},getCCRemovedSelections:function(){return f.ccRemovedSelections},
getPriceData:function(){return f.priceData},getCurrentBuyingOptionPosition:function(){return f.currentBuyingOptionPosition},getCurrentGroupName:function(){return f.currentGroupName},updateCCFeatureState:function(a,c,u){var v=!1;if(a!==g&&c!==g){var v=f.ccFeaturesState,t;t=p(a);if("add"===c.selectionType)u[a].hasOwnProperty("updateQtyAsBaseItem")&&u[a].updateQtyAsBaseItem&&(c.quantity=f.twisterState.quantity),t!==g?t.push(c):(f.ccFeaturesState[a]=[],f.ccFeaturesState[a].push(c)),d.logCounter(r.CC_SELECTION+
"."+a);else if("delete"===c.selectionType&&(u=c.itemType,c=c[u],t!==g))for(var q=0;q<t.length;q++)if(t[q][u]===c){t.splice(q,1);d.logCounter(r.CC_REMOVAL+"."+a);break}t=p(a);v[a]=t;v=!0}else h.log("CC featureName or featureData passed to Twister+ is not defined.","FATAL",a);return v},updateTwisterPlusFeatureStateForQuantity:function(a,d){f.twisterState.quantity=a;c.each(f.ccFeaturesState,function(g,h){d[h].hasOwnProperty("updateQtyAsBaseItem")&&d[h].updateQtyAsBaseItem&&c.each(g,function(c,d){f.ccFeaturesState[h][d].quantity=
a})})},updateCCRemovedSelections:function(a,d){var c=!1;a!==g&&d!==g?(c=f.ccRemovedSelections,q(a)===g&&(f.ccRemovedSelections[a]=[]),q(a).push(d),d=q(a),c[a]=d,c=!0):h.log("CC featureName or featureData passed to Twister+ is not defined.","FATAL",a);return c},clearCCFeatureSelections:function(a){var c=!1;a!==g?(p(a)!==g&&(c=f.ccFeaturesState[a].length,0<c&&d.logCounter(r.CC_REMOVAL+"."+a,c),f.ccFeaturesState[a]=[]),c=!0):h.log("CC featureName passed to Twister+ is not defined.","FATAL",a);return c},
clearCCRemovedSelections:function(a){var c=!1;a!==g?(q(a)!==g&&delete f.ccRemovedSelections[a],c=!0):h.log("CC featureName passed to Twister+ is not defined.","FATAL",a);return c},updatePriceData:function(a){f.priceData=a||{}},updateCurrentBuyingOptionPosition:function(a){y(a)},updateGroupName:function(a){f.currentGroupName=a||""}}})});
/* ******** */
(function(M){var I=window.AmazonUIPageJS||window.P,t=I._namespace||I.attributeErrors,G=t?t("DetailPageTwisterPlusSubAssets@itemAssociation","DetailPageTwisterPlusSubAssets"):I;G.guardFatal?G.guardFatal(M)(G,window):G.execute(function(){M(G,window)})})(function(M,I,t){"use strict";M.when("A","utils","twister-plus-constants","twister-plus-feature-state","item-association-utils").register("itemAssociation",function(G,l,y,E,z){function B(){var a=l.getActiveAccordionRow(E.getCurrentBuyingOptionPosition(),
E.getCurrentGroupName());return a&&1===a.length?a.find(m.ADD_TO_CART_ELEMENT_ID):g(m.ADD_TO_CART_ELEMENT_ID)}function R(){var a=l.getActiveAccordionRow(E.getCurrentBuyingOptionPosition(),E.getCurrentGroupName());return a&&1===a.length?a.find(m.BUYNOW_ELEMENT_ID):g(m.BUYNOW_ELEMENT_ID)}function aa(a){return 0<B().clone().find(m.ITEM_ASSOCIATION_INPUTS_CLASS).remove().end().find('input[name\x3d"'+a+'"]').length}function C(a,b,v){var h=[],d=e.CUSTOM_NAME_STRING+"."+a+"."+b,d=g("\x3c"+J.INPUT+"\x3e",
{type:e.INPUT_TYPE_HIDDEN,id:d,name:d,value:v[e.ITEM_ASSOCIATION_GROUP_KEY]});a=e.CUSTOM_VALUE_STRING+"."+a+"."+b;v=g("\x3c"+J.INPUT+"\x3e",{type:e.INPUT_TYPE_HIDDEN,id:a,name:a,value:JSON.stringify(v[e.ENCODED_ITEM_ASSOC_VAL])});h.push(d);h.push(v);return h}function U(a,b){for(var v=[],h,d=0;d<b.length;d++)h=b[d].name===L.IS_BUYBACK_KEY?g("\x3c"+J.INPUT+"\x3e",{type:e.INPUT_TYPE_HIDDEN,id:b[d].id,name:e.CUSTOM_NAME_STRING+"."+a+".1",value:b[d].value}):b[d].name===L.IS_BUYBACK_FEE?g("\x3c"+J.INPUT+
"\x3e",{type:e.INPUT_TYPE_HIDDEN,id:b[d].id,name:e.CUSTOM_VALUE_STRING+"."+a+".1",value:b[d].value}):g("\x3c"+J.INPUT+"\x3e",{type:e.INPUT_TYPE_HIDDEN,id:b[d].id,name:b[d].name,value:b[d].value}),v.push(h);return v}function V(a){return g("\x3c"+J.INPUT+"\x3e",{type:a.inputType,id:a.inputId,name:a.inputName,value:"string"===typeof a.inputValue?a.inputValue:JSON.stringify(a.inputValue)})}function F(a,b,v,h){var d=a.featureName;a=a.formData;var c=[];if(a!==t){var g;d===L.PAYMENT_OPTIONS_FEATURE&&a[0].inputName===
L.PAYMENT_OFFER_INPUT_NAME&&(g=v?L.PAYMENT_OPTIONS_BUY_NOW_CART_TYPE:L.PAYMENT_OPTIONS_ATC_CART_TYPE);for(v=0;v<a.length;v++)g!==t&&(a[v].inputValue[L.CART_TYPE]=g),d=a[v],"function"!==typeof b||h&&!e.PARAM_NAMES[d.inputName]||(d=b(d),c.push(d))}return c}function w(a,b,v){var e=v.quantity,d=v.offerListingId;e!==t&&d!==t?(a.push('\x3cinput type\x3d"hidden" id\x3d"asin.'+b+'" name\x3d"asin.'+b+'" value\x3d"'+v.asin+'"\x3e'),v=ba(b,e,!1),a.push(v),b=ca(b,d,!1),a.push(b)):M.log("offerListingId or quantity is not defined for the asin in the itemData",
"Error",JSON.stringify(v));return a}function H(){return g("\x3c"+J.INPUT+"\x3e",{type:e.INPUT_TYPE_HIDDEN,id:e.IS_BUYBACK_INPUT_FLAG,name:e.IS_BUYBACK_INPUT_FLAG,value:e.IS_BUYBACK_INPUT_FLAG_VALUE})}function p(a){var b=R(),v=b.find(m.ITEM_ASSOCIATION_INPUTS_CLASS);v.length?g(v).replaceWith(a):b.append(a)}function I(a,b){var v=g("\x3c"+J.FIELDSET+"\x3e",{"class":m.ITEM_ASSOCIATION_INPUTS_CLASS_NAME}),h=[],d={},c=2;if(ga&&l.isFeatureSelectionPresent(S.ccFeaturesState)){c={};c.quantity=g("#addToCart #atc-mbb-quantity").val();
var u=g("input[id|\x3dmbb-checkbox-input]:checked"),r=u.closest(".a-declarative[data-action\x3d'mbb-mobile-checkbox-toggle']");c.asin=u.val();c.offerListingId=r.data("mbb-mobile-checkbox-toggle")?r.data("mbb-mobile-checkbox-toggle").offeringId:"";h=w(h,2,c);c=3}for(u=0;u<a.length;u++){var r=a[u],n=r.featureName;d[n]=d[n]!==t?d[n]+1:0;if(W){var q,f,k=1;a[u][e.FEATURE_NAME_KEY]===e.KEY_BUYBACK&&(q=a[u].buynowData||[],f=U(c,q),g.merge(h,f),k=2);q=a[u].customData||[];for(var x=0;x<q.length;x++)f=C(c,
x+k,q[x]),g.merge(h,f),f=z.createCustomInputFieldsForNATC(d[n],n,q[x]),g.merge(h,f)}r.asin!==t&&(h=w(h,c,r),c++,h=z.addAsinItemsInputFieldsForNATC(d[n],n,h,r));r=F(a[u],V,!1,!1);g.merge(h,r);r=F(a[u],z.createFormInputFieldForNATC,!1,!0);g.merge(h,r)}if(h.length)for(d=[],aa(e.ASIN_KEY+e.FIRST_INDEX)||(c=e.BASE_ASIN_INDEX,d.push('\x3cinput type\x3d"hidden" id\x3d"asin.'+c+'" name\x3d"asin.'+c+'" value\x3d"'+S.baseAsinState.asin+'"\x3e')),aa(e.QUANTITY_KEY+e.FIRST_INDEX)||(ha?(c=l.getBaseItemQuantity(),
c===t&&(c=1)):c=B().find('input[id\x3d"quantity"]').val(),c=ba(e.BASE_ASIN_INDEX,c),d.push(c)),aa(e.OFFERING_ID_KEY+e.FIRST_INDEX)||(c=ca(e.BASE_ASIN_INDEX,S.baseAsinState.offerListingId),d.push(c)),g.merge(h,d),b&&(d=H(),h.push(d)),d=0;d<h.length;d++)g(v).append(h[d]);h=g("\x3c"+J.FIELDSET+"\x3e",{"class":m.ITEM_ASSOCIATION_INPUTS_CLASS_NAME});d=[];c=2;u=1;for(r=0;r<a.length;r++){n=a[r];if(W)for(x=1,a[r][e.FEATURE_NAME_KEY]===e.KEY_BUYBACK&&(q=a[r].buynowData||[],k=U(c,q),g.merge(d,k),x=2),q=a[r].customData||
[],f=0;f<q.length;f++)k=C(c,f+x,q[f]),g.merge(d,k);n.asin!==t&&(d=w(d,u,n),c++,u++);n=F(a[r],V,!0,!1);g.merge(d,n)}if(d.length)for(b&&(a=H(),d.push(a)),a=0;a<d.length;a++)g(h).append(d[a]);v.length&&(a=B().find(m.ITEM_ASSOCIATION_INPUTS_CLASS),a.length?g(a).replaceWith(v):B().append(v));h.length&&p(h)}function X(){if(N===t||0===N.length)N=B().find('input[name\x3d"itemCount"]'),ia=0===N.length?0:parseInt(N[0].value)}function b(){if(O===t||0===O.length)O=R().find('input[name\x3d"itemCount"]'),ja=0===
O.length?0:parseInt(O[0].value)}function c(){var a=g(m.OFFER_DISPLAY_GROUP);return a&&1===a.length?a.find(m.ADD_TO_CART_BUTTON_ID):(a=g(m.BUYBOX_ACCORDION))&&1===a.length?a.find(m.ADD_TO_CART_BUTTON_ID):g(m.ADD_TO_CART_BUTTON_ID)}function f(){var a=g(m.OFFER_DISPLAY_GROUP);return a&&1===a.length?a.find(m.BUYNOW_BUTTON_ID):(a=g(m.BUYBOX_ACCORDION))&&1===a.length?a.find(m.BUYNOW_BUTTON_ID):g(m.BUYNOW_BUTTON_ID)}function k(a,b,c){var h={};h[e.CUSTOM_NAME_STRING+"."+a+"."+b]=c[e.ITEM_ASSOCIATION_GROUP_KEY];
h[e.CUSTOM_VALUE_STRING+"."+a+"."+b]=JSON.stringify(c[e.ENCODED_ITEM_ASSOC_VAL]);return h}function D(a,b){for(var c={},h=0;h<b.length;h++){var d=b[h].name,g=b[h].value;b[h].name===L.IS_BUYBACK_KEY?c[e.CUSTOM_NAME_STRING+"."+a+".1"]=g:b[h].name===L.IS_BUYBACK_FEE?c[e.CUSTOM_VALUE_STRING+"."+a+".1"]=g:c[d]=g}return c}function ka(a){var b={},c=a.inputName;a="string"===typeof a.inputValue?a.inputValue:JSON.stringify(a.inputValue);b[c]=a;return b}function na(a,b){b={};var c={};K={};da={};for(var h=S.baseAsinState.asin,
d=l.getBaseItemQuantity(),f=d=d?d:P.addToCartData[0]&&P.addToCartData[0].initialFormData&&P.addToCartData[0].initialFormData.inputs?P.addToCartData[0].initialFormData.inputs.quantity:"",u=S.baseAsinState.offerListingId,r=2,n=0;n<a.length;n++){var q=a[n],m=q.featureName;c[m]=c[m]!==t?c[m]+1:0;var p=q.asin,x=q.quantity,A=q.offerListingId;p!==t&&x!==t&&A!==t&&(h+=e.PIPE_SEPARATOR+p,d+=e.PIPE_SEPARATOR+x,u+=e.PIPE_SEPARATOR+A,da[p]={quantity:x,offerListingId:A},p=z.addAsinItemKeyValuePairsForNATC(c[m],
m,q),K=g.extend(K,p));if(W){var w,x=1;a[n][e.FEATURE_NAME_KEY]===e.KEY_BUYBACK&&(p=a[n].buynowData||[],w=D(r,p),b=g.extend(b,w),x=2);p=a[n].customData||[];for(A=0;A<p.length;A++)w=k(r,A+x,p[A]),b=g.extend(b,w),w=z.createCustomKeyValuePairForNATC(c[m],m,p[A]),K=g.extend(K,w)}q.asin!==t&&r++;m=F(a[n],ka,!1,!1);for(q=0;q<m.length;q++)b=g.extend(b,m[q]);K=g.extend(K,b);m=F(a[n],z.createFormInputKeyValuePairForNATC,!1,!0);for(q=0;q<m.length;q++)K=g.extend(K,m[q])}b[e.FORM_DATA_ASIN_KEY]=h;b[e.QUANTITY_KEY]=
d;u&&(b[e.FORM_DATA_OID_KEY]=u);""!==f&&f!==t&&(b[e.ITEMS_PREFIX+e.OPENING_SQUARE_BRACKET+e.BASE_ASIN_INDEX_FOR_NATC+"."+e.BASE_ASIN_ITEM_TYPE+e.CLOSING_SQUARE_BRACKET+e.OPENING_SQUARE_BRACKET+e.QUANTITY_KEY+e.CLOSING_SQUARE_BRACKET]=f);return b}function oa(a,b){var c={},h=l.getBaseItemQuantity();c[e.QUANTITY_KEY]=h?h:Q.buyNowData[0]&&Q.buyNowData[0].initialFormData&&Q.buyNowData[0].initialFormData.inputs?Q.buyNowData[0].initialFormData.inputs.quantity:"";for(h=0;h<a.length;h++){var d=a[h],f=h+2,
u=h+1;c[e.ASIN_KEY+"."+u]=d.asin;var r=ba(u,d.quantity,!0),c=g.extend(c,r),d=ca(u,d.offerListingId,!0),c=g.extend(c,d);if(W){r=1;a[h][e.FEATURE_NAME_KEY]===e.KEY_BUYBACK&&(d=a[h].buynowData||[],u=D(f,d),c=g.extend(c,u),r=2);for(var d=a[h].customData||[],n=0;n<d.length;n++)u=k(f,n+r,d[n]),c=g.extend(c,u)}f=F(a[h],ka,!0,!1);for(d=0;d<f.length;d++)c=g.extend(c,f[d])}!l.isEmpty(c)&&b&&(c[e.IS_BUYBACK_INPUT_FLAG]=e.IS_BUYBACK_INPUT_FLAG_VALUE);return c}function Y(a){var b=[];a.each(function(){var a=g(this).parents(m.MOBILEAPP_TABS_ELEMENT_ID).parent().attr(m.TAB_GROUP_NAME),
a=a?a:l.getActiveGroupName();if(l.getAccordionRowBuyingOptionType(g(this).parents(m.MOBILEAPP_ACCORDION_OR_SINGLEOFFER_ELEMENT_ID),a)!==y.UNKNOWN&&(a=g(this).parents(m.DECLARATIVE_CLASS),0<a.length)){var c=g(a).data(m.DATA_ATTRIBUTE_ACTION),c=l.convertHTMLDataAttributesToKeys(c),a=G.copy(g(a).data(c));b.push({dataActionKey:c,initialFormData:a})}});return b}function pa(a,b,c){var g=c.a.split(e.PIPE_SEPARATOR);c=b[e.FORM_DATA_ASIN_KEY].split(e.PIPE_SEPARATOR);b[e.QUANTITY_KEY].split(e.PIPE_SEPARATOR);
var d=b[e.FORM_DATA_OID_KEY].split(e.PIPE_SEPARATOR);G.each(c,function(b,c){g.includes(b)||ea[b]!==t||(a[e.FORM_DATA_ASIN_KEY]=a[e.FORM_DATA_ASIN_KEY]+e.PIPE_SEPARATOR+b,b=l.getBaseItemQuantity(),a[e.QUANTITY_KEY]=a[e.QUANTITY_KEY]+e.PIPE_SEPARATOR+(b?b:P.addToCartData[0]&&P.addToCartData[0].initialFormData&&P.addToCartData[0].initialFormData.inputs?P.addToCartData[0].initialFormData.inputs.quantity:""),a[e.FORM_DATA_OID_KEY]=a[e.FORM_DATA_OID_KEY]+e.PIPE_SEPARATOR+d[c])})}function la(a,b,c,e){var d=
0;a.each(function(){var a=g(this).parents(m.MOBILEAPP_TABS_ELEMENT_ID).parent().attr(m.TAB_GROUP_NAME),a=a?a:l.getActiveGroupName();if(l.getAccordionRowBuyingOptionType(g(this).parents(m.MOBILEAPP_ACCORDION_OR_SINGLEOFFER_ELEMENT_ID),a)!==y.UNKNOWN&&(a=g(this).parents(m.DECLARATIVE_CLASS),0<a.length)){var f=b[d++];if(f!==t){var n=g.extend({},f.initialFormData.inputs,c),q=g.extend({},f.initialFormData);e&&pa(n,f.initialFormData.inputs,c);q.inputs=n;a.data(f.dataActionKey,q)}}});if(e){var d=0,f=Y(a);
a.each(function(){var a=g(this).parents(m.MOBILEAPP_TABS_ELEMENT_ID).parent().attr(m.TAB_GROUP_NAME),a=a?a:l.getActiveGroupName();if(l.getAccordionRowBuyingOptionType(g(this).parents(m.MOBILEAPP_ACCORDION_OR_SINGLEOFFER_ELEMENT_ID),a)!==y.UNKNOWN&&(a=g(this).parents(m.DECLARATIVE_CLASS),0<a.length)){var b=f[d++];if(b!==t){G.each(Object.keys(fa),function(a,c){delete b.initialFormData.inputs[a]});var c=g.extend({},b.initialFormData.inputs,K),e=g.extend({},b.initialFormData);e.inputs=c;a.data(b.dataActionKey,
e)}}});fa=K;ea=da}}function qa(a,b){var e=na(a,b);G.delay(function(){Q.addToCartData=Y(c());la(c(),Q.addToCartData,e,!0)});a=oa(a,b);la(f(),Q.buyNowData,a,!1)}function ba(a,b,c){return c?(c={},c[e.QUANTITY_KEY+"."+a]=b,c):'\x3cinput type\x3d"hidden" id\x3d"quantity.'+a+'" name\x3d"quantity.'+a+'" value\x3d"'+b+'"\x3e'}function ca(a,b,c){return c?(c={},c[e.OFFERING_ID_KEY+"."+a]=b,c):'\x3cinput type\x3d"hidden" id\x3d"offeringID.'+a+'" name\x3d"offeringID.'+a+'" value\x3d"'+b+'"\x3e'}function ra(a,
c){if(T===e.DEVICE_TYPE_MOBILE_APP)qa(a,c),I(a,c);else if(T===e.DEVICE_TYPE_MOBILE_WEB)I(a,c);else{var f=g("\x3c"+J.FIELDSET+"\x3e",{"class":m.ITEM_ASSOCIATION_INPUTS_CLASS_NAME});g(m.ITEM_ASSOCIATION_INPUTS_CLASS).remove();var h=[],d={},k=B().find('input[name^\x3d"offeringID"]').length+1,u=k+1,r=a.length;X();N.length?N[0].value=ia+r:(B().append('\x3cinput type\x3d"hidden" name\x3d"itemCount" value\x3d"'+r+'"\x3e'),N=B().find('input[name\x3d"itemCount"]'));for(r=0;r<a.length;r++){var n=a[r],q=n.featureName;
d[q]=d[q]!==t?d[q]+1:0;if(W){var l,D,x=1;a[r][e.FEATURE_NAME_KEY]===e.KEY_BUYBACK&&(l=a[r].buynowData||[],D=U(k,l),g.merge(h,D),x=2);l=a[r].customData||[];for(var A=0;A<l.length;A++)D=C(u,A+x,l[A]),g.merge(h,D),D=z.createCustomInputFieldsForNATC(d[q],q,l[A]),g.merge(h,D)}n.asin!==t&&(h=w(h,k,n),k++,u++,h=z.addAsinItemsInputFieldsForNATC(d[q],q,h,n));n=F(a[r],V,!1,!1);g.merge(h,n);n=F(a[r],z.createFormInputFieldForNATC,!1,!0);g.merge(h,n)}if(h.length)for(c&&(d=H(),h.push(d)),d=0;d<h.length;d++)g(f).append(h[d]);
h=g("\x3c"+J.FIELDSET+"\x3e",{"class":m.ITEM_ASSOCIATION_INPUTS_CLASS_NAME});d=[];k={};u=R().find('input[name^\x3d"offeringID"]').length+1;r=u+1;n=a.length;b();O.length?O[0].value=ja+n:(R().append('\x3cinput type\x3d"hidden" name\x3d"itemCount" value\x3d"'+n+'"\x3e'),O=R().find('input[name\x3d"itemCount"]'));for(n=0;n<a.length;n++){q=a[n];l=q.featureName;k[l]=k[l]!==t?k[l]+1:0;if(W){var y,A=1;a[n][e.FEATURE_NAME_KEY]===e.KEY_BUYBACK&&(x=a[n].buynowData||[],y=U(u,x),g.merge(d,y),A=2);x=a[n].customData||
[];for(D=0;D<x.length;D++)y=C(r,D+A,x[D]),g.merge(d,y),y=z.createCustomInputFieldsForNATC(k[l],l,x[D]),g.merge(d,y)}q.asin!==t&&(d=w(d,u,q),u++,r++,d=z.addAsinItemsInputFieldsForNATC(k[l],l,d,q));q=F(a[n],V,!1,!1);g.merge(d,q);q=F(a[n],z.createFormInputFieldForNATC,!1,!0);g.merge(d,q)}if(d.length)for(c&&(a=H(),d.push(a)),a=0;a<d.length;a++)g(h).append(d[a]);f.length&&(a=B().find(m.ITEM_ASSOCIATION_INPUTS_CLASS),a.length?g(a).replaceWith(f):B().append(f));h.length&&p(h)}}var g=G.$,Z={name:"itemAssociation"},
T="",ga,ha=!1,fa={},K={},da={},ea={},W,S={ccFeaturesState:{},baseAsinState:{}},Q={addToCartData:[],buyNowData:[]},P={addToCartData:[]},e=y.itemAssociation,J=y.htmlTags,m=y.selectors,L=y.ccFeatures,N,O,ia,ja;Z.addItemAssociationBundleData=function(a,b,c,f){ga=c;W=b;ha=f;var d=!1,k=[];S.ccFeaturesState=a.ccFeaturesState;S.baseAsinState=a.twisterState;g.each(S.ccFeaturesState,function(a,b){g.each(b,function(b,c){a===e.KEY_BUYBACK&&c.isBuyBack&&(d=!0);b={};var f=[];b[e.ASIN_KEY]=c.asin;b[e.QUANTITY_KEY]=
c.quantity;b[e.OFFER_LISTING_ID_KEY]=c.offerListingId;if(c.enableIA){var g={};g[e.ITEM_ASSOCIATION_GROUP_KEY]=e.ITEM_ASSOCIATION_GROUP_VAL;g[e.ENCODED_ITEM_ASSOC_VAL]=c.IAData;f.push(g);b[e.CUSTOM_DATA_KEY]=f}b[e.FEATURE_NAME_KEY]=a;c.formData!==t&&0<c.formData.length&&(b.formData=c.formData);a===e.KEY_BUYBACK&&(b[L.BUY_NOW_DATA]=c.buynowData);k.push(b)})});ra(k,d);T===e.DEVICE_TYPE_MOBILE_APP&&G.trigger(y.TP_AFTER_BUYBOX_UPDATE_EVENT)};Z.init=function(){T=l.getDeviceType();fa={};ea={};T===e.DEVICE_TYPE_MOBILE_APP&&
(P.addToCartData=Y(c()),Q.addToCartData=Y(c()),Q.buyNowData=Y(f()));T===y.DEVICE_TYPE_WEB&&(X(),b())};Z.reInitialiseItemCountVal=function(){O=N=t;T=l.getDeviceType();T===y.DEVICE_TYPE_WEB&&(X(),b())};return Z});"use strict";M.when("A","twister-plus-constants").register("item-association-utils",function(t,l){function y(b,c){var f=p.ITEMS_PREFIX;return f+=p.OPENING_SQUARE_BRACKET+(b+"."+c)+p.CLOSING_SQUARE_BRACKET}function E(b,c){var f="string"===typeof b?b:"";"object"===typeof c&&Array.isArray(c)?
t.each(c,function(b,c){f+=p.OPENING_SQUARE_BRACKET+b+p.CLOSING_SQUARE_BRACKET}):"string"===typeof c&&(f+=p.OPENING_SQUARE_BRACKET+c+p.CLOSING_SQUARE_BRACKET);return f}function z(b,c,f){return w("\x3c"+ma.INPUT+"\x3e",{type:f,id:b,name:b,value:c})}function B(b,c){var f={};f[b]=c;return f}function R(b,c){if("number"===typeof b&&0<=b&&"string"===typeof c)return b=y(b,c),b=E(b,p.PARAM_NAMES.ITEM_ASSOCIATION);M.log("Invalid data-type for itemIndex or itemType: itemIndex \x3d "+b+", itemType \x3d "+c,"ERROR",
X)}function I(b,c,f){return f?B(b,c):z(b,c,p.INPUT_TYPE_HIDDEN)}function C(b,c,f,k){if("string"===typeof f)return b=E(b,c),I(b,f,k)}function U(b,c,f){if("string"===typeof c||"number"===typeof c)return b=E(b,p.PARAM_NAMES.QUANTITY),I(b,c,f)}function V(b,c,f){if("object"===typeof c&&Array.isArray(c)&&"DELETE"===c[0].type)return b=E(b,p.PARAM_NAMES.DELETE_CONSTRAINT),I(b,c[0].mutuallyInclusive,f)}function F(b,c,f){var k;if(c){if(c.AccessoryType){var l=E(b,p.PARAM_NAMES.ACCESSORY_TYPE);f?(k={},l=B(l,
c.AccessoryType),k=w.extend(k,l)):(k=[],l=z(l,c.AccessoryType,p.INPUT_TYPE_HIDDEN),k.push(l))}c.CustomerAppointmentType&&(b=E(b,p.PARAM_NAMES.CUSTOMER_APPOINTMENT_TYPE),f?(c=B(b,c.CustomerAppointmentType),k=w.extend(k,c)):(c=z(b,c.CustomerAppointmentType,p.INPUT_TYPE_HIDDEN),k.push(c)))}return k}var w=t.$,H={},p=l.itemAssociation,ma=l.htmlTags,X=l.ATTRIBUTION;H.createCustomInputFieldsForNATC=function(b,c,f){var k=[];b=R(b,c);f=f[p.ENCODED_ITEM_ASSOC_VAL];"string"===typeof b&&f&&(c=C(b,p.PARAM_NAMES.ASSOCIATED_ITEM_ID,
f.parentAsin,!1),k.push(c),c=C(b,p.PARAM_NAMES.PROGRAM_TYPE,f.type,!1),k.push(c),c=C(b,p.PARAM_NAMES.RENDER_TYPE,f.renderType,!1),k.push(c),c=V(b,f.constraintList,!1),k.push(c),b=F(b,f.properties,!1),k=k.concat(b));return k};H.addAsinItemsInputFieldsForNATC=function(b,c,f,k){var l=k.asin,t=k.quantity,w=k.offerListingId;l&&t&&w?(b=y(b,c),l=C(b,p.PARAM_NAMES.ASIN,l,!1),f.push(l),t=U(b,t,!1),f.push(t),w=C(b,p.PARAM_NAMES.OFFER_LISTING_ID,w,!1),f.push(w)):M.log("Invalid data (asin/offerListingId/quantity) is present in itemData"+
JSON.stringify(k),"ERROR",X);return f};H.createFormInputFieldForNATC=function(b){var c=y(p.BASE_ASIN_INDEX_FOR_NATC,p.BASE_ASIN_ITEM_TYPE),c=E(c,p.PARAM_NAMES[b.inputName]),f="string"===typeof b.inputValue?b.inputValue:JSON.stringify(b.inputValue);return z(c,f,b.inputType)};H.createCustomKeyValuePairForNATC=function(b,c,f){var k={};b=R(b,c);f=f[p.ENCODED_ITEM_ASSOC_VAL];"string"===typeof b&&f&&(c=C(b,p.PARAM_NAMES.ASSOCIATED_ITEM_ID,f.parentAsin,!0),k=w.extend(k,c),c=C(b,p.PARAM_NAMES.PROGRAM_TYPE,
f.type,!0),k=w.extend(k,c),c=C(b,p.PARAM_NAMES.RENDER_TYPE,f.renderType,!0),k=w.extend(k,c),c=V(b,f.constraintList,!0),k=w.extend(k,c),b=F(b,f.properties,!0),k=w.extend(k,b));return k};H.createFormInputKeyValuePairForNATC=function(b){var c=y(p.BASE_ASIN_INDEX_FOR_NATC,p.BASE_ASIN_ITEM_TYPE),c=E(c,p.PARAM_NAMES[b.inputName]);b="string"===typeof b.inputValue?b.inputValue:JSON.stringify(b.inputValue);return B(c,b)};H.addAsinItemKeyValuePairsForNATC=function(b,c,f){var k={},l=f.asin,t=f.quantity,z=f.offerListingId;
l&&t&&z?(b=y(b,c),l=C(b,p.PARAM_NAMES.ASIN,l,!0),k=w.extend(k,l),t=U(b,t,!0),k=w.extend(k,t),z=C(b,p.PARAM_NAMES.OFFER_LISTING_ID,z,!0),k=w.extend(k,z)):M.log("Invalid data (asin/offerListingId/quantity) is present in itemData"+JSON.stringify(f),"ERROR",X);return k};return H})});
/* ******** */
(function(h){var F=window.AmazonUIPageJS||window.P,t=F._namespace||F.attributeErrors,c=t?t("DetailPageTwisterPlusSubAssets@secondaryFeatures","DetailPageTwisterPlusSubAssets"):F;c.guardFatal?c.guardFatal(h)(c,window):c.execute(function(){h(c,window)})})(function(h,F,t){h.when("A","twister-plus-feature-state","twister-plus-constants","cc-manager","a-sheet","twister-plus-framework","twister-plus-logger-service").register("twister-plus-price-bottom-sheet",function(c,y,k,C,D,f,d){function b(){E=!0;n.html(L.html());
I=n.find("#tp-bottom-sheet-price-section");M=y.getTwisterPlusFeaturesState()}function a(a,e,r,b){var g=e[0];(e=e[1])&&"00"!==e?a.find(".a-price-fraction").text(String(e)):r?(a.find(".a-price-fraction").addClass("aok-hidden"),a.find(".a-price-decimal").addClass("aok-hidden")):(e="00",a.find(".a-price-fraction").text(String(e)));a.find(".a-price-whole").contents().filter(function(){return 3===this.nodeType||""===this.textContent.trim()}).first().replaceWith(Number(g).toLocaleString(t));b?a.find(".tp-price-minus").removeClass("aok-hidden"):
a.find(".tp-price-minus").addClass("aok-hidden")}function e(a,e){a.find("#display-string").text(e)}function u(e,r,b){e.find("#tp-item-quantity").text(r);e=e.find(".tp-bottom-sheet-quantity-block");e.removeClass("aok-hidden");a(e,b.toFixed(2).split("."),!0,!1)}function v(a){a+=B.data(1<V?A.ITEM_COUNT_PLURAL_TEMPLATE:A.ITEM_COUNT_SINGULAR_TEMPLATE);return a=a.replace(A.ITEM_COUNT_PLACEHOLDER,V)}function l(a){var e=m.clone();a!==t&&e.attr("id",a);e.find("#tp-bottom-sheet-price").removeClass("twister-plus-price-template");
return e}function p(){var a=n.find(".twister-plus-subtotal-price-template").clone().removeClass("twister-plus-subtotal-price-template");a.find("#tp-bottom-sheet-subtotal-price-value").removeAttr("id");return a}function r(a){return G.hasOwnProperty(a)&&0<G[a].length}var x=c.$,m=x("#tp-bottom-sheet-price-block"),M,W,J,E=!1,A=k.bottomSheet,w=k.registrationMap,I=x("#tp-bottom-sheet-price-section"),n=x("#twister-plus-bottom-sheet"),B=n.find("#tp-bottom-sheet-item-strings"),R=n.find("#tp-bottom-sheet-discount-string"),
L=n.clone(),G,Q,N=[],H=0,V,z=k.metrics,X=new d.Timer(z.BOTTOM_SHEET_TIMER),O=!1,g,S=!1;c.on("a:sheet:beforeShow:twisterPlusBottomSheet",function(){X.start();if(E){var b=0;G=M.ccFeaturesState;var z=r("paymentOptions"),c=M.twisterState.quantity;V=parseInt(c);Q=M.priceData.totalPrice.toFixed(2).split(".");for(var d in W){var m=W[d];if("paymentOptions"!==m&&r(m)){var f=G[m][0],x=!1;J[m].hasOwnProperty(w.IS_MULTI_SELECTION)&&J[m][w.IS_MULTI_SELECTION]&&(x=!0);for(var y=l("tp-bottom-sheet-price-block-"+
m),k=f.orderSummaryDisplayString,C=G[m].length,O=0,h=0,q=0,S=J[m][w.DISPLAY_SAVINGS_ROW_IN_BOTTOM_SHEET],L=0;L<C;L++){var U=G[m][L],F=U.quantity!==t?U.quantity:1,h=h+parseInt(F),O=O+U.price*F;S&&U.savings!==t&&(q+=U.savings*F)}S&&J[m][w.BASE_ITEM_SAVINGS]&&(q+=J[m][w.BASE_ITEM_SAVINGS]*c);z&&(H+=O,C=b?k.toLowerCase():k,N.push(C),b++);x?k=1<h?k+B.data(A.ITEM_COUNT_PLURAL_TEMPLATE):k+B.data(A.ITEM_COUNT_SINGULAR_TEMPLATE):f.hasOwnProperty("shortDisplayTitle")&&f.shortDisplayTitle!==t&&(k=k+" ("+f.shortDisplayTitle+
")",1<h&&u(y,h,G[m][0].price));V+=h;k=k.replace(A.ITEM_COUNT_PLACEHOLDER,h);a(y.find("#tp-bottom-sheet-price"),O.toFixed(2).split("."),!1,!1);e(y,k);I.append(y);0<Math.round(100*q)&&(f=f.hasOwnProperty("overrideOrderSummarySavingString")&&f.overrideOrderSummarySavingString!==t?f.overrideOrderSummarySavingString:R.data(A.DEFAULT_DISCOUNT_STRING),m=l("tp-bottom-sheet-savings-price-block-"+m),a(m.find("#tp-bottom-sheet-price"),q.toFixed(2).split("."),!1,!0),e(m,f),I.append(m))}}z?(z=G.paymentOptions[0],
b=n.find("#tp-bottom-sheet-footnote-section"),q=l("tp-bottom-sheet-price-block-interest"),d=z.interestAmount.toFixed(2).split("."),a(q.find("#tp-bottom-sheet-price"),d,!1,!1),e(q,z.interestDisplayString),I.append(q),z.isOrderLevel||0===N.length?(n.find("#twister-plus-order-level-monthly-payments-section").removeClass("aok-hidden"),q=n.find("#tp-bottom-sheet-order-level-monthly-payments-price-block"),e(q,z.orderSummaryDisplayString),d=p(),q.find("#tp-order-level-monthly-payment-subtotal-price").append(d),
d=z.price.toFixed(2).split("."),a(q,d,!1,!1),z=z.bottomSheetFootnoteDisplayString):(n.find("#twister-plus-item-level-monthly-payments-section").removeClass("aok-hidden"),q=l("tp-bottom-sheet-price-block-monthly-payment"),d=z.price.toFixed(2).split("."),a(q.find("#tp-bottom-sheet-price"),d,!1,!1),e(q,z.orderSummaryDisplayString),q.addClass("a-spacing-top-base"),m=n.find("#tp-monthly-payments-breakdown-section"),m.append(q),q=l("tp-bottom-sheet-price-block-all-selections"),d=H.toFixed(2).split("."),
a(q.find("#tp-bottom-sheet-price"),d,!1,!1),e(q,N.join(", ")),m.append(q),q=p(),n.find("#tp-item-level-monthly-payment-subtotal-price").append(q),d=(z.price+H).toFixed(2).split("."),a(q,d,!1,!1),z=n.find("#tp-bottom-sheet-footnote-string").data(A.MONTHLY_PAYMENTS_FOOTNOTE_TEMPLATE)),d=n.find("#tp-bottom-sheet-monthly-payment-subtotal-price-block"),q=d.find("#display-string").text(),q=v(q),e(d,q),q=n.find(".twister-plus-price-template").clone().removeClass("twister-plus-price-template").addClass("a-text-bold"),
d.find("#tp-monthly-payment-subtotal-price").append(q),a(d,Q,!1,!1),n.find("#tp-bottom-sheet-subtotal-price-block").addClass("aok-hidden"),d.removeClass("aok-hidden"),q=n.find("#tp-footnote-text").clone().attr("id","tp-monthly-payment-footnote-text"),q.text(z),b.append(q)):(a(n.find("#tp-bottom-sheet-subtotal-price-value"),Q,!1,!1),b=n.find("#tp-bottom-sheet-subtotal-price-block"),z=b.find("#display-string").text(),z=v(z),e(b,z));1<c&&(b=l(),z=M.twisterState.price,u(b,c,z),c*=z,a(b.find("#tp-bottom-sheet-price"),
c.toFixed(2).split("."),!1,!1),I.find("#tp-bottom-sheet-price-block").replaceWith(b));g=D.get(A.BOTTOM_SHEET_NAME).getContentContainer();g.html(n.html());g.addClass("twister-plus-bottom-sheet-padding")}E=!1});c.on("a:sheet:afterShow:twisterPlusBottomSheet",function(){var a=g[0].scrollHeight;0<a&&(D.get(A.BOTTOM_SHEET_NAME).changeHeight({height:a,duration:A.RESIZE_DURATION})||h.log("Bottom sheet resize failed","ERROR",A.FEATURE_ATTRIBUTION));X.stop();O||(d.logCounter(z.BOTTOM_SHEET_GV),O=!0)});return{init:function(){m=
x("#tp-bottom-sheet-price-block");I=x("#tp-bottom-sheet-price-section");n=x("#twister-plus-bottom-sheet");L=n.clone();B=n.find("#tp-bottom-sheet-item-strings");R=n.find("#tp-bottom-sheet-discount-string");E=!1;M=y.getTwisterPlusFeaturesState();W=C.getRenderedFeaturesList();O=!1;if(!S){var a={};a.featureName=A.FEATURE_NAME;a.featureAttribution=A.FEATURE_ATTRIBUTION;f.registerFeature(a,A.EVENT_NAME,b);J=C.getFeatureRegistrationDetails();S=!0}}}});"use strict";h.when("A","utils").register("buy-box-price-update",
function(c,y){function k(){p.text("/"+a.termType);r.text(a.termCount.toString()+" "+a.termType);x.removeClass("aok-hidden")}function C(){p.text("");r.text("");x.addClass("aok-hidden")}function D(){2===e.length?u.find(".a-price-fraction").text(String(e[1].substring(0,2))):u.find(".a-price-fraction").text("00");u.find(".a-price-whole").contents().filter(function(){return 3===this.nodeType||""===this.textContent.trim()}).first().replaceWith(Number(e[0]).toLocaleString(t))}var f=c.$;c={};var d,b,a,e,
u,v,l,p,r,x;c.init=function(){d=0;u=f("#tp_price_block_total_price_ww");v=f("#tp_options_detail");l=f("#tp_monthly_options_detail");p=f("#tp-price-update-payment-term");r=f("#tp-price-update-payment-term-length");x=f("#tp-price-update-payment-period")};c.updatePriceSubtotalFeature=function(r){b=r.ccFeaturesState;var c=r.priceData;if(c&&y.isValidNumber(c.totalPrice)&&y.isValidNumber(c.youSave)){var c=b.hasOwnProperty("paymentOptions")&&0<b.paymentOptions.length,u=0,p;for(p in b)if("paymentOptions"!==
p&&0<b[p].length){u=1;break}c?(a=b.paymentOptions[0],a.isOrderLevel?(e=a.price.toFixed(2).split("."),D(),k(),1===u?v.removeClass("aok-hidden"):v.addClass("aok-hidden"),l.addClass("aok-hidden")):1===u?(e=(r.priceData.totalPrice+a.price-r.twisterState.price).toFixed(2).split("."),D(),C(),v.addClass("aok-hidden"),l.removeClass("aok-hidden")):(e=a.price.toFixed(2).split("."),D(),k(),v.addClass("aok-hidden"),l.addClass("aok-hidden"))):(e=r.priceData.totalPrice.toFixed(2).split("."),D(),C(),v.removeClass("aok-hidden"),
l.addClass("aok-hidden"));r=f("#tp_price_update_feature_ww");p=f("#tp_price_row_ww");1===d&&(p.css("display","none"),r.css("display","none"),d=0)}};return c});"use strict";h.when("A","twister-plus-constants").register("twister-plus-pinning",function(c,y){var k=c.$,t=y.selectors;return{init:function(){var c=k(t.PPD_RIGHT_COL_ID);c&&c.addClass("twister-plus-pinning")}}});"use strict";h.when("A","twister-plus-constants").register("priceUpdate",function(c,y){function k(a,e,c,v){var l=a;D.each(c,function(a,
r){var c=v&&v[a]&&v[a][b.INCLUDE_SAVINGS_CALCULATION_IN_SUBTOTAL];D.each(r,function(e,b){a!==f.PAYMENT_OPTIONS_FEATURE&&b.price!==t&&(a===d.KEY_BUYBACK?b.isBuyBack&&(l=l-b.savings+b.price):a===f.COUPONS_FEATURE?l-=b.savings:(e=b.quantity!==t?b.quantity:1,l+=b.price*e,c&&b.savings!==t&&(l-=b.savings*e)))});c&&v[a][b.BASE_ITEM_SAVINGS]!==t&&(l-=v[a][b.BASE_ITEM_SAVINGS]*e)});return l}function h(a,e,c,v,l){var p=e;D.each(v,function(a,e){D.each(e,function(e,b){a!==f.PAYMENT_OPTIONS_FEATURE&&b.savings!==
t&&(a===d.KEY_BUYBACK?b.isBuyBack&&(p+=b.savings):p+=b.savings*(b.quantity!==t?b.quantity:1))});l&&l[a]&&l[a][b.BASE_ITEM_SAVINGS]!==t&&(p+=l[a][b.BASE_ITEM_SAVINGS]*c)});return p}var D=c.$;c={};var f=y.ccFeatures,d=y.itemAssociation,b=y.registrationMap;c.getTotalPrice=function(a,e){var b={},c=a.twisterState.quantity?a.twisterState.quantity:1;b.totalPrice=k(a.twisterState.price*c,c,a.ccFeaturesState,e);return b};c.getTotalPriceAndYouSave=function(a,b){var c={},d=a.twisterState.quantity?a.twisterState.quantity:
1,l=a.twisterState.price*d,f=a.twisterState.savings*d;c.totalPrice=k(l,d,a.ccFeaturesState,b);c.youSave=h(l,f,d,a.ccFeaturesState,b);return c};return c});"use strict";h.when("A","twister-plus-constants").register("side-sheet",function(c,y){function k(){d("#twister-plus-side-sheet-content").show(function(){h({right:"0px"})})}function t(){d("#twister-plus-side-sheet-content").show(function(){h({right:"-600px"})})}function h(b,a){c.animate(d("#twister-plus-side-sheet-content"),b,f.RESIZE_DURATION,a)}
var f=y.sideSheet,d=c.$;c.declarative("side-sheet","click",function(b){d("body").css("overflow","hidden");c.show("#twister-plus-dp-bg");k()});c.declarative("close-side-sheet","click",function(b){t();c.hide("#twister-plus-dp-bg");d("body").css("overflow","scroll")});return{getContentContainer:function(){return d("#tp-side-sheet-main-section")}}});"use strict";h.when("A","twister-plus-constants","cc-manager","twister-plus-framework","side-sheet","a-carousel-framework").register("twister-plus-side-sheet",
function(c,y,k,t,h,f){function d(){var a=k.getFeatureCurrentlyExpanded();a&&((a=k.isMultiSelectionFeature(a))||c.trigger("a:declarative:close-side-sheet:click"))}function b(a){(a=a.hasClass(e.CAROUSEL_CONTAINER_CLASS_NAME)?a:a.find(e.CAROUSEL_CONTAINER_CLASS))&&0<a.length&&!a.hasClass(e.CAROUSEL_INITIALIZED_CLASS_NAME)&&(a.addClass(e.CAROUSEL_NOT_INITIALIZED_CLASS_NAME),f.createAll(),f.initializeAll())}var a=c.$,e=y.sideSheet,u,v,l,p=!1;c.on("a:declarative:side-sheet:click",function(d){u.html(v.html());
l=h.getContentContainer();var f=a(e.SYMBOL_HASH+d.data.contentId),m=a(e.SYMBOL_HASH+d.data.contentId).clone(),p=d.data.url;p&&!f.prop("data-urlLoaded")?(m=a(e.SYMBOL_HASH+d.data.preUrlLoadDomId).clone(),m.prop("id",d.data.contentId+"-sideSheet"),m.removeClass("aok-hidden"),l.html(m),l.removeClass("aok-hidden"),a("#twister-plus-side-sheet-content").removeClass("aok-hidden"),c.ajax(p,{method:"get",success:function(b){f.prop("data-urlLoaded","true");f.html(b);b=a(e.SYMBOL_HASH+d.data.contentId).clone();
b.prop("id",d.data.contentId+"-sideSheet");l.html(b);d.data.postLoadEvent&&c.trigger(d.data.postLoadEvent,d.data);c.trigger(e.SIDE_SHEET_AJAX_SUCCESS,d);b.css(e.DISPLAY,"block");l.removeClass("aok-hidden");a("#twister-plus-side-sheet-content").removeClass("aok-hidden")},failure:function(b){b=a(e.SYMBOL_HASH+d.data.failedUrlLoadDomId).clone();b.removeClass("aok-hidden");l.html(b);l.removeClass("aok-hidden");a("#twister-plus-side-sheet-content").removeClass("aok-hidden")}})):(m.prop("id",d.data.contentId+
"-sideSheet"),l.append(m),m.css(e.DISPLAY,"block"),l.removeClass("aok-hidden"),a("#twister-plus-side-sheet-content").removeClass("aok-hidden"),b(m))});return{init:function(){u=a("#tp-side-sheet");v=u.clone();if(!p){var b={};b.featureName=e.FEATURE_NAME;b.featureAttribution=e.FEATURE_ATTRIBUTION;t.registerFeature(b,e.EVENT_NAME,d);p=!0}}}});h.when("A","twister-plus-feature-state","twister-plus-constants","cc-manager","a-popover","twister-plus-framework").register("twister-plus-price-tool-tip",function(c,
y,k,h,D,f){function d(){J=!0;w.html(n.html());A=w.find("#tp-tool-tip-price-section");m=y.getTwisterPlusFeaturesState()}function b(a,b,e){var d=b[0];(b=b[1])&&"00"!==b?a.find(".a-price-fraction").text(String(b)):e?(a.find(".a-price-fraction").addClass("aok-hidden"),a.find(".a-price-decimal").addClass("aok-hidden")):(b="00",a.find(".a-price-fraction").text(String(b)));a.find(".a-price-whole").contents().filter(function(){return 3===this.nodeType||""===this.textContent.trim()}).first().replaceWith(Number(d).toLocaleString(t))}
function a(a,b){a.find("#display-string").text(b)}function e(a,e,d){a.find("#tp-item-quantity").text(e);a=a.find(".tp-tool-tip-quantity-block");a.removeClass("aok-hidden");b(a,d.toFixed(2).split("."),!0)}function u(a){a+=I.data(1<N?E.ITEM_COUNT_PLURAL_TEMPLATE:E.ITEM_COUNT_SINGULAR_TEMPLATE);return a=a.replace(E.ITEM_COUNT_PLACEHOLDER,N)}function v(a){var b=x.clone();a!==t&&b.attr("id",a);b.find("#tp-tool-tip-price").removeClass("twister-plus-price-template");return b}function l(){var a=w.find(".twister-plus-subtotal-price-template").clone().removeClass("twister-plus-subtotal-price-template");
a.find("#tp-tool-tip-subtotal-price-value").removeAttr("id");return a}function p(a){return B.hasOwnProperty(a)&&0<B[a].length}var r=c.$,x=r("#tp-tool-tip-price-block"),m,M,F,J=!1,E=k.toolTip,A=r("#tp-tool-tip-price-section"),w=r("#twister-plus-tool-tip"),I=w.find("#tp-tool-tip-item-strings"),n=w.clone(),B,R,L=[],G=0,Q,N,H=!1;c.on("a:popover:beforeShow:twisterPlusPopOver",function(){var d=r(".twister-plus-tool-tip-padding").parents(".a-popover"),c=r("#twister-plus-popover-inner").parents(".a-popover");
d.addClass("twister-plus-popover-margin");c.addClass("twister-plus-popover-margin");if(J){c=0;B=m.ccFeaturesState;var f=p("paymentOptions"),d=m.twisterState.quantity;N=parseInt(d);R=m.priceData.totalPrice.toFixed(2).split(".");for(var k in M){var g=M[k];if("paymentOptions"!==g&&p(g)){var h=B[g][0],y=!1;F[g].hasOwnProperty("isMultiSelection")&&F[g].isMultiSelection&&(y=!0);var n=v("tp-tool-tip-price-block-"+g),x=h.orderSummaryDisplayString,C=B[g].length,H=0,P=0;if("couponsCard"===g){for(var K=0;K<
C;K++)var T=B[g][K].quantity!==t?B[g][K].quantity:1,P=P+parseInt(T),H=H+B[g][K].savings*T;n.find("#price-sign-string").text("-")}else for(K=0;K<C;K++)T=B[g][K].quantity!==t?B[g][K].quantity:1,P+=parseInt(T),H+=B[g][K].price*T;f&&(G+=H,C=c?x.toLowerCase():x,L.push(C),c++);y?x=1<P?x+I.data(E.ITEM_COUNT_PLURAL_TEMPLATE):x+I.data(E.ITEM_COUNT_SINGULAR_TEMPLATE):h.hasOwnProperty("shortDisplayTitle")&&h.shortDisplayTitle!==t&&(x=x+" ("+h.shortDisplayTitle+")",1<P&&e(n,P,B[g][0].price));N+=P;x=x.replace(E.ITEM_COUNT_PLACEHOLDER,
P);b(n.find("#tp-tool-tip-price"),H.toFixed(2).split("."),!1);a(n,x);A.append(n)}}f?(c=B.paymentOptions[0],k=w.find("#tp-tool-tip-footnote-section"),g=v("tp-tool-tip-price-block-interest"),f=c.interestAmount.toFixed(2).split("."),b(g.find("#tp-tool-tip-price"),f,!1),a(g,c.interestDisplayString),A.append(g),c.isOrderLevel||0===L.length?(w.find("#twister-plus-order-level-monthly-payments-section").removeClass("aok-hidden"),g=w.find("#tp-tool-tip-order-level-monthly-payments-price-block"),a(g,c.orderSummaryDisplayString),
f=l(),g.find("#tp-order-level-monthly-payment-subtotal-price").append(f),f=c.price.toFixed(2).split("."),b(g,f,!1),c=c.toolTipFootnoteDisplayString):(w.find("#twister-plus-item-level-monthly-payments-section").removeClass("aok-hidden"),g=v("tp-tool-tip-price-block-monthly-payment"),f=c.price.toFixed(2).split("."),b(g.find("#tp-tool-tip-price"),f,!1),a(g,c.orderSummaryDisplayString),g.addClass("a-spacing-top-base"),h=w.find("#tp-monthly-payments-breakdown-section"),h.append(g),g=v("tp-tool-tip-price-block-all-selections"),
f=G.toFixed(2).split("."),b(g.find("#tp-tool-tip-price"),f),a(g,L.join(", ")),h.append(g),g=l(),w.find("#tp-item-level-monthly-payment-subtotal-price").append(g),f=(c.price+G).toFixed(2).split("."),b(g,f,!1),c=w.find("#tp-tool-tip-footnote-string").data(E.MONTHLY_PAYMENTS_FOOTNOTE_TEMPLATE)),f=w.find("#tp-tool-tip-monthly-payment-subtotal-price-block"),g=f.find("#display-string").text(),g=u(g),a(f,g),g=w.find(".twister-plus-price-template").clone().removeClass("twister-plus-price-template").addClass("a-text-bold"),
f.find("#tp-monthly-payment-subtotal-price").append(g),b(f,R,!1),w.find("#tp-tool-tip-subtotal-price-block").addClass("aok-hidden"),f.removeClass("aok-hidden"),g=w.find("#tp-footnote-text").clone().attr("id","tp-monthly-payment-footnote-text"),g.text(c),k.append(g)):(b(w.find("#tp-tool-tip-subtotal-price-value"),R,!1),k=w.find("#tp-tool-tip-subtotal-price-block"),c=k.find("#display-string").text(),c=u(c),a(k,c));1<d&&(k=v(),c=m.twisterState.price,e(k,d,c),d*=c,b(k.find("#tp-tool-tip-price"),d.toFixed(2).split("."),
!1),A.find("#tp-tool-tip-price-block").replaceWith(k));Q=D.get(E.TOOL_TIP_NAME).getContent();Q.html(w.html());Q.addClass("twister-plus-tool-tip-padding")}J=!1});return{init:function(){x=r("#tp-tool-tip-price-block");A=r("#tp-tool-tip-price-section");w=r("#twister-plus-tool-tip");n=w.clone();I=w.find("#tp-tool-tip-item-strings");J=!1;m=y.getTwisterPlusFeaturesState();M=h.getRenderedFeaturesList();if(!H){var a={};a.featureName=E.FEATURE_NAME;a.featureAttribution=E.FEATURE_ATTRIBUTION;f.registerFeature(a,
E.EVENT_NAME,d);F=h.getFeatureRegistrationDetails();H=!0}}}});h.when("A","twister-plus-constants","utils").register("twister-plus-unavailable-message",function(c,h,k){function C(b,a,c,u){u=k.getActiveAccordionRow(c,u);c=b[0];a=a[c];var v=a[0].displayQuantityMessage;v?(b=1===b.length?d.QUANTITY_RESTRICTION:d.MULTIPLE,u=1===f(b).length?f(b):u?u.find(b):f(d.ACTIVE_ACCORDION).find(b)):(b=1===b.length?d.SINGLE:d.MULTIPLE,u=u?u.find(b):f(d.ACTIVE_ACCORDION).find(b));b=u.parent().first();var l=a[0]&&a[0].maxQuantity,
p=a[0]&&a[0].orderSummaryDisplayString;p?(c=a[0].invalidSelectionTitle)&&(p=p+h.SPACE+h.OPENING_BRACKET+c+h.CLOSING_BRACKET):p=c;c=u.clone();c.removeClass(d.HIDDEN).addClass(d.DISPLAYABLE_MESSAGE);c.html(function(a,b){return v?b.replace("${cardName}",p).replace("${maxQuantity}",l):b.replace("${cardName}",p)});f(b).append(c)}function D(b,a){var c=f(d.CLASS+d.TEMPLATE),h=c.parent();f.each(b,function(b,f){b=c&&c.first()&&c.first().clone();b.removeClass(d.HIDDEN).removeClass(d.TEMPLATE).addClass(d.MESSAGE_ITEM);
var k=a[f],r=k[0]&&k[0].orderSummaryDisplayString||f;b.html(function(a,b){return b.replace("%cardName%",r)});h.append(b)})}var f=c.$,d=h.unavailableMessage;return{update:function(b){f(d.CLASS+d.DISPLAYABLE_MESSAGE).remove();f(d.CLASS+d.MESSAGE_ITEM).remove();var a=b.getCCRemovedSelections(),c=b.getCurrentBuyingOptionPosition();b=b.getCurrentGroupName();var h=a?Object.keys(a):t;h&&0<h.length&&(C(h,a,c,b),D(h,a))}}})});
/* ******** */
(function(d){var e=window.AmazonUIPageJS||window.P,h=e._namespace||e.attributeErrors,b=h?h("DetailPageABSMultiSelectionIngressAssets",""):e;b.guardFatal?b.guardFatal(d)(b,window):b.execute(function(){d(b,window)})})(function(d,e,h){d.when("A","dp-latency-marker","abs_msx_ingress_constants","abs_msx_html_builder","abs_msx_ingress_metrics","abs_msx_ingress_utils").register("abs_msx_ingress",function(b,g,a,v,k,p){function w(c){document.body.style.overflow="hidden";b.ajax(c,{method:"get",success:x,error:function(c){l=
!0;k.registerCounter(a.msxMetrics.MSX_AJAX_CALL_TO_FETCH_MSX_CONTENT_FAILED);m()}})}function x(c){n=!0;c=c.trim();/^\s*$/.test(c)?(l=!0,k.registerCounter(a.msxMetrics.MSX_EMPTY_RESPONSE_AFTER_AJAX_CALL_SUCCESS),m()):(h(c),d.when("msx_slotDataLoader").execute(function(a){a.initialLoad()}))}function h(c){b.hide(document.getElementById(a.MSX_SPINNER_HTML_ID));var f=document.getElementById(a.MSX_SIDE_SHEET_TOP_CONTAINER_HTML_ID);f&&f.insertAdjacentHTML("beforeend",c)}function y(){b.hide(document.getElementById(a.MSX_SPINNER_HTML_ID));
var c=document.getElementById(q),f=document.getElementById(r);c.style.display="block";p.deviceTypeMobile()?(null!==f&&(f.style.display="block",f.style.height="100vh"),c.style.height="100vh"):(b.show(document.getElementById(a.MSX_BACKGROUND_HTML_ID)),null!==f&&(f.style.width="605px"),c.style.width="605px");document.body.style.overflow="hidden"}function t(){b.hide(document.getElementById(a.MSX_SPINNER_HTML_ID));var c=document.getElementById(q),f=document.getElementById(r);p.deviceTypeMobile()?(f&&(f.style.height=
"0"),c.style.height="0"):(b.hide(document.getElementById(a.MSX_BACKGROUND_HTML_ID)),f&&(f.style.width="0"),c.style.width="0");document.body.style.overflow="scroll"}function m(){b.hide(document.getElementById(a.MSX_SPINNER_HTML_ID));document.getElementById(a.MSX_SIDE_SHEET_TOP_CONTAINER_HTML_ID).appendChild(document.getElementById(a.MSX_ERROR_MSG_ID));document.getElementById(a.MSX_ERROR_MSG_ID).classList.remove(a.MSX_AOK_HIDDEN_CLASS)}var u=!1,n=!1;g=a.viewEvents.CLICK;var r=a.msxSideSheetSelectors.MSX_SIDE_SHEET,
q=a.msxSideSheetSelectors.MSX_SIDE_SHEET_TOP_CONTAINER,l=!1;b.declarative("msxIngressClick",g,function(c){c=c.$event;c.stopPropagation();e.history.state&&e.history.state.page===a.MSX_STATE||e.history.pushState({page:a.MSX_STATE},null);e.onpopstate=function(){t()};k.registerCounter(a.msxMetrics.MSX_INGRESS_LINK_CLICKED);n||u||(d.register("msxIngressClick"),u=!0);v.createMsxContainer();if(c&&c.currentTarget&&c.currentTarget.dataset&&c.currentTarget.dataset.msxingressclick){c=JSON.parse(c.currentTarget.dataset.msxingressclick);
var f=c.asin;c="true"===String(c.isFlowEnabledForAjax).toLowerCase()?a.FLOW_INGRESS_URL_PREFIX+f+a.FLOW_INGRESS_URL_SUFFIX:a.GXA_PREFIX_URL+f+a.EXPERIENCE_ID_AND_SHOW_FEATURES_SUFFIX_URL;b.show(document.getElementById(a.MSX_SPINNER_HTML_ID));n||l?y():w(c)}else k.registerCounter(a.msxMetrics.MSX_INGRESS_CLICK_EVENT_FAILED),m()});b.declarative("close-multi-selection-experience",g,function(a){t()})});"use strict";d.when("dp-latency-marker").register("abs_msx_ingress_constants",function(b){return{MSX_SIDE_SHEET_OPENED:"msxSideSheetOpened",
GXA_PREFIX_URL:"/gp/product/ajax?asin\x3d",EXPERIENCE_ID_AND_SHOW_FEATURES_SUFFIX_URL:"\x26experienceId\x3dabsMultiSelection\x26showFeatures\x3dmsxPrimaryWidget",FLOW_INGRESS_URL_PREFIX:"/gp/product/ajax/absMultiSelection?asin\x3d",FLOW_INGRESS_URL_SUFFIX:"\x26showFeatures\x3dmsxPrimaryWidget",viewEvents:{CLICK:"click"},msxSideSheetSelectors:{MSX_SIDE_SHEET:"multi-selection-experience",MSX_SIDE_SHEET_TOP_CONTAINER:"msx-top-container"},msxSideSheetBackgroundSelectors:{MSX_BACKGROUND_DECLARATIVE_CONTENT:"\x3cspan class\x3d'a-declarative' data-action\x3d'close-multi-selection-experience' data-close-multi-selection-experience\x3d'{}'\x3e\x3c/span\x3e",
MSX_BACKGROUND_CONTENT:"\x3cdiv id\x3d'msx-background' class\x3d'a-section msx-darken-background'\x3e\x3c/div\x3e",MSX_SPINNER_CONTAINER_CONTENT:"\x3cdiv id\x3d'multi-selection-experience-spinner' class\x3d'a-spinner-wrapper aok-hidden'\x3e\x3c/div\x3e",MSX_CONTAINER_CONTENT:"\x3cdiv id\x3d'msx-top-container' class\x3d'a-section'\x3e\x3c/div\x3e"},msxMetrics:{MSX_AJAX_CALL_TO_FETCH_MSX_CONTENT_FAILED:"ABDpxMsx.ajaxCallToFetchMsxContentFailed",MSX_EMPTY_RESPONSE_AFTER_AJAX_CALL_SUCCESS:"ABDpxMsx.emptyResponseAfterAjaxCallSuccess",
MSX_INGRESS_CLICK_EVENT_FAILED:"ABDpxMsx.ingressClickEventFailed",MSX_INGRESS_LINK_CLICKED:"ABDpxMsx.ingressLinkClicked"},HTML_BODY_TAG:"body",MSX_ANIMATION_CONTAINER:"\x3cspan class\x3d'msx-spinner-container'\x3e",MSX_ANIMATION_CONTAINER_INNER:"\x3cspan class\x3d'msx-spinner-container-inner'\x3e",MSX_PAGE_LOAD_ANIMATION_CUSTOM:"\x3cspan class\x3d'msx-animation msx-page-load'\x3e\x3c/span\x3e",HTML_SPAN_CLOSE_TAG:"\x3c/span\x3e",DIV_LOAD_TEXT:"\x3cdiv class\x3d'msx-load-text'\x3e",HTML_SIZE_BASE_COLOR_BASE:"\x3cspan class\x3d'a-size-base a-color-base'\x3e",
MSX_FUN_STRING_SUSPENSEFUL_MUSIC:"MSX_FUN_STRING_SUSPENSEFUL_MUSIC",HTML_DIV_CLOSE_TAG:"\x3c/div\x3e",MSX_BACKGROUND_HTML_ID:"msx-background",MSX_SIDE_SHEET_TOP_CONTAINER_HTML_ID:"msx-top-container",MSX_SPINNER_HTML_ID:"multi-selection-experience-spinner",MSX_ERROR_MSG_ID:"msx-error-msg-id",MSX_STATE:"MSX",MSX_AOK_HIDDEN_CLASS:"aok-hidden"}});"use strict";d.when("jQuery","dp-latency-marker","abs_msx_ingress_constants","abs_msx_spinner_builder").register("abs_msx_html_builder",function(b,d,a,e){var k=
!1;return{createMsxContainer:function(){if(!k){var d=b(a.msxSideSheetBackgroundSelectors.MSX_BACKGROUND_CONTENT),g=b(a.msxSideSheetBackgroundSelectors.MSX_BACKGROUND_DECLARATIVE_CONTENT);d.appendTo(g);g.prependTo(a.HTML_BODY_TAG);d=e.getSpinnerComponent();g=b(a.msxSideSheetBackgroundSelectors.MSX_SPINNER_CONTAINER_CONTENT);var h=b(a.msxSideSheetBackgroundSelectors.MSX_CONTAINER_CONTENT);d.appendTo(g);g.appendTo(h);h.prependTo(a.HTML_BODY_TAG);k=!0}}}});"use strict";d.when("jQuery","dp-latency-marker",
"abs_msx_ingress_constants","msx-spinner-string").register("abs_msx_spinner_builder",function(b,d,a,e){return{getSpinnerComponent:function(){var d=a.MSX_ANIMATION_CONTAINER+a.MSX_ANIMATION_CONTAINER_INNER+a.MSX_PAGE_LOAD_ANIMATION_CUSTOM+a.HTML_SPAN_CLOSE_TAG;d+=a.DIV_LOAD_TEXT+a.HTML_SIZE_BASE_COLOR_BASE+e.getSpinnerString(a.MSX_FUN_STRING_SUSPENSEFUL_MUSIC)+a.HTML_SPAN_CLOSE_TAG+a.HTML_DIV_CLOSE_TAG;d+=a.HTML_SPAN_CLOSE_TAG;return b(d)}}});"use strict";d.when("dp-latency-marker").register("msx-spinner-string",
function(b){var d={MSX_FUN_STRING_SUSPENSEFUL_MUSIC:"[Suspenseful music plays]"};return{getSpinnerString:function(a){return d[a]}}});"use strict";d.when("dp-latency-marker").register("abs_msx_ingress_metrics",function(b){return{registerCounter:function(b){e.ue&&e.ue.count&&e.ue.count(b,(e.ue.count(b)||0)+1)}}});"use strict";d.when("dp-latency-marker").register("abs_msx_ingress_utils",function(b){return{deviceTypeMobile:function(){return!1}}})});
/* ******** */
(function(c){var e=window.AmazonUIPageJS||window.P,f=e._namespace||e.attributeErrors,a=f?f("DetailPageDeepCheckPromiseAssets",""):e;a.guardFatal?a.guardFatal(c)(a,window):a.execute(function(){c(a,window)})})(function(c,e,f){c.when("A","deep-check-promise-container","deep-check-promise-loader").register("deep-check-promise",function(a,k,d){return{asyncRequestDeepCheckPromise:function(b){var a=e.ue,c=e.uet,f=e.uex,l=b.url,g={},h=k.getDcpContainer(b);h.length?(h.hide(),g.params={asin:b.asin,buyingOptionIndex:b.buyingOptionIndex,
customerId:b.customerId,device:b.device,marketplaceId:b.marketplaceId,merchantId:b.merchantId,requestId:b.requestId,sessionId:b.sessionId,slateToken:b.slateToken},g.headers={"Accept-Language":b.language,"csrf-token":b.csrfToken},g.success=function(b){h.html(b.content);h.show();a&&a.count&&a.count("dcp_ajax_success",1);"function"===typeof c&&c("cf","DeepCheckPromise",{wb:1});"function"===typeof f&&f("ld","DeepCheckPromise",{wb:1})},g.error=function(b){h.hide();a&&a.count&&a.count("dcp_ajax_error",
1)},"function"===typeof c&&c("bb","DeepCheckPromise",{wb:1}),d.load(l,g)):a&&a.count&&a.count("dcp_container_not_found",1)}}});"use strict";c.when("A").register("deep-check-promise-container",function(a){return{getDcpContainer:function(c){var d=a.$;c=c.buyingOptionIndex;var b=d("[id\x3ddelivery-block-ags-dcp-container_"+c+"]");return b.length?b:d("[id\x3dags-dcp-container_"+c+"]")}}});"use strict";c.when("A").register("deep-check-promise-loader",function(a){return{load:function(c,d){d=d||{};d.method=
"post";d.contentType="application/json";d.paramsFormat="json";d.withCredentials=!0;a.ajax(c,d)}}})});
/* ******** */
(function(g){var h=window.AmazonUIPageJS||window.P,k=h._namespace||h.attributeErrors,b=k?k("DetailPageBuyBoxTabularLayoutDesktopAssets",""):h;b.guardFatal?b.guardFatal(g)(b,window):b.execute(function(){g(b,window)})})(function(g,h,k){g.when("A").execute("show-tabular-buybox-side-sheet",function(b){function e(a){c&&c.count&&c.count(a,(c.count(a)||0)+1)}function f(){d(".tabular-buybox").each(function(a,c){a=d(c);var l=!1;a.find(".tabular-buybox-text").each(function(a,b){a=d(b);if(a.css("line-clamp")!==
(3).toString()&&a.css("-webkit-line-clamp")!==(3).toString()){a=d(b).find(".tabular-buybox-text-message");var c=a.text();a.text("...");var e=b.offsetHeight;a.text(c);for(c=!1;b.offsetHeight>3*e;)c=!0,a.text(a.text().replace(/\W*\s(\S)*$/,"..."));l=c||b}else if(l=b.scrollHeight>b.clientHeight)return!1});a=a.find(".tabular-buybox-show-more");l?(b.show(a),e("DesktopTabularBuyBoxContentTruncated")):(b.hide(a),e("DesktopTabularBuyBoxContentExpanded"))})}var d=b.$,c=h.ue;d("#tabular-buybox-side-sheet-content a").attr("target",
"_blank");d("#tabular-buybox #sellerProfileTriggerId").click(function(){e("BuyBoxTabularLayoutDesktopLinkClicked")});b.declarative("close-tabular-buybox-side-sheet","click",function(a){function c(a){a.siblings("#tabular-buybox-side-sheet-content").show(function(){d(this).removeClass("tabular-buybox-side-sheet-content-display")})}(function(a){c(a);b.hide(a.find("#tabular-buybox-background"))})(d(a&&a.$currentTarget&&a.$currentTarget[0]));e("DesktopTabularSideSheetClosed")});b.declarative("show-tabular-buybox-side-sheet",
"click",function(a){function c(a){a.siblings("#tabular-buybox-side-sheet-content").show(function(){d(this).addClass("tabular-buybox-side-sheet-content-display")})}(function(a){var d=a.siblings('[data-action\x3d"close-tabular-buybox-side-sheet"]').find("#tabular-buybox-background");b.show(d);c(a)})(d(a&&a.$currentTarget&&a.$currentTarget[0]).closest("#tabular-buybox"));e("DesktopTabularSideSheetOpened")});f();b.on("a:accordion:buybox-accordion:select",f);b.on("a:tabs:offerDisplayGroup_tabs:select",
f);b.on("a:pageUpdate",f)});g.when("A","a-truncate","atf").execute("show-tabular-buybox-side-sheet-merchant-rating",function(b,e){function f(b){var a=d(b&&b.$currentTarget&&b.$currentTarget[0]).closest("#tabular-buybox");b=a.find("#tbb_mr_star_dp");if(0<b.size()){var e="div[data-side-sheet-attribute-name\x3d'"+b.parent().attr("tabular-attribute-name")+"']",a=a.siblings("#tabular-buybox-side-sheet-content").find(e);0<a.find("#tbb_mr_star_dp_side_sheet").size()||(a.append(b.clone()),a.find("[id^\x3dtbb]").attr("id",
function(a,b){return b+"_side_sheet"}))}}var d=b.$;b.declarative("show-tabular-buybox-side-sheet","click",function(b){f(b)})})});
/* ******** */
(function(d){var l=window.AmazonUIPageJS||window.P,g=l._namespace||l.attributeErrors,b=g?g("DetailPageUpsellSelectionAwareAssets",""):l;b.guardFatal?b.guardFatal(d)(b,window):b.execute(function(){d(b,window)})})(function(d,l,g){"use strict";d.when("selection-aware-constants").register("selection-aware-utils",function(b){var f=b.registerFeatures;return{isFeatureAlreadyRegistered:function(a,d){return a.hasOwnProperty(d)},validateFeature:function(a,b,e){var c=!0;a.hasOwnProperty(f.FEATURE_NAME)&&a.hasOwnProperty(f.FEATURE_ATTRIBUTION)||
(d.log("Properties missing in feature registration passed","ERROR",a.featureAttribution||a.featureName),c=!1);c&&(c=!0,b.hasOwnProperty(e)||(d.log("Functions missing in callbacks passed","ERROR",a.featureAttribution||a.featureName),c=!1));return c}}});"use strict";d.register("selection-aware-constants",function(){return{registerFeatures:{VALIDATE_FEATURE_DATA_CALLBACK:"validateFeatureData",UPDATE_FEATURE_SELECTION_CALLBACK:"updateFeatureSelection",CALLBACKS:"callbacks",FEATURE_NAME:"featureName",
FEATURE_REGISTRATION:"featureRegistration",FEATURE_ATTRIBUTION:"featureAttribution",SELECTION_TYPE:"selectionType"},metrics:{PREFIX:"selectionAware.",TRIGGER_FEATURE:"triggerFeatureRegistration.",LISTENER_FEATURE:"listenerFeatureRegistration.",SUCCESSFUL:"successful",FAILURE:"failure",FEATURE_ATTRIBUTION:"Website/Detail Page/Selection Aware Framework"}}});"use strict";d.when("selection-aware-constants").register("selection-aware-logger",function(b){var f=b.metrics;return{logCounter:function(a,b){a!==
g&&""!==a?(a=f.PREFIX+a,ue&&ue.count&&(b===g&&(b=(ue.count(a)||0)+1),ue.count(a,b))):d.log("counterKey must be non empty string","ERROR",f.FEATURE_ATTRIBUTION)}}});"use strict";d.when("A","selection-aware-utils","selection-aware-constants","selection-aware-logger").register("selection-aware-trigger-features",function(b,f,a,g){var e={},c=a.registerFeatures,h=a.metrics;return{addFeature:function(k,a){var b=k.featureName,n=h.FAILURE;f.isFeatureAlreadyRegistered(e,b)?d.log("Feature is already registered to Selection Aware framework as trigger feature",
"ERROR",e[b][c.FEATURE_REGISTRATION][c.FEATURE_ATTRIBUTION]):f.validateFeature(k,a,c.VALIDATE_FEATURE_DATA_CALLBACK)&&(e[b]={},e[b][c.CALLBACKS]=a,e[b][c.FEATURE_REGISTRATION]=k,n=h.SUCCESSFUL);g.logCounter(h.TRIGGER_FEATURE+n)},getTriggerFeature:function(c){return e[c]},getTriggerFeatures:function(){return e}}});"use strict";d.when("A","selection-aware-utils","selection-aware-constants","selection-aware-logger").register("selection-aware-listener-features",function(b,f,a,g){var e={},c=a.registerFeatures,
h=a.metrics;return{addFeature:function(b,a){var m=b.featureName,n=h.FAILURE;f.isFeatureAlreadyRegistered(e,m)?d.log("Feature is already registered to Selection Aware framework as listener feature","ERROR",e[m][c.FEATURE_REGISTRATION][c.FEATURE_ATTRIBUTION]):f.validateFeature(b,a,c.UPDATE_FEATURE_SELECTION_CALLBACK)&&(e[m]={},e[m][c.CALLBACKS]=a,e[m][c.FEATURE_REGISTRATION]=b,n=h.SUCCESSFUL);g.logCounter(h.LISTENER_FEATURE+n)},getListenerFeature:function(c){return e[c]},getListenerFeatures:function(){return e}}});
"use strict";d.when("A","selection-aware-constants","selection-aware-trigger-features","selection-aware-listener-features").register("selection-aware-handler",function(b,f,a,l){var e=f.registerFeatures;return{registerAsTriggerFeature:function(c,b){a.addFeature(c,b)},registerAsListenerFeature:function(c,b){l.addFeature(c,b)},updateFeatureSelection:function(c,h){var k=a.getTriggerFeature(c);k!==g?k[e.CALLBACKS].validateFeatureData(h)?(k=l.getListenerFeatures(),b.each(k,function(b,a){b[e.CALLBACKS].updateFeatureSelection(c,
h)})):d.log("Validation of featureData failed for the updated feature","ERROR",k[e.FEATURE_REGISTRATION][e.FEATURE_ATTRIBUTION]):d.log("Updated feature is not registered to Selection Aware Framework as trigger feature","ERROR",c);return!1},getUpdatedState:function(c,a,d){var f=b.copy(c);if("twisterPlus"!==a)if("add"===d[e.SELECTION_TYPE])f.hasOwnProperty(a)||(f[a]=[]),f[a].push(d);else{if("delete"===d[e.SELECTION_TYPE]&&(c=d.itemType,d=d[c],f.hasOwnProperty(a)))for(var g=0;g<f[a].length;g++)if(f[a][g][c]===
d){f[a].splice(g,1);break}}else b.each(d,function(a,b){f[b]=a});return f}}})});
/* ******** */
(function(c){var b=window.AmazonUIPageJS||window.P,d=b._namespace||b.attributeErrors,a=d?d("DetailPagePBXAssets",""):b;a.guardFatal?a.guardFatal(c)(a,window):a.execute(function(){c(a,window)})})(function(c,b,d){});
/* ******** */
(function(u){var n=window.AmazonUIPageJS||window.P,A=n._namespace||n.attributeErrors,R=A?A("DetailPageMiraiAssets@discover","DetailPageMiraiAssets"):n;R.guardFatal?R.guardFatal(u)(R,window):R.execute(function(){u(R,window)})})(function(u,n,A){function R(c){if(Array.isArray(c)){for(var a=0,b=Array(c.length);a<c.length;a++)b[a]=c[a];return b}return Array.from(c)}u.when("A","ready").register("mirai-device-types",function(){return{IS_MOBILE:!1,IS_TABLET:!1}});"use strict";u.when("A","ready").register("mirai-constants",
function(){return{BOX_ID_PREFIX:"shopbylook-btf-item-box-",GET_RECOMMENDATION_ADD_LIKE:"getRecommendationsForLikeDPX",GET_RECOMMENDATION_ADD_DISLIKE:"getRecommendationsForDislikeDPX",GET_RECOMMENDATION_QU2X:"getRecommendationsForSearchQueryDPX",NUM_ITEMS_TO_FLIP_PER_DISLIKE:1,MOBILE_NUM_ITEMS_PER_SHOW_MORE:6,MOBILE_NUM_ITEMS_PER_SHOW_MORE_ON_SHADOW_PREV:4,MOBILE_NUM_ITEMS_TO_FLIP:2,MOBILE_MAX_SHOW_MORE:2,RATINGS_HALF_STAR_THRESHOLD:.5,LIKE_PREFIX:"L",DISLIKE_PREFIX:"D",SBL_WEBSITE_ADDRESS_PREFIX:"/discover/",
IS_PRIME_CLASS:"shopbylook-prime",SBL_FLIP_BOX_CLASS:"shopbylook-btf-item-box-flip",MAX_NUMBER_OF_ITEMS_MOBILE:6,MIN_DESKTOP_WIDTH_NEEDED_FOR_ANCHOR:800,MAX_DESKTOP_PAGE_SIZE:10,REVIEW_KEYWORD_ITEM:".sbl-keyword-item-review",END_OF_RECOMMENDATIONS_START_INDEX:-1,INTIAL_NUMBER_OF_ITEMS_DESKTOP:12,LIKE_BUTTON_FOCUS:"a-button-focus",SCROLL_HEIGHT_MULTIPLIER:3.3,SCROLL_HEIGHT_MULTIPLIER_MOBILE:2.1,SHOPBYLOOK_INIT:"shopbylook-btf-items-section-p-1",MAX_BN_CHARS_IN_REFTAG:41,ERROR_TITLE_CODE:"99",TOP_FILTERS_PADDING:200,
FILTER_OPTIONS_WIDTH:210,BROWSE_SOURCE:"browse",MOBILE_REFINEMENT_BOTTOM_SHEET_NAMES:["0","1","2","All"],DEFAULT_EXPECTED_FONT_SIZE:13,REFINEMENT_SELECTOR_PREFIX:".sbl-refinement-",NEW_ITEM_ANIMATION_TIME:750,AUI_EMPTY_IMAGE_URL:"https://images-na.ssl-images-amazon.com/images/G/01/x-locale/common/grey-pixel.gif",DEFAULT_SHOW_TRANSITION_TIME:300,CAROUSEL_SIZE:12,SWATCH_MOBILE_NUMBER:3,SWATCH_DESKTOP_NUMBER:6,ALL_FILTERS_ID:"#sbl-all-filters",REFINEMENT_SHEET_OPTION_BUTTON:".sbl-refinement-option-button",
REFINEMENT_TOP_NAV_SEARCH_INPUT:".sbl-refinements-search-input-container input",REFINEMENT_SEARCH_HIDDEN_CLASS:"sbl-refinement-option-button-hidden",REFINEMENT_CATEGORY_HIDDEN_CLASS:"sbl-category-button-hidden",REFINEMENT_UNAVAILABLE_HIDDEN_CLASS:"sbl-refinement-value-button-hidden",TOP_REFINEMENT_SECTION_ID:"#sbl-top-refinement-section",BRAND_REFINEMENT_MAX:15}});"use strict";u.when("A","jQuery","mirai-device-types","mirai-constants","a-truncate","mirai-heart-button-helper","ready").register("mirai-utils",
function(c,a,b,f,e,h){function d(){a(n).scroll();c.trigger("a:image:lazyLoad")}function k(p,g,c,l,r){if(b.IS_MOBILE){if(!g)return}else if(0>=p.find(".shopbylook-btf-item-ratings-row").length&&!g)return;for(var M=b.IS_MOBILE?"a-star-mini-":"a-star-",e=0;5>=e;e++)g.removeClass(M+e).removeClass(M+e+"-5");!c||c<f.RATINGS_HALF_STAR_THRESHOLD||1>l?(p.find(".sbl-item-rating").addClass("aok-hidden"),p.find(".sbl-review-count").first().text("")):(l=Math.floor(c),g.addClass(M+l+(c-l>=f.RATINGS_HALF_STAR_THRESHOLD?
"-5":"")),p.find(".sbl-review-count").first().text(r),a(p.find(".sbl-item-rating").find("span")).first().text(c),p.find(".sbl-item-rating").removeClass("aok-hidden"))}function K(a,g,b){if(!(c.objectIsEmpty(a)&&c.objectIsEmpty(b)||c.objectIsEmpty(g))){c.objectIsEmpty(a)||a.addClass("aok-hidden");c.objectIsEmpty(b)||b.addClass("aok-hidden");var f=g.statusBadgeSource;g=g.offerLevelWithDealBadge;if(!c.objectIsEmpty(f)||!c.objectIsEmpty(g)){if(b&&!c.objectIsEmpty(g)&&g.dealBadgeEnable){var r=b.find(".sbl-deal-badge-label"),
e=b.find(".sbl-deal-badge-message");e.addClass("aok-hidden");r.attr("style","color:"+g.badgeStringColor+"; background-color:"+g.badgeBackgroundColor+";");r.text(g.badgeString);c.objectIsEmpty(g.supportString)&&c.objectIsEmpty(g.supportShortString)||(e.attr("style","color:"+g.supportStringColor+"; background-color:"+g.supportStringBackgroundColor+";"),e.text(g.countdownTimerIncluded?g.supportShortString:g.supportString),e.removeClass("aok-hidden"));b.removeClass("aok-hidden")}c.objectIsEmpty(f)||c.objectIsEmpty(a)||
(b=a.find(".sbl-status-badge"),b.removeClass(),b.addClass("sbl-status-badge"),b.addClass("sbl-"+f.badgeStyle),b.find(".sbl-badge-text").first().text(f.badgeString),a.removeClass("aok-hidden"))}}}function N(a,g){if(!c.objectIsEmpty(a)&&!c.objectIsEmpty(g)){a.addClass("aok-hidden");var b=g.energyLabel;if(!(c.objectIsEmpty(b)||c.objectIsEmpty(b.ratingLetter)||0==b.ratingLetter.length||c.objectIsEmpty(b.energyEfficiencyImageUrl)||c.objectIsEmpty(b.productDataSheetImageUrl)||0==b.energyEfficiencyImageUrl.length||
0==b.productDataSheetImageUrl.length)){var f=b.eu2021Standard,r=b.mobileDeviceType,e=f?a.find(".sbl-eel-2021"):a.find(".sbl-eel-pre2021"),h=f?a.find(".sbl-eel-pre2021"):a.find(".sbl-eel-2021"),k=e.find("span.a-declarative").first(),t=e.find(".a-popover-preload").first(),d=r?JSON.parse(k.attr("data-a-secondary-view")):JSON.parse(k.attr("data-a-modal"));d.name="energyEfficiencyImagePreload_"+g.asin;t.prop("id","a-popover-energyEfficiencyImagePreload_"+g.asin);t.attr("id","a-popover-energyEfficiencyImagePreload_"+
g.asin);r?k.attr("data-a-secondary-view",JSON.stringify(d)):k.attr("data-a-modal",JSON.stringify(d));k=e.find("span.a-declarative").last();t=e.find(".a-popover-preload").last();d=r?JSON.parse(k.attr("data-a-secondary-view")):JSON.parse(k.attr("data-a-modal"));d.name="productDataSheetImagesPreload_"+g.asin;t.prop("id","a-popover-productDataSheetImagesPreload_"+g.asin);t.attr("id","a-popover-productDataSheetImagesPreload_"+g.asin);r?k.attr("data-a-secondary-view",JSON.stringify(d)):k.attr("data-a-modal",
JSON.stringify(d));g=e.find("svg.badge-shape");g.find("path.badgeColor").attr("fill",b.hexColor);g.find("text.badgeLetter").text(b.ratingLetter);f||g.find("text.badgeSymbol").text(b.ratingSymbol);e.find(".eelImageUrl").attr("src",b.energyEfficiencyImageUrl);e.find(".eelImageUrl").attr("data-src",b.energyEfficiencyImageUrl);e.find(".eelImageUrl").data("src",b.energyEfficiencyImageUrl);e.find(".pdsImageUrl").attr("src",b.productDataSheetImageUrl);e.find(".pdsImageUrl").attr("data-src",b.productDataSheetImageUrl);
e.find(".pdsImageUrl").data("src",b.productDataSheetImageUrl);h.addClass("aok-hidden");e.removeClass("aok-hidden");a.removeClass("aok-hidden")}}}function C(a,b){a.attr("src",f.AUI_EMPTY_IMAGE_URL);a.attr("data-src",b.imageAddress);a.data("src",b.imageAddress);a.addClass("a-lazy-loaded");a.attr("alt",b.title);a.attr("title",b.title)}function u(a,b){a.find(".a-price-whole").text(b.priceDetails.integerValue);a.find(".a-price-symbol").text(b.priceDetails.currencySymbol);a.find(".a-price-fraction").text(b.priceDetails.fractionalValue);
a.find(".a-offscreen").text(b.price);a.find(".sbl-basis-price").text(c.objectIsEmpty(b.basisPrice)?"":b.basisPrice);a=a.find(".sbl-basis-price-label");c.objectIsEmpty(a)||a.text(c.objectIsEmpty(b.basisPrice)?"":b.priceLabel)}return{getElementData:function(a){var b=a.data();b.asin&&(b.asin=a.attr("data-asin"));b.mainAsin&&(b.mainAsin=a.attr("data-main-asin"));b.refinementValue&&(b.refinementValue=a.attr("data-refinement-value"));b.refinementType&&(b.refinementType=a.attr("data-refinement-type"));return b},
getCurrentItemBoxes:function(a){return a.find(".shopbylook-btf-item-box")},getMaxNumberOfItems:function(){return b.IS_MOBILE?f.MAX_NUMBER_OF_ITEMS_MOBILE:f.INTIAL_NUMBER_OF_ITEMS_DESKTOP},triggerLazyLoad:function(){c.delay(d,500)},hideSelectedRefinementsBar:function(a){b.IS_MOBILE?a.removeClass("sbl-filter-keywords-activate"):c.slideUp(a.find("#sbl-selected-refinement-row"),300,"ease-out",function(){})},closeSelectedRefinementItem:function(a){var b=1<arguments.length&&arguments[1]!==A?arguments[1]:
!1,f=2<arguments.length&&arguments[2]!==A?arguments[2]:null;c.animate(a,{width:"0",margin:"0",opacity:"0","border-radius":"0"},350,"ease-out",function(){a.remove();b&&f&&f()})},startLoading:function(a){a.find("#shopbylook-btf-loading-section").show()},stopLoading:function(a){a.find("#shopbylook-btf-loading-section").hide();d()},updateReviewStars:k,updateTruncate:function(b){b.find(".a-truncate").each(function(){e.get(a(this)).update()})},updateImageAttributes:C,updatePriceAttributes:u,updateEnergyLabel:N,
replacingSrcImage:function(a,b,c){var f=b.find(".shopbylook-btf-image-container").get(0).querySelector(".shopbylook-btf-image-elem");f&&(f.src=a);a=b.find(".shopbylook-image-section-middle-dot");a.removeClass("selected");a.eq(c).addClass("selected")},getSearchQuery:function(){var a=1<n.location.search.length?n.location.search.substring(1):"";return c.contains(a,"keywords\x3d")&&(a=a.split("keywords\x3d")[1],!c.objectIsEmpty(a)&&(a=decodeURIComponent(a.split("\x26")[0]).replace(/\+/g," "),0<a.length))?
a:""},getRefinementsQueryParameter:function(){var a;a=1<n.location.search.length?n.location.search.substring(1):"";if(0===a.length)a={};else{for(var b,c=/\+/g,f={},e=/([^&=]+)=?([^&]*)/g;b=e.exec(a);)f[decodeURIComponent(b[1]).replace(c," ")]=decodeURIComponent(b[2]).replace(c," ");a=f}return a.hasOwnProperty("refinements")?a.refinements:""},addNewRow:function(b,c,e,l,r,M,k,d){e=b.index()+e-b.index()%e-1;c=a(c.get(e));M=Math.min(M,k.length);for(l=e=0;l<M;l++)if(k[l].asin){h.updateNextHeartStrings(b);
var t=b.clone();t.css({height:0,opacity:0});d(t,k[l],!1)&&(e++,t.insertAfter(c),t.animate({height:r,opacity:1},f.NEW_ITEM_ANIMATION_TIME,function(){a(this).height("auto")}))}b.offset().top-n.pageYOffset>r&&0<e&&a("html, body").animate({scrollTop:n.pageYOffset+b.outerHeight()},350)},fillGap:function(a,b,c,f,e){b=b.last();var h=0,k=0;for(h;h<Math.min(c,f.length);h++)if(f[h].asin){var d=a.clone();e(d,f[h],!1)&&(d.insertAfter(b),k++)}return k},addRowsToEnd:function(b,c,e,h,r,k,d,G){h=Math.min(h,e.length);
var t=h-(0===h%2?2:1);G=G&&2<h;for(var N=!1,K=0,C=0;C<h;C++){var u=b.clone();if(N=k(u,e[C],!1))K++,u.css({height:0,opacity:0}),c.append(u),G&&C>=t?(u.animate({height:r,opacity:1},f.NEW_ITEM_ANIMATION_TIME,function(){a(this).css({height:"50px"})}),N=u.find(".sbl-shadow-preview-fading"),N.removeClass("hit-sbl-shadow-preview-fading-override"),N.removeClass("aok-hidden"),u=a(n).width(),N.css("width",u/2.3+"px")):u.animate({height:r,opacity:1},f.NEW_ITEM_ANIMATION_TIME,function(){a(this).height("auto")})}0<
K&&(c=a(n).scrollTop(),b=b.offset().top+r*d-(c+a(n).height()),0<b&&a("html, body").animate({scrollTop:c+b},350))},getRefinementReadableName:function(b,c,e,h,r){return"review"===e?c.refinementStarsAndUp.replace("${count}",h):"price"===e||0<b.find(".sbl-colorsprite").length?b.closest(f.REFINEMENT_SELECTOR_PREFIX+r).text():"prime"!==e?0===a(".sbl_refinement_"+e+"_title").length?b.closest(".a-expander-container").find(".sbl-refinement-expander-header-text span").text()+": "+b.closest(f.REFINEMENT_SELECTOR_PREFIX+
r).text():a(".sbl_refinement_"+e+"_title").first().text()+": "+b.closest(f.REFINEMENT_SELECTOR_PREFIX+r).text():""},redesignBoxSwap:function(p,g,d,l,r,M,Y){l&&p.toggleClass(f.SBL_FLIP_BOX_CLASS);p.prop("id",f.BOX_ID_PREFIX+g.asin);p.attr("data-asin",g.asin);p.data("asin",g.asin);p.attr("data-physical-id",g.physicalId);p.data("physicalId",g.physicalId);p.attr("data-csa-c-item-id",g.itemId?g.itemId:"amzn1.asin."+g.asin);(l=p.data("smlt-product-string-template"))&&p.find("input").attr("aria-label",l.replace("${product}",
g.title));C(p.find(".shopbylook-btf-image-elem"),g);l=d(g.asin);p.find(".sbl-item-top").children("a").attr("href",l);d=p.find(".sbl-product-title-wrapper");p.hasClass("hit-sbl-softline-update")&&!c.objectIsEmpty(d)&&(c.objectIsEmpty(d)||c.objectIsEmpty(g)||0===d.find(".a-truncate").size()||(d.addClass("aok-hidden"),d.find(".sbl-product-title-url").closest("a").attr("href",l),l=g.shortTitle,c.objectIsEmpty(l)||(d.find(".sbl-product-title-hover").attr("title",l),d.find(".a-truncate").find(".a-truncate-full").first().text(l),
e.get(d.find(".a-truncate")).update(),d.removeClass("aok-hidden"))));d=p.find(".sbl-item-brand");p.hasClass("hit-sbl-softline-update")&&!c.objectIsEmpty(d)&&(c.objectIsEmpty(d)||c.objectIsEmpty(g)||(d.addClass("aok-hidden"),l=g.productBrandSource,c.objectIsEmpty(l)||(d.find(".a-text-bold").text(l),d.removeClass("aok-hidden"))));d=p.find(".lists-framework-action-button");h.updateHeartWishList(d,g);u(p.find(".sbl-item-price").first(),g);k(p,p.find(".shopbylook-btf-item-ratings").first(),g.rating,g.ratingCount,
g.ratingCountStr);K(p.find(".sbl-status-badge-wrapper"),g,null);K(null,g,p.find(".sbl-offer-level-badge-wrapper-with-dealBadge"));d=p.find(".sbl-delivery-message");c.objectIsEmpty(d)||(d.addClass("aok-hidden"),l=g.deliveryMessage,c.objectIsEmpty(l)||(d.html(l),d.removeClass("aok-hidden")));if(Y&&(r=p.find(".shopbylook-image-gallery-override"),!c.objectIsEmpty(r)&&!c.objectIsEmpty(g)&&(r.find(".shopbylook-carousel-arrow-container").addClass("aok-hidden"),r.find(".shopbylook-image-section-middle-dot").removeClass("selected"),
r.find(".shopbylook-carousel-pagination span:first-child .shopbylook-image-section-middle-dot").addClass("selected"),d=g.asinImageUrlsJson,l=g.imageAddress,Y=g.asin,!c.objectIsEmpty(l)))){r.find(".wb-image-url-container").attr("data-wb-image-url",l);r.find(".wb-image-url-container").attr("wbImageUrl",l);l=[];c.objectIsEmpty(d)||(l=d.split(",").slice(0,4),r.find(".image-urls-container").attr("data-image-urls",l),r.find(".image-urls-container").attr("imageUrls",l));d=l.length+1;l=r.find(".shopbylook-carousel-pagination");
r=r.find(".sbl-pagination-bullet-label").data("pagination-bullet-label");l.empty();l.attr("role","list");for(var G=0;G<d;G++){var t=r.replace("${order}",G+1),n;if(b.IS_MOBILE)n=a("\x3cdiv\x3e").addClass("shopbylook-image-section-middle-dot-container").attr("role","listitem"),t=a("\x3cbutton\x3e").addClass("shopbylook-image-section-middle-dot "+(0===G?"selected":"")+" "+(1===d?"aok-hidden":"")).attr("id","shopbylook-image-section-middle-dot-"+G+"-"+Y).attr("aria-label",t),n.append(t);else{n=a("\x3cspan\x3e").attr("role",
"listitem");var A=a("\x3cspan\x3e").addClass("a-declarative").attr("data-action","sblThumbnailDetailPagination").attr("data-csa-c-type","widget").attr("data-csa-c-func-deps","aui-da-sblThumbnailDetailPagination").attr("data-sblthumbnaildetailpagination",JSON.stringify({page:G})),A=n.append(A);n=a("\x3cdiv\x3e").addClass("shopbylook-image-section-middle-dot-container");t=a("\x3cbutton\x3e").addClass("shopbylook-image-section-middle-dot "+(0===G?"selected":"")+" "+(1===d?"aok-hidden":"")).attr("id",
"shopbylook-image-section-middle-dot-"+G+"-"+Y).attr("aria-label",t);n.append(t);A.append(n);n=A}l.append(n)}}M&&N(p.find(".sbl-energy-efficiency-wrapper"),g);g.prime?p.find(".sbl-item-delivery").first().removeClass("aok-hidden"):p.find(".sbl-item-delivery").first().addClass("aok-hidden");p.removeClass("sbl-item-disliked");return!0},registerSelectedRefinementItem:function(a,b,c,f){a.addClass("sbl-keyword-item-"+f);a.attr("data-parent-item",".sbl-refinement-"+f);a.removeClass("sbl-filter-keyword-hidden").width("")},
getReviewPosition:function(){return a(f.TOP_REFINEMENT_SECTION_ID).find(f.REVIEW_KEYWORD_ITEM).first()},createNewButton:function(a,b,c,f,e,d){d=d.find(".sbl-filter-keyword-hidden").clone();var h=a.find(".sbl-softlines-colorsprite,.sbl-colorsprite");0<h.length&&h.clone().prependTo(d.find(".sbl-refinement-element-box"));d.find(".sbl-filter-keyword-text").text(this.getRefinementReadableName(a,e,b,c,f));d.data("refinementValue",c);return d},createTopRefinementButton:function(a,b,c,f,e,d){a=this.createNewButton(a,
b,c,f,e,d);a.addClass("sbl-inactive sbl-top-refinement-element");return a},getRefinementData:function(a){var b=a.closest(".sbl-refinements-bn-list");if(!b||0===b.length)return null;var c=this.getElementData(b),b=c.refinementType,e="@"+b,d=this.getElementData(a.closest(".refinement-row"));a=d.refinementValue;var h=d.refinementIndex,d="review"===b;c.refinementSource===f.BROWSE_SOURCE?e=c=a:(c=e+(a?":"+a:""),e=b+(a?"-"+(d?a:h):""));return{refinementType:b,value:a,isReview:d,filter:c,filterSelectorSuffix:e}}}});
"use strict";u.when("A","jQuery","ready").register("mirai-side-sheet-helper",function(c,a){function b(){d.animate({right:"0px"},500,function(){c.show(d.find(".sbl-side-sheet-close-icon"))})}function f(){c.hide(d.find(".sbl-side-sheet-close-icon"));d.animate({right:-n+"px"},500,function(){c.hide(d)})}function e(b){if(b.target.closest(".a-button")===a("#sbl-refinement-item-all")[0]){b.preventDefault();b=a("#sbl-all-filters .sbl-refinement-expander");b=a(b[b.length-1]);var c=d.find(".sbl-refinements-show-results");
d.find("#sbl-refinements-bottom-nav")[0].classList.contains("aok-hidden")&&(c=a(b.find(".sbl-refinement-expander-content")),c=c[0].hasAttribute("aria-expanded")&&"true"===c[0].getAttribute("aria-expanded")||c[0].hasAttribute("data-expanded")&&"true"===c[0].getAttribute("data-expanded")?c.find("input"):a(b.find(".sbl-refinement-expander-header")));c.focus()}else b.target===a("#sbl_top_refinement_prime_switch_input")[0]&&(b.preventDefault(),d.find(".sbl-side-sheet-close-button").focus())}var h=a("body"),
d=a("#sbl-side-sheet-section"),k=a("#sbl-side-sheet-background"),n=d.outerWidth()+d.find(".sbl-side-sheet-close-icon").outerWidth(!0);return{showSideSheet:function(){h.addClass("sbl-lock-background");c.show(k);c.show(d);b();a("#shopbylook-btf-loading-section").find(".a-spinner-wrapper").addClass("aok-hidden");document.addEventListener("focus",e,!0)},hideSideSheet:function(){f();c.hide(k);h.removeClass("sbl-lock-background");a("#shopbylook-btf-loading-section").find(".a-spinner-wrapper").removeClass("aok-hidden");
document.removeEventListener("focus",e,!0)},refreshSideSheet:function(b){b||(h=a("body"),d=a("#sbl-side-sheet-section"),k=a("#sbl-side-sheet-background"),n=d.outerWidth()+d.find(".sbl-side-sheet-close-icon").outerWidth(!0))}}});"use strict";u.when("A","jQuery","mirai-constants","mirai-utils","mirai-device-types","ready").register("mirai-discover-search-bar-helper",function(c,a,b,f,e){function h(){var c=a(b.ALL_FILTERS_ID);c.find(".sbl-refinement-see-more-btn-container").addClass("aok-hidden");c.find(".sbl-refinement-option-button").removeClass("aok-hidden")}
function d(){var c=a(b.ALL_FILTERS_ID);c.find(".sbl-refinement-see-more-btn-container").removeClass("aok-hidden");c.find(".refinement-type-section").each(function(){0<a(this).find(".sbl-refinement-see-more-btn-container").length&&a(this).find(".sbl-refinement-option-button:gt("+(b.BRAND_REFINEMENT_MAX-1)+")").addClass("aok-hidden")})}function k(b,c){a("#sbl-filters-results-text").text(c.replace("{count}",b))}function n(a){return a.availableFilters.filter(function(a){return"keywords_static"===a.filterType}).map(function(a){return a.filterId})}
function u(a){a=a.availableFilters.filter(function(a){return"keywords_dynamic"===a.filterType}).map(function(a){return a.filterId}).filter(function(a){return a.includes(":")}).map(function(a){return a.substring(a.indexOf(":")+1)});for(var b=4;0<b;b--)if(-1!==a.indexOf(b.toString())){for(--b;0<b;b--)-1===a.indexOf(b.toString())&&a.push(b.toString());break}return a}function C(a){a.find(".sbl-refinement-option-button:not(.sbl-refinement-value-button-hidden):not(.sbl-refinement-option-button-hidden):lt("+
b.BRAND_REFINEMENT_MAX+")").removeClass("sbl-brand-refinement-option-button-hidden");a.find(".sbl-refinement-option-button:not(.sbl-refinement-value-button-hidden):not(.sbl-refinement-option-button-hidden):gt("+(b.BRAND_REFINEMENT_MAX-1)+")").addClass("sbl-brand-refinement-option-button-hidden");a.find(".sbl-refinement-option-button.sbl-refinement-item-selected:not(.sbl-refinement-value-button-hidden):not(.sbl-refinement-option-button-hidden)").removeClass("sbl-brand-refinement-option-button-hidden")}
function R(c,d,h){a(b.TOP_REFINEMENT_SECTION_ID).find(".sbl-refinement-element-container:not(.sbl-filter-keyword-hidden):not(.sbl-smart-tag)").each(function(){var e=f.getElementData(a(this).find("input")).refinementValue.toString();-1===c.indexOf(e)&&-1===d.indexOf(e)&&a(b.ALL_FILTERS_ID).find(b.REFINEMENT_SELECTOR_PREFIX+e).hasClass(b.REFINEMENT_UNAVAILABLE_HIDDEN_CLASS)?a(this).addClass(b.REFINEMENT_UNAVAILABLE_HIDDEN_CLASS):a(this).removeClass(b.REFINEMENT_UNAVAILABLE_HIDDEN_CLASS)});!e.IS_MOBILE&&
h&&h()}function p(c,e){a(b.ALL_FILTERS_ID).find(b.REFINEMENT_SHEET_OPTION_BUTTON).each(function(){var d=f.getElementData(a(this).find("input")).refinementValue.toString();-1===c.indexOf(d)&&-1===e.indexOf(d)?a(this).addClass(b.REFINEMENT_UNAVAILABLE_HIDDEN_CLASS):a(this).removeClass(b.REFINEMENT_UNAVAILABLE_HIDDEN_CLASS)});a(b.ALL_FILTERS_ID).find(b.REFINEMENT_SHEET_OPTION_BUTTON+".sbl-refinement-item-selected").each(function(){a(this).closest(".sbl-refinements-bn-list").find(b.REFINEMENT_SHEET_OPTION_BUTTON).removeClass(b.REFINEMENT_UNAVAILABLE_HIDDEN_CLASS)})}
function g(){a(b.ALL_FILTERS_ID).find(".refinement-type-section").each(function(){0<a(this).find(b.REFINEMENT_SHEET_OPTION_BUTTON+":not(."+b.REFINEMENT_SEARCH_HIDDEN_CLASS+"):not(."+b.REFINEMENT_UNAVAILABLE_HIDDEN_CLASS+")").length?a(this).removeClass(b.REFINEMENT_CATEGORY_HIDDEN_CLASS):a(this).addClass(b.REFINEMENT_CATEGORY_HIDDEN_CLASS)})}function ia(c){a(b.ALL_FILTERS_ID).find(b.REFINEMENT_SHEET_OPTION_BUTTON).each(function(){-1!==a(this).text().toLowerCase().indexOf(c)||a(this).hasClass("sbl-refinement-item-selected")?
a(this).removeClass(b.REFINEMENT_SEARCH_HIDDEN_CLASS):a(this).addClass(b.REFINEMENT_SEARCH_HIDDEN_CLASS)})}function l(c){a(b.ALL_FILTERS_ID).find(".refinement-type-section").each(function(){-1!==a(this).find(".sbl-refinement-expander-header-content").text().toLowerCase().indexOf(c)&&(a(this).removeClass(b.REFINEMENT_CATEGORY_HIDDEN_CLASS),a(this).find(b.REFINEMENT_SHEET_OPTION_BUTTON).removeClass(b.REFINEMENT_SEARCH_HIDDEN_CLASS))})}return{startRefinementSheetLoading:function(){a("#shopbylook-refinement-loading-section").show()},
stopRefinementSheetLoading:function(){a("#shopbylook-refinement-loading-section").hide()},showResultsNumber:k,updateSheetBottomSection:function(e){e?(c.show(a("#sbl-refinements-bottom-nav")),h()):(c.hide(a("#sbl-refinements-bottom-nav")),d());""!==(a(b.REFINEMENT_TOP_NAV_SEARCH_INPUT).val().toLowerCase()||"").trim()&&h()},updateFiltersAndAsinCount:function(c,e){var f=2<arguments.length&&arguments[2]!==A?arguments[2]:null,d=n(c),h=u(c);p(d,h);g();R(d,h,f);k(c.asinCount,e);C(a(b.ALL_FILTERS_ID).find(".sbl-refinement-brand"))},
updateBrandRefinements:C,clearFilters:function(){var c=0<arguments.length&&arguments[0]!==A?arguments[0]:null,e=1<arguments.length&&arguments[1]!==A?arguments[1]:null,f=2<arguments.length&&arguments[2]!==A?arguments[2]:null,h=a(b.ALL_FILTERS_ID),k=a(b.TOP_REFINEMENT_SECTION_ID);h.find(b.REFINEMENT_SHEET_OPTION_BUTTON).each(function(){a(this).hasClass("a-button-selected")&&c?c(a(this),!0):a(this)[0].setAttribute("aria-pressed","false");a(this).removeClass("sbl-refinement-item-selected "+b.REFINEMENT_UNAVAILABLE_HIDDEN_CLASS)});
h.find(".refinement-button-selected-value").text("");g();k.find(".sbl-refinement-element-container:not(.sbl-keyword-item-review):not(.sbl-filter-keyword-hidden):not(.sbl-top-refinement-element)").closest(".a-declarative").remove();k.find(".sbl-top-refinement-element").each(function(){a(this).hasClass("a-button-selected")&&(c&&c(a(this),!0),e&&a(this).find("input")[0].getAttribute("data-refinement-value").includes("price")&&e(a(this).closest(".a-declarative")));a(this).removeClass(b.REFINEMENT_UNAVAILABLE_HIDDEN_CLASS)});
a(k.find(b.REVIEW_KEYWORD_ITEM)).hasClass("a-button-selected")&&c(k.find(b.REVIEW_KEYWORD_ITEM),!0);0===k.find(".sbl-prime-toggle").removeClass("sbl-prime-selected").length&&f&&f.isOn(!1);C(a(b.ALL_FILTERS_ID).find(".sbl-refinement-brand"));d()},searchBarFilterResults:function(e){var f=a(b.REFINEMENT_TOP_NAV_SEARCH_INPUT).val().toLowerCase()||"";ia(f);g();l(f);C(a(b.ALL_FILTERS_ID).find(".sbl-refinement-brand"));""===f.trim()?(c.hide(a("#sbl-refinement-search-clear-btn")),d()):(c.show(a("#sbl-refinement-search-clear-btn")),
h());""===f.trim()&&e&&h()},clearFilterSearchBar:function(e){a(b.REFINEMENT_TOP_NAV_SEARCH_INPUT).val("");a(b.ALL_FILTERS_ID).find(b.REFINEMENT_SHEET_OPTION_BUTTON).each(function(){a(this).removeClass(b.REFINEMENT_SEARCH_HIDDEN_CLASS)});C(a(b.ALL_FILTERS_ID).find(".sbl-refinement-brand"));g();c.hide(a("#sbl-refinement-search-clear-btn"));e||d()}}});"use strict";u.when("A","ready").register("mirai-action-type",function(){return{LIKE:"LIKE",DISLIKE:"DISLIKE",ADD_FILTER:"ADD_FILTER",REMOVE_FILTER:"REMOVE_FILTER",
ADD_TOP_FILTER:"ADD_TOP_FILTER",REMOVE_TOP_FILTER:"REMOVE_TOP_FILTER",CLEAR_FILTERS:"CLEAR_FILTERS",OPEN_FILTERS:"OPEN_FILTERS",CLOSE_FILTERS:"CLOSE_FILTERS",LOAD_MORE:"LOAD_MORE",ADD_SUGGESTED_FILTER:"ADD_SUGGESTED_FILTER",GO_TO_DETAIL_PAGE:"GO_TO_DETAIL_PAGE",GO_TO_DETAIL_PAGE_VARIATIONS:"GO_TO_DETAIL_PAGE_VARIATIONS",PLAY_VIDEO:"PLAY_VIDEO",ADD_HEART:"ADD_HEART",REMOVE_HEART:"REMOVE_HEART",V31_DESKTOP_SCROLL:"V31_DESKTOP_SCROLL"}});"use strict";u.when("A","mirai-device-types").register("mirai-video-ingress-helper",
function(c,a){function b(){var b=f.find("[data-asin]").map(function(){return c.$(this).data("asin")}).get();0<b.length&&function(){var d=function(a){""!==a&&(e=!0,f.append(a))},k={adaptiveWidgetContext:{asinList:b},clientPrefix:"discover",page:"Detail",placement:"HITDiscover",device:a.IS_MOBILE?"Mobile":"Desktop",product:{contentID:b[0],contentIDType:"ASIN"},requestId:n.ue?n.ue.id:""};u.when("dp-latency-marker").execute("mirai-video-ingress-execute-ajax",function(){c.post("/vap/ew/componentbuilder",
{params:k,paramsFormat:"json",contentType:"application/json",success:d})})}()}var f=void 0,e=!1;return{initialize:function(a){f=a;b()},update:function(){e?c.trigger("ive:discover:adaptiveWidget:update"):b()},updateHoverStatus:function(a){a.hasClass("has-ive-video ive-is-hovering")&&(a.trigger("mouseleave"),a.removeClass("ive-is-hovering"))}}});"use strict";u.when("A","jQuery","mirai-constants","mirai-utils","ready").register("mirai-discover-url-refinements-helper",function(c,a,b,f){return{addOrReorderTopRefsWithUrlRef:function(c,
h,d){c=a(b.ALL_FILTERS_ID).find(".sbl-refinement-"+c).first();var k=f.getRefinementData(c);if(k)if(a(b.TOP_REFINEMENT_SECTION_ID).find(".sbl-keyword-item-"+k.filterSelectorSuffix).hasClass("sbl-top-refinement-element"))d.find(".sbl-keyword-item-"+k.filterSelectorSuffix).insertAfter(f.getReviewPosition());else{var n=k.refinementType,u=k.filterSelectorSuffix;h=f.createTopRefinementButton(c,n,k.value,u,h,d);h.insertAfter(f.getReviewPosition());f.registerSelectedRefinementItem(h,c,n,u)}}}});"use strict";
"use strict";u.when("A","jQuery","ready").register("mirai-heart-button-helper",function(c,a){return{updateHeartWishList:function(a,f){if(!c.objectIsEmpty(a)&&!c.objectIsEmpty(f)&&(f=f.heartActionDetails,!c.objectIsEmpty(f))){var e=f.initialActions,h;c.objectIsEmpty(e)||""===e||(h=e.replace(/&quot;/g,'"'),h=h.replace(/&#34;/g,'"'));var e=f.hiddenActions,d;c.objectIsEmpty(e)||""===e||(d=e.replace(/&quot;/g,'"'),d=d.replace(/&#34;/g,'"'));f=f.serializedItemInfo;var k;c.objectIsEmpty(f)||""===f||(k=f.replace(/&quot;/g,
'"'),k=k.replace(/&#34;/g,'"'));c.objectIsEmpty(h)||(a=a.removeClass("lists-framework-replaced"),a.attr("data-lists-framework-initial-actions",h),a.data("listsFrameworkInitialActions",h));c.objectIsEmpty(d)||(a.attr("data-lists-framework-hidden-actions",d),a.data("listsFrameworkHiddenActions",d));c.objectIsEmpty(k)||(a.attr("data-lists-framework-item-info",k),a.data("listsFrameworkItemInfo",k),a.find("span").remove())}},updateNextHeartStrings:function(a){a.find(".lists-framework-hearts-notifications-changeover").css("display",
"none")}}});"use strict";var Sa="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(c){return typeof c}:function(c){return c&&"function"===typeof Symbol&&c.constructor===Symbol&&c!==Symbol.prototype?"symbol":typeof c};u.when("A","jQuery","mirai-device-types","mirai-constants","mirai-utils","mirai-action-type","mirai-side-sheet-helper","mirai-discover-search-bar-helper","mirai-video-ingress-helper","mirai-discover-url-refinements-helper","mirai-heart-button-helper","ready").execute("mirai-core",
function(c,a,b,f,e,h,d,k,K,N,C){function Ba(a,b){-1===L.indexOf(f.LIKE_PREFIX+b.asin)&&(L.push(f.LIKE_PREFIX+b.asin),I.push({asin:b.asin,iteration:O}))}function p(m,w,P){var d=e.getCurrentItemBoxes(v).first().clone();d.removeClass(f.SBL_FLIP_BOX_CLASS);d.removeClass("sbl-item-liked");v.empty();w=m?Math.min(w,m.length):0;var h=w-(0===w%2?2:1);P=P&&2<w;for(var g=0;g<w;g++){C.updateNextHeartStrings(d);var k=d.clone();if(P&&g>=h){k.each(function(){a(this).css({height:"50px"})});var l=k.find(".sbl-shadow-preview-fading");
l.removeClass("hit-sbl-shadow-preview-fading-override");l.removeClass("aok-hidden");l.css("width",qa/2.3+"px")}var l=m[g],q=Z(k,l,!1);-1<L.indexOf(f.LIKE_PREFIX+l.asin)&&Ba(k,l);q?v.append(k):w=Math.min(w+1,m.length)}e.updateTruncate(v);b.IS_MOBILE||v.addClass(f.SHOPBYLOOK_INIT);Ea();K.update();ea();c.trigger("lists-framework-reinitialize");fa()}function g(m){z&&(z.abort(),z=null);var b=I;0===I.length&&0===Q.length&&(b=[{asin:q.mainAsin,iteration:O}]);e.startLoading(x);k.startRefinementSheetLoading();
var c=x.find("#shopbylook-btf-items-section");aa=0<c.find(".hit-sbl-shadow-preview-loop").length;var d=(ga=0<c.find(".hit-sbl-shadow-preview").length)||aa,c=ha(y),g=e.getMaxNumberOfItems()+(d?2:0);c.positive=b;c.count=g+2;c.currentViewAsins=[];c.isFilterChange=!0;c.actionType=m;c.initialAsinList=q.initialAsinList.split(",");z=a.ajax({type:"POST",url:f.SBL_WEBSITE_ADDRESS_PREFIX+"getRecommendationsDPX",data:JSON.stringify(c),contentType:"application/json",dataType:"json",statusCode:{200:function(a){x.find("#shopbylook-btf-no-results-section").hide();
var m=a.dpxRecommendationItemList;U=a.nextStart;p(m,g,d);k.updateFiltersAndAsinCount(a,q.refinementResultCountStr,S);k.updateSheetBottomSection(0<y.length)},204:function(){x.find("#shopbylook-btf-no-results-section").show();v.find(".shopbylook-btf-item-box").not(":first").remove();V.hide();v.animate({height:ja},f.NEW_ITEM_ANIMATION_TIME,function(){a(this).height("auto")});k.showResultsNumber(0,q.refinementResultCountStr);k.updateSheetBottomSection(0<y.length)}}}).always(function(){e.stopLoading(x);
k.stopRefinementSheetLoading();ra();a("#sbl-search-title").hide();a("#sbl-header-title").show();k.clearFilterSearchBar(0<y.length)})}function ia(){z&&(z.abort(),z=null);var m=e.getCurrentItemBoxes(v),m=m?m.length:0;e.startLoading(x);var w,P=0,d=v.find(".hit-sbl-shadow-preview"),g=v.find(".hit-sbl-shadow-preview-loop"),k;k=0<d.length&&0===g.length?f.MOBILE_NUM_ITEMS_PER_SHOW_MORE_ON_SHADOW_PREV:f.MOBILE_NUM_ITEMS_PER_SHOW_MORE;w=b.IS_MOBILE?k:2*ba;P=Fa(m);m=w+P+(b.IS_MOBILE?0:2);k=I;0===I.length&&
0===Q.length&&(k=[{asin:q.mainAsin,iteration:O}]);var l=ha(y);l.positive=k;l.currentViewAsins=pa();l.start=U;l.count=m;l.iteration=O;l.actionType=h.LOAD_MORE;l.initialAsinList=q.initialAsinList.split(",");z=a.ajax({type:"POST",url:f.SBL_WEBSITE_ADDRESS_PREFIX+"getRecommendationsDPX",data:JSON.stringify(l),contentType:"application/json",dataType:"json",statusCode:{424:function(){}},success:function(m){if(m&&m.dpxRecommendationItemList){var h=m.dpxRecommendationItemList;U=m.nextStart;m=e.getCurrentItemBoxes(v).filter(":visible");
m.each(function(){C.updateNextHeartStrings(a(this))});var k=m.first().clone();k.removeClass(f.SBL_FLIP_BOX_CLASS);k.removeClass("sbl-item-liked");k=m.last();m=e.fillGap(k,m,P,h,Z);h=h.slice(m);v=x.find("#shopbylook-btf-items-section");d=v.find(".hit-sbl-shadow-preview");g=v.find(".hit-sbl-shadow-preview-loop");aa=0<g.length;if((ga=0<d.length)||aa)d.each(function(){a(this).removeClass("hit-sbl-shadow-preview");a(this).css({height:"auto",display:"inline-block"})}),ga||g.each(function(){a(this).css({height:"auto",
display:"inline-block"})}),v.find(".sbl-shadow-preview-fading").each(function(){a(this).removeClass("hit-sbl-shadow-preview-fading-override");a(this).addClass("aok-hidden")}),aa||a(".shopbylook-btf-items-section-row").find(".shopbylook-btf-mobile-expand-row").removeClass("sbl-show-more-shadow-preview");e.addRowsToEnd(k,v,h,w,ja,Z,b.IS_MOBILE?f.SCROLL_HEIGHT_MULTIPLIER_MOBILE:f.SCROLL_HEIGHT_MULTIPLIER,aa);v.removeClass(f.SHOPBYLOOK_INIT);K.update();ea();c.trigger("lists-framework-reinitialize");fa()}else U=
f.END_OF_RECOMMENDATIONS_START_INDEX}}).always(function(){Ea();e.updateTruncate(v);e.stopLoading(x)})}function l(m,w,d,g,h){z&&(z.abort(),z=null);if(0!==I.length||0!==Q.length){var k=pa(),l=e.getCurrentItemBoxes(v).filter(":visible"),p=l.length,n=v.find("#"+f.BOX_ID_PREFIX+m.asin),r=b.IS_MOBILE&&n.hasClass("hit-sbl-smlt-update")?w?ba+2:1:w?ba:1,u=b.IS_MOBILE?0:Fa(p),t=0<u&&p+u-ba<=g,p=ha(y);p.asin=m.asin;p.physicalId=m.physicalId;p.positive=I;p.currentViewAsins=k;p.count=r+u+2+0;p.asinIndex=g;p.actionType=
h;w||(p.initialAsinList=q.initialAsinList.split(","));z=a.ajax({type:"POST",url:f.SBL_WEBSITE_ADDRESS_PREFIX+d,data:JSON.stringify(p),contentType:"application/json",dataType:"json",statusCode:{200:function(a){a=a.dpxRecommendationItemList;if(w){if(!b.IS_MOBILE&&t){var d=e.fillGap(n,l,u,a,Z);a=a.slice(d);l=e.getCurrentItemBoxes(v).filter(":visible")}e.addNewRow(n,l,ba,v,ja,r,a,Z);e.updateTruncate(v);b.IS_MOBILE||v.removeClass(f.SHOPBYLOOK_INIT)}else{for(var d=v.find("#"+f.BOX_ID_PREFIX+m.asin),P=0;null!==
a&&!Z(d,a[P])&&P<a.length;)P++;e.updateTruncate(v)}e.updateTruncate(v);K.update();ea();c.trigger("lists-framework-reinitialize");fa()},204:function(){var a=x.find("#sbl-no-content-message");V.hide();if(!c.objectIsEmpty(a)){var b=v.find("#"+f.BOX_ID_PREFIX+m.asin),w=v.offset();a.css({top:b.find(".sbl-item-details").offset().top-w.top,left:b.offset().left-w.left,width:b.outerWidth()});a.stop(!0,!0).fadeIn(200).delay(4E3).fadeOut(200)}}}}).always(function(){e.triggerLazyLoad()})}}function r(m){var c;
c=b.IS_MOBILE?a("#refinement-all-sheet").find(".sbl-refinement-"+m).first():a(".sbl-refinement-"+m).first();if(m.startsWith("@tag")){c=m.slice(5).split(" ").map(function(a){return a.charAt(0).toUpperCase()+a.slice(1)}).join(" ");m=x.find(".sbl-filter-keyword-hidden").closest(".a-declarative").clone();var e=m.find(".sbl-filter-keyword-hidden");e.find(".sbl-filter-keyword-text").text(c);e.addClass("sbl-smart-tag");e.removeClass("sbl-filter-keyword-hidden").width("");W(m,!0)}else m=(m=sa(c))?a(f.TOP_REFINEMENT_SECTION_ID).find(".sbl-keyword-item-"+
m.filterSelectorSuffix).hasClass("sbl-top-refinement-element"):!1,ta(c,!0,m,!1)}function M(m){z&&(z.abort(),z=null);var b=[{asin:q.mainAsin,iteration:O}],d=ha(y);d.positive=b;d.count=e.getMaxNumberOfItems();d.currentViewAsins=q.initialAsinList.split(",");d.isFilterChange=!1;d.searchQuery=m;d.refinementsQueryParameter=e.getRefinementsQueryParameter();d.topPickers=function(){return Array.from(a(".sbl-top-refinement-element").map(function(){return""+a(this).data("refinementValue")}))}();var g=function(a){var m=
!0,b=!1,c=A;try{for(var w=[].concat(R(a.topPickers||[])).filter(function(a){return d.topPickers.includes(a)}).reverse()[Symbol.iterator](),e;!(m=(e=w.next()).done);m=!0)N.addOrReorderTopRefsWithUrlRef(e.value,q,x)}catch(f){b=!0,c=f}finally{try{!m&&w.return&&w.return()}finally{if(b)throw c;}}};z=a.ajax({type:"POST",url:f.SBL_WEBSITE_ADDRESS_PREFIX+"getRecommendationsForSearchQueryDPX",data:JSON.stringify(d),contentType:"application/json",dataType:"json",statusCode:{200:function(b){var w=b.refinements;
if(!c.objectIsEmpty(w)){if(!0===b.titleShown){var d=a("#sbl-search-title"),f;f=d.hasClass("a-cardui-title")?d.find(".a-cardui-title-text").first():d.first();d.show();d=null===b.searchQueryTitle||b.searchQueryTitle===A?q.searchInputTitle.replace("${query}",'\x3cspan class\x3d"sbl-font-emphasis"\x3e'+m+"\x3c/span\x3e"):b.searchQueryTitle;f.html(d);a("#sbl-header-title").hide();D.find("#shopbylook-btf-no-results-section").hide()}U=b.nextStart;g(b);Ca(b);k.updateFiltersAndAsinCount(b,q.refinementResultCountStr);
k.updateSheetBottomSection(0<w.length);c.each(w,r);w=(b=b.dpxRecommendationItemList)?b.length:0;w=Math.min(e.getMaxNumberOfItems(),w);p(b,w);ra();e.triggerLazyLoad();K.update();ea();c.trigger("lists-framework-reinitialize");fa()}},206:function(a){g(a);Y(a)}}})}function Y(a){Array.isArray(a.urlRefinements)&&0<a.urlRefinements.length&&a.urlRefinements.some(function(a){return""!==a.trim()})&&a.urlRefinements.forEach(function(a){N.addOrReorderTopRefsWithUrlRef(a,q,x)})}function G(){var a=I;0===I.length&&
0===Q.length&&(a=[{asin:q.mainAsin,iteration:O}]);var b=ha(y);b.positive=a;b.count=e.getMaxNumberOfItems();b.currentViewAsins=[];b.isFilterChange=!1;return b}function t(m,b,c){if(q!==A&&null!==q){var d=G();d.actionType=m;if(m===h.GO_TO_DETAIL_PAGE){if(!b)return;d.asin=b.asin;d.physicalId=b.physicalId;d.asinIndex=c}z=a.ajax({type:"POST",url:f.SBL_WEBSITE_ADDRESS_PREFIX+"recordActionDPX",data:JSON.stringify(d),contentType:"application/json",dataType:"json"})}}function Ra(a,b,c,d){a=a.clone();var e=
a.find(".refinement-row");a.find(".shopbylook-btf-clickable").text(c);e.removeClass();e.addClass("refinement-row sbl-refinement-option-button");e.addClass("sbl-refinement-"+b);e.find("input").attr("data-refinement-value",b);e.find("input").attr("data-refinement-index",d);e.addClass("a-button a-button-normal a-button-toggle v31-sheet-all-refinement");T.append(a)}function Ca(m){if(!c.objectIsEmpty(m.fullRefinementItems)){m=m.fullRefinementItems.find(function(a){return a.type&&"brand"===a.type});T=Ga.find("#sbl-refinements-bn-list-"+
m.id);T.addClass("sbl-refinement-brand");var b=T.find(".a-declarative").length,d=[];T.find(".a-declarative .sbl-refinement-option-button").each(function(){d.push(e.getElementData(a(this).find("input")).refinementValue.toString())});for(var f in m.childNodes)-1===d.indexOf(f)&&(Ra(T.find(".a-declarative").first(),f,m.childNodes[f],b),b+=1);k.updateBrandRefinements(T)}}function Da(){if(q!==A&&null!==q&&!T){var m=G();z=a.ajax({type:"POST",url:f.SBL_WEBSITE_ADDRESS_PREFIX+"getFullRefinementsDPX",data:JSON.stringify(m),
contentType:"application/json",dataType:"json",statusCode:{200:function(a){Ca(a)}}})}}function pa(){var m=e.getCurrentItemBoxes(v).map(function(){return e.getElementData(a(this)).asin}).get();b.IS_MOBILE||m.push(q.mainAsin);return m}function Z(a,w,d){if(null===a||0===a.length||w===A||ka&&c.objectIsEmpty(w.basisPrice))return!1;if(d===A||d)a.toggleClass(f.SBL_FLIP_BOX_CLASS),a.removeClass("sbl-item-liked"),a.removeClass("sbl-item-disliked");if(!b.IS_MOBILE)return e.redesignBoxSwap(a,w,ua,d,!1,va,la),
w.prime?a.addClass(f.IS_PRIME_CLASS):a.removeClass(f.IS_PRIME_CLASS),K.updateHoverStatus(a),!0;e.redesignBoxSwap(a,w,ua,d,!0,va,la);a.removeClass("sbl-item-liked").removeClass("sbl-item-disliked");return!0}function Fa(a){var b=Ha();a%=b;return 0<a?b-a:0}function Ha(){return Math.floor(v.width()/v.children().eq(0).width())}function ua(a){var c=encodeURIComponent(e.getSearchQuery()),c=0<c.length?"?keywords\x3d"+c:"",d;d=q.browseNode.substring(0,f.MAX_BN_CHARS_IN_REFTAG);if(b.IS_MOBILE)d="sbl_dpx_m_"+
d+"_"+q.mainAsin;else{var g=q.desktopTitleCode;d="sbl_dpx_"+d+"_"+q.mainAsin+"_"+(!g||2!==g.length&&3!==g.length?f.ERROR_TITLE_CODE:q.desktopTitleCode)}return"/dp/"+a+"/ref\x3d"+d+c}function Ia(){var m=a("#desktop-dp-btf-shopbylook").width();a("#mirai-btf-shopbylook-row").width()<m?a(".sbl-btf-suggestion-items-section").addClass("sbl-ads-override"):a(".sbl-btf-suggestion-items-section").removeClass("sbl-ads-override");ba=Ha();b.IS_MOBILE||S()}function S(){var b=H[0].scrollLeft,c=H[0].scrollWidth-
H[0].clientWidth-b;2<b?a("#refinement_carousel_scroller_left").removeClass("aok-hidden"):a("#refinement_carousel_scroller_left").addClass("aok-hidden");2<c?a("#refinement_carousel_scroller_right").removeClass("aok-hidden"):a("#refinement_carousel_scroller_right").addClass("aok-hidden")}function ra(a){var c=y.length;0===c&&e.hideSelectedRefinementsBar(x);a||(a=x.find(b.IS_MOBILE?"#sbl-btf-refinement-row":"#sbl-refinement-row"));-1<y.indexOf("@prime")&&--c;-1<y.indexOf("@review:4")&&--c;a=a.find("#sbl-show-more-selected");
0<c?(a.text("("+c+")"),a.removeClass("aok-hidden"),a.closest(".a-button-toggle").removeClass("a-button-normal"),a.closest(".a-button-toggle").addClass("a-button-selected")):(a.text(""),a.addClass("aok-hidden"),a.closest(".a-button-toggle").addClass("a-button-normal"),a.closest(".a-button-toggle").removeClass("a-button-selected"))}function Ta(){f.MOBILE_REFINEMENT_BOTTOM_SHEET_NAMES.forEach(function(b){c.on("a:sheet:beforeShow:sbl"+b+"Sheet",function(c){t(h.OPEN_FILTERS);c=a("#refinement-"+b.toLowerCase()+
"-sheet").closest(".a-sheet-web");c.height(n.innerHeight*("All"===b?.8:.5));Da();wa(!1,c)});c.on("a:sheet:beforeHide:sbl"+b+"Sheet",function(a){t(h.CLOSE_FILTERS)})})}function sa(a){var b=a.closest(".sbl-refinements-bn-list");if(!b||0===b.length)return null;var c=e.getElementData(b),b=c.refinementType,d="@"+b,g=e.getElementData(a.find("input"));a=g.refinementValue;var h=g.refinementIndex,g="review"===b;c.refinementSource===f.BROWSE_SOURCE?d=c=a:(c=d+(a?":"+a:""),d=b+(a?"-"+(g?a:h):""));return{refinementType:b,
value:a,isReview:g,filter:c,filterSelectorSuffix:d}}function Ja(a,b){var c=y.indexOf(a);-1<c?(y.splice(c,1),J=b?h.REMOVE_TOP_FILTER:h.REMOVE_FILTER):(y.push(a),J=b?h.ADD_TOP_FILTER:h.ADD_FILTER)}function Ua(b,c,d,e,f){a(".sbl_refinement_"+c+"_selected").each(function(){var c=a(this);d?c.text(0<b?q.refinementStarsAndUp.replace("${count}",e):""):c.text(0<b?"("+b+")":"")})}function W(c,d){var e=2<arguments.length&&arguments[2]!==A?arguments[2]:!1;d?(b.IS_MOBILE?e?c.prependTo(c.closest(".sbl-two-row-refinements")):
c.prependTo(x.find("#sbl-two-row-other-refinements")):(c.prependTo(x.find("#sbl-top-refinement-section")),S()),H.animate({scrollLeft:0},600)):(e=b.IS_MOBILE?c.closest(".sbl-two-row-refinements").find(".sbl-refinement-element-container:not(.a-button-normal):not(.sbl-filter-keyword-hidden)"):x.find(f.TOP_REFINEMENT_SECTION_ID).find(".sbl-refinement-element-container:not(.a-button-normal):not(.sbl-filter-keyword-hidden):not(.sbl-filter-keyword-prime)"))&&0!==e.length?b.IS_MOBILE&&c.find("input")[0].getAttribute("data-refinement-value").includes("price")?
xa(c,e.last().closest(".a-declarative")):(c.insertAfter(e.last().closest(".a-declarative")),b.IS_MOBILE||S()):b.IS_MOBILE?c.find("input")[0].getAttribute("data-refinement-value").includes("price")?xa(c):c.prependTo(c.closest(".sbl-two-row-refinements")):(c.prependTo(a("#sbl-top-refinement-section")),S())}function ya(a){return a.find(".a-button-input")[0].getAttribute("data-refinement-value").replace("price-","")}function xa(b){for(var c=1<arguments.length&&arguments[1]!==A?arguments[1]:null,d=ya(b),
e=a("#sbl-two-row-review-price-refinements").find(".sbl-refinement-element-container:not(.sbl-keyword-item-review)").length,g=a("#sbl-two-row-review-price-refinements").find(".sbl-refinement-element-container:not(.sbl-keyword-item-review):not(.a-button-selected)").not(b),h=0;h<g.length;h++){var k=a(g[h].closest(".a-declarative")),l=ya(k),p=h<g.length-1?ya(a(g[h+1])):e;if(d<l)break;if(d>l&&d<p){b.insertAfter(k);return}}c&&0<a("#sbl-refinements-bn-list-review").find(".a-button-selected").length?b.insertAfter(c):
b.insertAfter(a(f.TOP_REFINEMENT_SECTION_ID).find(f.REVIEW_KEYWORD_ITEM).closest(".a-declarative").first())}function X(a,b){a.toggleClass("a-button-normal");a.toggleClass("a-button-selected");b?a.find("input")[0].setAttribute("aria-pressed","false"):a.find("input")[0].setAttribute("aria-pressed","true");a.find(".close-icon").toggleClass("aok-hidden");a.find(".add-icon").toggleClass("aok-hidden");a.removeClass(f.LIKE_BUTTON_FOCUS)}function ta(c,d,h,k){var l=c.hasClass("sbl-refinement-item-selected"),
p=c.closest(".sbl-refinements-bn-list");if(p&&0!==p.length){var n=sa(c),r=n.refinementType,u=n.value,v=n.isReview,t=n.filter,n=n.filterSelectorSuffix;J=null;X(a(f.REFINEMENT_SELECTOR_PREFIX+n),l);a(f.REFINEMENT_SELECTOR_PREFIX+n).toggleClass("sbl-refinement-item-selected");Ua(p.find(".sbl-refinement-item-selected").length,r,v,u,t);Ja(t,k);k=x.find(".sbl-keyword-item-"+(v?r:n)).closest(".a-declarative").find(".a-button-selected");t=y.indexOf(t);l||k.length&&!(-1>=t)?l&&k.length&&(h?(c=x.find(".sbl-keyword-item-"+
n),X(c,l),W(c.closest(".a-declarative"),!1,!0)):e.closeSelectedRefinementItem(k.first().closest(".a-declarative"),!b.IS_MOBILE,S)):h?(c=x.find(".sbl-keyword-item-"+n),X(c,l),W(c.closest(".a-declarative"),!0,!0)):(l=x.find(".sbl-filter-keyword-hidden").closest(".a-declarative").clone(),h=l.find(".a-button"),t=h.find("input"),k=h.find(".a-button-text"),t.addClass("sbl-keyword-item-"+n),t.attr("data-parent-item",".sbl-refinement-"+n),t.attr("data-refinement-value",n),t.attr("aria-labelledby","a-"+n+
"-announce"),h.attr("id","a-"+n),k.attr("id","a-"+n+"-announce"),h.removeClass("sbl-filter-keyword-hidden").width(""),h=c.find(".sbl-softlines-colorsprite,.sbl-colorsprite"),0<h.length&&(za(h),h.clone().prependTo(l.find(".sbl-refinement-element-box"))),l.find(".sbl-filter-keyword-text").text(e.getRefinementReadableName(c,q,r,u,n)),W(l,!0));d||g(J)}}function Ka(a){var b=y.indexOf("@prime");0>b?(y.push("@prime"),a.find(".sbl-prime-toggle").addClass("sbl-prime-selected"),J=h.ADD_FILTER):(y.splice(b,
1),a.find(".sbl-prime-toggle").removeClass("sbl-prime-selected"),J=h.REMOVE_FILTER);g(J)}function Ea(){U===f.END_OF_RECOMMENDATIONS_START_INDEX?V.hide():V.show()}function ma(){if(!La)if(c.objectIsEmpty(x))c.off("scroll",ma);else if(c.onScreen(x,b.IS_MOBILE?100:50)){c.off("scroll",ma);var a=e.getSearchQuery();c.objectIsEmpty(a)||M(a)}}function Va(){var b=a(f.REFINEMENT_TOP_NAV_SEARCH_INPUT);b.val("");b.bind("input",function(){k.searchBarFilterResults(0<y.length)})}function ca(a){B=a.$currentTarget.closest(".shopbylook-btf-item-box-inner").closest(".shopbylook-btf-item-box")}
function na(a){var b=a.find(".image-urls-container").data("image-urls");a=a.find(".wb-image-url-container").data("wb-image-url");E=[];E=[a].concat(b.split(","))}function wa(a){var d=1<arguments.length&&arguments[1]!==A?arguments[1]:null;a?c.each(x.find(".sbl-top-refinement-scroller-v31").find(".sbl-color-span"),za):c.each(b.IS_MOBILE&&d?d.find(".sbl-color-span"):x.find(".sbl-side-sheet-content").find(".sbl-color-span"),za)}function za(b){b=a(b);var c=b.attr("data-refinement-image-css");b.attr("style",
c);b.removeClass("aok-hidden");b.removeClass("sbl-color-span")}function Ma(){D=a(b.IS_MOBILE?"#mobile-dp-btf-shopbylook":"#desktop-dp-btf-shopbylook");x=a("#mirai-btf-shopbylook-row");if(0<x.length){c.state.parse();var m=c.state("shopbylookStateData");m||D.hide();Ga=b.IS_MOBILE?a(".sbl-bottom-sheet"):x;var f=0<D.length&&0<a("#miraiBTFShopByLook_feature_div").length&&a("#miraiBTFShopByLook_feature_div").hasClass("js-feature-refresh-overlay"),g=e.getElementData(x),k=g.mainAsin;f||D.show();q&&q.mainAsin===
k||q&&!k||!m?f&&D.hide():(f&&(a("#miraiBTFShopByLook_feature_div").removeClass("js-feature-refresh-overlay"),a("#miraiBTFShopByLook_feature_div").css({opacity:""})),wa(!0),q=m,m=q.mainAsin!==k,q.mainAsin=k?k:q.mainAsin,q.browseNode=g.browseNode?g.browseNode:q.browseNode,0<D.length&&D.find("h2"),b.IS_MOBILE||d.refreshSideSheet(b.IS_MOBILE),K.initialize(D),I=[],Q=[],L=[],O=0,U=null,y=[],La=D.hasClass("sbl-interactive-disabled"),va=D.hasClass("sbl-eel-enabled"),v=x.find("#shopbylook-btf-items-section"),
q.initialAsinList=m?pa().join(","):q.initialAsinList,g=x.find(".shopbylook-btf-desktop-expand-row"),g=0!==g.length?g:x.find("#shopbylook-btf-desktop-show-more"),V=b.IS_MOBILE?x.find("#shopbylook-btf-mobile-show-more"):g,b.IS_MOBILE?H=a("#sbl-top-refinement-section"):(H=a("#sbl-top-refinement-section"),H[0].addEventListener("scroll",function(){Aa||(t(h.V31_DESKTOP_SCROLL),Aa=!0);S()}),Aa=!1),Ia(),n.addEventListener("resize",Ia),Va(),ja=e.getCurrentItemBoxes(v).first().outerHeight(),c.onScreen(x,0)||
(c.off("scroll",ma),c.on("scroll",ma)),b.IS_MOBILE?b.IS_MOBILE&&!Na&&(Ta(),Na=!0):ra(),ga=0<v.find(".hit-sbl-shadow-preview").length,qa=a(n).width(),ga&&v.find(".sbl-shadow-preview-fading").slice(-2).each(function(b){0===b&&a(this).css("width",qa/2.3+"px")}),g=v.find(".shopbylook-btf-item-box"),la=D.hasClass("hit-sbl-swipeable-gallery-update"),g.each(function(){var b=a(this),c=e.getElementData(b),c=ua(c.asin);b.find("a.sbl-image-link").attr("href",c);la&&b.find(".shopbylook-image-section-middle-dot").first().addClass("selected")}))}else q&&
(q.mainAsin=null)}function ea(){D.find(".play-icon-placeholder").unbind("click");D.find(".play-icon-placeholder").click(function(){t(h.PLAY_VIDEO)})}function fa(){D.find(".sbl-suggestion-box-hearts-container").unbind("click");D.find(".sbl-suggestion-box-hearts-container").click(function(b){var c=a(this).find(".lists-framework-filled-heart");b=!a(this).find(".lists-framework-unfilled-heart").hasClass("aok-hidden");c=!c.hasClass("aok-hidden");b?t(h.ADD_HEART):c&&t(h.REMOVE_HEART)})}function ha(a){var b=
{browseNode:q.browseNode,anchorAsin:q.mainAsin,anchorAsinPid:q.mainAsinPid,negative:Q,iteration:O},c=[];a.forEach(function(a){if(a&&"object"===("undefined"===typeof a?"undefined":Sa(a))&&"price"===a.type)a.min&&(b.minPrice=a.min),a.max&&(b.maxPrice=a.max);else if("deal"==a){a=new Date;var d=new Date(a.getTime()+18E4),m={year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1};b.startViewDealTime=a.toLocaleString("ja-JP",m).replaceAll("/","-").replace(",",
"");b.endViewDealTime=d.toLocaleString("ja-JP",m).replaceAll("/","-").replace(",","")}else a&&"string"==typeof a&&-1==a.indexOf("@")?a.split("-").forEach(function(a){c.push(a)}):c.push(a)});b.filters=c;return b}var q,x,D,Ga,I=[],Q=[],L=[],O=0,U=null,z=null,y=[],Na=!1,J=null,La=!1,v=null,V=null,ja=null,ba=null,ga=!1,aa=!1,qa=null,T=null,va=!1,Oa=null,H=null,Aa=!1,ka=!1,la=!1,B=null,E=[],F=0,da=0,Pa=0,Qa=0,oa=!1;b.IS_MOBILE&&u.when("A","jQuery","a-sheet").register("mirai-discover-bottom-sheet",function(a,
b,c){a.declarative("mirai-discover-bottom-sheet:hide","click",function(){c.get("sblAllSheet").hide()})});c.on("a:pageUpdate",Ma);c.declarative("sblTopRefinementScrollLeftV31","click",function(){H.animate({scrollLeft:H[0].scrollLeft-Math.min(H[0].scrollLeft,350)},400)});c.declarative("sblTopRefinementScrollRightV31","click",function(){H.animate({scrollLeft:H[0].scrollLeft+Math.min(H[0].scrollWidth-H[0].clientWidth,350)},400)});c.declarative("sblImageMouseHover","mouseenter",function(a){ca(a);1<B.find(".shopbylook-carousel-pagination span").length&&
B.find(".shopbylook-carousel-arrow-container").removeClass("aok-hidden")});c.declarative("sblImageMouseHover","mouseleave",function(a){ca(a);B.find(".shopbylook-carousel-arrow-container").addClass("aok-hidden")});c.declarative("sblImageSwipe","touchstart",function(a){Pa=a.$event.originalEvent.touches[0].pageX;oa=!1});c.declarative("sblImageSwipe","touchmove",function(a){if(!oa){Qa=a.$event.originalEvent.touches[0].pageX;var b=Pa-Qa;ca(a);na(B);a=B.find(".shopbylook-btf-image-container").width();var c=
B.find(".shopbylook-btf-image-elem");a=Math.abs(b/a);c.css("transform","translateX("+-1*b+"px)");.05<a&&(oa=!0,E&&E.length&&(a=B.find(".shopbylook-image-section-middle-dot"),F=a.index(a.filter(".selected")),0<b?F=(F+1)%E.length:0>b&&(F=(F-1+E.length)%E.length),c.css("transform","translateX(0)"),c.css("opacity","0"),setTimeout(function(){c.attr("src",E[F]);c.css("opacity","1")},300),b=B.find(".shopbylook-image-section-middle-dot"),b.removeClass("selected"),b.eq(F).addClass("selected")),setTimeout(function(){oa=
!1},300))}});c.declarative("sblCarouselToPrevious","click",function(a){ca(a);a=B.find(".shopbylook-image-section-middle-dot");da=a.index(a.filter(".selected"));na(B);E&&(F=0<da?da-1:E.length-1,e.replacingSrcImage(E[F],B,F))});c.declarative("sblCarouselToNext","click",function(a){ca(a);a=B.find(".shopbylook-image-section-middle-dot");da=a.index(a.filter(".selected"));na(B);E&&(F=da<E.length-1?da+1:0,e.replacingSrcImage(E[F],B,F))});c.declarative("sblThumbnailDetailPagination","click",function(a){ca(a);
F=(a=a.$target.closest(".shopbylook-image-section-middle-dot").attr("id").match(/shopbylook-image-section-middle-dot-(\d+)-/))?parseInt(a[1],10):0;na(B);E&&e.replacingSrcImage(E[F],B,F)});c.declarative("sblItemLike","click",function(a){var c=a.$currentTarget.closest(".shopbylook-btf-item-like");a=c.closest(".shopbylook-btf-item-box");var d=a.index(),g=e.getElementData(a);O++;b.IS_MOBILE&&a.addClass("sbl-item-liked");c.find(".sbl-item-like-button").removeClass(f.LIKE_BUTTON_FOCUS);for(c=0;c<Q.length;c++)if(Q[c].asin===
g.asin){Q.splice(c,1);break}for(c=0;c<L.length;c++)if(L[c]===f.DISLIKE_PREFIX+g.asin){L.splice(c,1);break}Ba(a,g);l(g,!0,f.GET_RECOMMENDATION_ADD_LIKE,d,h.LIKE)});c.declarative("sblItemDislike","click",function(a){a=a.$currentTarget.closest(".shopbylook-btf-item-dislike").closest(".shopbylook-btf-item-box");var c=e.getElementData(a);b.IS_MOBILE||O++;for(var d=0;d<I.length;d++)if(I[d].asin===c.asin){I.splice(d,1);break}for(d=0;d<L.length;d++)if(L[d]===f.LIKE_PREFIX+c.asin){L.splice(d,1);break}-1===
L.indexOf(f.DISLIKE_PREFIX+c.asin)&&(L.push(f.DISLIKE_PREFIX+c.asin),Q.push({asin:c.asin,iteration:O}));b.IS_MOBILE&&a.addClass("sbl-item-disliked");l(c,!1,f.GET_RECOMMENDATION_ADD_DISLIKE,a.index(),h.DISLIKE)});c.declarative("sblRefinementChangeV31","click",function(a){a=a.$currentTarget.find(".sbl-refinement-option-button");var b=sa(a),b=b?x.find(f.TOP_REFINEMENT_SECTION_ID).find(".sbl-keyword-item-"+b.filterSelectorSuffix).hasClass("sbl-top-refinement-element"):!1;ta(a,!1,b,!1)});c.declarative("sblShowMore",
"click",function(a){ia();V.removeClass(f.LIKE_BUTTON_FOCUS)});c.declarative("sblShadowPreview","click",function(b){var c=b.$currentTarget.closest(".shopbylook-btf-item-box"),d=a(".shopbylook-btf-item-box"),e=d.length;b=c.hasClass("hit-sbl-shadow-preview")||c.hasClass("hit-sbl-shadow-preview-loop");c=c.is(d.eq(e-1))||c.is(d.eq(e-2));b&&c&&(ia(),V.removeClass(f.LIKE_BUTTON_FOCUS))});c.declarative("sblTopRefinementChangeV31","click",function(c){var d=a(c.$currentTarget.find(".sbl-refinement-element-container").first()).hasClass("sbl-top-refinement-element");
if(ka=".sbl-refinement-basisPrice"===c.$currentTarget.find("input").attr("data-parent-item"))c=y.indexOf("@basisPrice"),d=x.find(".sbl-keyword-item-basisPrice"),0>c?(y.push("@basisPrice"),J=h.ADD_FILTER,X(d,!1),W(d.closest(".a-declarative"),!0,!0)):(y.splice(c,1),J=h.REMOVE_FILTER,ka=!1,X(d,!0),W(d.closest(".a-declarative"),!1,!0)),g(J);else{var f=a(c.$currentTarget.find("input").attr("data-parent-item")).first();0===f.length?c.$currentTarget.find(".sbl-keyword-item-review")?(d=c.$currentTarget.find(".sbl-keyword-item-review"),
f=d.hasClass("a-button-selected"),Ja("@review:4",!0),X(d,f),g(J),W(c.$currentTarget,!f,!0)):c.$currentTarget.find(".sbl-smart-tag")&&(e.closeSelectedRefinementItem(c.$currentTarget,!b.IS_MOBILE,S),g(h.CLEAR_FILTERS)):ta(f,!1,d,!0,!1);c.$currentTarget.find("input").focus()}});c.declarative("sblPrimeRefinementChange","click",function(a){Ka(a.$currentTarget.find("#sbl-refinement-item-prime"))});c.declarative("sblPrimeRefinementChangeMobile","touchend",function(a){Ka(a.$currentTarget.find("#sbl-refinement-item-prime"))});
u.when("a-switch","jQuery").execute(function(a,b){Oa=a.getSwitch(b("#sbl_top_refinement_prime_switch"))});c.declarative("sblViewRefinements","click",function(){wa(!1);d.showSideSheet();t(h.OPEN_FILTERS);Da()});c.declarative("mirai-discover-side-sheet:hide","click",function(){d.hideSideSheet();t(h.CLOSE_FILTERS);k.clearFilterSearchBar(0<y.length)});c.declarative("sbl-filter-search-clear","click",function(){k.clearFilterSearchBar(0<y.length)});c.declarative("mirai-discover-clear-filters","click",function(){k.clearFilters(X,
xa,Oa);var a=x.find(f.REVIEW_KEYWORD_ITEM),b=a.find("input");b.attr("data-parent-item",".sbl-refinement-review-4");b.attr("data-refinement-value",4);a=a.find(".sbl-top-refinement-review");for(b=0;5>=b;b++)a.removeClass("a-star-medium-"+b),a.removeClass("sbl-top-refinement-review-"+b);a.addClass("a-star-medium-4");a.addClass("sbl-top-refinement-review-4");y=[];J=h.REMOVE_FILTER;ka=!1;g(J)});c.declarative("sbl-refinement-see-more","click",function(a){a.$currentTarget.closest(".sbl-refinements-bn-list").find(".sbl-refinement-option-button").removeClass("aok-hidden");
a.$currentTarget.closest(".sbl-refinement-see-more-btn-container").remove()});c.declarative("sblGoToDetailPage","click",function(a){z&&(z.abort(),z=null);a=a.$currentTarget.closest(".shopbylook-btf-image-container").closest(".shopbylook-btf-item-box");var b=e.getElementData(a);t(h.GO_TO_DETAIL_PAGE,b,a.index())});c.declarative("sblGoToDetailPageVariations","click",function(){z&&(z.abort(),z=null);t(h.GO_TO_DETAIL_PAGE_VARIATIONS)});Ma();ea();fa()})});
/* ******** */
(function(l){var y=window.AmazonUIPageJS||window.P,w=y._namespace||y.attributeErrors,n=w?w("DetailPageMiraiAssets@shoppableScenes","DetailPageMiraiAssets"):y;n.guardFatal?n.guardFatal(l)(n,window):n.execute(function(){l(n,window)})})(function(l,y,w){function n(a){if(Array.isArray(a)){for(var b=0,c=Array(a.length);b<a.length;b++)c[b]=a[b];return c}return Array.from(a)}function n(a){if(Array.isArray(a)){for(var b=0,c=Array(a.length);b<a.length;b++)c[b]=a[b];return c}return Array.from(a)}function n(a){if(Array.isArray(a)){for(var b=
0,c=Array(a.length);b<a.length;b++)c[b]=a[b];return c}return Array.from(a)}function n(a){if(Array.isArray(a)){for(var b=0,c=Array(a.length);b<a.length;b++)c[b]=a[b];return c}return Array.from(a)}function n(a){if(Array.isArray(a)){for(var b=0,c=Array(a.length);b<a.length;b++)c[b]=a[b];return c}return Array.from(a)}function n(a){if(Array.isArray(a)){for(var b=0,c=Array(a.length);b<a.length;b++)c[b]=a[b];return c}return Array.from(a)}function n(a){if(Array.isArray(a)){for(var b=0,c=Array(a.length);b<
a.length;b++)c[b]=a[b];return c}return Array.from(a)}function n(a){if(Array.isArray(a)){for(var b=0,c=Array(a.length);b<a.length;b++)c[b]=a[b];return c}return Array.from(a)}function n(a){if(Array.isArray(a)){for(var b=0,c=Array(a.length);b<a.length;b++)c[b]=a[b];return c}return Array.from(a)}l.when("jQuery","mirai-scene-polyfill","mirai-scene-utils","atf").register("mirai-scenes-action-recorder",function(a,b,c){function d(c,d,h){a.ajax({type:"POST",url:"/discover/rooms/dpx/recordAction",data:JSON.stringify(b.object.assign({actionType:c,
actionSource:d},h)),contentType:"application/json; charset\x3dUTF-8"})}return{recordTagClick:function(a,b,h,e,k){a=c.parseTagId(a);"SOFTLINES"===k?d("GET_SIMILAR_ITEMS","IMAGE_BLOCK_SOFTLINES_SCENE_PRODUCT_TAG",{tagId:a,scenePhysicalId:b,anchorAsin:h,position:e}):"IMAGE_GALLERY"===k?d("GET_SIMILAR_ITEMS","IMAGE_GALLERY_SCENE_PRODUCT_TAG",{tagId:a,scenePhysicalId:b,anchorAsin:h,position:e}):d("GET_SIMILAR_ITEMS","IMAGE_BLOCK_SCENE_PRODUCT_TAG",{tagId:a,scenePhysicalId:b,anchorAsin:h,position:e})},
recordTagClickSideSheet:function(a,b,h){b=c.parseTagId(b);d("GET_SIMILAR_ITEMS","IMAGE_BLOCK_SHEET_SCENE_PRODUCT_TAG",{anchorAsin:a,tagId:b,scenePhysicalId:h})},recordTabClick:function(a,b,h){a=c.parseTagId(a);h?d("GET_SIMILAR_ITEMS","IMAGE_GALLERY_SCENE_PRODUCT_TAB",{tagId:a,scenePhysicalId:b}):d("GET_SIMILAR_ITEMS","IMAGE_BLOCK_SCENE_PRODUCT_TAB",{tagId:a,scenePhysicalId:b})},recordViewProductsButtonClick:function(a,b,h,e,k){a=c.parseTagId(a);"SOFTLINES"===k?d("GET_SIMILAR_ITEMS","IMAGE_BLOCK_SOFTLINES_VIEW_PRODUCTS_BUTTON",
{tagId:a,scenePhysicalId:b,anchorAsin:h,position:e}):"IMAGE_GALLERY"===k?d("GET_SIMILAR_ITEMS","IMAGE_GALLERY_VIEW_PRODUCTS_BUTTON",{tagId:a,scenePhysicalId:b,anchorAsin:h,position:e}):d("GET_SIMILAR_ITEMS","IMAGE_BLOCK_VIEW_PRODUCTS_BUTTON",{tagId:a,scenePhysicalId:b,anchorAsin:h,position:e})},recordSheetOpen:function(a,b,h,e){var k=k!==w?c.parseTagId(b):"";"SOFTLINES"===e?d("SHEET_OPEN","IMAGE_BLOCK_SOFTLINES_SHEET",{anchorAsin:a,tagId:k,scenePhysicalId:h}):"IMAGE_GALLERY"===e?d("SHEET_OPEN","IMAGE_GALLERY_SHEET",
{anchorAsin:a,tagId:k,scenePhysicalId:h}):d("SHEET_OPEN","IMAGE_BLOCK_SHEET",{anchorAsin:a,tagId:k,scenePhysicalId:h})},recordSheetClose:function(a,b,c,e,k,m){"SOFTLINES"===m?d("SHEET_CLOSE","IMAGE_BLOCK_SOFTLINES_SHEET",{anchorAsin:a,tagId:b,scenePhysicalId:c,currentViewAsins:[].concat(n(e)),browseNodeList:[].concat(n(k))}):"IMAGE_GALLERY"===m?d("SHEET_CLOSE","IMAGE_GALLERY_SHEET",{anchorAsin:a,tagId:b,scenePhysicalId:c,currentViewAsins:[].concat(n(e)),browseNodeList:[].concat(n(k))}):d("SHEET_CLOSE",
"IMAGE_BLOCK_SHEET",{anchorAsin:a,tagId:b,scenePhysicalId:c,currentViewAsins:[].concat(n(e)),browseNodeList:[].concat(n(k))})},recordCollectionBrowseNextButton:function(a,b,c,e,k,m){"SOFTLINES"===m?d("GET_COLLECTION_RIGHT","IMAGE_BLOCK_SOFTLINES_COLLECTIONS_CAROUSEL_NEXT_PAGE_BUTTON",{anchorAsin:a,asin:b,tagId:c,scenePhysicalId:e,browseNode:k}):"IMAGE_GALLERY"===m?d("GET_COLLECTION_RIGHT","IMAGE_GALLERY_COLLECTIONS_CAROUSEL_NEXT_PAGE_BUTTON",{anchorAsin:a,asin:b,tagId:c,scenePhysicalId:e,browseNode:k}):
d("GET_COLLECTION_RIGHT","IMAGE_BLOCK_COLLECTIONS_CAROUSEL_NEXT_PAGE_BUTTON",{anchorAsin:a,asin:b,tagId:c,scenePhysicalId:e,browseNode:k})},recordCollectionBrowsePreviousButton:function(a,b,c,e,k,m){"SOFTLINES"===m?d("GET_COLLECTION_LEFT","IMAGE_BLOCK_SOFTLINES_COLLECTIONS_CAROUSEL_PREVIOUS_PAGE_BUTTON",{anchorAsin:a,asin:b,tagId:c,scenePhysicalId:e,browseNode:k}):"IMAGE_GALLERY"===m?d("GET_COLLECTION_LEFT","IMAGE_GALLERY_COLLECTIONS_CAROUSEL_PREVIOUS_PAGE_BUTTON",{anchorAsin:a,asin:b,tagId:c,scenePhysicalId:e,
browseNode:k}):d("GET_COLLECTION_LEFT","IMAGE_BLOCK_COLLECTIONS_CAROUSEL_PREVIOUS_PAGE_BUTTON",{anchorAsin:a,asin:b,tagId:c,scenePhysicalId:e,browseNode:k})},recordCollectionAddToCartButton:function(a,b,c,e,k,m){"SOFTLINES"===m?d("ADD_TO_CART","IMAGE_BLOCK_SOFTLINES_COLLECTIONS_ADD_TO_CART_BUTTON",{anchorAsin:a,tagId:b,scenePhysicalId:c,browseNode:e,asin:k}):"IMAGE_GALLERY"===m?d("ADD_TO_CART","IMAGE_GALLERY_COLLECTIONS_ADD_TO_CART_BUTTON",{anchorAsin:a,tagId:b,scenePhysicalId:c,browseNode:e,asin:k}):
d("ADD_TO_CART","IMAGE_BLOCK_COLLECTIONS_ADD_TO_CART_BUTTON",{anchorAsin:a,tagId:b,scenePhysicalId:c,browseNode:e,asin:k})},recordCollectionV2BrowseNextButton:function(a,b,c,e,k,m){"SOFTLINES"===m?d("GET_COLLECTION_RIGHT","IMAGE_BLOCK_SOFTLINES_COLLECTIONS_CAROUSEL_NEXT_PAGE_BUTTON",{anchorAsin:a,asin:b,tagId:c,scenePhysicalId:e,browseNode:k}):d("GET_COLLECTION_V2_RIGHT","IMAGE_BLOCK_COLLECTIONS_V2_CAROUSEL_NEXT_PAGE_BUTTON",{anchorAsin:a,asin:b,tagId:c,scenePhysicalId:e,browseNode:k})},recordCollectionV2BrowsePreviousButton:function(a,
b,c,e,k,m){"SOFTLINES"===m?d("GET_COLLECTION_LEFT","IMAGE_BLOCK_SOFTLINES_COLLECTIONS_CAROUSEL_PREVIOUS_PAGE_BUTTON",{anchorAsin:a,asin:b,tagId:c,scenePhysicalId:e,browseNode:k}):d("GET_COLLECTION_V2_LEFT","IMAGE_BLOCK_COLLECTIONS_V2_CAROUSEL_PREVIOUS_PAGE_BUTTON",{anchorAsin:a,asin:b,tagId:c,scenePhysicalId:e,browseNode:k})},recordCollectionV2AddToCartButton:function(a,b,c,e,k,m){"SOFTLINES"===m?d("ADD_TO_CART","IMAGE_BLOCK_SOFTLINES_COLLECTIONS_ADD_TO_CART_BUTTON",{anchorAsin:a,tagId:b,scenePhysicalId:c,
browseNode:e,asin:k}):d("ADD_TO_CART_COLLECTION_V2","IMAGE_BLOCK_COLLECTIONS_V2_ADD_TO_CART_BUTTON",{anchorAsin:a,tagId:b,scenePhysicalId:c,browseNode:e,asin:k})}}});"use strict";l.when("jQuery","mirai-scene-utils","atf").register("mirai-scenes-add-to-cart-dp",function(a,b){var c=function(a){-1!==a&&(l.when("nav.setCartCount").execute(function(b){b(a)}),l.when("mash").execute(function(b){b.cart&&b.cart.didUpdate&&b.cart.didUpdate({newCartQuantity:a})}))};return{addToCart:function(b,f){b=b.data;return a.ajax({type:"POST",
url:"/discover/rooms/addToCart?ref\x3d"+f,data:JSON.stringify({asin:b.asin,offerId:b.offerListingId,quantity:1,price:b.price,currencyCode:b.currencyCode}),contentType:"application/json",dataType:"html",success:function(a){c(parseInt(a))}})},showSpinnerThenMessage:function(a,c){var g=a.$declarativeParent.closest(".add-to-cart-button-container"),h=g.find(".add-to-cart-spinner");g.find(".add-to-cart-button").addClass(b.HIDDEN_CLASS);h.removeClass(b.HIDDEN_CLASS);c.always(function(){h.addClass(b.HIDDEN_CLASS)}).done(function(){g.find(".add-success-message").addClass("add-to-cart-success")}).fail(function(){g.find(".add-to-cart-button").removeClass(b.HIDDEN_CLASS)})}}});
"use strict";l.when("atf").register("mirai-event-bus",function(){function a(a){var b=[];return{add:function(a){a&&b.push(a);return{remove:function(){var c=b.indexOf(a);if(0<=c)return b.splice(c,1)}}},notify:function(f){b.forEach(function(b){try{b(f)}catch(d){l.log("Handler for "+a+" failed: "+d,"FATAL","mirai-event-bus")}})}}}function b(){for(var b={},d=arguments.length,f=Array(d),g=0;g<d;g++)f[g]=arguments[g];f.forEach(function(d){return b[d]=a(d)});return{on:function(a,d){if(!b[a])throw Error("Cannot assign handler to nonexistent event "+
a+". Please make sure the event name is spelled correctly and registered by the calling instance.");if(!d)throw Error("Cannot assign empty handler to event "+a);return b[a].add(d)},trigger:function(a,d){if(!b[a])throw Error("Cannot trigger nonexistent event "+a+". Please make sure the event name is spelled correctly and registered by the calling instance.");b[a].notify(d)}}}return function d(){if(!(this instanceof d))throw new TypeError("Cannot call a class as a function");var a=b.apply(w,arguments);
this.on=a.on;this.trigger=a.trigger}});"use strict";l.when("atf").register("mirai-scene-nexus-logger",function(){var a=function(a,c,d,f,g,h,e,k,m,r,z){y.ue&&y.ue.event({feature:a,metricName:c,metricValue:1,anchorAsin:d,scenePhysicalId:f,scenePosition:g,tagId:h,seenProductAsins:e,asin:k,productPosition:m,productBrowseNode:r,seenBrowseNodes:z},"mirai","mirai.styleideas.ClickInteraction.2")};return{recordTagClick:function(b,c,d,f){a("shoppable_scenes_immersive_view","IMMERSIVE_VIEW_PRODUCT_TAG",b,c,
d,f,[],"",-1,"",[])},recordAddToCart:function(b,c,d,f,g,h,e){a("shoppable_scenes_immersive_view","IMMERSIVE_VIEW_ADD_TO_CART_BUTTON",b,c,d,f,[],g,h,e,[])},recordImmersiveViewOpen:function(b,c,d){a("shoppable_scenes_immersive_view","IMMERSIVE_VIEW_OPEN",b,c,d,"",[],"",-1,"",[])},recordProductClick:function(b,c,d,f,g,h,e){a("shoppable_scenes_immersive_view","IMMERSIVE_VIEW_PRODUCT_CLICK",b,c,d,f,[],g,h,e,[])},recordNextCarousel:function(b,c,d,f,g,h,e){a("shoppable_scenes_immersive_view","IMMERSIVE_VIEW_CAROUSEL_NEXT_PAGE_BUTTON",
b,c,d,f,[],g,h,e,[])},recordPreviousCarousel:function(b,c,d,f,g,h,e){a("shoppable_scenes_immersive_view","IMMERSIVE_VIEW_CAROUSEL_PREVIOUS_PAGE_BUTTON",b,c,d,f,[],g,h,e,[])},recordImmersiveViewClose:function(b,c,d,f,g){a("shoppable_scenes_immersive_view","IMMERSIVE_VIEW_CLOSE",b,c,d,"",f,"",-1,"",g)}}});"use strict";l.when("atf").register("mirai-scene-polyfill",function(){return{object:{assign:function(a){for(var b=arguments.length,c=Array(1<b?b-1:0),d=1;d<b;d++)c[d-1]=arguments[d];var b=Object(a),
d=!0,f=!1,g=w;try{for(var h=c[Symbol.iterator](),e;!(d=(e=h.next()).done);d=!0){var k=e.value;if(k!==w&&null!==k)for(var m in k)k.hasOwnProperty(m)&&(b[m]=k[m])}}catch(r){f=!0,g=r}finally{try{!d&&h.return&&h.return()}finally{if(f)throw g;}}return b},entries:function(a){return Object.keys(a).map(function(b){return[b,a[b]]})},values:function(a){return Object.keys(a).map(function(b){return a[b]})}},array:{includes:function(a,b,c){return c!==w&&null!==c?c>=a.length?!1:0>c&&0>a.length+c?-1!==a.indexOf(b,
0):-1!==a.indexOf(b,c):-1!==a.indexOf(b)}}}});"use strict";l.when("atf").register("mirai-scene-scroll-listener",function(){function a(a){return Array.from(a.values(),function(a){return a.getBoundingClientRect()})}return function(b,c){var d=this;this.handler=b;this.options=c;var f=function(){a(d.columns).some(function(a){return y.innerHeight+d.options.scrollOffset>=a.bottom})&&d.handler()},g=function(){clearTimeout(d.resizeTimeout);d.resizeTimeout=setTimeout(function(){f()},100)};this.start=function(){var a=
this.handler,b=this.options,c=[];a||c.push("handler required: "+a);b||c.push("options required: "+b);b.columnSelector||c.push("columnSelector option required: "+b.columnSelector);b.scrollOffset||c.push("scrollOffset option required: "+b.scrollOffset);if(c.length)throw Error("[scroll listener error] "+c.join(". "));d.columns=document.querySelectorAll(d.options.columnSelector);d.scrollableViewport=d.options.scrollableViewportSelector?document.querySelector(d.options.scrollableViewportSelector):y;d.scrollableViewport.addEventListener("scroll",
g)};this.stop=function(){d.scrollableViewport.removeEventListener("scroll",g)};this.start()}});"use strict";var C=function(){return function(a,b){if(Array.isArray(a))return a;if(Symbol.iterator in Object(a)){var c=[],d=!0,f=!1,g=w;try{for(var h=a[Symbol.iterator](),e;!(d=(e=h.next()).done)&&(c.push(e.value),!b||c.length!==b);d=!0);}catch(k){f=!0,g=k}finally{try{if(!d&&h["return"])h["return"]()}finally{if(f)throw g;}}return c}throw new TypeError("Invalid attempt to destructure non-iterable instance");
}}();l.when("jQuery","mirai-scene-weblab-context","atf").register("mirai-scene-utils",function(a,b){return{steppedIndex:function(a,b){return Math.ceil((a+1)/b)*b-1},indicesOfMatches:function(a,b){return a.map(function(a,c){return a===b?c:""}).filter(String)},urlResolver:function(a){var b=function(a){return Object.entries(a).map(function(a){a=C(a,2);var b=a[1];return encodeURIComponent(a[0])+"\x3d"+encodeURIComponent(b)}).join("\x26")};return function(f,g){return a+"/"+f+(g?"?"+b(g):"")}},replacePlus:function(a){return a.replace(/\+/g,
"\\+")},parseTagId:function(a){return a.split("/").pop()},parseScenePhysicalIdFromTagId:function(a){return a.split("_").shift()},isScenesEnabledDp:function(a){return 0!==a("#image-block-row .scenes-view-products-background-ib").length||0!==a("#image-block-row .scenes-view-products-background").length},isDotsExperiment:function(a){return-1!==a(".scenes-product-tag")[0].src.indexOf("dot")},isSeeSimilarExperiment:function(){return b.isT1("MIRAI_SCENES_DP_IMAGE_BLOCK_MOBILE_V2_SEE_SIMILAR_EXPERIMENT_393991")},
getHeartIcon:function(a){return a("#image-block-row").find("#heart-background")||a("#image-block-row").find(".list-heart-sprite")},getAnchorAsin:function(a){return a("#imageBlock_feature_div").length?a("#imageBlock_feature_div")[0].dataset.csaCAsin:null},isShoppableImageLoaded:function(a){return 0<a("#image-block .scenes-tag-container").filter(function(){return 0!==a(this).closest(".image-wrapper").find("img.carousel-alt-img").length}).length},isImageDotsOnViewProductButtonCXEnabled:function(a){return 0<
a("#image-block-row .scenes-view-products-background-ib").length&&0<a(".scenes-view-products-background-ib.with-number").length},getCurrentSelectedShoppableSceneImage:function(a){return a("#image-block-pagination-dots .a-dots li.a-selected").index()+1},isCarouselLoaderDivExist:function(a){return 0<a("#image-block .image-wrapper .carousel-loader").length},getImmersiveViewThumbnailPosition:function(a,b){return Array.from(a(".ivBottomThumbImagesShoppableScene").children()).indexOf(a("#shoppable-scene-thumbnail-"+
b)[0])+1},getProductLine:function(){var b=a(".mirai-scene-image-block-tag-container[data-product-line]");if(b.length)return b.attr("data-product-line");b=a(".scenes-highlighted-product-tag").first();return b.length&&(b=b.closest(".scenes-tag-container"),b.length&&b[0].dataset.productLine)?b[0].dataset.productLine:null},SCENES_VIEW_PRODUCTS_BUTTON:"#image-block-row .scenes-view-products-background",SCENES_VIEW_PRODUCTS_BUTTON_IB:"#image-block-row .scenes-view-products-background-ib",HIDDEN_CLASS:"aok-hidden"}});
"use strict";l.when("atf").register("mirai-scene-url-parser",function(){return{getPageAsin:function(){var a=y.location.href.match(/\/dp\/[0-9]{9}[0-9X]|[A-Z][A-Z0-9]{9}/);return a?a[0]:null}}});"use strict";var F="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"===typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a};l.when("mirai-scene-polyfill","atf").register("mirai-scene-weblab-context",function(a){var b=
{};return{setWeblabsFromMap:function(c){c&&"object"===("undefined"===typeof c?"undefined":F(c))&&a.object.assign(b,c)},isT1:function(a){return"T1"===b[a]}}});"use strict";l.when("A","jQuery","mirai-multi-scene-view","mirai-side-sheet-view","mirai-shoppable-scene-immersive-view","atf").execute("MiraiShoppableScenes",function(a,b,c,d,f){0<b(".mirai-scene-image-block-template").length&&(new d({$sideSheetElement:b("#mirai-side-sheet")}),new c({$root:b("#scene-details-content")}));0<b("#ivShoppableSceneHeading").length&&
new f});"use strict";l.when("A","jQuery","mirai-scene-feed-select-view-model","mirai-scenes-action-recorder","mirai-scene-context-model","mirai-scene-utils","atf").register("mirai-scene-tag-view",function(a,b,c,d,f,g){function h(b,c){a.hide(c);a.show(b)}var e=f.createImageBlockContext(g.getProductLine()),k=g.getAnchorAsin(b);return function(b){var f=b.$tagElements,g=b.scenePhysicalId,q=new c({tagIds:b.tagIds}),u=f.not(".highlighted"),p=f.filter(".highlighted");q.eventBus.on(q.events.INDEX_CHANGE,
function(b){var c=b.selectedIndices;b.selectedPhysicalId===g&&(h(u,p),c.length?(c.forEach(function(b){var c=u.eq(b);b=p.eq(b);a.hide(c);a.show(b);b.removeClass("mirai-scene-dot-pulsate");b.width();b.addClass("mirai-scene-dot-pulsate")}),a.trigger("mirai:index:change",{selectedIndices:c,scenePhysicalId:g})):a.trigger("mirai:no-products-active",{scenePhysicalId:g}))});a.on("scenes-show-details-tags-ib-"+g,function(a){a=a.data;d.recordTagClick(a.tagId,g,k,null,e.requestSource);q.selectCommand(g,a.tagId)});
a.on("scenes-show-details-view-products-ib-"+g,function(a){d.recordViewProductsButtonClick(a.data.tagId,g,k,null,e.requestSource);q.selectCommand(g,null)});a.on("scenes-show-details-tags-ss-"+g,function(a){a=a.data;d.recordTagClickSideSheet(k,a.tagId,g);q.selectCommand(g,a.tagId)});a.on("scenes-scroll-to-carousel-ss-"+g,function(a){d.recordTagClickSideSheet(k,a.data.tagId,g)})}});"use strict";"use strict";l.when("A","jQuery","atf").register("mirai-scene-feed-container-view",function(a,b){var c=null,
d=null;return function(f){function g(){a.on("mirai:multi-scene-view:physical-id:change",function(a){d=a.physicalId})}function h(){a.declarative("like-feed-item","click",function(b){a.trigger("like-feed-item-"+d,b)});a.declarative("dislike-feed-item","click",function(b){a.trigger("dislike-feed-item-"+d,b)});a.declarative("show-discover-feed","click",function(b){a.trigger("show-discover-feed-"+d,b)});a.declarative("scenes-show-details","click",function(b){a.trigger("scenes-show-details-"+d,b)});a.declarative("scenes-show-details-tags-ib",
"click",function(b){a.trigger("scenes-show-details-tags-ib-"+d,b)});a.declarative("scenes-show-details-view-products-ib","click",function(b){a.trigger("scenes-show-details-view-products-ib-"+d,b)});a.declarative("scenes-show-details-tags-ss","click",function(b){a.trigger("scenes-show-details-tags-ss-"+d,b)});a.declarative("product-feed-to-detail-page-navigation","click",function(b){a.trigger("product-feed-to-detail-page-navigation-"+d,b)});a.declarative("see-more-items","click",function(b){a.trigger("see-more-items-"+
d,b)});a.declarative("mirai:scenes:carousel-product-card:add-to-cart","click",function(b){a.trigger("mirai:scenes:carousel-product-card:add-to-cart-"+d,b)});e.scroll(function(){var a=b(".back-to-top-icon");return function(){150<=e.scrollTop()?a.addClass("visible"):a.removeClass("visible")}}());a.declarative("go-back-to-top","click",function(){e.animate({scrollTop:0},"300")})}var e=f.$scrollableViewport;c||(h(),g(),c=this)}});"use strict";F="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?
function(a){return typeof a}:function(a){return a&&"function"===typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a};l.when("A","jQuery","a-carousel-constants","a-carousel-framework","mirai-scene-utils","mirai-scenes-action-recorder","mirai-scene-context-model","mirai-scene-scroll-listener","mirai-scene-flush-feed-display-strategy","mirai-scene-collection-view-model","a-carousel-ajax-standard","mirai-scenes-add-to-cart-dp","mirai-scene-nexus-logger","atf").register("mirai-scene-collection-view",
function(a,b,c,d,f,g,h,e,k,m,r,z,q){function u(d){var e=d.scenePhysicalId,t=d.$feedRootElement,x=d.$scrollableViewport,B=d.$loadingSpinnerElement,G=d.$errorElement,J=d.$belowFeedElement,A=new m({scenePhysicalId:e,tagIds:d.tagIds}),n=h.createImageBlockContext(f.getProductLine()),D=f.getAnchorAsin(b),H={};A.eventBus.on(A.events.COLLECTIONS_PREFETCH,function(){a.hide(t);a.hide(G);a.hide(J);a.show(B)});A.eventBus.on(A.events.COLLECTIONS_CHANGE,function(c){var d=c.scenePhysicalId,e=c.tagId,f=c.isActiveCollection;
k.replaceAll(t,b(c.res.html));a.show(B);a.hide(G);a.show(t);a.hide(B);b(".room-products-scroller-wrapper").empty();y(d);I(x);w(d,e,f)});A.eventBus.on(A.events.COLLECTIONS_ERROR,function(){a.hide(t);a.hide(B);a.show(G)});a.on("product-feed-to-detail-page-navigation-"+e,function(a){a=a.data;A.navigateToDetailPageCommand(a.asin,a.browseNode)});var w=function(a,c,d){d?function(){c=f.parseTagId(c);var a=b(".room-collection-"+f.replacePlus(c));x.animate({scrollTop:a.position().top},500,function(){K(a)})}():
x.scrollTop(0)},K=function(c){var d=c.closest(".room-feed-and-refinements");b(".mirai-scene-carousel-color-flicker").removeClass("mirai-scene-carousel-color-flicker");d.addClass("mirai-scene-carousel-color-flicker");a.delay(function(){d.removeClass("mirai-scene-carousel-color-flicker")},3250)},y=function(a){l.when("a-carousel-framework").execute(function(a){l.when("cf").execute(function(){a.createAll();a.initializeAll();var c=b(".collections-carousel-container");c.find(".a-carousel-card").css("height",
"190px");c.each(function(){var b=a.getCarousel(this),c=b.getAttr("name"),d=b.dom.$carousel.closest(".room-feed-and-refinements").data("tagId"),e=f.parseScenePhysicalIdFromTagId(d);L(b,c,d,e,a)})})})},I=function(a){a.scroll(function(){l.when("a-carousel-framework").execute(function(a){l.when("cf").execute(function(){a.createAll();a.initializeAll()})})})},L=function(b,c,d,e,k){var f="a:carousel:"+c+":change:pageNumber",x="a:carousel:"+c+":repaint",B=b.dom.$carousel.closest(".room-feed-items-container-collection").find(".pagination-slider");
k.onInit(c,function(b){r.want(b,1,5);E(b);a.on(f,function(a){E(a.carousel)})});a.on(f,function(a){if(a.carousel.__id===b.__id){var c=function(){E(a.carousel);var c=a.newValue,k=a.oldValue,f=b.dom.$carousel.closest(".room-feed-and-refinements").data().tagId;if(H[f]===c)return{v:void 0};var x=b.dom.$carousel.children(),p=[];x.each(function(){this.childNodes[0]&&p.push(this.childNodes[0].dataset.asin)});if(c!==k){C(c,B);var x=x[0].childNodes[0].dataset.browseNode,h=p[c-1].split()[0];H[f]=c;c>k?(A.storeCurrentViewAsins([h]),
g.recordCollectionBrowseNextButton(D,h,d,e,x,n.requestSource)):g.recordCollectionBrowsePreviousButton(D,h,d,e,x,n.requestSource)}}();if("object"===("undefined"===typeof c?"undefined":F(c)))return c.v}});a.on(x,function(a){a.carousel.__id===b.__id&&E(a.carousel)})},E=function(a){var b=a.getAttr(c.PAGE_NUMBER),d=a.getAttr(c.TOTAL_PAGES),e=a.dom.$container.find(".a-carousel-goto-prevpage");a=a.dom.$container.find(".a-carousel-goto-nextpage");e.css("visibility",1===b?"hidden":"visible");a.css("visibility",
b>=d?"hidden":"visible")},C=function(a,b){var c=b.width();b.css("left",c*(a-1))};a.on("mirai:scenes:carousel-product-card:add-to-cart-"+e,function(a){var c=a.$declarativeParent.closest(".room-feed-and-refinements").data().tagId,d=f.parseScenePhysicalIdFromTagId(c),e=a.$declarativeParent.closest(".mirai-side-sheet-content").length,x=a.$declarativeParent.closest(".mirai-scene-details-iv-"+d).length,k=parseInt(a.$declarativeParent[0].closest(".collection-item").dataset.csaCPosx);e&&A.scenePhysicalId===
d&&(e=z.addToCart(a,"sbl_dr_dp_ib_col_atc"),z.showSpinnerThenMessage(a,e),g.recordCollectionAddToCartButton(D,c,d,a.data.browseNode,a.data.asin,n.requestSource));x&&(x=z.addToCart(a,"sbl_dr_dp_iv_col_atc"),z.showSpinnerThenMessage(a,x),x=f.getImmersiveViewThumbnailPosition(b,d),q.recordAddToCart(D,d,x,c,a.data.asin,k,a.data.browseNode))});(new MutationObserver(function(a,b){""!==t.html()&&A.saveViewCommand(t.html())})).observe(t[0],{subtree:!0,childList:!0,attributes:!0,attributeFilter:["style","class"]});
u.initializeCarousels=y;u.initializeCarouselsOnScrollListener=I}return u});"use strict";l.when("jQuery","A","mirai-scene-side-sheet-view-model","mirai-scenes-action-recorder","atf").register("mirai-side-sheet-view",function(a,b,c,d){return function(d){var g=this,h=d.$sideSheetElement,e=a("body"),k=a("#mirai-side-sheet-background"),m=h.css("right"),r=new c;e.append(h);this.animateSideSheetOpen=function(){h.animate({right:0},500)};this.animateSideSheetClosed=function(){h.animate({right:m},500)};r.eventBus.on(r.events.SIDE_SHEET_SHOW,
function(){e.addClass("lock-background");b.show(k);g.animateSideSheetOpen()});b.declarative("mirai-side-sheet:hide","click",function(){g.animateSideSheetClosed();b.hide(k);e.removeClass("lock-background");r.setSideSheetVisible(!1);r.recordSideSheetClose()})}});"use strict";l.when("A","jQuery","mirai-scene-utils","mirai-scene-tag-view","mirai-scene-collection-view","mirai-multi-scene-view-model","mirai-scene-feed-container-view","atf").register("mirai-multi-scene-view",function(a,b,c,d,f,g,h){var e=
function(a){return c.replacePlus(".mirai-scene-details-"+a)},k=b("#room-detail-page-container"),m=b("#scene-details-content"),r=function(a,b,c){return new d({$tagElements:a,scenePhysicalId:b,tagIds:c})},l=function(a,b,c){return new f({scenePhysicalId:b,tagIds:c,$feedRootElement:a.find(".room-feed-section"),$scrollableViewport:m,$loadingSpinnerElement:a.find(".room-load-more-section"),$errorElement:a.find(".room-feed-no-results-container"),$belowFeedElement:a.find(".room-below-feed-section")})},q=
function(a){return b("."+a).clone().removeClass(a+" aok-hidden")},u=function(a){return q("mirai-scene-image-template").attr("src",a)},p=function(c){return c.map(function(b){var c=q("mirai-scene-tag-template");c.css({top:100*b.top+"%",left:100*b.left+"%"});a.declarative.create(c,"scenes-show-details-tags-ss",{tagId:b.link});return c}).reduce(b.merge)},v=function(a){b(".room-detail-section").addClass("aok-hidden");b(e(a)).removeClass("aok-hidden")},t=function(c){var d=function(b){return a.debounce(function(){c.css({"max-height":y.innerHeight*
b})},100)}(.35);b(y).bind("resize.sceneImage",d);d();return c},x=function(a){if(a.find(".scenes-product-carousel-placeholder").length){var c=b("\x3cdiv\x3e").addClass("a-section").addClass("room-below-image-section"),d=b("\x3cdiv\x3e").addClass("a-section").addClass("room-feed-and-refinements"),e=b("\x3cdiv\x3e").attr("id","room-feed-section").addClass("a-section").addClass("room-feed-section");d.append(e);c.append(d);a.find(".scenes-product-carousel-placeholder").replaceWith(c)}return a};return function(){var c=
new g;new h({$scrollableViewport:m});a.on("mirai:scene-side-sheet-init",function(a){var d=a.icons;a=a.strings;c.isSideSheetInitialized()||(b("img[mirai-scene-icon-source]").each(function(){var a=b(this);a.attr("src",d[a.attr("mirai-scene-icon-source")])}),b("img[data-mirai-scene-icon-source]").each(function(){var a=b(this);a.attr("src",d[a.attr("data-mirai-scene-icon-source")])}),b(".mirai-scene-no-results-string-slot").replaceWith(a.shoppableSceneNoSuggestions),b(".mirai-scene-tabs-title-string-slot").replaceWith(a.shoppableSceneTabsTitle),
b(".mirai-scene-see-more-string-slot").replaceWith(a.shoppableSceneSeeMoreString))});a.on("mirai:scene-details-init",function(d){var f=d.scene,g=d.imageSource;if(f&&f.physicalId&&(d=e(f.physicalId),!(0<b(d).length))){d="mirai-scene-details-"+f.physicalId;d=q("mirai-scene-details-template").addClass(d);d=x(d);var h=t(u(g)),g=p(f.tags);d.find(".mirai-scene-image-slot").replaceWith(h);d.find(".mirai-scene-tags-slot").replaceWith(g);k.append(d);h=f.tags.map(function(a){return a.link});d={tagView:r(g.find(".item-tag"),
f.physicalId,h),collectionView:l(d,f.physicalId,h)};c.initializeSceneAction(f.physicalId,f.tags,d);v(f.physicalId);a.trigger("mirai:multi-scene-view:physical-id:change",{physicalId:f.physicalId})}});a.on("mirai:scene-details-change",function(d){d=d.physicalId;c.doesSceneExist(d)&&b(e(d)).hasClass("aok-hidden")&&(v(d),a.trigger("mirai:multi-scene-view:physical-id:change",{physicalId:d}))})}});"use strict";l.when("A","jQuery","mirai-scene-utils","mirai-scene-immersive-recommendation-column-view").register("mirai-shoppable-scene-immersive-view",
function(a,b,c,d){var f=b("#shoppable-scene-details-content-iv").find(".room-detail-page-container"),g={};return function(){a.on("mirai:scene-immersive-recommendation-col-init",function(h){if((h=h.scene)&&h.physicalId){if(!g[h.physicalId]){var e=c.replacePlus(".mirai-scene-details-iv-"+h.physicalId);if(0<b(e).length)return;e="mirai-scene-details-iv-"+h.physicalId;e=b(".mirai-scene-details-template-iv").clone().removeClass("mirai-scene-details-template-iv aok-hidden").addClass(e);if(0<e.find(".scenes-product-carousel-placeholder-iv").length){var k=
b("\x3cdiv\x3e").addClass("a-section").addClass("room-below-image-section"),m=b("\x3cdiv\x3e").addClass("a-section").addClass("room-feed-and-refinements"),r=b("\x3cdiv\x3e").attr("id","room-feed-section").addClass("a-section").addClass("room-feed-section");m.append(r);k.append(m);e.find(".scenes-product-carousel-placeholder-iv").replaceWith(k)}f.append(e);new d({scenePhysicalId:h.physicalId,$container:e,$feedRootElement:e.find(".room-feed-section"),$scrollableViewport:e.closest(".a-popover-inner")})}g[h.physicalId]=
!0;a.trigger("mirai:multi-scene-view:immersive-view:open",h)}});a.on("mirai:scene-immersive-publish-metric",function(a){})}});"use strict";l.when("A","jQuery","mirai-scene-immersive-recommendation-column-view-model","mirai-scene-collection-view","mirai-scene-flush-feed-display-strategy","mirai-scene-utils","mirai-scene-nexus-logger","atf").register("mirai-scene-immersive-recommendation-column-view",function(a,b,c,d,f,g,h){var e=g.getAnchorAsin(b),k=function(){var a=b("#shoppable-scene-iv-recommendation-waiting-spinner");
0<a.length&&a.remove();a=b(".shoppable-scene-recommendation-iv");0<a.length&&a.show()};return function(m){var r=m.scenePhysicalId,l=m.$container,q=m.$feedRootElement,u=m.$scrollableViewport,p=new c(r),v=g.getImmersiveViewThumbnailPosition(b,r);a.on("mirai:multi-scene-view:immersive-view:open",function(a){h.recordImmersiveViewOpen(e,a.physicalId,v);var b=a.tags.map(function(a){return a.link});p.selectCommand(a.physicalId,null,b)});a.on("mirai:scene-immersive-recommendation-col-update",function(b){var c=
b.tagId;b=b.physicalId;b===p.scenePhysicalId&&(k(),a.show(l),c=g.parseTagId(c),h.recordTagClick(e,b,v,c),t(b,c))});p.eventBus.on(p.events.IMMERSIVE_VIEW_PREFETCH,function(){a.hide(l)});p.eventBus.on(p.events.IMMERSIVE_RECOMMENDATION_COL_SHOW,function(c){var e=c.scenePhysicalId;c=c.res;k();f.replaceAll(q,b(c.html));a.show(l);d.initializeCarousels(e);d.initializeCarouselsOnScrollListener(u)});(new MutationObserver(function(a,b){""!==q.html()&&p.saveViewCommand(q.html())})).observe(q[0],{subtree:!0,
childList:!0,attributes:!0,attributeFilter:["style","class"]});var t=function(a,c){var d=b(".room-collection-"+g.replacePlus(c));u.animate({scrollTop:d.position().top},500,function(){x(d)})},x=function(c){var d=c.closest(".room-feed-and-refinements");b(".mirai-scene-carousel-color-flicker").removeClass("mirai-scene-carousel-color-flicker");d.addClass("mirai-scene-carousel-color-flicker");a.delay(function(){d.removeClass("mirai-scene-carousel-color-flicker")},3250)}}});"use strict";l.when("mirai-scene-utils",
"atf").register("mirai-scene-flush-feed-display-strategy",function(a){return{append:function(a,c,d){a.last().after(d);c.animate({scrollTop:[d.position().top-100,"swing"]},{duration:700})},insert:function(b,c,d,f){var g=b.eq(f);c.animate({scrollTop:[g.position().top-100,"swing"]},{duration:700});b.eq(a.steppedIndex(f,d.length)).after(d);d.hide().css("opacity",0).slideDown(700).animate({queue:!1,opacity:1},700)},replaceOne:function(a,c,d){var f=a.eq(d);c.hide();f.fadeOut(200,function(){f.replaceWith(c);
c.fadeIn(200)})},replaceAll:function(a,c){a.empty();a.append(c)}}});"use strict";l.when("jQuery","mirai-scene-utils","mirai-scene-polyfill","mirai-event-bus","mirai-scene-details-model","mirai-scene-context-model","atf").register("mirai-scene-feed-select-view-model",function(a,b,c,d,f,g){return function(a){var e=this;a=a.tagIds;this.events={INDEX_CHANGE:"index:change"};this.eventBus=new (Function.prototype.bind.apply(d,[null].concat(n(c.object.values(this.events)))));this.selectableTagIds=a;f.eventBus.on(f.events.COLLECTIONS_PREFETCH,
function(a){var d=a.scenePhysicalId;a=a.tagId;c.array.includes(e.selectableTagIds,a)?(a=b.indicesOfMatches(e.selectableTagIds,a),0===a.length&&(a=[0]),e.eventBus.trigger(e.events.INDEX_CHANGE,{selectedPhysicalId:d,selectedIndices:a})):e.eventBus.trigger(e.events.INDEX_CHANGE,{selectedPhysicalId:d,selectedIndices:{}})});this.selectCommand=function(a,c){var d=g.createImageBlockContext(b.getProductLine());f.getCollections(a,c,e.selectableTagIds,d)}}});"use strict";l.when("jQuery","mirai-scene-utils",
"mirai-event-bus","mirai-scene-polyfill","mirai-scene-details-model","mirai-scene-context-model","atf").register("mirai-scene-collection-view-model",function(a,b,c,d,f,g){var h=g.createImageBlockContext(b.getProductLine());return function(a){var b=this,g=!1,l=[],z=[];this.scenePhysicalId=a.scenePhysicalId;this.events={COLLECTIONS_PREFETCH:"scene:collections:prefetch",COLLECTIONS_CHANGE:"scene:collections:change",COLLECTIONS_ERROR:"scene:collections:error",SIMILAR_PRODUCTS_CHANGE:"scene:similar-products:change",
SIMILAR_PRODUCTS_ERROR:"scene:similar-products:error",MORE_PRODUCTS_PREFETCH:"scene:more-products:prefetch",MORE_PRODUCTS_CHANGE:"scene:more-products:change",MORE_PRODUCTS_ERROR:"scene:more-products:error",SHOW_LOAD_MORE_BUTTON:"scene:load-more-button:show"};this.eventBus=new (Function.prototype.bind.apply(c,[null].concat(n(d.object.values(this.events)))));f.eventBus.on(f.events.COLLECTIONS_PREFETCH,function(){b.eventBus.trigger(b.events.COLLECTIONS_PREFETCH)});f.eventBus.on(f.events.COLLECTIONS_CHANGE,
function(a){var c=a.scenePhysicalId,d=a.tagId;a=a.res;c===b.scenePhysicalId&&(g=null!==d,l=a.firstAsinPerTagIdList,z=a.browseNodeList,b.eventBus.trigger(b.events.COLLECTIONS_CHANGE,{scenePhysicalId:c,tagId:d,res:a,isActiveCollection:g}))});f.eventBus.on(f.events.COLLECTIONS_CHANGE_IG,function(a){var c=a.scenePhysicalId,d=a.tagId;a=a.res;c===b.scenePhysicalId&&(g=null!==d,l=a.firstAsinPerTagIdList,z=a.browseNodeList,b.eventBus.trigger(b.events.COLLECTIONS_CHANGE_IG,{scenePhysicalId:c,tagId:d,res:a,
isActiveCollection:g}))});f.eventBus.on(f.events.COLLECTIONS_ERROR,function(a){a=a.scenePhysicalId;a===b.scenePhysicalId&&b.eventBus.trigger(b.events.COLLECTIONS_ERROR,{scenePhysicalId:a})});this.saveViewCommand=function(a){f.cacheView(this.scenePhysicalId,{firstAsinPerTagIdList:l,browseNodeList:z,html:a},h)};this.storeCurrentViewAsins=function(a){f.updateCurrentViewAsins(this.scenePhysicalId,a,h)};this.navigateToDetailPageCommand=function(a,b){y.open("/dp/"+a+"?ref\x3dsbl_dr_dp_col_"+b,"_blank")}}});
"use strict";l.when("jQuery","mirai-event-bus","mirai-scene-polyfill","mirai-scene-utils","mirai-scene-details-model","mirai-scenes-action-recorder","mirai-scene-context-model","atf").register("mirai-scene-side-sheet-view-model",function(a,b,c,d,f,g,h){return function(){var e=this,k=!1,l=h.createImageBlockContext(d.getProductLine()),r=d.getAnchorAsin(a);this.events={SIDE_SHEET_SHOW:"mirai:side-sheet:show"};this.scenePhysicalId;this.tagId;this.eventBus=new (Function.prototype.bind.apply(b,[null].concat(n(c.object.values(this.events)))));
f.eventBus.on(f.events.COLLECTIONS_PREFETCH,function(a){var b=a.scenePhysicalId;a=a.tagId;k||(e.eventBus.trigger(e.events.SIDE_SHEET_SHOW),k=!0,e.recordSideSheetOpen(a,b))});this.recordSideSheetOpen=function(a,b){this.tagId=null!==a?d.parseTagId(a):"";this.scenePhysicalId=b;g.recordSheetOpen(r,this.tagId,this.scenePhysicalId,l.requestSource)};this.recordSideSheetClose=function(){var a=f.getCurrentViewAsins(this.scenePhysicalId,l),b=f.getBrowseNodeList(this.scenePhysicalId);g.recordSheetClose(r,this.tagId,
this.scenePhysicalId,a,b,l.requestSource)};this.setSideSheetVisible=function(a){k=a}}});"use strict";l.when("atf").register("mirai-multi-scene-view-model",function(){return function(){var a={},b=!1;this.initializeSceneAction=function(c,d,f){a[c]={tags:d,subViews:f};b=!0};this.doesSceneExist=function(b){return!!a[b]};this.isSideSheetInitialized=function(){return b}}});"use strict";l.when("jQuery","mirai-event-bus","mirai-scene-polyfill","mirai-scene-details-model","mirai-scene-context-model","atf").register("mirai-scene-immersive-recommendation-column-view-model",
function(a,b,c,d,f){var g=f.createImageBlockImmersiveViewContext();return function(a){var e=this,f=[],l=[];this.scenePhysicalId=a;this.events={IMMERSIVE_VIEW_PREFETCH:"scene:immersive-view:prefetch",IMMERSIVE_RECOMMENDATION_COL_SHOW:"mirai:immersive-view-recommendation-col:show"};this.eventBus=new (Function.prototype.bind.apply(b,[null].concat(n(c.object.values(this.events)))));d.eventBus.on(d.events.COLLECTIONS_PREFETCH_IV,function(){e.eventBus.trigger(e.events.IMMERSIVE_VIEW_PREFETCH)});d.eventBus.on(d.events.COLLECTIONS_CHANGE_IV,
function(a){var b=a.scenePhysicalId,c=a.tagId;a=a.res;b===e.scenePhysicalId&&(f=a.firstAsinPerTagIdList,l=a.browseNodeList,e.eventBus.trigger(e.events.IMMERSIVE_RECOMMENDATION_COL_SHOW,{scenePhysicalId:b,tagId:c,res:a}))});this.selectCommand=function(a,b,c){a===this.scenePhysicalId&&d.getCollections(a,b,c,g)};this.saveViewCommand=function(a){d.cacheView(this.scenePhysicalId,{firstAsinPerTagIdList:f,browseNodeList:l,html:a},g)}}});"use strict";l.when("mirai-scene-url-parser","atf").register("mirai-scene-context-model",
function(a){var b=function(a,b){var f=2<arguments.length&&arguments[2]!==w?arguments[2]:w,g={requestSource:a,refMarker:b};return f?Object.assign(g,{pageAsin:f}):g};return{createImageBlockContext:function(c){return"softlines"===c?b("SOFTLINES","sbl_dr_dp_soft_sm_m",a.getPageAsin()):b("IMAGE_BLOCK","sbl_dr_dp_col_sm_m")},createImageGalleryContext:function(){return b("IMAGE_GALLERY","sbl_dr_dp_ig_col_sm_m")},createImageBlockImmersiveViewContext:function(){return b("IMMERSIVE_VIEW","sbl_dr_ibiv_sm")}}});
"use strict";l.when("mirai-scene-utils","mirai-scene-polyfill","mirai-event-bus","mirai-scene-details-model-adapter","atf").register("mirai-scene-details-model",function(a,b,c,d){function f(a,b,c){var d=e(a,c).currentViewAsins;b.forEach(function(a){return d.add(a)})}function g(a,b,c){a=k(a);a.numberOfRecommendationsMade+=1;a[c?"likedAsins":"dislikedAsins"].push({asin:b,iteration:a.numberOfRecommendationsMade})}function h(a,b,c,d,e){var f;a=k(a);(f=a.similarAsins).splice.apply(f,[e?b:b+1,e?1:0].concat(n(c)));
d&&(a.nextStartIndex=d)}function e(a,b){a=b.requestSource+"-"+a;if(a in u)return u[a];u[a]={currentViewAsins:new Set};return u[a]}function k(a){if(!q||!q[a])throw Error("There is no data available for the tag ID "+a);return q[a]}function l(a){if(!p||!p[a])throw Error("There is no response cached for the cacheKey "+a);return p[a]}function r(a){if(Object.values(a).some(function(a){return a===w}))throw Error("Invalid response from server");}function z(a){return Object.values(a).some(function(a){return a===
w})&&a.html}var q={},u={},p={},v={FEED_PREFETCH:"scene-details-model:feed:prefetch",FEED_CHANGE:"scene-details-model:feed:change",FEED_ERROR:"scene-details-model:feed:error",SIMILAR_PRODUCTS_CHANGE:"scene-details-model:similar-products:change",SIMILAR_PRODUCTS_ERROR:"scene-details-model:similar-products:error",MORE_PRODUCTS_PREFETCH:"scene-details-model:more-products:prefetch",MORE_PRODUCTS_CHANGE:"scene-details-model:more-products:change",MORE_PRODUCTS_ERROR:"scene-details-model:more-products:error",
MORE_PRODUCTS_ABORTED_ERROR:"scene-details-model:more-products:aborted",COLLECTIONS_PREFETCH:"scene-details-model:collections:prefetch",COLLECTIONS_PREFETCH_IV:"scene-details-model:collections:prefetch:iv",COLLECTIONS_CHANGE:"scene-details-model:collections:change",COLLECTIONS_CHANGE_IG:"scene-details-model:collections:change:ig",COLLECTIONS_CHANGE_IV:"scene-details-model:collections:change:iv",COLLECTIONS_ERROR:"scene-details-model:collections:error"},t=new (Function.prototype.bind.apply(c,[null].concat(n(b.object.values(v)))));
return{events:v,eventBus:t,getProducts:function(a,c,e){t.trigger(v.MORE_PRODUCTS_PREFETCH);var f=k(a);d.getProducts(b.object.assign({count:e,tagId:a},f),c).then(function(b){r(b);var c=b.html;h(a,f.similarAsins.length,b.similarAsins,b.nextIndex,!1);t.trigger(v.MORE_PRODUCTS_CHANGE,{tagId:a,html:c})}).catch(function(b){"abort"!==b.statusText?t.trigger(v.MORE_PRODUCTS_ERROR,{tagId:a}):t.trigger(v.MORE_PRODUCTS_ABORTED_ERROR,{tagId:a})})},getProductRecommendation:function(a,c,e,f,p,u,l){var q=k(a),m=
q.similarAsins.indexOf(c);0!=q.dislikedAsins.length||p||g(a,q.tagAsin,!0);g(a,c,p);d.getProductRecommendation(b.object.assign({productAsin:c,productPhysicalId:e,count:f,asinIndexInFeed:m},q),p,u).then(function(b){r(b);var c=b.similarAsins,d=b.nextIndex;b=b.html;var e=l(m);h(a,e,c,d,!p);t.trigger(v.SIMILAR_PRODUCTS_CHANGE,{targetIndex:e,tagId:a,isLike:p,html:b})}).catch(function(b){"abort"!==b.statusText&&t.trigger(v.SIMILAR_PRODUCTS_ERROR,{targetIndex:m,tagId:a})})},getSimilarProductsForTagId:function(a){t.trigger(v.FEED_PREFETCH,
{tagId:a});p&&p[a]?t.trigger(v.FEED_CHANGE,{tagId:a,html:l(a),nextIndex:k(a).nextStartIndex}):d.getSimilarProductsForTagId(a).then(function(b){if(z(b))t.trigger(v.FEED_CHANGE,{tagId:a,html:b.html});else{r(b);var c=b.similarAsins,d=b.nextIndex,e=b.html;q[a]={browseNode:b.browseNode,tagAsin:c[0],numberOfRecommendationsMade:0,nextStartIndex:0,similarAsins:[],likedAsins:[],dislikedAsins:[]};h(a,0,c,d,!1);t.trigger(v.FEED_CHANGE,{tagId:a,html:e,nextIndex:d})}}).catch(function(b){"abort"!==b.statusText&&
t.trigger(v.FEED_ERROR,{tagId:a})})},cacheView:function(a,b,c){p[c.requestSource+"-"+a]=b},getModel:function(a){return JSON.parse(JSON.stringify(q[a]))},getCollections:function(a,b,c,e){var g=void 0,h=v.COLLECTIONS_PREFETCH;e.requestSource.includes("IMAGE_GALLERY")?g=v.COLLECTIONS_CHANGE_IG:e.requestSource.includes("IMMERSIVE_VIEW")?(h=v.COLLECTIONS_PREFETCH_IV,g=v.COLLECTIONS_CHANGE_IV):g=v.COLLECTIONS_CHANGE;t.trigger(h,{scenePhysicalId:a,tagId:b});h=e.requestSource+"-"+a;p&&p[h]?(c=l(h),f(a,c.firstAsinPerTagIdList,
e),t.trigger(g,{scenePhysicalId:a,tagId:b,res:c})):d.getCollections(c,e).then(function(c){r(c);f(a,c.firstAsinPerTagIdList,e);t.trigger(g,{scenePhysicalId:a,tagId:b,res:c})}).catch(function(b){"abort"!==b.statusText&&t.trigger(v.COLLECTIONS_ERROR,{scenePhysicalId:a})})},updateCurrentViewAsins:f,getCurrentViewAsins:function(a,b){return e(a,b).currentViewAsins},getBrowseNodeList:function(a){return p[a]?p[a].browseNodeList:[]}}});"use strict";C=function(){return function(a,b){if(Array.isArray(a))return a;
if(Symbol.iterator in Object(a)){var c=[],d=!0,f=!1,g=w;try{for(var h=a[Symbol.iterator](),e;!(d=(e=h.next()).done)&&(c.push(e.value),!b||c.length!==b);d=!0);}catch(k){f=!0,g=k}finally{try{if(!d&&h["return"])h["return"]()}finally{if(f)throw g;}}return c}throw new TypeError("Invalid attempt to destructure non-iterable instance");}}();l.when("jQuery","mirai-scene-utils","mirai-scene-weblab-context","atf").register("mirai-scene-details-model-adapter",function(a,b,c){var d=b.urlResolver("/discover/rooms/dpx"),
f=function(){var b=null;return function(c){b&&(b.abort(),b=null);return b=a.ajax(c).done(function(){b=null})}}(),g=function(a){return"string"===typeof a?a.split(","):[]},h=function(a){return a},e=function(a){return a.trim()},k=function(b,c){var d=a(b);return Object.entries(c).reduce(function(a,b){var c=C(b,2);b=c[0];c=c[1];if("function"===typeof c){var e=d.data(b);a[b]=c(e);return a}},{})},l=function(b){return a(b).find(".discover-feed-item").map(function(){return this.outerHTML}).get().join("")},
r=function(a){return function(b){return Object.assign({html:l(b)},k(b,a))}},z=function(){var a=r({nextIndex:h,similarAsins:g});return function(b,c,g){c=c?"getProductRecommendationsForLike":"getProductRecommendationsForDislike";b={browseNode:b.browseNode,asin:b.productAsin,physicalId:b.productPhysicalId,currentViewAsins:[].concat(n(b.similarAsins)),positive:[].concat(n(b.likedAsins)),negative:[].concat(n(b.dislikedAsins)),count:b.count,asinIndex:b.asinIndexInFeed,iteration:b.numberOfRecommendationsMade};
return Promise.resolve(f({type:"POST",url:d(c,{roomPhysicalId:g}),data:JSON.stringify(b),contentType:"application/json; charset\x3dUTF-8"})).then(e).then(a)}}();return{getProducts:function(){var a=r({nextIndex:h,similarAsins:g});return function(b,c){b={browseNode:b.browseNode,currentAsins:[].concat(n(b.similarAsins)),keywords:[],positive:[].concat(n(b.likedAsins)),negative:[].concat(n(b.dislikedAsins)),start:b.nextStartIndex,iteration:b.numberOfRecommendationsMade,count:b.count,currentCount:b.similarAsins.length,
minPrice:0,maxPrice:null,isPrime:null,tagId:b.tagId.split("/").pop()};return Promise.resolve(f({type:"POST",url:d("loadMoreProducts",{roomPhysicalId:c}),data:JSON.stringify(b),contentType:"application/json; charset\x3dUTF-8"})).then(e).then(a)}}(),getProductRecommendation:z,getSimilarProductsForTagId:function(a){return Promise.resolve(f({type:"GET",url:a})).then(e).then(function(a){var b=k(a,{browseNode:h,tagAsin:h,similarAsins:g,weblabTreatments:h,nextIndex:h});c.setWeblabsFromMap(b.weblabTreatments);
return{html:a,browseNode:b.browseNode,tagAsin:b.tagAsin,similarAsins:b.similarAsins,nextIndex:b.nextIndex}})},getCollections:function(a,c){a=a.map(b.parseTagId);a=Object.assign({tagIds:a},c);return Promise.resolve(f({type:"GET",url:d("tags",a)})).then(e).then(function(a){var b=k(a,{model:h});return{html:a,firstAsinPerTagIdList:b.model.firstAsinPerTagIdList,browseNodeList:b.model.browseNodeList}})}}});"use strict";l.register("mirai-scene-bottom-sheet",function(){return{}});"use strict";"use strict";
"use strict";l.when("A","jQuery","a-carousel-constants","mirai-scene-utils","mirai-scene-details-model","mirai-scenes-action-recorder","a-carousel-ajax-standard","mirai-event-bus","mirai-scene-polyfill","atf").register("mirai-scenes-collections-carousels",function(a,b,c,d,f,g,h,e,k){return function(){function b(c,e,k,l){var m="a:carousel:"+e+":change:pageNumber",n="a:carousel:"+e+":repaint",q=c.dom.$carousel.closest(".room-feed-and-refinements").data("tagId"),w=d.parseScenePhysicalIdFromTagId(q),
A=c.dom.$carousel.closest(".room-feed-items-container-collection").find(".pagination-slider");k.onInit(e,function(b){h.want(b,1,5);f(b);a.on(m,function(a){f(a.carousel)})});a.on(m,function(a){a.carousel.__id===c.__id&&function(){f(a.carousel);var b=a.newValue,d=a.oldValue,e=c.dom.$carousel.children(),h=[];e.each(function(){this.childNodes[0]&&h.push(this.childNodes[0].dataset.asin)});if(b!==d){g(b,A);var k=e[0].childNodes[0].dataset.browseNode,p=h[b-1].split()[0];b>d?(l.eventBus.trigger(l.events.NEXT_BUTTON_CLICKED,
{asin:p,tagId:q,scenePhysicalId:w,browseNode:k,$items:e}),l.eventBus.trigger(l.events.ASIN_SEEN,{asin:p,scenePhysicalId:w})):l.eventBus.trigger(l.events.PREV_BUTTON_CLICKED,{asin:p,tagId:q,scenePhysicalId:w,browseNode:k})}}()});a.on(n,function(a){a.carousel.__id===c.__id&&f(a.carousel)})}function f(a){var b=a.getAttr(c.PAGE_NUMBER),d=a.getAttr(c.TOTAL_PAGES),e=a.dom.$container.find(".a-carousel-goto-prevpage");a=a.dom.$container.find(".a-carousel-goto-nextpage");e.css("visibility",1===b?"hidden":
"visible");a.css("visibility",b>=d?"hidden":"visible")}function g(a,b){var c=b.width();b.css("left",c*(a-1))}this.events={NEXT_BUTTON_CLICKED:"scene:collections:carousel:next",PREV_BUTTON_CLICKED:"scene:collections:carousel:prev",ASIN_SEEN:"scene:collections:asinSeen"};this.eventBus=new (Function.prototype.bind.apply(e,[null].concat(n(k.object.values(this.events)))));var q=this;this.bindEventListenersToCarousels=function(a){l.when("a-carousel-framework").execute(function(c){l.when("cf").execute(function(){c.createAll();
c.initializeAll();var d=a.find(".collections-carousel-container"),e=a.find(".collections-partial-carousel-container");d.add(e).each(function(){var a=c.getCarousel(this),d=a.getAttr("name");b(a,d,c,q)})})})};this.initializeCarousels=function(a){l.when("a-carousel-framework").execute(function(a){l.when("cf").execute(function(){a.createAll();a.initializeAll()})});a.scroll(function(){l.when("a-carousel-framework").execute(function(a){l.when("cf").execute(function(){a.createAll();a.initializeAll()})})})}}});
"use strict";l.when("A","jQuery","a-carousel-constants","mirai-scene-utils","mirai-scene-details-model","mirai-scenes-action-recorder","a-carousel-ajax-standard","mirai-event-bus","mirai-scene-polyfill","atf").register("mirai-scenes-collections-v2-carousels",function(a,b,c,d,f,g,h,e,k){return function(){function f(b,c,e,k){var l="a:carousel:"+c+":change:pageNumber",m="a:carousel:"+c+":repaint",n=b.dom.$carousel.closest(".room-feed-and-refinements").data("tagId"),u=d.parseScenePhysicalIdFromTagId(n),
y=b.dom.$carousel.closest(".room-feed-items-container-collection").find(".pagination-slider");e.onInit(c,function(b){h.want(b,1,5);b.onChange("fetchedItems",function(){q(b);b.strategies.display.repaint(b);k.initializeTruncation()});g(b);a.on(l,function(a){g(a.carousel)})});a.on(l,function(a){a.carousel.__id===b.__id&&function(){g(a.carousel);var c=a.newValue,d=a.oldValue,e=b.dom.$carousel.children(),f=[];e.each(function(){this.childNodes[0]&&f.push(this.childNodes[0].dataset.asin)});if(c!==d){w(c,
y);var h=e[0].childNodes[0].dataset.browseNode,l=f[c-1].split()[0];c>d?(k.eventBus.trigger(k.events.NEXT_BUTTON_CLICKED,{asin:l,tagId:n,scenePhysicalId:u,browseNode:h,$items:e}),k.eventBus.trigger(k.events.ASIN_SEEN,{asin:l,scenePhysicalId:u})):k.eventBus.trigger(k.events.PREV_BUTTON_CLICKED,{asin:l,tagId:n,scenePhysicalId:u,browseNode:h})}}()});a.on(m,function(a){a.carousel.__id===b.__id&&g(a.carousel)})}function g(a){var b=a.getAttr(c.PAGE_NUMBER),d=a.getAttr(c.TOTAL_PAGES),e=a.dom.$container.find(".a-carousel-goto-prevpage");
a=a.dom.$container.find(".a-carousel-goto-nextpage");e.css("visibility",1===b?"hidden":"visible");a.css("visibility",b>=d?"hidden":"visible")}function w(a,b){var c=b.width();b.css("left",c*(a-1))}function q(a){var c=0;a.dom.$carousel.find(".collection-item").each(function(){var a=b(this).outerHeight();c=Math.max(c,a)});a.dom.$carousel.find(".collection-item").css("min-height",c+"px");a.strategies.display.repaint(a);a.dom.$carousel.find(".a-carousel-card").css("height",c+"px");a.dom.$viewport.css("height",
"100%");a.strategies.display.repaint(a)}this.events={NEXT_BUTTON_CLICKED:"scene:collections:carousel:next",PREV_BUTTON_CLICKED:"scene:collections:carousel:prev",ASIN_SEEN:"scene:collections:asinSeen"};this.eventBus=new (Function.prototype.bind.apply(e,[null].concat(n(k.object.values(this.events)))));var u=this;this.bindEventListenersToCarousels=function(a){l.when("a-carousel-framework").execute(function(b){l.when("cf").execute(function(){b.createAll();b.initializeAll();var c=a.find(".collections-carousel-container"),
d=a.find(".collections-partial-carousel-container");c.add(d).each(function(){var a=b.getCarousel(this),c=a.getAttr("name");f(a,c,b,u)})})})};this.initializeCarousels=function(a){function b(){l.when("a-carousel-framework").execute(function(a){l.when("cf").execute(function(){a.createAll();a.initializeAll();u.initializeTruncation()})})}setTimeout(b,100);a.scroll(b)};this.initializeTruncation=function(){l.when("A","a-truncate").execute(function(a,b){b.refreshAutoTruncate()})}}});"use strict";"use strict";
"use strict";l.when("A","jQuery","mirai-scene-utils","atf").register("mirai-scene-image-block-view-products-button",function(a,b,c){function d(d){c.getHeartIcon(b)[0]?d.css({left:""}):d.css({left:"0px"});a.trigger("mirai:scenes-view-products-button-moved")}var f=function(){return 0<b(c.SCENES_VIEW_PRODUCTS_BUTTON_IB).length?b(c.SCENES_VIEW_PRODUCTS_BUTTON_IB):b(c.SCENES_VIEW_PRODUCTS_BUTTON)};a.on("a:pageUpdate",function(){return d(f())});return{show:function(){var a=f();a.css("visibility","visible");
d(a)},hide:function(){f().css("visibility","hidden")}}});"use strict"});
/* ******** */
(function(c){var b=window.AmazonUIPageJS||window.P,d=b._namespace||b.attributeErrors,a=d?d("DetailPageMiraiAssets@theia","DetailPageMiraiAssets"):b;a.guardFatal?a.guardFatal(c)(a,window):a.execute(function(){c(a,window)})})(function(c,b,d){});
/* ******** */
(function(d){var q=window.AmazonUIPageJS||window.P,n=q._namespace||q.attributeErrors,a=n?n("AmazonUIFormControlsJS","AmazonUI"):q;a.guardFatal?a.guardFatal(d)(a,window):a.execute(function(){d(a,window)})})(function(d,q,n){d.register("prv:a-form-states",function(){function a(a){return function(b){b.removeClass(a)}}function c(a){return function(b){b.addClass(a)}}function b(a){return function(b){return b.hasClass(a)}}return{disabled:{cssClass:"a-form-disabled",disabled:!0,enterState:function(a){a.addClass(this.cssClass);
a.prop("disabled",this.disabled)},exitState:function(a){a.removeClass(this.cssClass);a.prop("disabled",!this.disabled)},match:function(a){return a.hasClass(this.cssClass)&&a.prop("disabled")}},error:{enterState:c("a-form-error"),exitState:a("a-form-error"),match:b("a-form-error")},inactive:{enterState:c("a-form-inactive"),exitState:a("a-form-inactive"),match:b("a-form-inactive")},selected:{enterState:c("a-form-selected"),exitState:a("a-form-selected"),match:b("a-form-selected")},normal:{enterState:c("a-form-normal"),
exitState:a("a-form-normal"),match:b("a-form-normal")}}});"use strict";d.when("A").register("prv:a-base-form-control-specs",function(a){var c=a.$;return a.createClass({matchTag:function(a){return this.tag?a.is(this.tag):!0},matchType:function(b){if(!this.attrs||!this.attrs.type)return!0;var c=this.attrs.type;return 0<=a.indexOfArray(a.isArray(c)?c:[c],b.attr("type"))},matchCssClass:function(a){return this.attrs&&this.attrs.cssClass?a.hasClass(this.attrs.cssClass):!0},isCoreElement:function(a){return this.matchTag(a)&&
this.matchType(a)&&this.matchCssClass(a)},getCoreElement:function(a){var b=this;return this.isCoreElement(a)?a:a.find(this.tag).filter(function(){return b.isCoreElement(c(this))}).first()},isVisualElement:function(a){return this.visualElementSelector?a.is(this.visualElementSelector):this.isCoreElement(a)},getVisualElement:function(a){return this.isVisualElement(a)?a:this.visualElementSelector?a.closest(this.visualElementSelector):a},getWrapperElement:function(a){if(this.wrapperElementSelector){var b=
a.closest(this.wrapperElementSelector);return 0<b.length?b:a}return a}})});"use strict";d.when("A").register("prv:a-form-util",function(a){var c=0;return{setElementId:function(a){if(!a.attr("id")){var b="a-form-control-auto-id-"+c++;a.attr("id",b)}}}});"use strict";d.when("A","a-component","prv:a-form-util","prv:a-form-control-interfaces").register("a-form-control",function(a,c,b,k){var e=c.create({init:function(a,c){this._super(a,c);a=this.specs;this._$coreElement=a.getCoreElement(this._$element);
b.setElementId(this._$coreElement);this._$visualElement=a.getVisualElement(this._$coreElement);this.isInstanceOf("stateTransitionableControl")&&this._resolveFormState();this._$wrapperElement=a.getWrapperElement(this._$visualElement)},getNativeElement:function(){return this._$coreElement[0]},isInstanceOf:function(b){return 0<=a.indexOfArray(this.specs.interfaces||[],b)}});return{create:function(b){b&&b.specs||d.error("Form control specs required","AmazonUIFormControlsJS","createFormControl");a.extend(b,
k.resolveControlImplementation(b));return e.extend(b)}}});"use strict";d.when("A","prv:a-form-states","a-tooltip","a-dropdown-select-apis").register("prv:a-form-control-interfaces",function(a,c,b,d){function e(h,b){var w=a.$.extend({},c,b||{});return a.reduce(h||[],function(a,h){w.hasOwnProperty(h)&&(a[h]=w[h]);return a},{})}function g(h){return a.reduce(h||[],function(h,b){x.hasOwnProperty(b)&&a.extend(h,x[b]);return h},{})}var l=a.$,k=function(){var h={};a.each([].slice.call(arguments),function(b){a.mixin(h,
b)});return h},m={hasClass:function(){return l.fn.hasClass.apply(this._$visualElement,arguments)},addClass:function(){l.fn.addClass.apply(this._$visualElement,arguments)},removeClass:function(){l.fn.removeClass.apply(this._$visualElement,arguments)},prop:function(){var a=l.fn.prop.apply(this._$coreElement,arguments);return a&&a.jquery?n:a},attr:function(){var a=l.fn.attr.apply(this._$coreElement,arguments);return a&&a.jquery?n:a},removeAttr:function(){l.fn.removeAttr.apply(this._$coreElement,arguments)},
removeData:function(a){this._$wrapperElement.removeAttr("data-"+a)},data:function(a,b){return(a=this._$wrapperElement.attr("data-"+a,b))&&a.jquery?n:a}},t={trigger:function(a){this._$coreElement.trigger(a)},on:function(){l.fn.bind.apply(this._$coreElement,arguments)},off:function(){l.fn.unbind.apply(this._$coreElement,arguments)}},y=k(m,t,{check:function(a){this.isChecked()||(this._$coreElement.prop("checked",!0),a||this.trigger("change"))},uncheck:function(a){this.isChecked()&&(this.prop("checked",
!1),a||this.trigger("change"))},isChecked:function(){return this._$coreElement.is(":checked")}}),u=k(m,{setPlaceholder:function(a){this.attr("placeholder",a)}}),p=k(t,{focus:function(){this.trigger("focus")}}),v=k(m,{setTooltip:function(h,c,f){this.removeTooltip();b.create(this._$coreElement,{position:c,activate:f,content:a.escapeHtml(h)});this.attr("title",a.escapeHtml(h))},removeTooltip:function(){b.remove(this._$coreElement);this.removeAttr("title")}});k=k(m,{getState:function(){return this._state},
setState:function(a){if(this._applicableStateConfigs.hasOwnProperty(a)&&this.getState()!==a){var b=this._getApplicableStateConfig(this.getState());b&&b.exitState(this);this._getApplicableStateConfig(a).enterState(this);this._state=a}},isDisabled:function(){return"disabled"===this._state},isError:function(){return"error"===this._state},_resolveFormState:function(){var b=this.specs;b=e(b.applicableStates,b.formStates);for(var c=a.keys(b),f="normal",g=0;g<c.length;g++)if(b[c[g]].match(this)){f=c[g];
break}this._state=f;this._applicableStateConfigs=b},_getApplicableStateConfig:function(a){return this._applicableStateConfigs[a]}});var f={};a.mixin(f,d,"getOptions getOption addOptions addOption removeOptions removeOption".split(" "));var z={show:function(){this._$wrapperElement.show()},hide:function(){this._$wrapperElement.hide()},isHidden:function(){return!this._$wrapperElement.is(":visible")},val:function(a,b){if("undefined"!==typeof a&&a!==this._$coreElement.val())this._$coreElement.val(a),b||
"function"!==typeof this.trigger||this.trigger("change");else return this._$coreElement.val()}},x={domEventTriggerableControl:t,domManipulableControl:m,checkableControl:y,typeableControl:u,focusableControl:p,declarativeActionControl:{setDeclarativeAction:function(b,c){a.declarative.create(this._$coreElement,b,c)},removeDeclarativeAction:function(b){a.declarative.remove(this._$coreElement,b)}},tooltipableControl:v,stateTransitionableControl:k,selectableControl:f};return{resolveControlImplementation:function(b){var c=
b.specs||{},f=c.mixins||[];c=g(c.interfaces||[]);var e={};f&&f.length&&a.mixin(c,z,f);f=a.filter(a.keys(c),function(a){return!b.hasOwnProperty(a)});a.mixin(e,c,f);return e}}});"use strict";d.when("A").register("prv:a-form-control-proxy",function(a){function c(a,b){if("function"===typeof a[b])return function(){return a[b].apply(a,arguments)}}function b(b,g){var e=a.reduce(b,function(a,b){(b=c(b,g))&&a.push(b);return a},[]);return function(){var b=a.copy([].slice.call(arguments));return a.each(e,function(a){return a.apply(null,
b)})}}function d(a){var b=[],c;for(c in a)"function"===typeof a[c]&&0!==c.indexOf("_")&&b.push(c);return b}function e(b){return a.reduce(d(b),function(a,g){var e=c(b,g);e&&(a[g]=e);return a},{})}function g(c){var g={};g.length=c.length;var e=a.map(c,function(a){return l(a)});g.get=function(a){if(e&&e.length>=a+1)return e[a]};a.each(r,function(b){"function"===typeof a[b]&&(g[b]=function(){var c=[].slice.call(arguments);c.unshift(e);return a[b].apply(g,c)})});var k=d(c[0]);return a.reduce(k,function(g,
f){if(0>a.indexOfArray(m,f)){var e=b(c,f);e&&(g[f]=e)}return g},g)}function l(b){return a.isArray(b)&&1<b.length?g(b):e(a.isArray(b)?b[0]:b)}var r=["each","map","reduce","filter"],m=["getState","isDisabled","isError","isHidden","getNativeElement"];return{create:l}});"use strict";d.when("A","prv:a-form-control-proxy","a-text-input","a-form-radio-button","a-form-textarea","a-form-checkbox","a-form-multiselect").register("a-form",function(a,c,b,k,e,g,l){function r(a,b){a.is("input,select,textarea")||
(a=a.find("input,select,textarea").first());return b&&"function"===typeof b?b(a):null}function m(a){return function(b,c){return u(this,b,c,a)}}function n(b,c){for(var g=a.keys(c||{}),e=0;e<g.length;e++){var f=g[e],d=c[f];f=b.$el.find('[name\x3d"'+a.escapeJquerySelector(f)+'"]');f.length&&(f.is("select[multiple]")||1<f.length&&f.is("[type\x3dcheckbox]")||1<f.length&&f.is("[type\x3dradio]")?f.val([].concat(d)):a.isArray(d)&&f.length===d.length?f.val(function(a){return d[a]}):f.val(d))}}function q(b){b=
b.$el.serializeArray();return a.reduce(b,function(b,c){b.hasOwnProperty(c.name)?(a.isArray(b[c.name])||(b[c.name]=[b[c.name]]),b[c.name].push(c.value)):b[c.name]=c.value;return b},{})}function u(b,g,e,d){var f=b.$el;b=p(g,f);if(!b||!b.length)return null;e?(e=a.reduce(b,function(b,c){if((c=r(p(c),d))&&!c.jquery){var g=c.getNativeElement().name,e=c.specs.tag;b.hasOwnProperty(g)||(e=p(e+('[name\x3d"'+a.escapeJquerySelector(g)+'"]'),f),b[g]=1<e.length?r(e,d):c)}return b},{}),e=a.values(e)):e=a.map(b,
function(a){return r(p(a),d)});return c.create(e)}var p=a.$,v=a.createClass({init:function(b){b=p(b);b.is("form")?a.constProp(this,"$el",b):a.constProp(this,"$el",b.closest("form"));this.$el&&this.$el.length||d.error("The selector does not resolve back to a form","AmazonUIFormControlsJS","Form")},getTextInput:m(b),getRadioButton:m(k),getTextArea:m(e),getCheckbox:m(g),getMultiSelect:m(l),val:function(a){if(p.isPlainObject(a))n(this,a);else return q(this)},reset:function(){this.$el[0].reset()}});return function(a){return new v(a)}});
"use strict";d.when("A","prv:a-base-form-control-specs","prv:a-text-input-specs-overrides").register("prv:a-text-input-specs",function(a,c,b){return new (c.extend(a.extend({tag:"input",attrs:{type:"text color date datetime datetime-local email month number password search tel time url week".split(" ")},wrapperElementSelector:".a-input-text-addon-group-wrapper",applicableStates:["normal","disabled","error","inactive","selected"],interfaces:["stateTransitionableControl","typeableControl","focusableControl",
"tooltipableControl"],mixins:["show","hide","isHidden","val"]},b)))});"use strict";d.declare("prv:a-text-input-specs-overrides",{attrs:{cssClass:"a-input-text"}});"use strict";d.when("A","a-form-control","prv:a-text-input-specs").register("a-text-input",function(a,c,b){var d=c.create({_componentName:"form_TextInput",specs:b,init:function(a,b){this._super(a,b)}});return function(a,b){return new d(a,b)}});"use strict";d.when("A","prv:a-base-form-control-specs","prv:a-form-textarea-specs-overrides").register("prv:a-form-textarea-specs",
function(a,c,b){return new (c.extend(a.extend({tag:"textarea",applicableStates:["normal","disabled","error","inactive","selected"],interfaces:["stateTransitionableControl","typeableControl","focusableControl"],wrapperElementSelector:".a-input-text-wrapper",mixins:["show","hide","isHidden","val"]},b)))});"use strict";d.declare("prv:a-form-textarea-specs-overrides",{});"use strict";d.when("A","a-form-control","prv:a-form-textarea-specs").register("a-form-textarea",function(a,c,b){var d=c.create({_componentName:"form_TextArea",
specs:b,init:function(a,b){this._super(a,b)}});return function(a,b){return new d(a,b)}});"use strict";d.when("A","prv:a-base-form-control-specs","prv:a-form-radio-button-specs-overrides").register("prv:a-form-radio-button-specs",function(a,c,b){return new (c.extend(a.extend({tag:"input",attrs:{type:"radio"},visualElementSelector:".a-radio",applicableStates:["normal","disabled","error","inactive","selected"],mixins:["show","hide","isHidden"],interfaces:["checkableControl","focusableControl","tooltipableControl",
"stateTransitionableControl"]},b)))});"use strict";d.declare("prv:a-form-radio-button-specs-overrides",{formStates:{disabled:{enterState:function(a){a.prop("disabled",!0)},exitState:function(a){a.prop("disabled",!1)},match:function(a){return a.prop("disabled")}}}});"use strict";d.when("A","a-form-control","prv:a-form-radio-button-specs").register("a-form-radio-button",function(a,c,b){var d=c.create({_componentName:"form_RadioButton",specs:b,init:function(a,b){this._super(a,b)},val:function(a,b){if(a)this._$coreElement.val(1<
this._$coreElement.length?[a]:a),b||this.trigger("change");else return 1<this._$coreElement.length?this._$coreElement.filter(":checked").val():this._$coreElement.val()}});return function(a,b){return new d(a,b)}});"use strict";d.when("A","prv:a-base-form-control-specs","prv:a-form-checkbox-specs-overrides").register("prv:a-form-checkbox-specs",function(a,c,b){return new (c.extend(a.extend({tag:"input",attrs:{type:"checkbox"},visualElementSelector:".a-checkbox",applicableStates:["normal","disabled",
"error","inactive"],mixins:["show","hide","isHidden","val"],interfaces:["checkableControl","focusableControl","tooltipableControl","stateTransitionableControl"]},b)))});"use strict";d.declare("prv:a-form-checkbox-specs-overrides",{formStates:{disabled:{enterState:function(a){a.prop("disabled",!0)},exitState:function(a){a.prop("disabled",!1)},match:function(a){return a.prop("disabled")}}}});"use strict";d.when("A","a-form-control","prv:a-form-checkbox-specs").register("a-form-checkbox",function(a,
c,b){var d=c.create({_componentName:"form_Checkbox",specs:b,init:function(a,b){this._super(a,b)}});return function(a,b){return new d(a,b)}});"use strict";d.when("A","prv:a-base-form-control-specs").register("prv:a-form-multiselect-specs",function(a,c){return new (c.extend({tag:"select",attrs:{cssClass:"a-select-multiple"},formStates:{disabled:{enterState:function(a){a.prop("disabled",!0)},exitState:function(a){a.prop("disabled",!1)},match:function(a){return a.prop("disabled")}}},applicableStates:["normal",
"disabled"],interfaces:["focusableControl","selectableControl","stateTransitionableControl"],mixins:["show","hide","isHidden"]}))});"use strict";d.when("A","a-form-control","prv:a-form-multiselect-specs").register("a-form-multiselect",function(a,c,b){var d=a.constants.NOOP,e=c.create({_componentName:"form_MultiSelect",specs:b,init:function(b,c){this._super(b,c);this.options={$select:this._$coreElement,$button:a.$([])}},val:function(b,c){var d=this._$coreElement,e=d.val();if(b)b=a.isArray(b)?b:[b],
a.equals(e,b)||(d.val(b),c||this.trigger("change"));else return e},hidePopover:d,refreshPopover:d});return function(a,b){return new e(a,b)}})});
/* ******** */
(function(e){var f=window.AmazonUIPageJS||window.P,g=f._namespace||f.attributeErrors,d=g?g("DetailPageVSXOffersAssets",""):f;d.guardFatal?d.guardFatal(e)(d,window):d.execute(function(){e(d,window)})})(function(e,f,g){e.when("A","atf").register("vsx-offers-constants",function(d){return{ACTIVE_CLASS:"a-active",A_DECLARATIVE_SELECTOR:".a-declarative",ASIN:"asin",CATEGORY_CARDS_SELECTOR:".category_cards",CTI_CEPC:"Amazon.in/Category Expansion/CE-PC",CC_CARD_VSX_OFFERS_SELECTOR:".cc-card-vsxoffers",VSX_NLP_DIV_SELECTOR:".vsx_offers_nlp",
DISPLAY_PROPERTY:"display",EMI_CREDIT_NCE_NOT_AVAILABLE:".inemi-credit-nce-not-available",EMI_CREDIT_STANDARD_PLANS_TABLE_TITLE:".inemi-credit-standard-plans-table-title",EMI_CREDIT_TOGGLE_SWITCH:"#credit-toggle-switch",EMI_DEBIT_NCE_NOT_AVAILABLE:".inemi-debit-nce-not-available",EMI_DEBIT_STANDARD_PLANS_TABLE_TITLE:".inemi-debit-standard-plans-table-title",EMI_DEBIT_TOGGLE_SWITCH:"#debit-toggle-switch",INPUT:" input",EMI_LIST_VIEW_ITEMS:".emi-list-view-items",EMI_NCE_NOT_AVAILABLE_NOTE_CREDIT_EMI:".inemi-nce-not-available-note-credit-emi",
EMI_NCE_NOT_AVAILABLE_NOTE_DEBIT_EMI:".inemi-nce-not-available-note-debit-emi",EMI_POPOVER_PRELOAD:"#a-popover-preLoad",EMI_STANDARD_PLANS_CREDIT:".inemi-standard-plans-credit",EMI_STANDARD_PLANS_DEBIT:".inemi-standard-plans-debit",EMI_TAB:"-emi-tab",EMI_TAB_AMAZON:"amazon-pay",EMI_TAB_CREDIT:"credit",EMI_TAB_DEBIT:"debit",EMI_TYPE:"emitype",EMI_TYPE_AMAZON_CREDIT:"AmazonCredit",EMI_TYPE_CREDIT_CARD:"CreditCard",EMI_TYPE_DEBIT_CARD:"DebitCard",ERROR_LOG_LEVEL:"ERROR",EVENT_CLICK:"click",EVENT_POPOVER_AfTER_SHOW:"a:popover:afterShow:",
EVENT_POPOVER_AJAX_CONTENT_LOADED:"a:popover:ajaxContentLoaded:",EVENT_POPOVER_AJAX_FAILED:"a:popover:ajaxFail:",EXPANDER_AJAX_ERROR:"EXPANDER_AJAX_ERROR",EXPANDER_FETCH_ERROR:"Error fetching the details. Try again later",EXPANDER_STATUS_CODE_ERROR:"EXPANDER_STATUS_CODE_ERROR",HERES_HOW_EXAPANDER:"heres_how_expander",HERES_HOW_EXAPANDER_BODY:".heres-how-expander-body",HERES_HOW_EXAPANDER_HEAD:".heres-how-expander-head",ICART_OFFER_BOX:"#itembox-iCart",IN_EMI:"#inemi-",INHERIT_DISPLAY_PROPERTY:"inherit",
NCEMI_TYPE_SELECTOR:"#vsx__ncemi-type",NCEMI_ERROR_CONTAINER_SELECTOR:"#vsx__ncemi-error-container",NCEMI_ERROR_CONTENT_SELECTOR:"#vsx__ncemi-error-content",NCEMI_FETCH_ERROR:"NCEMI_FETCH_ERROR ",NCEMI_ID_NOT_FOUND:"NCEMI_ID_NOT_FOUND",NCEMI_STATUS_CODE_ERROR:"NCEMI_STATUS_CODE_ERROR",NCEMI_TREATMENT_T1:"#ncemi-treatment-t1",NOCOST_EMI_FEATURES_PARAM:"inPriceBlockEmi-secondaryviews,inemi",NOCOST_EMI_REQUEST_ENDPOINT:"/gp/product/ajax",NOCOST_EMI_EXPERIENCE_ID:"emiMenueSVAjaxExperience",NOCOST_EMI_SECONDARY_VIEW:"#vsxoffers-emi-secondary-view",
OFFER_URL:"url",REFTAG_OFFER_SUFFIX:"_click",REFTAG_PREFIX:"tp_cc_vsx_offers_",REFTAG_URL:"/hctp/log/refMarker?ref_\x3d",REFTAG_PREFIX_DESKTOP:"tp_desktop_cc_vsx_offers_",REQUEST_ACCEPT_TEXT_HTML:"text/html, charset:utf-8",REQUEST_METHOD_GET:"get",VSX_OFFERS_FEATURE_NAME:"vsxoffers",VSX_OFFERS_ITEMS_CONTENT:".offers-items-content",VSX_OFFERS_ITEMS_CONTENT_LINK:"vsx__offers-items-content-a",VSX_OFFER_SIMPLE_CARD_CLICKED_ACTION:"vsxOfferSimpleCardClickedAction",OFFERS_CARD_ICON:".vsx__offers-holder .headings-icon .a-image-wrapper",
VSX_OFFERS_MAINVIEW_ITEMS_CONTENT:".vsx__offers-mainview-item-content",ATTRIBUTE_ONCLICK:"onclick",REFTAG_VSX_PSP_PREFIX:"vsx_psp_",VSX_ICART_PSP_REDIRECT:"icart-psp-redirect",OFFER_ID:"offerid",TWISTER_PLUS_SIDE_SHEET_CONTENT_SELECTOR:"#twister-plus-side-sheet-content",VSX_OFFERS_CAROUSEL:"vsx-offers-carousel",OFFER_CATEGORY_SELECTOR:".offer_category",OFFERS_MOD_CARD_DECK:".cc-card-vsxoffers .offersConsistencyEnabled",OFFERS_MOD_CARD_DECK_DESKTOP:".vsxoffers_desktop_feature .offersConsistencyEnabled",
OFFER_TYPE_NOCOSTEMI:"NoCostEmi",OFFER_TYPE_PARTNER:"Partner",OFFER_TYPE_CASHBACK:"GCCashback",OFFER_TYPE_ICART:"iCart",OFFER_TYPE_BANK:"InstantBankDiscount",OFFER_TYPE_CARD_VIEW:"cardView",AUI_HIDE_CLASS:"aok-hidden",AUI_EXPANDER:"a:expander:",AUI_EXPANDER_EXPAND:":toggle:expand",AUI_EXPANDER_COLLAPSE:":toggle:collapse",OFFERS_EXPANDER:"vsx-offers-expander-header",OFFERS_CONTENT_SELECTOR:".vsx__commons .a-expander-container .offers-expander-content",OFFERS_EXPANDER_ICON_SELECTOR:".vsx__commons .a-expander-container .offers-header .a-icon",
DATA_EXPANDED:"data-expanded",EXPANDER_CONTENT_EXPANDED_CLASS:"a-expander-content-expanded",EXPANDER_CONTENT_COLLAPSED_STYLE:"overflow: hidden; display: none;",EXPANDER_ICON_COLLAPSE_CLASS:"a-icon-section-collapse",EXPANDER_ICON_EXPAND_CLASS:"a-icon-section-expand",FALSE:"false",STYLE:"style",OFFERS_EXPANDED:"offers-expanded",csmCountMetrics:{METRIC_PREFIX:"VSXOffers:",METRIC_TYPE_ERROR:"Error:",METRIC_TYPE_SUCCESS:"Success:",AJAX_FAILURE:"AjaxFailure",SECONDARY_SIDE_SHEET:"SecSideSheet:",PRIMARY_SIDE_SHEET:"PrimarySideSheet",
PRIMARY_POPOVER_VIEW:"PrimaryPopOverView",SECONDARY_POPOVER_VIEW:"SecondaryPopOverView",COLON:":",OFFERS_CARD_COLLAPSE:"CardCollapse",OFFERS_CARD_EXPAND:"CardExpand",NLP_DETAIL_CLICK:"NLPDetailClick",NLP_REFRESH:"NLPRefresh",NLP_SELECT:"NLPCardSelect",NLP_SEE_ALL_EMI:"NLPSeeAllEmi",NLP_SEE_ALL_OFFERS:"NLPSeeAllOffers",NLP_FETCH_GXA_DATA:"FetchNlpGxaData",NLP_COMBO_CARD:"combocard"},AJAX_VSX_DATA_SELECTOR:"#vsx__offer-data",DESKTOP_DEVICE_TYPE:"web",MOBILE_DEVICE_TYPE:"mobile",VSX_OFFERS_GXA_ENDPOINT:"/gp/product/ajax",
GXA_EXPERIENCE_ID:"vsxOffersSecondaryView",GXA_FEATURES:"vsxoffers",AJAX_DEFAULT_FALLBACK_MESSAGE:"Sorry, content is not available.",AJAX_ERROR_MESSAGE_SELECTOR:"ajaxerrormessage",BUYING_OPTION_INDEX:"buyingoptionindex",SMID:"smid",ENCRYPTED_MERCHANT_ID:"encryptedmerchantid",SR:"sr",QUERY_ARGS:"query-args",NONE:"none",POUND:"#",NORMAL:"normal",TRUE:"true",NOCOSTEMI:"NoCostEmi",_MAIN_CONTAINER:"_main_container",AUI_SPACING_NONE:"a-spacing-none",SECONDARY_PAGE:"secondaryPage",EMI_TABLE_CLASS:".emi_table_card_deck",
AUI_PADDING_NONE:"a-padding-none",AUI_PADDING_BASE:"a-padding-base",SPACE:" ",SEE_MORE_LINK_CLASS:".see_more_link",AUI_BTN_FOCUS_CLASS:"a-button-focus",AUI_TAB_BTN_CLASS:".vsx_tab_btn",VSX_TAB_LI_PREFIX:"#vsx_tab_offer_li_",NEAREST:"nearest",SCROLL:"scroll",OFFER_CATEGORY_TOGGLE_GROUP_ID:"#tab_btn_group",EMI_CREDIT_TAB_ID:"#inemi-credit-emi-tab",EMI_DEBIT_TAB_ID:"#inemi-debit-emi-tab",EMI_APAY_TAB_ID:"#inemi-amazon-pay-emi-tab",SECONDARY_VIEW:"secondaryView",TNC_MESSAGE_SELECTOR:".offer_messages .message a",
EMI_SECONDARY_VIEW_NAME:"emiSecondaryView",SEE_ALL_EMI_LINK_SELECTOR:".see_all_emi_offers .see_all_link a",COMMON_OFFER_BOTTOMSHEET_ACTION:"common-offer-bottomsheet-item-clicked-action",BANK_OFFER_BOTTOMSHEET_ACTION:"bank-offer-bottomsheet-item-clicked-action",SIMPLE_CARD_CLICKED_ACTION:"vsx-offer-simple-card-clicked-action",LOGO_CARD_CLICKED_ACTION:"vsx-offer-logo-card-clicked-action",SHOW_LIST_VIEW_ACTION:"show-list-view-action",OFFER_CARD_SCROLLER_ID:"#offer_cards_scroller",LAST_OFFER_CARD_SELECTOR:".offer_card:last",
SEE_ALL_LINKS_SECTION_ID:"#see_all_links",TAB_BTN_TOGGLE_EVENT:"a:button-group:tab_btn_group:toggle",REUSABLE_SPINNER_ID:"#offersv2-reusable-spinner",EMI_PLAN_SECONDARY_VIEW_ID:"#emiPlansSecondaryView",AUI_PAGE_UPDATE_EVENT:"a:pageUpdate",LOGO_CARD_PREFIX:"logo_card_",SIMPLE_CARD_PREFIX:"simple_card_",CLICK_METRIC_PREFIX:"tp_cc_vsx_offersv2_",CLICK_METRIC_SUFFIX:"_click",METRIC_BANK_OFFER:"bankoffer_",BOTTOMSHEET_PREFIX:"bs",SEE_ALL_INGRESS_PREFIX:"_see_all",SEE_MORE_INGRESS_PREFIX:"_see_more",UNDERSCORE:"_",
IBD:"InstantBankDiscount",BANK_OFFER_TNC:"bankoffer_tnc",INLINE:"inline",BOTTOMSHEET_AFTER_SHOW_EVENT:"a:sheet:afterShow:",SHOW_COMBINED_LIST_VIEW_ACTION:"show-combined-list-view-action",METRIC_COMBINED_LABEL:"combined",AUI_POPOVER_PREFIX:"#a-popover-",PADDING_BASE:"base",COMBINED_LIST_VIEW_EXPANDER_EVENT_EXPAND:"a:expander:combined_listview_expander:toggle:expand",COMBINED_LIST_VIEW_SEE_ALL_CLASS:".combined_see_all",EXPANDER_REFMARKER:"expander",OFFERS_V2_ID:"#vsx_offers_v2",OFFER_CATEGORY_CLASS:"#vsx_offers_v2 .offer_category",
VSX_OFFERS_CATEGORY_CARDS:".cc-card-vsxoffers",VSX_DESKTOP_OFFER_ITEMS:".vsxoffers_desktop_feature .offers-items",VSX_DESKTOP_FEATURE:".vsxoffers_desktop_feature",VSX_OFFER_GLANCE_VIEW_METRIC_PREFIX:"vsxoffer_gv_",VSX_GLANCE_VIEW_METRIC_SUFFIX:"_gv",VSX_SESSION_METRIC_SUFFIX:"_session",VSX_DESKTOP_OFFER_EXPANDER_CONTENT_SELECTOR:"#vsx-desktop-offer-expander-content-",NLP_CARD_SCROLLER:".nlp_cards_scroller",ccManagerInputParams:{couponItemType:"coupons",offerItemType:"offers",selectionType:{ADD:"add",
DELETE:"delete"},price:0}}});"use strict";e.when("A","vsx-offers-constants","postMetric","atf").register("vsx-offers-utils",function(d,a,e){function h(k,b){b?c(b+" "+a.IN_EMI+k+a.EMI_TAB).click():c(a.IN_EMI+k+a.EMI_TAB).click()}function g(c){f.ueLogError&&f.ueLogError({message:c},{logLevel:a.ERROR_LOG_LEVEL,attribution:a.VSX_OFFERS_FEATURE_NAME})}var c=d.$;return{logError:g,registerRefTag:function(d){c.get(a.REFTAG_URL+d)},onEmiAjaxSuccess:function(d,b){b=b?b+" ":"";switch(d){case a.EMI_TYPE_CREDIT_CARD:h(a.EMI_TAB_CREDIT,
b);break;case a.EMI_TYPE_DEBIT_CARD:h(a.EMI_TAB_DEBIT,b);break;case a.EMI_TYPE_AMAZON_CREDIT:h(a.EMI_TAB_AMAZON,b);break;default:h(a.EMI_TAB_CREDIT,b)}c(b+" "+a.EMI_POPOVER_PRELOAD)&&c(b+" "+a.EMI_DEBIT_TOGGLE_SWITCH)&&c(b+" "+a.EMI_CREDIT_TOGGLE_SWITCH)?(c(b+" "+a.EMI_POPOVER_PRELOAD).show(),c(b+" "+a.EMI_DEBIT_TOGGLE_SWITCH).addClass(a.ACTIVE_CLASS),c(b+" "+a.EMI_DEBIT_NCE_NOT_AVAILABLE).hide(),c(b+" "+a.EMI_STANDARD_PLANS_DEBIT).hide(),c(b+" "+a.EMI_DEBIT_STANDARD_PLANS_TABLE_TITLE).hide(),c(b+
" "+a.EMI_NCE_NOT_AVAILABLE_NOTE_DEBIT_EMI)&&c(b+" "+a.EMI_NCE_NOT_AVAILABLE_NOTE_DEBIT_EMI).css(a.DISPLAY_PROPERTY,a.INHERIT_DISPLAY_PROPERTY),c(b+" "+a.EMI_CREDIT_TOGGLE_SWITCH).addClass(a.ACTIVE_CLASS),c(b+" "+a.EMI_CREDIT_NCE_NOT_AVAILABLE).hide(),c(b+" "+a.EMI_STANDARD_PLANS_CREDIT).hide(),c(b+" "+a.EMI_CREDIT_STANDARD_PLANS_TABLE_TITLE).hide(),c(b+" "+a.EMI_NCE_NOT_AVAILABLE_NOTE_CREDIT_EMI)&&c(b+" "+a.EMI_NCE_NOT_AVAILABLE_NOTE_CREDIT_EMI).css(a.DISPLAY_PROPERTY,a.INHERIT_DISPLAY_PROPERTY),
c(b+" "+a.NCEMI_TREATMENT_T1).show()):(g(a.NCEMI_ID_NOT_FOUND),c(b+" "+a.NOCOST_EMI_SECONDARY_VIEW).show())},logCountMetric:function(c,b){e.postCountMetric(a.csmCountMetrics.METRIC_PREFIX+b+c)}}})});
/* ******** */
(function(c){var b=window.AmazonUIPageJS||window.P,d=b._namespace||b.attributeErrors,a=d?d("DetailPageFreebiesAssets",""):b;a.guardFatal?a.guardFatal(c)(a,window):a.execute(function(){c(a,window)})})(function(c,b,d){});
/* ******** */
(function(h){var p=window.AmazonUIPageJS||window.P,n=p._namespace||p.attributeErrors,c=n?n("DetailPageOfferDisplayFeatureCommonAssets",""):p;c.guardFatal?c.guardFatal(h)(c,window):c.execute(function(){h(c,window)})})(function(h,p,n){h.when("A","odf-metric-utils").register("progressive-display-utils",function(c,g){function m(b,f){e(".offer-display-features-expander").each(function(d,a){d=e(a);a=d.find(".a-expander-header.odf-expander-heading");if(a.is(":visible")){var c=d.attr("data-a-expander-collapsed-height");
if("undefined"===typeof c||!1===c||!0===f){var r=d.find(".offer-display-features-container").attr("displayable-row-count"),l=a.height()+4+6;d.find(".offer-display-feature-label").each(function(b,d){if(b>=parseInt(r))return!1;l+=e(d).outerHeight(!0)});d.attr("data-a-expander-collapsed-height",l);0<d.find('div[data-expanded\x3d"false"]').length&&(d.height(l),d.find(".a-expander-content-fade").remove());g.publishCountMetrics(b+"ProgressiveDisplayHeightSet")}g.publishCountMetrics(b+"ProgressiveDisplayAvailable")}else g.publishCountMetrics(b+
"ProgressiveDisplayNotAvailable")})}function h(b){e(".offer-display-features-expander").each(function(f,d){f=e(d);d=f.find(".offer-display-features-container").attr("displayable-row-count");var c=f.find(".offer-display-feature-label").not(".show-more .offer-display-feature-label").length;"undefined"!==typeof d&&c<=d?(d=f.find(".offer-display-features-show-more"),d.length&&d[0].classList.remove("a-spacing-small"),d=f.find(".a-expander-header.odf-expander-heading"),d.length&&d[0].classList.add("aok-hidden"),
f=f.find(".show-more"),0<f.length&&f.find(".offer-display-feature-label")[0].classList.add("aok-hidden"),g.publishCountMetrics(b+"ProgressiveDisplayHidden")):"undefined"!==typeof d&&a(f)})}function k(b){var f=0;e(".offer-display-dynamic-features").each(function(b,e){e.classList.remove("aok-hidden");f+=1});g.publishCountMetrics(b+"UnHidingDynamicFeatures",f)}function l(b){e(".collapsed-offer-display-features").each(function(f,d){f=e(d);var a=f.find(".offer-display-features-container").attr("displayable-row-count");
d=f.find(".offer-display-feature-label").length;"undefined"!==typeof a&&d>a&&(f.find(".offer-display-feature-label").each(function(b,d){b>=a&&e(d).parent()[0].classList.add("aok-hidden")}),g.publishCountMetrics(b+"FeaturesHiddenInCollapsedAccordion",d-a))})}function a(b){var a=b.find(".offer-display-features-container").attr("displayable-row-count");"undefined"!==typeof a&&b.find(".offer-display-feature-label").each(function(b,f){b>=a&&e(f).parent()[0].classList.add("aok-hidden")})}function q(b,a){b=
g.buildMetricPrefix(b,a);k(b);h(b);m(b,!1);l(b)}var e=c.$;return{initializeAndSetEventListeners:function(b){q(b,"pageLoad");c.on("a:pageUpdate",function(){q(b,"pageUpdate")});c.on("a:accordion:buybox-accordion:select",function(){m(g.buildMetricPrefix(b,"accordionSelect"),!1)});c.on("a:tabs:offerDisplayGroup_tabs:select",function(){m(g.buildMetricPrefix(b,"tabSelect"),!1)});c.on("a:odf:resetHeightForProgressiveFaceOut",function(){m(g.buildMetricPrefix(b,"resetHeightForProgressiveFaceOut"),!0)})},alignOverlappingElements:function(b,
a){var d=b.find(".a-expander-header.odf-expander-heading a")[0].getBoundingClientRect(),e=b.find(".offer-display-features-show-more a")[0].getBoundingClientRect();d=d.right-e.left;-10<=d&&(b.find(".offer-display-features-show-more a").css("paddingLeft",d+10),b=g.buildMetricPrefix(a),g.publishCountMetrics(b+"AlignedOverlappingElements"))},showFeaturesUnderProgressiveDisplay:function(b){var a=b.find(".offer-display-features-container").attr("displayable-row-count");"undefined"!==typeof a&&b.find(".offer-display-feature-label").each(function(b,
f){b>=a&&e(f).parent()[0].classList.remove("aok-hidden")})},hideFeaturesUnderProgressiveDisplay:a}});"use strict";h.when("A","odf-metric-utils").register("truncation-utils",function(c,g){function m(a,c){var e=l(a),b=!1;if(e.css("line-clamp")!==(3).toString()&&e.css("-webkit-line-clamp")!==(3).toString()){e=e.children("a").length?e.children("a").first():e;var f=e.text();e.text("...");var d=a.offsetHeight;for(e.text(f);a.offsetHeight>3*d;)b=!0,-1<e.text().indexOf(" ")?e.text(e.text().replace(/\W*\s(\S)*$/,
"...")):e.text(e.text().substring(0,e.text().length-6)+"...");c||e.text(f)}else b=a.scrollHeight>a.clientHeight;return b}function h(a,c,e){a.closest(".offer-display-feature-text[offer-display-attribute-name],.offer-display-feature-text[offer-display-feature-name]").find(".odf-truncation-popover").each(function(b,a){b=l(a);b.is(".offer-display-feature-text")?c?b.addClass("aok-hidden"):b.removeClass("aok-hidden"):c?(b.removeClass("aok-hidden"),g.publishCountMetrics(e+"TruncationPopoverShown")):(b.addClass("aok-hidden"),
g.publishCountMetrics(e+"TruncationPopoverNotShown"))})}function k(a,c){var e=g.buildMetricPrefix(a,c);l(".offer-display-features-container").each(function(b,a){var d=!1;l(a).find(".offer-display-feature-text-message").each(function(b,a){b=l(a);b.parent().is(".odf-truncation-popover")&&b.parent().is(".offer-display-feature-text")?(b.parent().removeClass("aok-hidden"),a=m(a,!1),h(b,a,e)):a=m(a,!0);a&&(d=!0)});d?g.publishCountMetrics(e+"ContentTruncated"):g.publishCountMetrics(e+"ContentNotTruncated")})}
var l=c.$;return{setEventsToUpdateTextVisibility:function(a){k(a,"pageLoad");if("Mobile"===a)c.on(c.constants.BROWSER_EVENTS.RESIZE,function(){k(a,"pageResize")});c.on("a:accordion:buybox-accordion:select",function(){k(a,"accordionSelect")});c.on("a:tabs:offerDisplayGroup_tabs:select",function(){k(a,"tabSelect")});c.on("a:pageUpdate",function(){k(a,"pageUpdate")})}}});"use strict";h.when("A").register("odf-metric-utils",function(c){function g(c,a){c="ODF."+c+".";a&&(c+=a+".");return c}function h(c,
a){k&&k.count&&k.count(c,a?a:1)}var n=c.$,k=p.ue;return{buildMetricPrefix:g,publishCountMetrics:h,publishFeatureLevelMetrics:function(c){n(".offer-display-features").find(".offer-display-feature-label").not(".show-more .offer-display-feature-label").each(function(a,k){a=n(k).attr("offer-display-feature-name");a=g(c)+a+".Display";h(a)})}}})});
/* ******** */
(function(c){var f=window.AmazonUIPageJS||window.P,g=f._namespace||f.attributeErrors,a=g?g("DetailPageOfferDisplayFeatureDesktopAssets",""):f;a.guardFatal?a.guardFatal(c)(a,window):a.execute(function(){c(a,window)})})(function(c,f,g){c.when("A","progressive-display-utils","odf-metric-utils").execute("offer-display-features-expander",function(a,e,d){e.initializeAndSetEventListeners("Desktop");a.on("a:expander:offer-display-features-expander:toggle:expand",function(b){b=b.expander.$expander;var a=b.find(".a-expander-header.odf-expander-heading").height();
b.find(".offer-display-features-show-more").is(":visible")?b.children(".a-row").css("paddingTop",a):b.children(".a-row").css("paddingTop",a+4);e.showFeaturesUnderProgressiveDisplay(b);d.publishCountMetrics(d.buildMetricPrefix("Desktop")+"ProgressiveDisplayExpand")});a.on("a:expander:offer-display-features-expander:toggle:collapse",function(b){b=b.expander.$expander;var a=b.attr("data-a-expander-collapsed-height");b.children(".a-row").css("paddingTop","0px");b.height(a);e.hideFeaturesUnderProgressiveDisplay(b);
d.publishCountMetrics(d.buildMetricPrefix("Desktop")+"ProgressiveDisplayCollapse")})});"use strict";c.when("A","odf-metric-utils").execute("publish-feature-metrics",function(a,e){e.publishFeatureLevelMetrics("Desktop")});"use strict";c.when("A","truncation-utils","odf-metric-utils").execute("truncate-offer-display-features",function(a,e,d){var b=a.$,c=d.buildMetricPrefix("Desktop");e.setEventsToUpdateTextVisibility("Desktop");b("#offer-display-features #sellerProfileTriggerId").click(function(){d.publishCountMetrics(c+
"SellerProfileTriggerIdClicked");0===b(this).closest(".offer-display-feature-text .odf-truncation-popover").length&&d.publishCountMetrics(c+"TruncationPopoverSellerProfileTriggerIdClicked")});a.on("a:popover:visible",function(a){a.popover.$trigger.find(".odf-truncation-popover").length&&d.publishCountMetrics(c+"TruncationPopoverInteracted")})})});
/* ******** */
(function(d){var f=window.AmazonUIPageJS||window.P,g=f._namespace||f.attributeErrors,b=g?g("DetailPageLoyaltyRewardPointsEarningsAssets",""):f;b.guardFatal?b.guardFatal(d)(b,window):b.execute(function(){d(b,window)})})(function(d,f,g){d.when("A","a-modal","earnings-bottom-sheet-aapi-util").register("diamonds-earnings-modal",function(b,d,e){function f(a){var c=JSON.stringify({domain:a.currencyType,marketplaceId:a.marketplaceId,balanceTypes:[k.PRIMARY],consistencyType:k.CONSISTENCY_TYPE});e.getAAPIProductData(a.aapiEndpoint,
a.csrfToken,a.language,c).done(function(a){a=g(a,k.PRIMARY);b.$(h.ajaxTextPointsDiv).text(parseInt(a).toLocaleString("en-US"));b.$(h.earningsSheetContentSpinner).addClass("aok-hidden");b.$(h.earningsBottomSheetContent).removeClass("aok-hidden")})}function g(a,b){return a&&a.entity&&a.entity.balances?(a=a.entity.balances.find(function(a,c){return a.balanceType===b}))?a.amount:0:0}var k=Object.freeze({PRIMARY:"PRIMARY",LIFETIME_EARNINGS:"LIFETIME_EARNINGS",CONSISTENCY_TYPE:"STRICT"}),c=Object.freeze({MODAL_NAME:"diamonds-earnings-modal-content",
WIDTH:"390",PADDING:"none",HIDE_HEADER:!0,CLOSE_TYPE:"icon"}),h={earningsBottomSheetContent:".earnings-sheet-content",ajaxTextPointsDiv:".earningsPointsBalance",earningsSheetContentSpinner:".earnings-bottom-sheet-spinner"};b.declarative("diamonds-earnings-modal","click",function(a){var e;if(e=d.get(c.MODAL_NAME)||d.create(a.$target,{name:c.MODAL_NAME,height:c.HEIGHT,width:c.WIDTH,padding:c.PADDING,hideHeader:c.HIDE_HEADER,closeType:c.CLOSE_TYPE}))b.$(h.earningsSheetContentSpinner).removeClass("aok-hidden"),
b.$(h.earningsBottomSheetContent).addClass("aok-hidden"),e.show(),f(a.data)})});"use strict";d.when("A").register("earnings-bottom-sheet-aapi-util",function(b){var d=b.$,e=document.querySelector('meta[name\x3d"encrypted-slate-token"]'),e=e?e.content:e;return{getAAPIProductData:function(b,f,g,c){return d.ajax({url:"https://"+b+"/custom/marbleserviceaapicontracts/marblesservice-getbalances-aapi",type:"POST",headers:{Accept:'application/vnd.com.amazon.api+json; type\x3d"aapi.marbleserviceaapicontracts.custom.marbleserviceaapi.getbalances.response/v1"',
"Content-Type":'application/vnd.com.amazon.api+json; type\x3d"aapi.marbleserviceaapicontracts.custom.marbleserviceaapi.getbalances.request/v1"',"x-api-csrf-token":f,"Accept-Language":g,"x-amzn-encrypted-slate-token":e},data:c,xhrFields:{withCredentials:!0}})}}})});
/* ******** */
(function(g){var k=window.AmazonUIPageJS||window.P,m=k._namespace||k.attributeErrors,b=m?m("DetailPageLoyaltyRewardPointsRedemptionAssets",""):k;b.guardFatal?b.guardFatal(g)(b,window):b.execute(function(){g(b,window)})})(function(g,k,m){var b=Object.freeze({PRIMARY:"PRIMARY",LIFETIME_EARNINGS:"LIFETIME_EARNINGS",CONSISTENCY_TYPE:"STRICT"}),l=Object.freeze({MODAL_NAME:"diamonds-redemption-modal-content",WIDTH:"395",PADDING:"none",HIDE_HEADER:!0,CLOSE_TYPE:"icon"});g.when("A","a-modal","redemption-bottom-sheet-aapi-util").register("redemption-bottom-sheet",
function(n,k,h){function m(f){function q(a,c){return a&&a.entity&&a.entity.balances?(a=a.entity.balances.find(function(a,e){return a.balanceType===c}))?a.amount:0:0}function r(a,d){if(a>=d)e(c.progressBarContents).addClass("aok-hidden");else{var b=a/d*100;g.when("a-meter").execute(function(){n.$(c.progressBar).find(".a-meter-bar")["0"].attributes["1"].nodeValue="width: "+b+"%;background-color: #008296; margin-left: -6%;";e(c.progressBarContents).removeClass("aok-hidden")})}}var d=f.data,p;p||(p=k.create(f.$target,
{name:l.MODAL_NAME,height:l.HEIGHT,width:l.WIDTH,padding:l.PADDING,hideHeader:l.HIDE_HEADER,closeType:l.CLOSE_TYPE}));e(c.redemptionSheetContentSpinnerClass).removeClass("aok-hidden");e(c.redemptionBottomSheetContentClass).addClass("aok-hidden");p.show();f=JSON.stringify({domain:d.currencyType,marketplaceId:d.marketplaceId,balanceTypes:[b.PRIMARY,b.LIFETIME_EARNINGS],consistencyType:b.CONSISTENCY_TYPE});h.getAAPIProductData(d.aapiEndpoint,d.csrfToken,d.language,f).done(function(a){var f=q(a,b.PRIMARY);
e(c.ajaxTextPointsDivClass).text(parseInt(f).toLocaleString(d.language));e(c.redemptionSheetContentSpinnerClass).addClass("aok-hidden");e(c.redemptionBottomSheetContentClass).removeClass("aok-hidden");d.lifetimeBalanceEnabled&&(a=q(a,b.LIFETIME_EARNINGS),f=parseInt(d.minimumLifetimeBalanceThreshold),e(c.remainingDiamondsTextDiv).text(parseInt(f-a).toLocaleString(d.language)),e(c.diamondsCollected).text(parseInt(a).toLocaleString(d.language)),e(c.minimumLifetimeBalanceRequired).text(parseInt(d.minimumLifetimeBalanceThreshold).toLocaleString(d.language)),
r(a,f))})}var e=n.$,c={redemptionBottomSheetContentClass:".redemption-bottom-sheet-container-class",ajaxTextPointsDivClass:".redemptionPointsTextDivClass",redemptionSheetContentSpinnerClass:".redemption-bottom-sheet-spinner-class",remainingDiamondsTextDiv:"#remainingDiamondsToCollect",diamondsCollected:"#diamondsCollectedNumerator",progressBarContents:"#progressBarContents",progressBar:"#progress-bar-bottom-sheet",minimumLifetimeBalanceRequired:"#diamondsCollectedDenominator"};n.declarative("diamonds-redemption-modal",
"click",function(c){m(c)})});"use strict";g.when("A").register("redemption-bottom-sheet-aapi-util",function(b){var g=b.$,h=document.querySelector('meta[name\x3d"encrypted-slate-token"]'),h=h?h.content:h;return{getAAPIProductData:function(b,e,c,f){return g.ajax({url:"https://"+b+"/custom/marbleserviceaapicontracts/marblesservice-getbalances-aapi",type:"POST",headers:{Accept:'application/vnd.com.amazon.api+json; type\x3d"aapi.marbleserviceaapicontracts.custom.marbleserviceaapi.getbalances.response/v1"',
"Content-Type":'application/vnd.com.amazon.api+json; type\x3d"aapi.marbleserviceaapicontracts.custom.marbleserviceaapi.getbalances.request/v1"',"x-api-csrf-token":e,"Accept-Language":c,"x-amzn-encrypted-slate-token":h},data:f,xhrFields:{withCredentials:!0}})}}})});
/* ******** */
(function(h){var f=window.AmazonUIPageJS||window.P,l=f._namespace||f.attributeErrors,c=l?l("DetailPageContextualTrustWidgetAssets@logger","DetailPageContextualTrustWidget"):f;c.guardFatal?c.guardFatal(h)(c,window):c.execute(function(){h(c,window)})})(function(h,f,l){h.when("A","ready").register("get-contextual-tw-page-state",function(c){return{parseJSON:function(e,b){b="contextual-tw-state-"+b;var d='script[data-a-state\x3d"{"key":"'+b+'"}"]',a;try{a=c.$("#"+e).find(d).html()}catch(k){console.log(k.message)}a?
e=c.$.parseJSON(a):(c.state.parse(),e=c.state(b));return e}}});h.declare("contextual-tw-metrics-constants",{CONTEXTUAL_TW_FEATURE_DIV:"contextualTrustWidget_feature_div",CONTEXTUAL_TW_PAGE_STATE_HOLDER_DIV:"contextual-tw-pagestate-holder",METRIC_TYPE:{GLANCE_VIEW:"GLANCE_VIEW",ICON_CLICK:"ICON_CLICK",SECONDARY_PAGE_OPEN:"SECONDARY_PAGE_OPEN",SECONDARY_PAGE_CLOSE:"SECONDARY_PAGE_CLOSE",ABSENT:"ABSENT",EXPANDER_OPEN:"EXPANDER_OPEN"},REF_MARKER_PREFIX:{CONTEXTUAL_TRUST_WIDGET:"contextual_tw_wid",RETURNS_POLICY:"contextual_tw_rp",
PAY_ON_DELIVERY:"contextual_tw_pod",GENERIC_RETURN_POLICY:"contextual_tw_grp",MULTIPLE_SPECIFIC_RETURN_POLICY:"contextual_tw_msrp",SINGLE_SPECIFIC_RETURN_POLICY:"contextual_tw_ssrp",PAY_ON_DELIVERY_ACTIVE:"contextual_tw_pod_active",PAY_ON_DELIVERY_INACTIVE:"contextual_tw_pod_inactive",STATIC_RETURNS_POLICY:"contextual_tw_srp",GENERIC_RETURNS_POLICY:"contextual_tw_grp",FREE_DELIVERY:"contextual_tw_fd",FREE_DELIVERY_V2:"contextual_tw_fdv2"},REF_MARKER_SUFFIX:{GLANCE_VIEW:"_gv",ICON_CLICK:"_clk",SECONDARY_PAGE_OPEN:"_sp_op",
SECONDARY_PAGE_CLOSE:"_sp_cl",FULL_RETURN_POLICY:"_frp",EXPANDER_OPEN:"_exp_op",ABSENT:"_noavail"},NEXUS_CONFIG:{NEXUS_PRODUCER_ID:"a2i-dpx",NEXUS_SCHEMA_ID:"a2i.dpx.WidgetImpressions.3"},LOGGER_CONFIG:{NEXUS_LOGGER:"nexus"}});h.when("A","contextual-tw-return-policy-metric-logger","contextual-tw-pay-on-delivery-metric-logger","contextual-tw-default-metric-logger").register("contextual-tw-icon-metric-factory",function(c,e,b,d){return{getIconMetric:function(a){switch(a){case "RETURNS_POLICY":return e;
case "PAY_ON_DELIVERY":return b;default:return d}}}});h.when("A","contextual-tw-metrics-constants","get-contextual-tw-page-state","contextual-tw-icon-metric-factory","ready").register("contextual-tw-metricLogger",function(c,e,b,d){return{log:function(a,k,m,g){if(a&&k&&null!==m&&e.REF_MARKER_PREFIX[a]&&e.REF_MARKER_SUFFIX[k]){var h=c.$("#contextual-trust-widget-"+m),f=b.parseJSON(e.CONTEXTUAL_TW_PAGE_STATE_HOLDER_DIV+"-"+m,m);f?d.getIconMetric(a).log(a,k,m,c.$.extend(!0,{asin:f.asin,merchantId:f.merchantId,
remoteAddress:f.remoteAddress,isInternal:f.isInternal,isRobot:f.isRobot,numOfShownIcons:f.numOfShownIcons,buyingOptionIndex:m},g)):h.length&&console.warn("contextualTrustWidget state may not be available")}}}});h.when("A","ready").register("contextual-tw-postmetric",function(){return{postCountMetric:function(c){if("undefined"!==typeof c){var e=f.ue;if(e){var b=e.count(c)||0;e.count(c,b+1)}}},postTimeMetric:function(c,e){if("undefined"!==typeof c&&"undefined"!==typeof e){var b=f.ue;b&&b.count(c,e)}}}});
h.when("A","ready").register("contextual-tw-metric-cache",function(c){var e=[],b=function(a){if(!d(a))return!1;var b=!1;c.each(e,function(c,d){c.asin===a.asin&&c.merchantId===a.merchantId&&c.ref===a.ref&&c.loggerType===a.loggerType&&c.buyingOptionIndex===a.buyingOptionIndex&&(b=!0)});return b},d=function(a){return a&&a.asin&&a.merchantId&&a.ref&&a.loggerType&&null!==a.buyingOptionIndex};return{isPresent:b,add:function(a){return d(a)?b(a)?!1:(e.push(a),!0):!1},reset:function(){e=[]}}});"use strict";
h.when("A","contextual-tw-metric-cache","contextual-tw-metrics-constants","ready").register("contextual-tw-Nexus-Service",function(c,e,b){return{log:function(d){if(e.add(d)){var a={};a.producerId=b.NEXUS_CONFIG.NEXUS_PRODUCER_ID;a.schemaId=b.NEXUS_CONFIG.NEXUS_SCHEMA_ID;a.refMarker=d.ref;a.pageAsin=d.asin;a.pageType=c.capabilities?c.capabilities.mobile?c.capabilities.isAmazonApp?"DetailWebView":"DetailAW":"Detail":"";a.subPageType="ContextualIconFarm";a.server=f?f.ue_sn:"";a.merchantId=d.merchantId;
a.remoteAddress=d.remoteAddress;a.isInternal=d.isInternal?1:0;a.isRobot=d.isRobot?1:0;var k={};k.numOfShownIcons=d.numOfShownIcons;k.buyingOptionIndex=d.buyingOptionIndex;d=JSON.stringify(k);a.additionalRequestData=d;if(d=f.ue)try{d.event&&d.event(a,b.NEXUS_CONFIG.NEXUS_PRODUCER_ID,b.NEXUS_CONFIG.NEXUS_SCHEMA_ID)}catch(m){d.count("NexusLoggerFailure",1)}}}}});h.when("A","contextual-tw-Nexus-Service","contextual-tw-metrics-constants","contextual-tw-postmetric","ready").register("contextual-tw-default-metric-logger",
function(c,e,b,d){return{log:function(a,k,f,g){f=JSON.parse(JSON.stringify(g));e.log(c.$.extend(!0,f,{ref:b.REF_MARKER_PREFIX[a]+b.REF_MARKER_SUFFIX[k],loggerType:b.LOGGER_CONFIG.NEXUS_LOGGER}));d.postCountMetric(b.REF_MARKER_PREFIX[a]+b.REF_MARKER_SUFFIX[k])}}});h.when("A","contextual-tw-Nexus-Service","contextual-tw-metrics-constants","contextual-tw-postmetric","get-contextual-tw-page-state","ready").register("contextual-tw-return-policy-metric-logger",function(c,e,b,d,a){return{log:function(k,
f,g,h){a:{if((g=a.parseJSON(b.CONTEXTUAL_TW_PAGE_STATE_HOLDER_DIV+"-"+g,g))&&g.RETURNS_POLICY&&g.RETURNS_POLICY.secondaryViewData&&g.RETURNS_POLICY.secondaryViewData.glLevelReturnPolicies)switch(g.RETURNS_POLICY.secondaryViewData.glLevelReturnPolicies.length){case 0:g="GENERIC_RETURN_POLICY";break a;case 1:g="SINGLE_SPECIFIC_RETURN_POLICY";break a;default:g="MULTIPLE_SPECIFIC_RETURN_POLICY";break a}g=void 0}k=g||k;h=JSON.parse(JSON.stringify(h));e.log(c.$.extend(!0,h,{ref:b.REF_MARKER_PREFIX[k]+b.REF_MARKER_SUFFIX[f],
loggerType:b.LOGGER_CONFIG.NEXUS_LOGGER}));d.postCountMetric(b.REF_MARKER_PREFIX[k]+b.REF_MARKER_SUFFIX[f])}}});h.when("A","contextual-tw-Nexus-Service","contextual-tw-metrics-constants","contextual-tw-postmetric","get-contextual-tw-page-state","ready").register("contextual-tw-pay-on-delivery-metric-logger",function(c,e,b,d,a){return{log:function(f,h,g,l){g=(g=a.parseJSON(b.CONTEXTUAL_TW_PAGE_STATE_HOLDER_DIV+"-"+g,g))&&g.PAY_ON_DELIVERY&&g.PAY_ON_DELIVERY.isEligible?g.PAY_ON_DELIVERY.isEligible?
"PAY_ON_DELIVERY_ACTIVE":"PAY_ON_DELIVERY_INACTIVE":void 0;f=g||f;l=JSON.parse(JSON.stringify(l));e.log(c.$.extend(!0,l,{ref:b.REF_MARKER_PREFIX[f]+b.REF_MARKER_SUFFIX[h],loggerType:b.LOGGER_CONFIG.NEXUS_LOGGER}));d.postCountMetric(b.REF_MARKER_PREFIX[f]+b.REF_MARKER_SUFFIX[h])}}})});
/* ******** */
(function(a){var g=window.AmazonUIPageJS||window.P,k=g._namespace||g.attributeErrors,c=k?k("DetailPageContextualTrustWidgetAssets@mobile","DetailPageContextualTrustWidget"):g;c.guardFatal?c.guardFatal(a)(c,window):c.execute(function(){a(c,window)})})(function(a,g,k){a.when("A","atf","ready").execute(function(c){var d=!1;try{c.loadImageManually(c.$(".contextual-tw-icon-check-box")),c.loadImageManually(c.$(".contextual-tw-inline-icon-box"))}catch(a){console.warn("contextual trust widget image loads failed",
a)}c.on("a:pageUpdate",function(){if(d)try{c.loadImageManually(c.$(".contextual-tw-icon-check-box")),c.loadImageManually(c.$(".contextual-tw-inline-icon-box"))}catch(a){console.warn("contextual trust widget image loads failed",a)}else d=!0})});"use strict";a.when("A","jQuery","a-secondary-view","contextual-tw-metricLogger","contextual-tw-metrics-constants","contextual-tw-metric-cache","contextual-tw-expander-util","contextual-tw-expander-constants","get-contextual-tw-page-state","atf","ready").execute(function(c,
d,g,h,e,k,n,b,p){var f=!1,l=c.$(".accordion-row").length;0===l&&(l=1);(function(a){var l=[];a.create=function(c,m){var b="contextual-tw-composite-secondary-page-"+m,h="#contextual-tw-composite-secondary-page-content-"+m,f=p.parseJSON(e.CONTEXTUAL_TW_PAGE_STATE_HOLDER_DIV+"-"+m,m);l[b]?(f=g.get(b),a.expandCard(c,m)):(a.createHandlers(b),a.expandCard(c,m),f=g.create(d(h),{name:b,dataStrategy:"preload",backButtonText:f&&f.backButtonText?f.backButtonText:"Back",padding:"none"}),l[b]=h);f.show()};a.logGlanceMetrics=
function(b){var a="#contextual-trust-widget-"+b,d=c.$(a);d&&d.length?h.log("CONTEXTUAL_TRUST_WIDGET",e.METRIC_TYPE.GLANCE_VIEW,b):h.log("CONTEXTUAL_TRUST_WIDGET",e.METRIC_TYPE.ABSENT,b);(a=c.$(a+" .contextual-tw-icon-container"))&&a.length&&a.each(function(){h.log(c.$(this).data("name"),e.METRIC_TYPE.GLANCE_VIEW,b)})};a.initializeHandlers=function(b){d(".contextual-tw-icon-container").click(function(b){var d=c.$(this).data("name"),f=c.$(this).data("buying-option-index");h.log(d,e.METRIC_TYPE.ICON_CLICK,
f);b.stopPropagation();a.create(d,f)})};a.createHandlers=function(b){var a=0;c.on("a:secondary-view:beforeShow:"+b,function(b){a=c.$("#a-page").offset().top});c.on("a:secondary-view:afterHide:"+b,function(b){c.$("html, body").scrollTop(-a)})};a.expandCard=function(a,c){d(b.COLLECTIONS_CONTENT_SELECTOR).removeClass(b.EXPANDER_CONTENT_EXPANDED_CLASS).attr(b.ARIA_EXPANDED,"false").attr(b.STYLE,b.EXPANDER_CONTENT_COLLAPSED_STYLE);d(b.COLLECTIONS_EXPANDER_ICON_SELECTOR).removeClass(b.EXPANDER_ICON_COLLAPSE_CLASS).addClass(b.EXPANDER_ICON_EXPAND_CLASS);
d("#"+a+"_CONTENT_"+c).addClass(b.EXPANDER_CONTENT_EXPANDED_CLASS).attr(b.ARIA_EXPANDED,"true").attr(b.STYLE,b.EXPANDER_CONTENT_EXPANDED_STYLE);a="#"+a+"_HEADER_"+c;d(a).attr(b.ARIA_EXPANDED,"true");d(a+"\x3e i").removeClass(b.EXPANDER_ICON_EXPAND_CLASS).addClass(b.EXPANDER_ICON_COLLAPSE_CLASS)}})(a.ContextualTrustSecondaryPage=a.ContextualTrustSecondaryPage||{});(function(a){a.initializeHandlers();n.init();for(var b=0;b<l;b++)a.logGlanceMetrics(b);c.on("a:pageUpdate",function(){if(f){k.reset();a.initializeHandlers();
n.init();for(var b=0;b<l;b++)a.logGlanceMetrics(b)}else f=!0})})(a.ContextualTrustSecondaryPage)});a.when("A","jQuery","contextual-tw-metricLogger","contextual-tw-metrics-constants","contextual-tw-expander-constants","atf","ready").register("contextual-tw-expander-util",function(a,d,g,h,e){return{init:function(){if(d(".contextual-tw-composite-view-expander").length){var k=d(".contextual-tw-composite-view-expander").map(function(a,b){return b.id}).get();d.each(k,function(k,b){a.on("a:expander:"+b+
":toggle:expand",function(a){d(e.COLLECTIONS_CONTENT_SELECTOR).removeClass(e.EXPANDER_CONTENT_EXPANDED_CLASS).attr(e.ARIA_EXPANDED,"false").attr(e.STYLE,e.EXPANDER_CONTENT_COLLAPSED_STYLE);d(e.COLLECTIONS_EXPANDER_ICON_SELECTOR).removeClass(e.EXPANDER_ICON_COLLAPSE_CLASS).addClass(e.EXPANDER_ICON_EXPAND_CLASS);a=a.expander.expanderName;var b="#"+a.replace("EXPANDER","CONTENT"),c="#"+a.replace("EXPANDER","HEADER");d(b).addClass(e.EXPANDER_CONTENT_EXPANDED_CLASS).attr(e.ARIA_EXPANDED,"true").attr(e.STYLE,
e.EXPANDER_CONTENT_EXPANDED_STYLE);d(c).attr(e.ARIA_EXPANDED,"true");d(c+"\x3e i").removeClass(e.EXPANDER_ICON_EXPAND_CLASS).addClass(e.EXPANDER_ICON_COLLAPSE_CLASS);b=a.split("_EXPANDER_")[0];a=a.split("_EXPANDER_")[1];g.log(b,h.METRIC_TYPE.EXPANDER_OPEN,a)})})}}}});a.declare("contextual-tw-expander-constants",{EXPANDER_CONTENT_COLLAPSED_STYLE:"overflow: hidden; display: none;",EXPANDER_CONTENT_EXPANDED_STYLE:"overflow: hidden; display: block;",EXPANDER_ICON_COLLAPSE_CLASS:"a-icon-section-collapse",
EXPANDER_ICON_EXPAND_CLASS:"a-icon-section-expand",EXPANDER_CONTENT_EXPANDED_CLASS:"a-expander-content-expanded",ARIA_EXPANDED:"aria-expanded",STYLE:"style",COLLECTIONS_CONTENT_SELECTOR:".contextual-tw-composite-view-expander.a-expander-container .contextual-tw-composite-view-expander-content",COLLECTIONS_EXPANDER_ICON_SELECTOR:".contextual-tw-composite-view-expander.a-expander-container .contextual-tw-composite-view-expander-heading \x3e .a-icon"})});
/* ******** */
