(function(h){var m=window.AmazonUIPageJS||window.P,u=m._namespace||m.attributeErrors,b=u?u("ProductAdsDetailPageAssets",""):m;b.guardFatal?b.guardFatal(h)(b,window):b.execute(function(){h(b,window)})})(function(h,m,u){h.when("A","a-carousel-framework","a-carousel-ajax-standard").register("AmazonClicks",function(b,m,q){function t(c,a,e,n){var k=c.getAttr("pageNumber");var w=c.getAttr("initialSeenAsins");for(var p=c.getAttr("fetchedItems").slice(w.length),l=0;l<p.length;l++)p[l]&&p[l].oid&&w.push(p[l].oid);
p=c.getAttr("filteredItems");for(l=0;l<p.length;l++)p[l]&&w.push(p[l]);w=w.join("");e.pg=k;e.tot=c.getAttr("set_size");e.start=e.offset;e.num=e.count;e.cc=1===k?0:e.offset;e.oData=w;k=c.getAttr("ajax");c.setAttr("requestTimer",b.delay(d,k.fetch_delay,c,a,e,n))}function d(c,a,e,n){c.triggerEvent("beforeAjax",{url:a,params:e});b.get(a,{cache:!1,success:function(k){k=D(k,a);if(null===k)h.error("Invalid JSON returned to carousel from "+a+" - see http://tiny/c1mr5h0u for details.","a-carousel-ajax-standard",
"sendRequest");else{e.needSetSize&&(k&&k.length||h.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",k[0].setSize?k[0].setSize:k.length));for(var n=c.getAttr("fetchedItems"),p=c.getAttr("filteredItems"),l=c.getAttr("ajax"),y=[],d,f=k.length,g=0;f--;)d=k[f],null===d&&y.push(f),d&&d.isFilteredItem&&"true"===d.isFilteredItem?(p.push(d.oid),g++):(d&&(d.content||""===d.content?d.content=b.trim(d.content):
d=b.trim(d)),n[e.offset+f]=d);A=1*g/k.length;l.remove_nulls&&l.id_list&&y.length&&(b.each(y,function(c){l.id_list.splice(e.offset+c,1)}),c.setAttr("ajax",l));e.needSetSize&&c.init();c.setAttr("fetchedItems",n);c.setAttr("filteredItems",p);c.setAttr("ajaxLock",!1);c.getAttr("pageSize")*c.getAttr("pageNumber")>=n.length&&c.strategies.ajax.wantCurrentPage(c);c.triggerEvent("ajaxSuccess",{url:a,params:e})}},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:e,headers:n})}function D(c,a){return b.isArray(c)?c:c!==u&&null!==c&&!b.objectIsEmpty(c)&&c.hasOwnProperty("data")&&b.isArray(c.data)?c.data:null}function f(c,k){Array.isArray(c)&&b.each(c,function(c){a[c]=k})}function g(c){b.each(a,function(b,e){b===c&&delete a[e]})}var B={},a={},v={},r={},z=[],A=0,x=b.extend([],q),C=function(c,b,a){return function(){c.apply(b,a)}};x.init=
function(c){var a=c.getAttr("ajax");if(a&&a.params){var e=a.params;if((a=c.getAttr("fetchedItems"))&&a.length!==e.start){var n=0;a.forEach(function(c){c&&n++});var d=[];c.dom.$carousel.children("li").each(function(c,a){if(c>=e.start)return!1;d.push(b.trim(a.innerHTML))});n!==d.length&&(e.offset=d.length,c.setAttr("fetchedItems",d))}}q.init(c)};x.getItems=function(c,a,e,d){var k=!1,n=c.getAttr("name");b.each(r,function(c,a){a!==n&&(k=k||c)});c=C(t,this,[c,a,e,d]);(a=v[n]!==u)&&k?z.push(c):(a&&(r[n]=
!0),c())};x.want=function(c,a,b){var d=Math.ceil(10*A);b=Math.max(b,c.getAttr("pageSize")*d);b=Math.min(b,30);if(!c.getAttr("ajaxLock")){if(d=c.getAttr("requestTimer"))clearTimeout(d),c.setAttr("requestTimer",null);d=c.getAttr("ajax");var e=c.getAttr("set_size");if(d.url){var k=c.getAttr("fetchedItems"),f=d.id_list;f||(f=[]);var l=-1<a?a:0;a=a+b-1;var g=d.params||{},h=d.headers||{},v=[],r=[];0===e&&(f.length&&(e=f),g.needSetSize="true",c.setAttr("ajaxLock",!0));for(-1===b&&e&&(a=e);l<=a;)k[l]||((b=
f[l])&&v.push(b),r.push(l)),l++;c.setAttr("fetchedItems",k,{silent:!0});g.count=r.length;g.offset=r[0]||0;0<v.length&&(g[d.id_param_name]=v.join(","));(0<r.length||g.needSetSize)&&this.getItems(c,d.url,g,h)}}};m.registerStrategy("ajax","clicksCustomAjax",x);return{registerFeedbackEvents:function(c,a,d,n,f){var e=!0,k=function(){b.$("#"+a).text(n);e=!1;b.$("."+f).each(function(){b.$(this).show()})},g=function(){b.$("#"+a).text(d);e=!0;b.$("."+f).each(function(){b.$(this).hide()})};b.$("#"+a).click(function(){e?
k():g()});b.on("a:carousel:"+c+":change:pageNumber",g);g()},registerFeedbackEventsWithSponsoredLabel:function(a,d,e,f){var c=!0,k=function(){b.$("#"+e).show();c=!1;b.$("."+f).each(function(){b.$(this).show()})},g=function(){b.$("#"+e).hide();c=!0;b.$("."+f).each(function(){b.$(this).hide()})};b.$("#"+d).click(function(){c?k():g()});b.on("a:carousel:"+a+":change:pageNumber",g);g()},truncateTitles:function(a){b.$("."+a).each(function(){var c=b.$(this);if("hidden"===c.css("overflow")){var d=c.html(),
f=b.$(this.cloneNode(!0)).hide().css("position","absolute").css("overflow","visible").width(c.width()).height("auto");c.after(f);for(f.html(d);0<d.length&&f.height()>c.height();)d=d.substr(0,d.length-1),f.html(d+"\x26#133;");c.html(f.html()).height("auto").removeClass(a);f.remove()}})},preventSpinners:function(a,d){B[a]===u&&(b.on("a:carousel:"+a+":ajaxSuccess",function(a){b.delay(function(){var c=b.$("#"+d+" 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)}),B[a]="defined")},registerCarouselToSaveAsins:function(a,d,e){g(a);f(e,a);r[a]=!1;v[a]===u&&(b.on("a:carousel:"+a+":ajaxSuccess",function(c){var d=c.carousel.getAttr("fetchedItems").slice(-1*c.params.count),e=[];b.each(d,function(a){e.push(a.oid)});f(e,a);r[c.carousel.getAttr("name")]=!1;0<z.length&&z.shift()()}),v[a]=d)}}});(function(b,m,q){function t(){return b.P&&b.P.AUI_BUILD_DATE}t()?(h.when("jQuery").register("sponsored-products-truncator-jQuery",
function(b){return b}),h.when("ready").register("sponsored-products-truncator-ready",function(){})):b.amznJQ&&(b.amznJQ.available("jQuery",function(){h.register("sponsored-products-truncator-jQuery",function(){return b.amznJQ.jQuery})}),b.amznJQ.onReady("jQuery",function(){h.register("sponsored-products-truncator-ready",function(){})}),b.amznJQ.available("amazonShoveler",function(){h.register("sponsored-products-truncator-amznJQ-shoveler",function(){})}));h.register("sponsored-products-truncator-util",
function(){function d(b,d){h({logLevel:b,attribution:"ProductAdsDetailPageAssets",message:"[sponsored-products-truncator] "+d})}var h=b.ueLogError;"function"!==typeof h&&(h=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:t,log:{warn:function(b){d("WARN",b)},error:function(b){d("ERROR",b)}}}})})(m,document);(function(b,m,q){h.when("A","sponsored-products-truncator-jQuery",
"sponsored-products-truncator-util").register("sponsored-products-truncator-line-truncator",function(b,d,h){function f(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||h.log.error("Truncation element missing necessary line number data")}var g=/(?=[ \-\/])|(?=[\u3105-\u312F])|(?=[\u31A0-\u31BA])|(?=[\u4E00-\u9FD5])|(?=[\u3400-\u4DB5])|(?=[\uF900-\uFAFF])|(?=[\u3040-\u309F])|(?=[\u30A0-\u30FF])|(?=[\u3190-\u319F])/;
var m=/[^\/\-\[\]():\s]/;f.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})):h.log.error("Unable to successfully truncate line "+a);this.$experimentElement.remove()};f.prototype.getLineHeight=function(){var a=this.$element.html();this.$element.html("\x26hellip;");var b=this.$element.innerHeight();
this.$element.html(a);return b};f.prototype.checkLineFit=function(a){this.$experimentElement.html(a);a=this.$experimentElement.get(0).clientHeight/this.lineHeight;return Math.round(a)<=this.maxRows};f.prototype.truncateByToken=function(a){a=a.split(this.getTokenSeparatorRegex());var b=a.length,d=0,f;for(f=1;f!==b;){var g=Math.floor((b+f)/2);var h=a.slice(0,g).join("")+"\x26hellip;";if(this.checkLineFit(h)){if(1>=b-g){for(d=g;0<d&&!m.test(a[d-1]);)d--;break}f=g}else b=g}if(0!==d)return a.slice(0,d).join("")+
"\x26hellip;"};f.prototype.getTokenSeparatorRegex=function(){return this.$element.attr("data-truncate-by-character")?"":g};return{truncateLines:function(a){a.find(".sponsored-products-truncator-truncate:visible, .sponsored-products-truncator-truncate-medium:visible").each(function(){(new f(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")}}});h.when("jQuery","A","sponsored-products-truncator-line-truncator","a-carousel-framework").register("sp-dp-carousel-truncation",function(b,d,h,f){function g(a){"string"===typeof a?(h.truncateLines(d.$("#"+a)),f.getCarouselByName(a+"_carousel")&&d.trigger("spTruncationComplete",f.getCarouselByName(a+"_carousel"))):(h.truncateLines(a.carousel.dom.$container),d.trigger("spTruncationComplete",a.carousel))}var m="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=m.length-1;0<=a;a--)g(m[a]),d.on("a:carousel:"+m[a]+"_carousel:change:animating",g),d.on("a:carousel:"+m[a]+"_carousel:change:loading",g),d.on("a:carousel:"+m[a]+"_carousel:change:pageSize",g);d.state("spTruncatorStatus",{truncationInitialized:!0})}});d.on("spMobileCarouselAjaxComplete",g);return{setUpTruncation:function(a){g(a);d.on("a:carousel:"+a+"_carousel:change:animating",
g);d.on("a:carousel:"+a+"_carousel:change:loading",g);d.on("a:carousel:"+a+"_carousel:change:pageSize",g)}}})})(m,document);h.execute("ClickLoggingUrlParamRemover",function(){if(history&&history.replaceState){var b=m.location.href;b=b.split("?");if(2<=b.length){for(var h=encodeURIComponent("spc")+"\x3d",q=b[1].split(/[&;]/g),t=q.length;0<t--;)-1!==q[t].lastIndexOf(h,0)&&q.splice(t,1);b=b[0]+(0<q.length?"?"+q.join("\x26"):"");m.history.replaceState({},document.title,b)}}})});
/* ******** */
(function(e){var f=window.AmazonUIPageJS||window.P,r=f._namespace||f.attributeErrors,b=r?r("SponsoredProductsViewabilityAssets",""):f;b.guardFatal?b.guardFatal(e)(b,window):b.execute(function(){e(b,window)})})(function(e,f,r){e.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 p(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 d(c){g[c.selector].viewHandler=b.delay(function(){if(c){var a=c.data("viewpixelurl");a&&-1===e.indexOf(a)&&(l.sendRequest(p(a+"\x26eventType\x3d1")),e.push(a),g[c.selector]&&(g[c.selector].viewState="VIEWED",k("viewUrlSuccess",g[c.selector].placementId)),m())}},500)}function m(){for(var c in g)if("VIEWED"===
g[c].viewState)delete g[c];else{var a=b.$(c),n=g[a.selector].viewState;"VIEWED"!==n&&(b.onScreen(a,-.15*a.height())?"OFF"===n&&(g[a.selector].viewState="ON",d(a)):"ON"===n&&(g[a.selector].viewState="OFF",clearTimeout(g[a.selector].viewHandler)))}}var g={},e=[],q=[],n=[],u=Date.now();b.on("spViewTrackingElementLoaded",m);return{registerViewTrackingElement:function(a,d){-1===e.indexOf(a.data("viewpixelurl"))&&(k("totalAds",d),g[a.selector]={viewState:"OFF",viewHandler:null,placementId:d},b.trigger("spViewTrackingElementLoaded"))},
registerAuiEvents:function(a){Array.isArray(a)&&a.forEach(function(a){if(-1===n.indexOf(a))b.on(a,m)})},registerHorizontalScrollEvent:function(a){a&&a.addEventListener("scroll",function(){75<Date.now()-u&&(u=Date.now(),m())})},loadImagePixel:function(a,b,d,n){!h.checkForHiddenElementsWithTargetList(b,d,n)&&Array.isArray(q)&&-1===q.indexOf(a)&&(q.push(a),l.sendRequest(p(a)))}}});e.when("A","SponsoredProductsViewabilityConfig").register("SponsoredProductsEventBatcher",function(b,l){function h(a,b){a||
(q+=1,g+=b);m+=b;t+=1;k("avgRequestFailurePerPage",q/t);k("avgEventFailurePerPage",g/m)}function k(a,b){f.ue&&f.ue.count("SPBatch-"+a,b)}function p(a){var d=[];b.each(a,function(a){d.push({data:a})});return{events:d}}function a(){if(0<d.length){var a=d.length,g=p(d);d=[];var c=/unagi-\w\w.amazon.com\/1\/events\/com.amazon.eel.SponsoredProductsEventTracking.(prod|gamma)/;l.eelEndpoint!==r&&c.test(l.eelEndpoint)?b.ajax(l.eelEndpoint,{method:"post",params:g,paramsFormat:"json",contentType:"application/json",
accepts:"application/json",success:function(b,c,d){h(!0,a);k("batchSuccess",a)},error:function(b,c,d){e.log("Warning -- sushi response: "+d+" | StatusText: "+c+" | xhrStatusCode: "+(b.http?b.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),e.log("Warning -- sushi endpoint incorrectly configured with: "+l.eelEndpoint,"WARN","SponsoredProductsViewabilityAssets"))}}var d=[],m=0,
g=0,t=0,q=0;b.interval(function(){a()},250);f.addEventListener("beforeunload",function(){a()});return{sendRequest:function(b){d.push(b);15<d.length&&a()},_batchRequest:function(){a()}}});e.when("A","SponsoredProductsEventBatcher").register("SPHAT",function(b,e){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,d){return a&&d?0<b.$(a).find(d.join(",")).filter(function(){return"hidden"===b.$(this).css("visibility")||"0"===b.$(this).css("opacity")||b.$(this).is(":hidden")}).length:
!1}function p(a,d){var e=":hidden";b.$.each(d,function(a,b){e+=":not("+b+")"});return 0<b.$(a).children(e).length}return{checkForHiddenElementsWithTargetList:function(a,b,e){a=k(a,b);h(e,a);return a},checkForHiddenElements:function(a,b,e){a=p(a,b);h(e,a);return a}}});e.when("A","ready").register("SponsoredProductsViewabilityConfigInitializer",function(b){function f(b){e.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?e.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(c){var h=window.AmazonUIPageJS||window.P,g=h._namespace||h.attributeErrors,a=g?g("CommonDetailPageScripts",""):h;a.guardFatal?a.guardFatal(c)(a,window):a.execute(function(){c(a,window)})})(function(c,h,g){c.when("jQuery","jumpLink").execute(function(a,b){var n=a("#miniATFUDP"),d=0;0<n.length&&(d=n.height()+9);0<a("#reviewStarsLinkedCustomerReviews").length&&b.bind("#reviewStarsLinkedCustomerReviews",10,d);0<a("#askATFLink").length&&b.bind("#askATFLink",10,d);c.when("cf").execute(function(c){0<
a("#important-information a[href\x3d'#legal-disclaimer']").length&&b.bind("#important-information a[href\x3d'#legal-disclaimer']",10,d,!0)});b.bind("#seeMoreDetailsLink",300,d)});"use strict";c.when("A","jQuery","ImageBlockATF","jumpLink","cf").register("miniATFUtils",function(a,b,n,d){function g(a){q&&!a||r||(a=(new Date).getTime()-w,a=50>a?50-a:10,q=1,q=0,w=(new Date).getTime(),setTimeout(function(){var a=t.scrollTop(),k=b("#miniATFUDP");if(0<k.length){var e=x;if("T1"===e){e=b("#sims_fbt");if(0>=
e.length||0>=e.height())e=b("#buyxgety_feature_div");var f=e;e=Number.MAX_VALUE;if(f&&0<f.length){var c=f.height();f=f.offset();c&&f&&(e=f.top+c)}e=Math.min(e,1200)}else if("T2"===e){e="#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(" ");
f=Number.MAX_VALUE;for(c=0;c<e.length;c++){var d=b(e[c]);if(d&&0<d.length&&0<d.height()){var m=Number.MAX_VALUE;d&&0<d.length&&(d=d.offset())&&(m=d.top);m<f&&(f=m)}}e=Math.min(f,1700)-100}else e=void 0;a>e?!u&&k.is(":hidden")&&(k.removeClass("a-hidden"),k.slideDown(200)):(k.slideUp(200),u=0)}},a))}d=b("#miniATFUDP");var y=b("#miniATFPartialSelection")[0],l=b(".twister-dropdown-highlight")[0];if(!(0>=d.length)){var u=0,w=0,q=0,p={},r=0,v=0,x="T2";p.setMiniATFShowHeight=function(b){x=b};p.setMiniATFScrollUpHeight=
function(a){v=0;"T1"===a&&(a=b("#productTitle"),0<a.length&&(a=a.offset())&&(v=a.top-20))};b("body").delegate(".go-to-top","click",function(){b("body, html").animate({scrollTop:v},300);u=1;y&&l&&(b(l).removeClass("transparentTwisterDropdownBorder"),b(l).addClass("highlightTwisterDropdownBorder"));return!1});y&&l&&b(l).click(function(){b(this).addClass("transparentTwisterDropdownBorder");b(this).removeClass("highlightTwisterDropdownBorder")});var t=b(h);t.scroll(function(){g(0)});t.resize(function(){g(1)});
c.when("ImageBlockBTF").execute(function(d){var c=function(a){var m=a.getState().selected_variations;if(m){var c="",e=a.getState().variation_display_labels;b.each(d.visualDimensions,function(a,b){a=1===d.gIsNewTwister?b:e[b];m[a]&&(c+=" "+m[a])});return c&&c.substring(1)}},g=d.defaultColor,e=g,f=d.landingAsinColor,h,k=b("#miniATF_image");0<k.length&&(h=k.attr("src"));p.updateMiniATFDiv=function(){r=0;var a=b("#miniATF_image");0<a.length&&h&&a.attr("src",h)};a.on("image-block-twister-swatch-click",
function(a,b,k,l){r=1;a=(a=l?l:c(b))&&""!==a?a:g;a===f&&(a=g);a!==e&&(h=(b=a!==g&&a!==f?d:n)&&b.colorImages&&b.colorImages[a]&&0<b.colorImages[a].length&&b.colorImages[a][0]?b.colorImages[a][0].large:null,e=a)})});return p}});"use strict";c.when("ueCount","jQuery").execute(function(a,b){b("#miniATF_BackToTopLink").click(function(){a.incrementCounterByOne("sl_back_to_top_button_click_count")})});"use strict";c.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"))});"use strict";c.when("A","ready").execute(function(a){a=a.$;var b=a("#seeMoreDetailsLink"),c=a("#prodDetails");b.length&&c.length&&(b.bind("keydown",function(a){13===a.keyCode&&(c.attr("tabindex","-1"),c.focus())}),b.bind("click",function(a){c.attr("tabindex","-1");c.focus()}))})});
/* ******** */
(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(m){var h=window.AmazonUIPageJS||window.P,p=h._namespace||h.attributeErrors,f=p?p("DetailPageLatencyAssets",""):h;f.guardFatal?f.guardFatal(m)(f,window):f.execute(function(){m(f,window)})})(function(m,h,p){m.when("dp-interactive-feature-component-base","dp-click-to-ci-utils","A").register("dp-interactive-feature",function(f,e,a){function c(a,g){this.name=a;this._baseComponents={};this.getComponent("default",g)}function k(a){return l.isPlainObject(a)&&a.hasComponents&&l.isArray(a.components)}
var l=a.$;c.prototype={getTimeToInteractivity:function(c,g){c=c||{};var d,b,f=0,h=!1,m=[];k(c)?(a.each(c.components,function(a){l.isPlainObject(a)&&e.isValidNonEmptyString(a.name)&&(d=this.getComponent(a.name,g),(b=d.getTimeToInteractivity(g,a.events))&&b.interactive?b.interactiveTime>f&&(f=b.interactiveTime):m.push(a.name))},this),m.length||(h=!0)):(b=this.getComponent("default",g).getTimeToInteractivity(g,c.events),h=b.interactive,f=b.interactiveTime);return{interactive:h,interactiveTime:h?f:0}},
getComponent:function(a,g){a=a.toLowerCase();this._baseComponents[a]||(this._baseComponents[a]=new f(a,g));return this._baseComponents[a]},updateFeatureInformation:function(c,g){var d={timestamp:c.timestamp,type:c.type,options:{}},b=!1;k(c.options)?a.each(c.options.components,function(a){l.isPlainObject(a)&&e.isValidNonEmptyString(a.name)&&(d.options=a,a=this.getComponent(a.name,g).updateComponentInformation(d,g),b=b||a)},this):(d.options=c.options||{},b=this.getComponent("default",g).updateComponentInformation(d,
g));return b},updateRenderTime:function(c,g,d){c=c||{};var b;k(c)?a.each(c.components,function(a){l.isPlainObject(a)&&e.isValidNonEmptyString(a.name)&&(b=this.getComponent(a.name))&&d&&b.updateRenderTime(d,g)},this):this.getComponent("default",d).updateRenderTime(d,g)},resetFeatureInfo:function(c,g){c=c||{};var d;k(c)?a.each(c.components,function(b){l.isPlainObject(b)&&e.isValidNonEmptyString(b.name)&&(d=this.getComponent(b.name))&&g&&d.resetComponentInfo(g)},this):this.getComponent("default",g).resetComponentInfo(g)}};
return c});m.when("A","dp-interactive-feature","dp-click-to-ci","dp-critical-features","3p-promise","dp-click-to-ci-utils").register("dp-time-to-interactive",function(f,e,a,c,k,l){var n=f.$;return{_features:{},criticalFeatures:{},_clickToCI:{},pageType:"glance",getTimeToInteractivity:function(a,d){a=a||{};var b={features:a,longPoleFeatureName:"",interactiveTime:0,allFeaturesInteractive:!1,nonInteractiveFeatures:[]},c=[];n.isPlainObject(a)&&!n.isEmptyObject(a)&&(f.each(a,function(d,a){a=a.toLowerCase();
var g=this._features[a];g?(g=g.getTimeToInteractivity(d,this.pageType),g.interactive?(d.interactiveTime=g.interactiveTime,g.interactiveTime>b.interactiveTime&&(b.interactiveTime=g.interactiveTime,b.longPoleFeatureName=a)):c.push(a)):c.push(a)},this),c.length||(b.allFeaturesInteractive=!0),b.nonInteractiveFeatures=c);return b},updateFeatures:function(a){a=a||[];var d=!1;n.isArray(a)&&(f.each(a,function(b){var a=!1;n.isPlainObject(b)&&l.isValidNonEmptyString(b.name)&&b.timestamp&&(a=this.getFeatureObject(b.name).updateFeatureInformation(b,
this.pageType));d=d||a},this),this._getClickToCIObj(this.pageType).getMetricInfo().allFeaturesInteractive||this.updateMetricInfo());return d},getFeatureObject:function(a){a=a.toLowerCase();this._features[a]||(this._features[a]=new e(a,this.pageType));return this._features[a]},updateRenderTime:function(a){if(a&&"twisterupdate"===this.pageType){var d=this.getCriticalFeatureObj().getCriticalFeaturesPromise(),b=this._getClickToCIObj(this.pageType).getMetricInfo(),c=this;d&&d.then(function(d){n.isPlainObject(d)&&
!n.isEmptyObject(d)&&f.each(d,function(b,d){d=d.toLowerCase();(d=c._features[d])&&d.updateRenderTime(b,a,c.pageType)},this);b.allFeaturesInteractive||c.updateMetricInfo(!0)})}},updatePage:function(g){if(g){var d=this.pageType;this.pageType=g.toLowerCase();var b=this.getCriticalFeatureObj().getCriticalFeatures();l.logCounter("ClickToCITwisterUpdateTotalCount");b&&this._clickToCI[d]&&!this._clickToCI[d].isResolved()&&this._clickToCI[d].reject(Error("ClicktoCI not available "));this._resetFeatureInfo(b,
g);this._clickToCI[this.pageType]=new a;this.criticalFeatures=new c;"twisterupdate"===this.pageType&&this.criticalFeatures.setIgnoreCriticalFeatures("twister")}},_resetFeatureInfo:function(a,d){d=d.toLowerCase();a=a||{};n.isPlainObject(a)&&!n.isEmptyObject(a)&&f.each(a,function(a,c){c=c.toLowerCase();(c=this._features[c])&&c.resetFeatureInfo(a,d)},this)},_getClickToCIObj:function(c){c=c.toLowerCase();this._clickToCI[c]||(this._clickToCI[c]=new a);return this._clickToCI[c]},getCriticalFeatureObj:function(){n.isEmptyObject(this.criticalFeatures)&&
(this.criticalFeatures=new c);return this.criticalFeatures},updateMetricInfo:function(a){var d=this._getClickToCIObj(this.pageType),b=this,c=this.getCriticalFeatureObj();c.getCriticalFeaturesPromise().then(function(k){c.isCriticalFeaturesKnown&&!d.getMetricInfo().allFeaturesInteractive&&d.setMetricInfo(b.getTimeToInteractivity(k,b.pageType));d.getMetricInfo().allFeaturesInteractive&&b._clickToCI[b.pageType]&&!b._clickToCI[b.pageType].isResolved()?(b._clickToCI[b.pageType].resolve(d.getMetricInfo()),
b._clickToCI[b.pageType].setResolved(!0),a&&l.logCounter("ClickToCITwisterUpdateSuccessCount"),m.now("dp-critical-features-interactive-marker").execute(function(a){a||m.register("dp-critical-features-interactive-marker",function(){return d.getMetricInfo().allFeaturesInteractive})})):a&&!d.getMetricInfo().allFeaturesInteractive&&l.logCounter("ClickToCITwisterUpdateFailureCount")})},getClickToCIPromise:function(a){if(a){if(a=a.toLowerCase(),this._clickToCI[a])return this._clickToCI[a].getPromiseObject()}else if(this._clickToCI[this.pageType])return this._clickToCI[this.pageType].getPromiseObject()},
updateCriticalFeatures:function(){this.getCriticalFeatureObj().updateCriticalInteractiveFeatures();this.updateMetricInfo()}}});m.when("A").register("dp-interactive-feature-component",function(f){function e(a){if(a instanceof e){var k={};this._renderTime=0;this._isInteractive=a._isInteractive;f.each(a._events,function(a){a.alwaysInteractive&&(k[a.name]={name:a.name,interactiveTime:a.interactiveTime,alwaysInteractive:!0})},this);this._events=k}else this._renderTime=0,this._isInteractive=!0,this._events=
{}}var a=f.$;e.prototype={updateComponentInformation:function(c){var k=!1;if(a.isPlainObject(c))switch(c.type){case "render":k=this._updateRenderInformation(c);break;case "interactive":k=this._updateInteractiveInformation(c)}return k},_updateRenderInformation:function(a){var k=!1,e=a.options||{};this._renderTime||(this._renderTime=a.timestamp,this._isInteractive=e.isInteractive===p?!0:e.isInteractive,k=!0);return k},_updateInteractiveInformation:function(a){var e;e=a.options||{};var l=e.alwaysInteractive||
!1,n=!1;this._isInteractive&&(e=e.events||["click"],f.each(e,function(g){this._events[g]||(this._events[g]={name:g,interactiveTime:a.timestamp,alwaysInteractive:l},n=!0)},this));return n},getTimeToInteractivity:function(c){var e=0,l=!1,n=[];this.isRendered()&&(this._isInteractive?(a.isArray(c)||(c=["click"]),f.each(c,function(a){var d=this._events[a];d?d.interactiveTime>e&&(e=d.interactiveTime):n.push(a)},this),n.length||(l=!0,this._renderTime>e&&(e=this._renderTime))):(l=!0,e=this._renderTime));
return{interactive:l,interactiveTime:l?e:0}},isRendered:function(){return!!this._renderTime},updateRenderTime:function(a){a&&!this.isRendered()&&(this._renderTime=a);return this._renderTime}};return e});m.when("dp-time-to-interactive").register("dp-interactive-page-refresh-handler",function(f){return{twisterStartTime:null,createInteractivityObjectForTwisterUpdate:function(){this.twisterStartTime=h.parseInt((new Date).getTime());f.updatePage("twisterUpdate")},updateCriticalFeatures:function(){f.updateCriticalFeatures()},
updateRenderTime:function(){f.updateRenderTime(this.twisterStartTime)},getClickToCIMetric:function(){return f.getClickToCIPromise("twisterUpdate")}}});m.when("dp-interactive-feature-component").register("dp-interactive-feature-component-base",function(f){function e(a,c){this.compName=a;this._pageType={};this.getComponentByPageType(c)}e.prototype={getComponentByPageType:function(a){if(a)return this._pageType[a]||(this._pageType[a]=this.getComponent(a)),this._pageType[a]},updateComponentInformation:function(a,
c){return this.getComponentByPageType(c).updateComponentInformation(a)},getTimeToInteractivity:function(a,c){return a?this.getComponentByPageType(a).getTimeToInteractivity(c):{interactive:!1,interactiveTime:0}},resetComponentInfo:function(a){a&&this._pageType[a]&&(this._pageType[a]=this.getComponent(a))},updateRenderTime:function(a,c){return this.getComponentByPageType(a).updateRenderTime(c)},getComponent:function(a){return this._pageType[a]?new f(this._pageType[a]):this._pageType.glance?new f(this._pageType.glance):
new f}};return e});m.when("3p-promise").register("dp-click-to-ci",function(f){function e(){this.reject=this.resolve=null;this.resolved=!1;var a=this;this.promiseObject=new f(function(c,e){a.resolve=c;a.reject=e});this.metricInfo={features:{},longPoleFeatureName:"",interactiveTime:0,allFeaturesInteractive:!1}}e.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 e});m.when("A","dp-time-to-interactive","dp-click-to-ci-utils").register("dp-clicktoci-metric-for-glanceview",function(f,e,a){function c(){var d=e.getClickToCIPromise("GLANCE");d&&d.then(function(a){l(a.features);n(a.features);k(a)}).catch(function(d){a.logCounter("ClickToCIFailureCount")})}function k(d){a.addTag("DPCIFLongPole"+d.longPoleFeatureName);a.widgetTime("cf","clickToCI",{wb:1},d.interactiveTime);a.widgetTime("fn",p,p,d.interactiveTime);a.postCSMMetrics("ld",
"clickToCI",{wb:1});h.ue&&ue.isl&&a.postCSMMetrics("at")}function l(d){g.isPlainObject(d.atc)?(d=d.atc,a.addTag("DPCIFBuyable"),a.widgetTime("cf","dpATCTTI",{wb:1},d.interactiveTime),a.postCSMMetrics("ld","dpATCTTI",{wb:1}),d.hasComponents&&g.isArray(d.components)&&(d=d.components[0],g.isPlainObject(d)&&a.isValidNonEmptyString(d.name)&&a.addTag("DPCIFBuyable-"+d.name))):a.addTag("DPCIFNonBuyable")}function n(d){if(g.isPlainObject(d)){var b=h.performance;"object"===typeof b&&"object"===typeof b.timing&&
f.each(d,function(d,c){var e="DP"+c+"TTI";a.logCounter("DPCF"+c+"TTI",d.interactiveTime-b.timing.navigationStart);a.widgetTime("cf",e,{wb:1},d.interactiveTime);a.postCSMMetrics("ld",e,{wb:1})})}}var g=f.$;a.widgetTime("bb","dpATCTTI",{wb:1});c();m.when("atf").execute("dp-get-critical-interactive-features",function(){e.updateCriticalFeatures()});return{markClickToCI:c,publishTTIOfCriticalFeatures:n,tagBuyablibity:l,publishTimeToInteractive:k}});m.when("A").register("dp-click-to-ci-utils",function(f){return{widgetTime:function(e,
a,c,f){"function"===typeof uet&&uet(e,a,c,f)},addTag:function(e){h.ue&&h.ue.tag&&h.ue.tag(e)},logCounter:function(e,a){h.ue&&f.$.isFunction(h.ue.count)&&(a=a||(h.ue.count(e)||0)+1,h.ue.count(e,a))},isValidNonEmptyString:function(e){return"string"===typeof e&&0<e.length},postCSMMetrics:function(e,a,c){"function"===typeof uex&&uex(e,a,c)}}});m.when("A","3p-promise","dp-click-to-ci-utils").register("dp-critical-features",function(f,e,a){function c(){this._resolve;this._reject=null;var a=this;this._promiseObj=
new e(function(c,d){a._resolve=c;a._reject=d});this._features=null;this.isCriticalFeaturesKnown=!1}var k=f.$,l=[];c.prototype={getCriticalFeatures:function(){return this._features},getCriticalFeaturesPromise:function(){return this._promiseObj},setCriticalFeatures:function(a){k.isPlainObject(a)&&!k.isEmptyObject(a)&&(this._features=a,this._resolve(a),this.isCriticalFeaturesKnown=!0)},setIgnoreCriticalFeatures:function(a){l.push(a)},updateCriticalInteractiveFeatures:function(){var c={},e=k(".dp-cif");
e.length?(e.each(function(){var d=(k(this).data()||{}).featureDetails;if(k.isPlainObject(d)&&a.isValidNonEmptyString(d.name)){var b;b=l.length&&l.includes(d.name)?!1:!0;b&&(c[d.name]=d)}else a.logCounter("DPCIFInvalidData")}),this._parseCriticalFeatures(c)):a.addTag("DPCIFNoData")},_parseCriticalFeatures:function(c){var e={};k.isPlainObject(c)?(f.each(c,function(a,b){e[b]={};k.isPlainObject(a)&&(e[b]=a)}),k.isEmptyObject(e)?a.addTag("DPCIFNoData"):this.setCriticalFeatures(e)):a.addTag("DPCIFNoData")},
resetIgnoreCriticalFeatures:function(){l=[]}};return c});m.when("dp-critical-features-interactive-marker").register("dp-latency-marker",function(f){});"use strict";m.when("A","load").execute("logDpAssetInjectionMetric",function(f){var e=f.state("dp_injected_meta_assets");if("undefined"!=typeof performance&&"undefined"!=typeof performance.getEntries){for(var a=0,c=0,k=0,l=0,n=performance.getEntries(),g=0;g<n.length;g++){var d=n[g],b=d.initiatorType;d.name.match(/\.css\?AUIClients\/AmazonUI/g)&&b&&
"link"===b&&d.duration+d.startTime>a+c&&(a=d.duration,c=d.startTime);if("undefined"!=typeof e&&"undefined"!=typeof e.assetNames&&0<e.assetNames.length)for(var m=0;m<e.assetNames.length;m++)if(d.name.match(new RegExp("\\.css\\?AUIClients/"+e.assetNames[m]))&&b&&"link"===b){if(0===k||k>d.startTime)k=d.startTime;l<d.startTime&&(l=d.startTime);break}}h.ue&&f.$.isFunction(h.ue.count)&&(h.ue.count("aui.auiDuration",a),h.ue.count("aui.auiStartTime",c),0!==k&&0!==l&&(h.ue.count("dpcss.dpStartTimeMin",k),
h.ue.count("dpcss.dpStartTimeMax",l),h.ue.count("dpcss.auiDiffMin",k-c),h.ue.count("dpcss.auiDiffMax",l-c)))}});m.when("A","load").execute("dp-asset-connection-metric-logging",function(f){function e(a){h.ue&&ue.tag&&ue.tag(a)}(function(){if(h.navigator&&h.navigator.connection){var a=1024*h.navigator.connection.downlink,c=h.navigator.connection.rtt,f=h.navigator.connection.effectiveType;c&&(h.ue&&ue.count&&ue.count("rtt",c),0<=c&&100>c?e("rtt:0_100"):100<=c&&200>=c&&e("rtt:100_200"));a&&(h.ue&&ue.count&&
ue.count("downlink",a),0<=a&&5120>a?e("downlink:0_5"):5120<=a&&10240>=a&&e("downlink:5_10"));e("EffectiveConnectionType:"+f)}})()});m.when("A").register("get-resource-time",function(f){return{getResourceTimeByName:function(e,a){var c=[];h.performance&&performance.getEntries&&e&&f.$.isArray(a)&&0<a.length&&(c=performance.getEntries(),c=f.filter(c,function(c){return c&&c.initiatorType===e?-1<f.indexOfArray(a,c.name):!1}));return c}}});m.when("A","dp-interactivity-metric-utils").execute("dp-non-critical-tti",
function(f,e){var a=f.$;(function(){a(".a-container").click(function(a){e.calculateInteractivity(a)})})()});m.when("A").register("dp-log-critical-asset-source-details",function(f){function e(a){h.ue&&ue.tag&&ue.tag(a)}function a(a){return a&&0<a.encodedBodySize}function c(c,d,b,e){var k=[];f.each(d,function(d){var l=new RegExp("\\."+b+"\\?AUIClients/"+d+"([^a-zA-Z]|$)");d=f.filter(c,function(d){return d&&d.initiatorType===e&&d.name&&d.name.match(l)&&a(d)?!0:!1});k=k.concat(d)});return k}function k(a){for(var d in a){var b=
a[d];if(b&&0!==b.transferSize)return!1}return!0}var l=["DPMobileAppCriticalFeatureMetaAsset","DetailPageMobileWebCriticalFeatureAsset","DetailPageDesktopImageBlockMetaAsset"],m=["AmazonUI"];return{logAssetCacheSourceDetails:function(a){var d=c(a,l,"js","script"),d=d.concat(c(a,l,"js","link"));a=c(a,m,"css","link");var b="";0<d.length&&0<a.length&&(b+="dpcriticaljs_",b=k(d)?b+"cached":b+"not_cached",b+=":auicss_",b=k(a)?b+"cached":b+"not_cached",e(b));return b},checkEncodedBodySize:a,getFilteredResources:c,
isResourceCached:k,logTag:e}});m.when("dp-log-critical-asset-source-details","ready").execute("dp-log-critical-asset-source-details_execute",function(f){if(h.performance&&performance.getEntries){var e=performance.getEntries();f.logAssetCacheSourceDetails(e)}});m.when("A","dp-click-to-ci-utils").register("dp-interactivity-metric-utils",function(f,e){var a=f.$;return{calculateInteractivity:function(c){var f=c.type,l=a(c.target),h=l.closest("div[id$\x3d'_feature_div']");e.logCounter("Total-"+f);h&&((h=
a(h).data("feature-name"))?e.logCounter(h+"-"+f):e.logCounter(c.target.id+"-"+f));(c=l.closest(".a-declarative"))&&(c=a(c).data("action"))&&e.logCounter(c+"-"+f+"-dec-action")}}});m.when("A","dp-log-critical-asset-source-details").register("logging-asset-metrics",function(f,e){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");e.logTag(b);return b}function c(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");e.logTag(b);return b}function k(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");e.logTag(b);return b}function h(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");e.logTag(b);return b}function m(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");e.logTag(b);return b}function g(a){var b=
[],c=[],e=[],g=0,h=0,k=/\.css([^a-zA-Z]|$)/,l=/\.js([^a-zA-Z]|$)/;f.each(a,function(a){a&&(a.transferSize&&(0===a.transferSize&&(g+=1),h+=a.transferSize),a.name&&(a.name.match(l)?c.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:c,CSSAssets:e,cachedAssets:g,bytesDownloaded:h}}return{classifyAndLog:function(d){var b=g(d),e;e="".concat(c(b.JSAssets.length));e=e.concat(":",a(b.CSSAssets.length));e=e.concat(":",h(b.imageAssets.length));
e=e.concat(":",k(b.cachedAssets,d.length));return e=e.concat(":",m(b.bytesDownloaded))},classifyResources:g,logBytesDownloaded:m,logImageAssets:h,logCSSAssets:a,logJSAssets:c,logCachedAssetsPercent:k}});m.when("logging-asset-metrics","ready").execute("logging-asset-metrics-execute",function(f){if(h.performance&&performance.getEntries){var e=performance.getEntries();f.classifyAndLog(e)}})});
/* ******** */
(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,d=n?n("ListsCreateAssets",""):k;d.guardFatal?d.guardFatal(l)(d,window):d.execute(function(){l(d,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(d,e,r,q,C,x,z){function t(a){var c=a.data||{};"HEARTS_V2_SELECT_HEARTING_BOTTOMSHEET"===h()&&u&&f&&e.remove(f);
f=e.create(e.buildComponentParams(c.componentName,!0,v,430,400,n,c.viewName,c.viewDescription,n,c.closeMessage),a.$target);z.hideGLOWOverlay();e.show(f);"DETAIL_PAGE"===h()&&w&&(e.onOpenExecute(f,g),e.onCloseExecute(f,function(){z.showGLOWOverlay()},!1))}function g(){C.raiseBottomsheet("#create-list-form-wrapper");e.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(),e.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){e.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)e.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?(e.onCloseExecute(f,function(){F.bufferReloadOnBackNavigation();k.location="/hz/wishlist/ls/"+a.listExternalId},!1),e.hide(f)):(e.hide(f),k.location="/hz/wishlist/ls/"+a.listExternalId)}function h(){return(d.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=d.$,v=380,w,u,F,f;d.declarative("awl-create-list-bottomsheet","click",function(a){var c=
a.data||{};d.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})});d.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}});d.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?(d.trigger("item-saved-different-list"),(c=u.getAsin())&&0<c.length&&(a.asin=c),e.hide(f),a.toastWeblabTrigger=!0,q(a,u.onCreateSuccess,u.onCreateError)):(c=d.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});d.on("a:expander:create-list-learn-more-popover:toggle:expand",function(){f.viewTypeLabel===e.VIEW_TYPE_LABELS.IS_BOTTOMSHEET_LABEL?e.changeHeight(f,v+165):e.changeHeight(f,580)});d.on("a:expander:create-list-learn-more-popover:toggle:collapse",function(){e.changeHeight(f,v);f.viewTypeLabel===e.VIEW_TYPE_LABELS.IS_BOTTOMSHEET_LABEL?e.changeHeight(f,v):e.changeHeight(f,430)});d.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(d,e,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=d.$,D=function(b){b="#"+(b.formId||"addToCart");0===g(b).length&&(b="#atwl-form");return b};d.declarative("show-create-list",["click touchstart"],function(b){b.$event.preventDefault();var e=b.data;if(e.url||e.name)"function"==typeof uet&&uet("bb","create-list-dp-widget",{wb:1}),r.create(b.$target,e).show({padding:"none"}),q("create-list-dp-widget");d.on("a:popover:afterHide:create-list",function(){r.remove("create-list");e.url.includes("DESKTOP_DETAIL_PAGE")&&(l("#add-to-wishlist-button-group").setSelected("#wishListDropDown"),
g("#add-to-wishlist-button").focus())});d.on("a:popover:show:create-list",function(b){E(b.popover.$popover)});e.createAndAddAsin&&x.saveCreateAndAddAsin(e.createAndAddAsin)});d.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=d.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=d.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;e(p,l,r)}}}});"use strict";l.when("A","amazon-lists-csrf-utils").register("create-new-list-hz",function(d,e){var l=d.$;return function(d,r,x){var q=[];e.addCsrfToken(q);
var t=k.ue?k.ue.rid:n;t&&(d.relatedRequestID=t);d.isJson=!0;return l.ajax("/hz/wishlist/create/newlist",{type:"POST",headers:q,data:d,success:r,error:x,timeout:1E4})}});"use strict";l.when("A").register("create-list-state-util",function(d){var e=d.$;(function(){var d=e('\x3cinput type\x3d"hidden"\x3e');d.attr("id","lists-createlist-createAndAddAsin");d.appendTo("body")})();return{getCreateAndAddAsin:function(){return e("#lists-createlist-createAndAddAsin").val()},saveCreateAndAddAsin:function(d){e("#lists-createlist-createAndAddAsin").val(d)}}})});
/* ******** */
(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(t){var k=window.AmazonUIPageJS||window.P,p=k._namespace||k.attributeErrors,y=p?p("GenericRegistryDPXAssets",""):k;y.guardFatal?y.guardFatal(t)(y,window):y.execute(function(){t(y,window)})})(function(t,k,p){"use strict";t.when("A","a-modal","a-popover","a-checkbox","a-dropdown","a-splitdropdown","ready").register("add-to-br-util",function(d,g,m,f,h){function r(){return encodeURIComponent(b("#ASIN").val())}function D(a){var e=d.state("atbrState"),u=e.hasBabyReg||!1,f="true"===b("#is-fully-selected-baby-reg").val()||
!1,g=r();g!==p&&f&&(f=encodeURIComponent(e.sessionId),u?c(e,"C",a):k.location.href="/baby-reg/signup/ref\x3ddp_create_br_desktop?asin\x3d"+g+"\x26sessionId\x3d"+f)}function c(a,e,c){var u=r();a=encodeURIComponent(a.sessionId);var g={};g.asin=u;g.sid=a;g.vendorId=c||"website.dpx.atbr";d.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")),f("#br_dp_post_atbr_manage_must_have_item").hide(),f("#br_dp_post_atbr_manage_group_gifting_item").hide(),f("#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(),H(e)):k.location.href="/baby-reg/ref\x3ddpx_atbr_dsk_hp?asin\x3d"+u},error:function(){k.location.href="/baby-reg/ref\x3ddpx_atbr_dsk_er?asin\x3d"+u}})}function H(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};d.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()};d.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){v=!0;var a=f("#br_dp_post_atbr_manage_must_have_item");
a.show();e.result.isMustHaveItem&&a.check()}e.result.hasGroupGifting&&(q=!0,a=f("#br_dp_post_atbr_manage_group_gifting_item"),a.show(),z=e.result.helpInfoLinkGroupGifting,e.result.isGroupGiftingItem&&a.check());e.result.hasPrivate&&(w=!0,a=f("#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=h.getSelect("br-dp-post-atbr-header-registry-request").getOption("br-dp-post-atbr-dropdown-tenPlusOpt"),e.info()[0]===
p?h.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+"})):(h.getSelect("br-dp-post-atbr-header-registry-request").getOption(e-1).update({selected:"true",text:e}),l()))},error:function(){}})}function l(){h.getSelect("br-dp-post-atbr-header-registry-request").removeOption("br-dp-post-atbr-dropdown-tenPlusOpt")}
var b=d.$,q=!1,v=!1,w=!1,z="",x=(d.state("atbrState")||{}).token;d.declarative("dpx-add-to-baby-registry-action",["click"],function(a){D()});d.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");
d.get("/baby-reg/dp-post-atbr-close/ref\x3dbr_dsk_dpx_patr_hdr_close",{})});d.declarative("br-dp-post-atbr-status-manage-info-popover",["click"],function(a){m.create(a.$target,{inlineContent:a.data.popoverContent,position:"triggerBottom",activate:"onclick"}).show();!1===v&&(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===q?(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",z);!1===w&&(b("#br-manage-popover-content-section-title-private").addClass("a-hidden"),b("#br-manage-popover-content-section-content-private").addClass("a-hidden"));d.get("/baby-reg/dp-post-atbr-manage-help-info/ref\x3dbr_dsk_dpx_patr_mgmt_info",{})});d.declarative("post-atbr-item-atbr-button-action",["click"],function(a){var e=a.data.reftag,c=a.data.asin;
a=a.data.sid;var f={};f.asin=c;f.sid=a;f.vendorId="website.dpx.post-atbr";d.post("/baby-reg/button-action/atbr-dpx/ref\x3d"+e,{params:f,timeout:5E3,success:function(a){a!==p&&"failure"!==a.result?(b("#post-atbr-item-atbr-success-"+c).removeClass("a-hidden"),b("#post-atbr-item-button-"+c).addClass("a-hidden"),b("#post-atbr-item-atbr-failure-"+c).addClass("a-hidden")):b("#post-atbr-item-atbr-failure-"+c).removeClass("a-hidden")},error:function(){b("#post-atbr-item-atbr-failure-"+c).removeClass("a-hidden")}})});
d.declarative("post-atbr-item-see-all-button-action",["click"],function(a){k.location.href=a.data.link});d.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:x};d.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){}})});d.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:x};d.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){}})});d.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:x};d.post("/baby-reg/dp-post-atbr-status-manage-private/ref\x3dbr_dsk_dpx_patr_mgmt_pvt",
{params:a,success:function(a){},error:function(a){}})});d.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:x};d.post("/baby-reg/dp-post-atbr-status-manage-request-quantity/ref\x3dbr_dsk_dpx_patr_mgmt_qty",{params:a,success:function(a){l()},error:function(a){}})});return{addToBabyRegistryFromDPX:D}});"use strict";t.when("A","a-button","a-modal","ready").register("dpx-modal-add-to-wr-declarative-actions",
function(d,g,m){var f=d.$,h=d.state("modal-add-to-wedding-registry-status");if(h&&h.weddingButtonId&&f("#"+h.weddingButtonId).length){var r={name:"wr-modal-add-to-reg-wedding-registry",header:h.modalHeader,url:""};f(document).delegate("#"+h.weddingButtonId,"click",function(d){d.preventDefault();if(h.userSignedIn){var c=f("#quantity").val();c||(c=1);d=m.create(f("#"+h.weddingButtonId),r);var g=encodeURIComponent(f("#ASIN").val());c=encodeURIComponent(c);var n=h.token?"\x26token\x3d"+encodeURIComponent(h.token):
"";h.hasWeddingRegistry?(d.update({cache:!1,url:"/wedding/modal/external-add-to-registry?asin\x3d"+g+"\x26quantity\x3d"+c+n+"\x26ref_\x3dhit_wr_dp_dp_mdl_pop"}).show(),"undefined"!==typeof k.ue&&k.ue.count("wrAddToRegModalPopup",(k.ue.count("wrAddToRegModalPopup")||0)+1)):k.location.href="/wedding/new-registry?asin."+g+"\x3d"+c+"\x26vendorId\x3dgr-dpx-new-reg\x26associateId\x3d\x26associateSubId\x3d"}else k.location.href="/wedding/nosignin"});d.declarative("wr-modal-add-to-reg-rec-add-to-registry-action",
"click",function(h){var c=h.data;h=f("#wr-modal-add-to-reg-wrapper").data("token");var m=g("#wr-modal-add-to-reg-add-to-wr-"+c.recItemAsin);m.isEnabled()&&(m.disable(),!0===f("#wr-modal-add-to-reg-rec-product-card-"+c.recItemAsin).data("exist-in-registry")?(m.hide(),f("#wr-modal-add-to-reg-item-exist-message-"+c.recItemAsin).removeClass("aok-hidden")):(h={items:JSON.stringify([{asin:c.recItemAsin,requestedQuantity:1}]),token:h},d.post("/wedding/registry-items/addItems?ref_\x3dhit_wr_dp_dp_mdl_sa",
{params:h,contentType:"application/x-www-form-urlencoded; charset\x3dUTF-8",success:function(d){m.hide();d.success?f("#wr-modal-add-to-reg-item-added-message-"+c.recItemAsin).removeClass("aok-hidden"):"ITEM_ALREADY_EXIST"===d.errorCode?f("#wr-modal-add-to-reg-item-exist-message-"+c.recItemAsin).removeClass("aok-hidden"):f("#wr-modal-add-to-reg-item-added-error-"+c.recItemAsin).removeClass("aok-hidden")},error:function(){f("#wr-modal-add-to-reg-item-added-error-"+c.recItemAsin).removeClass("aok-hidden");
"undefined"!==typeof k.ue&&k.ue.count("wrAddToRegModalAddFromSimilaritiesError",(k.ue.count("wrAddToRegModalAddFromSimilaritiesError")||0)+1)}})),"undefined"!==typeof k.ue&&k.ue.count("wrAddToRegModalAddFromSimilarities",(k.ue.count("wrAddToRegModalAddFromSimilarities")||0)+1))});d.on("a:popover:beforeHide:wr-modal-add-to-reg-wedding-registry",function(){"undefined"!==typeof k.ue&&k.ue.count("wrAddToRegModalDismissed",(k.ue.count("wrAddToRegModalDismissed")||0)+1)});d.declarative("wr-modal-add-to-reg-view-registry-action",
"click",function(d){"undefined"!==typeof k.ue&&k.ue.count("wrAddToRegModalViewRegistry",(k.ue.count("wrAddToRegModalViewRegistry")||0)+1);k.location.href="/wedding/organize-registry?ref_\x3dhit_wr_dp_dp_mdl_vr"})}});"use strict";var y="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(d){return typeof d}:function(d){return d&&"function"===typeof Symbol&&d.constructor===Symbol&&d!==Symbol.prototype?"symbol":typeof d};t.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(d,g,m,f,h,r,D){function c(){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;t(a)}).fail(b)}function t(c){c=n(c);if(null===c)b();else{var d=[];d.unshift({html_content:e(C.registryDropdownCreateRegistryTemplateId).html(),css_class:G.registryDropdownItemWrapper,native_id:A.newRegistryType,
value:JSON.stringify({regType:A.newRegistryType})});e.each(c,function(a,b){d.unshift({html_content:l(b),text:z(b.name),value:JSON.stringify({regType:b.type,regName:b.name,regId:b.id}),css_class:G.registryDropdownItemWrapper})});u.showOneClickSplitDropdown?a(h,B.oneClickSplitDropdownId,d):a(f,B.registryDropdownId,d)}}function n(a){var b=void 0;if("object"===("undefined"===typeof a?"undefined":y(a)))b=a.result;else try{b=d.parseJSON(a)}catch(J){b=null}return e.isArray(b)?b:null}function l(a){var b=
e(C.registryDropdownItemTemplateId).html();b=b.replace("{imgTag}",A.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(C.registryDropdownSpinnerId).addClass("aok-hidden");q(C.registryDropdownErrorBoxId)}function q(a){e(a).removeClass("aok-hidden")}function v(a){var b=e("#quantity").val()||1,c=JSON.parse(a.value);if(c.regId||c.regType){a=c.regType;
var d=c.regId,f=c.regName;c=encodeURIComponent(e("#ASIN").val());b=encodeURIComponent(b);var g=encodeURIComponent(u.sessionId);x(E.dropdownItemClicked+":"+a.toLowerCase());a===A.newRegistryType?k.location.href="/registries?ref\x3ddpx_create_registry_desktop\x26sessionId\x3d"+g:"Wedding"===a?(f={name:p.popoverModalName,header:A.addToRegistryModalHeaderText,url:""},(g=m.get(f.name))||(g=m.create(e("#GR-DROPDOWN-MODAL-TRIGGER"),f)),g.update(w(a,f.header,d,c,b,u.token)).show()):"Baby"===a?D.addToBabyRegistryFromDPX(A.addToBabyRegistryVendorId):
(g={name:p.popoverModalName,header:A.addToRegistryModalHeaderText,url:""},I.includes(a)?((f=m.get(g.name))||(f=m.create(e("#GR-DROPDOWN-MODAL-TRIGGER"),g)),f.update(w(a,g.header,d,c,b,u.token)).show()):r.renderDPXGiftTagModal(a,d,f,c,b,u.token))}}function w(a,b,c,e,d,f){var g="Wedding"===a?a:"GGR";a={Wedding:"/wedding/modal/external-add-to-registry",GGR:"/registries/dpx-add-to-registry/"+a.toLowerCase()+"/"+c};f=f?"\x26token\x3d"+encodeURIComponent(f):"";e=a[g]+"?asin\x3d"+e+"\x26quantity\x3d"+d+
f+"\x26ref_\x3dhit_wr_dp_dp_mdl_pop";"Wedding"===g?e+="\x26sourceVendorId\x3damazon.wedding_registry.add.dpx.desktop":"GGR"===g&&(e+="\x26sourceid\x3damazon.ggr.add.dpx.desktop");return{header:b,cache:!1,url:e}}function z(a){var b=document.createElement("textarea");b.innerHTML=a;return b.value}function x(a){a=E.deviceType+":"+a;k.ue&&k.ue.count(a,(k.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=d.$,u=d.state("modal-add-to-registry-dropdown-state"),F=null;if(u){var E={deviceType:"desktop",dropdownClicked:"dpx-ggr-dropdown-clicked",dropdownItemClicked:"dpx-ggr-dropdown-item-clicked",similarityClicked:"dpx-ggr-dropdown-similarity-clicked"},G={registryDropdownItemWrapper:"agr-add-to-registry-dropdown-item-wrapper"},B={registryDropdownId:"add-to-registry-dropdown",oneClickSplitDropdownId:"add-to-registry-one-click-dropdown"},
C={registryDropdownId:"#"+B.registryDropdownId,registryDropdownErrorBoxId:"#agr-registry-dropdown-error",registryDropdownSpinnerId:"#agr-registry-dropdown-spinner",oneClickSplitDropdownId:"#"+B.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"},A={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:u.addToRegistryModalHeaderText},I=["Custom","Birthday","Pet","Off_to_college","Education"];d.on("a:dropdown:"+
B.registryDropdownId+":select",function(a){v(a);f.getSelect(B.registryDropdownId).setValue("")});d.on("a:splitdropdown:"+B.oneClickSplitDropdownId+":select",function(a){v(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 c=g("#gr-modal-add-to-reg-add-to-wr-"+a);if(c.isEnabled()){c.disable();if(!0===b.data("exist"))c.hide(),q(b.find(p.addToRegistryDuplicateClass));else{var f=void 0,h=void 0;f=b.data("type");
h=e("#gr-modal-add-to-reg-wrapper").data("token");f&&"Wedding"!==f?(f={asin:a,desiredQuantity:1,registryId:b.data("id"),registryType:b.data("type"),itemType:"AMAZON_ITEM",vendorId:"amazon.ggr.add.dpx.desktop",token:h},h="/registries/registry-products/addProduct"):(f={token:h,items:JSON.stringify([{asin:a,requestedQuantity:1}])},h="/wedding/registry-items/addItems?ref_\x3dhit_wr_dp_dp_mdl_sa");d.post(h,{params:f,contentType:"application/x-www-form-urlencoded; charset\x3dUTF-8",success:function(a){c.hide();
a.success?q(b.find(p.addToRegistrySuccessClass)):"ITEM_ALREADY_EXIST"===a.errorCode&&q(b.find(p.addToRegistryDuplicateClass))},error:function(){c.hide();q(b.find(p.addToRegistryErrorClass))}})}x(E.similarityClicked)}});(function(){u.showOneClickSplitDropdown?c():e(document).delegate(C.registryDropdownId,"click",function(a){c();x(E.dropdownClicked)})})();d.on("a:pageUpdate",function(){F=null;u.showOneClickSplitDropdown&&c()});d.declarative("gr-modal-add-to-reg-view-registry-action","click",function(a){k.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"});d.declarative("wr-modal-add-to-reg-view-registry-action","click",function(a){k.location.href="/wedding/organize-registry?ref_\x3dhit_wr_dp_dp_mdl_vr"})}});"use strict";t.when("A","a-modal","a-button","a-alert","message-render","create-gift-tag-modal","ready").register("dpx-gift-tag-modal",function(d,g,k,f,h,r){function m(){n(q.giftTagErrorBoxId).removeClass("aok-hidden")}
function c(c){n(b.tagListWrapper).html("");n(b.tagListWrapper).html(c)}function p(b,c,a,e,d,f,g,h){b="/registries/dpx-add-to-registry/"+b.toLowerCase()+"/"+a;h=h?"\x26token\x3d"+encodeURIComponent(h):"";e=b+"?asin\x3d"+f+"\x26quantity\x3d"+g+"\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=d.$;if(d=d.state("modal-view-gift-tags-state")){var l={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"},q={registryTitleComponent:".gr-dpx-tag-modal-header-main",giftTagErrorBoxId:"#"+d.giftTagErrorBoxId,popoverModalName:"wr-modal-add-to-reg-wedding-registry"},v=d.addToHGLModalHeaderText,w=d.addToGiftListModalHeaderText;n(document).delegate(".gr-dpx-add-new-tag","click",function(b){r.renderCreateTagModal(l.selectedRegistryType,l.selectedRegistryId)});n(document).delegate(".gr-tag-modal-back-button","click",function(b){(b=
g.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:q.popoverModalName,header:!0===l.internationalGiftTagsEnabled?w:v,url:""},e=g.get(a.name);e||(e=g.create(n("#GR-DROPDOWN-MODAL-TRIGGER"),a));e.update(p(l.selectedRegistryType,a.header,l.selectedRegistryId,b,c,l.selectedAsin,l.selectedQuantity,l.selectedToken)).show()});return{renderDPXGiftTagModal:function(d,f,a,e,k,r){l.selectedRegistryType=
d;l.selectedRegistryId=f;l.selectedAsin=e;l.selectedQuantity=k;l.selectedToken=r;d=g.get("dpxTagModal");d||(d=b.tagModalTrigger,f={name:"dpxTagModal",width:800,cache:!1,header:w,inlineContent:n(b.tagModalContent)},d=g.create(d,f));f=l.selectedRegistryType;a=l.selectedRegistryId;f&&a?n.ajax({url:"/registries/"+f+"/"+a+"/dpx-get-registry-tags",timeout:5E3}).done(c).fail(m):h.showChangeOver(b.tagModalChangeover,void 0);d.show()}}}});"use strict";t.when("A","a-modal","a-button","a-alert","message-render",
"ready").register("create-gift-tag-modal",function(d,g,k,f,h){function m(a,e){d.get("/registries/"+a+"/"+e+"/dpx-get-registry-tags",{cache:!1,success:function(a){c(b.renderModalTagListWrapper).html("");c(b.renderModalTagListWrapper).html(a)},error:function(){w(q.ADD_TAG_FAILURE)}})}function t(a,d){n=a;y=d;var e=g.get("tagModal");if(!e){e=b.tagModalTrigger;var f={name:"tagModal",width:800,cache:!1,hideHeader:!0,inlineContent:c(b.tagModalContent)};e=g.create(e,f)}z({updateType:v.render,token:l},a,d);
x();e.show()}var c=d.$,y="",n="",l=d.state("modal-add-to-registry-dropdown-state")?d.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"},q={ADD_TAG_SUCCESS:"ADD_TAG_SUCCESS",REMOVE_TAG_SUCCESS:"REMOVE_TAG_SUCCESS",ADD_TAG_FAILURE:"ADD_TAG_FAILURE",REMOVE_TAG_FAILURE:"REMOVE_TAG_FAILURE"},v={add:"add",remove:"remove",render:"render"},w=function(a){var c="";"ADD_TAG_SUCCESS"===a?c=d.state("tagModalChangeoverStrings").addSuccess:"REMOVE_TAG_SUCCESS"===a?c=d.state("tagModalChangeoverStrings").removeSuccess:"ADD_TAG_FAILURE"===
a?c=d.state("tagModalChangeoverStrings").addFailure:"REMOVE_TAG_FAILURE"===a&&(c=d.state("tagModalChangeoverStrings").removeFailure);h.showChangeOver(b.tagModalChangeover,c)},z=function(a,e,f,g,h){e&&f?(a.ref_="gr-dpx-modal",d.post("/registries/"+e+"/"+f+"/update-tag",{params:a,timeout:5E3,cache:!1,success:function(d){g&&w(g);if(a.updateType===v.remove)m(e,f),t(e,f);else if(c(b.tagListWrapper).html(d),a.updateType===v.add){m(e,f);var h=a.tagName,k=c(c(b.tagSectionTemplate).html()).clone();d=c(d).find(b.tagIdFinderSelector).last().attr("id");
k.attr("data-section-id",d);k.find(".gr-product-list-expander-section-name").text(h);c(b.productListExpander).append(k)}},error:function(){w(h)}})):w(h)},x=function(){c(b.tooManyTagsAlert).hasClass(b.hiddenClass)||c(b.tooManyTagsAlert).addClass(b.hiddenClass);c(b.invalidInputAlert).hasClass(b.hiddenClass)||c(b.invalidInputAlert).addClass(b.hiddenClass);c(b.tagModalMainContent).hasClass(b.hiddenClass)&&c(b.tagModalMainContent).removeClass(b.hiddenClass);c(b.tagModalDeleteContent).hasClass(b.hiddenClass)||
c(b.tagModalDeleteContent).addClass(b.hiddenClass);c(b.tagTextContent).val()&&c(b.tagTextContent).val("");h.closeChangeOver(b.tagModalChangeover)};c(document).delegate(".gr-tag-modal-create-button","click",function(a){a.preventDefault();a=c(b.tagTextContent).val();x();15<=c(b.tagListContainer).children().length?c(b.tooManyTagsAlert).removeClass(b.hiddenClass):a?z({updateType:v.add,tagName:a,token:l},n,y,q.ADD_TAG_SUCCESS,q.ADD_TAG_FAILURE):c(b.invalidInputAlert).removeClass(b.hiddenClass)});c(document).delegate(".gr-tag-modal-your-tags-tag",
"click",function(a){a.preventDefault();a=c(this).attr("id");var d=c(this).text();c(b.deleteFlowDeleteButton).attr("id",a);c(b.deleteFlowReplacementSelector).text(d);c(b.deleteFlowButtonReplacementSelector).text(d);c(b.tagModalMainContent).addClass(b.hiddenClass);c(b.tagModalDeleteContent).removeClass(b.hiddenClass)});c(document).delegate(".gr-tag-modal-delete-go-back","click",function(a){a.preventDefault();c(b.tagModalDeleteContent).addClass(b.hiddenClass);c(b.tagModalMainContent).removeClass(b.hiddenClass)});
c(document).delegate(".gr-tag-modal-delete-confirm","click",function(a){a.preventDefault();a=c(this).attr("id");z({updateType:v.remove,tagId:a,token:l},n,y,q.REMOVE_TAG_SUCCESS,q.REMOVE_TAG_FAILURE);c(b.tagModalDeleteContent).addClass(b.hiddenClass);c(b.tagModalMainContent).removeClass(b.hiddenClass)});c(document).delegate(".gr-tag-modal-back-button","click",function(a){a.preventDefault();if(a=g.get("tagModal"))x(),a.hide()});return{renderCreateTagModal:t}});"use strict";t.when("A","ready").register("message-render",
function(d){var g=d.$;return{showChangeOver:function(d,f,h){d=g(d);d.stop(!0,!0);d.find("strong").text(f);d.is(":visible")||d.fadeIn(400);d.delay(2E3).fadeOut(800,function(){h&&h()})},closeChangeOver:function(d){g(d).hide()}}});"use strict";t.when("A","ready").register("gr-request-quantity",function(d){var g=d.$;return function(d){var f={},h={quantity:function(c){g(".gr-pd-request-quantity-ui__number").val(c)}},k=function(c){f.isValid(c)&&(m=c);h.quantity(m);1>=parseInt(f.getState().quantity)?(g(".gr-pd-request-quantity-ui__remove--trash").removeClass("aok-hidden"),
g(".gr-pd-request-quantity-ui__remove--minus").addClass("aok-hidden")):(g(".gr-pd-request-quantity-ui__remove--trash").addClass("aok-hidden"),g(".gr-pd-request-quantity-ui__remove--minus").removeClass("aok-hidden"))};f.getState=function(){return{quantity:g(".gr-pd-request-quantity-ui__number").val()}};f.isValid=function(c){if(Number.isInteger(c)){if(1>c||999<c)return!1}else return!1;return!0};f.enable=function(){g(".gr-pd-request-quantity-ui__number").prop("disabled",!1);g(".gr-pd-request-quantity-ui").removeClass("gr-pd-request-quantity-ui--disabled")};
f.disable=function(){g(".gr-pd-request-quantity-ui__number").prop("disabled",!0);g(".gr-pd-request-quantity-ui").addClass("gr-pd-request-quantity-ui--disabled")};g(document).delegate(".gr-pd-request-quantity-ui__add","click",function(c){c=parseInt(f.getState().quantity)+1;k(c)});g(document).delegate(".gr-pd-request-quantity-ui__remove","click",function(c){c=parseInt(f.getState().quantity)-1;k(c)});g(document).delegate(".gr-pd-request-quantity-ui__number","change",function(c){c=parseInt(f.getState().quantity);
k(c)});var m=f.getState().quantity;return f}})});
/* ******** */
(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,a=q?q("DeliveryStatic",""):n;a.guardFatal?a.guardFatal(l)(a,window):a.execute(function(){l(a,window)})})(function(l,n,q){l.when("A","jQuery","ready").register("DeliveryCountdownComponent",function(a,b){function g(a,b,f,c,d){this.strings=a;this.asin=b;this.deliveryMessageSectionId=f;this.countdownElementId=c;this.secondsLeft=d;this.intervalHandle=null}n.DeliveryCountdownHandler=function(a){var b=a.strings,f=a.asin,
c=a.deliveryMessageSectionId,d=a.fastCountdownElementId,m=a.cheapCountdownElementId;this.cheapCountdownTimer=this.fastCountdownTimer=null;this.start=function(a,h){0<a&&(this.fastCountdownTimer=new g(b,f,c,d,a),this.fastCountdownTimer.start());0<h&&(this.cheapCountdownTimer=new g(b,f,c,m,h),this.cheapCountdownTimer.start())};this.stop=function(){this.fastCountdownTimer&&(this.fastCountdownTimer.stop(),this.fastCountdownTimer=null);this.cheapCountdownTimer&&(this.cheapCountdownTimer.stop(),this.cheapCountdownTimer=
null)}};g.prototype.start=function(){var b=this;this.intervalHandle=a.interval(function(){b&&b.updateCountdownText()},1E3)};g.prototype.stop=function(){this.intervalHandle&&n.clearInterval(this.intervalHandle)};g.prototype.updateCountdownText=function(){this.secondsLeft--;if(0<this.secondsLeft){var a=Math.floor(this.secondsLeft/60),h=a%60;a=Math.floor(a/60);var f=this.secondsLeft%60,c=this.strings.inNext,d=1<a?this.strings.hours:this.strings.hour,m=1<h?this.strings.minutes:this.strings.minute,p=1<
f?this.strings.seconds:this.strings.second,g=this.strings.timeSeperator;h=0<a&&0<h?a+g+d+g+h+g+m+g+c:0<a&&0===h?a+g+d+c:0===a&&0<h?h+g+m+c:f+g+p+c;b(this.countdownElementId).html(h)}else this.stop(),h="\x3ca href\x3d'javacript:window.location.reload();'\x3e"+this.strings.refreshTimeout+"\x3c/a\x3e",b(this.deliveryMessageSectionId).html(h)}});l.when("A","jQuery","LUXContext").register("LUXController",function(a,b,g){function k(){return{addressLabel:m,addressId:p,obfuscatedId:r,countryCode:e,zipCode:w,
state:u,city:v,district:t,locationType:q}}function h(a){m=a.addressLabel;p=a.addressId;r=a.obfuscatedId;e=a.countryCode;w=a.zipCode;u=a.state;v=a.city;t=a.district;q=a.locationType}function f(e,c,b){e=a.copy(e);e.deviceType=g.deviceType;e.pageType=d;e.actionSource="locux";a.post("/gp/delivery/ajax/address-change.html",{contentType:"application/x-www-form-urlencoded;charset\x3dutf-8",params:e,success:function(e){if(e.sembuUpdated){e.address&&h(e.address);var d=k();g.fullPageRefresh?(l.when("LUXMetrics").execute(function(a){a.logLocationChange(d.locationType)}),
n.location.reload()):(a.trigger("DeliveryAddressDropdown_OnSembuUpdateSuccess",d),a.trigger("DeliveryAddressDropdown_OnAddressChange",d),c&&c(),l.when("LUXMetrics").execute(function(a){a.logLocationChange(d.locationType)}))}else b&&b()},error:function(){a.trigger("DeliveryAddressDropdown_OnSembuUpdateFail",k());b&&b()}})}var c=!1,d=null,m,p,r,e,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(e){l.when("LUXResponder").execute(function(d){c?a.equals(e,k())||(h(e),d.refresh()):(h(e),d.activate(),c=!0)});l.when("LUXCustom").execute(function(a){a.activate()});l.when("LUXMetrics").execute(function(a){d=a.getPageType()})},getLocationData:function(){return k()},changeLocation:function(a,e,c){f(a,e,c)}}});l.when("A","LUXDPOnly").register("LUXDPRefreshController",
function(a){function b(a){d=a;g({addressId:d.addressId,zipCode:d.zipCode,city:d.city,state:d.state,district:d.district,countryCode:d.countryCode,relatedRequestId:d.relatedRequestId});var b={asin:d.asin,merchantId:d.merchantId,deviceType:d.deviceType,smid:d.smid,wdg:d.wdg,exMerchId:d.exMerchId,oneClick:d.oneClick};l.when("UnifiedLocationUpdateHandler").execute(function(a){a.init(b);c=a});k(d.obfuscatedId);h(d.obfuscatedId)}function g(c){var d=f('#buybox select[name\x3d"quantity"]').val()||1;a.state("unifiedLocation",
{addressId:c.addressId,zipCode:c.zipCode,city:c.city,state:c.state,district:c.district,countryCode:c.countryCode,quantity:d,relatedRequestId:c.relatedRequestId})}function k(c){if(d&&d.oneClick){var b="unifiedLocation1ClickAddress";d.deviceType&&"mobileApp"===d.deviceType&&(b="addressID");c||(c=f("#"+b).data("addnewaddress"))||(c="new");b='[id\x3d"'+b+'"]';0<f(b).length&&f(b).val(c);if(d.deviceType&&d.deviceType in m&&(b=a.state("buyNowInfo"))){var e=b.urlParams;e=0<e.indexOf("addressID\x3d")?e.replace(/(addressID=)[^&]*/,
"$1"+c):e+"\x26addressID\x3d"+c;b.urlParams=e;a.state("buyNowInfo",b)}}}function h(a){d&&!d.oneClick&&"T1"===d.updateAddressForNon1Click&&(a||(a=f("#unifiedLocationAddress").data("addnewaddress")),1===f("#unifiedLocationAddress").length&&f("#unifiedLocationAddress").val(a))}var f=a.$,c=null,d=null,m={tabletApp:1,tabletLargeApp:1,iPad:1};a.on("DeliveryAddressDropdown_OnAddressChange",function(b){var d=a.state("unifiedLocation")?a.state("unifiedLocation").relatedRequestId:q;b.relatedRequestId=d;g(b);
k(b.obfuscatedId);h(b.obfuscatedId);null!==c&&(c.refresh(),a.trigger("LocationUX_OnAddressChange",b))});a.on("UnifiedLocationPostRefresh",function(){a.trigger("diodeAjaxRefreshed")});return{init:function(a){b(a)},updateFeaturesForNewQuantitySelection:function(b){g(b);null!==c&&(c.refresh(),a.trigger("LocationUX_OnAddressChange",b))}}});l.when("A","LUXController","LUXDPRefreshController","LUXDPOnly").register("LUXDPQuantityRefresh",function(a,b,g){a.declarative("quantity-dropdown","change",function(a){a=
b.getLocationData();g.updateFeaturesForNewQuantitySelection(a)})});l.when("A","detailPage:RefreshHandler","LUXDPOnly","a-state").execute(function(a,b){l.register("TwisterUpdateHandler",function(){return{init:function(b){a.state("unifiedLocation",b)},refresh:function(){var g=b.getHandlerInstance("LocationUX"),k=[],h="addressId zipCode city state district countryCode relatedRequestId".split(" ");if(g){var f=a.state("unifiedLocation"),c;for(c in f)if(f.hasOwnProperty(c)&&-1<a.$.inArray(c,h)){var d=typeof f[c];
("number"===d||"boolean"===d||"string"===d||f[c]instanceof String)&&k.push(g.getURLParamObject(c,null===f[c]?"":f[c],1))}}0<k.length&&g.doPageRefresh(k)}}})});l.when("A","LUXDPOnly","a-state").execute(function(a){l.register("UnifiedLocationUpdateHandler",function(){return{init:function(c){a.state("unifiedLocation",c)},refresh:function(){b=2;g()}}});var b=0,g=function(){var c=a.state("unifiedLocation");c.urlParams=JSON.stringify(c.urlParams);for(var b in c)if(c.hasOwnProperty(b)){var m=typeof c[b];
"number"===m||"boolean"===m||"string"===m||c[b]instanceof String||(null===c[b]?c[b]="":delete c[b])}c&&c.asin&&c.merchantId&&(a.trigger("UnifiedLocationPreRefresh"),a.ajax("/gp/product/features/unified-location/udp/refresh-features.html?_encoding\x3dUTF-8",{params:c,method:"POST",success:k,error:h,abort:f}))},k=function(){a.trigger("UnifiedLocationPostRefresh",!0)},h=function(){a.trigger("UnifiedLocationPostRefresh",!1);0<--b&&g()},f=function(c){a.trigger("UnifiedLocationPostRefresh",!1)}});l.when("A",
"jQuery","LUXContext","LUXWidgetConfig","LUXUtils","LUXController","LUXMetrics","ready").register("LUXResponder",function(a,b,g,k,h,f,c){function d(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(h.generateLocationLabel(a))}function p(c){b("#LUXAddressSelections input[type\x3dradio]:checked").attr("checked",!1);var e=
b("#LUXAddressSelections .a-declarative").has(".a-radio input[type\x3dradio]");c=c.addressId;for(var d=e.length-1;0<=d;d--)if(a.parseJSON(e[d].getAttribute("data-lux-address-selection")).addressId===c){b(".a-radio input[type\x3dradio]",e[d]).attr("checked",!0);break}}function r(a){a=a.locationType===f.locationTypes.locationInput&&a.zipCode?a.zipCode:"";b("#unifiedLocationAddrInput").trigger("updateZipCodeField",a);b("#unifiedLocationAddrInput").val(a);d(3)}function e(c){l.when("a-dropdown").execute(function(e){e=
e.getSelect(k.countrySelectorComponentName);a.objectIsEmpty(e)||(c.locationType===f.locationTypes.country||c.locationType===f.locationTypes.region||c.locationType===f.locationTypes.ip2location&&!c.state?e.setValue(h.mapLocationDataToCode(c)):e.setValue(""))})}function q(){a.post("/gp/delivery/ajax/get-country-selections.html",{contentType:"application/x-www-form-urlencoded;charset\x3dutf-8",params:h.prepareCountrySelectionGeneratorInput(),success:function(a){b("#unifiedLocationCountrySelectionDiv").html(a);
e(f.getLocationData())}})}function u(a){f.changeLocation(a.data,null,function(){p(f.getLocationData())})}function v(a){f.changeLocation(h.mapCodeToLocationData(a.value),null,function(){e(f.getLocationData())})}function t(){var a=b("#unifiedLocationAddrInput").val();h.validateZipCode(a)?f.changeLocation({zipCode:h.preprocessZipCode(a),locationType:f.locationTypes.locationInput},function(){d(3)},function(){d(1)}):h.isMilitaryZipCode(a)?d(2):d(1)}function z(){l.when(k.addressSelectorComponentType).execute(function(a){a.get(k.addressSelectorComponentName)&&
a.get(k.addressSelectorComponentName).hide()})}function x(){var a=b("#LUXAddressSelections .a-radio"),e=b("#LUXAddressSelections .a-radio.aok-hidden");a=a.length===e.length;e.slice(0,a?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"));a||c.logEvent(c.getEvents().click.seeMore)}function y(a){m(a);p(a);r(a);h.shouldPopulateCountrySelector()&&
e(a);z()}function A(){var e=f.getLocationData();r(e);g.isRecognizedCustomer&&0===b("#LUXAddressSelections .a-radio").length&&0===b("#LUXNoAddressNote").length&&a.get("/gp/delivery/ajax/get-address-selections.html",{params:{currentAddressId:e.addressId,deviceType:g.deviceType,isOneClickFromContext:g.isOneClick,clientPage:g.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&&h.shouldPopulateCountrySelector()&&q(e);c.logWidgetView(c.getEvents().view.addressSelector)}return{activate:function(){var e=f.getLocationData();c.logPageView(e.locationType);e.locationType===f.locationTypes.region&&m(e);a.on("a:popover:beforeShow:"+k.addressSelectorComponentName,A);r(e);a.on(f.locationChangeEventName,y);a.declarative("lux-address-selection",["change"],u);b(document).delegate("#unifiedLocationAddrInput",
"keypress",function(a){13===a.which&&t()});b(document).delegate("#unifiedLocationAddrInput","focus",function(){d(3)});b(document).delegate("#unifiedLocationAddrUpdate","click",t);b(document).delegate("#unifiedLocationSignIn","click",function(){c.logEvent(c.getEvents().click.signIn);var a=k.signInURL+n.location.pathname;"Search"===c.getPageType()&&(a+=n.location.search);n.location.href=a});b(document).delegate("#LUXSeeMoreAddressLink","click",x);b(document).delegate(".lux-manage-address-link","click",
function(a){c.logEvent(c.getEvents().click.manageAddressBook);return!0});a.on("a:dropdown:"+k.countrySelectorComponentName+":select",v)},refresh:function(a){y(f.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(a,b,g,k){function h(c){if(a.objectIsEmpty(c)||!c.countryCode||!c.zipCode)return null;for(var b in f)if(f.hasOwnProperty(b)&&a.reduce(f[b],function(d,h,g){return d&&!a.objectIsEmpty(c[g])&&a.equals(c[g],f[b][g])},!0))return b;return null}var f={"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 f},mapLocationDataToRegionCode:function(a){return h(a)},mapRegionCodeToLocationData:function(a){a=f.hasOwnProperty(a)?b.extend({},{addressLabel:k[a],countryCode:f[a].countryCode,zipCode:f[a].zipCode,state:f[a].state,city:f[a].city,locationType:g.locationTypes.region}):null;return a}}});l.when("A","jQuery","ready").register("LUXRegionConfig",function(a,b){var g="GB-ML GB-NI GB-JE GB-IS GB-BF GB-HI IE US FR DK DE AU".split(" "),k="AD AE AF AG AI AL AM AN AO AR AS AT AW AZ BA BB BD BE BF BG BH BI BJ BM BN BO BS BT BW BY BZ CA CC CF CG CH CI CK CL CM CN CO CR CV CX CY CZ DJ DM DO DZ EC EE EG EH ER ET FI FJ FK FM FO GA GD GE GF GH GI GL GM GN GQ GR GT GU GW HK HN HR HT HU ID IL IN IO IQ IS JM JO JP KE KG KH KI KM KN KR KW KY KZ LA LB LC LI LK LR LS LU LV LT LY MA MD ME MG MH MK ML MM MN MO MP MR MS MT MU MV MW MX MY MZ NA NE NF NG NI NL NO NP NR NU NZ OM PA PE PG PH PK PL PN PR PT PW PY QA RO RS RU RW SA SB SC SE SG SH SI SJ SK SL SM SN SO SR ST SV SZ TC TD TG TH TJ TK TM TN TO TL TR TT TV TW TZ UA UG UY UZ VA VC VE VG VI VN VU WS YE ZA ZM ZW BR-SP DE-GI ES-BI ES-CI FR-CH FR-GP FR-GY FR-MC FR-MQ FR-NC FR-PF FR-RE FR-SB FR-SM FR-SP FR-WF FR-YT IT-ML IT-II".split(" "),
h=/^[ \t]*((AB|AL|B|BA|BB|BD|BH|BL|BN|BR|BS|BT|CA|CB|CF|CH|CM|CO|CR|CT|CV|CW|DA|DD|DE|DG|DH|DL|DN|DT|DY|E|EC|EH|EN|EX|FK|FY|G|GL|GU|GY|HA|HD|HG|HP|HR|HS|HU|HX|IG|IM|IP|IV|JE|KA|KT|KW|KY|L|LA|LD|LE|LL|LN|LS|LU|M|ME|MK|ML|N|NE|NG|NN|NP|NR|NW|OL|OX|PA|PE|PH|PL|PO|PR|RG|RH|RM|S|SA|SE|SG|SK|SL|SM|SN|SO|SP|SR|SS|ST|SW|SY|TA|TD|TF|TN|TQ|TR|TS|TW|UB|W|WA|WC|WD|WF|WN|WR|WS|WV|YO|ZE)(([0-9V]{1,2})|([0-9][0-9A-Z]))[ \t]*[0-9][A-Z]{2})[ \t]*$/,f=/^[ \t]*((BF[0-9][ \t]*[0-9][A-Z]{2})|(B(\.?)([ \t]?)F(\.?)([ \t]?)P(\.?)([ \t]?)O(\.?)[ \t]*(C\/O[ \t]*)?[0-9]{1,4}))[ \t]*$/;
return{getPrimarySelections:function(){return g},getSecondarySelections:function(){return k},getZipCodePattern:function(){return h},getMilitaryZipCodePattern:function(){return f},preprocessZipCode:function(a){return a.toUpperCase().trim().replace(/([ \t]*[0-9][A-Z]{2})$/,function(a){return" "+a.trim()})}}});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, Democratic Republic of",CF:"Central African Republic",CG:"Congo",CH:"Switzerland",CI:"Ivory Coast (Côte 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, Commonwealth of",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",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, Republic of",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:"East Timor",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, US",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(a,b,g,k,h,f,c,d){function m(e){return!a.objectIsEmpty(e)&&e.countryCode&&
c.hasOwnProperty(e.countryCode)?a.equals(e.locationType,g.locationTypes.country)?e.countryCode:a.equals(e.locationType,g.locationTypes.region)?k.mapLocationDataToRegionCode(e):k.mapLocationDataToRegionCode(e)||e.countryCode:null}function p(a){return c.hasOwnProperty(a)?c[a]:d.hasOwnProperty(a)?d[a]:null}function l(e){var b={};if(!a.objectIsEmpty(e))for(var c=e.length,d=0;d<c;d++)b[p(e[d])]=e[d];return b}return{getNameForCode:function(a){return p(a)},mapCodeToLocationData:function(a){a=a?c.hasOwnProperty(a)?
{countryCode:a,locationType:g.locationTypes.country,district:a}:k.mapRegionCodeToLocationData(a):null;return a},mapLocationDataToCode:function(a){return m(a)},generateLocationLabel:function(a){a.addressLabel?a=a.addressLabel:a.locationType!==g.locationTypes.region&&a.locationType!==g.locationTypes.country&&a.zipCode?(h.formatZipCodeForAddressLabel&&(a.zipCode=h.formatZipCodeForAddressLabel(a.zipCode)),a=a.city||a.state?h.generateDiffLocationLabelForZip?h.generateDiffLocationLabelForZip(a):(a.city?
a.city+", ":"")+(a.state?a.state+" ":"")+a.zipCode:h.formatZipCodeForAddressLabel?a.zipCode:p(m(a))):a=p(m(a));return a},prepareCountrySelectionGeneratorInput:function(){return{deviceType:f.deviceType,primarySelections:JSON.stringify(l(h.getPrimarySelections())),primarySelectionsOrder:JSON.stringify(h.getPrimarySelections()),secondarySelections:JSON.stringify(l(h.getSecondarySelections()))}},validateZipCode:function(b){return!a.objectIsEmpty(b)&&h.getZipCodePattern().test(b.toUpperCase())},preprocessZipCode:function(a){return h.preprocessZipCode(a)},
isMilitaryZipCode:function(b){return!a.objectIsEmpty(b)&&h.getMilitaryZipCodePattern().test(b.toUpperCase())},shouldPopulateCountrySelector:function(){var a=!0;"undefined"!==typeof f.shouldPopulateCountrySelector&&(a=f.shouldPopulateCountrySelector);return a}}});l.when("A","jQuery","LUXContext","ready").register("LUXMetrics",function(a,b,g){function k(a,b){n.ueLogError&&a&&n.ueLogError({message:a},{logLevel:b||"ERROR",attribution:"LocationUX"})}function h(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 f(){var b;if(b=n.ue_pty)a:{b=n.ue_pty;for(var d in c)if(c.hasOwnProperty(d)&&-1!==a.indexOfArray(c[d],b)){b=!0;break a}b=!1}return b?n.ue_pty:"unrecognizedPage"}var c={detail:["Detail","DetailAW","DetailWebView","TabletUDP"],search:["Search","SearchAW"],offerListing:["OfferListing","OfferListingAW","OfferListingMobileAppAW"]},d={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 f()},getEvents:function(){return d},logLocationChange:function(b){l.when("LUXController").execute(function(m){var k=f(),e="LocationUX."+k;e=a.equals(b,m.locationTypes.locationInput)||a.equals(b,m.locationTypes.realmDefault)||a.equals(b,m.locationTypes.ip2location)?e+("."+d.override+"."+b):e+("."+d.selection+"."+b);a.equals(b,
m.locationTypes.defaultAddress)||a.equals(b,m.locationTypes.accountAddress)||a.equals(b,m.locationTypes.lockerAddress)||(e+="."+(g.isRecognizedCustomer?"recognized":"unrecognized"));-1!==a.indexOfArray(c.detail,k)&&g.isRecognizedCustomer&&(e+="."+(g.isOneClick?"1Click":"Non1Click"));h(e)})},logPageView:function(b){l.when("LUXController").execute(function(m){var k=f(),e="LocationUX."+k+"."+d.view.page+"."+b;a.equals(b,m.locationTypes.defaultAddress)||a.equals(b,m.locationTypes.accountAddress)||a.equals(b,
m.locationTypes.lockerAddress)||(e+="."+(g.isRecognizedCustomer?"recognized":"unrecognized"));-1!==a.indexOfArray(c.detail,k)&&g.isRecognizedCustomer&&(e+="."+(g.isOneClick?"1Click":"Non1Click"));h(e)})},logWidgetView:function(b){var d=f();b="LocationUX."+d+"."+b+"."+(g.isRecognizedCustomer?"recognized":"unrecognized");-1!==a.indexOfArray(c.detail,d)&&g.isRecognizedCustomer&&(b+="."+(g.isOneClick?"1Click":"Non1Click"));h(b)},logEvent:function(a){a="LocationUX."+f()+"."+a;h(a)},logError:function(a,
b){k(a,b)}}})});
/* ******** */
(function(h){var g=window.AmazonUIPageJS||window.P,q=g._namespace||g.attributeErrors,a=q?q("HLCXDetailPageAssets",""):g;a.guardFatal?a.guardFatal(h)(a,window):a.execute(function(){h(a,window)})})(function(h,g,q){h.register("wty:natc-constants",function(){return{PARAMETERS:{ATC:{ASIN:"items[0.warranty][asin]",OFFER_LISTING_ID:"items[0.warranty][offerListingId]",QUANTITY:"items[0.warranty][quantity]"},IA:{ASSOCIATED_ITEM_ID:"items[0.warranty][additionalParameters][itemAssociation][associatedItemId]",
PROGRAM_TYPE:"items[0.warranty][additionalParameters][itemAssociation][programType]",RENDER_TYPE:"items[0.warranty][additionalParameters][itemAssociation][renderType]",MUTUALLY_INCLUSIVE:"items[0.warranty][additionalParameters][itemAssociation][deleteConstraint][mutuallyInclusive]",QUANTITY_INVARIANCE_FACTOR:"items[0.warranty][additionalParameters][itemAssociation][quantityConstraint][invarianceFactor]",QUANTITY_EDITABLE:"items[0.warranty][additionalParameters][itemAssociation][quantityConstraint][quantityEditable]"}}}});
h.when("A","wty:natc-constants").register("wty:natcFormHelper",function(a,c){var b=function(a,b){var d=document.createElement("input");d.setAttribute("type","hidden");d.setAttribute("name",a);d.setAttribute("value",b);return d},d=function(a,d,k){return[b(c.PARAMETERS.ATC.ASIN,a),b(c.PARAMETERS.ATC.OFFER_LISTING_ID,d),b(c.PARAMETERS.ATC.QUANTITY,k)]};return{createItemAssocParams:function(a){return[b(c.PARAMETERS.IA.ASSOCIATED_ITEM_ID,a),b(c.PARAMETERS.IA.PROGRAM_TYPE,"AmazonProtect"),b(c.PARAMETERS.IA.RENDER_TYPE,
"renderAll"),b(c.PARAMETERS.IA.MUTUALLY_INCLUSIVE,!1),b(c.PARAMETERS.IA.QUANTITY_INVARIANCE_FACTOR,1),b(c.PARAMETERS.IA.QUANTITY_EDITABLE,!1)]},createFormInput:b,addAtcParams:function(b,c,k,r){b=d(b,c,k);a.$.each(b,function(a,b){r.append(b)})},clearParams:function(b,d){var c=a.$.map(Object.keys(d),function(a){return'input[name\x3d"'+d[a]+'"]'}).join(",");b.find(c).each(function(a,b){b.parentNode.removeChild(b)})},clearIAV2Params:function(a,b){a.find('input[name\x3d"custom-name.'+b+'.1"], input[name\x3d"custom-value.'+
b+'.1"]').each(function(a,b){b.parentNode.removeChild(b)})}}});h.when("A","wty:natc-constants").register("wty:natcDeclarativeHelper",function(a,c){return{createItemAssocParams:function(a){var d={};d[c.PARAMETERS.IA.ASSOCIATED_ITEM_ID]=a;d[c.PARAMETERS.IA.PROGRAM_TYPE]="AmazonProtect";d[c.PARAMETERS.IA.RENDER_TYPE]="renderAll";d[c.PARAMETERS.IA.MUTUALLY_INCLUSIVE]=!1;d[c.PARAMETERS.IA.QUANTITY_INVARIANCE_FACTOR]=1;d[c.PARAMETERS.IA.QUANTITY_EDITABLE]=!1;return d},addAtcParams:function(b,d,e,t){var k=
{};k[c.PARAMETERS.ATC.ASIN]=b;k[c.PARAMETERS.ATC.OFFER_LISTING_ID]=d;k[c.PARAMETERS.ATC.QUANTITY]=e;a.$.extend(t,k)},clearParams:function(b,d){a.$.each(Object.keys(d),function(a,c){b.hasOwnProperty(d[c])&&delete b[d[c]]})}}});h.when("A","ready").execute(function(a){a.on("a:accordion:installment-payment-buybox-accordion:select",function(c){a.$("#abbWrapper [id^\x3dmbb-offeringID-]").prop("checked",!1)})});h.when("A").register("BaseLinkKeyValuePairHelper",function(a){var c=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,
function(a){var b=16*Math.random()|0;return("x"===a?b:b&3|8).toString(16)})},b=function(a,b){this.key=a;this.value=b};return{getBaseLinkPairs:function(){var a=c();return{ITEM_ASSOC:new b("itemAssoc",a),UNIQ_PARENT:new b("UNIQ-itemAssoc",a),UNIQ_WARRANTY:new b("UNIQ-lnkdWrrnty",a),ITEM_ASSOC_TYPE:new b("itemAssocType","AmazonProtect"),RENDER_TYPE:new b("itemAssocRenderType","renderAll")}}}});h.when("A","wty:natc-constants","wty:natcFormHelper").register("BaseLinkFormHelper",function(a,c,b){var d=a.$,
e=function(a,p){m(p,a);var f=t(p),c=b.createItemAssocParams(f);d.each(c,function(a,v){p.append(v)});k(p,a,f)},t=function(a){return a.find('input[name\x3d"items[0.base][asin]"]').attr("value")||a.find('input[id\x3d"ASIN"], input[id\x3d"a"], input[name\x3d"asin"]').attr("value")},k=function(a,p,f){a.append(b.createFormInput("custom-name."+p+".1","itemAssociationGroup"));a.append(b.createFormInput("custom-value."+p+".1",JSON.stringify({parentAsin:f,type:"AmazonProtect",renderType:"renderAll",constraintList:[{type:"DELETE",
mutuallyInclusive:!1},{type:"QUANTITY",quantityEditable:!1,invarianceFactor:1}]})))},g=function(a,b){a=f(a.value,b);-1!==a&&(u(a,b),m(b,a+1))},m=function(a,f){b.clearParams(a,c.PARAMETERS.IA);f&&b.clearIAV2Params(a,f)},n=function(a,d){a=f(a.value,d);-1!==a&&(u(a,d),b.clearIAV2Params(d,a+1))},f=function(a,b){a=b.find('input[name^\x3d"asin"][value\x3d"'+a+'"]');if(!a||!a.length)return-1;a=a.attr("name");if(!a||"string"!==typeof a)return-1;a=a.split(".");if(2>a.length)return-1;a=parseInt(a[1]);return isNaN(a)?
-1:a},l=function(a,f){a=(0<d(".accordion-row").length?d(a).closest(".accordion-row"):d(document)).find("#mbb-checkbox-input");if(0===a.length)return[];a=a.val();var c=d("input[name\x3d'mbbq']").val(),e=d("input[name\x3d'mbboid']").val();return[b.createFormInput("asin."+f,a),b.createFormInput("quantity."+f,c),b.createFormInput("offeringID."+f,e)]},u=function(a,b){a=["asin."+a,"quantity."+a,"offeringID."+a].map(function(a){return'input[name\x3d"'+a+'"]'}).join(", ");b.find(a).each(function(a,b){b.parentNode.removeChild(b)})};
return{addBaseLinkFields:e,addBaseLinkFieldsBuyNow:function(a,b){g(a,b);var f=b.find("input[name^\x3d'asin']").length;a=l(a,f);d.each(a,function(a,f){b.append(f)});e(f+1,b)},addBaseLinkFieldsBuyNowCheckout:function(a,b){n(a,b);var f=b.find("input[name^\x3d'asin']").length;a=l(a,f);d.each(a,function(a,f){b.append(f)});a=t(b);k(b,f+1,a)},removeBaseLinkFields:m,removeBaseLinkFieldsBuyNow:g,removeBaseLinkFieldsBuyNowCheckout:n,getWarrantyIndex:f,getMobileWarrantyIndex:function(a){var b=1;a.find("input[name\x3d'a']").each(function(a,
f){f.value&&(a=f.value.split("|"))&&(b=a.length)});return b+1}}});h.when("A","BaseLinkKeyValuePairHelper","wty:natc-constants","wty:natcDeclarativeHelper").register("BaseLinkDeclarativeHelper",function(a,c,b,d){var e=a.$,g=[],k=function(a){var b=!1;e.each(a,function(a,f){if("itemAssoc"===f)return b=!0,!1});return b},h=function(a,b,d){var c={},k=m(a,b);e.each(d,function(b,d){b=d.value;var e="custom-name."+a+"."+k,l="custom-value."+a+"."+k;c[e]=d.key;c[l]=b;g.push(e);g.push(l);k++});return c},m=function(a,
b){var d=new RegExp("^custom-name[.]["+a+"]+[.]([0-9]+)$"),c=0;e.each(b,function(a){if(a=a.match(d))a=+a[1],a>c&&(c=a)});return c+1},n=function(a){e.each(g,function(b,d){a.hasOwnProperty(d)&&delete a[d]});g=[];d.clearParams(a,b.PARAMETERS.IA)};return{addBaseLinkFields:function(a){n(a);if(!k(a)){var b=c.getBaseLinkPairs(),m=h(1,a,[b.ITEM_ASSOC,b.UNIQ_PARENT,b.ITEM_ASSOC_TYPE]),b=[b.ITEM_ASSOC,b.UNIQ_WARRANTY,b.ITEM_ASSOC_TYPE,b.RENDER_TYPE],g=1;a.a&&(g=a.a.split("|").length);b=h(g+1,a,b);e.extend(a,
m);e.extend(a,b)}m=d.createItemAssocParams(a["items[0.base][asin]"]||a.a);e.extend(a,m)},removeBaseLinkFields:n,getDeclarativeDataInputs:function(a){if(a=e(a)){var b=a.data("action");if((a=a.data(b))&&a.inputs)return a.inputs}}}});h.when("A","aw-mash").register("BaseLinkAddWarrantyHelper",function(a,c){var b=function(a){g.ueLogError&&g.ueLogError({message:"msi - "+a},{logLevel:"ERROR",attribution:"Mobile_App_SI_Base_Link"})};return{addLinkedWarranty:function(d,e,g){a.ajax("/gp/product/amazon-protect/base-link/services/warranty-service.html",
{method:"post",params:d,timeout:1E3,success:function(a){a&&a.status&&"OK"===a.status?(e(),a.numActiveItemsInCart&&(a=parseInt(a.numActiveItemsInCart,10),c.cart.didUpdate({newCartQuantity:a}))):b("Error while doing a call to warranty-service.html. Success but response not valid.")},error:function(a,d,c){b("Error while doing a call to warranty-service.html. Status: "+d+" . Error: "+c);g()}})},obtainBaseItemCartid:function(d){a.ajax("/gp/product/amazon-protect/base-link/services/last-added-cart-item-id.html",
{method:"post",timeout:1E3,cache:!1,success:function(a){a&&a.status&&a.lastAddedItemCartId?d(a.lastAddedItemCartId):b("Error while doing a call to last-added-cart-item-id.html. Status: "+a.status)},error:function(a,d,c){b("Error while doing a call to last-added-cart-item-id.html. Status: "+d+" . Error: "+c)}})},mSilogError:b}});"use strict";h.when("A","ready").execute(function(a){function c(a){var b=g.ue;b&&b.count&&b.count(a,(b.count(a)||0)+1)}var b=a.$;a.on("a:expander:comparison_detail_expander:toggle:expand",
function(a){c("ComparisonExpanderExpanded");b(".comparison_other_attribute_row").removeClass("aok-hidden")});a.on("a:expander:comparison_detail_expander:toggle:collapse",function(a){c("ComparisonExpanderCollapsed");b(".comparison_other_attribute_row").addClass("aok-hidden")})});h.when("A","atf","ready").execute(function(a){function c(){var b,c=a.$("#HLCXComparisonJumplink_feature_div"),e=a.$("#HLCXComparisonWidget_feature_div");b=a.$("#HLCXComparisonJumplinkContent").length?e.find("#HLCXComparisonJumplinkContent"):
e.find(".HLCXComparisonJumplinkContent");e=e.has("#HLCXComparisonTable").length;c.empty();e&&b.clone().removeClass("aok-hidden").appendTo(c)}a.declarative("hlcx-send-reftag","click",function(b){a.$.get("/gp/product/ajax-handlers/reftag.html/ref\x3d"+b.data.refTag)});c();a.on("a:pageUpdate",c)});h.when("A","ready").execute("logCsmMetricsForComparisonTabs",function(a){var c;a.on("a:tabs:comparison_items_tabs:compare_to_similar_items_tab:select a:tabs:comparison_items_tabs:compare_to_recently_viewed_items_tab:select",
a.throttle(function(a){c&&c===a.selectedTab.tabName||(c=a.selectedTab.tabName,g.ue&&g.ue.count&&g.ue.count(a.selectedTab.tabName,1))},100,{trailing:!1}))});h.when("A","3p-promise","ready").register("hlcx-table-csm",function(a,c,b){function d(b){return a.$(b?".hlcx-cmp-title-col":".comparison_image_title_cell").filter(":visible").map(function(){return a.$(this).attr("data-asin")}).toArray()}function e(){try{var a=document.cookie.match("(^|[^;]+)\\s*(session-id|sessionId)\\s*\x3d\\s*([^;]+)");return a?
a.pop():""}catch(b){return""}}function h(b,d){return new c(function(c,e){function g(){d.unbind("click auxclick",g);var b=a.now()-k;a.off("DOMContentLoaded load resize scroll",h);c({timeInView:b,clickedOff:!0})}var k=a.now(),h=a.throttle(function(){if(!a.onScreen(b)){var d=a.now()-k;a.off("DOMContentLoaded load resize scroll",h);c({timeInView:d,clickedOff:!1})}},200);d.bind("click auxclick",g);a.on("DOMContentLoaded load resize scroll",h)})}function k(a,b,c){var e=d(c);a={pageAsin:a,comparableAsins:e.slice(1),
sessionId:b,deviceType:c?"mobile":"desktop"};g.ue&&g.ue.event&&g.ue.event(a,"comparison","comparison.dpTableImpression.1")}function r(b,c,f){function l(){!p&&a.onScreen(r)&&(p=!0,h(r,f()).then(function(a){p=!1;if(!(2500>a.timeInView)){var f=d(c).slice(1),e=a.timeInView,k=++w,h;h=g.location.href.endsWith("#HLCXComparisonWidget_feature_div");a={pageAsin:b,comparableAsins:f,sessionId:q,timeInView:e,viewOnPageCounter:k,deviceType:c?"mobile":"desktop",landedOnComparisonsTable:h,clickedOff:a.clickedOff};
g.ue&&g.ue.event&&g.ue.event(a,"comparison","comparison.dpTableView.2")}}))}var r=a.$(c?"#hlcx_cmp_table":"#HLCXComparisonTable");if(r.length){var q=e();k(b,q,c);var p=!1,w=0;a.on("DOMContentLoaded load resize scroll",l);a.on("a:pageUpdate",function(){b!==a.$(c?".hlcx-cmp-title-col":".comparison_image_title_cell").first().attr("data-asin")&&a.off("DOMContentLoaded load resize scroll",l)})}}return{setupClientSideLogging:function(b,c){var d;return function(){var e=a.$(b?".hlcx-cmp-title-col":".comparison_image_title_cell").first().attr("data-asin");
d!==e&&"undefined"!==typeof e&&(d=e,r(d,b,c))}}}});h.when("A","hlcx-table-csm").execute(function(a,c){c=c.setupClientSideLogging(!1,function(){return a.$("td.comparison_add_to_cart_button span.a-button, th.comparison_image_title_cell a, #comparison_sold_by_row a, #comparison_custormer_rating_row a")});a.on("a:pageUpdate",c);c()});h.when("A","ready").register("comparison-table-weblab-trigger",function(a,c){function b(b,c,h){var n=a.throttle(function(){if(a.onScreen(d)||h&&a.onScreen(e)){var f=a.state(b).treatment,
l=g.ue;f&&l&&l.trigger&&l.trigger(c,f);a.off("DOMContentLoaded load resize scroll",n)}},200);a.on("DOMContentLoaded load resize scroll",n)}var d,e,h;return{triggerWeblabWhenViewing:function(c,g,m){var n;return function(){d=a.$(c?"#hlcx_cmp_table":"#HLCXComparisonTable");h=a.$(c?".hlcx-cmp-title-col":".comparison_image_title_cell");e=a.$(c?"#hlcx_cmp_table_holder":"#HLCXComparisonTableHolder");var f;f=h.length?h.first().attr("data-asin"):e.length?e.attr("data-asin"):q;n!==f&&f&&(n=f,b(g,m,!0))}}}})});
/* ******** */
(function(n){var q=window.AmazonUIPageJS||window.P,r=q._namespace||q.attributeErrors,c=r?r("DetailPageIPCAssets",""):q;c.guardFatal?c.guardFatal(n)(c,window):c.execute(function(){n(c,window)})})(function(n,q,r){n.register("ipc_constants",function(){return{AUI_HIDDEN_CLASS:"aok-hidden",AUI_BUTTON_FOCUS_CLASS:"a-button-focus",IPC_CSRF_TOKEN_ELEMENT_ID:"#interactive-pc-csrf-token",IPC_AAPI_SLATE_TOKEN_META_NAME:'meta[name\x3d"encrypted-slate-token"]',IPC_AJAX_ENDPOINT_ELEMENT_ID:"#interactive-pc-ajax-endpoint",
IPC_MARKETPLACE_ELEMENT_ID:"#interactive-pc-marketplace-id",IPC_LANG_ELEMENT_ID:"#interactive-pc-language",IPC_COP_ELEMENT_ID:"#interactive-pc-cop",IPC_PRICE_FORMAT_PARAMS_PAGE_STATE:"interactiveProductComparisonPriceFormatParams",IPC_QD_SPINNER_PREFIX:"#qd_popover_spinner_",IPC_QD_BOTTOM_SHEET_CONTENT_PREFIX_MOBILE:"#qd_table_content_",IPC_QPT_ROW_PREFIX:"interactive_pc_qpt",IPC_QPT_RANGE_ELEMET_ID:"#interactive_pc_qpt_range",IPC_QPT_PRICE_ELEMET_ID:"#interactive_pc_qpt_price",IPC_CHECKBOX_ELEMENT_ID:"#interactive_pc_checkbox",
IPC_QD_LINK_CLASS:".interactive_pc_qd_link",IPC_HORIZONTAL_RULE_ELEMENT:'\x3chr aria-hidden\x3d"true" class\x3d"a-spacing-mini a-spacing-top-mini a-divider-normal"\x3e',IPC_PLUS:"+",IPC_DASH:"-",IPC_POPOVER_LINK_CLASS_NAME:".interactive_pc_qd_popover",IPC_SIMILAR_ATTR_VAL_CLASS_NAME:"interactive_pc_similar_attribute_value",IPC_QD_POPOVER_PREFIX:"ipc_quantity_discount_popover_",IPC_QD_BOTTOM_SHEET_PREFIX:"ipc_quantity_discount_sheet_",IPC_TABLE_EXPANDER_CONTENT_SELECTOR:".comparison_other_attribute_row",
IPC_OPTIONS_CONTAINER:"ipc_sorting_options",IPC_SORTING_OPTIONS_ROW_SELECTOR:".ipc_sorting_options_row",IPC_SORTING_ROW_ELEMENT_ID_PREFIX:"#interactive_pc_sorting_row_",IPC_TABLE_ATTR_ROW_ID_PREFIX:"#interactive_pc_table_row_",IPC_MOVE_DOWN_BTN_ID_PREFIX:"#interactive_pc_move_down_btn_",IPC_MOVE_UP_BTN_ID_PREFIX:"#interactive_pc_move_up_btn_",IPC_OPTIONS_BOTTOM_SHEET:"ipc_options_sheet",IPC_REARRANGE_ORDER_EXPANDER_ID:"#ipc_rearrange_order_expander",IPC_MOVE_DOWN_BUTTON_CLASS_SELECTOR:".ipc_move_down_btn",
IPC_MOVE_UP_BUTTON_CLASS_SELECTOR:".ipc_move_up_btn",IPC_LAST_DOWN_BUTTON:"ipc_last_down_btn",IPC_FIRST_UP_BUTTON:"ipc_first_up_btn",IPC_RESET_LINK_ELEMENT_ID:"#ipc_reset_link",IPC_COMPARE_DIFF_BUTTON_SELECTOR:"#interactive_pc_compare_diff_btn",IPC_COMPARE_DIFF_BUTTON_SELECTED:"ipc_button_selected",METRICS:{IPC_QD_INGRESS_CLICKED:"ipc_qd_ingress_clicked",IPC_QD_LOAD_FAILURE:"ipc_qd_table_load_failure",IPC_QD_TABLE_FETCHED:"ipc_qd_table_fetched",IPC_QD_AJAX_CALL_SUCCESS:"ipc_qd_ajax_call_success",
IPC_COMPARE_DIFF_FILTER_CHECKED:"ipc_compare_diff_filter_checked",IPC_COMPARE_DIFF_FILTER_UNCHECKED:"ipc_compare_diff_filter_unchecked",IPC_QD_EMPTY_QPT_RESPONSE_FROM_APPI:"ipc_qd_empty_qpt_response_from_aapi",IPC_TABLE_EXPANDER_EXPANDED:"ipc_table_show_more_clicked",IPC_TABLE_EXPANDER_COLLAPSED:"ipc_table_show_less_clicked",IPC_OPTIONS_LINK_CLICKED:"ipc_options_link_clicked",IPC_OPTIONS_EXPANDER_EXPANDED:"ipc_options_expander_expanded",IPC_OPTIONS_EXPANDER_COLLAPSED:"ipc_options_expander_collapsed",
IPC_ROW_MOVED_DOWN:"ipc_row_moved_down",IPC_ROW_MOVED_UP:"ipc_row_moved_up",IPC_DONE_BTN_CLICKED:"ipc_done_btn_clicked",IPC_RESET_DEFAULT_ORDER:"ipc_reset_default_order",IPC_AAPI_SLATE_TOKEN_ABSENT:"ipc_aapi_slate_token_absent"}}});"use strict";n.register("ipc_metrics",function(){return{registerCounter:function(c){q.ue&&q.ue.count&&q.ue.count(c,(q.ue.count(c)||0)+1)}}});"use strict";n.when("A","jQuery","ipc_constants").register("ipc_qty_table_helper",function(c,b,a){b=c.$;return{getQPTFromAPIResponse:function(b){for(var c=
[],f=b.length,e=0;e<f;e++){var l=b[e];if(!l.hidden){var h;h=b[e];if(e===f-1)h=h.minimumQuantity+a.IPC_PLUS;else{var k=b[e+1],m=k.minimumQuantity-1;h=h.minimumQuantity===m?h.minimumQuantity:k.hidden?h.minimumQuantity+a.IPC_PLUS:h.minimumQuantity+a.IPC_DASH+m}c.push({quantityRange:h,price:l.price.displayString})}}return c},getQtyDiscountTableContent:function(d){for(var c=document.createElement("div"),f=0;f<d.length;f++){var e=b("#"+a.IPC_QPT_ROW_PREFIX).clone(),l=e.find(a.IPC_QPT_RANGE_ELEMET_ID),h=
e.find(a.IPC_QPT_PRICE_ELEMET_ID),k=b(l).text().replace("{}",d[f].quantityRange),m=b(h).text().replace("{}",d[f].price);b(l).text(k);b(h).text(m);b(e).removeClass("aok-hidden");l=a.IPC_QPT_ROW_PREFIX+"_"+f;b(e).attr("id",l);b(c).append(e);f!==d.length-1&&b(c).append(a.IPC_HORIZONTAL_RULE_ELEMENT)}return c},getParamsForAJAXCall:function(d,c){return{priceFormatParams:c,cop:d,csrfToken:b(a.IPC_CSRF_TOKEN_ELEMENT_ID).attr("value"),apiEndpoint:b(a.IPC_AJAX_ENDPOINT_ELEMENT_ID).attr("value"),marketplaceId:b(a.IPC_MARKETPLACE_ELEMENT_ID).attr("value"),
language:b(a.IPC_LANG_ELEMENT_ID).attr("value")}},extractRawPriceTiers:function(b){try{return b.entity.buyingOptions[0].quantityPricingTable.entity.pricingTiers}catch(a){return[]}}}});"use strict";n.register("ipc_reset_option_state",function(){var c=!1;return{setResetState:function(b){"boolean"===typeof b&&(c=b)},getResetState:function(){return c}}});"use strict";n.when("A","jQuery","ipc_constants").register("ipc_sorting_n_filtering_utils",function(c,b,a){function d(){b(a.IPC_MOVE_DOWN_BUTTON_CLASS_SELECTOR).last().addClass(a.IPC_LAST_DOWN_BUTTON+
" "+a.AUI_HIDDEN_CLASS);b(a.IPC_MOVE_UP_BUTTON_CLASS_SELECTOR).first().addClass(a.IPC_FIRST_UP_BUTTON+" "+a.AUI_HIDDEN_CLASS)}function g(e,c){b(a.IPC_MOVE_UP_BTN_ID_PREFIX+e).hasClass(a.IPC_FIRST_UP_BUTTON)&&(b(a.IPC_MOVE_UP_BTN_ID_PREFIX+e).removeClass(a.IPC_FIRST_UP_BUTTON+" "+a.AUI_HIDDEN_CLASS),b(a.IPC_MOVE_UP_BTN_ID_PREFIX+c).addClass(a.IPC_FIRST_UP_BUTTON+" "+a.AUI_HIDDEN_CLASS));b(a.IPC_MOVE_DOWN_BTN_ID_PREFIX+c).hasClass(a.IPC_LAST_DOWN_BUTTON)&&(b(a.IPC_MOVE_DOWN_BTN_ID_PREFIX+c).removeClass(a.IPC_LAST_DOWN_BUTTON+
" "+a.AUI_HIDDEN_CLASS),b(a.IPC_MOVE_DOWN_BTN_ID_PREFIX+e).addClass(a.IPC_LAST_DOWN_BUTTON+" "+a.AUI_HIDDEN_CLASS))}function f(){b("."+a.IPC_LAST_DOWN_BUTTON).removeClass(a.IPC_LAST_DOWN_BUTTON+" "+a.AUI_HIDDEN_CLASS);b("."+a.IPC_FIRST_UP_BUTTON).removeClass(a.IPC_FIRST_UP_BUTTON+" "+a.AUI_HIDDEN_CLASS)}b=c.$;return{initializeMovementButtonCSS:d,getNextVisibleRow:function(a){for(a=b(a).next();0<b(a).length&&!b(a).is(":visible");)a=b(a).next();return 0<b(a).length?a:null},getPrevVisibleRow:function(a){for(a=
b(a).prev();0<b(a).length&&!b(a).is(":visible");)a=b(a).prev();return 0<b(a).length?a:null},moveRowDown:function(e,c,d){var f=b(a.IPC_TABLE_ATTR_ROW_ID_PREFIX+e),m=b(d).attr("id").split("_").pop(),p=b(a.IPC_TABLE_ATTR_ROW_ID_PREFIX+m);d.after(c);p.after(f);g(e,m)},moveRowUp:function(e,c,d){var f=b(a.IPC_TABLE_ATTR_ROW_ID_PREFIX+e),m=b(d).attr("id").split("_").pop(),p=b(a.IPC_TABLE_ATTR_ROW_ID_PREFIX+m);d.before(c);p.before(f);g(m,e)},resetTableRows:function(){for(var e=b('tr[id^\x3d"interactive_pc_table_row_"]').length,
c=b(a.IPC_TABLE_ATTR_ROW_ID_PREFIX+"0"),d=b(a.IPC_SORTING_ROW_ELEMENT_ID_PREFIX+"0"),f=1;f<e;f++){var g=b(a.IPC_TABLE_ATTR_ROW_ID_PREFIX+f),p=b(a.IPC_SORTING_ROW_ELEMENT_ID_PREFIX+f);c.after(g);d.after(p);c=g;d=p}},resetMovementButtonCSSForFilteredResult:function(){var e=b(a.IPC_MOVE_DOWN_BUTTON_CLASS_SELECTOR).last().closest("tr"),c=b(a.IPC_MOVE_UP_BUTTON_CLASS_SELECTOR).first().closest("tr");if(b(e).hasClass(a.IPC_SIMILAR_ATTR_VAL_CLASS_NAME)){for(e=b(e).prev();0<b(e).length&&b(e).hasClass(a.IPC_SIMILAR_ATTR_VAL_CLASS_NAME);)e=
b(e).prev();e=0<b(e).length?e:null}if(b(c).hasClass(a.IPC_SIMILAR_ATTR_VAL_CLASS_NAME)){for(c=b(c).next();0<b(c).length&&b(c).hasClass(a.IPC_SIMILAR_ATTR_VAL_CLASS_NAME);)c=b(c).next();c=0<b(c).length?c:null}f();b(e).find(a.IPC_MOVE_DOWN_BUTTON_CLASS_SELECTOR).addClass(a.IPC_LAST_DOWN_BUTTON+" "+a.AUI_HIDDEN_CLASS);b(c).find(a.IPC_MOVE_UP_BUTTON_CLASS_SELECTOR).addClass(a.IPC_FIRST_UP_BUTTON+" "+a.AUI_HIDDEN_CLASS)},resetMovementButtonCSSForUnFilteredResult:function(){f();d()},showResetLink:function(){b(a.IPC_RESET_LINK_ELEMENT_ID).removeClass(a.AUI_HIDDEN_CLASS)},
hideResetLink:function(){b(a.IPC_RESET_LINK_ELEMENT_ID).addClass(a.AUI_HIDDEN_CLASS)},alreadyInitialized:function(){return 0<b("."+a.IPC_FIRST_UP_BUTTON).length}}});"use strict";n.when("A","a-checkbox","jQuery","ready","ipc_constants","ipc_metrics","ipc_sorting_n_filtering_utils").execute("filter-action-handler",function(c,b,a,d,g,f,e){c.declarative("interactive-pc-compare-differences-action","change",function(c){b(g.IPC_CHECKBOX_ELEMENT_ID).isChecked()?(a("."+g.IPC_SIMILAR_ATTR_VAL_CLASS_NAME).css("display",
"none"),e.resetMovementButtonCSSForFilteredResult(),f.registerCounter(g.METRICS.IPC_COMPARE_DIFF_FILTER_CHECKED)):(a("."+g.IPC_SIMILAR_ATTR_VAL_CLASS_NAME).css("display",""),e.resetMovementButtonCSSForUnFilteredResult(),f.registerCounter(g.METRICS.IPC_COMPARE_DIFF_FILTER_UNCHECKED))})});"use strict";n.when("A","jQuery","ready","a-popover","abPricingFfqp_amazonAPIPriceFormatter","ipc_constants","ipc_qty_table_helper","ipc_metrics").register("ipc_qd_table_fetcher",function(c,b,a,d,g,f,e,l){function h(){var a=
c.state(f.IPC_PRICE_FORMAT_PARAMS_PAGE_STATE),d=b(f.IPC_COP_ELEMENT_ID).attr("value");u=e.getParamsForAJAXCall(d,a);a&&"object"===typeof a&&d&&(a.currencyOfPreference=d,t=new g(a));k()}function k(){b(f.IPC_POPOVER_LINK_CLASS_NAME).each(function(a,e){var d=e.dataset.asin;a=f.IPC_QD_POPOVER_PREFIX+d;c.off("a:popover:beforeShow:"+a);c.on("a:popover:beforeShow:"+a,function(a){l.registerCounter(f.METRICS.IPC_QD_INGRESS_CLICKED);b(f.IPC_QD_SPINNER_PREFIX+d).length&&m(u,d,a.popover)})})}function m(a,c,d){c=
"https://"+a.apiEndpoint+"/api/marketplaces/"+a.marketplaceId+"/products/"+c;var g=b(f.IPC_AAPI_SLATE_TOKEN_META_NAME).attr("content"),k={"Accept-Language":a.language,Accept:'application/vnd.com.amazon.api+json; type\x3d"product/v2"; expand\x3d"buyingOptions[].quantityPricingTable(product.quantity-pricing-table/v1)"',"x-api-csrf-token":a.csrfToken,"x-cc-currency-of-preference":a.cop};g?k["x-amzn-encrypted-slate-token"]=g:l.registerCounter(f.METRICS.IPC_AAPI_SLATE_TOKEN_ABSENT);a.csrfToken&&c&&a.language&&
a.cop?b.ajax({url:c,type:"GET",headers:k,xhrFields:{withCredentials:!0},success:function(a){l.registerCounter(f.METRICS.IPC_QD_AJAX_CALL_SUCCESS);t?(t.formatPrices(a),a=e.extractRawPriceTiers(a),"undefined"!==typeof a&&0<a.length?(a=e.getQPTFromAPIResponse(a),d.update({content:e.getQtyDiscountTableContent(a),width:"280px",closeButton:!1})):(l.registerCounter(f.METRICS.IPC_QD_EMPTY_QPT_RESPONSE_FROM_APPI),p(d))):p(d)},error:function(){p(d)},complete:function(){l.registerCounter(f.METRICS.IPC_QD_TABLE_FETCHED)}}):
p(d)}function p(a){l.registerCounter(f.METRICS.IPC_QD_LOAD_FAILURE);a.hide()}b=c.$;var u,t,n=!1;h();c.on("a:pageUpdate",function(){n?h():n=!0})});"use strict";n.when("A","ready","a-checkbox","ipc_constants","ipc_metrics","ipc_reset_option_state","ipc_sorting_n_filtering_utils").execute("ipc_table_action_handler",function(c,b,a,d,g,f,e){function l(){h()&&k("#"+d.IPC_OPTIONS_CONTAINER).css({display:"none"})}function h(){return 0<k("#"+d.IPC_OPTIONS_CONTAINER+":visible").length}var k=c.$,m=!1;e.initializeMovementButtonCSS();
f.setResetState(!1);c.on("a:expander:interactive_pc_detail_expander:toggle:expand",function(a){g.registerCounter(d.METRICS.IPC_TABLE_EXPANDER_EXPANDED);k(d.IPC_TABLE_EXPANDER_CONTENT_SELECTOR).removeClass(d.AUI_HIDDEN_CLASS)});c.on("a:expander:interactive_pc_detail_expander:toggle:collapse",function(a){g.registerCounter(d.METRICS.IPC_TABLE_EXPANDER_COLLAPSED);k(d.IPC_TABLE_EXPANDER_CONTENT_SELECTOR).addClass(d.AUI_HIDDEN_CLASS)});c.on("a:expander:interactive_pc_rearrange_detail_expander:toggle:expand",
function(a){g.registerCounter(d.METRICS.IPC_OPTIONS_EXPANDER_EXPANDED);k(d.IPC_SORTING_OPTIONS_ROW_SELECTOR).removeClass(d.AUI_HIDDEN_CLASS)});c.on("a:expander:interactive_pc_rearrange_detail_expander:toggle:collapse",function(a){g.registerCounter(d.METRICS.IPC_OPTIONS_EXPANDER_COLLAPSED);k(d.IPC_SORTING_OPTIONS_ROW_SELECTOR).addClass(d.AUI_HIDDEN_CLASS)});c.declarative("interactive-pc-options-dropdown-action","click",function(a){g.registerCounter(d.METRICS.IPC_OPTIONS_LINK_CLICKED);h()?(l(),k("#ipc_options_button").removeClass(d.AUI_BUTTON_FOCUS_CLASS)):
h()||k("#"+d.IPC_OPTIONS_CONTAINER).css({display:"block"})});k(document).mouseup(function(a){var b=k("#"+d.IPC_OPTIONS_CONTAINER),c=k("#ipc_options_button");b.is(a.target)||0!==b.has(a.target).length||c.is(a.target)||0!==c.has(a.target).length||l()});c.declarative("interactive-pc-sorting-move-down-action","click",function(a){var b=a.data.rowIndex,c=k(d.IPC_SORTING_ROW_ELEMENT_ID_PREFIX+b),h=e.getNextVisibleRow(c);null!==h&&(e.moveRowDown(b,c,h),f.getResetState()||f.setResetState(!0),g.registerCounter(d.METRICS.IPC_ROW_MOVED_DOWN));
a.$event.preventDefault();k(d.IPC_MOVE_DOWN_BTN_ID_PREFIX+b).removeClass(d.AUI_BUTTON_FOCUS_CLASS)});c.declarative("interactive-pc-sorting-move-up-action","click",function(a){var b=a.data.rowIndex,c=k(d.IPC_SORTING_ROW_ELEMENT_ID_PREFIX+b),h=e.getPrevVisibleRow(c);null!==h&&(e.moveRowUp(b,c,h),f.getResetState()||f.setResetState(!0),g.registerCounter(d.METRICS.IPC_ROW_MOVED_UP));a.$event.preventDefault();k(d.IPC_MOVE_UP_BTN_ID_PREFIX+b).removeClass(d.AUI_BUTTON_FOCUS_CLASS)});c.declarative("interactive-pc-reset-action",
"click",function(b){f.getResetState()&&(e.resetTableRows(),a(d.IPC_CHECKBOX_ELEMENT_ID).isChecked()?e.resetMovementButtonCSSForFilteredResult():e.resetMovementButtonCSSForUnFilteredResult(),g.registerCounter(d.METRICS.IPC_RESET_DEFAULT_ORDER),f.setResetState(!1))});c.on("a:pageUpdate",function(){m&&!e.alreadyInitialized()?(e.initializeMovementButtonCSS(),f.setResetState(!1)):m=!0})})});
/* ******** */
(function(l){var q=window.AmazonUIPageJS||window.P,r=q._namespace||q.attributeErrors,p=r?r("DetailPageWarrantyAssets",""):q;p.guardFatal?p.guardFatal(l)(p,window):p.execute(function(){l(p,window)})})(function(l,q,r){"use strict";var p;p=function(){};"use strict";l.when("A").register("wty:Reftag",function(d){function h(c){this.prefix=c}h.prototype.log=function(c,g,f){c=f?[this.prefix,c,g,f]:[this.prefix,c,g];p("Reftag.log: "+c);c=c.join("_");d.get("/gp/product/ajax-handlers/reftag.html/ref\x3d"+c)};
return h});"use strict";l.when("A","BaseLinkFormHelper","wty:natc-constants","wty:natcFormHelper","wty-nexus-logger").register("wty:detailPage",function(d,h,c,g,f){function a(){}a.prototype.bindQuantityChange=function(e){var a=function(){e(d.$(this).val())};e(d.$("#quantity").val());d.$("[id\x3d'quantity']").bind("change",a);return a};a.prototype.unbindQuantityChange=function(e){d.$("[id\x3d'quantity']").unbind("change",e)};a.prototype.bindBuyBoxAccordion=function(e){d.on("a:accordion:buybox-accordion:select",
e);d.on("a:accordion:installment-payment-buybox-accordion:select",e);return e};a.prototype.unbindBuyBoxAccordion=function(e){d.off("a:accordion:buybox-accordion:select",e);d.off("a:accordion:installment-payment-buybox-accordion:select",e)};a.prototype.findQuantityInput=function(e){return e.find("input[name^\x3dquantity]")};a.prototype.findOfferListingIdInput=function(e){return e.find("input[name^\x3dofferingID]")};a.prototype.handleBaselink=function(e){if(d.$("#mbb__bl").length){var a=d.$(e._checkbox[0].form);
a&&(e.isChecked()?(e=e.getKvpIndex(),h.addBaseLinkFields(e,a)):h.removeBaseLinkFields(a))}};a.prototype.handleATC=function(a){var k=d.$(a._checkbox[0].form);k&&(g.clearParams(k,c.PARAMETERS.ATC),a.isChecked()&&g.addAtcParams(a._warrantyAsin,a._offerListingIdSelection.val(),a._quantity.val(),k))};a.prototype.logAddToCartAction=function(a){function k(){var b=a.getCheckedItem();b&&(b=f.convertMBBObjectsToWarrantyDataNexusPayload(a,b),f.logWarrantyAddToCart(b))}var b=document.getElementById("add-to-cart-button");
b&&b.addEventListener("click",k);(b=document.getElementById("dealsx_atc_btn"))&&b.addEventListener("click",k)};return new a});"use strict";l.when("wty:Reftag","wty-nexus-constants").register("wty:MbbTypes",function(d,h){var c={mbb__tsn:{cssClass:"mbb__tsn",reftag:new d("psd_bb"),hasQuantity:!0,deviceType:h.DEVICE_TYPE_CONSTANTS.DESKTOP},mbb__ti:{cssClass:"mbb__ti",reftag:new d("psd_ib"),hasQuantity:!0,deviceType:h.DEVICE_TYPE_CONSTANTS.DESKTOP},mbb__tld:{cssClass:"mbb__tld",reftag:new d("psd_ld"),
deviceType:h.DEVICE_TYPE_CONSTANTS.DESKTOP}};return{getType:function(d){return c[d]}}});"use strict";l.when("A","a-modal").register("wty:mbbModalHelper",function(d,h){function c(){}c.prototype.create=function(c,f,a,e){if(e){var k=d.$("#a-popover-"+f),b=k.clone(!0).prop("id","a-popover-"+f+"-Opened");k.parent().append(b)}h.create(c,{name:e?f+"-Opened":f,header:a,width:750})};c.prototype.remove=function(c,d){h.remove(d?c+"-Opened":c)};c.prototype.hide=function(c,d){(c=h.get(d?c+"-Opened":c))&&c.hide()};
return new c});"use strict";l.when("A","wty:Reftag","wty:MbbItem","wty-nexus-logger","wty:detailPage").register("wty:Mbb",function(d,h,c,g,f){function a(a,k,b){this._type=b;this._deviceType=b.deviceType;this._reftag=b.reftag;this._baseFormIndex=a;this._pageData=k;this._baseItemAsin=k.bi.a;this._mbbFeature=d.$(".mbb__bb."+b.cssClass);this._modalHeader=this._mbbFeature.find(".mbb__mh").html();this._items=[];g.initialize(g.nexusConstants.FEATURE_NAME_CONSTANTS.MBB,this._pageData);this._nexusLogger=g;
var m=this;this._mbbFeature.each(function(b,a){d.$(a).find(".mbb__r").each(function(b){var a=d.$(this),a=new c(m,a,b);m._items[b]=a})});f.logAddToCartAction(this)}a.prototype._destroy=function(){for(var a=0,c=this._items.length;a<c;a++)this._items[a]._destroy()};a.prototype._setQuantity=function(a){for(var c=0,b=this._items.length;c<b;c++)this._items[c]._setQuantity(a)};a.prototype._setChecked=function(a,c){for(var b=0,d=this._items.length;b<d;b++)this._items[b]._setChecked(c&&b===a)};a.prototype.getCheckedItem=
function(){for(var a=0,c=this._items.length;a<c;a++){var b=this._items[a];if(b.isChecked())return b}};a.prototype.getItems=function(){return this._items};return a});l.when("A","cc-manager","warranty-options-constants","warranty-card-utils","warranty-options-csm").register("cc-warranty-options",function(d,h,c,g,f){function a(a){h.ccSelectionsClear(e,a)}var e=c.featureRegistration.featureName;return{updateWarrantyOptionSelection:function(c){if(!c)return console.log("Item data missing for selection update!"),
!1;var b="LumpSum";c.isMonthlySubscription&&(b="Monthly");f.increment("Swatch:Warranty:"+b+":Click");a();c=g.createCcDataFromWarrantySelectionData(c);return h.ccSelectionUpdate(e,c)},clearOptionSelection:a}});"use strict";l.when("A","cc-manager","warranty-options-constants","warranty-card-utils","warranty-options-csm").register("warranty-options-registration",function(d,h,c,g,f){var a=c.featureRegistration.featureName,e=c.supportedBuyingOptions,k=c.selector,b=c.styles,m=!1,n=d.$,l={init:g.init,cardCollapse:g.cardCollapse,
switchBuyingOption:function(c,f,l,v){e.includes(v)?(n(k.expanderIcon).removeClass(b.hidden),h.ccRemovedSelectionsClear(a),m&&d.trigger("warranty-twister-card:reset-subtitle"),m=!1):(m=!0,g.isWarrantyOptionSelected()&&g.ccRemovedSelectionUpdate(h),d.trigger("a:declarative:warranty-twister-default-action:click"),d.trigger("warranty-twister-card:card-collapse"),n(k.expanderIcon).addClass(b.hidden),n(k.warrantyIcon).addClass(b.hidden))},validateInputParams:g.validateInputParams};d.on("warranty-twister-card:expanded",
function(){h.cardExpanded(a)});f.initializeInteractionMetrics();(function(){n(k.warrantyOption).each(function(b){var a=g.getWarrantyDataFromOption(n(this));f.logImpressionToNexus(a,b)})})();h.registerFeature(c.featureRegistration,l)});"use strict";l.when("A").register("warranty-options-constants",function(d){return{featureRegistration:{featureName:"warrantyTwisterPlus",featureAttribution:"Retail/AppleCare/(de)activation",updateQtyAsBaseItem:1},selector:{expanderContainer:".warranty-twister-container",
skeletonLoader:".warranty-twister-skeleton-loader",checkmark:".warranty-twister-selected-checkmark",subtitle:".warranty-twister-subtitle",subtitleText:"#warranty-twister-subtitle",priceSubtitle:".warranty-twister-price-subtitle",priceSubtitleText:"#warranty-twister-price-subtitle",cardImage:".warranty-twister-selected-card-image",expanderIcon:".warranty-twister-expander-icon",learnMoreLink:"#learn-more-link",toggleButton:"#warranty-twister-toggle-button",expanderContent:".warranty-twister-expander-content",
expanderData:"[data-toggle-warranty-twister-expander]",swatch:".warranty-twister-swatch",warrantyOption:".warranty-twister-box-group-warranty-option",selectedWarrantyOption:".warranty-twister-selected-box-group.warranty-twister-box-group-warranty-option",warrantyOptionTitle:".warranty-twister-warranty-option-title",defaultOption:"#default-option-swatch",warrantyDefaultBoxGroup:".warranty-twister-box-group-default-option",swatchBoxGroup:".warranty-twister-box-group",swatchHeading:".warranty-twister-box-group-heading",
swatchBoxGroupDetail:".warranty-twister-box-group-detail",swatchBoxGroupDetailNoHeader:".warranty-twister-box-group-detail-no-header",popoverButtonRow:"#attach-warranty-popover-buttons-row",warrantyTwisterSecondaryView:"#a-popover-warrantyTwisterPlusSecondaryView",buyingOptionSuppressionMessage:"#buyingOptionSuppressionMessage",warrantyIcon:"#warranty-icon",monthlyCheckbox:".warranties-monthly-checkbox",monthlyWarning:"#MonthlyWarrantyWarning",warrantyListItem:".warranty-twister-list-item",multiCardExperimentData:"wireless-multi-card",
multiCardExperimentElement:"[data-wireless-multi-card]",activeTPlusCards:"#twister-plus-active-cards"},styles:{twisterPlusFadeIn:"twister-plus-cc-card-fadeIn",warrantyTwisterExpand:"warranty-twister-expander-content-expand",skeletonLoaderExpand:"warranty-twister-skeleton-loader-expand",selectedHeading:"warranty-twister-selected-heading",selectedBoxGroup:"warranty-twister-selected-box-group",unselectedHeading:"warranty-twister-unselected-heading",disabledCard:"disabled-card",disabledOption:"disabled-option",
hidden:"aok-hidden"},animationTimeoutUnit:200,metricPrefix:"warranty-options",supportedBuyingOptions:"NEW B2B_NEW CUSTOM_OFFER BUNDLE RENEWED_TIER_1 RENEWED_TIER_2 RENEWED_TIER_3 RENEWED_TIER_4".split(" ")}});"use strict";l.when("A").register("warranty-options-weblab-vars",function(d){return{isAutoExpandEnabled:!1}});"use strict";l.when("A","warranty-options-constants","warranty-devicetype-variants","wty-nexus-logger","warranty-card-utils").register("warranty-options-csm",function(d,h,c,g,f){function a(b,
a){"undefined"!==typeof l&&"undefined"!==typeof l.count&&b&&l.count(b,(l.count(b)||0)+a);"undefined"!==typeof q.csa&&q.csa("Events",{producerId:"dp-rpcx"})("log",{schemaId:"dpRpcx.CSALoggingSchema.5",eventName:b,valueToLog:a},{ent:"all"})}function e(b){if(b)this.timerName=b,this.startTime=0;else throw Error("timerName must be non empty string");}function k(b,a,e){b||(b=Object.assign({},f.getSelectedCardData()),b.warrantyAsin=p.NON_WARRANTY_ACTION_ASIN_PLACEHOLDER);b={baseItemAsin:b.baseAsin,warrantyAsin:b.warrantyAsin,
customerId:b["warranty-customerID"]||f.getSelectedCardData()["warranty-customerID"],deviceType:c.attributesForDeviceType.deviceType,warrantyDisplayPosition:a+1,feature:p.TWISTER_PLUS_FEATURE_NAME,action:e};g.logWarrantyWidgetInteraction(b)}function b(b){b={baseItemAsin:b.baseAsin,warrantyAsin:b.warrantyAsin,customerId:b["warranty-customerID"]||f.getSelectedCardData()["warranty-customerID"],deviceType:c.attributesForDeviceType.deviceType,warrantyDisplayPosition:1,feature:p.TWISTER_PLUS_FEATURE_NAME};
g.logWarrantyAddToCart(b)}function m(){n(t.warrantyOption).each(function(b){d.on("a:popover:beforeShow:warrantyTwisterPlusSecondaryView-"+b,function(){var a=n(t.warrantyOption).get(b);k(a,b,p.LEARN_MORE_CLICK_METRIC_NAME)})})}var n=d.$,l=q.ue,t=h.selector;h=h.featureRegistration.featureName;var u=!1,r={ccExpanded:"twisterPlus.ccExpanded."+h,ccExpandedTime:"twisterPlus.ccExpandedTime."+h,ccScroll:"twisterPlus.ccScroll."+h,ccLearnMore:"twisterPlus.ccLearnMore."+h,ccItemCounts:"twisterPlus.ccItemsCount."+
h,ccItemsSelectCount:"twisterPlus.ccItemsSelectCount."+h,defaultOptionSelectCount:"twisterPlus.defaultSelectCount."+h,ccSVLoadingtime:"twisterPlus.ccSVLoadingtime."+h},p={TWISTER_PLUS_FEATURE_NAME:"TWISTER_PLUS",NON_WARRANTY_OPTION_INDEX:-1,NON_WARRANTY_ACTION_ASIN_PLACEHOLDER:"NONE",COLLAPSE_CARD_METRIC_NAME:"CARD_COLLAPSE",EXPAND_CARD_METRIC_NAME:"CARD_EXPAND",LEARN_MORE_CLICK_METRIC_NAME:"LEARN_MORE_CLICK"};d.declarative("warranty-option-swatch-select","click",function(b){u=!0});d.declarative("default-option-swatch",
"click",function(b){u=!1});n(document).ready(function(){function a(){if(u){var c=f.getSelectedCardData();c&&b(c)}}var c=document.getElementById("add-to-cart-button");c&&c.addEventListener("click",a);(c=document.getElementById("dealsx_atc_btn"))&&c.addEventListener("click",a);(c=document.getElementById("pickup-add-to-cart-button"))&&c.addEventListener("click",a)});e.prototype={isStarted:!1,start:function(){this.isStarted=!0;this.startTime=Date.now()},stop:function(){this.startTime&&a(this.timerName,
Date.now()-this.startTime)}};return{increment:function(b){a(b,1)},incrementWithValue:a,initializeInteractionMetrics:function(){m();var b=n(t.warrantyOption).length;b&&a(r.ccItemCounts,b)},logImpressionToNexus:function(b,a){g.logWarrantyImpression({baseItemAsin:b.baseAsin,warrantyAsin:b.warrantyAsin,customerId:b["warranty-customerID"],deviceType:c.attributesForDeviceType.deviceType,warrantyDisplayPosition:a+1,feature:p.TWISTER_PLUS_FEATURE_NAME})},logInteractionToNexus:k,logAddToCartToNexus:b,Timer:e,
MetricNames:r,InternalMetricConstants:p}});l.when("A","warranty-options-constants").register("warranty-card-utils",function(d,h){function c(b){var c=b.warrantyQuantity;if(c===r||1>c)c=1;var d="Protection Plans";a(e.subtitleText).length&&(d=a(e.subtitleText).text());var k=parseFloat(b.warrantyPriceAmount);return{itemType:"Warranty",asin:b.warrantyAsin,price:k,quantity:c,offerListingId:b.warrantyOffer,selectionType:b.selectionType,orderSummaryDisplayString:d,shortDisplayTitle:b.warrantyShortTitle,enableIA:!0,
IAData:{parentAsin:b.baseAsin,type:"AmazonProtect",renderType:"renderAll",constraintList:[{type:"DELETE",mutuallyInclusive:!1}]}}}function g(){var b=a("[data-warranty-option-swatch-select]").data("warranty-option-swatch-select");0<a(e.selectedWarrantyOption).length&&(b=f(a(e.selectedWarrantyOption)));return b}function f(b){var c=a(b).parent().data("warranty-option-swatch-select");c||(b=a(b).children(".a-declarative")[0],c=a(b).data("warranty-option-swatch-select"));return c}var a=d.$,e=h.selector,
k=h.featureRegistration.featureName;return{cardCollapse:function(){d.trigger("warranty-twister-card:card-collapse")},cardExpand:function(){d.trigger("warranty-twister-card:card-expand")},ccRemovedSelectionUpdate:function(b){var a=g(),a=c(a);b.ccRemovedSelectionUpdate(k,a)},createCcDataFromWarrantySelectionData:c,getSelectedCardData:g,getWarrantyDataFromOption:f,init:function(b){},isBuyingOptionUnsupported:function(b,a){return!h.supportedBuyingOptions.includes(a)},isWarrantyOptionSelected:function(){return 0<
a(e.selectedWarrantyOption).length},validateInputParams:function(b){return"number"===typeof b.price}}});"use strict";l.when("A","wty-nexus-constants").register("warranty-devicetype-variants",function(d,h){return{attributesForDeviceType:{deviceType:h.DEVICE_TYPE_CONSTANTS.DESKTOP}}});"use strict";l.when("A","jQuery","warranty-options-constants").execute(function(d,h,c){d.loadDescendantImagesManually(h(c.selector.expanderContainer))});"use strict";l.when("A","warranty-twister-expander-state","warranty-options-constants",
"warranty-twister-swatch-actions","warranty-options-csm").register("warranty-twister-expander-actions",function(d,h,c,g,f){function a(){var a=b(m.expanderContainer),c=a.offset().top+a.outerHeight();if(b(q).scrollTop()+b(q).height()<c){var c=a.offset().top,e=b(q).height(),a=a.height(),a=c-(e-a)/2;b("html, body").animate({scrollTop:a},h.animationTimeoutUnit)}}function e(a){a=a?l.expandedPriceSubtitle:l.loadingSubtitle;b(m.priceSubtitleText).text(a)}function k(){b(m.expanderIcon).hasClass(n.hidden)?
b(m.priceSubtitleText).text(b(m.buyingOptionSuppressionMessage).text()):b(m.priceSubtitleText).text(l.collapsedPriceSubtitle)}var b=d.$,m=c.selector,n=c.styles,l=h.expanderSubtitle,t=new f.Timer(f.MetricNames.ccExpandedTime);g={initSubtitle:function(b){l.collapsedSubtitle=b.data.defaultSubtitle;l.expandedSubtitle=b.data.expandedSubtitle;l.collapsedPriceSubtitle=b.data.defaultPriceSubtitle;l.expandedPriceSubtitle=b.data.expandedPriceSubtitle},expandWarrantyOptions:function(k){f.increment(f.MetricNames.ccExpanded);
f.logInteractionToNexus(null,f.InternalMetricConstants.NON_WARRANTY_OPTION_INDEX,f.InternalMetricConstants.EXPAND_CARD_METRIC_NAME);t.start();b(m.expanderContent).addClass(n.warrantyTwisterExpand);b(m.subtitleText).text(l.expandedSubtitle);b(m.expanderIcon).addClass("rotate");d.delay(function(){b(m.swatch).addClass(n.twisterPlusFadeIn);b(m.warrantyIcon).removeClass(n.hidden);e(k);a()},c.animationTimeoutUnit)},expandSkeletonLoader:function(){b(m.expanderContent).addClass(n.skeletonLoaderExpand);b(m.expanderIcon).addClass("rotate");
d.delay(function(){b(m.skeletonLoader).addClass(n.twisterPlusFadeIn);e(!1);a()},c.animationTimeoutUnit)},hideLoaderAnimation:function(k){k&&b(m.skeletonLoader).removeClass(n.twisterPlusFadeIn);d.delay(function(){b(m.skeletonLoader).hide();b(m.swatch).removeClass("invisible");k&&(b(m.expanderContent).addClass(n.warrantyTwisterExpand),d.delay(function(){b(m.swatch).addClass(n.twisterPlusFadeIn);e(!0);a()},c.animationTimeoutUnit))},c.animationTimeoutUnit)},collapseWarrantyOptions:function(a){t.stop();
f.logInteractionToNexus(null,f.InternalMetricConstants.NON_WARRANTY_OPTION_INDEX,f.InternalMetricConstants.COLLAPSE_CARD_METRIC_NAME);b(m.swatch).removeClass(n.twisterPlusFadeIn);a||b(m.skeletonLoader).removeClass(n.twisterPlusFadeIn);b(m.expanderIcon).removeClass("rotate");b(m.subtitleText).text(l.collapsedSubtitle);d.delay(function(){b(m.expanderContent).removeClass(n.warrantyTwisterExpand);b(m.expanderContent).removeClass(n.skeletonLoaderExpand);k();b(m.selectedWarrantyOption).length||b(m.warrantyIcon).addClass(n.hidden)},
c.animationTimeoutUnit)},showPriceSubtitleInCollapsedView:k};d.on("a:popover:show:secondaryview-legal-message",function(b){b.popover.$container.css("left",0)});return g});"use strict";l.when("A","warranty-twister-expander-actions","warranty-twister-expander-state","warranty-options-weblab-vars","warranty-options-constants").execute(function(d,h,c,g,f){function a(){var a=k(n.expanderData).data("toggle-warranty-twister-expander");!1!==b&&a.isExpand?(b=!1,a.isExpand=!1,h.collapseWarrantyOptions(m)):
h.showPriceSubtitleInCollapsedView()}function e(c){if(b===r||null===b||null===c.data.isExpand||c.data.isExpand===r){if(null===c.data.isExpand||c.data.isExpand===r)k(n.expanderData).data("toggle-warranty-twister-expander").isExpand=!1,c.data.isExpand=!1;h.initSubtitle(c);m&&h.hideLoaderAnimation(c.data.isExpand)}b=c.data.isExpand;!0===b?a():!1===b&&(b=!0,m?h.expandWarrantyOptions(m):h.expandSkeletonLoader(),d.trigger("warranty-twister-card:expanded"));k(n.expanderData).data("toggle-warranty-twister-expander").isExpand=
b}var k=d.$,b,m=c.isLoaded,n=f.selector,p=f.styles;l.when("cc-warranty-options").execute(function(){m=!0;h.hideLoaderAnimation(b);b&&d.trigger("warranty-twister-card:expanded")});d.on("PageRefresh:ATF",function(){var b=k(n.expanderData).data("toggle-warranty-twister-expander");b&&(h.initSubtitle({data:b}),m&&h.hideLoaderAnimation(!1))});d.declarative("toggle-warranty-twister-expander","click",function(b){k(n.expanderIcon).hasClass(p.hidden)||e(b)});d.on("warranty-twister-card:card-collapse",function(){console.log("Collapse trigger received for warranty card!");
a()});d.on("warranty-twister-card:reset-subtitle",function(){h.showPriceSubtitleInCollapsedView()});g.isAutoExpandEnabled&&(c=k(n.expanderData).data("toggle-warranty-twister-expander"))&&e({data:c})});"use strict";l.when("A").register("warranty-twister-expander-state",function(d){return{expanderSubtitle:{collapsedSubtitle:"",expandedSubtitle:"",collapsedPriceSubtitle:"",expandedPriceSubtitle:"",loadingSubtitle:"Loading options..."},get isLoaded(){return this.property},set isLoaded(d){this.property=
d}}});"use strict";l.when("A").execute(function(d){var h=!0;d.declarative("warranty-twister-plus-click-header","click",function(c){h&&(d.trigger("a:declarative:side-sheet:click",c),h=!1)});d.declarative("warranty-twister-plus-card-learn-more","click",function(c){d.trigger("a:declarative:side-sheet:click",c)})});"use strict";l.when("A","warranty-twister-expander-state","warranty-options-constants").register("warranty-twister-swatch-actions",function(d,h,c){var g=d.$,f=c.selector,a=c.styles,e=h.expanderSubtitle;
return{updateSwatchStyle:function(c){g(f.swatchBoxGroup).removeClass(a.selectedBoxGroup);g(f.swatchHeading).removeClass(a.selectedHeading);g(f.swatchHeading).addClass(a.unselectedHeading);var b=c.find(f.swatchHeading),e=c.find(f.swatchBoxGroup);1>e.length&&(e=c.parent(f.swatchBoxGroup));c=e;b.removeClass(a.unselectedHeading);b.addClass(a.selectedHeading);c.addClass(a.selectedBoxGroup)},updateDefaultOptionPriceSubtitle:function(a,b){e.collapsedPriceSubtitle=a;e.expandedPriceSubtitle=b;g(f.priceSubtitleText).text(b);
g(f.priceSubtitle).removeClass("a-color-success");g(f.priceSubtitle).addClass("a-color-tertiary");g(f.checkmark).addClass("a-hidden")},updateWarrantyOptionPriceSubtitle:function(a,b){e.collapsedPriceSubtitle=a;e.expandedPriceSubtitle=a;g(f.priceSubtitleText).text(a);g(f.priceSubtitle).removeClass("a-color-tertiary");g(f.priceSubtitle).addClass("a-color-success");g(f.checkmark).removeClass("a-hidden");g(f.cardImage).attr("src",b)}}});"use strict";l.when("A","warranty-twister-swatch-actions","warranty-card-utils",
"warranty-options-constants").execute(function(d,h,c,g){function f(b){1>k(a.expanderContainer).length||1>k(a.monthlyCheckbox).length||(1<Number(k(b.target).val())?(k(a.monthlyCheckbox).addClass(e.disabledOption),k(a.monthlyWarning).removeClass(e.hidden),(b=c.getSelectedCardData())&&b.isMonthlySubscription&&d.trigger("a:declarative:warranty-twister-default-action:click")):(k(a.monthlyCheckbox).removeClass(e.disabledOption),k(a.monthlyWarning).addClass(e.hidden)))}var a=g.selector,e=g.styles,k=d.$;
d.declarative("warranty-twister-default-action","click",function(){d.trigger("a:declarative:select-default-option:click");var b=d.$("[data-warranty-twister-default-action]");if(b!==r&&null!==b){var a=b.data("warranty-twister-default-action");h.updateSwatchStyle(b);h.updateDefaultOptionPriceSubtitle(a.defaultPriceSubtitle,a.expandedPriceSubtitle)}});d.declarative("warranty-option-swatch-select","click",function(b){var c=k(b.$currentTarget);if(c!==r&&null!==c){var f=c.children(a.warrantyOption)[0];
f===r&&(f=c.parent(a.warrantyOption)[0]);k(f).hasClass(e.disabledOption)||(d.trigger("a:declarative:select-warranty-option:click",b),h.updateSwatchStyle(c),h.updateWarrantyOptionPriceSubtitle("+"+b.data.warrantyPrice+" "+b.data.warrantyOptionPriceSubtitle,b.data.cardImageUrl))}});k(document).delegate("#mobileQuantityDropDown","change",function(b){f(b)});k(document).delegate("#quantity","change",function(b){f(b)})});"use strict";l.when("A","cc-warranty-options","warranty-options-csm").register("warranty-twister-actions",
function(d,h,c){function g(f,a){var e=d.$(f).closest(".warranty-secondary-view-container");f=e.find('input[name\x3d"baseAsin"]').val();var k=e.find('input[name\x3d"formIndex"]').val(),e=e.find('input[name\x3d"warrantyAsin"]').val();c.logInteractionToNexus({baseAsin:f,warrantyAsin:e},Number(k),a)}d.declarative("select-warranty-option","click",function(f){f=f.data;f.selectionType="add";f.warrantyQuantity=d.$("#quantity").val();c.increment(c.MetricNames.ccItemsSelectCount);c.logInteractionToNexus({baseAsin:d.$("#twister-plus-asin").val(),
warrantyAsin:f.warrantyAsin,customerId:f["warranty-customerID"]},f.formIndex,"wtyOptionSelect");h.updateWarrantyOptionSelection(f)});d.declarative("select-learn-more","click",function(f){var a=f.data;c.increment(c.MetricNames.ccLearnMore);c.logInteractionToNexus({baseAsin:d.$("#twister-plus-asin").val(),warrantyAsin:a.warrantyAsin,customerId:a["warranty-customerID"]},a.formIndex,c.InternalMetricConstants.LEARN_MORE_CLICK_METRIC_NAME);f.$event.preventDefault();f.$event.stopImmediatePropagation();d.trigger("a:declarative:side-sheet:click",
f)});d.$(document).delegate(".warranty-see-details","click",function(){g(this,"popoverProductDetailsClick")});d.$(document).delegate(".warranty-review-link","click",function(){g(this,"popoverReviewClick")});d.declarative("select-default-option","click",function(f){c.increment(c.MetricNames.defaultOptionSelectCount);f=f&&f.isUserClick;c.logInteractionToNexus({baseAsin:d.$("#twister-plus-asin").val(),warrantyAsin:c.InternalMetricConstants.NON_WARRANTY_ACTION_ASIN_PLACEHOLDER},c.InternalMetricConstants.NON_WARRANTY_OPTION_INDEX,
"noThanksSelect");h.clearOptionSelection(f)})});"use strict";l.when("A","wty:mbbModalHelper","wty:detailPage","a-checkbox","a-popover").register("wty:MbbItem",function(d,h,c,g,f){function a(b){b.stopPropagation();b.preventDefault()}function e(b,a,e){this._mbb=b;this._warrantyAsin=b._pageData.w[e].a;this._isSubscription=!!b._pageData.w[e].sub;this._index=e;this._row=a;this._quantity=c.findQuantityInput(a);this._offerListingIdSelection=c.findOfferListingIdInput(a);this._checkbox=a.find("input[type\x3dcheckbox]");
this._shortTitle=this._row.find(".mbb__st");this._modal=b._mbbFeature.find(".mbb__m:eq("+e+")");this._modalYes=this._modal.find(".mbb__yes");this._modalNo=this._modal.find(".mbb__no");this._modalLearnMore=this._modal.find(".mbb__learnMore");this._modalReviews=this._modal.find(".mbb__reviews");this._modalName="MbbModal-"+this._mbb._type.cssClass+this._index;var d=this;this._onShortTitle=function(){d._logReftag("st")};this._setChecked(!1);this._logReftag("i");this._bind()}var k=d.$;e.prototype._bind=
function(){this._bindQuantity();this._bindBuyBoxAccordion();this._bindModalYes();this._bindModalNo();this._bindShortTitle();this._bindCheckbox();this._bindModalLearnMore();this._bindModalReviews()};e.prototype._destroy=function(){this._unbindQuantity();this._unbindBuyBoxAccordion();this._unbindModalYes();this._unbindModalNo();this._unbindShortTitle();this._unbindCheckbox();this._unbindModalLearnMore();this._unbindModalReviews()};e.prototype.getAsin=function(){return this._warrantyAsin};e.prototype.getFormIndex=
function(){return this._index+this._mbb._baseFormIndex};e.prototype.getKvpIndex=function(){return this.getFormIndex()+1};e.prototype.getOfferListingId=function(){return this._offerListingIdSelection};e.prototype.isChecked=function(){return this._checkbox.prop("checked")};e.prototype.getQuantity=function(){return this._quantity.val()};e.prototype._setChecked=function(b){this._checkbox.prop("checked",b)};e.prototype._setSubscriptionQuantityRestricted=function(b){f.remove(this._shortTitle);var a=k(".a-accordion-active #MonthlyWarrantyWarning");
a.length||(a=k("#MonthlyWarrantyWarning"));var c=k(".warranties-monthly-checkbox");1<c.length&&(c=k(".a-accordion-active .warranties-monthly-checkbox"));b?(this._bindShortTitle(),g(this._checkbox).enable(),c.length&&c[0].closest(".mbb__r").classList.remove("monthly-warranty-text-disabled"),a.length&&a[0].classList.add("aok-hidden")):(g(this._checkbox).isChecked()&&a.length&&a[0].classList.remove("aok-hidden"),this._unbindShortTitle(),g(this._checkbox).uncheck(),g(this._checkbox).disable(),c.length&&
c[0].closest(".mbb__r").classList.add("monthly-warranty-text-disabled"),b={inlineContent:d.$("#popover-message").data("message"),position:"triggerLeft",closeButton:"false"},f.create(this._shortTitle,b))};e.prototype._setQuantity=function(b){this._quantity.val(b)};e.prototype._logReftag=function(b){var a=this._mbb._nexusLogger.convertMBBObjectsToWarrantyDataNexusPayload(this._mbb,this);"i"===b?this._mbb._nexusLogger.logWarrantyImpression(a):(a.action=b,this._mbb._nexusLogger.logWarrantyWidgetInteraction(a))};
e.prototype._bindModalYes=function(){var b=this;this._onModalYes=function(){b._logReftag("my");b._mbb._setChecked(b._index,!0);h.hide(b._modalName,b._isSubscription);c.handleBaselink(b);c.handleATC(b)};this._modalYes.bind("click",this._onModalYes)};e.prototype._unbindModalYes=function(){this._modalYes.unbind("click",this._onModalYes)};e.prototype._bindModalNo=function(){var b=this;this._onModalNo=function(){b._logReftag("mn");b._mbb._setChecked(b._index,!1);h.hide(b._modalName,b._isSubscription);
c.handleBaselink(b);c.handleATC(b)};this._modalNo.bind("click",this._onModalNo)};e.prototype._unbindModalNo=function(){this._modalNo.unbind("click",this._onModalNo)};e.prototype._bindShortTitle=function(){this._shortTitle.unbind("click",a);this._shortTitle.bind("click",this._onShortTitle);h.create(this._shortTitle,this._modalName,this._mbb._modalHeader,this._isSubscription)};e.prototype._unbindShortTitle=function(){this._shortTitle.unbind("click",this._onShortTitle);this._shortTitle.bind("click",
a);h.remove(this._modalName,this._isSubscription)};e.prototype._bindQuantity=function(){this._onQuantityChange=null;if(this._mbb._type.hasQuantity){var b=this;this._onQuantityChange=c.bindQuantityChange(function(a){a=a||1;b._setQuantity(a);if(b.isChecked()){var c=b._checkbox[0].form;c&&d.$(c).find("input[name\x3d'items[0.warranty][quantity]']").each(function(b,c){c.value=a})}})}};e.prototype._unbindQuantity=function(){c.unbindQuantityChange(this._onQuantityChange)};e.prototype._bindCheckbox=function(){var b=
this;this._onCheckboxChange=function(){var a=b.isChecked();b._mbb._setChecked(b._index,a);b._logReftag(a?"cy":"cn");c.handleBaselink(b);c.handleATC(b)};this._checkbox.bind("change",this._onCheckboxChange)};e.prototype._unbindCheckbox=function(){this._checkbox.bind("change",this._onCheckboxChange)};e.prototype._bindBuyBoxAccordion=function(){var a=this;this._onBuyBoxAccordion=c.bindBuyBoxAccordion(function(){a._setChecked(!1);c.handleBaselink(a);c.handleATC(a)})};e.prototype._unbindBuyBoxAccordion=
function(){c.unbindBuyBoxAccordion(this._onBuyBoxAccordion)};e.prototype._bindModalLearnMore=function(){var a=this;this._onModalLearnMore=function(){a._logReftag("learnMoreClick")};this._modalLearnMore.bind("click",this._onModalLearnMore)};e.prototype._unbindModalLearnMore=function(){this._modalLearnMore.unbind("click",this._onModalLearnMore)};e.prototype._bindModalReviews=function(){var a=this;this._onModalReviews=function(){a._logReftag("reviewsClick")};this._modalReviews.bind("click",this._onModalReviews)};
e.prototype._unbindModalReviews=function(){this._modalReviews.unbind("click",this._onModalReviews)};return e});"use strict";l.when("A","wty:MbbTypes","wty:Mbb").register("mbb",function(d,h,c){function g(){this._mbbs={}}var f=new g;d.on("mbb:loaded",function(a,e,k){var b=h.getType(k);if(b){var g=f._mbbs[k];g&&g._destroy();g=new c(a,e,b);f._mbbs[k]=g;d.trigger("mbb:ready",k)}});g.prototype.getMbb=function(a){return this._mbbs[a]};return f});"use strict";l.when("A","wty-nexus-constants").register("wty-nexus-logger",
function(d,h){var c={},g,f;c.nexusConstants=h;c.initialize=function(a,e){g=a;f=c.getDefaultPayload};c.convertMBBObjectsToWarrantyDataNexusPayload=function(a,c){return{deviceType:a._deviceType||null,baseItemAsin:a._baseItemAsin,baseItemQuantity:c._quantity.val(),baseItemCurrencySymbol:a._baseItemCurrencySymbol||null,baseItemBuyingPriceDecimal:a._baseItemBuyingPriceDecimal||null,warrantyAsin:c._warrantyAsin,warrantyCurrencySymbol:c._warrantyCurrencySymbol||null,warrantyBuyingPriceDecimal:c._warrantyBuyingPriceDecimal||
null,warrantyDisplayPosition:c._index+1}};c.populateCustomerIdIfNotPresent=function(a){if(a.customerId)return a;a.customerId=d.$("#warranty-customerID").val()||d.$("#attach-customerId").val()||null;return a};c.setPayloadBuilder=function(a){f=function(){var e=a();e.feature=g;e.obfuscatedMarketplaceId=q.ue_mid;e.producerId=c.nexusConstants.PRODUCER_ID;e.messageId=c.getRandomHexString();return e}};c.getDefaultPayload=function(){var a={};a.feature=g;a.obfuscatedMarketplaceId=q.ue_mid;a.producerId=c.nexusConstants.PRODUCER_ID;
a.messageId=c.getRandomHexString();return a};c.getRandomHexString=function(){return Date.now().toString(10)+Math.random().toString(16).substring(2,13)};c.logWarrantyAddToCart=function(a,e){e=c.nexusConstants.WARRANTY_ATC_SCHEMA_PREFIX+c.nexusConstants.WARRANTY_ATC_SCHEMA_VERSION;var d=f();a.feature&&(d.feature=a.feature);d.deviceType=a.deviceType;d.baseAsin=a.baseItemAsin;d.baseItemCurrencySymbol=a.baseItemCurrencySymbol||null;d.baseItemBuyingPriceDecimal=a.baseItemBuyingPriceDecimal||null;d.baseItemQuantity=
a.baseItemQuantity||null;d.asin=a.warrantyAsin;d.warrantyCurrencySymbol=a.warrantyCurrencySymbol||null;d.warrantyBuyingPriceDecimal=a.warrantyBuyingPriceDecimal||null;d.warrantyQuantity=a.warrantyQuantity||null;d.warrantyDisplayPosition=a.warrantyDisplayPosition;d.price="";c.log(d,e)};c.logWarrantyImpression=function(a){var d=c.nexusConstants.WARRANTY_IMPRESSION_SCHEMA_PREFIX+c.nexusConstants.WARRANTY_IMPRESSION_SCHEMA_VERSION,g=f();a.feature&&(g.feature=a.feature);g.customerId=a.customerId||null;
g.deviceType=a.deviceType;g.baseItemAsin=a.baseItemAsin;g.baseItemCurrencySymbol=a.baseItemCurrencySymbol||null;g.baseItemBuyingPriceDecimal=a.baseItemBuyingPriceDecimal||null;g.warrantyAsin=a.warrantyAsin;g.warrantyCurrencySymbol=a.warrantyCurrencySymbol||null;g.warrantyBuyingPriceDecimal=a.warrantyBuyingPriceDecimal||null;g.warrantyDisplayPosition=a.warrantyDisplayPosition;c.log(g,d)};c.logWarrantyWidgetInteraction=function(a){var d=c.nexusConstants.WARRANTY_WIDGET_INTERACTION_SCHEMA_PREFIX+c.nexusConstants.WARRANTY_WIDGET_INTERACTION_SCHEMA_VERSION,
g=f();a.feature&&(g.feature=a.feature);g.customerId=a.customerId||null;g.deviceType=a.deviceType;g.baseItemAsin=a.baseItemAsin;g.warrantyAsin=a.warrantyAsin;g.warrantyDisplayPosition=a.warrantyDisplayPosition;g.action=a.action;c.log(g,d)};c.log=function(a,d){q.ue&&q.ue.event&&(a=c.populateCustomerIdIfNotPresent(a),q.ue.event(a,c.nexusConstants.PRODUCER_ID,d,{ssd:!1}),p("NEXUS PAYLOAD: "+JSON.stringify(a)+" SCHEMA: "+d))};return c});"use strict";l.when("A","wty-nexus-logger","wty-nexus-constants").register("mbb-nexus-event-handler",
function(d,h,c){h.initialize(c.FEATURE_NAME_CONSTANTS.MBB,null);d.on("mbb:widget-interaction:nexus",function(c){c&&h.logWarrantyWidgetInteraction({baseItemAsin:c.baseAsin||null,warrantyAsin:c.serviceAsin||null,warrantyDisplayPosition:c.warrantyDisplayPosition,action:c.action,deviceType:c.deviceType||null})});d.on("mbb:impression:nexus",function(c){c&&h.logWarrantyImpression({baseItemAsin:c.baseAsin||null,warrantyAsin:c.serviceAsin||null,warrantyDisplayPosition:c.warrantyDisplayPosition,deviceType:c.deviceType||
null})});d.on("mbb:add-to-cart:nexus",function(c){c&&h.logWarrantyAddToCart({baseItemAsin:c.baseAsin||null,warrantyAsin:c.serviceAsin||null,warrantyDisplayPosition:c.warrantyDisplayPosition,deviceType:c.deviceType||null})})});"use strict";l.when("A").register("wty-nexus-constants",function(d){return{PRODUCER_ID:"warranties",WARRANTY_IMPRESSION_SCHEMA_PREFIX:"warranty.WarrantyImpressions.",WARRANTY_IMPRESSION_SCHEMA_VERSION:"4",WARRANTY_ATC_SCHEMA_PREFIX:"attach.AddWarrantyToCart.",WARRANTY_ATC_SCHEMA_VERSION:"5",
WARRANTY_WIDGET_INTERACTION_SCHEMA_PREFIX:"warranty.WidgetInteraction.",WARRANTY_WIDGET_INTERACTION_SCHEMA_VERSION:"3",FEATURE_NAME_CONSTANTS:{MBB:"MBB",SI:"SI",TWISTER_PLUS:"TWISTER_PLUS"},DEVICE_TYPE_CONSTANTS:{DESKTOP:"DESKTOP",MOBILE:"MOBILE",MOBILE_APP:"MOBILE_APP"}}})});
/* ******** */
(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",NEO_ATC:"NeoATC",PRODUCT_V2:"ProductV2"};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,l,k,m,p,h,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 h(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=m.getView({rootContainer:f,dealModel:c.dealModel});c.redemptionView=d.getView({rootContainer:f,setupData:a});c.appAccessView=p.getView({rootContainer:f,dealModel:c.dealModel,setupData:a});c.timerView=l.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 m=this.timerView.find(".timer-precise");if(0<b)c=a.find(".singular"),f=a.find(".plural"),k=f.find(".value"),a.show(),m.hide(),1===b?(c.show(),f.hide()):(c.hide(),f.show(),k.text(b));else{b=m.find(".timer-hours \x3e .value");var p=m.find(".timer-minutes \x3e .value"),h=m.find(".timer-seconds \x3e .value");a.hide();m.show();b.text(c.toString().padStart(2,"0"));p.text(f.toString().padStart(2,"0"));h.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))}};DealsX.timeNow=function(){if(performance)return Math.round(performance.now());DealsX.recordAPIMetrics({apiName:"client_latency_measure",isSuccess:!1,errorCode:"fallback_to_date"});return Date.now()}});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 m=0;m<c.length;m++)if(c[m].checked){f=e('div[id\x3d"mbbLD_feature_div"] input[name\x3d"asin.3'+
m+'"]').val();k=e('div[id\x3d"mbbLD_feature_div"] input[name\x3d"offeringID.3'+m+'"]').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,l={apiName:DealsX.ApiNames.CART_ADD_ITEMS},k=DealsX.timeNow();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){l.isSuccess=!0;l.latency=DealsX.timeNow()-k;DealsX.callIfFunctionWithMetrics(l,d,a,f._request)},error:function(a){l.isSuccess=!1;l.latency=DealsX.timeNow()-k;DealsX.recordAPIMetrics(l);if(a.hasOwnProperty("responseText")){var b=JSON.parse(a.responseText);
b.hasOwnProperty("type")&&b.type===DealsX.constants.AAPI_V1_ERROR_TYPE&&(l.errorCode=b.entity.status)}l.errorCode||(l.errorCode=a.status);DealsX.callIfFunctionWithMetrics(l,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,l,k){var d=this,e={apiName:DealsX.ApiNames.CLAIM_AND_ADD_TO_CART,isRetry:!1},h=DealsX.timeNow();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;e.latency=DealsX.timeNow()-h;DealsX.callIfFunctionWithMetrics(e,l,a.entity,d._request)},error:function(a){e.isSuccess=!1;e.latency=DealsX.timeNow()-h;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(m){var k=window.AmazonUIPageJS||window.P,E=k._namespace||k.attributeErrors,a=E?E("BurjDesktopAssets",""):k;a.guardFatal?a.guardFatal(m)(a,window):a.execute(function(){m(a,window)})})(function(m,k,E){m.when("jQuery","ready").register("action-panel-secondary-panel",function(a){function d(b,c){b&&c&&h[b]&&(a("#"+b+"_secondaryPanelHeadingText").text(c),h[b].heading=c)}function e(b,c){if(b&&c&&h[b]){var d=a("#"+c);a("#"+b+"_secondaryPanelHeadingContent").append(d);h[b].headingContentId=c}}function g(b,
c){if(b&&c&&h[b]){var d=a("#"+c);0<d.length&&(c!==h[b].contentId&&a("#"+h[b].contentId).addClass("aok-hidden"),a("#"+b+"_secondaryPanelContent").append(d),d.removeClass("aok-hidden"),h[b].contentId=c)}}function f(b){b&&h[b]&&a("#actionPanel,#superleafActionPanel").animate({left:"+\x3d420px"},400,"swing",function(){a("#"+b+"_secondaryPanel").addClass("aok-hidden");a("#"+b+"_secondaryPanelBackButton").removeClass("backButtonClickedState");"undefined"!==typeof a("#actionPanelWrapper,#superleafActionPanelWrapper")[0].style.setProperty&&
"function"===typeof a("#actionPanelWrapper,#superleafActionPanelWrapper")[0].style.setProperty&&a("#actionPanelWrapper,#superleafActionPanelWrapper")[0].style.setProperty("overflow","visible","important")})}var h={},c=function(b){a(this).addClass("backButtonClickedState");f(b.data.panelId)};return{init:function(b){if(b.panelId){h[b.panelId]=b;b.heading&&d(b.panelId,b.heading);b.headingContentId&&e(b.panelId,b.headingContentId);b.contentId&&g(b.panelId,b.contentId);var f=a("#"+b.panelId+"_secondaryPanelBackButton");
f.unbind("click",c);f.bind("click",{panelId:b.panelId},c);"0px"!==a("#actionPanel").css("left")&&a("#actionPanel").css("left","0px")}},setHeading:d,setHeadingContent:e,setContent:g,animateIn:function(b){b&&h[b]&&.5!==parseFloat(a("#"+b+"_secondaryPanel").closest(".feature").css("opacity"))&&(a("#actionPanelWrapper,#superleafActionPanelWrapper")[0]!==E&&"undefined"!==typeof a("#actionPanelWrapper,#superleafActionPanelWrapper")[0].style.setProperty&&"function"===typeof a("#actionPanelWrapper,#superleafActionPanelWrapper")[0].style.setProperty&&
a("#actionPanelWrapper,#superleafActionPanelWrapper")[0].style.setProperty("overflow","hidden","important"),a("#"+b+"_secondaryPanel").removeClass("aok-hidden"),a("#actionPanel,#superleafActionPanel").animate({left:"-\x3d420px"},400,"swing"))},animateOut:f}});m.when("jQuery","ready").register("elevatorFeature",function(a){var d,e,g,f,h,c,b,u=function(){k.pageYOffset>f?(d.addClass("stickyBar"),g.removeClass("aok-hidden"),e.removeClass("aok-hidden")):(d.removeClass("stickyBar"),g.addClass("aok-hidden"),
e.addClass("aok-hidden"))},v=function(){var c=k.pageYOffset,d,f;d=0;for(f=b.length;d<f;++d){var g=b[d],e=a(g.element);if(0<e.length){var n=e.offset().top-h-10,e=n+e.height(),l;c>=n-10&&c<=e+10?(a(g.selector).addClass("elevatorHighlight"),l=g.selector):a(g.selector).hasClass("elevatorHighlight")&&l!==g.selector&&a(g.selector).removeClass("elevatorHighlight")}}},z=function(a){if(0<a.length){var b=a.offset().top-h-10;t(b,a)}},t=function(b,d){var g=a(k).scrollTop(),f=Math.abs(g-b)+0,e=f/2E3*1E3,n=0>g-
b,l=!1,u=n?b-.2*f:b+.2*f;c=!0;a(".elevatorButton").removeClass("elevatorHighlight");a("html, body").animate({scrollTop:b},{duration:500>e?500:e,step:function(a,c){d&&!l&&(n?a>u:a<u)&&(l=!0,a=d.offset().top-h-10,b!==a&&(c.end=a))},complete:function(){c=!1;v()}})},r=function(c,d,g){var f=a(c);f.length?(b.push({selector:d,element:c}),a(d).click(function(){f=a(c);z(f)})):a(g).addClass("aok-hidden")},y=function(){var c=[];a("#beautyRecommendations").length&&c.push("#beautyRecommendations");a("#sims_fbt").length&&
c.push("#sims_fbt");a("#session-sims-feature, #fallbacksession-sims-feature").length&&c.push("#session-sims-feature, #fallbacksession-sims-feature");a("#purchase-sims-feature").length&&c.push("#purchase-sims-feature");if(c.length)c.sort(function(c,b){return a(c).offset().top-a(b).offset().top}),c.forEach(function(a){b.push({selector:"#elevatorRelatedProductsSection",element:a})}),a("#elevatorRelatedProductsSection").click(function(){for(var b=k.pageYOffset,d=0,f=c.length,g=null;null===g&&d<f;){var e=
a(c[d++]);0<e.length&&Math.floor(e.offset().top-h-10)>b&&(g=e)}null===g&&d===f&&(g=a(c[0]));z(g)});else{a("#elevatorRelatedProductsSection").addClass("aok-hidden");for(var d=a(".elevatorDividerSection"),g=!0,f=d.length-1;g&&0<=f;){var e=a(d[f]);e.hasClass("aok-hidden")?f--:(e.addClass("aok-hidden"),g=!1)}}},x=function(){a("#elevatorViewBuyingOptionsButton .a-button-inner").click(function(){t(a("#a-page .a-container").offset().top-10,null)})},l;m.when("page-refresh:page").execute(function(a){l=a});
var n=function(){if(l&&l.config){var b=!1,c;for(c in l.config)if(l.config[c].affectedFeatures&&(a(l.config[c].affectedFeatures).each(function(c,d){c=a(d);"none"!==c.css("display")&&"1"!==c.css("opacity")&&(b=!0)}),b))return!0}return!1},w=function(){if(n())setTimeout(function(){w()},200);else{d=a("#elevatorBar");e=a("#elevatorBarPlaceholder");g=a("#elevatorViewBuyingOptionsSection");f=d.position().top;h=d.height();b=[];var l=!1;c=!1;r("#productDescription, #product-description_feature_div, #product-description-iframe",
"#elevatorMoreAboutThisItemSection","#elevatorMoreAboutThisItemSection, #elevatorMoreAboutThisItemDivider");r("#detail-bullets, #prodDetails","#elevatorProductDetailsSection","#elevatorProductDetailsSection, #elevatorProductDetailsDivider");r("#quickPromoBucketContent","#elevatorSpecialOffersSection","#elevatorSpecialOffersSection, #elevatorSpecialOffersDivider");r("#cm_cr_dpwidget","#elevatorCustomerReviewsSection","#elevatorCustomerReviewsSection, #elevatorCustomerReviewsDivider");y();x();a(k).resize(function(){f=
d.position().top});a(k).scroll(function(){l=!0});setInterval(function(){l&&(l=!1,u(),c||v())},100);u();v()}};return{init:w}});"use strict";m.when("A","a-popover","actionpanel-modified-popover","cf").register("sns-frequency-dropdown",function(a,d,e){var g=a.$;return{init:function(){g("#sns-frequency-button").length&&(new e("sns-frequency-dropdown-popover",g("#sns-frequency-button")),a.declarative("sns-frequency-update","click",function(a){var e=a.$target.parents("li");a=a.data.frequency;e.siblings().removeClass("sns-selected-frequency");
e.addClass("sns-selected-frequency");g("#rcxOrdFreq").val(a);g("#sns-frequency-button-label").text(e.text());d.get("sns-frequency-dropdown-popover").hide()}),a.declarative("sns-frequency-dropdown-popover-close","click",function(a){d.get("sns-frequency-dropdown-popover").hide()}))}}});m.when("jQuery","action-panel").register("mom-checkbox",function(a,d){return{init:function(){var e=a("#addToCart"),g=e.attr("action");a("#chkMom").change(function(){if(a("#chkMom").length){var f;a("#chkMom").is(":checked")?
(e.attr("action","/gp/family/pipeline/view-signup/"),f="mom"):(e.attr("action",g),f="sns");d.setPanelState({mode:f})}});a("#chkMom").length&&a("#chkMom").is(":checked")&&a("#chkMom").attr("checked",!1)}}});m.when("jQuery","A").register("twister-aui-page-state",function(a,d){var e="beautyRecommendations bRecDynamicStrings csxfsSecondaryPanelSettings ccxsmartShelfSecondaryPanelSettings accessoryInfo smartShelfVASInfo".split(" ");return{updatePageState:function(){var g=d.parseJSON;d.each(a('script[type\x3d"a-state"]'),
function(f){f=a(f);if(!f.data("a-eval")){var h=f.attr("data-a-state");if(h&&(h=g(h),h.key&&-1!==a.inArray(h.key,e))){var c=g(f.html());d.state.replace(h.key,c);f.data("a-eval",!0)}}})}}});m.when("A","skinToneSelector","scenesAjaxHandler","colorScenesSlider","colorScenesCarousel","ready").register("colorScenes",function(a,d,e,g,f){function h(){O=!0;F.addClass("aok-hidden");G.removeClass("aok-hidden");m.addClass("aok-hidden");T.initCarousel();k.CounterScenesController&&r(k.CounterScenesController.getCounterSelection());
a.trigger("colorScenes:expandCounter");q&&q.count&&q.count("colorScenesShowScene",1)}function c(){G.addClass("aok-hidden");m.removeClass("aok-hidden");F.removeClass("aok-hidden");O=!1;p(k).resize()}function b(){O?c():h();q&&q.count&&q.count("colorScenesClickCounterIngress",1)}function u(){var a=T.getCarouselWidth(),c=E.getSlideTrackWidth();X=a/c;Y=c/a}function v(a,c,b){u();E.moveSlider(-a*Y,c,b)}function z(a,c){u();U.hideWhenClickOutside();T.moveCarouselByX(-a*X,c,!1,!1)}function t(a,c){T.updateImagePosition(R[a],
R[c])}function r(a){O&&T.selectCarouselItemAtIndex(a,!1);x(a-1)}function y(c){Z||(a.trigger("colorScenes:expandCounter"),a.trigger("colorScenes:select",c),x(c+1))}function x(a){M&&a!==H&&(I.css("background-image",'url("'+V[B[a]]+'")').fadeTo(300,1),H=a)}function l(a,c,b){p.each(a,function(a,d){"missingSkinTones"!==a&&"placeHolderImageId"!==a&&(p("#carouselSceneImage_"+a).css("background-image",'url("'+d+'")').fadeTo(300,1),V[a]=d,c&&("function"===typeof A&&A("cf","colorScenesFetchImages",{wb:1}),
I.css("background-image",'url("'+d+'")').fadeTo(300,1),p("#colorScenesIngressLeftImg").delay(300).animate({"margin-right":"25px"},300,"linear")),b&&"function"===typeof J&&(J("ld","colorScenesFetchImages",{wb:1}),J("ld","colorScenesFeature",{wb:1})))})}function n(){K.click(function(a){h();q&&q.count&&q.count("colorScenesClickIngressButton",1)});W.click(function(a){c();q&&q.count&&q.count("colorScenesClickBackButton",1)});N.length&&N.click(b)}function w(c){if(c[L]){"function"===typeof A&&A("cf","colorScenesIsEnabled",
{wb:1});F=p("#imageBlock_feature_div");K=p("#colorScenesIngressButton");I=p("#colorScenesIngressImages").children();m=p("#colorScenesIngressContainer");G=p("#colorScenesStage");W=p("#colorScenesBackArrowImage");N=p("#counterColorScenesIngress");c=1;k.CounterScenesController&&(c=k.CounterScenesController.getCounterSelection());T=new f(c);a.on("scenesCarousel:select",y);1<B.length?(E=new g,a.on("scenesCarousel:sync",v),a.on("scenesSlider:sync",z)):p("#colorSceneSliderSection").addClass("aok-hidden");
U=new d(S);a.on("skinToneSelector:select",t);"function"===typeof A&&A("bb","colorScenesFetchImages",{wb:1});var b=H;c=b-7;var e=H+1,h=e+7,u=B.length;for(D.getSceneInfo(B[H],l,!0,!1);0<=c||h<u;)0<=c&&(b=B.slice(c,b).toString(),D.getSceneInfo(b,l,!1,!1),b=c,c-=7),h<u&&(e=B.slice(e,h).toString(),D.getSceneInfo(e,l,!1,!1),e=h,h+=7);0<b&&e<u?(b=B.slice(0,b).toString(),D.getSceneInfo(b,l,!1,!1),e=B.slice(e,u).toString(),D.getSceneInfo(e,l,!1,!0)):0<b?(b=B.slice(0,b).toString(),D.getSceneInfo(b,l,!1,!0)):
e<u&&(e=B.slice(e,u).toString(),D.getSceneInfo(e,l,!1,!0));n();M=!0;m.removeClass("aok-hidden");K.removeClass("aok-hidden");N.removeClass("aok-hidden");"function"===typeof J&&J("ld","colorScenesIsEnabled",{wb:1});"function"===typeof A&&A("cf","colorScenesFeature",{wb:1});q&&q.count&&q.count("colorScenesShowIngress",1)}}var p=a.$,q=k.ue,A=k.uet,J=k.uex,F,m,K,I,G,W,N,O,M=!1,D,L,H,B,V={},P,C,U,S,R,Z,Y,X,E,T;return{init:function(a){L=a.parentAsin;B=a.variationAsins;L&&B&&0<B.length&&(H=a.currentAsinIndex,
P=a.isEnabledEndPoint,C=a.infoEndPoint,R=a.skinToneToPositionCssClass,S=a.defaultSkinTone,Z=a.isSingletonCase,"function"===typeof A&&A("bb","colorScenesFeature",{wb:1}),D=new e(P,C),"function"===typeof A&&A("bb","colorScenesIsEnabled",{wb:1}),D.checkIsEnabled(L,w))},selectSceneItem:r}});m.when("A").execute(function(a){k.CounterScenesController=new function(){function d(a,b,d){if("string"===typeof b||"number"===typeof b)"string"===typeof b&&(b=parseInt(b,10)),d?e(a,b+1):e(a,b-1)}function e(a,b){h||
"function"!==typeof a||(h=!0,"undefined"!==typeof b?a(b):a(),h=!1)}var g,f,h;this.registerCounter=function(a){"object"===typeof a&&a?g=a:k.ueLogError&&k.ueLogError({message:"[Failed to register Counter Twister with CounterScenesController]"},{logLevel:"ERROR",attribution:"counter_scenes_controller_register_counter_error"})};this.registerColorScene=function(a){"object"===typeof a&&a?f=a:k.ueLogError&&k.ueLogError({message:"[Failed to register Color Scene with CounterScenesController]"},{logLevel:"ERROR",
attribution:"counter_scenes_controller_register_scene_error"})};this.getCounterSelection=function(){return g?g.getCurrentSelectedIndex()+1:1};f=g=null;h=!1;a.on("colorScenes:expandCounter",function(){g&&e(g.expandCounter)});a.on("colorScenes:select",function(a){g&&d(g.selectCounterVariationAtIndex,a,!1)});a.on("counter:select",function(a){f&&d(f.selectSceneItem,a,!0)})}});m.when("A").register("skinToneSelector",function(a){return function(d){function e(){v.addClass("aok-hidden");u.removeClass("aok-hidden");
t=!1}function g(a){u.addClass("aok-hidden");v.removeClass("aok-hidden");c(k).click(h.hideWhenClickOutside);t=!0;b&&b.count&&b.count("colorScenesOpenSkinTone",1);a.preventDefault();a.stopPropagation();return!1}function f(d){var g=d.target.id,f=z.attr("id");d=c(d.target);g!==f&&z.removeClass("selectedSkinTone");d.addClass("selectedSkinTone");a.trigger("skinToneSelector:select",g,f);z=d;e();b&&b.count&&b.count(r[g],1)}var h=this,c=a.$,b=k.ue,u,v,z,t=!1,r={skinTone_10:"colorScenesSelectSkinTone10",skinTone_20:"colorScenesSelectSkinTone20",
skinTone_30:"colorScenesSelectSkinTone30",skinTone_40:"colorScenesSelectSkinTone40",skinTone_50:"colorScenesSelectSkinTone50"};h.hideWhenClickOutside=function(){t&&(e(),c(k).unbind("click",h.hideWhenClickOutside),t=!1)};(function(b){u=c("#colorSceneSkinToneButton");v=c("#skinTonePanel");z=c("#"+b);z.addClass("selectedSkinTone");a.trigger("skinToneSelector:select",b,null);u.click(g);c(".skinToneColor").click(f)})(d)}});m.when("A").register("scenesAjaxHandler",function(a){return function(d,e){function g(a,
b,d){if(!a||0===a.length)throw Error(b+" is null or empty for "+d);}var f,h;this.getSceneInfo=function(c,b,d,e){g(c,"asinList","getSceneInfo");var f=h+c;a.ajax(f,{method:"get",success:function(a,c,g){"function"===typeof b&&b(a,d,e)},error:function(){k.ueLogError&&k.ueLogError({message:"[Failed to load sprite images from"+f+" ]"},{logLevel:"ERROR",attribution:"color_scenes_throwing_the_error"})}})};this.checkIsEnabled=function(c,b){g(c,"parentAsin","checkIsEnabled");var d=f+c;a.ajax(d,{method:"get",
success:function(a,c,d){"function"===typeof b&&b(a)},error:function(){k.ueLogError&&k.ueLogError({message:"[Failed to determined if colorscene is enabled for "+c+" with url "+d+" ]"},{logLevel:"ERROR",attribution:"color_scenes_is_enabled_throwing_the_error"})}})};(function(a,b){g(a,"checkEnabledEndpoint","init");g(b,"loadImagesEndpoint","init");f=a;h=b})(d,e)}});m.when("A","a-carousel-framework","scenesMoveEventUtil","scenesFlickVelocity").register("colorScenesCarousel",function(a,d,e,g){return function(f){function h(){return C}
function c(){M=K.first().width();D=K.first().outerWidth(!0)-M;N=K.first().position().left;O=K.last().position().left;L=N-q/2+D+M/2;H=O-q/2+D+M/2;var a=Q.find(".selectedCarouselItem");V=0<a.length?a.width()-M-2*D:0;B=H-L}function b(a){P=!1;e.bind(v,u);U=e.getClientX(a);R.startFlickVelocityTracking();S=C;a.preventDefault();a.stopPropagation();return!1}function u(a){e.unbind(v,u);R.triggerFlickVelocityMove();y();a.preventDefault();a.stopPropagation();return!1}function v(a){var b=e.getClientX(a),c=b-
U;U=b;l.moveCarouselByX(c,!0,!1,!1);P=!0;a.preventDefault();a.stopPropagation();return!1}function m(b){if(!P||5>=Math.abs(Math.abs(S-C))){var c=b.data.index;l.selectCarouselItemAtIndex(b.data.index,!1);a.trigger("scenesCarousel:select",c);w&&w.count&&w.count("colorScenesClickSceneImage",1)}P=!1}function t(a){l.moveCarouselByX(a,!0,!1,!1)}function r(){return C>L&&C<H}function y(){Math.abs(S-C)&&w&&w.count&&w.count("colorScenesCarouselMove",Math.abs(S-C))}function x(){d.onInit("colorScenes",function(b){c();
C=L;G=n(I[E-1]);G.addClass("selectedCarouselItem");G.siblings(".sceneImageNamePlate").addClass("selectedCarouselItem");l.selectCarouselItemAtIndex(E,!1);a.on("a:carousel:colorScenes:repaint",function(a){l.selectCarouselItemAtIndex(E,!0)})})}var l=this,n=a.$,w=k.ue,p,q,A,J,F,Q,K,I,G,E,N,O,M,D,L,H,B,V,P,C,U,S,R;l.getCarouselWidth=function(){return B};l.moveCarouselByX=function(b,d,e,g){C-=b;c();C<L?C=L:C>H&&(C=H);e?F.gotoPixel(C,{animationDuration:0}):500<Math.abs(b)?F.gotoPixel(C,{animationDuration:400}):
F.gotoPixel(C);d&&a.trigger("scenesCarousel:sync",b,!d,g)};l.selectCarouselItemAtIndex=function(a,b){c();var d=q/2-N-D-M/2+V,d=F.getItemOffset(a)-d;l.moveCarouselByX(C-d,!0,b,!0);E=a;a=n(I[a-1]);G.attr("id")!==a.attr("id")&&(G&&(G.removeClass("selectedCarouselItem"),G.siblings(".sceneImageNamePlate").removeClass("selectedCarouselItem")),a.addClass("selectedCarouselItem"),a.siblings(".sceneImageNamePlate").addClass("selectedCarouselItem"),G=a)};l.updateImagePosition=function(a,b){I.removeClass(b).addClass(a)};
l.resizeCarouselContainer=function(){A.width(p.parent().width());q=p.width()};l.initCarousel=function(){l.resizeCarouselContainer();d.initializeAll()};(function(c){P=!1;R=new g(t,y,r,h);E=c;p=n("#leftCol");q=p.width();A=n("#colorScenesCarouselSection");J=n("#colorScenesCarouselContainer");Q=J.find(".a-carousel");K=Q.children();F=d.getCarouselByName("colorScenes");I=n(".carouselSceneImage");x();I.mousedown(b);"undefined"!==typeof k.ontouchstart&&I.bind("touchstart",b);c=I;for(var e=0;e<c.length;e++)n(c[e]).bind("click",
{index:e+1},m),"undefined"!==typeof k.ontouchend&&n(c[e]).bind("touchend",{index:e+1},m);a.on.resize(l.resizeCarouselContainer);a.on.orientationchange(l.resizeCarouselContainer)})(f)}});m.when("A","scenesMoveEventUtil","scenesFlickVelocity").register("colorScenesSlider",function(a,d,e){return function(){function g(a){d.bind(h,f);y=d.getClientX(a);A.startFlickVelocityTracking();l=x;a.preventDefault();a.stopPropagation();return!1}function f(a){d.unbind(h,f);A.triggerFlickVelocityMove();b();a.preventDefault();
a.stopPropagation();return!1}function h(a){var b=d.getClientX(a),c=b-y;y=b;u.moveSlider(c,!0,!1);a.preventDefault();a.stopPropagation();return!1}function c(a){if(t[0]===a.target){y=r.offset().left;var b=d.getClientX(a),c=b-y-p/2;y=b;u.moveSlider(c,!0,!0);v&&v.count&&v.count("colorScenesClickSlider",c);a.preventDefault();a.stopPropagation();return!1}}function b(){var a=Math.abs(l-x);a&&v&&v.count&&v.count("colorScenesSliderMove",a)}var u=this,v=k.ue,m=a.$,t,r,y,x,l,n,w,p,q,A;u.getSlideTrackWidth=function(){return q};
u.moveSlider=function(b,c,d){if(0!==Math.abs(b)){var e=x+b;e>w&&(e=w);e<n&&(e=n);x=e;d?r.animate({left:e},200):r.css("left",e);c&&a.trigger("scenesSlider:sync",b,!1)}};A=new e(function(a){u.moveSlider(-a,!0,!1)},b,function(){return x>n&&x<w},function(){return x});t=m("#colorSceneSliderBar");r=m("#colorSceneSlider");a.capabilities.touch&&(t.css("height","8px"),r.css("height","15px"));p=r.outerWidth();x=-p/2;r.css("left",x);n=-p/2;w=t.outerWidth()-p/2;q=w-n;r.mousedown(g);t.click(c);"undefined"!==typeof k.ontouchstart&&
(r.bind("touchstart",g),t.bind("touchstart",c))}});m.when("A").register("scenesFlickVelocity",function(a){return function(d,e,g,f){function h(a,b){if("function"!==typeof a)throw Error(b);}var c=this,b,k,m,z,t,r,y,x,l;c.startFlickVelocityTracking=function(){k=b=0;m=Date.now();z=t();clearInterval(r);r=setInterval(c.computeFlickVelocity,50)};c.computeFlickVelocity=function(){var a,c;a=Date.now();c=a-m;m=a;a=t()-z;z=t();c=1E3*a/(1+c);b=.8*c+.2*c};c.triggerFlickVelocityMove=function(){clearInterval(r);
50<Math.abs(b)&&(k=.05*b,m=Date.now(),a.requestAnimationFrame(c.flickVelocityMove))};c.flickVelocityMove=function(){var b;k&&(b=Date.now()-m,b=-k*Math.exp(-b/500),1<Math.abs(b)&&l()?(y(b),a.requestAnimationFrame(c.flickVelocityMove)):x())};(function(a,b,c,d){h(a,"moveRefFn is null or undefined for FlickVelocityController.");h(c,"checkLimitRefFn is null or undefined for FlickVelocityController.");h(d,"getFrameRefFn is null or undefined for FlickVelocityController.");y=a;x=b;l=c;t=d})(d,e,g,f)}});m.when("A").register("scenesMoveEventUtil",
function(a){function d(a,d){e(k).unbind("mousemove",a).unbind("mouseup",d);"undefined"!==typeof k.ontouchmove&&e(k).unbind("touchmove",a).unbind("touchend",d)}var e=a.$;return{bind:function(a,f){d(a,f);e(k).bind("mousemove",a).bind("mouseup",f);"undefined"!==typeof k.ontouchmove&&e(k).bind("touchmove",a).bind("touchend",f)},unbind:d,getClientX:function(a){return a.originalEvent&&a.originalEvent.targetTouches&&0<a.originalEvent.targetTouches.length?a.originalEvent.targetTouches[0].clientX:a.clientX}}});
m.when("A","atf").register("smart-shelfT1",function(a){function d(b,c,d,e){a.$("#ASIN").val(b);a.$("#offerListingID").val(c);a.$("#isAddOn").val(d);a.$("#quantity").val(e);p.submit();a.$("#ASIN").val(W);a.$("#offerListingID").val(N);a.$("#isAddOn").val(O);a.$("#quantity").val(q)}function e(a,b){G&&G.count&&G.count(a,b)}function g(){h();a.$("body").delegate("#add-to-cart-button","click",L);m.click(function(){a.$("#addToCart").prop("action","/gp/consumables/add-to-cart-ajax.html/ref\x3ddp_csx_sw_atc_0");
d(n.asin,n.offerId,n.addOn,1);m.addClass("aok-hidden");r.removeClass("aok-hidden");e("smartShelfAccessoriesAdded",1)});v.click(function(){a.$("#addToCart").prop("action","/gp/consumables/add-to-cart-ajax.html/ref\x3ddp_csx_sw_atc_1");d(n.asin1,n.offerId1,n.addOn1,1);v.addClass("aok-hidden");y.removeClass("aok-hidden");e("smartShelfAccessoriesAdded",1)});z.click(function(){a.$("#addToCart").prop("action","/gp/consumables/add-to-cart-ajax.html/ref\x3ddp_csx_sw_atc_2");d(n.asin2,n.offerId2,n.addOn2,
1);z.addClass("aok-hidden");x.removeClass("aok-hidden");e("smartShelfAccessoriesAdded",1)});t.click(function(){a.$("#addToCart").prop("action","/gp/consumables/add-to-cart-ajax.html/ref\x3ddp_csx_sw_atc_w");d(n.warrantyAsin,n.warrantyOfferId,!1);t.addClass("aok-hidden");l.removeClass("aok-hidden")});a.$("body").undelegate("#add-to-cart-button","click.siatc");a.$("body").undelegate("#add-to-cart-button","click.vaswarrantysiatc")}function f(){F=[];w=a.state("smartShelfVASInfo");m=a.$(".csxsw_item_atc");
v=a.$(".csxsw_item1_atc");z=a.$(".csxsw_item2_atc");t=a.$(".csxsw_warranty_atc");r=a.$(".csxsw_item_success");y=a.$(".csxsw_item1_success");x=a.$(".csxsw_item2_success");l=a.$(".csxsw_warranty_success");p=a.$("#addToCart");Q=b=!1;var d=a.$("#"+J+"_secondaryPanelBackButton");n.showBackButton&&"false"!==n.showBackButton?d.click(function(){b=!1}):d.addClass("aok-hidden");c=a.$("#"+J+"_actionPanelSecondaryPanelDivider");c.addClass("smartShelfDivider");c.removeClass("actionPanelSecondaryPanelDivider");
w!==E&&w.hideSmartShelf||(a.$("#add-to-cart-button"),g())}function h(){a.$("body").undelegate("#add-to-cart-button","click",B);a.$("body").undelegate("#add-to-cart-button","click",L)}var c,b,m,v,z,t,r,y,x,l,n,w,p,q,A,J,F,Q,K,I,G=k.ue,W=a.$("#ASIN").val(),N=a.$("#offerListingID").val(),O=a.$("#isAddOn").val(),M=function(){if(!b&&.5!==parseFloat(a.$("#"+J+"_secondaryPanel").closest(".feature").css("opacity"))){q=a.$("#quantity").val();Q||(e("smartShelfAccessoriesSeen",n.numberOfAccessories),e("smartShelfShowSecondaryPanel",
1),Q=!0);var c=a.$("#addToCart").find(".abbListItem");c.length&&c.each(function(b){b=a.$(this).find("input[id^\x3d'mbb-offer']");var c=a.$(this).find("input[name^\x3d'asin']");c.length&&this.removeChild(c[0]);b[0].checked&&c.length&&(a.$("#csxswWarrantyInclude").addClass("aok-hidden"),F.push([c[0].value,b[0].value]))});if(a.$("#addToCart").find(".atcFormServiceAsinData").length){var c=a.$("#addToCart").find(".atcFormServiceAsinData[name^\x3d'asin']"),d=a.$("#addToCart").find(".atcFormServiceAsinData[name^\x3d'offeringID']");
c.length&&d.length&&F.push([c.val(),d.val()])}a.$("#freeSampleOfferListingID").val()&&""!==a.$("#freeSampleOfferListingID").val()&&F.push([a.$("#csxfsSelectedAsin").val(),a.$("#freeSampleOfferListingID").val()]);A.animateIn(J);b=!0}},D=function(b){a.$("#addToCart").submit(function(b){a.$.ajax({type:a.$("#addToCart").attr("method"),url:a.$("#addToCart").attr("action"),data:a.$("#addToCart").serialize(),success:function(b){var c=a.$.parseJSON(b);c&&!c.error&&(F.length?(b=F.pop(),d(b[0],b[1],!1,1)):
c.cartCount&&k.$Nav&&k.$Nav.when("api.setCartCount").run(function(a){a(c.cartCount)}))}});b.preventDefault()})},L=function(){if(a.$("#smartShelfDP_feature_div").children().length||a.$("#smartShelfContent_feature_div").children().length){if("false"!==n.changeForm||a.$("#actionPanel").hasClass("ap-onetime")||a.$("#regularBuybox").hasClass("a-accordion-active")||a.$("#oneTimeBuyBox").hasClass("a-accordion-active")){var b="";p.length&&null!==p.prop("action")&&(b=p.prop("action"));var c="",d=b.search("ref\x3d");
p.length&&-1!==d&&(c=b.substr(d,b.length));b="/gp/consumables/add-to-cart-ajax.html/"+c;a.$("#addToCart").prop("action",b)}M();D()}},H=function(){I++;3>I&&B()},B=function(b){K||(b.preventDefault(),a.$.ajax({timeout:5E3,url:"/gp/smartshelf/utility/trigger",success:function(b,c,d){var e;if(b&&b!==E&&""!==b.trim())try{var g=JSON.parse(b.trim());K="T1"===g.treatment||"C"===g.treatment;e="T1"===g.treatment}catch(h){H()}K?(e&&f(),a.$("#add-to-cart-button").click()):H()},error:function(a,b,c){H()}}))};return{init:function(b,
c){h();K=!1;I=0;A=b;J=c;n=a.state("accessoryInfo");"true"===n.doTrigger?a.$("body").delegate("#add-to-cart-button","click",B):f()},undelegateATC:h}});"use strict";m.when("A","jQuery","pantryEnhancementMetrics").execute("dpv2-pantryEnhancement-metrics",function(a,d,e){e.registerCounters()});m.when("A","jQuery").register("pantryEnhancementMetrics",function(a,d){return{registerCounters:function(){var a=d("#pantry-store-message");a.length&&a.bind("click",function(a){if(a=k.ue){var d=a.count("pantryStoreMessageClick")||
0;a.count("pantryStoreMessageClick",d+1)}})}}});"use strict";m.when("A","jQuery","dualDimMetrics","atf").execute("dualdimInfo-metrics",function(a,d,e){d(".dualDim-Swatch").length&&e.registerCounters()});m.when("A","jQuery","atf").register("dualDimMetrics",function(a,d){function e(a){var d=k.ue;if(d){var e=d.count(a)||0;d.count(a,e+1)}}return{registerCounters:function(){var a=d(".vodd-dim-wrapper").length,f=d(".twisterShelf_container").length,h=d(".twisterCounter_container").length;e("DualDimCount");
1===a&&1===f+h?(e("DualDimOneVoddCount"),1===f?e("DualDimVoddShelfCount"):1===h&&e("DualDimVoddCounterCount")):2===a?e("DualDim2VoddCount"):2===f?e("DualDimShelfCount"):2===h?e("DualDimCounterCount"):2===f+h&&e("DualDimShelfCounterCount")}}});m.when("A","action-panel","ready").register("aposWithBB",function(a,d){var e={mode:"onetime"},g={mode:"sns"},f={mode:"sampling"};return{init:function(){a.on("a:accordion:buybox-accordion:onetime-accordion:select",function(a){d.setPanelState(e)});a.on("a:accordion:buybox-accordion:sns-accordion:select",
function(a){d.setPanelState(g)});a.on("a:accordion:buybox-accordion:sampling-accordion:select",function(a){d.setPanelState(f)})}}});m.when("A","jQuery","ready","atf").execute(function(a,d){m.register("stickybuybox",function(){function e(){a.off("scroll",c);f();l=!1}function g(){var f=d("#csxfsSelectSampleButton"),g=d("input:radio[name\x3dtoggleBuyBox]");y.click(e);a.declarative("single-sample-widget-open-secondary-panel","click",e);f.click(e);g.change(function(){setTimeout(h,200)});d(k).resize(b);
a.on("TwisterShelfExpanded",h);a.on("TwisterShelfCollapsed",h);a.on("TwisterCounterExpanded",h);a.on("TwisterCounterCollapsed",h);a.on.scroll(c)}function f(){w.removeClass("stickybuybox");p.removeClass("stickybuybox");q.removeClass("stickybuybox")}function h(){f();v=r.offset();m=y.offset();z=x.offset();c()}function c(){var a=d(k).scrollTop(),b=d(k).scrollLeft(),c=t+a-38,e=n.offset().left,a=m?c-m.top:0,f=v?c-v.top:0,c=z?c-z.top:0;l&&(b=e-b,v&&0>f?(w.addClass("stickybuybox"),w.css({left:b+"px"})):(w.removeClass("stickybuybox"),
m&&!v&&0>a?(p.addClass("stickybuybox"),p.css({left:b+"px"})):(p.removeClass("stickybuybox"),z&&0>c?(q.addClass("stickybuybox"),q.css({left:b+"px"})):q.removeClass("stickybuybox"))))}function b(){t=d(k).height();c()}var m,v,z,t,r,y,x,l=!0,n=d("#actionPanel"),w,p,q;return{init:function(){r=d(".a-button-oneclick");y=d("#submit\\.add-to-cart").not(".a-button-preorder");x=d("#rcx-subscribe-submit-button");w=r.parent();p=y.parent();q=x.parent();t=d(k).height();h();g()}}})})});
/* ******** */
(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(f){var g=window.AmazonUIPageJS||window.P,h=g._namespace||g.attributeErrors,e=h?h("VasDPInstrumentationMetrics",""):g;e.guardFatal?e.guardFatal(f)(e,window):e.execute(function(){f(e,window)})})(function(f,g,h){f.register("vas-dp-instrumentation-config",function(){return{SCHEMA_ID:"vas.instrumentation.metrics.VasInstrumentationMetrics.5",PRODUCER_ID:"vas-discovery"}});f.register("vas-dp-postal-code-format-config",function(){return{BRITISH_FORMAT:["gb","ca"]}});f.register("vas-dp-instrumentation-get-marketplace",
function(){return{marketplace:"gb"}});f.register("vas-dp-instrumentation-exception-logger",function(){return{logDataTypeException:function(e,b){b={message:"Incorrect data type for param: "+b};"undefined"!==typeof g.ueLogError&&ueLogError(b,{logLevel:"WARN",attribution:"Vas dp instrumentation metricId: "+e})}}});f.when("A","vas-dp-instrumentation-get-marketplace","vas-dp-postal-code-format-config").register("vas-dp-instrumentation-postal-code-formatter",function(e,b,d){return{format:function(c){var a=
c;-1!==e.indexOfArray(d.BRITISH_FORMAT,b.marketplace)&&(c=c.split(" "),a="",1<c.length&&2<=c[0].length&&4>=c[0].length&&(a=c[0]+" "+c[1][0]));return a}}});f.register("vas-dp-instrumentation-time-formatter",function(){var e=function(b){return(10>b?"0":"")+b};return{formatTime:function(b){return b.getFullYear()+"-"+e(b.getMonth()+1)+"-"+e(b.getDate())+" "+e(b.getHours())+":"+e(b.getMinutes())+":"+e(b.getSeconds())}}});f.when("vas-dp-instrumentation-config","vas-dp-instrumentation-time-formatter").register("vas-dp-instrumentation",
function(e,b){return{DetailPageInstrumentation:function(d){this.pagePath=location.href;this.customerLocalTime=b.formatTime(new Date);this.metricId=d.metricId;this.obfuscatedCustomerId=d.obfuscatedCustomerId||"";this.widgetName=d.widgetName||"";this.productAsin=d.productAsin;this.productPrice=d.productPrice;this.selectedUpsellAsin=d.selectedUpsellAsin;this.selectedUpsellPrice=d.selectedUpsellPrice;this.upsellAsins=d.upsellAsins;this.postalCode=d.postalCode;this.merchantId=d.merchantId;this.pageType=
d.pageType||"LocalServicesWidget";this.subPageType=d.subPageType||"Impression";this.hitType=d.hitType||"popUp";this.isCritical=d.isCritical;this.deviceType=d.deviceType;this.promo=d.promo;this.isMbcClick=d.isMbcClick;this.isBuyBoxAvailable=d.isBuyBoxAvailable;this.deviceType=d.deviceType;this.postPurchaseUID=d.postPurchaseUID;this.experimentalData=d.experimentalData;this.payload=function(){var b={},a;for(a in this)"function"!==typeof this[a]&&(b[a]=this[a]);return b};this.publishMetrics=function(){g.ue&&
ue.event&&"undefined"!==typeof this.metricId&&ue.event(this.payload(),e.PRODUCER_ID,e.SCHEMA_ID)}}}});f.when("vas-dp-instrumentation","vas-dp-instrumentation-exception-logger","vas-dp-instrumentation-postal-code-formatter").register("vas-dp-instrumentation-builder",function(e,b,d){return{DetailPageInstrumentationBuilder:function(c){return{metricId:c,obfuscatedCustomerId:"",setWidgetName:function(a){"string"===typeof a?this.widgetName=a:"undefined"!==typeof a&&null!==a&&b.logDataTypeException(c,"widgetName");
return this},setProductAsin:function(a){"string"===typeof a?this.productAsin=a:"undefined"!==typeof a&&null!==a&&b.logDataTypeException(c,"productAsin");return this},setProductPrice:function(a){"string"===typeof a?this.productPrice=a:"undefined"!==typeof a&&null!==a&&b.logDataTypeException(c,"productPrice");return this},setSelectedUpsellAsin:function(a){"string"===typeof a?this.selectedUpsellAsin=a:"undefined"!==typeof a&&null!==a&&b.logDataTypeException(c,"selectedUpsellAsin");return this},setSelectedUpsellPrice:function(a){"string"===
typeof a?this.selectedUpsellPrice=a:"undefined"!==typeof a&&null!==a&&b.logDataTypeException(c,"selectedUpsellPrice");return this},setUpsellAsins:function(a){if("object"===typeof a)this.upsellAsins=a;else if("string"===typeof a)try{this.upsellAsins=JSON.parse(a)}catch(k){g.ueLogError&&g.ueLogError(k,{logLevel:"ERROR",attribution:"error in parsing upsellAsin"})}else"undefined"!==typeof a&&null!==a&&b.logDataTypeException(c,"upsellAsins");return this},setPostalCode:function(a){"string"===typeof a?this.postalCode=
d.format(a):"undefined"!==typeof a&&null!==a&&b.logDataTypeException(c,"postalCode");return this},setMerchantId:function(a){"string"===typeof a?this.merchantId=a:"undefined"!==typeof a&&null!==a&&b.logDataTypeException(c,"merchantId");return this},setPageType:function(a){"string"===typeof a?this.pageType=a:"undefined"!==typeof a&&null!==a&&b.logDataTypeException(c,"pageType");return this},setSubPageType:function(a){"string"===typeof a?this.subPageType=a:"undefined"!==typeof a&&null!==a&&b.logDataTypeException(c,
"subPageType");return this},setHitType:function(a){"string"===typeof a?this.hitType=a:"undefined"!==typeof a&&null!==a&&b.logDataTypeException(c,"hitType");return this},setIsCritical:function(a){"boolean"===typeof a?this.isCritical=a:"undefined"!==typeof a&&null!==a&&b.logDataTypeException(c,"isCritical");return this},setPromo:function(a){"boolean"===typeof a?this.promo=a:"undefined"!==typeof a&&null!==a&&b.logDataTypeException(c,"promo");return this},setIsBuyBoxAvailable:function(a){"boolean"===
typeof a?this.isBuyBoxAvailable=a:"undefined"!==typeof a&&null!==a&&b.logDataTypeException(c,"isBuyBoxAvailable");return this},setIsMbcClick:function(a){"boolean"===typeof a?this.isMbcClick=a:"undefined"!==typeof a&&null!==a&&b.logDataTypeException(c,"isMbcClick");return this},setDeviceType:function(a){"string"===typeof a?this.deviceType=a:"undefined"!==typeof a&&null!==a&&b.logDataTypeException(c,"deviceType");return this},setPostPurchaseUID:function(a){"string"===typeof a?this.postPurchaseUID=a:
"undefined"!==typeof a&&null!==a&&b.logDataTypeException(c,"postPurchaseUID");return this},addExperimentalData:function(a,b){"undefined"===typeof this.experimentalData&&(this.experimentalData={});"string"===typeof b&&(this.experimentalData[a]=b);return this},build:function(){return new e.DetailPageInstrumentation(this)}}}}})});
/* ******** */
(function(m){var t=window.AmazonUIPageJS||window.P,B=t._namespace||t.attributeErrors,b=B?B("ProductBundleUIAssets",""):t;b.guardFatal?b.guardFatal(m)(b,window):b.execute(function(){m(b,window)})})(function(m,t,B){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 y(a){var f=a.getAttr(u.ATTR_MAX_HEIGHT);f&&b.isFiniteNumber(f)||(f=1);var n=f;a.dom.$carousel.children("li").not("."+u.EMPTY_CARD_CLASS).each(function(a,
f){a=p(f).outerHeight();n=Math.max(a,n)});n>f&&(a.setAttr(u.ATTR_MAX_HEIGHT,n),k.capabilities.transition?1===f?a.dom.$viewport.height(n):b.animate(a.dom.$viewport,{height:n},a.getAttr(u.ATTR_HEIGHT_ANIMATION_SPEED),"linear"):a.dom.$viewport.height(n),a.updateDimensionsCache({viewport:{height:n,outerHeight:n}}))}function r(p){var f=p.getAttr(a.PAGE_NUMBER),n=p.getAttr(a.TOTAL_PAGES),v=p.dom.$container.find(u.prevButton);p=p.dom.$container.find(u.nextButton);v.css("visibility",1===f?"hidden":"visible");
p.css("visibility",f>=n?"hidden":"visible")}function x(){d.onInit("bundle-drawer-carousel",function(a){y(a);r(a);b.on(u.pageChangeEvent,function(p){var n=p.oldValue,v=p.newValue,c=a.dom.$carousel.children("li").not("."+u.EMPTY_CARD_CLASS);(n=v>=n?c.first():c.last())&&(n=n.find("a"))&&n.focus();z||(z=!0,e.logCount(g.SCROLL,1),f.isDevices&&e.logRefTag(h.INGRESS_SCROLLED+f.landingAsin,f.landingAsin));r(p.carousel)});b.on(u.repaintEvent,function(a){r(a.carousel)})})}function m(){var a=p(w.bundlesCardBundles),
f=0,n=0,v=0;b.each(a,function(a,c){a=p(a);c=a.find(w.bundleTitle);c.height()>f&&(f=c.height());c=a.find(w.bundleImage);c.height()>n&&(n=c.height());a=a.find(w.bundleSavings);a.height()>v&&(v=a.height())});b.each(a,function(a,c){p(a).find(w.bundleTitle).height(f);p(a).find(w.bundleImage).height(n);p(a).find(w.bundleSavings).height(v)})}var p=b.$,f={},z=!1,u={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(){z=!1;var a=p(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();x();e.logCount(g.WIDGET_SHOWN,1);f.isDevices&&e.logRefTag(h.INGRESS_SHOWN+f.landingAsin,f.landingAsin);p(w.alexaBadgeContainer).length&&p(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,c,d){this.csrfToken=a||"";this.marketplace=c||"";this.ajaxEndpoint=d||"";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,d){var b=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){b.verifyCartApiResponse(c)?a(c):d()},error:d}):(m.log("Invalid request with an empty asin list to CartAPI","WARN"),d())},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 c=[],d=0;d<a.length;d++){var b=a[d],e={asin:b.asin,offerListingId:b.offerId,quantity:b.quantity},b=this.formatBooleanParams(b);e.additionalParameters=this.constructAdditionalParameters(b);c.push(e)}return JSON.stringify({items:c})},constructAdditionalParameters:function(a){var c={};a.hasOwnProperty("isToBeGiftWrapped")&&"boolean"===typeof a.isToBeGiftWrapped&&
(c.giftOptions={includeGiftReceipt:a.isToBeGiftWrapped});a.hasOwnProperty("isDevicePreRegistered")&&"boolean"===typeof a.isDevicePreRegistered&&(c.devicePreregistration={selected:a.isDevicePreRegistered});a.hasOwnProperty("programId")&&a.programId.length&&(c.installments={programId:a.programId});a.hasOwnProperty("incentivizedCart")&&a.incentivizedCart.length&&(c.incentivizedCart=a.incentivizedCart);a.hasOwnProperty("paymentOfferInfo")&&a.paymentOfferInfo.length&&(c.paymentOfferInfo=a.paymentOfferInfo);
return c},formatBooleanParams:function(a){for(var c in a)if(a.hasOwnProperty(c)&&"string"===typeof a[c]){var d=a[c].toLowerCase();-1!==e.indexOf(d)&&(a[c]="true"===d)}return a}});return{createRequest:function(a,c,b){return new d(a,c,b)}}});"use strict";m.when("A","bundles-card").register("bundles-secondary-view-item-models",function(b,c){function e(a){try{var c=y.grep(a.entity.images,function(a){return"MAIN"===a.variant});c&&c.length||(c=a.entity.images);return"https://m.media-amazon.com/images/I/"+
c[0].lowRes.physicalId+"."+c[0].lowRes.extension}catch(d){m.log("Unable to fetch main image for asin","ERROR")}}function d(a){try{return a.entity.displayString}catch(c){m.log("Unable to fetch title for asin","ERROR")}}function a(a,c){try{if(a[0].price&&a[0].price.entity[""+c]){var d=a[0].price.entity[""+c];if(d)return d.moneyValueOrRange.value.amount}}catch(b){m.log("Unable to fetch "+JSON.stringify(c)+" price for asin","ERROR")}}function k(a,c){r||(r=new Intl.NumberFormat(a,{style:"currency",currency:c}));
return r}var y=b.$,r,x=function(a,c){try{return"stars"===c?a.rating.hasHalfStar?a.rating.fullStarCount+.5:a.rating.fullStarCount:a.count.displayString}catch(d){m.log("Unable to fetch star rating/review count for asin","ERROR")}},A=function(a,c,d){a=a.parameters;if(a.length)for(var b=0;b<a.length;b++)if(a[b].name===c)return a[b].value;return d};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=x(b.customerReviewsSummary.entity,"stars"),this.ratingCount=x(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=x(b.customerReviewsSummary.entity,"stars"),this.ratingCount=x(b.customerReviewsSummary.entity,"count"));f=a(b.buyingOptions,"basisPrice");var r=k(c.language,c.currencyOfPreference);f&&(this.basisPrice=r.format(f));this.buyingPrice=r.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=A(f,"canAddToCart",!1),this.offerListingId=A(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,m,r,x){return c.ajax({url:"https://"+b+"/api/marketplaces/"+r+"/products/"+k,type:"GET",headers:{Accept:m,"x-api-csrf-token":a,"Accept-Language":d,"x-cc-currency-of-preference":x,"x-amzn-encrypted-slate-token":c('meta[name\x3d"encrypted-slate-token"]').prop("content")},xhrFields:{withCredentials:!0}})},getProductV2ResourceInclusions:function(c){return'application/vnd.com.amazon.api+json; type\x3d"collection(product/v2)/v1"; expand\x3d"'+
c.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){b=t.ue||!1;var c=b.count||!1,e=b.log||!1,d=t.ueLogError||!1,a={ent:"all"},k=function(a,b,c,k){"INFO"!==b&&d?(null!==k&&"object"===
typeof k?k.message="["+a+"] "+k.message:k={message:"["+a+"]"},d(k,{logLevel:b,attribution:c,message:a})):"INFO"===b&&e&&e(a,c)},m=function(a,b,c){k(a,"ERROR",b,c)};return{logCount:function(a,b){if(c)return c(a,b),c(a)},logInfo:function(a,b){k(a,"INFO",b,null)},logWarning:function(a,b,c){k(a,"WARN",b,c)},logError:m,logFatal:function(a,b,c){k(a,"FATAL",b,c)},logRefTag:function(b,c){try{if(!t.csa)throw Error("CSA is not available.");var d=t.csa("Events",{producerId:"buda"});if(!b||!c)throw Error("All parameters (refTag, asin) are required.");
if(!t.ue)throw Error("Session and Request Data is not available.");var k=(new Date).toISOString(),f=(new Date(Date.now()-6E4*(new Date).getTimezoneOffset())).toISOString().slice(0,-1),e=t.opts?t.opts.customerId:t.fwcimData?t.fwcimData.customerId:"",u=t.opts?parseInt(t.opts.marketId):null;d("log",{schemaId:"buda.CSAMetrics.8",refMarker:b,userCustomerId:e,marketplaceId:u,sessionId:t.ue.sid||"",requestId:t.ue.rid||"",hitHourUtc:k,endTimeLocal:f,pageAsin:c},a)}catch(w){m(w.message,"ProductBundleUIAssets:bundle-logger",
w)}}}});"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,y,r,x){function t(a){r.reset();g.post(e.AJAX_URL+a).done(function(a){a=g(E.ajaxDataWrapper).html(a);r.initialize(a)}).done(function(){b.trigger(e.BUNDLES_CARD_SECONDARY_VIEW_ATC_READY);b.trigger(e.BUNDLES_DRAWER_SIDE_SHEET_READY);g(q.bundleTitle).live("click",function(){if(c.isDevices){var a=g(this).closest(q.bundleExpander).find(q.bundleAsin).val();x.logRefTag(C.BUNDLE_TITLE_CLICKED_DESKTOP+c.landingAsin+v.UNDERSCORE+
a,c.landingAsin)}});g(q.bundleGetDealButton).live("click",function(){if(c.isDevices){var a=g(this).closest(q.bundleExpander).find(q.bundleAsin).val();x.logRefTag(C.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 p(b,n,k){var e=g(q.bundleComponentsExpander+b),u=!1;e.length&&a.getAAPIProductData(c.aapiEndpoint,c.language,c.csrfToken,n,h,c.marketplaceId,c.currencyOfPreference).done(function(a){a=
a.entities;for(var b=0;b<a.length;b++){var n=a[b].entity;if(d.validateProductV2Entity(n)){var k=n.asin,n=new d.componentData(n,c.currency),k=e.find(q.bundleComponentCard+k);f(k,n);z(k,n);k.find(l.productBuyingPriceBase).text()&&n.basisPrice&&k.find(l.productFullPrice).text(n.basisPrice)}else{u=!0;break}}e.toggleClass(v.AUI_HIDDEN_CLASS,u);r.updateContent(g(q.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);y.get(a.find(l.productTitleTruncate)).update()}function z(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 u(a,b){var c=g(q.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 u=g(q.bundlesSecondaryView).find(n.upsellRecommendation+b),p=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=u.find(n.accessoryAtcCard+e.asin);f(e,h);z(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(n.individualRecommendationAtc).find(n.accessoryOfferListingId).val(h.offerListingId),e.toggleClass(v.AUI_HIDDEN_CLASS),p++)}}0<p&&(a=u.find(n.accessoryAtcHeader),a.text(a.text().replace(v.ITEM_COUNT_PLACEHOLDER,p)),a.toggleClass(v.AUI_HIDDEN_CLASS));r.updateContent(g(q.bundlesSecondaryViewSideSheet).html())}).fail(function(){u.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"},q={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"},n={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'},C={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(){t(c.landingAsin)});b.on(e.BUNDLES_DRAWER_SIDE_SHEET_READY,function(){var a=g(q.bundlesSecondaryView),b=a.find(q.expanderComponentAsins),d=a.find(q.expanderAsins);b.length&&b.each(function(c){p(d[c].textContent.trim(),b[c].textContent.trim(),a)});
var f=a.find(n.bundleAsin),e=a.find(n.bundleAccessoryAsins);e.length&&e.each(function(a){w(f[a].textContent.trim(),e[a].textContent.trim())});a=g(q.bundlesSecondaryViewSideSheet);g(".ingress-card").unbind("click").click(function(b){b.preventDefault();c.isDevices&&x.logRefTag(v.INGRESS_CARD_REFTAG+c.landingAsin,c.landingAsin);r.show(function(){var b=g(q.relatedBundlesDivider);u(a,b)},!0)});c.isUnifiedCxView||g(".bundle-box-link").unbind("click").click(function(b){b.preventDefault();var n=g(this).siblings(q.bundleCardAsin).val();
c.isDevices&&(b=g(".bundle-box-link").index(b.target),x.logRefTag(v.BUNDLE_CARD_CLICKED_REFTAG+b+v.UNDERSCORE+c.landingAsin,c.landingAsin));r.show(function(b){var c=g(q.bundlesSecondaryView).find(".secondary-bundle-container input[value\x3d'"+b+"']").closest(q.bundleExpander);"false"===c.find(q.bundleExpanderContent).attr("aria-expanded")&&c.find(q.bundleExpanderHeader).click();"false"===c.find(q.bundleComponentsExpanderContent).attr("aria-expanded")&&c.find(q.bundleComponentsExpanderHeader).click();
c.find(q.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(q.bundleExpander);u(a,b)},!1,n)})})});"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,y,r){function t(a){a&&
a.items&&a.items.forEach(function(a){k.setCartItemQuantity(a.asin,a.quantity)})}function A(a){k.setCartTotalCount(a);m.when("nav.setCartCount").execute(function(b){b(a)})}function p(a){g(h.postAddToCartContent).find(q.subTotalContainer).toggleClass(l.AUI_HIDDEN_CLASS,!a)}function f(){d.getCartSummary(a.aapiEndpoint,a.csrfToken,a.marketplaceId).done(function(a){p(!0);a.entity&&a.entity.summary&&0<a.entity.summary.length&&g(h.postAddToCartContent).find(q.subTotalPrice).text(a.entity.summary[0].subtotal.displayString)}).fail(function(){p(!1);
m.log("An error has occurred while getting cart sub total","WARN")})}function z(a){var b=a.asin;if(g(h.atcButton+b).length){var c=r(h.accountLinkingCheckbox+b);c&&(a.isDevicePreRegistered=c.isChecked())}g(h.installmentsCheckbox+b).length&&(c=r(h.installmentsCheckbox+b))&&c.isChecked()&&(a.programId=g(h.installmentsCheckbox+b).val());return a}function u(a){var b=g(h.postAddToCartContent).find(q.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}"},q={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){t(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),p=e.find(h.atcButton+d),w=e.find(h.reachCartLimitMessage+d),t=e.find(h.atcErrorBlock+d);k.cartContainsItem(d)?(p.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=z(b),e.addSingleAsinData(b),e.setRefTag("bundles_dsk_sec_view_bundle_atc"),y.logCount("bundlesDrawerBundleCartApiSent",1),e.sendRequest(function(b){k.setCartItemQuantity(d,1);var c=k.getCartTotalCount();A(b.entity.count.entity.items);a.isDevices&&y.logRefTag("amzdv_tplus_dp_dsk_atc_"+a.landingAsin+l.UNDERSCORE+d,a.landingAsin);f();u(k.getCartTotalCount());b=g(h.bundlesDrawerSideSheet).find(h.bundleExpanders+d).find(h.bundleImage).attr("src");
var e=0;g(h.installmentsCheckbox+d).length&&r(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(q.addedItemImage).attr("src",b);g(h.bundlesDrawerSideSheet).scrollTop(0);g(h.bundleContent).toggleClass(l.AUI_HIDDEN_CLASS,!0);g(h.postAddToCartContent).find(q.upsellRecommendationSection+
d).toggleClass(l.AUI_HIDDEN_CLASS);g(h.postAddToCartContent).toggleClass(l.AUI_HIDDEN_CLASS)},function(){y.logCount("bundlesDrawerBundleCartApiFailed",1);m.log("An error has occurred with Cart API addItems request when add "+d+" from Secondary View.","WARN");a.isDevices&&y.logRefTag("amzdv_tplus_dp_dsk_failed_atc_"+a.landingAsin+l.UNDERSCORE+d,a.landingAsin);p.addClass(l.AUI_HIDDEN_CLASS);t.removeClass(l.AUI_HIDDEN_CLASS)}))});b.declarative(l.ACCESSORY_ATC_DECLARATIVE_ACTION,"click",function(d){var e=
d.data;y.logCount("bundlesDrawerSideSheetAccessoryAtcClicked",1);var h=e.bundleAsin,g=e.asin,p=d.$target.closest(q.accessoryAtcButton);p.toggleClass(l.AUI_HIDDEN_CLASS,!0);var r=p.closest(q.accessoryAtcCard),t=r.find(q.accessoryAtcSpinner);t.toggleClass(l.AUI_HIDDEN_CLASS);var x=r.find(q.accessoryAtcSuccessContent).find(q.accessoryAtcButton),z=r.find(q.accessoryAtcErrorContent);d=r.find(q.accessoryOfferListingId).val();var B=r.find(q.accessoryAtcSuccessContainer),D=B.find(q.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){A(c.entity.count.entity.items);z.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();u(k.getCartTotalCount());w(t,D,k.getCartItemQuantity(g),B);p.toggleClass(l.AUI_HIDDEN_CLASS,
!1);x.toggleClass(l.AUI_HIDDEN_CLASS,!1)},3E3):(f(),u(k.getCartTotalCount()),w(t,D,k.getCartItemQuantity(g),B));a.isDevices&&y.logRefTag("amzdv_tplus_dp_dsk_patc_"+a.landingAsin+l.UNDERSCORE+h+l.UNDERSCORE+g,a.landingAsin)},function(){y.logCount("bundlesDrawerSideSheetAccessoryAtcFailed",1);t.toggleClass(l.AUI_HIDDEN_CLASS,!0);p.toggleClass(l.AUI_HIDDEN_CLASS,!1);x.toggleClass(l.AUI_HIDDEN_CLASS,!0);z.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&&y.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=r(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=r(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){t=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(),z;d(f.SIDE_SHEET_CONTAINER).find('[id^\x3d"bundle-expander-header-"]:first').focus()}}var d=b.$,a,k,m,r=!1,t,A,p,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"},z={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");r=!1;t.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");r=!0;e(g,c)},reset:function(){m=null;r=!1;t=null;A=!1;p=null},isReadyToShow:function(){return null!==m},updateContent:function(a){m=a}};document.addEventListener("focus",function(a){if(r&&!A){var b=d(f.SIDE_SHEET_MODAL_LAYER).get(0);b.contains(a.target)?p=a.target:(A=!0,c.focusDescendant(b,"first"),p===document.activeElement&&c.focusDescendant(b,"last"),A=!1,p=document.activeElement)}},!0);
return z});"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(q){var r=window.AmazonUIPageJS||window.P,y=r._namespace||r.attributeErrors,a=y?y("DetailPageAttachAssets",""):r;a.guardFatal?a.guardFatal(q)(a,window):a.execute(function(){q(a,window)})})(function(q,r,y){"use strict";q.register("attach-variant-registration",function(){function a(a){if(b.hasOwnProperty(a))throw"Variant flag already registered";b[a]=!0}var b={};a("BEATS_COMPRECS_ATTACH_MOBILE_BOTTOM_SHEET_1232995:C");a("CETECH_WTY_MBS_STICKY_BUTTONS_1257103:C");return{registerVariantFlag:a,
getVariantFlag:function(a){return b.hasOwnProperty(a)}}});"use strict";q.when("A","attach-weblabs","attach-logging","attach.amazonapi.cart.add-items").register("attach-baselink",function(a,b,f,c){var k=null;q.when("BaseLinkFormHelper").execute(function(a){k=a});var l=function(a){r.ueLogError&&r.ueLogError({message:"msi - "+a},{logLevel:"ERROR",attribution:"Mobile_App_SI_Base_Link"})};return{createBaseLinkFormFields:function(a,b){return k?k.addBaseLinkFields(a,b):null},addLinkedWarranty:function(a,
b,e){if(!a||!a.baseItemAsin)return l("baseItemAsin is undefined. Abandoning ATC since Base item and Warranty association can not be done."),e();a={asin:a.warrantyAsin,offerListingId:a.offeringId,quantity:parseInt(a.quantity),additionalParameters:{itemAssociation:{associatedItemId:a.baseItemAsin,deleteConstraint:{mutuallyInclusive:!1},quantityConstraint:{invarianceFactor:1,quantityEditable:!0},programType:"AmazonProtect",renderType:"renderAll"}}};c.addItems([a],f.REF_TAGS.WARRANTY_MBS_ADD_TO_CART).then(b).catch(e)},
mSilogError:l}});"use strict";q.when("A").register("attach-external-atc-interceptor",function(a){var b=a.$,f=[],c=[],k=!1,l=!1,p=function(){l=!0},h=function(a){var e=c.indexOf(a);-1<e&&(a=b("#attach_add_accessory_alert_"+e),e=b("#attach_add_accessory_button_"+e),a&&e&&(a.removeClass("aok-hidden"),e.addClass("aok-hidden")))};return{updateAttachModule:function(a){p&&(k?h(a):f.push(a))},loadAttachModule:function(a){if(l)for(k=!0,c=a;0<f.length;)a=f.shift(),h(a)},unloadAttachModule:function(){k=!1;c=
[]},enableModule:p}});"use strict";q.when("A").register("attach-preinitiate-checkout",function(a){return{getCartInitiateId:function(){return(new Date).getTime()},preinitiateCheckout:function(b){var f=a.$("#attach-desktop-sideSheet");var c=a.$("#attach_accessory_sheet");f=f.length?f:c;f.find("iframe#checkoutPrefetch").remove();b="/gp/cart/checkout-prefetch.html?\x26cartInitiateId\x3d"+b;c=document.createElement("iframe");c.setAttribute("src",b);c.setAttribute("style","width:0px;height:0px;display:none;position:absolute;");
c.setAttribute("name","checkoutPrefetch");c.setAttribute("id","checkoutPrefetch");f.append(c)}}});"use strict";q.when("A","attach-common","attach-variant-registration").register("attach-weblabs",function(a,b,f){var c={hideBottomSheetForCompRecsWeblab:!1},k=function(b){if(b){var e="";r.ue&&(e=r.ue.id);a.$.ajax({url:"/ussx/weblab-trigger?weblabValue\x3d"+b+"\x26requestId\x3d"+e})}};c.compRecsTriggerWeblab=function(){b.isCustomerLoggedIn()&&(f.getVariantFlag("BEATS_COMPRECS_ATTACH_MOBILE_BOTTOM_SHEET_1232995:C")?
k("BEATS_COMPRECS_ATTACH_MOBILE_BOTTOM_SHEET_1232995"):f.getVariantFlag("BEATS_COMPRECS_ATTACH_MOBILE_BOTTOM_SHEET_1232995:T1")&&(k("BEATS_COMPRECS_ATTACH_MOBILE_BOTTOM_SHEET_1232995"),c.hideBottomSheetForCompRecsWeblab=!0))};c.mbsStickyTriggerWeblab=function(){b.isCustomerLoggedIn()&&(f.getVariantFlag("CETECH_WTY_MBS_STICKY_BUTTONS_1257103:C")||f.getVariantFlag("CETECH_WTY_MBS_STICKY_BUTTONS_1257103:T1"))&&k("CETECH_WTY_MBS_STICKY_BUTTONS_1257103")};var l=c.Selectors={CORE_FREE_SHIPPING_MESSAGE:"#attach-core-free-shipping-message",
DEBUG_IS_DEBUG:"#attach-debug-isDebug",DEBUG_QUERY_STRING:"#attach-debug-queryString",ATTACH_MARKETPLACE_ID:"#attach-marketplaceId",WTY_TWISTER_CONTAINER:"#warranty-twister-container",DSS_MBS_UI_ENHANCEMENT:"#attach-dss-mbs-enhancement",DSS_MBS_UI_ENHANCEMENT_LD:"#attach-dss-mbs-ld-enhancement",DSS_MBS_EU_COMPLIANCE:"#attach-dss-mbs-eu-compliance",FLOW_MIGRATION:"#attach-gxa-to-flow-migration-enabled",ATTACH_UNIFICATION:"#attach-unification"},p=c.Marketplaces={IN:"A21TJRUUN4KGV"};c.isWarrantyPaneSuppressed=
function(){return a.$(l.ATTACH_MARKETPLACE_ID).val()===p.IN&&(!c.servicesInterstitialDeprecated()||b.hasAccessories())};c.isCoreFreeShippingMessageEnabled=function(){return b.elementExists(l.CORE_FREE_SHIPPING_MESSAGE)};c.isWarrantyTwisterPlusDesktopEnabled=function(){return 0<a.$(l.WTY_TWISTER_CONTAINER).length};c.isFlowMigrationEnabled=function(){return b.elementExists(l.FLOW_MIGRATION)};c.servicesInterstitialDeprecated=function(){return b.elementExists("#attachSIDeprecated")};c.isDssMbsEnhancementEnabled=
function(){return b.elementExists(l.DSS_MBS_UI_ENHANCEMENT)};c.isLdDssMbsEnhancementEnabled=function(){return b.elementExists(l.DSS_MBS_UI_ENHANCEMENT_LD)};c.isDssMbsEuComplianceActive=function(){return b.elementExists(l.DSS_MBS_EU_COMPLIANCE)};c.isAttachUnificationEnabled=function(){return b.elementExists(l.ATTACH_UNIFICATION)};c.isMBSCloseIcon=function(){return b.isCustomerLoggedIn()&&f.getVariantFlag("CETECH_WTY_MBS_STICKY_BUTTONS_1257103:T1")};return c});"use strict";q.when("A").register("attach-logging",
function(a){var b={},f,c,k;b.NEXUS={PRODUCER_ID:"atch",PRODUCER_ID_WARRANTY:"warranties",ACCESSORY_IMPRESSIONS_PREFIX:"attach.AccessoryImpressions.",ACCESSORY_IMPRESSIONS_SCHEMA_VERSION:"11",ADD_ACCESSORY_PREFIX:"attach.AddAccessoryToCart.",ADD_ACCESSORY_SCHEMA_VERSION:"15",ADD_WARRANTY_PREFIX:"attach.AddWarrantyToCart.",ADD_WARRANTY_SCHEMA_VERSION:"5",ADD_WARRANTY_FAILURE_PREFIX:"attach.AddWarrantyToCartFailure.",ADD_WARRANTY_FAILURE_SCHEMA_VERSION:"3",WARRANTY_IMPRESSION_PREFIX:"attach.WarrantyImpression.",
WARRANTY_IMPRESSION_SCHEMA_VERSION:"6",WARRANTY_WIDGET_INTERACTION_PREFIX:"warranty.widgetInteraction.",WARRANTY_WIDGET_INTERACTION_SCHEMA_VERSION:"3",DSS_WARNING_MESSAGE_PREFIX:"attach.DssWarningMessages.",DSS_WARNING_MESSAGE_VERSION:"2",PROMOTION_CLAIMED_PREFIX:"attach.ClaimPromotion.",PROMOTION_CLAIMED_SCHEMA_VERSION:"2",ACCESSORY_TYPE:{ACCESSORY:"accessory",WARRANTY:"warranty"}};b.FEATURES={DSS:"dss",MBS:"mbs",MBS_APP:"mbs_app",MBS_WEB:"mbs_web"};b.CSM_METRICS={ATTACH_BASE_ATC_CLICK:"attachDesktopBaseATCClick",
ATTACH_BASE_ATC_FAILURE:"ATTACH_DSS_ADD_BASE_FAILURE",ATTACH_BASE_ATC_SUCCESS:"ATTACH_DSS_ADD_BASE_SUCCESS",ATTACH_CART_CLICK:"ATTACH_DSS_CART_BUTTON_CLICK",ATTACH_CHECKOUT_CLICK:"ATTACH_DSS_CHECKOUT_CLICK",ATTACH_GET_CART_DESCRIPTION_FAILURE:"ATTACH_DSS_GET_CART_DESCRIPTION_AJAX_FAILURE",ATTACH_GET_CART_DESCRIPTION_SUCCESS:"ATTACH_DSS_GET_CART_DESCRIPTION_AJAX_SUCCESS",ATTACH_SHOW_LESS:"attachDesktopShowLess",ATTACH_SHOW_MORE:"attachDesktopShowMore",ATTACH_SIDE_SHEET_CLOSE:"attachDesktopSideSheetClose",
ATTACH_UPSELL_ATC_CLICK:"attachDesktopUpsellATCClick",ATTACH_UPSELL_ATC_FAILURE:"ATTACH_DSS_ADD_ACCESSORY_FAILURE",ATTACH_UPSELL_ATC_LATENCY:"attach_desktop_upsell_atc_latency",ATTACH_UPSELL_ATC_SUCCESS:"ATTACH_DSS_ADD_ACCESSORY_SUCCESS",MINI_DP_ATC:"attachDesktopMiniDPATC",MINI_DP_BACK:"attachDesktopMiniDPBack",MINI_DP_CANCEL:"attachDesktopMiniDPCancel",MINI_DP_CAROUSEL_THUMBNAIL_CHANGE:"attachDesktopMiniDPCarouselThumbnailChange",MINI_DP_DWELL_TIME:"attach_desktop_mini_dp_dwell_time",MINI_DP_OPEN:"attachDesktopMiniDPOpen",
ATTACH_MBS_BASE_ATC_CLICK:"AttachMbsBaseItemAtcClick",DSS_BASE_LD_ATC_CLICK:"attachDesktopBaseLightningDealAtcClick",MBS_BASE_LD_ATC_CLICK:"attachMobileBaseLightningDealAtcClick",DSS_BASE_LD_MISSING_TIMER:"attachDesktopBaseLightningDealMissingTimer",MBS_BASE_LD_MISSING_TIMER:"attachMobileBaseLightningDealMissingTimer",DSS_LD_MISSING_ATTACH:"attachDesktopLightningDealMissingAttachContainer",MBS_APP_LD_MISSING_ATTACH:"attachMobileAppLightningDealMissingAttachContainer",MBS_WEB_LD_MISSING_ATTACH:"attachMobileWebLightningDealMissingAttachContainer",
ATTACH_BASE_LD_PRESENT:"attachBaseLightningDeal",ATTACH_BASE_LD_WARRANTY_SUCCESS:"attachBaseLightningDealAddWarrantySuccess",ATTACH_BASE_LD_WARRANTY_FAILURE:"attachBaseLightningDealAddWarrantyFailure",ATTACH_BASE_LD_DEAL_STATUS_ERROR:"attachBaseLightningDealStatusError",ATTACH_MBS_ATC_STAY_AJAX_SUCCESS:"attachMbsAtcStayAjaxSuccess",ATTACH_MBS_ATC_STAY_AJAX_FAILURE:"attachMbsAtcStayAjaxFailure",ATTACH_MBS_ATC_STAY_INCOMPLETE_FAILURE:"attachMbsAtcStayAjaxIncomplete",ATTACH_MBS_ATC_ADD_ITEMS_API_SUCCESS:"attachMbsAtcAddItemsApiSuccess",
ATTACH_MBS_ATC_ADD_ITEMS_API_FAILURE:"attachMbsAtcAddItemsApiFailure",ATTACH_MBS_ATC_ADD_ITEMS_API_INCOMPLETE_FAILURE:"attachMbsAtcAddItemsApiIncomplete",ATTACH_MBS_ATC_GURUPA_SUCCESS:"attachMbsAtcGurupaSuccess",ATTACH_MBS_ATC_GURUPA_FAILURE:"attachMbsAtcGurupaFailure",ATTACH_MBS_GET_CART_SUMMARY_SUCCESS:"attachMbsGetCartSummarySuccess",ATTACH_MBS_GET_CART_SUMMARY_FAILURE:"attachMbsGetCartSummaryFailure",WARRANTY_MBS_APP_ATC_SUCCESS:"warrantyMbsAppAtcSuccess",WARRANTY_MBS_APP_ATC_FAILURE:"warrantyMbsAppAtcFailure",
WARRANTY_MBS_WEB_ATC_SUCCESS:"warrantyMbsWebAtcSuccess",WARRANTY_MBS_WEB_ATC_FAILURE:"warrantyMbsWebAtcFailure",WARRANTY_DSS_ATC_CLICK:"warrantyDssAtcClick",WARRANTY_DSS_ATC_SUCCESS:"warrantyDssAtcSuccess",WARRANTY_DSS_ATC_FAILURE:"warrantyDssAtcFailure",WARRANTY_DSS_WARRANTY_PANE_ATC_CART_API_SUCCESS:"warrantyDssWarrantyPaneAtcCartApiSuccess",WARRANTY_DSS_WARRANTY_PANE_ATC_CART_API_INCOMPLETE:"warrantyDssWarrantyPaneAtcCartApiIncomplete",WARRANTY_DSS_WARRANTY_PANE_ATC_CART_API_FAILURE:"warrantyDssWarrantyPaneAtcCartApiFailure",
WARRANTY_DESKTOP_ATC_BY_ACCESSORIES_PANE_SUCCESS:"warrantyDesktopAtcByAccessoriesPaneSuccess",WARRANTY_DESKTOP_ATC_BY_ACCESSORIES_PANE_INCOMPLETE:"warrantyDesktopAtcByAccessoriesPaneIncomplete",WARRANTY_DESKTOP_ATC_BY_ACCESSORIES_PANE_FAILURE:"warrantyDesktopAtcByAccessoriesPaneFailure",WARRANTY_MOBILE_WEB_ATC_WITH_BASE_SUCCESS:"warrantyMobileWebAtcWithBaseSuccess",WARRANTY_MOBILE_WEB_ATC_WITH_BASE_INCOMPLETE:"warrantyMobileWebAtcWithBaseIncomplete",WARRANTY_MOBILE_WEB_ATC_WITH_BASE_FAILURE:"warrantyMobileWebAtcWithBaseFailure",
SHOW_MBS:"attachShowMbs",SHOW_WARRANTY:"attachShowWarranty",SHOW_MBS_ON_APP:"attachShowMbsOnApp",SHOW_MBS_ON_WEB:"attachShowMbsOnWeb",SHOW_WARRANTY_ON_WEB:"attachShowWarrantyOnWeb",SHOW_WARRANTY_ON_APP:"attachShowWarrantyOnApp"};b.ENDPOINTS={REF_TAG_IN:"/hctp/log/refMarker?ref_\x3d"};b.METRICS={DPX_MOBILE_APP_ATC:"DetailPage_MobileApp_AddToCart",DPX_MOBILE_WEB_ATC:"DetailPage_MobileWeb_AddToCart"};b.initialize=function(a,h){f=a;c=h;b.REF_TAGS={WARRANTY_IMPRESSION:"dp_atc_"+a+"_w_i_",WARRANTY_ADD_TO_CART:"dp_atc_"+
a+"_w_y_",WARRANTY_MBS_ADD_TO_CART:"dp_atch_"+a+"_w_y",WARRANTY_WIDGET_INTERACTION:"dp_atc_"+a+"_w_w_i_"}};b.setPayloadBuilder=function(a){k=function(){var p=a();p.feature=f;p.obfuscatedMarketplaceId=c||r.ue_mid;p.producerId=b.NEXUS.PRODUCER_ID;p.requestId=b.getRandomHexString();return p}};b.getRandomHexString=function(){return Date.now().toString(10)+Math.random().toString(16).substring(2,13)};b.log=function(c,h){if(r.ue&&r.ue.event){var e={ssd:!1};c.customerId=a.$("#attach-customerId").val()||null;
h==b.NEXUS.WARRANTY_WIDGET_INTERACTION_PREFIX+b.NEXUS.WARRANTY_WIDGET_INTERACTION_SCHEMA_VERSION?r.ue.event(c,b.NEXUS.PRODUCER_ID_WARRANTY,h,e):r.ue.event(c,b.NEXUS.PRODUCER_ID,h,e)}};b.getAccessoryLoggingData=function(b){return{asin:a.$("#attach-accessory-asin-"+(parseInt(b)+1)).val(),index:b,priceFormatted:a.$("#attach-accessory-price-"+b+" \x3e .a-offscreen").text(),priceDecimal:parseFloat(a.$("#attach-accessory-base-price-"+b).val())||null,currencySymbol:a.$("#attach-accessory-base-currency-symbol-"+
b).val()||null,couponDecimal:null,couponType:null,dealType:a.$("#attach-accessory-deal-type-"+b).val()||null,dealPercentSavings:parseInt(a.$("#attach-accessory-deal-percent-savings-"+b).val())||null,dealDollarAmount:a.$("#attach-accessory-deal-dollar-savings-"+b).val()||null,categoryIndex:a.$("#attach-accessory-category-index-"+b).val()||null,categoryTitle:a.$("#attach-accessory-category-title-"+b).val()||null,asinIndexWithinCategory:a.$("#attach-accessory-asin-category-index-"+b).val()||null}};b.getWarrantyPayload=
function(a,b){return{asin:a,priceFormatted:b,priceDecimal:null,currencySymbol:null}};b.logAccessoryAddToCart=function(a){var c=b.NEXUS.ADD_ACCESSORY_PREFIX+b.NEXUS.ADD_ACCESSORY_SCHEMA_VERSION,e=k();e.type=b.NEXUS.ACCESSORY_TYPE.ACCESSORY;e.displayPosition=parseInt(a.index)+1;e.accessoryAsin=a.asin;e.accessoryAsinPrice=a.priceFormatted;e.accessoryItemCurrencySymbol=a.currencySymbol;e.accessoryItemPriceDecimal=a.priceDecimal;e.couponType=a.couponType;e.couponDecimal=a.couponDecimal;e.dealType=a.dealType;
e.dealPercentSavings=a.dealPercentSavings;e.dealDollarAmount=a.dealDollarAmount;e.categoryDisplayPosition=parseInt(a.categoryIndex)+1;e.categoryTitle=a.categoryTitle;e.displayPositionWithinCategory=parseInt(a.asinIndexWithinCategory)+1;b.log(e,c)};b.logAccessoryImpressions=function(a){var c=b.NEXUS.ACCESSORY_IMPRESSIONS_PREFIX+b.NEXUS.ACCESSORY_IMPRESSIONS_SCHEMA_VERSION,e=k();e.accessories=[];for(var m=0;m<a.length;m++){var d=a[m];e.accessories.push({displayPosition:parseInt(d.index)+1,asin:d.asin,
price:d.priceFormatted,currencySymbol:d.currencySymbol,priceDecimal:d.priceDecimal,couponType:d.couponType,couponDecimal:d.couponDecimal,dealType:d.dealType,dealPercentSavings:d.dealPercentSavings,dealDollarAmount:d.dealDollarAmount,categoryDisplayPosition:parseInt(d.categoryIndex)+1,categoryTitle:d.categoryTitle,displayPositionWithinCategory:parseInt(d.asinIndexWithinCategory)+1})}b.log(e,c)};b.logWarrantyAddToCart=function(c,h){h?(h=b.NEXUS.ADD_WARRANTY_FAILURE_PREFIX+b.NEXUS.ADD_WARRANTY_FAILURE_SCHEMA_VERSION,
l(c,h),a.capabilities.isAmazonApp?b.logCount(b.CSM_METRICS.WARRANTY_MBS_APP_ATC_FAILURE):a.capabilities.mobile?b.logCount(b.CSM_METRICS.WARRANTY_MBS_WEB_ATC_FAILURE):b.logCount(b.CSM_METRICS.WARRANTY_DSS_ATC_FAILURE)):(h=b.NEXUS.ADD_WARRANTY_PREFIX+b.NEXUS.ADD_WARRANTY_SCHEMA_VERSION,l(c,h),a.capabilities.isAmazonApp?b.logCount(b.CSM_METRICS.WARRANTY_MBS_APP_ATC_SUCCESS):a.capabilities.mobile?b.logCount(b.CSM_METRICS.WARRANTY_MBS_WEB_ATC_SUCCESS):b.logCount(b.CSM_METRICS.WARRANTY_DSS_ATC_CLICK),b.logWarrantyRefTag(b.REF_TAGS.WARRANTY_ADD_TO_CART,
c.asin))};var l=function(a,c){var e=k();e.asin=a.asin;e.price=a.priceFormatted;e.warrantyCurrencySymbol=a.currencySymbol;e.warrantyPriceDecimal=a.priceDecimal;b.log(e,c)};b.logWarrantyImpression=function(a){var c=b.NEXUS.WARRANTY_IMPRESSION_PREFIX+b.NEXUS.WARRANTY_IMPRESSION_SCHEMA_VERSION,e=k();e.asin=a.asin;e.price=a.priceFormatted;e.warrantyCurrencySymbol=a.currencySymbol;e.warrantyPriceDecimal=a.priceDecimal;b.log(e,c);b.logWarrantyRefTag(b.REF_TAGS.WARRANTY_IMPRESSION,a.asin)};b.logWarrantyWidgetInteraction=
function(a){var c=b.NEXUS.WARRANTY_WIDGET_INTERACTION_PREFIX+b.NEXUS.WARRANTY_WIDGET_INTERACTION_SCHEMA_VERSION,e=k();e.asin=a.asin;e.action=a.action;b.log(e,c);b.logWarrantyRefTag(b.REF_TAGS.WARRANTY_WIDGET_INTERACTION,a.asin)};b.logWarrantyInteractionData=function(c,h){var e=h.closest(".attach-warranty-box");h=a.$(e).find(".dssMbs__r input[type\x3dcheckbox]")[0].name;e=a.$(e).find("input[name\x3d'asin."+h+"']").val();b.logWarrantyWidgetInteraction({index:h,asin:e,action:c})};b.logWarrantyRefTag=
function(a,c){var e=k().baseAsin;b.logRefTag(a+e+"_"+c)};b.logSecondarySheetRefTag=function(a){var c=k().baseAsin;b.logRefTag(a+"_"+c)};b.logRefTag=function(k){"A21TJRUUN4KGV"===c&&a.get(b.ENDPOINTS.REF_TAG_IN+k)};b.logMobileBaseAtc=function(c){b.logCount(b.CSM_METRICS.ATTACH_MBS_BASE_ATC_CLICK);c&&c.data&&"add-to-cart"===c.data.buttonID&&b.logCount(a.capabilities.isAmazonApp?b.METRICS.DPX_MOBILE_APP_ATC:b.METRICS.DPX_MOBILE_WEB_ATC)};b.logCount=function(a,b){r.ue&&r.ue.count&&(b=b||1,r.ue.count(a,
(r.ue.count(a)||0)+b))};b.logCountOnce=function(a){r.ue&&r.ue.count&&!r.ue.count(a)&&r.ue.count(a,1)};b.logError=function(a,b,c){r.ueLogError&&r.ueLogError(a,{logLevel:b||"ERROR",attribution:c||"DetailPageAttachAssets"})};b.logDSSWarningMessage=function(a){var c=b.NEXUS.DSS_WARNING_MESSAGE_PREFIX+b.NEXUS.DSS_WARNING_MESSAGE_VERSION,e=k();b.log({quantity:e.quantity.toString(),baseAsin:e.baseAsin,warningMessage:a},c)};b.isFunction=function(a){return"function"===typeof a};b.beginLatencyCapture=function(a){b.isFunction(r.uet)&&
r.uet("bb",a,{wb:1})};b.endLatencyCapture=function(a){b.isFunction(r.uex)&&r.uex("ld",a,{wb:1})};return b});"use strict";q.when("A","3p-promise","attach-variant-registration","attach-logging","attach.utilities.add-to-cart.base-product").register("attach-common",function(a,b,f,c,k){function l(b){var g=p(b,d.UNIQ_ITEM_ASSOC_NAME),c=p(b,d.ITEM_ASSOC_TYPE_NAME),k=1,f=!1;null!==c&&(m.itemAssocTypeValue=b.find(d.INPUT_NAME+c+d.CLOSED_BRACKET).val(),m.itemAssocTypeValue===d.ATTACH_ITEM_ASSOC_TYPE_VALUE&&
(f=!0));null!==g?f?(c=p(b,d.ITEM_ASSOC_NAME),f=a.$("#attach-sessionId").val()+"-"+(new Date).getTime(),b.find(d.INPUT_NAME+g+d.CLOSED_BRACKET).val(f),b.find(d.INPUT_NAME+c+d.CLOSED_BRACKET).val(f),m.uniqueId=f):m.uniqueId=b.find(d.INPUT_NAME+g+d.CLOSED_BRACKET).val():(m.uniqueId=a.$("#attach-sessionId").val()+"-"+(new Date).getTime(),k=e(b,k),h(b,d.ITEM_ASSOC_NAME,m.uniqueId,k),k++,k=e(b,k),h(b,d.UNIQ_ITEM_ASSOC_NAME,m.uniqueId,k),k++,k=e(b,k),h(b,d.ITEM_ASSOC_TYPE_NAME,m.itemAssocTypeValue,k),k++);
k=e(b,k);h(b,d.ITEM_ASSOC_PROPERTIES_NAME,d.ITEM_ASSOC_PROPERTIES_VALUE,k)}function p(a,b){a=a.find(d.INPUT_VALUE+b+d.CLOSED_BRACKET);if(!a.length)return null;a=a[0].name.split(".");return 2<a.length?d.CUSTOM_VALUE_KEY+a[1]+"."+a[2]:null}function h(a,b,d,c){a.append('\x3cinput type\x3d"hidden" name\x3d"custom-name.1.'+c+'" value\x3d"'+b+'"/\x3e');a.append('\x3cinput type\x3d"hidden" name\x3d"custom-value.1.'+c+'" value\x3d"'+d+'"/\x3e')}function e(a,b){for(;0<a.find('input[name\x3d"custom-name.1.'+
b+'"]').length||0<a.find('input[name\x3d"custom-value.1.'+b+'"]').length;)b++;return b}var m={},d=m.ItemAssociationConstants={ITEM_ASSOC_NAME:"itemAssoc",UNIQ_ITEM_ASSOC_NAME:"UNIQ-itemAssoc",ITEM_ASSOC_TYPE_NAME:"itemAssocType",ATTACH_ITEM_ASSOC_TYPE_VALUE:"Attach",ITEM_ASSOC_RENDER_TYPE_NAME:"itemAssocRenderType",ITEM_ASSOC_RENDER_TYPE_VALUE:"renderAll",ITEM_ASSOC_PROPERTIES_NAME:"itemAssocProperties",ITEM_ASSOC_PROPERTIES_VALUE:"{\x26#34;QuantityEditable\x26#34;:\x26#34;1\x26#34;,\x26#34;QuantityInvarianceFactor\x26#34;:\x26#34;1\x26#34;}",
CUSTOM_VALUE_KEY:"custom-value.",INPUT_VALUE:"input[value\x3d'",INPUT_NAME:"input[name\x3d'",CLOSED_BRACKET:"']"},C=m.Marketplaces={IN:"A21TJRUUN4KGV"};m.uniqueId=null;m.itemAssocTypeValue="Attach";m.selectedBaseLightningDeal=!1;m.cartInitiateId=!1;m.FailureModes={ERROR_500:1,RESUBMIT_BUY_BOX:2,TRANSITION_TO_HUC:3,UNBIND_ATC:4,REBIND_ATC:5};var t=m.Selectors={ADD_TO_CART_BUTTON:"#add-to-cart-button",ATTACH_MARKETPLACE_ID:"#attach-marketplaceId",DISCRIMINATED_OFFERS_ENABLED:"#attach-discriminated-offers-enabled",
ATC_FORM:"#addToCart",INSTALLMENTS_FORM:"#mobile-installments",DSS_CART:".attach-cart-button",DSS_PROCEED:".attach-checkout-button",HAS_DDWL:"#attach-has-ddwl",ATTACH_HAS_RECOMMENDATIONS_FLAG:"#attach-has-recommendations"},q=m.Endpoints={PROCEED_TO_CHECKOUT:"/gp/cart/desktop/go-to-checkout.html?proceedToCheckout\x3dProceed",PROCEED_TO_CART:"/gp/cart/view/html",PROCEED_TO_SMART_WAGON:"/cart/smart-wagon"};m.buyButton=a.$(t.ADD_TO_CART_BUTTON);m.reject=function(b,d,c){return m.rejectPromise(a.$.Deferred(),
b,d,c)};m.getInputValueByNameAndIndex=function(b,d){b=a.$('input[name\x3d"'+b+"."+d+'"]')[0];return m.getInputValue(b)};m.getInputValue=function(b){return a.$(b).val()};m.rejectPromise=function(b,d,e,m){if(e&&e.count&&r.ue&&r.ue.count)if("string"===typeof e.count)r.ue.count(e.count,1);else if(a.$.isArray(e.count))for(var g=0;g<e.count.length;g++)r.ue.count(e.count[g],1);e&&e.information&&c.logError("string"===typeof e.information?{message:e.information}:e.information,e.level,e.attribution);return b.reject(d,
e,m)};m.pipeJSON=function(a){try{return JSON.parse(a)}catch(x){return m.reject(null,{count:"ATTACH_DSS_JSON_PARSE_FAILURE"})}};m.unescapeJson=function(a){if(!a)return null;a=a.replace(/\|\|/g,'"');return a=a.replace(/&pipe;/g,"||")};m.elementExists=function(b){return b?b instanceof a.$?0!==b.length:0!==a.$(b).length:!1};m.moduleExists=function(b){return(b=a.$("#"+b+"_feature_div").html())?0<b.trim().length:!1};m.isCurrencyOfPreferenceApplied=function(){return"true"===a.$("#attach-used-currency-of-preference").val()};
m.hasWarranty=function(){return m.elementExists("#attachSIDeprecated")&&m.elementExists("#attach-warranty-pane")||0<a.$("#warrantyEscapedJson").length};m.hasMonthlyWarranty=function(){return m.elementExists("#attach-monthly-warranty")};m.hasAccessories=function(){return"true"===a.$(t.ATTACH_HAS_RECOMMENDATIONS_FLAG).val()};m.hasDataDrivenWeblab=function(){return"true"===a.$(t.HAS_DDWL).val()};m.isDiscriminatedOffersEnabled=function(){return m.elementExists(t.DISCRIMINATED_OFFERS_ENABLED)?"true"===
a.$(t.DISCRIMINATED_OFFERS_ENABLED).val():a.$(t.ATTACH_MARKETPLACE_ID).val()===C.IN};m.addBaseProduct=function(b,d){var e=k.createRequest(m.getAtcForm());e.isValid()?(e=e.execute(),e.then(function(a){a.response&&!a.error&&"function"===typeof b?b(a):a.error&&"function"===typeof d&&d(a)}),c.logCount(c.CSM_METRICS.ATTACH_BASE_ATC_CLICK),a.trigger("attach:add-base-to-cart",e)):m.submitATCForm()};m.submitATCForm=function(){var b=m.getAtcForm();m.isDiscriminatedOffersEnabled()&&l(b);c.logCount(c.CSM_METRICS.ATTACH_BASE_ATC_CLICK);
b=b.serializeArray();var d=m.buyButton.attr("name"),e=m.buyButton.val();b.push({name:d,value:e});b=a.$.param(b);b=a.$.ajax({type:"POST",url:"/gp/product/handle-buy-box/ref\x3ddp_start-bbf_1_glance",data:b,headers:{Accept:"text/html,*/*"}});b.fail(function(a){c.logCount(c.CSM_METRICS.ATTACH_BASE_ATC_FAILURE);c.logError({message:"Base product ATC call failed: "+a.status})});a.trigger("attach:add-base-to-cart",b)};m.getAtcForm=function(){return m.buyButton.closest("form")};m.isMTAEnabledForAttach=function(){return!1};
m.getDeferredFromPromise=function(b){var d=a.$.Deferred();b.then(function(a){d.resolve(a)}).catch(function(a){d.reject(a)});return d.promise()};m.getPromiseFromDeferred=function(a){return new b(function(b,d){a.then(b).fail(d)})};m.bindEventToCallback=function(b,d,c){a.$(b).unbind(d,c);a.$(b).bind(d,c)};m.setupDesktopEgressButtons=function(){m.bindEventToCallback(t.DSS_CART,"click",function(){c.logCount(c.CSM_METRICS.ATTACH_CART_CLICK)});m.bindEventToCallback(t.DSS_PROCEED,"click",function(){c.logCount(c.CSM_METRICS.ATTACH_CHECKOUT_CLICK);
var a=q.PROCEED_TO_CHECKOUT;document.location=m.cartInitiateId?a+"\x26cartInitiateId\x3d"+m.cartInitiateId+"\x26ref_\x3ddp_atch_dss_proceed":a+"\x26ref_\x3ddp_atch_dss_proceed"})};m.proceedToCart=function(a){r.location="string"===typeof a?q.PROCEED_TO_CART+"?ref_\x3d"+a:q.PROCEED_TO_CART};m.proceedToSmartWagon=function(a,b){r.location=q.PROCEED_TO_SMART_WAGON+"?newItems\x3d"+a+","+b};m.isPromise=function(b){return b&&a.$.isFunction(b.then)&&a.$.isFunction(b.catch)};m.isCustomerLoggedIn=function(){return!!a.$("#attach-customerId, #attach-customer-id").val()};
return m});"use strict";q.when("A","attach-common","attach-logging","attach-baselink","attach-weblabs","attach-variant-registration","attach.utilities.focus-management").register("attach-desktop-warranty-pane",function(a,b,f,c,k,l,p){var h={name:"warranty"},e=h.Selectors={ASIN:"#attach-warranty-asin",PRICE_FORMATTED:"#attach-accessory-price-warranty",PRICE_AMOUNT:"#attach-accessory-price-warranty-amount",BASE_ASIN:'input[name\x3d"items[0.base][asin]"], #ASIN',MARKETPLACE_ID:"#attach-marketplaceId",
BASE_CURRENCY_SYMBOL:"#attach-base-product-currency-symbol",ATC_QUANTITY:"#quantity",ATC_DEAL_QUANTITY:"#dealx_quantity_dropdown",ATC_WARRANTY:".attach-warranty-input",JSON_DATA:"#warrantyEscapedJson",PANE:"#attach-warranty-pane",PANE_IMAGE:"#attach-sheet-warranty-image",PANE_WARRANTY_IMAGE:".attach-warranty-image",PANE_UPSELL_IMAGE:"#attach-sheet-warranty-upsell-image",PANE_ADD_BUTTON:"#attachSiAddCoverage",PANE_ADD_BUTTON_T1:".attachSiAddCoverage",PANE_NO_BUTTON:"#attachSiNoCoverage",PANE_WARRANTY_TITLE:"#attach-warranty-displayTitle",
PANE_EXPERIMENT_DISPLAY:"#attach-warranty-experiment-display",PANE_REGULAR_DISPLAY:"#attach-warranty-display",WARRANTY_CHECKBOX:".dssMbs__r input[type\x3dcheckbox]",WARRANTY_NOT_ADDED:"#attach-no-warranty-alert",WARRANTY_NOT_ADDED_T1:".attach-no-warranty-alert",WARRANTY_LEARN_MORE_HEADER:".attach-warranty-learn-more",WARRANTY_REVIEW_LINK:".warranty-review-link",WARRANTY_POLICY_DOCUMENTS:".warranty-policy-documents",WARRANTY_DETAIL_PAGE_LINK:".warranty-detail-page-link",WARRANTY_BOX:".attach-warranty-box",
BUY_BOX:"#buybox",PANE_LD:"#attach-warranty-pane-ld",PANE_ADD_BUTTON_LD:"#attachSiAddCoverage-ld",PANE_ADD_BUTTON_LD_T1:".attachSiAddCoverage-ld",PANE_NO_BUTTON_LD:"#attachSiNoCoverage-ld"};h.getWarrantyLoggingPayload=function(){var c=a.$(e.ASIN).val(),d=a.$(e.PRICE_FORMATTED),f=a.$(e.PRICE_AMOUNT);return!k.servicesInterstitialDeprecated()&&b.elementExists(f)?{asin:c,priceFormatted:d.text().trim(),priceDecimal:parseFloat(f.val())||null,currencySymbol:a.$(e.BASE_CURRENCY_SYMBOL).val()||null}:{asin:c,
priceFormatted:d.text().trim(),priceDecimal:null,currencySymbol:null}};h.appendWarrantyToATCForm=function(m,d){if(a.$(e.BASE_ASIN).val()&&m&&d){var f=b.getAtcForm();f.append('\x3cinput type\x3d"hidden" id\x3d"useABBHandler" class\x3d"attach-warranty-input" name\x3d"useABBHandler" value\x3d"1" /\x3e');var h=1;k.isWarrantyTwisterPlusDesktopEnabled()&&(h+=1);h=f.find("input[name^\x3d'offeringID']").length+h;var l=a.$(e.BUY_BOX).find("form").filter(":visible").first().find('[name\x3d"items[0.base][quantity]"]').val()||
1,g="quantity."+h,p="asin."+h;f.find('input[name\x3d"'+g+'"]').remove();f.find('input[name\x3d"'+p+'"]').remove();f.append('\x3cinput type\x3d"hidden" id\x3d"'+g+'" name\x3d"'+g+'" value\x3d"'+l+'" class\x3d"attach-warranty-input" /\x3e');f.append('\x3cinput type\x3d"hidden" id\x3d"'+p+'" name\x3d"'+p+'" value\x3d"'+m+'" class\x3d"attach-warranty-input" /\x3e');f.append('\x3cinput type\x3d"hidden" id\x3d"offeringID.'+h+'" name\x3d"offeringID.'+h+'" value\x3d"'+d+'" class\x3d"attach-warranty-input"/\x3e');
f.append('\x3cinput type\x3d"hidden" name\x3d"items[0.warranty][quantity]" value\x3d"'+l+'" class\x3d"attach-warranty-input" /\x3e');f.append('\x3cinput type\x3d"hidden" name\x3d"items[0.warranty][asin]" value\x3d"'+m+'" class\x3d"attach-warranty-input" /\x3e');f.append('\x3cinput type\x3d"hidden" name\x3d"items[0.warranty][offerListingId]" value\x3d"'+d+'" class\x3d"attach-warranty-input" /\x3e');m=f.find('input[name\x3d"itemCount"]');0===m.length?f.append('\x3cinput type\x3d"hidden" name\x3d"itemCount" value\x3d"'+
h+'"\x3e'):m[0].value=h;a.$("#atch__bl").length&&c.createBaseLinkFormFields(h+1,f)}};h.clearWarrantyFromATCForm=function(){b.getAtcForm().find(e.ATC_WARRANTY).remove()};h.load=function(c){if(k.servicesInterstitialDeprecated()){if(b.elementExists(e.PANE))a.$(e.PANE).removeClass("aok-hidden");else return b.reject(b.FailureModes.RESUBMIT_BUY_BOX,{count:"ATTACH_DSS_WARRANTY_LOAD_FAILURE"});if(b.selectedBaseLightningDeal)if(b.elementExists(e.PANE_LD))a.$(e.PANE+", "+e.PANE_LD).toggleClass("aok-hidden");
else return b.reject(b.FailureModes.UNBIND_ATC);b.elementExists(e.PANE_EXPERIMENT_DISPLAY)&&a.$(e.PANE_EXPERIMENT_DISPLAY).remove()}else{if(b.elementExists(e.JSON_DATA)){var d=b.unescapeJson(a.$(e.JSON_DATA).val());d=JSON.parse(d)}return d?h.renderClientSide(c,d):b.reject(b.FailureModes.RESUBMIT_BUY_BOX,{count:"ATTACH_DSS_WARRANTY_LOAD_FAILURE"})}};h.renderClientSide=function(b,d){var c="",e=d.baseASIN,m="dp_atch_dss_w_lm_"+e+"_"+d.asin,g="dp_atch_dss_w_r_"+e+"_"+d.asin;e="dp_atch_dss_w_lm_"+e+"_"+
d.asin;var f=a.$("#stringTranslation-si-warranty-title").val(),k=a.$("#stringTranslation-si-accident-protection").val(),h=a.$("#stringTranslation-si-from").val(),l=a.$("#stringTranslation-si-rating-out-of-5-stars").val(),n=a.$("#stringTranslation-item-added-to-cart").val(),p=a.$("#stringTranslation-desktop-attach-accessory-failed-add-to-cart").val(),u=a.$("#stringTranslation-desktop-attach-accessory-retry").val(),E=a.$("#stringTranslation-si-add-coverage").val(),w=a.$("#stringTranslation-si-no-thanks").val(),
F=a.$("#stringTranslation-services-bundle-detail-link").val();c+='   \x3cdiv id\x3d"attach-warranty-pane" class\x3d"a-section"\x3e\n       \x3cdiv id\x3d"attach-warranty" class\x3d"a-section attach-sidesheet-card"\x3e\n           \x3cinput type\x3d"hidden" name\x3d"" value\x3d"'+d.asin+'" id\x3d"attach-warranty-asin"\x3e\n           \x3ch1 class\x3d"a-size-medium a-spacing-none a-color-base a-text-center"\x3e'+f+'\x3c/h1\x3e\n           \x3chr class\x3d"a-spacing-base a-spacing-top-small a-divider-normal attach-warranty-divider"\x3e\n           \x3cdiv class\x3d"a-row a-spacing-micro"\x3e\n';
null!==d.thumbImage&&(c+='                \x3cdiv class\x3d"a-column a-span2"\x3e\n                    \x3cimg id\x3d"attach-sheet-warranty-image" src\x3d"" data-image-url\x3d"'+d.thumbImage+'" class\x3d"attach-accessory-image"\x3e\n                \x3c/div\x3e\n');c+='                \x3cdiv class\x3d"a-column a-span10 a-span-last"\x3e\n                    \x3ca class\x3d"a-size-large a-spacing-micro a-link-normal a-color-base" id\x3d"attach-warranty-displayTitle" target\x3d"_blank" rel\x3d"noopener" href\x3d"/dp/'+
d.asin+"/ref\x3d"+m+'"\x3e\n                        \x3cstrong\x3e'+(null!==d.displayTitle?d.displayTitle:k.replace("${brandName}",d.brandName))+'\x3c/strong\x3e\n                    \x3c/a\x3e\n                    \x3cbr\x3e\n                    \x3cspan class\x3d"a-size-base a-color-secondary"\x3e'+h+" "+d.merchantName+"\x3c/span\x3e\n";Number(d.averageRating)&&Number(d.numReviews)&&Number(d.numFullStars)&&"boolean"===typeof d.hasHalfStar&&(m=l.replace("${averageRating}",d.averageRating),c+='                    \x3cdiv class\x3d"a-icon-row a-spacing-micro"\x3e\n                        \x3ca class\x3d"a-link-normal" href\x3d"/product-reviews/'+
d.asin+"/ref\x3d"+g+'?ie\x3dUTF8\x26amp;showViewpoints\x3d1"\x3e\n                            \x3ci class\x3d"a-icon a-icon-star a-star-'+d.numFullStars+(d.hasHalfStar?"-5":"")+'"\x3e\x3cspan class\x3d"a-icon-alt"\x3e'+m+'\x3c/span\x3e\x3c/i\x3e\n                        \x3c/a\x3e\n                        \x3ca class\x3d"a-link-normal" href\x3d"/product-reviews/'+d.asin+"/ref\x3d"+g+'?ie\x3dUTF8\x26amp;showViewpoints\x3d1"\x3e\n                            '+d.numReviews+"\n                        \x3c/a\x3e\n                    \x3c/div\x3e\n");
null!==d.buyingPriceAmount&&(c+='                    \x3cinput id\x3d"attach-accessory-price-warranty-amount" type\x3d"hidden" value\x3d"'+d.buyingPriceAmount+'"\x3e\n');c+='                    \x3cspan id\x3d"attach-accessory-price-warranty" class\x3d"a-size-large a-color-base attach-warranty-price"\x3e'+d.formattedBuyingPrice+'\x3c/span\x3e\n                \x3c/div\x3e\n            \x3c/div\x3e\n            \x3cdiv class\x3d"a-row"\x3e\n                \x3cdiv class\x3d"a-column a-span12"\x3e\n                    \x3cdiv id\x3d"warrantyBulletRowWrapper" class\x3d"a-section"\x3e\n                        \x3cdiv class\x3d"a-row a-spacing-micro"\x3e\n                            \x3cul class\x3d"a-unordered-list a-vertical a-spacing-none"\x3e\n';
for(g=0;g<d.bulletPoints.length;g++)c+='                                \x3cli\x3e\x3cspan class\x3d"a-list-item"\x3e'+d.bulletPoints[g].text+"\x3c/span\x3e\x3c/li\x3e\n";c+='                            \x3c/ul\x3e\n                        \x3c/div\x3e\n                        \x3cdiv id\x3d"attachWarrantyButtonWrapper" class\x3d"a-section a-box-inner a-color-alternate-background"\x3e\n                            \x3cdiv id\x3d"attachWarrantyButtonInnerWrapper" class\x3d"a-section a-box-inner"\x3e\n                                \x3cdiv id\x3d"attach_add_accessory_alert_warranty" class\x3d"a-box a-alert-inline a-alert-inline-success aok-hidden attach_add_accessory_alert"\x3e\n                                    \x3cdiv class\x3d"a-box-inner a-alert-container"\x3e\n                                        \x3ci class\x3d"a-icon a-icon-alert"\x3e\x3c/i\x3e\n                                        \x3cdiv class\x3d"a-alert-content"\x3e\n                                            \x3cspan class\x3d"a-size-base a-color-success"\x3e'+
n+'\x3c/span\x3e\n                                        \x3c/div\x3e\n                                    \x3c/div\x3e\n                                \x3c/div\x3e\n                                \x3cdiv id\x3d"attach_add_accessory_error_warranty" class\x3d"a-box a-alert-inline a-alert-inline-error aok-hidden attach_add_accessory_alert" aria-live\x3d"assertive" role\x3d"alert"\x3e\n                                    \x3cdiv class\x3d"a-box-inner a-alert-container"\x3e\n                                        \x3ci class\x3d"a-icon a-icon-alert"\x3e\x3c/i\x3e\n                                        \x3cdiv class\x3d"a-alert-content"\x3e\n                                            \x3cspan class\x3d"a-size-base"\x3e\n                                                '+
p+'\x3cbr\x3e\n                                            \x3c/span\x3e\n                                            \x3ca class\x3d"a-link-normal attach-add-to-cart-retry" href\x3d"#"\x3e\n                                                '+u+'\n                                            \x3c/a\x3e\n                                        \x3c/div\x3e\n                                    \x3c/div\x3e\n                                \x3c/div\x3e\n                                \x3cspan class\x3d"attach_add_accessory_spinner_warranty a-spinner a-spinner-small attach-spinner aok-hidden"\x3e\x3c/span\x3e\n                                \x3cdiv class\x3d"a-section attach-warranty-button-row"\x3e\n                                    \x3cdiv class\x3d"a-button-stack"\x3e\n                                        \x3cspan id\x3d"attachSiAddCoverage" class\x3d"a-button a-button-primary attach-si-add-client"\x3e\n                                            \x3cspan class\x3d"a-button-inner"\x3e\n                                                \x3cbutton id\x3d"attachSiAddCoverage-announce" data-asin\x3d"'+
d.asin+'" data-offering-id\x3d"'+d.oid+'" class\x3d"a-button-text" type\x3d"button"\x3e\n                                                    '+E+'\n                                                \x3c/button\x3e\n                                            \x3c/span\x3e\n                                        \x3c/span\x3e\n                                        \x3cspan id\x3d"attachSiNoCoverage" class\x3d"a-button"\x3e\n                                            \x3cspan class\x3d"a-button-inner"\x3e\n                                                \x3cbutton id\x3d"attachSiNoCoverage-announce" class\x3d"a-button-text" type\x3d"button"\x3e\n                                                    '+
w+'\n                                                \x3c/button\x3e\n                                            \x3c/span\x3e\n                                        \x3c/span\x3e\n                                    \x3c/div\x3e\n                                \x3c/div\x3e\n                            \x3c/div\x3e\n                        \x3c/div\x3e\n                    \x3c/div\x3e\n                \x3c/div\x3e\n            \x3c/div\x3e\n            \x3ca class\x3d"a-link-normal" target\x3d"_blank" rel\x3d"noopener" href\x3d"/dp/'+
d.asin+"/ref\x3d"+e+'"\x3e\n                '+F+"\n            \x3c/a\x3e\n        \x3c/div\x3e\n    \x3c/div\x3e\n";b.$container.append(c)};h.onAttachAddBaseToCart=function(a){b.isPromise(a)?a.finally(h.clearWarrantyFromATCForm):a.always(h.clearWarrantyFromATCForm)};h.closeSheetAndSubmitForm=function(){if(k.isDssMbsEnhancementEnabled()){var c=a.$(e.WARRANTY_CHECKBOX+":checked").get(0),d=b.getInputValueByNameAndIndex("asin",c.name);c=b.getInputValueByNameAndIndex("warrantyPrice",c.name);f.logWarrantyAddToCart(f.getWarrantyPayload(d,
c))}else f.logWarrantyAddToCart(h.getWarrantyLoggingPayload());k.servicesInterstitialDeprecated()&&!b.hasAccessories()||b.addBaseProduct(function(a){"add-items.incomplete-add.error/v1"===a.response.type?f.logCount(f.CSM_METRICS.WARRANTY_DSS_WARRANTY_PANE_ATC_CART_API_INCOMPLETE):f.logCount(f.CSM_METRICS.WARRANTY_DSS_WARRANTY_PANE_ATC_CART_API_SUCCESS)},function(){f.logCount(f.CSM_METRICS.WARRANTY_DSS_WARRANTY_PANE_ATC_CART_API_FAILURE)});h.sheet.next()};h.setSelectedWarrantyOptionDataOnATCForm=function(){var c=
a.$(e.WARRANTY_CHECKBOX+":checked").get(0);if(c){var d=c.name;c=b.getInputValueByNameAndIndex("asin",d);d=b.getInputValueByNameAndIndex("offerId",d);h.appendWarrantyToATCForm(c,d);h.closeSheetAndSubmitForm()}else k.isLdDssMbsEnhancementEnabled()?a.$(e.WARRANTY_NOT_ADDED_T1).show():a.$(e.WARRANTY_NOT_ADDED).show()};h.setSelectedWarrantyOptionDataOnATCFormEU=function(c){var d=c.find(".a-button-input").attr("name"),f=a.$(e.WARRANTY_CHECKBOX+":checked").get(0);f&&d==f.name?(d=f.name,c=b.getInputValueByNameAndIndex("asin",
d),d=b.getInputValueByNameAndIndex("offerId",d),h.appendWarrantyToATCForm(c,d),h.closeSheetAndSubmitForm()):k.isLdDssMbsEnhancementEnabled()?c.closest(e.WARRANTY_BOX).find(e.WARRANTY_NOT_ADDED_T1).show():a.$(e.WARRANTY_NOT_ADDED+"-"+d).show()};h.setup=function(m){h.sheet=m;a.$(e.PANE).hide();if(k.isDssMbsEnhancementEnabled())a.loadImageManually(a.$(e.PANE_WARRANTY_IMAGE).filter("[data-a-image-source]")),a.$("div[id^\x3dattach-no-warranty-alert-]").hide(),a.$(e.WARRANTY_NOT_ADDED).hide(),a.$(e.WARRANTY_NOT_ADDED_T1).hide(),
a.$(e.PANE_LD).find(e.WARRANTY_CHECKBOX).prop("checked",!1),a.$(e.PANE).find(e.WARRANTY_CHECKBOX).prop("checked",!1);else{var d=a.$(e.PANE_IMAGE).attr("data-image-url");a.$(e.PANE_IMAGE).attr("src",d)}k.isDssMbsEuComplianceActive()&&k.isDssMbsEnhancementEnabled()?a.$(e.PANE_ADD_BUTTON_T1).click(function(){h.setSelectedWarrantyOptionDataOnATCFormEU(a.$(this))}):a.$(e.PANE_ADD_BUTTON).click(function(){if(k.isDssMbsEnhancementEnabled())h.setSelectedWarrantyOptionDataOnATCForm();else{var b=a.$(this).find("button");
k.servicesInterstitialDeprecated()&&(b=a.$(this).find("[data-asin]"));var d=b.attr("data-asin");b=b.attr("data-offering-id");h.appendWarrantyToATCForm(d,b);h.closeSheetAndSubmitForm()}});k.isDssMbsEnhancementEnabled()&&(a.$(e.WARRANTY_CHECKBOX).change(function(d){var c=this;d="cn";var k=c.name,g=a.$(this).closest(e.WARRANTY_BOX).find("input[name\x3d'asin."+k+"']").val();c.checked&&(d="cy",a.$(e.WARRANTY_NOT_ADDED).hide(),a.$(e.WARRANTY_NOT_ADDED_T1).hide(),a.$("div[id^\x3dattach-no-warranty-alert-]").hide(),
a.$(b.selectedBaseLightningDeal?e.PANE_LD:e.PANE).find(e.WARRANTY_CHECKBOX).each(function(b){c!==this&&a.$(this).prop("checked",!1)}));f.logWarrantyWidgetInteraction({index:k,asin:g,action:d})}),a.$(e.WARRANTY_LEARN_MORE_HEADER).click(function(){f.logWarrantyInteractionData("LEARN_MORE_CLICK",this)}),a.$(e.WARRANTY_REVIEW_LINK).click(function(){f.logWarrantyInteractionData("REVIEW_CLICK",this)}),a.$(e.WARRANTY_DETAIL_PAGE_LINK).click(function(){f.logWarrantyInteractionData("DETAIL_PAGE_LINK_CLICK",
this)}),a.$(e.WARRANTY_POLICY_DOCUMENTS).click(function(){f.logWarrantyInteractionData("POLICY_DOCUMENTS_CLICK",this)}));a.$(e.PANE_NO_BUTTON).click(function(){k.servicesInterstitialDeprecated()&&!b.hasAccessories()||b.addBaseProduct();m.next()});k.isDssMbsEuComplianceActive()&&k.isDssMbsEnhancementEnabled()?a.$(e.PANE_ADD_BUTTON_LD_T1).click(function(){var b=function(b){f.logCount(f.CSM_METRICS.ATTACH_BASE_LD_WARRANTY_SUCCESS);q.when("EWC").execute("attach-everywhere-cart",function(a){a.refresh()});
b=a.$(e.WARRANTY_CHECKBOX+":checked").get(0);a.$(b).closest(e.WARRANTY_BOX).find("img.attach-warranty-image").clone().removeAttr("class").removeAttr("id").attr("alt","warranty image").appendTo("#attach-ld-image-container");m.next()},d=function(a){f.logCount(f.CSM_METRICS.ATTACH_BASE_LD_WARRANTY_FAILURE);m.next()},h=a.$(this).find(".a-button-input").attr("name"),g=a.$(e.WARRANTY_CHECKBOX+":checked").get(0);if(g&&g.name==h){var l=a.$(g).closest(e.WARRANTY_BOX);h=l.find("input[name\x3d'asin."+g.name+
"']").val();g=l.find("input[name\x3d'offerId."+g.name+"']").val();g={warrantyAsin:h,offeringId:g,addWarranty:1,quantity:a.$(e.ATC_DEAL_QUANTITY).val()||1};g.baseItemAsin=a.$(e.BASE_ASIN).val();c.addLinkedWarranty(g,b,d)}else k.isLdDssMbsEnhancementEnabled()?a.$(this).closest(e.WARRANTY_BOX).find(e.WARRANTY_NOT_ADDED_T1).show():a.$(e.WARRANTY_NOT_ADDED+"-"+h).show()}):a.$(e.PANE_ADD_BUTTON_LD).click(function(){var b=function(b){f.logCount(f.CSM_METRICS.ATTACH_BASE_LD_WARRANTY_SUCCESS);q.when("EWC").execute("attach-everywhere-cart",
function(a){a.refresh()});k.isDssMbsEnhancementEnabled()?(b=a.$(e.WARRANTY_CHECKBOX+":checked").get(0),b=a.$(b).closest(e.WARRANTY_BOX).find("img.attach-warranty-image")):b=a.$("#attach-sheet-warranty-image");b.clone().removeAttr("class").removeAttr("id").attr("alt","warranty image").appendTo("#attach-ld-image-container");m.next()},d=function(a){f.logCount(f.CSM_METRICS.ATTACH_BASE_LD_WARRANTY_FAILURE);m.next()};if(k.isDssMbsEnhancementEnabled()){var h=a.$(e.WARRANTY_CHECKBOX+":checked").get(0);if(h){var g=
a.$(h).closest(e.WARRANTY_BOX),l=g.find("input[name\x3d'asin."+h.name+"']").val();h=g.find("input[name\x3d'offerId."+h.name+"']").val();l={warrantyAsin:l,offeringId:h,addWarranty:1,quantity:a.$(e.ATC_DEAL_QUANTITY).val()||1};l.baseItemAsin=a.$(e.BASE_ASIN).val();c.addLinkedWarranty(l,b,d)}else k.isLdDssMbsEnhancementEnabled()?a.$(e.WARRANTY_NOT_ADDED_T1).show():a.$(e.WARRANTY_NOT_ADDED).show()}else l=a.$(e.PANE_ADD_BUTTON_LD).find("input"),l={warrantyAsin:l.attr("data-asin"),offeringId:l.attr("data-offering-id"),
addWarranty:1,quantity:a.$(e.ATC_DEAL_QUANTITY).val()||1},l.baseItemAsin=a.$(e.BASE_ASIN).val(),c.addLinkedWarranty(l,b,d)});a.$(e.PANE_NO_BUTTON_LD).click(function(){m.next()});a.off("attach:add-base-to-cart",h.onAttachAddBaseToCart);a.on("attach:add-base-to-cart",h.onAttachAddBaseToCart)};h.show=function(){b.selectedBaseLightningDeal?b.selectedBaseLightningDeal&&a.$(e.PANE_LD).show():a.$(e.PANE).removeClass("aok-hidden");a.$(e.PANE).fadeIn(400,h.setFocus);k.isDssMbsEnhancementEnabled()?b.selectedBaseLightningDeal?
a.$(e.PANE_LD).find(e.WARRANTY_CHECKBOX).each(function(b){var d=a.$(this).closest(e.WARRANTY_BOX),c=d.find("input[name\x3d'asin."+b+"']").val();b=d.find("input[name\x3d'warrantyPrice."+b+"']").val();f.logWarrantyImpression(f.getWarrantyPayload(c,b))}):a.$(e.PANE).find(e.WARRANTY_CHECKBOX).each(function(){var a=b.getInputValueByNameAndIndex("asin",this.name),d=b.getInputValueByNameAndIndex("warrantyPrice",this.name);f.logWarrantyImpression(f.getWarrantyPayload(a,d))}):f.logWarrantyImpression(h.getWarrantyLoggingPayload());
a.$(e.PANE).find("h1").first().attr("id","attach-warranty-header");h.sheet&&h.sheet.$container&&h.sheet.$container.attr("aria-labelledby","attach-warranty-header")};h.hide=function(){a.$(e.PANE+", "+e.PANE_LD).fadeOut()};h.setFocus=function(){p.focusDescendant(a.$(e.PANE).get(0),"first");p.focusDescendant(a.$(e.PANE_LD).get(0),"first")};return h});"use strict";q.when("A","attach-common","attach-weblabs","attach-logging","attach-variant-registration","attach.utilities.focus-management","attach.amazonapi.client",
"attach.amazonapi.cart.add-items","attach.amazonapi.cart.summary","attach.amazonapi.deals.claim-and-add-to-cart","attach.amazonapi.products.productV2","attach.amazonapi.products.media-builder","attach.utilities.strings").register("attach-desktop-accessories-pane",function(a,b,f,c,k,l,p,h,e,m,d,C,t){function D(b){b=a.$('\x3cdiv class\x3d"a-alert-content"\x3e\x3c/div\x3e').append(b);var d=a.$('\x3ci class\x3d"a-icon a-icon-alert"\x3e\x3c/i\x3e');b=a.$('\x3cdiv class\x3d"a-box-inner a-alert-container"\x3e\x3c/div\x3e').append(d).append(b);
b=a.$('\x3cdiv class\x3d"a-box a-alert a-alert-error" role\x3d"alert"\x3e\x3c/div\x3e').append(b);return a.$('\x3cdiv class\x3d"attach-sidesheet-card attach-add-to-cart-message-card aok-hidden"\x3e\x3c/div\x3e').append(b)}var g={name:"accessories"},x=!0,B,A=!1;g.isEmptyAccessoryList=!1;var z=g.Endpoints={RENDER:"/gp/product/ajax?experienceId\x3dattach",RENDER_FLOW:"/gp/product/ajax/attach"},n=g.Selectors={BASE_ASIN:"#attach-baseAsin",QUANTITY:"#quantity",MARKETPLACE_ID:"#attach-marketplaceId",LANGUAGE_OF_PREFRENCE:"#attach-languageOfPreference",
PANE:"#attach-accessory-pane",PANE_CLOSE_BUTTON:"#attach-close_sideSheet-link",PANE_CART_BASE_ALERT_IMAGE_AREA:"#attach-added-to-cart-alert-and-image-area",PANE_CART_BASE_ALERT:"#attachDisplayAddBaseAlert",PANE_CART_BASE_SUCCESS_ALERT:"#attachAddBaseItemSuccessAlert",PANE_CART_BASE_ERROR_ALERT:"#attachAddBaseItemErrorAlert",PANE_CART_BASE_INITIAL_IMAGE:"#attach-sheet-view-base-product-image",PANE_CART_BASE_HUC_IMAGE:".huc-image-wrapper",PANE_CART_BLOCK:".attach-primary-atc-confirm-box",PANE_CART_BLOCK_INNER:"#attach-added-to-cart-message",
PANE_CART_BLOCK_SUBTOTAL_LABEL:"#attach-accessory-cart-total-string",PANE_CART_BLOCK_SUBTOTAL_PRICE:"#attach-accessory-cart-subtotal",PANE_CART_BLOCK_CORE_FREE_SHIPPING_MESSAGE:"#attach-core-free-shipping-message",PANE_CART_BLOCK_DESCRIPTION_FAILURE_MESSAGE:"#attach-cart-description-failure",PANE_CART_BLOCK_PROCEED_TO_CHECKOUT:"#attach-accessory-proceed-to-checkout-text",PANE_CART_SPINNER:"#attach-add-to-cart-message-spinner",PANE_VIEW_CART_BUTTON:"#attach-sidesheet-view-cart-button",PANE_CHECKOUT_BUTTON:"#attach-sidesheet-checkout-button",
PANE_CART_TEMPLATE_SUBTOTAL_SINGLE:"#attach-string-cart-subtotal-single",PANE_CART_TEMPLATE_SUBTOTAL_MULTIPLE:"#attach-string-cart-subtotal-multiple",PANE_CART_TEMPLATE_PROCEED_TO_CHECKOUT_SINGLE:"#attach-string-cart-ptc-button-single",PANE_CART_TEMPLATE_PROCEED_TO_CHECKOUT_MULTIPLE:"#attach-string-cart-ptc-button-multiple",PANE_CART_GENERIC_ERROR_MESSAGE:"#attach-string-cart-generic-error",PANE_CART_TRY_AGAIN_MESSAGE:"#attach-string-cart-try-again",PANE_HUC_MESSAGE:".attach-add-to-cart-message-card",
PANE_ACCESORIES_CARD:"#attach-accessories",PANE_CATEGORIZED_ACCESSORIES_TILES_CARD:"#attach-categorized-accessories-tiles",PANE_ACCESSORY_RETRY_BUTTON:".attach-add-to-cart-retry",PANE_ACCESSORY_ADD_DECLARATIVES:'.a-declarative[data-action\x3d"attach-accessory-add"]',PANE_ACCESSORY_IMAGE:".attach-accessory-image",PANE_ACCESSORY_ASIN:".attach-accessory-asin",PANE_ACCESSORY_ADD_BUTTON_PREFIX:"#attach_add_accessory_button_",PANE_ACCESSORY_ADD_SPINNER_PREFIX:"#attach_add_accessory_spinner_",PANE_ACCESSORY_ADD_SUCCESS_PREFIX:"#attach_add_accessory_alert_",
PANE_ACCESSORY_ADD_ERROR_PREFIX:"#attach_add_accessory_error_",PANE_ACCESSORY_FIRST_ASIN:"#attach_accessory_dp_1",PANE_CATEGORIZED_ACCESSORIES_CARD:"#attach-categorized-accessories",PANE_ACCESSORY_TITLE:".attach-accessory-title",PANE_ACCESSORY_TILE_ITEM:".attach-accessory-tile",PANE_ACCESSORY_TILE_ITEM_PREFIX:"#attach-accessory-tile-",PANE_ACCESSORY_CAROUSEL:"#attach-accessories .a-carousel-container",PANE_ACCESSORY_CARD:"#attach-accessories.card-expandable",PANE_ACCESSORY_CARD_SEE_MORE:".card-toggle-see-more",
PANE_ACCESSORY_CARD_SEE_LESS:".card-toggle-see-less",PANE_ACCESSORY_CARD_PEEK_CONTENT:".card-peek-content",PANE_ACCESSORY_CARD_EXPAND_CONTENT:".card-expand-content",PANE__DATA_CATEGORY_VIEW:"categoryView",PANE__DATA_ASIN_INDEX:"asinindex",PANE_ACCESSORY_LIGHTNING_DEAL:".attach-accessory-lightning-deal",PANE_ACCESSORY_LIGHTNING_DEAL_PREFIX:"#attach-accessory-lightning-deal-",PANE_ACCESSORY_LIGHTNING_DEAL_JOIN_WAITLIST_PREFIX:"#attach-accessory-deal-on-waitlist-",PANE_ACCESSORY_CSRF_TOKEN:"#attach-accessory-deal-csrf-token",
DEAL_QUANTITY:"#dealx_quantity_dropdown",DEBUG_IS_DEBUG:"#attach-debug-isDebug",DEBUG_QUERY_STRING:"#attach-debug-queryString"},v=g.AccessoryAddStatus={INITIAL:0,ADDING:1,SUCCESS:2,ERROR:3};g.load=function(d){q.now("attach-external-atc-interceptor").execute(function(a){B=a});a.trigger("LOADED_ACCESSORIES_PANE_SUCCESSFULLY");var c=a.$.Deferred();q.now("dp-util-cookie").execute(function(d){d&&d("session-id")!==a.$("#attach-sessionId").val()&&b.rejectPromise(c,b.FailureModes.TRANSITION_TO_HUC,{count:"ATTACH_DSS_INVALID_SESSION_ID",
information:"Unexpected session ID received; expected "+a.$("#attach-sessionId").val()+" but cookie value was "+d("session-id")})});var e=f.isFlowMigrationEnabled()?z.RENDER_FLOW:z.RENDER;e=a.$.get(e,{asin:a.$(n.BASE_ASIN).val()});a.$.when(e).done(function(e){var u=a.$(e.trim());u.is(n.PANE)?(g.isEmptyAccessoryList=0===u.find(n.PANE_ACCESSORY_ASIN).length,g.isEmptyAccessoryList?b.rejectPromise(c,b.FailureModes.TRANSITION_TO_HUC,{count:"ATTACH_DSS_RENDER_FAILURE_INVALID_HTML",information:"Failed to render DSS: Accessory list is empty"}):
(d.$container.append(a.$(e)),c.resolve())):b.rejectPromise(c,b.FailureModes.TRANSITION_TO_HUC,{count:"ATTACH_DSS_RENDER_FAILURE",information:"Failed to render DSS: Pane is missing"})}).fail(function(){b.rejectPromise(c,b.FailureModes.TRANSITION_TO_HUC,{count:"ATTACH_DSS_RENDER_FAILURE",information:"Failed to render DSS: network request failed"})});return c.promise()};g.onAttachAddBaseToCart=function(a){x=!1;b.isPromise(a)||(a=b.getPromiseFromDeferred(a));a.then(g.handleAddBaseAndGetCartDescription).catch(function(a){q.logError(a,
"Base product add to cart failed: ","ERROR","attach-desktop-accessories-pane");g.sheet.fail(b.FailureModes.ERROR_500)})};g.runOnceSetup=function(){A||(A=!0,a.declarative("attach-accessory-add","click",function(b){var d=b.$currentTarget,e=b.data,u=e.a,f=e.oid,k=e.isLightningDeal;e=e.isPEDOTD;c.logCount(c.CSM_METRICS.ATTACH_UPSELL_ATC_CLICK);c.beginLatencyCapture(c.CSM_METRICS.ATTACH_UPSELL_ATC_LATENCY);b=!0===a.$(n.PANE_CATEGORIZED_ACCESSORIES_CARD).data(n.PANE__DATA_CATEGORY_VIEW)?a.$(b.$target).data(n.PANE__DATA_ASIN_INDEX):
a.$(n.PANE_ACCESSORY_ADD_DECLARATIVES).index(d);k||e?g.addAccessoryToCartWithDeal(b,u,k):g.addAccessoryToCart(u,f,b)}))};g.setup=function(d){g.runOnceSetup();a.$(n.PANE).hide();g.sheet=d;a.off("attach:add-base-to-cart",g.onAttachAddBaseToCart);a.on("attach:add-base-to-cart",g.onAttachAddBaseToCart);b.setupDesktopEgressButtons();a.$(n.PANE_ACCESSORY_RETRY_BUTTON).click(function(){var b=a.$(this).attr("data-asin"),d=a.$(this).attr("data-oid"),c=a.$(this).attr("data-idx");g.addAccessoryToCart(b,d,c)});
a.$(n.PANE).find(n.PANE_CLOSE_BUTTON).appendTo(n.PANE_CART_BLOCK);a.$(n.PANE_CLOSE_BUTTON).click(d.next);a.$(n.PANE_ACCESSORY_IMAGE).each(function(){a.$(this).attr("src",a.$(this).attr("data-image-url"))});a.$(n.PANE_ACCESSORY_LIGHTNING_DEAL).each(function(){var b=a.$(this).data().idx;g.updateLightningDealTimer(b);g.initializeLightningDealStatusRefresher(b)});0===a.$(n.PANE_CART_GENERIC_ERROR_MESSAGE).length&&a.$(n.PANE_CART_BLOCK).append(a.$("\x3cspan\x3e\x3c/span\x3e").attr("id","attach-string-cart-generic-error").addClass("aok-hidden").text(a.$(".attach_add_accessory_alert.a-alert-inline-error .a-alert-content span").first().text()));
0===a.$(n.PANE_CART_TRY_AGAIN_MESSAGE).length&&a.$(n.PANE_CART_BLOCK).append(a.$("\x3cspan\x3e\x3c/span\x3e").attr("id","attach-string-cart-try-again").addClass("aok-hidden").text(a.$(".attach_add_accessory_alert.a-alert-inline-error .attach-add-to-cart-retry").first().text()))};g.show=function(){!b.selectedBaseLightningDeal&&x&&b.addBaseProduct(function(a){a.request.isWarrantyAddedWithBase()&&("add-items.incomplete-add.error/v1"===a.response.type?c.logCount(c.CSM_METRICS.WARRANTY_DESKTOP_ATC_BY_ACCESSORIES_PANE_INCOMPLETE):
c.logCount(c.CSM_METRICS.WARRANTY_DESKTOP_ATC_BY_ACCESSORIES_PANE_SUCCESS))},function(a){a.request.isWarrantyAddedWithBase()&&c.logCount(c.CSM_METRICS.WARRANTY_DESKTOP_ATC_BY_ACCESSORIES_PANE_FAILURE)});a.$(n.PANE).css({opacity:0}).show().animate({opacity:1},500,"linear");if(b.selectedBaseLightningDeal)a.$(n.PANE_CART_BLOCK).addClass("aok-hidden"),a.$("#attach-accessory-pane").css("height",a.$(r).height()-161);else{var d=a.$(n.PANE_CART_BLOCK_INNER);d.find("div").addClass("aok-hidden");d.append(a.$(n.PANE_CART_SPINNER).removeClass("aok-hidden"))}g.initializeAccessoriesDisplay();
q.now("attach-categorized-cards").execute(function(a){a!==y&&a.initializeCategorizedCards()})};g.hide=function(){a.$(n.PANE).hide();a.$(n.PANE_CART_SPINNER).addClass("aok-hidden");a.$(n.PANE_HUC_MESSAGE).remove();a.$(n.PANE_ACCESSORY_ASIN).each(function(b,d){(d=a.$(d).data(n.PANE__DATA_ASIN_INDEX))&&(b=d);g.updateAccessoryStatus(b,v.INITIAL)});a.trigger("RESET_SECONDARY_SIDE_SHEET_MODULE");B&&B.unloadAttachModule();a.trigger("aloha:detailPage:reappear");x=!0};g.updateNavCartDisplayQuantity=function(b){var d=
Number(b);b=isNaN(d)?"":100>d?b:"99+";a.$("#nav-cart-count").toggleClass("nav-cart-0",0===d).toggleClass("nav-cart-1",1<=d&&10>d).toggleClass("nav-cart-10",10<=d&&20>d).toggleClass("nav-cart-20",20<=d&&100>d).toggleClass("nav-cart-100",100<=d).text(b)};g.createCartSubtotalLabelString=function(b){var d=a.$(1==b?n.PANE_CART_TEMPLATE_SUBTOTAL_SINGLE:n.PANE_CART_TEMPLATE_SUBTOTAL_MULTIPLE).val();return t.substituteParameters(d,{quantity:b})};g.createProceedToCheckoutString=function(b){var d=a.$(1==b?
n.PANE_CART_TEMPLATE_PROCEED_TO_CHECKOUT_SINGLE:n.PANE_CART_TEMPLATE_PROCEED_TO_CHECKOUT_MULTIPLE).val();return t.substituteParameters(d,{quantity:b})};g.updateCartSummary=function(){return e.get([e.CART_TYPE_RETAIL]).then(g.handleCartDescription).catch(g.handleCartDescriptionError)};g.handleAddBaseAndGetCartDescription=function(b){c.logCount(c.CSM_METRICS.ATTACH_BASE_ATC_SUCCESS);b.request?g.renderBaseProductStatus(b):(b=a.$(b),b.find("#sw-atc-confirmation").length?(g.renderFallbackSmartWagonFeedback(b),
g.renderFallbackSmartWagonBaseAddStatusIcon(b)):(g.renderHUCFeedback(b),g.renderBaseAddStatusIcon(b)));if(B)try{var d=a.$(n.PANE_ACCESSORY_ASIN).map(function(){return this.value}).get();B.loadAttachModule(d)}catch(w){q.logError(w,"Could not update ABB/DSS external interceptor: ","ERROR","attach-desktop-accessories-pane")}g.sheet.$container.attr("aria-labelledby","attachDisplayAddBaseAlert");l.focusDescendant(a.$(n.PANE).get(0),"first");return g.updateCartSummary()};g.handleCartDescription=function(d){var u=
d.entity.summary[0]||e.EMPTY_CART_RETAIL,f=u.itemCount;u=p.formatMoney(u.subtotal);var k=g.createCartSubtotalLabelString(f),h=g.createProceedToCheckoutString(f);g.updateNavCartDisplayQuantity(f);a.$(n.PANE_CART_BLOCK_SUBTOTAL_LABEL).html(k);a.$(n.PANE_CART_BLOCK_SUBTOTAL_PRICE).html(u);a.$(n.PANE_CART_BLOCK_PROCEED_TO_CHECKOUT).html(h);a.$(n.PANE_CHECKOUT_BUTTON).removeClass("aok-hidden");a.$("#attach-customerId").val()&&q.when("attach-preinitiate-checkout").execute(function(a){b.cartInitiateId=a.getCartInitiateId();
a.preinitiateCheckout(b.cartInitiateId)});b.selectedBaseLightningDeal||(a.$(n.PANE_CART_BLOCK_INNER).find("div").removeClass("aok-hidden"),a.$(n.PANE_CART_SPINNER).addClass("aok-hidden"),a.$(n.PANE_CART_BLOCK_DESCRIPTION_FAILURE_MESSAGE).addClass("aok-hidden"));a.delay(g.revealIMBMessages,200);q.when("EWC").execute("attach-everywhere-cart",function(a){a.refresh()});c.logCount(c.CSM_METRICS.ATTACH_GET_CART_DESCRIPTION_SUCCESS);return d};g.handleCartDescriptionError=function(d){q.logError(d,"Could not process the cart description: ",
"ERROR","attach-desktop-accessories-pane");c.logCount("ATTACH_DSS_HANDLE_CART_DESCRIPTION_FAILURE");b.selectedBaseLightningDeal||(a.$(n.PANE_CART_BLOCK_INNER).find("div").removeClass("aok-hidden"),a.$(n.PANE_CART_SPINNER).addClass("aok-hidden"),a.$(n.PANE_CART_BLOCK_SUBTOTAL_LABEL).empty(),a.$(n.PANE_CART_BLOCK_SUBTOTAL_PRICE).empty(),a.$(n.PANE_CHECKOUT_BUTTON).addClass("aok-hidden"),a.$(n.PANE_CART_BLOCK_DESCRIPTION_FAILURE_MESSAGE).removeClass("aok-hidden"))};g.updateAccessoryStatus=function(b,
d){a.$(n.PANE_ACCESSORY_ADD_BUTTON_PREFIX+b).toggleClass("aok-hidden",d!==v.INITIAL);a.$(n.PANE_ACCESSORY_ADD_SPINNER_PREFIX+b).toggleClass("aok-hidden",d!==v.ADDING);a.$(n.PANE_ACCESSORY_ADD_SUCCESS_PREFIX+b).toggleClass("aok-hidden",d!==v.SUCCESS);a.$(n.PANE_ACCESSORY_ADD_ERROR_PREFIX+b).toggleClass("aok-hidden",d!==v.ERROR);a.$("#tile-add-accessory-badge-"+b).toggleClass("aok-hidden",d!==v.SUCCESS);a.$("#attach-accessory-tile-"+b).toggleClass("in-cart",d===v.SUCCESS);b=a.$("#attach-accessory-asin-"+
(b+1)).parent();l.focusDescendant(b.get(0),"first")};g.addAccessoryToCart=function(d,e,f){g.updateAccessoryStatus(f,v.ADDING);var u=a.$(n.BASE_ASIN).val(),k=(b.selectedBaseLightningDeal?parseInt(a.$(n.DEAL_QUANTITY).val()):parseInt(a.$(n.QUANTITY).val()))||1,l=y;b.isDiscriminatedOffersEnabled()&&(l={itemAssociation:{programType:"Attach",renderType:"renderAll",associatedItemId:u,deleteConstraint:{mutuallyInclusive:!1}}});h.addItems([{asin:d,offerListingId:e,quantity:k,additionalParameters:l}],"dp_atch_dss_atc_ce").then(function(a){if(a.type===
h.RESPONSE_TYPE_SUCCESS)return g.updateCartSummary();q.logError(Error(a.entity.details.message),"Could not add accessory via AmazonAPI ("+d+"):","ERROR","attach-desktop-accessories-pane");throw a.entity.details.message;}).then(function(b){g.updateAccessoryStatus(f,v.SUCCESS);c.logAccessoryAddToCart(g.getAccessoryLoggingData(f));c.logCount(c.CSM_METRICS.ATTACH_UPSELL_ATC_SUCCESS);a.trigger("UPSELL_ASIN_ADDED_TO_CART",f);q.when("EWC").execute("attach-everywhere-cart",function(a){a.refresh()})}).catch(function(){c.logCount(c.CSM_METRICS.ATTACH_UPSELL_ATC_FAILURE);
g.updateAccessoryStatus(f,v.ERROR);a.trigger("UPSELL_ASIN_NOT_ADDED_TO_CART",f)})};g.addAccessoryToCartWithDeal=function(d,e,f){g.updateAccessoryStatus(d,v.ADDING);var u=a.$("#attach-accessory-claim-deal-url-"+d).val();u=g.getDealId(u);m.claimAndAddDeal(u,e,"dp_atch_dss_atc_ce").then(function(e){var u=e.entity;e=u.customerState;if(!0!==u.claimed&&"INWAITLIST"!==e)return b.reject(null,{count:"ATTACH_DSS_ADD_ACCESSORY_NOT_IN_CART"});"INWAITLIST"===e?a.$(n.PANE_ACCESSORY_ADD_SPINNER_PREFIX+d).addClass("aok-hidden"):
g.updateAccessoryStatus(d,v.SUCCESS);c.logAccessoryAddToCart(g.getAccessoryLoggingData(d));c.logCount(c.CSM_METRICS.ATTACH_UPSELL_ATC_SUCCESS);f&&(u=u.msUntilExpiration,g.handleLightningDealAddToCart(d,u?u:900,e));a.trigger("UPSELL_ASIN_ADDED_TO_CART",d);q.when("EWC").execute("attach-everywhere-cart",function(a){a.refresh()});g.updateCartSummary()}).catch(function(){c.logCount(c.CSM_METRICS.ATTACH_UPSELL_ATC_FAILURE);g.updateAccessoryStatus(d,v.ERROR);a.trigger("UPSELL_ASIN_NOT_ADDED_TO_CART",d)})};
g.getDealId=function(a){return(a=a.match(/\/api\/marketplaces\/\w+\/deals\/(.*?)\/claim-and-add-to-cart/))?a[1]:y};g.revealIMBMessages=function(){var b=a.$(n.PANE_HUC_MESSAGE);if(b.hasClass("aok-hidden")){b.css({position:"absolute",top:0}).removeClass("aok-hidden");var d=b.children().height();0<d&&b.css({marginTop:-1*(d+4)+"px",position:"initial"}).animate({marginTop:"14px"},800)}};g.renderHUCFeedback=function(d){var e=d.find("#hlb-ship-message");d=a.$().add(d.find("#huc-v2-message-group")).add(d.find("#hlb-imb"));
f.isCoreFreeShippingMessageEnabled()&&b.elementExists(e)&&a.$(n.PANE_CART_BLOCK_CORE_FREE_SHIPPING_MESSAGE).html(e.html());0<d.length&&(e=a.$("\x3cdiv class\x3d'attach-sidesheet-card attach-add-to-cart-message-card aok-hidden'\x3e\x3c/div\x3e"),e.append(d),e.insertAfter(n.PANE_CART_BLOCK),e.find(".a-declarative a").unwrap(),e.find(".a-declarative span").removeClass("a-color-link huc-cursor-pointer").unwrap(),e.find(".sc-action-quantity").hide(),(e=d.find(".a-alert-heading").text())&&c.logDSSWarningMessage(e))};
g.renderBaseAddStatusIcon=function(d){var c;b.elementExists(d.find("#huc-v2-order-row-confirm-text"))?c=d.find("#huc-v2-order-row-confirm-text").hasClass("a-color-error"):b.elementExists(d.find("#hl-confirm-text"))&&(c=d.find("#hl-confirm-text").hasClass("a-alert-warning"));c=(c?a.$(n.PANE_CART_BASE_ERROR_ALERT):a.$(n.PANE_CART_BASE_SUCCESS_ALERT)).clone().prop("id","attachDisplayAddBaseAlert");a.$(n.PANE_CART_BASE_ALERT).remove();a.$(n.PANE_CART_BASE_ALERT_IMAGE_AREA).prepend(c);c=d.find(".huc-v2-order-row-image").clone();
b.elementExists(c)||(c=d.find(".hlb-product-image").clone());if(1<c.length){c=c.first();var e=a.$('input[name^\x3d"asin"].attach-warranty-input');0===e.length&&(e=a.$('.abbListItem.mbb__r input[name^\x3d"asin"]'));if(b.elementExists(e))for(var g=0;g<e.length;g++){var f=e[g].value,k=d.find("#huc-v2-order-row-item-"+f);if(k.length){d=b.elementExists(k)?k.find(".huc-v2-order-row-image"):d.find(".hlb-item-link.hlb-asin-"+f+" \x3e img");c=c.add(d.clone());break}}}a.$(n.PANE_CART_BASE_HUC_IMAGE).remove();
a.$(n.PANE_CART_BASE_INITIAL_IMAGE).hide().parent().append(c);c.wrap('\x3cdiv class\x3d"huc-image-wrapper"\x3e\x3c/div\x3e')};g.renderFallbackSmartWagonFeedback=function(b){b=b.find("#cart-important-message-box");if(0<b.length){var d=a.$("\x3cdiv class\x3d'attach-sidesheet-card attach-add-to-cart-message-card aok-hidden'\x3e\x3c/div\x3e");d.append(b);d.find("#sc-important-message-alert").removeClass("a-spacing-medium-plus").addClass("a-spacing-mini");d.find(".sc-action-quantity").hide();d.insertAfter(n.PANE_CART_BLOCK)}};
g.renderFallbackSmartWagonBaseAddStatusIcon=function(b){var d=b.find(".sw-atc-message").first().parent().clone();d.prop("id","attachDisplayAddBaseAlert");d.addClass("sw-fallback");d.addClass("aok-hidden");a.$(n.PANE_CART_BASE_ALERT_IMAGE_AREA).empty();a.$(n.PANE_CART_BASE_ALERT_IMAGE_AREA).prepend(d);b.find("#add-to-cart-confirmation-image").find(".sc-product-image").clone().appendTo(n.PANE_CART_BASE_ALERT_IMAGE_AREA).wrap('\x3cdiv class\x3d"huc-image-wrapper aok-hidden sw-fallback"\x3e\x3c/div\x3e');
b=b.find(".sw-atc-extra-item").clone().appendTo(n.PANE_CART_BASE_ALERT_IMAGE_AREA);b.addClass("aok-hidden sw-fallback");b.find(".sw-atc-item-no").prepend('\x3cspan class\x3d"a-size-small"\x3e+\x3c/span\x3e')};g.renderBaseProductStatus=function(e){var f=e.response&&e.response.type===h.RESPONSE_TYPE_SUCCESS,k=e.response&&e.response.type===h.RESPONSE_TYPE_INCOMPLETE_ADD;k=!f&&!k;f=(f?a.$(n.PANE_CART_BASE_SUCCESS_ALERT):a.$(n.PANE_CART_BASE_ERROR_ALERT)).clone().prop("id","attachDisplayAddBaseAlert");
a.$(n.PANE_CART_BASE_ALERT).remove();a.$(n.PANE_CART_BASE_ALERT_IMAGE_AREA).prepend(f);if((f=e.response&&e.response.entity&&e.response.entity.details&&e.response.entity.details.message)||k){var l=a.$("\x3cdiv\x3e\x3c/div\x3e");f?l.append(e.response.entity.details.message):l.append(a.$(n.PANE_CART_GENERIC_ERROR_MESSAGE).clone().removeClass("aok-hidden"));k&&l.append(a.$('\x3ca href\x3d"#"\x3e\x3c/a\x3e').click(function(a){a.preventDefault();c.logCount("ATTACH_DSS_BASE_PRODUCT_TRY_AGAIN_CLICKED");g.sheet.fail(b.FailureModes.RESUBMIT_BUY_BOX)}).append(a.$(n.PANE_CART_TRY_AGAIN_MESSAGE).clone().removeClass("aok-hidden")));
D(l).insertAfter(n.PANE_CART_BLOCK);a.delay(g.revealIMBMessages,200)}f=e.response&&e.response.entity&&e.response.entity.internalInfo&&e.response.entity.internalInfo.message;k&&c.logCount("ATTACH_DSS_BASE_PRODUCT_UNRECOVERABLE_FAILURE");f&&q.logError(Error(e.response.entity.internalInfo.message),"Error when trying to add the base product to cart: ","FATAL","attach-desktop-accessories-pane:renderBaseProductStatus");a.$(n.PANE_CART_BASE_HUC_IMAGE).remove();a.$(n.PANE_CART_BASE_INITIAL_IMAGE).hide();
var m=a.$(n.PANE_CART_BASE_INITIAL_IMAGE).parent();e=e.request.getAsins();d.getProductsBatch(e,[d.RESOURCE_INCLUSIONS.PRODUCT_IMAGES]).then(function(b){b.entities&&b.entities.forEach(function(b){if(b.type===d.RESPONSE_TYPE_SUCCESS){var c=b.entity;if(c&&c.productImages&&c.productImages.entity&&c.productImages.entity.images&&c.productImages.entity.images.length){var e=c.productImages.entity;b=e.altText;e=C.init(e.images[0].lowRes).scaleToSquare(60).build().url;c="/dp/"+c.asin;b=a.$("\x3cimg\x3e\x3c/img\x3e").attr("src",
e).attr("alt",b);b=a.$("\x3ca\x3e\x3c/a\x3e").attr("href",c).append(b);b=a.$("\x3cdiv\x3e\x3c/div\x3e").addClass("huc-image-wrapper").append(b)}else b=a.$();m.append(b)}})}).catch(function(a){q.logError(a,"Could not process the cart description: ","ERROR","attach-desktop-accessories-pane");c.logCount("ATTACH_DSS_HANDLE_CART_DESCRIPTION_FAILURE")})};g.getAccessoryLoggingData=function(b){return{asin:a.$("#attach-accessory-asin-"+(parseInt(b)+1)).val(),index:b,priceFormatted:a.$("#attach-accessory-price-"+
b+" \x3e .a-offscreen").text(),priceDecimal:parseFloat(a.$("#attach-accessory-base-price-"+b).val())||null,currencySymbol:a.$("#attach-accessory-base-currency-symbol-"+b).val()||null,couponDecimal:null,couponType:null,dealType:a.$("#attach-accessory-deal-type-"+b).val()||null,dealPercentSavings:parseInt(a.$("#attach-accessory-deal-percent-savings-"+b).val())||null,dealDollarAmount:a.$("#attach-accessory-deal-dollar-savings-"+b).val()||null,categoryIndex:a.$("#attach-accessory-category-index-"+b).val()||
null,categoryTitle:a.$("#attach-accessory-category-title-"+b).val()||null,asinIndexWithinCategory:a.$("#attach-accessory-asin-category-index-"+b).val()||null}};g.createAccessoryImpressions=function(){var b=[];a.$(n.PANE_ACCESSORY_ASIN).parent().each(function(d,c){c=a.$(c);if(c.is(":hidden")||"hidden"===c.css("visibility")||c.prop("data-accessory-seen"))return null;c.prop("data-accessory-seen",!0);b.push(g.getAccessoryLoggingData(d))});return b};g.resetAccessoryImpressions=function(){a.$(n.PANE_ACCESSORY_ASIN).parent().removeProp("data-accessory-seen")};
g.initializeAccessoriesDisplay=function(){g.initializeAccessoriesCards();g.initializeAccessoriesTiles();g.initializeCategorizedAccessoriesCards();a.animationFrameDelay(function(){g.resetAccessoryImpressions();c.logAccessoryImpressions(g.createAccessoryImpressions())})};g.initializeAccessoriesCards=function(){a.$(n.PANE_ACCESSORY_CARD).each(function(){var b=a.$(this),d=b.find(n.PANE_ACCESSORY_CARD_SEE_MORE),e=b.find(n.PANE_ACCESSORY_CARD_SEE_LESS),f=b.find(n.PANE_ACCESSORY_CARD_EXPAND_CONTENT);d.show();
e.hide();f.hide();b.removeProp("data-card-expanded");b.removeProp("data-card-previously-expanded");d.click(function(){d.hide();e.show();f.slideDown(400);b.prop("data-card-expanded",!0);b.parent().animate({scrollTop:b.get(0).offsetTop-30},400);b.prop("data-card-previously-expanded")||(b.prop("data-card-previously-expanded",!0),c.logAccessoryImpressions(g.createAccessoryImpressions()));c.logCount(c.CSM_METRICS.ATTACH_SHOW_MORE)});e.click(function(){e.hide();d.show();f.slideUp(400);b.prop("data-card-expanded",
!1);c.logCount(c.CSM_METRICS.ATTACH_SHOW_LESS)})})};g.initializeAccessoriesTiles=function(){q.when("a-truncate").execute(function(b){a.$(n.PANE_ACCESSORY_TITLE).each(function(){b.get(this).update()});a.$(n.PANE_ACCESSORY_TILE_ITEM).hover(function(){var d=a.$(this).find(n.PANE_ACCESSORY_TITLE);d.length&&b.get(d.get()).update()})});a.$(n.PANE_ACCESSORY_TILE_ITEM).attr("tabindex",0)};g.initializeCategorizedAccessoriesCards=function(){b.elementExists(n.PANE_CATEGORIZED_ACCESSORIES_TILES_CARD)&&(a.on("a:expander:attach_see_more_expander:toggle:expand",
function(){c.logAccessoryImpressions(g.createAccessoryImpressions())}),a.on("a:expander:attach_category_expander:toggle:expand",function(){c.logAccessoryImpressions(g.createAccessoryImpressions())}))};g.initializeAccessoriesCarousel=function(){q.when("a-truncate","a-carousel-framework").execute(function(b,d){if(a.$(n.PANE_ACCESSORY_CAROUSEL).length){a.$(n.PANE_ACCESSORY_TITLE).each(function(){b.get(this).update()});d.createAll();var e=d.getCarousel(a.$(n.PANE_ACCESSORY_CAROUSEL));e&&(e.attachViewedPages=
[1],e.gotoPage(1,{animationDuration:1}),a.on("a:carousel:attach-carousel:change:animating",function(a){a.newValue||(a=e.getAttr("pageNumber"),-1===e.attachViewedPages.indexOf(a)&&(e.attachViewedPages.push(a),c.logAccessoryImpressions(g.createAccessoryImpressions())))}))}})};g.updateLightningDealTimer=function(b){var d=a.$("#attach-accessory-deal-timer-"+b).val()-1;a.$("#attach-accessory-deal-timer-"+b).val(d);var c=g.convertTimeLeftToString(d);a.$("#attach-accessory-deal-timer-string-"+b).text(c);
0===d?g.handleDealHasEnded(b):setTimeout(g.updateLightningDealTimer,1E3,b)};g.convertTimeLeftToString=function(a){var b=Math.floor(a/3600),d=Math.floor(a/60)%60;a%=60;return 0>=b?g.appendZeroIfSingleDigit(d)+":"+g.appendZeroIfSingleDigit(a):b+":"+g.appendZeroIfSingleDigit(d)+":"+g.appendZeroIfSingleDigit(a)};g.appendZeroIfSingleDigit=function(a){return(10>a?"0":"")+a};g.handleDealHasEnded=function(b){a.$(n.PANE_ACCESSORY_ADD_SUCCESS_PREFIX+b).hasClass("aok-hidden")&&(a.$("#attach-accessory-asin-"+
(b+1)).parent().addClass("lightning-deal-ended"),a.$("#attach-accessory-deal-on-waitlist-"+b).addClass("aok-hidden"),a.$("#attach-accessory-deal-has-ended-"+b).removeClass("aok-hidden"))};g.updateLightningDealTimeToCheckoutTimer=function(b){var d=a.$("#attach-accessory-time-to-checkout-"+b).val()-1;a.$("#attach-accessory-time-to-checkout-"+b).val(d);var c=g.convertTimeLeftToString(d);a.$("#attach-accessory-time-to-checkout-string-"+b).text(c);0===d?(a.$("#attach-accessory-ld-in-cart-details-"+b).addClass("aok-hidden"),
a.$(n.PANE_ACCESSORY_ADD_SUCCESS_PREFIX+b).addClass("aok-hidden"),a.$("#tile-add-accessory-badge-"+b).addClass("aok-hidden"),a.$(n.PANE_ACCESSORY_ADD_BUTTON_PREFIX+b).removeClass("aok-hidden"),a.$("#attach-accessory-deal-availability-details-"+b).removeClass("aok-hidden")):setTimeout(g.updateLightningDealTimeToCheckoutTimer,1E3,b)};g.handleLightningDealAddToCart=function(b,d,c){a.$("#attach_add_accessory-button-row-"+b).addClass("aok-hidden");"INWAITLIST"===c?a.$("#attach-accessory-deal-on-waitlist-"+
b).removeClass("aok-hidden"):(a.$("#attach-accessory-deal-availability-details-"+b).addClass("aok-hidden"),a.$("#attach-accessory-time-to-checkout-"+b).val(d/1E3),g.updateLightningDealTimeToCheckoutTimer(b),a.$("#attach-accessory-ld-in-cart-details-"+b).removeClass("aok-hidden"))};g.initializeLightningDealStatusRefresher=function(b){if(a.$("#attach-accessory-deal-has-ended-"+b).hasClass("aok-hidden")){var c=a.$("#attach-accessory-asin-"+(b+1)).val();d.getProduct(c,[d.RESOURCE_INCLUSIONS.DEAL_DETAILS]).then(function(d){d=
d.entity.buyingOptions.filter(function(a){return"LIGHTNING_DEAL"===a.type});d.length&&d[0].dealDetails.entity&&(d=d[0].dealDetails.entity,g.updateLightningDealInfo(b,d.state,d.percentClaimed)&&a.delay(g.initializeLightningDealStatusRefresher,3E4,b))})}};g.updateLightningDealInfo=function(b,d,c){if("AVAILABLE"!==d&&"WAITLIST"!==d)return g.handleDealHasEnded(b),!1;var e=a.$("#attach_add_accessory_button_"+b+"-announce");"WAITLIST"===d?e.html(a.$("#attach-accessory-join-waitlist-string").html()):"AVAILABLE"===
d&&e.html(a.$("#attach-accessory-add-to-cart-string").html());a.$("#attach-accessory-percent-claimed-"+b).text(c);a.$("#attach-accessory-deal-progress-bar-width-"+b).width(c+"%");return!0};return g});"use strict";q.when("A","attach-logging","attach-common","attach-weblabs","attach.utilities.focus-management").register("attach-desktop-side-sheet",function(a,b,f,c,k){var l={},p=[],h=-1,e,m,d,q,t,D,g=null,x=null,B=null,A=!1,z=null,n="false",v="false",u="auto",E=null,w=l.Selectors={PAGE_BACKGROUND:"#a-page",
NAV_FOOTER:"#navFooter",PLACEHOLDER:"#attach-dss-placeholder",SHEET:"#attach-desktop-sideSheet",MODAL_LAYER:".attach-dss-modal-layer",LIGHTBOX:"#attach-popover-lgtbox",WARRANTY_BOX:".attach-warranty-box",WARRANTY_MONTHLY:"#attach-monthly-warranty",WARRANTY_MULTI_DEVICE:"#attach-warranty-multi-device-container"};l.transitionDuration=500;l.onKeyDown=function(a){27===a.which&&l.next()};l.initialize=function(){p=[];f.elementExists(w.MODAL_LAYER)?q=a.$(w.MODAL_LAYER):(q=a.$("\x3cdiv class\x3d'attach-dss-modal-layer'\x3e\x3c/div\x3e"),
q.hide(),q.appendTo(document.body));f.elementExists(w.SHEET)?l.$container=a.$(w.SHEET):(l.$container=a.$('\x3cdiv id\x3d"attach-desktop-sideSheet" class\x3d"a-section attach-desktop-sideSheet"\x3e\x3c/div\x3e'),l.$container.addClass("aok-hidden"),l.$container.appendTo(w.PLACEHOLDER));g=l.$container.parent();f.elementExists(w.LIGHTBOX)||(t=a.$("\x3cdiv id\x3d'attach-popover-lgtbox' class\x3d'attach-dss-backdrop'\x3e\x3c/div\x3e"),t.hide(),t.appendTo(q),t.click(l.next));a.$(document).unbind("keydown",
l.onKeyDown);a.$(document).keydown(l.onKeyDown);e=function(){};m=function(){};d=!0};l.setFailureHandler=function(a){e=a};l.setCloseHandler=function(a){m=a};l.fail=function(a,b){e(a,b)};l.addPane=function(a){p.push(a)};l.removePane=function(a){a=p.indexOf(a);-1<a&&p.splice(a,1)};l.hideMultiQuantityMonthlyWarranties=function(b){var d=f.selectedBaseLightningDeal?a.$("#attach-warranty-pane-ld "+w.WARRANTY_BOX):a.$("#attach-warranty-pane "+w.WARRANTY_BOX),c=d.has("[id\x3dattach-monthly-warranty]");a.$(w.WARRANTY_MULTI_DEVICE).addClass("aok-hidden");
c.addClass("aok-hidden");c.length===d.length&&l.removePane(b)};l.showMonthlyWarranties=function(){var b=(f.selectedBaseLightningDeal?a.$("#attach-warranty-pane-ld "+w.WARRANTY_BOX):a.$("#attach-warranty-pane "+w.WARRANTY_BOX)).has("[id\x3dattach-monthly-warranty]");a.$(w.WARRANTY_MULTI_DEVICE).removeClass("aok-hidden");b.removeClass("aok-hidden")};l.getPaneIndex=function(a){return p.indexOf(a)};l.insertPane=function(a,b){b===y&&(b=p.length);p.splice(b,0,a);d=!0};l.hasPane=function(a){return-1<l.getPaneIndex(a)};
l.next=function(){if(h+1===p.length){t.hide();l.$container.animate({right:D},{duration:l.transitionDuration,complete:function(){var a=p[h];a&&a.hide?a.hide():b.logError("Unable to hide current pane. Index: "+h);h=-1;m();q.hide();E.focus();l.$container.appendTo(g)}});r.ue&&r.ue.count&&r.ue.count("ATTACH_DSS_CLOSE_ACCESSORY_PANE",(r.ue.count("ATTACH_DSS_CLOSE_ACCESSORY_PANE")||0)+1);var d=a.$(w.PAGE_BACKGROUND).get(0);document.body.style.overflow=u;d.ariaHidden=n;d=a.$(w.NAV_FOOTER).get(0);d!==y&&(d.ariaHidden=
v);x.remove();B.remove();a.$("#attach-ld-image-container").first().children().not(":nth-child(1)").remove();a.trigger("HIDE_SIDE_SHEET")}else-1!==h&&(p[h].hide(),p[h+1].show(),h+=1)};l.show=function(){if(d){d=!1;var b=a.$.map(p,function(a){return a.load(l)});a.$.when.apply(a.$,b).fail(l.fail).done(function(){a.$.each(p,function(a,b){b.setup(l)});l.show()})}else{q.show();l.$container.addClass("aok-hidden").attr("role","dialog").attr("aria-modal","true").appendTo(q);h=0;p[h].show();D=l.$container.css("right");
l.$container.removeClass("aok-hidden");l.$container.animate({right:"0"},l.transitionDuration,"linear");t.show();r.ue&&r.ue.count&&(b=a.$("#attach-customerId").val()?"ATTACH_DSS_SHOW_HAS_CUSTOMER_ID":"ATTACH_DSS_SHOW_NO_CUSTOMER_ID",r.ue.count(b,(r.ue.count(b)||0)+1),b="true"===a.$("#attach-is-prime-member").val()?"ATTACH_DSS_IS_PRIME_MEMBER":"ATTACH_DSS_IS_NOT_PRIME_MEMBER",r.ue.count(b,(r.ue.count(b)||0)+1));b=document.body;var c=a.$(w.PAGE_BACKGROUND).get(0);n=c.ariaHidden;c.ariaHidden="true";c=
a.$(w.NAV_FOOTER).get(0);c!==y&&(v=c.ariaHidden,c.ariaHidden="true");u=b.style.overflow;b.style.overflow="hidden";E=document.activeElement;x=a.$('\x3cdiv tabindex\x3d"0"\x3e\x3c/div\x3e').insertBefore(l.$container);B=a.$('\x3cdiv tabindex\x3d"0"\x3e\x3c/div\x3e').insertAfter(l.$container);a.trigger("attach:show_side_sheet")}};l.isEmpty=function(){return 0===p.length};document.addEventListener("focus",function(a){if(!A&&-1!==h){var b=l.$container.get(0);b.contains(a.target)?z=a.target:(A=!0,k.focusDescendant(b,
"first"),z===document.activeElement&&k.focusDescendant(b,"last"),A=!1,z=document.activeElement)}},!0);l.isOpen=function(){return-1!==h};return l});"use strict";q.when("A","attach-common","attach-weblabs","attach-logging","attach-desktop-warranty-pane","attach-desktop-accessories-pane","attach-desktop-side-sheet","attach-variant-registration","attach.utilities.add-to-cart.base-product").register("attach-desktop",function(a,b,f,c,k,l,p,h,e){function m(){return b.elementExists(p.Selectors.PLACEHOLDER)?
b.elementExists(g.STS_FEATURE)?(A||(c.logCount("attachSuppressForShipToStoreFeature"),A=!0),!0):!1:!0}var d={},C,t=d.Events={CLICK:"click",ATTACH_ATC_CLICK_NAMESPACE:"click.attachDSS",WARRANTY_SI_CLICK_NAMESPACE:"click.siatc",VAS_SI_CLICK_NAMESPACE:"click.lsatc",LD_CLAIM_SUCCESS:"deals_claimDealSuccess",LD_CLAIM_ERROR:"deals_claimDealError"},D=d.Endpoints={ERROR_500_URL:"/gp/errors/500.html",WARRANTY_SI_CHECK:"/gp/si/util/is-si-with-triggers.html"},g=d.Selectors={ADD_TO_CART_BUTTON:"#add-to-cart-button",
PICKUP_ATC_BUTTON:"#pickup-add-to-cart-button",ASIN:"#ASIN,#asin",QUANTITY:"#quantity",DEAL_QUANTITY:"#dealx_quantity_dropdown",BASE_ITEM_PRICE_DECIMAL:"#attach-base-product-price",BASE_ITEM_CURRENCY_SYMBOL:"#attach-base-product-currency-symbol",ATTACH_MARKETPLACE_ID:"#attach-marketplaceId",ATTACH_BASE_ASIN:"#attach-baseAsin",INSTALLMENTS_BUTTON:"#installments-button",MBB_WARRANTY_ITEM:"#abbWrapper .abbListItem input[type\x3dcheckbox]",WTY_TWISTER_SELECTED_GROUP:".warranty-twister-selected-box-group",
WTY_TWISTER_WTY_OPTION:".warranty-twister-box-group-warranty-option",LD_BUY_BOX:"#dealsAccordionRow",LD_ATC_BUTTON:".gb-btn-atc, #dealsx_atc_btn",ATTACH_LD_CONTAINER:"#attach-ld-container",STS_FEATURE:"#addProfessionalServicesRow"},x=d.Classes={ATTACH_DSS_ATC:"attach-dss-atc"},y=-1,A=!1,z=function(){a.off(t.LD_CLAIM_SUCCESS,z);a.off(t.LD_CLAIM_ERROR,n);b.selectedBaseLightningDeal||(b.selectedBaseLightningDeal=!0,p.setCloseHandler(d.setupAddToCartButton),d.handleLdAddToCartClick(),q.when("attach-lightning-deals-desktop").execute(function(a){a.handleDealClaim()}))},
n=function(){a.off(t.LD_CLAIM_ERROR,n);a.off(t.LD_CLAIM_SUCCESS,z);a.$(g.LD_ATC_BUTTON).bind(t.CLICK,v)},v=function(){a.$(g.LD_ATC_BUTTON).unbind(t.CLICK,v);a.on(t.LD_CLAIM_SUCCESS,z);a.on(t.LD_CLAIM_ERROR,n)};d.initialize=function(){if(m()||p.isOpen())return!1;d.setupDependencies();d.setupSideSheet();d.setupAddToCartButton()};d.setupDependencies=function(){var b=a.$(g.ATTACH_MARKETPLACE_ID).val();c.initialize(c.FEATURES.DSS,b);c.setPayloadBuilder(function(){return{baseAsin:a.$(g.ASIN).val(),baseItemPriceDecimal:parseFloat(a.$(g.BASE_ITEM_PRICE_DECIMAL).val())||
null,baseItemCurrencySymbol:a.$(g.BASE_ITEM_CURRENCY_SYMBOL).val()||null,quantity:Number(a.$(g.QUANTITY).val())||1,almBrandId:null}});q.when("attach-external-atc-interceptor").execute(function(a){C=a;C.enableModule()})};d.setupSideSheet=function(){p.initialize();p.setFailureHandler(d.failure);var a=b.hasWarranty();!f.isWarrantyPaneSuppressed()&&a&&p.addPane(k);!f.servicesInterstitialDeprecated()||b.hasAccessories()?(p.addPane(l),p.setCloseHandler(d.setupAddToCartButton)):p.setCloseHandler(d.failureTransitionToHUC)};
d.setupAddToCartButton=function(){a.$(document.body).delegate(g.ADD_TO_CART_BUTTON,t.ATTACH_ATC_CLICK_NAMESPACE,d.handleAddToCartClick);a.$(g.ADD_TO_CART_BUTTON).prop("type","button").addClass(x.ATTACH_DSS_ATC);a.$(document.body).delegate(g.INSTALLMENTS_BUTTON,t.ATTACH_ATC_CLICK_NAMESPACE,d.handleAddToCartClick);a.$(g.INSTALLMENTS_BUTTON).prop("type","button").addClass(x.ATTACH_DSS_ATC);a.$(document.body).delegate(g.PICKUP_ATC_BUTTON,t.ATTACH_ATC_CLICK_NAMESPACE,d.handleAddToCartClick);a.$(g.PICKUP_ATC_BUTTON).prop("type",
"button").addClass(x.ATTACH_DSS_ATC);b.elementExists(g.LD_BUY_BOX)&&b.elementExists(g.ATTACH_LD_CONTAINER)?(a.$(g.LD_ATC_BUTTON).bind(t.CLICK,v).addClass(x.ATTACH_DSS_ATC),!f.isWarrantyPaneSuppressed()&&b.hasWarranty()&&!p.hasPane(k)&&-1<y&&p.insertPane(k,y),c.logCountOnce(c.CSM_METRICS.ATTACH_BASE_LD_PRESENT)):b.elementExists(g.LD_BUY_BOX)&&!b.elementExists(g.ATTACH_LD_CONTAINER)&&c.logCount(c.CSM_METRICS.DSS_LD_MISSING_ATTACH);c.logCount(c.CSM_METRICS.ATTACH_SIDE_SHEET_CLOSE)};d.failure=function(a,
c){switch(a){case b.FailureModes.ERROR_500:d.failureError500();break;case b.FailureModes.RESUBMIT_BUY_BOX:d.failureResubmitBuyBox();break;case b.FailureModes.UNBIND_ATC:d.failureUnbindATC();break;case b.FailureModes.REBIND_ATC:d.failureRebindATC();break;default:case b.FailureModes.TRANSITION_TO_HUC:d.failureTransitionToHUC()}};d.failureError500=function(){r.location=D.ERROR_500_URL};d.failureResubmitBuyBox=function(){b.selectedBaseLightningDeal?d.failureRebindATC():(d.failureUnbindATC(),b.buyButton.click())};
d.failureUnbindATC=function(){a.$(document.body).undelegate(g.ADD_TO_CART_BUTTON,t.ATTACH_ATC_CLICK_NAMESPACE);a.$(document.body).undelegate(g.INSTALLMENTS_BUTTON,t.ATTACH_ATC_CLICK_NAMESPACE);a.$(g.INSTALLMENTS_BUTTON).prop("type","submit");a.$(document.body).undelegate(g.PICKUP_ATC_BUTTON,t.ATTACH_ATC_CLICK_NAMESPACE);a.$(g.PICKUP_ATC_BUTTON).prop("type","submit");a.$(g.ADD_TO_CART_BUTTON).prop("type","submit")};d.failureTransitionToHUC=function(){if(b.selectedBaseLightningDeal)return d.failureUnbindATC();
f.servicesInterstitialDeprecated()?a.$(document.body).undelegate(g.ADD_TO_CART_BUTTON,t.VAS_SI_CLICK_NAMESPACE):a.$(document.body).undelegate(g.ADD_TO_CART_BUTTON,t.WARRANTY_SI_CLICK_NAMESPACE);f.servicesInterstitialDeprecated()?a.$(document.body).undelegate(g.INSTALLMENTS_BUTTON,t.VAS_SI_CLICK_NAMESPACE):a.$(document.body).undelegate(g.INSTALLMENTS_BUTTON,t.WARRANTY_SI_CLICK_NAMESPACE);f.servicesInterstitialDeprecated()?a.$(document.body).undelegate(g.PICKUP_ATC_BUTTON,t.VAS_SI_CLICK_NAMESPACE):
a.$(document.body).undelegate(g.PICKUP_ATC_BUTTON,t.WARRANTY_SI_CLICK_NAMESPACE);d.failureResubmitBuyBox()};d.failureRebindATC=function(){d.setupAddToCartButton()};d.handleAddToCartClick=function(c){b.buyButton=a.$(c.target);a.$(document.body).undelegate(g.ADD_TO_CART_BUTTON,t.ATTACH_ATC_CLICK_NAMESPACE);a.$(document.body).undelegate(g.PICKUP_ATC_BUTTON,t.ATTACH_ATC_CLICK_NAMESPACE);a.$(document.body).undelegate(g.INSTALLMENTS_BUTTON,t.ATTACH_ATC_CLICK_NAMESPACE);b.getAtcForm().append(b.buyButton.filter("input").clone().attr("type",
"hidden"));b.elementExists(g.LD_BUY_BOX)&&a.$(g.LD_ATC_BUTTON).unbind(t.CLICK,v);b.selectedBaseLightningDeal||!f.servicesInterstitialDeprecated()||b.hasAccessories()||p.setCloseHandler(d.failureTransitionToHUC);a.$.when().pipe(d.checkCanAddBaseProduct).pipe(d.checkWarranty).pipe(d.checkFeatureExists).pipe(d.show).fail(d.failure);c.preventDefault();c.stopImmediatePropagation();return!1};d.handleLdAddToCartClick=function(){a.$(document.body).undelegate(g.ADD_TO_CART_BUTTON,t.ATTACH_ATC_CLICK_NAMESPACE);
a.$(g.LD_ATC_BUTTON).unbind(t.CLICK,v);a.$.when().pipe(d.checkWarranty).pipe(d.checkFeatureExists).pipe(d.show).fail(d.failure)};d.checkCanAddBaseProduct=function(){e.canAddWithCartApi(b.getAtcForm())?c.logCount("Attach.CanAddBaseProduct.CartAPI"):c.logCount("Attach.CanAddBaseProduct.Gurupa")};d.checkFeatureExists=function(){if(d.shouldSuppressForFeatureNotPresent())return b.selectedBaseLightningDeal?(a.trigger("HIDE_SIDE_SHEET"),b.selectedBaseLightningDeal=!1,b.reject(b.FailureModes.REBIND_ATC)):
b.reject(b.FailureModes.RESUBMIT_BUY_BOX,{count:"ATTACH_DSS_SUPPRESSED_FEATURE_DOES_NOT_EXIST"})};d.checkWarranty=function(){if(!f.isWarrantyPaneSuppressed()){var e=!1,g=f.isDssMbsEnhancementEnabled()?a.$("#attach-warranty-ld .attach-warranty-box").length:a.$("#attach-warranty-ld #attach-warranty-asin").val();!b.selectedBaseLightningDeal||a.$("#atch__bl").length&&g?d.shouldSuppressForWarrantyInMbb()?(e=!0,c.logCount("ATTACH_DSS_SUPPRESSED_MBB_WARRANTY_CHECKED",1)):b.elementExists(".mbb__mdbi")||0<
a.$("#multidevice-eligible-flag").length?e=!0:f.servicesInterstitialDeprecated()&&d.shouldSuppressforMultiQuantityMonthlyWarranty()?(f.isDssMbsEnhancementEnabled()?p.hideMultiQuantityMonthlyWarranties(k):e=!0,c.logCount("ATTACH_DSS_SUPPRESSED_MULTI_QUANTITY_MONTHLY_WARRANTY",1)):f.isDssMbsEnhancementEnabled()&&p.showMonthlyWarranties():(y=p.getPaneIndex(k),e=!0);e&&p.removePane(k)}};d.handleSICheck=function(a){if(!a)return b.reject(b.FailureModes.RESUBMIT_BUY_BOX,{count:"ATTACH_DSS_SUPPRESSED_SI_CHECK_FAILURE"});
a.suppressSi&&(p.removePane(k),c.logCount("ATTACH_DSS_SUPPRESSED_SI",1))};d.handleSIFailure=function(){return b.reject(b.FailureModes.RESUBMIT_BUY_BOX,{count:"ATTACH_DSS_SUPPRESSED_SI_CHECK_FAILURE"})};d.shouldSuppressForFeatureNotPresent=function(){return f.servicesInterstitialDeprecated()?!b.elementExists(p.Selectors.PLACEHOLDER)||p.isEmpty():!b.elementExists(p.Selectors.PLACEHOLDER)||!b.hasAccessories()||!b.elementExists(g.ATTACH_MARKETPLACE_ID)||!b.elementExists(g.ATTACH_BASE_ASIN)};d.shouldSuppressForWarrantyInMbb=
function(){return f.isWarrantyTwisterPlusDesktopEnabled()?0<a.$(g.MBB_WARRANTY_ITEM).filter(":checked").length||0<a.$(g.WTY_TWISTER_SELECTED_GROUP).filter(g.WTY_TWISTER_WTY_OPTION).length:0<a.$(g.MBB_WARRANTY_ITEM).filter(":checked").length};d.shouldSuppressforMultiQuantityMonthlyWarranty=function(){var d=f.isLdDssMbsEnhancementEnabled()&&b.selectedBaseLightningDeal?Number(a.$(g.DEAL_QUANTITY).val())||1:Number(a.$(g.QUANTITY).val())||1;return b.hasMonthlyWarranty()&&1<d};d.show=function(){p.show()};
a.on("a:popover:show:dss-basisprice-legal-message",function(a){a.popover.$container.css("z-index",6E3)});return d});q.when("A","attach-desktop","attach-weblabs","ready").execute("attach-desktop-main",function(a,b,f){b.initialize();a.on("a:pageUpdate",a.debounce(function(){b.initialize();a.trigger("attach:dss:initialized")},300))});"use strict";q.when("A","attach-logging","attach-common").register("attach-lightning-deals-common",function(a,b,f){var c={Constants:{ATTACH_LD_CONTAINER:'\x3cdiv id\x3d"attach-ld-container" class\x3d"aok-hidden"\x3e\x3c/div\x3e',
ALERTS:["a-alert-success","a-alert-warning","a-alert-error"],ATTACH_LD_TIME:'\x3cp class\x3d"a-color-success a-text-bold" id\x3d"attach-ld-time"\x3e\x3c/p\x3e'},Selectors:{ATTACH_LD_CONTAINER:"#attach-ld-container",ATTACH_LD_ALERT:"#attach-ld-alert",ATTACH_LD_ICON:"#attach-ld-icon",ATTACH_LD_STATUS:"#attach-ld-status",ATTACH_LD_SUCCESS:"#attach-ld-success",ATTACH_LD_RECLAIM:"#attach-ld-reclaim",ATTACH_LD_EXPIRED:"#attach-ld-expired",ATTACH_LD_ERROR:"#attach-ld-error",ATTACH_LD_INFO:".attach-ld-info",
ATTACH_LD_TIME:"#attach-ld-time",ATTACH_BASE_ASIN:"#attach-baseAsin, #attach-base-asin",ATTACH_MARKETPLACE:"#attach-marketplaceId",LD_TIMER_PREFIX:"#deal_checkout_timer_",LD_ID_OBJECT:"div[id^\x3dgb_atc_]",LD_ATC_DECLARATIVE:'*[data-action\x3d"dealsx-addtocart-button-action"]',LD_TIMER:"#dealsx_checkout_timer"},Events:{CLICK:"click",LD_CLAIM_SUCCESS:"deals_claimDealSuccess",DSS_CLOSE:"HIDE_SIDE_SHEET",MBS_CLOSE:"a:sheet:afterHide:attach_accessory_sheet"},DealStates:{AVAILABLE:"AVAILABLE",UNKNOWN:"UNKNOWN",
UPCOMING:"UPCOMING",WAITLIST:"WAITLIST",WAITLISTFULL:"WAITLISTFULL"},CustomerDealStates:{CLAIMED:"CLAIMED",EXPIRED:"EXPIRED",IN_CART:"IN_CART",IN_WAITLIST:"IN_WAITLIST",NONE:"NONE",PENDING_ATC:"PENDING_ADD_TO_CART",UNKNOWN:"UNKNOWN"}};c.dealItemState;c.dealCustomerState;c.dealMsToCustomerStateExpiry;c.dealId;c.baseAsin;c.marketplace;c.initializeAttachLD=function(){c.baseAsin=a.$(c.Selectors.ATTACH_BASE_ASIN).val();c.marketplace=a.$(c.Selectors.ATTACH_MARKETPLACE).val();var b=a.$(c.Selectors.LD_ATC_DECLARATIVE).data();
b.dealsxAddtocartButtonAction&&b.dealsxAddtocartButtonAction.dealId&&(c.dealId=b.dealsxAddtocartButtonAction.dealId);e()};c.hasLightningDealTimer=function(){return f.elementExists(c.Selectors.LD_TIMER)};c.attachDealTimerExists=function(){return 0<a.$(c.Selectors.ATTACH_LD_INFO+" p").length};c.updateLDUX=function(){0>c.dealMsToCustomerStateExpiry&&(c.dealCustomerState=c.CustomerDealStates.EXPIRED);switch(c.dealItemState){case c.DealStates.AVAILABLE:case c.DealStates.WAITLIST:switch(c.dealCustomerState){case c.CustomerDealStates.NONE:case c.CustomerDealStates.CLAIMED:case c.CustomerDealStates.IN_CART:case c.CustomerDealStates.IN_WAITLIST:case c.CustomerDealStates.PENDING_ATC:k();
break;case c.CustomerDealStates.EXPIRED:l(c.Selectors.ATTACH_LD_RECLAIM);break;default:p()}a.delay(c.updateLDUX,1E3);break;case c.DealStates.UPCOMING:case c.DealStates.WAITLISTFULL:l(c.Selectors.ATTACH_LD_EXPIRED);break;default:p()}};var k=function(){if(c.dealCustomerState!==c.DealStates.NONE){h(c.Selectors.ATTACH_LD_SUCCESS);var b=a.$(c.Selectors.LD_TIMER).text();a.$(c.Selectors.ATTACH_LD_TIME).text(b);c.dealMsToCustomerStateExpiry-=1E3;a.$(c.Selectors.ATTACH_LD_ALERT).hasClass("a-alert-success")||
(a.$(c.Selectors.ATTACH_LD_ALERT).removeClass("a-alert-warning a-alert-error").addClass("a-alert-success"),a.$(c.Selectors.ATTACH_LD_ICON).removeClass("a-icon-warning a-icon-error").addClass("a-icon-success"));a.$("#attachSiAddCoverage-ld").hasClass("aok-hidden")&&a.$("#attachSiAddCoverage-ld").removeClass("aok-hidden")}},l=function(b){if(c.dealCustomerState===c.CustomerDealStates.IN_CART||c.dealCustomerState==c.CustomerDealStates.CLAIMED)return k();h(b);a.$(c.Selectors.ATTACH_LD_ALERT).removeClass("a-alert-success").addClass("a-alert-warning");
a.$(c.Selectors.ATTACH_LD_ICON).removeClass("a-icon-success").addClass("a-icon-warning");a.$("#attachSiAddCoverage-ld").addClass("aok-hidden")},p=function(){h(c.Selectors.ATTACH_LD_ERROR);a.$(c.Selectors.ATTACH_LD_ALERT).removeClass("a-alert-success").addClass("a-alert-error");a.$(c.Selectors.ATTACH_LD_ICON).removeClass("a-icon-success").addClass("a-icon-error")},h=function(b){b=a.$(b);b.hasClass("aok-hidden")&&(a.$(c.Selectors.ATTACH_LD_STATUS).find("\x3e div:not(.aok-hidden)").each(function(){a.$(this).addClass("aok-hidden")}),
b.removeClass("aok-hidden"))},e=function(){var e=new RegExp("/api/marketplaces/"+c.marketplace+"/products/"+c.baseAsin+"?.*buyingOptionTypes\x3dLIGHTNING_DEAL");a.$(document).ajaxSuccess(function(a,f,k){if(e.test(k.url))try{var d=JSON.parse(f.responseText).entity.buyingOptions;d=d.filter(function(a){return a.dealDetails.entity.id==c.dealId});if(1!=d.length)throw Error("Multiple LD buyingOptions found for deal: "+c.dealId);var g=d[0].dealCustomerStatus.entity;c.dealItemState=d[0].dealDetails.entity.state;
c.dealCustomerState=g.state;c.dealMsToCustomerStateExpiry=new Date(g.expiryTime)-new Date}catch(x){b.logCount(b.CSM_METRICS.ATTACH_BASE_LD_DEAL_STATUS_ERROR)}})};return c});"use strict";q.when("A","attach-common","attach-lightning-deals-common","attach-desktop-side-sheet","attach-logging").register("attach-lightning-deals-desktop",function(a,b,f,c,k){var l={},p=/(\{0})/,h=function(){f.initializeAttachLD();b.setupDesktopEgressButtons();2===a.$(f.Selectors.ATTACH_LD_ALERT).find(".a-icon").length&&a.$(f.Selectors.ATTACH_LD_ALERT+
" .a-icon").first().remove();a.$("#attach-ld-close-button").hasClass("close-button")||a.$("#attach-ld-close-button").addClass("close-button").click(c.next);if(f.hasLightningDealTimer()&&!f.attachDealTimerExists()){var h=a.$("#attach-base-ld-timer").val();h&&h.length?h.split(p).forEach(function(b){b="{0}"===b?f.Constants.ATTACH_LD_TIME:"\x3cp\x3e"+b+"\x3c/p\x3e";a.$("#attach-ld-success .attach-ld-info").append(b)}):(k.logCount(k.CSM_METRICS.DSS_BASE_LD_MISSING_TIMER),k.logError({message:"Attach desktop base LD missing timer translation. Base ASIN\x3d"+
a.$("#attach-baseAsin").val()}))}a.$(f.Selectors.ATTACH_LD_CONTAINER).removeClass("aok-hidden");a.on(f.Events.DSS_CLOSE,e);f.updateLDUX()},e=function(){a.off(f.Events.DSS_CLOSE,e);b.selectedBaseLightningDeal=!1;a.$("#attach-accessory-pane").height("");a.$(f.Selectors.ATTACH_LD_CONTAINER).addClass("aok-hidden");a.$(".attach-primary-atc-confirm-box").removeClass("aok-hidden");a.$("#attachSiAddCoverage").removeClass("aok-hidden")};l.handleDealClaim=function(){k.logCount(k.CSM_METRICS.DSS_BASE_LD_ATC_CLICK);
f.dealCustomerState=f.CustomerDealStates.IN_CART;f.dealItemState=f.DealStates.AVAILABLE;f.dealMsToCustomerStateExpiry=y;h()};return l});"use strict";q.when("A","attach-desktop","dp-util-cookie","cf").execute(function(a,b,f){"000-0000000-8675309"===a.$("#attach-sessionId").val()&&a.$("#attach-sessionId").val(f("session-id"))});"use strict";q.when("A","3p-promise","attach.utilities.price-formatter").register("attach.amazonapi.client",function(a,b,f){var c={buildRequestUrl:function(b){var c=a.$("#attach-aapi-ajax-endpoint").val()+
"/"+b.apiPath,f=[];if(b.additionalParameters)for(var k in b.additionalParameters)b.additionalParameters.hasOwnProperty(k)&&f.push(k+"\x3d"+encodeURIComponent(b.additionalParameters[k]));f.length&&(c+="?"+f.join("\x26"));return c},buildAcceptHeader:function(a){var b=["application/vnd.com.amazon.api+json",'type\x3d"'+a.responseType+'"'];a.resourceInclusions&&b.push('expand\x3d"'+a.resourceInclusions.join(",")+'"');return b.join("; ")},buildRequestHeaders:function(b){var f=a.$("#attach-aapi-ajax-csrf-token").val();
f={Accept:c.buildAcceptHeader(b),"Accept-Language":a.$("#attach-languageOfPreference,#attach-language-of-preference").val().replace(/_/g,"-"),"x-cc-currency-of-preference":a.$("#attach-currency-of-preference").val(),"x-api-csrf-token":f};var k=a.$('meta[name\x3d"encrypted-slate-token"]');k.length&&k.attr("content")?(r.ue.count("attachAjaxSlateTokenPresent",1),f["x-amzn-encrypted-slate-token"]=k.attr("content")):r.ue.count("attachAjaxSlateTokenAbsent",1);b.requestType&&(f["Content-Type"]='application/vnd.com.amazon.api+json; type\x3d"'+
b.requestType+'"');return f},makeRequest:function(f){return new b(function(b,k){var h=c.buildRequestUrl(f),e=c.buildRequestHeaders(f),l=f.data?JSON.stringify(f.data):y;return a.$.ajax({type:f.method,url:h,headers:e,data:l,xhrFields:{withCredentials:!0},dataType:"json",success:function(a){b(a)},error:function(a){var b={statusCode:a.status,xhr:a};if(a.responseText)try{b.data=JSON.parse(a.responseText)}catch(t){b.data=a.responseText}k(b)}})})},isException:function(a){return a&&"undefined"!==typeof a.statusCode&&
"undefined"!==typeof a.xhr},formatMoney:function(b){return b.displayString?b.displayString:b.convertedFrom&&b.currencyCode===b.convertedFrom.currencyCode&&b.convertedFrom.displayString?b.convertedFrom.displayString:f.formatPrice(Number(b.amount),b.currencyCode||a.$("#attach-currency-of-preference").val(),a.$("#attach-languageOfPreference,#attach-language-of-preference").val().replace(/_/g,"-"))}};return c});"use strict";q.when("attach.amazonapi.client").register("attach.amazonapi.cart.add-items",
function(a){var b={RESPONSE_TYPE_SUCCESS:"cart.add-items/v1",RESPONSE_TYPE_INCOMPLETE_ADD:"add-items.incomplete-add.error/v1"},f=function(a){return a},c=function(a){q.when("mash").execute("atc-mbs-mash",function(b){b.cart.didUpdate({newCartQuantity:a.entity.count.entity.items})});return a},k=function(a){if(a.data&&"add-items.incomplete-add.error/v1"===a.data.type)return a.data;throw a;};b.addItems=function(b,p){b={apiPath:"cart/carts/retail/items",requestType:"cart.add-items.request/v1",responseType:"cart.add-items/v1",
method:"POST",data:{items:b},additionalParameters:{}};p&&(b.additionalParameters.ref=p);return a.makeRequest(b).then(f).then(c).catch(k)};return b});"use strict";q.when("attach.amazonapi.client").register("attach.amazonapi.cart.items",function(a){return{items:function(b,f){b={apiPath:"cart/items",requestType:"cart.items.request/v1",responseType:"cart.items/v1",method:"GET",additionalParameters:b};f&&(b.additionalParameters.ref=f);return a.makeRequest(b)}}});"use strict";q.when("attach.amazonapi.client").register("attach.amazonapi.cart.summary",
function(a){var b={CART_TYPE_RETAIL:"RETAIL",CART_TYPE_LOCAL_MARKET:"LOCAL_MARKET",EMPTY_CART_RETAIL:{itemCount:0,lastModified:null,cartType:"RETAIL",subtotal:{amount:0}}},f=function(a){return a};b.get=function(b){var c={apiPath:"cart/summary",responseType:"cart.summary/v1",method:"GET",additionalParameters:{}};b&&(c.additionalParameters.cartTypes=b);return a.makeRequest(c).then(f)};return b});"use strict";q.when("attach.amazonapi.client").register("attach.amazonapi.deals.claim-and-add-to-cart",function(a){var b=
{RESPONSE_TYPE_SUCCESS:"deals.claim.response/v1",RESPONSE_TYPE_QUANTITY_ERROR:"deal.claim.quantity_restriction_violation.error/v1",RESPONSE_TYPE_ERROR:"error/v1"},f=function(a){return a},c=function(a){throw a;};b.claimAndAddDeal=function(b,l,p){b={apiPath:"deals/"+b+"/claim-and-add-to-cart",requestType:"deals.claim.request/v1",responseType:"deals.claim.response/v1",method:"POST",data:{asin:l,quantity:1},additionalParameters:{}};p&&(b.additionalParameters.ref=p);return a.makeRequest(b).then(f).catch(c)};
return b});"use strict";q.when("A").register("attach.amazonapi.products.media-builder",function(a){var b={},f,c,k,l,p,h,e,m;b.init=function(a){f=a;p=l=k=c=y;h=f.width;e=f.height;m=[];f.styleCode&&m.push(encodeURIComponent(f.styleCode));return b};b.cdn=function a(a){c=a;return b};b.withNameAndOU=function(a,c,e){k=a.startsWith("/")?a.substring(1):a;l=1===c.length?"0"+c:c;p=e;return b};b.crop=function(a,c,f,k){h=Math.round(Math.min(f,h-a));e=Math.round(Math.min(k,e-c));m.push("_CR"+[a,c,f,k].join());
return b};b.autoCrop=function(){m.push("_AC");return b};b.blur=function(a){m.push("_BL"+a);return b};b.scaleToRectangle=function(a,c){h=a;e=c;m.push("_SR"+a+","+c);return b};b.scaleToSquare=function(a){e=h=a;m.push("_SS"+a);return b};b.scaleToWidth=function(a){h>a&&(e=Math.round(a*e/h),h=Math.round(a));m.push("_SX"+a);return b};b.scaleToHeight=function(a){e>a&&(h=Math.round(a*h/e),e=Math.round(a));m.push("_SY"+a);return b};b.scaleToLongest=function(a){h>e?a<h&&(e=Math.round(a*e/h),h=Math.round(a)):
a<e&&(h=Math.round(a*h/e),e=Math.round(a));m.push("_SL"+a);return b};b.upscaleToHeight=function(a){h=0<e?Math.round(a*h/e):0;e=Math.round(a);this.rendering.push("_UY"+a);return b};b.upscaleToLongest=function(a){h>e?(e=Math.round(a*e/h),h=Math.round(a)):(h=0<e?Math.round(a*h/e):0,e=Math.round(a));this.rendering.push("_UL"+a);return b};b.upscaleToWidth=function(a){e=0<h?Math.round(a*e/h):0;h=Math.round(a);this.rendering.push("_UX"+a);return b};b.custom=function a(a){this.rendering.push(encodeURIComponent(a));
return b};b.build=function(){var a=[];a.push("https://");a.push(c?c:"m.media-amazon.com");k?a.push("/images/G/",l,"/",k,"._CB",p):a.push("/images/I/",f.physicalId,".");m.length&&a.push(m.join(""));(p||m.length)&&a.push("_");"."!==a[a.length-1]&&a.push(".");a.push(f.extension);return{url:a.join(""),width:h,height:e}};return b});"use strict";q.when("attach.amazonapi.client").register("attach.amazonapi.products.productV2",function(a){return{RESPONSE_TYPE_SUCCESS:"product/v2",RESOURCE_INCLUSIONS:{LINKS:"links(product.links/v2)",
PRODUCT_IMAGES:"productImages(product.product-images/v2)",DEAL_DETAILS:"buyingOptions[].dealDetails(product.deal-details/v1)"},getProduct:function(b,f,c,k){b={apiPath:"products/"+b,requestType:"product.request/v2",responseType:"product/v2",method:"GET",resourceInclusions:f,additionalParameters:c||{}};k&&(b.additionalParameters.ref=k);return a.makeRequest(b)},getProductsBatch:function(b,f,c,k){b={apiPath:"products/"+b.join(","),requestType:"product.request/v2",responseType:"collection(product/v2)/v1",
method:"GET",resourceInclusions:f,additionalParameters:c||{}};k&&(b.additionalParameters.ref=k);return a.makeRequest(b)}}});"use strict";q.when("A").register("attach.events",function(a){return{Accessories:{ADD_TO_CART_STATUS:"attach:accessories:add-to-cart:status",SHOW:"attach:accessories:pane:show",HIDE:"attach:accessories:pane:hide",SEE_MORE_EXPAND:"attach:accessories:see-more:expand",SEE_MORE_COLLAPSE:"attach:accessories:see-more:collapse",CAROUSEL_PAGE_VIEW:"attach:accessories:carousel:page-view"},
Cart:{ADD_BASE_HUC:"attach:add-base-to-cart",ADD_BASE_HUC_SUCCESS:"attach:add-base-to-cart:huc-success",UPDATE_SUMMARY:"attach:cart:summary:update"}}});"use strict";q.when("A").register("attach.utilities.add-to-cart.natc-parameter-parser",function(a){var b={},f=/items?\[(\d+(?:\.\w+)?)\]\.?(.*)/,c=/\w+/g,k={asin:"string",offerListingId:"string",quantity:"integer","additionalParameters.giftOptions.includeGiftReceipt":"boolean","additionalParameters.installments.programId":"string","additionalParameters.pickupOption.addressId":"string",
"additionalParameters.pickupOption.locationId":"string"};b.attemptTypeCoercion=function(b,c){if(k.hasOwnProperty(b))switch(k[b]){case "string":return c;case "integer":return parseInt(c);case "boolean":return"true"===c}try{var f=JSON.parse(c);return null===f||"string"===typeof f||a.$.isPlainObject(f)?c:f}catch(e){}return c};b.checkValidParameters=function(a){return a.hasOwnProperty("items[0.base][asin]")||a.hasOwnProperty("item[0].asin")};b.createAddItemsRequestItems=function(a){var k=[],h={},e;for(e in a)if(a.propertyIsEnumerable(e)){var m=
a[e],d=f.exec(e);if(d){var l=d[1];if(d=d[2].match(c)){h.hasOwnProperty(l)||(h[l]={});l=h[l];for(var q=d.join("."),r=0;r<d.length;r++){var g=d[r];r===d.length-1?l[g]=b.attemptTypeCoercion(q,m):(l.hasOwnProperty(g)||(l[g]={}),l=l[g])}}}}for(var x in h)h.propertyIsEnumerable(x)&&(a=h[x],"0.base"===x||"0"===x?k.unshift(a):k.push(a));return k};return b});"use strict";q.when("A","attach-logging","attach-variant-registration","attach.utilities.add-to-cart.natc-parameter-parser","attach.amazonapi.cart.add-items",
"attach.utilities.page-reader").register("attach.utilities.add-to-cart.base-product",function(a,b,f,c,k,l){function p(a){return new h(a)}var h=a.createClass({_container:null,_rawNatcParameters:null,_cartItems:[],init:function(b){var e=a.$(b);this._container=b;b=e.serializeArray();e={};for(var d=0;d<b.length;d++){var f=b[d];e[f.name]=f.value}this._rawNatcParameters=e;this._cartItems=c.createAddItemsRequestItems(this._rawNatcParameters)},isValid:function(){return c.checkValidParameters(this._rawNatcParameters)&&
this.shouldUseNatc()},shouldUseNatc:function(){var b=a.$(this._container).find("[data-a-state*\x3datc-page-state]");0< !b.length&&(b=a.$(this._container).siblings("[data-a-state*\x3datc-page-state]"));0< !b.length&&(b=a.$("[data-a-state*\x3datc-page-state]"),0<b.length&&(b=b.first()));return 0<b.length&&(b=JSON.parse(b.text()))&&b.hasOwnProperty("shouldUseNatc")?b.shouldUseNatc:!0},getAsins:function(){return this._cartItems.map(function(a){return a.asin})},isWarrantyAddedWithBase:function(){var a=
l.getAvailableWarrantyAsinsOnDetailPage(),b=this._cartItems.map(function(a){return a.asin});return a.some(function(a){return b.some(function(b){return b===a})})},execute:function(a){var c=this;return k.addItems(this._cartItems,a?a:"dp_atch_dss_base").then(function(a){b.logCount("attach.utilities.add-to-cart.base-product.success");return{request:c,response:a}}).catch(function(a){b.logCount("attach.utilities.add-to-cart.base-product.error");return{request:c,response:a?a.data:y,error:a}})}});return{canAddWithCartApi:function(a){return p(a).isValid()},
createRequest:p}});"use strict";q.register("attach.utilities.focus-management",function(){var a={attemptFocus:function(a){try{a.focus()}catch(f){}return a===document.activeElement},focusDescendant:function(b,f){if(b&&b.children)for(var c=0;c<b.children.length;c++){var k=b.children.item("last"===f?b.children.length-c-1:c);if(a.attemptFocus(k)||a.focusDescendant(k,f))return!0}return!1}};return a});"use strict";q.when("attach-logging").register("attach.utilities.price-formatter",function(a){var b={};
return{formatPrice:function(f,c,k){if(!r.Intl||!r.Intl.NumberFormat)return a.logCount("attach.utilities.price-formatter:UsedSimpleFormat"),c+" "+f.toFixed(2);a.logCount("attach.utilities.price-formatter:UsedIntlNumberFormat");var l=k+"/"+c;b.hasOwnProperty(l)||(b[l]=new Intl.NumberFormat(k,{style:"currency",currency:c}));return b[l].format(f)}}});"use strict";q.when("A").register("attach.utilities.page-reader",function(a){return{getAvailableWarrantyAsinsOnDetailPage:function(){var b=a.capabilities.mobile?
a.$("input[id|\x3dmbb-checkbox-input]").map(function(){return this.value}).get():a.$('#abbWrapper input[name^\x3d"asin"]').map(function(){return this.value}).get();var f=a.$('[data-action\x3d"warranty-option-swatch-select"]').map(function(){var b=a.$(this).data("warranty-option-swatch-select");return b?b.warrantyAsin:null}).get();return b.concat(f)}}});"use strict";q.register("attach.utilities.strings",function(){var a=/\$\{(?:hash-get\s+)?([^\}]+)\}/g;return{substituteParameters:function(b,f){return b.replace(a,
function(a,b){return f&&f.hasOwnProperty(b)?f[b]:""})}}})});
/* ******** */
(function(n){var p=window.AmazonUIPageJS||window.P,l=p._namespace||p.attributeErrors,a=l?l("SmartShelfAssets",""):p;a.guardFatal?a.guardFatal(n)(a,window):a.execute(function(){n(a,window)})})(function(n,p,l){n.when("A","atf").register("smart-shelf-desktop",function(a){function n(d,c){var b={clientName:"SmartShelf",ASIN:d.find("input[name\x3d'ASIN']").val(),verificationSessionID:d.find("input[name\x3d'session-id']").val(),offerListingID:d.find("input[name\x3d'"+c+"']").val(),quantity:d.find("input[name\x3d'quantity'], select[name\x3d'quantity']").val(),
registryID:d.find("input[name\x3d'sourceCustomerOrgListID']").val(),registryItemID:d.find("input[name\x3d'sourceCustomerOrgListItemID']").val()};d.is(".ccxss_desktop_atc_form")||(b.snsOptIn=a.$("input[name\x3d'snsOptIn']").val(),b.rcxOrdFreq=a.$("input[name\x3d'rcxOrdFreq']").val(),b.snsOfferListingID=a.$("input[name\x3d'snsOfferListingID']").val(),b.snsMerchantID=a.$("input[name\x3d'snsMerchantID']").val(),b.momAsin=a.$("input[name\x3d'momAsin']").val(),b.snsAddressId=a.$("input[name\x3d'snsAddressId']").val(),
b.snsMostCommonFrequency=a.$("input[name\x3d'snsMostCommonFrequency']").val(),b.snsOnmlOfferId=a.$("input[name\x3d'snsOnmlOfferId']").val());if(b.quantity===l||"samplingOfferListingID"===c)b.quantity=1;c=d.find(".abbListItem");c.length&&c.each(function(d){var c=a.$(this),e=c.find("input[id^\x3d'mbb-offer']"),g=c.find("input[name^\x3d'asin']"),c=c.find("input[name^\x3d'quantity']");e[0].checked&&(a.$("#csxswWarrantyInclude").addClass("aok-hidden"),b["ASIN.warranty"+d]=g[0].value,b["offerListingID.warranty"+
d]=e[0].value,b["quantity.warranty"+d]=c[0].value)});if(d.find(".atcFormServiceAsinData").length){c=d.find(".atcFormServiceAsinData[name^\x3d'asin']");var g=d.find(".atcFormServiceAsinData[name^\x3d'offeringID']"),e=d.find(".atcFormServiceAsinData[name^\x3d'quantity']");c.length&&g.length&&e.length&&(b[c[0].id]=c[0].value,b[g[0].id]=g[0].value,b[e[0].id]=e[0].value)}d.find("#freeSampleOfferListingID")&&d.find("#freeSampleOfferListingID").val()&&""!==d.find("#freeSampleOfferListingID").val()&&(b["ASIN.sample"]=
a.$("input#csxfsSelectedAsin").val(),b["offeringListingID.sample"]=d.find("#freeSampleOfferListingID").val(),b["quantity.sample"]=1);return b}var h,f,q,w,t,u={},r={},e=p.ue,x=a.$(".ccxss_desktop_atc_form").length,z=function(d,c){a.$(d).addClass("aok-hidden");a.$(c).removeClass("aok-hidden")},A=function(a){var c="";a.length&&null!==a.prop("action")&&(c=a.prop("action"));var b="",e=c.search("ref\x3d");a.length&&-1!==e&&(b=c.substr(e,c.length));return b},m=function(d){var c=a.$(this),b=A(c),g={sessionID:c.find("input[name\x3d'session-id']").val(),
clientName:"SmartShelf"},h=function(){c.unbind("submit",m);c.submit()},f=function(b,f){(function(g){return a.on("SUCCESS_CALL_BACK"+c.attr("id"),function(f){b&&b.isOK?(p.$Nav.when("api.setCartCount").run(function(a){a(f)}),"main"!==d.data.buttonType||q?(f<=g||e&&e.count&&e.count("smartShelfAccessoriesAdded",1),z(c.find(".ccxss_atc_spinner"),c.find(".ccxss_success_message"))):(a.$(".smartShelfFailure").addClass("aok-hidden"),a.$(".smartShelfSuccess").removeClass("aok-hidden"),t||(0===x&&(x=a.$(".ccxss_desktop_atc_form").length),
e&&e.count&&e.count("smartShelfAccessoriesSeen",x),e&&e.count&&e.count("smartShelfShowSecondaryPanel",1),t=!0),w.animateIn(u[d.data.buttonId]),q=!0)):h();a.off("SUCCESS_CALL_BACK"+c.attr("id"))})})(f);k("SUCCESS_CALL_BACK"+c.attr("id"),g)},k=function(c,b){a.post("/gp/api/cart/1.0/get-cart-count.json",{params:b,success:function(b){var d;b&&b.isOK&&b.total&&b.total.numActiveItem!==l&&(d=b.total.numActiveItem);a.trigger(c,d)},error:h})};"ss"===d.data.buttonType&&(a.$(c.find(".csxsw_item_atc")).addClass("aok-hidden"),
a.$(c.find(".ccxss_atc_spinner")).removeClass("aok-hidden"));a.on("ATC_CALL_BACK"+c.attr("id"),function(e){a.post("/gp/add-to-cart/json/"+b,{params:n(c,r[d.data.buttonId]),success:function(a){f(a,e)},error:h});a.off("ATC_CALL_BACK"+c.attr("id"))});k("ATC_CALL_BACK"+c.attr("id"),g);d.preventDefault()},v=function(d){a.$(d.data.button).closest("form").bind("submit",{buttonType:"main",buttonId:d.data.button},m);a.$(".ccxss_desktop_atc_form").bind("submit",{buttonType:"ss",buttonId:"smartShelfButton"},
m)},k=function(d){a.$(d).closest("form").unbind("submit",m);a.$(".ccxss_desktop_atc_form").length&&a.$(".ccxss_desktop_atc_form").unbind("submit",m)},y=function(){var d=a.$("#smartShelfSamplingBuyBoxReplace");if(0!==d.length){var c=a.$("#toggleBuyBox #sampling");c.children().addClass("aok-hidden");c.append(d);d.removeClass("aok-hidden")}};return{init:function(d,c,b){w=d;h=a.state("smartShelfVASInfo");a.state("accessoryInfo");t=q=!1;u[b]=c;r[b]="offerListingID";r.smartShelfButton="offerListingID";
a.$("#"+c+"_secondaryPanelBackButton").click(function(){q=!1;y();k(b)});f=a.$("#"+c+"_actionPanelSecondaryPanelDivider");f.addClass("smartShelfDivider");f.removeClass("actionPanelSecondaryPanelDivider");a.$(".ccxsmartShelf .plsims").hide();h!==l&&h.hideSmartShelf||(k(b),a.$(b).unbind("click",v),a.$("#ccxssContent").children().not(".aok-hidden").length&&a.$(b).bind("click",{button:b},v))},initV2:function(d,c,b,e){w=d;h=a.state("smartShelfVASInfo");a.state("accessoryInfo");t=q=!1;u[b]=c;r[b]=e;r.smartShelfButton=
"offerListingID";a.$("#"+c+"_secondaryPanelBackButton").click(function(){q=!1;y();k(b)});f=a.$("#"+c+"_actionPanelSecondaryPanelDivider");f.addClass("smartShelfDivider");f.removeClass("actionPanelSecondaryPanelDivider");a.$(".ccxsmartShelf .plsims").hide();h!==l&&h.hideSmartShelf||(k(b),a.$(b).unbind("click",v),a.$("#ccxssContent").children().not(".aok-hidden").length&&a.$(b).bind("click",{button:b},v))},undelegateFormHandlers:k,undelegateAllHandlers:function(){Object.keys(u).forEach(function(d){a.$(d).closest("form").unbind("submit",
m)});a.$(".ccxss_desktop_atc_form").length&&a.$(".ccxss_desktop_atc_form").unbind("submit",m)}}})});
/* ******** */
(function(f){var g=window.AmazonUIPageJS||window.P,v=g._namespace||g.attributeErrors,e=v?v("SmartHomeDPAssets",""):g;e.guardFatal?e.guardFatal(f)(e,window):e.execute(function(){f(e,window)})})(function(f,g,v){f.when("A","a-button","a-checkbox","sh-badge-utils","ready").execute(function(e,y,n,x){function m(c){var e=w[c],a=y(d.selectors.shAtcBtn);0<c?(a.enable(),q(d.selectors.shTotalPriceContainer).css("visibility","visible")):(a.disable(),q(d.selectors.shTotalPriceContainer).css("visibility","hidden"));
a.text(e)}function k(){var c=0,e=0,a=[];q(d.selectors.shCheckbox).each(function(){var b=q(this);b.find("input").prop("checked")&&(e++,b=b.data(),a.push({asin:b[d.dataProperties.checkboxAsin],offerListingId:b[d.dataProperties.checkboxOfferListingId]}),c+=b[d.dataProperties.checkboxPrice])});x.injectUniversalAddToCartParams(a,d.selectors.shAtcFormFields);x.updatePrice(d.selectors.shAtcTotalPriceText,p,c,f,r);m(e)}var d={selectors:{shAtcBtn:"#sh-badge-v2-atc-btn",shCheckbox:".sh-badge-v2-chkBox",shAtcTotalPriceText:"#sh-badge-v2-simple-total-price",
shAtcFormFields:".sh-badge-v2-atc-form-fields",shTotalPriceContainer:"#sh-badge-v2-atc-total-price-container"},pageStateModels:{shAtcBtnMsg:"sh-badge-v2-atc-btn-messages",shBadgeV2WidgetData:"sh-badge-v2-data"},pageStateModelKeys:{currencyDecimalSeparator:"currencyDecimalSeparator",currencyCode:"currencyCode",priceFormat:"priceFormat"},declarativeActions:{shCheckBoxEventHandler:"sh-badge-v2-chkBox-action"},dataProperties:{checkboxPrice:"price",checkboxAsin:"asin",checkboxOfferListingId:"offerlistingid"},
events:{expanderCollapse:"a:expander:sh-badge-v2-rq-device-expander:toggle:collapse"}},c=e.state(d.pageStateModels.shBadgeV2WidgetData);if("object"!==typeof c)return!1;var f=c[d.pageStateModelKeys.currencyCode],p=c[d.pageStateModelKeys.priceFormat],r=c[d.pageStateModelKeys.currencyDecimalSeparator],w=e.state(d.pageStateModels.shAtcBtnMsg);r||(r="");if(!r&&"JPY"!==f||!f||!p||"object"!==typeof w)return!1;var q=e.$;e.declarative(d.declarativeActions.shCheckBoxEventHandler,"change",function(){k()});e.on(d.events.expanderCollapse,
function(){n(d.selectors.shCheckbox).check()});n(d.selectors.shCheckbox).enable();e.on("a:pageUpdate",function(){n(d.selectors.shCheckbox).enable()})});"use strict";f.when("A","sh-accounting","ready").register("sh-badge-utils",function(e,f){var n=e.$;return{injectUniversalAddToCartParams:function(e,m){var k=n(m);k.empty();e.forEach(function(d,c){n("\x3cinput\x3e").attr({type:"hidden",name:"ASIN."+c,value:d.asin}).appendTo(k);n("\x3cinput\x3e").attr({type:"hidden",name:"offerListingID."+c,value:d.offerListingId}).appendTo(k)})},
updatePrice:function(e,m,k,d,c){k=f.formatNumber(k,"JPY"===d?"0":"2",","===c?".":",",c);m=m.replace(/([0.,]*[0][0.,]*)/,k);n(e).html(m)}}});f.register("sh-accounting",function(){function e(a){return!!(""===a||a&&a.charCodeAt&&a.substr)}function f(a){return p?p(a):"[object Array]"===r.call(a)}function n(a){return a&&"[object Object]"===r.call(a)}function x(a,b){var c;a=a||{};b=b||{};for(c in b)b.hasOwnProperty(c)&&null==a[c]&&(a[c]=b[c]);return a}function m(a,b,c){var e=[],d,f;if(!a)return e;if(g&&
a.map===g)return a.map(b,c);d=0;for(f=a.length;d<f;d++)e[d]=b.call(c,a[d],d,a);return e}function k(a,b){a=Math.round(Math.abs(a));return isNaN(a)?b:a}function d(a){var b=c.settings.currency.format;"function"===typeof a&&(a=a());return e(a)&&a.match("%v")?{pos:a,neg:a.replace("-","").replace("%v","-%v"),zero:a}:a&&a.pos&&a.pos.match("%v")?a:e(b)?c.settings.currency.format={pos:b,neg:b.replace("%v","-%v"),zero:b}:b}var c={version:"0.4.1",settings:{currency:{symbol:"$",format:"%s%v",decimal:".",thousand:",",
precision:2,grouping:3},number:{precision:0,grouping:3,thousand:",",decimal:"."}}},g=Array.prototype.map,p=Array.isArray,r=Object.prototype.toString,w=c.unformat=c.parse=function(a,b){if(f(a))return m(a,function(a){return w(a,b)});a=a||0;if("number"===typeof a)return a;b=b||c.settings.number.decimal;var d=new RegExp("[^0-9-"+b+"]",["g"]);a=parseFloat((""+a).replace(/\((.*)\)/,"-$1").replace(d,"").replace(b,"."));return isNaN(a)?0:a},q=c.toFixed=function(a,b){b=k(b,c.settings.number.precision);var d=
Math.pow(10,b);return(Math.round(c.unformat(a)*d)/d).toFixed(b)},v=c.formatNumber=c.format=function(a,b,d,e){if(f(a))return m(a,function(a){return v(a,b,d,e)});a=w(a);var t=x(n(b)?b:{precision:b,thousand:d,decimal:e},c.settings.number),u=k(t.precision),h=0>a?"-":"",l=parseInt(q(Math.abs(a||0),u),10)+"",g=3<l.length?l.length%3:0;return h+(g?l.substr(0,g)+t.thousand:"")+l.substr(g).replace(/(\d{3})(?=\d)/g,"$1"+t.thousand)+(u?t.decimal+q(Math.abs(a),u).split(".")[1]:"")},z=c.formatMoney=function(a,
b,e,g,t,u){if(f(a))return m(a,function(a){return z(a,b,e,g,t,u)});a=w(a);var h=x(n(b)?b:{symbol:b,precision:e,thousand:g,decimal:t,format:u},c.settings.currency),l=d(h.format);return(0<a?l.pos:0>a?l.neg:l.zero).replace("%s",h.symbol).replace("%v",v(Math.abs(a),k(h.precision),h.thousand,h.decimal))};c.formatColumn=function(a,b,g,q,t,u){if(!a)return[];var h=x(n(b)?b:{symbol:b,precision:g,thousand:q,decimal:t,format:u},c.settings.currency),l=d(h.format),r=l.pos.indexOf("%s")<l.pos.indexOf("%v")?!0:!1,
p=0;a=m(a,function(a,b){if(f(a))return c.formatColumn(a,h);a=w(a);a=(0<a?l.pos:0>a?l.neg:l.zero).replace("%s",h.symbol).replace("%v",v(Math.abs(a),k(h.precision),h.thousand,h.decimal));a.length>p&&(p=a.length);return a});return m(a,function(a,b){return e(a)&&a.length<p?r?a.replace(h.symbol,h.symbol+Array(p-a.length+1).join(" ")):Array(p-a.length+1).join(" ")+a:a})};return c})});
/* ******** */
(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(e){var l=window.AmazonUIPageJS||window.P,n=l._namespace||l.attributeErrors,f=n?n("DetailPageHNBAssets",""):l;f.guardFatal?f.guardFatal(e)(f,window):f.execute(function(){e(f,window)})})(function(e,l,n){e.when("A","postMetric","faddAjaxCallConstants","faddAjaxCallUtil").execute(function(f,e,c,b){var d=f.$,k={},a=function(){k.isSDAvailable?f.ajax(c.AJAXCALLURL,{method:"post",dataType:"json",contentType:"application/x-www-form-urlencoded; charset\x3dUTF-8",params:k.getSlotArgs,success:function(a){var c=
b.successOnAjaxCallToGetSlotsAPI(a);a=b.isShippingOrientedPromise(a);c&&!b.shouldHidePromiseMessage()?(a?d("#fadd").html(c):d("#fadd").html(k.scheduledDeliveryMessage).append(c).append(k.scheduledDeliveryCheckoutMessage),e.postCountMetric("FADDMobileSDMessageShown")):e.postCountMetric("FADDMobileUnavailableWhenSDAvailable")},error:function(){e.postCountMetric("FADDMobileErrorWhenSDAvailable")},timeout:5E3,traditional:!0}):e.postCountMetric("FADDMobileWhenSDUnavailable")};k=b.init();a();f.on("a:pageUpdate",
function(){k=b.init();d("#fadd").text().trim()||a()})});"use strict";e.when("A").register("faddAjaxCallConstants",function(){return{SDMESSAGE:"Get delivery by",SDCHECKOUTMESSAGE:"Schedule a convenient slot at checkout.",AJAXCALLURL:"/gp/product/features/scheduled-delivery/get-slots-json.html?powerbar\x3d0\x26sourcePage\x3dDetail",MONTHNAMES:"January February March April May June July August September October November December".split(" "),DAYNAMES:"Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),
STDMESSAGE:"Get delivery in 3-5 business days.",SDNOSLOTSPREFIXMESSAGE:"Delivery to",SDNOSLOTSSUFFIXMESSAGE:"is currently not available for this item.",WHYLINKDESKTOP:"/gp/help/customer/display.html/ref\x3dddm_undeliverable_dp?ie\x3dUTF8\x26nodeId\x3d200966130\x26pop-up\x3d1#",WHYLINKMOBILE:"/gp/help/customer/display.html/ref\x3dddm_undeliverable_dp?ie\x3dUTF8\x26nodeId\x3d200966130#",DETAILSLINKDESKTOP:"/gp/help/customer/display.html/ref\x3dddm_not_ft_dp?ie\x3dUTF8\x26nodeId\x3d200534000\x26pop-up\x3d1#",
DETAILSLINKMOBILE:"/gp/help/customer/display.html/ref\x3dddm_not_ft_dp?ie\x3dUTF8\x26nodeId\x3d200534000#",DETAILS:"Details"}});"use strict";e.when("A","faddAjaxCallConstants","domConstants").execute(function(f,h,c){e.now().register("faddAjaxCallUtil",function(){var b=f.$,d={},e={};d.init=function(){e.isSDAvailable=d.isValueTrue(b(c.faddIsSDAvailable).val());e.scheduledDeliveryMessage=b(c.faddScheduledDeliveryMessage).val()||h.SDMESSAGE;e.scheduledDeliveryCheckoutMessage=b(c.faddScheduledDeliveryCheckoutMessage).val()||
h.SDCHECKOUTMESSAGE;e.shippingOrientedPromiseMessage=b(c.faddShippingOrientedPromiseMessage).val();var a={};a.marketplace=b(c.faddMarketplace).val()?b(c.faddMarketplace).val():"";a.shipoption=b(c.faddShipOption).val()?b(c.faddShipOption).val():"";a.merchant=b(c.faddMerchant).val()?b(c.faddMerchant).val():"";a.offerListingID=b(c.faddOfferListingID).val()?b(c.faddOfferListingID).val():"";a.quantity=b(c.faddQuantity).val()?b(c.faddQuantity).val():"";a.address=b(c.faddAddress).val()?b(c.faddAddress).val():
"";a.zipcode=!a.address&&b(c.faddZipcode).val()?b(c.faddZipcode).val():"";a.asin=b(c.faddAsin).val()?b(c.faddAsin).val():"";a.sku=b(c.faddSku).val()?b(c.faddSku).val():"";a.isAFN=b(c.faddIsAFN).val()?b(c.faddIsAFN).val():"";a.fmid=b(c.faddFmid).val()?b(c.faddFmid).val():"";e.getSlotArgs=a;return e};d.isValueTrue=function(a){return a&&"function"===typeof a.toLowerCase?"true"===a.toLowerCase():!1};d.getMonthNames=function(){for(var a=[],g=0;g<c.faddMonthNames.length;g++)a.push(b(c.faddMonthNames[g]).val()?
b(c.faddMonthNames[g]).val():h.MONTHNAMES[g]);return a};d.getDayNames=function(){for(var a=[],g=0;g<c.faddDayNames.length;g++)a.push(b(c.faddDayNames[g]).val()?b(c.faddDayNames[g]).val():h.DAYNAMES[g]);return a};d.convertSlotMapToArray=function(a){var b=[];f.each(a,function(a,c){b.push(a)});return b};d.areSlotsAvailable=function(a){return 1<=a.length};d.getEarliestAndCheapestSlotsMap=function(a){var b={};b.Cheapest=a[0];b.Earliest=a[0];for(var c=a.length,d=1;d<c;d++){if(b.Cheapest.cost>a[d].cost||
a[d].cost===b.Cheapest.cost&&b.Cheapest.sm>a[d].sm)b.Cheapest=a[d];b.Earliest.sm>a[d].sm&&(b.Earliest=a[d])}return b};d.successOnAjaxCallToGetSlotsAPI=function(a){var g;if(a&&!a.errorMsg&&a.ids){if(a=d.convertSlotMapToArray(a.ids),d.areSlotsAvailable(a)&&(0<b(c.isSlotsAvailable).length&&b(c.isSlotsAvailable).val("true"),a=d.getEarliestAndCheapestSlotsMap(a).Earliest)){var f=new Date(1E3*a.sm),k=d.getMonthNames(),h=d.getDayNames(),l=f.getMonth(),m=f.getDate();f=h[f.getDay()];"A1VC38T7YXB528"===b(c.faddMarketplace).val()?
(h=b(c.faddLanguage).val(),"JP"===h?g=b("\x3cspan\x3e\x3cstrong\x3e\x26nbsp;"+(l+1)+"/"+m+"\x26nbsp;"+f+"\x26nbsp;"+a.sut+"-"+a.eut+" \x3c/strong\x3e\x3c/span\x3e"):"EN"===h?g=b("\x3cspan\x3e\x3cstrong\x3e\x26nbsp;"+f+",\x26nbsp;"+k[l]+"\x26nbsp;"+m+",\x26nbsp;"+a.sut+"-"+a.eut+" \x3c/strong\x3e\x3c/span\x3e"):"ZH"===h&&(g=b("\x3cspan\x3e\x3cstrong\x3e\x26nbsp;"+k[l]+m+"日\x26nbsp;"+f+a.sut+"-"+a.eut+" \x3c/strong\x3e\x3c/span\x3e"))):g=b("\x3cspan\x3e\x3cstrong\x3e\x26nbsp;"+(f+",\x26nbsp;"+k[l]+
"\x26nbsp;"+m)+",\x26nbsp;"+a.sut+"\x26nbsp;-\x26nbsp;"+a.eut+". \x3c/strong\x3e\x3c/span\x3e")}}else d.isShippingOrientedPromise(a)&&a.defaultDates&&a.defaultDates.maxShipDisplay&&(k=e.shippingOrientedPromiseMessage)&&(g=k.replace("%dateDisplay",a.defaultDates.maxShipDisplay));return g};d.isShippingOrientedPromise=function(a){return a&&a.slotQualityInfo&&"DEFERRED"===a.slotQualityInfo.slotQuality&&"SD_INVENTORY_STATE_RESTRICTED"===a.slotQualityInfo.slotQualityDetail};d.shouldHidePromiseMessage=function(){return d.isValueTrue(b(c.hidePromiseMessage).val())};
return d})});"use strict";e.when("A").execute(function(f){e.now().register("metricConstants",function(){return{promiseConstants:{LOG_KEY_DDM_AVAIL_TYPE:"ddm_avail_type",LOG_KEY_DDM_POSTAL_CODE:"ddm_postal_code",LOG_KEY_DDM_STATE:"ddm_state",LOG_KEY_DDM_CITY:"ddm_city",LOG_KEY_DDM_DISTRICT:"ddm_district",LOG_KEY_DDM_ADDRESS_SOURCE:"ddm_address_source",LOG_KEY_DDM_COUNTRY:"ddm_country",LOG_KEY_DDM_ADDRESS_SELECT_SOURCE:"ddm_address_select_source",LOG_KEY_DDM_SHIPMETHOD_CNT:"ddm_shipmethod_cnt",LOG_KEY_DDM_FASTEST_METHOD:"ddm_fastest_method",
LOG_KEY_DDM_FASTEST_EARLIEST_PROMISE_INSEC:"ddm_fastest_earliest_promise_insec",LOG_KEY_DDM_FASTEST_LATEST_PROMISE_INSEC:"ddm_fastest_latest_promise_insec",LOG_KEY_DDM_FASTEST_INTERNAL_SHIPPING_EARLIEST_INSEC:"ddm_fastest_internal_shipping_earliest_insec",LOG_KEY_DDM_FASTEST_INTERNAL_SHIPPING_LATEST_INSEC:"ddm_fastest_internal_shipping_latest_insec",LOG_KEY_DDM_SUPPRESS_PAID:"ddm_suppress_paid",LOG_KEY_DDM_CHEAPEST_METHOD:"ddm_cheapest_method",LOG_KEY_DDM_CHEAPEST_EARLIEST_PROMISE_INSEC:"ddm_cheapest_earliest_promise_insec",
LOG_KEY_DDM_CHEAPEST_LATEST_PROMISE_INSEC:"ddm_cheapest_latest_promise_insec",LOG_KEY_DDM_CHEAPEST_INTERNAL_SHIPPING_EARLIEST_INSEC:"ddm_cheapest_internal_shipping_earliest_insec",LOG_KEY_DDM_CHEAPEST_INTERNAL_SHIPPING_LATEST_INSEC:"ddm_cheapest_internal_shipping_latest_insec",LOG_KEY_NOT_FASTTRACKABLE_REASONCODE:"notFastTrackableReasonCode",LOG_KEY_FAST_TRACKABLE:"fast-trackable",LOG_KEY_REQUEST_ID:"requestID",LOG_KEY_DDM_CUTOFF:"ddm_cutoff",LOG_KEY_FAST_TRACK_TIME:"fast-track-time",LOG_KEY_PROMISE_DELIVERY_DATE:"promise-delivery-date",
LOG_KEY_SAME_DAY_FAST_TRACK:"same-day-fast-track",LOG_KEY_LIST_PRICE:"list-price",LOG_KEY_IS_FBA:"is-fba",LOG_KEY_PRIME_ELIGIBLE:"is-prime-eligible-item",LOG_KEY_MERCHANT_ID:"merchant-id",LOG_KEY_OUR_PRICE:"our-price",LOG_KEY_ADDRESS_ID:"addressId",LOG_KEY_IS_RDD:"is-rdd",LOG_VALUE_YES_FLAG:"Y",LOG_VALUE_NO_FLAG:"N",LOG_VALUE_NA:"NA"}}})});"use strict";e.when("A").execute(function(f){e.now().register("domConstants",function(){return{faddIsSDAvailable:"#faddIsSDAvailable",faddIsSecondarySDAvailable:"#faddIsSecondarySDAvailable",
faddScheduledDeliveryMessage:"#faddScheduledDeliveryMessage",faddScheduledDeliveryCheckoutMessage:"#faddScheduledDeliveryCheckoutMessage",faddShippingOrientedPromiseMessage:"#faddShippingOrientedPromiseMessage",faddMarketplace:"#faddMarketplace",faddShipOption:"#faddShipOption",faddSecondaryShipOption:"#faddSecondaryShipOption",faddMerchant:"#faddMerchant",faddOfferListingID:"#faddOfferListingID",faddQuantity:"#faddQuantity",faddAddress:"#faddAddress",faddZipcode:"#faddZipcode",faddAsin:"#faddAsin",
faddSku:"#faddSku",faddIsAFN:"#faddIsAFN",faddFmid:"#faddFmid",isSlotsAvailable:"#isSlotsAvailable",shipOptionForRenderedSlot:"#shipOptionForRenderedSlot",hidePromiseMessage:"#hidePromiseMessage",faddMonthNames:"#faddJanuaryString #faddFebruaryString #faddMarchString #faddAprilString #faddMayString #faddJuneString #faddJulyString #faddAugustString #faddSeptemberString #faddOctoberString #faddNovemberString #faddDecemberString".split(" "),faddDayNames:"#faddSundayString #faddMondayString #faddTuesdayString #faddWednesdayString #faddThursdayString #faddFridayString #faddSaturdayString".split(" "),
faddPromiseLogMap:"#faddPromiseLogMap",faddStandardDeliveryMessage:"#faddStandardDeliveryMessage",faddCityName:"#faddCityName",faddIsSTDAvailable:"#faddIsSTDAvailable",faddDetails:"#faddDetailsString",faddStandardDeliveryINActualPromiseMsg:"#faddStandardDeliveryINActualPromiseMsg",faddGlProductGroupId:"#faddGlProductGroupId",faddLanguage:"#faddLanguage"}})});e.when("A","postMetric").register("faddWeblabUtil",function(e,h){return{triggerWeblabAndCallback:function(c,b,d){b&&d&&e.$.post("/gp/detailpage/hardlines-util/get-treatment-and-record-weblabs.html",
d,function(d){c(d,b)}).fail(function(b,a,c){h.postCountMetric("FADDWeblabTriggerFailed-"+a)})}}})});
/* ******** */
(function(c){var b=window.AmazonUIPageJS||window.P,d=b._namespace||b.attributeErrors,a=d?d("AmazonCertifiedDetailPageAssets",""):b;a.guardFatal?a.guardFatal(c)(a,window):a.execute(function(){c(a,window)})})(function(c,b,d){c.when("A","ready").execute(function(a){var c=a.$,d=function(a){b.ue&&b.ue.count&&b.ue.count(a,1)},f=a.debounce(function(){var a=c("#amazon-certified-content");a.length&&!a.data("amazon-certified-render-counter-logged")&&(d("cetech-ac-badge-render"),a.data("amazon-certified-render-counter-logged",
!0))},1E3);a.on("a:popover:afterShow:AmazonCertifiedPopover a:popover:afterShow:AmazonCertifiedSecondaryView a:sheet:afterShow:AmazonCertifiedSheet",function(b){d("cetech-ac-explanatory-view-show");var e;b=c(".amazonCertifiedPageState").find("script").html();try{e=a.parseJSON(b)}catch(f){e={}}e=(e||{}).featuredCertificationShortId;c.get("/gp/product/ajax-handlers/reftag.html/ref\x3d"+(e?"amazon_certified_learn_more_"+e:"amazon_certified_learn_more"))});a.on("a:pageUpdate",f);f()})});
/* ******** */
(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(r){var u=window.AmazonUIPageJS||window.P,w=u._namespace||u.attributeErrors,p=w?w("DetailPageSTSAssets",""):u;p.guardFatal?p.guardFatal(r)(p,window):p.execute(function(){r(p,window)})})(function(r,u,w){function p(a,c){if(!(a instanceof c))throw new TypeError("Cannot call a class as a function");}function p(a,c){if(!(a instanceof c))throw new TypeError("Cannot call a class as a function");}function p(a,c){if(!(a instanceof c))throw new TypeError("Cannot call a class as a function");}function p(a,
c){if(!(a instanceof c))throw new TypeError("Cannot call a class as a function");}function p(a,c){if(!(a instanceof c))throw new TypeError("Cannot call a class as a function");}function p(a,c){if(!(a instanceof c))throw new TypeError("Cannot call a class as a function");}function p(a,c){if(!(a instanceof c))throw new TypeError("Cannot call a class as a function");}function p(a,c){if(!(a instanceof c))throw new TypeError("Cannot call a class as a function");}function p(a,c){if(!(a instanceof c))throw new TypeError("Cannot call a class as a function");
}function p(a,c){if(!(a instanceof c))throw new TypeError("Cannot call a class as a function");}function p(a,c){if(!(a instanceof c))throw new TypeError("Cannot call a class as a function");}function p(a,c){if(!(a instanceof c))throw new TypeError("Cannot call a class as a function");}function p(a,c){if(!(a instanceof c))throw new TypeError("Cannot call a class as a function");}function p(a,c){if(!(a instanceof c))throw new TypeError("Cannot call a class as a function");}function p(a,c){if(!(a instanceof
c))throw new TypeError("Cannot call a class as a function");}function p(a,c){if(!(a instanceof c))throw new TypeError("Cannot call a class as a function");}function p(a,c){if(!(a instanceof c))throw new TypeError("Cannot call a class as a function");}function p(a,c){if(!(a instanceof c))throw new TypeError("Cannot call a class as a function");}function p(a,c){if(!(a instanceof c))throw new TypeError("Cannot call a class as a function");}function p(a,c){if(!(a instanceof c))throw new TypeError("Cannot call a class as a function");
}function p(a,c){if(!(a instanceof c))throw new TypeError("Cannot call a class as a function");}function p(a,c){if(!(a instanceof c))throw new TypeError("Cannot call a class as a function");}function p(a,c){if(!(a instanceof c))throw new TypeError("Cannot call a class as a function");}function p(a,c){if(!(a instanceof c))throw new TypeError("Cannot call a class as a function");}function p(a,c){if(!(a instanceof c))throw new TypeError("Cannot call a class as a function");}function p(a,c){if(!(a instanceof
c))throw new TypeError("Cannot call a class as a function");}function p(a,c){if(!(a instanceof c))throw new TypeError("Cannot call a class as a function");}function p(a,c){if(!(a instanceof c))throw new TypeError("Cannot call a class as a function");}function p(a,c){if(!(a instanceof c))throw new TypeError("Cannot call a class as a function");}"use strict";r.when("A","ship-to-store-settings","ship-to-store-metric-publisher","ship-to-store-metric-names","ship-to-store-offer-helper","ship-to-store-item-association-helper",
"ship-to-store-vas-metric-utils","ship-to-store-helper","ship-to-store").register("ship-to-store-atc",function(a,c,b,e,n,m,g,d){var t=a.$,k=JSON.parse(t("[data-a-state*\x3dvas-common-vm]").html());k&&k.isShipToStore&&(k.hijackMBCATC=!1,k.populateMBCATC=!1,k.showEnhancedUpsellBundle=!1,k.showFakeTwisterBundles=!1,t("[data-a-state*\x3dvas-common-vm]").html(JSON.stringify(k)));return new function l(){var k=this;p(this,l);this.handleAttachDSSEvent=function(){t("body").undelegate(k.$atcButton.selector,
"click.attachDSS");t(k.$atcButton.selector).bind("click.mynamespace",k.atcClicked)};this.init=function(a){k.$addProfessionalServicesRow=t("#addProfessionalServicesRow");k.$atcButton=t("#add-to-cart-button");k.$buyNowFeatureDiv=t("[id\x3dbuyNow],[id\x3dbuyNow_feature_div]");k.$oneClickContainer=t("[id^\x3doneClickAvailable]");k.addedToCart=!1;k.atcClickIntercepted=!1;k.itemAssociationHelper=m;k.offerHelper=n;k.modal=a;k.atcSiEnabled=c.get("atcSiEnabled");d.hasShipToStoreBeenInitialized()||(t("body").undelegate(k.$atcButton.selector,
"click.lsatc").delegate(k.$atcButton.selector,"click.lsatc",k.atcClicked),"T1"===c.get("atcTwisterFixWeblab")&&k.handleAttachDSSEvent())};this.pageRefreshPerformed=function(a){k.onOriginalOfferPage=a.currentOfferListingId===a.winningOfferListingId;k.$addProfessionalServicesRow=t("#addProfessionalServicesRow");k.$atcButton=t("#add-to-cart-button");k.$buyNowFeatureDiv=t("[id\x3dbuyNow],[id\x3dbuyNow_feature_div]");k.$oneClickContainer=t("[id^\x3doneClickAvailable]");t("body").undelegate(k.$atcButton.selector,
"click.lsatc").delegate(k.$atcButton.selector,"click.lsatc",k.atcClicked);"T1"===c.get("atcTwisterFixWeblab")&&k.handleAttachDSSEvent()};this.atcClicked=function(){k.atcClickIntercepted=!0;b.publish(e.ATC_CLICK);b.logVasRefMarker(g,g.metricConstants.actions.addToCart);k.$addProfessionalServicesRow.is(":visible")?k.offerHelper.getAcceptedOffer()||k.modal.openCount||!k.atcSiEnabled?k.clickATCButton():k.modal.modalInstance?(b.publish(e.ATC_CLICK_MODAL_SHOWN),k.isATCButtonClicked=!0,k.modal.modalInstance.show()):
(k.clickATCButton(),b.publish(e.ATC_CLICK_MODAL_FAIL)):(b.publish(e.ATC_CLICK_INGRESS_HIDDEN),k.offerHelper.declineOffer(),k.clickATCButton());return!1};this.clickATCButton=function(){var a=(new Date).getTime();k.atcClickIntercepted&&(t("body").undelegate(k.$atcButton.selector,"click.lsatc",k.atcClicked),"T1"===c.get("atcTwisterFixWeblab")&&t(k.$atcButton.selector).unbind("click.mynamespace"));var d=k.offerHelper.getAcceptedOffer();d||k.onOriginalOfferPage||b.publish(e.ATC_LFS_CLICK_WITHOUT_OFFER);
if(d){b.publish(e.ATC_CLICK_WITH_OFFER);b.tag(c.get("refTagPrefix")+"mapping_set_winning_"+d.mappingSet);if(k.offerHelper.hasStoreDistanceString&&d.distanceString&&d.distanceString.endsWith(" mi")){var m=d.distanceString.substring(0,d.distanceString.length-3);isNaN(m)||b.publishEvent({distance:parseFloat(m),zipCode:c.get("zipCode")},"in-store-services","shiptostore.logs.CustomerToStoreDistancesExperiment.1")}d.isRecommendedOffer&&b.publish(e.ATC_CLICK_RECOMMENDED_OFFER)}else b.publish(e.ATC_CLICK_WITHOUT_OFFER);
m=k.offerHelper.getAccepterOfferTypeName().toLowerCase();(m="mobile"!==m&&"at_home"!==m)||b.publish(e.ADD_SERVICE_WITHOUT_IA);k.itemAssociationHelper.removeServices();k.itemAssociationHelper.addService(d,m).then(function(){k.addedToCart=!0;k.$atcButton.click();var d=(new Date).getTime()-a;b.publish(e.ATC_HIJACK_LATENCY,d)});"T1"===c.get("atcTwisterFixWeblab")&&(d=t("#addToCart"),t("body").undelegate("#add-to-cart-button","click.attachDSS"),d.submit())};this.offerAcceptedCallback=function(){k.hideBuyNowOneClickButtons()};
this.hideBuyNowOneClickButtons=function(){a.hide(k.$buyNowFeatureDiv);a.hide(k.$oneClickContainer)};this.offerDeclinedCallback=function(){k.showBuyNowOneClickButtons();k.itemAssociationHelper.removeServices()};this.showBuyNowOneClickButtons=function(){a.show(k.$buyNowFeatureDiv);a.show(k.$oneClickContainer)};this.modalOffersGenerated=function(a){a.offerCount||(k.showBuyNowOneClickButtons(),k.itemAssociationHelper.removeServices())};this.modalClosedCallback=function(){if(k.atcClickIntercepted&&!k.addedToCart||
"T1"===c.get("atcTwisterFixWeblab")&&k.isATCButtonClicked)k.clickATCButton(),k.isATCButtonClicked=!1};a.on("ship-to-store:modal:closed",this.modalClosedCallback);a.on("ship-to-store:modal:offers-generated",this.modalOffersGenerated);a.on("ship-to-store:offer-accepted",this.offerAcceptedCallback);a.on("ship-to-store:offer-declined",this.offerDeclinedCallback);this.onOriginalOfferPage=!0;this.isATCButtonClicked=!1}});"use strict";r.when("A","ship-to-store-atc","ship-to-store-settings","ship-to-store-helper",
"ship-to-store-metric-publisher","ship-to-store-metric-names","query-param","ship-to-store-offer-helper","ship-to-store-item-association-helper","a-dropdown","vehicle-info-utils","ship-to-store").execute(function(a,c,b,e,n,m,g,d,t,k,h){var l=function(){n.logRefTag(b.get("refTagPrefix"),{deviceType:b.get("deviceType")});n.tag(b.get("ueTag"));a.each(b.get("mappingSets"),function(a){n.tag(b.get("refTagPrefix")+"mapping_set_"+a)});e.isShipToStoreEnabled(b.get("winningWidgetName"),b.get("offerCollections"))?
r.when("ship-to-store-ingress","ship-to-store-modal").execute(function(b,g){n.publish(m.LOADED);var h=a.$;(new function z(){var l=this;p(this,z);this.quantityChanged=function(a){l.updateSelectedQuantity(a.value);!l.ingress.$selected.is(":visible")&&l.offerHelper.hasOfferForQuantity(l.selectedQuantity)||l.offerHelper.getAcceptedOffer()||l.itemAssociationHelper.removeServices()};this.quantityChangedBusiness=function(){var a=h("#quantityRelocate_feature_div tbody select").find(":selected").text();l.updateSelectedQuantity(a);
!l.ingress.$selected.is(":visible")&&l.offerHelper.hasOfferForQuantity(l.selectedQuantity)||l.offerHelper.getAcceptedOffer()||l.itemAssociationHelper.removeServices()};this.checkForValidSelectedOffers=function(){if(l.offerHelper&&l.offerHelper.getAcceptedOffer()){var d=l.offerHelper.getAcceptedOffer();(d=l.offerHelper.getOfferByStoreId(d.storeId))?(l.offerHelper.setVisibleOffers(d.offerType.name),a.trigger("ship-to-store:previous-offer-found",d)):l.offerHelper.declineOffer()}};this.updateSelectedQuantity=
function(d){l.offerHelper.setQuantity(d);l.offerHelper.setVisibleOffers();if(!l.offerHelper.getAsinForQuantity())return n.publish(m.SELECTED_QTY_NOT_MAPPED_TO_ASIN),!1;if(!l.offerHelper.hasVisibleOffers())return n.publish(m.SELECTED_QTY_MAPPED_TO_ASIN_WO_OFFERS),!1;n.publish(m.SELECTED_QTY_MAPPED_TO_ASIN_W_OFFERS);a.trigger("ship-to-store:generate-html")};this.modalOffersGenerated=function(d){d.offerCount?a.show(l.$shipToStoreFeatureDiv):a.hide(l.$shipToStoreFeatureDiv)};this.initModules=function(){l.$shipToStoreFeatureDiv=
h("#valueAdds_feature_div");l.ingress.init();l.offerHelper.init();l.modal.init();l.addToCart.init(l.modal)};this.init=function(){n.publish(m.INIT);l.ingress=b;l.itemAssociationHelper=t;l.offerHelper=d;l.modal=g;l.addToCart=c;l.initModules();var p=k.getSelect("quantity");p?l.updateSelectedQuantity(p.val()):l.updateSelectedQuantity(1);n.publish(m.OFFERS_ON_PAGE_LOAD,l.offerHelper.getNumberOfOffers());a.on("a:dropdown:quantity:select",l.quantityChanged);h("#quantityRelocate_feature_div tbody select").change(l.quantityChangedBusiness);
a.on("ship-to-store-buybox-quantity-changed",l.quantityChanged);a.on("ship-to-store:ingress:offered-click",l.offerHelper.setVisibleOffers);a.on("ship-to-store:modal:offers-generated",l.modalOffersGenerated);l.checkForValidSelectedOffers();n.publish(m.DISPLAY_WIDTH,h(u).width());n.publish(m.DISPLAY_HEIGHT,h(u).height());l.offerHelper.hasLFSOffers()?n.tag("pdpShipToStoreWidget:LFS"):n.tag("pdpShipToStoreWidget:noLFS");e.shipToStoreInitialized()}}).init()}):n.publish(m.CONTROLLER_ABORTED)};a.on("a:pageUpdate",
function(){console.log("Updating setting");e.shipToStoreNotInitialized();b.set(b.parsePageState());l()});l();a.$(u).load(function(){var b=k.getSelect("quantity");d.setQuantity(b.val());d.setVisibleOffers();a.trigger("ship-to-store:generate-html")});a.$(u).bind("pageshow",function(a){a.originalEvent.persisted&&(e.shipToStoreNotInitialized(),l())})});"use strict";r.when("A","ship-to-store-settings","ship-to-store-metric-publisher","ship-to-store-metric-names","ship-to-store-offer-helper","ship-to-store-vas-metric-utils",
"vehicle-info-utils","ship-to-store").register("ship-to-store-ingress",function(a,c,b,e,n,m,g){var d=a.$;return new function k(){var h=this;p(this,k);this.selectedIngressChangeClick=function(){a.trigger("ship-to-store:ingress:selected-change-click");a.trigger("ship-to-store:modal:show");b.publish(e.SELECTED_INGRESS_CHANGE_CLICK);h.modalIsReady||b.publish(e.SELECTED_INGRESS_CHANGE_CLICK_MODAL_NOT_READY)};this.offeredIngressClick=function(d){a.trigger("ship-to-store:ingress:offered-click",d.currentTarget.dataset.offerType);
a.trigger("ship-to-store:modal:show");b.publish(e.OFFER_INGRESS_CLICK);b.logVasRefMarker(m,m.metricConstants.actions.featureClick);h.modalIsReady||b.publish(e.OFFER_INGRESS_CLICK_MODAL_NOT_READY)};this.offerAcceptedCallback=function(){var d=h.offerHelper.getAcceptedOffer(),b=h.offerHelper.getSelectedOfferTypeCollection();h.$selected.find("#ship-to-store-selected-service-provider-address").text(d.displayAddress);h.$selected.find("#ship-to-store-selected-service-provider-name").text(d.merchantName);
h.$totalSelectedPricePlaceholder.html(d.localizedPrice+" )");h.$totalInstallationStringPlaceHolder.html(d.totalInstallationCostString);h.$offerBundlePriceTemplate.html(d.localizedServicePricePerQuantity);c.get("isVehicleInformationEnabled")&&h.$selectedVehiclePlaceholder.html(g.getMruVehicle().name);var e=h.$offerPriceTemplate.clone();e.html(d.localizedPrice);e.removeAttr("id");a.show(e);h.$selectedBelowAddress.find(".price").html(e);if(d.hasPromotion){var m=h.$offerPriceStrikethroughTemplate.clone();
m.html(d.localizedPriceWithoutPromotion);m.removeAttr("id");a.show(m);e.append(" ");e.after(m)}h.$selectedIngressOfferType.html(b.modalTabButtonString);d=h.offerHelper.getAsinForQuantity();h.$selectedBelowPrice.html(b.upsellAsinSpecificStrings[d].selectedIngressBelowPrice);a.hide(h.$offered);a.show(h.$selected);a.show(h.$addProfessionalServicesRow);a.trigger("ship-to-store:trigger-page-refresh",!1)};this.offerDeclinedCallback=function(){a.hide(h.$selected);a.show(h.$offered);a.trigger("ship-to-store:trigger-page-refresh",
!0)};this.amazonHappinessGuaranteeClick=function(){b.publish(e.AMAZON_HAPPINESS_GUARANTEE_CLICK)};this.generateHTML=function(){if(!c.get("isDynamicPricingApplicable")){var g=d(".ship-to-store-ingress-bullet-points"),k=c.get("quantitySpecificStrings");if(!k)return;var n=h.offerHelper.getSelectedQuantity();if(!k.hasOwnProperty(n))return;g.html(k[n].bulletPoints);a.show(g)}performance&&(performance.mark("ship-to-store-ingress-end"),performance.measure(e.INGRESS_SHOWING_SINCE_PAGE_LOAD_LATENCY,"ship-to-store-ingress-start",
"ship-to-store-ingress-end"),g=performance.getEntriesByName(e.INGRESS_SHOWING_SINCE_PAGE_LOAD_LATENCY),g.length&&(k=g[0].duration,b.publish(e.INGRESS_SHOWING_SINCE_PAGE_LOAD_LATENCY,g[0].startTime+k),b.publish(e.INGRESS_SHOWING_SINCE_MODULE_LOAD_LATENCY,k)));b.logVasRefMarker(m,m.metricConstants.actions.view)};this.quantityChangedCallback=function(){h.offerHelper.hasOfferForQuantity()?(b.publish(e.QUANTITY_SUPPORTED),a.show(h.$addProfessionalServicesRow),a.trigger("ship-to-store-pregenerate-offers")):
(b.publish(e.QUANTITY_NOT_SUPPORTED),a.hide(h.$addProfessionalServicesRow))};this.modalReadyCallback=function(){r.when("ship-to-store-ingress-button").execute(function(a){a.enable();h.modalIsReady=!0})};this.init=function(){h.$addProfessionalServicesRow=d("#addProfessionalServicesRow");h.$offered=d("#ship-to-store-ingress-offered");h.$offerPriceTemplate=d("#ship-to-store-modal-offer-price-text-template");h.$offerPriceStrikethroughTemplate=d("#ship-to-store-ingress-offer-price-text-strikethrough-template");
h.$offerBundlePriceTemplate=d("#ship-to-store-selected-service-below-address-bundle-price");h.$totalInstallationStringPlaceHolder=d("#total-installation-cost-for-units-placeholder");h.$totalSelectedPricePlaceholder=d("#total-service-price-selected-placeholder");h.$offerBundlePriceBreakDownTemplate=d("#ship-to-store-selected-service-below-address-bundle-price-breakdown");h.$offerBundlePriceBreakdownServiceStrikethroughTemplate=d("#ship-to-store-selected-service-below-address-bundle-price-breakdown-service-strikethrough");
h.$offerBundlePriceBreakdownServiceParenthesisTemplate=d("#ship-to-store-selected-service-below-address-bundle-price-breakdown-service-parenthesis");h.$selected=d("#ship-to-store-ingress-selected");h.$selectedBelowAddress=d("#ship-to-store-selected-service-below-address");h.$selectedBelowPrice=d("#ship-to-store-selected-service-below-price");h.$selectedIngressOfferType=d(".ship-to-store-ingress-header-primary-text .offer-type");c.get("isVehicleInformationEnabled")&&(h.$selectedVehiclePlaceholder=
d("#selected-vehicle-placeholder"));h.offerHelper.init()};performance&&performance.mark("ship-to-store-ingress-start");this.offerHelper=n;this.modalIsReady=!1;var l=d("body");l.delegate(".ship-to-store-ingress-button","click",this.offeredIngressClick);l.delegate(".ship-to-store-ingress-header-secondary-text","click",this.amazonHappinessGuaranteeClick);l.delegate("#ship-to-store-change-installation","click",this.selectedIngressChangeClick);a.on("ship-to-store:offer-accepted",this.offerAcceptedCallback);
a.on("ship-to-store:offer-declined",this.offerDeclinedCallback);a.on("ship-to-store:generate-html",this.generateHTML);a.on("ship-to-store:quantity-changed",this.quantityChangedCallback);a.on("ship-to-store:modal:ready",this.modalReadyCallback)}});"use strict";r.when("ship-to-store").register("ship-to-store-ingress-button",function(){var a=function b(){p(this,b)};a.enable=function(){r.when("jQuery","a-button").execute(function(a,e){e(".ship-to-store-ingress-button-container").enable();a(".ship-to-store-ingress-bullet-points").removeClass("disabled")})};
return a});"use strict";r.when("A","ship-to-store-settings","ship-to-store-offer-tags-helper","ship-to-store").register("ship-to-store-pushpin-icon-helper",function(a,c,b){return new function n(){var a=this;p(this,n);this.ZIP_ICON_CIRCLE_RADIUS=125;this.COLOR_BLACK="#000";this.COLOR_GRAY="#767676";this.COLOR_LIGHTGRAY="#ccc";this.COLOR_ORANGE="#ec8c00";this.COLOR_WHITE="#fff";this.getPushpinIcon=function(c){return c.isMobileAddressAZipCode?a.createMobileAddressZipCodeIcon():c.showCustomerAddressOnMap?
a.createPinIcon(c.pinSelected,'\x3cg transform\x3d"matrix( 1 0 0 1 4 5 )" id\x3d"Flows" stroke\x3d"none" stroke-width\x3d"1" fill\x3d"none" fill-rule\x3d"evenodd"\x3e\n                              \x3cg transform\x3d"translate(-905.000000, -636.000000)" fill\x3d"#FFFFFF"\x3e\n                                  \x3cg id\x3d"home" transform\x3d"translate(895.000000, 624.000000)"\x3e\n                                      \x3cg transform\x3d"translate(10.000000, 12.000000)" id\x3d"Group-2"\x3e\n                                          \x3cg\x3e\n                                              \x3cpolygon id\x3d"Fill-1" points\x3d"10.1169 -5.17241382e-05 -9.99999999e-05 7.09184483 1.1219 8.80468966 10.0959 2.51374138 18.7359 8.79486207 19.8859 7.10193103"\x3e\x3c/polygon\x3e\n                                              \x3cpolygon id\x3d"Fill-2" points\x3d"14.528475 5.30847414 14.528475 12.8948534 5.343225 12.8948534 5.343225 5.30847414 3.343225 5.30847414 3.343225 14.963819 16.528475 14.963819 16.528475 5.30847414"\x3e\x3c/polygon\x3e\n                                              \x3crect id\x3d"Rectangle" x\x3d"8.57142857" y\x3d"7.5" width\x3d"2.85714286" height\x3d"6"\x3e\x3c/rect\x3e\n                                          \x3c/g\x3e\n                                      \x3c/g\x3e\n                                  \x3c/g\x3e\n                              \x3c/g\x3e\n                          \x3c/g\x3e'):
b.hasCheapestTag(c.offerTags)?'\x3csvg width\x3d"29px" height\x3d"37px" viewBox\x3d"0 0 29 37" version\x3d"1.1" xmlns\x3d"http://www.w3.org/2000/svg" xmlns:xlink\x3d"http://www.w3.org/1999/xlink"\x3e\n                                       \x3cg id\x3d"Flows" stroke\x3d"none" stroke-width\x3d"1" fill\x3d"none" fill-rule\x3d"evenodd"\x3e\n                                           \x3cg id\x3d"2a-modal-sts-copy-4" transform\x3d"translate(-933.000000, -343.000000)"\x3e\n                                               \x3cg id\x3d"modal-box-" transform\x3d"translate(360.000000, 66.000000)"\x3e\n                                                   \x3cg id\x3d"map-" transform\x3d"translate(415.000000, 36.000000)"\x3e\n                                                       \x3cg id\x3d"pin_sts" transform\x3d"translate(157.000000, 240.000000)"\x3e\n                                                           \x3cg id\x3d"pin-selected-copy-2" fill-rule\x3d"evenodd" stroke-width\x3d"1"\x3e\n                                                               \x3cg id\x3d"Page-1"\x3e\n                                                                   \x3cpath d\x3d"M22.3448571,36.2826923 C22.3448571,37.0558462 19.1848571,37.6828462 15.2862857,37.6828462 C11.3877143,37.6828462 8.22628571,37.0558462 8.22628571,36.2826923 C8.22628571,35.5080769 11.3877143,34.8810769 15.2862857,34.8810769 C19.1848571,34.8810769 22.3448571,35.5080769 22.3448571,36.2826923" id\x3d"Fill-1" fill-opacity\x3d"0.2" fill\x3d"#000000"\x3e\x3c/path\x3e\n                                                                   \x3cpath d\x3d"M15.2857143,35.0766308 C15.2028571,35.0605538 15,34.9567846 14.8771429,34.8924769 C14.8542857,34.8676308 2,25.9683231 2,15.6381692 C2,8.1434 7.96,2.04586154 15.2857143,2.04586154 C22.6114286,2.04586154 28.5714286,8.1434 28.5714286,15.6381692 C28.5714286,25.9683231 15.7171429,34.8676308 15.5871429,34.9567846 C15.5671429,34.9582462 15.3685714,35.0605538 15.2857143,35.0766308" id\x3d"Fill-3" fill\x3d"#00A4B4"\x3e\x3c/path\x3e\n                                                                   \x3cpath d\x3d"M15.2857143,1.02307692 C7.42857143,1.02307692 1,7.6 1,15.6384615 C1,26.4538462 14,35.5153846 14.4285714,35.8076923 C14.7142857,35.9538462 15,36.1 15.2857143,36.1 C15.5714286,36.1 15.8571429,35.9538462 16.1428571,35.8076923 C16.5714286,35.5153846 29.5714286,26.4538462 29.5714286,15.6384615 C29.5714286,7.6 23.1428571,1.02307692 15.2857143,1.02307692 M15.2857143,3.06923077 C22.06,3.06923077 27.5714286,8.70784615 27.5714286,15.6384615 C27.5714286,24.6576154 17.0614286,32.642 15.2857143,33.9266923 C13.51,32.642 3,24.6576154 3,15.6384615 C3,8.70784615 8.51142857,3.06923077 15.2857143,3.06923077" id\x3d"Fill-5" fill\x3d"#FFFFFF"\x3e\x3c/path\x3e\n                                                               \x3c/g\x3e\n                                                           \x3c/g\x3e\n                                                           \x3cpath d\x3d"M14.9567054,23 L14.9567054,21.1964097 C13.8824304,21.1175638 12.9412219,20.8169685 12.1330517,20.2946146 L12.1330517,18.6388596 C12.8426646,18.9640988 13.404433,19.195705 13.8183738,19.3336853 C14.2323146,19.4716656 14.6117547,19.5554381 14.9567054,19.5850053 L14.9567054,16.7317846 L14.3653643,16.5100317 C13.5374827,16.2045039 12.9362919,15.8373833 12.561774,15.4086589 C12.1872561,14.9799345 12,14.4501967 12,13.8194298 C12,12.9816924 12.2710286,12.2868736 12.813094,11.7349525 C13.3551593,11.1830314 14.0696893,10.8676526 14.9567054,10.7888068 L14.9567054,9 L16.0506864,9 L16.0506864,10.8035903 C16.8194336,10.8824362 17.5635304,11.123898 18.2829989,11.5279831 L18.2829989,13.1837381 C17.464973,12.7599416 16.7208763,12.5036963 16.0506864,12.4149947 L16.0506864,15.2534319 L16.5681098,15.4456177 C17.4649816,15.770857 18.1055947,16.1453692 18.4899683,16.5691658 C18.8743419,16.9929623 19.0665259,17.5202362 19.0665259,18.1510032 C19.0665259,18.9690291 18.7930334,19.6515284 18.2460401,20.1985216 C17.6990469,20.7455149 16.9672696,21.0732131 16.0506864,21.1816262 L16.0506864,23 L14.9567054,23 Z M17.189018,18.2840549 C17.189018,17.9883829 17.1003177,17.7444571 16.9229145,17.5522703 C16.7455113,17.3600835 16.4547715,17.1900747 16.0506864,17.0422386 L16.0506864,19.5702218 C16.3759256,19.5307988 16.6469542,19.3878928 16.8637804,19.1414995 C17.0806065,18.8951061 17.189018,18.6092941 17.189018,18.2840549 Z M13.8479409,13.686378 C13.8479409,13.9721943 13.9341772,14.2136562 14.1066526,14.4107709 C14.2791279,14.6078855 14.562476,14.7852861 14.9567054,14.9429778 L14.9567054,12.4002112 C14.6117547,12.4494899 14.3407261,12.589932 14.1436114,12.8215417 C13.9464967,13.0531515 13.8479409,13.3414273 13.8479409,13.686378 Z" id\x3d"$" fill\x3d"#FFFFFF" fill-rule\x3d"nonzero"\x3e\x3c/path\x3e\n                                                       \x3c/g\x3e\n                                                   \x3c/g\x3e\n                                               \x3c/g\x3e\n                                           \x3c/g\x3e\n                                       \x3c/g\x3e\n                                   \x3c/svg\x3e':
b.hasFastestTag(c.offerTags)?'\x3csvg width\x3d"29px" height\x3d"37px" viewBox\x3d"0 0 29 37" version\x3d"1.1" xmlns\x3d"http://www.w3.org/2000/svg" xmlns:xlink\x3d"http://www.w3.org/1999/xlink"\x3e\n                                      \x3cg id\x3d"Flows" stroke\x3d"none" stroke-width\x3d"1" fill\x3d"none" fill-rule\x3d"evenodd"\x3e\n                                          \x3cg id\x3d"2a-modal-sts-copy-4" transform\x3d"translate(-890.000000, -343.000000)"\x3e\n                                              \x3cg id\x3d"modal-box-" transform\x3d"translate(360.000000, 66.000000)"\x3e\n                                                  \x3cg id\x3d"map-" transform\x3d"translate(415.000000, 36.000000)"\x3e\n                                                      \x3cg id\x3d"pin_sts" transform\x3d"translate(114.000000, 240.000000)"\x3e\n                                                          \x3cg id\x3d"pin-selected-copy-2" stroke-width\x3d"1"\x3e\n                                                              \x3cg id\x3d"Page-1"\x3e\n                                                                  \x3cpath d\x3d"M22.3448571,36.2826923 C22.3448571,37.0558462 19.1848571,37.6828462 15.2862857,37.6828462 C11.3877143,37.6828462 8.22628571,37.0558462 8.22628571,36.2826923 C8.22628571,35.5080769 11.3877143,34.8810769 15.2862857,34.8810769 C19.1848571,34.8810769 22.3448571,35.5080769 22.3448571,36.2826923" id\x3d"Fill-1" fill-opacity\x3d"0.2" fill\x3d"#000000"\x3e\x3c/path\x3e\n                                                                  \x3cpath d\x3d"M15.2857143,35.0766308 C15.2028571,35.0605538 15,34.9567846 14.8771429,34.8924769 C14.8542857,34.8676308 2,25.9683231 2,15.6381692 C2,8.1434 7.96,2.04586154 15.2857143,2.04586154 C22.6114286,2.04586154 28.5714286,8.1434 28.5714286,15.6381692 C28.5714286,25.9683231 15.7171429,34.8676308 15.5871429,34.9567846 C15.5671429,34.9582462 15.3685714,35.0605538 15.2857143,35.0766308" id\x3d"Fill-3" fill\x3d"#00A4B4"\x3e\x3c/path\x3e\n                                                                  \x3cpath d\x3d"M15.2857143,1.02307692 C7.42857143,1.02307692 1,7.6 1,15.6384615 C1,26.4538462 14,35.5153846 14.4285714,35.8076923 C14.7142857,35.9538462 15,36.1 15.2857143,36.1 C15.5714286,36.1 15.8571429,35.9538462 16.1428571,35.8076923 C16.5714286,35.5153846 29.5714286,26.4538462 29.5714286,15.6384615 C29.5714286,7.6 23.1428571,1.02307692 15.2857143,1.02307692 M15.2857143,3.06923077 C22.06,3.06923077 27.5714286,8.70784615 27.5714286,15.6384615 C27.5714286,24.6576154 17.0614286,32.642 15.2857143,33.9266923 C13.51,32.642 3,24.6576154 3,15.6384615 C3,8.70784615 8.51142857,3.06923077 15.2857143,3.06923077" id\x3d"Fill-5" fill\x3d"#FFFFFF"\x3e\x3c/path\x3e\n                                                              \x3c/g\x3e\n                                                          \x3c/g\x3e\n                                                          \x3cpath d\x3d"M12.7027775,22.9988509 C12.5330142,22.9000772 15.4618683,17.4301913 15.3612354,17.1898678 C15.2606025,16.9495444 12.1541096,16.0730249 12.0027227,15.650709 C11.8504608,15.228393 18.1343273,8.87887671 18.2997152,9.00176054 C18.4642281,9.12464437 15.5616261,14.6310843 15.6403822,14.8107436 C15.7200135,14.9896251 18.9017623,15.9026986 18.9988949,16.3499024 C19.0951524,16.7971062 12.8716657,23.0976246 12.7027775,22.9988509" id\x3d"bolt" fill\x3d"#FFFFFF"\x3e\x3c/path\x3e\n                                                      \x3c/g\x3e\n                                                  \x3c/g\x3e\n                                              \x3c/g\x3e\n                                          \x3c/g\x3e\n                                      \x3c/g\x3e\n                                  \x3c/svg\x3e':
'\x3csvg width\x3d"29px" height\x3d"37px" viewBox\x3d"0 0 29 37" version\x3d"1.1" xmlns\x3d"http://www.w3.org/2000/svg" xmlns:xlink\x3d"http://www.w3.org/1999/xlink"\x3e\n                                      \x3cg id\x3d"Flows" stroke\x3d"none" stroke-width\x3d"1" fill\x3d"none" fill-rule\x3d"evenodd"\x3e\n                                          \x3cg id\x3d"2a-modal-sts-copy-4" transform\x3d"translate(-1033.000000, -453.000000)"\x3e\n                                              \x3cg id\x3d"modal-box-" transform\x3d"translate(360.000000, 66.000000)"\x3e\n                                                  \x3cg id\x3d"map-" transform\x3d"translate(415.000000, 36.000000)"\x3e\n                                                      \x3cg id\x3d"pin_service" transform\x3d"translate(257.000000, 350.000000)"\x3e\n                                                          \x3cg id\x3d"pin-selected" stroke-width\x3d"1"\x3e\n                                                              \x3cg id\x3d"Page-1"\x3e\n                                                                  \x3cpath d\x3d"M22.3448571,36.2826923 C22.3448571,37.0558462 19.1848571,37.6828462 15.2862857,37.6828462 C11.3877143,37.6828462 8.22628571,37.0558462 8.22628571,36.2826923 C8.22628571,35.5080769 11.3877143,34.8810769 15.2862857,34.8810769 C19.1848571,34.8810769 22.3448571,35.5080769 22.3448571,36.2826923" id\x3d"Fill-1" fill-opacity\x3d"0.2" fill\x3d"#000000"\x3e\x3c/path\x3e\n                                                                  \x3cpath d\x3d"M15.2857143,35.0766308 C15.2028571,35.0605538 15,34.9567846 14.8771429,34.8924769 C14.8542857,34.8676308 2,25.9683231 2,15.6381692 C2,8.1434 7.96,2.04586154 15.2857143,2.04586154 C22.6114286,2.04586154 28.5714286,8.1434 28.5714286,15.6381692 C28.5714286,25.9683231 15.7171429,34.8676308 15.5871429,34.9567846 C15.5671429,34.9582462 15.3685714,35.0605538 15.2857143,35.0766308" id\x3d"Fill-3" fill\x3d"#EC8C00"\x3e\x3c/path\x3e\n                                                                  \x3cpath d\x3d"M15.2857143,1.02307692 C7.42857143,1.02307692 1,7.6 1,15.6384615 C1,26.4538462 14,35.5153846 14.4285714,35.8076923 C14.7142857,35.9538462 15,36.1 15.2857143,36.1 C15.5714286,36.1 15.8571429,35.9538462 16.1428571,35.8076923 C16.5714286,35.5153846 29.5714286,26.4538462 29.5714286,15.6384615 C29.5714286,7.6 23.1428571,1.02307692 15.2857143,1.02307692 M15.2857143,3.06923077 C22.06,3.06923077 27.5714286,8.70784615 27.5714286,15.6384615 C27.5714286,24.6576154 17.0614286,32.642 15.2857143,33.9266923 C13.51,32.642 3,24.6576154 3,15.6384615 C3,8.70784615 8.51142857,3.06923077 15.2857143,3.06923077" id\x3d"Fill-5" fill\x3d"#FFFFFF"\x3e\x3c/path\x3e\n                                                              \x3c/g\x3e\n                                                          \x3c/g\x3e\n                                                          \x3cpath d\x3d"M20.0345576,15.6335486 C19.1039732,16.564133 17.7574459,16.8190133 16.5947577,16.4063241 L12.3241563,20.6769255 C11.8930289,21.1080529 11.1874985,21.1080529 10.7563711,20.6769255 L10.3230745,20.2430866 C9.89194713,19.8125015 9.89248943,19.1064288 10.3236168,18.6758437 L14.5936759,14.4057846 C14.1804444,13.2430964 14.435867,11.8960268 15.3659091,10.9654424 C16.2650401,10.0663113 17.5535416,9.79624662 18.6880302,10.1509099 L16.7948659,12.0440743 C16.7948659,12.0440743 16.4006148,12.8971099 17.2514813,13.7479764 C18.1023478,14.5993852 18.9559257,14.2051341 18.9559257,14.2051341 L20.8490901,12.3119698 C21.2037534,13.4464584 20.9336887,14.7349599 20.0345576,15.6335486" id\x3d"service" fill\x3d"#FFFFFF"\x3e\x3c/path\x3e\n                                                      \x3c/g\x3e\n                                                  \x3c/g\x3e\n                                              \x3c/g\x3e\n                                          \x3c/g\x3e\n                                      \x3c/g\x3e\n                                  \x3c/svg\x3e'};
this.createMobileAddressZipCodeIcon=function(){return'\x3csvg height\x3d"'+a.ZIP_ICON_CIRCLE_RADIUS+'" width\x3d"'+a.ZIP_ICON_CIRCLE_RADIUS+'" xmlns\x3d"http://www.w3.org/2000/svg"\x3e\n                  \x3ccircle cx\x3d"50%" cy\x3d"50%" r\x3d"50%" fill\x3d"'+a.COLOR_ORANGE+'" fill-opacity\x3d"0.5"\x3e\n                  \x3c/circle\x3e\n                  \x3ctext x\x3d"50%" y\x3d"50%" fill-opacity\x3d"1" fill\x3d"#000" text-anchor\x3d"middle" font-weight\x3d"bold" font-size\x3d"15px" dy\x3d".3em" font-family\x3d"\'Amazon Ember\',Arial,sans-serif"\x3e\n                      '+
c.get("modalPushpinZipPrefix")+" "+c.get("zipCode")+"\n                  \x3c/text\x3e\n              \x3c/svg\x3e"};this.createPinIcon=function(b,d){return'\x3csvg style\x3d"left:-14px;top:-36px;"  xmlns\x3d"http://www.w3.org/2000/svg" width\x3d"28px" height\x3d"36px" \x3e\n                  \x3cpath d\x3d"M21,33.5007825 C21,34.3286385 17.8665385,35 14.0007083,35 C10.1348781,35 7,34.3286385 7,33.5007825 C7,32.6713615 10.1348781,32 14.0007083,32 C17.8665385,32 21,32.6713615 21,33.5007825" id\x3d"Fill-1" fill-opacity\x3d"0.2" fill\x3d"#000000"\x3e\x3c/path\x3e\n                  \x3cpath d\x3d"M14.2663345,32.1398355 L13.9060703,32.4894035 L13.858873,32.2328415 L14.013324,31.9216153 C14.1356449,32.0100221 14.2240065,32.0735979 14.2637423,32.1024204 L14.2663345,32.1398355 Z M14.0223706,31.9243914 C14.1104469,31.9676951 14.2449887,32.0282883 14.1809248,32.0165031 L14.0872178,32.525889 L13.8439568,32.151758 L13.8190752,32.0165031 C13.8151665,32.0172221 13.8115316,32.0178891 13.8081517,32.0185076 C13.8268521,32.0061311 13.8482135,31.9918659 13.8720408,31.9758254 C13.9134319,31.9589986 13.9652927,31.9405319 14.0223706,31.9243914 Z M13.9835281,31.9000747 C14.0877611,31.8286971 14.2181338,31.7380569 14.3666419,31.6328035 C14.8297355,31.3045911 15.3445613,30.9224441 15.8975864,30.4903188 C17.467962,29.2632512 19.0345365,27.879962 20.4908916,26.3720501 C24.5738016,22.1446002 27,17.783901 27,13.579646 C27,6.65108026 21.1739922,1 14,1 C6.8260078,1 1,6.65108026 1,13.579646 C1,17.7845531 3.42611067,22.1459465 7.5044675,26.3738413 C8.95113624,27.8735539 10.5036727,29.2473243 12.0594008,30.4668331 C12.6813761,30.954389 13.5349851,31.5757173 13.9835281,31.9000747 Z" id\x3d"Fill-3" stroke\x3d"#FFFFFF" stroke-width\x3d"2" fill\x3d"'+
(b?a.COLOR_ORANGE:a.COLOR_GRAY)+'"\x3e\x3c/path\x3e\n                  '+d+"\n              \x3c/svg\x3e"};this.createMobilePinIcon=function(b){var d=7*b.text.length+6.728,c=d+9.272,k=(d-6.3)/2;return'\x3csvg xmlns\x3d"http://www.w3.org/2000/svg" width\x3d"'+c+'px" height\x3d"30px" viewBox\x3d"0 0 '+c+' 30"\x3e\n                  \x3cg fill\x3d"#000" fill-opacity\x3d".2"\x3e\n                      \x3cpath d\x3d"M '+(4+d/2)+' 27.903 c 2.762 0 5 0.448 5 1 c 0 0.552 -2.238 1 -5 1 c -2.76 0 -5 -0.448 -5 -1 s 2.24 -1 5 -1 Z"/\x3e\n                  \x3c/g\x3e\n                  \x3cg fill\x3d"'+
(b.pinSelected?a.COLOR_ORANGE:a.COLOR_WHITE)+'" stroke\x3d"'+(b.pinSelected?a.COLOR_WHITE:a.COLOR_LIGHTGRAY)+'" stroke-linejoin\x3d"round" stroke-width\x3d"1.5"\x3e\n                      \x3cpath d\x3d"M 4 2.5 l '+d+" 0 c 0.656 0 1.253 0.268 1.686 0.7 c 0.432 0.433 0.7 1.03 0.7 1.686 l 0 17.455 c 0 0.656 -0.268 1.253 -0.7 1.686 c -0.433 0.433 -1.03 0.7 -1.686 0.7 l -"+k+" 0 l -3.15 3.676 l -3.15 -3.676 l -"+k+' 0 c -0.656 0 -1.253 -0.267 -1.686 -0.7 c -0.432 -0.433 -0.7 -1.03 -0.7 -1.686 l 0 -17.455 c 0 -0.656 0.268 -1.253 0.7 -1.686 c 0.433 -0.432 1.03 -0.7 1.686 -0.7 Z"/\x3e\n                      \x3ctext dominant-baseline\x3d"middle" text-anchor\x3d"middle" font-family\x3d"\'Amazon Ember\',Arial,sans-serif" font-size\x3d"12px" font-weight\x3d"bold" x\x3d"50%" y\x3d"50%" stroke-width\x3d"0" stroke\x3d"#000" fill\x3d"'+
(b.pinSelected?a.COLOR_WHITE:a.COLOR_BLACK)+'"\x3e'+a.escapeXmlEntities(b.text)+"\x3c/text\x3e\n                  \x3c/g\x3e\n              \x3c/svg\x3e"};this.escapeXmlEntities=function(a){return a.replace(/[\u00A0-\u2666]|[\uFFE5]/g,function(a){return"\x26#"+a.charCodeAt(0)+";"})}}});"use strict";r.when("A","ship-to-store-settings","ship-to-store-offer-helper","ship-to-store").register("ship-to-store-map-helper",function(a,c,b){return new function n(){var m=this;p(this,n);this.getPinDataToRender=
function(){return m.showCustomerAddressOnMap()?[{address:c.get("mobileAddress")}]:m.offerHelper.getVisibleOffers()};this.showCustomerAddressOnMap=function(){return m.offerHelper.getSelectedOfferTypeCollection().offerType.showCustomerAddressOnMap};this.isMobileAddressAZipCode=function(){return!c.get("mobileAddressIsCustomerDestinationAddress")&&m.showCustomerAddressOnMap()};this.isGeographicallyMappableOffer=function(a){return a&&a.address&&a.address.geoCode&&a.address.geoCode.latitude&&a.address.geoCode.longitude};
this.hasAllGeographicallyMappableOffers=function(b){return a.isArray(b)&&a.reduce(b,function(a,b){b=m.isGeographicallyMappableOffer(b);return a&&b},!0)};this.offerHelper=b}});"use strict";r.when("A","ship-to-store-settings","ship-to-store").register("ship-to-store-metric-names",function(a,c){var b={ACCEPTED_OFFER_EARLIEST_SERVICE_DATE:"accepted_offer_earliest_service_date",ACCEPTED_OFFER_DISTANCE_TO_STORE:"accepted_offer_distance_to_store",ACCEPTED_OFFER_SERVICE_PRICE:"accepted_offer_service_price",
ACCEPTED_OFFER_STORE_RATING:"accepted_offer_store_rating",ADD_SERVICE_WITHOUT_IA:"add_service_without_ia",ATC_CLICK:"add_to_cart_button_click",ATC_CLICK_MODAL_SHOWN:"add_to_cart_button_click_modal_shown",ATC_CLICK_MODAL_FAIL:"add_to_cart_button_click_modal_fail",ATC_CLICK_WITH_OFFER:"add_to_cart_button_click_with_offer",ATC_CLICK_WITHOUT_OFFER:"add_to_cart_button_click_without_offer",ATC_CLICK_INGRESS_HIDDEN:"add_to_cart_button_click_ingress_hidden",ATC_LFS_CLICK_WITHOUT_OFFER:"add_to_cart_button_click_lfs_without_offer",
ATC_CLICK_RECOMMENDED_OFFER:"add_to_cart_button_click_recommended_offer",ATC_FORM_APPEND_FAIL:"add_to_cart_form_append_fail",ATC_FORM_APPEND_SUCCESS:"add_to_cart_form_append_success",ATC_FORM_REMOVE_FAIL:"add_to_cart_form_remove_fail",ATC_FORM_REMOVE_SUCCESS:"add_to_cart_form_remove_success",ATC_POST_DONE:"add_to_cart_post_done",ATC_POST_FAIL:"add_to_cart_post_fail",ATC_POST_STARTED:"add_to_cart_post_started",ATC_POST_SUCCESS:"add_to_cart_post_success",ATC_HIJACK_LATENCY:"add_to_cart_hijack_latency",
ATC_UBB_CLICK:"add_to_cart_ubb_button_click",ATC_OPENS_STORE_SELECTOR:"add_to_cart_opens_store_selector",ATC_SERVICE_ADDED_TO_CART:"add_to_cart_service_added_to_cart",ATC_SERVICE_NOT_ADDED_TO_CART:"add_to_card_service_not_added_to_cart",ATC_TWISTER_PLUS_CLICK_INTERCEPTED:"add_to_cart_twister_plus_click_intercepted",ATC_TWISTER_PLUS_CLICKED:"add_to_cart_twister_plus_clicked",ATC_TWISTER_PLUS:"add_to_cart_twister_plus",CHANGED_QUANTITY:"changed_quantity_event",CONTROLLER_ABORTED:"controller_aborted",
DESELECT_OFFER_QTY_NOT_FOUND:"deselect_offer_qty_not_found",DISPLAY_WIDTH:"display_width",DISPLAY_HEIGHT:"display_height",IA_TYPE_NOT_SET:"ia_type_not_set",IA_TYPE_SET:"ia_type_set",INCLUDED_SERVICES_DESKTOP_HOVER:"included_services_desktop_hover",INCLUDED_SERVICES_MOBILE_CLICK:"included_services_mobile_click",INCLUDED_SERVICES_NUMBER_OF_SERVICES:"included-services-number-of-services",INGRESS_SHOWING_SINCE_MODULE_LOAD_LATENCY:"ingress-showing-since-module-load-latency",INGRESS_SHOWING_SINCE_PAGE_LOAD_LATENCY:"ingress-showing-since-page-load-latency",
INIT:"init",LOADED:"loaded",MODAL_CLOSED_AFTER_MILLISECONDS:"modal_closed_after_milliseconds",MODAL_CLOSED_W_OFFER_AFTER_MILLISECONDS:"modal_closed_with_offer_after_milliseconds",MODAL_CLOSED_WO_OFFER_AFTER_MILLISECONDS:"modal_closed_without_offer_after_milliseconds",MODAL_MAP_LOAD_FAIL:"modal_map_load_fail",MODAL_MAP_LOAD_MILLISECONDS:"modal_map_load_milliseconds",MODAL_MAP_LOAD_SUCCESS:"modal_map_load_success",MODAL_MAP_OFFER_FILTER_ALL_BUTTON_CLICK:"modal_map_offer_filter_all_button_click",MODAL_MAP_OFFER_FILTER_CHEAPEST_BUTTON_CLICK:"modal_map_offer_filter_cheapest_button_click",
MODAL_MAP_OFFER_FILTER_FASTEST_BUTTON_CLICK:"modal_map_offer_filter_fastest_button_click",MODAL_MAP_OFFER_FILTER_RETENTION_RATE:"modal_map_offer_filter_retention_rate",MODAL_NOT_FOUND:"modal_not_found",MODAL_OFFER_FILTER_CHECK_CLICK:"modal_offer_filter_check_click",MODAL_OFFER_FILTER_UNCHECK_CLICK:"modal_offer_filter_uncheck_click",MODAL_OPENED_AFTER_MILLISECONDS:"modal_opened_after_milliseconds",MODAL_BUTTONS_NOT_VISIBLE:"modal_buttons_not_visible",NO_ACTIVE_OFFER_TYPE:"no_active_offer_type",NO_OFFERS_ON_PAGE_LOAD:"no_offers_on_page_load",
NO_TABS_HAVE_OFFERS:"no_tabs_have_offers",OFFER_ACCEPTED:"offer_accepted",OFFER_ACCEPTED_AT_INDEX:"offer_accepted_at_index",OFFER_ACCEPTED_CLICK:"offer_accepted_click",OFFER_ACCEPTED_WITH_STORE_ID:"offer_accepted_with_store_id",OFFER_DECLINED:"offer_declined",OFFER_DECLINED_AT_SCROLLING_OFFSET:"offer_declined_at_scrolling_offset",OFFER_DECLINED_CLICK:"offer_declined_click",OFFER_INGRESS_CLICK:"offer_ingress_click",OFFER_INGRESS_CLICK_IN_STORE:"offer_ingress_click_in_store",OFFER_INGRESS_CLICK_AT_HOME:"offer_ingress_click_at_home",
OFFER_INGRESS_CLICK_MODAL_NOT_READY:"offer_ingress_click_modal_not_ready",OFFER_LIST_CLOSED:"offer_list_closed",OFFER_LIST_MAX_SCROLLING_OFFSET:"offer_list_max_scrolling_offset",OFFER_LIST_NOT_SCROLLABLE:"offer_list_not_scrollable",OFFER_LIST_OPENED:"offer_list_opened",OFFER_SELECTED:"offer_selected",OFFER_SELECTION_CHANGED_CLICK:"offer_selection_changed_click",OFFER_PRICE_FALSY:"offer_price_falsy",OFFERS_GENERATED:"offers_generated",OFFERS_ON_PAGE_LOAD:"offers_on_page_load",OFFERS_ON_ZIP_UPDATE:"offers_on_zip_update",
OFFERS_PRESENTED_EARLIEST_SERVICE_DATE:"offers_presented_earliest_service_date",OFFERS_PRESENTED_LATEST_SERVICE_DATE:"offers_presented_latest_service_date",OFFERS_PRESENTED_CLOSEST_STORE_DISTANCE:"offers_presented_closest_store_distance",OFFERS_PRESENTED_FURTHEST_STORE_DISTANCE:"offers_presented_furthest_store_distance",OFFERS_PRESENTED_LOWEST_SERVICE_PRICE:"offers_presented_lowest_service_price",OFFERS_PRESENTED_HIGHEST_SERVICE_PRICE:"offers_presented_highest_service_price",OFFERS_PRESENTED_LOWEST_RATING:"offers_presented_lowest_rating",
OFFERS_PRESENTED_HIGHEST_RATING:"offers_presented_highest_rating",PAGE_RELOAD_OFFER_FOUND:"page_reload_offer_found",PAGE_RELOAD_OFFER_NOT_FOUND:"page_reload_offer_not_found",PAGE_RELOAD_OFFER_NOT_SPECIFIED:"page_reload_offer_not_specified",PAGE_REFRESH_SUCCEEDED:"page_refresh_succeeded",PAGE_REFRESH_FAILED:"page_refresh_failed",PAGE_REFRESH_STARTED:"page_refresh_started",PAGE_REFRESH_ENDED:"page_refresh_ended",PAGE_REFRESH_ABORTED:"page_refresh_aborted",PAGE_REFRESH_TIME:"page_refresh_time",PUSHPIN_CLICK:"pushpin_click",
QUANTITY_SUPPORTED:"quantity_supported",QUANTITY_NOT_SUPPORTED:"quantity_not_supported",SCROLLER_ELEMEMTS_NOT_FOUND:"scroller_elememts_not_found",SECOND_OFFER_NOT_VISIBLE:"second_offer_not_visible",SELECTED_INGRESS_CHANGE_CLICK:"selected_ingress_change_click",AMAZON_HAPPINESS_GUARANTEE_CLICK:"amazon_happiness_guarantee_click",SELECTED_INGRESS_CHANGE_CLICK_MODAL_NOT_READY:"selected_ingress_change_click_modal_not_ready",SELECTED_QTY_MAPPED_TO_ASIN_W_OFFERS:"selected_quantity_mapped_to_asin_with_offers",
SELECTED_QTY_MAPPED_TO_ASIN_WO_OFFERS:"selected_quantity_mapped_to_asin_with_no_offers",SELECTED_QTY_NOT_MAPPED_TO_ASIN:"selected_quantity_not_mapped_to_asin",SELECTED_QTY_UPDATED:"selected_quantity_updated",SERVICE_OPTION_DEFAULT_SWATCH_CLICK:"service_option_default_swatch_click",SERVICE_OPTION_IN_STORE_SWATCH_CLICK:"service_option_in_store_swatch_click",SERVICE_OPTION_SELECT_LOCATION_CLICK:"service_option_select_location_click",SERVICE_OPTION_DECLINE_LOCATION_CLICK:"service_option_decline_location_click",
SERVICE_OPTION_EXPANDED:"service_option_expanded",SERVICE_OPTION_COLLAPSED:"service_option_collapsed",SERVICE_OPTION_QUANTITY_CHANGE_WITH_OFFER:"service_option_quantity_change_with_offer",SERVICE_OPTION_QUANTITY_CHANGE_WITH_NO_OFFER:"service_option_quantity_change_with_no_offer",SERVICE_OPTION_QUANTITY_CHANGE_MORE_THAN_4:"service_option_quantity_change_more_than_4",SERVICE_OPTION_PRICE_AND_STORE_PERSISTED:"service_option_price_and_store_persisted",SERVICE_OPTION_PRICE_AND_STORE_NOT_PERSISTED:"service_option_price_and_store_not_persisted",
SERVICE_OPTION_IN_STORE_SWATCH_SELECTION_PERSISTED:"service_option_in_store_swatch_selection_persisted",SERVICE_OPTION_DEFAULT_SWATCH_SELECTION_PERSISTED:"service_option_default_swatch_selection_persisted",SERVICE_LOCATION_SELECTOR_CLICK:"service_location_selector_click",SERVICE_LOCATION_POPOVER_OPEN:"service_location_popover_open",SERVICE_LOCATION_POPOVER_FAILED:"service_location_popover_failed",SERVICE_OPTION_OFFER_NOT_PRESENT_REASON_UNKNOWN:"service_option_offer_not_Present_reason_unknown",STRIPED_MERCHANT_ID:"striped_merchant_id",
ZIP_UPDATE_ERROR:"zip_update_error",ZIP_UPDATE_HIDE:"zip_update_hide",ZIP_UPDATE_HIDE_CLICK:"zip_update_hide_click",ZIP_UPDATE_INVALID_ZIP_ENTERED:"zip_update_invalid_zip_entered",ZIP_UPDATE_NO_OFFERS:"zip_update_no_offers",ZIP_UPDATE_SHOW:"zip_update_show",ZIP_UPDATE_SHOW_CLICK:"zip_update_show_click",ZIP_UPDATE_SUCCESS:"zip_update_success",PER_UNIT_SERVICE_PRICE_HTML_MAP_UNDEFINED:"per_unit_service_price_html_map_undefined",PER_UNIT_SERVICE_PRICE_HTML_MAP_KEY_MISSING:"per_unit_service_price_html_map_key_missing",
GET_VEHICLES_CALL_FAILED:"get_vehicles_call_failed",SELECT_VEHICLE_CALL_FAILED:"select_vehicle_call_failed",ATTRIBUTE_SELECTIONS_FAILED:"attribute_selections_failed",SAVE_VEHICLE_BY_NUMBER_PLATE:"save_vehicle_by_number_plate",SAVE_VEHICLE_BY_ATTRIBUTES:"save_vehicle_by_attributes",SAVE_VEHICLE_CALL_FAILED:"save_vehicle_call_failed",NUMBER_PLATE_ENC_FAILED:"number_plate_enc_failed",VEHICLE_ATTRIBUTES_BY_VEHICLE_ID_FAILED:"vehicle_attributes_by_vehicle_id_failed",SAVE_VEHCILE_DATA_PRIVATE_AAPI_CALL_FAILED:"save_vehcile_data_private_aapi_call_failed",
INVALID_NUMBER_PLATE:"invalid_number_plate",CONFIRM_VEHICLE_CLICK:"confirm_vehicle_click",ADD_VEHICLE_CLICK:"add_vehicle_click",NEW_VEHICLE_ADD_OPTION_SELECT:"new_vehicle_add_option_select",SAVE_VEHICLE_CLICK:"save_vehicle_click",ADD_VEHICLE_CANCEL_CLICK:"add_vehicle_cancel_click",NUMBER_PLATE_SEARCH_CLICK:"number_plate_search_click",CHANGE_VEHICLE_CLICK:"change_vehicle_click",CHANGE_SERVICE_PROVIDER_CLICK:"change_service_provider_click",CHOOSE_BUTTON_CLICK:"choose_button_click",CHOOSE_BUTTON_CLICK_FOR_FIRST_OFFER_IN_LIST:"choose_button_click_for_first_offer_in_list",
NUMBER_PLATE_RADIO_CLICK:"number_plate_radio_click",VEHICLE_ATTRIBUTES_RADIO_CLICK:"vehicle_attributes_radio_click",TOTAL_NUMBER_OF_VEHICLES_IN_GARAGE:"total_number_of_vehicles_in_garage",UPDATE_VEHICLE_REQUIRED:"update_vehicle_required",ATTRIBUTE_SELECTIONS_INVALID_RESPONSE:"attribute_selections_invalid_response",NATC_DESKTOP_ENDPOINT_USED:"natc_atc_desktop_endpoint_used",NATC_MOBILE_WEB_ENDPOINT_USED:"natc_atc_mobile_web_endpoint_used",NATC_MOBILE_APP_ENDPOINT_USED:"natc_atc_mobile_app_endpoint_used",
GURUPA_DESKTOP_ENDPOINT_USED:"gurupa_atc_desktop_endpoint_used",GURUPA_MOBILE_ENDPOINT_USED:"gurupa_atc_mobile_endpoint_used",NATC_DESKTOP_ENDPOINT_ERROR:"natc_atc_desktop_endpoint_error",NATC_MOBILE_WEB_ENDPOINT_ERROR:"natc_atc_mobile_web_endpoint_error",NATC_MOBILE_APP_ENDPOINT_ERROR:"natc_atc_mobile_app_endpoint_error",USER_ON_MAP_VIEW_FOR_MORE_THAN_10_SECONDS:"user_on_map_view_for_more_than_10_seconds",VEHICLE_INFO_WITH_UNINITIALIZED_ASSOCIATION_ID:"vehicle_info_with_uninitialized_association_id",
VEHICLE_INFO_WITH_NULL_SAVED_ID:"vehicle_info_with_null_saved_id",VEHICLE_INFO_WITH_UNEQUAL_ASSOCIATION_ID:"vehicle_info_with_unequal_association_id",VEHICLE_INFO_EXCEPTION_WHILE_LOGGING:"vehicle_info_exception_while_logging",VEHICLE_INFO_NOT_ENABLED:"vehicle_info_not_enabled",SAVE_VEHICLE_PRIVATE_API_CLIENT_SIDE_ERROR:"save_vehicle_private_api_client_side_error",SAVE_VEHICLE_PRIVATE_API_SERVER_SIDE_ERROR:"save_vehicle_private_api_server_side_error",FETCH_STS_SERVICE_OPTIONS_FROM_GXA_SUCCESS:"fetch_sts_service_options_from_gxa_success",
SWITCH_BUYING_OPTION_EVENT:"switch_buying_option_event",COLLAPSE_STS_CARD_EVENT:"collapse_sts_card_event"};a.each(b,function(a,n){b[n]=""+c.get("refTagPrefix")+a});return b});"use strict";var A="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};r.when("jQuery","query-param","vas-metrics-publisher","ship-to-store-settings","ship-to-store").register("ship-to-store-metric-publisher",
function(a,c,b,e){return new function m(){var a=this;p(this,m);this.publish=function(d,b){a.constructAndPublishNexusEvent(d,b);a.publishCsmCount(d,b)};this.constructAndPublishNexusEvent=function(d,b){var c={event:d,feature:"sts",pageType:"DetailPage",subPageType:"ValueAdds"};if("number"===typeof b||"string"==typeof b)c.value=b;[{lookupKey:"productAsin",nexusKey:"asin",nullable:!1},{lookupKey:"productAsin",nexusKey:"pageTypeId",nullable:!1},{lookupKey:"customerId",nexusKey:"customerId",nullable:!0},
{lookupKey:"deviceType",nexusKey:"deviceType",nullable:!0},{lookupKey:"deviceOs",nexusKey:"deviceOs",nullable:!0}].forEach(function(d){var b=e.get(d.lookupKey);b?c[d.nexusKey]=b:d.nullable||a.logError("Error while constructing Nexus event: expected value for "+d.nexusKey+" but found nothing",e.get("attribution"))});a.publishEvent(c,"automotive_client_side",a.getNexusSchemaIdForValueType(b))};this.getNexusSchemaIdForValueType=function(a){switch("undefined"===typeof a?"undefined":A(a)){case "string":return"automotive.client.side.metrics.string.1";
case "number":return"automotive.client.side.metrics.numeric.1";default:return"automotive.client.side.metrics.boolean.1"}};this.logError=function(a,b){"function"==typeof u.ueLogError&&u.ueLogError(a,{logLevel:"ERROR",attribution:b})};this.logRefTag=function(a){};this.publishCsmCount=function(a){var b=1<arguments.length&&arguments[1]!==w?arguments[1]:1;u.ue&&"function"==typeof u.ue.count&&u.ue.count(a,b)};this.publishEvent=function(a,b,e){u.ue&&"function"==typeof u.ue.event&&u.ue.event(a,b,e)};this.tag=
function(a){u.ue&&"function"==typeof u.ue.tag&&u.ue.tag(a)};this.logVasRefMarker=function(a,e){b.createRefMarkerAndLog(a.tenantName,a.mappingSet,a.widgetName,e,a.hitParameters)};this.tag("pdpShipToStoreWidget")}});"use strict";r.when("ship-to-store-metric-publisher","ship-to-store-metric-names","ship-to-store").register("offer-metric-utils",function(a,c){return new function e(){var n=this;p(this,e);this.publishAcceptedOfferMetrics=function(e){n.convertNumericOfferFieldsToNumber(e);e.earliestAppointmentDateEpochSeconds&&
a.publish(c.ACCEPTED_OFFER_EARLIEST_SERVICE_DATE,e.earliestAppointmentDateEpochSeconds);e.distance&&a.publish(c.ACCEPTED_OFFER_DISTANCE_TO_STORE,Number(e.distance.toFixed(2)));e.servicePrice&&a.publish(c.ACCEPTED_OFFER_SERVICE_PRICE,e.servicePrice);e.ratings&&a.publish(c.ACCEPTED_OFFER_STORE_RATING,e.ratings)};this.publishMinAndMaxOfferMetrics=function(e){e.earliestServiceDateEpochSeconds&&a.publish(c.OFFERS_PRESENTED_EARLIEST_SERVICE_DATE,e.earliestServiceDateEpochSeconds);e.latestServiceDateEpochSeconds&&
a.publish(c.OFFERS_PRESENTED_LATEST_SERVICE_DATE,e.latestServiceDateEpochSeconds);e.closestStoreDistance&&a.publish(c.OFFERS_PRESENTED_CLOSEST_STORE_DISTANCE,e.closestStoreDistance);e.furthestStoreDistance&&a.publish(c.OFFERS_PRESENTED_FURTHEST_STORE_DISTANCE,e.furthestStoreDistance);e.lowestServicePrice&&a.publish(c.OFFERS_PRESENTED_LOWEST_SERVICE_PRICE,e.lowestServicePrice);e.highestServicePrice&&a.publish(c.OFFERS_PRESENTED_HIGHEST_SERVICE_PRICE,e.highestServicePrice);e.lowestStoreRating&&a.publish(c.OFFERS_PRESENTED_LOWEST_RATING,
e.lowestStoreRating);e.highestStoreRating&&a.publish(c.OFFERS_PRESENTED_HIGHEST_RATING,e.highestStoreRating)};this.updateMinAndMaxOfferMetrics=function(a,e){n.convertNumericOfferFieldsToNumber(e);if(e.earliestAppointmentDateEpochSeconds){if(a.earliestServiceDateEpochSeconds===w||e.earliestAppointmentDateEpochSeconds<a.earliestServiceDateEpochSeconds)a.earliestServiceDateEpochSeconds=e.earliestAppointmentDateEpochSeconds;if(a.latestServiceDateEpochSeconds===w||e.earliestAppointmentDateEpochSeconds>
a.latestServiceDateEpochSeconds)a.latestServiceDateEpochSeconds=e.earliestAppointmentDateEpochSeconds}if(e.distance){var d=Number(e.distance.toFixed(2));if(a.closestStoreDistance===w||d<a.closestStoreDistance)a.closestStoreDistance=d;if(a.furthestStoreDistance===w||d>a.furthestStoreDistance)a.furthestStoreDistance=d}if(e.servicePrice){if(a.lowestServicePrice===w||e.servicePrice<a.lowestServicePrice)a.lowestServicePrice=e.servicePrice;if(a.highestServicePrice===w||e.servicePrice>a.highestServicePrice)a.highestServicePrice=
e.servicePrice}if(e.ratings){if(a.lowestStoreRating===w||e.ratings<a.lowestStoreRating)a.lowestStoreRating=e.ratings;if(a.highestStoreRating===w||e.ratings>a.highestStoreRating)a.highestStoreRating=e.ratings}};this.convertNumericOfferFieldsToNumber=function(a){a.earliestAppointmentDateEpochSeconds=Number(a.earliestAppointmentDateEpochSeconds);a.distance=Number(a.distance);a.servicePrice=Number(a.servicePrice);a.ratings=Number(a.ratings)}}});"use strict";r.when("A","ship-to-store-settings","ship-to-store").register("ship-to-store-weblab-names",
function(){return{STORE_DISTANCES_WEBLAB:"HCX_PDX_STS_STORE_DISTANCES_341984",RECOMMENDED_OFFER_WEBLAB:"HCX_ISS_OFFER_RECOMMENDATION_346228",VEHICLE_INFORMATION_WEBLAB:"VEHICLE_INFORMATION_IN_STS_380533",VEHICLE_INFO_STS_WEBLAB:"VAS_PDP_STS_VEHICLE_INFO_1210088"}});"use strict";r.when("jQuery","ship-to-store-function","ship-to-store").register("ship-to-store-weblab-publisher",function(a,c){a=function e(){p(this,e)};a.logTreatment=function(a,n){c.try(function(){a&&n&&"INACTIVE"!==n&&u.ue.trigger(a,
n)})};return a});"use strict";r.when("A").register("bw-aui-bsheet-weblab",function(){return{treatment:"T1"}});"use strict";r.when("A").register("vas-sts-bottomsheet-mitigation-weblab",function(){return{treatment:"C"}});"use strict";r.when("A").register("ship-to-store-weblab-constants",function(){return{TREATMENT:{C:"C",T1:"T1",T2:"T2"}}});"use strict";r.when("A","ship-to-store-settings","ship-to-store-metric-publisher","ship-to-store-metric-names","ship-to-store-offer-helper","ship-to-store-weblab-publisher",
"ship-to-store-weblab-names","ship-to-store-map-helper","ship-to-store-page-refresh","ship-to-store-offer-tags-helper","ship-to-store-pushpin-icon-helper","ship-to-store-vas-metric-utils","offer-metric-utils","vehicle-info-utils","sts-modal-utils","ship-to-store").register("ship-to-store-modal",function(a,c,b,e,n,m,g,d,t,k,h,l,D,y,C){var q=a.$,z="#buybox_feature_div #desktop_buybox #price_feature_div #unifiedPrice_feature_div #pmpux_feature_div #issuancePriceblockAmabot_feature_div #alternativeOfferEligibilityMessaging_feature_div #applicablePromotionList_feature_div #availability_feature_div #holidayDeliveryMessage_feature_div #dpFastTrack_feature_div #businessOnlyItem_feature_div #shipsFromSoldBy_feature_div #businessPricing_feature_div #smileEligibility_feature_div #holidayAvailabilityMessage_feature_div #moreBuyingChoices_feature_div #companyCompliancePolicies_feature_div #apex_desktop".split(" ");
return new function x(){var f=this;p(this,x);this.acceptOfferClick=function(){if(c.get("isVehicleInformationEnabled")){if(!q("#include-service-button").hasClass("a-button-disabled")){var b=y.getMruVehicle();b&&0!==b.length?(b=C.getSaveVehicleDataFromMruVehicle(b),y.saveVehicleDataAapiCall(b).then(function(){f.acceptOffer()})):a.show(q("#vehicle-info-aapi-ajax-failure-alert"))}}else f.acceptOffer()};this.acceptOffer=function(){f.modalInstance.unlock();f.modalInstance.hide();f.offerHelper.acceptOffer(f.selectedOffer);
b.publish(e.OFFER_ACCEPTED_CLICK);b.publish(e.OFFER_ACCEPTED_AT_INDEX,f.$highlightedOffer.index());b.publish(e.OFFER_ACCEPTED_WITH_STORE_ID,f.$highlightedOffer.data("storeId"));b.logVasRefMarker(l,l.metricConstants.actions.includeService);D.publishAcceptedOfferMetrics(f.selectedOffer)};this.declineOfferClick=function(){f.modalInstance.unlock();f.modalInstance.hide();f.offerHelper.declineOffer();b.publish(e.OFFER_DECLINED_CLICK);b.publish(e.OFFER_DECLINED_AT_SCROLLING_OFFSET,f.getOfferListScrollingOffset(f.$modalTabSharedContent));
b.logVasRefMarker(l,l.metricConstants.actions.declineService)};this.filterModalOffers=function(){r.when("a-checkbox","ship-to-store-modal").execute(function(d,c){d=d("#ship-to-store-modal-offer-filter");f.modalOfferFilterSelected=!d.isEmpty()&&d.isChecked();f.modalOfferFilterSelected?b.publish(e.MODAL_OFFER_FILTER_CHECK_CLICK):b.publish(e.MODAL_OFFER_FILTER_UNCHECK_CLICK);var h=!0,k=null;a.each(n.getVisibleOffers(),function(a,b){f.modalOfferFilterSelected?a.isLfsOffer?((a=q("#ship-to-store-offer-merchant-row-"+
b))&&f.$highlightedOffer&&a.is(f.$highlightedOffer)&&(h=!1),null===k&&(k=a)):q("#ship-to-store-offer-merchant-row-"+b).addClass("aok-hidden"):a.isLfsOffer||q("#ship-to-store-offer-merchant-row-"+b).removeClass("aok-hidden")});h&&k&&c.changeSelectedOffer(k);c.$modalTabSharedContent.animate({scrollTop:c.$highlightedOffer.offset().top-c.$modalTabSharedContent.offset().top+c.$modalTabSharedContent.scrollTop()});a.trigger(a.constants.BROWSER_EVENTS.RESIZE);c.sdpMapBaseIsRendered&&c.renderMapPinsAndEvents()})};
this.deselectModalOfferFilter=function(){r.when("a-checkbox").execute(function(a){a=a("#ship-to-store-modal-offer-filter");!a.isEmpty()&&a.isEnabled()&&a.uncheck();f.modalOfferFilterSelected=!a.isEmpty()&&a.isChecked()})};this.acceptPreviousSelectedOffer=function(a){f.selectedOffer=a;f.offerHelper.acceptOffer(f.selectedOffer)};this.triggerPageRefresh=function(a){f.shipToStorePageRefreshHandler.pageRefresh(a,f.pageRefreshData,f.selectedOffer,f.offerHelper.getSelectedQuantity())};this.selectionChanged=
function(h){var k=q(h.currentTarget);c.get("isVehicleInformationEnabled")&&h.target.className.includes("a-button-input")&&(a.hide(q("#ship-to-store-modal-tabs")),a.show(q("#confirmed-service-section")),a.show(q("#change-service-provider-link")),a.show(q("#service-provider-text")),a.hide(q("#choose-service-provider-text")),q(".ship-to-store-modal-content-column").addClass("ship-to-store-modal-content-column-min-height"),q("#ship-to-store-modal-offer-action-buttons").addClass("ship-to-store-modal-offer-action-buttons-class"),
C.enableIncludeServiceButton(),b.publish(e.CHOOSE_BUTTON_CLICK),0===k.index()&&b.publish(e.CHOOSE_BUTTON_CLICK_FOR_FIRST_OFFER_IN_LIST));k&&k.is(f.$highlightedOffer)||(b.publish(e.OFFER_SELECTION_CHANGED_CLICK),f.changeSelectedOffer(k),d.showCustomerAddressOnMap()||(h=f.radioButtons.index(f.radioButtons.filter(":checked")),f.sdpMap&&f.pushpinClicked(f.pushPins[h])))};this.changeSelectedOffer=function(a){a&&a.length&&a.is(f.$highlightedOffer)||(f.$highlightedOffer.removeClass("selected"),f.$highlightedOffer=
a,f.selectHighlightedOffer())};this.selectHighlightedOffer=function(){var d=f.$highlightedOffer.data("storeId");f.selectedOffer=f.offerHelper.getOfferByStoreId(d);c.get("isVehicleInformationEnabled")&&(q("#merchant-name").text(f.selectedOffer.merchantName),q("#merchant-address").text(f.selectedOffer.displayAddress),q("#total-service-price-chosen-placeholder").html(f.selectedOffer.localizedPrice+")"),q("#total-installation-cost-for-units").html("("+f.selectedOffer.totalInstallationCostString),q("#sts-chosen-service-below-address-bundle-price").html(f.selectedOffer.localizedServicePricePerQuantity));
f.$highlightedOffer.addClass("selected");q('input[name\x3d"ship-to-store-merchant-select"]',f.$highlightedOffer).prop("checked",!0);f.$modalTabSharedContent.length&&f.$highlightedOffer.length?(f.$modalTabSharedContent.animate({scrollTop:f.$highlightedOffer.offset().top-f.$modalTabSharedContent.offset().top+f.$modalTabSharedContent.scrollTop()}),a.trigger("ship-to-store:offer-selected",d)):b.publish(e.SCROLLER_ELEMEMTS_NOT_FOUND)};this.getDefaultOffer=function(){var a=f.offerHelper.getDefaultOffer();
return f.$modal.find(".ship-to-store-modal-offer-wrapper."+a.storeId)};this.getOfferListScrollingOffset=function(a){return a.scrollTop()};this.beforeShow=function(){if(performance){performance.mark("ship-to-store-modal-opened");performance.measure(e.MODAL_OPENED_AFTER_MILLISECONDS,"ship-to-store-modal-init","ship-to-store-modal-opened");var d=a.map(performance.getEntriesByName(e.MODAL_OPENED_AFTER_MILLISECONDS),function(a){return a.duration}).shift();d&&b.publish(e.MODAL_OPENED_AFTER_MILLISECONDS,
d)}a.off("a:popover:beforeShow:"+c.get("modalName"),f.beforeShow)};this.afterVisible=function(){b.publish(e.OFFER_LIST_OPENED);f.isOpen=!0;f.openCount++;f.showSelectedTab();a.trigger("ship-to-store:modal:opened");f.updateModalPosition();c.get("isVehicleInformationEnabled")&&y.showCustomerSavedVehicles();a.trigger(a.constants.BROWSER_EVENTS.RESIZE);m.logTreatment(g.RECOMMENDED_OFFER_WEBLAB,c.get("recommendedOfferWeblab"));c.get("isAutomotiveWDG")&&(m.logTreatment(g.VEHICLE_INFORMATION_WEBLAB,c.get("isVehicleInformationEnabled")?
"T1":"C"),m.logTreatment(g.VEHICLE_INFO_STS_WEBLAB,c.get("isVehicleInformationEnabled")?"T1":"C"));f.offerHelper.hasStoreDistanceString&&"T1"===c.get("storeDistancesWeblabGate")&&m.logTreatment(g.STORE_DISTANCES_WEBLAB,c.get("storeDistancesWeblab"))};this.afterInvisible=function(){c.get("isVehicleInformationEnabled")&&y.timeWhenUserClicksConfirmVehicleButton&&1E4<(new Date).getTime()-y.timeWhenUserClicksConfirmVehicleButton&&b.publish(e.USER_ON_MAP_VIEW_FOR_MORE_THAN_10_SECONDS);if(performance){performance.mark("ship-to-store-modal-closed");
performance.measure(e.MODAL_CLOSED_AFTER_MILLISECONDS,"ship-to-store-modal-opened","ship-to-store-modal-closed");var d=a.map(performance.getEntriesByName(e.MODAL_CLOSED_AFTER_MILLISECONDS),function(a){return a.duration}).shift();d&&(f.offerHelper.getAcceptedOffer()?b.publish(e.MODAL_CLOSED_W_OFFER_AFTER_MILLISECONDS,d):b.publish(e.MODAL_CLOSED_WO_OFFER_AFTER_MILLISECONDS,d));performance.clearMeasures(e.MODAL_CLOSED_AFTER_MILLISECONDS)}b.publish(e.OFFER_LIST_CLOSED);f.isOpen=!1;f.modalOfferFilterSelected&&
(f.isHTMLGenerated=!1);f.deselectModalOfferFilter()};this.afterUpdatePosition=function(){f.$offersScrollerContainer.height()>f.$modalTabSharedContent.height()?f.$modalTabSharedContent.bind("scroll",function(){var a=f.getOfferListScrollingOffset(f.$modalTabSharedContent);a>f.offerListMaxScrollingOffset&&(f.offerListMaxScrollingOffset=a,b.publish(e.OFFER_LIST_MAX_SCROLLING_OFFSET,f.offerListMaxScrollingOffset))}):b.publish(e.OFFER_LIST_NOT_SCROLLABLE)};this.showSelectedTab=function(){f.tabSelect(f.offerHelper.selectedOfferType)};
this.modalDismissedByClickingXorGreyBorderBackground=function(){f.offerHelper.getAcceptedOffer()?b.publish(e.OFFER_ACCEPTED_AT_INDEX,f.$highlightedOffer.index()):b.publish(e.OFFER_DECLINED_AT_SCROLLING_OFFSET,f.getOfferListScrollingOffset(f.$modalTabSharedContent));a.trigger("ship-to-store:modal:closed")};this.greyBackgroundClicked=function(a){a.$currentTarget.is(a.$target)&&f.isOpen&&f.modalDismissedByClickingXorGreyBorderBackground()};this.tabSelect=function(a){f.offerHelper.setVisibleOffers(a);
f.isHTMLGenerated||f.generateHTML();"IN_STORE"===a?f.renderMapPinsAndEventsIfMapLayerExists():f.sdpMap&&f.disposeMapLayer()};this.updateModalServiceProviderSecondaryHeader=function(){var a=f.offerHelper.getSelectedOfferTypeCollection(),d=f.offerHelper.getAsinForQuantity(null,a),a=a.upsellAsinSpecificStrings[d];a.hasOwnProperty("modalServiceProviderSecondaryHeader")&&q("#ship-to-store-modal-service-provider-secondary-header").html(a.modalServiceProviderSecondaryHeader)};this.includedServicesPopoverHover=
function(){b.publish(e.INCLUDED_SERVICES_DESKTOP_HOVER)};this.renderMapPinsAndEventsIfMapLayerExists=function(){q("#ship-to-store-modal-map-loading-image").attr("src","https://m.media-amazon.com/images/G/01/vas/pdp/map_loading_blur.png");f.renderMapLayerIfNotExists();if(!d.hasAllGeographicallyMappableOffers(d.getPinDataToRender()))f.$modalContentColumn.addClass("ship-to-store-modal-content-column-no-map"),f.$modalMapColumn.addClass("aok-hidden"),f.updateModalPosition();else if(f.sdpMapBaseIsRendered)f.renderMapPinsAndEvents();
else if(f.sdpMapBaseHasStartedRendering)a.on("ship-to-store:bing-map:render-complete",f.renderMapPinsAndEvents)};this.renderMapPinsAndEvents=function(){if(f.sdpMap){f.$modalContentColumn.removeClass("ship-to-store-modal-content-column-no-map");y.isVehicleConfirmed()&&(f.$modalMapColumn.removeClass("aok-hidden"),f.updateModalPosition());f.sdpMap.entities.clear();f.stsLocations=[];f.pushPins={};var b=d.getPinDataToRender();b&&b.length&&(a.each(b,f.createPushpinsForSTS),f.centerLocations(f.stsLocations),
d.showCustomerAddressOnMap()?f.infobox.setOptions({visible:!1}):(b=f.radioButtons.index(f.radioButtons.filter(":checked")),f.pushpinClicked(f.pushPins[b])));f.$modalMapLoadingOverlay.hide()}};this.renderLoadingOverlay=function(){f.$modalMapLoadingOverlay.show();q(".ship-to-store-modal-map-loading-button").hide();q("#ship-to-store-modal-map-loading-spinner").show();q("#ship-to-store-modal-map-loading-message").text(c.get("modalMapLoadingString"))};this.renderMapLayerIfNotExists=function(){if(d.hasAllGeographicallyMappableOffers(d.getPinDataToRender())&&
!f.sdpMapBaseHasStartedRendering&&!f.sdpMapBaseIsRendered){f.sdpMapBaseHasStartedRendering=!0;f.renderLoadingOverlay();var a=(c.get("languageOfPreference")||"").replace("_","-");performance.mark("modal-map-load");f.sdpMapRetries=0;r.load.js("https://www.bing.com/api/maps/mapcontrol?setLang\x3d"+a,f.renderMapLayer)||f.renderMapLayer()}};this.disposeMapLayer=function(){clearTimeout(f.sdpMapPoller);f.sdpMap&&f.sdpMap.dispose();f.sdpMapBaseIsRendered=!1;f.sdpMapBaseHasStartedRendering=!1;f.sdpMap=null};
this.renderMapLayer=function(){if(!f.sdpMap){try{f.sdpMap=new Microsoft.Maps.Map(document.getElementById("ship-to-store-modal-map"),{credentials:"AgD__4QLnPZjTdAY_U1NlB-RhTfje8ULMcKzTV6tv8A5KYH0L-22G8AHx4M61so5",showLocateMeButton:!1}),f.infobox=new Microsoft.Maps.Infobox(new Microsoft.Maps.Location(0,0),{visible:!1,offset:new Microsoft.Maps.Point(0,30),height:80,maxHeight:500,width:80,showCloseButton:!1}),f.infobox.setMap(f.sdpMap)}catch(d){f.sdpMap=null;if(50<=f.sdpMapRetries)f.onMapFailure(d);
else f.isOpen&&(f.sdpMapPoller=setTimeout(function(){f.sdpMapRetries+=1;f.renderMapLayer()},100));return}f.sdpMapBaseIsRendered=!0;a.trigger("ship-to-store:bing-map:render-complete");performance.mark("modal-map-loaded");performance.measure(e.MODAL_MAP_LOAD_MILLISECONDS,"modal-map-load","modal-map-loaded");var c=a.map(performance.getEntriesByName(e.MODAL_MAP_LOAD_MILLISECONDS),function(a){return a.duration}).shift();c&&b.publish(e.MODAL_MAP_LOAD_MILLISECONDS,c);b.publish(e.MODAL_MAP_LOAD_SUCCESS)}};
this.onMapFailure=function(a){f.disposeMapLayer();q("#ship-to-store-modal-map-loading-message").text(c.get("modalMapLoadingErrorString"));q("#ship-to-store-modal-map-loading-spinner").hide();q(".ship-to-store-modal-map-loading-button").css("display","inline-block");b.publish(e.MODAL_MAP_LOAD_FAIL);b.logError(a,"Map failed to load even after retries.")};this.createPushpinsForSTS=function(a,c){if(!f.modalOfferFilterSelected||a.isLfsOffer){var h=a.address.geoCode,k=a.offerTags,h=new Microsoft.Maps.Location(h.latitude,
h.longitude);f.stsLocations.push(h);h=f.createPushpin(h,c,k);h.metadata={merchantName:a.merchantName,displayAddress:a.address.displayAddress,distance:a.distanceString,isGeographicallyMappableOffer:d.isGeographicallyMappableOffer(a)?!0:!1,index:c,offerTags:k};Microsoft.Maps.Events.addHandler(h,"click",function(a){b.publish(e.PUSHPIN_CLICK);f.pushpinClicked(a.target)});Microsoft.Maps.Events.addHandler(f.sdpMap,"viewchangestart",f.updateInfoBoxLocation);Microsoft.Maps.Events.addHandler(f.sdpMap,"viewchange",
f.updateInfoBoxLocation);Microsoft.Maps.Events.addHandler(f.sdpMap,"viewchangeend",f.updateInfoBoxLocation);f.sdpMap.entities.push(h);f.pushPins[h.metadata.index]=h}};this.updateInfoBoxLocation=function(){if(f.selectedPushPin){var a=f.selectedPushPin.getLocation();d.isMobileAddressAZipCode()&&(a=f.sdpMap.tryLocationToPixel(a),a.y-=h.ZIP_ICON_CIRCLE_RADIUS/2,a=f.sdpMap.tryPixelToLocation(a));f.infobox.setLocation(a)}};this.pushpinClicked=function(b){f.selectedPushPin=b;f.updateInfoBoxLocation();f.centerMapOnLocation(b.getLocation());
var e=(d.showCustomerAddressOnMap()?f.$modalMapPushpinCustomerAddressTemplate:f.$modalMapPushpinTemplate).clone();e.length&&(e.find(".ship-to-store-modal-map-pushpin-merchant-name").html(b.metadata.merchantName),e.find(".ship-to-store-modal-map-pushpin-merchant-address").html(b.metadata.displayAddress),!0===b.metadata.isGeographicallyMappableOffer&&"T1"===c.get("storeDistancesWeblab")&&"T1"===c.get("storeDistancesWeblabGate")&&e.find(".ship-to-store-modal-map-pushpin-merchant-distance").html(b.metadata.distance),
e.removeAttr("id"),e.removeClass("aok-hidden"),f.infobox.setOptions({visible:!0,description:e[0].outerHTML}));var k=b.metadata.index;b=q("#ship-to-store-offer-merchant-row-"+k);f.changeSelectedOffer(b);a.each(f.pushPins,function(a){a.setOptions({icon:h.getPushpinIcon({pinSelected:a.metadata.index===k,offerIndex:a.metadata.index,offerTags:a.metadata.offerTags,isMobileAddressAZipCode:d.isMobileAddressAZipCode(),showCustomerAddressOnMap:d.showCustomerAddressOnMap()})})})};this.createPushpin=function(a,
b,e){return new Microsoft.Maps.Pushpin(a,{icon:h.getPushpinIcon({pinSelected:!1,offerIndex:b,offerTags:e,isMobileAddressAZipCode:d.isMobileAddressAZipCode(),showCustomerAddressOnMap:d.showCustomerAddressOnMap()})})};this.centerLocations=function(a){f.sdpMap&&(a=Microsoft.Maps.LocationRect.fromLocations(a),f.sdpMap.setView({bounds:a,padding:100}),9!==f.sdpMap.getZoom()&&f.sdpMap.setView({zoom:9}))};this.centerMapOnLocation=function(a){f.sdpMap&&f.sdpMap.setView({center:a})};this.getOfferAddress=function(){f.$highlightedOffer&&
f.$highlightedOffer.find(".ship-to-store-merchant-address").val()};this.showIncludedServices=function(d,c){if(c.includedServicesList&&0<c.includedServicesList.length){c.includedServicesList.sort();f.setPreviewString(d,c.includedServicesList);d.find(".ship-to-store-pdp-only-included-services-container").removeClass("aok-hidden");if(c.includedServicesList.length>f.numberOfServicesPreviewed){d.find(".ship-to-store-pdp-only-included-services-number-of-services").html(c.includedServicesNumberOfServicesWithPreviewString);
var h=q(".ship-to-store-pdp-only-included-services-popover-content-template").clone();h.find(".ship-to-store-pdp-only-included-services-all-providers").html(c.includedServicesAllProviders);var k=q.map(c.includedServicesList,function(a){var b=document.createElement("li");b.innerHTML=a;return b});h.find(".ship-to-store-pdp-only-included-services-list").append(k);k=d.find(".ship-to-store-pdp-only-included-services-popover-trigger");h={activate:"onclick",name:"includedServicesPopover",inlineContent:h.get(0).outerHTML};
a.declarative.create(k,"a-popover",h);d.find(".ship-to-store-pdp-only-included-services-popover-trigger").removeClass("aok-hidden")}b.publish(e.INCLUDED_SERVICES_NUMBER_OF_SERVICES,c.includedServicesList.length)}};this.setPreviewString=function(a,b){a.find(".ship-to-store-pdp-only-included-services-preview").prepend(b.slice(0,f.numberOfServicesPreviewed).join(", "))};this.preGenerateModalOffersHTML=function(){null!==f.generatedQuantity&&(f.generateHTML(),f.sdpMap&&f.disposeMapLayer())};this.resetHTMLPregenerate=
function(){f.isHTMLGenerated=!1;f.disposeMapLayer()};this.generateHTML=function(){f.getOfferAddress();f.$highlightedOffer=null;var h=0;f.$offersScroller.empty();var n=c.get("priceHTMLMap")||{},g=c.get("priceStrikethroughHTMLMap")||{},m={},t=d.hasAllGeographicallyMappableOffers(f.offerHelper.getVisibleOffers())?!0:!1;a.each(f.offerHelper.getVisibleOffers(),function(l,q){if(q=n[l.localizedPrice]){var p=(d.showCustomerAddressOnMap()?f.$modalOfferMobileTemplate:f.$offerTemplate).clone(),r;r=k.hasCheapestTag(l.offerTags)?
"ship-to-store-offer-badge-cheapest":k.hasFastestTag(l.offerTags)?"ship-to-store-offer-badge-fastest":"ship-to-store-offer-badge-default";p.find(".ship-to-store-modal-offer-radio-button").addClass(r);p.find(".ship-to-store-merchant-name").html(l.merchantName);p.find(".ship-to-store-merchant-address").val(l.address?l.address.displayAddress:"");p.find(".ship-to-store-merchant-ratings").html(l.ratingsAndReviews);!0===t&&"T1"===c.get("storeDistancesWeblab")&&"T1"===c.get("storeDistancesWeblabGate")&&
p.find(".ship-to-store-merchant-distance").html(l.distanceString);l.isRecommendedOffer&&"T1"===c.get("recommendedOfferWeblab")&&(p.find(".ship-to-store-recommended-offer-title-text").html(c.get("isRecommendedString")),p.find(".ship-to-store-recommended-offer-badge-text").html(l.recommendedBadgeMessage),p.find(".ship-to-store-recommended-offer-title").removeClass("aok-hidden"),p.find(".ship-to-store-recommended-offer-badge").removeClass("aok-hidden"),p.find(".ship-to-store-merchant-distance").addClass("ship-to-store-recommended-offer"));
p.find("#total-installation-cost-text").html(l.totalInstallationCostString);p.find(".total-service-price-placeholder").html(l.localizedPrice);(r=c.get("pricePerUnitHTMLMap"))?r.hasOwnProperty(l.localizedServicePricePerQuantity)?p.find(".ship-to-store-merchant-bundle-price").html(r[l.localizedServicePricePerQuantity]):b.publish(e.PER_UNIT_SERVICE_PRICE_HTML_MAP_KEY_MISSING,l.localizedServicePricePerQuantity):b.publish(e.PER_UNIT_SERVICE_PRICE_HTML_MAP_UNDEFINED);p.find(".ship-to-store-merchant-estimated-service-date").html(l.fastestServiceAppointmentTimeString);
c.get("includedServicesEnabled")&&f.showIncludedServices(p,l);p.attr("id","ship-to-store-offer-merchant-row-"+h);p.addClass(l.storeId);p.data("storeId",l.storeId);l.hasPromotion&&g.hasOwnProperty(l.localizedPriceWithoutPromotion)&&(q=q+" "+g[l.localizedPriceWithoutPromotion]);p.find(".ship-to-store-merchant-price .price").html(q);h++;D.updateMinAndMaxOfferMetrics(m,l);a.show(p);f.$offersScroller.append(p)}else b.publish(e.OFFER_PRICE_FALSY)});b.publish(e.OFFERS_GENERATED,h);D.publishMinAndMaxOfferMetrics(m);
a.trigger("ship-to-store:modal:offers-generated",{offerCount:h});f.$highlightedOffer=f.getDefaultOffer();f.selectHighlightedOffer();f.radioButtons=q('#ship-to-store-modal-offer-scroller-content input[name\x3d"ship-to-store-merchant-select"]');f.updateModalServiceProviderSecondaryHeader();f.generatedQuantity=f.offerHelper.getSelectedQuantity();f.isHTMLGenerated=!0};this.show=function(){f.modalInstance?f.modalInstance.show():b.publish(e.MODAL_NOT_FOUND)};this.init=function(){performance&&performance.mark("ship-to-store-modal-init");
c.get("isVehicleInformationEnabled")?(a.hide(q("#ship-to-store-modal-tabs")),q(".ship-to-store-modal-content-column").width("390px"),a.hide(q(".ship-to-store-modal-map-column")),q(".ship-to-store-modal-content-column").addClass("ship-to-store-modal-content-column-min-height"),q("#ship-to-store-modal-offer-action-buttons").addClass("ship-to-store-modal-offer-action-buttons-class"),y.init(),C.init()):(q("#ship-to-store-pdp-service-modal").width("915px"),q(".ship-to-store-modal-content-column").width("42.512%"),
a.show(q(".ship-to-store-modal-map-column")));f.numberOfServicesPreviewed=2;f.offerHelper=n;f.shipToStorePageRefreshHandler=t;f.$modal=q("#ship-to-store-pdp-service-modal-content");f.$modalContentColumn=q(".ship-to-store-modal-content-column");f.$modalMapColumn=q(".ship-to-store-modal-map-column");f.$modalMapLoadingOverlay=q(".ship-to-store-modal-map-loading-overlay");q(".ship-to-store-modal-map-loading-button").click(f.renderMapLayerIfNotExists);f.$modalMapPushpinCustomerAddressTemplate=q("#ship-to-store-modal-map-pushpin-customer-address-template");
f.$modalMapPushpinTemplate=q("#ship-to-store-modal-map-pushpin-template");f.$modalOfferFilter=q(".ship-to-store-modal-offer-filter-class");f.$modalOfferMobileTemplate=q("#ship-to-store-modal-offer-mobile-wrapper-template");f.$modalTabContent=q(".ship-to-store-modal-tab-content");f.$modalTabSharedContent=q("#ship-to-store-modal-tab-shared-content");f.$offersScrollerContainer=q("#ship-to-store-modal-offer-scroller");f.$offersScroller=q("#ship-to-store-modal-offer-scroller-content");f.$offerTemplate=
q("#ship-to-store-modal-offer-wrapper-template");f.$modalTabHeadings=q(".ship-to-store-modal-tab-headings");var d=!1;a.each(q(".ship-to-store-modal-tab-heading"),function(a){a=q(a);var b=a.find(".ship-to-store-offer-img");f.offerHelper.getSelectedOfferTypeCollection(a.data("offer-type")).hasOffers?(a.removeClass("disabled"),b.removeClass("disabled"),d=!0):(a.addClass("disabled"),b.addClass("disabled"))});d||b.publish(e.NO_TABS_HAVE_OFFERS);r.when("a-modal").execute(function(b){f.modalInstance=b.get(q("#ship-to-store-modal-action"));
a.trigger("ship-to-store:modal:ready")})};this.changeServiceProvider=function(){b.publish(e.CHANGE_SERVICE_PROVIDER_CLICK);a.show(q("#ship-to-store-modal-tabs"));a.hide(q("#confirmed-service-section"));a.hide(q("#change-service-provider-link"));a.hide(q("#service-provider-text"));a.show(q("#choose-service-provider-text"));q(".ship-to-store-modal-content-column").removeClass("ship-to-store-modal-content-column-min-height");q("#ship-to-store-modal-offer-action-buttons").removeClass("ship-to-store-modal-offer-action-buttons-class");
C.disableIncludeServiceButton()};this.updateModalPosition=function(){f.modalInstance.lock().show().updatePosition()};this.sdpMapBaseIsRendered=this.sdpMapBaseHasStartedRendering=this.sdpMap=null;this.sdpMapRetries=0;this.infobox=null;this.isOpen=!1;this.pushPins={};this.stsLocations=[];this.modalInstance=this.selectedOffer=this.radioButtons=this.selectedPushPin=null;this.isHTMLGenerated=this.modalOfferFilterSelected=!1;this.openCount=0;this.generatedQuantity=null;this.offerListMaxScrollingOffset=
0;this.modalName=(c.get("modalParams")||{}).name||"";this.pageRefreshData={};this.pageRefreshData.winningOfferListingId=c.get("winningOfferListingId");this.pageRefreshData.currentOfferListingId=this.pageRefreshData.winningOfferListingId;this.pageRefreshData.featuresToGreyOut=z;this.pageRefreshData.asin=c.get("productAsin")||"";this.pageRefreshData.callBackFunction="ship-to-store:ajax-success";this.pageRefreshData.quantityUpdateCallback="ship-to-store:updateQuantity";q("body").delegate(".ship-to-store-modal-offer-wrapper",
"click",this.selectionChanged).delegate(".ship-to-store-modal-accept-offer","click",this.acceptOfferClick).delegate(".ship-to-store-modal-decline-offer","click",this.declineOfferClick).delegate("#ship-to-store-modal-offer-filter","click",this.filterModalOffers);c.get("isVehicleInformationEnabled")&&(a.declarative("change-service-provider-action","click",this.changeServiceProvider),a.on("renderMap",this.renderMapPinsAndEventsIfMapLayerExists),a.on("update-modal-position",this.updateModalPosition));
a.on("a:popover:afterShow:includedServicesPopover",this.includedServicesPopoverHover);a.on("ship-to-store:previous-offer-found",this.acceptPreviousSelectedOffer);a.on("ship-to-store:trigger-page-refresh",this.triggerPageRefresh);a.on("a:popover:beforeShow:"+this.modalName,this.beforeShow);a.on("a:popover:visible:"+this.modalName,this.afterVisible);a.on("a:popover:invisible:"+this.modalName,this.afterInvisible);a.on("a:popover:afterUpdatePosition:"+this.modalName,this.afterUpdatePosition);a.on("a:popover:dismiss:"+
this.modalName,this.modalDismissedByClickingXorGreyBorderBackground);a.declarative("a-popover-floating-close","click",this.greyBackgroundClicked);a.on("ship-to-store:modal:show",this.show);a.on("ship-to-store-pregenerate-offers",this.preGenerateModalOffersHTML);a.on("a:pageUpdate",this.resetHTMLPregenerate)}});"use strict";r.when("A","ship-to-store-settings","ship-to-store-metric-publisher","ship-to-store-metric-names","ship-to-store").register("ship-to-store-offer-helper",function(a,c,b,e){return new function m(g){var d=
this;p(this,m);this.visibleOffers=[];this.determineOfferType=function(){if(d.selectedOfferType in d.offerCollectionsMap&&d.offerCollectionsMap[d.selectedOfferType].hasOffers)return d.selectedOfferType;var g=void 0;a.each(c.get("offerCollections"),function(a){a.hasOffers&&g===w&&(g=a.offerType.name)});if(g)return g;b.publish(e.NO_ACTIVE_OFFER_TYPE)};this.getNumberOfOffers=function(){return a.reduce(c.get("offerCollections")||[],function(b,d){return b+(d&&a.isArray(d.offers)?d.offers.length:0)},0)};
this.getSelectedOfferTypeCollection=function(a){return d.offerCollectionsMap[a||d.selectedOfferType]};this.setVisibleOffers=function(b){b&&(d.selectedOfferType=b);var e=d.getAsinForQuantity();d.visibleOffers=[];a.each(d.getSelectedOfferTypeCollection().offers,function(a){a.asin===e&&d.visibleOffers.push(a)})};this.getOfferAtStoreIdForQuantity=function(a,b){for(var d=0;d<a.length;d++)if(a[d].storeId===b)return a[d];return null};this.setQuantity=function(c){c=parseInt(c);if(d.selectedQuantity!==c){var k=
d.selectedQuantity;d.selectedQuantity=c;c=d.acceptedOffer;d.setVisibleOffers();c&&((c=d.getOfferAtStoreIdForQuantity(d.getVisibleOffers(),c.storeId))?d.acceptOffer(c):(d.getAsinForQuantity()&&b.publish(e.DESELECT_OFFER_QTY_NOT_FOUND),d.declineOffer()));a.trigger("ship-to-store:quantity-changed",{previousQuantity:k,quantity:d.selectedQuantity})}};this.getAsinForQuantity=function(a,b){b=b||d.getSelectedOfferTypeCollection();a=a||d.selectedQuantity;return b.quantityToUpsellAsinMap[a]};this.getVisibleOffers=
function(){return d.visibleOffers};this.getOfferByStoreId=function(b){return a.reduce(d.offerMap[b]||[],function(a,b){return b.quantity===d.selectedQuantity?b:a},null)};this.getSelectedQuantity=function(){return d.selectedQuantity};this.hasVisibleOffers=function(){return d.visibleOffers&&d.visibleOffers.length};this.hasLFSOffers=function(){var b=!1;a.each(d.getSelectedOfferTypeCollection().offers,function(a){b=b||a.isLfsOffer});return b};this.hasOfferForQuantity=function(b){b=b||d.selectedQuantity;
return a.reduce(c.get("offerCollections")||[],function(a,e){return a||d.getAsinForQuantity(b,e)},!1)};this.getDefaultOffer=function(){return d.acceptedOffer&&d.getSelectedOfferTypeCollection().offerType.name===d.acceptedOffer.offerType.name?d.acceptedOffer:d.getSelectedOfferTypeCollection().offers.find(function(a){return a.quantity===d.selectedQuantity})};this.getAcceptedOffer=function(){return d.acceptedOffer};this.getAccepterOfferTypeName=function(){var a=d.getAcceptedOffer();return a&&a.offerType&&
a.offerType.name||""};this.acceptOffer=function(c){d.acceptedOffer=c;d.selectedOfferType=c.offerType.name;b.publish(e.OFFER_ACCEPTED);a.trigger("ship-to-store:offer-accepted")};this.declineOffer=function(){d.acceptedOffer=null;b.publish(e.OFFER_DECLINED);a.trigger("ship-to-store:offer-declined")};this.init=function(){d.offerCollectionsMap={};a.each(c.get("offerCollections"),function(a){d.offerCollectionsMap[a.offerType.name]=a});d.offerMap={};a.each(c.get("offerCollections"),function(b){a.each(b.offers,
function(a){d.offerMap[a.storeId]||(d.offerMap[a.storeId]=[]);d.offerMap[a.storeId].push(a);!d.hasStoreDistanceString&&a.distanceString&&(d.hasStoreDistanceString=!0)})});d.selectedOfferType=d.determineOfferType()};if(m.instance)return m.instance;m.instance=this;this.init(g);this.selectedQuantity=this.acceptedOffer=null;this.hasStoreDistanceString=!1}});"use strict";r.when("ship-to-store").register("ship-to-store-offer-tags-helper",function(){return new function c(){p(this,c);this.hasCheapestTag=
function(b){return b!==w&&-1!==b.indexOf("CHEAPEST")};this.hasFastestTag=function(b){return b!==w&&-1!==b.indexOf("FASTEST")}}});"use strict";A="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};r.when("A","ship-to-store").register("ship-to-store-settings",function(a){var c=function n(){p(this,n)};c.get=function(a){if(a&&b)return b[a]};c.set=function(c){c&&
"object"===("undefined"===typeof c?"undefined":A(c))&&!a.isArray(c)&&(b=c)};c.parsePageState=function(){var b=0<arguments.length&&arguments[0]!==w?arguments[0]:a.$("body");return a.parseJSON(b.find("[data-a-state*\x3dship-to-store-view-model]").html())};var b=c.parsePageState();return c});"use strict";r.when("ship-to-store-settings","3p-promise").register("ship-to-store-function",function(a,c){var b=function n(){p(this,n)};b.try=function(b){return(new c(function(a,c){b(a,c)})).catch(function(b){r.when("ship-to-store-metric-publisher").execute(function(c){c.logError(b,
a.get("attribution"))});throw b;})};return b});"use strict";r.when("jQuery","ship-to-store-settings","ship-to-store-metric-publisher","ship-to-store-metric-names","ship-to-store-uuid","3p-promise","add-to-cart-parameter-helper","ship-to-store").register("ship-to-store-item-association-helper",function(a,c,b,e,n,m,g){return new function t(){var k=this;p(this,t);this.addService=function(h){var l=1<arguments.length&&arguments[1]!==w?arguments[1]:!0;k.updateNatcState();return new m(function(m){if(h&&
h.offerListingId)try{var t=a("#addToCart"),p=void 0;c.get("isVehicleInformationEnabled")&&k.uuid?p=k.uuid:(p=n.generate(),c.get("isVehicleInformationEnabled")&&(b.publish(e.VEHICLE_INFO_WITH_UNINITIALIZED_ASSOCIATION_ID),b.logError(Error("Vehicle info not saved for assocId: "+p),c.get("attribution")+":"+e.VEHICLE_INFO_WITH_UNINITIALIZED_ASSOCIATION_ID+":"+p)));if(k.isNatcEnabled){b.publish(e.NATC_DESKTOP_ENDPOINT_USED);var q=[],r=t.find('input[name$\x3d"[asin]"]').length;g.getServiceFormParameters(q,
h.asin,h.offerListingId,1,r);l&&(g.getItemAssociationFormParameters(q,c.get("productAsin"),p,r),c.get("isPassingStoreAddressEnabled")&&g.getStoreAddressFormParameters(q,c.get("marketplaceId"),h.addressForStore.legacyAddressId,r));g.addParametersToWebForm(t,q)}else{b.publish(e.GURUPA_DESKTOP_ENDPOINT_USED);var q=t.find('input[name^\x3d"offeringID"]').length+1,v=t.find('input[name^\x3d"custom-name"]').length+1,r=q+1,x=t.find('input[name\x3d"itemCount"]'),f='\x3cinput type\x3d"hidden" class\x3d"atcFormServiceAsinData" id\x3d"quantity.'+
q+'" name\x3d"quantity.'+q+'" value\x3d"1" /\x3e\n                \x3cinput type\x3d"hidden" class\x3d"atcFormServiceAsinData" id\x3d"asin.'+q+'" name\x3d"asin.'+q+'" value\x3d"'+h.asin+'" /\x3e\n                \x3cinput type\x3d"hidden" class\x3d"atcFormServiceAsinData" id\x3d"offeringID.'+q+'" name\x3d"offeringID.'+q+'" value\x3d"'+h.offerListingId+'" /\x3e\n                \x3cinput type\x3d"hidden" class\x3d"atcFormServiceAsinData" id\x3d"merchantID.'+q+'" name\x3d"merchantID.'+q+'" value\x3d"'+
h.merchantId+'" /\x3e';l&&(f+='\x3cinput type\x3d"hidden" class\x3d"atcFormServiceAsinData" id\x3d"custom-name.1.'+v+'" name\x3d"custom-name.1.'+v+'" value\x3d"itemAssoc" /\x3e\n                  \x3cinput type\x3d"hidden" class\x3d"atcFormServiceAsinData" id\x3d"custom-value.1.'+v+'" name\x3d"custom-value.1.'+v+'" value\x3d"'+p+'" /\x3e\n                  \x3cinput type\x3d"hidden" class\x3d"atcFormServiceAsinData" id\x3d"custom-name.1.'+(v+1)+'" name\x3d"custom-name.1.'+(v+1)+'" value\x3d"UNIQ-itemAssoc" /\x3e\n                  \x3cinput type\x3d"hidden" class\x3d"atcFormServiceAsinData" id\x3d"custom-value.1.'+
(v+1)+'" name\x3d"custom-value.1.'+(v+1)+'" value\x3d"'+p+'" /\x3e\n                  \x3cinput type\x3d"hidden" class\x3d"atcFormServiceAsinData" id\x3d"custom-name.1.'+(v+2)+'" name\x3d"custom-name.1.'+(v+2)+'" value\x3d"itemAssocType" /\x3e\n                  \x3cinput type\x3d"hidden" class\x3d"atcFormServiceAsinData" id\x3d"custom-value.1.'+(v+2)+'" name\x3d"custom-value.1.'+(v+2)+'" value\x3d"ShipToStore" /\x3e',f+='\x3cinput type\x3d"hidden" class\x3d"atcFormServiceAsinData" id\x3d"custom-name.'+
r+'.1" name\x3d"custom-name.'+r+'.1" value\x3d"itemAssoc" /\x3e\n                  \x3cinput type\x3d"hidden" class\x3d"atcFormServiceAsinData" id\x3d"custom-value.'+r+'.1" name\x3d"custom-value.'+r+'.1" value\x3d"'+p+'" /\x3e\n                  \x3cinput type\x3d"hidden" class\x3d"atcFormServiceAsinData" id\x3d"custom-name.'+r+'.2" name\x3d"custom-name.'+r+'.2" value\x3d"itemAssocType" /\x3e\n                  \x3cinput type\x3d"hidden" class\x3d"atcFormServiceAsinData" id\x3d"custom-value.'+r+'.2" name\x3d"custom-value.'+
r+'.2" value\x3d"ShipToStore" /\x3e',c.get("isPassingStoreAddressEnabled")&&(f+='\x3cinput type\x3d"hidden" class\x3d"atcFormServiceAsinData" id\x3d"custom-name.1.'+(v+3)+'" name\x3d"custom-name.1.'+(v+3)+'" value\x3d"storeLegacyAddressId" /\x3e\n                    \x3cinput type\x3d"hidden" class\x3d"atcFormServiceAsinData" id\x3d"custom-value.1.'+(v+3)+'" name\x3d"custom-value.1.'+(v+3)+'" \n                    value\x3d"'+h.addressForStore.legacyAddressId+'" /\x3e\n                    \x3cinput type\x3d"hidden" class\x3d"atcFormServiceAsinData" id\x3d"custom-name.'+
r+'.3" name\x3d"custom-name.'+r+'.3" value\x3d"storeLegacyAddressId" /\x3e\n                    \x3cinput type\x3d"hidden" class\x3d"atcFormServiceAsinData" id\x3d"custom-name.'+r+'.3" name\x3d"custom-name.'+r+'.3" \n                    value\x3d"'+h.addressForStore.legacyAddressId+'" /\x3e'));t.append(f);x.length?x[0].value=q:t.append('\x3cinput type\x3d"hidden" name\x3d"itemCount" value\x3d"'+q+'"\x3e')}b.publish(e.ATC_FORM_APPEND_FAIL,0);b.publish(e.ATC_FORM_APPEND_SUCCESS);b.publish(e.IA_TYPE_SET)}catch(u){k.isNatcEnabled&&
b.publish(e.NATC_DESKTOP_ENDPOINT_ERROR),b.publish(e.ATC_FORM_APPEND_SUCCESS,0),b.publish(e.ATC_FORM_APPEND_FAIL),b.logError(u,c.get("attribution"),"addService call exception caught")}m()})};this.removeServices=function(){try{var h=a("#addToCart");if(k.isNatcEnabled)g.removeParametersFromWebForm();else{a(".atcFormServiceAsinData").remove();var l=h.find('input[name^\x3d"offeringID"]');l.length&&l[0].value&&--l[0].value}b.publish(e.ATC_FORM_REMOVE_FAIL,0);b.publish(e.ATC_FORM_REMOVE_SUCCESS)}catch(m){b.publish(e.ATC_FORM_REMOVE_SUCCESS,
0),b.publish(e.ATC_FORM_REMOVE_FAIL),b.logError(m,c.get("attribution"),"removeService call exception caught")}};this.updateNatcState=function(){k.isNatcEnabled=g.shouldUseNatcDesktop()};this.generateUUID=function(){return k.uuid=n.generate()};this.updateNatcState();this.uuid=null}});"use strict";A="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};
r.when("a-util").register("query-param",function(a){var c=function e(){var c=this;p(this,e);this._queryString="";this._parameters={};this.getParameters=function(){var a=e._getQueryStringFromBrowser();if(a===c._queryString)return c._parameters;c._queryString=a;c._queryString.slice(1).split("\x26").map(function(a){a=a.split("\x3d");if(a.length&&a[0].length){var d=decodeURIComponent(a[0]);switch(a.length){case 2:c._parameters[d]=decodeURIComponent(a[1]);break;case 1:c._parameters[d]=null}}});return c._parameters};
this.getParameter=function(a){return c.getParameters()[a]};this.parameterExists=function(a){return c.getParameters().hasOwnProperty(a)};this.setParameters=function(m){if("object"!==("undefined"===typeof m?"undefined":A(m))||a.isArray(m))return!1;c._queryString="?"+e.createQueryStringFromObject(m);e._setQueryStringOnBrowser(c._queryString);return c};this.setParameter=function(a,e){if(!a||!a.length)return!1;var d=c.getParameters();d[a]=e;return c.setParameters(d)};this.removeParameter=function(a){if(!a||
!a.length)return!1;var e=c.getParameters();delete e[a];return c.setParameters(e)};this.getQueryString=function(){return c._queryString}};c.createQueryStringFromObject=function(a){var c=[];Object.keys(a).forEach(function(m){if(!a.hasOwnProperty(m)||""===m||""===a[m])return!1;c.push(encodeURIComponent(m)+"\x3d"+encodeURIComponent(a[m]))});return c.join("\x26")};c._getQueryStringFromBrowser=function(){return location.search.valueOf()};c._setQueryStringOnBrowser=function(a){"function"===typeof history.replaceState?
history.replaceState({},document.title,a):location.search=a};return c});"use strict";r.when("A","ship-to-store-settings","ship-to-store-metric-publisher","ship-to-store-metric-names","ship-to-store").register("ship-to-store-helper",function(a,c,b,e){var n=a.$,m=!1,g=!1,d=function k(){p(this,k)};d.isShipToStoreEnabled=function(c,h){!(c="stsPdpOnly"===c)||a.isArray(h)&&h.length||(d.hideShipToStore(),c=!1,m||(b.publish(e.NO_OFFERS_ON_PAGE_LOAD),b.publish(e.OFFERS_ON_PAGE_LOAD,0)));m=!0;return c};d.hideShipToStore=
function(){a.hide(n(0<arguments.length&&arguments[0]!==w?arguments[0]:"#addProfessionalServicesRow"))};d.hasShipToStoreBeenInitialized=function(){return g};d.shipToStoreInitialized=function(){g=!0};d.shipToStoreNotInitialized=function(){g=!1};return d});"use strict";var B=function(){function a(a,b){for(var e=0;e<b.length;e++){var n=b[e];n.enumerable=n.enumerable||!1;n.configurable=!0;"value"in n&&(n.writable=!0);Object.defineProperty(a,n.key,n)}}return function(c,b,e){b&&a(c.prototype,b);e&&a(c,e);
return c}}();r.when("ship-to-store").register("ship-to-store-uuid",function(){var a=function(){function a(){p(this,a)}B(a,null,[{key:"getRandomValue",value:function(){var a=crypto||msCrypto;if(a){var c=new Uint8Array(1);a.getRandomValues(c);return c[0]%16}return 16*Math.random()}}]);return a}();a.generate=function(c){return c?(c^a.getRandomValue()>>c/4).toString(16):"10000000-1000-4000-8000-100000000000".replace(/[018]/g,a.generate)};return a});"use strict";r.when("A","ship-to-store-atc","ship-to-store-metric-publisher",
"ship-to-store-metric-names","a-dropdown","ship-to-store").register("ship-to-store-page-refresh",function(a,c,b,e,n){var m=a.$;"use strict";return new function d(t){var k=this;p(this,d);this.pageRefresh=function(b,d,c,e){if(d.winningOfferListingId===w)a.trigger("ship-to-store:modal:closed");else{var m=b?d.winningOfferListingId:c.productOfferListingId;c.productOfferListingId===w&&(m=d.winningOfferListingId);d.currentOfferListingId!==m?(d.currentOfferListingId=m,d.quantity=e,d.declineOffer=b,k.performPageRefresh(d)):
a.trigger("ship-to-store:modal:closed")}};this.performPageRefresh=function(a){k.setOpacityForFeaturesInPDP("0.5",a.featuresToGreyOut);k.pageRefreshAjaxHandle=null;var b=k.getAjaxUrl(a);a.ajaxUrl=b;k.callDPXAjaxHandler(a)};this.callDPXAjaxHandler=function(d){performance.mark(e.PAGE_REFRESH_STARTED);k.pageRefreshAjaxHandle=a.ajax(d.ajaxUrl,{method:"POST",timeout:"90000",success:function(c){d.pageRefreshData=c;a.trigger(d.callBackFunction,d);performance.mark(e.PAGE_REFRESH_ENDED);performance.measure(e.PAGE_REFRESH_TIME,
e.PAGE_REFRESH_STARTED,e.PAGE_REFRESH_ENDED);b.publish(e.PAGE_REFRESH_SUCCEEDED)},error:function(){b.publish(e.PAGE_REFRESH_FAILED)},abort:function(){b.publish(e.PAGE_REFRESH_ABORTED)}})};this.updateDesktopFeatures=function(d){try{var l=d.pageRefreshData;d.featuresToGreyOut.forEach(function(a){m(a).replaceWith(m(l).find(a).prop("outerHTML"))});k.setOpacityForFeaturesInPDP("1.0",d.featuresToGreyOut);c.pageRefreshPerformed();c.hideBuyNowOneClickButtons();k.updateBuyBoxQuantity(d.quantity)}catch(n){k.setOpacityForFeaturesInPDP("1.0",
d.featuresToGreyOut),b.publish(e.PAGE_REFRESH_FAILED)}finally{a.trigger("ship-to-store:modal:closed")}};this.updateMobileFeatures=function(d){try{var l=d.pageRefreshData;selectedInitialFeatureData=m("#shipToStoreBuyBox_feature_div");d.featuresToGreyOut.forEach(function(a){m(a).replaceWith(m(l).find(a).prop("outerHTML"))});d.declineOffer?m("#shipToStoreBuyBox_feature_div").replaceWith(d.initialFeatureData.prop("outerHTML")):(m("#shipToStoreBuyBox_feature_div").replaceWith(selectedInitialFeatureData.prop("outerHTML")),
c.pageRefreshPerformed(),c.hideBuyNowOneClickButtons());k.updateMobileBuyBoxQuantity(d.quantity);k.setOpacityForFeaturesInPDP("1.0",d.featuresToGreyOut)}catch(n){k.setOpacityForFeaturesInPDP("1.0",d.featuresToGreyOut),b.publish(e.PAGE_REFRESH_FAILED)}finally{c.atcClickIntercepted||a.trigger("a:pageUpdate"),a.trigger("ship-to-store:modal:closed")}};this.updateBuyBoxQuantity=function(b){var d=n.getSelect("quantity");if(d){var c=d.getOptions().size();b>c?(d.setValue(c),a.trigger("ship-to-store-buybox-quantity-changed",
{value:c})):d.setValue(b)}};this.updateMobileBuyBoxQuantity=function(b){k.updateATCForm(b);var d=n.getSelect("mobileQuantityDropDown");if(d){var c=d.getOptions().size();b>c?(d.setValue(c),a.trigger("ship-to-store-mobile-buybox-quantity-changed",{value:c})):d.setValue(b)}};this.updateATCForm=function(a){m("#addToCart").find('input[name^\x3d"quantity"]').val(a)};this.getAjaxUrl=function(a){return"/gp/product/"+encodeURIComponent(a.asin)+"?oid\x3d"+encodeURIComponent(a.currentOfferListingId)+"\x26otk\x3d"+
encodeURIComponent("ValueAdds")};this.setOpacityForFeaturesInPDP=function(b,d){a.each(d,function(a,d){m(a).css("opacity",b)})};this.oidKey="ValueAdds";this.pageRefreshAjaxHandle=null;a.on("ship-to-store:ajax-success",this.updateDesktopFeatures);a.on("ship-to-store:ajax-success-mobile",this.updateMobileFeatures);a.on("ship-to-store:updateQuantity",this.updateBuyBoxQuantity);a.on("ship-to-store:updateMobileQuantity",this.updateMobileBuyBoxQuantity)}});"use strict";r.when("A","ship-to-store-settings",
"ship-to-store").register("ship-to-store-vas-metric-utils",function(a,c){return new function e(){var a=this;p(this,e);this.metricConstants={refmarkerPrefixes:{tenant:"vas",mappingSet:"sts",desktopWidget:"dsts",mobileWidget:"msts"},hitRecordConstants:{pageType:"DetailPage",subPageType:"ValueAdds"},additionalRequestDataKeys:{zipCode:"zip"},hitParameterKeys:{productAsin:"productAsin",pageType:"pageType",subPageType:"subPageType",additionalRequestData:"additionalRequestData",zipCode:"zip"},actions:{addToCart:"att",
featureClick:"clk",view:"gv",includeService:"incl",declineService:"cncl"}};this.createHitParameters=function(){var e={},g={};g[a.metricConstants.additionalRequestDataKeys.zipCode]=c.get("zipCode");e[a.metricConstants.hitParameterKeys.productAsin]=c.get("productAsin");e[a.metricConstants.hitParameterKeys.pageType]=a.metricConstants.hitRecordConstants.pageType;e[a.metricConstants.hitParameterKeys.subPageType]=a.metricConstants.hitRecordConstants.subPageType;e[a.metricConstants.hitParameterKeys.additionalRequestData]=
g;return e};this.tenantName=function(){return a.metricConstants.refmarkerPrefixes.tenant};this.widgetName=function(){return c.get("isApp")?a.metricConstants.refmarkerPrefixes.mobileWidget:a.metricConstants.refmarkerPrefixes.desktopWidget};this.mappingSet=function(){return c.get("mappingSets")?c.get("mappingSets")[0]:a.metricConstants.refmarkerPrefixes.mappingSet};this.hitParameters=this.createHitParameters();this.tenantName=this.tenantName();this.widgetName=this.widgetName();this.mappingSet=this.mappingSet()}});
"use strict";r.when("A","query-param","ship-to-store-metric-publisher","ship-to-store-metric-names","ship-to-store").execute("ship-to-store-redirect",function(a,c,b,e){a=a.$;var n=["A1F0ZNSBIZPSXB"];c=new c;c.parameterExists("smid")&&n.includes(c.getParameter("smid"))?(a("#add-to-cart-button").addClass("aok-disabled"),c.removeParameter("smid"),b.publish(e.STRIPED_MERCHANT_ID),u.location.replace(u.location.href)):b.publish(e.STRIPED_MERCHANT_ID,0)});"use strict";r.when("A","ship-to-store-settings",
"ship-to-store").register("sts-aapi-ajax-constants",function(a,c){var b=c.get("aapiAjaxEndpoint"),e=c.get("marketplaceId");return{GARAGE_VEHICLES_URL:"https://"+b+"/api/marketplaces/"+e+"/customer/garage/vehicles/",VEHICLE_SELECT_PATH:"/select",ATTRIBUTE_SELECTIONS_PATH:"https://"+b+"/api/marketplaces/"+e+"/taxonomies/garage",PRIVATE_API_URL:"https://"+b+("/custom/stsvehicleinformationcontracts/marketplaces/"+e+"/stsvehicleinfo/save"),TIMEOUT:1E4,CSRF_TOKEN:c.get("aapiCSRFToken"),SLATE_TOKEN:a.$('meta[name\x3d"encrypted-slate-token"]').prop("content")}});
"use strict";r.when("A","a-dropdown","a-button","ship-to-store-settings","ship-to-store-metric-publisher","ship-to-store-metric-names","ship-to-store-vas-metric-utils","sts-aapi-ajax-constants","sts-vehicle-add-utils","number-plate-helper","ship-to-store").register("vehicle-info-utils",function(a,c,b,e,n,m,g,d,t,k){var h=a.$,l=new Map;l.set("version","1");l.set("flow","vehicle-by-attributes");g=e.get("vehicleAttributesIds")||[];var r=e.get("vehicleInfoAdditionalAttributeIds")||[];e.get("isDynamicPricingApplicable")&&
(r=r.concat(e.get("vehicleInfoOptionalAttributeIds")||[]));var u=[],w=new Set(r),q=g.concat(r),z=!1,v=[],x={},f=void 0;return new function E(){var g=this;p(this,E);this.showCustomerSavedVehicles=function(){a.show(g.vehicleInfoSpinner);a.hide(g.addVehicleButton);a.hide(g.selectVehicleDropdown);a.hide(g.addVehicleSection);a.hide(g.aapiAjaxFailureAlert);h.ajax({url:d.GARAGE_VEHICLES_URL,type:"GET",headers:{"Accept-Language":"en-US",Accept:'application/vnd.com.amazon.api+json; type\x3d"customer.garage.vehicles/v1"',
"x-api-csrf-token":d.CSRF_TOKEN,"x-amzn-encrypted-slate-token":d.SLATE_TOKEN},xhrFields:{withCredentials:!0},timeout:d.TIMEOUT,success:function(b){a.hide(h("#vehicle-info-spinner"));v=b.entity.vehicleList;a.trigger("show-select-vehicle-dropdown")},error:function(b){a.hide(h("#vehicle-info-spinner"));a.show(h("#vehicle-info-aapi-ajax-failure-alert"));n.publish(m.GET_VEHICLES_CALL_FAILED)}})};this.selectVehicleAapiCall=function(b){x=t.getVehicleFromId(v,b.value);"A1VC38T7YXB528"!==e.get("marketplaceId")&&
(a.show(g.vehicleInfoSpinner),h.ajax({url:d.GARAGE_VEHICLES_URL+encodeURIComponent(b.value)+d.VEHICLE_SELECT_PATH,type:"POST",headers:{"Accept-Language":"en-US",Accept:'application/vnd.com.amazon.api+json; type\x3d"customer.garage.vehicle/v1"',"Content-Type":'application/vnd.com.amazon.api+json; type\x3d"customer.garage.select-vehicle.request/v1"',"x-api-csrf-token":d.CSRF_TOKEN,"x-amzn-encrypted-slate-token":d.SLATE_TOKEN},data:JSON.stringify({}),xhrFields:{withCredentials:!0},timeout:d.TIMEOUT,
success:function(b){a.hide(h("#vehicle-info-spinner"))},error:function(b){n.publish(m.SELECT_VEHICLE_CALL_FAILED);a.hide(h("#vehicle-info-spinner"))}}))};this.saveVehicleDataAapiCall=function(b){return new Promise(function(c){a.show(g.vehicleInfoSpinner);h.ajax({url:d.PRIVATE_API_URL,type:"POST",headers:{"Accept-Language":"en-US",Accept:'application/vnd.com.amazon.api+json; type\x3d"aapi.stsvehicleinformationcontracts.custom.save.response/v1"',"Content-Type":'application/vnd.com.amazon.api+json; type\x3d"aapi.stsvehicleinformationcontracts.custom.save.request/v1"',
"x-api-csrf-token":d.CSRF_TOKEN,"x-amzn-encrypted-slate-token":d.SLATE_TOKEN},data:JSON.stringify(b),xhrFields:{withCredentials:!0},timeout:d.TIMEOUT,success:function(b){a.hide(h("#vehicle-info-spinner"))},error:function(b){n.publish(m.SAVE_VEHCILE_DATA_PRIVATE_AAPI_CALL_FAILED);a.hide(h("#vehicle-info-spinner"));a.show(h("#vehicle-info-aapi-ajax-failure-alert"))}});c()})};this.setMruVehicleName=function(a){x.name=a};this.getMruVehicle=function(){return x};this.addVehicleButtonClick=function(){n.publish(m.ADD_VEHICLE_CLICK);
a.hide(g.confirmVehicleButton);a.hide(g.addVehicleButton);a.hide(g.missingAdditionalAttributesSection);a.show(g.addVehicleSection);b(g.addVehicleSaveButton).disable();a.hide(g.selectVehicleDropdown);g.numberPlateActive?k.numberPlateOptionClick():k.vehicleAttributeOptionClick()};this.selectVehicleDropdownAction=function(b){a.hide(g.aapiAjaxFailureAlert);"addVehicle"===b.value?(n.publish(m.NEW_VEHICLE_ADD_OPTION_SELECT),g.addVehicleButtonClick()):(g.selectVehicleAapiCall(b),b=t.getVehicleFromId(v,b.value),
g.manageMissingAdditionalAttributes(b))};this.initializeVehicleAttributeDropdowns=function(){e.get("isNumberPlateEnabled")&&l.set("vehicleType","CAR");t.resetDropdownSelection(0,q,l,"sts-vehicle-info-attribute-dropdown-native-");t.showDropdowns(0,q,"sts-vehicle-info-attribute-dropdown-");g.fetchNextAttribute(q[0],g.newVehicleFetchNextAttributeAction)};this.manageMissingAdditionalAttributes=function(d){z=!1;u=t.getMissingAdditionalAttr(d,r);t.resetDropdownSelection(0,r,l,"sts-vehicle-info-missing-additional-attribute-dropdown-native-");
t.showOnlyMissingAdditionalAttributeDropdowns(r,u,"sts-vehicle-info-missing-additional-attribute-dropdown-");0!==u.length?(a.show(g.missingAdditionalAttributesSection),b(g.confirmVehicleButton).disable(),t.populateSelectedAttributesMap(d,l),g.fetchNextAttribute(u[0],g.missingAttributeFetchNextAttributeAction)):(a.hide(g.missingAdditionalAttributesSection),b(g.confirmVehicleButton).enable())};this.attributeSelectionAction=function(a){var d=a.id.slice(43),c=t.findIndex(q,d);l.set(d,a.value);t.resetDropdownSelection(c+
1,q,l,"sts-vehicle-info-attribute-dropdown-native-");t.showDropdowns(c+1,q,"sts-vehicle-info-attribute-dropdown-");c!==q.length-1?(b(g.addVehicleSaveButton).disable(),g.fetchNextAttribute(q[c+1],g.newVehicleFetchNextAttributeAction)):g.fetchNextAttribute(null,g.newVehicleFetchNextAttributeAction)};this.missingAttributeSelectionAction=function(a){z=!0;var d=a.id.slice(62),c=t.findIndex(u,d);l.set(d,a.value);t.resetDropdownSelection(c+1,u,l,"sts-vehicle-info-missing-additional-attribute-dropdown-native-");
t.showDropdowns(c+1,u,"sts-vehicle-info-missing-additional-attribute-dropdown-");c!==u.length-1?(b(g.confirmVehicleButton).disable(),g.fetchNextAttribute(u[c+1],g.missingAttributeFetchNextAttributeAction)):g.fetchNextAttribute(null,g.missingAttributeFetchNextAttributeAction)};this.newVehicleFetchNextAttributeAction=function(d,e){if(e)if(w.has(e)&&d&&d.entity&&d.entity.nextAttribute&&0<d.entity.nextAttribute.length){var g=d.entity.nextAttribute.filter(function(a){return a.id===e});0===g.length||0===
g[0].options.length?(g=t.findIndex(q,e),t.hideDropdowns(g,q,"sts-vehicle-info-attribute-dropdown-"),f=d.entity.selectedEntityAttributes,b(h("#add-vehicle-save-button")).enable()):t.setOptionsAndEnable(c.getSelect("sts-vehicle-info-attribute-dropdown-native-"+g[0].id),g[0].options)}else d&&d.entity&&d.entity.nextAttribute&&0<d.entity.nextAttribute.length&&d.entity.nextAttribute[0].options&&0<d.entity.nextAttribute[0].options.length?t.setOptionsAndEnable(c.getSelect("sts-vehicle-info-attribute-dropdown-native-"+
d.entity.nextAttribute[0].id),d.entity.nextAttribute[0].options):(a.show(h("#vehicle-info-aapi-ajax-failure-alert")),n.publish(m.ATTRIBUTE_SELECTIONS_INVALID_RESPONSE));else d&&d.entity&&d.entity.selectedEntityAttributes?(f=d.entity.selectedEntityAttributes,b(h("#add-vehicle-save-button")).enable()):(a.show(h("#vehicle-info-aapi-ajax-failure-alert")),n.publish(m.ATTRIBUTE_SELECTIONS_INVALID_RESPONSE))};this.missingAttributeFetchNextAttributeAction=function(d,e){if(e)if(w.has(e)&&d&&d.entity&&d.entity.nextAttribute&&
0<d.entity.nextAttribute.length){var k=d.entity.nextAttribute.filter(function(a){return a.id===e});0===k[0].options.length&&w.has(k[0].id)?(k=t.findIndex(u,e),t.hideDropdowns(k,u,"sts-vehicle-info-missing-additional-attribute-dropdown-"),f=d.entity.selectedEntityAttributes,b(g.confirmVehicleButton).enable()):t.setOptionsAndEnable(c.getSelect("sts-vehicle-info-missing-additional-attribute-dropdown-native-"+k[0].id),k[0].options)}else a.show(h("#vehicle-info-aapi-ajax-failure-alert")),n.publish(m.ATTRIBUTE_SELECTIONS_INVALID_RESPONSE);
else d&&d.entity&&d.entity.selectedEntityAttributes?(f=d.entity.selectedEntityAttributes,b(g.confirmVehicleButton).enable()):(a.show(h("#vehicle-info-aapi-ajax-failure-alert")),n.publish(m.ATTRIBUTE_SELECTIONS_INVALID_RESPONSE))};this.getAapiAjaxNextAttributeUrl=function(){return d.ATTRIBUTE_SELECTIONS_PATH+t.getNextAttributeUrlParams(g.numberPlateActive?k.getNumberPlateAttributesMap():l)};this.fetchNextAttribute=function(b,c){a.show(g.vehicleInfoSpinner);return new Promise(function(e){h.ajax({url:g.getAapiAjaxNextAttributeUrl(),
type:"GET",headers:{"Accept-Language":"en-US",Accept:'application/vnd.com.amazon.api+json; type\x3d"taxonomies.garage.attributes-selections/v1"',"Content-Type":'application/vnd.com.amazon.api+json; type\x3d"taxonomies.garage.attributes-selections.request/v1"',"x-api-csrf-token":d.CSRF_TOKEN,"x-amzn-encrypted-slate-token":d.SLATE_TOKEN},xhrFields:{withCredentials:!0},timeout:d.TIMEOUT,success:function(d){c(d,b);a.hide(h("#vehicle-info-spinner"));e()},error:function(d){a.hide(h("#vehicle-info-spinner"));
a.show(h("#vehicle-info-aapi-ajax-failure-alert"));n.publish(m.ATTRIBUTE_SELECTIONS_FAILED)}})})};this.loadAndShowSelectVehicleView=function(){a.hide(g.aapiAjaxFailureAlert);a.hide(g.addVehicleSection);if(0===v.length)a.show(g.addVehicleButton);else{n.publish(m.TOTAL_NUMBER_OF_VEHICLES_IN_GARAGE,v.length);g.selectVehicleDropdownNative.getOptions().remove();for(var d=0;d<v.length;++d)g.selectVehicleDropdownNative.addOption({text:v[d].name,value:v[d].identity},d),"A1VC38T7YXB528"===e.get("marketplaceId")&&
t.checkAndPublishMetricsForAttribute(v[d].selections,"model_number");g.selectVehicleDropdownNative.addOption({html_content:'\x3chr class\x3d"a-spacing-mini a-spacing-top-micro a-divider-normal"\x3e\x3cspan class\x3d"add-vehicle-option-in-dropdown"\x3e+ '+e.get("addVehicleString")+"\x3c/span\x3e",value:"addVehicle"},v.length);g.selectVehicleDropdownNative.setValue(v[0].identity);a.show(g.selectVehicleDropdown);g.selectVehicleDropdownNative.update({status:"normal"});x=v[0];a.show(g.confirmVehicleButton);
g.manageMissingAdditionalAttributes(v[0])}};this.addVehicleSaveButtonClick=function(){n.publish(m.SAVE_VEHICLE_CLICK);b(g.addVehicleSaveButton).disable();a.show(g.vehicleInfoSpinner);var d=function(d){a.hide(h("#vehicle-info-spinner"));a.hide(h("#add-vehicle-section"));c.getSelect("select-vehicle-dropdown-native").update({status:"disable"});a.trigger("show-customer-saved-vehicles")};g.numberPlateActive?(e.get("isHsnTsnEnabled")?k.numberPlateSearchButtonClick().then(function(){g.fetchNextAttribute(null,
g.newVehicleFetchNextAttributeAction).then(function(){g.saveVehicle(d)})}):g.fetchNextAttribute(null,g.newVehicleFetchNextAttributeAction).then(function(){g.saveVehicle(d)}),n.publish(m.SAVE_VEHICLE_BY_NUMBER_PLATE)):(g.saveVehicle(d),n.publish(m.SAVE_VEHICLE_BY_ATTRIBUTES))};this.saveVehicle=function(b){h.ajax({url:d.GARAGE_VEHICLES_URL,type:"POST",headers:{"Accept-Language":"en-US",Accept:'application/vnd.com.amazon.api+json; type\x3d"customer.garage.vehicle/v1"',"Content-Type":'application/vnd.com.amazon.api+json; type\x3d"customer.garage.add-vehicle.request/v1"',
"x-api-csrf-token":d.CSRF_TOKEN,"x-amzn-encrypted-slate-token":d.SLATE_TOKEN},data:JSON.stringify({attributes:f}),xhrFields:{withCredentials:!0},timeout:d.TIMEOUT,success:b,error:function(d){a.hide(h("#vehicle-info-spinner"));a.show(h("#vehicle-info-aapi-ajax-failure-alert"));n.publish(m.SAVE_VEHICLE_CALL_FAILED)}})};this.updateVehicle=function(){b(g.confirmVehicleButton).disable();a.show(g.vehicleInfoSpinner);g.saveVehicle(function(d){d&&d.entity?(a.hide(h("#vehicle-info-spinner")),x=d.entity,g.confirmSelectedVehicle()):
a.show(h("#vehicle-info-aapi-ajax-failure-alert"))})};this.changeVehicleClick=function(d){n.publish(m.CHANGE_VEHICLE_CLICK);a.hide(h(".ship-to-store-modal-map-column"));a.trigger("update-modal-position");g.confirmedVehicle=!1;a.hide(g.confirmedVehicleSection);a.show(g.selectVehicleSection);a.hide(g.changeVehicleLink);a.hide(h("#ship-to-store-modal-tabs"));a.hide(h("#confirmed-service-section"));a.hide(h("#change-service-provider-link"));a.show(h("#select-vehicle-first"));a.hide(h("#zip-code-section"));
a.show(h("#choose-vehicle-info-text"));a.hide(h("#vehicle-info-text"));a.show(h("#service-provider-text"));a.hide(h("#choose-service-provider-text"));h(".ship-to-store-modal-content-column").addClass("ship-to-store-modal-content-column-min-height");h("#ship-to-store-modal-offer-action-buttons").addClass("ship-to-store-modal-offer-action-buttons-class");a.trigger("disable-include-service-button");a.trigger("show-customer-saved-vehicles")};this.confirmVehicleButtonClick=function(){g.confirmVehicleButton.hasClass("a-button-disabled")||
(g.timeWhenUserClicksConfirmVehicleButton=(new Date).getTime(),n.publish(m.CONFIRM_VEHICLE_CLICK),z?(n.publish(m.UPDATE_VEHICLE_REQUIRED),g.updateVehicle()):g.confirmSelectedVehicle())};this.confirmSelectedVehicle=function(){h(".ship-to-store-modal-content-column").removeClass("ship-to-store-modal-content-column-min-height");h("#ship-to-store-modal-offer-action-buttons").removeClass("ship-to-store-modal-offer-action-buttons-class");a.show(g.changeVehicleLink);a.hide(g.selectVehicleSection);g.confirmedVehicleSection.text(x.name);
a.show(g.confirmedVehicleSection);a.hide(h("#choose-vehicle-info-text"));a.show(h("#vehicle-info-text"));a.hide(h("#service-provider-text"));a.show(h("#choose-service-provider-text"));a.hide(h("#select-vehicle-first"));a.show(h("#zip-code-section"));a.show(h("#ship-to-store-modal-tabs"));g.confirmedVehicle=!0;a.trigger("renderMap")};this.isVehicleConfirmed=function(){return g.confirmedVehicle};this.setNumberPlateStatus=function(a){g.numberPlateActive=a};this.addVehicleCancelButtonClick=function(){n.publish(m.ADD_VEHICLE_CANCEL_CLICK);
g.loadAndShowSelectVehicleView()};this.init=function(){g.numberPlateActive=!1;g.confirmedVehicle=!1;g.selectVehicleDropdownNative=c.getSelect("select-vehicle-dropdown-native");g.addVehicleButton=h("#add-vehicle-button");g.vehicleInfoSpinner=h("#vehicle-info-spinner");g.selectVehicleDropdown=h("#select-vehicle-dropdown");g.addVehicleSection=h("#add-vehicle-section");g.addVehicleSaveButton=h("#add-vehicle-save-button");g.aapiAjaxFailureAlert=h("#vehicle-info-aapi-ajax-failure-alert");g.confirmVehicleButton=
h("#confirm-vehicle-button");g.changeVehicleLink=h("#change-vehicle-link");g.confirmedVehicleSection=h("#confirmed-vehicle-section");g.selectVehicleSection=h("#select-vehicle-section");g.missingAdditionalAttributesSection=h("#missing-additional-attributes-section");e.get("isNumberPlateEnabled")&&(g.numberPlateActive=!0)};a.on("a:dropdown:selected:select-vehicle-dropdown",this.selectVehicleDropdownAction);a.on("show-select-vehicle-dropdown",this.loadAndShowSelectVehicleView);a.on("show-customer-saved-vehicles",
this.showCustomerSavedVehicles);a.on("a:dropdown:selected:sts-vehicle-info-attribute-dropdown",this.attributeSelectionAction);a.on("set-number-plate-status",this.setNumberPlateStatus);a.on("initialize-vehicle-attribute-dropdowns",this.initializeVehicleAttributeDropdowns);a.on("a:dropdown:selected:sts-vehicle-info-missing-additional-attribute-dropdown",this.missingAttributeSelectionAction);a.declarative("change-vehicle-action","click",this.changeVehicleClick);h("body").delegate("#add-vehicle-button",
"click",this.addVehicleButtonClick);h("body").delegate("#add-vehicle-cancel-button","click",this.addVehicleCancelButtonClick);h("body").delegate("#add-vehicle-save-button","click",this.addVehicleSaveButtonClick);h("body").delegate("#confirm-vehicle-button","click",this.confirmVehicleButtonClick)}});"use strict";r.when("A","a-dropdown","ship-to-store-metric-publisher","ship-to-store").register("sts-vehicle-add-utils",function(a,c,b){function e(a){a.getOptions().remove();a.setValue("");a.update({status:"disabled"})}
function n(a){return c.getSelect(a)}function m(d,b,c){for(;d<b.length;d++)a.$("#"+c+b[d]).hide()}function g(d,b,c){for(;d<b.length;d++)a.$("#"+c+b[d]).show()}return{getDropdown:n,setOptionsAndEnable:function(a,b){for(var c=b.length-1;0<=c;--c)a.addOption({text:b[c].value,value:b[c].id});a.update({status:"normal"})},resetDropdown:e,getNextAttributeUrlParams:function(a){var b=[];a.forEach(function(a,d){b.push(btoa(encodeURIComponent(JSON.stringify({id:d,value:a})).replace(/%([0-9A-F]{2})/g,function(a,
d){return String.fromCharCode("0x"+d)})))});return"?selectedAttributes\x3d"+encodeURIComponent(b.join(","))},resetDropdownSelection:function(a,b,c,g){for(;a<b.length;a++)e(n(g+b[a])),c.delete(b[a])},findIndex:function(a,b){for(var c=0;c<a.length;c++)if(!a[c].localeCompare(b))return c;return-1},getVehicleFromId:function(a,b){for(var c=0;c<a.length;c++)if(String(a[c].identity)===String(b))return a[c];return{}},checkAndPublishMetricsForAttribute:function(d,c){var e=!1;a.each(d,function(a,b){a.id===c&&
(e=!0)});e?b.publish("sts_vehicle_attribute_"+c+"_found"):b.publish("sts_vehicle_attribute_"+c+"_not_found")},getMissingAdditionalAttr:function(a,b){var c=new Set(a.selections.map(function(a){return a.id}));return b.filter(function(a){return!c.has(a)})},populateSelectedAttributesMap:function(a,b){a=a.selections;for(var c=0;c<a.length;c++)b.set(a[c].id,a[c].value)},hideDropdowns:m,showDropdowns:g,showOnlyMissingAdditionalAttributeDropdowns:function(a,b,c){m(0,a,c);g(0,b,c)}}});"use strict";r.when("A",
"a-dropdown","a-button","ship-to-store-settings","ship-to-store-metric-publisher","ship-to-store-metric-names","ship-to-store-vas-metric-utils","sts-aapi-ajax-constants","sts-vehicle-add-utils","ship-to-store").register("number-plate-helper",function(a,c,b,e,n,m,g,d,t){var k=new Map;k.set("version","1");k.set("flow","vehicle-by-identifier");var h=e.get("isHsnTsnEnabled"),l=a.$;return new function y(){var e=this;p(this,y);this.numberPlateOptionClick=function(){n.publish(m.NUMBER_PLATE_RADIO_CLICK);
a.trigger("set-number-plate-status",!0);h?(l("#hsn-input").val(""),l("#tsn-input").val("")):(l("#number-plate-input").val(""),a.hide(l("#sts-vehicle-info-number-plate-dropdown")));b(l("#add-vehicle-save-button")).disable();a.show(l("#by-number-plate-section"));a.hide(l("#by-vehicle-attributes-section"));a.hide(l("#vehicle-info-aapi-ajax-failure-alert"));a.hide(l("#invalid-number-plate-alert"))};this.vehicleAttributeOptionClick=function(){n.publish(m.VEHICLE_ATTRIBUTES_RADIO_CLICK);a.trigger("set-number-plate-status",
!1);b(l("#add-vehicle-save-button")).disable();a.trigger("initialize-vehicle-attribute-dropdowns");a.show(l("#by-vehicle-attributes-section"));a.hide(l("#by-number-plate-section"));a.hide(l("#vehicle-info-aapi-ajax-failure-alert"));a.hide(l("#invalid-number-plate-alert"))};this.getEncryptedNumberPlate=function(a){return new Promise(function(b,c){l.ajax({url:"/automotive-components/vehicle-identifier?sif_profile\x3dAutomotiveUIComponentsVehicleIdentifierSIFProfile",type:"POST",contentType:"application/json",
data:JSON.stringify({automotiveVehicleIdentifier:a}),timeout:d.TIMEOUT,success:function(a){b(a.automotiveVehicleIdentifier)},error:function(a){c()}})})};this.numberPlateSearchButtonClick=function(){n.publish(m.NUMBER_PLATE_SEARCH_CLICK);a.show(l("#vehicle-info-spinner"));k.delete("vehicle-identifier");k.delete("vehicle-id");a.hide(l("#vehicle-info-aapi-ajax-failure-alert"));a.hide(l("#invalid-number-plate-alert"));var g=void 0;h?g=l("#hsn-input").val().trim().toUpperCase()+l("#tsn-input").val().trim().toUpperCase():
(g=l("#number-plate-input").val().trim().toUpperCase(),a.hide(l("#sts-vehicle-info-number-plate-dropdown")));return new Promise(function(p){e.getEncryptedNumberPlate(g).then(function(e){k.set("vehicle-identifier",e);l.ajax({url:d.ATTRIBUTE_SELECTIONS_PATH+t.getNextAttributeUrlParams(k),type:"GET",headers:{"Accept-Language":"en-US",Accept:'application/vnd.com.amazon.api+json; type\x3d"taxonomies.garage.attributes-selections/v1"',"Content-Type":'application/vnd.com.amazon.api+json; type\x3d"taxonomies.garage.attributes-selections.request/v1"',
"x-api-csrf-token":d.CSRF_TOKEN,"x-amzn-encrypted-slate-token":d.SLATE_TOKEN},xhrFields:{withCredentials:!0},timeout:d.TIMEOUT,success:function(d){if(d&&d.entity&&d.entity.nextAttribute&&0<d.entity.nextAttribute.length&&d.entity.nextAttribute[0].options&&0<d.entity.nextAttribute[0].options.length){if(h)k.set("vehicle-id",d.entity.nextAttribute[0].options[0].id),b(l("#add-vehicle-save-button")).enable();else{var e=c.getSelect("sts-vehicle-info-number-plate-dropdown-native");t.resetDropdown(e);t.setOptionsAndEnable(e,
d.entity.nextAttribute[0].options);a.show(l("#sts-vehicle-info-number-plate-dropdown"))}p()}else a.show(l("#invalid-number-plate-alert")),n.publish(m.INVALID_NUMBER_PLATE);a.hide(l("#vehicle-info-spinner"))},error:function(b){n.publish(m.VEHICLE_ATTRIBUTES_BY_VEHICLE_ID_FAILED);a.show(l("#vehicle-info-aapi-ajax-failure-alert"));a.hide(l("#vehicle-info-spinner"))}})}).catch(function(b){n.publish(m.NUMBER_PLATE_ENC_FAILED);a.show(l("#vehicle-info-aapi-ajax-failure-alert"))})})};this.vehicleSelectedFromDropdown=
function(a){k.set("vehicle-id",a.value);b(l("#add-vehicle-save-button")).enable()};this.getNumberPlateAttributesMap=function(){return k};this.numberPlateTextChange=function(){h?l("#hsn-input").val().trim()&&l("#tsn-input").val().trim()?b(l("#add-vehicle-save-button")).enable():b(l("#add-vehicle-save-button")).disable():l("#number-plate-input").val().trim()?b(l("#number-plate-search-button")).enable():b(l("#number-plate-search-button")).disable()};a.declarative("number-plate-radio-click","change",
this.numberPlateOptionClick);a.declarative("vehicle-attributes-radio-click","change",this.vehicleAttributeOptionClick);a.declarative("number-plate-input-action","keyup",this.numberPlateTextChange);l("body").delegate("#number-plate-search-button","click",this.numberPlateSearchButtonClick);a.on("a:dropdown:selected:sts-vehicle-info-number-plate-dropdown",this.vehicleSelectedFromDropdown)}});"use strict";B=function(){function a(a,b){for(var e=0;e<b.length;e++){var n=b[e];n.enumerable=n.enumerable||!1;
n.configurable=!0;"value"in n&&(n.writable=!0);Object.defineProperty(a,n.key,n)}}return function(c,b,e){b&&a(c.prototype,b);e&&a(c,e);return c}}();r.when("A","ship-to-store-settings","ship-to-store-item-association-helper","ship-to-store").register("sts-modal-utils",function(a,c,b){var e=a.$;return new (function(){function n(){var e=this;p(this,n);this.disableIncludeServiceButton=function(){e.tooltipCreated||(a.declarative.create(e.includeServiceButton,"a-tooltip",{content:c.get("acceptButtonTooltipText")}),
e.tooltipCreated=!0);e.includeServiceButton.addClass("a-button-disabled")};this.enableIncludeServiceButton=function(){a.declarative.remove(e.includeServiceButton,"a-tooltip");e.tooltipCreated=!1;e.includeServiceButton.removeClass("a-button-disabled")};this.getSaveVehicleDataFromMruVehicle=function(a){var d=[],n=[],k=a.name,h=c.get("isAdditionalAttributeInJpWeblabEnabled"),l=c.get("isDynamicPricingApplicable");if(h||l)for(var p=0;p<a.selections.length;p++)attribute=a.selections[p],e.mandatoryAttributeIdSet.has(attribute.id)?
d.push({attributeKey:attribute.id,attributeValue:attribute.label}):(l||h)&&e.additionalAttributeIdSet.has(attribute.id)&&n.push({attributeKey:attribute.id,attributeValue:attribute.label});else for(h=0;h<a.selections.length;h++)d.push({attributeKey:a.selections[h].id,attributeValue:a.selections[h].label});return{itemAssocId:b.generateUUID(),vehicleName:k,mandatoryAttributes:d,additionalAttributes:n}}}B(n,[{key:"init",value:function(){var b=this;c.get("isVehicleInformationEnabled")&&(this.tooltipCreated=
!0,this.includeServiceButton=e("#include-service-button"),a.declarative.create(this.includeServiceButton,"a-tooltip",{content:c.get("acceptButtonTooltipText")}),a.on("disable-include-service-button",this.disableIncludeServiceButton));if(c.get("isAdditionalAttributeInJpWeblabEnabled")||c.get("isDynamicPricingApplicable"))this.mandatoryAttributeIdSet=new Set(c.get("vehicleAttributesIds")||[]),this.additionalAttributeIdSet=new Set,(c.get("vehicleInfoAdditionalAttributeIds")||[]).forEach(function(a){return b.additionalAttributeIdSet.add(a)}),
(c.get("vehicleInfoOptionalAttributeIds")||[]).forEach(function(a){return b.additionalAttributeIdSet.add(a)})}}]);return n}())});"use strict";r.when("A","ship-to-store").register("add-to-cart-parameter-helper",function(a){function c(a,b,c){var g=document.createElement("input");g.type="hidden";g.id=a;g.name=a;g.value=b;g.className=c;return g}var b=a.$;return{createInputElement:c,getServiceFormParameters:function(a,b,c,g,d){a.push(["items["+d+".ShipToStore][asin]",b]);a.push(["items["+d+".ShipToStore][offerListingId]",
c]);a.push(["items["+d+".ShipToStore][quantity]",g])},getItemAssociationFormParameters:function(a,b,c,g){a.push(["items[0.base][additionalParameters][itemAssociation][associatedItemId]",""]);a.push(["items[0.base][additionalParameters][itemAssociation][deleteConstraint][mutuallyInclusive]",!0]);a.push(["items[0.base][additionalParameters][itemAssociation][id]",c]);a.push(["items[0.base][additionalParameters][itemAssociation][programType]","ShipToStore"]);a.push(["items[0.base][additionalParameters][itemAssociation][renderType]",
"nested"]);a.push(["items["+g+".ShipToStore][additionalParameters][itemAssociation][associatedItemId]",b]);a.push(["items["+g+".ShipToStore][additionalParameters][itemAssociation][deleteConstraint][mutuallyInclusive]",!0]);a.push(["items["+g+".ShipToStore][additionalParameters][itemAssociation][id]",c]);a.push(["items["+g+".ShipToStore][additionalParameters][itemAssociation][programType]","ShipToStore"]);a.push(["items["+g+".ShipToStore][additionalParameters][itemAssociation][renderType]","nested"])},
getStoreAddressFormParameters:function(a,b,c,g){a.push(["items[0.base][additionalParameters][storeAddress]","/api/marketplaces/"+b+"/customer/addresses/"+c]);a.push(["items["+g+".ShipToStore][additionalParameters][storeAddress]","/api/marketplaces/"+b+"/customer/addresses/"+c])},addParametersToWebForm:function(a,b){b.forEach(function(b){a.append(c(b[0],b[1],"stsAtcFormServiceData"))})},removeParametersFromWebForm:function(){b(".stsAtcFormServiceData").remove()},addParametersToMobileAppEvent:function(a,
b){a.forEach(function(a){b.data.inputs[a[0]]=a[1]})},getServiceIndexForMobileAppEvent:function(a){return Object.keys(a.data.inputs).filter(function(a){return 6<a.length&&"[asin]"===a.substring(a.length-6)}).length},getMobileAppDeclarativeActionName:function(){var b=a.$("#atc-declarative");return b?b.data("action"):null},shouldUseNatcDesktop:function(){var b=a.$("body");return(b=a.parseJSON(b.find("[data-a-state*\x3datc-page-state]").html()))&&b.shouldUseNatc?b.shouldUseNatc:!1},shouldUseNatcMobileWeb:function(){var b=
a.$("body");return(b=a.parseJSON(b.find("[data-a-state*\x3datc-page-state]").html()))&&b.shouldUseNatc?b.shouldUseNatc:!1},shouldUseNatcMobileApp:function(){var b=a.$("#atc-declarative");if(!b)return!1;var c=this.getMobileAppDeclarativeActionName();return(b=b.data(c))&&b.shouldUseNATCMobileApp?b.shouldUseNATCMobileApp:!1}}});"use strict";"use strict";r.register("ship-to-store-service-options-constants",function(){return{SUB_HEADER:{DEFAULT_SUB_HEADER:"#shipToStore-service-options-expander-default-sub-header-",
SERVICE_OPTED_SUB_HEADER:"#shipToStore-service-options-expander-service-opted-sub-header-",SERVICE_AND_STORE_OPTED_SUB_HEADER:"#shipToStore-service-options-expander-service-and-store-opted-sub-header-",STORE_TITLE_SUB_HEADER:"#store-title-sub-header-",STORE_OPT_PROMPT_SUB_HEADER:"#store-opt-prompt-sub-header-",SERVICE_OPTED_SUB_HEADER_PLACE_HOLDER:"#service-opted-sub-header-placeHolder-",SERVICE_AND_STORE_OPTED_SUB_HEADER_PLACE_HOLDER:"#service-and-store-opted-sub-header-placeHolder-",STORE_TITLE_SUB_HEADER_PLACE_HOLDER:"#store-title-sub-header-placeHolder-"},
SWATCH:{DEFAULT_SERVICE_OPTIONS_SWATCH:"#shipToStore-service-options-default-swatch-",SERVICE_OPTIONS_SWATCH_HEADER:"#shipToStore-service-options-swatch-header-",SERVICE_OPTIONS_SWATCH_CONTENT:"#shipToStore-service-options-swatch-content-",SERVICE_OPTIONS_SWATCH_STORE_TITLE:"#shipToStore-service-options-swatch-store-title-",SERVICE_OPTIONS_SWATCH_STORE_ADDRESS:"#shipToStore-service-options-swatch-store-address-",SERVICE_OPTIONS_SWATCH_SCOPE_OF_WORK:"#shipToStore-service-options-swatch-scope-of-work-",
SERVICE_OPTIONS_SWATCH_SCOPE_OF_WORK_BULLET_POINT:"#shipToStore-service-options-swatch-scope-of-work-bullet-point-",SERVICE_OPTIONS_SWATCH_STORE_INFO:"#shipToStore-service-options-swatch-store-info-",SERVICE_OPTIONS_SWATCH_STORE_PRICE:"#shipToStore-service-options-swatch-store-price-",SERVICE_OPTIONS_SWATCH_DEFAULT_PRICE:"#shipToStore-service-options-swatch-default-price-",SERVICE_OPTIONS_SWATCH_HEADER_TEXT:"#shipToStore-service-options-swatch-header-text-",SERVICE_OPTIONS_SWATCH_SERVICE_UNAVAILABLE:"#shipToStore-service-options-swatch-service-unavailable-"},
SWATCH_CSS:{SELECTED_SERVICE_OPTION_DEFAULT_SWATCH_CSS:"selected-shipToStore-service-options-default-swatch",SELECTED_SERVICE_OPTIONS_SWATCH_HEADER_CSS:"selected-shipToStore-service-options-swatch-header",SELECTED_SERVICE_OPTIONS_SWATCH_CONTENT_CSS:"selected-shipToStore-service-options-swatch-content",SERVICE_OPTION_DEFAULT_SWATCH_CSS:"shipToStore-service-options-default-swatch",SERVICE_OPTIONS_SWATCH_HEADER_CSS:"shipToStore-service-options-swatch-header",SERVICE_OPTIONS_SWATCH_CONTENT_CSS:"shipToStore-service-options-swatch-content"},
SERVICE_OPTIONS:{EXPANDER_HEADER:"#shipToStore-service-options-expander-header-",EXPANDER_CONTENT:"#shipToStore-service-options-expander-content-",EXPANDER_CONTENT_EXPANDED:"a-expander-content-expanded",DEFAULT_CARD:"#shipToStore-service-options-default-card-",CARD:"#shipToStore-service-options-card-",MODAL_TRIGGER:"#shipToStore-service-location-selector-modal-trigger-",LOCATION_SELECTOR:"#shipToStore-service-location-selector-",BUY_NOW_FEATURE_DIV:"[id\x3dbuyNow],[id\x3dbuyNow_feature_div]",ONE_CLICK_CONTAINER:"[id^\x3doneClickAvailable]"},
ACTIONS:{CLICK:"click",SERVICE_LOCATION_SELECTED:"ship-to-store:offer-accepted",SERVICE_DECLINED:"ship-to-store:offer-declined",MODAL_READY:"ship-to-store:modal:ready",MODAL_SHOW:"ship-to-store:modal:show",QUANTITY_CHANGED:"ship-to-store:quantity-changed",PREGENERATE_OFFERS:"ship-to-store-pregenerate-offers",GXA_RESPONSE_SUCCESS_EVENT:"GXA_RESPONSE_SUCCESS",SWITCH_BUYING_OPTION_EVENT:"SWITCH_BUYING_OPTION",COLLAPSE_CARD_EVENT:"COLLAPSE_CARD"},COMMON:{TWISTER_PLUS_INGRESS:"twisterPlusIngress",ASIN:"asin",
PRODUCT_ASIN:"productAsin",PRICE_PER_UNIT_MAP:"pricePerUnitMap",BUYING_OPTION_INDEX:"buyingOptionIndex",SUB_HEADER_KEY_PREFIX:"subHeader_",EXPERIENCES_KEY_PREFIX:"experiences_",ITEM_ASSOC_TYPE:"ShipToStore",NESTED_RENDER_TYPE:"nested",ADD_SELECTION_TYPE:"add",AOK_HIDDEN:"aok-hidden",BODY:"body",EMPTY_STRING:"",SERVICE_OPTIONS_ICON_CLASS:" .a-icon",DATA_EXPANDED_STATE:"data-expanded",DATA_EXPANDED_STATE_VALUE_TRUE:"true",DATA_EXPANDED_STATE_VALUE_FALSE:"false",STYLE:"style",CARD_SHOWN_STYLE:"overflow: hidden;",
CARD_HIDDEN_STYLE:"overflow: hidden; display: none;",COLLAPSE_HEADING_ICON:"a-icon-section-collapse",EXPAND_HEADING_ICON:"a-icon-section-expand",STS_USER_EXPERIENCE_TYPE:"SHIP_TO_STORE"}}});"use strict";r.when("A","ship-to-store-settings","ship-to-store-service-options-constants","ship-to-store").register("ship-to-store-service-options-expander-sub-header-utils",function(a,c,b){var e=a.$;return new function m(){var a=this;p(this,m);this.init=function(){var d=c.get(b.COMMON.BUYING_OPTION_INDEX);a.$defaultSubHeader=
e(b.SUB_HEADER.DEFAULT_SUB_HEADER+d);a.$serviceOptedSubHeader=e(b.SUB_HEADER.SERVICE_OPTED_SUB_HEADER+d);a.$serviceAndStoreOptedSubHeader=e(b.SUB_HEADER.SERVICE_AND_STORE_OPTED_SUB_HEADER+d);a.$serviceOptedSubHeaderPlaceHolder=e(b.SUB_HEADER.SERVICE_OPTED_SUB_HEADER_PLACE_HOLDER+d);a.$serviceAndStoreOptedSubHeaderPlaceHolder=e(b.SUB_HEADER.SERVICE_AND_STORE_OPTED_SUB_HEADER_PLACE_HOLDER+d);a.$storeTitleSubHeaderPlaceHolder=e(b.SUB_HEADER.STORE_TITLE_SUB_HEADER_PLACE_HOLDER+d);a.$storeTitleSubHeader=
e(b.SUB_HEADER.STORE_TITLE_SUB_HEADER+d);a.$storeOptPromptSubHeader=e(b.SUB_HEADER.STORE_OPT_PROMPT_SUB_HEADER+d)};this.expandSubHeader=function(){a.$storeTitleSubHeader.removeClass(b.COMMON.AOK_HIDDEN);a.$storeOptPromptSubHeader.removeClass(b.COMMON.AOK_HIDDEN)};this.collapseSubHeader=function(){a.$storeTitleSubHeader.addClass(b.COMMON.AOK_HIDDEN);a.$storeOptPromptSubHeader.addClass(b.COMMON.AOK_HIDDEN)};this.showDefaultSubHeader=function(){a.$defaultSubHeader.removeClass(b.COMMON.AOK_HIDDEN);a.$serviceOptedSubHeader.addClass(b.COMMON.AOK_HIDDEN);
a.$serviceAndStoreOptedSubHeader.addClass(b.COMMON.AOK_HIDDEN)};this.showServiceOptedSubHeader=function(d){a.updateServiceOptedSubheader(d);a.$defaultSubHeader.addClass(b.COMMON.AOK_HIDDEN);a.$serviceOptedSubHeader.removeClass(b.COMMON.AOK_HIDDEN);a.$serviceAndStoreOptedSubHeader.addClass(b.COMMON.AOK_HIDDEN)};this.showServiceAndStoreOptedSubHeader=function(d,c){a.updateServiceAndStoreOptedSubheader(d,c);a.$defaultSubHeader.addClass(b.COMMON.AOK_HIDDEN);a.$serviceOptedSubHeader.addClass(b.COMMON.AOK_HIDDEN);
a.$serviceAndStoreOptedSubHeader.removeClass(b.COMMON.AOK_HIDDEN)};this.updateDefaultSubheader=function(b){a.$defaultSubHeader.html(b)};this.updateServiceOptedSubheader=function(b){a.$serviceOptedSubHeaderPlaceHolder.text(b)};this.updateServiceAndStoreOptedSubheader=function(b,c){a.$serviceAndStoreOptedSubHeaderPlaceHolder.text(b);a.$storeTitleSubHeaderPlaceHolder.text(c)}}});"use strict";r.when("A","ship-to-store-settings","ship-to-store-service-options-constants","ship-to-store").register("ship-to-store-service-options-swatch-utils",
function(a,c,b){var e=a.$;return new function m(){var a=this;p(this,m);this.init=function(){var d=c.get(b.COMMON.BUYING_OPTION_INDEX);a.$defaultServiceOptionSwatch=e(b.SWATCH.DEFAULT_SERVICE_OPTIONS_SWATCH+d);a.$serviceOptionsSwatchHeader=e(b.SWATCH.SERVICE_OPTIONS_SWATCH_HEADER+d);a.$serviceOptionsSwatchContent=e(b.SWATCH.SERVICE_OPTIONS_SWATCH_CONTENT+d);a.$serviceOptionsSwatchStoreTitle=e(b.SWATCH.SERVICE_OPTIONS_SWATCH_STORE_TITLE+d);a.$serviceOptionsSwatchStoreAddress=e(b.SWATCH.SERVICE_OPTIONS_SWATCH_STORE_ADDRESS+
d);a.$serviceOptionsSwatchScopeOfWork=e(b.SWATCH.SERVICE_OPTIONS_SWATCH_SCOPE_OF_WORK+d);a.$serviceOptionsSwatchScopeOfWorkBulletPoint=e(b.SWATCH.SERVICE_OPTIONS_SWATCH_SCOPE_OF_WORK_BULLET_POINT+d);a.$serviceOptionsSwatchStoreInfo=e(b.SWATCH.SERVICE_OPTIONS_SWATCH_STORE_INFO+d);a.$serviceOptionsSwatchStorePrice=e(b.SWATCH.SERVICE_OPTIONS_SWATCH_STORE_PRICE+d);a.$serviceOptionsSwatchDefaultPrice=e(b.SWATCH.SERVICE_OPTIONS_SWATCH_DEFAULT_PRICE+d);a.$serviceOptionsSwatchHeaderText=e(b.SWATCH.SERVICE_OPTIONS_SWATCH_HEADER_TEXT+
d);a.$serviceoptionsSwatchServiceUnavailable=e(b.SWATCH.SERVICE_OPTIONS_SWATCH_SERVICE_UNAVAILABLE+d)};this.selectDefaultSwatch=function(){a.$defaultServiceOptionSwatch.addClass(b.SWATCH_CSS.SELECTED_SERVICE_OPTION_DEFAULT_SWATCH_CSS).removeClass(b.SWATCH_CSS.SERVICE_OPTION_DEFAULT_SWATCH_CSS);a.$serviceOptionsSwatchHeader.addClass(b.SWATCH_CSS.SERVICE_OPTIONS_SWATCH_HEADER_CSS).removeClass(b.SWATCH_CSS.SELECTED_SERVICE_OPTIONS_SWATCH_HEADER_CSS);a.$serviceOptionsSwatchContent.addClass(b.SWATCH_CSS.SERVICE_OPTIONS_SWATCH_CONTENT_CSS).removeClass(b.SWATCH_CSS.SELECTED_SERVICE_OPTIONS_SWATCH_CONTENT_CSS)};
this.selectServiceOptionSwatch=function(){a.$defaultServiceOptionSwatch.addClass(b.SWATCH_CSS.SERVICE_OPTION_DEFAULT_SWATCH_CSS).removeClass(b.SWATCH_CSS.SELECTED_SERVICE_OPTION_DEFAULT_SWATCH_CSS);a.$serviceOptionsSwatchHeader.addClass(b.SWATCH_CSS.SELECTED_SERVICE_OPTIONS_SWATCH_HEADER_CSS).removeClass(b.SWATCH_CSS.SERVICE_OPTIONS_SWATCH_HEADER_CSS);a.$serviceOptionsSwatchContent.addClass(b.SWATCH_CSS.SELECTED_SERVICE_OPTIONS_SWATCH_CONTENT_CSS).removeClass(b.SWATCH_CSS.SERVICE_OPTIONS_SWATCH_CONTENT_CSS)};
this.showSwatchWithServiceInfo=function(){a.showDefaultContent()};this.showSwatchWithStoreInfo=function(b,c,e){a.$serviceOptionsSwatchStoreTitle.text(b);a.$serviceOptionsSwatchStoreAddress.text(c);a.$serviceOptionsSwatchStorePrice.html(e);a.showStoreInfoContent()};this.updateSwatchWithServiceInfo=function(b,c){a.$serviceOptionsSwatchHeaderText.html(b.title);a.$serviceOptionsSwatchDefaultPrice.html(b.subtitle);a.$serviceOptionsSwatchScopeOfWorkBulletPoint.html(b.scopeOfWorkSummary);c?a.showStoreInfoContent():
a.showDefaultContent()};this.showSwatchWithServiceUnavailable=function(b){a.$serviceoptionsSwatchServiceUnavailable.text(b);a.showServiceUnavailableContent()};this.showDefaultContent=function(){a.$serviceOptionsSwatchDefaultPrice.removeClass(b.COMMON.AOK_HIDDEN);a.$serviceOptionsSwatchStorePrice.addClass(b.COMMON.AOK_HIDDEN);a.$serviceOptionsSwatchScopeOfWork.removeClass(b.COMMON.AOK_HIDDEN);a.$serviceOptionsSwatchStoreInfo.addClass(b.COMMON.AOK_HIDDEN);a.$serviceoptionsSwatchServiceUnavailable.addClass(b.COMMON.AOK_HIDDEN)};
this.showStoreInfoContent=function(){a.$serviceOptionsSwatchDefaultPrice.addClass(b.COMMON.AOK_HIDDEN);a.$serviceOptionsSwatchStorePrice.removeClass(b.COMMON.AOK_HIDDEN);a.$serviceOptionsSwatchScopeOfWork.addClass(b.COMMON.AOK_HIDDEN);a.$serviceOptionsSwatchStoreInfo.removeClass(b.COMMON.AOK_HIDDEN);a.$serviceoptionsSwatchServiceUnavailable.addClass(b.COMMON.AOK_HIDDEN)};this.showServiceUnavailableContent=function(){a.$serviceOptionsSwatchDefaultPrice.addClass(b.COMMON.AOK_HIDDEN);a.$serviceOptionsSwatchStorePrice.addClass(b.COMMON.AOK_HIDDEN);
a.$serviceOptionsSwatchScopeOfWork.addClass(b.COMMON.AOK_HIDDEN);a.$serviceOptionsSwatchStoreInfo.addClass(b.COMMON.AOK_HIDDEN);a.$serviceoptionsSwatchServiceUnavailable.removeClass(b.COMMON.AOK_HIDDEN)}}});"use strict";r.when("A","ship-to-store-settings","ship-to-store-service-options-constants","ship-to-store").register("ship-to-store-service-options-card-toggle-utils",function(a,c,b){var e=a.$;return new function m(){var a=this;p(this,m);this.init=function(){var d=c.get(b.COMMON.BUYING_OPTION_INDEX);
a.$serviceOptionsExpanderHeaderIcon=e(b.SERVICE_OPTIONS.EXPANDER_HEADER+d+b.COMMON.SERVICE_OPTIONS_ICON_CLASS).first();a.$serviceOptionsExpanderContent=e(b.SERVICE_OPTIONS.EXPANDER_CONTENT+d)};this.expandCard=function(){a.$serviceOptionsExpanderContent.addClass(b.SERVICE_OPTIONS.EXPANDER_CONTENT_EXPANDED).attr(b.COMMON.DATA_EXPANDED_STATE,b.COMMON.DATA_EXPANDED_STATE_VALUE_TRUE).attr(b.COMMON.STYLE,b.COMMON.CARD_SHOWN_STYLE);a.$serviceOptionsExpanderHeaderIcon.addClass(b.COMMON.COLLAPSE_HEADING_ICON).removeClass(b.COMMON.EXPAND_HEADING_ICON)};
this.collapseCard=function(){a.$serviceOptionsExpanderContent.removeClass(b.SERVICE_OPTIONS.EXPANDER_CONTENT_EXPANDED).attr(b.COMMON.DATA_EXPANDED_STATE,b.COMMON.DATA_EXPANDED_STATE_VALUE_FALSE).attr(b.COMMON.STYLE,b.COMMON.CARD_HIDDEN_STYLE);a.$serviceOptionsExpanderHeaderIcon.removeClass(b.COMMON.COLLAPSE_HEADING_ICON).addClass(b.COMMON.EXPAND_HEADING_ICON)}}});"use strict";r.when("A","service-options-registration","service-options-device-specific-constants","ship-to-store-service-options-constants",
"ship-to-store-service-options-item-utils","ship-to-store").register("ship-to-store-service-options-add-to-cart-utils",function(a,c,b,e,n){return new function g(){p(this,g);this.removeSTSServiceItemFromCart=function(){return c.ccSelectionsClear(b.FEATURE_NAME)};this.addSTSServiceItemToCart=function(a,g){a=n.createItemData(a,g,e.COMMON.ADD_SELECTION_TYPE);return c.selectionUpdate(b.FEATURE_NAME,a)}}});"use strict";B=function(){function a(a,b){for(var e=0;e<b.length;e++){var n=b[e];n.enumerable=n.enumerable||
!1;n.configurable=!0;"value"in n&&(n.writable=!0);Object.defineProperty(a,n.key,n)}}return function(c,b,e){b&&a(c.prototype,b);e&&a(c,e);return c}}();r.when("A","ship-to-store-settings","ship-to-store-service-options-constants","service-options-device-specific-constants","ship-to-store-service-options-item-association-utils","ship-to-store").register("ship-to-store-service-options-item-utils",function(a,c,b,e,n){var m=a.$;return new (function(){function a(){var d=this;p(this,a);this.createItemData=
function(a,e,g){g={itemType:b.COMMON.ASIN,asin:a.asin,offerListingId:a.offerListingId,quantity:1,price:Number(a.servicePrice),selectionType:g,enableIA:e};e&&(g.IAData=n.getIAData());c.get("isPassingStoreAddressEnabled")&&(g.formData=d.getStoreAddressFormData(a));return g};this.getStoreAddressFormData=function(a){var b=d.getATCForm();return[{inputType:"hidden",inputName:"items["+d.getProductIndex(b)+".base][additionalParameters][storeAddress]",inputId:"items["+d.getProductIndex(b)+".base][additionalParameters][storeAddress]",
inputValue:d.getStoreAddress(c.get("marketplaceId"),a.addressForStore.legacyAddressId)},{inputType:"hidden",inputName:"items["+d.getAssociatedItemIndex(b)+"."+e.FEATURE_NAME+"][additionalParameters][storeAddress]",inputId:"items["+d.getAssociatedItemIndex(b)+"."+e.FEATURE_NAME+"][additionalParameters][storeAddress]",inputValue:d.getStoreAddress(c.get("marketplaceId"),a.addressForStore.legacyAddressId)}]};this.getATCForm=function(){var a=m("#buyBoxAccordion");return a&&1===a.length?(a=c.get(b.COMMON.BUYING_OPTION_INDEX),
m("#newAccordionRow_"+a+" #addToCart")):m("#addToCart")}}B(a,[{key:"getStoreAddress",value:function(a,b){return"/api/marketplaces/"+a+"/customer/addresses/"+b}},{key:"getProductIndex",value:function(a){return(a=a.find('input[name$\x3d".base][asin]"]').length)?a-1:0}},{key:"getAssociatedItemIndex",value:function(a){return(a=a.find('input[name$\x3d".'+e.FEATURE_NAME+'][asin]"]').length)?a-1:0}}]);return a}())});"use strict";r.when("A","ship-to-store-settings","ship-to-store-offer-helper","ship-to-store-service-options-constants",
"ship-to-store").register("ship-to-store-service-options-item-association-utils",function(a,c,b,e){return new function m(){p(this,m);this.getIAData=function(){return{parentAsin:c.get(e.COMMON.PRODUCT_ASIN),type:e.COMMON.ITEM_ASSOC_TYPE,renderType:e.COMMON.NESTED_RENDER_TYPE,constraintList:[{type:"DELETE",mutuallyInclusive:!0}]}};this.withItemAssociation=function(){var a=b.getAccepterOfferTypeName().toLowerCase();return"mobile"!==a&&"at_home"!==a}}})});
/* ******** */
(function(u){var x=window.AmazonUIPageJS||window.P,z=x._namespace||x.attributeErrors,M=z?z("DetailPageMiraiAssets@discover","DetailPageMiraiAssets"):x;M.guardFatal?M.guardFatal(u)(M,window):M.execute(function(){u(M,window)})})(function(u,x,z){function M(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,d,e,f){function m(){a(x).scroll();c.trigger("a:image:lazyLoad")}function h(p,g,c,r,e){if(b.IS_MOBILE){if(!g)return}else if(0>=p.find(".shopbylook-btf-item-ratings-row").length&&!g)return;for(var W=b.IS_MOBILE?"a-star-mini-":"a-star-",f=0;5>=f;f++)g.removeClass(W+f).removeClass(W+f+"-5");!c||c<d.RATINGS_HALF_STAR_THRESHOLD||1>r?(p.find(".sbl-item-rating").addClass("aok-hidden"),p.find(".sbl-review-count").first().text("")):(r=Math.floor(c),g.addClass(W+r+(c-r>=d.RATINGS_HALF_STAR_THRESHOLD?
"-5":"")),p.find(".sbl-review-count").first().text(e),a(p.find(".sbl-item-rating").find("span")).first().text(c),p.find(".sbl-item-rating").removeClass("aok-hidden"))}function C(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 r=g.statusBadgeSource;g=g.offerLevelWithDealBadge;if(!c.objectIsEmpty(r)||!c.objectIsEmpty(g)){if(b&&!c.objectIsEmpty(g)&&g.dealBadgeEnable){var d=b.find(".sbl-deal-badge-label"),
e=b.find(".sbl-deal-badge-message");e.addClass("aok-hidden");d.attr("style","color:"+g.badgeStringColor+"; background-color:"+g.badgeBackgroundColor+";");d.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(r)||c.objectIsEmpty(a)||
(b=a.find(".sbl-status-badge"),b.removeClass(),b.addClass("sbl-status-badge"),b.addClass("sbl-"+r.badgeStyle),b.find(".sbl-badge-text").first().text(r.badgeString),a.removeClass("aok-hidden"))}}}function S(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 r=b.eu2021Standard,d=b.mobileDeviceType,e=r?a.find(".sbl-eel-2021"):a.find(".sbl-eel-pre2021"),f=r?a.find(".sbl-eel-pre2021"):a.find(".sbl-eel-2021"),h=e.find("span.a-declarative").first(),k=e.find(".a-popover-preload").first(),n=d?JSON.parse(h.attr("data-a-secondary-view")):JSON.parse(h.attr("data-a-modal"));n.name="energyEfficiencyImagePreload_"+g.asin;k.prop("id","a-popover-energyEfficiencyImagePreload_"+g.asin);k.attr("id","a-popover-energyEfficiencyImagePreload_"+
g.asin);d?h.attr("data-a-secondary-view",JSON.stringify(n)):h.attr("data-a-modal",JSON.stringify(n));h=e.find("span.a-declarative").last();k=e.find(".a-popover-preload").last();n=d?JSON.parse(h.attr("data-a-secondary-view")):JSON.parse(h.attr("data-a-modal"));n.name="productDataSheetImagesPreload_"+g.asin;k.prop("id","a-popover-productDataSheetImagesPreload_"+g.asin);k.attr("id","a-popover-productDataSheetImagesPreload_"+g.asin);d?h.attr("data-a-secondary-view",JSON.stringify(n)):h.attr("data-a-modal",
JSON.stringify(n));g=e.find("svg.badge-shape");g.find("path.badgeColor").attr("fill",b.hexColor);g.find("text.badgeLetter").text(b.ratingLetter);r||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);f.addClass("aok-hidden");e.removeClass("aok-hidden");a.removeClass("aok-hidden")}}}function ha(a,b){a.attr("src",d.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)}function M(b,g,d){c.objectIsEmpty(g)||g.remove();g=d.deliveryMessage;c.objectIsEmpty(g)||(g=a(g),g.find(".udm-badge-block").remove(),b.after(g))}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?d.MAX_NUMBER_OF_ITEMS_MOBILE:d.INTIAL_NUMBER_OF_ITEMS_DESKTOP},triggerLazyLoad:function(){c.delay(m,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]!==z?arguments[1]:!1,d=2<arguments.length&&arguments[2]!==z?arguments[2]:null;c.animate(a,{width:"0",margin:"0",opacity:"0","border-radius":"0"},350,"ease-out",function(){a.remove();b&&d&&d()})},startLoading:function(a){a.find("#shopbylook-btf-loading-section").show()},stopLoading:function(a){a.find("#shopbylook-btf-loading-section").hide();m()},updateReviewStars:h,updateTruncate:function(b){b.find(".a-truncate").each(function(){e.get(a(this)).update()})},
updateImageAttributes:ha,updatePriceAttributes:u,updateEnergyLabel:S,updateDeliveryMessage:M,replacingSrcImage:function(a,b,c){var d=b.find(".shopbylook-btf-image-container").get(0).querySelector(".shopbylook-btf-image-elem");d&&(d.src=a);a=b.find(".shopbylook-image-section-middle-dot");a.removeClass("selected");a.eq(c).addClass("selected")},getSearchQuery:function(){var a=1<x.location.search.length?x.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<x.location.search.length?x.location.search.substring(1):"";if(0===a.length)a={};else{for(var b,c=/\+/g,d={},e=/([^&=]+)=?([^&]*)/g;b=e.exec(a);)d[decodeURIComponent(b[1]).replace(c," ")]=decodeURIComponent(b[2]).replace(c," ");a=d}return a.hasOwnProperty("refinements")?a.refinements:""},addNewRow:function(b,c,e,r,ga,h,m,T){e=b.index()+e-b.index()%e-
1;c=a(c.get(e));h=Math.min(h,m.length);for(r=e=0;r<h;r++)if(m[r].asin){f.updateNextHeartStrings(b);var k=b.clone();k.css({height:0,opacity:0});T(k,m[r],!1)&&(e++,k.insertAfter(c),k.animate({height:ga,opacity:1},d.NEW_ITEM_ANIMATION_TIME,function(){a(this).height("auto")}))}b.offset().top-x.pageYOffset>ga&&0<e&&a("html, body").animate({scrollTop:x.pageYOffset+b.outerHeight()},350)},fillGap:function(a,b,c,d,e){b=b.last();var f=0,h=0;for(f;f<Math.min(c,d.length);f++)if(d[f].asin){var m=a.clone();e(m,
d[f],!1)&&(m.insertAfter(b),h++)}return h},addRowsToEnd:function(b,c,e,r,f,h,m,S){r=Math.min(r,e.length);var k=r-(0===r%2?2:1);S=S&&2<r;for(var n=!1,u=0,z=0;z<r;z++){var C=b.clone();if(n=h(C,e[z],!1))u++,C.css({height:0,opacity:0}),c.append(C),S&&z>=k?(C.animate({height:f,opacity:1},d.NEW_ITEM_ANIMATION_TIME,function(){a(this).css({height:"50px"})}),n=C.find(".sbl-shadow-preview-fading"),n.removeClass("hit-sbl-shadow-preview-fading-override"),n.removeClass("aok-hidden"),C=a(x).width(),n.css("width",
C/2.3+"px")):C.animate({height:f,opacity:1},d.NEW_ITEM_ANIMATION_TIME,function(){a(this).height("auto")})}0<u&&(c=a(x).scrollTop(),b=b.offset().top+f*m-(c+a(x).height()),0<b&&a("html, body").animate({scrollTop:c+b},350))},getRefinementReadableName:function(b,c,e,r,f){return"review"===e?c.refinementStarsAndUp.replace("${count}",r):"price"===e||0<b.find(".sbl-colorsprite").length?b.closest(d.REFINEMENT_SELECTOR_PREFIX+f).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(d.REFINEMENT_SELECTOR_PREFIX+f).text():a(".sbl_refinement_"+e+"_title").first().text()+": "+b.closest(d.REFINEMENT_SELECTOR_PREFIX+f).text():""},redesignBoxSwap:function(p,g,m,r,ga,W,x){var T=7<arguments.length&&arguments[7]!==z?arguments[7]:!1;r&&p.toggleClass(d.SBL_FLIP_BOX_CLASS);p.prop("id",d.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);var k=p.data("smlt-product-string-template");k&&p.find("input").attr("aria-label",k.replace("${product}",g.title));ha(p.find(".shopbylook-btf-image-elem"),g);var n=m(g.asin);p.find(".sbl-item-top").children("a").attr("href",n);k=p.find(".sbl-product-title-wrapper");p.hasClass("hit-sbl-softline-update")&&!c.objectIsEmpty(k)&&(c.objectIsEmpty(k)||c.objectIsEmpty(g)||0===k.find(".a-truncate").size()||(k.addClass("aok-hidden"),k.find(".sbl-product-title-url").closest("a").attr("href",
n),n=g.shortTitle,c.objectIsEmpty(n)||(k.find(".sbl-product-title-hover").attr("title",n),k.find(".a-truncate").find(".a-truncate-full").first().text(n),e.get(k.find(".a-truncate")).update(),k.removeClass("aok-hidden"))));k=p.find(".sbl-item-brand");p.hasClass("hit-sbl-softline-update")&&!c.objectIsEmpty(k)&&(c.objectIsEmpty(k)||c.objectIsEmpty(g)||(k.addClass("aok-hidden"),n=g.productBrandSource,c.objectIsEmpty(n)||(k.find(".a-text-bold").text(n),k.removeClass("aok-hidden"))));k=p.find(".lists-framework-action-button");
f.updateHeartWishList(k,g);u(p.find(".sbl-item-price").first(),g);h(p,p.find(".shopbylook-btf-item-ratings").first(),g.rating,g.ratingCount,g.ratingCountStr);C(p.find(".sbl-status-badge-wrapper"),g,null);C(null,g,p.find(".sbl-offer-level-badge-wrapper-with-dealBadge"));k=p.find(".sbl-item-delivery");n=p.find(".udm-delivery-block");!c.objectIsEmpty(k)&&T&&M(k,n,g);if(x){var I=p.find(".shopbylook-image-gallery-override");if(!c.objectIsEmpty(I)&&!c.objectIsEmpty(g)&&(I.find(".shopbylook-carousel-arrow-container").addClass("aok-hidden"),
I.find(".shopbylook-image-section-middle-dot").removeClass("selected"),I.find(".shopbylook-carousel-pagination span:first-child .shopbylook-image-section-middle-dot").addClass("selected"),k=g.asinImageUrlsJson,n=g.imageAddress,T=g.asin,!c.objectIsEmpty(n))){I.find(".wb-image-url-container").attr("data-wb-image-url",n);I.find(".wb-image-url-container").attr("wbImageUrl",n);n=[];c.objectIsEmpty(k)||(n=k.split(",").slice(0,4),I.find(".image-urls-container").attr("data-image-urls",n),I.find(".image-urls-container").attr("imageUrls",
n));k=n.length+1;n=I.find(".shopbylook-carousel-pagination");I=I.find(".sbl-pagination-bullet-label").data("pagination-bullet-label");n.empty();n.attr("role","list");for(var O=0;O<k;O++){var P=I.replace("${order}",O+1),F;if(b.IS_MOBILE)F=a("\x3cdiv\x3e").addClass("shopbylook-image-section-middle-dot-container").attr("role","listitem"),P=a("\x3cbutton\x3e").addClass("shopbylook-image-section-middle-dot "+(0===O?"selected":"")+" "+(1===k?"aok-hidden":"")).attr("id","shopbylook-image-section-middle-dot-"+
O+"-"+T).attr("aria-label",P),F.append(P);else{F=a("\x3cspan\x3e").attr("role","listitem");var X=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:O})),X=F.append(X);F=a("\x3cdiv\x3e").addClass("shopbylook-image-section-middle-dot-container");P=a("\x3cbutton\x3e").addClass("shopbylook-image-section-middle-dot "+
(0===O?"selected":"")+" "+(1===k?"aok-hidden":"")).attr("id","shopbylook-image-section-middle-dot-"+O+"-"+T).attr("aria-label",P);F.append(P);X.append(F);F=X}n.append(F)}}}W&&S(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,d){a.addClass("sbl-keyword-item-"+d);a.attr("data-parent-item",
".sbl-refinement-"+d);a.removeClass("sbl-filter-keyword-hidden").width("")},getReviewPosition:function(){return a(d.TOP_REFINEMENT_SECTION_ID).find(d.REVIEW_KEYWORD_ITEM).first()},createNewButton:function(a,b,c,d,e,f){f=f.find(".sbl-filter-keyword-hidden").clone();var h=a.find(".sbl-softlines-colorsprite,.sbl-colorsprite");0<h.length&&h.clone().prependTo(f.find(".sbl-refinement-element-box"));f.find(".sbl-filter-keyword-text").text(this.getRefinementReadableName(a,e,b,c,d));f.data("refinementValue",
c);return f},createTopRefinementButton:function(a,b,c,d,e,f){a=this.createNewButton(a,b,c,d,e,f);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,f=this.getElementData(a.closest(".refinement-row"));a=f.refinementValue;var h=f.refinementIndex,f="review"===b;c.refinementSource===d.BROWSE_SOURCE?e=c=a:(c=e+(a?":"+a:""),e=b+(a?
"-"+(f?a:h):""));return{refinementType:b,value:a,isReview:f,filter:c,filterSelectorSuffix:e}}}});"use strict";u.when("A","jQuery","ready").register("mirai-side-sheet-helper",function(c,a){function b(){m.animate({right:"0px"},500,function(){c.show(m.find(".sbl-side-sheet-close-icon"))})}function d(){c.hide(m.find(".sbl-side-sheet-close-icon"));m.animate({right:-C+"px"},500,function(){c.hide(m)})}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=m.find(".sbl-refinements-show-results");m.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(),m.find(".sbl-side-sheet-close-button").focus())}var f=a("body"),m=a("#sbl-side-sheet-section"),h=a("#sbl-side-sheet-background"),C=m.outerWidth()+m.find(".sbl-side-sheet-close-icon").outerWidth(!0);return{showSideSheet:function(){f.addClass("sbl-lock-background");c.show(h);c.show(m);b();a("#shopbylook-btf-loading-section").find(".a-spinner-wrapper").addClass("aok-hidden");document.addEventListener("focus",e,!0)},hideSideSheet:function(){d();c.hide(h);f.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||(f=a("body"),m=a("#sbl-side-sheet-section"),h=a("#sbl-side-sheet-background"),C=m.outerWidth()+m.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,d,e){function f(){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 m(){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 h(b,c){a("#sbl-filters-results-text").text(c.replace("{count}",
b))}function C(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 x(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 M(c,f,g){a(b.TOP_REFINEMENT_SECTION_ID).find(".sbl-refinement-element-container:not(.sbl-filter-keyword-hidden):not(.sbl-smart-tag)").each(function(){var e=d.getElementData(a(this).find("input")).refinementValue.toString();-1===c.indexOf(e)&&-1===f.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&&
g&&g()}function pa(c,e){a(b.ALL_FILTERS_ID).find(b.REFINEMENT_SHEET_OPTION_BUTTON).each(function(){var f=d.getElementData(a(this).find("input")).refinementValue.toString();-1===c.indexOf(f)&&-1===e.indexOf(f)?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 p(){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 g(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 oa(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:h,updateSheetBottomSection:function(e){e?(c.show(a("#sbl-refinements-bottom-nav")),f()):(c.hide(a("#sbl-refinements-bottom-nav")),m());""!==(a(b.REFINEMENT_TOP_NAV_SEARCH_INPUT).val().toLowerCase()||"").trim()&&f()},updateFiltersAndAsinCount:function(c,e){var d=2<arguments.length&&arguments[2]!==z?arguments[2]:null,f=C(c),g=u(c);pa(f,g);p();M(f,g,d);h(c.asinCount,e);x(a(b.ALL_FILTERS_ID).find(".sbl-refinement-brand"))},
updateBrandRefinements:x,clearFilters:function(){var c=0<arguments.length&&arguments[0]!==z?arguments[0]:null,e=1<arguments.length&&arguments[1]!==z?arguments[1]:null,d=2<arguments.length&&arguments[2]!==z?arguments[2]:null,f=a(b.ALL_FILTERS_ID),g=a(b.TOP_REFINEMENT_SECTION_ID);f.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)});
f.find(".refinement-button-selected-value").text("");p();g.find(".sbl-refinement-element-container:not(.sbl-keyword-item-review):not(.sbl-filter-keyword-hidden):not(.sbl-top-refinement-element)").closest(".a-declarative").remove();g.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(g.find(b.REVIEW_KEYWORD_ITEM)).hasClass("a-button-selected")&&c(g.find(b.REVIEW_KEYWORD_ITEM),!0);0===g.find(".sbl-prime-toggle").removeClass("sbl-prime-selected").length&&d&&d.isOn(!1);x(a(b.ALL_FILTERS_ID).find(".sbl-refinement-brand"));m()},searchBarFilterResults:function(e){var d=a(b.REFINEMENT_TOP_NAV_SEARCH_INPUT).val().toLowerCase()||"";g(d);p();oa(d);x(a(b.ALL_FILTERS_ID).find(".sbl-refinement-brand"));""===d.trim()?(c.hide(a("#sbl-refinement-search-clear-btn")),m()):(c.show(a("#sbl-refinement-search-clear-btn")),
f());""===d.trim()&&e&&f()},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)});x(a(b.ALL_FILTERS_ID).find(".sbl-refinement-brand"));p();c.hide(a("#sbl-refinement-search-clear-btn"));e||m()}}});"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=d.find("[data-asin]").map(function(){return c.$(this).data("asin")}).get();0<b.length&&function(){var m=function(a){""!==a&&(e=!0,d.append(a))},h={adaptiveWidgetContext:{asinList:b},clientPrefix:"discover",page:"Detail",placement:"HITDiscover",device:a.IS_MOBILE?"Mobile":"Desktop",product:{contentID:b[0],contentIDType:"ASIN"},requestId:x.ue?x.ue.id:""};u.when("dp-latency-marker").execute("mirai-video-ingress-execute-ajax",function(){c.post("/vap/ew/componentbuilder",
{params:h,paramsFormat:"json",contentType:"application/json",success:m})})}()}var d=void 0,e=!1;return{initialize:function(a){d=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,d){return{addOrReorderTopRefsWithUrlRef:function(c,
f,m){c=a(b.ALL_FILTERS_ID).find(".sbl-refinement-"+c).first();var h=d.getRefinementData(c);if(h)if(a(b.TOP_REFINEMENT_SECTION_ID).find(".sbl-keyword-item-"+h.filterSelectorSuffix).hasClass("sbl-top-refinement-element"))m.find(".sbl-keyword-item-"+h.filterSelectorSuffix).insertAfter(d.getReviewPosition());else{var x=h.refinementType,u=h.filterSelectorSuffix;f=d.createTopRefinementButton(c,x,h.value,u,f,m);f.insertAfter(d.getReviewPosition());d.registerSelectedRefinementItem(f,c,x,u)}}}});"use strict";
"use strict";u.when("A","jQuery","ready").register("mirai-heart-button-helper",function(c,a){return{updateHeartWishList:function(a,d){if(!c.objectIsEmpty(a)&&!c.objectIsEmpty(d)&&(d=d.heartActionDetails,!c.objectIsEmpty(d))){var e=d.initialActions,f;c.objectIsEmpty(e)||""===e||(f=e.replace(/&quot;/g,'"'),f=f.replace(/&#34;/g,'"'));var e=d.hiddenActions,m;c.objectIsEmpty(e)||""===e||(m=e.replace(/&quot;/g,'"'),m=m.replace(/&#34;/g,'"'));d=d.serializedItemInfo;var h;c.objectIsEmpty(d)||""===d||(h=d.replace(/&quot;/g,
'"'),h=h.replace(/&#34;/g,'"'));c.objectIsEmpty(f)||(a=a.removeClass("lists-framework-replaced"),a.attr("data-lists-framework-initial-actions",f),a.data("listsFrameworkInitialActions",f));c.objectIsEmpty(m)||(a.attr("data-lists-framework-hidden-actions",m),a.data("listsFrameworkHiddenActions",m));c.objectIsEmpty(h)||(a.attr("data-lists-framework-item-info",h),a.data("listsFrameworkItemInfo",h),a.find("span").remove())}},updateNextHeartStrings:function(a){a.find(".lists-framework-hearts-notifications-changeover").css("display",
"none")}}});"use strict";u.when("A","ready").register("mirai-weblab-treatment-ref",function(){return{TREATMENT:"c"}});"use strict";var Va="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","mirai-weblab-treatment-ref","ready").execute("mirai-core",function(c,a,b,d,e,f,m,h,C,S,ha,Ua){function pa(a,b){-1===N.indexOf(d.LIKE_PREFIX+b.asin)&&(N.push(d.LIKE_PREFIX+b.asin),K.push({asin:b.asin,iteration:Q}))}function p(l,w,A){var f=l?Math.min(w,l.length):0,g=f-(0===f%2?2:1),h=A&&2<f;if(3<arguments.length&&arguments[3]!==z&&arguments[3])e.getCurrentItemBoxes(t).each(function(b,w){var d=a(w).find(".sbl-item-delivery");w=a(w).find(".udm-delivery-block");
c.objectIsEmpty(d)||e.updateDeliveryMessage(d,w,l[b])});else{var k=e.getCurrentItemBoxes(t).first().clone();k.removeClass(d.SBL_FLIP_BOX_CLASS);k.removeClass("sbl-item-liked");t.empty();for(var m=0;m<f;m++){ha.updateNextHeartStrings(k);var p=k.clone();if(h&&m>=g){p.each(function(){a(this).css({height:"50px"})});var q=p.find(".sbl-shadow-preview-fading");q.removeClass("hit-sbl-shadow-preview-fading-override");q.removeClass("aok-hidden");q.css("width",wa/2.3+"px")}var q=l[m],n=F(p,q,!1);-1<N.indexOf(d.LIKE_PREFIX+
q.asin)&&pa(p,q);n?t.append(p):f=Math.min(f+1,l.length)}}e.updateTruncate(t);b.IS_MOBILE||t.addClass(d.SHOPBYLOOK_INIT);Ha();C.update();ia();c.trigger("lists-framework-reinitialize");ja()}function g(l){B&&(B.abort(),B=null);var b=K;0===K.length&&0===R.length&&(b=[{asin:q.mainAsin,iteration:Q}]);e.startLoading(v);h.startRefinementSheetLoading();var c=v.find("#shopbylook-btf-items-section");ca=0<c.find(".hit-sbl-shadow-preview-loop").length;var f=(ka=0<c.find(".hit-sbl-shadow-preview").length)||ca,
c=la(y),g=e.getMaxNumberOfItems()+(f?2:0);c.positive=b;c.count=g+2;c.currentViewAsins=[];c.isFilterChange=!0;c.actionType=l;c.initialAsinList=q.initialAsinList.split(",");B=a.ajax({type:"POST",url:d.SBL_WEBSITE_ADDRESS_PREFIX+"getRecommendationsDPX",data:JSON.stringify(c),contentType:"application/json",dataType:"json",statusCode:{200:function(a){v.find("#shopbylook-btf-no-results-section").hide();var l=a.dpxRecommendationItemList;Y=a.nextStart;p(l,g,f);h.updateFiltersAndAsinCount(a,q.refinementResultCountStr,
U);h.updateSheetBottomSection(0<y.length)},204:function(){v.find("#shopbylook-btf-no-results-section").show();t.find(".shopbylook-btf-item-box").not(":first").remove();Z.hide();t.animate({height:ra},d.NEW_ITEM_ANIMATION_TIME,function(){a(this).height("auto")});h.showResultsNumber(0,q.refinementResultCountStr);h.updateSheetBottomSection(0<y.length)}}}).always(function(){e.stopLoading(v);h.stopRefinementSheetLoading();xa();a("#sbl-search-title").hide();a("#sbl-header-title").show();h.clearFilterSearchBar(0<
y.length)})}function oa(){B&&(B.abort(),B=null);var l=e.getCurrentItemBoxes(t),l=l?l.length:0;e.startLoading(v);var w,A=0,g=t.find(".hit-sbl-shadow-preview"),qa=t.find(".hit-sbl-shadow-preview-loop"),h;h=0<g.length&&0===qa.length?d.MOBILE_NUM_ITEMS_PER_SHOW_MORE_ON_SHADOW_PREV:d.MOBILE_NUM_ITEMS_PER_SHOW_MORE;w=b.IS_MOBILE?h:2*da;A=X(l);l=w+A+(b.IS_MOBILE?0:2);h=K;0===K.length&&0===R.length&&(h=[{asin:q.mainAsin,iteration:Q}]);var k=la(y);k.positive=h;k.currentViewAsins=P();k.start=Y;k.count=l;k.iteration=
Q;k.actionType=f.LOAD_MORE;k.initialAsinList=q.initialAsinList.split(",");B=a.ajax({type:"POST",url:d.SBL_WEBSITE_ADDRESS_PREFIX+"getRecommendationsDPX",data:JSON.stringify(k),contentType:"application/json",dataType:"json",statusCode:{424:function(){}},success:function(l){if(l&&l.dpxRecommendationItemList){var f=l.dpxRecommendationItemList;Y=l.nextStart;l=e.getCurrentItemBoxes(t).filter(":visible");l.each(function(){ha.updateNextHeartStrings(a(this))});var h=l.first().clone();h.removeClass(d.SBL_FLIP_BOX_CLASS);
h.removeClass("sbl-item-liked");h=l.last();l=e.fillGap(h,l,A,f,F);f=f.slice(l);t=v.find("#shopbylook-btf-items-section");g=t.find(".hit-sbl-shadow-preview");qa=t.find(".hit-sbl-shadow-preview-loop");ca=0<qa.length;if((ka=0<g.length)||ca)g.each(function(){a(this).removeClass("hit-sbl-shadow-preview");a(this).css({height:"auto",display:"inline-block"})}),ka||qa.each(function(){a(this).css({height:"auto",display:"inline-block"})}),t.find(".sbl-shadow-preview-fading").each(function(){a(this).removeClass("hit-sbl-shadow-preview-fading-override");
a(this).addClass("aok-hidden")}),ca||a(".shopbylook-btf-items-section-row").find(".shopbylook-btf-mobile-expand-row").removeClass("sbl-show-more-shadow-preview");e.addRowsToEnd(h,t,f,w,ra,F,b.IS_MOBILE?d.SCROLL_HEIGHT_MULTIPLIER_MOBILE:d.SCROLL_HEIGHT_MULTIPLIER,ca);t.removeClass(d.SHOPBYLOOK_INIT);C.update();ia();c.trigger("lists-framework-reinitialize");ja()}else Y=d.END_OF_RECOMMENDATIONS_START_INDEX}}).always(function(){Ha();e.updateTruncate(t);e.stopLoading(v)})}function r(l,w,A,f,g){B&&(B.abort(),
B=null);if(0!==K.length||0!==R.length){var h=P(),k=e.getCurrentItemBoxes(t).filter(":visible"),m=k.length,p=t.find("#"+d.BOX_ID_PREFIX+l.asin),n=b.IS_MOBILE&&p.hasClass("hit-sbl-smlt-update")?w?da+2:1:w?da:1,r=b.IS_MOBILE?0:X(m),x=0<r&&m+r-da<=f,m=la(y);m.asin=l.asin;m.physicalId=l.physicalId;m.positive=K;m.currentViewAsins=h;m.count=n+r+2+0;m.asinIndex=f;m.actionType=g;w||(m.initialAsinList=q.initialAsinList.split(","));B=a.ajax({type:"POST",url:d.SBL_WEBSITE_ADDRESS_PREFIX+A,data:JSON.stringify(m),
contentType:"application/json",dataType:"json",statusCode:{200:function(a){a=a.dpxRecommendationItemList;if(w){if(!b.IS_MOBILE&&x){var A=e.fillGap(p,k,r,a,F);a=a.slice(A);k=e.getCurrentItemBoxes(t).filter(":visible")}e.addNewRow(p,k,da,t,ra,n,a,F);e.updateTruncate(t);b.IS_MOBILE||t.removeClass(d.SHOPBYLOOK_INIT)}else{for(var A=t.find("#"+d.BOX_ID_PREFIX+l.asin),f=0;null!==a&&!F(A,a[f])&&f<a.length;)f++;e.updateTruncate(t)}e.updateTruncate(t);C.update();ia();c.trigger("lists-framework-reinitialize");
ja()},204:function(){var a=v.find("#sbl-no-content-message");Z.hide();if(!c.objectIsEmpty(a)){var b=t.find("#"+d.BOX_ID_PREFIX+l.asin),w=t.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 ga(l){var c;c=b.IS_MOBILE?a("#refinement-all-sheet").find(".sbl-refinement-"+l).first():a(".sbl-refinement-"+l).first();if(l.startsWith("@tag")){c=
l.slice(5).split(" ").map(function(a){return a.charAt(0).toUpperCase()+a.slice(1)}).join(" ");l=v.find(".sbl-filter-keyword-hidden").closest(".a-declarative").clone();var e=l.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("");aa(l,!0)}else l=(l=ya(c))?a(d.TOP_REFINEMENT_SECTION_ID).find(".sbl-keyword-item-"+l.filterSelectorSuffix).hasClass("sbl-top-refinement-element"):!1,za(c,!0,l,!1)}function W(l){B&&
(B.abort(),B=null);var b=[{asin:q.mainAsin,iteration:Q}],A=la(y);A.positive=b;A.count=e.getMaxNumberOfItems();A.currentViewAsins=c.objectIsEmpty(l)?P():q.initialAsinList.split(",");A.initialAsinList=q.initialAsinList.split(",");A.isFilterChange=!1;A.searchQuery=l;A.refinementsQueryParameter=e.getRefinementsQueryParameter();A.topPickers=function(){return Array.from(a(".sbl-top-refinement-element").map(function(){return""+a(this).data("refinementValue")}))}();var f=function(a){var l=!0,b=!1,c=z;try{for(var w=
[].concat(M(a.topPickers||[])).filter(function(a){return A.topPickers.includes(a)}).reverse()[Symbol.iterator](),e;!(l=(e=w.next()).done);l=!0)S.addOrReorderTopRefsWithUrlRef(e.value,q,v)}catch(d){b=!0,c=d}finally{try{!l&&w.return&&w.return()}finally{if(b)throw c;}}};B=a.ajax({type:"POST",url:d.SBL_WEBSITE_ADDRESS_PREFIX+"getRecommendationsForSearchQueryDPX",data:JSON.stringify(A),contentType:"application/json",dataType:"json",statusCode:{200:function(b){if(!c.objectIsEmpty(b)){(ma=b.deliveryMessageEnabled)&&
D.addClass("sbl-delivery-message-on");var w=b.refinements;if(!c.objectIsEmpty(w)||c.objectIsEmpty(l)){if(!0===b.titleShown){var d=a("#sbl-search-title"),A;A=d.hasClass("a-cardui-title")?d.find(".a-cardui-title-text").first():d.first();d.show();d=null===b.searchQueryTitle||b.searchQueryTitle===z?q.searchInputTitle.replace("${query}",'\x3cspan class\x3d"sbl-font-emphasis"\x3e'+l+"\x3c/span\x3e"):b.searchQueryTitle;A.html(d);a("#sbl-header-title").hide();D.find("#shopbylook-btf-no-results-section").hide()}c.objectIsEmpty(l)||
(Y=b.nextStart,f(b),I(b),h.updateFiltersAndAsinCount(b,q.refinementResultCountStr),h.updateSheetBottomSection(0<w.length),c.each(w,ga),xa());w=(b=b.dpxRecommendationItemList)?b.length:0;w=Math.min(e.getMaxNumberOfItems(),w);p(b,w,!1,c.objectIsEmpty(l));e.triggerLazyLoad();C.update();ia();c.trigger("lists-framework-reinitialize");ja()}}},206:function(a){f(a);Ta(a)}}})}function Ta(a){Array.isArray(a.urlRefinements)&&0<a.urlRefinements.length&&a.urlRefinements.some(function(a){return""!==a.trim()})&&
a.urlRefinements.forEach(function(a){S.addOrReorderTopRefsWithUrlRef(a,q,v)})}function T(){var a=K;0===K.length&&0===R.length&&(a=[{asin:q.mainAsin,iteration:Q}]);var b=la(y);b.positive=a;b.count=e.getMaxNumberOfItems();b.currentViewAsins=[];b.isFilterChange=!1;return b}function k(l,b,c){if(q!==z&&null!==q){var e=T();e.actionType=l;if(l===f.GO_TO_DETAIL_PAGE){if(!b)return;e.asin=b.asin;e.physicalId=b.physicalId;e.asinIndex=c}B=a.ajax({type:"POST",url:d.SBL_WEBSITE_ADDRESS_PREFIX+"recordActionDPX",
data:JSON.stringify(e),contentType:"application/json",dataType:"json"})}}function n(a,b,c,e){a=a.clone();var d=a.find(".refinement-row");a.find(".shopbylook-btf-clickable").text(c);d.removeClass();d.addClass("refinement-row sbl-refinement-option-button");d.addClass("sbl-refinement-"+b);d.find("input").attr("data-refinement-value",b);d.find("input").attr("data-refinement-index",e);d.addClass("a-button a-button-normal a-button-toggle v31-sheet-all-refinement");V.append(a)}function I(l){if(!c.objectIsEmpty(l.fullRefinementItems)){l=
l.fullRefinementItems.find(function(a){return a.type&&"brand"===a.type});V=Ia.find("#sbl-refinements-bn-list-"+l.id);V.addClass("sbl-refinement-brand");var b=V.find(".a-declarative").length,d=[];V.find(".a-declarative .sbl-refinement-option-button").each(function(){d.push(e.getElementData(a(this).find("input")).refinementValue.toString())});for(var f in l.childNodes)-1===d.indexOf(f)&&(n(V.find(".a-declarative").first(),f,l.childNodes[f],b),b+=1);h.updateBrandRefinements(V)}}function O(){if(q!==z&&
null!==q&&!V){var l=T();B=a.ajax({type:"POST",url:d.SBL_WEBSITE_ADDRESS_PREFIX+"getFullRefinementsDPX",data:JSON.stringify(l),contentType:"application/json",dataType:"json",statusCode:{200:function(a){I(a)}}})}}function P(){var l=e.getCurrentItemBoxes(t).map(function(){return e.getElementData(a(this)).asin}).get();b.IS_MOBILE||l.push(q.mainAsin);return l}function F(a,w,f){if(null===a||0===a.length||w===z||sa&&c.objectIsEmpty(w.basisPrice))return!1;if(f===z||f)a.toggleClass(d.SBL_FLIP_BOX_CLASS),a.removeClass("sbl-item-liked"),
a.removeClass("sbl-item-disliked");ma=D.hasClass("sbl-delivery-message-on");if(!b.IS_MOBILE)return e.redesignBoxSwap(a,w,Aa,f,!1,Ba,ta,ma),w.prime?a.addClass(d.IS_PRIME_CLASS):a.removeClass(d.IS_PRIME_CLASS),C.updateHoverStatus(a),!0;e.redesignBoxSwap(a,w,Aa,f,!0,Ba,ta,ma);a.removeClass("sbl-item-liked").removeClass("sbl-item-disliked");return!0}function X(a){var b=Ja();a%=b;return 0<a?b-a:0}function Ja(){return Math.floor(t.width()/t.children().eq(0).width())}function Aa(a){var c=encodeURIComponent(e.getSearchQuery()),
c=0<c.length?"?keywords\x3d"+c:"",f;f=q.browseNode.substring(0,d.MAX_BN_CHARS_IN_REFTAG);f=b.IS_MOBILE?"sbl_dpx_m_"+f+"_"+q.mainAsin:"sbl_dpx_"+Ua.TREATMENT+"_"+f+"_"+q.mainAsin;return"/dp/"+a+"/ref\x3d"+f+c}function Ka(){var l=a("#desktop-dp-btf-shopbylook").width();a("#mirai-btf-shopbylook-row").width()<l?a(".sbl-btf-suggestion-items-section").addClass("sbl-ads-override"):a(".sbl-btf-suggestion-items-section").removeClass("sbl-ads-override");da=Ja();b.IS_MOBILE||U()}function U(){var b=J[0].scrollLeft,
c=J[0].scrollWidth-J[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 xa(a){var c=y.length;0===c&&e.hideSelectedRefinementsBar(v);a||(a=v.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 Wa(){d.MOBILE_REFINEMENT_BOTTOM_SHEET_NAMES.forEach(function(b){c.on("a:sheet:beforeShow:sbl"+b+"Sheet",function(c){k(f.OPEN_FILTERS);
c=a("#refinement-"+b.toLowerCase()+"-sheet").closest(".a-sheet-web");c.height(x.innerHeight*("All"===b?.8:.5));O();Ca(!1,c)});c.on("a:sheet:beforeHide:sbl"+b+"Sheet",function(a){k(f.CLOSE_FILTERS)})})}function ya(a){var b=a.closest(".sbl-refinements-bn-list");if(!b||0===b.length)return null;var c=e.getElementData(b),b=c.refinementType,f="@"+b,g=e.getElementData(a.find("input"));a=g.refinementValue;var h=g.refinementIndex,g="review"===b;c.refinementSource===d.BROWSE_SOURCE?f=c=a:(c=f+(a?":"+a:""),
f=b+(a?"-"+(g?a:h):""));return{refinementType:b,value:a,isReview:g,filter:c,filterSelectorSuffix:f}}function La(a,b){var c=y.indexOf(a);-1<c?(y.splice(c,1),L=b?f.REMOVE_TOP_FILTER:f.REMOVE_FILTER):(y.push(a),L=b?f.ADD_TOP_FILTER:f.ADD_FILTER)}function Xa(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 aa(c,e){var f=2<arguments.length&&arguments[2]!==z?arguments[2]:!1;e?(b.IS_MOBILE?
f?c.prependTo(c.closest(".sbl-two-row-refinements")):c.prependTo(v.find("#sbl-two-row-other-refinements")):(c.prependTo(v.find("#sbl-top-refinement-section")),U()),J.animate({scrollLeft:0},600)):(f=b.IS_MOBILE?c.closest(".sbl-two-row-refinements").find(".sbl-refinement-element-container:not(.a-button-normal):not(.sbl-filter-keyword-hidden)"):v.find(d.TOP_REFINEMENT_SECTION_ID).find(".sbl-refinement-element-container:not(.a-button-normal):not(.sbl-filter-keyword-hidden):not(.sbl-filter-keyword-prime)"))&&
0!==f.length?b.IS_MOBILE&&c.find("input")[0].getAttribute("data-refinement-value").includes("price")?Da(c,f.last().closest(".a-declarative")):(c.insertAfter(f.last().closest(".a-declarative")),b.IS_MOBILE||U()):b.IS_MOBILE?c.find("input")[0].getAttribute("data-refinement-value").includes("price")?Da(c):c.prependTo(c.closest(".sbl-two-row-refinements")):(c.prependTo(a("#sbl-top-refinement-section")),U())}function Ea(a){return a.find(".a-button-input")[0].getAttribute("data-refinement-value").replace("price-",
"")}function Da(b){for(var c=1<arguments.length&&arguments[1]!==z?arguments[1]:null,e=Ea(b),f=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")),m=Ea(k),p=h<g.length-1?Ea(a(g[h+1])):f;if(e<m)break;if(e>m&&e<p){b.insertAfter(k);
return}}c&&0<a("#sbl-refinements-bn-list-review").find(".a-button-selected").length?b.insertAfter(c):b.insertAfter(a(d.TOP_REFINEMENT_SECTION_ID).find(d.REVIEW_KEYWORD_ITEM).closest(".a-declarative").first())}function ba(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(d.LIKE_BUTTON_FOCUS)}function za(c,f,h,k){var m=c.hasClass("sbl-refinement-item-selected"),p=c.closest(".sbl-refinements-bn-list");if(p&&0!==p.length){var n=ya(c),r=n.refinementType,t=n.value,x=n.isReview,u=n.filter,n=n.filterSelectorSuffix;L=null;ba(a(d.REFINEMENT_SELECTOR_PREFIX+n),m);a(d.REFINEMENT_SELECTOR_PREFIX+n).toggleClass("sbl-refinement-item-selected");Xa(p.find(".sbl-refinement-item-selected").length,r,x,t,u);La(u,k);k=v.find(".sbl-keyword-item-"+(x?r:n)).closest(".a-declarative").find(".a-button-selected");
u=y.indexOf(u);m||k.length&&!(-1>=u)?m&&k.length&&(h?(c=v.find(".sbl-keyword-item-"+n),ba(c,m),aa(c.closest(".a-declarative"),!1,!0)):e.closeSelectedRefinementItem(k.first().closest(".a-declarative"),!b.IS_MOBILE,U)):h?(c=v.find(".sbl-keyword-item-"+n),ba(c,m),aa(c.closest(".a-declarative"),!0,!0)):(m=v.find(".sbl-filter-keyword-hidden").closest(".a-declarative").clone(),h=m.find(".a-button"),u=h.find("input"),k=h.find(".a-button-text"),u.addClass("sbl-keyword-item-"+n),u.attr("data-parent-item",
".sbl-refinement-"+n),u.attr("data-refinement-value",n),u.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&&(Fa(h),h.clone().prependTo(m.find(".sbl-refinement-element-box"))),m.find(".sbl-filter-keyword-text").text(e.getRefinementReadableName(c,q,r,t,n)),aa(m,!0));f||g(L)}}function Ma(a){var b=y.indexOf("@prime");0>b?(y.push("@prime"),
a.find(".sbl-prime-toggle").addClass("sbl-prime-selected"),L=f.ADD_FILTER):(y.splice(b,1),a.find(".sbl-prime-toggle").removeClass("sbl-prime-selected"),L=f.REMOVE_FILTER);g(L)}function Ha(){Y===d.END_OF_RECOMMENDATIONS_START_INDEX?Z.hide():Z.show()}function na(){if(!Na)if(c.objectIsEmpty(v))c.off("scroll",na);else if(c.onScreen(v,b.IS_MOBILE?100:50)){c.off("scroll",na);var a=e.getSearchQuery();W(a)}}function Ya(){var b=a(d.REFINEMENT_TOP_NAV_SEARCH_INPUT);b.val("");b.bind("input",function(){h.searchBarFilterResults(0<
y.length)})}function ea(a){E=a.$currentTarget.closest(".shopbylook-btf-item-box-inner").closest(".shopbylook-btf-item-box")}function ua(a){var b=a.find(".image-urls-container").data("image-urls");a=a.find(".wb-image-url-container").data("wb-image-url");G=[];G=[a].concat(b.split(","))}function Ca(a){var e=1<arguments.length&&arguments[1]!==z?arguments[1]:null;a?c.each(v.find(".sbl-top-refinement-scroller-v31").find(".sbl-color-span"),Fa):c.each(b.IS_MOBILE&&e?e.find(".sbl-color-span"):v.find(".sbl-side-sheet-content").find(".sbl-color-span"),
Fa)}function Fa(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 Oa(){D=a(b.IS_MOBILE?"#mobile-dp-btf-shopbylook":"#desktop-dp-btf-shopbylook");v=a("#mirai-btf-shopbylook-row");if(0<v.length){c.state.parse();var l=c.state("shopbylookStateData");l||D.hide();Ia=b.IS_MOBILE?a(".sbl-bottom-sheet"):v;var d=0<D.length&&0<a("#miraiBTFShopByLook_feature_div").length&&a("#miraiBTFShopByLook_feature_div").hasClass("js-feature-refresh-overlay"),
g=e.getElementData(v),h=g.mainAsin;d||D.show();q&&q.mainAsin===h||q&&!h||!l?d&&D.hide():(d&&(a("#miraiBTFShopByLook_feature_div").removeClass("js-feature-refresh-overlay"),a("#miraiBTFShopByLook_feature_div").css({opacity:""})),Ca(!0),q=l,l=q.mainAsin!==h,q.mainAsin=h?h:q.mainAsin,q.browseNode=g.browseNode?g.browseNode:q.browseNode,0<D.length&&D.find("h2"),b.IS_MOBILE||m.refreshSideSheet(b.IS_MOBILE),C.initialize(D),K=[],R=[],N=[],Q=0,Y=null,y=[],Na=D.hasClass("sbl-interactive-disabled"),Ba=D.hasClass("sbl-eel-enabled"),
t=v.find("#shopbylook-btf-items-section"),q.initialAsinList=l?P().join(","):q.initialAsinList,g=v.find(".shopbylook-btf-desktop-expand-row"),g=0!==g.length?g:v.find("#shopbylook-btf-desktop-show-more"),Z=b.IS_MOBILE?v.find("#shopbylook-btf-mobile-show-more"):g,a("#sbl_top_refinement_prime_switch_input").click(function(a){a.stopPropagation()}),b.IS_MOBILE?J=a("#sbl-top-refinement-section"):(J=a("#sbl-top-refinement-section"),J[0].addEventListener("scroll",function(){Ga||(k(f.V31_DESKTOP_SCROLL),Ga=
!0);U()}),Ga=!1),Ka(),x.addEventListener("resize",Ka),Ya(),ra=e.getCurrentItemBoxes(t).first().outerHeight(),c.onScreen(v,0)?na():(c.off("scroll",na),c.on("scroll",na)),b.IS_MOBILE?b.IS_MOBILE&&!Pa&&(Wa(),Pa=!0):xa(),ka=0<t.find(".hit-sbl-shadow-preview").length,wa=a(x).width(),ka&&t.find(".sbl-shadow-preview-fading").slice(-2).each(function(b){0===b&&a(this).css("width",wa/2.3+"px")}),g=t.find(".shopbylook-btf-item-box"),ta=D.hasClass("hit-sbl-swipeable-gallery-update"),ma=D.hasClass("sbl-delivery-message-on"),
g.each(function(){var b=a(this),c=e.getElementData(b),c=Aa(c.asin);b.find("a.sbl-image-link").attr("href",c);ta&&b.find(".shopbylook-image-section-middle-dot").first().addClass("selected")}))}else q&&(q.mainAsin=null)}function ia(){D.find(".play-icon-placeholder").unbind("click");D.find(".play-icon-placeholder").click(function(){k(f.PLAY_VIDEO)})}function ja(){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?k(f.ADD_HEART):c&&k(f.REMOVE_HEART)})}function la(a){var b={browseNode:q.browseNode,anchorAsin:q.mainAsin,anchorAsinPid:q.mainAsinPid,negative:R,iteration:Q},c=[];a.forEach(function(a){if(a&&"object"===("undefined"===typeof a?"undefined":Va(a))&&"price"===a.type)a.min&&(b.minPrice=a.min),a.max&&(b.maxPrice=a.max);else if("deal"==a){a=new Date;var l=new Date(a.getTime()+18E4),d={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",d).replaceAll("/","-").replace(",","");b.endViewDealTime=l.toLocaleString("ja-JP",d).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,v,D,Ia,K=[],R=[],N=[],Q=0,Y=null,B=null,y=[],Pa=!1,L=null,Na=!1,t=null,Z=null,ra=null,da=null,ka=!1,ca=!1,wa=null,V=null,Ba=!1,Qa=
null,J=null,Ga=!1,sa=!1,ta=!1,E=null,G=[],H=0,fa=0,Ra=0,Sa=0,va=!1,ma=!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",Oa);c.declarative("sblTopRefinementScrollLeftV31","click",function(){J.animate({scrollLeft:J[0].scrollLeft-Math.min(J[0].scrollLeft,350)},400)});c.declarative("sblTopRefinementScrollRightV31","click",function(){J.animate({scrollLeft:J[0].scrollLeft+
Math.min(J[0].scrollWidth-J[0].clientWidth,350)},400)});c.declarative("sblImageMouseHover","mouseenter",function(a){ea(a);1<E.find(".shopbylook-carousel-pagination span").length&&E.find(".shopbylook-carousel-arrow-container").removeClass("aok-hidden")});c.declarative("sblImageMouseHover","mouseleave",function(a){ea(a);E.find(".shopbylook-carousel-arrow-container").addClass("aok-hidden")});c.declarative("sblImageSwipe","touchstart",function(a){Ra=a.$event.originalEvent.touches[0].pageX;va=!1});c.declarative("sblImageSwipe",
"touchmove",function(a){if(!va){Sa=a.$event.originalEvent.touches[0].pageX;var b=Ra-Sa;ea(a);ua(E);a=E.find(".shopbylook-btf-image-container").width();var c=E.find(".shopbylook-btf-image-elem");a=Math.abs(b/a);c.css("transform","translateX("+-1*b+"px)");.05<a&&(va=!0,G&&G.length&&(a=E.find(".shopbylook-image-section-middle-dot"),H=a.index(a.filter(".selected")),0<b?H=(H+1)%G.length:0>b&&(H=(H-1+G.length)%G.length),c.css("transform","translateX(0)"),c.css("opacity","0"),setTimeout(function(){c.attr("src",
G[H]);c.css("opacity","1")},300),b=E.find(".shopbylook-image-section-middle-dot"),b.removeClass("selected"),b.eq(H).addClass("selected")),setTimeout(function(){va=!1},300))}});c.declarative("sblCarouselToPrevious","click",function(a){ea(a);a=E.find(".shopbylook-image-section-middle-dot");fa=a.index(a.filter(".selected"));ua(E);G&&(H=0<fa?fa-1:G.length-1,e.replacingSrcImage(G[H],E,H))});c.declarative("sblCarouselToNext","click",function(a){ea(a);a=E.find(".shopbylook-image-section-middle-dot");fa=
a.index(a.filter(".selected"));ua(E);G&&(H=fa<G.length-1?fa+1:0,e.replacingSrcImage(G[H],E,H))});c.declarative("sblThumbnailDetailPagination","click",function(a){ea(a);H=(a=a.$target.closest(".shopbylook-image-section-middle-dot").attr("id").match(/shopbylook-image-section-middle-dot-(\d+)-/))?parseInt(a[1],10):0;ua(E);G&&e.replacingSrcImage(G[H],E,H)});c.declarative("sblItemLike","click",function(a){var c=a.$currentTarget.closest(".shopbylook-btf-item-like");a=c.closest(".shopbylook-btf-item-box");
var g=a.index(),h=e.getElementData(a);Q++;b.IS_MOBILE&&a.addClass("sbl-item-liked");c.find(".sbl-item-like-button").removeClass(d.LIKE_BUTTON_FOCUS);for(c=0;c<R.length;c++)if(R[c].asin===h.asin){R.splice(c,1);break}for(c=0;c<N.length;c++)if(N[c]===d.DISLIKE_PREFIX+h.asin){N.splice(c,1);break}pa(a,h);r(h,!0,d.GET_RECOMMENDATION_ADD_LIKE,g,f.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||Q++;for(var g=0;g<K.length;g++)if(K[g].asin===c.asin){K.splice(g,1);break}for(g=0;g<N.length;g++)if(N[g]===d.LIKE_PREFIX+c.asin){N.splice(g,1);break}-1===N.indexOf(d.DISLIKE_PREFIX+c.asin)&&(N.push(d.DISLIKE_PREFIX+c.asin),R.push({asin:c.asin,iteration:Q}));b.IS_MOBILE&&a.addClass("sbl-item-disliked");r(c,!1,d.GET_RECOMMENDATION_ADD_DISLIKE,a.index(),f.DISLIKE)});c.declarative("sblRefinementChangeV31","click",function(a){a=a.$currentTarget.find(".sbl-refinement-option-button");
var b=ya(a),b=b?v.find(d.TOP_REFINEMENT_SECTION_ID).find(".sbl-keyword-item-"+b.filterSelectorSuffix).hasClass("sbl-top-refinement-element"):!1;za(a,!1,b,!1)});c.declarative("sblShowMore","click",function(a){oa();Z.removeClass(d.LIKE_BUTTON_FOCUS)});c.declarative("sblShadowPreview","click",function(b){var c=b.$currentTarget.closest(".shopbylook-btf-item-box"),e=a(".shopbylook-btf-item-box"),f=e.length;b=c.hasClass("hit-sbl-shadow-preview")||c.hasClass("hit-sbl-shadow-preview-loop");c=c.is(e.eq(f-
1))||c.is(e.eq(f-2));b&&c&&(oa(),Z.removeClass(d.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(sa=".sbl-refinement-basisPrice"===c.$currentTarget.find("input").attr("data-parent-item"))c=y.indexOf("@basisPrice"),d=v.find(".sbl-keyword-item-basisPrice"),0>c?(y.push("@basisPrice"),L=f.ADD_FILTER,ba(d,!1),aa(d.closest(".a-declarative"),!0,!0)):(y.splice(c,
1),L=f.REMOVE_FILTER,sa=!1,ba(d,!0),aa(d.closest(".a-declarative"),!1,!0)),g(L);else{var h=a(c.$currentTarget.find("input").attr("data-parent-item")).first();0===h.length?c.$currentTarget.find(".sbl-keyword-item-review")?(d=c.$currentTarget.find(".sbl-keyword-item-review"),h=d.hasClass("a-button-selected"),La("@review:4",!0),ba(d,h),g(L),aa(c.$currentTarget,!h,!0)):c.$currentTarget.find(".sbl-smart-tag")&&(e.closeSelectedRefinementItem(c.$currentTarget,!b.IS_MOBILE,U),g(f.CLEAR_FILTERS)):za(h,!1,
d,!0,!1);c.$currentTarget.find("input").focus()}});c.declarative("sblPrimeRefinementChange","click",function(a){Ma(a.$currentTarget.find("#sbl-refinement-item-prime"))});c.declarative("sblPrimeRefinementChangeMobile","touchend",function(a){Ma(a.$currentTarget.find("#sbl-refinement-item-prime"))});u.when("a-switch","jQuery").execute(function(a,b){Qa=a.getSwitch(b("#sbl_top_refinement_prime_switch"))});c.declarative("sblViewRefinements","click",function(){Ca(!1);m.showSideSheet();k(f.OPEN_FILTERS);
O()});c.declarative("mirai-discover-side-sheet:hide","click",function(){m.hideSideSheet();k(f.CLOSE_FILTERS);h.clearFilterSearchBar(0<y.length)});c.declarative("sbl-filter-search-clear","click",function(){h.clearFilterSearchBar(0<y.length)});c.declarative("mirai-discover-clear-filters","click",function(){h.clearFilters(ba,Da,Qa);var a=v.find(d.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=[];L=f.REMOVE_FILTER;sa=!1;g(L)});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){B&&(B.abort(),B=null);a=a.$currentTarget.closest(".shopbylook-btf-image-container").closest(".shopbylook-btf-item-box");var b=e.getElementData(a);k(f.GO_TO_DETAIL_PAGE,b,a.index())});c.declarative("sblGoToDetailPageVariations","click",function(){B&&(B.abort(),B=null);k(f.GO_TO_DETAIL_PAGE_VARIATIONS)});Oa();ia();ja()})});
/* ******** */
(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(e){var c=window.AmazonUIPageJS||window.P,k=c._namespace||c.attributeErrors,g=k?k("DetailPageValuePickDesktopAssets",""):c;g.guardFatal?g.guardFatal(e)(g,window):g.execute(function(){e(g,window)})})(function(e,c,k){e.when("jQuery","A","valuepick_constants").register("valuepick_amazonAPIClient",function(g,c,b){return c.createClass({init:function(d){this._baseUrl="https://"+d.endpoint+"/api/marketplaces/"+d.marketplaceId+"/";this._defaultHeaders={"Accept-Language":d.language,"x-api-csrf-token":d.csrfToken,
"x-cc-currency-of-preference":d.currency,"x-amzn-encrypted-slate-token":c.$('meta[name\x3d"encrypted-slate-token"]').prop("content")}},productV2:function(d){var b=["products",d.asin],c={Accept:'application/vnd.com.amazon.api+json; type\x3d"product/v2"; expand\x3d"'+d.subresources.join(",")+'"'},b=this._constructUrl(b,d.parameters),c=g.extend(this._defaultHeaders,c);this._get(d.success,d.error,d.always,b,c)},_get:function(d,c,l,a,h){g.ajax({url:a,type:"GET",headers:h,xhrFields:{withCredentials:!0},
timeout:b.AAPI_CLIENT_TIMEOUT}).done(function(a,b){d(a,b)}).fail(function(a,b,d){c(b,d)}).always(function(a,b){l(b)})},_constructUrl:function(b,c){c=c||{};c=g.map(c,function(b,a){return a.toString()+"\x3d"+b.toString()}).join("\x26");return this._baseUrl+b.join("/")+(0<c.length?"?"+c:"")}})});"use strict";e.when("jQuery","A","valuepick_constants","valuepick_metrics","valuepick_amazonAPIClient","valuepick_resourceHandler","ready").register("valuepick_ajaxManager",function(g,e,b,d,k,l){return{aapiRequest:function(){var a=
e.state(b.AJAX_PARAMS_STATE_KEY);"undefined"===typeof a&&(e.state.parse(),a=e.state(b.AJAX_PARAMS_STATE_KEY));if(a&&a.resources){var h=c.performance&&c.performance.now?c.performance.now():Date.now(),m=new k(a),f=a.resources.split(","),g=f.map(function(a){return b.INCLUSIONS[a]});m.productV2({asin:a.asin,subresources:g,parameters:[],success:function(a,c){d.updateCounter(b.METRICS.AAPI_AJAX_SUCCESS);f.forEach(function(b){l[b].success(a,c)})},error:function(a,c){d.updateCounter(b.METRICS.AAPI_AJAX_FAILURE);
f.forEach(function(b){l[b].error(a,c)})},always:function(a){var m=c.performance&&c.performance.now?c.performance.now():Date.now();d.updateLatency(b.AAPI_LATENCY,m-h);f.forEach(function(b){l[b].always(a)})}})}}}});"use strict";e.when("dp-latency-marker").register("valuepick_constants",function(){return{AJAX_PARAMS_STATE_KEY:"valuePickAjaxParams",UNSPECIFIED_REQUEST_STATUS:"unspecified",AAPI_CLIENT_TIMEOUT:6E3,INCLUSIONS:{businessDiscountsSummaryV1:"buyingOptions[].businessDiscountsSummary(product.business-discounts-summary/v1)",
deliveryV2:"buyingOptions[].delivery(product.delivery/v1)"},METRICS:{AAPI_AJAX_SUCCESS:"DesktopValuePick.AjaxSuccess",AAPI_AJAX_FAILURE:"DesktopValuePick.AjaxFailure",AAPI_LATENCY:"DesktopValuePick.AAPILatency",BUSINESS_DISCOUNTS_MESSAGE_SUCCESS:"DesktopValuePick.BusinessDiscountMessage.AjaxSuccess",BUSINESS_DISCOUNTS_MESSAGE_FAILURE:"DesktopValuePick.BusinessDiscountMessage.AjaxFailure",BUSINESS_DISCOUNTS_MESSAGE_EMPTY_RESPONSE:"DesktopValuePick.BusinessDiscountMessage.EmptyResponse",BUSINESS_DISCOUNTS_MESSAGE_PARSING_FAILURE:"DesktopValuePick.BusinessDiscountMessage.UnableToParse",
PRIME_BADGE_SUCCESS:"DesktopValuePick.PrimeBadge.AjaxSuccess",PRIME_BADGE_FAILURE:"DesktopValuePick.PrimeBadge.AjaxFailure",PRIME_BADGE_EMPTY_RESPONSE:"DesktopValuePick.PrimeBadge.EmptyResponse"},PRIME:{PRIME:"PRIME",SUB_SAME_DAY:"SUB_SAME_DAY",SUB_SAME_DAY_PAID:"SUB_SAME_DAY_PAID",PRIME_ONE_DAY:"PRIME_ONE_DAY",PRIME_SAME_DAY:"PRIME_SAME_DAY",PRIME_UPSELL_VARIANT:"PRIME_UPSELL",PRIME_VARIANT:"PRIME"}}});"use strict";e.when("dp-latency-marker").register("valuepick_metrics",function(){return{updateCounter:function(g){c.ue&&
c.ue.count&&c.ue.count(g,(c.ue.count(g)||0)+1)},updateLatency:function(g,e){c.ue&&c.ue.count&&c.ue.count(g,e)}}});"use strict";e.when("jQuery","A","valuepick_constants","valuepick_metrics").register("valuepick_resourceHandler",function(c,e,b,d){function p(a,b){b.forEach(function(b){b.strong?a.find("b").append(b.text):a.append(b.text)})}function l(a){var b=a.fragments;return b?(a=b.map(function(b){var a=b.semanticContent;return a&&a.content.text?{text:a.content.text,strong:a.strong||!1}:b.text?{text:b.text,
strong:!1}:{text:"",strong:!1}}),0<=a.map(function(a){return a.text}).indexOf("")?k:a):a.text?[{text:a.text,strong:!1}]:k}return{businessDiscountsSummaryV1:{success:function(a,h){if((a=a.entity.buyingOptions[0].businessDiscountsSummary)&&a.entity&&a.entity.featuredDiscountMessage){h=a.entity.featuredDiscountMessage;var e=h.label?h.label.content:k,f=h.message;if(e||f){var n=e?l(e):k;a=f?l(f):k;e&&!n||f&&!a?d.updateCounter(b.METRICS.BUSINESS_DISCOUNTS_MESSAGE_PARSING_FAILURE):(n&&(e=c(".value-pick-business-discount-label"),
p(e,n),"BADGE"===h.label.highlightingStyle&&e.addClass("value-pick-business-discounts-badge")),a&&(h=c(".value-pick-business-discount-message"),p(h,a)),c(".value-pick-business-discount-message-container").removeClass("aok-hidden"),d.updateCounter(b.METRICS.BUSINESS_DISCOUNTS_MESSAGE_SUCCESS))}else d.updateCounter(b.METRICS.BUSINESS_DISCOUNTS_MESSAGE_EMPTY_RESPONSE)}else d.updateCounter(b.METRICS.BUSINESS_DISCOUNTS_MESSAGE_EMPTY_RESPONSE)},error:function(a,c){d.updateCounter(b.METRICS.BUSINESS_DISCOUNTS_MESSAGE_FAILURE)},
always:function(a){c(".value-pick-business-discount-loading-bar").addClass("aok-hidden")}},deliveryV2:{success:function(a,c){if((a=a.entity.buyingOptions[0].delivery)&&a.entity&&a.entity.messageInstructions){c=!1;for(var e=0;e<a.entity.messageInstructions.length;e++){var f=a.entity.messageInstructions[e];if(f.type===b.PRIME.PRIME||f.type===b.PRIME.SUB_SAME_DAY||f.type===b.PRIME.SUB_SAME_DAY_PAID||f.type===b.PRIME.PRIME_ONE_DAY||f.type===b.PRIME.PRIME_SAME_DAY||f.type===b.PRIME.PRIME_BADGE)c=!0;if(f.variant===
b.PRIME.PRIME_UPSELL_VARIANT||f.variant===b.PRIME.PRIME_VARIANT)c=!0;if(c)break}c&&document.getElementById("value-pick-prime-badge-lazy-loading").classList.remove("aok-hidden");d.updateCounter(b.METRICS.PRIME_BADGE_SUCCESS)}else d.updateCounter(b.METRICS.PRIME_BADGE_EMPTY_RESPONSE)},error:function(a,c){d.updateCounter(b.METRICS.PRIME_BADGE_FAILURE)},always:function(a){}}}})});
/* ******** */
(function(f){var h=window.AmazonUIPageJS||window.P,m=h._namespace||h.attributeErrors,c=m?m("BeautyRecommendationAssets",""):h;c.guardFatal?c.guardFatal(f)(c,window):c.execute(function(){f(c,window)})})(function(f,h,m){f.when("jQuery","cf").register("beauty-recommendations-cf",function(c){function d(g,a){g="bRec"+(g?"Vert":"Horiz")+"ImgHolder";for(var b,d,e=0;e<k;e++)b=g+e,b=c("#"+b),d=c("#bRecImg"+e),a?m(d,a[e],b):d.detach().appendTo(b)}function f(g){g="bRec"+(g?"Vert":"Horiz")+"CheckHolder";for(var a,
b,d=0;d<k;d++)a=g+d,a=c("#"+a),b=c("#bRecCheckOuter"+d),b.detach().appendTo(a)}function h(a,b){b=b.offset();a=a.offset();return{top:a.top-b.top,left:a.left-b.left}}function m(a,b,c){e.css("position","relative");a.css("left",b.left);a.css("top",b.top);a.css("position","absolute");a.detach().appendTo(e);setTimeout(function(){var b=h(c,e);a.animate({left:b.left,top:b.top},250,"swing")},1);setTimeout(function(){a.detach().appendTo(c);a.css("position","static");e.css("position","static")},400)}function p(){for(var a,
b=[],d=0;d<k;d++)a=c("#bRecImg"+d),a=h(a,e),b.push(a);return b}var k,e,b,l,n,a,q,r;return{init:function(){k=c(".bRecVerticalContent").length;e=c("#beautyRecommendations");b=c("#bRecHorizontalView");l=c("#bRecVerticalView");n=c("#bRecToggle");a=c("#useWithDot");q=!0;r=!1;if(1<k){l.hide();q=!1;b.show();r=!0;d(!1,null);f(!1);for(var g=0;g<k;g++)c("#bRecCheckbox"+g).prop("checked",!0);n.css("visibility","visible");n.click(function(a){c.get(c(this).data("foresterurl"));var e=p();r?(b.hide(),r=!1,l.fadeIn(400,
function(){q=!0}),d(!0,e),f(!0)):q&&(l.hide(),q=!1,b.fadeIn(400,function(){r=!0}),d(!1,e),f(!1));a.preventDefault()});a.click(function(){n.click()})}}}});f.when("A","jQuery","ready").register("beauty-recommendations-ready",function(c,d){function f(a){switch(a){case 0:return b.bRecCart1;case 1:return b.bRecCart2;case 2:return b.bRecCart3;case 3:return b.bRecCart4;default:return b.bRecCart1}}function h(a){switch(a){case 0:return b.bRecWish1;case 1:return b.bRecWish2;case 2:return b.bRecWish3;case 3:return b.bRecWish4;
default:return b.bRecWish1}}function m(a){switch(a){case 0:return b.bRecPrice1;case 1:return b.bRecPrice2;case 2:return b.bRecPrice3;case 3:return b.bRecPrice4;default:return b.bRecPrice1}}function p(a){return d("#bRecCheckbox"+a)}function k(){for(var a=0,b,c,e=0;e<l;e++)c=d("#bRecImg"+e),(b=p(e).prop("checked"))?(a++,c.removeClass("bRecDisabled")):c.addClass("bRecDisabled");d("#bRecAddToCart").find("span.a-button-text").text(f(a));d("#bRecAddToList").find("span.a-button-text").text(h(a));d("#bRecPriceLabel").text(m(a));
a="";for(b=0;b<l;b++)a+=p(b).prop("checked")?"1":"0";a=parseInt(a,2);a=n[a];d("#bRecPrice").text(a)}var e,b,l,n;return{init:function(){var a=d("#bRecDataDiv").find("script").html();e=a?d.parseJSON(a):c.state("beautyRecommendations");b=c.state("bRecDynamicStrings");if(e){l=e.numRecommendations;n=e.possibleSums;for(a=0;a<l;a++)p(a).change(k);d("#bRecPricePara").removeClass("a-hidden");k()}}}})});
/* ******** */
(function(c){var e=window.AmazonUIPageJS||window.P,d=e._namespace||e.attributeErrors,a=d?d("PantryAddressWidgetAsset",""):e;a.guardFatal?a.guardFatal(c)(a,window):a.execute(function(){c(a,window)})})(function(c,e,d){c.when("A","ready","pantry-page","enable-pantry-dp-paw-asset").execute("paw-cia",function(a){var c=function(b){b&&0!==Number(b.isValidAddress)?a.$("form#add-zip").unbind("submit").submit():d(b)},d=function(b){b&&0===Number(b.isValidAddress)?a.$("div#paw-form-invalid-zip-error").removeClass("aok-hidden"):
a.$("div#paw-form-general-error").removeClass("aok-hidden");a.$("form#add-zip input[name\x3d'zip']").removeAttr("disabled");a.$("form#add-zip .a-button").removeClass("a-button-disabled");a.$("div#paw-button-spinner").addClass("aok-hidden")};a.$("form#add-zip").submit(function(b){b.preventDefault();a.$("form#add-zip input[name\x3d'zip']").attr("disabled","disabled");a.$("form#add-zip .a-button").addClass("a-button-disabled");a.$("div#paw-form-invalid-zip-error").addClass("aok-hidden");a.$("div#paw-form-general-error").addClass("aok-hidden");
a.$("div#paw-button-spinner").removeClass("aok-hidden");b={locationType:"LOCATION_INPUT",zipCode:a.$("form#add-zip input[name\x3d'zip']").val().toUpperCase(),deviceType:"web",pageType:e.ue_pty,actionSource:"pantry-detail-page"};a.post("/gp/delivery/ajax/address-change.html",{contentType:"application/x-www-form-urlencoded;charset\x3dutf-8",params:b,success:c,error:d})})});"use strict";c.when("A","atf").execute("pantry-enable-pantry-dp-paw-asset-gate",function(a){c.declare("enable-pantry-dp-paw-asset",
!0)})});
/* ******** */
(function(q){var n=window.AmazonUIPageJS||window.P,t=n._namespace||n.attributeErrors,e=t?t("PantryCDListAssets",""):n;e.guardFatal?e.guardFatal(q)(e,window):e.execute(function(){q(e,window)})})(function(q,n,t){q.when("A","a-dropdown","a-button","pantry-product-tile-utils","pantry-product-tile-quantity","enable-pantry-cd-list-asset","ready").execute(function(e,q,n,r,f,u){var l=e.$;u=r.prefix;var g=r.selectors,c=r.controlClasses,t=r.formUrls,x=r.ajaxUrls;e.declarative(u+"-cdlist-delete","click",function(k){var a=
r.getItemContainerByElement(k.$target);if(n(a.find(g.itemCDListDeleteButton)).isEnabled()){var p=n(a.find(g.itemATCButton));f.getQuantity(a);var b=k.data,m=b.asin,d=b.cdListId;if(d){var h=f.getQuantity(a);f.setQuantity(a,0);f.disableQuantities(a);p.disable();a.addClass(c.cdListExecuting);e.post(x.deleteFromCDListUrl,{params:{asin:m,cdListId:d,quantity:h},success:function(b){if(0===Number(b.status))a.find(g.itemMessaging).html(b.messaging),a.removeClass(c.cdListExecuting),a.addClass(c.cdListDeleteSuccess),
l(".p-cdlist-"+d+"-item-count").html(b.itemCountString);else{var v=a.find(g.itemMessaging);a.removeClass(c.cdListExecuting);a.addClass(c.cdListActionError);v.find(g.itemCDListActionError).remove();v.append(b.messaging);e.delay(function(){a.removeClass(c.cdListActionError);f.enableQuantities(a);p.enable()},3E3)}},error:function(b){var c=l('\x3cform action\x3d"'+t.cdListUrl+"/"+d+'" method\x3d"POST"\x3e\x3c/form\x3e');e.each({action:"deleteItem",cdListId:d,asin:m,quantity:h},function(a,b){c.append(l('\x3cinput type\x3d"hidden"\x3e').attr({name:b,
value:a}))});a.append(c);c.submit()}});k.$event.preventDefault()}}});e.declarative(u+"-cdlist-delete-undo","click",function(k){var a=k.data,p=a.quantity,b=r.getItemContainerByElement(k.$target),m=n(b.find(g.itemATCButton));a=k.data;var d=a.asin,h=a.cdListId;h&&(b.addClass(c.cdListUndoingDelete),e.post(x.undoDeleteFromCDListUrl,{params:{asin:d,cdListId:h,quantity:p},success:function(a){if(0===Number(a.status))b.removeClass(c.cdListUndoingDelete),b.removeClass(c.cdListDeleteSuccess),f.enableQuantities(b),
f.setQuantity(b,p),m.enable(),l(".p-cdlist-"+h+"-item-count").html(a.itemCountString);else{var d=b.find(g.itemMessaging);b.removeClass(c.cdListUndoingDelete);b.removeClass(c.cdListDeleteSuccess);b.addClass(c.cdListActionError);d.find(g.itemCDListActionError).remove();d.append(a.messaging);e.delay(function(){b.removeClass(c.cdListActionError);b.addClass(c.cdListDeleteSuccess);f.enableQuantities(b);m.enable()},3E3)}},error:function(a){var c=l('\x3cform action\x3d"'+t.cdListUrl+"/"+h+'" method\x3d"POST"\x3e\x3c/form\x3e');
e.each({action:"addItem",cdListId:h,asin:d,quantity:p},function(a,b){c.append(l('\x3cinput type\x3d"hidden"\x3e').attr({name:b,value:a}))});b.append(c);c.submit()}}),k.$event.preventDefault())});e.declarative(u+"-cdlist-move","change",function(k){var a=r.getItemContainerByElement(k.$target),p=n(a.find(g.itemATCButton)),b=f.getQuantity(a),m=a.find(g.itemCDListMoveToSelect),d=q.getSelect(m),h=d.val(),u=m.find('option[value\x3d"'+h+'"]').text();d.update({status:"disabled"});d.setValue("");d.update({status:"normal"});
m=k.data;var v=m.asin,w=m.cdListId;w&&(f.disableQuantities(a),p.disable(),a.addClass(c.cdListExecuting),e.post(x.moveToCDListUrl,{params:{asin:v,cdListId:w,moveToCDListId:h,quantity:b},success:function(b){if(0===Number(b.status)){var d=l(b.messaging);d.find(g.itemCDListMovedTo).html('\x3ca href\x3d"/gp/pantry/yourlists/'+h+'"\x3e'+u+"\x3c/a\x3e");a.find(g.itemMessaging).html(d);a.removeClass(c.cdListExecuting);a.addClass(c.cdListMoveSuccess);f.enableQuantities(a);f.setQuantity(a,0);f.disableQuantities(a);
l(".p-cdlist-"+w+"-item-count").html(b.itemCountString);l(".p-cdlist-"+h+"-item-count").html(b.moveToListItemCountString)}else a.find(g.itemMessaging),a.removeClass(c.cdListExecuting),a.addClass(c.cdListActionError),a.find(g.itemMessaging).html(b.messaging),e.delay(function(){a.removeClass(c.cdListActionError);f.enableQuantities(a);p.enable()},3E3)},error:function(c){var d=l('\x3cform action\x3d"'+t.cdListUrl+"/"+w+'" method\x3d"POST"\x3e\x3c/form\x3e');e.each({action:"moveItem",cdListId:w,moveToCDListId:h,
asin:v,quantity:b},function(a,b){d.append(l('\x3cinput type\x3d"hidden"\x3e').attr({name:b,value:a}))});a.append(d);d.submit()}}),k.$event.preventDefault())})});"use strict";q.when("A").execute("pantry-enable-pantry-cd-list-asset-gate",function(e){q.declare("enable-pantry-cd-list-asset",!0)})});
/* ******** */
(function(c){var b=window.AmazonUIPageJS||window.P,d=b._namespace||b.attributeErrors,a=d?d("PantryCPIAssets",""):b;a.guardFatal?a.guardFatal(c)(a,window):a.execute(function(){c(a,window)})})(function(c,b,d){c.when("A","atf").execute("pantry-enable-pantry-dp-cpi-asset-gate",function(a){c.declare("enable-pantry-dp-cpi-asset",!0)});"use strict";c.when("A","pantry-cpi-atc","enable-pantry-dp-cpi-asset","ready").execute(function(a,b){var d=a.throttle(function(a){b.itemsAddedToCart(a)},2500,{trailing:!1});
a.on("pantryAtcSuccess",function(a){d(a)});a.on("pantryAtcClick",function(a){b.positionBar()});c.when("ewc.app").execute(function(a){a.on("ewc:cartUpdate:success",function(a){d({});b.positionBar()})});b.hideGenericMessage()})});
/* ******** */
(function(k){var h=window.AmazonUIPageJS||window.P,u=h._namespace||h.attributeErrors,c=u?u("PantryCommonUtilsAssets",""):h;c.guardFatal?c.guardFatal(k)(c,window):c.execute(function(){k(c,window)})})(function(k,h,u){k.when("A","a-dropdown","a-button","enable-pantry-common-utils-asset","ready").register("pantry-product-tile-common-utils",function(c,e,v){var f=c.$,l=f(h),p={itemContainer:".p-prod-tile",itemQuantitySelect:".p-prod-tile-quantity-select",itemQuantityDisplay:".p-prod-tile-quantity",itemQuantityInput:".p-prod-tile-quantity-input",
itemButtons:".p-prod-tile-buttons",itemATC:".p-prod-tile-atc",itemPromo:".p-prod-tile-promo",itemInCart:".p-prod-tile-in-cart",itemMessaging:".p-prod-tile-messaging",itemInlineUpsell:".p-prod-tile-inline-upsell",itemMessageOverImg:".p-prod-tile-message-over-img",itemDetail:".p-prod-tile-detail",itemCarousel:".p-prod-tile-carousel",itemCDListActions:".p-prod-tile-cdlist-actions",itemCDListMoveToSelect:".p-prod-tile-cdlist-move-dropdown",itemCDListDeleteButton:".p-prod-tile-cdlist-delete-button",itemCDListMovedTo:".p-prod-tile-cdlist-moved-to",
itemCDListActionError:".p-prod-tile-cdlist-action-error",aoosButton:".p-prod-tile-aoos-button",aoosError:".p-prod-tile-aoos-error"},q=f("body"),n={addToCartUrl:"/gp/pantry/ajax/product/add-to-cart.html",miniDpaddToCartUrl:"/gp/pantry/ajax/product/add-to-cart-mini-dp.html",deleteFromCDListUrl:"/gp/pantry/ajax/product/delete-item-from-cdlist.html",moveToCDListUrl:"/gp/pantry/ajax/product/move-item-to-cdlist.html",undoDeleteFromCDListUrl:"/gp/pantry/ajax/product/undo-delete-item-from-cdlist.html",updateCDListItemQuantityUrl:"/gp/pantry/ajax/product/change-cdlist-item-quantity.html",
viewSimilarItemsUrl:"/gp/pantry/ajax/product/mobile/get-mobile-aoos-carousel.html",cxVersionErrorMetricUrl:"/gp/pantry/ajax/product/cxVersionErrorMetric.html"},r=function(a,b){b=b||q;return b.find(".p-prod-tile-asin-"+a)},w=function(a){a=f(a).attr("class").split(/\s+/);for(var b=0;b<a.length;b++){var c=a[b];if(-1!==c.indexOf("p-prod-tile-type-"))return c.substring(17)}},d=function(a,b,t){var m={tileType:b,mode:t,ref_:"p_prod_tile_atc_"+b};c.each(a,function(a,b){c.each(a,function(a,c){"sessionId"===
c?m[c]=a:"refTag"===c?m.ref_=a:m[b+"."+c]=a})});return m},x=c.state("pantry-strings")||{},g=function(){var a=c.state("cpi_hybrid_pages");if(!a)return!0;var b="excludedPathList"in a?a.excludedPathList:[],t="includedQueryParamList"in a?a.includedQueryParamList:[];if(!("disableHybridPages"in a&&a.disableHybridPages))return!0;var m=h.location.pathname;"/"!==m.substr(-1)&&(m+="/");for(a=0;a<b.length;a++)if(0<=m.indexOf(b[a])){b=h.location.search;for(a=0;a<t.length;a++)if(0<=b.indexOf(t[a]))return!0;return!1}return!0};
return{commonAPI:{$window:l,prefix:"p-prod-tile",resultsContainer:q,ajaxTriggeringOffset:1200,ajaxUrls:n,formUrls:{addToCartUrl:"/gp/pantry/actions/add-items.html",cdListUrl:"/gp/pantry/yourlists"},tileTypes:{CDLIST:"cdlist",LIST:"list",SIMILAR_ITEM:"similarItem",CAROUSEL:"carousel",MOBILE_LIST:"mobile-list",MOBILE_CDLIST:"mobile-cdlist"},atcModes:{SINGLE:"single",MULTI:"multi"},popoverFeatures:{"default":{timeout:5E3},minimumOrderValue:{timeout:1E4},inlineUpsell:{timeout:15E3}},ajaxAddToCartUrl:"/gp/pantry/ajax/product/add-to-cart.html",
formAddToCartUrl:"/gp/pantry/actions/add-items.html",miniDpaddToCartUrl:"/gp/pantry/ajax/product/add-to-cart-mini-dp.html",dpAddToCartURL:"/gp/pantry/ajax/product/add-to-cart-dp.html",elementTopAboveWindowBottom:function(a,b){a=f(a).offset().top;var c=l.scrollTop()+l.height();b&&(a+=b);return a<=c},elementTopBelowWindowTop:function(a,b){a=f(a).offset().top;var c=l.scrollTop();b&&(a+=b);return a>=c},updateNavCartCount:function(a){a&&h.$Nav&&h.$Nav.when("api.setCartCount").run(function(b){b(a)})},getItemContainersByAsin:r,
getItemContainerByElement:function(a,b){return f(a).closest(p.itemContainer)},getItemContainerType:w,getItemContainerAsin:function(a){a=f(a).attr("class").split(/\s+/);for(var b=0;b<a.length;b++){var c=a[b];if(-1!==c.indexOf("p-prod-tile-asin-"))return c.substring(17)}},roundToDecimal:function(a,b){return+parseFloat(a).toFixed(b)||0},createParamsForAjaxHandler:d,extendParamsForAjaxHandler:function(a,b,c,m){b=d(b,c,m);b.isAddAnother=a;return b},updateUrlParameters:function(a,b){c.each(b,function(b,
c){var d=new RegExp("([?\x26])"+c+"\x3d[^\x26#]*");a=a.match(d)?a.replace(d,"$1"+c+"\x3d"+b):a+((-1===a.indexOf("?")?"?":"\x26")+c+"\x3d"+b)});return a},submitToFormHandler:function(a){var b={"submit.addToCart":"addToCart",ref_:"p_prod_tile_atc_form"},d=f('\x3cform action\x3d"/gp/pantry/actions/add-items.html" method\x3d"POST"\x3e\x3c/form\x3e'),m=1;c.each(a,function(a,c){b["offeringID."+m]=a.offeringId;b["pantryRegion."+m]=a.pantryRegion;b["quantity."+m]=a.quantity;b["asin."+m]=c;b["session-id"]=
a.sessionId;b["anti-csrftoken-a2z"]=a.csrftoken;m++});c.each(b,function(a,b){d.append(f('\x3cinput type\x3d"hidden"\x3e').attr({name:b,value:a}))});q.append(d);d.submit()},disableCDListActions:function(a){var b=e.getSelect(a.find(p.itemCDListMoveToSelect));b&&b.update({status:"disabled"});(a=v(a.find(p.itemCDListDeleteButton)))&&a.disable()},enableCDListActions:function(a){var b=e.getSelect(a.find(p.itemCDListMoveToSelect));b&&b.update({status:"normal"});(a=v(a.find(p.itemCDListDeleteButton)))&&a.enable()},
getTileTypesByAsin:function(a){var b={};r(a).each(function(a,c){a=w(c);b[a]=!0});var d=[];c.each(b,function(a,b){d.push(b)});return d},getString:function(a){return x[a]},addATCHanlder:function(a){c.on("pantryTileItemATCSuccess",a)},logCXVersionError:function(a){c.post(n.cxVersionErrorMetricUrl,{cache:!1,params:{tileType:a}})},showCPIWidget:function(){k.when("pantry-cpi-mobile-message-provider").execute(function(a){g()&&a.showCPIWidget()})},isValidUrlForCPI:g,getActionUrl:function(a,b,d){return a+
"?"+c.$.param({ref_:b,"discoveredAsins.0":d})}},selectors:p,controlClasses:{itemZero:"p-prod-tile-zero",atcExecuting:"p-prod-tile-atc-executing",atcSuccess:"p-prod-tile-atc-success",inuSuccess:"p-prod-tile-inu-success",cdListExecuting:"p-prod-tile-cdlist-executing",cdListDeleteSuccess:"p-prod-tile-cdlist-delete-success",cdListActionError:"p-prod-tile-cdlist-action-error",cdListUndoingDelete:"p-prod-tile-cdlist-undoing-delete",cdListUndoError:"p-prod-tile-cdlist-delete-undo-error",cdListMoveSuccess:"p-prod-tile-cdlist-move-success",
aoosViewSimilarToggle:"p-prod-tile-aoos-view-similar-toggle",aoosCollapsed:"p-prod-tile-aoos-collapsed",aoosExpanded:"p-prod-tile-aoos-expanded",aoosSlidedOut:"p-prod-tile-aoos-slidedOut",aoosExecuting:"p-prod-tile-aoos-executing",aoosSuccess:"p-prod-tile-aoos-success"}}});"use strict";k.when("A","enable-pantry-common-utils-asset").register("pantry-product-tile-metrics",function(c){return{addCounter:function(c){var e=h.ue;"undefined"!==typeof e&&e.count(c,1)}}});"use strict";k.when("A","pantry-product-tile-utils",
"pantry-product-tile-atc-base","a-popover","enable-pantry-common-utils-asset","ready").execute(function(c,e,k,f){var l=c.$,h=l("body");c.declarative("mini-dp-sims-select","click",function(c){c.$currentTarget.parent().find("img").removeClass("current");c.$target.addClass("current");var d=c.data;c=d.asin;d=d.primaryAsin;var e=document.getElementsByClassName("p-prod-tile-mini-dp-details-row-primary-"+d),g=document.getElementsByClassName("p-prod-tile-mini-dp-details-"+d+"-"+c);e=e[0];g=g[0];l(".p-prod-tile-mini-dp-box-fill-confirmation-"+
d+"-"+c).removeClass("p-prod-tile-mini-dp-percent-section-show");e.innerHTML=g.innerHTML});var q=function(k){var d={"submit.addToCart":"addToCart",ref_:"p-mini-dp-form"},f=l('\x3cform action\x3d"'+e.formAddToCartUrl+'" method\x3d"POST"\x3e\x3c/form\x3e'),g=1;c.each(k,function(a,b){d["offeringID."+g]=a.offeringId;d["pantryRegion."+g]=a.pantryRegion;d["quantity."+g]=a.quantity;d["asin."+g]=b;d["session-id"]=a.sessionId;g++});c.each(d,function(a,b){f.append(l('\x3cinput type\x3d"hidden"\x3e').attr({name:b,
value:a}))});h.append(f);f.submit()},n=function(e){var d={ref_:"p-mini-dp"};c.each(e,function(e,g){c.each(e,function(a,b){"sessionId"===b?d[b]=a:d[g+"."+b]=a})});return d},r=function(c){q(c)};c.declarative("p-prod-tile-mini-dp-atc","click",function(f){var d=f.data,h=f.$target.closest("form");e.getItemContainerByElement(h);var g=d.asin,a={};f.$event.preventDefault();d.quantity=1;a[g]=d;c.post(e.miniDpaddToCartUrl,{params:n(a),success:function(b){var c=b.pantryBox,d=b.cartCount,f=b.itemMessagings,h=
b.wayfinderBoxHtml,p=b.enableWayfinderSavingInfo,n=b.pantrySavingInfo,r=b.wayfinderSavingHtml;!b.error&&c&&d&&h?(b=".p-prod-tile-mini-dp-atc-confirm-"+a[g].primaryAsin+"-"+g,p?k.updateWayfinderSavingInfo(n,r):k.updateWayfinder(c,h),e.updateNavCartCount(d),l(b).addClass("p-prod-tile-mini-dp-atc-confirm-success"),c=".p-prod-tile-mini-dp-box-fill-confirmation-"+a[g].primaryAsin+"-"+g,f=f[g],l(c).html(f),l(c).addClass("p-prod-tile-mini-dp-percent-section-show")):q(a)},error:function(){"undefined"!==typeof r&&
q(a)}})})});"use strict";k.when("A","pantry-product-tile-utils","enable-pantry-common-utils-asset","ready").execute(function(c,e){var h=c.$,f=e.prefix;c.declarative(f+"-similar-pagination","click",function(e){var k=function(c){c=h(c);n.empty().append(c);n.css("opacity",1)},l=e.$target.closest("li"),n=l.closest(".a-pagination").closest("."+f+"-popover-content");e.$event.preventDefault();e.$event.stopPropagation();l.hasClass("a-disabled")||l.hasClass("a-selected")||(e=l.find("a").attr("href"),n.css("opacity",
.5),c.get(e,{success:k}));return!1})});"use strict";k.when("A","pantry-product-tile-common-utils","enable-pantry-common-utils-asset","ready").register("pantry-product-tile-utils",function(c,e){return c.$.extend({selectors:e.selectors,controlClasses:e.controlClasses},e.commonAPI)});"use strict";k.when("A").execute("pantry-enable-pantry-common-utils-asset-gate",function(c){k.declare("enable-pantry-common-utils-asset",!0)})});
/* ******** */
(function(f){var d=window.AmazonUIPageJS||window.P,h=d._namespace||d.attributeErrors,b=h?h("PantryDetailPageATCAssets",""):d;b.guardFatal?b.guardFatal(f)(b,window):b.execute(function(){f(b,window)})})(function(f,d,h){f.when("A","a-button","inlinue-upsell-util","atf").register("pantry-inu-atc-base",function(b,f,h){var k=function(){return b.$("#pantryInlineUpsellWrapper").is(":visible")},l=function(a,b,c,e){b<c&&a.clone().appendTo(".inu-list");a.html(e.textToShow);a.attr("href",e.URL);a.attr("title",
e.textToShow)},m=function(a,b,c,e,g){c<e&&(b.clone().appendTo(".inu-list"),a.clone().appendTo(".inu-list"));e={ref:g.URL,text:g.textToShow};b.attr("data-action","pantry-inu-click");b.attr("data-pantry-inu-click",JSON.stringify(e));b.attr("id","pantry-inu-click-"+c);a.appendTo(b.find("#pantry-inu-link"));a.html(g.textToShow);a.attr("href",g.URL);a.attr("title",g.textToShow)},n=0,p=function(a,t,c){n&&(a={pageType:"Detail",subPageType:"InlineUpsell",eventData:JSON.stringify({pageType:"Detail",pageWidget:"InlineUpsell",
uiAction:a,itemDescription:t,advertisementId:c})},b.post("/gp/pantry/ajax/log-nexus-message.html",{params:a}))},q=function(a,b,c){d.ueLogError&&d.ueLogError(a,{logLevel:"ERROR",attribution:b,message:c})},r=function(a,d){if(!k()){var c=h.getASIN(),e=b.$("#pantry-inu-action"),g=b.$(".inu-item");a=a[c];var f=a.length-1;b.$.each(a,function(a,c){1===d&&null!==e?(m(g,e,a,f,c),e=b.$("#pantry-inu-action:last")):l(g,a,f,c);g=b.$(".inu-item:last")});n=d;p("PageUpdate",c,"");b.$("#pantryInlineUpsellWrapper").slideDown()}};
return{updateNavbarCartCount:function(a){a&&d.$Nav&&d.$Nav.when("api.setCartCount").run(function(b){b(a)})},updateFreeShipping:function(){b.ajax("/gp/pantry/wayfinder/free-shipping-promo-bar.html",{cache:!1,method:"get",success:function(a){a.trim()&&b.$("#pantry-wayfinder-free-shipping-promo-bar").html(a)}})},isRecommendationVisible:k,appendRecommendation:l,appendRecommendationWithAction:m,logINUNexusMessage:p,showRecommendation:function(a,b){try{r(a,b)}catch(c){q(c,"PantryInlineUpsell","Show recommendation failed on Desktop or Mobile DP:")}},
showConfirmation:function(){var a=b.$("#pantry-inu-confirmation");a&&a.show()},logError:q,doShowRecommendation:r}});"use strict";f.when("A","atf").execute("pantry-enable-pantry-dp-atc-asset-gate",function(b){f.declare("enable-pantry-dp-atc-asset",!0)})});
/* ******** */
(function(b){var c=window.AmazonUIPageJS||window.P,d=c._namespace||c.attributeErrors,a=d?d("PantryDetailPageCommonAssets",""):c;a.guardFatal?a.guardFatal(b)(a,window):a.execute(function(){b(a,window)})})(function(b,c,d){b.when("A","atf").execute("pantry-page-detector",function(a){(a.$("#pantryStoreInfo_feature_div").text()||a.$("#pantryBuyBox_feature_div").length||a.$(".a-declarative[data-action\x3d'aw-mash-pantry']").length)&&b.declare("pantry-page",!0)})});
/* ******** */
(function(c){var b=window.AmazonUIPageJS||window.P,d=b._namespace||b.attributeErrors,a=d?d("DetailPageQuantityAwarePriceAssets",""):b;a.guardFatal?a.guardFatal(c)(a,window):a.execute(function(){c(a,window)})})(function(c,b,d){});
/* ******** */
(function(c){var b=window.AmazonUIPageJS||window.P,d=b._namespace||b.attributeErrors,a=d?d("DetailPageVoltageComplianceAssets",""):b;a.guardFatal?a.guardFatal(c)(a,window):a.execute(function(){c(a,window)})})(function(c,b,d){});
/* ******** */
(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("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 d="";g.ue&&(d=g.ue.id);var c=X+"weblabValue\x3d"+Z+"\x26requestId\x3d"+d;navigator&&navigator.sendBeacon?(d=navigator.sendBeacon(c))||a.$.ajax({url:c}):a.$.ajax({url:c})}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 d=v("#cps-atc-changeover");if(0<d.length){var c=a.state("cps-atc-toast-text");if(c&&c.atcToastTextString){c=c.atcToastTextString.replace("FreshATCToastQuantity",b.inputs.quantity);var e=d.find(".a-changeover-inner");e&&(e.text(c),d.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"),d=n("inst-button-space"),c=n("inst-indicator");b.addClass("inst-btn-opacity");
a.hide();d.removeClass("aok-hidden");c.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.metaData=JSON.stringify({snsContextData:{isSnSDefaultBuyingOption:f,isSnSBuyingOptionPresent:d}});return c}catch(u){return e("updatingSnSBuyBoxDataExceptionMetric"),c}}}})});
/* ******** */
(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(n){var h=window.AmazonUIPageJS||window.P,A=h._namespace||h.attributeErrors,d=A?A("DetailPageTextLinkIngressAssets@legacy",""):h;d.guardFatal?d.guardFatal(n)(d,window):d.execute(function(){n(d,window)})})(function(n,h,A){"use strict";n.when("A","a9vs-dpx-ar-metrics").register("a9vs-dpx-mweb-ar-ingress",function(d,B){var a="";return{initMobileWebAr:function(){var c=d.$("#mWebArLink");null!==document.getElementById("asin")&&(a=document.getElementById("asin").value);var e={ingressType:"ARmweb",
pageType:"ScanIt",subPageType:"Viewer",sessionType:"ARmweb",asin:a,refMarker:""};c&&(e.sessionId=c.attr("data-sessionId"),e.requestId=c.attr("data-requestId"),e.marketplaceId=c.attr("data-marketplaceId"));c.bind("click",function(){h.ue&&h.ue.count&&(ue.count("ar_mweb_LinkClicked",(ue.count("ar_mweb_LinkClicked")||0)+1),B.logEvent("ARViewLaunchedFromDetailPage",e))});h.ue&&h.ue.count&&(ue.count("ar_mweb_LinkDisplayed_shown",(ue.count("ar_mweb_LinkDisplayed_shown")||0)+1),B.logEvent("LinkDisplayed",
e))}}});"use strict";n.when("A","ready","a9vs-dpx-ar-metrics").register("a9vs-dp-visually-rich-image-block-ingress",function(d,h,a){function c(a,b,c){var f=!0;switch(a){case "ibupm":case "ibupm_floor":case "ibupm_wall_large":f=b<1.2*c;break;case "ibupm_tabletop":case "ibupm_wall_small":return!0;case "ibupm_rugs":return!1;case "ibupm_televisions_small":case "ibupm_televisions_large":return!1}return f}function e(a){var b=1;switch(a){case "ibupm":case "ibupm_floor":b=.2;break;case "ibupm_rugs":b=.4;
break;case "ibupm_tabletop":b=.45;break;case "ibupm_televisions_small":b=.45;break;case "ibupm_televisions_large":b=.3;break;case "ibupm_wall_small":b=.6;break;case "ibupm_wall_large":b=.2}return b}function n(a){var b=0;switch(a){case "ibupm":case "ibupm_floor":b=.05;break;case "ibupm_rugs":b=.2;break;case "ibupm_tabletop":case "ibupm_televisions_small":case "ibupm_televisions_large":b=.01;break;case "ibupm_wall_small":b=.01;break;case "ibupm_wall_large":b=.01}return b}function B(a){var b=0;switch(a){case "ibupm":case "ibupm_floor":b=
43;break;case "ibupm_rugs":b=75;break;case "ibupm_tabletop":b=50;break;case "ibupm_televisions_small":b=135;break;case "ibupm_televisions_large":b=70;break;case "ibupm_wall_small":b=150;break;case "ibupm_wall_large":b=90}return b}function F(a){var b=0;switch(a){case "ibupm":case "ibupm_floor":b=2.44;break;case "ibupm_rugs":b=.2;break;case "ibupm_tabletop":b=1;break;case "ibupm_televisions_small":b=1.5;break;case "ibupm_televisions_large":b=2;break;case "ibupm_wall_small":b=5;break;case "ibupm_wall_large":b=
1.5}return b}function Q(a){var b=0;switch(a){case "ibupm":case "ibupm_floor":b=20;break;case "ibupm_rugs":b=20;break;case "ibupm_tabletop":b=35;break;case "ibupm_televisions_small":b=110;break;case "ibupm_televisions_large":b=65;break;case "ibupm_wall_small":b=100;break;case "ibupm_wall_large":b=30}return b}var C=.65;return{initialize:function(f){if((f=d.$("#image-block-arview-launcher").data("image-block-launch-arview"))&&f.imageBlockFlavor){"true"===localStorage.getItem("onIBUPM")&&a.logEvent("ScreenRefreshIBUPM",
{linkName:"dpx-image-block-ingress",refMarker:f.refTag,asin:f.asin,pageType:"ImageBlockIngress",subPageType:"IBUPM",sessionId:f.sessionId,requestId:f.requestId,marketplaceId:f.marketplaceId});var b=d.$("#ar-ib-ingress-overlay-id"),h=d.$("#ar-ib-ingress-spinner-id"),w=d.$("#ar-ib-ingress-container-id"),P=d.$("#ar-ib-ingress-button-btn-id"),D=d.$("#ar-ib-ingress-phone-container-id"),l=d.$("#ar-ib-ingress-product-id"),u=d.$("#ar-ib-ingress-outline-id"),r=d.$("#ar-ib-ingress-phone-screen-id"),p=w.width(),
m=D.width(),q=r.width(),I=r.height(),k=f.mediaDetails[0],g=k.widthInMeters,t=k.heightInMeters,x=k.depthInMeters;f=f.imageBlockFlavor;if("number"===typeof m&&isFinite(m)&&0!==m){"ibupm_wall_small"==f?D[0].style.bottom="30px":"ibupm_tabletop"==f?(g/=Math.cos(Math.PI/4),k=l.height()/l.width(),t=g*k):"ibupm_rugs"==f&&(x=t,t=.45*g,C=.4);k=(7*(x+n(f))/9+g)*p*e(f);g=t*k/g;x=B(f)-33*x/F(f);t=g/k;g=Math.min(w.height()*C,g);m=g===w.height()*C?g/t:Math.min(.85*m,k);g=Math.min(w.height()*C,m*t);k=Math.min(Q(f),
x);"ibupm_wall_large"===f&&(k+=85);l.width(m);u.width(m);l.height(g);u.height(g);l.css("bottom",k);u.css("bottom",k);l.addClass(f);u.addClass(f);if(c(f,m,q)){l.addClass("tall");u.addClass("outline-tall");r.addClass("vertical");l=Math.min(p-q-10-10-10,(p+m)/2-q/3-10);document.body.style.setProperty("--horizontal-animation-start",Math.max(0,(p-m)/2-2*q/3-10-10)+"px");document.body.style.setProperty("--horizontal-animation-end",l+"px");var J=null,K=null,y=null,L=null,M=null,R=18-(p-m)/2,S=p-q-12-(p-
m)/2,T=q-10-10-190;var N=function(){y=r.position().left;J=y+R;K=S-y;L=y+-20;M=y+T;document.body.style.setProperty("--left-clip",J+"px");document.body.style.setProperty("--right-clip",K+"px");document.body.style.setProperty("--outline-left-clip",L+"px");document.body.style.setProperty("--outline-right-clip",M+"px")}}else{l.addClass("wide");u.addClass("outline-wide");r.addClass("horizontal");r.height(m+10+10);var v=q*(m+10+10)/I;p=l.position().top;var G=12*v/q;q=(l=v>g+G+40&&50>g)?2*g/3:p-2*v/3-D.position().top;
l=l?-10:q+g+50-G-(20===k?k:40-k)-v/2;document.body.style.setProperty("--vertical-animation-start",q+"px");document.body.style.setProperty("--vertical-animation-end",l+"px");var E=null,O=null,H=null,U=6-p,V=p+g-v+6;N=function(){H=r.position().top;E=U+H;O=V-H;document.body.style.setProperty("--top-clip",E+"px");document.body.style.setProperty("--bottom-clip",O+"px");document.body.style.setProperty("--outline-top-clip",E+"px");document.body.style.setProperty("--outline-bottom-clip",E+v-G+"px")}}b.addClass("fade-out");
h.addClass("fade-out");P.addClass("ingress-fade-in");D.addClass("fade-in");var z;(new IntersectionObserver(function(a){a.forEach(function(a){a.isIntersecting?z||(z=setInterval(N,10),localStorage.setItem("onIBUPM",!0)):z&&(localStorage.setItem("onIBUPM",!1),clearInterval(z),z=A)})},{threshold:.1})).observe(w.get(0))}}}}});"use strict";n.when("A","a9vs-dpx-ar-metrics").execute(function(d,n){var a={pageType:"DPWeb",subPageType:"DYRIngress"};d.declarative("showDyrWebIngress","click",function(){n.logEvent("dyr_web_ingress_clicked",
a);var c=d.$("#dyrWebUrl")[0].defaultValue,e=(new URL(document.location)).searchParams.get("ref_");c&&(e&&(c=c+"\x26ref_\x3d"+e),h.open(c,"_self"))});d.$("#dyrLink").is(":visible")&&n.logEvent("dyr_web_ingress_shown",a)});"use strict";n.when("A").register("a9vs-dpx-ar-metrics",function(d){function n(a){Object.keys(a).forEach(function(c){"string"!==typeof a[c]&&(a[c]=String(a[c]))});return a}return{findARViewPosition:function(){try{for(var a=document.querySelectorAll(".a-carousel-card")||[],c=0;c<
a.length;c++){var e=a[c];if(e&&e.querySelector("#ar-ib-ingress-container-id")){var d=e.getAttribute("aria-posinset");return d?parseInt(d):null}}}catch(I){}return null},normalizeOSName:function(a){if(!a)return"unknown";var c=a.toLowerCase();return"android"===c?"Android":"ios"===c?"iOS":a},logEvent:function(a,c){var e=h.ue;e&&e.event&&(n(c),e.event({marketplaceId:c.marketplaceId||"ue_timeout",clickstreamRequestId:c.requestId||"ue_timeout",amazonSessionId:c.sessionId||"ue_timeout",pageType:c.pageType,
subPageType:c.subPageType,pageAction:a,vsMetricsMap:c},"a9vs-web-user","a9vsmetrics.ClientSideMetrics.2",{ssd:!0}))},appendLinkNameToDeepLink:function(a,c){try{var e=new URL(a),d=e.searchParams.get("linkID"),h=e.searchParams.get("payload");e.search="";e.searchParams.append("linkID",d);e.searchParams.append("linkName",c);e.searchParams.append("payload",h);return e.toString()}catch(F){return console.log("Error appending linkName to deepLink:",F),a}},getBaseViYRMetricsFields:function(a){return a?{pageType:"ScanIt",
subPageType:"Viewer",refMarker:a.refTag||"",asin:a.asin||"",sessionId:a.sessionId||"",requestId:a.requestId||"",marketplaceId:a.marketplaceId||"",deviceType:a.deviceType||"",deviceOS:a.deviceOS||""}:{}},logCounter:function(a){h.ue&&h.ue.count&&ue.count(a,(ue.count(a)||0)+1)}}})});
/* ******** */
(function(c){var b=window.AmazonUIPageJS||window.P,d=b._namespace||b.attributeErrors,a=d?d("DetailPageTextLinkIngressAssets@vit",""):b;a.guardFatal?a.guardFatal(c)(a,window):a.execute(function(){c(a,window)})})(function(c,b,d){});
/* ******** */
(function(b){var e=window.AmazonUIPageJS||window.P,c=e._namespace||e.attributeErrors,a=c?c("DetailPageCustomerReviewsAttributeAssets",""):e;a.guardFatal?a.guardFatal(b)(a,window):a.execute(function(){b(a,window)})})(function(b,e,c){b.when("customerReviewsAttributeSeeAllRatingsCounter").execute(function(a){a.init()});b.when("A","atf","cf","ready").register("customerReviewsAttributeSeeAllRatingsCounter",function(a){function b(){c(".cra-review-stars").removeClass("aok-hidden");var d=e.ue;d&&d.count("customerReviewsAttributeDesktopRender",
1);a.declarative("cra-expand-all-reviews","click",function(){c("#cra-expand-content").removeClass("aok-hidden");c("#cra-expand-button").addClass("aok-hidden");d&&d.count("customerReviewsAttributeSeeMoreClick",1)});a.declarative("cra-see-all-rating-click","click",function(){d&&d.count("customerReviewsAttributeSeeAllRatingsClick",1)})}var c=a.$;a.on("a:pageUpdate",function(){b()});return{init:b}})});
/* ******** */
(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){b=h.attr("data-asin");var 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(n){}}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(h){var l=window.AmazonUIPageJS||window.P,q=l._namespace||l.attributeErrors,f=q?q("AmazonDevicesDetailPageUtilityAssets",""):l;f.guardFatal?f.guardFatal(h)(f,window):f.execute(function(){h(f,window)})})(function(h,l,q){h.when("A").execute(function(f){f.declarative("popup-window","click",function(d){var b=d.data.windowName||"popupWindow",a=d.data.windowOptions||"width\x3d600,height\x3d400,scrollbars\x3dyes";d.$event.preventDefault();l.open(d.$target.prop("href"),b,a)})});"use strict";h.when("A").register("ods-element-factory",
function(f){var d=f.$;return{getHiddenInput:function(b,a){return d("\x3cinput\x3e").prop("name",b).prop("type","hidden").prop("value",a)}}});"use strict";h.register("ods-url-utils",function(){return{getUrlParam:function(f){for(var d=null,b=l.location.search.substr(1).split("\x26"),a=0;a<b.length;a++){var c=b[a].split("\x3d");c[0]===f&&(d=c[1])}return d}}});"use strict";h.when("A").register("csmCounter",function(f){var d=f.$;return{register:function(b,a,c){b&&a&&c&&d(b).bind(a,d.proxy(this.increment,
this,c))},increment:function(b){b&&l.ue.count(b,(l.ue.count(b)||0)+1)},update:function(b,a){b&&"number"===typeof a&&l.ue.count(b,a)}}});"use strict";h.register("function-utils",function(){return{throttle:function(f,d,b){var a,c,e,k=null,g=0;b||(b={});var m=function(){g=!1===b.leading?0:(new Date).getTime();k=null;e=f.apply(a,c);k||(a=c=null)};return function(){var t=(new Date).getTime();g||!1!==b.leading||(g=t);var h=d-(t-g);a=this;c=arguments;0>=h||h>d?(k&&(clearTimeout(k),k=null),g=t,e=f.apply(a,
c),k||(a=c=null)):k||!1===b.trailing||(k=setTimeout(m,h));return e}},debounce:function(f,d,b){var a;return function(){var c=this,e=arguments;clearTimeout(a);a=setTimeout(function(){a=null;b||f.apply(c,e)},d);b&&!a&&f.apply(c,e)}},memoize:function(f,d){var b={};return function(){for(var a=0<arguments.length?"":"%NO_ARGUMENTS%",c=0;c<arguments.length;c++)a&&(a+="-"),a+="object"===typeof arguments[c]?JSON.stringify(arguments[c]):arguments[c];b.hasOwnProperty(a)||(b[a]=d.apply(f,arguments));return b[a]}}}});
"use strict";h.when("A","csmCounter").register("odsRefTagUtils",function(f,d){var b=f.$;return{send:function(a,c){if(!a)throw d.increment("odsRefTagUtils_reftag_undefined"),Error("refTag is not defined");b.get((c||"/hctp/log/refMarker")+"?ref_\x3d"+a);d.increment("odsRefTagUtils_csm_counter")}}});"use strict";h.when("A").register("ods-image-utilities",function(f){function d(a,c){var e=new Image;e.onload=function(){c.resolve(a)};e.onerror=function(){c.reject(a)};e.src=a}var b=f.$;return{preloadImage:function(a,
c){var e=b.Deferred();d(a,e);if(c&&f.capabilities.hires){var k=b.Deferred();d(c,k)}return{image:e.promise(),hiResImage:k?k.promise():q}},preloadImages:function(a){for(var c=[],e=0;e<a.length;e++){var k=b.Deferred();d(a[e],k);c.push(k.promise())}return c}}});"use strict";h.when("A").register("ODSEventDispatcher",function(f){return f.createClass({init:function(){this._callbacks={}},registerCallback:function(d,b){var a=this._callbacks[d]||[];-1===a.indexOf(b)&&a.push(b);this._callbacks[d]=a},unregisterCallback:function(d,
b){if(d=this._callbacks[d])b=d.indexOf(b),-1<b&&d.splice(b,1)},dispatch:function(d){var b=this._callbacks[d];if(b)for(var a=0;a<b.length;a++)b[a].apply(this,Array.prototype.slice.call(arguments,1))}})});"use strict";h.when("A","jQuery").register("BuyboxManagerFactory",function(f,d){function b(c,a,b,g){var e=f.copy(b);d.each(e,function(e){-1===["initialize","reset"].indexOf(e)&&(c[e]=g?d.proxy(a,null,e):d.proxy(b,e))})}function a(c,a,k,g){var e=function(m){if(!h&&(g?(g.initialize(),b(f,e,g,!1)):p=
new k,h=new a(p),d.each(c,function(a,c){f[c]=d.proxy(h,c)}),"string"===typeof m))return f[m].apply(h,Array.prototype.slice.call(arguments,1))},f={reset:function(){h?(g&&g.reset(),p&&p.reset(),h.reset()):e()},initialize:e},h,p;g&&b(f,e,g,!0);d.each(c,function(c,a){f[a]=d.proxy(e,null,a)});return f}return{create:function(c,e,b){return a(c,e,b)},extend:function(c,e,b){return a(c,e,null,b)}}});"use strict";h.when("jQuery","BuyboxManagerViewHelper").register("BuyboxManagerFormHelper",function(f,d){function b(a,
c){return'\x3cinput type\x3d"hidden" name\x3d"'+a+'" value\x3d"'+c+'" /\x3e'}function a(a){return 0<=a.attr("id").search("buyNow")}function c(a){return 0<=a.attr("id").search("addToCart")||0<=a.attr("id").search("mobile-installments")}function e(a,c){return f.map(a,function(a){return f(a).attr(c)})}'input[name\x3d"%NAME%"]'.replace("%NAME%","verificationSessionID");var k='input[name\x3d"%NAME%"]'.replace("%NAME%","a"),g='input[name\x3d"%NAME%"]'.replace("%NAME%","oid"),m='input[name\x3d"%NAME%"]'.replace("%NAME%",
"quantity"),h='input[name\x3d"%NAME%"]'.replace("%NAME%","asin"),r='input[name\x3d"%NAME%"]'.replace("%NAME%","offeringID"),p='input[name\x3d"%NAME%"]'.replace("%NAME%","quantity"),l=[k,g,m].concat([h,r,p]).join(", ");return{removeAllFormFields:function(a){a.find(l).remove()},getHiddenInputHTML:b,isFormBuyNow:a,isFormAddToCart:c,createMobileAppFormInputs:function(a){var c=a[0];if(c){var e=c.asin;var k=c.offerId;var g=c.quantity}for(c=1;c<a.length;c++)e+="|"+a[c].asin,k+="|"+a[c].offerId,g+="|"+a[c].quantity;
return""+(b("asin",e)+b("offeringID",k)+b("quantity",g))},getViewData:function(b){if(a(b)){var f=e(b.find(h),"value")[0].split("|"),n=e(b.find(r),"value")[0].split("|");b=e(b.find(p),"value")[0].split("|");return d.buildRawData(f,n,b)}if(c(b))return f=e(b.find(k),"value"),n=e(b.find(g),"value"),b=e(b.find(m),"value"),d.buildRawData(f,n,b);throw Error("Add to order button not handled in buyBoxManagerFormHelper");},updateMobileAppFormInputsWithSubscriptionData:function(a,c,e){if(!f.isEmptyObject(a._digitalSubscriptionAsinMap)){var k=
[],g=a._digitalSubscriptionAsinMap,d;for(d in g)if(g.hasOwnProperty(d)){var n=g[d],m=n.name;n=n.value;k.push('input[name\x3d"%NAME%"]'.replace("%NAME%",m));k.push('input[name\x3d"%NAME%"]'.replace("%NAME%",n));delete g[d]}m=k.join(",");e.find(m).remove();a._digitalSubscriptionAsinMap=g}e="";for(g=1;g<c.length;g++)c[g].customAttribute&&(m="custom-name.%INDEX.1".replace("%INDEX",g),n="custom-value.%INDEX.1".replace("%INDEX",g),k=c[g],e+=b(m,k.customAttribute.name)+b(n,k.customAttribute.value),a._digitalSubscriptionAsinMap||
(a._digitalSubscriptionAsinMap={}),a._digitalSubscriptionAsinMap[k.asin]={index:g,name:m,value:n});return e}}});"use strict";h.when("A","jQuery","BuyboxManagerViewBase").register("BuyboxManagerView",function(f,d,b){return b.extend({init:function(){this._super()},moveFieldsToContainer:function(a,c){for(var e=1,b=[],g;g===q||0<g.length;)g=a.find(this.getHiddenSelector("ASIN."+e)),0<g.length&&b.push(g.get(0),a.find(this.getHiddenSelector("offerListingID."+e)).get(0),a.find(this.getHiddenSelector("quantity."+
e)).get(0)),e++;c.append(b)},render:function(a){this._super(a);var c=this;this.$forms.each(function(e){var b=d(this),g=b.find('input[type\x3d"hidden"][name^\x3d"ASIN."]'),f=d.isArray(a)?a.length:0,h=c.$fieldsContainers.get(e);g.each(function(){var a=d(this);if(!a.parent().is(h)){var e=c._getAsinIndex(a);f++;a.prop("name","ASIN."+f);b.find('input[type\x3d"hidden"][name\x3d"offerListingID.'+e+'"]').prop("name","offerListingID."+f);b.find('input[type\x3d"hidden"][name\x3d"quantity.'+e+'"]').prop("name",
"quantity."+f)}})})},buildHTML:function(a,c){return this.getHiddenInputHTML("ASIN."+c,a.asin)+this.getHiddenInputHTML("offerListingID."+c,a.offerId)+this.getHiddenInputHTML("quantity."+c,a.quantity)},getDataFromDOM:function(){var a=[],c=this.$fieldsContainers.first(),e=this;c.find('input[type\x3d"hidden"][name^\x3d"ASIN."]').each(function(){var b=d(this),g=e._getAsinIndex(b);a.push({asin:b.val(),offerId:c.find(e.getHiddenSelector("offerListingID."+g)).val(),quantity:parseInt(c.find(e.getHiddenSelector("quantity."+
g)).val(),10)})});return a},_getAsinIndex:function(a){return parseInt(a.prop("name").substring(5),10)}})});"use strict";h.when("A","BuyboxNatcMobileweb","jQuery").register("BuyboxManagerViewBase",function(f,d,b){return f.createClass({init:function(){this.reset()},registerAtcBtn:function(a){this.$atcBtns=this.$atcBtns.add(a)},registerForm:function(a){a="string"===typeof a?b(a):a;if(a instanceof b&&0<a.length&&0===this.$forms.has(a).length){this.$forms=this.$forms.add(a);var c=this.createFieldsContainer(a);
this.moveFieldsToContainer(a,c)}},createFieldsContainer:function(a){var c=a.find(".buyboxManagerHiddenFieldsContainer");0===c.length&&(c=b('\x3cdiv class\x3d"buyboxManagerHiddenFieldsContainer"\x3e'),a.append(c));0===this.$fieldsContainers.has(c).length&&(this.$fieldsContainers=this.$fieldsContainers.add(c));return c.first()},moveFieldsToContainer:function(a,c){throw Error("The view must override the moveFieldsToContainer function");},getHiddenSelector:function(a,c){var e='input[type\x3d"hidden"]';
"string"===typeof a&&(e+='[name\x3d"'+a+'"]');"string"===typeof c&&(e+='[value\x3d"'+c+'"]');return e},getHiddenInputHTML:function(a,c){return'\x3cinput type\x3d"hidden" name\x3d"'+a+'" value\x3d"'+c+'" /\x3e'},render:function(a){this.appendFormData(a)},appendFormData:function(a,c){c=c||1;var e="";if(b.isArray(a))for(var k=0;k<a.length;k++)e+=this.buildHTML(a[k],c+k);this.$fieldsContainers.html(e)},appendFormDataNatc:function(a,c){var e="";c.find('input[type\x3d"hidden"].ATCFormUpsellAsinData').remove();
if(b.isArray(a))for(var k=1;k<a.length;k++)e+=d.buildNatcHTML(a[k],k);c.append(e)},reset:function(){this.$forms=b();this.$fieldsContainers=b();this.registerForm(b("#addToCart"));b("#mobile-installments")&&this.registerForm(b("#mobile-installments"));this.$atcBtns=b();this.registerAtcBtn(b("#add-to-cart-button"));this.registerAtcBtn(b("#bb_to_cfg_button"));this.registerAtcBtn(b("#buy-now-button"));b("#add-to-delivery-mobile-button").length&&this.registerAtcBtn(b("#add-to-delivery-mobile-button"));
b("#installments-button").length&&this.registerAtcBtn(b("#installments-button"))}})});"use strict";h.when("jQuery").register("BuyboxManagerViewHelper",function(f){var d={FORM:"form",AW_MASH:"aw_mash",SHOW_HCTP_ATTACH:"show-hctp-attach",UNKNOWN:q};return{ViewType:d,getAtcBtnViewType:function(b){var a=d.UNKNOWN;b instanceof f||(b=f(b));var c=b.closest('.a-declarative[data-action\x3d"aw-mash"]'),e=b.closest('.a-declarative[data-action\x3d"show-hctp-attach"]');return 0<c.length?d.AW_MASH:0<b.closest("form").length?
d.FORM:0<e.length?d.SHOW_HCTP_ATTACH:a},buildRawData:function(b,a,c){var e={},k=[];f.each(b,function(b,d){var g=a.length>b?a[b]:"";b=c.length>b?parseInt(c[b],10):1;var f=d+":"+g;e.hasOwnProperty(f)?k[e[f]].quantity+=b:e[f]=k.push({asin:d,offerId:g,quantity:b})-1});return k}}});"use strict";h.when("A","jQuery","ODSEventDispatcher","ods-url-utils","BuyboxManagerViewBase").register("BuyboxManagerController",function(f,d,b,a,c){return f.createClass({init:function(a){if(!(a instanceof c))throw new TypeError("The view must inherits from BuyboxManagerViewBase");
this._view=a;this._eventDispatcher=new b;this._enableEvents(!0);this.reset();var e=this;f.on("a:dropdown:mobileQuantityDropDown:select",function(a){e.setPageAsinQuantity(parseInt(a.value,10))});this._isFreeFormQuantityPickerPresent()&&this._makeAwareOfFreeFormQuantity()},_enableEvents:function(a){d.each("UpsellAsinAdded UpsellAsinRemoved UpsellAsinChanged PageAsinAdded PageAsinReplaced PageAsinChanged".split(" "),d.proxy(function(c,b){a?(this["register"+b]=d.proxy(this._eventDispatcher,"registerCallback",
b),this["unregister"+b]=d.proxy(this._eventDispatcher,"unregisterCallback",b)):(delete this["register"+b],delete this["unregister"+b])},this))},_parseInitialAsins:function(){var a=this._view.getDataFromDOM();if(a)for(var c=0;c<a.length;c++)this[0===c?"setPageAsin":"setUpsellAsin"](a[c].asin,a[c].offerId,a[c].quantity)},_dispatchSetUpsellAsinEvents:function(a,c,b,d){d!==b&&(0===d&&0<b?this._eventDispatcher.dispatch("UpsellAsinAdded",a,c,b,d):0===b&&0<d&&this._eventDispatcher.dispatch("UpsellAsinRemoved",
a,c,b,d),this._eventDispatcher.dispatch("UpsellAsinChanged",a,c,b,d))},_indexOfAsin:function(a,c){c=c||"";for(var b=0;b<this._asinsData.length;b++)if(this._asinsData[b].asin===a&&this._asinsData[b].offerId===c)return b;return-1},_isFreeFormQuantityPickerPresent:function(){return 0<d('select[id$\x3d"-predefinedQuantitiesDropdown"]').length},_makeAwareOfFreeFormQuantity:function(){var c=this;f.on("buyBoxQuantityChanged",function(a,b){c.setPageAsinQuantity(b)});var b=parseInt(a.getUrlParam("qty"),10);
b&&c.setPageAsinQuantity(b)},setUpsellAsin:function(a,c,b,d){if("string"!==typeof a||0>=a.length)throw new TypeError("The asin argument is required");var e=this._indexOfAsin(a,c),k=0;c=c||"";b="number"===typeof b?Math.max(0,b):1;if(0===e)throw Error("To modify the pageAsin, use setPageAsin() instead.");if(0<e)d=this._asinsData[e],k=d.quantity,0>=b?this._asinsData.splice(e,1):d.quantity=b;else if(0<b)this._asinsData.push({asin:a,offerId:c,quantity:b,customAttribute:d});else return!1;this.render();
this._dispatchSetUpsellAsinEvents(a,c,b,k,e);return!0},updateSelectedAsinsQuantity:function(a){if(1>a)throw Error("New quantity for upsell asins must be greater than 0.");for(var c=1;c<this._asinsData.length;c++)this._asinsData[c].quantity=a;this.render()},registerForm:function(a){this._view.registerForm(a);this.render()},registerAtcBtn:function(a){this._view.registerAtcBtn(a);this.render()},setPageAsin:function(a,c,b){if("string"!==typeof a||0>=a.length)throw new TypeError("The asin argument is required");
var e=this._indexOfAsin(a,c),d=0<this._asinsData.length?this._asinsData[0].quantity:0;c=c||"";if(0>=b)throw new TypeError("The quantity of the page asin must be \x3e 0.");b="number"===typeof b?Math.max(1,b):1;if(0===e&&b===d)return!1;0<e&&this.setUpsellAsin(a,c,0);this._asinsData[0]={asin:a,offerId:c,quantity:b};this.render();-1<e?this._eventDispatcher.dispatch("PageAsinReplaced",a,c,b,d):this._eventDispatcher.dispatch("PageAsinAdded",a,c,b);this._eventDispatcher.dispatch("PageAsinChanged",a,c,b);
return!0},setPageAsinQuantity:function(a){var c=this._asinsData&&this._asinsData.length&&this._asinsData[0];c&&this.setPageAsin(c.asin,c.offerId,a)},addUpsellAsin:function(a,c,b){b=b||1;for(var e=0;e<this._asinsData.length;e++){var d=this._asinsData[e];if(d.asin===a){this.setUpsellAsin(a,c,d.quantity+b);return}}this.setUpsellAsin(a,c,b)},render:function(){this._view.render(this._asinsData)},getAsins:function(){return f.copy(this._asinsData)},getUpsellAsins:function(){var a=this.getAsins();a.splice(0,
1);return a},resetUpsellAsins:function(){this._asinsData=[this._asinsData[0]];return f.copy(this._asinsData)},getPageAsin:function(){return f.copy(this._asinsData[0])},getPageQuantityDropdown:function(){return d("#buybox").find('select[name\x3d"quantity"]')},reset:function(){this._asinsData=[];this._parseInitialAsins()}})});"use strict";h.when("BuyboxManagerController","BuyboxManagerView","BuyboxManagerFactory","jQuery").register("BuyboxManager",function(f,d,b,a){return b.create("getAsins getUpsellAsins setUpsellAsin resetUpsellAsins getPageAsin setPageAsin registerUpsellAsinChanged registerUpsellAsinAdded registerUpsellAsinRemoved registerPageAsinChanged registerPageAsinAdded registerPageAsinReplaced unregisterUpsellAsinChanged unregisterUpsellAsinRemoved unregisterUpsellAsinAdded unregisterPageAsinChanged unregisterPageAsinAdded unregisterPageAsinReplaced addUpsellAsin registerForm registerAtcBtn updateSelectedAsinsQuantity getPageQuantityDropdown".split(" "),
f,d)});"use strict";h.when("A").register("BuyboxNatcMobileweb",function(f){return{buildNatcHTML:function(d,b){return""+(this.getHiddenInputHTMLNatc("items["+b+".upsell][asin]",d.asin)+this.getHiddenInputHTMLNatc("items["+b+".upsell][offerListingId]",d.offerId)+this.getHiddenInputHTMLNatc("items["+b+".upsell][quantity]",d.quantity))},getHiddenInputHTMLNatc:function(d,b){return'\x3cinput type\x3d"hidden" name\x3d"'+d+'" value\x3d"'+b+'" class\x3d"ATCFormUpsellAsinData"  /\x3e'}}});"use strict";h.when("jQuery").register("BuyboxNatcMobileapp",
function(f){return{createInputs:function(d){var b={};f.each(d,function(a,c){0!==a&&(b["items["+a+".upsell][asin]"]=c.asin,b["items["+a+".upsell][offerListingId]"]=c.offerId,b["items["+a+".upsell][quantity]"]=c.quantity)});return b}}});"use strict";h.when("jQuery","BuyboxManagerViewHelper").register("BuyboxManagerMashHelper",function(f,d){return{createInputs:function(b){var a={a:[],oid:[],quantity:[]};f.each(b,function(c,b){a.a.push(b.asin);a.oid.push(b.offerId);a.quantity.push(b.quantity)});a.a=a.a.join("|");
a.oid=a.oid.join("|");a.quantity=a.quantity.join("|");return a},getViewData:function(b){var a=b.inputs.a.split("|"),c=b.inputs.oid.split("|");b=b.inputs.quantity.split("|");return d.buildRawData(a,c,b)},setDeclarativeMultiple:function(b){b.buttonID="add-multiple-to-cart"},getDeclarativeDataFromBtn:function(b){return b.closest('.a-declarative[data-action\x3d"aw-mash"]').data("awMash")},isAddToCart:function(b){return"add-to-cart"===b.buttonID},updateInputWithSubscriptionData:function(b,a,c){if(!f.isEmptyObject(b._digitalSubscriptionAsinMap)){var e=
b._digitalSubscriptionAsinMap,d;for(d in e)if(e.hasOwnProperty(d)){var g=e[d],h=g.index;if(c.length<=h||c[h].asin!==d)a[g.name]&&delete a[g.name],a[g.value]&&delete a[g.value],delete e[d]}b._digitalSubscriptionAsinMap=e}f.each(c,function(c,e){if(e.customAttribute){var d="custom-name."+(c+1)+".1",f="custom-value."+(c+1)+".1";a[d]=e.customAttribute.name;a[f]=e.customAttribute.value;b._digitalSubscriptionAsinMap||(b._digitalSubscriptionAsinMap={});b._digitalSubscriptionAsinMap[e.asin]={index:c,name:d,
value:f}}})}}});"use strict";h.when("ODSBuyboxManagerController","BuyboxManager","BuyboxManagerFactory","A","jQuery").register("ODSBuyboxManager",function(f,d,b,a,c){return b.extend(["addMetadata","getMetadata","getAsins","getPageAsin","getUpsellAsins"],f,d)});"use strict";h.when("BuyboxManager","ODSBuyboxAsinMetadata","A","jQuery").register("ODSBuyboxManagerController",function(f,d,b,a){return b.createClass({init:function(){this.reset()},addMetadata:function(a){if(!(a instanceof d))throw Error("The argument metadata must be an instance of ODSBuyboxAsinMetadata");
if(!a.isValid())throw Error("The metadata is NOT valid");this._metadatas[a.asin+":"+a.offerId]=a.clone()},getMetadata:function(a,b){return this._metadatas[a+":"+b]},getMetadatas:function(){return b.copy(this._metadatas)},enhanceAsinsData:function(c){if("undefined"!==typeof c&&null!==c&&0!==c.length){var b=this;a.isArray(c)?c=a.map(c,function(c){return a.extend({},c,{metadata:b.getMetadata(c.asin,c.offerId)})}):c.metadata=b.getMetadata(c.asin,c.offerId)}return c},getPageAsin:function(){return this.enhanceAsinsData(f.getPageAsin())},
getUpsellAsins:function(){return this.enhanceAsinsData(f.getUpsellAsins())},getAsins:function(){return this.enhanceAsinsData(f.getAsins())},reset:function(){this._metadatas={}}})});"use strict";h.when("A","jQuery").register("ODSBuyboxAsinMetadata",function(f,d){var b=f.createClass({init:function(a,c,b,d,f,h,l){this.asin=a;this.offerId=c;this.buyingPrice=b;this.listingPrice=d;this.title=f;this.imageUrl=h;this.availabilityMessage=l},isValid:function(){var a="string"===typeof this.asin&&0<this.asin.length;
return"number"===typeof this.buyingPrice&&a},clone:function(){return new b(this.asin,this.offerId,this.buyingPrice,this.listingPrice,this.title)}});return b});"use strict";h.when("A","jQuery","a-modal").register("singleton-popup-modal",function(f,d,b){function a(a){null===g?(k=e.appendTo(d("body")),g=b.create(k,a)):g.update(a);g.show()}function c(){g&&g.hide()}var e=d('\x3cdiv style\x3d"display:none"\x3e'),k=null,g=null;f.declarative("cfg-singleton-modal-close","click",c);f.declarative("cfg-singleton-modal-open",
"click",function(c){a({inlineContent:c.data.inlineContent,header:c.data.header,width:c.data.width||"502",position:"triggerRight"},!0)});return{show:a,hide:c,destroy:function(){g&&(b.remove(g),g=null)}}});"use strict";h.when("A").register("MakoCommonCartHelper",function(f){var d=f.$,b=f.createClass({init:function(a,c,b,d){this.sessionId=a||"";this.clientName=c||"";this.asinsData=b||[];this.additionalData=d||{};this.reftag;this.hasBeenPosted=!1},setSessionId:function(a){this.sessionId=a;return this},
setClientName:function(a){this.clientName=a;return this},setAsinsData:function(a){if(Array.isArray(a))return this.asinsData=a,this},addAsinData:function(a,c,b){this.asinsData.push({asin:a,offerId:c,quantity:b});return this},setAdditionalData:function(a){this.additionalData=a;return this},setReftag:function(a){this.reftag=a;return this},sendRequest:function(){if(this.hasBeenPosted)h.log("Request has already been sent.","WARN");else if(this._verifyRequest()){var a=this._buildRequestData();this.hasBeenPosted=
!0;a=d.ajax({url:"/gp/add-to-cart/json/"+(this.reftag?"ref\x3d"+this.reftag:""),type:"POST",data:a});a.done(function(a){f.trigger("mako:common-cart-request:complete",a)});return a}},_verifyRequest:function(){var a=!0;this.sessionId&&""!==this.sessionId||(a=!1,h.log("SessionId is undefined or blank","WARN"));this.asinsData&&this.asinsData.length||(a=!1,h.log("No asins data exist for cart handler request","WARN"));return a},_buildRequestData:function(){var a={};a.verificationSessionID=this.sessionId;
a.clientName=this.clientName;for(var c=0;c<this.asinsData.length;c++){var b=this.asinsData[c];a["asin."+c]=b.asin;a["offeringID."+c]=b.offerId||b.offerListingID;a["quantity."+c]=b.quantity}if(this.additionalData)for(var d in this.additionalData)this.additionalData.hasOwnProperty(d)&&(a[d]=this.additionalData[d]);return a}});return{createRequest:function(a,c){a||h.log("Cannot find session-id and attempting to add to cart without session-id","FATAL");return new b(a,c)}}});"use strict";h.when("A").register("MakoAmazonApiAddToCartHelper",
function(f){var d=f.$,b=["true","false"],a=f.createClass({init:function(a,b,d){this.csrfToken=a||"";this.marketplace=b||"";this.ajaxEndpoint=d||"";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;h.log("asin, offerListingId or quantity of single asinData is empty","FATAL")},setRefTag:function(a){this.refTag=a;return this},sendRequest:function(a,
b){var c=this;this.asinDataList.length?d.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":d('meta[name\x3d"encrypted-slate-token"]').prop("content")},success:function(d){c.verifyCartApiResponse(d)?
a(d):b()},error:b}):(h.log("Invalid request with an empty asin list to CartAPI","FATAL"),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],f={asin:d.asin,offerListingId:d.offerId,quantity:d.quantity};d=this.formatBooleanParams(d);d=this.constructAdditionalParameters(d);if(d.hasOwnProperty("giftOptions")||d.hasOwnProperty("devicePreregistration")||d.hasOwnProperty("installments")||d.hasOwnProperty("incentivizedCart")||d.hasOwnProperty("paymentOfferInfo"))f.additionalParameters=d;b.push(f)}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 c in a)if(a.hasOwnProperty(c)&&"string"===typeof a[c]){var d=a[c].toLowerCase();-1!==b.indexOf(d)&&(a[c]="true"===d)}return a}});return{createRequest:function(b,d,f){return new a(b,d,f)}}});"use strict";h.when().register("ExtraDataHelper",function(){function f(a,b){return a&&a.name&&0===a.name.indexOf(b)}function d(a,b){var c=
Array.prototype.slice.call(a.elements);a=c.filter(function(a){return a&&a.tagName&&"input"===a.tagName.toLowerCase()&&f(a,["custom-name",b,""].join("."))});c=c.filter(function(a){return a&&a.tagName&&"input"===a.tagName.toLowerCase()&&f(a,["custom-value",b,""].join("."))});return{names:a,values:c}}function b(a,b){return a!==q&&null!==a?a:b}function a(a,c,d){c=b(c,"([0-9]+)");d=b(d,"([0-9]+)");return new RegExp([a,c,d].join("."))}function c(a,b){var c=document.createElement("input");c.type="hidden";
c.name=a;c.value=b;return c}function e(b,c,d,e){var f=a("custom-name",b);return c.reduce(function(a,c){var g=f.exec(c);if(g){g=g[1];var n=["custom-value",b,g].join(".");a[g]={name:d(c),value:e(n)}}return a},{})}function h(a,b,c,d){Object.keys(b).forEach(function(e){var f=b[e],g=["custom-name",a,e].join(".");e=["custom-value",a,e].join(".");"object"===typeof f&&(c(g,f.name),d(e,f.value))})}function g(a,b){var c=Object.keys(a),d=function(b){return a[b]};return e(b,c,d,d)}function m(a,b,c){var d=function(b,
c){a[b]=c};h(c,b,d,d)}function l(a,b){a=d(a,b);var c=a.names.map(function(a){return a.name}),f=function(a){return function(b){var c=a.filter(function(a){return a.name===b});return c.length?c[0].value:q}};return e(b,c,f(a.names),f(a.values))}function r(a,b,e){var f=d(a,e),g=function(b){return function(d,e){var f=b.filter(function(a){return a.name===d});f.length?f.forEach(function(a){a.value=e}):a.appendChild(c(d,e))}};h(e,b,g(f.names),g(f.values))}function p(a){return Object.keys(a).reduce(function(b,
c){c=a[c];b[c.name]=c.value;return b},{})}function u(a,b){var c=Object.keys(a).reduce(function(b,c){c=a[c];b[c.name]=c;return b},{});Object.keys(b).forEach(function(d){if(c[d])c[d].value=b[d];else{var e=w(a),f={name:d,value:b[d]};a[e]=f;c[d]=f}});return a}function v(a,b){return a-b}function w(a){a=Object.keys(a).map(function(a){return parseInt(a)}).sort(v);if(a.length){if(1!==a[0])return 1;for(var b=1;b<a.length;b++)if(1!==a[b]-a[b-1])return a[b-1]+1;return a.length+1}return 1}return{getObjectExtraData:function(a,
c){c=b(c,1);return p(g(a,c))},setObjectExtraData:function(a,c,d){d=b(d,1);c=u(g(a,d),c);m(a,c,d)},getFormExtraData:function(a,c){if(!a)return{};c=b(c,1);return p(l(a,c))},setFormExtraData:function(a,c,d){a&&(d=b(d,1),c=u(l(a,d),c),r(a,c,d))}}})});
/* ******** */
(function(c){var a=window.AmazonUIPageJS||window.P,e=a._namespace||a.attributeErrors,d=e?e("MakoCommonMetricAssets",""):a;d.guardFatal?d.guardFatal(c)(d,window):d.execute(function(){c(d,window)})})(function(c,a,e){c.now("mako-metric-logger").execute("MakoMetricLoggerEmpty",function(a){a||c.when("A").register("mako-metric-logger",function(a){function b(){}return{increment:b,update:b,counter:b,timer:b,suffixed:b}})});"use strict";c.now("mako-reftag-logger").execute("ReftagLoggerExecute",function(a){a||
c.when("A").register("mako-reftag-logger",function(a){function b(){}function c(a){if(!a)throw Error("refTag is not defined");d.post("/gp/digital/fiona/ajax/log.html/ref\x3d"+a)}var d=a.$;return{increment:c,update:b,counter:function(a){return function(){c(a)}},timer:b,suffixed:function(a,b){return function(c){return a(b+":"+c)}}}})});"use strict";c.now("mako-csm-logger").execute("MakoCsmLoggerExecute",function(d){d||c.when("A").register("mako-csm-logger",function(c){function b(){}function d(){return a.ue&&
"function"===typeof a.ue.count?a.ue.count:b}function e(a){if(a){var b=d();b(a,(b(a)||0)+1)}}function g(a,b){a&&"number"===typeof b&&d()(a,b)}function h(a){var b=d();return function(c){b(a,c)}}function k(b){var c=function(){return{stop:function(){}}};if(a.performance&&"function"===typeof a.performance.now){var l=d();c=function(){var c=a.performance.now();return{stop:function(){var d=a.performance.now()-c;l(b,d)}}}}return{start:c}}function f(a,b){return function(c){return a(b+":"+c)}}return a.ue&&"function"===
typeof a.ue.count?{increment:e,update:g,counter:h,timer:k,suffixed:f}:{increment:b,update:b,counter:b,timer:b,suffixed:b}})});"use strict";c.now("mako-csa-logger").execute("MakoCsaLoggerExecute",function(d){d||c.when("A").register("mako-csa-logger",function(c){function b(){}function d(a,b){f("recordMetric",a,b)}function e(a){f("recordMetric",a,1)}function g(a){return function(b){d(a,b)}}function h(a,b){return function(c){return a(b+":"+c)}}function k(b){var c=function(){return{stop:function(){}}};
a.performance&&"function"===typeof a.performance.now&&(c=function(){var c=a.performance.now();return{stop:function(){var e=a.performance.now()-c;d(b,e)}}});return{start:c}}if(a.csa&&"function"===typeof a.csa){var f=a.csa("Metrics",{producerId:"mako-ml"});if("function"===typeof a.csa)return{increment:e,update:d,counter:g,timer:k,suffixed:h}}f=b;return{increment:b,update:b,counter:b,timer:b,suffixed:b}})})});
/* ******** */
(function(l){var m=window.AmazonUIPageJS||window.P,n=m._namespace||m.attributeErrors,g=n?n("DetailPagePreRegistrationAssets",""):m;g.guardFatal?g.guardFatal(l)(g,window):g.execute(function(){l(g,window)})})(function(l,m,n){l.when("A","a-checkbox","a-dropdown","ExtraDataHelper").register("PreRegistration.View",function(g,f,d,a){var e=g.$,k={},h=g.createClass({init:function(c,b){this.selectors={};this._setupSelectors(c,b);this.reset()},reset:function(){this._giftingCheckbox=f(this.selectors.GIFTING_CHECKBOX_SELECTOR);
this._giftingCheckboxElement=e(this.selectors.GIFTING_CHECKBOX_SELECTOR);this._accountLinkingCheckbox=f(this.selectors.ACCOUNT_LINKING_CHECKBOX_SELECTOR);this._accountLinkingCheckboxes=f(this.selectors.ALL_ACCOUNT_LINKING_CHECKBOX_SELECTOR);this._desktopQuantityDropdown=d.getSelect(this.selectors.DESKTOP_QUANTITY_DROPDOWN_SELECTOR);this._mobileQuantityDropdown=d.getSelect(this.selectors.MOBILE_QUANTITY_DROPDOWN_SELECTOR);this._quantityAlert=e(this.selectors.QUANTITY_ALERT_SELECTOR);this._giftingAlert=
e(this.selectors.GIFTING_ALERT_SELECTOR);this._mainGiftingAlert=e(this.selectors.MAIN_GIFTING_ALERT_SELECTOR);this._declaratives=e(this.selectors.DECLARATIVES_SELECTOR);this._forms=e(this.selectors.FORMS_SELECTOR);this._atcforms=e(this.selectors.ATC_FORM_SELECTOR);this._quantityAlert.length&&(this._quantityAlertFormatString=this._quantityAlert.html())},_setupSelectors:function(c,b){this.selectors.ACCOUNT_LINKING_ATTRIBUTE_NAME="isDevicePreRegistered";this.selectors.MAX_QUANTITY_LIMIT_FORMAT_SPECIFIER=
"$PREREG_MAX_QUANTITY";this.selectors.AUI_HIDDEN_CLASS="aok-hidden";this.selectors.AUI_COLOR_TERTIARY="a-color-tertiary";this.selectors.GIFTING_CHECKBOX_SELECTOR="#gift-wrap"+c;this.selectors.ACCOUNT_LINKING_CHECKBOX_SELECTOR="#account-linking"+c;this.selectors.ALL_ACCOUNT_LINKING_CHECKBOX_SELECTOR=".pre-reg-checkbox-option";this.selectors.DESKTOP_QUANTITY_DROPDOWN_SELECTOR=b[c].desktopQuantityDropdown;this.selectors.MOBILE_QUANTITY_DROPDOWN_SELECTOR=b[c].mobileQuantityDropdown;this.selectors.QUANTITY_ALERT_SELECTOR=
"#preregistrationQuantityAlert"+c;this.selectors.GIFTING_ALERT_SELECTOR="#preregistrationGiftingAlert"+c;this.selectors.MAIN_GIFTING_ALERT_SELECTOR="#preregistrationGiftingAlert";this.selectors.ACCOUNT_LINKING_CHECKBOX_TEXT_SELECTOR="#preRegCheckboxText"+c;this.selectors.ALL_ACCOUNT_LINKING_CHECKBOX_TEXT_SELECTOR=".mako-pre-reg-checkbox-text";this.selectors.DECLARATIVES_SELECTOR="#atc-declarative, #buyNow .a-declarative";this.selectors.FORMS_SELECTOR="form#addToCart, form#mobile-installments, form#buyNow, form#buyNowCheckout, form#oneClickBuy, form#buyNowOneClickCheckout";
this.selectors.ATC_FORM_SELECTOR="#addToCart"},updateQuantityLimit:function(c){this._quantityAlert.length&&this._quantityAlertFormatString&&(c=this._quantityAlertFormatString.replace(this.selectors.MAX_QUANTITY_LIMIT_FORMAT_SPECIFIER,c),this._quantityAlert.html(c))},_setDeclarativeExtraData:function(c){this._declaratives.each(function(){var b=e(this),f=b.data("action");f&&(b=b.data(f))&&b.inputs&&a.setObjectExtraData(b.inputs,c)})},_setFormHiddenInput:function(c){for(var b=document.querySelectorAll(this.selectors.ATC_FORM_SELECTOR),
a=0;a<b.length;a++){var f=b[a],g="accountLinking"+a,d=e("[id\x3d"+g+"]");d&&d.length&&d.remove();d=document.createElement("input");d.type="hidden";d.name="items[0.base][additionalParameters][devicePreregistration][selected]";d.value=c;d.id=g;f.appendChild(d)}},_setFormExtraData:function(c){this._forms.each(function(){a.setFormExtraData(this,c)})},setAccountLinkingAttributeValue:function(c){var b={};b[this.selectors.ACCOUNT_LINKING_ATTRIBUTE_NAME]=c;this._setDeclarativeExtraData(b);this._setFormExtraData(b);
this._setFormHiddenInput(c)},_isCheckboxPresent:function(c){return!c.isEmpty()},_isCheckboxChecked:function(c){return!c.isEmpty()&&c.isChecked()},isGiftingChecked:function(){return this._isCheckboxChecked(this._giftingCheckbox)},isGiftingPresent:function(){return this._isCheckboxPresent(this._giftingCheckbox)},uncheckGiftingbox:function(){f(this.selectors.GIFTING_CHECKBOX_SELECTOR).uncheck();this._hide(this._mainGiftingAlert)},isAccountLinkingChecked:function(){return this._isCheckboxChecked(this._accountLinkingCheckbox)},
isAccountLinkingPresent:function(){return this._isCheckboxPresent(this._accountLinkingCheckbox)},getQuantity:function(){return this._desktopQuantityDropdown?this._desktopQuantityDropdown.val():this._mobileQuantityDropdown?this._mobileQuantityDropdown.val():1},scrollGiftingIntoView:function(){this._giftingCheckboxElement.length&&!g.onScreen(this._giftingCheckboxElement,5)&&this._giftingCheckboxElement[0].scrollIntoView()},_hide:function(c){c.addClass(this.selectors.AUI_HIDDEN_CLASS)},_show:function(c){c.removeClass(this.selectors.AUI_HIDDEN_CLASS)},
_isHidden:function(c){return c.hasClass(this.selectors.AUI_HIDDEN_CLASS)},showGiftingAlert:function(){this._show(this._giftingAlert)},hideGiftingAlert:function(){this._hide(this._giftingAlert)},showQuantityAlert:function(){this._show(this._quantityAlert)},hideQuantityAlert:function(){this._hide(this._quantityAlert)},isGiftingAlertHidden:function(){return this._isHidden(this._giftingAlert)},enableAccountLinkingCheckboxes:function(c){this._accountLinkingCheckboxes.enable();e(this.selectors.ACCOUNT_LINKING_CHECKBOX_TEXT_SELECTOR).removeClass(this.selectors.AUI_COLOR_TERTIARY);
e(this.selectors.ALL_ACCOUNT_LINKING_CHECKBOX_TEXT_SELECTOR).removeClass(this.selectors.AUI_COLOR_TERTIARY);c?this._accountLinkingCheckboxes.check():this._accountLinkingCheckboxes.uncheck()},enableInstanceAccountLinkingCheckbox:function(c){this._accountLinkingCheckbox.enable();e(this.selectors.ACCOUNT_LINKING_CHECKBOX_TEXT_SELECTOR).removeClass(this.selectors.AUI_COLOR_TERTIARY);e(this.selectors.ALL_ACCOUNT_LINKING_CHECKBOX_TEXT_SELECTOR).removeClass(this.selectors.AUI_COLOR_TERTIARY);c?this._accountLinkingCheckbox.check():
this._accountLinkingCheckbox.uncheck()},disableAccountLinkingCheckbox:function(){this._accountLinkingCheckboxes.uncheck();this._accountLinkingCheckbox.disable();e(this.selectors.ACCOUNT_LINKING_CHECKBOX_TEXT_SELECTOR).addClass(this.selectors.AUI_COLOR_TERTIARY)},disableAccountLinkingCheckboxForQuantityCheck:function(){this._accountLinkingCheckbox.uncheck();this._accountLinkingCheckbox.disable();e(this.selectors.ACCOUNT_LINKING_CHECKBOX_TEXT_SELECTOR).addClass(this.selectors.AUI_COLOR_TERTIARY)},isAccountLinkingCheckboxEnabled:function(){return this._accountLinkingCheckbox.isEnabled()},
allAccountLinkingCheckboxEnabled:function(){return this._accountLinkingCheckboxes.isEnabled()},updateAccountLinkingCheckboxes:function(c){c?this._accountLinkingCheckboxes.check():this._accountLinkingCheckboxes.uncheck()},openPopup:function(c){m.open(c,"popupWindow","width\x3d600,height\x3d400,scrollbars\x3dyes")}});return{getInstance:function(c,b){var a=""==c?"default":c;k[a]||(k[a]=new h(c,b));return k[a]}}});l.when("A","PreRegistration.View","PreRegistration.Metrics").register("PreRegistration.Controller",
function(g,f,d){var a=g.$,e={},k={"":{quantityChangeEvent:"a:dropdown:selected:quantity",mobileQuantityDropdown:"#quantity",desktopQuantityDropdown:"#mobileQuantityDropDown"},"-installment":{quantityChangeEvent:"a:dropdown:selected:installmentsQuantityDropdown",mobileQuantityDropdown:"#installmentsQuantityDropdown",desktopQuantityDropdown:"#installmentsQuantityDropdown"},"-deals":{quantityChangeEvent:"a:dropdown:dealOrderQuantityDropdown:select",mobileQuantityDropdown:"#dealOrderQuantityDropdown",
desktopQuantityDropdown:"#dealOrderQuantityDropdown"}},h,c=g.createClass({init:function(b,a){this.selectors={};this._data=b;this._view=f.getInstance(a,k);this._metrics=new d;this._suffix=a;this.reset(b);this._bindEventsOnce()},reset:function(b){this._setupSelectors(this._suffix);this._view.reset();this._view.uncheckGiftingbox();this._bindEventsDOM();"object"===typeof b?(this._showStatus=b.showStatus,this._maxQuantityLimit=b.maxQuantity,this._defaultValue=b.defaultValue,this._status=b.status,this._asin=
b.asin,h=h===n?this._defaultValue:h,this._view.updateQuantityLimit(this._maxQuantityLimit),this._view.setAccountLinkingAttributeValue(this._defaultValue),this._reenableALC(),this._showStatus?this._metrics.emitGiftingAndAccountLinkingLoadedMetric(this._asin):this._metrics.emitGiftingLoadedMetric(this._asin)):this._view.setAccountLinkingAttributeValue("false")},_setupSelectors:function(b){this.selectors.QUANTITY_CHANGE_EVENT=k[b].quantityChangeEvent;this.selectors.DETAIL_PAGE_GIFTING_DECLARATIVE_NAME=
"detail-page-gifting-declarative"+b;this.selectors.DESKTOP_GIFTING_DECLARATIVE_NAME="mako-gifting-declarative"+b;this.selectors.MOBILE_POPOVER_TRIGGER_EVENT="a:popover:beforeSlide:preRegistration-secview"+b;this.selectors.MOBILE_GIFTING_DECLARATIVE_NAME="mako-gifting-declarative-mobile";this.selectors.ACCOUNT_LINKING_DECLARATIVE_NAME="mako-preReg-declarative"+b;this.selectors.POPUP_DECLARATIVE_NAME="preReg-popup-window"+b;this.selectors.INSTALLMENT_ATC_SELECTOR="#installments-button";this.selectors.ADD_TO_CART_SELECTOR=
"#add-to-cart-button";this.selectors.BUY_NOW_BUTTON_SELECTOR="#buy-now-button";this.selectors.BUY_NOW_CLICK_EVENT="click.makoPreRegistration";this.selectors.ONE_CLICK_BUTTON_SELECTOR="#one-click-button";this.selectors.TWISTER_PLUS_AFTER_BUYBOX_UPDATE_EVENT="twisterPlus:selection:afterBuyBox:update"},_reenableALC:function(){this._view.isGiftingChecked()||(this._enableAccountLinkingCheckbox(h),this._view.hideGiftingAlert())},_giftingCheckboxChecked:function(){this._view.hideQuantityAlert();this._view.showGiftingAlert();
this._view.isAccountLinkingChecked()&&this._metrics.emitALForceUncheckedGiftingSelected(this._asin);this._disableAccountLinkingCheckbox()},_giftingCheckboxUnchecked:function(){this._view.hideGiftingAlert();this._enableAccountLinkingCheckbox()},_enableAccountLinkingCheckbox:function(){this._view.enableInstanceAccountLinkingCheckbox(h);this._view.setAccountLinkingAttributeValue(h?"true":"false")},_disableAccountLinkingCheckbox:function(){this._view.disableAccountLinkingCheckbox();h=this._view.isAccountLinkingChecked();
this._view.setAccountLinkingAttributeValue("false")},_bindEventsOnce:function(){g.on(this.selectors.MOBILE_POPOVER_TRIGGER_EVENT,this._handlePopupClickMobile.bind(this));g.declarative(this.selectors.DETAIL_PAGE_GIFTING_DECLARATIVE_NAME,"click",this._handleGiftingClick.bind(this));g.declarative(this.selectors.DESKTOP_GIFTING_DECLARATIVE_NAME,"click",this._handleGiftingClick.bind(this));g.declarative(this.selectors.MOBILE_GIFTING_DECLARATIVE_NAME,"click",this._handleGiftingClick.bind(this));g.declarative(this.selectors.ACCOUNT_LINKING_DECLARATIVE_NAME,
"click",this._handleAccountLinkingClick.bind(this));g.declarative(this.selectors.POPUP_DECLARATIVE_NAME,"click",this._handlePopupClick.bind(this));g.declarative(this.selectors.POPUP_DECLARATIVE_NAME,"mouseenter",this._handlePopupHover.bind(this));g.on(this.selectors.TWISTER_PLUS_AFTER_BUYBOX_UPDATE_EVENT,this._handleTwisterPlusUpdate.bind(this))},_bindEventsDOM:function(){a(this.selectors.INSTALLMENT_ATC_SELECTOR).click(this._handleATC.bind(this,"ATC"));a(this.selectors.ADD_TO_CART_SELECTOR).click(this._handleATC.bind(this,
"ATC"));a(this.selectors.BUY_NOW_BUTTON_SELECTOR).bind(this.selectors.BUY_NOW_CLICK_EVENT,this._handleATC.bind(this,"BUYNOW"));a(this.selectors.ONE_CLICK_BUTTON_SELECTOR).click(this._handleATC.bind(this,"ONECLICK"))},_handleGiftingClick:function(b){(this._isInputEvent(b)||this._isDefaultInstance())&&this._view.isGiftingPresent()&&(this._view.isGiftingChecked()?(this._giftingCheckboxChecked(),this._metrics.emitGiftingCheckedMetric(this._asin)):(this._giftingCheckboxUnchecked(),this._metrics.emitGiftingUncheckedMetric(this._asin)))},
_handleAccountLinkingClick:function(b){if(this._isInputEvent(b)&&this._view.isAccountLinkingPresent()){var a=this._view.isAccountLinkingChecked();a?(this._view.uncheckGiftingbox(),this._handleGiftingClick(b),this._metrics.emitALCheckedMetric(this._asin)):this._metrics.emitALUncheckedMetric(this._asin);h=a;this._view.updateAccountLinkingCheckboxes(a);this._view.setAccountLinkingAttributeValue(a?"true":"false")}},_handleTwisterPlusUpdate:function(){if(this._view.isAccountLinkingPresent()){var b=this._view.isAccountLinkingChecked();
this._view.setAccountLinkingAttributeValue(b?"true":"false")}},_handlePopupClick:function(b){b.$event.preventDefault();b=b.$target.prop("href");this._view.openPopup(b);this._metrics.emitWhyIsThisImportantClickedMetric(this._asin)},_handlePopupClickMobile:function(b){this._metrics.emitWhyIsThisImportantClickedMetric(this._asin)},_handlePopupHover:function(b){this._metrics.emitPopupHoverMetric(this._asin)},_handleATC:function(b){this._metrics.emitATCGiftingALSelectionMetric(this._asin,b,this._view.isGiftingChecked(),
this._view.isAccountLinkingChecked())},_isInputEvent:function(b){return"input"===b.targetTag.toLowerCase()},_isStatusAllowedConditional:function(){return"ALLOWED_CONDITIONAL"===this._status},_isDefaultInstance:function(){return""===this._suffix},getInstanceData:function(){return this._data},emitInitializationMetrics:function(b){this._metrics.emitALCheckboxBuyboxInitializedMetric(this._data.asin,b);this._metrics.emitALCheckboxInitializedMetric(this._data.asin)}});return{getInstance:function(b,a){a=
"undefined"===typeof a?"":a;var d=""===a?"default":a;e[d]?b&&e[d].reset(b):e[d]=new c(b,a);e[d].emitInitializationMetrics(d);return e[d]},reset:function(){Object.keys(e).forEach(function(a){var c=e[a].getInstanceData();e[a].reset(c)})}}});l.when("A","odsRefTagUtils","mako-csm-logger").register("PreRegistration.Metrics",function(g,f,d){return g.createClass({emitGiftingAndAccountLinkingLoadedMetric:function(a){d.increment("PREREGISTRATION_GIFTING_AL_LOADED");f.send("PREREGISTRATION_"+a+"_GIFTING_AL_LOADED")},
emitALCheckboxInitializedMetric:function(a){d.increment("PREREGISTRATION_AL_ASSETS_INITIALIZED");f.send("PREREGISTRATION_"+a+"_AL_ASSETS_INITIALIZED")},emitALCheckboxBuyboxInitializedMetric:function(a,e){e&&0<e.length&&(e=e.replace("-","").toUpperCase(),d.increment("PREREGISTRATION_"+e+"_AL_ASSETS_INITIALIZED"),f.send("PREREGISTRATION_"+a+"_"+e+"_AL_ASSETS_INITIALIZED"))},emitGiftingLoadedMetric:function(a){d.increment("PREREGISTRATION_ONLY_GIFTING_LOADED");f.send("PREREGISTRATION_"+a+"_ONLY_GIFTING_LOADED")},
emitALForceUncheckedQuantityHigh:function(a){d.increment("PREREGISTRATION_AL_FORCE_UNCHECKED_QUANTITYHIGH");f.send("PREREGISTRATION_"+a+"_AL_FORCE_UNCHECKED_QUANTITYHIGH")},emitALForceUncheckedGiftingSelected:function(a){d.increment("PREREGISTRATION_AL_FORCE_UNCHECKED_GIFTINGSELECTED");f.send("PREREGISTRATION_"+a+"_AL_FORCE_UNCHECKED_GIFTINGSELECTED")},emitGiftingCheckedMetric:function(a){d.increment("PREREGISTRATION_GIFTING_CHECKED");f.send("PREREGISTRATION_"+a+"_GIFTING_CHECKED")},emitGiftingUncheckedMetric:function(a){d.increment("PREREGISTRATION_GIFTING_UNCHECKED");
f.send("PREREGISTRATION_"+a+"_GIFTING_UNCHECKED")},emitALCheckedMetric:function(a){d.increment("PREREGISTRATION_AL_CHECKED");f.send("PREREGISTRATION_"+a+"_AL_CHECKED")},emitALUncheckedMetric:function(a){d.increment("PREREGISTRATION_AL_UNCHECKED");f.send("PREREGISTRATION_"+a+"_AL_UNCHECKED")},emitWhyIsThisImportantClickedMetric:function(a){d.increment("PREREGISTRATION_WHY_IS_THIS_IMPORTANT_CLICKED");f.send("PREREGISTRATION_"+a+"_WHY_IS_THIS_IMPORTANT_CLICKED")},emitPopupHoverMetric:function(a){d.increment("PREREGISTRATION_WHY_IS_THIS_IMPORTANT_HOVER");
f.send("PREREGISTRATION_"+a+"_WHY_IS_THIS_IMPORTANT_HOVER")},emitATCGiftingALSelectionMetric:function(a,e,g,h){g?(d.increment("PREREGISTRATION_"+e+"_GIFTING_CHECKED"),f.send("PREREGISTRATION_"+a+"_"+e+"_GIFTING_CHECKED")):(d.increment("PREREGISTRATION_"+e+"_GIFTING_UNCHECKED"),f.send("PREREGISTRATION_"+a+"_"+e+"_GIFTING_UNCHECKED"));h?(d.increment("PREREGISTRATION_"+e+"_AL_CHECKED"),f.send("PREREGISTRATION_"+a+"_"+e+"_AL_CHECKED")):(d.increment("PREREGISTRATION_"+e+"_AL_UNCHECKED"),f.send("PREREGISTRATION_"+
a+"_"+e+"_AL_UNCHECKED"))}})});l.when("A","PreRegistration.Controller").execute(function(g,f){g.on("a:accordion:buybox_accordion:select",function(d){f.reset()});g.on("a:accordion:buybox-accordion:select",function(d){f.reset()})});"use strict";l.when("a-checkbox","add-to-cart-parameter-name","add-to-cart-constants").register("mobile-app-account-linking",function(g,f,d){return{updateData:function(a){var e=f.constructParameterName(d.ITEM_TYPES.BASE,0,d.PARAMETER_PATHS.DEVICEPREREGISTRATION),k=g("#account-linking");
0<k.size()&&k.isChecked()?a.inputs[e]="true":a.inputs[e]="false";return a}}})});
/* ******** */
(function(d){var f=window.AmazonUIPageJS||window.P,g=f._namespace||f.attributeErrors,b=g?g("DetailPagePrelaunchAssets",""):f;b.guardFatal?b.guardFatal(d)(b,window):b.execute(function(){d(b,window)})})(function(d,f,g){d.when("A").register("nlx-notify-me-utils",function(b){function d(){function e(c){return(10>c?"0":"")+c}var c=new Date;return c.getUTCFullYear().toString().substr(2)+e(c.getUTCMonth()+1)+e(c.getUTCDate())+e(c.getUTCHours())}function g(e,c,b,a){a="sub"===a?"n":"u";var f=d();return c+"_"+
e+"_"+(b?"m":"d")+"_"+f+"_"+a}function p(e){l.get("/hctp/log/refMarker?ref_\x3d"+e)}function q(e,c){"undefined"!==typeof f.csa&&"undefined"!==typeof f.ue&&"undefined"!==typeof f.ue.count&&f.csa("Events",{producerId:h.PRODUCER_ID})("log",{schemaId:h.SCHEMA_ID,producerId:h.PRODUCER_ID,featureName:h.FEATURE_NAME,metricType:e,messageId:c},{ent:"all"})}function r(e){var c="",b;for(b in e)""!==c&&(c+="\x26"),c+=b+"\x3d"+encodeURIComponent(e[b]);return c}function m(e){var c=0===l("html.a-mobile").length?
!1:!0,d=l(e.target),a=d.data(),v=a.signedIn,t=a.refMarker,m=a.subscribeText,w=a.unsubscribeText,u=a.notifyUri,n=a.action,k;a:switch(a.source){case "DETAIL":k="d";break a;default:k="s"}var a={topics:a.topic,channels:a.channel,csrfToken:a.token,entityID:a.entityId,entityType:a.entityType,action:a.action,source:a.source,shouldSendConfirmationEmail:a.sendConfirmationEmail},x=d.text();e.preventDefault();!0!==v?f.location.href=u+"?"+r(a)+"\x26redirectUrl\x3d"+encodeURIComponent("/preferences/subscriptions/your-subscriptions/current-subscriptions?noMoaR\x3d1"):
(d.html('\x3cspan class\x3d"a-spinner a-spinner-small"\x3e\x3c/span\x3e'),b.ajax(u,{params:a,method:"post",success:function(){var a,b;switch(n){case "sub":a="unsub";b=w;break;default:a="sub",b=m}d.text(b);d.data("action",a);p(g(k,t,c,n));q(h.METRIC_TYPE.CLICK,g(k,t,c,n))},error:function(){d.text(x)}}))}var l=b.$,h={PRODUCER_ID:"brandxassistedshopping",FEATURE_NAME:"detailPagePrelaunch",SCHEMA_ID:"brandxassistedshopping.ClientSideMetrics.1",METRIC_TYPE:{CLICK:"click"}};return{generateQueryString:r,
registerRefMarker:p,logClientSideMetric:q,getButtonClickHandler:function(){return m}}});"use strict";d.when("A","nlx-notify-me-utils").register("nlx-dp-notify-me-component",function(b,d){b=b.$;d=d.getButtonClickHandler();b(document).delegate(".nlx-dp-notify-me","click",d)})});
/* ******** */
(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(f){var h=window.AmazonUIPageJS||window.P,l=h._namespace||h.attributeErrors,m=l?l("AllOffersDisplayIngressAssets",""):h;m.guardFatal?m.guardFatal(f)(m,window):m.execute(function(){f(m,window)})})(function(f,h,l){f.execute("all-offers-display-ingress-init",function(){var m=h.uet,n=h.uex;"function"===typeof m&&m("bb","aod-ingress-assets-load-time",{wb:1});f.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(a,d,c,g,e){function k(b){f.now().execute(function(c){c!==l||g.isMarkerOverrideRegistered()||("function"===typeof q&&q("bb","aod-main-assets-injection",{wb:1}),f.register("aodIngressClick"),f.register("aodDeclarativeEvent",function(){return b}),g.setMarkerOverrideTriggered())})}var q=h.uet;a.state("aod:assetsLoaded",{isAodAssetsLoaded:!0});e.triggerUnitCounter("aodIngressAssetsLoadCtr");a.declarative("show-all-offers-display","click keydown",function(b){if("click"===b.type||"keydown"===b.type&&
(32===b.$event.keyCode||32===b.$event.key))b.$event.preventDefault(),b.$event.stopPropagation(),b&&b.data&&b.data.ingressName&&e.incrementAndTriggerCounter(b.data.ingressName+"LoadAod"),!a.state("aod:assets2Loaded")&&c.isClickOnAODIngressSupported(b)&&(k(b),f.when("aod-load-event-handler","aodDeclarativeEvent").execute(function(c,b){b&&b.data&&(b.data.pc="dp");c.renderAodAction(b)}))});a.declarative("s-show-all-offers-display","click",function(b){b.$event.preventDefault();b.$event.stopPropagation();
!a.state("aod:assets2Loaded")&&c.isClickOnAODIngressSupported(b)&&(k(b),f.when("search-all-offers-display-util","aodDeclarativeEvent").execute(function(b,c){b.searchOnClickHandler(c)}))});a.declarative("all-offers-display-show-from-morpheus","click",function(b){b.$event.preventDefault();b.$event.stopPropagation();!a.state("aod:assets2Loaded")&&c.isClickOnAODIngressSupported(b)&&(k(b),f.when("all-offers-display-morpheus-util","aodDeclarativeEvent").execute(function(b,c){b.openAODFromMorpheus(c)}))})});
f.when("A","jQuery","all-offers-display-register-state","all_offers_display_ingress_csm_counters").execute("all-offers-display-enable-compare",function(a,d,c,g){var e=h.uet;a.state("aod:assets2Loaded")||(a=h.location.href.split("?"),1<a.length&&(a=a[1].toLowerCase().split(/[&,#]/))&&-1!==a.indexOf("aod\x3d1")&&f.now().execute(function(d){d===l&&(c.isMarkerOverrideRegistered()?g.incrementAndTriggerCounter("aodAutoLoadMarkerOverrideSetCtr"):(g.triggerUnitCounter("aodAutoLoadAssetsRequestedCtr"),"function"===
typeof e&&e("bb","aod-main-assets-injection-auto-load",{wb:1}),f.register("aodIngressClick"),c.setMarkerOverrideTriggered()))}))});f.when("A","jQuery","all_offers_display_ingress_olp_hyperlink").register("all_offers_display_ingress_utils",function(a,d,c){return{isClickOnAODIngressSupported:function(d){return c.getOlpHyperlink(d)?!0:!1}}});f.register("all_offers_display_ingress_csm_counters",function(){var a=h.ue;return{incrementAndTriggerCounter:function(d){a&&a.count&&a.count(d,(a.count(d)||0)+1)},
triggerUnitCounter:function(d){a&&a.count&&a.count(d,1)}}});f.when("all_offers_display_ingress_csm_counters").register("all_offers_display_ingress_aod_supported",function(a){return{isPropertySupported:function(d,c,g){var e=typeof d[c]===g;if(!e){var k={};d.tagName&&(k.tagName=d.tagName);d.getAttribute&&"function"===typeof d.getAttribute&&(d.getAttribute("id")&&(k.id=d.getAttribute("id")),d.getAttribute("class")&&(k.class=d.getAttribute("class")),d.getAttribute("href")&&(k.href=d.getAttribute("href")));
d="aodPropertyUnsupportedMessage, element: "+JSON.stringify(k);f.log(d+(", propertyName: "+c+", propertyType: "+g),"WARN","aodPropertyUnsupportedMessage");a.triggerUnitCounter("aodPropertyUnsupportedMessage")}return e}}});f.when("A","jQuery","all_offers_display_ingress_aod_supported").register("all_offers_display_ingress_olp_hyperlink",function(a,d,c){return{getOlpHyperlink:function(a){if(a&&a.$event&&a.$event.target){var e=a.$event.target;if("A"===e.nodeName&&e.href)return e.href;if(c.isPropertySupported(a.$event.target,
"closest","function"))return(a=e.closest("a"))?a.href:null;if(a=d(e).closest("a"))return a.attr("href")}return null}}});f.when().register("all-offers-display-register-state",function(){var a=!1;return{isMarkerOverrideRegistered:function(){return a},setMarkerOverrideTriggered:function(){a=!0}}});"use strict";f.when("A","mbc_constants","all_offers_display_ingress_csm_counters").register("mbc_atc_cart_api_ajax_controller",function(a,d,c){var g=l,e;return{mbcAtcAjaxCall:function(e){g?c.incrementAndTriggerCounter(d.MBC_ATC_CLICK_CANCELLED_CSM_METRIC):
g=a.$.ajax({url:e.url,type:e.type,data:e.data,cache:!1,headers:e.headers,xhrFields:e.xhrFields,success:e.successHandler,error:e.errorHandler,timeout:e.timeout||1E4})},updateCartCount:function(a){f.when("EWC").execute(function(c){e=c});e!==l&&"function"===typeof e.refresh?(e.refresh(),c.triggerUnitCounter(d.MBC_EWC_REFRESH_API_CSM_METRIC_SCOPE_NAME)):(f.when("nav.setCartCount").execute(function(c){c(a)}),c.triggerUnitCounter(d.MBC_NAV_API_CSM_METRIC_SCOPE_NAME))},resetAjaxHandler:function(){g=l}}});
"use strict";f.when("A","mbc_constants","mbc_cart_api_handler").execute("mbc_atc_action_handler",function(a,d,c){a.declarative("mbc-atc-action",d.MBC_WIDGET_TRIGGER_EVENTS,function(a){c.addToCart(a.data,!0)})});"use strict";f.when("A","jQuery","mbc_constants","all_offers_display_ingress_csm_counters","mbc_atc_cart_api_ajax_controller").register("mbc_cart_api_handler",function(a,d,c,f,e){function g(b){f.triggerUnitCounter(c.MBC_CART_API_ATC_CSM_FAILURE_METRIC_SCOPE_NAME);var a=b.offerIndex;d(c.MBC_OFFER_ADDED_TO_CART+
a).addClass(c.AUI_HIDE_ELEMENT_CSS_NAME);d(c.MBC_OFFER_NOT_ADDED_TO_CART+a).removeClass(c.AUI_HIDE_ELEMENT_CSS_NAME);h(b.offerIndex)}function h(a){d(c.MBC_OFFER_VIEW_CART_BUTTON+a).removeClass(c.AUI_HIDE_ELEMENT_CSS_NAME);d(c.MBC_OFFER_ATC_BUTTON_ID+a).addClass(c.AUI_HIDE_ELEMENT_CSS_NAME)}return{addToCart:function(a,k){var b=d(c.MBC_ATC_AJAX_ENDPOINT).val(),l=d(c.MBC_ATC_CSRF_TOKEN).val(),m=d(c.MBC_LANGUAGE_HEADER).val(),n={items:[{asin:a.asin,offerListingId:a.oid,quantity:a.minQty}]},p=document.querySelector('meta[name\x3d"encrypted-slate-token"]');
b={url:"https://"+b+"?ref\x3d"+a.refTag+"\x26sr\x3d"+a.sr+"\x26qid\x3d"+a.qid,type:"POST",data:JSON.stringify(n),headers:{"Accept-Language":m,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":p&&p.content?p.content:""},xhrFields:{withCredentials:!0},timeout:1E4,successHandler:function(b){b&&b.entity&&b.entity.items&&b.entity.items[0]&&0<b.entity.items[0].quantity?(b.entity.count&&b.entity.count.entity&&
b.entity.count.entity.items?e.updateCartCount(b.entity.count.entity.items):(f.triggerUnitCounter(c.MBC_CART_API_SUCCESS_COUNT_FAILURE_CSM_METRIC),e.updateCartCount(b.entity.items[0].quantity)),f.triggerUnitCounter(c.MBC_CART_API_ATC_CSM_SUCCESS_METRIC_SCOPE_NAME),k&&d(c.MBC_OFFER_ADDED_TO_CART+a.offerIndex).removeClass(c.AUI_HIDE_ELEMENT_CSS_NAME),h(a.offerIndex)):g(a);e.resetAjaxHandler()},errorHandler:function(b){422===b.status&&(b=JSON.parse(b.responseText))&&b.entity&&b.entity.items&&b.entity.items[0]&&
(b.entity.count&&b.entity.count.entity&&b.entity.count.entity.items?e.updateCartCount(b.entity.count.entity.items):(f.triggerUnitCounter(c.MBC_CART_API_ERROR_COUNT_FAILURE_CSM_METRIC),e.updateCartCount(b.entity.items[0].quantity)));g(a);e.resetAjaxHandler()}};e.mbcAtcAjaxCall(b)}}});f.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"],
EXTERNAL_REFERENCE_ID:["properties","externalReferenceId"]},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,w,y,p,q,f,r,a,l){function u(){var b=l.getBuyingOptionPriceDataMap(),I=e;if(b){var a=x;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();x=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:x,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(x);d.updateGroupName(e);f.updatePriceSubtotalFeature(b);r.update(d);l.getBuyingOptionType(x,e)===y.UNKNOWN||G&&!l.isFeatureSelectionPresent(d.getCCFeaturesState())||q.addItemAssociationBundleData(d.getTwisterPlusFeaturesState(),!0);w.callRegisteredFeaturesCallback(n.CC_SELECTION_UPDATE_EVENT);a.updateInputCheckbox(b)}var n=y,D,A,F,E=c.$,z,G=!1,x,e;return{initializeTwisterPlus:function(){v();t()},refreshTwisterPlusData:function(){v();t();w.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){x=b;d.updateCurrentBuyingOptionPosition(b);q.reInitialiseItemCountVal()},setCurrentGroupName:function(b){e=b;d.updateGroupName(b);q.reInitialiseItemCountVal()},getCurrentBuyingOptionPosition:function(){return x},getCurrentGroupName:function(){return e},updateTwisterPlusComponents:function(){m()},getTwisterPlusState:function(){return c.copy(d.getTwisterPlusFeaturesState())},registerFeature:function(b,e,a){try{"function"===typeof a?w.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,w,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(w.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=w.ccManager,m=w.registrationMap,n,D=w.metrics,A=w.ccCardsRefresh,F,E,z,G="",x;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"===x||"T3"===x)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===w.DEVICE_TYPE_WEB&&l&&!b&&e!==w.ccFeatures.WIRELESS_PROMOTIONS_FEATURE&&(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"!==x&&"T3"!==x||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"))x=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"!==x&&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(w.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()});c.on("twisterPlusBelowOD:visibility:change",function(){p()})});"use strict";h.when("A","twister-plus-logger-service","twister-plus-constants").register("twister-plus-feature-state",
function(c,d,w){function y(a){f.currentBuyingOptionPosition=a||0}function p(a){return f.ccFeaturesState[a]}function q(a){return f.ccRemovedSelections[a]}var f={},r=w.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,c){var d=!1;a!==g&&c!==g?(d=f.ccRemovedSelections,q(a)===g&&(f.ccRemovedSelections[a]=[]),q(a).push(c),c=q(a),d[a]=c,d=!0):h.log("CC featureName or featureData passed to Twister+ is not defined.","FATAL",a);return d},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(L){var H=window.AmazonUIPageJS||window.P,t=H._namespace||H.attributeErrors,y=t?t("DetailPageTwisterPlusSubAssets@itemAssociation","DetailPageTwisterPlusSubAssets"):H;y.guardFatal?y.guardFatal(L)(y,window):y.execute(function(){L(y,window)})})(function(L,H,t){"use strict";L.when("A","utils","twister-plus-constants","twister-plus-feature-state","item-association-utils").register("itemAssociation",function(y,u,v,E,A){function C(){var a=u.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 Q(){var a=u.getActiveAccordionRow(E.getCurrentBuyingOptionPosition(),E.getCurrentGroupName());return a&&1===a.length?a.find(m.BUYNOW_ELEMENT_ID):g(m.BUYNOW_ELEMENT_ID)}function Z(a){return 0<C().clone().find(m.ITEM_ASSOCIATION_INPUTS_CLASS).remove().end().find('input[name\x3d"'+a+'"]').length}function D(a,b,w){var k=[],d=e.CUSTOM_NAME_STRING+"."+a+"."+b,d=g("\x3c"+I.INPUT+"\x3e",{type:e.INPUT_TYPE_HIDDEN,
id:d,name:d,value:w[e.ITEM_ASSOCIATION_GROUP_KEY]});a=e.CUSTOM_VALUE_STRING+"."+a+"."+b;w=g("\x3c"+I.INPUT+"\x3e",{type:e.INPUT_TYPE_HIDDEN,id:a,name:a,value:JSON.stringify(w[e.ENCODED_ITEM_ASSOC_VAL])});k.push(d);k.push(w);return k}function T(a,b){for(var w=[],k,d=0;d<b.length;d++)k=b[d].name===K.IS_BUYBACK_KEY?g("\x3c"+I.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===K.IS_BUYBACK_FEE?g("\x3c"+I.INPUT+"\x3e",{type:e.INPUT_TYPE_HIDDEN,
id:b[d].id,name:e.CUSTOM_VALUE_STRING+"."+a+".1",value:b[d].value}):g("\x3c"+I.INPUT+"\x3e",{type:e.INPUT_TYPE_HIDDEN,id:b[d].id,name:b[d].name,value:b[d].value}),w.push(k);return w}function U(a){return g("\x3c"+I.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,w,k){var d=a.featureName;a=a.formData;var c=[];if(a!==t){var g;d===K.PAYMENT_OPTIONS_FEATURE&&a[0].inputName===K.PAYMENT_OFFER_INPUT_NAME&&
(g=w?K.PAYMENT_OPTIONS_BUY_NOW_CART_TYPE:K.PAYMENT_OPTIONS_ATC_CART_TYPE);for(w=0;w<a.length;w++)g!==t&&(a[w].inputValue[K.CART_TYPE]=g),d=a[w],"function"!==typeof b||k&&!e.PARAM_NAMES[d.inputName]||(d=b(d),c.push(d))}return c}function x(a,b,w){var e=w.quantity,d=w.offerListingId;e!==t&&d!==t?(a.push('\x3cinput type\x3d"hidden" id\x3d"asin.'+b+'" name\x3d"asin.'+b+'" value\x3d"'+w.asin+'"\x3e'),w=ba(b,e,!1),a.push(w),b=ca(b,d,!1),a.push(b)):L.log("offerListingId or quantity is not defined for the asin in the itemData",
"Error",JSON.stringify(w));return a}function G(){return g("\x3c"+I.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 l(a){var b=Q(),w=b.find(m.ITEM_ASSOCIATION_INPUTS_CLASS);w.length?g(w).replaceWith(a):b.append(a)}function H(a,b){var w=g("\x3c"+I.FIELDSET+"\x3e",{"class":m.ITEM_ASSOCIATION_INPUTS_CLASS_NAME}),k=[],d={},c=2;if(ga&&u.isFeatureSelectionPresent(R.ccFeaturesState)){c={};c.quantity=g("#addToCart #atc-mbb-quantity").val();
var f=g("input[id|\x3dmbb-checkbox-input]:checked"),p=f.closest(".a-declarative[data-action\x3d'mbb-mobile-checkbox-toggle']");c.asin=f.val();c.offerListingId=p.data("mbb-mobile-checkbox-toggle")?p.data("mbb-mobile-checkbox-toggle").offeringId:"";k=x(k,2,c);c=3}for(f=0;f<a.length;f++){var p=a[f],n=p.featureName;d[n]=d[n]!==t?d[n]+1:0;if(V){var q,h,z=1;a[f][e.FEATURE_NAME_KEY]===e.KEY_BUYBACK&&(q=a[f].buynowData||[],h=T(c,q),g.merge(k,h),z=2);q=a[f].customData||[];for(var r=0;r<q.length;r++)h=D(c,
r+z,q[r]),g.merge(k,h),h=A.createCustomInputFieldsForNATC(d[n],n,q[r]),g.merge(k,h)}p.asin!==t&&(k=x(k,c,p),c++,k=A.addAsinItemsInputFieldsForNATC(d[n],n,k,p));p=F(a[f],U,!1,!1);g.merge(k,p);p=F(a[f],A.createFormInputFieldForNATC,!1,!0);g.merge(k,p)}if(k.length)for(d=[],Z(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"'+R.baseAsinState.asin+'"\x3e')),Z(e.QUANTITY_KEY+e.FIRST_INDEX)||(ha?(c=u.getBaseItemQuantity(),
c===t&&(c=1)):c=C().find('input[id\x3d"quantity"]').val(),c=ba(e.BASE_ASIN_INDEX,c),d.push(c)),Z(e.OFFERING_ID_KEY+e.FIRST_INDEX)||(c=ca(e.BASE_ASIN_INDEX,R.baseAsinState.offerListingId),d.push(c)),g.merge(k,d),b&&(d=G(),k.push(d)),d=0;d<k.length;d++)g(w).append(k[d]);k=g("\x3c"+I.FIELDSET+"\x3e",{"class":m.ITEM_ASSOCIATION_INPUTS_CLASS_NAME});d=[];c=2;f=1;for(p=0;p<a.length;p++){n=a[p];if(V)for(r=1,a[p][e.FEATURE_NAME_KEY]===e.KEY_BUYBACK&&(q=a[p].buynowData||[],z=T(c,q),g.merge(d,z),r=2),q=a[p].customData||
[],h=0;h<q.length;h++)z=D(c,h+r,q[h]),g.merge(d,z);n.asin!==t&&(d=x(d,f,n),c++,f++);n=F(a[p],U,!0,!1);g.merge(d,n)}if(d.length)for(b&&(a=G(),d.push(a)),a=0;a<d.length;a++)g(k).append(d[a]);w.length&&(a=C().find(m.ITEM_ASSOCIATION_INPUTS_CLASS),a.length?g(a).replaceWith(w):C().append(w));k.length&&l(k)}function W(){if(M===t||0===M.length)M=C().find('input[name\x3d"itemCount"]'),ia=0===M.length?0:parseInt(M[0].value)}function b(){if(N===t||0===N.length)N=Q().find('input[name\x3d"itemCount"]'),ja=0===
N.length?0:parseInt(N[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 h(a,b,c){var k={};k[e.CUSTOM_NAME_STRING+"."+a+"."+b]=c[e.ITEM_ASSOCIATION_GROUP_KEY];
k[e.CUSTOM_VALUE_STRING+"."+a+"."+b]=JSON.stringify(c[e.ENCODED_ITEM_ASSOC_VAL]);return k}function r(a,b){for(var c={},k=0;k<b.length;k++){var d=b[k].name,g=b[k].value;b[k].name===K.IS_BUYBACK_KEY?c[e.CUSTOM_NAME_STRING+"."+a+".1"]=g:b[k].name===K.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={};J={};da={};for(var k=R.baseAsinState.asin,
d=u.getBaseItemQuantity(),f=d=d?d:O.addToCartData[0]&&O.addToCartData[0].initialFormData&&O.addToCartData[0].initialFormData.inputs?O.addToCartData[0].initialFormData.inputs.quantity:"",aa=R.baseAsinState.offerListingId,p=2,n=0;n<a.length;n++){var q=a[n],l=q.featureName;c[l]=c[l]!==t?c[l]+1:0;var m=q.asin,x=q.quantity,B=q.offerListingId;m!==t&&x!==t&&B!==t&&(k+=e.PIPE_SEPARATOR+m,d+=e.PIPE_SEPARATOR+x,aa+=e.PIPE_SEPARATOR+B,da[m]={quantity:x,offerListingId:B},m=A.addAsinItemKeyValuePairsForNATC(c[l],
l,q),J=g.extend(J,m));if(V){var v,x=1;a[n][e.FEATURE_NAME_KEY]===e.KEY_BUYBACK&&(m=a[n].buynowData||[],v=r(p,m),b=g.extend(b,v),x=2);m=a[n].customData||[];for(B=0;B<m.length;B++)v=h(p,B+x,m[B]),b=g.extend(b,v),v=A.createCustomKeyValuePairForNATC(c[l],l,m[B]),J=g.extend(J,v)}q.asin!==t&&p++;l=F(a[n],ka,!1,!1);for(q=0;q<l.length;q++)b=g.extend(b,l[q]);J=g.extend(J,b);l=F(a[n],A.createFormInputKeyValuePairForNATC,!1,!0);for(q=0;q<l.length;q++)J=g.extend(J,l[q])}b[e.FORM_DATA_ASIN_KEY]=k;b[e.QUANTITY_KEY]=
d;aa&&(b[e.FORM_DATA_OID_KEY]=aa);""!==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={},k=u.getBaseItemQuantity();c[e.QUANTITY_KEY]=k?k:P.buyNowData[0]&&P.buyNowData[0].initialFormData&&P.buyNowData[0].initialFormData.inputs?P.buyNowData[0].initialFormData.inputs.quantity:"";for(k=0;k<a.length;k++){var d=a[k],f=k+
2,l=k+1;c[e.ASIN_KEY+"."+l]=d.asin;var p=ba(l,d.quantity,!0),c=g.extend(c,p),d=ca(l,d.offerListingId,!0),c=g.extend(c,d);if(V){p=1;a[k][e.FEATURE_NAME_KEY]===e.KEY_BUYBACK&&(d=a[k].buynowData||[],l=r(f,d),c=g.extend(c,l),p=2);for(var d=a[k].customData||[],n=0;n<d.length;n++)l=h(f,n+p,d[n]),c=g.extend(c,l)}f=F(a[k],ka,!0,!1);for(d=0;d<f.length;d++)c=g.extend(c,f[d])}!u.isEmpty(c)&&b&&(c[e.IS_BUYBACK_INPUT_FLAG]=e.IS_BUYBACK_INPUT_FLAG_VALUE);return c}function X(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:u.getActiveGroupName();if(u.getAccordionRowBuyingOptionType(g(this).parents(m.MOBILEAPP_ACCORDION_OR_SINGLEOFFER_ELEMENT_ID),a)!==v.UNKNOWN&&(a=g(this).parents(m.DECLARATIVE_CLASS),0<a.length)){var c=g(a).data(m.DATA_ATTRIBUTE_ACTION),c=u.convertHTMLDataAttributesToKeys(c),a=y.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);y.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=u.getBaseItemQuantity(),a[e.QUANTITY_KEY]=a[e.QUANTITY_KEY]+e.PIPE_SEPARATOR+(b?b:O.addToCartData[0]&&O.addToCartData[0].initialFormData&&O.addToCartData[0].initialFormData.inputs?O.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:u.getActiveGroupName();if(u.getAccordionRowBuyingOptionType(g(this).parents(m.MOBILEAPP_ACCORDION_OR_SINGLEOFFER_ELEMENT_ID),a)!==v.UNKNOWN&&(a=g(this).parents(m.DECLARATIVE_CLASS),0<a.length)){var f=b[d++];if(f!==t){var h=g.extend({},f.initialFormData.inputs,c),l=g.extend({},f.initialFormData);e&&pa(h,f.initialFormData.inputs,c);l.inputs=h;a.data(f.dataActionKey,
l)}}});if(e){var d=0,f=X(a);a.each(function(){var a=g(this).parents(m.MOBILEAPP_TABS_ELEMENT_ID).parent().attr(m.TAB_GROUP_NAME),a=a?a:u.getActiveGroupName();if(u.getAccordionRowBuyingOptionType(g(this).parents(m.MOBILEAPP_ACCORDION_OR_SINGLEOFFER_ELEMENT_ID),a)!==v.UNKNOWN&&(a=g(this).parents(m.DECLARATIVE_CLASS),0<a.length)){var b=f[d++];if(b!==t){y.each(Object.keys(fa),function(a,c){delete b.initialFormData.inputs[a]});var c=g.extend({},b.initialFormData.inputs,J),e=g.extend({},b.initialFormData);
e.inputs=c;a.data(b.dataActionKey,e)}}});fa=J;ea=da}}function qa(a,b){var e=na(a,b);y.delay(function(){P.addToCartData=X(c());la(c(),P.addToCartData,e,!0)});a=oa(a,b);la(f(),P.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(S===e.DEVICE_TYPE_MOBILE_APP)qa(a,c),H(a,c);else if(S===e.DEVICE_TYPE_MOBILE_WEB)H(a,c);else{var f=g("\x3c"+I.FIELDSET+"\x3e",{"class":m.ITEM_ASSOCIATION_INPUTS_CLASS_NAME});g(m.ITEM_ASSOCIATION_INPUTS_CLASS).remove();var k=[],d={},h=C().find('input[name^\x3d"offeringID"]').length+1,r=h+1,p=a.length;W();M.length?M[0].value=ia+p:(C().append('\x3cinput type\x3d"hidden" name\x3d"itemCount" value\x3d"'+p+'"\x3e'),M=C().find('input[name\x3d"itemCount"]'));for(p=0;p<a.length;p++){var n=
a[p],q=n.featureName;d[q]=d[q]!==t?d[q]+1:0;if(V){var v,z,u=1;a[p][e.FEATURE_NAME_KEY]===e.KEY_BUYBACK&&(v=a[p].buynowData||[],z=T(h,v),g.merge(k,z),u=2);v=a[p].customData||[];for(var B=0;B<v.length;B++)z=D(r,B+u,v[B]),g.merge(k,z),z=A.createCustomInputFieldsForNATC(d[q],q,v[B]),g.merge(k,z)}n.asin!==t&&(k=x(k,h,n),h++,r++,k=A.addAsinItemsInputFieldsForNATC(d[q],q,k,n));n=F(a[p],U,!1,!1);g.merge(k,n);n=F(a[p],A.createFormInputFieldForNATC,!1,!0);g.merge(k,n)}if(k.length)for(c&&(d=G(),k.push(d)),d=
0;d<k.length;d++)g(f).append(k[d]);k=g("\x3c"+I.FIELDSET+"\x3e",{"class":m.ITEM_ASSOCIATION_INPUTS_CLASS_NAME});d=[];h={};r=Q().find('input[name^\x3d"offeringID"]').length+1;p=r+1;n=a.length;b();N.length?N[0].value=ja+n:(Q().append('\x3cinput type\x3d"hidden" name\x3d"itemCount" value\x3d"'+n+'"\x3e'),N=Q().find('input[name\x3d"itemCount"]'));for(n=0;n<a.length;n++){q=a[n];v=q.featureName;h[v]=h[v]!==t?h[v]+1:0;if(V){var y,B=1;a[n][e.FEATURE_NAME_KEY]===e.KEY_BUYBACK&&(u=a[n].buynowData||[],y=T(r,
u),g.merge(d,y),B=2);u=a[n].customData||[];for(z=0;z<u.length;z++)y=D(p,z+B,u[z]),g.merge(d,y),y=A.createCustomInputFieldsForNATC(h[v],v,u[z]),g.merge(d,y)}q.asin!==t&&(d=x(d,r,q),r++,p++,d=A.addAsinItemsInputFieldsForNATC(h[v],v,d,q));q=F(a[n],U,!1,!1);g.merge(d,q);q=F(a[n],A.createFormInputFieldForNATC,!1,!0);g.merge(d,q)}if(d.length)for(c&&(a=G(),d.push(a)),a=0;a<d.length;a++)g(k).append(d[a]);f.length&&(a=C().find(m.ITEM_ASSOCIATION_INPUTS_CLASS),a.length?g(a).replaceWith(f):C().append(f));k.length&&
l(k)}}var g=y.$,Y={name:"itemAssociation"},S="",ga,ha=!1,fa={},J={},da={},ea={},V,R={ccFeaturesState:{},baseAsinState:{}},P={addToCartData:[],buyNowData:[]},O={addToCartData:[]},e=v.itemAssociation,I=v.htmlTags,m=v.selectors,K=v.ccFeatures,M,N,ia,ja;Y.addItemAssociationBundleData=function(a,b,c,f){ga=c;V=b;ha=f;var d=!1,h=[];R.ccFeaturesState=a.ccFeaturesState;R.baseAsinState=a.twisterState;g.each(R.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[K.BUY_NOW_DATA]=c.buynowData);h.push(b)})});ra(h,d);S===e.DEVICE_TYPE_MOBILE_APP&&y.trigger(v.TP_AFTER_BUYBOX_UPDATE_EVENT)};Y.init=function(){S=
u.getDeviceType();fa={};ea={};S===e.DEVICE_TYPE_MOBILE_APP&&(O.addToCartData=X(c()),P.addToCartData=X(c()),P.buyNowData=X(f()));S===v.DEVICE_TYPE_WEB&&(W(),b())};Y.reInitialiseItemCountVal=function(){N=M=t;S=u.getDeviceType();S===v.DEVICE_TYPE_WEB&&(W(),b())};return Y});"use strict";L.when("A","twister-plus-constants").register("item-association-utils",function(t,u){function v(b,c){var f=l.ITEMS_PREFIX;return f+=l.OPENING_SQUARE_BRACKET+(b+"."+c)+l.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+=l.OPENING_SQUARE_BRACKET+b+l.CLOSING_SQUARE_BRACKET}):"string"===typeof c&&(f+=l.OPENING_SQUARE_BRACKET+c+l.CLOSING_SQUARE_BRACKET);return f}function A(b,c,f){return x("\x3c"+ma.INPUT+"\x3e",{type:f,id:b,name:b,value:c})}function C(b,c){var f={};f[b]=c;return f}function Q(b,c){if("number"===typeof b&&0<=b&&"string"===typeof c)return b=v(b,c),b=E(b,l.PARAM_NAMES.ITEM_ASSOCIATION);L.log("Invalid data-type for itemIndex or itemType: itemIndex \x3d "+
b+", itemType \x3d "+c,"ERROR",W)}function H(b,c,f){return f?C(b,c):A(b,c,l.INPUT_TYPE_HIDDEN)}function D(b,c,f,h){if("string"===typeof f)return b=E(b,c),H(b,f,h)}function T(b,c,f){if("string"===typeof c||"number"===typeof c)return b=E(b,l.PARAM_NAMES.QUANTITY),H(b,c,f)}function U(b,c,f){if("object"===typeof c&&Array.isArray(c)&&"DELETE"===c[0].type)return b=E(b,l.PARAM_NAMES.DELETE_CONSTRAINT),H(b,c[0].mutuallyInclusive,f)}function F(b,c,f){var h=f?{}:[];if(c){if(c.AccessoryType){var r=E(b,l.PARAM_NAMES.ACCESSORY_TYPE);
f?(r=C(r,c.AccessoryType),h=x.extend(h,r)):(r=A(r,c.AccessoryType,l.INPUT_TYPE_HIDDEN),h.push(r))}c.CustomerAppointmentType&&(r=E(b,l.PARAM_NAMES.CUSTOMER_APPOINTMENT_TYPE),f?(r=C(r,c.CustomerAppointmentType),h=x.extend(h,r)):(r=A(r,c.CustomerAppointmentType,l.INPUT_TYPE_HIDDEN),h.push(r)));c.externalReferenceId&&(b=E(b,l.PARAM_NAMES.EXTERNAL_REFERENCE_ID),f?(c=C(b,c.externalReferenceId),h=x.extend(h,c)):(c=A(b,c.externalReferenceId,l.INPUT_TYPE_HIDDEN),h.push(c)))}return h}var x=t.$,G={},l=u.itemAssociation,
ma=u.htmlTags,W=u.ATTRIBUTION;G.createCustomInputFieldsForNATC=function(b,c,f){var h=[];b=Q(b,c);f=f[l.ENCODED_ITEM_ASSOC_VAL];"string"===typeof b&&f&&(c=D(b,l.PARAM_NAMES.ASSOCIATED_ITEM_ID,f.parentAsin,!1),h.push(c),c=D(b,l.PARAM_NAMES.PROGRAM_TYPE,f.type,!1),h.push(c),c=D(b,l.PARAM_NAMES.RENDER_TYPE,f.renderType,!1),h.push(c),c=U(b,f.constraintList,!1),h.push(c),b=F(b,f.properties,!1),h=h.concat(b));return h};G.addAsinItemsInputFieldsForNATC=function(b,c,f,h){var r=h.asin,t=h.quantity,u=h.offerListingId;
r&&t&&u?(b=v(b,c),r=D(b,l.PARAM_NAMES.ASIN,r,!1),f.push(r),t=T(b,t,!1),f.push(t),u=D(b,l.PARAM_NAMES.OFFER_LISTING_ID,u,!1),f.push(u)):L.log("Invalid data (asin/offerListingId/quantity) is present in itemData"+JSON.stringify(h),"ERROR",W);return f};G.createFormInputFieldForNATC=function(b){var c=v(l.BASE_ASIN_INDEX_FOR_NATC,l.BASE_ASIN_ITEM_TYPE),c=E(c,l.PARAM_NAMES[b.inputName]),f="string"===typeof b.inputValue?b.inputValue:JSON.stringify(b.inputValue);return A(c,f,b.inputType)};G.createCustomKeyValuePairForNATC=
function(b,c,f){var h={};b=Q(b,c);f=f[l.ENCODED_ITEM_ASSOC_VAL];"string"===typeof b&&f&&(c=D(b,l.PARAM_NAMES.ASSOCIATED_ITEM_ID,f.parentAsin,!0),h=x.extend(h,c),c=D(b,l.PARAM_NAMES.PROGRAM_TYPE,f.type,!0),h=x.extend(h,c),c=D(b,l.PARAM_NAMES.RENDER_TYPE,f.renderType,!0),h=x.extend(h,c),c=U(b,f.constraintList,!0),h=x.extend(h,c),b=F(b,f.properties,!0),h=x.extend(h,b));return h};G.createFormInputKeyValuePairForNATC=function(b){var c=v(l.BASE_ASIN_INDEX_FOR_NATC,l.BASE_ASIN_ITEM_TYPE),c=E(c,l.PARAM_NAMES[b.inputName]);
b="string"===typeof b.inputValue?b.inputValue:JSON.stringify(b.inputValue);return C(c,b)};G.addAsinItemKeyValuePairsForNATC=function(b,c,f){var h={},r=f.asin,t=f.quantity,u=f.offerListingId;r&&t&&u?(b=v(b,c),r=D(b,l.PARAM_NAMES.ASIN,r,!0),h=x.extend(h,r),t=T(b,t,!0),h=x.extend(h,t),u=D(b,l.PARAM_NAMES.OFFER_LISTING_ID,u,!0),h=x.extend(h,u)):L.log("Invalid data (asin/offerListingId/quantity) is present in itemData"+JSON.stringify(f),"ERROR",W);return h};return G})});
/* ******** */
(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(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,
buyingOptionType:b.buyingOptionType,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(n){var p=window.AmazonUIPageJS||window.P,q=p._namespace||p.attributeErrors,l=q?q("DetailPageCCCommonAssets",""):p;l.guardFatal?l.guardFatal(n)(l,window):l.execute(function(){n(l,window)})})(function(n,p,q){n.when("A","atf").register("cc-common-constants",function(l){return{CLICK:"click",SCROLL:"scroll",DELETE:"DELETE",ANNOUNCE:"-announce",LI:"li",UL:"ul",DIV:"div",ID:"id",NAME:"name",IMG_KEY:"img-key",PAGE_REFRESH_ATF:"PageRefresh:ATF",CHANGE_PAGE_NUMBER:"change:pageNumber",CHANGE_PAGE_SIZE:"change:pageSize",
DISPLAY:"display",VISIBLE:":visible",VISIBILITY:"visibility",INLINE_BLOCK:"inline-block",INLINE:"inline",NONE:"none",DATA_ACCESSOR:"data-",DATA_ACTION:"data-action\x3d",DEFAULT_QTY:"1",OLD_QTY_DEFAULT_VAL:"-1",CSS_LEFT:"left",CSS_TOP:"top",OLD_QUANTITY_KEY:"oldQuantity",BUSINESS_METRICS_SELECTOR_SUFFIX:"BusinessMetrics",CONFIGS_STATE_SELECTOR_SUFFIX:"ConfigState",STATE_DATA:"state-data",SRC:"src",MOUSE_ENTER:"mouseenter",HIDDEN_CLASS:"aok-hidden",CURRENCY_SIGN_POSITION_LEFT:"left",CURRENCY_SIGN_POSITION_RIGHT:"right",
SELECT:"select",QUANTITY_SCROLLER_ATTACHED:"quantity-scroller-attached",QUANTITY_DROPDOWN:"-quantity-dropdown",UNDEFINED:"undefined",STRING:"string",OBJECT:"object",BOOLEAN:"boolean",NUMBER:"number",FUNCTION:"function",TRUE:"true",FALSE:"false",CARD_OFFSET:58,SEPARATOR_OFFSET:25,ANIMATION_DURATION_TAB_CLICK:100,ANIMATION_DURATION_FEATURE_SCROLL:75,ANIMATION_DURATION_SCROLL_LEFT:200,ANIMATION_DURATION_SCROLL:300,QUANTITY_BADGE_THRESHOLD:2,A_DECLARATIVE:".a-declarative",CC_COMMON_CLASS:".cc-common",
CAROUSEL_HEIGHT_CSS_CLASS:".cc-common-carousel-height",UPSELL_ASIN_ITEM:".upsell-asin-item",UPSELL_ASIN_IMAGE:".upsell-asin-image",UPSELL_ASIN_TITLE:".upsell-asin-title",ITEM_ADDED_ICON:".cc-common-item-added-icon",SELECTED_ICON_CSS:"cc-common-selected-icon-css",QTY_BADGE:"cc-common-quantity-badge",QTY_BADGE_CSS:"cc-common-quantity-badge-css",COMMON_CATEGORY_TAB:"common-category-tab",MINI_DP_SELECTOR:".cc-common-mini-dp",MINI_DP_CAROUSEL:"cc-common-mini-dp-carousel",MINI_DP_CAROUSEL_IMAGES:".cc-common-mini-dp-carousel-images",
CC_COMMON_PAGINATION:".cc-common-pagination",CC_COMMON_CAROUSEL_CONTAINER:".cc-common-mini-dp-carousel-container",CC_COMMON_MINI_DP_QTY_DROPDOWN:"cc-common-quantity-dropdown",CC_COMMON_MINI_DP_CANCEL:"cc-common-mini-dp-cancel",CANCEL_BUTTON_MINI_DP:"#cc-common-mini-dp-cancel-",SIDE_SHEET_SELECTOR:".cc-common-side-sheet",SIDE_SHEET_MAIN_IMAGE_SELECTOR_PREFIX:"#cc-common-sidesheet-imageMain-",SIDE_SHEET_IMAGE_BLOCK_SELECTOR:".sidesheet-thumbnail-group",SIDE_SHEET_IMAGE_FOCUS_ACTION:"sidesheet-image-focus",
TWISTER_PLUS_SIDE_SHEET_MAIN_SECTION:"#tp-side-sheet-main-section",TWISTER_PLUS_SIDE_SHEET_CONTENT:"#twister-plus-side-sheet-content",CC_COMMON_SIDE_SHEET_CANCEL:"cc-common-side-sheet-cancel",CANCEL_BUTTON_SIDE_SHEET:"#cc-common-side-sheet-cancel-",CAROUSEL_TRANSITION:"transition",CAROUSEL_TRANSITION_STRATEGY:"transition-slide-dynamic-card-width",ADD_BUTTON_MINI_DP:"#cc-common-mini-dp-asin-add-",ADDED_BUTTON_MINI_DP:"#cc-common-mini-dp-asin-remove-",UPDATE_BUTTON_MINI_DP:"#cc-common-mini-dp-asin-update-",
ADD_BUTTON_SIDE_SHEET:"#cc-common-side-sheet-asin-add-",ADDED_BUTTON_SIDE_SHEET:"#cc-common-side-sheet-asin-remove-",UPDATE_BUTTON_SIDE_SHEET:"#cc-common-side-sheet-asin-update-",ADD_BUTTON_LISTING:"#cc-common-upsell-asin-add-",ADDED_BUTTON_LISTING:"#cc-common-upsell-asin-remove-",ADD_BUTTON_LISTING_SELECTOR:".common-upsell-asin-add",ADDED_BUTTON_LISTING_SELECTOR:".common-upsell-asin-remove",ADD_BUTTON_MINI_DP_ACTION:"cc-common-mini-dp-asin-add-",ADDED_BUTTON_MINI_DP_ACTION:"cc-common-mini-dp-asin-remove-",
UPDATE_BUTTON_MINI_DP_ACTION:"cc-common-mini-dp-asin-update-",ADD_BUTTON_SIDE_SHEET_ACTION:"cc-common-side-sheet-asin-add-",ADDED_BUTTON_SIDE_SHEET_ACTION:"cc-common-side-sheet-asin-remove-",UPDATE_BUTTON_SIDE_SHEET_ACTION:"cc-common-side-sheet-asin-update-",AUI_BUTTON_SELECTED:"a-button-selected",AUI_BUTTON_FOCUS:"a-button-focus",AUI_SELECTED:"a-selected",AUI_SECONDARY_VIEW:"a-secondary-view",AUI_SUCCESS_COLOR:"a-color-success",AUI_SECONDARY_COLOR:"a-color-secondary",AUI_CAROUSEL:"a:carousel",AUI_CAROUSEL_PREV_BUTTON_CLASS:".a-carousel-goto-prevpage",
AUI_CAROUSEL_NEXT_BUTTON_CLASS:".a-carousel-goto-nextpage",AUI_CAROUSEL_LEFT_CLASS:".a-carousel-left",AUI_CAROUSEL_RIGHT_CLASS:".a-carousel-right",AUI_POPOVER_SHOW:"a:popover:show:",AUI_POPOVER_HIDE:"a:popover:hide",AUI_POPOVER_AJAX_CONTENT_LOADED:"a:popover:ajaxContentLoaded:",AUI_EXPANDER:"a:expander:",AUI_EXPANDER_EXPAND:":toggle:expand",AUI_EXPANDER_COLLAPSE:":toggle:collapse",AUI_TRUNCATE_CUT_CLASS:" .a-truncate-cut",AUI_TRUNCATE_FULL_CLASS:" .a-truncate-full",AUI_BUTTON_TOGGLE_GROUP:".a-button-toggle-group",
AUI_BUTTON_TOGGLE:".a-button-toggle",AUI_DROPDOWN_CONTAINER:".a-dropdown-container",AUI_DROPDOWN_SELECTED:"a:dropdown:selected:",SELECTION_UPSELL_ASIN:"upsellasin",SELECTION_OFFER_LISTING_ID:"offerlistingid",SELECTION_OFFER_PRICE:"offerprice",SELECTION_QUANTITY:"quantity",SELECTION_MIN_ORDER_QUANTITY:"minorderquantity",SELECTION_SUBTYPE:"subtype",SELECTION_TYPE:"type",SELECTION_FEATURE:"feature",SELECTION_ASIN_INDEX:"asinindex",SELECTION_ASIN_INDEX_VAL:"asinindexval",SELECTION_CATEGORY_INDEX:"catindex",
SELECTION_CATEGORY_DISPLAY_NAME:"categorydisplayname",SELECTION_PRICE_SYMBOL:"pricesymbol",SELECTION_PRICE_SIGN_POSITION:"currencysignposition",SELECTION_DISCOUNT:"discount",METRIC_FEATURE_EXPANDED:"FeatureExpanded",METRIC_FEATURE_COLLAPSED:"FeatureCollapsed",METRIC_MINI_DP_OPENED:"MiniDpOpened",METRIC_SIDE_SHEET_OPENED:"SideSheetOpened",METRIC_SELECT_UPSELL_ASIN_MINI_DP:"SelectUpsellAsinMiniDp",METRIC_SELECT_UPSELL_ASIN_SIDE_SHEET:"SelectUpsellAsinSideSheet",METRIC_SELECT_UPSELL_ASIN_LISTING:"SelectUpsellAsinListing",
METRIC_REMOVE_UPSELL_ASIN_MINI_DP:"RemoveUpsellAsinMiniDp",METRIC_REMOVE_UPSELL_ASIN_SIDE_SHEET:"RemoveUpsellAsinSideSheet",METRIC_REMOVE_UPSELL_ASIN_LISTING:"RemoveUpsellAsinListing",METRIC_NO_THANKS_MINI_DP:"NoThanksMiniDp",METRIC_FIRST_SELECTION_MINI_DP:"MiniDpFirstSelection",METRIC_FIRST_SELECTION_LISTING:"ListingFirstSelection",METRIC_FIRST_MINI_DP_OPENED:"MiniDpFirstOpenedIndex",METRIC_QTY_UPDATED:"QuantityUpdated",METRIC_FIRST_SIDE_SHEET_OPENED:"SideSheetFirstOpenedIndex",METRIC_SIDE_SHEET_QTY_UPDATED:"SideSheetQuantityUpdated",
METRIC_NO_THANKS_SIDE_SHEET:"NoThanksSideSheet",METRIC_FIRST_SELECTION_SIDE_SHEET:"SideSheetFirstSelection",ASIN_ADD_FAILURE:"UpsellAsinAddFailed",ASIN_REMOVE_FAILURE:"UpsellAsinRemoveFailed",INVALID_FEATUREOBJ:"InvalidFeatureObjectForTwisterPlusReg",REMOVE_CC_CARD_NOTIFICATION_EVENT:"twisterPlus-removeCCCardNotification",IA_RENDER_TYPE:"RenderAll",ASIN:"asin",ADD_SELECTION_TYPE:"add",DELETE_SELECTION_TYPE:"delete",ERROR_MSG:"Unexpected event.data passed",INVALID_SELECTIONOBJ_ERROR:"Invalid selectionObj passed by feature",
ERROR:"ERROR",BRACKET_OPEN:"(",BRACKET_CLOSED:")",SQUARE_BRACKET_OPEN:"[",SQUARE_BRACKET_CLOSED:"]",COLON:":",SPACE:" ",DOT:".",HASH:"#",HYPHEN:"-",PLUS:"+",EQUALS:"\x3d"}});n.when("A","cc-common-constants","cc-common-utils").register("cc-common-validator",function(l,b,g){return{validateEventData:function(a){return a.hasOwnProperty("featureName")&&a.hasOwnProperty("featureClass")&&a.hasOwnProperty("tabSetScrollerClass")&&a.hasOwnProperty("scrollerClass")&&a.hasOwnProperty("categoryCount")&&a.hasOwnProperty("startAsinCoordinates")&&
a.hasOwnProperty("startTabCoordinates")&&a.hasOwnProperty("startAsins")?!0:!1},validateRegistrationInput:function(a){return a.hasOwnProperty("featureName")&&a.hasOwnProperty("featureAttribution")&&a.hasOwnProperty("callbacks")&&typeof a.featureName===b.STRING&&typeof a.featureAttribution===b.STRING&&a.callbacks.hasOwnProperty("init")&&a.callbacks.hasOwnProperty("cardCollapse")&&typeof a.callbacks.init===b.FUNCTION&&typeof a.callbacks.cardCollapse===b.FUNCTION?!0:!1},validateSelectionObj:function(a){return a.hasOwnProperty("featureName")&&
a.hasOwnProperty("asinsQuantityPerCategory")&&a.hasOwnProperty("quantity")&&a.hasOwnProperty("totalPrice")&&a.hasOwnProperty("iconId")&&a.hasOwnProperty("iconCss")&&a.hasOwnProperty("parentHeader")&&a.hasOwnProperty("parentSubheaderId")&&a.hasOwnProperty("pageStateId")&&a.hasOwnProperty("tabSetScrollerClass")&&a.hasOwnProperty("hasMultipleQuantityRequirement")&&a.hasOwnProperty("requiresTabCountUpdate")&&a.hasOwnProperty("requiresAttachIntegration")?!0:!1}}});n.when("A","a-dropdown","a-truncate",
"cc-common-constants","postMetric","atf").register("cc-common-utils",function(l,b,g,a,m){function h(c){var d=c.selectorSideSheet.attr(a.DATA_ACCESSOR+c.action);d=JSON.parse(d);d.hasOwnProperty("quantity")&&(d.quantity=c.value);c.selectorSideSheet.attr(a.DATA_ACCESSOR+c.action,JSON.stringify(d))}function k(c,d,b){var e=f(a.ADD_BUTTON_SIDE_SHEET+c);c=f(a.ADDED_BUTTON_SIDE_SHEET+c);e.length&&c.length&&(e={selectorSideSheet:e,action:a.ADD_BUTTON_SIDE_SHEET_ACTION+b.toLowerCase(),value:d},d={selectorSideSheet:c,
action:a.ADDED_BUTTON_SIDE_SHEET_ACTION+b.toLowerCase(),value:d},h(e),h(d))}var f=l.$;return{registerTabCoordinates:function(c){for(var d=f(a.CC_COMMON_CLASS+a.SPACE+c.featureClass).children(),b=0,k=a.CARD_OFFSET,h=a.SEPARATOR_OFFSET,g=0;g<d.length;g++){var m=a.COMMON_CATEGORY_TAB+a.HYPHEN+b;d[g].classList.contains(m)&&(c.startAsinCoordinates[b]=f(a.HASH+d[g].id).offset().left-h,c.startAsins[b]=a.HASH+m,typeof f(a.HASH+m).offset()!==a.UNDEFINED&&null!==f(a.HASH+m).offset()&&(c.startTabCoordinates[b]=
f(a.HASH+m).offset().left),b++)}c.startTabCoordinates[0]-=k;c.startAsinCoordinates[0]-=k+h;return b-1},activateTab:function(c,d){f(c+a.SPACE+a.DOT+a.COMMON_CATEGORY_TAB).removeClass(a.AUI_BUTTON_SELECTED);f(c+a.SPACE+a.DOT+a.COMMON_CATEGORY_TAB).removeClass(a.AUI_BUTTON_FOCUS);f(c+a.SPACE+d).addClass(a.AUI_BUTTON_SELECTED)},manualLoadImages:function(c){c=f(c+a.SPACE+a.UPSELL_ASIN_ITEM);l.loadImageManually(c.find(a.UPSELL_ASIN_IMAGE))},updateSubheaderTruncate:function(a){g.get(f(a)).update()},logCountMetric:function(a,
d){m.postCountMetric(a,d);"undefined"!==typeof p.csa&&"undefined"!==typeof p.ue&&"undefined"!==typeof p.ue.count&&(d=p.ue.count(a),p.csa("Events",{producerId:"dp-rpcx"})("log",{schemaId:"dpRpcx.CSALoggingSchema.5",eventName:a,valueToLog:d},{ent:"all"}))},updateQuantity:k,updateQuantityDropdownOnSideSheet:function(a,d,e){var c=b.getSelect(a);c&&c.setValue(String(d));k(a,d,e)},updateQuantityBadge:function(c,d){var b=c.attr(a.DATA_ACCESSOR+a.SELECTION_QUANTITY);c=c.find(a.DOT+a.QTY_BADGE);Number(b)<
a.QUANTITY_BADGE_THRESHOLD?(c.removeClass(a.QTY_BADGE_CSS),c.html("")):(c.addClass(a.QTY_BADGE_CSS),c.css(a.CSS_LEFT,d.badgeOffsetValues.qtyBadgeLeftOffset),c.css(a.CSS_TOP,d.badgeOffsetValues.qtybadgeTopOffset),c.html(b))},hideUpdateButton:function(c){f(a.UPDATE_BUTTON_SIDE_SHEET+c+a.A_DECLARATIVE).hide();f(a.ADDED_BUTTON_SIDE_SHEET+c+a.A_DECLARATIVE).show();f(a.UPDATE_BUTTON_SIDE_SHEET+c).css(a.DISPLAY,a.NONE)},showUpdateButton:function(c){f(a.ADDED_BUTTON_SIDE_SHEET+c+a.A_DECLARATIVE).hide();f(a.UPDATE_BUTTON_SIDE_SHEET+
c+a.A_DECLARATIVE).show();f(a.UPDATE_BUTTON_SIDE_SHEET+c).css(a.DISPLAY,a.INLINE)},hideAddButton:function(c){f(a.ADD_BUTTON_SIDE_SHEET+c+a.A_DECLARATIVE).hide();f(a.ADDED_BUTTON_SIDE_SHEET+c+a.A_DECLARATIVE).show();f(a.ADD_BUTTON_LISTING+c).hide();f(a.ADDED_BUTTON_LISTING+c).css(a.DISPLAY,a.INLINE_BLOCK)},hideAddedButton:function(c){f(a.ADDED_BUTTON_SIDE_SHEET+c+a.A_DECLARATIVE).hide();f(a.ADD_BUTTON_SIDE_SHEET+c+a.A_DECLARATIVE).show();f(a.ADDED_BUTTON_LISTING+c).hide();f(a.ADD_BUTTON_LISTING+c).css(a.DISPLAY,
a.INLINE_BLOCK)},resetButtonsState:function(c,d,b){var e=c.attr(a.DATA_ACCESSOR+a.CC_COMMON_SIDE_SHEET_CANCEL);e=JSON.parse(e);e.oldQuantity&&typeof e.oldQuantity===a.STRING&&delete e.oldQuantity;c.attr(a.DATA_ACCESSOR+a.CC_COMMON_SIDE_SHEET_CANCEL,JSON.stringify(e));c={asinIndex:e.asinIndex,popoverName:e.popoverName,oldQuantity:"",newQuantity:""};d.attr(a.DATA_ACCESSOR+a.UPDATE_BUTTON_SIDE_SHEET_ACTION+b.toLowerCase(),JSON.stringify(c))},onClickStopped:function(c,d,b){typeof c!==a.UNDEFINED&&c.addEventListener(a.CLICK,
l.debounce(d,b))},getAsinData:function(c){return{asin:c.attr(a.DATA_ACCESSOR+a.SELECTION_UPSELL_ASIN),offerListingId:c.attr(a.DATA_ACCESSOR+a.SELECTION_OFFER_LISTING_ID),offerPrice:c.attr(a.DATA_ACCESSOR+a.SELECTION_OFFER_PRICE),quantity:c.attr(a.DATA_ACCESSOR+a.SELECTION_QUANTITY),minOrderQuantity:c.attr(a.DATA_ACCESSOR+a.SELECTION_MIN_ORDER_QUANTITY),subType:c.attr(a.DATA_ACCESSOR+a.SELECTION_SUBTYPE),type:c.attr(a.DATA_ACCESSOR+a.SELECTION_TYPE),featureName:c.attr(a.DATA_ACCESSOR+a.SELECTION_FEATURE),
asinIndex:c.attr(a.DATA_ACCESSOR+a.SELECTION_ASIN_INDEX),catIndex:c.attr(a.DATA_ACCESSOR+a.SELECTION_CATEGORY_INDEX),categoryDisplayName:c.attr(a.DATA_ACCESSOR+a.SELECTION_CATEGORY_DISPLAY_NAME),priceSymbol:c.attr(a.DATA_ACCESSOR+a.SELECTION_PRICE_SYMBOL),currencySignPosition:c.attr(a.DATA_ACCESSOR+a.SELECTION_PRICE_SIGN_POSITION),discount:c.attr(a.DATA_ACCESSOR+a.SELECTION_DISCOUNT)}},getParamData:function(a,b){return{itemAsin:a.asin,itemOfferingId:a.offerListingId,itemQuantity:Number(a.quantity),
itemPrice:Number(a.offerPrice),itemPriceSymbol:a.priceSymbol,itemDiscount:Number(a.discount),itemPriceSignPosition:a.currencySignPosition,categoryDisplayName:a.categoryDisplayName,categoryIndex:a.catIndex,baseAsin:b.baseAsin,enableIA:b.enableIA,subType:a.subType,type:a.type}},isAsinSelected:function(c){return!f(a.ADD_BUTTON_LISTING+c).is(a.VISIBLE)}}});n.when("A","cc-common-constants","cc-common-validator","cc-common-utils","cc-manager").register("cc-common-twister-registration",function(l,b,g,a,
m){var h=function(a){var f;!(f=typeof a===b.UNDEFINED||a.itemType!==b.ASIN||typeof a.asin!==b.STRING||typeof a.offerListingId!==b.STRING||typeof a.quantity!==b.NUMBER||typeof a.price!==b.NUMBER||typeof a.savings!==b.NUMBER||a.selectionType!==b.ADD_SELECTION_TYPE&&a.selectionType!==b.DELETE_SELECTION_TYPE)&&(f=a.selectionType===b.ADD_SELECTION_TYPE)&&!(f=typeof a.enableIA!==b.BOOLEAN)&&(f=!0===a.enableIA)&&(a=a.IAData,f=!(typeof a!==b.UNDEFINED&&typeof a.parentAsin===b.STRING&&typeof a.type===b.STRING&&
typeof a.renderType===b.STRING&&a.renderType===b.IA_RENDER_TYPE&&typeof a.constraintList===b.OBJECT&&1===a.constraintList.length&&typeof a.constraintList[0].type===b.STRING&&a.constraintList[0].type===b.DELETE&&typeof a.constraintList[0].mutuallyInclusive===b.BOOLEAN));return f?!1:!0};return{validateInput:h,registerTwisterPlusFeature:function(k){g.validateRegistrationInput(k)?m.registerFeature({featureName:k.featureName,featureAttribution:k.featureAttribution,isMultiSelection:k.isMultiSelection,updateQtyAsBaseItem:k.updateQtyAsBaseItem},
{init:k.callbacks.init,validateInputParams:typeof k.callbacks.validateInputParams===b.UNDEFINED?h:k.callbacks.validateInputParams,cardCollapse:k.callbacks.cardCollapse}):a.logCountMetric(k.featureName+b.INVALID_FEATUREOBJ)},selectionUpdate:function(a,b){return m.ccSelectionUpdate(a,b)},cardExpanderListener:function(a){m.cardExpanded(a)}}});n.when("A","cc-common-constants","cc-common-utils").register("cc-common-tab-handlers",function(l,b,g){var a=l.$,m={tabSetScroller:function(h,k,f){var c=a(b.CC_COMMON_CLASS+
b.SPACE+f.tabSetScrollerClass).scrollLeft(),d=c+a(b.CC_COMMON_CLASS+b.SPACE+f.tabSetScrollerClass).width(),e=f.startTabCoordinates[h]+a(f.startAsins[h]).width();f.startTabCoordinates[h]>c&&e<d||a(b.CC_COMMON_CLASS+b.SPACE+f.tabSetScrollerClass).animate({scrollLeft:f.startTabCoordinates[h]},k)},tabScrollHandler:function(h){if(h.data){0===h.data.categoryCount&&(h.data.categoryCount=g.registerTabCoordinates(h.data));for(var k=a(b.CC_COMMON_CLASS+b.SPACE+h.data.scrollerClass).scrollLeft(),f=0;f<h.data.categoryCount;f++)if(h.data.startAsinCoordinates[f+
1]>k+screen.width/2){m.tabSetScroller(f,b.ANIMATION_DURATION_FEATURE_SCROLL,h.data);g.activateTab(h.data.tabSetScrollerClass,h.data.startAsins[f]);break}k+screen.width/2>h.data.startAsinCoordinates[h.data.categoryCount]&&(m.tabSetScroller(h.data.categoryCount,b.ANIMATION_DURATION_FEATURE_SCROLL,h.data),g.activateTab(h.data.tabSetScrollerClass,h.data.startAsins[h.data.categoryCount]))}},tabClickHandler:function(h){if(h.data){0===h.data.categoryCount&&(h.data.categoryCount=g.registerTabCoordinates(h.data));
var k=h.target.id,f=h.data.startAsins.indexOf(b.HASH+k);m.tabSetScroller(f,b.ANIMATION_DURATION_TAB_CLICK,h.data);a(b.CC_COMMON_CLASS+b.SPACE+h.data.scrollerClass).unbind(b.SCROLL);a(b.CC_COMMON_CLASS+b.SPACE+h.data.scrollerClass).animate({scrollLeft:h.data.startAsinCoordinates[f]},b.ANIMATION_DURATION_SCROLL_LEFT);g.activateTab(h.data.tabSetScrollerClass,b.HASH+k);l.delay(function(){a(b.CC_COMMON_CLASS+b.SPACE+h.data.scrollerClass).scroll(m.tabScrollHandler(h))},b.ANIMATION_DURATION_SCROLL);g.logCountMetric(h.data.refTagCategoryTabClicked+
(f+1),1)}}};return m});n.when("A","side-sheet","a-dropdown","cc-common-constants","cc-common-utils").execute(function(l,b,g,a,m){var h=l.$,k=null,f=null;l.declarative(a.SIDE_SHEET_IMAGE_FOCUS_ACTION,a.MOUSE_ENTER,function(c){var d=c.$target,f=b.getContentContainer();c=c.data;f.find(a.SIDE_SHEET_MAIN_IMAGE_SELECTOR_PREFIX+c.featureName+a.HYPHEN+c.asinIndex).attr(a.SRC,c.imageUrl);f.find(a.SIDE_SHEET_IMAGE_BLOCK_SELECTOR).removeClass(a.AUI_BUTTON_SELECTED).removeClass(a.AUI_BUTTON_FOCUS);(d=d.prop(a.ID))&&
f.find(a.HASH+d).addClass(a.AUI_BUTTON_FOCUS)});var c=function(c){if(c.data&&c.data.ccCommonSideSheet){k=c.data.featureName;f=a.OLD_QTY_DEFAULT_VAL;m.logCountMetric(k+a.METRIC_SIDE_SHEET_OPENED);var d=l.$(a.HASH+k+a.CONFIGS_STATE_SELECTOR_SUFFIX),r=d.data().stateData;r&&typeof d!==a.UNDEFINED&&r.firstTimeOpeningMiniDp===a.TRUE&&(r.firstTimeOpeningMiniDp=a.FALSE,l.$(a.HASH+k+a.CONFIGS_STATE_SELECTOR_SUFFIX).attr(a.DATA_ACCESSOR+a.STATE_DATA,JSON.stringify(r)),m.logCountMetric(k+a.METRIC_FIRST_SIDE_SHEET_OPENED,
c.data.asinIndexVal));d=c.data.asinIndex;c=h(a.TWISTER_PLUS_SIDE_SHEET_CONTENT+a.SPACE+a.SQUARE_BRACKET_OPEN+a.NAME+a.EQUALS+'"'+a.CC_COMMON_MINI_DP_QTY_DROPDOWN+'"'+a.SQUARE_BRACKET_CLOSED);if(c=g.getSelect(c))d=h(a.ADDED_BUTTON_SIDE_SHEET+d),d.length&&(d=d.attr(a.DATA_ACCESSOR+a.ADDED_BUTTON_SIDE_SHEET_ACTION+k.toLowerCase()),d=JSON.parse(d),c.setValue(d.quantity)),b.getContentContainer().closest(a.HASH+a.TWISTER_PLUS_SIDE_SHEET_MAIN_SECTION).scrollTop(0).css(a.VISIBILITY,a.VISIBLE)}};l.declarative(a.CC_COMMON_SIDE_SHEET_CANCEL,
a.CLICK,function(c){l.trigger("a:declarative:close-side-sheet:click");m.logCountMetric(k+a.METRIC_NO_THANKS_SIDE_SHEET);var b=h(a.CANCEL_BUTTON_SIDE_SHEET+c.data.asinIndex),d=b.attr(a.DATA_ACCESSOR+a.CC_COMMON_SIDE_SHEET_CANCEL);d=JSON.parse(d);d.hasOwnProperty(a.OLD_QUANTITY_KEY)&&(g.getSelect(d.asinIndex).setValue(String(d.oldQuantity)),m.updateQuantity(d.asinIndex,d.oldQuantity,k),m.hideUpdateButton(d.asinIndex),c=h(a.UPDATE_BUTTON_SIDE_SHEET+c.data.asinIndex),m.resetButtonsState(b,c,k))});l.on(a.AUI_DROPDOWN_SELECTED+
a.CC_COMMON_MINI_DP_QTY_DROPDOWN,function(c){var b=h(a.CANCEL_BUTTON_SIDE_SHEET+c.id),d=h(a.UPDATE_BUTTON_SIDE_SHEET+c.id);if(Number(c.value)===Number(f))m.hideUpdateButton(c.id),m.resetButtonsState(b,d,k);else if(h(a.ADDED_BUTTON_SIDE_SHEET+c.id+a.A_DECLARATIVE).css(a.DISPLAY)===a.INLINE||h(a.UPDATE_BUTTON_SIDE_SHEET+c.id+a.A_DECLARATIVE).css(a.DISPLAY)===a.INLINE){var g=h(a.ADDED_BUTTON_SIDE_SHEET+c.id).attr(a.DATA_ACCESSOR+a.ADDED_BUTTON_SIDE_SHEET_ACTION+k.toLowerCase());g=JSON.parse(g);f===a.OLD_QTY_DEFAULT_VAL&&
(f=g.quantity);g=b.attr(a.DATA_ACCESSOR+a.CC_COMMON_SIDE_SHEET_CANCEL);g=JSON.parse(g);g.oldQuantity=String(f);b.attr(a.DATA_ACCESSOR+a.CC_COMMON_SIDE_SHEET_CANCEL,JSON.stringify(g));b={asinIndex:c.id,popoverName:g.popoverName,oldQuantity:String(f),newQuantity:c.value};d.attr(a.DATA_ACCESSOR+a.UPDATE_BUTTON_SIDE_SHEET_ACTION+k.toLowerCase(),JSON.stringify(b));m.showUpdateButton(c.id);m.logCountMetric(k+a.METRIC_SIDE_SHEET_QTY_UPDATED)}m.updateQuantity(c.id,c.value,k)});l.on("a:declarative:close-side-sheet:click",
function(c){var d=b.getContentContainer().find(a.SIDE_SHEET_SELECTOR);d.length&&c&&(c=d.find(a.SQUARE_BRACKET_OPEN+a.DATA_ACTION+'"'+a.CC_COMMON_SIDE_SHEET_CANCEL+'"'+a.SQUARE_BRACKET_CLOSED),c.length&&c.click())});l.on("a:declarative:side-sheet:click",c);l.on("twister-plus:side-sheet:ajax:success",c)});n.when("A","cc-common-utils","cc-common-constants","a-truncate").register("cc-common-image-loader",function(l,b,g,a){function m(b){l.$(b+g.SPACE+g.UPSELL_ASIN_TITLE).each(function(b,f){b=a.get(l.$(f));
b.getIsUpdated()&&b.update()})}return{loadImagesAndTruncateTitle:function(a,k,f){b.manualLoadImages(k);l.on(g.AUI_EXPANDER+a+g.AUI_EXPANDER_EXPAND,function(){b.logCountMetric(f+g.METRIC_FEATURE_EXPANDED);m(k)})}}});n.when("A").register("cc-common-category-page-state",function(l){var b=l.$;return{updateCategory:function(g,a,m){var h=b(g),k={};h&&(k=(k=h.val())?JSON.parse(k):{});h=0;k.hasOwnProperty(a)&&(h=k[a]);k[a]=h+m;a=JSON.stringify(k);b(g)&&b(g).val(a)},updateCategoriesCountToPageState:function(g,
a){null!==g&&g.hasOwnProperty("categoryCount")&&(g=JSON.stringify({totalCategories:g.categoryCount}),b(a)&&b(a).val(g))}}});n.when("A","a-carousel-framework","a-carousel-transition-slide","a-carousel-constants","cc-common-constants").register("cc-common-upsell-asins-carousel-handler",function(l,b,g,a,m){var h=l.copy(g);h.gotoPage=function(b,f,c){c=c||{};(c.animationDuration===q||0<c.animationDuration)&&!c.silent&&b.setAttr(a.ANIMATING,!0);var d=b.getAttr(a.TOTAL_PAGES);0<f&&f<=d&&b.setAttr(a.PAGE_NUMBER,
f);f=Math.min(Math.max(1,f),d);if(f===d){var e=b.getDimensions().items.length,g=b.getAttr(a.PAGE_SIZE);this.gotoIndex(b,e-g+1,c)}else this.gotoIndex(b,b.getAttr(a.PAGE_SIZE)*(f-1)+1,c);this.setButtonVisibility(b,f,d)};h.setButtonVisibility=function(b,f,c){var d=b.dom.$container.find(m.AUI_CAROUSEL_PREV_BUTTON_CLASS),e=b.dom.$container.find(m.AUI_CAROUSEL_NEXT_BUTTON_CLASS);f===q&&c===q&&(f=b.getAttr(a.PAGE_NUMBER),c=b.getAttr(a.TOTAL_PAGES));d.toggleClass(m.HIDDEN_CLASS,1===f);e.toggleClass(m.HIDDEN_CLASS,
f===c)};b.registerStrategy(m.CAROUSEL_TRANSITION,m.CAROUSEL_TRANSITION_STRATEGY,h);return{initializeCarousel:function(a){b.onInit(a,function(b){var c=b.dom.$container;c.length&&l.loadImageManually(c.find(a));h.setButtonVisibility(b,q,q);c.find(m.AUI_CAROUSEL_LEFT_CLASS).addClass(m.CAROUSEL_HEIGHT_CSS_CLASS);c.find(m.AUI_CAROUSEL_RIGHT_CLASS).addClass(m.CAROUSEL_HEIGHT_CSS_CLASS)})}}});n.when("A","cc-common-constants","cc-common-category-page-state","cc-common-utils","cc-common-twister-registration").register("cc-common-selection-utils",
function(l,b,g,a,m){function h(a,e){c(a+b.AUI_TRUNCATE_CUT_CLASS).html(e).css(b.DISPLAY,b.INLINE);c(a+b.AUI_TRUNCATE_FULL_CLASS).html(e).css(b.DISPLAY,b.INLINE)}function k(d,e,f){e.totalPrice+=d.price;e.quantity+=d.quantity;var r=c(e.iconId),k=d.priceSymbol,m=e.parentHeader,l=e.parentSubheaderId,n=e.quantity,p=e.totalPrice,q=e.iconCss,t=f.subHeaderString,u=f.cardSubtotalString,w=f.locale,v=d.currencySignPosition;typeof f.cardSubtotalStringPlural!==b.UNDEFINED&&1<n&&(u=f.cardSubtotalStringPlural);
0<n?(f=b.PLUS,t="",v===b.CURRENCY_SIGN_POSITION_LEFT&&(t+=k),t+=Number(p).toLocaleString(w,{minimumFractionDigits:2}),v===b.CURRENCY_SIGN_POSITION_RIGHT&&(t+=k),h(l,f+t+b.SPACE+b.BRACKET_OPEN+n+b.SPACE+u+b.BRACKET_CLOSED),k=c(l),n=b.AUI_SECONDARY_COLOR,k.addClass(b.AUI_SUCCESS_COLOR).removeClass(n),r.addClass(b.SELECTED_ICON_CSS).removeClass(q),c(m+b.SPACE+b.ITEM_ADDED_ICON).show()):(h(l,t),k=c(l),n=b.AUI_SUCCESS_COLOR,k.addClass(b.AUI_SECONDARY_COLOR).removeClass(n),k=b.SELECTED_ICON_CSS,r.addClass(q).removeClass(k),
c(m+b.SPACE+b.ITEM_ADDED_ICON).hide());a.updateSubheaderTruncate(l);e.requiresAttachIntegration&&g.updateCategory(e.pageStateId,d.subType,d.quantity)}function f(a,e){var d=b.HASH+b.COMMON_CATEGORY_TAB+b.HYPHEN+a.categoryIndex+b.ANNOUNCE;typeof e.asinsQuantityPerCategory[a.subType]===b.UNDEFINED&&(e.asinsQuantityPerCategory[a.subType]=0);e.asinsQuantityPerCategory[a.subType]+=a.quantity;0<e.asinsQuantityPerCategory[a.subType]?c(e.tabSetScrollerClass+b.SPACE+d).html(a.categoryDisplayName+b.SPACE+b.BRACKET_OPEN+
e.asinsQuantityPerCategory[a.subType]+b.BRACKET_CLOSED):c(e.tabSetScrollerClass+b.SPACE+d).html(a.categoryDisplayName)}var c=l.$;return{addAsin:function(d,e,g){var h={itemType:b.ASIN,asin:d.itemAsin,offerListingId:d.itemOfferingId,quantity:d.itemQuantity,price:d.itemPrice,priceUnit:d.itemPriceSymbol,savings:d.itemDiscount,selectionType:b.ADD_SELECTION_TYPE,orderSummaryDisplayString:g.subHeaderString,enableIA:d.enableIA};d.enableIA&&(h=c.extend({},h,{IAData:{parentAsin:d.baseAsin,businessType:e.iaBusinessType,
renderType:b.IA_RENDER_TYPE,constraintList:[{type:b.DELETE,mutuallyInclusive:e.mutuallyInclusive}]}}));h=m.selectionUpdate(e.featureName,h);if(!h)return a.logCountMetric(e.featureName+b.ASIN_ADD_FAILURE),!1;k({price:d.itemPrice*d.itemQuantity,quantity:d.itemQuantity,priceSymbol:d.itemPriceSymbol,subType:d.subType,currencySignPosition:d.itemPriceSignPosition},e,g);e.requiresTabCountUpdate&&f({categoryIndex:d.categoryIndex,subType:d.subType,quantity:d.itemQuantity,categoryDisplayName:d.categoryDisplayName},
e);return h},removeAsin:function(c,e,g){var d=m.selectionUpdate(e.featureName,{itemType:b.ASIN,asin:c.itemAsin,offerListingId:c.itemOfferingId,quantity:c.itemQuantity,price:c.itemPrice,priceUnit:c.itemPriceSymbol,savings:c.itemDiscount,selectionType:b.DELETE_SELECTION_TYPE,orderSummaryDisplayString:g.subHeaderString});if(!d)return a.logCountMetric(e.featureName+b.ASIN_REMOVE_FAILURE),!1;k({price:c.itemPrice*c.itemQuantity*-1,quantity:-1*c.itemQuantity,priceSymbol:c.itemPriceSymbol,subType:c.subType,
currencySignPosition:c.itemPriceSignPosition},e,g);e.requiresTabCountUpdate&&f({categoryIndex:c.categoryIndex,subType:c.subType,quantity:-1*c.itemQuantity,categoryDisplayName:c.categoryDisplayName},e);return d}}});n.when("A","side-sheet","cc-common-constants","cc-common-utils","cc-common-selection-utils").register("cc-common-selection-update",function(l,b,g,a,m){function h(){l.trigger("a:declarative:close-side-sheet:click")}function k(a,b){a=f(g.ADD_BUTTON_LISTING+a).closest(g.DIV+g.UPSELL_ASIN_ITEM);
a.attr(g.DATA_ACCESSOR+g.SELECTION_QUANTITY,b);return a}var f=l.$;return{addUpsellAsinHandler:function(c){if(c.data&&c.data.configsObj&&c.data.selectionObj){var b=f(this).closest(g.DIV+g.UPSELL_ASIN_ITEM),e=a.getAsinData(f(b)),h=a.getParamData(e,c.data.configsObj);m.addAsin(h,c.data.selectionObj,c.data.configsObj)&&(a.hideAddButton(e.asinIndex),c.data.selectionObj.hasMultipleQuantityRequirement&&a.updateQuantityDropdownOnSideSheet(e.asinIndex,h.itemQuantity,c.data.selectionObj.featureName),c.data.selectionObj.badgeOffsetValues&&
a.updateQuantityBadge(b,c.data.selectionObj),a.logCountMetric(c.data.selectionObj.featureName+g.METRIC_SELECT_UPSELL_ASIN_LISTING),c.data.selectionObj.isFirstSelectionListing&&(a.logCountMetric(c.data.selectionObj.featureName+g.METRIC_FIRST_SELECTION_LISTING,Number(b.attr(g.DATA_ACCESSOR+g.SELECTION_ASIN_INDEX_VAL))),c.data.selectionObj.isFirstSelectionListing=!1))}else if(c.data&&c.data.selectionObj)n.log(g.ERROR_MSG,c.data.selectionObj.featureName);else throw new TypeError(g.ERROR_MSG,g.ERROR);
},removeUpsellAsinHandler:function(c){if(c.data&&c.data.configsObj&&c.data.selectionObj){var b=f(this).closest(g.DIV+g.UPSELL_ASIN_ITEM),e=a.getAsinData(f(b)),h=a.getParamData(e,c.data.configsObj);m.removeAsin(h,c.data.selectionObj,c.data.configsObj)&&(b.attr(g.DATA_ACCESSOR+g.SELECTION_QUANTITY,e.minOrderQuantity),a.hideAddedButton(e.asinIndex),c.data.selectionObj.hasMultipleQuantityRequirement&&a.updateQuantityDropdownOnSideSheet(e.asinIndex,e.minOrderQuantity,c.data.selectionObj.featureName),c.data.selectionObj.badgeOffsetValues&&
a.updateQuantityBadge(b,c.data.selectionObj),a.logCountMetric(c.data.selectionObj.featureName+g.METRIC_REMOVE_UPSELL_ASIN_LISTING))}else if(c.data&&c.data.selectionObj)n.log(g.ERROR_MSG,c.data.selectionObj.featureName);else throw new TypeError(g.ERROR_MSG,g.ERROR);},sideSheetAddHandler:function(c,b,e){h();var d=a.getParamData(c,b);m.addAsin(d,e,b)&&(b=k(c.asinIndex,c.quantity),a.hideAddButton(c.asinIndex),e.hasMultipleQuantityRequirement&&a.updateQuantityDropdownOnSideSheet(c.asinIndex,d.itemQuantity,
e.featureName),e.badgeOffsetValues&&a.updateQuantityBadge(b,e),a.logCountMetric(e.featureName+g.METRIC_SELECT_UPSELL_ASIN_SIDE_SHEET),e.isFirstSelectionSideSheet&&(a.logCountMetric(e.featureName+g.METRIC_FIRST_SELECTION_SIDE_SHEET,Number(c.asinIndexVal)),e.isFirstSelectionSideSheet=!1))},sideSheetRemoveHandler:function(c,b,e){h();var d=a.getParamData(c,b);m.removeAsin(d,e,b)&&(b=f(g.ADDED_BUTTON_LISTING+c.asinIndex).closest(g.DIV+g.UPSELL_ASIN_ITEM).attr(g.DATA_ACCESSOR+g.SELECTION_MIN_ORDER_QUANTITY),
d=k(c.asinIndex,b),a.hideAddedButton(c.asinIndex),e.hasMultipleQuantityRequirement&&a.updateQuantityDropdownOnSideSheet(c.asinIndex,b,e.featureName),e.badgeOffsetValues&&a.updateQuantityBadge(d,e),a.logCountMetric(e.featureName+g.METRIC_REMOVE_UPSELL_ASIN_SIDE_SHEET))},sideSheetUpdateHandler:function(b,d,e){h();var c=f(g.ADD_BUTTON_SIDE_SHEET+b.asinIndex).attr(g.DATA_ACCESSOR+g.ADD_BUTTON_SIDE_SHEET_ACTION+e.featureName.toLowerCase());c=JSON.parse(c);var l=a.getParamData(c,d);l.itemQuantity=Number(b.oldQuantity);
m.removeAsin(l,e,d)&&(l.itemQuantity=Number(b.newQuantity),m.addAsin(l,e,d)&&(d=k(c.asinIndex,b.newQuantity),a.hideUpdateButton(b.asinIndex),e.hasMultipleQuantityRequirement&&a.updateQuantityDropdownOnSideSheet(c.asinIndex,l.itemQuantity,e.featureName),e.badgeOffsetValues&&a.updateQuantityBadge(d,e),d=f(g.CANCEL_BUTTON_SIDE_SHEET+b.asinIndex),b=f(g.UPDATE_BUTTON_SIDE_SHEET+b.asinIndex),a.resetButtonsState(d,b,e.featureName)))}}});n.when("A","cc-common-constants","cc-common-utils","cc-common-validator",
"cc-common-twister-registration","cc-common-selection-update","side-sheet","a-popover-base-factory").register("cc-common-setup-handlers",function(l,b,g,a,m,h,k,f){var c=l.$;return{setupSideSheetHandlers:function(d,e){if(a.validateSelectionObj(e))l.declarative(b.ADD_BUTTON_SIDE_SHEET_ACTION+e.featureName,b.CLICK,function(a){a=c(b.HASH+a.$currentTarget.get(0).id).attr(b.DATA_ACCESSOR+b.ADD_BUTTON_SIDE_SHEET_ACTION+e.featureName.toLowerCase());a=JSON.parse(a);h.sideSheetAddHandler(a,d(),e)}),l.declarative(b.ADDED_BUTTON_SIDE_SHEET_ACTION+
e.featureName,b.CLICK,function(a){a=c(b.HASH+a.$currentTarget.get(0).id).attr(b.DATA_ACCESSOR+b.ADDED_BUTTON_SIDE_SHEET_ACTION+e.featureName.toLowerCase());a=JSON.parse(a);h.sideSheetRemoveHandler(a,d(),e)}),e.hasMultipleQuantityRequirement&&l.declarative(b.UPDATE_BUTTON_SIDE_SHEET_ACTION+e.featureName,b.CLICK,function(a){a=c(b.HASH+a.$currentTarget.get(0).id).attr(b.DATA_ACCESSOR+b.UPDATE_BUTTON_SIDE_SHEET_ACTION+e.featureName.toLowerCase());a=JSON.parse(a);h.sideSheetUpdateHandler(a,d(),e)}),c(b.HASH+
e.featureName+b.QUANTITY_DROPDOWN+b.SPACE+b.SELECT+b.SQUARE_BRACKET_OPEN+b.NAME+b.EQUALS+'"'+b.CC_COMMON_MINI_DP_QTY_DROPDOWN+'"'+b.SQUARE_BRACKET_CLOSED).live(b.CLICK,function(a){a=c(this);if(!a.data(b.QUANTITY_SCROLLER_ATTACHED)){a.data(b.QUANTITY_SCROLLER_ATTACHED,!0);a=k.getContentContainer();var d=f.getRoot();a.closest(b.HASH+b.TWISTER_PLUS_SIDE_SHEET_MAIN_SECTION).bind(b.SCROLL,function(){d.updateChildrenPosition()})}});else if(e.featureName)n.log(b.INVALID_SELECTIONOBJ_ERROR,e.featureName,
b.ERROR);else throw new TypeError(b.INVALID_SELECTIONOBJ_ERROR,b.ERROR);},setupListingHandlers:function(d,e,f){if(!a.validateSelectionObj(f))if(f.featureName)n.log(b.INVALID_SELECTIONOBJ_ERROR,f.featureName,b.ERROR);else throw new TypeError(b.INVALID_SELECTIONOBJ_ERROR,b.ERROR);e={configsObj:e(),selectionObj:f};c(d+b.SPACE+b.ADD_BUTTON_LISTING_SELECTOR).unbind(b.CLICK,h.addUpsellAsinHandler).click(e,h.addUpsellAsinHandler);c(d+b.SPACE+b.ADDED_BUTTON_LISTING_SELECTOR).unbind(b.CLICK,h.removeUpsellAsinHandler).click(e,
h.removeUpsellAsinHandler)},setupCardExpandCollapse:function(a,c,f){l.on(b.AUI_EXPANDER+c+b.AUI_EXPANDER_EXPAND,function(){m.cardExpanderListener(a);g.logCountMetric(f.refTagOnOpen,1)});l.on(b.AUI_EXPANDER+c+b.AUI_EXPANDER_COLLAPSE,function(){g.logCountMetric(f.refTagOnClose,1)})},initialiseQuantityBadges:function(a,c){l.$(a+b.SPACE+b.UPSELL_ASIN_ITEM).each(function(a,b){a=l.$(b);c.badgeOffsetValues&&g.updateQuantityBadge(a,c)})}}})});
/* ******** */
(function(e){var h=window.AmazonUIPageJS||window.P,k=h._namespace||h.attributeErrors,b=k?k("DetailPageCollectionsCardAssets",""):h;b.guardFatal?b.guardFatal(e)(b,window):b.execute(function(){e(b,window)})})(function(e,h,k){e.when("A","atf").register("collections-constants",function(b){return{FEATURE_NAME:"collectionsCard",FEATURE_ATTRIBUTION:"A2I/Amazon.in/OHL",FALSE:"false",TRUE:"true",STYLE:"style",QTY_BADGE_LEFT_OFFSET:"100px",QTY_BADGE_TOP_OFFSET:"100px",DEVICE_TYPE_WEB:"web",COLLECTIONS_IS_MULTI_SELECTION:1,
COLLECTIONS_UPDATE_QTY_AS_BASE_ITEM:0,SCROLL_STOP_DELAY:250,CAROUSEL_STOP_DELAY:750,COLLECTIONS_EXPANDER:"collections-expander-header",COLLECTIONS_CONTENT_SELECTOR:".cc-common .a-expander-container .collections-expander-content",COLLECTIONS_EXPANDER_ICON_SELECTOR:".cc-common .a-expander-container .collections-header \x3e .a-icon",COLLECTIONS_PAGE_STATE_ID:"#collections-page-state",COLLECTIONS_PARENT_HEADER:".collections-header",COLLECTIONS_PARENT_SUBHEADER_ID:"#collections-subheader",COLLECTIONS_SCROLLER:".collections-scroller",
COLLECTIONS_CAROUSEL:".collections-carousel",COLLECTIONS_CARD_ASIN_BLOCK_CAROUSEL:"collections-card-asin-block-carousel",COLLECTIONS_REFRESH_NOTIFICATION_CONTAINER_SELECTOR:".cc-common .a-expander-container .collections-expander-content .collections-refresh-notification",ARIA_EXPANDED:"aria-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",
COLLECTIONS_OPENED:"tp_cc_common_coll_open",COLLECTIONS_CLOSED:"tp_cc_common_coll_close",COLLECTIONS_CARD_DESKTOP_OPENED:"tp_cc_common_desktop_coll_open",COLLECTIONS_CARD_DESKTTOP_CLOSED:"tp_cc_common_desktop_coll_close",COLLECTIONS_FEATURE_INITIALIZED:"twisterPlusInitializedCollectionsFeature",COLLECTIONS_CARD_COLLAPSED:"collectionsCardFeatureCollapsed",COLLECTIONS_INVALID_SELECTIONOBJ:"collectionsAssetsInvalidSelectionObject",COLLECTION_CARD_LAZY_LOAD_COMPLETE:"collectionsCardLazyLoadSuccessful",
METRIC_COLLECTIONS_EXPANDED_DURATION:"collectionsCardExpandedDuration",METRIC_COLLECTIONS_SCROLL_DEPTH:"collectionsCardScrollDepth",METRIC_COLLECTIONS_CAROUSEL_SCROLL:"collectionsCardCarouselScroll"}});e.when("A","cc-common-constants","collections-constants","atf").register("collections-configs",function(b,c,d){return{getCollectionsConfig:function(){var a=b.$(c.HASH+d.FEATURE_NAME+c.CONFIGS_STATE_SELECTOR_SUFFIX).data();return typeof a===c.UNDEFINED||null===a?null:{baseAsin:a.stateData.baseASIN,enableIA:a.stateData.enableIA===
d.TRUE,cardSubtotalString:a.stateData.cardSubtotalString,cardSubtotalStringPlural:a.stateData.cardSubtotalStringMultipleQuantity,subHeaderString:a.stateData.subHeaderDesktopString,categoryCount:Number(a.stateData.categoryCount),locale:a.stateData.locale}}}});e.when("A","cc-common-setup-handlers","collections-constants").execute(function(b,c,d){c.setupCardExpandCollapse(d.FEATURE_NAME,d.COLLECTIONS_EXPANDER,{refTagOnOpen:d.COLLECTIONS_CARD_DESKTOP_OPENED,refTagOnClose:d.COLLECTIONS_CARD_DESKTOP_CLOSED})});
e.when("A","cc-common-utils","cc-common-twister-registration","collections-constants").execute(function(b,c,d,a){var g=b.$;d.registerTwisterPlusFeature({featureName:a.FEATURE_NAME,featureAttribution:a.FEATURE_ATTRIBUTION,isMultiSelection:a.COLLECTIONS_IS_MULTI_SELECTION,updateQtyAsBaseItem:a.COLLECTIONS_UPDATE_QTY_AS_BASE_ITEM,callbacks:{init:function(){c.logCountMetric(a.COLLECTIONS_FEATURE_INITIALIZED)},cardCollapse:function(){g(a.COLLECTIONS_CONTENT_SELECTOR).removeClass(a.EXPANDER_CONTENT_EXPANDED_CLASS).attr(a.ARIA_EXPANDED,
a.FALSE).attr(a.STYLE,a.EXPANDER_CONTENT_COLLAPSED_STYLE);g(a.COLLECTIONS_EXPANDER_ICON_SELECTOR).removeClass(a.EXPANDER_ICON_COLLAPSE_CLASS).addClass(a.EXPANDER_ICON_EXPAND_CLASS);c.logCountMetric(a.COLLECTIONS_CARD_COLLAPSED)}}})});e.when("A","cc-common-constants","cc-common-utils","cc-common-image-loader","collections-constants","ready").execute(function(b,c,d,a,g){a.loadImagesAndTruncateTitle(g.COLLECTIONS_EXPANDER,g.COLLECTIONS_CAROUSEL,g.FEATURE_NAME);b.on(c.PAGE_REFRESH_ATF,function(){d.manualLoadImages(g.COLLECTIONS_CAROUSEL)})});
e.when("A","a-carousel-framework","cc-common-constants","cc-common-utils","cc-common-upsell-asins-carousel-handler","collections-constants","ready").execute(function(b,c,d,a,g,e){g.initializeCarousel(e.COLLECTIONS_CARD_ASIN_BLOCK_CAROUSEL);b.on(d.AUI_EXPANDER+e.COLLECTIONS_EXPANDER+d.AUI_EXPANDER_EXPAND,function(){b.trigger(d.SCROLL)})});e.when("A","side-sheet","a-carousel-constants","a-carousel-framework","cc-common-constants","cc-common-utils","cc-common-setup-handlers","collections-constants",
"collections-configs").execute(function(b,c,d,a,e,m,h,f,k){c=b.$;var l={featureName:f.FEATURE_NAME,asinsQuantityPerCategory:{},quantity:0,totalPrice:0,iconId:"",iconCss:"",parentHeader:f.COLLECTIONS_PARENT_HEADER,parentSubheaderId:f.COLLECTIONS_PARENT_SUBHEADER_ID,pageStateId:f.COLLECTIONS_PAGE_STATE_ID,tabSetScrollerClass:"",hasMultipleQuantityRequirement:!0,requiresTabCountUpdate:!1,requiresAttachIntegration:!1,badgeOffsetValues:{qtyBadgeLeftOffset:f.QTY_BADGE_LEFT_OFFSET,qtybadgeTopOffset:f.QTY_BADGE_TOP_OFFSET},
isFirstSelectionSideSheet:!0,isFirstSelectionListing:!0};c=c(f.COLLECTIONS_CAROUSEL);m.onClickStopped(c.get(0),function(){var b=a.getCarouselByName(f.COLLECTIONS_CARD_ASIN_BLOCK_CAROUSEL),c=b.getAttr(d.PAGE_NUMBER),b=b.getAttr(d.TOTAL_PAGES);m.logCountMetric(f.METRIC_COLLECTIONS_CAROUSEL_SCROLL,parseFloat((c/b*100).toFixed(4)))},f.CAROUSEL_STOP_DELAY);h.setupSideSheetHandlers(k.getCollectionsConfig,l);h.setupListingHandlers(f.COLLECTIONS_CAROUSEL,k.getCollectionsConfig,l);b.on(e.PAGE_REFRESH_ATF,
function(){l.asinsQuantityPerCategory={};l.quantity=0;l.totalPrice=0;h.setupListingHandlers(f.COLLECTIONS_CAROUSEL,k.getCollectionsConfig,l)});b.on(f.COLLECTION_CARD_LAZY_LOAD_COMPLETE,function(a){"undefined"!==typeof m.isAsinSelected&&m.isAsinSelected(a.asinIndex)&&m.hideAddButton(a.asinIndex)})})});
/* ******** */
(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(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 d=window.AmazonUIPageJS||window.P,g=d._namespace||d.attributeErrors,f=g?g("DetailPageVSXOffersAssets",""):d;f.guardFatal?f.guardFatal(e)(f,window):f.execute(function(){e(f,window)})})(function(e,d,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",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",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",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},CSA_EVENT_METRIC:{PRODUCER_ID:"valueshopping",FEATURE_NAME:"vsxOffers",SCHEMA_ID:"valueShopping.ClientSideMetrics.2"},METRIC_PREFIX_DESKTOP:"tp_desktop_cc_vsx_offers_",CAROUSEL_CHANGE:"carousel_change",METRIC_TYPE:"click",
HORIZONTAL_SCROLL:"horizontalscroll"}});"use strict";e.when("A","vsx-offers-constants","postMetric","atf").register("vsx-offers-utils",function(f,a,e){function h(d,b){b?c(b+" "+a.IN_EMI+d+a.EMI_TAB).click():c(a.IN_EMI+d+a.EMI_TAB).click()}function g(c){d.ueLogError&&d.ueLogError({message:c},{logLevel:a.ERROR_LOG_LEVEL,attribution:a.VSX_OFFERS_FEATURE_NAME})}var c=f.$;return{logError:g,logClientSideMetric:function(c,b){"undefined"!==typeof d.csa&&"undefined"!==typeof d.ue&&"undefined"!==typeof d.ue.count&&
(d.csa("Events",{producerId:a.CSA_EVENT_METRIC.PRODUCER_ID})("log",{schemaId:a.CSA_EVENT_METRIC.SCHEMA_ID,producerId:a.CSA_EVENT_METRIC.PRODUCER_ID,featureName:a.CSA_EVENT_METRIC.FEATURE_NAME,metricType:c,messageId:b},{ent:"all"}),d.ue&&"function"===typeof d.ue.count&&d.ue.count(b,(d.ue.count(b)||0)+1))},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(c){var b=window.AmazonUIPageJS||window.P,d=b._namespace||b.attributeErrors,a=d?d("DetailPageABBAccessoriesAssets",""):b;a.guardFatal?a.guardFatal(c)(a,window):a.execute(function(){c(a,window)})})(function(c,b,d){});
/* ******** */
(function(c){var d=window.AmazonUIPageJS||window.P,h=d._namespace||d.attributeErrors,a=h?h("DetailPageQRMAssets",""):d;a.guardFatal?a.guardFatal(c)(a,window):a.execute(function(){c(a,window)})})(function(c,d,h){c.when("singletonPopupModal","a-dropdown","jQuery","csm-counter").register("quantity-restriction-messaging",function(a,d,k,l){return{quantityModal:function(e){var c=k("#quantity"),g=k("#cspQuantity"),f=function(){var b={};return"lastQuantityOption"===c.find("option:selected").attr("data-a-id")?
(b.id=c,b.dropdown="quantity",b.popoverTitle=e.popoverTitle,b.message=e.message,b.plusOne=e.moq,b):"lastQuantityOption"===g.find("option:selected").attr("data-a-id")?(b.id=g,b.dropdown="cspQuantity",b.popoverTitle=e.popoverTitle,b.message=e.cspMessage,b.plusOne=e.cspMOQ,b):null},m=function(){var b=f();null!==b&&b.message&&(a.show({width:502,position:"triggerRight",header:b.popoverTitle,inlineContent:b.message.replace(/MAX_QUANTITY_PLUS_ONE/g,b.plusOne)},!0),b.id.selectedIndex=0,(b=d.getSelect(b.dropdown))&&
b.getOption(0).update({selected:!0}),l.increment("last-quantity-option-click-count"))};c.change(m);g.change(m);m()}}});"use strict";c.when("A").register("csm-counter",function(a){var c=a.$;return{register:function(k,a,e){k&&a&&e&&c(k).bind(a,c.proxy(this.increment,this,e))},increment:function(a){a&&d.ue.count(a,(d.ue.count(a)||0)+1)},update:function(a,c){a&&"number"===typeof c&&d.ue.count(a,c)}}});"use strict";c.when("A","jQuery","a-modal").register("singletonPopupModal",function(a,c,d){function l(a){null===
f?(g=h.appendTo(c("body")),f=d.create(g,a)):f.update(a);f.show()}function e(){f&&f.hide()}var h=c('\x3cdiv style\x3d"display:none"\x3e'),g=null,f=null;a.declarative("cfg-singleton-modal-close","click",e);a.declarative("cfg-singleton-modal-open","click",function(a){l({inlineContent:a.data.inlineContent,header:a.data.header,width:a.data.width||"502",position:"triggerRight"},!0)});return{show:l,hide:e,destroy:function(){f&&(d.remove(f),f=null)}}})});
/* ******** */
'use strict';(function(g){var d=window.AmazonUIPageJS||window.P,n=d._namespace||d.attributeErrors,a=n?n("DetailPageProductSpecDepthAsset",""):d;a.guardFatal?a.guardFatal(g)(a,window):a.execute(function(){g(a,window)})})(function(g,d,n){g.when("A","ready","a-toggle-button","voyager-desktop-metric").register("voyager-expand-collapse-module",function(a,e,b,c){function f(){return h("#productDetails_expanderSectionTables").find(".a-expander-header")||[]}function d(b){return"true"===b.getAttribute("aria-expanded")}
function y(){var b=f();b&&b.length&&(c.incrementCounter(c.metricName.expandAllButtonClicked(q,t)),c.incrementCounter(c.metricName.expandAllButtonClicked("all","all")),b.each(function(){d(this)||h(this).click()}))}function l(){var b=f();b&&b.length&&(c.incrementCounter(c.metricName.collapseAllButtonClicked(q,t)),c.incrementCounter(c.metricName.collapseAllButtonClicked("all","all")),b.each(function(){d(this)&&h(this).click()}))}function g(){var b=!1,a=!1;f().each(function(){d(this)?a=!0:b=!0});k("#voyager-expand-all-btn",
b);k("#voyager-collapse-all-btn",a)}function k(a,e){a=b(a);e?a.enable():a.disable()}function p(){var b=h("#productDetails_expanderSectionTables").find(".a-expander-content");b&&b.length&&(b=b.find(".prodDetSectionEntry"))&&15>b.length&&(f().each(function(){"true"!==this.getAttribute("data-expanded")&&h(this).click()}),k("#voyager-expand-all-btn",!1),k("#voyager-collapse-all-btn",!0))}function n(){var b=w();c.incrementCounter(c.metricName.expandAllButtonClicked(q,m));c.incrementCounter(c.metricName.expandAllButtonClicked("all",
"all"));f().each(function(){b?h(this).click():d(this)||h(this).click()});a.debounce(u)()}function w(){var b=!0;f().each(function(){d(this)||(b=!1)});return b}function u(){var b=h("#voyager-expand-all-text"),a=h("#voyager-collapse-all-text");w()?(b.addClass("aok-hidden"),a.removeClass("aok-hidden")):(b.removeClass("aok-hidden"),a.addClass("aok-hidden"))}function x(){f().each(function(){"true"!==this.getAttribute("aria-expanded")&&h(this).click()})}e=a.state("voyager-desktop-context");var t="unknown",
m="unknown",q="unknown";e&&(t=e["voyager-desktop-treatment"],m=e["voyager-desktop-v2-treatment"],q=e.product_type);var h=a.$;if("T1"===m||"T2"===m||"T3"===m||"T4"===m){if("T1"===m||"T3"===m)x(),a.on("PageRefresh:ATF",x);a.debounce(u)();a.declarative("voyager-expand-all-handler","click",n);a.declarative("voyager-expander-heading-toggle","click",a.debounce(u))}else p(),a.on("PageRefresh:ATF",p),a.declarative("voyager-expand-all-handler","click",y),a.declarative("voyager-collapse-all-handler","click",
l),a.declarative("voyager-expander-heading-toggle","click",g)});"use strict";g.when("A","ready").register("voyager-pd-desktop-jump-link",function(a){function e(){var b=a.$("#seeMoreDetailsLink"),e=a.$("#productDetails_expanderSectionTables");b.length&&e.length&&b.parent().removeClass("aok-hidden")}e();a.on("a:pageUpdate",e)});"use strict";"use strict";"use strict";"use strict";"use strict";"use strict";"use strict";"use strict";g.when("A","ready").register("voyager-desktop-metric",function(a){a={};
a={impression:function(a,b){return"voyager:desktop:"+a+":"+b+":impression"},sectionExpanderClicked:function(a,b,c,d){return"voyager:desktop:"+a+":"+b+":"+c+":"+d+":clicked"},sectionExpanderOverallClicked:function(a,b){return"voyager:desktop:"+a+":"+b+":sectionExpander:overall:clicked"},expandAllButtonClicked:function(a,b){return"voyager:desktop:"+a+":"+b+":expandAll:clicked"},collapseAllButtonClicked:function(a,b){return"voyager:desktop:"+a+":"+b+":collapseAll:clicked"},sectionExpanderContentDwellTime:function(a,
b,d,f){return"voyager:desktop:"+a+":"+b+":"+d+":"+f+":dwellTime"},sectionExpanderContentOverallDwellTime:function(a,b){return"voyager:desktop:"+a+":"+b+":sectionExpander:overall:dwellTime"}};return{incrementCounter:function(a){d.ue&&d.ue.count&&d.ue.count(a,(d.ue.count(a)||0)+1)},setCounter:function(a,b){d.ue&&d.ue.count&&d.ue.count(a,b)},metricName:a}});"use strict";g.when("A","jQuery","voyager-desktop-metric").execute("voyager-desktop-sectionExpander-listener",function(a,d,b){function c(){if(!v){var d=
document.getElementById("productDetails_expanderSectionTables");a.onScreen(d,0)&&(b.setCounter(b.metricName.impression(l,g),1),b.setCounter(b.metricName.impression("all","all"),1),v=!0)}}function f(){var e=document.getElementById("productDetails_expanderSectionTables");e&&a.onScreen(e,0)&&!document.hidden?(c(),k&&function(){var e=Date.now()-k;p+=e;var c=d("#productDetails_expanderSectionTables").find(".a-expander-header");c&&c.length&&c.each(function(){if(a.onScreen(this,0)&&"true"===this.getAttribute("aria-expanded")){var c=
JSON.parse(d(this).parent().attr("data-voyager-expander-heading-toggle")),f=c.columnName+c.sectionIndex;r.set(f,(r.get(f)||0)+e);b.setCounter(b.metricName.sectionExpanderContentDwellTime(l,g,c.columnName,c.sectionIndex+1),r.get(f));b.setCounter(b.metricName.sectionExpanderContentDwellTime("all","all",c.columnName,c.sectionIndex+1),r.get(f))}});b.setCounter(b.metricName.sectionExpanderContentOverallDwellTime(l,g),p);b.setCounter(b.metricName.sectionExpanderContentOverallDwellTime("all","all"),p)}(),
k=Date.now()):k=n}var e=a.state("voyager-desktop-context"),g="unknown",l="unknown";e&&(g=e["voyager-desktop-treatment"],l=e.product_type);var r=new Map,k=void 0,p=0,v=!1;(function(){document.addEventListener("visibilitychange",function(){document.hidden&&(k=n)});f();a.interval(f,1E3)})();a.declarative("voyager-expander-heading-toggle","click",function(a){if(a&&a.data){f();var c=a.data.sectionIndex;a=a.data.columnName;"true"===d("#productDetails_expanderTables_"+a).find(".a-expander-header").eq(c).attr("aria-expanded")&&
(b.incrementCounter(b.metricName.sectionExpanderClicked(l,g,a,c+1)),b.incrementCounter(b.metricName.sectionExpanderClicked("all","all",a,c+1)),b.incrementCounter(b.metricName.sectionExpanderOverallClicked(l,g)),b.incrementCounter(b.metricName.sectionExpanderOverallClicked("all","all")))}})});"use strict";"use strict";"use strict"});
/* ******** */
(function(e){var g=window.AmazonUIPageJS||window.P,h=g._namespace||g.attributeErrors,c=h?h("LuxuryBeautyStaticAssets",""):g;c.guardFatal?c.guardFatal(e)(c,window):c.execute(function(){e(c,window)})})(function(e,g,h){e.when("A","jQuery","twister-aui-page-state","ready").register("beauty-recommendations-init",function(c,d,e){function u(a){switch(a){case 0:return f.bRecCart1;case 1:return f.bRecCart2;case 2:return f.bRecCart3;case 3:return f.bRecCart4;default:return f.bRecCart1}}function b(a){switch(a){case 0:return f.bRecWish1;
case 1:return f.bRecWish2;case 2:return f.bRecWish3;case 3:return f.bRecWish4;default:return f.bRecWish1}}function v(a){switch(a){case 0:return f.bRecPrice1;case 1:return f.bRecPrice2;case 2:return f.bRecPrice3;case 3:return f.bRecPrice4;default:return f.bRecPrice1}}function n(a){return d("#bRecCheckbox"+a)}function w(){for(var a="",b=0;b<l;b++)a+=n(b).prop("checked")?"1":"0";a=parseInt(a,2);a=p[a];d("#bRecPrice").text(a)}function q(){for(var a=0,f,c,e=0;e<l;e++)c=d("#bRecImg"+e),(f=n(e).prop("checked"))?
(a++,c.removeClass("bRecDisabled")):c.addClass("bRecDisabled");d("#bRecAddToCart").find("span.a-button-text").text(u(a));d("#bRecAddToList").find("span.a-button-text").text(b(a));d("#bRecPriceLabel").text(v(a));f=a+1;d("#bRecForm").attr("action",r+f);k("beautyRecommendationsComplementaryASINCount",a);w();d("#bRecAddToList").click(function(){try{k("beautyRecommendationsAddToWishListTotalClickCount");var a=d("#bRecAddToListNative").data("action");d("#bRecForm").attr("action",a);k("beautyRecommendationsAddToWishListSuccessClickCount")}catch(b){k("beautyRecommendationsAddToWishListFailureClickCount")}});
d("#bRecAddToCart").click(function(){try{k("beautyRecommendationsAddToCartTotalClickCount");var a=d("#addToCart").data("action");d("#bRecForm").attr("action",a);k("beautyRecommendationsAddToCartSuccessClickCount")}catch(b){k("beautyRecommendationsAddToCartFailureClickCount")}})}var t=g.ue,m,f,l,p,r,k=function(a,b){b=b!==h?b:1;a!==h&&t.count(a,(t.count(a)||0)+b)};return{init:function(){e.updatePageState();m=c.state("beautyRecommendations");f=c.state("bRecDynamicStrings");if(m){l=m.numRecommendations;
p=m.possibleSums;r=d("#bRecForm").attr("action");for(var a=0;a<l;a++)n(a).change(q);d("#bRecPricePara").removeClass("a-hidden");q()}}}});e.when("A","ready").register("beauty-recommendations-atc",function(c){function d(b,d,c){b='\x3cinput type\x3d"hidden" name\x3d"items[{key}][{field}]" value\x3d"{value}"\x3e'.replace("{key}",b);e(b,"asin",d);e(b,"offerListingId",c);e(b,"quantity","1")}function e(b,d,c){b=b.replace("{field}",d).replace("{value}",c);g("#bRecNATCFormInputs").append(b)}var g=c.$;c.declarative("beauty-recommendations-add-to-cart",
"click",function(b){b=b.data;d("0.base",b.rootItem.asin,b.rootItem.offerListingId);for(var c=0,e=0;e<b.complementaryItems.length;e++)if(g("#bRecCheckbox"+e).is(":checked")){var h=b.complementaryItems[e];d(c+".addOn",h.asin,h.offerListingId);c++}c+=1;g("#bRecForm").attr("action","/cart/add-to-cart/ref\x3d"+b.refTag+c)})})});
/* ******** */
(function(c){var b=window.AmazonUIPageJS||window.P,d=b._namespace||b.attributeErrors,a=d?d("BuyItOnABUIAssets",""):b;a.guardFatal?a.guardFatal(c)(a,window):a.execute(function(){c(a,window)})})(function(c,b,d){});
/* ******** */
'use strict';(function(b){var c=window.AmazonUIPageJS||window.P,d=c._namespace||c.attributeErrors,a=d?d("TurboCheckoutBaseAssets@accessibility_switch","TurboCheckout"):c;a.guardFatal?a.guardFatal(b)(a,window):a.execute(function(){b(a,window)})})(function(b,c,d){b.when("turbo-initiate-migration-switch").register("turbo-checkout-accessibility-switch",function(a){return{isEnabled:function(){return a.isEnabled()}}})});
/* ******** */
'use strict';(function(a){var b=window.AmazonUIPageJS||window.P,d=b._namespace||b.attributeErrors,c=d?d("TurboCheckoutBaseAssets@buy_now_to_tango_switch","TurboCheckout"):b;c.guardFatal?c.guardFatal(a)(c,window):c.execute(function(){a(c,window)})})(function(a,b,d){a.when("turbo-configuration","buy-now-to-tango-switch-mobile","buy-now-to-tango-switch-desktop","buy-now-to-tango-switch-beta").register("buy-now-to-tango-switch",function(c,a,b,d){return{isEnabled:function(){return c.get(c.KEYS.IS_BUY_NOW_TO_TANGO_ENABLED)&&
(a.isGatingWeblabEnabled()||b.isGatingWeblabEnabled()||d.isGatingWeblabEnabled())}}});"use strict";a.when("turbo-checkout-page-ready").register("buy-now-to-tango-switch-mobile",function(){return{isGatingWeblabEnabled:function(){return!1}}});"use strict";a.when("buy-now-to-tango-switch-desktop-prime","buy-now-to-tango-switch-desktop-non-prime").register("buy-now-to-tango-switch-desktop",function(a,b){return{isGatingWeblabEnabled:function(){return a.isGatingWeblabEnabled()||b.isGatingWeblabEnabled()}}});
"use strict";a.when("turbo-checkout-page-ready").register("buy-now-to-tango-switch-desktop-prime",function(){return{isGatingWeblabEnabled:function(){return!1}}});"use strict";a.when("turbo-checkout-page-ready").register("buy-now-to-tango-switch-desktop-non-prime",function(){return{isGatingWeblabEnabled:function(){return!1}}});"use strict";a.when("turbo-checkout-page-ready").register("buy-now-to-tango-switch-beta",function(){return{isGatingWeblabEnabled:function(){return!1}}})});
/* ******** */
'use strict';(function(a){var c=window.AmazonUIPageJS||window.P,d=c._namespace||c.attributeErrors,b=d?d("TurboCheckoutBaseAssets@chewbacca_migration_switch","TurboCheckout"):c;b.guardFatal?b.guardFatal(a)(b,window):b.execute(function(){a(b,window)})})(function(a,c,d){a.when("turbo-checkout-state-handler").register("turbo-chewbacca-migration-switch-non-prime-desktop",function(b){return{isGatingWeblabEnabled:function(){return!1},isShadowModeEnabled:function(){return!1}}});"use strict";a.when("turbo-checkout-state-handler").register("turbo-chewbacca-migration-switch-prime-desktop",
function(b){return{isGatingWeblabEnabled:function(){!1},isShadowModeEnabled:function(){return!1}}});"use strict";a.when("turbo-checkout-state-handler").register("turbo-chewbacca-migration-switch-non-prime-mobile",function(b){return{isGatingWeblabEnabled:function(){return!1},isShadowModeEnabled:function(){return!1}}});"use strict";a.when("turbo-checkout-state-handler").register("turbo-chewbacca-migration-switch-prime-mobile",function(b){return{isGatingWeblabEnabled:function(){return!1},isShadowModeEnabled:function(){return!1}}});
"use strict";a.when("turbo-checkout-state-handler","turbo-chewbacca-migration-switch-prime-mobile","turbo-chewbacca-migration-switch-non-prime-mobile","turbo-chewbacca-migration-switch-prime-desktop","turbo-chewbacca-migration-switch-non-prime-desktop").register("turbo-chewbacca-migration-switch",function(b,a,c,d,e){return{isGatingWeblabEnabled:function(){return a.isGatingWeblabEnabled()||c.isGatingWeblabEnabled()||d.isGatingWeblabEnabled()||e.isGatingWeblabEnabled()},isShadowModeEnabled:function(){return a.isShadowModeEnabled()},
isMobileGatingWeblabEnabled:function(){return a.isGatingWeblabEnabled()||c.isGatingWeblabEnabled()},isDesktopGatingWeblabEnabled:function(){return d.isGatingWeblabEnabled()||e.isGatingWeblabEnabled()}}})});
/* ******** */
'use strict';(function(c){var a=window.AmazonUIPageJS||window.P,d=a._namespace||a.attributeErrors,b=d?d("TurboCheckoutBaseAssets@chewbacca_migration_switch_beta","TurboCheckout"):a;b.guardFatal?b.guardFatal(c)(b,window):b.execute(function(){c(b,window)})})(function(c,a,d){c.when("turbo-checkout-state-handler","turbo-checkout-device-filter").register("turbo-chewbacca-migration-switch-beta",function(b,c){return{isGatingWeblabEnabled:function(){var a=b.getClientId();return!("primewardrobe"===a||"primestylist"===
a)&&c.isMashBeta()},isShadowModeEnabled:function(){return!1}}})});
/* ******** */
'use strict';(function(a){var g=window.AmazonUIPageJS||window.P,h=g._namespace||g.attributeErrors,b=h?h("TurboCheckoutBaseAssets@initiate_migration_switch","TurboCheckout"):g;b.guardFatal?b.guardFatal(a)(b,window):b.execute(function(){a(b,window)})})(function(a,g,h){a.when("turbo-initiate-migration-switch-mobile","turbo-initiate-migration-switch-desktop","turbo-chewbacca-migration-switch").register("turbo-initiate-migration-switch",function(b,a,f){return{isEnabled:function(){return b.isEnabled()||
a.isEnabled()},getWeblabInControlOnlyToTrigger:function(){return f.isMobileGatingWeblabEnabled()?b.getWeblabInControlOnlyToTrigger():f.isDesktopGatingWeblabEnabled()?a.getWeblabInControlOnlyToTrigger():[]}}});"use strict";a.when("turbo-chewbacca-migration-switch").register("turbo-initiate-migration-switch-mobile",function(b){return{isEnabled:function(){return!1},getWeblabInControlOnlyToTrigger:function(){return[]}}});"use strict";a.when("turbo-chewbacca-migration-switch","turbo-checkout-state-handler").register("turbo-initiate-migration-switch-desktop",
function(b,a){function f(){for(var e=a.getAdditionalWeblabAndTreatmentMap(),b={},d=0;d<c.length;d++)e.hasOwnProperty(c[d])&&(b[c[d]]=e[c[d]]);return b}var c=["PAX_TURBO_INITIATE_MIGRATION_DESKTOP_868123","PAX_TURBO_INITIATE_MIGRATION_DESKTOP_NON_PRIME_986684"];return{isEnabled:function(){var e;if(e=b.isGatingWeblabEnabled())a:{e=f();for(var a=0;a<c.length;a++)if(e.hasOwnProperty(c[a])&&("T1"===e[c[a]]||"T3"===e[c[a]])){e=!0;break a}e=!1}return e},getWeblabInControlOnlyToTrigger:function(){for(var a=
f(),b={},d=0;d<c.length;d++)if(a.hasOwnProperty(c[d])&&"C"===a[c[d]]){b[c[d]]=a[c[d]];break}return b}}})});
/* ******** */
'use strict';(function(a){var c=window.AmazonUIPageJS||window.P,d=c._namespace||c.attributeErrors,b=d?d("TurboCheckoutBaseAssets@shopping_portal_switch","TurboCheckout"):c;b.guardFatal?b.guardFatal(a)(b,window):b.execute(function(){a(b,window)})})(function(a,c,d){a.when("turbo-checkout-state-handler","turbo-checkout-page-ready").register("turbo-shopping-portal-switch",function(b){return{isShoppingPortalEnabled:function(){var a=b.getClientId();return!("primewardrobe"===a||"primestylist"===a)}}})});
/* ******** */
'use strict';(function(b){var c=window.AmazonUIPageJS||window.P,d=c._namespace||c.attributeErrors,a=d?d("TurboCheckoutBaseAssets@tbyb_shopping_portal_switch","TurboCheckout"):c;a.guardFatal?a.guardFatal(b)(a,window):a.execute(function(){b(a,window)})})(function(b,c,d){b.when("turbo-checkout-page-ready").register("turbo-tbyb-shopping-portal-switch",function(){return{isTBYBShoppingPortalEnabled:function(){return!1}}})});
/* ******** */
'use strict';(function(g){var q=window.AmazonUIPageJS||window.P,w=q._namespace||q.attributeErrors,c=w?w("TurboCheckoutBaseAssets@confirm_initiate_removal","TurboCheckout"):q;c.guardFatal?c.guardFatal(g)(c,window):c.execute(function(){g(c,window)})})(function(g,q,w){g.when("A","turbo-view-adapter","turbo-checkout-view-state","turbo-checkout-eligible-state","turbo-checkout-content-loader","turbo-checkout-utils","turbo-checkout-weblab-allocation","turbo-checkout-weblab-trigger","turbo-checkout-csm",
"turbo-checkout-state-handler","turbo-checkout-device-filter","turbo-checkout-ajax-wrapper","turbo-checkout-page-visibility-manager","turbo-checkout-counter","turbo-checkout-prefetcher","turbo-checkout-prefetch-timer","turbo-checkout-buy-now-button","turbo-checkout-signin-controller","buy-now-to-tango-weblab-trigger","turbo-checkout-auto-open","turbo-checkout-urls","turbo-checkout-ref-tagger","turbo-configuration","turbo-checkout-event-verification","turbo-checkout-eligibility-aggregator","turbo-checkout-page-ready").register("turbo-checkout-controller",
function(c,d,g,C,l,x,k,D,e,h,E,y,F,q,z,t,m,G,H,w,A,K,u,N,B){function a(){m.bindTurboClickEvent();c.off("turbo:checkout:dimmer:clicked");c.on("turbo:checkout:dimmer:clicked",function(n){n()})}function b(n,a){x.logDebug("turbo-checkout-controller",n,a)}function f(a,b){I();a||(b===K.TAGS.ROTATION&&e.logCount("turboCheckoutDeviceRotated"),d.close({reason:b}))}function aa(){b("Handling signin success");S()}function P(){b("Handling buy now button click");S();return!0}function S(){Q=setTimeout(ba,2E4);r=
e.createScope();r.markClick();v="loading";L=!1;t.checkTimeout();q.incrementSheetOpenedCounter();d.show()}function ba(){e.logCount("turboCheckoutContenLoadTimeout")}function ca(){I();d.removeContent()}function T(){I();N.logBuyNowButtonClickHandlerMetrics()}function I(){C.canShow()&&!k.isDisableTurboWeblabInTreatment()?(b("Registering with buy now button"),c.trigger("turbo:checkout:buyNowEnabled"),m.registerOnClickCallback(P)):(b("Unregistering from buy now button"),c.trigger("turbo:checkout:buyNowDisabled"),
m.deregisterOnClickCallback(P))}function Y(a,O){e.logCount("turboCheckoutPrefetchSuccess");a&&(k.isControl()||k.isBuyNowOnly())&&(b("Received content in control: "+a.substring(0,255)),e.logCount("turboCheckoutControlContentReceived"));R=O;l.isTurboOptimisticFlushingEnabled()?d.finalizeIFrameContent():d.setContent(a);I();l.shadowCallChewbaccaInitiate()}function J(){I();g.isOpeningOrOpen()&&(e.logCount("turboCheckoutYieldNewPurchase"),d.closeImmediatelyThenExecute(U))}function Z(){clearTimeout(Q);v=
"unknown";V();W()}function V(){!p||p.isResolved()||p.isRejected()||(b("Initiate confirm called for "+R.currentPurchaseId+" with existing confirm still executing. Aborting"),e.logCount("turboCheckoutConfirmPending"),p._supersedByNewPurchase=!0,p.abort())}function da(){var a=h.getLineItems().filter(function(a){return a&&a.isDiscoveredAsin}).map(function(a,b){return a.asin});e.logCount("turboCheckoutDiscoveredAsins",a.length);return a}function W(){e.logCount("turboCheckoutConfirm");var a=R.currentPurchaseId,
b=A.buildConfirmPathWith(h.getRefTag(),k.getExperimentName(),h.getClientId(),h.getRequestId(),h.getSessionId(),da());p=y.loadWithJQXHR(b,{type:"POST",data:{pid:a},headers:ea(),success:function(a,b,n){e.logCount("turboCheckoutConfirmSuccess")},error:function(b,n,O){"abort"===n?e.logCount("turboCheckoutConfirmAborted"):("timeout"===n&&e.logCount("turboCheckoutConfirmTimeOut"),e.logCount("turboCheckoutConfirmFailed"));b._supersedByNewPurchase||(x.logError("Issue confirming turbo initiate prefetch for pid "+
a+": "+O+", "+n),e.logCount("turboCheckoutYieldNewPurchase"),d.closeImmediatelyThenExecute(U))}})}function ea(){var a={},b=h.getCSRFToken();b&&0<b.length&&(a["x-amz-checkout-csrf-token"]=b);return a}function fa(){r.markFirstByte()}function ha(){clearTimeout(Q);v="unknown"}function ia(){V();W()}function ja(){r.markFirstByte()}function M(){return u.get(u.KEYS.HOST_PAGE_TYPE_IDENTIFIER)}function U(){m.executeOriginalBuyNowAction(h.getActiveId())}function ka(a){c.trigger("turbo:checkout:embedded:page:showSpinner");
p.done(a)}function la(a,b,c){v=c;L=!1}function ma(){L=!0}function na(a){c.off("turbo:checkout:dimmer:clicked");c.on("turbo:checkout:dimmer:clicked",function(a){a()});a&&a.doNotLog||(a&&!a.doNotLog?X(v,a.reason):X(v,!1));v="closed"}function X(a,c){var n=A.buildLogPageHitPathWith(L?a+"2":a,c,h.getClientId());b("Logging page hit from "+a+" to "+M()+" reason "+c);y.load(n,{method:"POST",params:{pageType:M(),referrer:a},timeout:4E3})}function oa(){g.isOpeningOrOpen()&&e.logCount("turboCheckoutProductChangedWhileOpening")}
var r,v,R,L,pa=u.get(u.KEYS.AJAX_PAGE_UPDATE_EVENT),Q,p;c.on(pa,a);a();return{pageLoaded:function(){var a=k.getExperimentName();if(a){var b=k.getAllocation();e.addCounterExtraSuffix("wl:"+b);e.addCounterExtraSuffix(a+":"+b)}if(E.isDeviceTurboEligible()||B.shouldAttemptTangoPrefetch())C.setup(),C.registerStateChangeCallback(f),F.setup(),l.registerCallback({onStart:ca,onTurboEligible:T,onFinish:Y,onError:J}),D.setup(),G.setup(),G.registerCallback(aa),H.registerBuyNowToTangoTriggerOnButton(),r=e.createScope(),
d.registerCallbacks({beforeFramePopulated:Z,afterFramePopulated:fa,beforeOptimisticFlushing:ha,afterOptimisticFlushing:ia,csmMarkFirstByte:ja}),h.registerCallback(oa),c.on("turbo:checkout:sheet:beforeClose",na),c.on("turbo:checkout:embedded:page:beforeReload",la),c.on("turbo:checkout:embedded:page:animation:start",ma),w.setup(m.executeTurboBuyNowAction,T),z.setup(),c.trigger("turbo:checkout:controller:onPageLoaded")},loadFullscreen:function(a,b){function c(){a=x.createFQDN(a);"thankyou"===b?(e.logCount("turboCheckoutYieldTYP"),
"primewardrobe"===h.getClientId()&&e.logCount("turboCheckoutYieldTYP:pw"),d.closeAndNavigate(a)):"thirdPartyPaymentInterstitial"===b?d.closeAndNavigate(a):"verifyMfaPage"===b?("primewardrobe"===h.getClientId()&&e.logCount("turboCheckoutYieldTYP:pw"),d.closeAndNavigate(a)):(e.logCount("turboCheckoutYield"),d.closeToFullscreen(a))}!p||p.isResolved()||p.isRejected()?c():(e.logCount("turboCheckoutWaitYield"),ka(c))},frameContentReady:function(a,b,f){c.trigger("turbo:checkout:embedded:page:ready",a,b);
(function(){var a=function(){r.markCriticalFeature();f.confirmHit(M(),h.getRefTag());r.whenDataSet(f.recordClientSideMetrics);b.off("checkout:afterReload",a)};b.on("checkout:afterReload",a)})();(function(){b.on("checkout:beforeReload",function(f){c.trigger("turbo:checkout:embedded:page:beforeReload",a,b,f)});b.on("checkout:reload",function(f){c.trigger("turbo:checkout:embedded:page:reload",a,b,f)});b.on("checkout:afterReload",function(f){c.trigger("turbo:checkout:embedded:page:afterReload",a,b,f)});
b.on("turbo:checkout:animation:start",function(){c.trigger("turbo:checkout:embedded:page:animation:start")});b.state("turbo-secondary-panels-weblab-state",k.getHoldbackSecondaryPanelsWeblab());c.on("turbo:checkout:embedded:page:showSpinner",function(){f.showSpinner()});c.off("turbo:checkout:dimmer:clicked");c.on("turbo:checkout:dimmer:clicked",function(a){b.trigger("turbo:checkout:dimmer:clicked:iFrame",a)});b.on("turbo:checkout:update:dimmer",function(a){c.trigger("turbo:checkout:update:dimmer:afterReload",
a)});b.on("turbo:checkout:update:modal:header",function(a){c.trigger("turbo:checkout:update:modal:header:afterReload",a)});b.on("turbo:checkout:update:dimmer:block",function(){c.trigger("turbo:checkout:update:dimmer:block:iFrame")});b.on("turbo:checkout:update:dimmer:unblock",function(){c.trigger("turbo:checkout:update:dimmer:unblock:iFrame")});b.on("turbo:checkout:order:success",function(){c.trigger("turbo:checkout:order:success:iFrame")})})()},frameHtmlRendered:function(){r.markAboveTheFold()},
updateBounds:function(a,b){d.updateBounds(a,b)},getHeight:function(){return d.getHeight()},updateMinHeight:function(a){return d.updateMinHeight(a)},updateScrollHeight:function(a,b){return d.updateScrollHeight(a,b)},updateDimmer:function(a){c.trigger("turbo:checkout:update:dimmer:typReload",a)},getHostPageType:M,closeBottomSheet:function(a){c.trigger("turbo:checkout:sheet:doClose",a)}}});"use strict";g.register("turbo-discovered-asins-filter",function(){return{apply:function(c){return c.filter(function(c){return c&&
c.isDiscoveredAsin}).map(function(c,g){return c.asin})}}});"use strict";g.when("A","turbo-configuration","turbo-checkout-csm","turbo-checkout-ref-tagger","turbo-checkout-utils","turbo-initiate-migration-switch","turbo-shopping-portal-switch","turbo-tbyb-shopping-portal-switch","turbo-checkout-state-handler","buy-now-to-tango-switch","turbo-checkout-eligibility-aggregator","turbo-checkout-page-ready").register("turbo-checkout-urls",function(c,d,g,q,l,x,k,D,e,h,E){function y(a,b){if(a&&x.isEnabled()||
b){try{var f=c.$("#debug-purchase-id")[0].textContent;var d=f===w?"":"/"+f}catch(P){d=""}a="/checkout/entry/buynow"+d}else a=D.isTBYBShoppingPortalEnabled()&&F()?"/checkout/trybeforeyoubuy/turbo-initiate":k.isShoppingPortalEnabled()?"/checkout/turbo/initiate":"/checkout/turbo-initiate";return a}function F(){return"primewardrobe"===e.getClientId()}function J(a,b){return["\x26",a,"\x3d",b].join("")}function z(a,b,c){a="\x26pipelineType\x3dturbo\x26clientId\x3d"+a;var f=d.get(d.KEYS.DEVICE_OVERRIDE);
return a+(f?"\x26devicestring-override\x3d"+f:"")+A(b,c)}function t(a){var b=d.get(d.KEYS.HOST_PAGE_TYPE_IDENTIFIER);return"ref_\x3d"+a+"\x26referrer\x3d"+b}function m(a){return l.isNonEmptyString(a)?"\x26weblab\x3d"+a:""}function G(a){if("boolean"===typeof a)return"\x26primeStatus\x3d"+a;g.logCount("turboCheckoutPrimeStatusEmpty");return""}function H(){return d.get(d.KEYS.IS_ADD_TO_CART_ENABLED)?"\x26temporaryAddToCart\x3d1":""}function C(a){if(!a||!a.length)return"";d.get(d.KEYS.IS_ADD_TO_CART_ENABLED)||
l.logError('Discovered asins present but add to cart is disabled? This will generate a "clickstream_ignore" hit on the server side and cause the hit to be ignored by clickstream and the attribution lost!',"turbo-checkout-urls");var b="";a.forEach(function(a,c){b+="\x26discoveredAsins."+c+"\x3d"+a});return b}function A(a,b){var c="";l.isNonEmptyString(a)&&(c+="\x26pageRequestId\x3d"+a);l.isNonEmptyString(b)&&(c+="\x26pageSessionId\x3d"+b);return c}function K(){return D.isTBYBShoppingPortalEnabled()&&
F()?"/checkout/trybeforeyoubuy/triggerWeblab":k.isShoppingPortalEnabled()?"/checkout/turbo/triggerWeblab":"/checkout/triggerWeblab"}function u(){return B("auiDebug","auiDebug")+B("ds_user","ds_user")+B("ds_turbo_workspace","ds_workspace")+B("stringDebug","stringDebug")}function N(a){a=a?a:[];var b="";a.forEach(function(a,c){b+="\x26asin."+(c+1)+"\x3d"+a.asin});return b}function B(a,b){var c="";a=l.getUrlQueryParam(a);l.isNonEmptyString(a)&&(c="\x26"+b+"\x3d"+a);return c}return{buildInitiatePathWith:function(a,
b,c,d,e,h,g,k){var f=y(!0,k);a=f+"?"+t(a)+z(c,d,e)+m(b)+G(g)+H()+u()+N(h);b="";l.isNonEmptyString(f)&&-1!==f.indexOf("/checkout/entry/buynow")&&(b="\x26turboCheckoutMigrationFlag\x3d1");k&&(b+="\x26isShadowMode\x3d1");return a+b},buildEligibilityPathWith:function(a,b,c,d,e,g){a=y()+"?"+t(a)+z(c,d,e)+m(b)+G(g)+"\x26checkEligibilityOnly\x3dtrue"+H()+u();b=[];c=E.shouldAttemptTurboPrefetch()&&E.isTurboEligible();b.push(J("runTurboEligibility",c));h.isEnabled()&&b.push(J("runTangoEligibility",E.shouldAttemptTangoPrefetch()));
b=b.join("");return a+b},buildConfirmPathWith:function(a,b,c,d,e,g){return y()+"/confirm?"+t(a)+z(c,d,e)+m(b)+H()+C(g)},buildLogPageHitPathWith:function(a,b,c){a=(D.isTBYBShoppingPortalEnabled()&&F()?"/checkout/trybeforeyoubuy/log-page-hit":k.isShoppingPortalEnabled()?"/checkout/turbo/log-page-hit":"/checkout/log-page-hit")+"?"+q.generateRefTag(a,q.ACTIONS.CLOSE,b)+z(c);b=x.isEnabled()?"":"\x26isLegacyCheetah\x3d1";return a+b},buildTriggerWeblabPathWith:function(a,b,c,d,e){return K()+"?"+t(a)+m(b)+
"\x26weblabAllocation\x3d"+c+A(d,e)},buildTriggerWeblabPathWithoutWeblab:function(a,b,c){return K()+"?"+t(a)+A(b,c)}}})});
/* ******** */
'use strict';(function(c){var a=window.AmazonUIPageJS||window.P,e=a._namespace||a.attributeErrors,b=e?e("TurboCheckoutBaseAssets@navigation_window","TurboCheckout"):a;b.guardFatal?b.guardFatal(c)(b,window):b.execute(function(){c(b,window)})})(function(c,a,e){c.when("turbo-checkout-page-ready").register("turbo-checkout-navigation-window",function(){function b(){var b=!1;try{try{var d=a.self!==a.parent}catch(f){c.log("Encountered exception while executing inIframe: "+f,"ERROR","turbo-checkout-navigation-window"),
d=!0}d&&a.parent!==e&&"object"===typeof a.parent.P&&a.parent.P.now("icdp").execute(function(a){b=!!a})}catch(f){c.log("Encountered exception while verifying parent Window: "+f,"WARN","turbo-checkout-navigation-window")}return b}function d(){return b()?a.parent:a.self}return{getWindow:d,replace:function(a){d().location.replace(a)},assign:function(a){d().location.assign(a)}}})});
/* ******** */
'use strict';(function(b){var c=window.AmazonUIPageJS||window.P,d=c._namespace||c.attributeErrors,a=d?d("TurboCheckoutBaseAssets@chewbacca_migration_optimistic_flushing","TurboCheckout"):c;a.guardFatal?a.guardFatal(b)(a,window):a.execute(function(){b(a,window)})})(function(b,c,d){b.when().register("turbo-chewbacca-migration-optimistic-flushing",function(){return{isEnabled:function(){return!0}}})});
/* ******** */
'use strict';(function(b){var c=window.AmazonUIPageJS||window.P,d=c._namespace||c.attributeErrors,a=d?d("TurboCheckoutBaseAssets@chewbacca_migration_get_request","TurboCheckout"):c;a.guardFatal?a.guardFatal(b)(a,window):a.execute(function(){b(a,window)})})(function(b,c,d){b.when().register("turbo-chewbacca-migration-get-request",function(){return{isEnabled:function(){return!0}}})});
/* ******** */
'use strict';(function(k){var q=window.AmazonUIPageJS||window.P,B=q._namespace||q.attributeErrors,c=B?B("TurboCheckoutBaseAssets@base","TurboCheckout"):q;c.guardFatal?c.guardFatal(k)(c,window):c.execute(function(){k(c,window)})})(function(k,q,B){"use strict";k.register("turbo-function-adapter",function(){return{adapt:function(c){return function(){if("function"!==typeof c)throw Error("Parameter 'property' is invalid. Expected a function but got "+typeof c);return c.apply(c,arguments)}}}});"use strict";
k.when("turbo-configuration","turbo-function-adapter").execute("turbo-signin-adapter-factory",function(c,a){k.when(c.get(c.KEYS.SHOW_SIGN_IN_INTERFACE)).register("turbo-signin-adapter",function(d){return{show:a.adapt(d.show)}})});"use strict";k.when("turbo-configuration","turbo-function-adapter").execute("turbo-view-adapter-factory",function(c,a){k.when(c.get(c.KEYS.VIEW_ADAPTER)).register("turbo-view-adapter",function(d){return{registerCallbacks:a.adapt(d.registerCallbacks),close:a.adapt(d.close),
show:a.adapt(d.show),removeContent:a.adapt(d.removeContent),setContent:a.adapt(d.setContent),closeImmediatelyThenExecute:a.adapt(d.closeImmediatelyThenExecute),closeAndNavigate:a.adapt(d.closeAndNavigate),closeToFullscreen:a.adapt(d.closeToFullscreen),updateBounds:a.adapt(d.updateBounds),getHeight:a.adapt(d.getHeight),updateMinHeight:a.adapt(d.updateMinHeight),updateScrollHeight:a.adapt(d.updateScrollHeight),updateBottomSheetAttributes:a.adapt(d.updateBottomSheetAttributes),initiateIFrameContent:a.adapt(d.initiateIFrameContent),
appendToIFrameContent:a.adapt(d.appendToIFrameContent),finalizeIFrameContent:a.adapt(d.finalizeIFrameContent)}})});"use strict";k.when("A","turbo-checkout-utils","turbo-checkout-csm","turbo-callback-list","turbo-checkout-form","turbo-configuration","turbo-checkout-weblab-allocation","turbo-checkout-load-events","buy-now-to-tango-parameter-list-retriever","turbo-checkout-page-ready").register("buy-now-to-tango-parameter-eligibility-listener",function(c,a,d,f,e,b,g,l,h){function n(a){var b=D,m=e.getForms(G(x));
m===B||0===m.length?d.logCount("buyNowToTangoCheckoutInvalidBuyNowForm"):(a(m),b!==D&&(r("Buy Now to Tango parameter eligibility state has changed"),!0===D?r("Form corresponding to the Buy Now button is Buy Now to Tango parameter eligible",m):r("Form corresponding to the Buy Now button is NOT Buy Now to Tango parameter eligible",m),E.callAll("buyNowToTangoFormParameterEligibility")))}function m(b){r("Observing child node mutation events on:",b);try{var e=b[0];(new MutationObserver(function(){n(u)})).observe(e,
{childList:!0,subtree:!0})}catch(I){d.logCount("buyNowToTangoCheckoutObserveBuyNowFormException"),a.logWarning("buy-now-to-tango-parameter-eligibility-listener","Exception while attempting to observe the Buy Now Button Form \x3d "+I+". Buy Now Button Form: ",b)}}function u(a){y=A=0;a=!0;for(var b=t(),e=h.getBuyNowToTangoParameterExclusionList(),m=g.getBuyNowToTangoWeblabs(),f=0;f<b.length;f++){var c=b[f];w(c,e,m)||(A++,a=!1,d.logCountSimple("buyNowToTangoCheckoutParameterExcluded:onDetailPageStateChange:"+
c))}D=0<b.length?a:!1}function t(){var a=e.getForms(G(x));if(a===B||0===a.length)d.logCountSimple("buyNowToTangoCheckoutInvalidBuyNowForm");else{a=a.find("input[type\x3dhidden]");for(var b=[],m=0;m<a.length;m++)b.push(a[m].getAttribute("name"));return b}}function w(a,b,e){if(!a)return!0;if(v.test(a)){b=p(a);if(b)if(k.hasOwnProperty(b)){var m=k[b];e=m?"T1"!==e[m]?!0:!1:!1}else e=!0;else e=!1;e?(d.logCountSimple("buyNowToTangoCheckoutParameterIneligibleValue:"+a),r("Buy Now To Tango Ineligible Parameter value observed: "+
a+"\x3d"+b),a=!1):a=!0;return a}if(!b.hasOwnProperty(a))return!0;b=b[a];if(!b)return!1;if("T1"!==e[b])return y++,!1;a:{if(C.hasOwnProperty(a)&&(e=p(a),e!==B&&!(new RegExp(C[a])).test(e?e:""))){d.logCountSimple("buyNowToTangoCheckoutParameterIneligibleValue:"+a);r("Buy Now To Tango Ineligible Parameter value observed: "+a+"\x3d"+e);a=!0;break a}a=!1}return a?!1:!0}function p(a){var b=e.getForms(G(x));if(b!==B&&0!==b.length)if(b=b.find('input[type\x3dhidden][name\x3d"'+a+'"]'),1!==b.length)d.logCountSimple("buyNowToTangoCheckoutParameterMultiInputs:"+
a);else if(a=b[0])return a.getAttribute("value")}function z(a,b){return a.every(function(a){return 0<=b.indexOf(a)})}function r(b,e){a.logDebug("buy-now-to-tango-parameter-eligibility-listener",b,e)}var x=b.get(b.KEYS.BUY_NOW_BUTTON_SELECTOR),v=new RegExp(/^custom-name\.\d+\.\d+$/),C={},k={itemAssoc:"PAX_CHECKOUT_VAS_ENABLE_BUY_NOW_TANGO_1165794","UNIQ-itemAssoc":"PAX_CHECKOUT_VAS_ENABLE_BUY_NOW_TANGO_1165794",itemAssocType:"PAX_CHECKOUT_VAS_ENABLE_BUY_NOW_TANGO_1165794",itemAssociationGroup:"PAX_CHECKOUT_VAS_ENABLE_BUY_NOW_TANGO_1165794",
itemAssocRenderType:"PAX_CHECKOUT_VAS_ENABLE_BUY_NOW_TANGO_1165794",incentivizedCart:"",isDevicePreRegistered:"PAX_CHECKOUT_ALC_BUY_NOW_TANGO_1185935"},G=c.$,E=f.create(),D=!1,A=0,y=0;l.bind(function(){b.get(b.KEYS.IS_BUY_NOW_TO_TANGO_ENABLED)&&n(function(a){u(a);m(a)})});return{onStateChange:function(a){E.push(a)},isBuyNowToTangoParameterEligible:function(){return D},logBuyNowFormParameterExclusionsAndFeatures:function(){for(var a=t(),e=b.get(b.KEYS.BUY_NOW_TO_TANGO_PARAMETER_TO_FEATURE_MAPPING),
m={},f=0;f<a.length;f++){var c=a[f],p=c;h.getBuyNowToTangoParameterExclusionList().hasOwnProperty(p)&&(d.logCountSimple("buyNowToTangoCheckoutParameterExcluded:onBuyNowButtonClick:"+c),e.hasOwnProperty(c)||(d.logCountSimple("buyNowToTangoCheckoutParameterExcluded:onBuyNowButtonClick:Unknown"),r("Buy Now To Tango Unknown Parameter Observed: "+c)),p="Unknown",e.hasOwnProperty(c)&&""!==e[c]&&(p=e[c]),m[p]=!0)}for(var g in m)m.hasOwnProperty(g)&&d.logCountSimple("buyNowToTangoCheckoutParameterExcluded:Feature:"+
g);e=b.get(b.KEYS.BUY_NOW_TO_TANGO_FEATURE_PARAMETER_GROUP_MAPPING);m=!1;for(var u in e)e.hasOwnProperty(u)&&z(e[u],a)&&(d.logCountSimple("buyNowToTangoCheckoutParameterExcluded:FeatureByGrouping:"+u),m=!0);m||d.logCountSimple("buyNowToTangoCheckoutParameterExcluded:FeatureByGrouping:Unknown")},isBuyNowToTangoParameterIneligibleOnlyDueToNonT1WeblabAllocation:function(){return 0!==A&&A===y}}});"use strict";k.when("A","turbo-checkout-form","turbo-checkout-utils","turbo-checkout-state-handler","turbo-checkout-content-loader",
"turbo-checkout-weblab-allocation","turbo-configuration","turbo-checkout-load-events","turbo-checkout-eligible-state","turbo-checkout-buy-now-button","buy-now-to-tango-parameter-eligibility-listener","buy-now-to-tango-switch","turbo-checkout-weblab-allocation","turbo-checkout-csm","turbo-checkout-page-ready").register("buy-now-to-tango-url-handler",function(c,a,d,f,e,b,g,l,h,n,m,u,t,w){function p(){!f.isProductTangoEligible()||h.canShow()&&!b.isDisableTurboWeblabInTreatment()?(D("Remove customer eligibility check for BuyNow is in T1: Turbo eligible or Tango InEligible. Calling Tango Ineligible callbacks "),
r()):(D("Remove customer eligibility check for BuyNow is in T1: Turbo Ineligible and Tango Eligible. Flipping the BuyNow URL to Tango "),z())}function z(){q=!0;m.isBuyNowToTangoParameterEligible()&&C()}function r(){q=!1;b.isBuyNowToTangoCustomerEligibilityCheckRemovalWeblabInTreatment()&&v()}function x(){q&&(m.isBuyNowToTangoParameterEligible()&&!I?(I=!0,C()):(I=!1,D("Handle tango ineligible and update form action url to the fallback url"),K=!1,n.deregisterOnClickCallback(k),B=!1))}function v(){!K||
h.canShow()&&!b.isDisableTurboWeblabInTreatment()?(n.deregisterOnClickCallback(k),B=!1):(n.registerOnClickCallback(k),B=!0)}function C(){K=!0;h.canShow()&&!b.isDisableTurboWeblabInTreatment()?D("Tango eligible but Turbo being eligible takes precedence when handling URL"):(n.registerOnClickCallback(k),B=!0)}function k(){var b=a.getForms(A(y));if("T1"===t.getBuyNowToTangoWeblabs().PAX_CHECKOUT_BUY_NOW_TO_TANGO_REMOVE_LEGACY_PIPELINE_PARAMETER_1125072)if(b){var e=b.find('input[name\x3d"pipelineType"]');
if(e&&0<e.length){e.remove();e=e.val();D("the original pipelineType is: "+e);var d=a.getRefTag(A(y));w.logCountSimple("buynowToTangoRemoveLegacyPipelineParameterForDesktop:"+e+":"+d);w.logCount("buynowToTangoTotalRemoveLegacyPipelineParameterTotalForDesktop")}}else D("No buyNowButton form found");b.append(G(a.getRefTag(A(y))));b.attr("action","/checkout/entry/buynow");b.submit();return!1}function G(a){var b=document.createDocumentFragment();b.appendChild(E("pipelineType","Chewbacca"));b.appendChild(E("referrer",
F));b.appendChild(E("isBuyNow","1"));b.appendChild(E("ref_",(a||"unknown_buy_now")+"_chw"));return b}function E(a,b){var e=document.createElement("input");e.type="hidden";e.className="buy-now-to-tango-migration-request-param";e.name=a;e.value=b;return e}function D(a,b){d.logDebug("buy-now-to-tango-url-handler",a,b)}var A=c.$,y=g.get(g.KEYS.BUY_NOW_BUTTON_SELECTOR),F=g.get(g.KEYS.HOST_PAGE_TYPE_IDENTIFIER),q=!1,I=!1,K=!1,B=!1;l.bind(function(){u.isEnabled()&&(b.isBuyNowToTangoCustomerEligibilityCheckRemovalWeblabInTreatment()&&
p(),e.registerCallback({onTangoEligible:z,onTangoIneligible:r}),m.onStateChange(x),h.registerStateChangeCallback(v))});return{_forTestOnly:{_setTangoAsinCustomerEligibleAndCheckBuyNowToTangoParameterEligibility:z,_onBuyNowToTangoParameterEligibilityChange:x,_onTurboEligibilityChange:v,_overrideBuyNowButtonFormAttributesAndSubmit:k,_validateAndSetTangoEligibilityState:p},isBuyNowToTangoEligible:function(){return K},isTangoCustomerAndAsinEligible:function(){return q},isBuyNowClickPointingToTango:function(){return B}}});
"use strict";k.when("A","turbo-checkout-utils","turbo-configuration","turbo-checkout-form","buy-now-to-tango-switch","buy-now-to-tango-switch-beta","turbo-checkout-buy-now-button","turbo-checkout-eligible-state","turbo-checkout-weblab-allocation","turbo-checkout-state-handler","buy-now-to-tango-url-handler","turbo-checkout-urls","turbo-checkout-weblab-trigger","buy-now-to-tango-parameter-eligibility-listener","turbo-checkout-csm","buy-now-to-tango-parameter-list-retriever","turbo-checkout-page-ready").register("buy-now-to-tango-weblab-trigger",
function(c,a,d,f,e,b,g,l,h,n,m,u,t,w,p,z){function r(){!l.canShow()&&m.isBuyNowClickPointingToTango()?p.logCountSimple("BUY_NOW_TO_TANGO_HIT"):l.canShow()||!e.isEnabled()||b.isGatingWeblabEnabled()||(p.logCountSimple("BUY_NOW_TO_TANGO_EXCLUDED"),w.isBuyNowToTangoParameterEligible()||(p.logCountSimple("BUY_NOW_TO_TANGO_EXCLUSION_REASON:Parameter"),w.logBuyNowFormParameterExclusionsAndFeatures()),n.isProductTangoEligible()||p.logCountSimple("BUY_NOW_TO_TANGO_EXCLUSION_REASON:ASIN"),n.isProductTangoEligible()&&
!m.isTangoCustomerAndAsinEligible()&&p.logCountSimple("BUY_NOW_TO_TANGO_EXCLUSION_REASON:Customer"));var a=x(v);a=f.getForms(a);if(a===B||0===a.length)return!1;var d=!l.canShow(),c=m.isTangoCustomerAndAsinEligible();if(d&&c&&e.isEnabled()&&!b.isGatingWeblabEnabled()){a:{a=a.find("input[type\x3dhidden]");b:{d=z.getBuyNowToTangoParameterExclusionList();c=[];for(var g=0;g<a.length;g++){var r=a[g].getAttribute("name");if(r&&d.hasOwnProperty(r)){r=d[r];if(!r){a=[];break b}0>c.indexOf(r)&&c.push(r)}}a=
c}if(0===a.length)p.logCountSimple("NO_BUY_NOW_TO_TANGO_PARAMETER_WEBLABS"),a=[];else{d=h.getBuyNowToTangoWeblabs();c=0;g="";for(r=0;r<a.length;r++){var k=a[r];if(!d.hasOwnProperty(k)||""===d[k]||null===d[k]){p.logCountSimple("BUY_NOW_TO_TANGO_WEBLAB_TRIGGER:"+k+d.hasOwnProperty(k)?"HAS_NO_ALLOCATION":"DOES_NOT_EXIST");a=[];break a}"C"===d[k]&&(c++,g=k)}r=[];if(0===c){for(c=0;c<a.length;c++)g=a[c],r.push({weblabName:g,weblabAllocation:d[g]}),p.logCountSimple("BUY_NOW_TO_TANGO_WEBLAB_TRIGGER:"+g+":T1");
m.isBuyNowClickPointingToTango()||p.logCountSimple("BUY_NOW_TO_TANGO_WEBLAB_TRIGGERED_T1_BUT_URL_DID_NOT_FLIP")}else 1===c&&(r.push({weblabName:g,weblabAllocation:"C"}),p.logCountSimple("BUY_NOW_TO_TANGO_WEBLAB_TRIGGER:"+g+":C"),m.isBuyNowClickPointingToTango()&&p.logCountSimple("BUY_NOW_TO_TANGO_TRIGGERED_C_BUT_URL_FLIPPED"));a=r}}0<a.length&&(d=u.buildTriggerWeblabPathWithoutWeblab(n.getRefTag(),n.getRequestId(),n.getSessionId()),t.sendTurboWeblabRequest(d,a))}return!1}var x=c.$,v=d.get(d.KEYS.BUY_NOW_BUTTON_SELECTOR);
return{registerBuyNowToTangoTriggerOnButton:function(){g.registerOnClickCallback(r)},_forTestOnly:{_triggerBuyNowToTangoExperimentWeblabs:r}}});"use strict";k.when("turbo-checkout-page-ready").execute(function(){k.declare("turbo-eligibility-override",!1)});"use strict";k.when("turbo-checkout-page-state","turbo-configuration","turbo-checkout-utils","turbo-checkout-csm","turbo-checkout-page-ready").register("buy-now-to-tango-parameter-list-retriever",function(c,a,d,f){return{getBuyNowToTangoParameterExclusionList:function(){if(!1===
a.get(a.KEYS.IS_BUY_NOW_TO_TANGO_PRIME_SPLIT))return a.get(a.KEYS.BUY_NOW_TO_TANGO_PARAMETER_EXCLUSION_LIST);var e=c.get().isPrimeCustomer;if(!0===e)return a.get(a.KEYS.BUY_NOW_TO_TANGO_PARAMETER_EXCLUSION_LIST_PRIME);if(!1===e)return a.get(a.KEYS.BUY_NOW_TO_TANGO_PARAMETER_EXCLUSION_LIST_NON_PRIME);f.logCountSimple("buyNowToTangoCheckoutTurboStateIsPrimeCustomerUndefined:getBuyNowToTangoParameterExclusionList");throw Error("getBuyNowToTangoParameterExclusionList(): Unable to determine if prime customer or not as Turbo page state's isPrimeCustomer attribute is not true or false, but: "+
e);}}});"use strict";k.when("A","turbo-checkout-csm","turbo-configuration","turbo-checkout-page-ready").register("turbo-checkout-address-id",function(c,a,d){function f(b){for(var d=0;d<b.length;d++){var c=e(b[d]);if(0<c.length)return a.logCount("turboCheckoutAddressSelectorIndex"+d),c}a.logCount("turboCheckoutAddressSelectorMissing");return e()}var e=c.$;return{getAddressId:function(){return f(d.get(d.KEYS.ADDRESS_INPUT_SELECTORS)).val()||""},set:function(a){f(d.get(d.KEYS.ADDRESS_INPUT_SELECTORS)).val()!==
a&&f(d.get(d.KEYS.ADDRESS_INPUT_SELECTORS)).val(a).trigger("change",[a])}}});"use strict";k.when("A","turbo-checkout-utils","turbo-callback-list","turbo-configuration","turbo-checkout-load-events","turbo-checkout-page-ready").register("turbo-checkbox-exclusion-listener",function(c,a,d,f,e){function b(a){var b=t;t=!1;for(var e=0;e<n.length;e++){var d=m(n[e]).find("input[type\x3dcheckbox]");a(d)}b!==t&&(l("Exclusion checkbox state changed"),u.callAll("exclusionCheckbox"))}function g(a){var b;if(!(b=
t)){b=!1;for(var e=0;e<a.length&&!b;e++){var d=m(a[e]);(b=d.prop("checked"))&&l("Exclusion checkbox is checked",d)}}t=b}function l(b,e){a.logDebug("turbo-checkbox-exclusion-listener",b,e)}function h(){b(g)}var n=f.get(f.KEYS.CHECKBOX_EXCLUSION_ROOT_NODES),m=c.$,u=d.create(),t=!1;e.bind(function(){b(function(a){l("Listening for change events on:",a);a.unbind("change",h).bind("change",h);g(a)})});return{onStateChange:function(a){u.push(a)},isAnyCheckboxChecked:function(){return t}}});"use strict";k.when("A",
"turbo-callback-list","turbo-checkout-load-events","turbo-checkout-page-ready").register("turbo-checkout-custom-price-input",function(c,a,d){function f(){var a=e();l!==a&&(l=a,g.callAll())}function e(){return b("#gcPriceOverride").val()||""}var b=c.$,g=a.create(),l;d.bind(function(){l=e();b("#gcPriceOverride").unbind("change",f).bind("change",f)});return{getCustomPrice:e,onChange:function(a){g.push(a)}}});"use strict";k.when("A","turbo-checkout-csm","turbo-checkout-utils","turbo-configuration","turbo-callback-list",
"turbo-checkout-load-events","turbo-checkout-page-ready").register("turbo-checkout-quantity-input",function(c,a,d,f,e,b){function g(a){var b=a?a.value?parseInt(a.value,10):a.target&&a.target.value?parseInt(a.target.value,10):void 0:void 0;t===b?d.logDebug("turbo-checkout-quantity-input","Quantity change event does NOT have new quantity. Suppressing callbacks",void 0):(t=b,d.logDebug("turbo-checkout-quantity-input","Quantity change event",a),n.callAll())}function l(b){b=b.val();(b=parseInt(b,10))||
a.logCount("turboCheckoutNoQuantityFromPage");return b}var h=c.$,n=e.create(),m=f.get(f.KEYS.QUANTITY_SELECT_SELECTOR),u="Multiple quantity nodes present on the page. This may lead to an incorrect quantity being used in Turbo! Selector \x3d "+m,t;b.bind(function(){var b=h(m);t=l(b);b.unbind("change",g).bind("change",g);1<b.length&&(d.logError(u,"turbo-checkout-quantity-input"),d.logDebug("turbo-checkout-quantity-input",u,b));a.logCount("turboCheckoutQuantityNodes",b.length)});return{getQuantity:function(){return l(h(m))},
setQuantity:function(a){var b=h(m),e=l(b);a=parseInt(a,10);e!==a&&b.val(a).change()},onChange:function(a){n.push(a)}}});"use strict";k.when("A","turbo-checkout-csm","turbo-checkout-utils","turbo-callback-list","turbo-configuration","turbo-checkout-quantity-input","turbo-checkout-load-events","turbo-checkout-page-ready").register("turbo-checkout-warranty-input",function(c,a,d,f,e,b,g){var l=c.$,h=f.create(),n=e.get(e.KEYS.WARRANTY_CHECKBOX_INPUT_SELECTOR),m=e.get(e.KEYS.WARRANTY_CHECKBOX_RELATIVE_PARENT_SELECTOR),
u=e.get(e.KEYS.WARRANTY_ASIN_INPUT_NAME),t=e.get(e.KEYS.WARRANTY_OFFER_INPUT_SELECTOR);g.bind(function(){l(n).unbind("click",h.callAll).bind("click",h.callAll)});return{select:function(a){a&&l(m+" input[name^\x3d"+u+"][value\x3d"+a+"]").parents(m).find(n).click()},onChange:function(a){h.push(a)},getLineItem:function(e){if(l(n+":checked").length){var c=l(n+":checked").first().parents(m).find("input[name^\x3d"+u+"]").val()||"",f=l(t).val()||"";e=parseInt(e,10)||b.getQuantity()||1;if(c&&f)return{asin:c,
offerListingId:f,quantity:e,isDiscoveredAsin:!0};a.logCount("turboCheckoutIncompleteWarrantyInputs");d.logError("Incomplete input data for the selected warranty checkbox - asin:"+c+", offerId:"+f+", quantity:"+e)}else d.logDebug("turbo-checkout-warranty-input","No warranty checkbox is selected",void 0)}}});"use strict";k.when("A","turbo-checkout-csm","turbo-callback-list","turbo-configuration","turbo-checkout-load-events","turbo-checkout-page-ready").register("turbo-checkout-vas-input",function(c,
a,d,f,e){function b(){return n(l).prop("checked")||!1}function g(){var a=u;u=b();a!==u&&m.callAll(u)}var l=f.get(f.KEYS.VAS_CHECKBOX_SELCTOR),h=f.get(f.KEYS.VAS_CHANGE_EVENTS),n=c.$,m=d.create(),u;e.bind(function(){u=b();h.forEach(function(a){c.off(a,g);c.on(a,g)})});return{isSelected:b,onChange:function(a){m.push(a)}}});"use strict";k.when("A","turbo-checkout-utils","turbo-callback-list","turbo-checkout-load-events","turbo-checkout-csm","turbo-checkout-aui-page-state-parser","turbo-configuration",
"turbo-checkout-page-ready").register("turbo-checkout-accessories-input",function(c,a,d,f,e,b,g){function l(){var a=r;r=w();r!==a&&z.callAll()}function h(){if(x===B&&p(v).length){var a=b.parse("simpleBundleParameterMap",".simpleBundleFeatureContainer");0===a.length?(e.logCount("Turbo:Accessories:No:State"),x={}):n(a)}}function n(a){x={};a[0].items.forEach(function(a){x[a.asin]={asin:a.asin,offerListingId:a.offerListingId,isDiscoveredAsin:!0}})}function m(){return p(v).find("input[type\x3dcheckbox]")}
function u(){m().unbind("change",l).bind("change",l)}function t(){return p(v).length?1>=r:0===r}function w(){var b=0;m().each(function(){p(this).prop("checked")&&b++});a.logDebug("turbo-checkout-accessories-input","Accessories selected "+b);return b}var p=c.$,z=d.create(),r=0,x,v=g.get(g.KEYS.ENABLED_ACCESSORIES_SELECTOR);h();u();f.bind(function(){h();u();w()});return{isEligible:t,registerCallback:function(a){z.push(a)},getLineItem:function(){if(t()){var a=m().filter(":checked").val();a=x?x[a]:void 0;
return a||B}return B},select:function(a){a&&p(v+" input[type\x3dcheckbox][value\x3d"+a+"]").click()}}});"use strict";k.when("A","turbo-checkout-csm","turbo-configuration","turbo-checkout-page-ready").register("turbo-checkout-session-id-input",function(c,a,d){var f=c.$;return{getSessionId:function(){var e=f(d.get(d.KEYS.SESSION_ID_SELECTOR));e&&0<e.length||(a.logCount("turboCheckoutSessionIdSelectorMissing"),e=f());return e.val()||""}}});"use strict";k.when("A","turbo-checkout-csm","turbo-checkout-utils",
"turbo-configuration","turbo-checkout-aui-page-state-parser","turbo-checkout-page-ready").register("java-checkout-url-page-state",function(c,a,d,f,e){function b(a,b){this.javaCheckoutUrl=a;this.javaCheckoutQueryParams=b}function g(a,b){d.logDebug("java-checkout-url-page-state",a,b)}var l=f.get(f.KEYS.JAVA_CHECKOUT_URL_PAGE_STATE_KEY),h=f.get(f.KEYS.JAVA_CHECKOUT_URL_PAGE_STATE_PARSING_ROOT_NODE_SELECTOR),n=new b("",{});return{get:function(d,c){d=d||l;c=c||h;c=e.parse(d,c);a.logCount("javaCheckoutUrlPageStates",
c.length);0===c.length?(g("Java checkout url page state ["+d+"] is NOT present"),d=void 0):d=c[0];d?d=new b(d.javaCheckoutUrl,d.javaCheckoutQueryParams):(a.logCount("javaCheckoutUrlPageStateNotDefined"),d=n);g("Java Checkout Url PageState",d);return d}}});"use strict";k.when("A","turbo-checkout-csm","turbo-checkout-utils","turbo-checkout-form","turbo-checkout-ref-tagger","turbo-checkout-page-state","turbo-checkout-product-state","turbo-checkout-page-ready").register("turbo-checkout-joined-state",
function(c,a,d,f,e,b,g){function l(a,b,e){b&&(e&&(b.quantity=e),a.push(b))}function h(b,d){function m(){var d=b.turboWeblab;d||a.logCount("turboCheckoutWeblabNameNotDefinedInState");return d}function g(){return b.turboWeblabTreatment}this.pageState=b;this.productStates=d;this.getLineItems=function(){return h.lineItemInputs};this.getActiveId=function(){return h.id};this.getHeaderText=function(){return h?h.turboHeaderText||b.turboHeaderText:b.turboHeaderText};this.getLoadingText=function(){return b.turboLoadingText};
this.getCloseText=function(){return b.turboCloseText};this.getAddressId=function(){return b.addressId};this.getRequestId=function(){return b.requestId};this.getSessionId=function(){return b.sessionId};this.getAdditionalWeblabs=function(){return b.additionalWeblabs};this.getInitiateSelector=function(){return b.initiateSelector};this.getWeblab=m;this.getWeblabTreatment=g;this.isTurboLaunched=function(){return!m()&&"C"!==g()};this.isProductStateEligible=function(){return d.isTurboEligible};this.getRefTag=
function(){if(!h)throw Error("Turbo checkout product state is NOT resolved. Cannot generate ref tag");var a=c.$("#"+h.id);a=f.getRefTag(a);return e.generateJoinedValue(a)};this.getCSRFToken=function(){return b.csrfToken};this.getClientId=function(){return h&&h.checkoutClientId?h.checkoutClientId:"retailwebsite"};this.resolve=function(a){if(a){h=d.states[a];if(!h)throw a="Resolved turbo checkout product state is undefined. Id \x3d "+a,n(a,d),Error(a);n("Resolved new product state",h);c.trigger("turbo:checkout:state:product:resolved")}};
this.getHoldbackSecondaryPanelsWeblab=function(){return b.holdbackSecondaryPanelsWeblab};this.isPrimeCustomer=function(){return b.isPrimeCustomer};var h=1!==d.states.length?B:d.states[0]}function n(a,b){d.logDebug("turbo-checkout-joined-state",a,b)}return{createTurboState:function(d,e,c,f,n,z){if(f&&c)throw Error("Custom item price is NOT supported with warranty");var m=b.get();e&&(m.addressId=e);e=g.get();if(d||f||c||z)d=parseInt(d,10),e.states.forEach(function(b){b.lineItemInputs.forEach(function(b){d&&
(b.quantity=d);f?(b.customItemPrice=f,a.logCount("turboCheckoutItemPriceOverrided")):b.customItemPrice&&a.logCount("turboCheckoutItemPriceSelectorFallBackToTurboState")});l(b.lineItemInputs,z,d);l(b.lineItemInputs,c,d)});m=new h(m,e);m.resolve(n);return m}}});"use strict";k.when("A","turbo-checkout-csm","turbo-checkout-utils","turbo-configuration","turbo-checkout-aui-page-state-parser","turbo-constants","turbo-checkout-page-ready").register("turbo-checkout-page-state",function(c,a,d,f,e,b){function g(a,
d,e,c,f,h,g,m,n,l,u,k,A,y,F,q){this.version=a;this.turboWeblab=d;this.turboWeblabTreatment=e;this.initiateSelector=c;this.turboLoadingText=f;this.turboHeaderText=h;this.turboCloseText=g;this.addressId=m;this.requestId=n;this.sessionId=l;this.csrfToken=u;this.turboAssetsMode=k;this.isJavaPipelineEligible="0"!==this.version&&this.turboAssetsMode!==b.ASSET_MODE_TURBO_ONLY;this.additionalWeblabs=A;this.holdbackSecondaryPanelsWeblab=y;this.isTangoCheckoutEligible=F;this.isPrimeCustomer=q}function l(a,
b){d.logDebug("turbo-checkout-page-state",a,b)}var h=f.get(f.KEYS.TURBO_PAGE_STATE_KEY),n=f.get(f.KEYS.PAGE_STATE_PARSING_ROOT_NODE_SELECTOR),m=f.get(f.KEYS.LEGACY_SESSION_ID_IDENTIFIER),u=new g("0","","C","#buy-now-button","","","","","","","",b.ASSET_MODE_TURBO_ONLY,"","",!1,!1);return{get:function(c,f){b:{c=c||h;f=f||n;f=e.parse(c,f);a.logCount("turboCheckoutPageStates",f.length);if(1<f.length)d.logError("Multiple turbo checkout page states found! Turbo will NOT show","turbo-checkout-page-state",
void 0),l("PageStates",f);else if(0===f.length)l("Turbo checkout page state ["+c+"] is NOT present");else{c=f[0];break b}c=void 0}if(c)if(c.version)c=new g(c.version,c.turboWeblab||"",c.turboWeblabTreatment||"C",c.initiateSelector||".buy-now-button",c.turboLoadingText||"",c.turboHeaderText||"",c.turboCloseText||"",c.addressId||"",c.requestId||"",c.sessionId||"",c.csrfToken||"",c.turboAssetsMode||b.ASSET_MODE_TURBO_ONLY,c.additionalWeblabs||"{}",c.holdbackSecondaryPanelsWeblab||"{}",c.isTangoCheckoutEligible||
!1,c.isPrimeCustomer||!1);else{f=c.inputs||{};var p=c.strings||{};c=new g("1",c.turboWeblab||"",c.turboWeblabTreatment||"C",(c.configurations||{}).initiateSelector||"#buy-now-button",p.TURBO_LOADING_TEXT||"",p.TURBO_CHECKOUT_HEADER||"",p.TURBO_CLOSE_TEXT||"",f.addressId||"",f.requestId||"",f.sessionId||f[m]||"",c.csrfToken||"",c.turboAssetsMode||b.ASSET_MODE_TURBO_ONLY,c.additionalWeblabs||"{}",c.holdbackSecondaryPanelsWeblab||"{}",c.isTangoCheckoutEligible||!1,c.isPrimeCustomer||!1)}else a.logCount("turboCheckoutStateNotDefined"),
c=u;l("Turbo Checkout PageState",c);return c}}});"use strict";k.when("A","turbo-checkout-csm","turbo-checkout-utils","turbo-configuration","turbo-checkout-aui-page-state-parser","turbo-checkout-page-ready").register("turbo-checkout-product-state",function(c,a,d,f,e){function b(a,b){this.isTurboEligible=a;this.states=b}function g(a,b,d,e,c){this.id=a;this.isTurboEligible=b;this.lineItemInputs=d;this.turboHeaderText=e||"";this.checkoutClientId=c}function l(a,b,d,e,c,f,h,g,m,n,l){this.asin=b||"";this.offerListingId=
d||"";this.quantity=parseInt(e,10)||1;this.isTurboEligible=!!this.asin&&!!this.offerListingId&&a;this.productTitle=c||"";this.incentivizedCart=f||"";this.customItemPrice=h||"";this.addToCartTimeAsUnixEpochMilliseconds=g||"";this.addToCartSessionId=m||"";this.isDiscoveredAsin=!!n;this.concealmentEligibilityType=l||""}function h(a,b){d.logDebug("turbo-checkout-product-state",a,b)}function n(a){if(!a.lineItemInputs||!a.lineItemInputs.length||!a.id)return h('Versioned product state is invalid. Expected non empty "id" and "lineItemInputs". Turbo may NOT show',
a),t;var b=!0,d=c.map(a.lineItemInputs,function(a){a=new l(a.isTurboEligible,a.asin,a.offerListingId,a.quantity,a.productTitle,a.incentivizedCart,a.customItemPrice,a.addToCartTimeAsUnixEpochMilliseconds,a.addToCartSessionId,a.isDiscoveredAsin,a.concealmentEligibilityType);b=b&&a.isTurboEligible;return a});return new g(a.id,b,d,a.turboHeaderText,a.checkoutClientId)}var m=f.get(f.KEYS.TURBO_PRODUCT_STATE_KEY),u=f.get(f.KEYS.PRODUCT_STATE_PARSING_ROOT_NODE_SELECTOR),t=new g("buy-now-button",!1,[],"",
"retailwebsite"),k=new b(!1,[t]);return{get:function(c,f){c=c||m;f=f||u;f=e.parse(c,f);a.logCount("turboCheckoutProductStates",f.length);1<f.length&&"turbo-checkout-page-state"===c?(d.logError("turbo-checkout-page-state only supports the single item use case! Turbo will NOT show","turbo-checkout-product-state",void 0),c=[]):c=f;if((f=c)&&f.length){var p=!1;c=[];for(var z=0;z<f.length;z++){var v=f[z];if(v)if(v.version)var w=n(v);else v.inputs&&v.eligibility?(w=v.strings||{},v=new l(v.eligibility.isEligible,
v.inputs.a,v.inputs.oid,v.inputs.quantity,w.TURBO_CHECKOUT_HEADER,v.inputs.incentivizedCart,v.inputs.customItemPrice,v.inputs.concealmentEligibilityType),w=new g("buy-now-button",v.isTurboEligible,[v],w.TURBO_CHECKOUT_HEADER,"retailwebsite")):(h('Legacy product state is missing "inputs" or "eligibility". Turbo will NOT show',v),w=t);else h("Product state parsed DOM object is invalid. Turbo may NOT show",v),w=t;p=p||w.isTurboEligible||!1;v=w.id;if(c[v])throw f="Duplicate product state found. id \x3d "+
v,h(f,c),Error(f);c.push(w);c[w.id]=w}c=new b(p,c)}else h("Parsed states are invalid. Turbo will NOT show",f),c=k;h("Turbo Checkout Product State(s)",c);return c}}});"use strict";k.when("A","turbo-configuration","turbo-checkout-csm","turbo-checkout-utils","turbo-checkout-auto-open","turbo-checkout-address-id","turbo-checkout-quantity-input","turbo-checkout-warranty-input","turbo-checkout-custom-price-input","turbo-callback-list","turbo-checkout-joined-state","turbo-checkout-accessories-input","turbo-checkout-session-id-input",
"turbo-checkout-page-state","buy-now-to-tango-switch","turbo-checkout-page-ready").register("turbo-checkout-state-handler",function(c,a,d,f,e,b,g,l,h,n,m,u,t,k,p){function z(a,d,e,c,f,n){a=a||g.getQuantity();d=d||b.getAddressId();e=e||l.getLineItem(a);c=c||h.getCustomPrice();n=n||u.getLineItem();return m.createTurboState(a,d,e,c,f,n)}function r(a,b){f.logDebug("turbo-checkout-state-handler",a,b)}function w(a,b){f.logWarning("turbo-checkout-state-handler",a,b)}function v(a,b,d,e,c){y=z(a,b,d,B,e,c)}
function C(){c.trigger("turbo:checkout:product:onChange");D.callAll()}function q(){var a=z();f.isDeepEquals(y,a)||(y=a,r("New Turbo State",y),C())}var G=c.$,E=a.get(a.KEYS.AJAX_PAGE_UPDATE_EVENT),D=n.create(),A=!1;var y=z();return{isProductTurboEligible:function(){return!A&&y.isProductStateEligible()||a.get(a.KEYS.OVERRIDE_ELIGIBILITY)},isProductTangoEligible:function(){return p.isEnabled()&&k.get().isTangoCheckoutEligible},getLineItems:function(){return y.getLineItems()},getAddressId:function(){return y.getAddressId()},
getWeblabAllocation:function(){return y.getWeblabTreatment()},registerCallback:function(a){D.push(a)},startMonitoringPage:function(){e.updateInputsAndThen(v);g.onChange(q);l.onChange(q);h.onChange(q);u.registerCallback(q);c.off(E,q);c.on(E,q);C()},getRequestId:function(){return y.getRequestId()},getSessionId:function(){return y.getSessionId()},getExperimentName:function(){return y.getWeblab()},getPrimeStatus:function(){return y.isPrimeCustomer()},getAdditionalWeblabAndTreatmentMap:function(){try{var a=
y.getAdditionalWeblabs();""===a&&d.logCount("turboStateAdditionalWeblabsEmptyString");var b=JSON.parse(a);return b===B?(d.logCount("turboCheckoutParseAdditionalWeblabsUndefined"),w("JSON::parsed additionalWeblabs as undefined for weblabs: ["+a+"]"),{}):b}catch(I){return d.logCount("turboCheckoutParseAdditionalWeblabsException"),w("JSON::parse exception on additionalWeblabs: ["+y.getAdditionalWeblabs()+"]. Exception \x3d "+I),{}}},getStrings:function(){return{TURBO_LOADING_TEXT:y.getLoadingText(),
TURBO_CHECKOUT_HEADER:y.getHeaderText(),TURBO_CLOSE_TEXT:y.getCloseText()}},getInitiateSelector:function(){return y.getInitiateSelector()},isTurboLaunched:function(){return y.isTurboLaunched()},isPhysicalGiftCardExperimentEligible:function(){var a=0!==G("#giftcardcustomtwister_feature_div").length;a&&(r("Physical Gift Card use case"),d.logCount("turboCheckoutGiftCardUseCase"));return a},setTurboStateNotEligible:function(){A=!0},resolveProductState:function(a){y.resolve(a)},getActiveId:function(){return y.getActiveId()},
getRefTag:function(){return y.getRefTag()},getCSRFToken:function(){var a;(a=y.getCSRFToken())||(a=(a=y.getSessionId())&&0<a.length?a:t.getSessionId());a=a||"";if(!a||0>=a.length)w("CSRF Token is empty. This will result in denied requests."),d.logCount("turboCheckoutNoValidCSRFToken");return a},getClientId:function(){return y.getClientId()},getHoldbackSecondaryPanelsWeblab:function(){try{return JSON.parse(y.getHoldbackSecondaryPanelsWeblab())}catch(F){d.logCount("turboCheckoutParseHoldbackSecondaryPanelsWeblabException"),
w("JSON::parse exception. Exception \x3d "+F)}}}});"use strict";k.when("A","turbo-checkout-utils","turbo-checkout-page-ready").register("turbo-checkout-aui-page-state-parser",function(c,a){var d=c.$;return{parse:function(c,e){c="script[data-a-state*\x3d'"+c+"'], #"+c;e=e?d(e).find(c):d(c);c=[];for(var b=0;b<e.length;b++){a:{try{var f=d(e[b]).text();var l=JSON.parse(f);break a}catch(h){a.logError("JSON::parse exception. Exception \x3d "+h,"turbo-checkout-aui-page-state-parser",void 0)}l=void 0}l&&
c.push(l)}return c}}});"use strict";k.when("A","turbo-checkout-page-state","turbo-checkout-csm","turbo-checkout-state-handler","tango-checkout-urls","turbo-checkout-page-ready").register("tango-checkout-eligibility",function(c,a,d,f,e){function b(){var a={},b=f.getAddressId();b&&(a.addressID=b);return a}function g(a){m();n(!1);t=null;a&&a.isTangoEligible?(d.logCount("tangoCheckoutCustomerEligible"),w&&w()):(h(""),d.logCount("tangoCheckoutCustomerNotEligible"),p&&p())}function l(a,b,e){m();n(!1);"timeout"===
b&&d.logCount("tangoCheckoutCustomerEligibilityCallFailedWithTimeOut");t=null;h("");d.logCount("tangoCheckoutCustomerEligibilityCallFailed")}function h(a){k.when("ready").execute(function(){c.state("checkout-url-migration-page-state",{checkoutUrl:a})})}function n(a){c.state("checkout-url-migration-page-state",{ajaxEligibilityInProgress:a})}function m(){var a=(new Date).getTime()-u;d.logCount("tangoCheckoutCustomerEligibilityTime",a)}var u,t,w,p;return{setEligibleCallback:function(a){w=a},setIneligibleCallback:function(a){p=
a},isEligibleFromPageState:function(){return a.get().isJavaPipelineEligible},checkEligibility:function(){u=(new Date).getTime();t&&(t.abort(),t=null);var a=e.buildEligibilityPathWithParams();n(!0);t=c.$.ajax(a,{type:"POST",data:b(),success:g,error:l})},setTangoPageStateUrl:h,setEligibilityAJAXInProgress:n}});"use strict";k.when("A","turbo-configuration","turbo-shopping-portal-switch","java-checkout-url-page-state","turbo-checkout-page-ready").register("tango-checkout-urls",function(c,a,d,f){function e(a){return 0===
a.length?"":"?"+a.join("\x26")}function b(a,b){var d=[],e;for(e in a)if(a.hasOwnProperty(e)){var c=a[e];if(b){var f=e;var h=document.createElement("input");h.type="hidden";h.className="checkout-url-migration-request-param";h.name=f;h.value=c;f=h}else f=e+"\x3d"+c;d.push(f)}return d}function g(a){var b=c.$("#sc-buy-box form, #sw-atc-buy-box form, #sc-luxury-buy-box form, #sc-bazaar-buy-box form");if(0!==b.length){var d=document.createDocumentFragment();a.forEach(function(a){d.appendChild(a)});b.append(d)}}
function l(a){k.when("ready").execute(function(){c.state("checkout-url-migration-page-state",{queryParamString:a})})}var h="unknown";return{buildEligibilityPathWithParams:function(){var c={isAsync:"1",pipelineType:"Chewbacca"};c.referrer=a.get(a.KEYS.HOST_PAGE_TYPE_IDENTIFIER);c.ref_="chk_"+h+"_eligibility";c=b(c,!1);return(d.isShoppingPortalEnabled()?"/checkout/turbo/tango-eligibility":"/checkout/tango-eligibility")+e(c)},buildProceedToCheckoutPathWithParams:function(){var d=f.get(),c={pipelineType:"Chewbacca"};
c.referrer=a.get(a.KEYS.HOST_PAGE_TYPE_IDENTIFIER);c.ref_=d.javaCheckoutQueryParams.ref_||"ox_"+h+"_proceed";var u=b(c,!0);g(u);c=b(c,!1);c=e(c);l(c);return d.javaCheckoutUrl||"/checkout/entry/cart"},buildBuyNowToTangoCheckoutPathWithParams:function(d){var c={pipelineType:"Chewbacca"};c.referrer=a.get(a.KEYS.HOST_PAGE_TYPE_IDENTIFIER);c.isBuyNow="1";c.ref_=(d||"unknown_buy_now")+"_chw";d=b(c,!1);return"/checkout/entry/buynow"+e(d)},setRefMarkerPageContext:function(a){h=a}}});"use strict";k.when("jQuery",
"turbo-checkout-auto-open","turbo-checkout-page-ready").register("turbo-checkout-page-load-spinner",function(c,a){function d(){0!==c("#turbo-checkout-auto-load-spinner-container").length&&(c("#turbo-checkout-auto-load-spinner-container").remove(),e.unbind("touchmove touchstart touchend touchcancel click scroll",f))}function f(a){a.preventDefault();a.stopPropagation()}var e=c("body");a.isAutoOpenEligible()&&(e.bind("touchmove touchstart touchend touchcancel click scroll",f),e.append("\x3cdiv id\x3d'turbo-checkout-auto-load-spinner-container' class\x3d'turbo-checkout-auto-load-spinner-container'\x3e\x3cdiv id\x3d'turbo-checkout-auto-load-circle-container' class\x3d'turbo-checkout-auto-load-circle-container'\x3e\x3cdiv id\x3d'turbo-checkout-auto-load-spinner' class\x3d'a-spinner a-spinner-medium turbo-checkout-auto-load-spinner'\x3e\x3c/div\x3e\x3c/div\x3e\x3c/div\x3e"),
setTimeout(d,5E3));return{removePageLoadSpinner:d}});"use strict";k.when("turbo-checkout-page-ready").register("turbo-callback-list",function(){function c(){var a=[];this.callAll=function(){for(var d=0;d<a.length;d++){var c=a[d];c.apply(c,arguments)}};this.push=function(d){if("function"!==typeof d)throw Error("Invalid callback. Expected typeof 'callback' to be 'function'. typeof \x3d "+typeof d);-1===a.indexOf(d)&&a.push(d)};this.remove=function(d){d=a.indexOf(d);-1!==d&&a.splice(d,1)}}return{create:function(){return new c}}});
"use strict";k.when("turbo-callback-list","turbo-checkout-page-ready").register("turbo-filtered-callback-list",function(c){function a(a){var d=c.create();this.callAll=d.callAll;this.remove=d.remove;this.push=function(c){(c=c[a])&&"function"===typeof c&&d.push(c)}}return{create:function(d){if(!d||"string"!==typeof d)throw Error("Invalid filter parameter. Expected 'filter' to be a non empty string. typeof \x3d "+typeof d+" value \x3d "+d);return new a(d)}}});"use strict";k.when("A","turbo-configuration",
"turbo-checkout-utils","turbo-checkout-page-ready").register("turbo-checkout-form",function(c,a,d){function f(b){var d=a.get(a.KEYS.FORM_SELECTOR_OVERRIDE);if(d&&0<e(d).length)return e(d);d=a.get(a.KEYS.FORM_TYPE);if("link"===d)return b.find("a");if("form"===d)return b.closest("form");throw Error("Unsupported FORM_TYPE is configured. value \x3d "+d);}var e=c.$,b=/[\/?&]ref_?=([^?&]+)/;return{getForms:f,getRefTag:function(a){if(1!==a.length)return d.logError("Expected getRefTag input to have a single element. Cannot resolve refTag as this is a data quality risk",
"turbo-checkout-form"),d.logDebug("turbo-checkout-form","Expected getRefTag input to have a single element. Cannot resolve refTag as this is a data quality risk",a),"";a=f(a);a=((a.attr("action")||a.attr("href")||"")+"\x26"+a.serialize()).match(b)||{};return 2===a.length?a[1]:""}}});"use strict";k.when("A","turbo-checkout-page-ready").register("turbo-checkout-ajax-wrapper",function(c){return{load:function(a,d){d.hasOwnProperty("timeout")||(d.timeout=2E4);return c.ajax(a,d)},loadWithJQXHR:function(a,
d){d.hasOwnProperty("timeout")||(d.timeout=2E4);return c.$.ajax(a,d)},createXHRRequest:function(){var a=new XMLHttpRequest;a.timeout=2E4;return a}}});"use strict";k.when("A","turbo-checkout-csm","turbo-checkout-utils","turbo-checkout-session-storage","turbo-checkout-quantity-input","turbo-checkout-address-id","turbo-checkout-warranty-input","turbo-checkout-accessories-input","turbo-checkout-navigation-window","turbo-checkout-page-ready").register("turbo-checkout-auto-open",function(c,a,d,f,e,b,g,
l,h){function n(a,b){d.logDebug("turbo-checkout-auto-open",a,b)}function m(){return u()&&0!==z}function u(){var b;if(b="1"===x.trb_open||"1"===d.getUrlQueryParam("trb_open"))(b=f.isPresent("hasTurboAutoOpened"))&&a.logCount("turboCheckoutAutoOpenLoopPrevented"),b=!b;return b}function t(){return 1===z&&u()}function k(){t()&&(m()&&(z=2,f.set("hasTurboAutoOpened","1")),v(x.trb_bid),c.trigger("turbo:checkout:auto:open"))}var p=c.$,z=0,r="trb_open trb_addr trb_qty trb_warrAsin trb_auth trb_sid trb_bid trb_accessoryAsin trb_accessoryOffer".split(" "),
x={},v=function(){};return{setup:function(a,b){if(u()){z=1;var e=h.getWindow().location.href;p.each(r,function(a,b){a=d.getUrlQueryParam(b);x[b]=a;e=d.removeQueryParam(b,a,e)});n("Parameters:",x);d.replaceHistory(e);"function"===typeof a?v=a:d.logError("Initiate action must be supplied, and it must be a function.");c.on("turbo:checkout:prefetcher:state:dataStale",k);b()}else z=0,n("Disabled")},reset:function(){f.remove("hasTurboAutoOpened")},isAutoOpenEligible:u,isAutoOpenEnabled:m,isAutoOpenReadyToBeOpened:t,
updateInputsAndThen:function(a){var d=x.trb_qty,c=x.trb_addr,f=x.trb_warrAsin,h=x.trb_bid,m=x.trb_accessoryAsin,n=x.trb_accessoryOffer;if(d||c||f||h||m||n){d&&e.setQuantity(d);c&&b.set(c);if(f){g.select(f);var u=g.getLineItem(d)}if(m&&n){l.select(m);var t=l.getLineItem()}a(d,c,u,h,t)}}}});"use strict";k.when("turbo-checkout-navigation-window","turbo-checkout-page-ready").register("turbo-checkout-utils",function(c){function a(){return navigator.userAgent}function d(a,b){if(a===b||"function"===typeof a&&
"function"===typeof b)return!0;if(typeof a!==typeof b)return!1;if("object"!==typeof a||null===a||null===b)return a===b||a!==a&&b!==b;var c=Object.getOwnPropertyNames(a);if(c.length!==Object.getOwnPropertyNames(b).length)return!1;for(var e=0;e<c.length;e++){var f=c[e];if(!a.hasOwnProperty(f)||!b.hasOwnProperty(f)||!d(a[f],b[f]))return!1}return!0}var f={"\x26":"\x26amp;","\x3c":"\x26lt;","\x3e":"\x26gt;",'"':"\x26quot;","'":"\x26#039;"};return{logError:function(a,b){k.log(a,"ERROR",b||"turbo-checkout-utils")},
logWarning:function(a,b){k.log(a,"WARN",b||"turbo-checkout-utils")},logDebug:function(){},getUserAgent:a,isAndroid:function(){return!!a().match(/[a|A]ndroid/)},isIPhone:function(){return!!a().match(/iPhone/)},isIPad:function(){return!!a().match(/iPad/)},isInternetExplorer:function(){return!!a().match(/MSIE/)},createFQDN:function(a){/^http/.test(a)||(a=c.getWindow().location.origin?c.getWindow().location.origin+a:c.getWindow().location.protocol+"//"+c.getWindow().location.hostname+":"+c.getWindow().location.port+
a);return a},getUrlQueryParam:function(a,b){b||(b=c.getWindow().location.href);a=a.replace(/[\[\]]/g,"\\$\x26");return(a=(new RegExp("[?\x26]"+a+"(\x3d([^\x26#]*)|\x26|#|$)")).exec(b))?a[2]?decodeURIComponent(a[2].replace(/\+/g," ")):"":B},removeQueryParam:function(a,b,d){var c=d;a&&b&&d&&(a=a+"\x3d"+b,c=d.replace(new RegExp("\\?"+a+"[\x26]?","g"),"?"),c=c.replace(new RegExp("[\x26]?"+a,"g"),""));return c},replaceHistory:function(a){c.getWindow().history.pushState&&(c.getWindow().history.replaceState(null,
c.getWindow().title,a),c.getWindow())},isNonEmptyString:function(a){return"string"===typeof a&&0<a.length},isDeepEquals:d,escapeHtml:function(a){return a.replace(/[&<>"']/g,function(a){return f[a]})}}});"use strict";k.when("turbo-checkout-utils","turbo-checkout-page-ready").register("turbo-checkout-csm",function(c){function a(a,b,d,c){return"function"===typeof q.uet?q.uet.apply(q.uet,arguments):c||f()}function d(a,b,d){return"function"===typeof q.ues?q.ues.apply(q.ues,arguments):d}function f(){return+new Date}
function e(b){function c(){l&&e&&g&&h&&!p&&"function"===typeof k&&(k(l,e,g,h),p=!0)}var e,h,g,l,p=!1,k;this.getId=function(){return b};this.markClick=function(){l=a("tc",b)};this.markFirstByte=function(){e=d("t0",b,f())};this.markAboveTheFold=function(){g=a("af",b);c()};this.markCriticalFeature=function(){h=a("cf",b);c()};this.whenDataSet=function(a){k=a;c()}}function b(a){"undefined"!==typeof q.ue_t0&&q.ue.count(a,Date.now()-q.ue_t0)}var g=0,l=[];return{createScope:function(){return new e("chk_turbo_"+
++g)},logCount:function(a,d){d=d||1;c.logDebug("Logging counter "+a+" with value "+d);if(q.ue&&q.ue.count){var e=a+"_time";q.ue.count(a,d);b(e);for(var f=0;f<l.length;++f)q.ue.count(a+"."+l[f],d),b(e+"."+l[f])}},logCountSimple:function(a,b){b=b||1;c.logDebug("Logging counter "+a+" with value "+b);q.ue&&q.ue.count&&q.ue.count(a,b)},addCounterExtraSuffix:function(a){l.push(a)},timestamp:f}});"use strict";k.when("A","turbo-checkout-csm","turbo-checkout-page-ready").register("turbo-checkout-counter",
function(c,a){var d=0,f=0,e=0,b=0,g=0,l=0,h="u";c.on("turbo:checkout:sheet:beforeOpen",function(){a.logCount("turboCheckoutSheetOpen",d);"u"!==h?(++g,a.logCount("turboCheckoutPrefetchUsed",g),"p"===h?a.logCount("turboCheckoutPrefetchUsedInProgress",g):a.logCount("turboCheckoutPrefetchUsedFull",g)):(++l,a.logCount("turboCheckoutPrefetchMissing",l))});c.on("turbo:checkout:sheet:beforeClose",function(){++f;a.logCount("turboCheckoutSheetClose",f)});c.on("turbo:checkout:prefetcher:state:dataPrefetching",
function(){a.logCount("turboCheckoutPrefetchRequested",e);h="p"});c.on("turbo:checkout:prefetcher:state:dataFresh",function(){++b;a.logCount("turboCheckoutPrefetchAvailable",b);h="a"});c.on("turbo:checkout:prefetcher:state:dataStale",function(){h="u"});return{incrementSheetOpenedCounter:function(){d++},incrementPrefetchCounter:function(){e++},getSheetOpenCount:function(){return d},getPrefetchCount:function(){return e}}});"use strict";k.when("turbo-checkout-page-ready").register("turbo-checkout-cacher",
function(){return{createCache:function(c){var a=!1,d;return function(){a||(d=c(),a=!0);return d}}}});"use strict";k.when("A","turbo-configuration","turbo-checkout-utils","turbo-checkout-counter","turbo-checkout-page-ready").register("turbo-checkout-ref-tagger",function(c,a,d,f){function e(a,d,c){a="chk_"+a+"_"+(d+"_"+f.getPrefetchCount()+"-"+f.getSheetOpenCount());return b(c?a+"_"+c:a)}function b(a){if(!("string"===typeof a&&0<a.length&&64>=a.length&&l.test(a))||h.test(a))throw Error("Invalid ref tag. This would be filtered and replaced in clickstream. Value \x3d "+
a);return a}var g={ELIGIBILITY:"eligibility",BUY_NOW:"buyNow",CLOSE:"close"},l=/(^[A-z]$|^[A-z][A-z0-9_-]*[A-Za-z0-9]$)/,h=/[_-]{2,}/,n=a.get(a.KEYS.HOST_PAGE_TYPE_IDENTIFIER);return{generateRefTag:function(a,b,d){return"ref_\x3d"+e(a,b,d)},generateValue:e,generateJoinedValue:function(a){if(!a)return e(n,g.BUY_NOW,"fallback");try{var c=a+"_"+(g.BUY_NOW+"_"+f.getPrefetchCount()+"-"+f.getSheetOpenCount());return b(c)}catch(t){return d.logError(t.message,"turbo-checkout-ref-tagger"),e(n,g.BUY_NOW,"fallback")}},
generateEligibilityValue:function(){return e(n,g.ELIGIBILITY)},ACTIONS:g,TAGS:{TOUCH:"touch",TOUCH_X:"touchX",BACK:"back",ROTATION:"rotation",DONE:"done"}}});"use strict";k.when("A","turbo-checkout-page-ready").register("turbo-checkout-prefetch-timer",function(c){function a(){b||(b=!0,c.trigger("turbo:checkout:timer:onTimeout"))}function d(){if(b)return!0;var a=(new Date).getTime();return e?6E5<=a-e:!1}var f,e,b=!1;return{startTimer:function(){f||(f=q.setTimeout(a,6E5));e||(e=(new Date).getTime())},
isTimeout:d,resetTimer:function(){q.clearTimeout(f);b=!1;e=f=null},checkTimeout:function(){d()&&a()}}});"use strict";k.when("A","jQuery","turbo-checkout-csm","turbo-checkout-utils","turbo-checkout-state-handler","turbo-checkout-form","turbo-checkout-buy-now-onclick-handler","turbo-configuration","turbo-checkout-page-ready").register("turbo-checkout-buy-now-button",function(c,a,d,f,e,b,g,l){function h(a,b){f.logDebug("turbo-checkout-buy-now-button",a,b)}function n(b){return b?m(b):a(e.getInitiateSelector())}
function m(b){var c=a("#"+b),e=l.get(l.KEYS.BUY_NOW_CSS_CLASS_TO_RESOLVE_DUPLICATE_BUTTON_ID);if(!e)return c;var g=a("[id\x3d"+b+"]");if(2>g.length)return c;d.logCount("turboCheckoutBuyNowDuplicateIdPresent");h("Duplicate nodes present for BuyNow button ID: #"+b+". Resolving BuyNow button with CSS: "+e);g=g.filter(e);return 1!==g.length?(d.logCount("turboCheckoutBuyNowUnableToResolveButtonIdWithCss"),f.logError("Unable to resolve a unique BuyNow button with CSS: "+e+". Defaulting to first button with ID: #"+
b,"turbo-checkout-buy-now-button",void 0),c):g}function u(c){h("Buy now button clicked");d.logCount("turboCheckoutBuyNowClicked");"landscape"===q?d.logCount("turboCheckoutLandscapeOrientation"):d.logCount("turboCheckoutPortraitOrientation");g.isConflictingOnClickListenerPresent(a(c.currentTarget))&&(C=!0);c&&c.currentTarget&&c.currentTarget.id||(h("Click event target is INVALID. Expected event target with an id. Turbo will NOT show",c),C=!0);if(C)C=!1,h("Buy now button callbacks supressed");else{e.resolveProductState(c.currentTarget.id);
h("Calling buy now button callbacks...");var f=!1;for(var m=0;m<v.length;m++)f=f||v[m]();f?(h("Suppressing default buy now button action"),c.preventDefault(),c.stopPropagation(),c.stopImmediatePropagation(),f=!0):f=void 0;if(f)return!1}b.getForms(a(c.currentTarget)).attr("data-action",t());h("Calling default BuyNow action. User will be sent to Checkout SPC. Turbo will NOT show.");d.logCount("turboCheckoutBuyNowDefault");g.callCachedOnClickListenerIfPresent(c.currentTarget,c);return!0}function t(){return n().attr("name")||
"submit.buy-now"}function k(a){for(var b=v.length-1;0<=b;--b)v[b]===a&&v.splice(b,1)}function p(a){if(!a&&1<n().length)throw Error("Button id parameter is NOT present. Cannot execute action without a button id on a page with multiple buy now buttons!");}function z(a){a=n(a);r(a);a.click()}function r(b){for(var c=l.get(l.KEYS.CONFLICTING_INITIATE_LISTENERS),e=0;e<c.length;e++){var f=c[e];h("Unbound configured event '"+f+"' from buy now button");d.logCount("turboCheckoutBuyNowButtonConflictingListeners");
b.unbind(f);a(document.body).undelegate(b.selector,f)}}var x=l.get(l.KEYS.BUY_NOW_CLICK_EVENT),v=[],C=!1,q="portrait";c.on("turbo:checkout:clickInitiate",z);c.on("turbo:checkout:orientation:onChange",function(a){q=a.orientation});d.logCount("turboCheckoutBuyNowButtonBound");return{registerOnClickCallback:function(a){k(a);v.push(a)},deregisterOnClickCallback:k,executeOriginalBuyNowAction:function(a){p(a);C=!0;var e=b.getForms(n(a)).attr("action");e&&-1!==e.indexOf("/checkout/entry/buynow")?d.logCount("turboCheckoutYieldToTango"):
d.logCount("turboCheckoutYieldToGurupa");c.trigger("turbo:checkout:buyNowDisabled");c.trigger("turbo:checkout:clickInitiate",a)},executeTurboBuyNowAction:function(a){p(a);C=!1;z(a)},getSubmitAction:t,bindTurboClickEvent:function(a){a=a||n();g.removeConflictingOnClickListenerIfPresentAndCacheIt(a);a.unbind(x).bind(x,u)},removeConflictingListeners:r,getBuyNowButtons:n}});"use strict";k.when("A","jQuery","turbo-checkout-csm","turbo-checkout-utils","turbo-checkout-page-ready").register("turbo-checkout-buy-now-onclick-handler",
function(c,a,d,f){function e(b,c){b.each(function(b,d){a(d).removeProp(c)})}function b(b,c){var d=!1;b.each(function(){var b=a(this),e=b.find("[onclick]"),f=b.prop("onclick"),g=e.prop("onclick");return h(f)&&h(g)||1<e.length||!h(f||g)||l(b)!==c?(d=!0,!1):!0});return d}function g(a){return a.prop("onclick")||a.find("[onclick]").prop("onclick")}function l(a){return a.attr("onclick")||a.find("[onclick]").attr("onclick")}function h(a){return"function"===typeof a}function n(a,b){f.logDebug("turbo-checkout-buy-now-onclick-handler",
a,b)}var m;return{callCachedOnClickListenerIfPresent:function(a,b){h(m)&&(n("BuyNow button onclick listener function called."),d.logCount("turboCheckoutBuyNowButtonOnClickListenerCalled"),m.call(a,b.originalEvent))},removeConflictingOnClickListenerIfPresentAndCacheIt:function(a){var c=g(a),f=l(a);h(c)&&f&&(b(a,f)?(n("[DOM ERROR] Turbo will NOT show. BuyNow button node has INVALID 'onclick' DOM structure.",a),d.logCount("turboCheckoutBuyNowButtonInvalidOnClickDOM")):(n("BuyNow button node has 'onclick' attribute. Removing its listener and caching it.",
a),d.logCount("turboCheckoutBuyNowButtonOnClickListenerRemoveAndCache"),m=c,c=a.find("[onclick]"),e(a,"onclick"),e(c,"onclick")))},isConflictingOnClickListenerPresent:function(a){if(a=h(g(a)))n("Turbo will NOT show. BuyNow button node has conflicting 'onclick' listener."),d.logCount("turboCheckoutBuyNowButtonConflictingOnClickListener");return a}}});"use strict";k.when("A","turbo-checkout-utils","turbo-checkout-buy-now-button","turbo-checkout-page-ready").register("turbo-checkout-buy-now-integration",
function(c,a,d){function f(b,c){a.logDebug(b,"turbo-checkout-buy-now-integration",c)}var e=c.$,b=[];c.on("turbo:checkout:page:reappear",function(){f("Removing additional form inputs from form",b);for(var a;(a=b.shift())!==B;)a.remove()});return{isBuyNow:function(a){return a instanceof e&&a.attr("data-action")===d.getSubmitAction()},checkoutWith:function(c,d){if(Array.isArray(c)&&d instanceof e){var h=d;for(var g=1;0<h.find('input[name\x3d"asin.'+g+'"]').length||0<h.find('input[name\x3d"offeringID.'+
g+'"]').length;)g++;h=g;g=[];for(var m=0;m<c.length;m++){var l=c[m];if(l!==B&&l.asin&&l.offerListingId){var k=h;l=[e("\x3cinput /\x3e",{type:"hidden",name:"asin."+k,value:l.asin}),e("\x3cinput /\x3e",{type:"hidden",name:"offeringID."+k,value:l.offerListingId}),e("\x3cinput /\x3e",{type:"hidden",name:"quantity."+k,value:l.quantity||1})];Array.prototype.push.apply(g,l);h++}else f('Line item inputs are invalid. Expected "asin" and "offerListingId" keys in object. Customer purchase inputs ignored!',l),
a.logError('Line item inputs are invalid. Expected "asin" and "offerListingId" keys in object. Customer purchase inputs ignored!')}m=d.find('input[name\x3d"itemCount"]');1===m.length?m.val(h):d.append(e("\x3cinput /\x3e",{type:"hidden",name:"itemCount",value:h}));f("Appended additional buy now inputs.",g);d.append.apply(d,g);b=g}else h="Inputs are invalid. Expected array and jQuery object. lineItems \x3d "+c+" $form \x3d "+d,f(h,arguments),a.logError(h)}}});"use strict";k.when("turbo-checkout-page-ready").register("turbo-configuration-keys",
function(c){var a={HOST_PAGE_TYPE_IDENTIFIER:"HOST_PAGE_TYPE_IDENTIFIER",IS_BUY_NOW_TO_TANGO_ENABLED:"IS_BUY_NOW_TO_TANGO_ENABLED",IS_BUY_NOW_TO_TANGO_PRIME_SPLIT:"IS_BUY_NOW_TO_TANGO_PRIME_SPLIT",BUY_NOW_TO_TANGO_PARAMETER_EXCLUSION_LIST:"BUY_NOW_TO_TANGO_PARAMETER_EXCLUSION_LIST",BUY_NOW_TO_TANGO_PARAMETER_EXCLUSION_LIST_PRIME:"BUY_NOW_TO_TANGO_PARAMETER_EXCLUSION_LIST_PRIME",BUY_NOW_TO_TANGO_PARAMETER_EXCLUSION_LIST_NON_PRIME:"BUY_NOW_TO_TANGO_PARAMETER_EXCLUSION_LIST_NON_PRIME",BUY_NOW_TO_TANGO_PARAMETER_TO_FEATURE_MAPPING:"BUY_NOW_TO_TANGO_PARAMETER_TO_FEATURE_MAPPING",
BUY_NOW_TO_TANGO_FEATURE_PARAMETER_GROUP_MAPPING:"BUY_NOW_TO_TANGO_FEATURE_PARAMETER_GROUP_MAPPING",FORM_TYPE:"FORM_TYPE",FORM_SELECTOR_OVERRIDE:"FORM_SELECTOR_OVERRIDE",BUY_NOW_BUTTON_SELECTOR:"BUY_NOW_BUTTON_SELECTOR",BUY_NOW_BUTTON_V2_SELECTOR:"BUY_NOW_BUTTON_V2_SELECTOR",BUY_NOW_CLICK_EVENT:"BUY_NOW_CLICK_EVENT",BUY_NOW_CSS_CLASS_TO_RESOLVE_DUPLICATE_BUTTON_ID:"BUY_NOW_CSS_CLASS_TO_RESOLVE_DUPLICATE_BUTTON_ID",QUANTITY_SELECT_SELECTOR:"QUANTITY_SELECT_SELECTOR",ADDRESS_INPUT_SELECTORS:"ADDRESS_INPUT_SELECTORS",
SESSION_ID_SELECTOR:"SESSION_ID_SELECTOR",LEGACY_SESSION_ID_IDENTIFIER:"LEGACY_SESSION_ID_IDENTIFIER",WARRANTY_CHECKBOX_INPUT_SELECTOR:"WARRANTY_CHECKBOX_INPUT_SELECTOR",WARRANTY_CHECKBOX_RELATIVE_PARENT_SELECTOR:"WARRANTY_CHECKBOX_RELATIVE_PARENT_SELECTOR",WARRANTY_ASIN_INPUT_NAME:"WARRANTY_ASIN_INPUT_NAME",WARRANTY_OFFER_INPUT_SELECTOR:"WARRANTY_OFFER_INPUT_SELECTOR",AJAX_PAGE_UPDATE_EVENT:"AJAX_PAGE_UPDATE_EVENT",PREFETCH_TREATMENT:"PREFETCH_TREATMENT",NO_PREFETCH_TREATMENT:"NO_PREFETCH_TREATMENT",
BUY_NOW_ONLY_TREATMENT:"BUY_NOW_ONLY_TREATMENT",IS_DEVICE_FILTER_REQUIRED:"IS_DEVICE_FILTER_REQUIRED",IS_SIGN_IN_SUPPORTED:"IS_SIGN_IN_SUPPORTED",USES_MASH_WILL_REAPPEAR:"USES_MASH_WILL_REAPPEAR",SHOW_SIGN_IN_INTERFACE:"SHOW_SIGN_IN_INTERFACE",IFRAME_ID:"IFRAME_ID",EXTEND_ELIGIBLE_STATE:"EXTEND_ELIGIBLE_STATE",VIEW_ADAPTER:"VIEW_ADAPTER",PAGE_STATE_PARSING_ROOT_NODE_SELECTOR:"PAGE_STATE_PARSING_ROOT_NODE_SELECTOR",PRODUCT_STATE_PARSING_ROOT_NODE_SELECTOR:"PRODUCT_STATE_PARSING_ROOT_NODE_SELECTOR",
JAVA_CHECKOUT_URL_PAGE_STATE_PARSING_ROOT_NODE_SELECTOR:"JAVA_CHECKOUT_URL_PAGE_STATE_PARSING_ROOT_NODE_SELECTOR",TURBO_PAGE_STATE_KEY:"TURBO_PAGE_STATE_KEY",TURBO_PRODUCT_STATE_KEY:"TURBO_PRODUCT_STATE_KEY",JAVA_CHECKOUT_URL_PAGE_STATE_KEY:"JAVA_CHECKOUT_URL_PAGE_STATE_KEY",DEVICE_OVERRIDE:"DEVICE_OVERRIDE",CONFLICTING_INITIATE_LISTENERS:"CONFLICTING_INITIATE_LISTENERS",VAS_CHANGE_EVENTS:"VAS_CHANGE_EVENTS",VAS_CHECKBOX_SELCTOR:"VAS_CHECKBOX_SELCTOR",CHECKBOX_EXCLUSION_ROOT_NODES:"CHECKBOX_EXCLUSION_ROOT_NODES",
MASH_ADAPTER:"MASH_ADAPTER",IS_ADD_TO_CART_ENABLED:"IS_ADD_TO_CART_ENABLED",IS_BUYNOW_ENABLED_FOR_SCREENREADER:"IS_BUYNOW_ENABLED_FOR_SCREENREADER",BACKGROUND_SCROLL_TARGET_SELECTOR:"BACKGROUND_SCROLL_TARGET_SELECTOR",NO_PREFETCH_EXPERIMENT_WEBLABS:"NO_PREFETCH_EXPERIMENT_WEBLABS",ENABLED_ACCESSORIES_SELECTOR:"ENABLED_ACCESSORIES_SELECTOR",OVERRIDE_ELIGIBILITY:"OVERRIDE_ELIGIBILITY",validate:function(c){if("string"!==typeof c||!a[c])throw Error("The key '"+c+"' is not defined within 'turbo-configuration-keys'.");
}};return a});"use strict";k.when("A","turbo-configuration-keys","turbo-device-configuration","turbo-client-configuration","turbo-eligibility-override","turbo-checkout-page-ready").register("turbo-configuration",function(c,a,d,f,e){function b(a,b){var c=g(a);n[a]=c===B?b:c}function g(a){var b=f[a];a=d[a];if(l(b))return b;if(l(a))return a}function l(a){return"boolean"===typeof a||a}function h(a){if(!l(f[a])&&!l(d[a]))throw Error("Required configuration override for key '"+a+"' is missing");n[a]=g(a)}
var n,m={isGift:"GiftOptions","items[0.base][additionalParameters][giftOptions][includeGiftReceipt]":"GiftOptions","gift-wrap":"GiftOptions",offerListingID:"OfferService",snsMostCommonFrequency:"SNS",snsOnmlOfferId:"SNS",snsOptIn:"SNS",rcxOrdFreq:"SNS",snsOfferListingID:"SNS",ref:"SNS",skipCart:"",isBuyBack:"",shippingAddressID:"",tag:"",b2brdOptIn:"",cartCustomerID:"",fromSignIn:"",siteState:"",mbboid:"",mbbq:"",mbba:"","openid.assoc_handle":"","openid.claimed_id":"","openid.identity":"","openid.mode":"",
"openid.ns":"","openid.ns.pape":"","openid.op_endpoint":"","openid.pape.auth_policies":"","openid.pape.auth_time":"","openid.response_nonce":"","openid.return_to":"","openid.sig":"","openid.signed":"","custom-name.1.incentivizedCart":"IncentivizedCart","custom-value.1.incentivizedCart":"IncentivizedCart",pickupAddressId:"BOPIS",pickupStoreChainId:"BOPIS",pickupStoreChainOwnerId:"BOPIS",inHouseInstallments:"UFO","installments-check":"UFO","installments-programId":"UFO",isInstallmentsChecked:"UFO",
paymentOfferInfo:"UFO","items[0.base][additionalParameters][paymentOfferInfo]":"UFO","items[0.base][additionalParameters][installments][programId]":"UFO",serial:"",a:"",checkoutClientId:"","discoveredAsins.1":"",customId:"MerchOnDemand",customizationToken:"ConfigurableProduct",fulfillmentType:"",claim_type:"",new_account:"",returnFromLogin:"",captcha_verified:"",pickupAsin:"","session-id":"",clientName:"",merchantID:"",useDefaultCart:"",distributableLicense:"","asin.1":"","offeringID.1":"","quantity.1":"",
purchaseAsin:"",type:"",AssociateTag:"",dplnkId:"","submit.buy-now":"","custom-name.2.1":"","address-ui-widgets-enableEmailAddress":"",oid:"",sr:"",ASIN:"","custom-name.1.2":"","address-ui-widgets-enableAddressWizardInlineSuggestions":"","address-ui-widgets-enableAddressWizardForm":"","address-ui-widgets-enterAddressPostalCode":"","address-ui-widgets-locale":"",rebateId:"","custom-value.1.5":"","address-ui-widgets-avsSuppressSoftblock":"",offerListingId:"","custom-value.1.6":"",qid:"",cimarronIssuerId:"",
"custom-name.2.2":"",popoverContentStringId:"","custom-name.1.11":"","address-ui-widgets-csrfToken":"",registryItemID:"","address-ui-widgets-delivery-instructions-desktop-expander-context":"",paymentCadenceValue:"",numberOfPayments:"","address-ui-widgets-obfuscated-customerId":"","address-ui-widgets-enterAddressLine2":"","custom-name.1.13":"",addressID:"","custom-name.1.3":"","address-ui-widgets-amazonBusinessGroupId":"","custom-name.2.3":"",timestamp:"","ppw-widgetState":"",taxDistributionStrategy:"",
"address-ui-widgets-enableLatestAddressWizardForm":"","custom-value.2.3":"","custom-value.2.1":"","custom-value.2.2":"","custom-value.1.13":"","address-ui-widgets-enterAddressFullName":"","inHouseInstallments-programType":"","address-ui-widgets-enableAddressDetails":"",_from:"","address-ui-widgets-enterAddressPhoneNumber":"","custom-value.1.0":"","address-ui-widgets-locationData":"",turboPageRequestId:"","custom-name.2.4":"","address-ui-widgets-delivery-instructions-data":"","address-ui-widgets-enterAddressCity":"",
quantity:"",paymentCadenceUnit:"","address-ui-widgets-returnLegacyAddressID":"",addressId:"","custom-value.1.7":"",purchaseInputs:"","custom-value.1.1":"","custom-name.1.1":"","preorder-button":"","address-ui-widgets-heading-string-id":"",ref_:"","address-ui-widgets-enterAddressStateOrRegion":"",triggerTurboWeblab:"","custom-value.1.2":"","custom-name.1.4":"",sessionID:"","address-ui-widgets-enableDeliveryInstructions":"","address-ui-widgets-avsSuppressSuggestion":"","custom-name.1.6":"",ttclid:"",
"address-ui-widgets-countryCode":"","custom-name.1.5":"",turboPageSessionId:"","address-ui-widgets-ab-delivery-instructions-data":"","address-ui-widgets-form-load-start-time":"","custom-value.1.3":"",termsAndConditionUrl:"","custom-value.1.11":"",offeringID:"","custom-name.1.0":"","address-ui-widgets-addressFormHideHeading":"","address-ui-widgets-address-wizard-interaction-id":"","custom-name.1.7":"","address-ui-widgets-use-as-my-default":"","custom-name.1.12":"","custom-value.1.12":"","address-ui-widgets-addressFormButtonText":"",
offerConfigurationType:"","address-ui-widgets-clientName":"",registryID:"","address-ui-widgets-enableAddressTips":"",buyNow:"","address-ui-widgets-previous-address-form-state-token":"",asin:"",fbclid:"","custom-value.1.4":"",triggerTurboWeblabName:"","custom-value.2.4":"","address-ui-widgets-addressFormHideSubmitButton":"","address-ui-widgets-enterAddressLine1":"","items[0.upsell][asin]":"AccessoryUpsell"},k={},t;for(t in m)if(m.hasOwnProperty(t)&&""!==m[t]){var w=m[t];k[w]||(k[w]=[]);k[w].push(t)}return{get:function(c){a.validate(c);
n||(n={},h(a.HOST_PAGE_TYPE_IDENTIFIER),h(a.SHOW_SIGN_IN_INTERFACE),h(a.EXTEND_ELIGIBLE_STATE),h(a.VIEW_ADAPTER),b(a.IS_BUY_NOW_TO_TANGO_ENABLED,!1),b(a.IS_BUY_NOW_TO_TANGO_PRIME_SPLIT,!1),b(a.BUY_NOW_TO_TANGO_PARAMETER_EXCLUSION_LIST,{}),b(a.BUY_NOW_TO_TANGO_PARAMETER_EXCLUSION_LIST_PRIME,{}),b(a.BUY_NOW_TO_TANGO_PARAMETER_EXCLUSION_LIST_NON_PRIME,{}),b(a.FORM_TYPE,"form"),b(a.FORM_SELECTOR_OVERRIDE,""),b(a.BUY_NOW_BUTTON_SELECTOR,"#buy-now-button"),b(a.BUY_NOW_BUTTON_V2_SELECTOR,".checkout-buy-now"),
b(a.BUY_NOW_CLICK_EVENT,"click.turboCheckout"),b(a.BUY_NOW_CSS_CLASS_TO_RESOLVE_DUPLICATE_BUTTON_ID,""),b(a.QUANTITY_SELECT_SELECTOR,'select[name\x3d"quantity"]'),b(a.SESSION_ID_SELECTOR,""),b(a.LEGACY_SESSION_ID_IDENTIFIER,""),b(a.ADDRESS_INPUT_SELECTORS,["#unifiedLocation1ClickAddress","#unifiedLocationAddress"]),b(a.WARRANTY_CHECKBOX_INPUT_SELECTOR,".mbb-checkbox input[name\x3dmbba]"),b(a.WARRANTY_CHECKBOX_RELATIVE_PARENT_SELECTOR,".mbb-checkbox-column"),b(a.WARRANTY_ASIN_INPUT_NAME,"mbba"),b(a.WARRANTY_OFFER_INPUT_SELECTOR,
"#mbb-offering-id"),b(a.AJAX_PAGE_UPDATE_EVENT,"a:pageUpdate"),b(a.PREFETCH_TREATMENT,"PREFETCH_DISABLED"),b(a.NO_PREFETCH_TREATMENT,"T1"),b(a.BUY_NOW_ONLY_TREATMENT,"BUY_NOW_LAUNCHED"),b(a.IS_DEVICE_FILTER_REQUIRED,!1),b(a.IS_SIGN_IN_SUPPORTED,!0),b(a.USES_MASH_WILL_REAPPEAR,!1),b(a.IFRAME_ID,"turbo-checkout-iframe"),b(a.PAGE_STATE_PARSING_ROOT_NODE_SELECTOR,"#turboState"),b(a.PRODUCT_STATE_PARSING_ROOT_NODE_SELECTOR,"#turboState"),b(a.JAVA_CHECKOUT_URL_PAGE_STATE_PARSING_ROOT_NODE_SELECTOR,"#turboState"),
b(a.TURBO_PAGE_STATE_KEY,"turbo-checkout-page-state"),b(a.TURBO_PRODUCT_STATE_KEY,"turbo-checkout-page-state"),b(a.JAVA_CHECKOUT_URL_PAGE_STATE_KEY,"java-checkout-url-page-state"),b(a.DEVICE_OVERRIDE,""),b(a.CONFLICTING_INITIATE_LISTENERS,[]),b(a.CHECKBOX_EXCLUSION_ROOT_NODES,"#simpleBundle_feature_div #monthlyPayments_feature_div #bbg_feature_div #addons_feature_div #mobile-accessory-upsell #twister-plus-feature #payment-options-feature #detailPageGifting_feature_div #giftingODF_feature_div #giftWrapInfoFeature_feature_div #dynamicGiftWrapInfoFeature_feature_div".split(" ")),
b(a.ENABLED_ACCESSORIES_SELECTOR,".simpleBundleCheckBoxArea"),b(a.MASH_ADAPTER,""),b(a.IS_ADD_TO_CART_ENABLED,!0),b(a.IS_BUYNOW_ENABLED_FOR_SCREENREADER,!0),b(a.BACKGROUND_SCROLL_TARGET_SELECTOR,"#productTitleGroupAnchor"),b(a.VAS_CHANGE_EVENTS,["turbo:checkout:sheet:doClose"]),b(a.VAS_CHECKBOX_SELCTOR,"#vas-checkbox-input"),b(a.VAS_CHANGE_EVENTS,["turbo:checkout:sheet:doClose"]),b(a.VAS_CHECKBOX_SELCTOR,"#vas-checkbox-input"),b(a.NO_PREFETCH_EXPERIMENT_WEBLABS,["RCX_CHECKOUT_TURBO_PRIME_UPSELL_222066"]),
b(a.BUY_NOW_TO_TANGO_PARAMETER_TO_FEATURE_MAPPING,m),b(a.BUY_NOW_TO_TANGO_FEATURE_PARAMETER_GROUP_MAPPING,k),b(a.OVERRIDE_ELIGIBILITY,e));var d=n;return d[c]},KEYS:c.copy(a)}});"use strict";k.when("A","turbo-checkout-utils","turbo-checkout-weblab-allocation","turbo-checkout-eligibility-aggregator","turbo-checkout-state-handler","turbo-checkbox-exclusion-listener","turbo-checkout-content-loader","turbo-checkout-device-filter","turbo-callback-list","turbo-checkout-auto-open","turbo-checkout-vas-input",
"turbo-checkout-accessories-input","turbo-checkout-page-ready").register("turbo-base-eligible-state",function(c,a,d,f,e,b,g,l,h,n,m,k){function t(){C=!0}function u(){C=!1}function p(){var a=new z;l.isDeviceTurboEligible()||a.invalidate("Device is NOT eligible");g.isError()&&!d.isNoPrefetch()&&a.invalidate("Prefetch failed");e.isProductTurboEligible()||a.invalidate("Product is NOT eligible");n.isAutoOpenEnabled()||C||a.invalidate("Cheetah eligibility response is false");d.isControl()&&a.invalidate("Weblab is in CONTROL");
d.isBuyNowOnly()&&a.invalidate("Weblab is in buy now only treatment");m.isSelected()&&a.invalidate("Value added service is selected and NOT supported");k.isEligible()||a.invalidate("Accessory selection was not eligible");b.isAnyCheckboxChecked()&&a.invalidate("Exclusion case checkbox is checked");0!==q("#account-linking").length&&a.invalidate("Account linking checkbox present");x.callAll(a);a.logInvalidState();return a.canShow()}function z(){var b=!0,c=[];this.invalidate=function(a){b=!1;c.push(a)};
this.logInvalidState=function(){b||a.logDebug("turbo-base-eligible-state","Cannot show turbo because: "+c)};this.canShow=function(){return b}}function r(a){v.callAll(p(),a)}var x=h.create(),v=h.create(),C=!1,q=c.$;return{addStateCheck:function(a){x.push(a)},canShow:p,registerStateChangeCallback:function(a){v.push(a)},onStateChange:r,isTangoAsinEligibleAndTurboIneligible:function(){return e.isProductTangoEligible()&&(!C||!f.isTurboEligible())},setup:function(){g.registerCallback({onTurboEligible:t,
onFinish:t,onTurboIneligible:u});e.registerCallback(r);b.onStateChange(r);m.onChange(r);k.registerCallback(r)}}});"use strict";k.when("A","turbo-callback-list","turbo-checkout-page-ready").register("turbo-checkout-base-view",function(c,a){function d(c){if("string"!==typeof c)throw Error("Parameter 'iFrameContainerSelector' is not a string.");this.onBoundsAdjustedCallbacks=a.create();this.IFRAME_CONTAINER_SELECTOR=c}var f=c.$;d.prototype.updateBounds=function(a,b){if("number"!==typeof a)throw Error("Parameter 'iFrameContainerHeightInPixels' is not a number. Cannot validate bounds.");
var c=this.$getIFrameContainer().height(),d=a-c,e=c+d;0!==d&&(this.$getIFrameContainer().height(e),this.updateScrollHeight(a,b),a=parseInt(this.$getIFrameContainer().css("min-height"),10),e=e>a?e:a,c!==e&&this.onBoundsAdjustedCallbacks.callAll(e))};d.prototype.updateScrollHeight=function(a,b){b&&a!==b?(this.$getIFrame().height(b),this.$getIFrameContainer().css("overflow-y","scroll"),this.$getIFrameContainer().css("-webkit-overflow-scrolling","touch")):(this.$getIFrame().height("100%"),this.$getIFrameContainer().css("overflow-y",
""),this.$getIFrameContainer().css("-webkit-overflow-scrolling",""))};d.prototype.getHeight=function(){return this.$getIFrameContainer().height()};d.prototype.$getIFrameContainer=function(){return f(this.IFRAME_CONTAINER_SELECTOR)};d.prototype.$getIFrame=function(){return f(this.IFRAME_CONTAINER_SELECTOR+" iframe")};d.prototype.pushBoundsAdjustedCallback=function(a){this.onBoundsAdjustedCallbacks.push(a)};return{extend:function(){function a(){d.apply(this,arguments)}a.prototype=Object.create(d.prototype);
return a.prototype.constructor=a}}});"use strict";k.when("turbo-configuration","turbo-checkout-page-ready").execute("turbo-eligible-state-check",function(c){c.get(c.KEYS.EXTEND_ELIGIBLE_STATE)||k.when("turbo-base-eligible-state").register("turbo-checkout-eligible-state",function(a){return{canShow:a.canShow,registerStateChangeCallback:a.registerStateChangeCallback,setup:a.setup}})});"use strict";k.when("A","turbo-checkout-state-handler","turbo-configuration","turbo-initiate-migration-switch","turbo-checkout-utils",
"turbo-checkout-page-ready").register("turbo-checkout-weblab-allocation",function(c,a,d,f){function e(){return a.getWeblabAllocation()}function b(){return a.getExperimentName()}function g(){var b=a.getAdditionalWeblabAndTreatmentMap(),c={},d;for(d in b)b.hasOwnProperty(d)&&-1===n.indexOf(d)&&(c[d]=b[d]);return c}function l(){return"C"===e()}function h(){var a=d.get(d.KEYS.NO_PREFETCH_EXPERIMENT_WEBLABS);return Array.isArray(a)&&-1!==a.indexOf(b())&&!l()}var n="PAX_CHECKOUT_BUY_NOW_TO_TANGO_MOBILE_EXPERIMENT_969578 PAX_CHECKOUT_BUY_NOW_TO_TANGO_DESKTOP_EXPERIMENT_969581 PAX_CHECKOUT_BUY_NOW_TO_TANGO_DESKTOP_EXPERIMENT_NON_PRIME_1088576 UPMT_CHECKOUT_BUY_NOW_GIFT_TANGO_MOBILE_1044567 UPMT_CHECKOUT_BUY_NOW_GIFT_TANGO_DESKTOP_1044576 PAX_CHECKOUT_BUY_NOW_UFO_TANGO_MOBILE_1116443 PAX_CHECKOUT_BUY_NOW_UFO_TANGO_DESKTOP_1118473 PAX_CHECKOUT_BUY_NOW_AMP_TANGO_MOBILE_1118485 PAX_CHECKOUT_BUY_NOW_AMP_TANGO_DESKTOP_1118500 PAX_CHECKOUT_BUY_NOW_GC_TANGO_1121297 PAX_CHECKOUT_BUY_NOW_TO_TANGO_REMOVE_LEGACY_PIPELINE_PARAMETER_1125072 PAX_CHECKOUT_VAS_ENABLE_BUY_NOW_TANGO_1165794 PAX_CHECKOUT_ALC_BUY_NOW_TANGO_1185935 PAX_CHECKOUT_REGISTRY_PARAMS_TANGO_BUYNOW_1190070 CETECH_CHECKOUT_WARRANTIES_ENABLE_BUY_NOW_TANGO_1184394".split(" ");
return{getAllocation:e,getExperimentName:b,getAdditionalWeblabAndTreatmentMap:g,getBuyNowToTangoWeblabs:function(){for(var b=n,c=a.getAdditionalWeblabAndTreatmentMap(),d={},e=0;e<b.length;e++)c.hasOwnProperty(b[e])&&(d[b[e]]=c[b[e]]);return d},getHoldbackSecondaryPanelsWeblab:function(){return a.getHoldbackSecondaryPanelsWeblab()},isControl:l,isBuyNowOnly:function(){return e()===d.get(d.KEYS.BUY_NOW_ONLY_TREATMENT)&&!f.isEnabled()},isDisableTurboWeblabInTreatment:function(){for(var a=g(),b=["RCX_CHECKOUT_DISABLE_TURBO_FOR_NPA_EXPERIMENT_543201",
"RCX_CHECKOUT_DISABLE_TURBO_FOR_PRIME_MOBILE_EXPERIMENT_601969","RCX_CHECKOUT_DISABLE_TURBO_FOR_PRIME_DESKTOP_EXPERIMENT_601976","RCX_CHECKOUT_DISABLE_TURBO_FOR_NPA_MOBILE_EXPERIMENT_1173806","RCX_CHECKOUT_DISABLE_TURBO_FOR_NPA_DESKTOP_EXPERIMENT_1173801"],c=0;c<b.length;c++){var d=b[c];if(d in a&&"T1"===a[d])return!0}return!1},isPrefetch:function(){return f.isEnabled()?!1:!h()&&e()===d.get(d.KEYS.PREFETCH_TREATMENT)},isNoPrefetch:function(){if(f.isEnabled())return!0;var a=d.get(d.KEYS.NO_PREFETCH_TREATMENT);
return h()||!!e().match(a)},isBuyNowToTangoCustomerEligibilityCheckRemovalWeblabInTreatment:function(){var b=a.getAdditionalWeblabAndTreatmentMap();return b.hasOwnProperty("PAX_CHECKOUT_BUY_NOW_TO_TANGO_CUSTOMER_ELIGIBILITY_CHECK_REMOVAL_1134797")&&"T1"===b.PAX_CHECKOUT_BUY_NOW_TO_TANGO_CUSTOMER_ELIGIBILITY_CHECK_REMOVAL_1134797}}});"use strict";k.when("A","jQuery","turbo-checkout-ajax-wrapper","turbo-checkout-utils","turbo-checkout-urls","turbo-checkout-csm","turbo-checkout-weblab-allocation","turbo-checkout-buy-now-button",
"turbo-checkout-form","turbo-configuration","turbo-checkout-state-handler","turbo-checkout-eligibility-response-weblabs","turbo-checkout-eligible-state","turbo-initiate-migration-switch","turbo-checkout-page-ready").register("turbo-checkout-weblab-trigger",function(c,a,d,f,e,b,g,l,h,n,m,k,t,w){function p(){c.on("turbo:checkout:prefetch:onTurboEligible",function(){J=!0;v()})}function u(){c.on("turbo:checkout:prefetch:onTurboIneligible",function(){J=!1;v()})}function r(){c.on("a:pageUpdate",function(){v()})}
function x(){c.on("turbo:checkout:auto:open",function(){G()})}function v(){0===C().length?b.logCount("turboCheckoutBuyNowButtonMissing"):0===h.getForms(C()).length&&b.logCount("turboCheckoutBuyNowFormMissing");0<h.getForms(C()).length&&(J?(f.logDebug("turbo-checkout-weblab-trigger","Adding trigger to form: "+g.getAllocation()),D.val(g.getAllocation()),A.val(g.getExperimentName()),y.val(m.getRequestId()),F.val(m.getSessionId()),h.getForms(C()).append(D,A,y,F)):(f.logDebug("turbo-checkout-weblab-trigger",
"Removing trigger from form: "+g.getAllocation()),D.remove(),A.remove(),y.remove(),F.remove()))}function C(){var b=n.get(n.KEYS.BUY_NOW_BUTTON_SELECTOR),c=n.get(n.KEYS.BUY_NOW_BUTTON_V2_SELECTOR);return 0===a(b).length?a(c):a(b)}function B(){if(k.get()&&0<k.get().length||J){f.logDebug("turbo-checkout-weblab-trigger","Calling cheetah to trigger: "+g.getAllocation());0<h.getForms(C()).find(D).length||b.logCount("turboCheckoutTriggerMissing");var a=J?e.buildTriggerWeblabPathWith(m.getRefTag(),g.getExperimentName(),
g.getAllocation(),m.getRequestId(),m.getSessionId()):e.buildTriggerWeblabPathWithoutWeblab(m.getRefTag,m.getRequestId(),m.getSessionId());if(J){var c=g.getAdditionalWeblabAndTreatmentMap();var d=[],l;for(l in c)c.hasOwnProperty(l)&&d.push({weblabName:l,weblabAllocation:c[l]});c=d}else c=[];G(a,c)}}function G(c,d){d=[].concat(d).concat(k.get());d={additionalWeblabsToTrigger:JSON.stringify(d)};var e="function"===typeof q.Blob;"function"===typeof q.navigator.sendBeacon&&e?(d=new Blob([a.param(d)],{type:"application/x-www-form-urlencoded"}),
q.navigator.sendBeacon(c,d)||b.logCount("turboCheckoutTriggerRecordingFailed")):E(c,d)}function E(a,c){d.load(a,{method:"POST",params:c,error:function(a,c,d){a&&204===a.http.status||b.logCount("turboCheckoutTriggerRecordingFailed")},abort:function(a){b.logCount("turboCheckoutTriggerRecordingFailed")}})}var D,A,y,F,J=!1;return{setup:function(){D=a("\x3cinput/\x3e",{type:"hidden",name:"triggerTurboWeblab",value:""});A=a("\x3cinput/\x3e",{type:"hidden",name:"triggerTurboWeblabName",value:""});y=a("\x3cinput/\x3e",
{type:"hidden",name:"turboPageRequestId",value:""});F=a("\x3cinput/\x3e",{type:"hidden",name:"turboPageSessionId",value:""});r();p();u();l.registerOnClickCallback(B);x()},sendTurboWeblabRequest:G}});"use strict";k.when("A","turbo-checkout-form","turbo-checkout-utils","turbo-checkout-state-handler","turbo-checkout-page-ready").register("turbo-checkout-page-filter",function(c,a,d,f){function e(a,c){d.logDebug("turbo-checkout-page-filter",a,c)}return{isCurrentViewTurboEligible:function(){var b=c.$(f.getInitiateSelector()),
d=a.getForms(b),l=0<b.length&&b.length===d.length;l||(e("Page is NOT turbo eligible. Parent forms / nested links do not match the number of initiate selectors",b),e("Forms",d));return l}}});"use strict";k.when("turbo-configuration","turbo-checkout-page-ready").execute("turbo-device-filter-check",function(c){c.get(c.KEYS.IS_DEVICE_FILTER_REQUIRED)||k.when("turbo-checkout-cacher","turbo-checkout-page-ready").register("turbo-checkout-device-filter",function(a){var c=function(){return!0};return{isDeviceTurboEligible:a.createCache(c),
isSignInSupported:a.createCache(c),isMashBeta:a.createCache(function(){return!1}),isBuyNowToTangoSupported:a.createCache(c)}})});"use strict";k.when("A","turbo-checkout-state-handler","turbo-checkout-device-filter","turbo-checkout-page-filter","turbo-checkout-weblab-allocation","buy-now-to-tango-switch","turbo-chewbacca-migration-switch","turbo-checkout-page-ready").register("turbo-checkout-eligibility-aggregator",function(c,a,d,f,e,b,g){function l(){return f.isCurrentViewTurboEligible()&&a.isProductTurboEligible()&&
(!e.isBuyNowOnly()||g.isGatingWeblabEnabled())}function h(){return e.isBuyNowToTangoCustomerEligibilityCheckRemovalWeblabInTreatment()?!1:b.isEnabled()&&a.isProductTangoEligible()}return{isTurboEligible:l,isTurboOrTangoPrefetchEligible:function(){return l()||h()},isSignInSupported:function(){return d.isSignInSupported()&&(!e.isBuyNowOnly()||g.isGatingWeblabEnabled())},shouldAttemptTangoPrefetch:h,shouldAttemptTurboPrefetch:function(){return d.isDeviceTurboEligible()&&(!e.isBuyNowOnly()||g.isGatingWeblabEnabled())}}});
"use strict";k.when("A","turbo-view-adapter","turbo-checkout-ref-tagger","turbo-filtered-callback-list","turbo-checkout-state-handler","turbo-checkout-ajax-wrapper","turbo-checkout-utils","turbo-checkout-urls","turbo-checkout-csm","turbo-checkout-eligibility-aggregator","turbo-checkout-eligibility-response-weblabs","turbo-checkout-accessories-input","turbo-chewbacca-migration-switch","turbo-chewbacca-migration-shadow","turbo-initiate-migration-switch","buy-now-to-tango-switch","turbo-checkout-navigation-window",
"turbo-chewbacca-migration-optimistic-flushing","turbo-checkout-weblab-allocation","turbo-chewbacca-migration-get-request","turbo-checkout-page-ready").register("turbo-checkout-content-loader",function(c,a,d,f,e,b,g,l,h,k,m,u,t,w,p,q,r,x,v,C){function n(f){h.logCount("turboCheckoutInitiate");R();M=!1;N=f;O=Date.now();A("Notifying loading callbacks");H="started";U.callAll();c.trigger("turbo:checkout:prefetch:onStart");f&&(q.isEnabled()&&e.isProductTangoEligible()&&h.logCount("tangoCheckCustomerEligibilityPrefetchStarted"),
k.shouldAttemptTurboPrefetch&&k.isTurboEligible()&&h.logCount("turboCheckCustomerEligibilityPrefetchStarted"));h.logCount("turboCheckoutPrefetchStart");var g=f?[]:e.getLineItems(),m=f?d.generateEligibilityValue():e.getRefTag();g=(f?l.buildEligibilityPathWith:l.buildInitiatePathWith)(m,e.getExperimentName(),e.getClientId(),e.getRequestId(),e.getSessionId(),g,e.getPrimeStatus());p.isEnabled()&&a.updateBottomSheetAttributes();L=b.loadWithJQXHR(g,{type:p.isEnabled()&&!N&&C.isEnabled()?"GET":"POST",data:z(f),
headers:E(),xhr:D,success:J,error:I})}function z(a){var b={isAsync:1};e.getAddressId()&&(b.addressID=e.getAddressId());e.isPhysicalGiftCardExperimentEligible()&&(b.isPhysicalGiftCard=!0);if(a&&u.isEligible()&&u.getLineItem()){var c=u.getLineItem();b["offerListing.1"]=c.offerListingId;b["requiresEligibilityCheck.1"]="true"}a||e.getLineItems().forEach(function(a,c){c+=1;b["offerListing."+c]=a.offerListingId;b["quantity."+c]=a.quantity;a.incentivizedCart&&(b["incentivizedCart."+c]=a.incentivizedCart,
b.incentivizedCart=a.incentivizedCart);a.customItemPrice&&(b["customItemPrice."+c]=a.customItemPrice,b.customItemPrice=a.customItemPrice);var d=a.addToCartTimeAsUnixEpochMilliseconds;d&&(b["addToCartTimeAsUnixEpochMilliseconds."+c]=d);(d=a.addToCartSessionId)&&(b["addToCartSessionId."+c]=d);a.concealmentEligibilityType&&(b["concealmentEligibilityType."+c]=a.concealmentEligibilityType)});return b}function E(){var a={"x-amz-support-custom-signin":1};a["x-amz-turbo-checkout-dp-url"]=r.getWindow().location.href;
a["x-amz-checkout-entry-referer-url"]=r.getWindow().location.href;var b=e.getCSRFToken();b&&0<b.length&&(a["x-amz-checkout-csrf-token"]=b);return a}function D(){var d=b.createXHRRequest();d.receivedDataLength=0;d.addEventListener("readystatechange",function(){if(S()&&M&&(3===d.readyState||4===d.readyState)){var b=d.responseText.substring(d.receivedDataLength);0===d.receivedDataLength?a.initiateIFrameContent(b):a.appendToIFrameContent(b);d.receivedDataLength=d.responseText.length}else if(M||!d.readyState||
2>d.readyState)A("Ignoring ready state changed event because headers already received or missing xhr");else if(M=!0,h.logCount("turboCheckoutPrefetchHeadersReceived"),h.logCount("turboCheckoutPrefetchHeadersReceivedDuration",Date.now()-O),d&&d.getResponseHeader("x-amz-turbo-checkout-eligible")){A("Headers received: Turbo eligible");h.logCount("turboCheckoutTurboEligibleAfterCheetahChecks");b=d&&d.getResponseHeader("x-amzn-checkout-login-required");var e=k.isSignInSupported();b&&(A("Headers received: Signin required"),
h.logCount("turboCheckoutSigninRequired"),e||(A("Sign-in required but it is disabled or not supported."),h.logCount("turboCheckoutSigninNotSupported")));if(e||!b)A("Notifying turbo eligible callbacks"),V.callAll(),c.trigger("turbo:checkout:prefetch:onTurboEligible");F(d)&&W.callAll(d.getResponseHeader("x-amzn-checkout-login-provider"));v.isDisableTurboWeblabInTreatment()?(A("Turbo Headers received, But Holdback experiment is in T1,Checking Tango Eligibility"),y(d)):(A("Turbo Headers received, No Holdback experiment and calling TangoIneligible callbacks"),
P.callAll())}else A("Only Tango Headers received, No turbo headers received"),X.callAll(),c.trigger("turbo:checkout:prefetch:onTurboIneligible"),y(d)});return d}function A(a,b){g.logDebug("turbo-checkout-content-loader",a,b)}function y(a){a=v.isBuyNowToTangoCustomerEligibilityCheckRemovalWeblabInTreatment()?e.isProductTangoEligible():a&&a.getResponseHeader("x-amz-tango-checkout-eligible");a?(A("Tango Eligible callback method invoked "),h.logCount("tangoCheckoutEligibleAfterCheetahChecks"),Y.callAll()):
(A("Tango InEligible callback method invoked "),P.callAll())}function F(a){return k.isSignInSupported()&&a&&a.getResponseHeader("x-amzn-checkout-login-required")}function J(a,b,d){h.logCount("turboCheckoutPrefetchEnd",Date.now()-O);L=null;b=d&&d.getResponseHeader("x-amz-turbo-checkout-eligible");var e=a&&a.match(ba);if(e&&0<e.length)try{var f=T(e[0]);var l=T.parseJSON(f.text())}catch(Q){g.logError("Could not extract page state from cheetah page: "+Q)}else A("Could not extract page state from response data");
f=l&&"turbo"===l.pipelineType;e=l&&l.currentPurchaseId&&0<String(l.currentPurchaseId).trim().length;var k=d.getResponseHeader("x-amzn-experiment-weblabs-to-trigger");if(k!==B){var v=[];try{v=JSON.parse(k)}catch(Q){console.error("Error parsing additional weblabs from xhr response header: ",Q)}m.set(v)}f&&!e&&g.logError("No purchaseid provided, cannot show turbo");b&&f&&e?("started"!==H&&g.logError("turbo-checkout-content-loader","Error processing turbo available callbacks. Expected state to be started but was "+
H),A("Notifying turbo available callbacks"),H="success",Z.callAll(a,l),c.trigger("turbo:checkout:prefetch:onSuccess"),h.logCount("turboCheckoutTurboPrefetchSuccess")):b&&F(d)?A("Body received: Eligible and sign-in is supported and required."):d.getResponseHeader("x-amz-checkout-redirect")?r.replace(d.getResponseHeader("x-amz-checkout-redirect")):(A("Body received: No turbo page or not eligible: isTurboEligible: "+b+" isTurboPage: "+f+" hasPurchaseId: "+e),K(),h.logCount("turboCheckoutTurboPrefetchFail"))}
function I(a,b,c){h.logCount("turboCheckoutPrefetchEnd");L=null;A("Error while initiate",c);h.logCount("turboCheckoutTurboPrefetchError");"timeout"===b&&h.logCount("turboCheckoutInitiateTimeOut");K()}function K(){"started"!==H&&g.logError("turbo-checkout-content-loader","Error processing turbo not available callbacks. Expected state to be started but was "+H);A("Notifying error callbacks");H="error";aa.callAll();c.trigger("turbo:checkout:prefetch:onError")}function R(){L&&L.abort&&(A("Aborting running request..."),
L.abort())}function S(){return p.isEnabled()&&!N&&x.isEnabled()}var ba=/<script.*data-a-state.*checkout:conductor:page.*>.*<\/script>/,T=c.$,L,H="stopped",O,M=!1,N=!1,U=f.create("onStart"),Z=f.create("onFinish"),aa=f.create("onError"),V=f.create("onTurboEligible"),X=f.create("onTurboIneligible"),Y=f.create("onTangoEligible"),P=f.create("onTangoIneligible"),W=f.create("onSigninRequired");c.on("turbo:checkout:signInController:onDoSignIn",K);return{registerCallback:function(a){U.push(a);Z.push(a);aa.push(a);
V.push(a);W.push(a);X.push(a);Y.push(a);P.push(a)},callInitiate:function(){A("Calling turbo initiate");n(!1)},checkEligibility:function(){A("Calling turbo eligibility check only");n(!0)},abortCall:R,isSuccess:function(){return"success"===H},isError:function(){return"error"===H},isStarted:function(){return"started"===H},shadowCallChewbaccaInitiate:function(){t.isShadowModeEnabled()&&w.shadowCallChewbaccaInitiate()},isTurboOptimisticFlushingEnabled:S}});"use strict";k.when("A","jQuery","turbo-checkout-ref-tagger",
"turbo-checkout-utils","turbo-checkout-page-ready").register("turbo-checkout-history-manager",function(c,a,d,f){function e(){if(q.history.state&&q.history.state.turboAction)return q.history.state.turboAction}function b(){e();e()||(f.logDebug("turbo-checkout-history-manager","Adding turbo history state"),q.history.pushState({turboAction:"popover"},document.title+" Turbo open"))}var g=!1;a(q).bind("popstate.turbo",function(a){e();g?(f.logDebug("turbo-checkout-history-manager","Trigger Subpanel Back Clicked"),
c.trigger("turbo:checkout:dimmer:clicked"),g=!1,b()):e()?(f.logDebug("turbo-checkout-history-manager","Trigger sheet open"),c.trigger("turbo:checkout:sheet:doOpen")):(f.logDebug("turbo-checkout-history-manager","Trigger sheet close"),c.trigger("turbo:checkout:sheet:doClose",{immediate:!1,reason:d.TAGS.BACK}))});return{sheetOpened:b,sheetClosed:function(){e();e()&&(f.logDebug("turbo-checkout-history-manager","Removing turbo history state"),q.history.back())},subPanelOpened:function(){g=!0},subPanelClosed:function(){g=
!1}}});"use strict";k.when("A","turbo-checkout-page-ready").register("turbo-base-visibility-manager",function(c){function a(){c.trigger("turbo:checkout:page:gone")}return{setup:function(){c.on("turbo:checkout:sheet:onNavigateAway",a)}}});k.when("turbo-configuration","turbo-checkout-page-ready").execute("turbo-mash-will-reappear-check",function(c){c.get(c.KEYS.USES_MASH_WILL_REAPPEAR)||k.when("turbo-base-visibility-manager").register("turbo-checkout-page-visibility-manager",function(a){return a})});
"use strict";k.when("A","jQuery","turbo-checkout-view-state","turbo-checkout-weblab-allocation","turbo-checkout-state-handler","turbo-checkout-content-loader","turbo-checkout-prefetch-timer","turbo-checkout-page-visibility-manager","turbo-checkout-counter","turbo-checkout-utils","turbo-checkout-eligibility-aggregator","turbo-checkout-auto-open","turbo-checkout-page-ready").register("turbo-checkout-prefetcher",function(c,a,d,f,e,b,g,l,h,k,m,u){function n(a){var b=p;p=a;k.logDebug("turbo-checkout-prefetcher",
"Transitioning from "+b.name+" to "+a.name);if(b.onExit)b.onExit(a.name);if(a.onEnter)a.onEnter(b.name);c.trigger("turbo:checkout:prefetcher:state:"+a.name);c.trigger("turbo:checkout:prefetcher:state",a.name)}var w,p,q=function(){var a=b.isError(),c=!m.isTurboOrTangoPrefetchEligible(),d=g.isTimeout(),e=0===w;k.logDebug("turbo-checkout-prefetcher","Test is data stale: isStaleWhenCheetahReturnsError: "+a+" isStaleWhenProductNotEligiblie: "+c+" isStaleWhenTimeoutOccurs: "+d+" isStaleWhenNoMorePrefetchesAvailable: "+
e);return a||c||d||e},r=function(){var a=m.isTurboOrTangoPrefetchEligible()&&!g.isTimeout()&&0<w;k.logDebug("turbo-checkout-prefetcher","Test should prefetch: eligibilityAggregator.isTurboOrTangoPrefetchEligible(): "+m.isTurboOrTangoPrefetchEligible()+" !timer.isTimeout(): "+!g.isTimeout()+" _prefetchesAvailable: "+w);return a},x={name:"start",onEvent:function(a){m.shouldAttemptTurboPrefetch()||m.shouldAttemptTangoPrefetch()?"controller:onPageLoaded"===a&&n(v):(k.logDebug("turbo-checkout-prefetcher",
"Turbo experience is disabled eligibilityAggregator.shouldAttemptTurboPrefetch() is"+m.shouldAttemptTurboPrefetch()+" and product is not Tango eligible since eligibilityAggregator.shouldAttemptTangoPrefetch() is also"+m.shouldAttemptTangoPrefetch()+" Hence customer eligibility prefetch call is not fired"),n(G))},onExit:function(){e.startMonitoringPage()}},v={name:"dataStale",onEvent:function(a){"page:gone"!==a&&"prefetch:onError"!==a&&"sheet:afterClose"!==a&&r()&&n(C)}},C={name:"dataPrefetching",
onEnter:function(){h.incrementPrefetchCounter();f.isPrefetch()||d.isOpeningOrOpen()||u.isAutoOpenReadyToBeOpened()?b.callInitiate():b.checkEligibility();--w},onEvent:function(a){if("page:gone"===a)n(v);else{var c=b.isSuccess()&&f.isPrefetch(),d=b.isSuccess()&&f.isNoPrefetch();k.logDebug("turbo-checkout-prefetcher","Test is data fresh: isFreshWhenPrefetchResultOKInT1: "+c+" isFreshWhenPrefetchResultOKInT4: "+d);c||d?n(B):q()?n(v):"product:onChange"===a&&r()&&n(C)}},onExit:function(a){"dataFresh"!==
a&&b.abortCall()}},B={name:"dataFresh",onEnter:function(){g.startTimer()},onEvent:function(a){"page:gone"===a?n(v):q()?n(v):(d.isClosed()||"product:onChange"===a)&&r()&&n(C)},onExit:function(){g.resetTimer()}},G={name:"end"},E="controller:onPageLoaded sheet:beforeOpen sheet:afterClose product:onChange prefetch:onSuccess prefetch:onError timer:onTimeout page:gone page:reappear".split(" "),D={"sheet:beforeOpen":function(){w=10}};return{setup:function(){w=10;p=x;a.each(E,function(a,b){var d=D[b];c.on("turbo:checkout:"+
b,function(a){k.logDebug("turbo-checkout-prefetcher","Processing "+b);d&&d();if(p.onEvent)p.onEvent(b)})})},getState:function(){return p.name}}});"use strict";k.when("A","turbo-signin-adapter","turbo-checkout-content-loader","turbo-checkout-buy-now-button","turbo-checkout-csm","turbo-checkout-weblab-allocation","turbo-checkout-utils","turbo-callback-list","turbo-checkout-state-handler","turbo-checkout-eligible-state","turbo-checkout-page-ready").register("turbo-checkout-signin-controller",function(c,
a,d,f,e,b,g,l,h,k){function m(){r=!1}function n(a){r=!0;x=a;e.logCount("turboCheckoutSigninRequired")}function t(){var b=r&&k.canShow();b&&(g.logDebug("turbo-checkout-signin-controller","Showing sign in dialog"),e.logCount("turboCheckoutSigninPopup"),a.show(x,w,p),c.trigger("turbo:checkout:signInController:onDoSignIn"));return b}function w(){g.logDebug("turbo-checkout-signin-controller","Signin success");e.logCount("turboCheckoutSigninSuccess");q.callAll()}function p(){g.logDebug("turbo-checkout-signin-controller",
"Signin failed");e.logCount("turboCheckoutSigninFailed")}var q=l.create(),r=!1,x;return{setup:function(){d.registerCallback({onStart:m,onSigninRequired:n});f.registerOnClickCallback(t)},registerCallback:q.push}});"use strict";k.when("A","turbo-configuration","turbo-callback-list","turbo-filtered-callback-list","turbo-initiate-migration-switch","turbo-checkout-page-ready").register("turbo-checkout-iframe",function(c,a,d,f,e){function b(a){if("string"!==typeof a)throw Error("Attempted to write non-string value to iFrame. typeof \x3d "+
typeof a);}function g(){return c.$("#"+u)}function l(){if(!(0<g().length))throw Error("Attempted to read / write the iFrame without it being in the DOM. This would result in an undefined iFrame document.");var a=g()[0];return a.contentDocument||a.contentWindow.document}function h(){if(0<g().length)throw Error("Attempted to insert multiple Turbo Checkout iFrames");}function k(){var a=c.$("\x3ciframe/\x3e",{id:u,src:"about:blank",scrolling:"no","class":"turbo-checkout-blank"});e.isEnabled()&&a.css({borderRadius:"24px 24px 0px 0px"});
return a}function m(a){p.push(a)}var u=a.get(a.KEYS.IFRAME_ID),t=f.create("beforeFramePopulated"),w=f.create("afterFramePopulated"),p=d.create(),q=f.create("beforeOptimisticFlushing"),r=f.create("afterOptimisticFlushing"),x=f.create("csmMarkFirstByte");m(function(a){a.addClass("turbo-checkout-shown")});c.on("turbo:checkout:iframe:document:loaded",function(){p.callAll(g())});return{write:function(a){t.callAll();a+='\x3cscript\x3e"use strict";window.parent.P.now("turbo-checkout-controller").execute("callbackPageController", function callbackPageController(controller) {controller.frameHtmlRendered();});P.when("load").execute("onTurboDocumentLoaded", function onTurboDocumentLoaded() {window.parent.P.when("A").execute("triggerTurboDocumentLoaded", function triggerTurboDocumentLoaded(A) {A.trigger("turbo:checkout:iframe:document:loaded");});});\x3c/script\x3e';
b(a);var c=l();c.open();c.write(a);c.close();w.callAll(g()[0])},remove:function(){g().remove()},appendTo:function(a){h();a.append(k())},insertInto:function(a){h();a.html(k())},hasContent:function(){var a=0<g().length&&l();return a&&(a.body.hasChildNodes()||a.head.hasChildNodes())},registerCallbacks:function(a){t.push(a);w.push(a);q.push(a);r.push(a);x.push(a)},onContentLoaded:m,appendToIFrameDocument:function(a,c){b(c);var d=l();a?(q.callAll(),d.open(),d.write(c),x.callAll()):d.write(c)},finalizeAndAppendCallback:function(){var a=
l();a.write('\x3cscript\x3e"use strict";window.parent.P.now("turbo-checkout-controller").execute("callbackPageController", function callbackPageController(controller) {controller.frameHtmlRendered();});P.when("load").execute("onTurboDocumentLoaded", function onTurboDocumentLoaded() {window.parent.P.when("A").execute("triggerTurboDocumentLoaded", function triggerTurboDocumentLoaded(A) {A.trigger("turbo:checkout:iframe:document:loaded");});});\x3c/script\x3e');a.close();r.callAll()}}});"use strict";
k.when("A","turbo-checkout-page-ready").register("turbo-checkout-view-state",function(c){function a(a,c){return function(){return e===a||e===c}}function d(a){return function(){e=a;f.apply(f,arguments)}}function f(a,d){a&&"string"===typeof a&&c.trigger(a,d)}var e=0;return{isClosed:a(0),isClosing:a(1),isOpen:a(2),isOpening:a(3),isClosingOrClosed:a(1,0),isOpeningOrOpen:a(3,2),setToOpen:d(2),setToOpening:d(3),setToClosed:d(0),setToClosing:d(1)}});"use strict";k.when("turbo-checkout-page-load-spinner",
"turbo-checkout-controller","turbo-checkout-csm","turbo-checkout-page-state","turbo-constants","turbo-checkout-page-ready").register("turbo-checkout-startup",function(c,a,d,f,e){f.get().turboAssetsMode!==e.ASSET_MODE_CLT_CX_ONLY&&(c.removePageLoadSpinner(),d.logCount("turboCheckoutControllerPageLoaded"),a.pageLoaded())});"use strict";k.when("turbo-checkout-assets-load-trigger").register("turbo-checkout-page-ready",function(){q.ue&&q.ue.count&&"undefined"!==typeof q.ue_t0&&q.ue.count("turboCheckoutPageReady",
Date.now()-q.ue_t0)});"use strict";k.when("A","turbo-checkout-csm","turbo-checkout-utils","turbo-checkout-state-handler","turbo-checkout-quantity-input","turbo-checkout-warranty-input","turbo-checkout-accessories-input","turbo-checkout-navigation-window","turbo-checkout-page-ready").register("turbo-checkout-authportal-return-query",function(c,a,d,f,e,b,g,l){function h(a){d.logDebug("turbo-checkout-authportal-return-query",a)}function k(a){return!!a.match("trb_auth\x3d1")}function m(b){if(k(b)){b=
((b||"").match(q)||[])[1]||"";var c=f.getSessionId();d.isNonEmptyString(b)||a.logCount("turboCheckoutPostAuthEmptySessionParameter");d.isNonEmptyString(c)||a.logCount("turboCheckoutPostAuthEmptySessionPageState");d.isNonEmptyString(b)&&d.isNonEmptyString(c)&&b!==c&&(d.logWarning("Turbo Session Flip Detected. Post authentication sessionId \x3d "+c+", Expected \x3d "+b,"turbo-checkout-authportal-return-query"),a.logCount("turboCheckoutPostAuthSessionFlip"))}}var u=/&?(openid|aToken|serial)[^&]*/g,t=
/&?trb_(open|auth|qty|warrAsin|sid|accessory(Asin|Offer))=[^&]*/g,q=/&?trb_sid=([^&]*)/,p=/\?[?&]*/,z=/[?&]{2,}/g;m(l.getWindow().location.search);return{buildFrom:function(a){h("Initial Query \x3d "+a);a=(a||"?").replace(u,"");a=a.replace(t,"");a+="\x26trb_auth\x3d1\x26trb_open\x3d1";var c=e.getQuantity();a+=1<c?"\x26trb_qty\x3d"+c:"";c=b.getLineItem();a+=c&&c.asin?"\x26trb_warrAsin\x3d"+c.asin:"";c=f.getSessionId();a+=0<c.length?"\x26trb_sid\x3d"+c:"";c=f.getActiveId();a+=c?"\x26trb_bid\x3d"+c:
"";c=g.getLineItem();a+=c&&c.asin&&c.offerListingId?"\x26trb_accessoryAsin\x3d"+c.asin+"\x26trb_accessoryOffer\x3d"+c.offerListingId:"";a=a.replace(p,"?").replace(z,"\x26");h("Final Query \x3d "+a);return a},isReturningFromAuthPortal:k,validateSession:m}});"use strict";k.when("turbo-checkout-utils","turbo-checkout-csm","turbo-checkout-authportal-return-query","turbo-checkout-navigation-window","turbo-checkout-page-ready").register("turbo-checkout-signin-utils",function(c,a,d,f){function e(a){return null!==
a.match(g)}function b(){var a=d.buildFrom(f.getWindow().location.search);return encodeURIComponent("https://"+f.getWindow().location.hostname+f.getWindow().location.pathname.replace(k,"/ref\x3dtrb_chk_auth")+a)}var g=/openid\.return_to=([^&$]+)/,k=/(\/ref=[^/]*\/?$|\/?$)/;return{encodeSignInUrl:function(d){if(e(d)){a.logCount("turboCheckoutForceMobileClaimCollection");var f=d.match(g)[1],h=decodeURIComponent(f);f===h&&c.logError("The pre-defined returnTo seems to be un-encoded");h=encodeURIComponent(h+
(-1===h.indexOf("?")?"?":"\x26")+"openid.return_to\x3d"+b());return d.replace(f,h)}return d+(-1===d.indexOf("?")?"?":"\x26")+"openid.return_to\x3d"+b()},isEnforceMobileClaimUrl:function(a){var b=null!==a.match("openid.pape.preferred_auth_policies%3DEnforcePossessionOnMobileClaim")||null!==a.match(decodeURIComponent("openid.pape.preferred_auth_policies%3DEnforcePossessionOnMobileClaim"));a=null!==a.match("intercept%3Dfalse")||null!==a.match(decodeURIComponent("intercept%3Dfalse"));return b&&a},_isReturnToParameterPredefined:e}});
"use strict";k.when("turbo-checkout-utils","turbo-checkout-csm","turbo-checkout-auto-open","turbo-checkout-authportal-return-query","turbo-checkout-signin-utils","turbo-checkout-navigation-window","turbo-checkout-page-ready").register("turbo-checkout-browser-signin",function(c,a,d,f,e,b){function g(){var c=b.getWindow().location.search.match(k)?"turboCheckoutSigninSuccess":"turboCheckoutSigninFailed";a.logCount(c)}var k=/openid\.mode=id_res/;f.isReturningFromAuthPortal(b.getWindow().location.search)&&
(a.logCount("turboCheckoutAuthPortalReturn"),g());return{show:function(c){c=e.encodeSignInUrl(c);a.logCount("turboCheckoutSignInUrlSize",c.length);d.reset();b.assign(c)}}});"use strict";k.when("turbo-checkout-utils","turbo-checkout-state-handler","turbo-checkout-page-ready").register("turbo-checkout-strings",function(c,a){function d(d){return function(){var e=a.getStrings()[d];if(e)return c.escapeHtml(e);c.logDebug("turbo-checkout-strings",'String for key "'+d+'" is undefined! Returning empty string.');
return""}}return{getHeaderText:d("TURBO_CHECKOUT_HEADER"),getLoadingText:d("TURBO_LOADING_TEXT"),getCloseText:d("TURBO_CLOSE_TEXT")}});"use strict";k.when("jQuery","A","turbo-checkout-ref-tagger","turbo-checkout-strings","turbo-initiate-migration-switch","turbo-checkout-page-ready").register("turbo-checkout-loading-spinner",function(c,a,d,f,e){function b(){return c("#turbo-loading-container")}function g(a){var b=c("\x3cdiv\x3e",{id:"turbo-loading-content"}).append(c("\x3cdiv\x3e",{id:"turbo-loading-spinner",
"class":"a-spinner a-spinner-medium"}));if(e.isEnabled()){var d=c("\x3cspan/\x3e",{id:"turbo-checkout-loading-sheet-dimmer-close",tabindex:0,role:"button","aria-label":f.getCloseText()});b.append(d);d.bind("click",k);d.bind("keypress",h)}"string"===typeof a&&a&&b.append(c("\x3cdiv\x3e",{id:"turbo-loading-text",text:a}));return b}function k(){a.trigger("turbo:checkout:sheet:doClose",{reason:d.TAGS.TOUCH_X})}function h(b){13===(b.which||b.keyCode||0)&&(b.preventDefault(),a.trigger("turbo:checkout:sheet:doClose",
{reason:d.TAGS.TOUCH_X}))}return{create:function(a){return c("\x3cdiv\x3e",{id:"turbo-loading-container"}).append(g(a))},get:b,show:function(){b().addClass("turbo-checkout-shown")}}});"use strict";k.when("A","turbo-checkout-utils","turbo-checkout-page-ready").register("turbo-checkout-eligibility-response-weblabs",function(c,a){var d=[];return{set:function(a){c.$.isArray(a)&&(d=a)},get:function(){return d}}});"use strict";k.when("turbo-checkout-csm","turbo-checkout-utils","turbo-checkout-page-ready").register("turbo-checkout-session-storage",
function(c,a){function d(c,d){a.logDebug("turbo-checkout-session-storage",c,d)}return{isPresent:function(a){a:{try{var e=q.sessionStorage.getItem(a);break a}catch(b){c.logCount("turboCheckoutSessionStorageExceptionGet"),d("turboCheckoutSessionStorage get() exception",b)}e=null}return null!==e&&e!==B},set:function(a,e){try{q.sessionStorage.setItem(a,e)}catch(b){c.logCount("turboCheckoutSessionStorageExceptionSet"),d("turboCheckoutSessionStorage set() exception",b)}},remove:function(a){try{return q.sessionStorage.removeItem(a)}catch(e){c.logCount("turboCheckoutSessionStorageExceptionRemove"),
d("turboCheckoutSessionStorage remove() exception",e)}}}});"use strict";k.when("A","turbo-configuration","turbo-checkout-page-ready").register("turbo-checkout-load-events",function(c,a){var d=a.get(a.KEYS.AJAX_PAGE_UPDATE_EVENT);return{bind:function(a){c.off(d,a);c.off("turbo:checkout:controller:onPageLoaded",a);c.on(d,a);c.on("turbo:checkout:controller:onPageLoaded",a)}}});"use strict";k.when("A","jQuery","turbo-checkout-csm","turbo-checkout-utils","turbo-checkout-buy-now-button","turbo-configuration",
"turbo-checkout-page-ready").register("turbo-checkout-event-verification",function(c,a,d,f,e,b){function g(){var a=b.get(b.KEYS.BUY_NOW_CLICK_EVENT).split(".");return 1<a.length?a[1]:"turboCheckout"}function k(a){var b=a.map(function(a){return a.namespace}).filter(function(a,b,c){return c.indexOf(a)===b});a.length!==b.length&&d.logCount("turboCheckoutBuyNowButtonDuplicateClickHandler")}function h(a){if((a=a.filter(function(a){return a!==B&&"click"===a.type&&0<=q.indexOf(a.namespace)}))&&0<a.length){var b=
0;a.forEach(function(a){a.namespace!==g()&&(d.logCount("turboCheckoutBuyNowButtonClickHandlerWhitelisted:"+a.namespace),b++)});0<b&&d.logCount("turboCheckoutBuyNowButtonClickHandlerWhitelistedQuantity:"+b)}}function n(a){if((a=a.filter(function(a){return a!==B&&"click"===a.type&&0>q.indexOf(a.namespace)}))&&0<a.length){var b=0;a.forEach(function(){d.logCount("turboCheckoutBuyNowButtonClickHandlerNotWhitelisted");b++});d.logCount("turboCheckoutBuyNowButtonClickHandlerNotWhitelistedQuantity:"+b)}}var m=
!1,q=[g(),"accessoryUpsellInterstitial","makoPreRegistration","moq","siatc","hctpDFL","bbg","vasBuyNow","ppdBundles","makoGiftingMetrics","financialOptionsCheckout"];return{logBuyNowButtonClickHandlerMetrics:function(){var b=e.getBuyNowButtons();if(!m&&b&&0<b.length){for(var c=0;c<b.length;c++){var g=a._data(b[c],"events");if(!g||!g.click){d.logCount("turboCheckoutBuyNowButtonNoBoundHandlers");return}var l=(g=g.click)?g.length:0;1<l&&(f.logDebug("turbo-checkout-event-verification","Multiple handlers bound to 'click' in Buy Now button. Number of handlers: "+
l,void 0),d.logCount("turboCheckoutBuyNowButtonMultipleClickEventsBound"),d.logCount("turboCheckoutBuyNowButtonMultipleClickEventsBoundQuantity:"+l));k(g);n(g);h(g)}m=!0}}}});"use strict";k.when("turbo-checkout-page-ready").register("turbo-constants",function(){return{ASSET_MODE_TURBO_ONLY:"TURBO_ONLY",ASSET_MODE_CLT_CX_ONLY:"CLT_CX_ONLY",ASSET_MODE_TURBO_AND_CLT_CX:"TURBO_AND_CLT_CX"}});"use strict";k.when("A","turbo-checkout-state-handler","turbo-checkout-ajax-wrapper","turbo-checkout-utils","turbo-checkout-urls",
"turbo-checkout-csm","turbo-checkout-navigation-window","turbo-checkout-page-ready").register("turbo-chewbacca-migration-shadow",function(c,a,d,f,e,b,g){function k(a,b){f.logDebug("turbo-chewbacca-migration-shadow",a,b)}function h(){var a=d.createXHRRequest();a.addEventListener("readystatechange",function(){p||!a.readyState||2>a.readyState?k("Chewbacca Request Ignoring ready state changed event because headers already received or missing xhr"):(p=!0,b.logCount("turboCheckoutChewbaccaHeadersReceived"),
b.logCount("turboCheckoutChewbaccaHeadersReceivedDuration",Date.now()-w),a&&a.getResponseHeader("x-amz-turbo-checkout-eligible")?(k("Chewbacca Request Headers received: Turbo eligible"),b.logCount("turboCheckoutChewbaccaEligible")):(k("Chewbacca Request Headers received: Not turbo eligible"),b.logCount("turboCheckoutChewbaccaNotEligible")))});return a}function n(a,c,d){b.logCount("turboCheckoutChewbaccaCallEnd",Date.now()-w);z=null;c=d&&d.getResponseHeader("x-amz-turbo-checkout-eligible");if((a=a&&
a.match(r))&&0<a.length)try{var e=x(a[0]);var g=x.parseJSON(e.text())}catch(D){f.logError("Chewbacca Request Could not extract page state from chewbacca page: "+D)}else k("Chewbacca Request Could not extract page state from response data");g=(e=g)&&"turbo"===e.pipelineType;e=e&&e.currentPurchaseId&&0<String(e.currentPurchaseId).trim().length;g&&!e&&f.logError("Chewbacca Request No purchaseid provided, cannot show turbo");c&&g&&e?(k("Notifying Chewbacca Request success"),b.logCount("turboCheckoutChewbaccaCallSuccess")):
(k("Notifying Chewbacca Request Fail"),b.logCount("turboCheckoutChewbaccaCallFail"))}function m(a,c,d){b.logCount("turboCheckoutChewbaccaCallEnd");z=null;k("Chewbacca Request Error while initiate",d);b.logCount("turboCheckoutChewbaccaCallError");"timeout"===c&&b.logCount("turboCheckoutChewbaccaInitiateTimeOut")}function q(){var b={isAsync:1};a.getAddressId()&&(b.addressID=a.getAddressId());a.isPhysicalGiftCardExperimentEligible()&&(b.isPhysicalGiftCard=!0);a.getLineItems().forEach(function(a,c){c+=
1;b["offerListing."+c]=a.offerListingId;b["quantity."+c]=a.quantity;a.incentivizedCart&&(b["incentivizedCart."+c]=a.incentivizedCart,b.incentivizedCart=a.incentivizedCart);a.customItemPrice&&(b["customItemPrice."+c]=a.customItemPrice,b.customItemPrice=a.customItemPrice)});return b}function t(){var b={"x-amz-support-custom-signin":1};b["x-amz-turbo-checkout-dp-url"]=g.getWindow().location.href;b["x-amz-checkout-entry-referer-url"]=g.getWindow().location.href;var c=a.getCSRFToken();c&&0<c.length&&(b["x-amz-checkout-csrf-token"]=
c);return b}var w,p=!1,z,r=/<script.*data-a-state.*checkout:conductor:page.*>.*<\/script>/,x=c.$;return{shadowCallChewbaccaInitiate:function(){b.logCount("turboCheckoutChewbaccaInitiate");z&&z.abort&&(k("Aborting running Chewbacca request..."),z.abort());p=!1;w=Date.now();b.logCount("turboCheckoutChewbaccaCallStart");var c=e.buildInitiatePathWith(a.getRefTag(),a.getExperimentName(),a.getClientId(),a.getRequestId(),a.getSessionId(),a.getLineItems(),a.getPrimeStatus(),!0);z=d.loadWithJQXHR(c,{type:"POST",
data:q(),headers:t(),xhr:h,success:n,error:m})}}});"use strict";k.when("A","turbo-checkout-utils","turbo-checkout-page-ready").execute("turbo-checkout-buy-again-workaround",function(c,a){c.on("ride:show",function(){a.logDebug("turbo-checkout-buy-again-workaround","Firing page:gone event to reset prefetches");c.trigger("turbo:checkout:page:gone")})})});
/* ******** */
'use strict';(function(d){var m=window.AmazonUIPageJS||window.P,r=m._namespace||m.attributeErrors,a=r?r("TurboCheckoutDesktopAssets","TurboCheckout"):m;a.guardFatal?a.guardFatal(d)(a,window):a.execute(function(){d(a,window)})})(function(d,m,r){d.when("turbo-configuration-keys","turbo-checkout-page-ready").register("turbo-device-configuration",function(a){if(!b){var b={};b[a.SHOW_SIGN_IN_INTERFACE]="turbo-checkout-browser-signin";b[a.EXTEND_ELIGIBLE_STATE]=!1;b[a.IS_DEVICE_FILTER_REQUIRED]=!0;b[a.VIEW_ADAPTER]=
"turbo-checkout-modal";b[a.WARRANTY_CHECKBOX_INPUT_SELECTOR]="input[id^\x3dmbb-offeringID-]";b[a.WARRANTY_CHECKBOX_RELATIVE_PARENT_SELECTOR]=".abbListItem";b[a.WARRANTY_OFFER_INPUT_SELECTOR]="input[id^\x3dmbb-offeringID-]:checked";b[a.WARRANTY_ASIN_INPUT_NAME]="asin"}return b});"use strict";d.when("A","turbo-checkout-csm","turbo-checkout-utils","turbo-configuration","turbo-checkout-device-variant","turbo-checkout-is-touch-and-orientation-enabled","turbo-checkout-page-ready").register("turbo-checkout-device-filter",
function(a,b,g,d,f,r){function h(a){var c=!1;this.countOnce=function(){c||(b.logCount(a),c=!0)}}function e(a){g.logDebug("turbo-checkout-device-filter",a)}var m="turboCheckoutDisabledDesktopAuiVariant"+f,k,v,c,y,t,n,p;return{isDeviceTurboEligible:function(){k=k||new h("Desktop"===f?"turboCheckoutDesktopAuiVariantEligible":m);var b;(b=v)||(b=g.isInternetExplorer()?"turboCheckoutDisabledDesktopIE":g.isIPad()?"turboCheckoutDisabledDesktopIPad":g.isIPhone()?"turboCheckoutDisabledDesktopIPhone":g.isAndroid()?
"turboCheckoutDisabledDesktopAndroid":"turboCheckoutDesktopUserAgentEligible",b=new h(b));v=b;c=c||new h("turboCheckoutDisabledDesktopTouch");y=y||new h("turboCheckoutDisabledDesktopOrientation");t=t||new h("turboCheckoutDisabledDesktopTouchAndOrientation");n=n||new h("turboCheckoutDisabledTurboDesktopOnDevice");p=p||new h("turboCheckoutEnabledTurboDesktopOnDevice");k.countOnce();"Desktop"===f||e("Aui device variant is NOT Desktop. Turbo will NOT show. Variant is "+f);(b="Desktop"!==f)||(v.countOnce(),
b=!!(g.isInternetExplorer()||g.isIPad()||g.isAndroid()||g.isIPhone()));if(b)return n.countOnce(),!1;if(b=a.capabilities.touch)c.countOnce(),e("Touch enabled device. Turbo will NOT show");var d=a.capabilities.orientation;d&&(y.countOnce(),e("Orientation enabled device. Turbo will NOT show"));b&&d&&t.countOnce();if((b||d)&&!r)return n.countOnce(),!1;p.countOnce();return!0},isSignInSupported:function(){return d.get(d.KEYS.IS_SIGN_IN_SUPPORTED)},isMashBeta:function(){return!1},isBuyNowToTangoSupported:function(){return!0}}});
"use strict";d.when("turbo-checkout-page-ready").execute(function(){d.declare("turbo-checkout-device-variant","Desktop")});"use strict";d.when("A","a-modal","turbo-checkout-csm","turbo-checkout-utils","turbo-checkout-iframe","turbo-checkout-base-view","turbo-checkout-loading-spinner","turbo-checkout-view-state","turbo-checkout-ref-tagger","turbo-checkout-strings","turbo-checkout-navigation-window","turbo-checkout-page-ready").register("turbo-checkout-modal",function(a,b,d,m,f,G,h,e,A,k,v){function c(a){m.logDebug("turbo-checkout-modal",
a)}function g(){!B()||e.isOpeningOrOpen()?c("show() suppressed. View is null or undefined or view state is opening or open"):(e.setToOpening(),p().show())}function t(a){u&&e.isOpeningOrOpen()&&(f.appendTo(w()),a?f.appendToIFrameDocument(!0,u):f.write(u))}function n(){f.remove();if(0<w().length)c("Modal frame is in DOM. Inserting Spinner"),w().height("").html(h.create(k.getLoadingText())).append(z()),q("#turbo-checkout-modal-header").text(k.getHeaderText());else{c("Modal frame is NOT in DOM. Resetting Modal");
var a={inlineContent:q("\x3cdiv\x3e",{id:"turbo-checkout-frame"}).html(h.create(k.getLoadingText())).append(z()).prop("outerHTML"),padding:"none",dataStrategy:"inline",header:'\x3cdiv id\x3d"turbo-checkout-modal-header"\x3e'+k.getHeaderText()+"\x3c/div\x3e"};p().update(a)}}function p(){return C=C||b.get(q("#turbo-checkout-modal"))}function z(){return q("\x3cscript/\x3e",{type:"text/javascript",html:'P.when("A").execute(function turboFrameReady(A) { A.trigger("turbo:checkout:frame:ready"); });'})}
function w(){return q("#turbo-checkout-frame")}function x(a){!B()||e.isClosingOrClosed()?c("close() suppressed. View is undefined or null or view state is closing or closed"):(l=a||l,l.notify=!0===l.notify||l.notify===r,e.setToClosing(),p().hide())}function B(){var a=p();a||c("Modal is undefined or null. Modal \x3d "+a);return a?!0:!1}function D(b){q(document.body).unbind("click");b();a.trigger("turbo:checkout:sheet:onNavigateAway");x({notify:!1,immediate:!0,doNotLog:!0})}function E(a){c("onDismiss");
l={notify:!0,reason:a}}var q=a.$,l={},u,C,F=new (G.extend())("#turbo-checkout-frame");f.onContentLoaded(function(a){h.get().remove()});a.on("a:popover:dismiss:turbo",function(){c("onClick_X");E(A.TAGS.TOUCH_X)});a.declarative("a-popover-floating-close","click",function(){c("onDimmerClicked");E(A.TAGS.TOUCH)});a.on("a:popover:beforeShow:turbo",function(){c("onBeforeOpen");e.setToOpening("turbo:checkout:sheet:beforeOpen");n()});a.on("a:popover:show:turbo",function(){c("onOpen");e.setToOpen();u||h.show()});
a.on("a:popover:beforeHide:turbo",function(){c("onBeforeClose");e.setToClosing.apply(e,!0===l.notify?["turbo:checkout:sheet:beforeClose",l]:r);w().removeClass("turbo-checkout-shown")});a.on("a:popover:hide:turbo",function(){c("onClose");e.setToClosed("turbo:checkout:sheet:afterClose");l={}});a.on("a:popover:afterHide:turbo",n);a.on("turbo:checkout:sheet:doOpen",g);a.on("turbo:checkout:sheet:doClose",x);a.on("turbo:checkout:frame:ready",t);a.on(a.constants.BROWSER_EVENTS.ORIENTATION_CHANGE,function(){d.logCount("turboCheckoutDesktopOrientationChange");
e.isOpen()&&d.logCount("turboCheckoutDesktopOrientationChangeWhenModalOpen")});a.on("turbo:checkout:state:product:resolved",function(){q("#turbo-checkout-modal-header").text(k.getHeaderText())});a.on("turbo:checkout:update:modal:header:afterReload",function(a){null!==a&&q("#turbo-checkout-modal-header").text(a)});return{show:g,setContent:function(a){u=a;c("iFrame content saved");e.isOpeningOrOpen()?t():(c("setFrameContent NOT called"),c("viewState is not opening? isOpeningOrOpen \x3d "+e.isOpeningOrOpen()),
c("iFrame already has content? iFrame.hasContent \x3d "+f.hasContent()))},removeContent:function(){u="";n()},close:x,closeToFullscreen:function(a){D(function(){v.assign(a)})},closeImmediatelyThenExecute:D,closeAndNavigate:function(b){v.assign(b);a.trigger("turbo:checkout:sheet:onNavigateAway");x({notify:!1,doNotLog:!0})},registerCallbacks:f.registerCallbacks,updateBounds:function(a){F.updateBounds(a)},getHeight:function(){return F.getHeight()},updateBottomSheetAttributes:function(){},initiateIFrameContent:function(a){u=
a;e.isOpeningOrOpen()&&!f.hasContent()&&t(!0)},appendToIFrameContent:function(a){f.appendToIFrameDocument(!1,a)},finalizeIFrameContent:function(){f.finalizeAndAppendCallback()}}});"use strict";d.declare("turbo-checkout-is-touch-and-orientation-enabled",!0)});
/* ******** */
'use strict';(function(e){var f=window.AmazonUIPageJS||window.P,g=f._namespace||f.attributeErrors,a=g?g("DetailPageTurboCheckoutDesktopAssets",""):f;a.guardFatal?a.guardFatal(e)(a,window):a.execute(function(){e(a,window)})})(function(e,f,g){e.when("turbo-configuration-keys","turbo-product-state-key","turbo-state-parsing-root-node-selector","turbo-checkout-page-ready").register("turbo-client-configuration",function(a,e,f){var g="asin sessionID timestamp qid sr offeringID buyNow addressID registryID registryItemID quantity rebateId triggerTurboWeblab triggerTurboWeblabName turboPageRequestId turboPageSessionId pipelineType referrer ref_ isBuyNow anti-csrftoken-a2z items[0.base][customerVisiblePrice][amount] items[0.base][customerVisiblePrice][currencyCode] items[0.base][customerVisiblePrice][displayString] items[0.base][asin] clientName items[0.base][offerListingId] pageLoadTimestampUTC offerListingID session-id ASIN isMerchantExclusive merchantID isAddon nodeID sellingCustomerID storeID tagActionCode viewID ctaDeviceType ctaPageType usePrimeHandler smokeTestEnabled rsid sourceCustomerOrgListID sourceCustomerOrgListItemID wlPopCommand items[0.base][quantity] submit.buy-now dropdown-selection dropdown-selection-ubb skipCart custom-name.1.incentivizedCart custom-value.1.incentivizedCart items[0.base][additionalParameters][incentivizedCart] ue_back".split(" "),
h="items[0.freebies][additionalParameters][itemAssociation][associatedItemId] items[0.freebies][additionalParameters][itemAssociation][deleteConstraint][mutuallyInclusive] items[0.freebies][additionalParameters][itemAssociation][programType] items[0.freebies][additionalParameters][itemAssociation][properties][accessoryType] items[0.freebies][additionalParameters][itemAssociation][renderType] items[0.freebies][asin] items[0.freebies][offerListingId] items[0.freebies][quantity]".split(" "),k="items[0.warranty][additionalParameters][itemAssociation][associatedItemId] items[0.warranty][additionalParameters][itemAssociation][deleteConstraint][mutuallyInclusive] items[0.warranty][additionalParameters][itemAssociation][programType] items[0.warranty][additionalParameters][itemAssociation][quantityConstraint][invarianceFactor] items[0.warranty][additionalParameters][itemAssociation][quantityConstraint][quantityEditable] items[0.warranty][additionalParameters][itemAssociation][renderType] items[0.warranty][asin] items[0.warranty][offerListingId] items[0.warranty][quantity]".split(" "),
l="items[0.base][additionalParameters][itemAssociation][associatedItemId] items[0.base][additionalParameters][itemAssociation][deleteConstraint][mutuallyInclusive] items[0.base][additionalParameters][itemAssociation][programType] items[0.base][additionalParameters][itemAssociation][renderType] items[0.vasItem][additionalParameters][itemAssociation][associatedItemId] items[0.vasItem][additionalParameters][itemAssociation][deleteConstraint][mutuallyInclusive] items[0.vasItem][additionalParameters][itemAssociation][programType] items[0.vasItem][additionalParameters][itemAssociation][renderType] items[0.vasItem][asin] items[0.vasItem][offerListingId] items[0.vasItem][quantity]".split(" "),
b={};g.forEach(function(a){b[a]="PAX_CHECKOUT_BUY_NOW_TO_TANGO_DESKTOP_EXPERIMENT_969581"});l.forEach(function(a){b[a]="PAX_CHECKOUT_VAS_ENABLE_BUY_NOW_TANGO_1165794"});k.forEach(function(a){b[a]="CETECH_CHECKOUT_WARRANTIES_ENABLE_BUY_NOW_TANGO_1184394"});b["items[0.base][additionalParameters][giftOptions][includeGiftReceipt]"]="UPMT_CHECKOUT_BUY_NOW_GIFT_TANGO_DESKTOP_1044576";b["gift-wrap"]="UPMT_CHECKOUT_BUY_NOW_GIFT_TANGO_DESKTOP_1044576";b.paymentOfferInfo="PAX_CHECKOUT_BUY_NOW_UFO_TANGO_DESKTOP_1118473";
b["items[0.base][additionalParameters][paymentOfferInfo]"]="PAX_CHECKOUT_BUY_NOW_UFO_TANGO_DESKTOP_1118473";b.inHouseInstallments="PAX_CHECKOUT_BUY_NOW_AMP_TANGO_DESKTOP_1118500";b["installments-check"]="PAX_CHECKOUT_BUY_NOW_AMP_TANGO_DESKTOP_1118500";b.isInstallmentsChecked="PAX_CHECKOUT_BUY_NOW_AMP_TANGO_DESKTOP_1118500";b["items[0.base][additionalParameters][installments][programId]"]="PAX_CHECKOUT_BUY_NOW_AMP_TANGO_DESKTOP_1118500";b["installments-programId"]="PAX_CHECKOUT_BUY_NOW_AMP_TANGO_DESKTOP_1118500";
b["items[0.base][additionalParameters][giftCardMetadata][amount][amount]"]="PAX_CHECKOUT_BUY_NOW_GC_TANGO_1121297";b["items[0.base][additionalParameters][giftCardMetadata][amount][currencyCode]"]="PAX_CHECKOUT_BUY_NOW_GC_TANGO_1121297";b["items[0.base][additionalParameters][giftCardMetadata][amount][displayString]"]="PAX_CHECKOUT_BUY_NOW_GC_TANGO_1121297";b["items[0.base][additionalParameters][giftCardMetadata][type]"]="PAX_CHECKOUT_BUY_NOW_GC_TANGO_1121297";h.forEach(function(a){b[a]=""});var c=
{};g.forEach(function(a){c[a]="PAX_CHECKOUT_BUY_NOW_TO_TANGO_DESKTOP_EXPERIMENT_NON_PRIME_1088576"});l.forEach(function(a){c[a]="PAX_CHECKOUT_VAS_ENABLE_BUY_NOW_TANGO_1165794"});k.forEach(function(a){c[a]="CETECH_CHECKOUT_WARRANTIES_ENABLE_BUY_NOW_TANGO_1184394"});c["items[0.base][additionalParameters][giftOptions][includeGiftReceipt]"]="UPMT_CHECKOUT_BUY_NOW_GIFT_TANGO_DESKTOP_1044576";c["gift-wrap"]="UPMT_CHECKOUT_BUY_NOW_GIFT_TANGO_DESKTOP_1044576";c.paymentOfferInfo="PAX_CHECKOUT_BUY_NOW_UFO_TANGO_DESKTOP_1118473";
c["items[0.base][additionalParameters][paymentOfferInfo]"]="PAX_CHECKOUT_BUY_NOW_UFO_TANGO_DESKTOP_1118473";c.inHouseInstallments="PAX_CHECKOUT_BUY_NOW_AMP_TANGO_DESKTOP_1118500";c["installments-check"]="PAX_CHECKOUT_BUY_NOW_AMP_TANGO_DESKTOP_1118500";c.isInstallmentsChecked="PAX_CHECKOUT_BUY_NOW_AMP_TANGO_DESKTOP_1118500";c["items[0.base][additionalParameters][installments][programId]"]="PAX_CHECKOUT_BUY_NOW_AMP_TANGO_DESKTOP_1118500";c["installments-programId"]="PAX_CHECKOUT_BUY_NOW_AMP_TANGO_DESKTOP_1118500";
c["items[0.base][additionalParameters][giftCardMetadata][amount][amount]"]="PAX_CHECKOUT_BUY_NOW_GC_TANGO_1121297";c["items[0.base][additionalParameters][giftCardMetadata][amount][currencyCode]"]="PAX_CHECKOUT_BUY_NOW_GC_TANGO_1121297";c["items[0.base][additionalParameters][giftCardMetadata][amount][displayString]"]="PAX_CHECKOUT_BUY_NOW_GC_TANGO_1121297";c["items[0.base][additionalParameters][giftCardMetadata][type]"]="PAX_CHECKOUT_BUY_NOW_GC_TANGO_1121297";h.forEach(function(a){c[a]=""});if(!d){var d=
{};d[a.HOST_PAGE_TYPE_IDENTIFIER]="detail";d[a.IS_BUY_NOW_TO_TANGO_ENABLED]=!0;d[a.IS_BUY_NOW_TO_TANGO_PRIME_SPLIT]=!0;d[a.BUY_NOW_TO_TANGO_PARAMETER_EXCLUSION_LIST_PRIME]=b;d[a.BUY_NOW_TO_TANGO_PARAMETER_EXCLUSION_LIST_NON_PRIME]=c;d[a.BUY_NOW_ONLY_TREATMENT]="T1";d[a.NO_PREFETCH_TREATMENT]=/T[2-9]/;d[a.ADDRESS_INPUT_SELECTORS]=["#unifiedLocation1ClickAddress","#addToCart input[name\x3d'dropdown-selection']","#unifiedLocationAddress","input[name\x3d'dropdown-selection']"];d[a.QUANTITY_SELECT_SELECTOR]=
"#quantity";d[a.CONFLICTING_INITIATE_LISTENERS]=["click.siatc"];d[a.VAS_CHANGE_EVENTS]=["vas:remove-service-asin-buybox-event","vas:add-service-asin-buybox-event"];d[a.VAS_CHECKBOX_SELCTOR]="#ppdb-add-service-checkbox";d[a.SESSION_ID_SELECTOR]='input[name\x3d"session-id"]';d[a.TURBO_PRODUCT_STATE_KEY]=e;d[a.PAGE_STATE_PARSING_ROOT_NODE_SELECTOR]=f;d[a.PRODUCT_STATE_PARSING_ROOT_NODE_SELECTOR]=f}return d});"use strict";e.when("turbo-checkout-page-ready").execute(function(){e.declare("turbo-product-state-key",
"turbo-checkout-page-state")});"use strict";e.when("turbo-checkout-page-ready").execute(function(){e.declare("turbo-state-parsing-root-node-selector","#turboState")})});
/* ******** */
