(function(d){var m=window.AmazonUIPageJS||window.P,f=m._namespace||m.attributeErrors,b=f?f("DetailPageImageBlockSubAssets@controller","DetailPageImageBlockSubAssets"):m;b.guardFatal?b.guardFatal(d)(b,window):b.execute(function(){d(b,window)})})(function(d,m,f){d.when("A","imageBlockUtils").register("ImageBlockModel",function(b,c){function p(b,a,q,e,n,h){c.isDefined(b)&&(g.type=b);c.isDefined(a)&&(g.index=a);c.isDefined(q)&&(g.thumbnailIndex=q);c.isDefined(e)&&(g.variant=e);c.isDefined(n)&&(g.color=
n);g.shoppableScene=h||null}function k(b){p("image",0,0,"MAIN",b||a.landingAsinColor||a.defaultColor,null)}function e(a){a=a.data;l=b.copy(g);p(a.type,a.index,a.thumbnailIndex,a.variant,a.color,a.shoppableScene)}function h(a){e(a);a=b.copy(a);a.data=b.copy(g);n.dispatch("updateView",a)}function d(){l=b.copy(g);k(g.color)}var a,n,g={},l={},m,f;return function(c,r){n=r;a=c;n.register("updateSelection",h);n.register("updateModel",e);n.register("resetModel",d);this.init=function(){k()};this.getCurrentItem=
function(){return b.copy(g)};this.getPreviousItem=function(){return b.copy(l)};this.setCurrentEvent=function(a){m=a};this.getCurrentEvent=function(){return m};this.setImmersiveViewModalInstance=function(a){f=a};this.getImmersiveViewModalInstance=function(){return f};this.updateTitle=function(b){a.title=b};this.setToPreviousItem=function(){p(l.type,l.index,l.thumbnailIndex,l.variant,l.color,l.shoppableScene)};this.setToCurrentItem=function(a){p(a.type,a.index,a.thumbnailIndex,a.variant,a.color,a.shoppableScene)}}});
"use strict";d.when("imageBlockUtils").register("ImageBlockState",function(b){return function(c,d,k){this.getImageHash=function(e){var h=k.getCurrentItem();e=b.getIndexForVariant(h.color,e||"MAIN",c);return b.getImageHash(h.color,e,c)};this.onImageUpdateForTwister=function(b){d.register("updateSelection",function(c){"swatchClick"===c.type&&"function"===typeof b&&b()})}}});"use strict";d.when("jQuery","ImageBlockModel","ImageBlockView","imageBlockUtils","ImageBlockState").register("ImageBlockController",
function(b,c,d,k,e){var h={};return function(f){var a=this;a.dispatch=function(a,c){a=h[a];k.isDefined(a)&&b.each(a,function(a,b){b.call(m,c)})};a.register=function(a,b){k.isDefined(h[a])||(h[a]=[]);"function"===typeof b&&h[a].push(b)};a.model=new c(f,a);a.view=new d(f,a,a.model);a.api=new e(f,a,a.model);a.init=function(){a.model.init();a.view.init()};a.init()}});"use strict";d.when("jQuery","ImageBlockController","ImageBlockATF","ImageBlockBTF").register("ImageBlock",function(b,c,f,k){b=b.extend(!0,
{},f,k);var e=new c(b);d.register("ImageBlockAPI",function(){return e.api});return e})});
/* ******** */
(function(O){var p=window.AmazonUIPageJS||window.P,R=p._namespace||p.attributeErrors,ca=R?R("DetailPageImageBlockSubAssets@baseViews","DetailPageImageBlockSubAssets"):p;ca.guardFatal?ca.guardFatal(O)(ca,window):ca.execute(function(){O(ca,window)})})(function(O,p,R){function ca(g,b,f){b in g?Object.defineProperty(g,b,{value:f,enumerable:!0,configurable:!0,writable:!0}):g[b]=f;return g}O.when("A","jQuery","imageBlockUtils","ImageBlockLoader","postMetric","logFailedInteractionMetric","postEarlyMetric").register("ImageBlockAdditionalAltImageView",
function(g,b,f,P,l,K,B){function G(k,a,c,e,m){if(!f.isjQueryObjDefined(k.find(".a-button-selected"))){var d=w.getCurrentItem();if(!e||"chromeless-video"!==d.type||!h.autoplayVideo){e=0;"image"===d.type&&(e=Math.max(f.getIndexForVariant(d.color,d.variant,h),0));var z=0;f.isDefined(h.heroImage[d.color])&&(z=h.heroImage[d.color].length);m=e-(a>=h.maxAlts?h.maxAlts-m-z:0);a=0<=m?a+m:e+z;a>=c&&(e=0,a=z);c=f.getImageHash(d.color,e,h);-1!==c&&(q.dispatch("updateModel",{data:{index:e,thumbnailIndex:a,variant:c.variant,
type:"image",shoppableScene:c.shoppableScene}}),c=k.find(".item").get(a),f.selectGivenThumbnail(b(c),k))}}}function u(b){if(!h.useChildVideos)return f.lazyLoadingRequired(w.getCurrentItem(),w,h)?void 0:h.videos;if(h.colorToVideo[b])return h.colorToVideo[b];var a=h.colorToAsin[b];if(a&&a.asin){var c={};c.params={asin:a.asin,productGroupID:h.productGroupID,useAiryVideoPlayer:!0,useChromelessVideoPlayer:h.useChromelessVideoPlayer,isUDP:h.isUDP};h.isDPXFeatureEnabled||(c.success=function(a){videosOnTwisterRefresh(a)},
P.load(VIDEO_AJAX_ENDPOINT,c));return h.colorToVideo&&h.colorToVideo[b]}}function L(d,a,c){if((2===h.unrolledImageBlockTreatment||3===h.unrolledImageBlockTreatment)&&c)return d;var e=u(a),m=f.isDefined(e)&&0<e.length&&h.alwaysIncludeVideo?1:0;a=h.colorImages&&h.colorImages[a];e=d;var g=0;f.isDefined(a)&&(b.each(a,function(a,c){if(g>=h.maxAlts-m&&d<h.maxAlts+h.additionalNumberOfImageAlts){if(2===h.unrolledImageBlockTreatment||3===h.unrolledImageBlockTreatment){var e=b(".thumbItemUnrolled");e[d]?e[d].querySelector("img").src=
c.thumb:b('\x3cli class\x3d"thumbItemUnrolled thumbTypeimage thumbIndex'+a+'"\x3e\x3cspan class\x3d"a-list-item"\x3e \x3cspan class\x3d"a-button a-button-thumbnail a-button-toggle" id\x3d"a-autoid-'+(d+1)+'"\x3e\x3cspan class\x3d"a-button-inner"\x3e\x3cinput class\x3d"a-button-input" type\x3d"submit" aria-labelledby\x3d"a-autoid-'+(d+1)+'-announce"\x3e\x3cspan class\x3d"a-button-text" aria-hidden\x3d"true" id\x3d"a-autoid-'+(d+1)+'-announce"\x3e \x3cimg alt\x3d"" src\x3d"'+c.thumb+'"\x3e \x3c/span\x3e\x3c/span\x3e\x3c/span\x3e \x3c/span\x3e\x3c/li\x3e').appendTo(b(".regularAltImageViewLayout"))}else f.createThumbnail({type:"image",
index:a,thumbnailIndex:d,variant:c.variant,shoppableScene:c.shoppableScene},c.thumb,k,"imageThumbnail");d++}g++}),K.isEnabled&&B.logAltImgRequestPlacedOnThumbnails(b,K,w),G(k,e,d,c,m));return d}function C(b,a){h.useIV&&f.isDefined(a.hiRes)&&b.css("cursor","pointer")}function A(d,a){if("image"===d.type&&W){var c=b("#image-canvas-caption #canvasCaption"),e=h.staticStrings,k=h.colorImages,m=d.color,r=d.index,q=!0;var w='\x3ca href\x3d"#"\x3e'+e.clickForFullView+"\x3c/a\x3e";f.isShoppableScenesEnabled()&&
d.shoppableScene?w=e.clickSceneTagsToShopProducts:a&&h.useIV?(w='\x3ca href\x3d"#"\x3e'+e.clickForFullView+"\x3c/a\x3e",q=!0):k[m]&&k[m][r].hiRes&&h.useHoverZoom?(h.useHoverZoomIpad?w=e.touchToZoom:h.useClickZoom&&(w=e.clickToZoom),h.hoverZoomIndicator&&(w="\x3cimg src\x3d'"+h.staticImages.hoverZoomIcon+"'/\x3e\x26nbsp;"+w)):h.useIV&&(w='\x3ca href\x3d"#"\x3e'+e.clickForFullView+"\x3c/a\x3e",q=!0);c.html(w);q&&(d=b("#image-canvas-caption #canvasCaption a"),g.declarative.create(d,"iv-open-caption-click"))}}
function x(d,a){var c="a-dynamic-image";if(!h.acEnabled){var e;b.each(d.main,function(a,c){f.isDefined(e)||(e=parseFloat(c[1]/c[0])<=parseFloat(h.holderRatio)?" a-stretch-vertical":" a-stretch-horizontal")});c+=e}var k=f.getMaxDimensionsOfMainImage(d.main,D,h),m=k[0],g=k[1];k=b("\x3cdiv\x3e\x3c/div\x3e");m={"max-height":m,"max-width":g};k.addClass(c).css(m).attr({"data-old-hires":d.hiRes,"data-a-manual-replacement":"true",onload:a}).data("a-dynamic-image",d.main);return k}function t(f,a,c){var e=
"desktop-dp-atf-ib-shoppablescenes-tags-"+f;"function"==typeof uet&&uet("bb",e,{wb:1});c.attr("data-a-image-name","shoppable-scene:"+f);c=v.find(".mirai-scene-image-block-template").clone().removeClass("mirai-scene-image-block-template aok-hidden").addClass("mirai-shoppable-scene");c.addClass("celwidget").attr("cel_widget_id",e);c.children("span").css("display","inline-block");q.dispatch("initialize-shoppable-scene",{index:f,shoppableScene:a.shoppableScene,imageSource:a.hiRes||a.large||a.lowRes,$tagPlaceholder:c.find(".mirai-scene-tag-placeholder"),
$viewProductsButton:c.find(".mirai-scene-view-products-button")});"MutationObserver"in p&&(new MutationObserver(function(c,e){c.forEach(function(c){"childList"===c.type&&c.target.classList.contains("mirai-scene-image-block-tag-container")&&1===c.addedNodes.length&&"IMG"===c.addedNodes[0].tagName&&""!==c.addedNodes[0].src&&(c=c.addedNodes[0],"function"!==typeof c.onload&&(c.onload=function(){g.trigger("shoppable-scene-image-loaded",{index:f,shoppableScene:a.shoppableScene})}),e.disconnect())})})).observe(c.find(".mirai-scene-image-block-tag-container")[0],
{subtree:!0,childList:!0,attributes:!1});"function"==typeof uet&&uet("cf",e,{wb:1});return c}function y(d,a,c){c=x(d,c);d=f.isShoppableScenesEnabled()&&d.shoppableScene?t(a,d,c):v.find(".mainImageTemplate").clone().removeClass("template mainImageTemplate");d.addClass("image item itemNo"+a+" maintain-height").attr({"data-csa-c-type":"uxElement","data-csa-c-element-type":"navigational","data-csa-c-action":"image-block-main-image-hover","data-csa-c-posy":a+1});d.find(".placeHolder").replaceWith(c);v.find(".list").append(d);
g.loadImageManually(c);return d}function M(d){var a=D.css("height");null!==a&&d.find(".imgTagWrapper").css("height",a);d.addClass("selected");h.imgTagWrapperClasses&&d.find(".imgTagWrapper").addClass(h.imgTagWrapperClasses)}function H(d,a,c,e){if(2!==h.unrolledImageBlockTreatment&&3!==h.unrolledImageBlockTreatment||e||"unavailable"===d.type){if("image"===d.type||"unavailable"===d.type||"lazy-loaded"===d.type){c=f.getImageHash(d.color,d.index,h);if(-1===c)return a={data:{index:0,thumbnailIndex:0,variant:"",
type:"unavailable"}},f.lazyLoadingRequired(d,w,h)||(q.dispatch("updateModel",a),f.showUnavailable(d.color)),-1;e=v.find(".item.itemNo"+d.thumbnailIndex);f.isjQueryObjDefined(e)||(e=y(c,d.thumbnailIndex,a));M(e);q.dispatch("loadMagnifier");A(d);C(e,c);g.trigger("dp:image-block:update",c)}}else{d=h.colorImages&&h.colorImages[c];a=b(".unrolledImg");c=u(c);var k=f.isDefined(c)&&0<c.length&&h.alwaysIncludeVideo?1:0;a.length>h.maxAlts&&a.each(function(a){a>=h.maxAlts&&b(this).remove()});f.isDefined(d)&&
b.each(d,function(a,c){a<h.maxAlts-k+h.additionalNumberOfImageAlts&&a>=h.maxAlts-k&&b('\x3cli data-csa-c-action\x3d"image-block-main-image-hover" data-csa-c-element-type\x3d"navigational" data-csa-c-posy\x3d"'+(a+k+1)+'" data-csa-c-type\x3d"uxElement" class\x3d"image item itemNo'+(a+k)+' unrolledImg imgMedia"\x3e\x3cspan class\x3d"a-list-item"\x3e \x3cspan class\x3d"a-declarative" data-action\x3d"main-image-click" data-csa-c-type\x3d"widget" data-csa-c-func-deps\x3d"aui-da-main-image-click" data-main-image-click\x3d"{}" data-ux-click\x3d""\x3e \x3cdiv id\x3d"imgTagWrapperId" class\x3d"imgTagWrapper"\x3e \x3cdiv id\x3d"unrolledImgNo'+
(a+k)+'"\x3e \x3cdiv class\x3d"a-image-container a-dynamic-image-container greyBackground" style\x3d"width:100%; height:600px;"\x3e \x3cimg alt\x3d"" src\x3d"'+c.large+'" data-a-hires\x3d"'+c.hiRes+'"\x3e \x3c/div\x3e \x3c/div\x3e\x3c/div\x3e\x3c/span\x3e \x3c/span\x3e\x3c/li\x3e').appendTo(b(".unrolledScrollBox .list-unrolled"))})}}function I(d){var a=w.getCurrentItem().color;h.colorImages[a]||(h.colorImages[a]=d);d={type:"updatedData",data:w.getCurrentItem()};q.dispatch("updateView",d);(a=h.colorToAsin[a])&&
a.asin&&O.register(f.rankedImagesReadyEvent(a.asin))}function N(){var d=v.find(".item .imgTagWrapper"),a=f.getContainerHeight(D,h.holderRatio,h.holderMaxHeight);0<a&&(D.height(a),d.height(a));v.find("img.a-dynamic-image").each(function(){var a=b(this);a.data("a-manual-replacement")&&g.loadDynamicImage(this);var d=a.data("a-dynamic-image");d=f.getMaxDimensionsOfMainImage(d,D,h);a.css({"max-height":d[0]+"px","max-width":d[1]+"px"})})}function m(d){A(w.getCurrentItem(),"mouseenter"===d.type)}var d,h,
w,q,k,v,D,J,W=(l=g.state("imageBlockStateData"))?!l.shouldRemoveCaption:!0;return function(l,a,c,e){d=this;h=l;w=a;q=e;g.on("triggerImageAjax",I);h.colorImages[h.landingAsinColor]=h.colorImages[h.defaultColor];d.render=function(a,c,d,e,m,n,g){v=d;k=e;D=m;J=L(c,a,n);n||(c=w.getCurrentItem(),f.lazyLoadingRequired(c,w,h)&&q.dispatch("updateModel",{data:{type:"lazy-loaded"}}));c=w.getCurrentItem();d=!n;f.lazyLoadingRequired(c,w,h)||(b("#imageBlock").css("opacity","1"),v.css("opacity","1"),f.spinner(v,
!1),v.find("li").removeClass("selected"),W&&b("#image-canvas-caption #canvasCaption").empty(),f.hideUnavailable(),d&&v.find(".list .item").remove());H(w.getCurrentItem(),g,a,n);return J};d.update=function(a){};h.overrideAltImageClickAction&&f.addTag("clickEnabledOnAltImages");q.register("imageHover",m);q.register("resize",N)}});"use strict";O.when("A","jQuery","imageBlockUtils").register("ImageBlockAltImageIngressView",function(g,b,f){var p,l,K,B;return function(b,u,P,C){p=this;l=b;K=C;p.render=function(b,
u,t,y,P,H,I){B=y;p=this;t=l.maxAlts;y=u;P=l.colorImages[b]?l.colorImages[b].length:0;P+=f.getVideosCount(b,l);b=l.heroImage[b];H=0;b&&(H=b.length);b=P+H;b>t&&(t=b-t,b=B.find(".altIngressTemplate").clone().removeClass("altIngressTemplate").removeClass("aok-hidden").addClass("item"),t+="+",y={type:"ingress",index:0,thumbnailIndex:u,variant:""},b.find("#altIngressText").append(t),g.declarative.create(b,"thumb-action",y),B.append(b),y=u++);return y};p.update=function(b){"ingress"===b.data.type&&"click"===
b.type&&K.dispatch("imageClick",b)}}});"use strict";O.when("A","jQuery","imageBlockUtils","ImageBlockHeroUtils").register("ImageBlockHeroImageView",function(g,b,f,p){function l(m,d,h,g){if(!f.isjQueryObjDefined(m.find(".a-button-selected"))){var q=y.getCurrentItem();if(!g||"chromeless-video"!==q.type||!t.autoplayVideo){g=0;if("hero-image"===q.type){g=B(q.color,q.variant);if(-1===g)return;g=-1!==g?g:0}var k=d+g;k>=h&&(g=0,k=d);d=p.getHeroImageHash(t,q.color,g);-1!==d&&(M.dispatch("updateModel",{data:{index:g,
thumbnailIndex:k,variant:d.variant,type:"hero-image"}}),d=m.find(".item").get(k),f.selectGivenThumbnail(b(d),m))}}}function P(m,d,h){if("hero-video"===y.getCurrentItem().type)return m;d=t.heroImage&&t.heroImage[d];var g=m;f.isDefined(d)&&(b.each(d,function(d,b){m<t.maxAlts&&(f.createThumbnail({type:"hero-image",index:d,thumbnailIndex:m,variant:b.variant},b.thumb,H,"imageThumbnail"),m++)}),l(H,g,m,h));return m}function B(m,d){var h=t.heroImage;if(1>h.length||!f.isDefined(h[m])||!f.isDefined(d))return-1;
var g=-1;b.each(h[m],function(b,f){f.variant===d&&(g=b)});return g}function G(){if(I.length&&t.repositionHeroImage){var b=p.getHeroDimParams(t,y.getCurrentItem());if(f.isDefined(b)){var d=f.isDefined(b.xPos)?b.xPos+"px "+b.yPos+"px ":"center "+b.yPos+"px ";I.css({"background-position":d,"background-size":b.width+"px "+b.height+"px ","max-width":b.width+"px ","min-height":b.height+"px ",filter:"","-ms-filter":""})}}}function u(b,d,h,g){if(I.length&&b&&d){if("function"===typeof h||g){var m=new Image;
m.onload=g?function(){I.css("background-image",'url("'+b+'")')}:h;m.src=b}h=d[1];m=d[0];g||I.css({"background-image":'url("'+b+'")'});if(t.repositionHeroImage&&(d=p.getHeroDimParams(t,y.getCurrentItem(),d),f.isDefined(d))){h=d.width;m=d.height;var k=f.isDefined(d.xPos)?d.xPos+"px "+d.yPos+"px ":"center "+d.yPos+"px "}I.css({"background-position":k,"background-size":h+"px "+m+"px ","max-width":h+"px ","min-height":m+"px ",filter:"","-ms-filter":""})}}function L(f,d,g,l){f=p.getHeroImageHash(t,f,d);
if(-1===f)return-1;d=b.map(f.main,function(d,b){return b})[0];u(d,f.main[d],g,l)}function C(b,d,f){if("hero-image"!==b.type)return-1;var g=B(b.color,y.getCurrentItem().variant);g=-1!==g?g:0;if(-1===p.getHeroImageHash(t,b.color,g))return-1;var m=y.getCurrentItem();b.thumbnailIndex=m.thumbnailIndex;b.type=m.type;b.variant=m.variant;b.index=g;A(b,d,f)}function A(b,d,f){var m=p.getHeroImageHash(t,b.color,b.index);var h=b&&N&&g.equals(b,N)?!0:!1;N||(N=b);if(!h&&b||d)L(b.color,b.index,d,f),N=b;I.removeClass("hide-background");
g.trigger("dp:image-block:update",m)}var x,t,y,M,H,I,N={};return function(g,d,h,l){x=this;t=g;y=d;M=l;t.heroImage[t.landingAsinColor]=t.heroImage[t.defaultColor];x.render=function(d,f,g,h,m,l,w){H=h;I=b("#heroImage");d=P(f,d,l);C(y.getCurrentItem(),w,l);return d};x.update=function(b){var d=b.data;"ingress"!==d.type&&I.addClass("hide-background");"swatchHover"===b.type?b.captured||(d.type=y.getCurrentItem().type,-1!==C(d)&&(b.captured=!0)):"hero-image"===d.type&&(A(d),"click"!==b.type&&t.usePeekHover||
f.selectGivenThumbnail(b.$declarativeParent,H))};M.register("resize",G)}});"use strict";O.when("A","jQuery","imageBlockUtils","postMetric","logFailedInteractionMetric","postEarlyMetric").register("ImageBlockMagnifierView",function(g,b,f,P,l,K){function B(b){H?b.css("cursor","url('"+A.staticImages.zoomIn+"'), auto"):(b.css("cursor","-webkit-zoom-in"),b.css("cursor","-moz-zoom-in"),b.css("cursor","zoom-in"))}function G(b){var d=b.match(/\._((\w|,|\.)+)_\.(gif|jpg|png)$/i);b={};if(f.isDefined(d)){d=
d[1].split("_");for(var g=0;g<d.length;g++){var m=d[g].match(/^([A-Z]+)(\d+(\.\d+)?)$/);f.isDefined(m)&&(b[m[1]]=parseInt(m[2],10))}}return b}function u(m,d){function h(){if(d.useClickZoom){var a=d.offsetInClickZoom;a=[Math.min(1,Math.max(0,C[0]-(S[0]+a))/(S[2]-2*a)),Math.min(1,Math.max(0,C[1]-(S[1]+a))/(S[3]-2*a))]}else a=x&&x.updatePosition();if(a&&r&&r.detailSize){var c=[r.detailSize[0]-r.rect.width,r.detailSize[1]-r.rect.height];g.capabilities.rtl?r.detailImage.get(0).style.right=-(a[0]*c[0])+
"px":r.detailImage.get(0).style.left=-(a[0]*c[0])+"px";r.detailImage.get(0).style.top=-(a[1]*c[1])+"px"}}function w(a){return a.offsetParent().hasClass("a-dynamic-image-container")}function q(a){var c=T?a.originalEvent.touches[0]||a.originalEvent.changedTouches[0]:"";C=T?[c.pageX,c.pageY]:[a.pageX,a.pageY];if(g.capabilities.rtl){var d=b(p).width();C=T?[d-c.pageX,c.pageY]:[d-a.pageX,a.pageY]}}function k(a){q(a);d.useClickZoom?a=[S[0],S[1],S[0]+S[2],S[1]+S[3]]:(a=x?x.offset:m.offsetParent().offset(),
a=A.acEnabled?[a.left,a.top,z.width()+a.left,z.height()+a.top]:[n[0]+a.left,n[1]+a.top,n[0]+n[2]+a.left,n[1]+n[3]+a.top]);return C[0]<a[0]||C[1]<a[1]||C[0]>=a[2]||C[1]>=a[3]||A.acEnabled&&!w(m)?!0:!1}function v(a){T&&a.preventDefault();N=k(a)?!1:!0}function u(a){T&&a.preventDefault();k(a)?(I||(d.fadeMagnifier?da||(da=!0,R=setTimeout(function(){J(!0)},500)):d.useClickZoom||J(),ea&&(ea=!1,clearTimeout(ca))),I=!1):(ea||(ea=!0,ca=setTimeout(function(){P.postCountMetric("dppc_hoverZoomOpened");l.isEnabled&&
K.logHoverZoomRequestServed(l)},1E3)),d.fadeMagnifier&&da&&(da=!1,clearTimeout(R)),I||h())}function J(a){a&&e.suppressMagnifier(!0);if(X){r&&r.hide();x&&(x.destroy(),x=null);I&&L();X=!1;T?(m.unbind("touchmove.magnifier touchstart.magnifier touchend.magnifier"),b(document).trigger("disengaged.magnifier")):b(document).unbind("mousemove.magnifier").trigger("disengaged.magnifier");y();if(a)m.one("click.magnifier touchstart.magnifier",function(a){t(a,!0)});b(document).unbind("keydown.magnifier")}}function t(a,
f){f&&e.suppressMagnifier(!1);N||(I=!1);if(!(X||E||I)){0===ba&&(P.postCountMetric("dppc_hoverTime",new Date-(p.ue&&p.ue.t0||0)),ba=1);Z[Q]||(P.postCountMetric("dppc_hoverMain"),Z[Q]=1);Q&&(q(a),r?r.refit().show():r=new O,d.useClickZoom||(x=x||new M),S=r.getWindowSize(),h());X=!0;T?(m.unbind("touchstart.magnifier touchmove.magnifier").bind("touchmove.magnifier",u).bind("touchend.magnifier",J),b(document).trigger("engaged.magnifier")):(A.acEnabled?z.unbind("mousemove.magnifier"):m.unbind("mousemove.magnifier"),
b(document).trigger("engaged.magnifier").bind("mousemove.magnifier",u));if(f&&(a=b("#zoomWindow"),0<a.length))a.one("click.magnifier touchend.magnifier",function(a){J(!0)});b(document).bind("keydown.magnifier",c)}}function y(){d.useHoverZoom&&(T?m.bind("touchstart.magnifier touchmove.magnifier",t):(A.acEnabled?w(m)&&z.bind("mousemove.magnifier",t):m.bind("mousemove.magnifier",t),b(document).bind("mousemove.magnifierCursor",v)))}function a(a){return[a.position().left,a.position().top,a.width(),a.height()]}
function c(a){if("key"in a?"Escape"===a.key||"Esc"===a.key:27===a.keyCode)I=!0,J(!0)}var e=this,z=m.offsetParent(),F={detailImageUrl:m.attr("data-old-hires"),location:"over",locationElement:m,prelaod:"ready",zIndex:50,offsetInClickZoom:50};d=b.extend(F,d);d.adjustment=[10,0,-10,0];var r=null,x=null,C=null,n=a(m),S=null,U={"null":1,"":1,undefined:1},X=!1,E=!1,Q=d.detailImageUrl,T=d.useHoverZoomIpad||0,ba=0,Z={},M=function(){function a(a){var c=Math.round(Math.min(m.width(),r.rect.width/a));a=Math.round(Math.min(m.height(),
r.rect.height/a));g.css({width:c,height:a});e=[c,a]}var c=this,e=[0,0],f=(r.detailSize&&r.detailSize[0]||5E8)/n[2],k=(r.detailSize&&r.detailSize[1]||5E8)/n[3];f=k>f?k:f;b("#magnifierLens").remove();var g=b("\x3cdiv id\x3d'magnifierLens' /\x3e").css({position:"absolute"});d.generalImageUrls.zoomLensBackground&&g.css({backgroundImage:"url("+d.generalImageUrls.zoomLensBackground+")"});A.showMagnifierOnHover?B(g):g.css("cursor","pointer");c.updatePosition=function(){var a=[n[2]-e[0],n[3]-e[1]],b=0>=a[0]?
.5:Math.max(0,Math.min(1,(C[0]-e[0]/2-n[0]-c.offset.left)/a[0])),d=0>=a[1]?.5:Math.max(0,Math.min(1,(C[1]-e[1]/2-n[1]-c.offset.top)/a[1])),f=n[0]+Math.round(b*a[0]);a=n[1]+Math.round(d*a[1]);g.get(0).style.left=f+"px";g.get(0).style.top=a+"px";return[b,d]};c.destroy=function(){g.remove()};c.offset=m.offsetParent().offset();a(f);c.updatePosition();g.appendTo(m.parent());r.detailImage[0].complete||r.detailImage.load(function(){var b=r.detailImage.width()/n[2];a(b);c.updatePosition()})};M.preload=function(){e.preload(d.generalImageUrls.lensBackgroundUrl)};
var O=function(){function a(){var a={};if("over"===d.location){a=d.useClickZoom;var c={},k=b("#leftCol"),n=b("#centerCol"),h=b("#rightCol"),z=b("#hover-zoom-end"),S=b("#actionPanelContainer"),Q=f.isjQueryObjDefined(k)?k.outerHeight():n.outerHeight();c.top=f.isjQueryObjDefined(k)?k.offset().top:n.offset().top;c.bottom=Q+c.top;c.right=f.isjQueryObjDefined(h)?h.offset().left:S.offset().left;c.left=a?0:k.offset().left+k.outerWidth();f.isjQueryObjDefined(z)&&z.offset().top>c.bottom&&(c.bottom=z.offset().top);
a=c}else"right"===d.location&&(a=m.offset(),a={left:a.left+m.outerWidth(),top:a.top,right:a.left+m.outerWidth()+400,bottom:a.top+400});d.minHeightElement&&(a.bottom=Math.max(a.bottom,a.top+b(d.minHeightElement).outerHeight()));a.bottom=Math.min(a.bottom,b(p).scrollTop()+b(p).height());a.left+=g[0];a.top+=g[1];a.right+=g[2];a.bottom+=g[3];a.width=a.right-a.left;a.height=a.bottom-a.top;d.enhancedHoverOverlay&&f.isDefined(p.pageXOffset)&&(c=b(p).width(),a.width=c-a.left+p.pageXOffset-18,a.height-=14);
E.css({left:a.left,top:a.top,width:a.width,height:a.height});e.rect=a;return e}function c(a){var c=new Image;e.detailSize=[0,0];c.onload=function(){e.detailSize=[c.width,c.height];h()};c.src=a.attr("src");if(0<c.width&&0<c.height)e.detailSize=[c.width,c.height];else if(d.detailImageSize)e.detailSize=d.detailImageSize;else{a=G(c.src);var b=n[2]/n[3];a.SS||a.AA?(a=a.SS||a.AA,e.detailSize=[a,a]):a.SX?e.detailSize=[a.SX,Math.round(a.SX/b)]:a.SY?e.detailSize=[Math.round(a.SY*b),a.SY]:a.SL&&(e.detailSize=
1<=b?[a.SL,Math.round(a.SL/b)]:[Math.round(a.SL*b),a.SL])}}var e=this,g=d.adjustment;b("#zoomWindow").remove();var k={overflow:"hidden",position:"absolute",backgroundColor:"white",zIndex:d.zIndex};d.enhancedHoverOverlay&&(k.boxShadow="0 6px 8px 2px rgba(0,0,0,.25)",k.border="1px solid #949494",k.borderColor="rgb(148,148,148)");var E=b("\x3cdiv id\x3d'zoomWindow' /\x3e").css(k);d.fadeMagnifier&&E.fadeIn(200);d.useClickZoom&&(H?E.css("cursor",'url("'+d.zoomOutIcon+'"), auto'):(E.css("cursor","-webkit-zoom-out"),
E.css("cursor","-moz-zoom-out"),E.css("cursor","zoom-out")));e.updateImage=function(a){a=b("\x3cimg id\x3d'detailImg' src\x3d'"+a+"'/\x3e").css("position","absolute");e.detailImage&&e.detailImage.remove();E.append(a);b(document).trigger("updated.magnifier");e.detailImage=a;c(e.detailImage)};e.refit=function(){a();c(e.detailImage);return e};d.fadeMagnifier?(e.show=function(){E.fadeIn(200);return e},e.hide=function(){E.fadeOut(200);return e}):(e.show=function(){E.show();return e},e.hide=function(){E.hide();
return e});e.destroy=function(){E.remove();return e};e.getWindowSize=function(){return[e.rect.left,e.rect.top,e.rect.width,e.rect.height]};e.updateImage(Q);a();E.appendTo(document.body)},da=!1,R,ea=!1,ca;e.preload=function(a){a=b.makeArray(a);for(var c=a.length,d=0;d<c;d++)a[d]instanceof Array?e.preload(a[d]):"string"===typeof a[d]&&a[d]&&!U[a[d]]&&(U[a[d]]=new Image,U[a[d]].src=a[d])};e.changeImage=function(c,f){X&&J();Q=f;m.attr("src",c);e.preload(c);n=a(m);f&&("immediately"===d.preload?e.preload(f,
!0):b(p).ready(function(){e.preload(f)}),r?r.updateImage(f):m.attr("data-old-hires",f))};e.destroy=function(){A.acEnabled?z.unbind("touchstart touchstart.magnifier touchmove.magnifier mousemove.magnifier"):m.unbind("touchstart touchstart.magnifier touchmove.magnifier mousemove.magnifier");b(document).unbind("mousemove.magnifier");x&&x.destroy();x=null;r&&r.destroy();r=null};e.detailImage=function(){return r.detailImage};e.suppressMagnifier=function(a){E=a};e.isEngaged=function(){return X};e.engageMagnifier=
t;e.disengageMagnifier=J;m[0].complete?y():m.one("load",y);e.preload(m.attr("src"));p.performance&&performance.now&&p.ue&&ue.count&&ue.count("MagnifierImageDownload",performance.now());if(d.preload){var Y=d.detailImageUrl;F=function(){e.preload(Y,!0);d.useClickZoom||M.preload()};var aa=d.preload;aa.constructor!==Array&&(aa=[aa]);for(var fa=0;fa<aa.length;fa++)if("immediately"===aa[fa])F();else if(b(p)[aa[fa]])b(p)[aa[fa]](F);else b(p).bind(aa[fa],F)}return e}function L(){if(A.useHoverZoom){var g=
{adjustment:[0,0,1,1],generalImageUrls:A.staticImages,location:"over",minHeightElement:"#imageBlock",preload:"ready",zIndex:199,useHoverZoomIpad:A.useHoverZoomIpad,useHoverZoom:A.useHoverZoom,useClickZoom:A.useClickZoom,fadeMagnifier:A.fadeMagnifier,zoomOutIcon:A.staticImages.zoomOutCur,enhancedHoverOverlay:A.enhancedHoverOverlay||A.atfEnhancedHoverOverlay};y&&(y.destroy(),y=R);var d=M.find(".image.item.selected:not(.mirai-shoppable-scene) img[data-old-hires]").not("[data-old-hires\x3d'']");f.isjQueryObjDefined(d)?
A.useClickZoom?(d.one("click.loadmagnifier touchstart.loadmagnifier",function(b){y=new u(d,g);y.engageMagnifier(b,!0)}),H?d.css("cursor",'url("'+A.staticImages.zoomInCur+'"), auto'):(d.css("cursor","-webkit-zoom-in"),d.css("cursor","-moz-zoom-in"),d.css("cursor","zoom-in"))):y=new u(d,g):l.isEnabled&&K.logHoverZoomApplicability(b,l)}}var C,A,x,t,y,M,H=navigator.userAgent.match(/msie|trident/i),I=!1,N=!1;return function(b,d,f,g){C=this;A=b;x=d;l.refToModel=x;t=g;C.render=function(b,d,f,g,h,m){M=f;
y&&(y.destroy(),y=R)};C.update=function(b){};t.register("loadMagnifier",L);t.register("resize",L)}});"use strict";O.when("A","jQuery","imageBlockUtils","postMetric").register("ImageBlockTwisterView",function(g,b,f,P){function l(b,g,l){b=(b=l?l:f.getColorFromState(g.getState().hovered_variations,G))&&""!==b?b:G.defaultColor;L.dispatch("updateView",{type:"swatchHover",data:{color:b}});P.postCountMetric("swatchHover")}function K(b,g,l,t){b=(b=t?t:f.getColorFromState(g.getState().selected_variations,
G))&&""!==b?b:G.defaultColor;b===u.getCurrentItem().color?"function"===typeof l&&l():(L.dispatch("updateSelection",{type:"swatchClick",data:{color:b},onload:function(){var b={hasComponents:!0,components:[{name:"mainImage"}]};"function"===typeof p.markFeatureRender&&p.markFeatureRender("imageblock",b);l()}}),P.postCountMetric("swatchClick"))}var B,G,u,L;return function(b,f,p,t){B=this;G=b;u=f;L=t;g.on("image-block-twister-swatch-hover",l);g.on("image-block-twister-swatch-click",K);B.render=function(b,
f,g,l,t){};B.update=function(b){}}});"use strict";O.when("A","jQuery","imageBlockUtils","ImageBlockLoader","postMetric","logFailedInteractionMetric","postEarlyMetric").register("ImageBlockAltImageView",function(g,b,f,P,l,K,B){function G(a,c,d,e){if(!f.isjQueryObjDefined(a.find(".a-button-selected"))){var g=v.getCurrentItem();if(!e||"chromeless-video"!==g.type||!k.autoplayVideo)if(e=0,"image"===g.type&&(e=Math.max(A(g.color,g.variant),0)),!(g.thumbnailIndex>=k.maxAlts&&0!=e)){var n=c+e;n>=d&&(e=0,
n=c);c=f.getImageHash(g.color,e,k);-1!==c&&(D.dispatch("updateModel",{data:{index:e,thumbnailIndex:n,variant:c.variant,type:"image",shoppableScene:c.shoppableScene}}),c=a.find(".item").get(n),f.selectGivenThumbnail(b(c),a))}}}function u(a,c,e){if((2===k.unrolledImageBlockTreatment||3===k.unrolledImageBlockTreatment)&&e)return a;var d=k.colorImages&&k.colorImages[c];c=a;2!==k.unrolledImageBlockTreatment&&3!==k.unrolledImageBlockTreatment||b(".thumbItemUnrolled").each(function(a){(!b(this)[0].classList.contains("thumbTypeimage")||
a>=d.length||a>=k.maxAlts)&&b(this).remove()});f.isDefined(d)&&(b.each(d,function(c,e){if(a<k.maxAlts)if(2===k.unrolledImageBlockTreatment||3===k.unrolledImageBlockTreatment){a++;var g=b(".thumbItemUnrolled");g[c]?g[c].querySelector("img").src=e.thumb:b('\x3cli class\x3d"thumbItemUnrolled thumbTypeimage thumbIndex'+c+'"\x3e\x3cspan class\x3d"a-list-item"\x3e \x3cspan class\x3d"a-button a-button-thumbnail a-button-toggle" id\x3d"a-autoid-'+a+'"\x3e\x3cspan class\x3d"a-button-inner"\x3e\x3cinput class\x3d"a-button-input" type\x3d"submit" aria-labelledby\x3d"a-autoid-'+
a+'-announce"\x3e\x3cspan class\x3d"a-button-text" aria-hidden\x3d"true" id\x3d"a-autoid-'+a+'-announce"\x3e \x3cimg alt\x3d"" src\x3d"'+e.thumb+'"\x3e \x3c/span\x3e\x3c/span\x3e\x3c/span\x3e \x3c/span\x3e\x3c/li\x3e').appendTo(b(".regularAltImageViewLayout"))}else c={type:"image",index:c,thumbnailIndex:a,variant:e.variant,shoppableScene:e.shoppableScene},e=f.createThumbnail(c,e.thumb,V,"imageThumbnail"),"T1"!==k.desktopCollapsibleThumbnailsExperience&&"T2"!==k.desktopCollapsibleThumbnailsExperience||
f.updateImageThumbnailOverlay(e,c,d),a++}),K.isEnabled&&B.logAltImgRequestPlacedOnThumbnails(b,K,v),G(V,c,a,e));return a}function L(a,c){k.useIV&&f.isDefined(c.hiRes)&&a.css("cursor","pointer")}function C(a,c){if("image"===a.type&&ha){var e=b("#image-canvas-caption #canvasCaption"),d=k.staticStrings,n=k.colorImages,h=a.color,m=a.index,z=!1;if(f.isShoppableScenesEnabled()&&a.shoppableScene)var l=d.clickSceneTagsToShopProducts;else c&&k.useIV?(l='\x3ca href\x3d"#"\x3e'+d.clickForFullView+"\x3c/a\x3e",
z=!0):n[h]&&n[h][m].hiRes&&k.useHoverZoom?(k.useHoverZoomIpad?l=d.touchToZoom:k.useClickZoom?l=d.clickToZoom:(l='\x3ca href\x3d"#"\x3e'+d.clickForFullView+"\x3c/a\x3e",z=!0),k.hoverZoomIndicator&&(l="\x3cimg src\x3d'"+k.staticImages.hoverZoomIcon+"'/\x3e\x26nbsp;"+l)):k.useIV&&(l='\x3ca href\x3d"#"\x3e'+d.clickForFullView+"\x3c/a\x3e",z=!0);e.html(l);z&&(a=b("#image-canvas-caption #canvasCaption a"),g.declarative.create(a,"iv-open-caption-click"))}}function A(a,c){return f.getIndexForVariant(a,c,
k)}function x(a,c,b){var d=c.thumbnailIndex,f=k.colorToAsin[c.color]&&k.colorToAsin[c.color].asin;c="altImageHover"===b&&e&&e.altImageIdx===d&&e.asin===f&&"swatchClick"===e.event?!0:"swatchHover"===b?e&&e.asin===f&&e.event===b:e&&e.altImageIdx===d&&e.asin===f&&e.event===b;if(!c){var g="#",n=a.find(".imgTagWrapper img").get(0);n&&(g=n.src);a=new Image;a.onload=function(){if(n){n.src=g;var a=n.width,c=n.height,e=n.naturalWidth,k=n.naturalHeight;try{var h=(Math.abs(a/e*k-c)/c).toFixed(2);.01<h&&(p.ue&&
((("landing"!==b||r||R)&&"swatchClick"!==b||p.ue.count("imageBlock-PC-hi_res_image_distortion",1),"landing"===b||"swatchClick"===b)?p.ue.count("imageBlock-PC-hi_res_landing_image_distortion",1):"swatchHover"!==b||R?"altImageHover"!==b||r||(p.ue.count("imageBlock-PC-hi_res_alt_image_distortion",1),r=!0):(p.ue.count("imageBlock-PC-hi_res_swatch_hover_image_distortion",1),R=!0)),p.ueLogError&&(a={logLevel:"WARN",attribution:"imageBlock-PC-hi_res_image_distortion"},p.ueLogError("swatchHover"===b?{message:"[ImageBlock Hi-Res: Size distortion for ASIN: "+
f+" Event:"+b+" Diff:"+h.toString()+"]"}:{message:"[ImageBlock Hi-Res: Size distortion for ASIN: "+f+" at altImageIdx "+d+" Event:"+b+" Diff:"+h.toString()+"]"},a)))}catch(oa){p.ueLogError&&(a={logLevel:"WARN",attribution:"imageBlock-PC-hi_res_log_distortion_catch_exception"},p.ueLogError(oa,a))}}};"#"!==g&&(a.src=g);e.altImageIdx=d;e.asin=f;e.event=b}}function t(a,d){var e="a-dynamic-image";if(!k.acEnabled){var g;b.each(a.main,function(a,c){f.isDefined(g)||(g=parseFloat(c[1]/c[0])<=parseFloat(k.holderRatio)?
" a-stretch-vertical":" a-stretch-horizontal")});e+=g}var n=f.getMaxDimensionsOfMainImage(a.main,c,k),h=n[0],m=n[1];n=b("\x3cdiv\x3e\x3c/div\x3e");h={"max-height":h,"max-width":m};n.addClass(e).css(h).attr({"data-old-hires":a.hiRes,"data-a-manual-replacement":"true",onload:d}).data("a-dynamic-image",a.main);return n}function y(c,b,e){var d="desktop-dp-atf-ib-shoppablescenes-tags-"+c;"function"==typeof uet&&uet("bb",d,{wb:1});e.attr("data-a-image-name","shoppable-scene:"+c);e=a.find(".mirai-scene-image-block-template").clone().removeClass("mirai-scene-image-block-template aok-hidden").addClass("mirai-shoppable-scene");
e.find(".mirai-scene-image-block-tag-container").attr({"data-csa-c-content-id":d,"data-csa-c-slot-id":d,"data-csa-c-type":"widget","data-csa-c-asin":k.mediaAsin,"data-csa-c-physical-id":b.shoppableScene.physicalId,"data-product-line":b.shoppableScene.productLine});e.children("span").css("display","inline-block");D.dispatch("initialize-shoppable-scene",{index:c,shoppableScene:b.shoppableScene,imageSource:b.hiRes||b.large||b.lowRes,$tagPlaceholder:e.find(".mirai-scene-tag-placeholder"),$viewProductsButton:e.find(".mirai-scene-view-products-button")});
"MutationObserver"in p&&(new MutationObserver(function(a,e){a.forEach(function(a){"childList"===a.type&&a.target.classList.contains("mirai-scene-image-block-tag-container")&&1===a.addedNodes.length&&"IMG"===a.addedNodes[0].tagName&&""!==a.addedNodes[0].src&&(a=a.addedNodes[0],"function"!==typeof a.onload&&(a.onload=function(){g.trigger("shoppable-scene-image-loaded",{index:c,shoppableScene:b.shoppableScene})}),e.disconnect())})})).observe(e.find(".mirai-scene-image-block-tag-container")[0],{subtree:!0,
childList:!0,attributes:!1});"function"==typeof uet&&uet("cf",d,{wb:1});return e}function M(c,b,e){e=t(c,e);c=f.isShoppableScenesEnabled()&&c.shoppableScene?y(b,c,e):a.find(".mainImageTemplate").clone().removeClass("template mainImageTemplate");c.addClass("image item itemNo"+b+" maintain-height").attr({"data-csa-c-type":"uxElement","data-csa-c-element-type":"navigational","data-csa-c-action":"image-block-main-image-hover","data-csa-c-posy":b+1});c.find(".placeHolder").replaceWith(e);a.find(".list").append(c);
g.loadImageManually(e);g.trigger("dp:image-block:imageBlockImageLoad",b);return c}function H(a){var b=c.css("height");null!==b&&a.find(".imgTagWrapper").css("height",b);a.addClass("selected");k.imgTagWrapperClasses&&a.find(".imgTagWrapper").addClass(k.imgTagWrapperClasses)}function I(a){if(a.isUserGenerated){var c=v.getPreviousItem(),b=a.variant;f.isDefined(b)&&c.thumbnailIndex!==a.thumbnailIndex&&(K.isEnabled&&B.logAltImgRequestServed(K),l.postCountMetric("ImageThumbnailSelectedVariant:"+b),0===
b.indexOf("IG")&&(l.postCountMetric("IGImageSelectedVariant:"+b),l.postCountMetric("IGImageSelectedEvent:"+a.interaction)))}}function N(c,e,d,h){if(2!==k.unrolledImageBlockTreatment&&3!==k.unrolledImageBlockTreatment||h||"unavailable"===c.type){if("image"===c.type||"unavailable"===c.type||"lazy-loaded"===c.type){(m=f.isDefined(e))&&l.postCountMetric("mainImageUpdateOnTwisterVariationClick");d=f.getImageHash(c.color,c.index,k);if(-1===d)return e={data:{index:0,thumbnailIndex:0,variant:"",type:"unavailable"}},
f.lazyLoadingRequired(c,v,k)||(D.dispatch("updateModel",e),f.showUnavailable(c.color)),-1;h=a.find(".item.itemNo"+c.thumbnailIndex);f.isjQueryObjDefined(h)||(h=M(d,c.thumbnailIndex,e),m?(R=r=!1,x(h,c,"swatchClick")):x(h,c,"altImageHover"));H(h);D.dispatch("loadMagnifier");C(c);L(h,d);I(c);g.trigger("dp:image-block:update",d)}}else if(c=k.colorImages&&k.colorImages[d],b(".unrolledImg").each(function(a){b(this).remove()}),f.isDefined(c)){b.each(c,function(a,c){if(a<k.maxAlts){var e=b(".unrolledImg");
e[a]?b(".unrolledImg #unrolledImgNo"+a+" img").replaceWith('\x3cimg alt\x3d"" src\x3d"'+c.large+'" data-a-hires\x3d"'+c.hiRes+'" data-a-manual-replacement\x3d"true"\x3e'):a>=e.length&&b('\x3cli data-csa-c-action\x3d"image-block-main-image-hover" data-csa-c-element-type\x3d"navigational" data-csa-c-posy\x3d"'+(a+1)+'" data-csa-c-type\x3d"uxElement" class\x3d"image item itemNo'+a+' unrolledImg imgMedia"\x3e\x3cspan class\x3d"a-list-item"\x3e \x3cspan class\x3d"a-declarative" data-action\x3d"main-image-click" data-csa-c-type\x3d"widget" data-csa-c-func-deps\x3d"aui-da-main-image-click" data-main-image-click\x3d"{}" data-ux-click\x3d""\x3e \x3cdiv id\x3d"imgTagWrapperId" class\x3d"imgTagWrapper"\x3e \x3cdiv id\x3d"unrolledImgNo'+
a+'"\x3e \x3cdiv class\x3d"a-image-container a-dynamic-image-container greyBackground" style\x3d"width:100%; height:600px;"\x3e \x3cimg alt\x3d"" src\x3d"'+c.large+'" data-a-hires\x3d"'+c.hiRes+'" data-a-manual-replacement\x3d"true"\x3e \x3c/div\x3e \x3c/div\x3e\x3c/div\x3e\x3c/span\x3e \x3c/span\x3e\x3c/li\x3e').appendTo(b(".unrolledScrollBox .list-unrolled"))}});g.loadHiResImage(document.querySelectorAll(".unrolledImg.imgMedia img"));var m=f.isDefined(e);m&&(l.postCountMetric("mainImageUpdateOnTwisterVariationClick"),
e())}}function m(c){var b=Math.max(A(c.color,v.getCurrentItem().variant),0);b=f.getImageHash(c.color,b,k);if(-1===b)return f.lazyLoadingRequired(c,v,k)||f.showUnavailable(c.color),-1;var e=a.find(".swatchHoverExp"),d=t(b);e.find(".imgTagWrapper").html(d);g.loadImageManually(d);l.postCountMetric("mainImageUpdateOnTwisterVariationHover");H(e);x(e,c,"swatchHover");g.trigger("dp:image-block:update",b)}function d(c,e){f.lazyLoadingRequired(c,v,k)||(b("#imageBlock").css("opacity","1"),a.css("opacity","1"),
f.spinner(a,!1),a.find("li").removeClass("selected"),ha&&b("#image-canvas-caption #canvasCaption").empty(),f.hideUnavailable(),e&&a.find(".list .item").remove())}function h(){var e=a.find(".item .imgTagWrapper"),d=f.getContainerHeight(c,k.holderRatio,k.holderMaxHeight);0<d&&(c.height(d),e.height(d));a.find("img.a-dynamic-image").each(function(){var a=b(this);a.data("a-manual-replacement")&&g.loadDynamicImage(this);var e=a.data("a-dynamic-image");e=f.getMaxDimensionsOfMainImage(e,c,k);a.css({"max-height":e[0]+
"px","max-width":e[1]+"px"})})}function w(a){C(v.getCurrentItem(),"mouseenter"===a.type)}var q,k,v,D,J,W,V,a,c,e={},z,F=null,r=!1,R=!1,ha=(P=g.state("imageBlockStateData"))?!P.shouldRemoveCaption:!0;g.on("triggerImageAjax",function(a){var c=v.getCurrentItem().color;k.colorImages[c]||(k.colorImages[c]=a);a={type:"updatedData",data:v.getCurrentItem()};D.dispatch("updateView",a);(c=k.colorToAsin[c])&&c.asin&&O.register(f.rankedImagesReadyEvent(c.asin))});return function(e,g,r,H){q=this;k=e;v=g;D=H;k.colorImages[k.landingAsinColor]=
k.colorImages[k.defaultColor];q.render=function(e,g,h,m,l,n,r,J){a=2!==k.unrolledImageBlockTreatment&&3!==k.unrolledImageBlockTreatment?h:b(".unrolledScrollBox");V=m;c=l;z=u(g,e,n);n?0===g&&x(a.find(".item.itemNo0"),v.getCurrentItem(),"landing"):(g=v.getCurrentItem(),f.lazyLoadingRequired(g,v,k)&&D.dispatch("updateModel",{data:{type:"lazy-loaded"}}));d(v.getCurrentItem(),!n);2===k.unrolledImageBlockTreatment||3===k.unrolledImageBlockTreatment?"swatchClick"===J&&k&&k.colorImages?(F=k.colorImages[e],
N(v.getCurrentItem(),r,e,n)):"updatedData"===J&&k&&k.colorImages&&k.colorImages[e]!==F&&(F=k.colorImages[e],N(v.getCurrentItem(),r,e,n)):N(v.getCurrentItem(),r,e,n);return z};f.isImageBlockGridViewHoverDelayEnabled()?q.update=function(a){var c=a.data;v.setCurrentEvent(a);"ingress"!==c.type&&"swatchHover"!==a.type&&(v.setToPreviousItem(),"mouseenter"===a.type?(W&&clearTimeout(W),W=setTimeout(function(){v.setToCurrentItem(c);d(a.data,!1)},f.getHoveringDelayTimer())):"mouseleave"===a.type?W&&clearTimeout(W):
"click"===a.type&&(v.setToCurrentItem(c),d(a.data,!1)));"swatchHover"===a.type?("ingress"!==c.type&&d(a.data,!1),c.color===v.getCurrentItem().color?N(v.getCurrentItem(),null,c.color,!0):a.captured||-1===m(c)||(a.captured=!0)):"image"===c.type&&(c.interaction=a.type,c.isUserGenerated=!0,"mouseenter"===a.type?(l.postCountMetric("dpcc_imageThumbHovered_"+(c.thumbnailIndex+1)+"_"+z),J&&clearTimeout(J),J=setTimeout(function(){N(c,null,c.color,!0);k.usePeekHover||f.selectGivenThumbnail(a.$declarativeParent,
V)},f.getHoveringDelayTimer())):"mouseleave"===a.type?J&&clearTimeout(J):"click"===a.type&&(N(c,null,c.color,!0),f.selectGivenThumbnail(a.$declarativeParent,V),l.postCountMetric("dpcc_imageThumbClicked_total"),l.postCountMetric("dpcc_imageThumbClicked_"+(c.thumbnailIndex+1)+"_"+z)))}:q.update=function(a){var c=a.data;v.setCurrentEvent(a);"ingress"!==c.type&&d(a.data,!1);"swatchHover"===a.type?c.color===v.getCurrentItem().color?N(v.getCurrentItem(),null,c.color,!0):a.captured||-1===m(c)||(a.captured=
!0):"image"===c.type&&(c.interaction=a.type,c.isUserGenerated=!0,"mouseenter"===a.type&&l.postCountMetric("dpcc_imageThumbHovered_"+(c.thumbnailIndex+1)+"_"+z),N(c,null,c.color,!0),k.usePeekHover&&"click"!==a.type||(f.selectGivenThumbnail(a.$declarativeParent,V),"click"===a.type&&(l.postCountMetric("dpcc_imageThumbClicked_total"),l.postCountMetric("dpcc_imageThumbClicked_"+(c.thumbnailIndex+1)+"_"+z))))};k.overrideAltImageClickAction&&f.addTag("clickEnabledOnAltImages");D.register("imageHover",w);
D.register("resize",h)}});"use strict";O.when("A","jQuery","imageBlockUtils","postMetric").register("ImageBlockShoppableSceneView",function(g,b,f,p){function l(f,g){f=b("\x3cimg src\x3d'"+(g?t.staticImages.shoppableSceneDotHighlighted:t.staticImages.shoppableSceneDot)+"' alt\x3d''\x3e");f.css({display:g?"none":"inline-block"});f.addClass("mirai-scene-tag").addClass(g?"active-tag":"inactive-tag");return f}function P(f){var p=b("\x3cspan\x3e");g.each(f.tags,function(f){var m=b("\x3cdiv\x3e").css({position:"absolute",
left:100*f.left+"%",top:100*f.top+"%",height:"auto",width:"auto"});m.append(l(f,!1));m.append(l(f,!0));m.bind("mouseenter",function(){B(b(this).find(".mirai-scene-tag[style*\x3d'display: inline-block']"))});g.declarative.create(m,"scenes-show-details-tags-ib",{tagId:f.link});p.append(m)});return p.children()}function B(b){b.addClass("mirai-scene-dot-pulsate");g.delay(function(){b.removeClass("mirai-scene-dot-pulsate")},4E3)}function G(b,f){b.css({display:"none"});f.css({display:"inline-block"})}function u(b,
f,g){b.eq(g).css({display:"inline-block"});f.eq(g).css({display:"none"})}function L(b){O.when("mirai-multi-scene-view").execute("mirai-scene-protected-image-selection",function(){g.trigger("mirai:scene-details-change",{physicalId:b})})}function C(){var f=b("\x3cspan class\x3d'mirai-scene-view-products-button-content'\x3e"),g=b("\x3cimg class\x3d'item-tag'\x3e").attr("src",t.staticImages.shoppableSceneViewProductsButton).addClass("item-tag"),l=b("\x3cspan class\x3d'mirai-scene-view-products-button-text'\x3e");
l.html(t.staticStrings.shoppableSceneViewProductsButton);return f.append(g).append(l)[0].outerHTML}function A(b){function f(){b.$tagPlaceholder.replaceWith(m);var d=m.find(".mirai-scene-tag.active-tag"),f=m.find(".mirai-scene-tag.inactive-tag");u(d,f,0);B(m.find(".mirai-scene-tag[style*\x3d'display: inline-block']"));M=!0;b.$viewProductsButton.removeClass("aok-hidden");"function"==typeof uex&&uex("ld","desktop-dp-atf-ib-shoppablescenes-tags-"+b.index,{wb:1});q=!0;p.postCountMetric("miraiShoppableScenes_imageLoadedCount")}
if(b.shoppableScene){var l=b.$viewProductsButton.find(".a-button-text");if(0===l.children().length){l.append(C());g.declarative.create(b.$viewProductsButton,"scenes-show-details-view-products-ib",{tagId:b.shoppableScene.tags[0].link});var m=P(b.shoppableScene),d=m.find(".mirai-scene-tag.active-tag"),h=m.find(".mirai-scene-tag.inactive-tag"),w=b.shoppableScene.physicalId,q=!1;g.on("mirai:index:change",function(b){b.scenePhysicalId===w&&(b=b.selectedIndices[0],G(d,h),u(d,h,b),B(m.find(".mirai-scene-tag[style*\x3d'display: inline-block']").eq(b)),
M=!0)});g.on("mirai:scene-details-change",function(b){b.physicalId!==w||M||(G(d,h),u(d,h,0),B(m.find(".mirai-scene-tag[style*\x3d'display: inline-block']")),M=!0)});g.on("mirai:no-products-active",function(b){b.scenePhysicalId===w&&G(d,h)});g.on("mirai:set-first-product-active",function(b){b.scenePhysicalId===w&&(G(d,h),u(d,h,0))});g.on("a:image:load:shoppable-scene:"+b.index,function(){q||(f(),p.postCountMetric("miraiShoppableScenes_imageLoadedViaAuiListenerCount"))});g.on("shoppable-scene-image-loaded",
function(d){d.index!=b.index||q||(f(),p.postCountMetric("miraiShoppableScenes_imageLoadedViaMiraiListenerCount"))});O.when("mirai-multi-scene-view").execute("mirai-scene-protected-side-sheet-initialization",function(){g.trigger("mirai:scene-side-sheet-init",{icons:t.staticImages,strings:t.staticStrings});g.trigger("mirai:scene-details-init",{scene:b.shoppableScene,imageSource:b.imageSource})})}}}var x,t,y,M=!1;return function(b,g,l,m){x=this;t=b;y=m;f.isShoppableScenesEnabled()?(y.register("initialize-shoppable-scene",
A),x.render=function(b,f,g,m,k,l,p){},x.update=function(b){"mouseenter"===b.type&&(b.data.shoppableScene?L(b.data.shoppableScene.physicalId):M=!1)}):(b=function(){},x.render=b,x.update=b)}});O.now().register("ShoppableSceneWeblabProvider",function(){return{isEnabled:!0}});"use strict";var ma="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(g){return typeof g}:function(g){return g&&"function"===typeof Symbol&&g.constructor===Symbol&&g!==Symbol.prototype?"symbol":typeof g};O.when("A",
"jQuery","postMetric","ImageBlockATF","ImageBlockBTF","logFailedInteractionMetric","postEarlyMetric","ShoppableSceneWeblabProvider").register("imageBlockUtils",function(g,b,f,P,l,K,B,G){function u(a){return null!==a&&"undefined"!==typeof a}function L(a){var c=0;b.each(a,function(a,b){a=parseInt(b[1],10);a>c&&(c=a)});return c}function C(a){var c=0;b.each(a,function(a,b){a=parseInt(b[0],10);a>c&&(c=a)});return c}function A(a,c,b){c=c.width();if(b.naturalMainImageSize)return c;a=L(a);0<a&&(c=Math.min(c,
a));return c}function x(a,c,b){c=c.height();if(b.naturalMainImageSize)return c;a=C(a);0<a&&(c=Math.min(c,a));return c}function t(a){var c;b.each(a,function(a,b){u(c)||(c=b[1]/b[0])});return c||1}function y(a){if(a){if(0<a.indexOf(".m3u8"))return"application/x-mpegURL";if(0<a.indexOf(".mp4"))return"video/mp4"}return""}function M(a,c){c=c.find("img");u(c[a])&&b(c[a]).click()}function H(a,c){k[a]=c?c:k[a];return k[a]}function I(a,c,e){e=e||q;e=e.colorImages;if(1>e.length||!u(e[a])||!u(c))return-1;var d=
-1;b.each(e[a],function(a,b){b.variant===c&&(d=a)});return d}function N(a,c,e){e=e||q;e=e.colorImages;return!(u(e)&&u(e[a])&&u(e[a][c])&&u(e[a][c].main))||1>b.map(e[a][c].main,function(a,c){return c}).length?-1:e[a][c]}function m(a,c,b,d){d.parent().css("z-index",2);0!==b&&0!==c&&(c/=b,d.css("width",""),d.css("height",""),a>c?d.css("width",c/a*100+"%"):d.css("height",a/c*100+"%"))}function d(a,c){var e;if(e=a.useIV)e=a.colorImages&&a.colorImages[c]&&0<a.colorImages[c].length?!0:!1;a=e;K.isEnabled&&
(K.IVApplicaple=a,B.logImmersiveViewApplicability(b,K));return a}function h(){return 0<b(".gridImageBlockViewLayoutIn2x4").length||0<b(".gridImageBlockViewLayoutIn2x5").length||0<b(".gridImageBlockViewLayoutIn1x7").length}var w,q=b.extend(!0,{},P,l),k={},v=0,D=0,J=/gridAltImageViewLayoutIn(\d+)x(\d+)/g,W={},V={};return{isDefined:u,isDefinedAndEmpty:function(a){return u(a)&&"object"===("undefined"===typeof a?"undefined":ma(a))&&0===Object.keys(a).length},isUndefinedOrEmpty:function(a){return u(a)?
"object"===("undefined"===typeof a?"undefined":ma(a))&&0===Object.keys(a).length:!0},isDefinedAndNotEmpty:function(a){return u(a)?"object"===("undefined"===typeof a?"undefined":ma(a))&&0<Object.keys(a).length:!1},isjQueryObjDefined:function(a){return 0!==a.length},getAspectRatio:t,getMaxHeightOfMainImage:x,getMaxWidthOfMainImage:A,getMaxDimensionsOfMainImage:function(a,c,b){if(b.acEnabled)return[c.height(),c.width()];var e=x(a,c,b);c=A(a,c,b);a=t(a);b=c/a;c=Math.min(c,e*a);e=Math.min(e,b);return[e,
c]},getContainerHeight:function(a,c,b){var e=a.get(0);a=0;if(u(e)){a=Math.min(e.offsetWidth/c,b);var d;c=q.mainImageHeightPartitions;b=q.mainImageMaxSizes;if(u(b)&&u(c)){var f=0,g=p.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;for(e=0;e<c.length;e++)g>c[e]&&(f=e+1);b.length>=f&&(d=b[f])}u(d)&&(a=Math.min(d[1],a))}return a},getColorFromState:function(a,c){if(a){c=c||q;var e="";b.each(c.visualDimensions,function(c,b){a[b]&&(e+=" "+a[b])});return e&&e.substring(1)}},
createThumbnail:function(a,c,b,d){var e=b.find(".template").clone().removeClass("template").addClass("item"),f=document.createElement("img");f.src=c;e.find(".placeHolder").replaceWith(f);(c=a.heroVideoVariant)&&"hero-image"===a.type&&a.variant===c&&e.addClass("heroImageThumbnail");u(d)&&e.addClass(d);h()&&e&&(d=document.createElement("div"),d.className="imageBlockThumbnailImageGrayOverlay",f.parentNode.insertBefore(d,f));g.declarative.create(e,"thumb-action",a);e.attr&&(e.attr("data-ux-click",""),
a.type&&a.type.match(/video/)?(e.attr("data-csa-c-type","uxElement"),e.attr("data-csa-c-element-type","navigational"),e.attr("data-csa-c-action","image-block-alt-image-clickToImmersiveVideos")):(e.attr("data-csa-c-type","uxElement"),e.attr("data-csa-c-element-type","navigational"),e.attr("data-csa-c-action","image-block-alt-image-hover")),e.attr("data-csa-c-posy",a.thumbnailIndex+1));b.append(e);return e},updateImageThumbnailOverlay:function(a,c,b){a.find(".textMoreImages").append(b.length-c.thumbnailIndex+
"+")},selectGivenThumbnail:function(a,c){a=a.find(".a-button");var b=a.find(".a-button-input");c.find(".a-button").removeClass("a-button-selected").removeClass("a-button-focus");c.find(".a-button-input").attr("aria-checked","false");a.addClass("a-button-selected").addClass("a-button-focus");b.attr("aria-checked","true")},loadMediaIntoAiry:function(a,c,b,d){a&&a.getMediaSourceInfo()!==c.url&&(d?a.loadMedia?(w={mediaSourceInfo:[c.url],contentId:c.mediaObjectId,refTag:"vse_ib_tablet_web",title:c.title,
altText:c.altText},a.loadMedia(w)):a.play({videoUrl:c.url,imageUrl:c.slateUrl,mimeType:"video/mp4",contentId:c.mediaObjectId,rankingStrategy:c.rankingStrategy,refTag:"vse_ib_tablet_web"}):a.loadMedia?a.loadMedia({mediaSourceInfo:c.url,contentId:c.mediaObjectId,contentMinAge:Number(c.minimumAge||"")||0,contentTitle:c.title,slateImages:{preloadSlate:c.slateUrl,postMediaSlate:c.slateUrl}}):a.setInitialData({videoUrl:c.url,mimeType:y(c.url),contentId:c.mediaObjectId,rankingStrategy:c.rankingStrategy,
imageUrl:c.slateUrl,aciContentId:c.aciContentId,title:c.title,altText:c.altText}))},showUnavailable:function(a){a&&(b("#imageBlock .unvailableVariation").html(a),b("#imageBlock .variationUnavailable").show())},hideUnavailable:function(){b("#imageBlock .variationUnavailable").hide()},fadeToThumbnail:function(a,c,b){c.fadeTo(500,0,function(){M(a,b);c.fadeTo(500,1)})},toggleVideoCaption:function(a){a&&a.toggle()},selectThumbnail:M,spinner:function(a,c){var e=b("#imageBlock .a-spinner").parent();0===
e.length&&(e=b("\x3cdiv\x3e\x3c/div\x3e").append(b("\x3cspan\x3e\x3c/span\x3e").addClass("a-spinner").addClass("a-spinner-medium")),a.append(e),e.css({position:"absolute",left:"50%",top:"50%",transform:"translate3d(-50%, -50%, 0)","-webkit-transform":"translate3d(-50%, -50%, 0)","z-index":"3",width:"48px",height:"48px",border:"8px solid #FFFFFF","-webkit-border-radius":"20px","-moz-border-radius":"20px","border-radius":"100%"}));c?e.show():e.hide();return e},rankedImagesReadyEvent:function(a){return"ranked-images-ready-for-"+
a},ajaxState:H,getIndexForVariant:I,getImageHash:N,lazyLoadingRequired:function(a,c,b){c=Math.max(I(a.color,c.getCurrentItem().variant,b),0);c=-1!==N(a.color,c,b);a=b.colorToAsin[a.color]&&b.colorToAsin[a.color].asin;a=!a||"success"!==H(a);return!b.lazyLoadExperienceDisabled&&!c&&a},lazyLoadOnHoverEnabled:function(a){return!a.lazyLoadExperienceOnHoverDisabled},updateAspectRatio:m,repositionVideoBanner:function(a,c,b,d){setTimeout(function(){var b=a.width()/a.height();m(b,16,9,c)},d||0)},getVideosCount:function(a,
c){return c.useChildVideos&&c.colorToVideo[a]?c.colorToVideo[a].length:c.videos?c.videos.length:0},getVideoHash:function(a,c,b){if(b.useChildVideos){if(!u(b.colorToVideo))return-1;a=b.colorToVideo[a]}else a=b.videos;return u(a)&&u(a[c])&&u(a[c].url)?a[c]:-1},isImmersiveViewEnabled:d,playVideoInImmersiveView:function(a,c){return d(a,c)&&a.useTabbedImmersiveView},useTabbedImmersiveView:function(a){return a.useTabbedImmersiveView},getMediaSourceInfo:function(){return u(w)?w.mediaSourceInfo[0]:""},getNilgiriServiceAjaxRequest:function(a,
c,b){return{requester:"DetailPageTablet",marketplaceID:b.marketPlaceID,clientPrefix:"ImageBlock_tablet",locale:b.languageCode,page:"DetailPageTablet",placement:"ImageBlock",metadata:{shouldPreload:!1},video:{videoURL:b.url,imageURL:b.slateUrl}}},addTag:function(a){p.ue&&p.ue.tag&&p.ue.tag(a)},isShoppableScenesEnabled:function(){return G.isEnabled&&0<b(".mirai-scene-image-block-template").length},isImageBlockGridViewDisplayEnabled:h,isImageBlockGridViewHoverDelayEnabled:function(){return 0<b(".gridImageBlockViewLayoutIn2x4").length||
0<b(".gridImageBlockViewLayoutIn2x5").length},getHoveringDelayTimer:function(){return v},updateThumbnailHoverDelay:function(a){if(u(a)){v=0;var c=a.closest("li");c=c.parent().children("li").filter(":not(.aok-hidden, .template, .pos-360)").index(c);if(-1!==c){var b=D;a=a.closest("ul").attr("class");a===R?b=!1:(a=J.exec(a),null===a||3!==a.length?b=!1:(a=a[2],b=Math.floor(b/a)>Math.floor(c/a)));b&&(v=100);D=c}}},setDimensionIngressData:function(a,c,b){W[a]=c;V[a]=b},isDimensionIngressEnabled:function(a){return!!W[a]},
getDimensionVariantList:function(a){return V[a]},logError:function(a,c,b,d){p.ueLogError&&p.ueLogError(d,{logLevel:a,attribution:c,message:b})},customerId:""}});"use strict";O.when("A","jQuery","imageBlockUtils","ImageBlockLoader","postMetric","vse_ns_videoPlayer").register("ImageBlockVideoView",function(g,b,f,P,l,K){function B(d,g,k,h){!a.autoplayVideo||ea||a.useChromelessVideoPlayer?!f.isjQueryObjDefined(d.find(".a-button-selected"))&&(k=c.getCurrentItem(),!h||a.prioritizeVideos||"chromeless-video"===
k.type&&a.autoplayVideo)&&(h=f.getVideoHash(k.color,0,a),-1===h||k.thumbnailIndex>=a.maxAlts-1||(g+=0,e.dispatch("updateModel",{data:{index:0,thumbnailIndex:g,variant:h.variant,type:a.useChromelessVideoPlayer?"chromeless-video":"chromeful-video"}}),g=d.find(".item").get(g),f.selectGivenThumbnail(b(g),d))):(f.selectGivenThumbnail(d.find("img:last"),d),f.fadeToThumbnail(d.find("img").length-1,na,d))}function G(b){var d=c.getCurrentItem().color;if(a.useChildVideos&&!a.colorToVideo[d]){var g=function(){if(b){a.colorToVideo[d]=
b;var f={type:"updatedData",data:c.getCurrentItem()};e.dispatch("updateView",f)}};a.lazyLoadExperienceDisabled?g():O.when(f.rankedImagesReadyEvent(a.colorToAsin[d].asin)).execute(function(){g()})}}function u(b){if(!a.useChildVideos)return f.lazyLoadingRequired(c.getCurrentItem(),c,a)?void 0:a.videos;if(a.colorToVideo[b])return a.colorToVideo[b];var d=a.colorToAsin[b];if(d&&d.asin){var e={};e.params={asin:d.asin,productGroupID:a.productGroupID,useAiryVideoPlayer:!0,useChromelessVideoPlayer:a.useChromelessVideoPlayer,
isUDP:a.isUDP};a.isDPXFeatureEnabled||(e.success=function(a){G(a)},P.load("/gp/product/features/apparel-main-image/videos.html",e));return a.colorToVideo&&a.colorToVideo[b]}}function L(b){var c=g.$("#main-video-container");0<c.length&&(c.find(".ive-video-thumbnail").addClass("aok-hidden"),c.find(".videoTagWrapper").addClass("aok-hidden"));n&&null===b&&2!==a.unrolledImageBlockTreatment&&3!==a.unrolledImageBlockTreatment&&(n.hide(),F.parent().css("z-index",-1),r&&r.hide())}function C(b,c,d){c=na.width()/
na.height();var e=parseInt(b.videoWidth,10),g=parseInt(b.videoHeight,10);f.updateAspectRatio(c,e,g,F);if(n&&"unrolled-video-add"!==d)n.show(),f.loadMediaIntoAiry(n,b,S,a.tabletWeb);else if(a.tabletWeb)n=E;else{if("unrolled-video-add"===d){n=E;return}if(null===E||E===R)Y=setInterval(function(){n=E;n!==R&&null!==n&&(n.show(),f.loadMediaIntoAiry(n,b,S,a.tabletWeb),A(),H(n),clearInterval(Y),Y=null)},500);else if(n=E,n!==R&&null!==n){n.show();f.loadMediaIntoAiry(n,b,S,a.tabletWeb);A();H(n);return}}A();
H(n)}function A(){if(2!==a.unrolledImageBlockTreatment&&3!==a.unrolledImageBlockTreatment)if(f.useTabbedImmersiveView(a)){g.$("#main-video-container").find(".ive-video-thumbnail").removeClass("aok-hidden");g.$("#main-video-container").find(".videoTagWrapper").removeClass("aok-hidden");if(1<f.getVideosCount(c.getCurrentItem().color,a)&&r){if(f.isDefined(ha)){r.show();return}ha=b('\x3ca class\x3d"more-videos"\x3e\x3c/a\x3e').attr("href","#").text(a.staticStrings.clickForFullView);r.find("#videoCaption").append(ha);
g.declarative.create(ha,"videoIngressClick",U)}f.playVideoInImmersiveView(a,c.getCurrentItem().color)&&(g.declarative.create(F,"videoIngressClick",U),F.attr&&F.attr("data-ux-click",""),F.children().css("z-index","-1"),F.css("display","inline-block"))}else r&&(r.find("#videoCaption").text(a.staticStrings.playVideo),r.show())}function x(b,c){if("chromeful-video"===b.type||"chromeless-video"===b.type||"unrolled-video-add"===c){var d=f.getVideoHash(b.color,b.index,a);if(-1===d)return-1;"chromeful-video"===
b.type&&C(d,b.thumbnailIndex+1,c)}}function t(d,e,k){if((2===a.unrolledImageBlockTreatment||3===a.unrolledImageBlockTreatment)&&k)return d;var h=u(e);e=d;var m=b(".unrolledImg"),n=f.isDefined(h)&&0<h.length&&a.alwaysIncludeVideo?1:0;f.isDefined(h)&&0<h.length&&!a.alwaysIncludeVideo&&d===a.maxAlts&&l.postCountMetric("IBVideoDrop");m.length>a.maxAlts&&m.each(function(c){c>=a.maxAlts&&b(this).remove()});n&&d===a.maxAlts&&(2===a.unrolledImageBlockTreatment||3==a.unrolledImageBlockTreatment?(b(".thumbItemUnrolled").last().remove(),
b(".unrolledImg").last().remove()):z.find(".item:last").remove(),d--);f.isDefined(h)&&(b.each(h,function(e,g){if(d<a.maxAlts){if(2===a.unrolledImageBlockTreatment||3===a.unrolledImageBlockTreatment){var k=a.useChromelessVideoPlayer?"chromeless-video":"chromeful-video";b('\x3cli class\x3d"thumbItemUnrolled thumbType'+k+" thumbIndex"+e+'"\x3e\x3cspan class\x3d"a-list-item"\x3e \x3cspan class\x3d"a-button a-button-thumbnail a-button-toggle" id\x3d"a-autoid-'+d+'"\x3e\x3cspan class\x3d"a-button-inner"\x3e\x3cinput class\x3d"a-button-input" type\x3d"submit" aria-labelledby\x3d"a-autoid-'+
d+'-announce"\x3e\x3cspan class\x3d"a-button-text" aria-hidden\x3d"true" id\x3d"a-autoid-'+d+'-announce"\x3e \x3cimg alt\x3d"" src\x3d"'+g.thumb+'"\x3e \x3c/span\x3e\x3c/span\x3e\x3c/span\x3e \x3c/span\x3e\x3c/li\x3e').appendTo(b("ul.regularAltImageViewLayout"));b('\x3cli data-csa-c-action\x3d"image-block-main-image-hover" data-csa-c-element-type\x3d"navigational" data-csa-c-posy\x3d"'+d+'" data-csa-c-type\x3d"uxElement" class\x3d"image item itemNo'+d+' unrolledImg videoMedia"\x3e\x3cspan class\x3d"a-list-item"\x3e \x3cspan class\x3d"a-declarative" data-action\x3d"main-image-click" data-csa-c-type\x3d"widget" data-csa-c-func-deps\x3d"aui-da-main-image-click" data-main-image-click\x3d"{}" data-ux-click\x3d"" \x3e \x3cdiv id\x3d"imgTagWrapperId" class\x3d"imgTagWrapper"\x3e\x3cdiv id\x3d"unrolledImgNo'+
d+'" class\x3d"videoIndex'+e+'"\x3e\x3c/div\x3e\x3c/div\x3e\x3c/span\x3e\x3c/span\x3e\x3c/li\x3e').appendTo(b(".unrolledScrollBox .list-unrolled"));a.dp60InLastPositionUnrolledImageBlock||2!==a.dp60VideoPosition||y(b(".regularAltImageViewLayout"),a.dp60VideoPosition)}else{k=a.useChromelessVideoPlayer?"chromeless-video":"chromeful-video";var m={type:k,index:e,thumbnailIndex:d,variant:g.variant};U={type:"video-ingress",index:e,thumbnailIndex:d,variant:g.variant};f.useTabbedImmersiveView(a)&&("chromeful-video"===
k&&(pa+=" videoBlockIngress  videoBlockDarkIngress",g.thumb=g.thumb.replace("_PKmb-play-button-overlay-thumb","")),a.altsOnLeft||(pa+=" a-align-top"));f.isImageBlockGridViewDisplayEnabled()&&(pa+=" videoImageBlockGridView");f.createThumbnail(m,g.thumb,z,pa);2===a.dp60VideoPosition&&y(z,a.dp60VideoPosition);f.useTabbedImmersiveView(a)&&(M(z.find(".videoBlockIngress img"),a.videoIngressATFSlateThumbURL),e=1<h.length?"multiple-videos":"one-video",m=a.staticStrings.watchVideosLabel,z.find(".videoBlockIngress").addClass(e),
m&&z.find(".videoBlockIngress").append(z.find("#videoCount_template").clone().text(m).attr("id","videoCount")));g=l.buildNexusMetric("ib.thumbnailRender",d+1,g.mediaObjectId,g.rankingStrategy,f.customerId,g.groupType,T,Q,ba,Z);e=W(a,c.getCurrentItem().color);e!==g.pageAsin&&(g.pageAsin=e,T=p.location.href,e=T.replace(/\/dp\/([A-Z0-9]{10})/,"/dp/"+e),g.pageUrl=e);l.emitNexusMetric(g);oa||(oa=!0,l.postCountMetric("chromeless-video"===k?"dppc_chromelessVideoAvailable":"dppc_chromefulVideoAvailable"))}d++}if(f.useTabbedImmersiveView(a))return!1}),
B(z,e,d,k),q(v),a.imageBlockRenderingStartTime&&l.postTimeMetric("vse_desktop_ib_video_ingress_enable_duration",g.now()-a.imageBlockRenderingStartTime));return d}function y(c,d){if(0!==d)if(2===a.unrolledImageBlockTreatment||3===a.unrolledImageBlockTreatment){var e=a.useChromelessVideoPlayer?"chromeless-video":"chromeful-video",f=c.children(".thumbTypeimage");c=c.children(".thumbType"+e);f&&c&&f[d-1]&&b(f[d-1]).before(c[0]);c=b(".unrolledScrollBox .list-unrolled");f=c.children(".unrolledImg.imgMedia");
c=c.children(".unrolledImg.videoMedia");f&&c&&f[d-1]&&b(f[d-1]).before(c[0]);b(".unrolledScrollBox .list-unrolled").children(".unrolledImg").each(function(a){for(var c=null,d=0;d<this.classList.length;d++)this.classList[d].includes("itemNo")&&(c=d);null!==c&&b(this).removeClass(this.classList[c]).addClass("itemNo"+a);this.querySelectorAll("div")[1].id="unrolledImgNo"+a})}else f=c.children(".imageThumbnail"),c=c.children(".videoBlockIngress"),f&&c&&f[d-1]&&b(f[d-1]).before(c[0])}function M(a,c){var b=
a.attr("src");b&&c&&(a.attr("src",c),c=new Image,c.onload=function(c){a.attr("src",b)},c.src=b)}function H(c){a.autoplayVideo&&c&&!ea&&(r&&f.toggleVideoCaption(r),c.setVolume(0),c.show(),c.play(),ea=!0)}function I(c){if("click"===c.$event.type||"keypress"===c.$event.type&&13===c.$event.keyCode){n&&n.pause();c.data=U;c.clickTimeStamp=c.$event.timeStamp;var d="a"===c.targetTag?"dpcc_videoIngressLink":"dpcc_videoIngressSlate";e.dispatch("imageClick",c);l.postTimeMetric("dpcc_vse_videoingressclick",c.$event.timeStamp);
c=l.buildNexusMetric("ib.thumbnailClick",c.data.thumbnailIndex+1,a.videos[0].mediaObjectId,a.videos[0].rankingStrategy,f.customerId,a.videos[0].groupType,T,Q,ba,Z);l.emitNexusMetric(c);l.postCountMetric(d);b("#main-video-container .vjs-control-bar").css("display","none");b("#main-video-container .vjs-poster").css("display","inline-block")}}function N(a){null!==n&&n!==R&&(n.frame&&n.frame.remove(),n=null,E.frame&&E.frame.remove(),E=null);E=a.player;b("#main-video-container .vse-airy-container.vse-player-container").css("min-width",
"auto");E.hide=function(){E.pause();g.$("#main-video-container").find(".vse-player-container").hide()};E.show=function(){g.$("#main-video-container").find(".vse-player-container").show()};E.getMediaSourceInfo=function(){return f.getMediaSourceInfo()}}function m(d,e,k,h,m,l){L(l);F=null!==l?b("#unrolledImgNo"+l.thumbnailIndex):h.find("#main-video-container");ta&&(r=null!==l?"":F.parent().find("#video-canvas-caption"));na=null!==l?b(".unrolledScrollBox"):b("#main-image-container");null===l&&f.isImageBlockGridViewDisplayEnabled()&&
(F.addClass("videoCenter"),h.find("#video-outer-container").addClass("videoWrapperCenter"));T=p.location.href;d=c.getCurrentItem().color;!0===m?Q=a.mediaAsin:(Q=a.colorToAsin[d]&&a.colorToAsin[d].asin,Q=f.isDefined(Q)?Q:a.mediaAsin);a.useChromelessVideoPlayer||F.addClass("chromeful-container");null!==l?x(l,"unrolled-video-add"):x(c.getCurrentItem(),"");f.useTabbedImmersiveView(a)&&g.declarative("videoIngressClick",["click","keypress"],I);if(-1!==n&&null!==l){d=c.getCurrentItem().color;var n=f.getVideoHash(d,
l.index,a);f.useTabbedImmersiveView(a)||(m={requester:"MediaBlockSoftlines",marketplaceID:n.marketPlaceID,clientPrefix:"mbSoftlines"+l.thumbnailIndex,locale:n.languageCode,page:"Detail",metadata:{placementcontext:"mb_sl",alwaysSetInitialVideo:!1},placement:"ImageBlock",video:{videoURL:n.url,imageURL:n.slateUrl},product:{contentID:W(a,d),contentIDType:"ASIN"}},K.get(g,"#unrolledImgNo"+l.thumbnailIndex,m,function(){g.$("#unrolledImgNo"+l.thumbnailIndex).find(".vse-player-container").show()},function(){g.$("#imageBlock #altImages ul").find("li.videoThumbnail").hide()}))}}
function d(a){var c=g.$("#main-video-container");if(c&&c.length){var b=g.$("\x3cdiv\x3e\x3c/div\x3e").addClass("a-dynamic-image ive-video-thumbnail aok-hidden");b.attr({"data-old-hires":a.slateUrl,"data-a-manual-replacement":"true"});b.data("a-dynamic-image",ca({},a.slateUrl,["100%","100%"]));var d=g.$("\x3cdiv\x3e").addClass("videoTagWrapper");d.append(b);c.empty().append(d);b.length&&g.loadImageManually(b);g.$("#main-video-container").find(".ive-video-thumbnail").removeClass("aok-hidden");if(c=
document.querySelector("#main-video-container .videoTagWrapper img.ive-video-thumbnail"))c.setAttribute("tabindex","0"),c.setAttribute("alt",a.title),c.setAttribute("role","button"),c.setAttribute("type","submit")}}function h(a,c){function d(){var a=Math.floor((z.width()-1)/h);return f?a-1:a}function e(a){a=d();c.slice(a).hide();c.slice(0,a).show();c.find(".textMoreImages").remove();c.removeClass("overlayRestOfImages");c.find("img").each(function(){b(this).parent().attr("aria-hidden","true")});if(a<
c.length){var e=a-1;a=c.eq(e);c.eq(e).find("img").parent().attr("aria-hidden","false");e=c.length-e;e=b("\x3cspan\x3e").addClass("textMoreImages").text(e+"+");a.find("img").after(e);a.addClass("overlayRestOfImages")}}var f=0!=z.find(".item.videoThumbnail").length,g=c.eq(0).width(),k=c.eq(1).position().left-c.eq(0).position().left-g,h=g+k;e();a.register("resize",e)}function w(a){var c=z.find(".item.imageThumbnail");if(!(1>=c.length)){var b=c.eq(0).find("img").get(0);b!==R&&b.decode().then(function(){h(a,
c)})}}function q(a){try{if(!a)return!1;qa=a;ia=document.querySelectorAll("#imageBlock #altImages ul li.videoThumbnail");a={root:null,rootMargin:"0%",threshold:.75};null!==aa&&aa.disconnect();0<ia.length&&(aa=new IntersectionObserver(k,a));ia.forEach(function(a){aa.observe(a)})}catch(ua){l.postCountMetric("ib_dsktp_thumb_impr_intersection_obs_failed")}}function k(a){qa(a,sa,fa,ia,ma)}function v(a,d,e,f,g){try{b.each(a,function(a,k){var h=b(f).index(k.target);k.isIntersecting?la[h]||(la[h]=setTimeout(function(){d=
d.slice();d.push(h);e=d.sort(function(a,c){return a-c});var a=D(e,g);if(0!==a.length&&0!==e.length){var b=c.getCurrentItem().color;b=u(b);J(b,a);delete la[h]}},1E3)):(clearTimeout(la[h]),delete la[h],d=d.filter(function(a){return a!==h}),e=d.sort(function(a,c){return a-c}))})}catch(wa){l.postCountMetric("ib_dsktp_thumbnail_on_intersection_failed")}}function D(a,c){return c=a=a.slice().filter(function(a){return 0>c.indexOf(a)})}function J(a,c){try{if(!a||!c||0===a.length||0===c.length)return!1;b.each(c,
function(c,b){if(b=1===ia.length?a[0]:a[b])c=l.buildNexusMetric("ib.thumbnailImpression",c+1,b.mediaObjectId,b.rankingStrategy,f.customerId,b.groupType,p.location.href,Q,ba,Z),l.emitNexusMetric(c)})}catch(va){l.postCountMetric("ib_dsktp_thumbnail_impression_failed")}}function W(a,c){if(a){if(a.colorToAsin&&a.colorToAsin[c]&&a.colorToAsin[c].asin)return a.colorToAsin[c].asin;if(a.mediaAsin)return a.mediaAsin}return""}var V,a,c,e,z,F,r,na,ha,n,S,U,X,E,Q,T,ba,Z,ka,ja,da,oa=!1,ea=!1,pa="videoThumbnail",
Y=null,aa=null,fa,ma=[],ia,sa=[],qa=null,ra=g.state("imageBlockStateData"),ta=ra?!ra.shouldRemoveCaption:!0,la={};return function(h,k,n,p){V=this;a=h;c=k;e=p;S=a.airyConfig;ba=a.contentWeblab&&a.contentWeblab+":"+a.contentWeblabTreatment;f.customerId=f.customerId||a.customerId||"";a.colorToVideo={};a.colorToVideo[a.landingAsinColor]=a.colorToVideo[a.defaultColor]=a.videos;a.tabletWeb?(ka="tablet",Z="applicationType.ImageBlock.vse_ib_tablet_web"):g.capabilities.tablet?(ka="tablet",g.capabilities.isAmazonApp&&
(Z="applicationType.ImageBlock.vse_ib_tablet_app")):(ka="desktop",Z="desktop_web.ImageBlock.vse_ib_iv");V.render=function(d,h,k,l,n,J){var p=g.$("#main-video-container");0<p.length&&(p.find(".ive-video-thumbnail").addClass("aok-hidden"),p.find(".videoTagWrapper").addClass("aok-hidden"));null!==Y&&(clearInterval(Y),Y=null,F&&F.parent&&F.parent().css("z-index",-1),r&&r.hide&&r.hide());p=[];if(2===a.unrolledImageBlockTreatment||3===a.unrolledImageBlockTreatment){z=b("ul.regularAltImageViewLayout");X=
t(h,d,J);p=[];h=b(".thumbItemUnrolled").filter(function(){return this.classList.contains("thumbTypechromeful-video")||this.classList.contains("thumbTypechromeless-video")});for(var q=0;q<h.length;q++){var u=h[q].classList.contains("thumbTypechromeful-video")?"chromeful-video":"chromeless-video",v=Number(h[q].classList[2].slice(10)),x=b(".thumbItemUnrolled").index(h[q]);p.push({color:d,thumbnailIndex:x,type:u,varient:"MAIN",index:v})}for(q=0;q<p.length;q++)m(d,k,l,n,J,p[q])}else z=l,X=t(h,d,J),m(d,
k,l,n,J,null),l=c.getCurrentItem().color,n=f.getVideoHash(l,0,a),-1!==n&&(d=function(){g.$("#main-video-container").find(".vse-player-container").hide()},k=function(){g.$("#imageBlock #altImages ul").find("li.videoThumbnail").hide()},a.tabletWeb?(l=f.getNilgiriServiceAjaxRequest(a,l,n),K.get(g,"#main-video-container",l,d,k)):f.useTabbedImmersiveView(a)||(l={requester:"MediaBlockSoftlines",marketplaceID:n.marketPlaceID,clientPrefix:"mbSoftlines",locale:n.languageCode,page:"Detail",metadata:{placementcontext:"mb_sl",
alwaysSetInitialVideo:!1},placement:"ImageBlock",video:{videoURL:n.url,imageURL:n.slateUrl},product:{contentID:W(a,l),contentIDType:"ASIN"}},K.get(g,"#main-video-container",l,d,k)));a.collapsibleThumbnails&&w(e);return X};V.setupIntersectionObserverToWatchVideoThumbnail=q;V.emitMultipleImpressionMetric=J;f.isImageBlockGridViewHoverDelayEnabled()?V.update=function(b){var h=g.$("#main-video-container");0<h.length&&(h.find(".ive-video-thumbnail").addClass("aok-hidden"),h.find(".videoTagWrapper").addClass("aok-hidden"));
null!==Y&&(clearInterval(Y),Y=null,F&&F.parent&&F.parent().css("z-index",-1),r&&r.hide&&r.hide());var k=b.data;"ingress"===k.type||"swatchHover"===b.type||f.lazyLoadingRequired(k,c,a)||(c.setToPreviousItem(),"mouseenter"===b.type?(da&&clearTimeout(da),da=setTimeout(function(){c.setToCurrentItem(k);L(null)},f.getHoveringDelayTimer())):"mouseleave"===b.type?da&&clearTimeout(da):"click"===b.type&&(c.setToCurrentItem(k),L(null)));if("swatchHover"===b.type)"ingress"===k.type||f.lazyLoadingRequired(k,c,
a)||L(null),k.color===c.getCurrentItem().color?x(c.getCurrentItem(),""):b.captured||f.lazyLoadingRequired(k,c,a)&&!f.lazyLoadOnHoverEnabled(a)&&x(c.getCurrentItem(),"");else if("chromeful-video"===k.type)if(h=f.getVideoHash(k.color,k.index,a),"mouseenter"===b.type)f.useTabbedImmersiveView(a)&&d(h),l.postCountMetric("dpcc_videoThumbHovered_"+(k.thumbnailIndex+1)+"_"+X),h=l.buildNexusMetric("ib.thumbnailHover",k.thumbnailIndex+1,h.mediaObjectId,h.rankingStrategy,f.customerId,h.groupType,T,Q,ba,Z),l.emitNexusMetric(h),
ja&&clearTimeout(ja),ja=setTimeout(function(){x(k,"");!a.usePeekHover&&g.$(b.$currentTarget).closest("li").hasClass("videoThumbnail")&&f.selectGivenThumbnail(b.$declarativeParent,z)},f.getHoveringDelayTimer());else if("mouseleave"===b.type)ja&&clearTimeout(ja);else if("click"===b.type&&(x(k,""),g.$(b.$currentTarget).closest("li").hasClass("videoThumbnail"))){f.selectGivenThumbnail(b.$declarativeParent,z);var m=l.buildNexusMetric("ib.thumbnailClick",k.thumbnailIndex+1,h.mediaObjectId,h.rankingStrategy,
f.customerId,h.groupType,T,Q,ba,Z);(!f.useTabbedImmersiveView(a)&&"chromeless-video"===k.type||"tablet"==ka)&&l.emitNexusMetric(m);f.useTabbedImmersiveView(a)&&(l.emitNexusMetric(m),l.postCountMetric("dpcc_videoThumbClicked_"+(k.thumbnailIndex+1)+"_"+X),d(h),U.action="videoIngressClick",U.clickTimeStamp=b.$event.timeStamp,U.$event=b.$event,U.$currentTarget=b.$currentTarget,e.dispatch("videoIngressClick",U),l.postTimeMetric("dpcc_vse_videoingressclick",b.$event.timeStamp))}}:V.update=function(b){var h=
g.$("#main-video-container");0<h.length&&(h.find(".ive-video-thumbnail").addClass("aok-hidden"),h.find(".videoTagWrapper").addClass("aok-hidden"));null!==Y&&(clearInterval(Y),Y=null,F&&F.parent&&F.parent().css("z-index",-1),r&&r.hide&&r.hide());h=b.data;"ingress"===h.type||f.lazyLoadingRequired(h,c,a)||L(null);if("swatchHover"===b.type)h.color===c.getCurrentItem().color?x(c.getCurrentItem(),""):b.captured||f.lazyLoadingRequired(h,c,a)&&!f.lazyLoadOnHoverEnabled(a)&&x(c.getCurrentItem(),"");else if("chromeful-video"===
h.type){var k=f.getVideoHash(h.color,h.index,a);if("mouseenter"===b.type){f.useTabbedImmersiveView(a)&&d(k);l.postCountMetric("dpcc_videoThumbHovered_"+(h.thumbnailIndex+1)+"_"+X);var m=l.buildNexusMetric("ib.thumbnailHover",h.thumbnailIndex+1,k.mediaObjectId,k.rankingStrategy,f.customerId,k.groupType,T,Q,ba,Z);l.emitNexusMetric(m)}x(h,"");a.usePeekHover&&"click"!==b.type||!g.$(b.$currentTarget).closest("li").hasClass("videoThumbnail")||(f.selectGivenThumbnail(b.$declarativeParent,z),"click"===b.type&&
(m=l.buildNexusMetric("ib.thumbnailClick",h.thumbnailIndex+1,k.mediaObjectId,k.rankingStrategy,f.customerId,k.groupType,T,Q,ba,Z),(!f.useTabbedImmersiveView(a)&&"chromeless-video"===h.type||"tablet"==ka)&&l.emitNexusMetric(m),f.useTabbedImmersiveView(a)&&(l.emitNexusMetric(m),l.postCountMetric("dpcc_videoThumbClicked_"+(h.thumbnailIndex+1)+"_"+X),d(k),U.action="videoIngressClick",U.clickTimeStamp=b.$event.timeStamp,U.$event=b.$event,U.$currentTarget=b.$currentTarget,e.dispatch("videoIngressClick",
U),l.postTimeMetric("dpcc_vse_videoingressclick",b.$event.timeStamp))))}};if(a.isDPXFeatureEnabled)g.on("triggerVideoAjax",G);g.on("vsePlayer-imageblock_tablet",N);g.on("vsePlayer-mbsoftlines",N)}});"use strict";O.when("ImageBlockBTF","postMetric").register("ImageBlockInitViews",function(g,b){function f(b,f,K,B,G){function l(b){"click"===b.type&&B.postCountMetric("thumbClick");"click"===b.type&&q.overrideAltImageClickAction?k.dispatch("thumbActionClick",b):k.dispatch("updateSelection",b)}function L(b){q.useClickZoom||
k.dispatch("imageClick",b)}function C(b){q.useClickZoom||k.dispatch("imageHover",b)}function A(b){k.dispatch("button360Click",b)}function x(b){k.dispatch("captionClick",b)}function t(d){!K.isDefined(d)||"swatchClick"!==d.type&&"updatedData"!==d.type?(w.update(d),"swatchHover"!==d.type&&v.getPreviousItem().thumbnailIndex!==d.data.thumbnailIndex&&B.postCountMetric(d.data.type+"ThumbnailSelected"),b.trigger("image-block-thumbnail-selected",d.data)):(w.render(d.data.color,!1,d.onload,d.type),d={hasComponents:!0,
components:[{name:"mainimage"},{name:"thumbnail"}]},"function"===typeof p.markFeatureRender&&p.markFeatureRender("imageblock",d))}function y(b){k.dispatch("resize",b)}function M(b){K.selectThumbnail(b,D)}function H(){"function"===typeof p.markFeatureInteractive&&p.markFeatureInteractive("imageblock",{hasComponents:!0,components:[{name:"mainimage",events:["click"],alwaysInteractive:!0}]})}function I(){q.interactiveCallJSPEnabled||("function"===typeof p.markFeatureInteractive&&p.markFeatureInteractive("imageblock",
{hasComponents:!0,components:[{name:"mainimage",events:["hover"],alwaysInteractive:!0},{name:"thumbnail",events:["click","hover"],alwaysInteractive:!0}]}),1===g.useIV?O.when("a-modal").execute(function(){H()}):H());q.disableHoverOnAltImages||b.declarative("thumb-action",["mouseenter","mouseleave"],l);b.declarative("thumb-action",["click"],l);b.declarative("main-image-click",["click"],L);b.declarative("main-image-click",["mouseenter","mouseleave"],C);b.declarative("button-360-click",["click"],A);b.declarative("iv-open-caption-click",
["click"],x);b.on("resize",y)}function N(b){var d=b.data,f;d&&"ingress"!==d.type&&"click"===b.type&&(f=b);return f}function m(b){var d=v.getCurrentItem(),f={type:"click"};f.$declarativeParent=b;f.data=d;return f}function d(){var b=D.find(".item.imageThumbnail");if(!(1>=b.length)){var d=v&&v.getCurrentItem()&&v.getCurrentItem().color;d=(d=q.colorImages&&d&&q.colorImages[d])&&d.length;b.removeClass("overlayRestOfImages");b.length<d&&(b.eq(b.length-1).addClass("overlayRestOfImages"),b=document.createElement("div"),
b.className="lastAltImageOverlay",(d=(d=(d=document.getElementsByClassName("overlayRestOfImages")[0])&&d.getElementsByTagName("img"))&&0<d.length&&d[0])&&d.parentNode&&(d.parentNode.insertBefore(b,d),d=(d=d.parentNode.getElementsByClassName("textMoreImages"))&&0<d.length&&d[0]))&&("T1"===q.desktopCollapsibleThumbnailsExperience?(d.classList.add("textMoreImages-t1"),b.classList.add("lastAltImageOverlay-t1"),B.postCountMetric("desktopCollapsibleThumbnailShowT1")):"T2"===q.desktopCollapsibleThumbnailsExperience&&
(d.classList.add("textMoreImages-t2"),b.classList.add("lastAltImageOverlay-t2"),B.postCountMetric("desktopCollapsibleThumbnailShowT2")))}}function h(b){K.isImageBlockGridViewHoverDelayEnabled()&&"mouseenter"===b.type&&K.updateThumbnailHoverDelay(b.$target)}var w,q,k,v,D;return function(b,g,l){w=this;q=b;k=g;v=l;D=f("#imageBlock #altImages ul");var a=f("#imageBlock .canvas"),c=f("#main-image-container"),e;w.subViews=[];for(g=0;g<G.length;g++)w.subViews.push(new G[g](b,l,w,k));w.render=function(b,g,
h,k){var l=0;D.find(".item").remove();b=b||v.getCurrentItem().color;f.each(w.subViews,function(d,e){l=(2===q.unrolledImageBlockTreatment||3===q.unrolledImageBlockTreatment?e.render(b,l,a,D,c,g,h,k):e.render(b,l,a,D,c,g,h))||l});"T1"!==q.desktopCollapsibleThumbnailsExperience&&"T2"!==q.desktopCollapsibleThumbnailsExperience||d();var n=D.find(".a-button-selected").closest(".a-declarative");e=m(n)};w.init=function(){D=f("#imageBlock #altImages ul");var a=D.find(".a-button-selected").closest(".a-declarative"),
b=a.data("action");a=a.data(b)||{};a.color=q.landingAsinColor||q.defaultColor;k.dispatch("updateModel",{data:a});w.render(a.color,!0);q.isDebug&&p.console&&console.log(q);k.register("updateView",t);k.register("selectThumbnail",M);I()};w.update=function(a){h(a);f.each(w.subViews,function(b,c){c.update(a)});q.usePeekHover&&("mouseleave"===a.type?k.dispatch("updateSelection",e):"click"===a.type&&(e=N(a)||e))}}}b=["A","jQuery","imageBlockUtils","postMetric"].concat(g.views);O.when.apply(O,b).register("ImageBlockView",
function(){for(var b=arguments[0],g=arguments[1],p=arguments[2],B=arguments[3],G=[],u=4,L=arguments.length;u<L;u++)G.push(arguments[u]);return f(b,g,p,B,G)})})});
/* ******** */
(function(J){var C=window.AmazonUIPageJS||window.P,ja=C._namespace||C.attributeErrors,g=ja?ja("DetailPageImageBlockSubAssets@immersiveViews","DetailPageImageBlockSubAssets"):C;g.guardFatal?g.guardFatal(J)(g,window):g.execute(function(){J(g,window)})})(function(J,C,ja){J.when("A","jQuery","imageBlockUtils","imageBlockImmersiveViewUtils","postMetric").register("ImageBlockImmersiveViewDimensionIngress",function(g,a,c,u,n){function A(d,b){var l=a(d+" image").attr("data");a(d+" image")[0].setAttribute("href",
l);d=new Image;d.src=l;d.onload=function(){b(this.width/this.height)}}function v(d){null!==a(d.euclidSvg)&&(new Promise(function(b,a){A(d.euclidSvg,b)})).then(function(b){if(null===a(d.featureDiv)||0===a(d.featureDiv).length||0>=b)var l=null;else{var e=a(d.featureDiv).width(),c=a(d.featureDiv).height(),k=2*(16+x(d.euclidHeightText,d.numberSpace)+10),f=e-k,t=a(d.euclidHeightLine).data("euclid-height-startx");0>t?k+=f*Math.abs(t)*2:1<t&&(k+=f*(t-1)*2);f=e-k;0>f&&(k=152);var g=a(d.euclidWidthLine).data("euclid-width-starty"),
m=1<g?c*(g-1)+50:50,M=c-m;if(f/M>b)var q=M*b,W=M,r=M*b+k,y=c;else q=f,W=f/b,r=e,y=f/b+m;l={imageWidth:q,imageHeight:W,svgWidth:r,svgHeight:y}}if("undefined"===typeof l||null===l||10>=l.imageWidth||10>=l.imageHeight||10>=l.svgWidth||10>=l.svgHeight)n.postCountMetric("dpcc_dimensionIngressEuclidInvalid");else{var L=l,w=d.euclidSvg;a(w+" image").attr("width",L.imageWidth);a(w+" image").attr("height",L.imageHeight);a(w).attr("width",L.svgWidth);a(w).attr("height",L.svgHeight);var B=(L.svgWidth-L.imageWidth)/
2;a(w+" image")[0].setAttribute("x",B);a(w+" image")[0].setAttribute("y",10);var u=L.imageWidth,v=L.imageHeight,p=(L.svgWidth-L.imageWidth)/2,R=a(d.euclidLengthLine).data("euclid-length-startx")*u,I=a(d.euclidLengthLine).data("euclid-length-starty")*v,G=a(d.euclidLengthLine).data("euclid-length-endx")*u,H=a(d.euclidLengthLine).data("euclid-length-endy")*v,fa=a(d.euclidWidthLine).data("euclid-width-startx")*u,A=a(d.euclidWidthLine).data("euclid-width-starty")*v,X=a(d.euclidWidthLine).data("euclid-width-endx")*
u,D=a(d.euclidWidthLine).data("euclid-width-endy")*v,V=a(d.euclidHeightLine).data("euclid-height-startx")*u,N=a(d.euclidHeightLine).data("euclid-height-starty")*v,O=a(d.euclidHeightLine).data("euclid-height-endx")*u,P=a(d.euclidHeightLine).data("euclid-height-endy")*v,va=(D-A)/(X-fa),hb=0>=va?"leftInclined":"rightInclined",Ra=1/va,ma=Math.abs(Math.sqrt(Math.pow(16,2)/(1+Math.pow(Ra,2)))),oa=0===ma?16:Math.abs(Ra*ma),qa=Math.abs(Math.sqrt(Math.pow(3,2)/(1+Math.pow(Ra,2)))),sa=0===qa?3:Math.abs(Ra*
qa),U=(H-I)/(G-R),C=1/U,z=Math.abs(Math.sqrt(Math.pow(16,2)/(1+Math.pow(C,2)))),F=0===z?16:Math.abs(C*z),K=Math.abs(Math.sqrt(Math.pow(3,2)/(1+Math.pow(C,2)))),S=0===K?3:Math.abs(C*K),ca=0>=U?"leftInclined":"rightInclined";if(.5<a(d.euclidHeightLine).data("euclid-height-startx")){var Y=V+p+16,Z=N+10,aa=O+p+16,ea=P+10,pa=V+p+16-3,na=N+10,ja=V+p+16+3,ib=N+10,jb=O+p+16-3,kb=P+10,lb=O+p+16+3,mb=P+10,nb=(Y+aa)/2+5,ob=(Z+ea)/2+8,Aa=X+p+ma,Ba=D+oa+10,Ca=fa+p+ma,Da=A+oa+10,pb=X+p+ma-qa,qb=D+oa-sa+10,rb=X+
p+ma+qa,sb=D+oa+sa+10,tb=fa+p+ma-qa,ub=A+oa-sa+10,vb=fa+p+ma+qa,wb=A+oa+sa+10;if("leftInclined"===hb){var Sa=(Aa+Ca)/2;var Ta=(Ba+Da)/2+15}else Sa=(Aa+Ca)/2+5,Ta=(Ba+Da)/2;var Ea=R+p-z,Fa=I+F+10,Ga=G+p-z,Ha=H+F+10,xb=R+p-z-K,yb=I+F+S+10,zb=R+p-z+K,Ab=I+F-S+10,Bb=G+p-z-K,Cb=H+F+S+10,Db=G+p-z+K,Eb=H+F-S+10,Hb=x(d.euclidLengthText,d.numberSpace);if("leftInclined"===ca)var Ua=(Ea+Ga)/2,Va=(Fa+Ha)/2+15;else Ua=(Ea+Ga)/2-Hb,Va=(Fa+Ha)/2+15}else{Y=V+p-16;Z=N+10;aa=O+p-16;ea=P+10;pa=V+p-16-3;na=N+10;ja=V+
p-16+3;ib=N+10;jb=O+p-16-3;kb=P+10;lb=O+p-16+3;mb=P+10;var Ib=x(d.euclidHeightText,d.numberSpace);nb=(Y+aa)/2-Ib-3;ob=(Z+ea)/2+8;Aa=X+p-ma;Ba=D+oa+10;Ca=fa+p-ma;Da=A+oa+10;pb=X+p-ma-qa;qb=D+oa+sa+10;rb=X+p-ma+qa;sb=D+oa-sa+10;tb=fa+p-ma-qa;ub=A+oa+sa+10;vb=fa+p-ma+qa;wb=A+oa-sa+10;var Fb=x(d.euclidWidthText,d.numberSpace);"leftInclined"===hb?(Sa=(Aa+Ca)/2-Fb,Ta=(Ba+Da)/2):(Sa=(Aa+Ca)/2-Fb,Ta=(Ba+Da)/2+15);Ea=R+p+z;Fa=I+F+10;Ga=G+p+z;Ha=H+F+10;xb=R+p+z+K;yb=I+F+S+10;zb=R+p+z-K;Ab=I+F-S+10;Bb=G+p+z+
K;Cb=H+F+S+10;Db=G+p+z-K;Eb=H+F-S+10;"leftInclined"===ca?(Ua=(Ea+Ga)/2,Va=(Fa+Ha)/2+15):(Ua=(Ea+Ga)/2+15,Va=(Fa+Ha)/2)}var Jb=Ea;var Kb=Fa;var Lb=Ga;var Mb=Ha;var Nb=xb;var Ob=yb;var Pb=zb;var Qb=Ab;var Rb=Bb;var Sb=Cb;var Tb=Db;var Ub=Eb;var Vb=Ua;var Wb=Va;var Xb=Aa;var Yb=Ba;var Zb=Ca;var $b=Da;var ac=pb;var bc=qb;var cc=rb;var dc=sb;var ec=tb;var fc=ub;var gc=vb;var hc=wb;var ic=Sa;var jc=Ta;var kc=Y;var lc=Z;var mc=aa;var nc=ea;var oc=pa;var pc=na;var qc=ja;var rc=ib;var sc=jb;var tc=kb;var uc=
lb;var vc=mb;var wc=nb;var xc=ob;ha(w+" .hit-pd-euclid-height-line",kc,lc,mc,nc);ha(w+" .hit-pd-euclid-height-start",oc,pc,qc,rc);ha(w+" .hit-pd-euclid-height-end",sc,tc,uc,vc);J(w+" .hit-pd-euclid-height-text",wc,xc);ha(w+" .hit-pd-euclid-width-line",Xb,Yb,Zb,$b);ha(w+" .hit-pd-euclid-width-start",ac,bc,cc,dc);ha(w+" .hit-pd-euclid-width-end",ec,fc,gc,hc);J(w+" .hit-pd-euclid-width-text",ic,jc);ha(w+" .hit-pd-euclid-length-line",Jb,Kb,Lb,Mb);ha(w+" .hit-pd-euclid-length-start",Nb,Ob,Pb,Qb);ha(w+
" .hit-pd-euclid-length-end",Rb,Sb,Tb,Ub);J(w+" .hit-pd-euclid-length-text",Vb,Wb);Q("#imageBlockDimensionIngress_feature_div #dimension-ingress-outer-container #image-block-euclid-svg-container")&&(d===ia&&"dimension-ingress-image"===E.getCurrentItem().type?(T(),a("#imageBlock #main-image-container #dimension-ingress-outer-container").addClass("a-declarative"),a("#imageBlock #main-image-container #dimension-ingress-outer-container").attr("data-action","dimension-hero-click"),n.postTimeMetric("dppc_loadDimensionHeroTime",
Date.now()-la)):d===da&&(a("ivDimensionTab").css("display","block"),h(a("#iv-euclid"),a("#ivDimensionTab #ivLargeDimensions #dimension-ingress-outer-container")),n.postTimeMetric("dppc_loadDimensionImmersiveTime",Date.now()-ka)))}});Q("#imageBlockDimensionIngress_feature_div #image-block-seller-dimension-image-container")&&K(d===ia,E.getCurrentItem(),null)}function x(d,b){return a(d).text().replace(/[^0-9]/g,"").length*b+5}function ha(d,b,l,e,c){d=a(d)[0];d!==ja&&null!==d&&(d.setAttribute("x1",b),
d.setAttribute("y1",l),d.setAttribute("x2",e),d.setAttribute("y2",c))}function J(d,b,l){var e=a(d)[0];e!==ja&&null!==e&&(e.setAttribute("x",b),e.setAttribute("y",l),d=a(d+" tspan"),d!==ja&&null!==d&&2===d.length&&(d[0].setAttribute("x",b),d[0].setAttribute("dy",LEFT_STRING_FIRST_LINE_BIAS),d[1].setAttribute("x",b),d[1].setAttribute("dy",LEFT_STRING_SECOND_LINE_BIAS)))}function z(d){if(!a("#imageBlock #main-image-container #dimension-ingress-outer-container").length||a("#imageBlock #main-image-container #dimension-ingress-outer-container").hasClass("aok-hidden")){if(!a("#imageBlock #main-image-container #dimension-ingress-outer-container").length){d=
y(d.color);if(null===d)return;if(d in R)Q("#imageBlockDimensionIngress_feature_div #dimension-ingress-outer-container #image-block-euclid-svg-container")&&R[d].clone().appendTo(a("#imageBlock #main-image-container"));else{var b=a("#imageBlockDimensionIngress_feature_div #dimension-ingress-outer-container");b.length?(Q("#imageBlockDimensionIngress_feature_div #dimension-ingress-outer-container #image-block-euclid-svg-container")&&b.clone().appendTo(a("#imageBlock #main-image-container")),R[d]=b):S(d)}}v(ia)}}
function S(d){try{setTimeout(function(){X++;var b=a("#imageBlockDimensionIngress_feature_div #dimension-ingress-outer-container");b.length?(d in R||(R[d]=b),a("#imageBlock #main-image-container #dimension-ingress-outer-container")&&0>=a("#imageBlock #main-image-container #dimension-ingress-outer-container").length&&Q("#imageBlockDimensionIngress_feature_div #dimension-ingress-outer-container #image-block-euclid-svg-container")&&b.clone().appendTo(a("#imageBlock #main-image-container")),v(ia)):100>
X&&S(d)},100)}catch(b){console.log("ImageBlockImmersiveViewDimensionIngress lazy load loop:"+b)}}function Q(d){return"true"===a(d).attr("data-should-use-in-hero")}function K(d,b,l){var e=q.colorImages[b.color],c=a("#imageBlockDimensionIngress_feature_div #image-block-seller-dimension-image-container #dimension-ingress-seller-image");c&&0<c.length?(e=C(e),Z(e,d,b,l)):O(e,d,b,l)}function O(d,b,l,e){try{setTimeout(function(){M++;var c=a("#imageBlockDimensionIngress_feature_div #image-block-seller-dimension-image-container #dimension-ingress-seller-image");
c&&0<c.length?(c=C(d),Z(c,b,l,e)):100>M?O(d,b,l,e):(n.postCountMetric("dpcc_dimensionIngress_hero_data_not_found"),c=d[0],Z(c,b,l,e))},100)}catch(ba){console.log("ImageBlockImmersiveViewDimensionIngress lazy load seller image loop:"+ba)}}function C(d){for(var b=a("#imageBlockDimensionIngress_feature_div #image-block-seller-dimension-image-container #dimension-ingress-seller-image").attr("variant"),l=d[0],e=0;e<d.length;e++){var c=d[e];c.variant===b&&(l=c)}l===d[0]&&n.postCountMetric("dpcc_dimensionIngress_no_image_data_found_for_seller_image_variant");
return l}function Z(d,b,l,e){b?((b=P.find(".item.dimensionItemNo"+l.thumbnailIndex))&&b.remove(),b=l.thumbnailIndex,e=U(d,e),l=P.find(".mainImageTemplate").clone().removeClass("template mainImageTemplate"),l.addClass("image item dimensionItemNo"+b+" maintain-height").attr({"data-csa-c-type":"uxElement","data-csa-c-element-type":"navigational","data-csa-c-action":"image-block-main-image-hover","data-csa-c-posy":b+1}),l.find(".placeHolder").replaceWith(e),l.find(".a-declarative").attr("data-action",
"dimension-hero-click"),P.find(".list").append(l),g.loadImageManually(e),e=b=l,l=ea.css("height"),null!==l&&e.find(".imgTagWrapper").css("height",l),e.addClass("selected"),q.imgTagWrapperClasses&&e.find(".imgTagWrapper").addClass(q.imgTagWrapperClasses),F.dispatch("loadMagnifier"),e=b,q.useIV&&c.isDefined(d.hiRes)&&e.css("cursor","pointer"),g.trigger("dp:image-block:update",d)):(N(d),h(a("#iv-seller"),a("#ivDimensionTab #ivLargeDimensions .imgTagWrapper")))}function N(d){var b=a("#ivDimensionTab #ivLargeDimensions");
if(0<b.find(".imgTagWrapper").length){var e=a("#ivDimensionTab #ivLargeDimensions .imgTagWrapper img");return Y(b,e)}e=a("\x3cdiv\x3e\x3c/div\x3e");e.addClass("imgTagWrapper");var c=a("\x3cimg\x3e");e.html(c);b.append(e);e=a("#ivDimensionTab #ivLargeDimensions .imgTagWrapper img");e.attr("src",d.hiRes);return Y(b,e)}function Y(a,b){a=a.closest("#ivStageDimensions");var d=a.width();a={height:"auto","max-height":a.height(),"max-width":d,"text-align":"center"};b.css(a);b=b.closest(".imgTagWrapper");
b.css(a);return b}function U(d,b){var e="a-dynamic-image";if(!q.acEnabled){var f;a.each(d.main,function(b,a){c.isDefined(f)||(f=parseFloat(a[1]/a[0])<=parseFloat(q.holderRatio)?" a-stretch-vertical":" a-stretch-horizontal")});e+=f}var k=c.getMaxDimensionsOfMainImage(d.main,ea,q),h=k[0],t=k[1];k=a("\x3cdiv\x3e\x3c/div\x3e");h={"max-height":h,"max-width":t};k.addClass(e).css(h).attr({"data-old-hires":d.hiRes,"data-a-manual-replacement":"true",onload:b}).data("a-dynamic-image",d.main);return k}function D(){var d=
'\x3ca href\x3d"#"\x3e'+q.staticStrings.clickForFullView+"\x3c/a\x3e";a("#image-canvas-caption #canvasCaption").html(d);d=a("#image-canvas-caption #canvasCaption a");g.declarative.create(d,"dimension-hero-click")}function y(a){var b=q.colorToAsin[a];return b&&b.asin?a=q.colorToAsin[a].asin:a=q.mediaAsin?q.mediaAsin:null}function r(){a("#imageBlock #main-image-container #dimension-ingress-outer-container").addClass("aok-hidden");a("#imageBlock #main-image-container #dimension-ingress-outer-container").css("z-index",
-1)}function T(){null!==a(ia.euclidSvg)&&0!==a(ia.euclidSvg).length?(a("#imageBlock #main-image-container #dimension-ingress-outer-container").removeClass("aok-hidden"),a("#imageBlock #main-image-container #dimension-ingress-outer-container").css("z-index",2)):K(ia,E.getCurrentItem(),null)}function G(a,b){q.usePeekHover&&"click"!==b.type||c.selectGivenThumbnail(b.$declarativeParent,a)}function B(a){a.action="dimensionIngressClick";a.data=aa;F.dispatch("dimensionIngressClick",a)}function H(){ka=Date.now();
if(e&&!a("#ivDimensionTab #ivLargeDimensions #dimension-ingress-outer-container").length){var d=y(E.getCurrentItem().color);if(null!==d){a("#imageBlockDimensionIngress_feature_div #dimension-ingress-outer-container");var b=a("#ivDimensionTab #ivLargeDimensions").length;console.log("checkImmersiveViewContainer",b);d in R?R[d].clone().appendTo(a("#ivDimensionTab #ivLargeDimensions")):(b=a("#imageBlockDimensionIngress_feature_div #dimension-ingress-outer-container"),b.length?(b.clone().appendTo(a("#ivDimensionTab #ivLargeDimensions")),
R[d]=b):w(d));u.populateTitle(a("#ivDimensionTab #ivMainDimensions").find("#ivTitleDimensions"),160,q);u.populateVariationSelection(a("#ivDimensionTab #ivMainDimensions").find("#ivVariationSelectionDimensions"));V();e=!1}d=a("#iv-tab-view-container").find("#ivThumbsDimensions");d.find(".ivRow").not(".placeholder").remove();b=d.find(".ivRow.placeholder").clone().removeClass("placeholder").appendTo(d);var c=0<a("#imageBlockDimensionIngress_feature_div #image-block-seller-dimension-image-container").length,
k=0<a("#imageBlockDimensionIngress_feature_div #dimension-ingress-outer-container #image-block-euclid-svg-container").length;if("true"===a("#imageBlockDimensionIngress_feature_div #dimension-ingress-outer-container").attr("data-should-show-thumbnails-in-iv")){if(c){if(!a("#ivDimensionTab #ivLargeDimensions .imgTagWrapper").length){var f=q.colorImages[E.getCurrentItem().color];f=C(f);N(f);a("#ivDimensionTab #ivLargeDimensions .imgTagWrapper").addClass("aok-hidden")}t(d,b,f.thumb,a("#ivDimensionTab #ivLargeDimensions .imgTagWrapper"),
"iv-seller")}k&&(f=a("#imageBlockDimensionIngress_feature_div #dimension-ingress-outer-container #image-block-euclid-svg-container image").attr("data"),t(d,b,f,a("#ivDimensionTab #ivLargeDimensions #dimension-ingress-outer-container"),"iv-euclid"))}}m()}function m(){fa=a("#ivDimensionTab").height();if(0!==fa){u.detachImmersiveViewResizeHandler(H);var d=a("#ivDimensionTab #ivMainDimensions"),b=a("#ivDimensionTab").height(),e=a("#ivDimensionTab").width();d.css("height",b);d.css("width",e);e=d.find("#ivTitleDimensions").outerHeight(!0);
var c=d.find("#ivVariationSelectionDimensions").outerHeight(!0),f=d.find("#ivThumbsDimensions"),k=u.getDimension(f,"margin-top")+u.getDimension(f,"margin-bottom");f.css("height",b-e-c-k);e=d.find("#ivStageDimensions");d=(d[0]&&d[0].getBoundingClientRect&&Math.floor(d[0].getBoundingClientRect().width)||d.width())-u.getDimension(d,"padding-left")-u.getDimension(d,"padding-right")-d.find("#ivThumbColumnDimensions").width()-u.getDimension(e,"margin-left")-u.getDimension(e,"margin-right");e.css("width",
d);e.css("height",b);v(da)}}function t(a,b,e,c,f){a=a.find(".ivThumb.placeholder").clone().removeClass("placeholder").attr({id:f}).appendTo(b);a.find(".ivThumbImage").css("background",'url("'+u.getResizedThumbnailURL(e)+'") center no-repeat');c.hasClass("aok-hidden")||a.addClass("selected");W(a,c)}function W(a,b){a.click(function(){h(a,b)})}function h(a,b){a.parent().find(".ivThumb").removeClass("selected");a.addClass("selected");b.hasClass("imgTagWrapper")&&Y(b,b.find("img"));b.parent().find("#dimension-ingress-outer-container").addClass("aok-hidden");
b.parent().find(".imgTagWrapper").addClass("aok-hidden");b.removeClass("aok-hidden")}function w(e){try{setTimeout(function(){k++;var b=a("#imageBlockDimensionIngress_feature_div #dimension-ingress-outer-container");b.length?(e in R||(R[e]=b),a("#ivDimensionTab #ivLargeDimensions #dimension-ingress-outer-container")&&0>=a("#ivDimensionTab #ivLargeDimensions #dimension-ingress-outer-container").length&&b.clone().appendTo(a("#ivDimensionTab #ivLargeDimensions")),m()):100>k&&w(e)},100)}catch(b){console.log("ImageBlockImmersiveViewDimensionIngress lazy load IV loop:"+
b)}}function I(e,b){f&&clearTimeout(f);"mouseenter"===b.type&&(f=setTimeout(function(){z(e);a("#image-canvas-caption #canvasCaption").empty();D();G(ca,b)},c.getHoveringDelayTimer()));"mouseleave"===b.type&&D()}var p,q,E,F,ca,P,ea,aa,e=!0,la,ka,f,L,R={},X=0,k=0,M=0,fa,ia={euclidSvgContainer:"#imageBlock #image-block-euclid-svg-container",euclidSvg:"#imageBlock #hit-pd-angled-front-svg",euclidHeightText:"#imageBlock #hit-pd-angled-front-svg .hit-pd-euclid-height-text",euclidWidthText:"#imageBlock #hit-pd-angled-front-svg .hit-pd-euclid-width-text",
euclidLengthText:"#imageBlock #hit-pd-angled-front-svg .hit-pd-euclid-length-text",featureDiv:"#imageBlock #main-image-container",euclidLengthLine:"#imageBlock .hit-pd-euclid-length-line",euclidWidthLine:"#imageBlock .hit-pd-euclid-width-line",euclidHeightLine:"#imageBlock .hit-pd-euclid-height-line",numberSpace:10},da={euclidSvg:"#ivDimensionTab #hit-pd-angled-front-svg",euclidHeightText:"#ivDimensionTab #hit-pd-angled-front-svg .hit-pd-euclid-height-text",euclidWidthText:"#ivDimensionTab #hit-pd-angled-front-svg .hit-pd-euclid-width-text",
euclidLengthText:"#ivDimensionTab #hit-pd-angled-front-svg .hit-pd-euclid-length-text",featureDiv:"#ivDimensionTab #ivStageDimensions",euclidLengthLine:"#ivDimensionTab .hit-pd-euclid-length-line",euclidWidthLine:"#ivDimensionTab .hit-pd-euclid-width-line",euclidHeightLine:"#ivDimensionTab .hit-pd-euclid-height-line",numberSpace:14},V=g.once(function(){u.attachImmersiveViewResizeHandler(H)});g.on.resize(function(){Q("#imageBlockDimensionIngress_feature_div #dimension-ingress-outer-container #image-block-euclid-svg-container")&&
v(ia)});return function(d,b,f,h){p=this;q=d;E=b;F=h;d=q.mediaAsin;b=[];q&&q.dimensionIngressAtfData&&q.dimensionIngressAtfData.initial&&(b=q.dimensionIngressAtfData.initial.dimensionVariantList);c.setDimensionIngressData(d,q.dimensionIngressEnabled,b);p.render=function(b,d,f,l,h,t){ca=l;P=2!==q.unrolledImageBlockTreatment&&3!==q.unrolledImageBlockTreatment?f:a(".unrolledScrollBox");ea=h;e=!0;a("#imageBlock #main-image-container #dimension-ingress-outer-container").remove();a("#ivDimensionTab #ivLargeDimensions #dimension-ingress-outer-container").remove();
a("#ivDimensionTab #ivLargeDimensions").empty();k=X=0;f=y(E.getCurrentItem().color);if(null!==f){if(c.isDimensionIngressEnabled(f)&&q.dimensionIngressThumbURL&&q.dimensionIngressThumbURL.initial&&q.dimensionIngressThumbURL.initial.length){f=c.getDimensionVariantList(f);if(f.includes("DIMN")||f.includes("DCMN"))Array.isArray(f)||(f=JSON.parse(f.replace(/(\w+)/g,'"$1"'))),f.push("DIMN"),f.push("DCMN");if(f&&0<f.length){h=q.colorImages[b];t=l.find(".item.imageThumbnail");for(var g=0;g<t.length&&g<q.maxAlts-
1;g++){var m=h[g].variant;"MAIN"!=m&&f.includes(m)&&(m=t.eq(g))&&(m.remove(),d--)}}d===q.maxAlts&&(l.find(".item.imageThumbnail").last().remove(),d--);aa={type:"dimension-ingress-image",index:0,thumbnailIndex:d,variant:"Main"};c.createThumbnail(aa,q.dimensionIngressThumbURL.initial,l,"dimension-ingress-imageblock-thumbnail");l=q.dimensionIngressAtfData.initial.thumbnailCaption;l=a("\x3cspan /\x3e").html(l);l.addClass("a-size-mini a-color-secondary dimension-caption a-text-bold a-nowrap");l.attr("id",
"dimensionCaption");a(".dimension-ingress-imageblock-thumbnail").addClass("a-align-top");a(".dimension-ingress-imageblock-thumbnail").append(l);d++;a("#ivDimensionTabHeading").removeClass("aok-hidden");y(b)!==q.mediaAsin&&0===a("#imageBlockDimensionIngress_feature_div #dimension-ingress-outer-container").length&&a("#imageBlock .dimension-ingress-imageblock-thumbnail").addClass("aok-hidden");return d}a("#ivDimensionTabHeading").addClass("aok-hidden")}};p.update=function(b){var e=b.data;E.setCurrentEvent(b);
"dimension-ingress-image"===e.type?(e.interaction=b.type,e.isUserGenerated=!0,"mouseenter"===b.type&&(la=Date.now(),n.postCountMetric("dpcc_dimensionIngressHovered")),c.isImageBlockGridViewHoverDelayEnabled()?I(e,b):(z(e),a("#image-canvas-caption #canvasCaption").empty(),D(),G(ca,b)),"click"===b.type&&c.useTabbedImmersiveView(q)&&(B(b),n.postCountMetric("dpcc_dimensionIngressClicked"))):"swatchHover"===b.type?e.color===E.getCurrentItem().color&&"dimension-ingress-image"===E.getCurrentItem().type?
T():r():c.isImageBlockGridViewHoverDelayEnabled()?(E.setToPreviousItem(),"mouseenter"===b.type&&(L&&clearTimeout(L),L=setTimeout(function(){E.setToCurrentItem(e);r()},c.getHoveringDelayTimer())),"mouseleave"===b.type&&L&&clearTimeout(L),"click"===b.type&&(E.setToCurrentItem(e),r())):r()};u.attachTabSelectHandler("ivDimensionTab",H);g.declarative("dimension-hero-click",["click"],B)}});"use strict";J.when("A","jQuery","imageBlockUtils","postMetric","imageBlockImmersiveViewUtils").register("ImageBlockImmersiveViewImages",
function(g,a,c,u,n){var A,v,x;function ha(){n.populateTitle(m.find("#ivTitle"),160,B)}function C(){var a=H.getCurrentItem().color;W=B.colorImages[a];t=B.heroImage[a];h=w=0;c.isDefined(t)&&(h=t.length);c.isDefined(W)&&(w=W.length)}function z(a){return a.hiRes||a.large||a.main[a.main.length-1]}function S(){var a=m.find("#ivStage").find("#ivLargeImage"),c=a.width(),h=a.height(),f=a.find(".fullscreen");f.removeAttr("style");var t=f.width(),g=f.height();0<f.length&&(f[0].naturalWidth&&(t=f[0].naturalWidth),
f[0].naturalHeight&&(g=f[0].naturalHeight));a.css("cursor","auto");t=0===t?1:t;g=0===g?1:g;var q=Math.min(c/t,h/g),k=g*q,M=t*q;1>q?(p?a.css("cursor","url('"+B.staticImages.zoomIn+"'), auto"):(a.css("cursor","-webkit-zoom-in"),a.css("cursor","-moz-zoom-in"),a.css("cursor","zoom-in")),F=!0):F=!1;t=Math.min(M,t);g=Math.min(k-20,g);f.css({"margin-top":(h-g)/2,"margin-left":(c-t)/2,height:g,width:t});a.css("visibility","visible");E=!1}function Q(a){var e=m.find("#ivLargeImage"),c=m.find("#ivZoom");e.css("visibility",
"hidden");e.empty();n.animateStageIn(e);e.append(a);S();F?(g.show(c),U("zoomOut")):g.hide(c)}function K(e){m.find("#ivLargeImage").css("display","none");m.find("#ivLargeImage").css("display","block");var h;"hero-image"===e?c.isDefined(t)&&(h=z(t[I.index])):c.isDefined(W)&&(h=z(W[I.index]));if(c.isDefined(h)){m.find(".fullscreen").remove();var p=a("\x3cimg\x3e").attr("src",h).addClass("fullscreen"),f=m.find("#ivLargeImage");n.animateStageOut(f,function(){p.load(function(){Q(p);g.trigger("dp:image-block:imageBlockImmersiveImageLoad",
I.index)});if(p[0].complete)Q(p),g.trigger("dp:image-block:imageBlockImmersiveImageLoad",I.index);else{f.empty();var e=(f.height()-104)/2,c=(f.width()-80)/2;a("\x3cimg\x3e").attr("src",B.staticImages.spinner).css({position:"relative",top:e+"px",left:c+"px"}).appendTo(f)}})}}function O(a){m.find(".ivThumb").removeClass("selected").attr("aria-pressed","false");a.addClass("selected").attr("aria-pressed","true");a.hasClass("ivHeroImage")?I.type="hero-image":I.type="image";I.index=a.attr("id").split("_")[1];
K(I.type);u.postCountMetric("dpcc_iv_thumbCLick_"+(parseInt(I.index,10)+1)+"_"+(h+w))}function J(){m.delegate(".ivThumb","click keydown",function(e){var c=a(this);if("click"===e.type||"keydown"===e.type&&(13===e.keyCode||13===e.key||32===e.keyCode||32===e.key))e.preventDefault(),O(c)})}function Z(){if(F){var a=m.find("#ivLargeImage"),c=a.find(".fullscreen");p?a.css("cursor","url('"+B.staticImages.zoomOut+"'), auto"):(a.css("cursor","-webkit-zoom-out"),a.css("cursor","-moz-zoom-out"),a.css("cursor",
"zoom-out"));E=!0;var h=m.find("#ivLargeImage");v=h.width()-c.width();x=h.height()-c.height();h=a.height()/2;var f=a.width()/2;ea=[a.offset().left+f,a.offset().top+h];A=h-c.height()/2;ca=f-c.width()/2;c.css({position:"relative",left:ca,top:A});P=Math.max(c.height()/a.height(),c.width()/a.width())}}function N(a,c){return 0<c?c/2:Math.min(0,Math.max(c,a))}function Y(a){var c=A-(a.pageY-ea[1])*P;a=N(ca-(a.pageX-ea[0])*P,v);c=N(c,x);m.find(".fullscreen").css({left:a,top:c})}function U(a){var c=m.find("#ivZoomIn"),
e=m.find("#ivZoomOut");if("zoomIn"===a)a=c,c=e;else if("zoomOut"===a)a=e;else return;a.addClass("disabled").attr({"aria-disabled":"true",tabindex:"-1"});c.removeClass("disabled").attr({"aria-disabled":"false",tabindex:"0"})}function D(){g.declarative("iv-zoomOut",["click","keydown"],function(a){a=a.$event;var c=m.find("#ivZoomIn");!F||"click"!==a.type&&("keydown"!==a.type||13!==a.keyCode&&32!==a.keyCode)||(S(),c.focus(),U("zoomOut"))});g.declarative("iv-zoomIn",["click","keydown"],function(a){a=a.$event;
if(F&&("click"===a.type||"keydown"===a.type&&(13===a.keyCode||32===a.keyCode))){a=m.find(".fullscreen");var c=m.find("#ivLargeImage");a.removeAttr("style");Z();c.attr("tabindex","-1");c.focus();U("zoomIn")}});g.declarative("iv-largeImage",["keydown"],function(a){if(E)a:{var c=m.find("#ivLargeImage"),e=m.find(".fullscreen"),f=parseInt(e.css("left"))||0,h=parseInt(e.css("top"))||0,t=m.find("#ivZoomOut"),g=a.$event,k=f;a=h;g.preventDefault();switch(g.keyCode){case 38:a=Math.min(h+30,0);break;case 40:a=
Math.max(h-30,c.height()-e.height());break;case 37:k=Math.min(f+30,0);break;case 39:k=Math.max(f-30,c.width()-e.width());break;default:c.removeAttr("tabindex");t.focus();break a}c=N(k,v);f=N(a,x);e.css({left:c,top:f})}})}function y(){m.delegate("#ivLargeImage","click",function(a){E?(S(),U("zoomOut")):F&&(m.find(".fullscreen").removeAttr("style"),Z(),Y(a),u.postCountMetric("dpcc_iv_largeImageCLick"),U("zoomIn"))});m.delegate("#ivLargeImage","mousemove",function(a){E&&Y(a)});D()}function r(){m.find("#ivLargeImage").empty()}
function T(e){if(q){m=a("#ivMain");C();I=H.getCurrentItem();ha();n.populateVariationSelection(m.find("#ivVariationSelection"));e=m.find("#ivThumbs");e.find(".ivRow").not(".placeholder").remove();var g=h+w,p=!1;B&&B.dimensionIngressAtfData&&B.dimensionIngressAtfData.initial&&(p=B.dimensionIngressAtfData.initial.immersiveViewDimensionSuppressionEnabled);for(var f=0,r=0;f<g;)for(var y=e.find(".ivRow.placeholder").clone().removeClass("placeholder").appendTo(e),u=0;4>u&&f<g;u++,f++,r++)if(r<h){var k=t[f].thumb,
M=e.find(".ivThumb.placeholder").clone().removeClass("placeholder").addClass("ivHeroImage").attr({id:"ivHeroImage_"+f,"data-csa-c-type":"item","data-csa-c-component":"imageBlock","data-csa-c-content-id":"image-block-immersive-view-hero-image","data-csa-c-posy":f+1}).appendTo(y);M.find(".ivThumbImage").css("background",'url("'+n.getResizedThumbnailURL(k)+'") center no-repeat')}else if(r>=h&&r<w+h){k=B.colorToAsin[H.getCurrentItem().color].asin;k||(k=B.mediaAsin);if((M=c.isDimensionIngressEnabled(k))&&
p){if((k=c.getDimensionVariantList(k))&&k.includes(W[f-h].variant)){u--;continue}}else if(M&&"DIMN"===W[f-h].variant){u--;continue}k=W[f-h].thumb;M=B.staticStrings.ivImageThumbnailLabelAnnounce.replace("###ivImageThumbnailIndex",f-h+1);M=e.find(".ivThumb.placeholder").clone().removeClass("placeholder").attr({id:"ivImage_"+(f-h),"aria-label":M,"data-csa-c-type":"item","data-csa-c-component":"imageBlock","data-csa-c-content-id":"image-block-immersive-view-alt-image","data-csa-c-posy":f-h+1}).appendTo(y);
M.find(".ivThumbImage").css("background",'url("'+n.getResizedThumbnailURL(k)+'") center no-repeat')}aa();q=!1}else ha();e=a("#ivImagesTab").height();m.css("height",e);g=m.find("#ivTitle").outerHeight(!0);p=m.find("#ivVariationSelection").outerHeight(!0);f=m.find("#ivThumbs");r=n.getDimension(f,"margin-top")+n.getDimension(f,"margin-bottom");f.css("height",e-g-p-r);m.find("#ivLargeImage").css("height",e);e=m.find("#ivStage");g=m[0]&&m[0].getBoundingClientRect&&Math.floor(m[0].getBoundingClientRect().width)||
m.width();e.css("width",g-n.getDimension(m,"padding-left")-n.getDimension(m,"padding-right")-m.find("#ivThumbColumn").width()-n.getDimension(e,"margin-left")-n.getDimension(e,"margin-right"));I=H.getCurrentItem();e="hero-image"===I.type?m.find("#ivHeroImage_"+I.index):"image"===I.type?m.find("#ivImage_"+I.index):c.isDefined(t)?m.find("#ivHeroImage_"+I.index):m.find("#ivImage_"+I.index);c.isjQueryObjDefined(e)||(e=m.find("#ivImage_0"));O(e)}var G,B,H,m,t,W,h,w,I,p=navigator.userAgent.match(/msie|trident/i),
q=!0,E=!1,F=!1;var ca=A=x=v=void 0;var P,ea;q=!0;var aa=g.once(function(){J();y();n.attachImmersiveViewResizeHandler(T);n.attachTabDeselectHandler("ivImagesTab",r)});return function(c,g,t,f){G=this;B=c;H=g;G.render=function(c,f,e,k,g,t){q=!0;C();0===h+w?n.hideTabHeading("ivImagesTabHeading"):n.unhideTabHeading("ivImagesTabHeading");1===h+w?a("#ivThumbs").hide():a("#ivThumbs").show()};G.update=function(a){};n.attachTabSelectHandler("ivImagesTab",T)}});"use strict";J.when("A","jQuery","imageBlockUtils",
"postMetric","logFailedInteractionMetric","postEarlyMetric","imageBlockImmersiveViewUtils").register("ImageBlockTabbedImmersiveView",function(g,a,c,u,n,A,v){function x(){var c=K.getImmersiveViewModalInstance().$container.find(".a-popover-wrapper"),n=c.find(".a-popover-inner");c=c.height()-v.getDimension(n,"padding-top")-v.getDimension(n,"padding-bottom");a("#iv-tab-view-container").css("height",c);Z=a("#iv-tab-view-container ul.iv-tab-views li").filter(function(){return"none"!==a(this).css("display")}).length;
1<Z?(a("#iv-tab-view-container ul.iv-tab-views li").parent().show(),n=a("#iv-tab-view-container ul.iv-tab-views li").parent().height(),c-=n):a("#iv-tab-view-container ul.iv-tab-views li").parent().hide();a("#iv-tab-view-container .iv-tab-content").css("height",c);g.trigger("dp:image-block:immersive-view:resize")}function ha(){g.trigger("dp:image-block:immersive-view:reset")}function pa(a){a.find("a").focus()}function z(y){if(c.isImmersiveViewEnabled(Q,K.getCurrentItem().color))if(Y){var r=y.$event.originalEvent;
r.acknowledge&&r.acknowledge(y.$currentTarget[0]);n.isEnabled&&A.logImmersiveViewRequestServed(n);u.postCountMetric("dppc_immersiveViewOpened");c.isDefined(y)&&("button-360-click"===y.action?a("#iv360TabHeading").click():"videoIngressClick"===y.action?(N=y.clickTimeStamp,a("#ivVideosTabHeading").click()):"showroomIngressClick"===y.action?(N=y.clickTimeStamp,a("#ivShowroomTabHeading").click()):"dimensionIngressClick"===y.action?(N=y.clickTimeStamp,a("#ivDimensionTabHeading").click()):a("#ivImagesTabHeading").click());
r=K.getImmersiveViewModalInstance();if(c.isDefined(r))r.show();else{y=a("#auiImmersiveViewDiv");r=Math.min(Math.max(a(C).height()-150,540),1080);var v=Math.min(Math.max(a(C).width()-75,990),1980);r=Y.create(y,{name:"immersiveView",activate:"onclick",width:v,height:r,popoverLabel:"ImmersiveView",hideHeader:!0});K.setImmersiveViewModalInstance(r);y.click()}na&&(na=!1,U(),g.trigger("dp:image-block:immersive-view:init"))}else C.performance&&performance.now&&C.ue&&ue.count&&ue.count("DPIBClickFailedInteractionCount",
(ue.count("DPIBClickFailedInteractionCount")||0)+1);else u.postCountMetric("immersiveViewNotExistsClickCount")}var S,Q,K,O,na=!0,Z=0,N,Y;J.when("a-modal").execute(function(a){Y=a});var U=g.once(function(){g.on("a:popover:afterUpdatePosition:immersiveView",x);g.on("a:popover:afterShow:immersiveView",x);g.on("a:popover:afterHide:immersiveView",ha)}),D=g.once(function(){var c=a("#iv-tab-view-container ul.iv-tab-views li");c.bind("click",function(n){var r=c.filter(".iv-active");r.attr("id")!==a(this).attr("id")&&
g.trigger("dp:ivTabs:"+r.find("a").attr("data-iv-tab-view")+":deselect",n);c.removeClass("iv-active").attr("aria-selected","false").find("a").attr("tabindex","-1");a(this).addClass("iv-active").attr("aria-selected","true").find("a").attr("tabindex","0");a("#iv-tab-view-container .iv-tab-content").hide();r=a(this).find("a").attr("data-iv-tab-view");a("#"+r).show();"ivVideosTab"===r&&(n.clickTimeStamp=N||n.timeStamp);g.trigger("dp:ivTabs:"+r+":select",n);u.postCountMetric("dppc_"+r);return!1});c.bind("keydown",
function(g){var n=a(this),r=c.filter(":visible"),u=r.index(n),v=r.length-1;switch(g.keyCode){case 37:g.preventDefault();0<u?pa(r.eq(u-1)):pa(r.eq(v));break;case 39:g.preventDefault();u<v?pa(r.eq(u+1)):pa(r.eq(0));break;case 13:case 32:g.preventDefault(),n.find("a")[0].click()}})});return function(a,r,v,x){S=this;Q=a;K=r;n.refToModel=K;O=x;S.render=function(a,c,g,t,n,h){u.postCountMetric("dpcc_altThumbs_"+c);na=!0};S.update=function(a){};S.getTitle=function(){};S.getVariationSelectionInfo=function(){};
D();c.isImmersiveViewEnabled(Q,K.getCurrentItem().color)||c.addTag("immersiveViewNotAvailable");O.register("imageClick",z);O.register("button360Click",z);(Q.collapsibleThumbnails||Q.desktopCollapsibleThumbnails||"T1"===Q.desktopCollapsibleThumbnailsExperience||"T2"===Q.desktopCollapsibleThumbnailsExperience)&&g.declarative("thumb-action",["click"],function(a){a.$declarativeParent.hasClass("overlayRestOfImages")&&(z(a),(Q.collapsibleThumbnails||Q.desktopCollapsibleThumbnails)&&u.postCountMetric("collapsibleThumbnailImmersiveViewClick"),
"T1"===Q.desktopCollapsibleThumbnailsExperience?u.postCountMetric("desktopCollapsibleThumbnailImmersiveViewClickT1"):"T2"===Q.desktopCollapsibleThumbnailsExperience&&u.postCountMetric("desktopCollapsibleThumbnailImmersiveViewClickT2"))});c.useTabbedImmersiveView(Q)&&(O.register("videoIngressClick",z),O.register("showroomIngressClick",z),O.register("dimensionIngressClick",z),O.register("captionClick",z))}});"use strict";J.when("A","jQuery","imageBlockUtils","ImageBlockLoader","postMetric","logFailedInteractionMetric",
"postEarlyMetric","imageBlockImmersiveViewUtils").register("ImageBlockImmersiveView",function(g,a,c,u,n,A,v,x){function ha(a){return a.hiRes||a.large||a.main[a.main.length-1]}function pa(){k.find("#ivTitle").click(function(){X.hide()})}function z(){l=fb?{type:"360-spin"}:L.getCurrentItem()}function S(){var a=k.find("#ivStage"),b=X.$container.find(".a-popover-wrapper"),c=b.find(".a-popover-inner");b=b.height()-x.getDimension(c,"padding-top")-x.getDimension(c,"padding-bottom");k.css("height",b);c=k.find("#ivTitle").outerHeight(!0);
var d=k.find("#ivVariationSelection").outerHeight(!0),f=k.find("#ivMediaSelection").outerHeight(!0),e=k.find("#ivThumbs"),l=x.getDimension(e,"margin-top")+x.getDimension(e,"margin-bottom");e.css("height",b-c-d-f-l);k.find("#ivLargeImage").css("height",b);a.css("width",k.width()-x.getDimension(k,"padding-left")-x.getDimension(k,"padding-right")-k.find("#ivThumbColumn").width()-x.getDimension(a,"margin-left")-x.getDimension(a,"margin-right"))}function Q(){k.find("#ivMediaSelect").change(function(){var b=
a(this).val();"all"===b?(k.find("#ivVideoList").hide(),k.find("#ivThumbs").show(),k.find(".ivThumbVideo").show(),"chromeful-video"===l.type&&k.find("#ivVideo_"+l.index).click()):"images"===b?(k.find("#ivVideoList").hide(),k.find("#ivThumbs").show(),k.find(".ivThumbVideo").hide(),"chromeful-video"===l.type&&(0===V&&0===da?k.find("#iv360").click():0===V?k.find("#ivHeroImage_0").click():k.find("#ivImage_0").click())):"videos"===b&&(k.find("#ivVideoList").show(),k.find("#ivThumbs").hide(),"chromeful-video"!==
l.type?k.find("#ivVideoList_0").click():k.find("#ivVideoList_"+l.index).click())})}function K(){var a=k.find("#ivStage").find("#ivLargeImage"),b=a.width(),c=a.height(),d=a.find(".fullscreen");d.removeAttr("style");var e=d.width(),l=d.height();0<d.length&&(d[0].naturalWidth&&(e=d[0].naturalWidth),d[0].naturalHeight&&(l=d[0].naturalHeight));a.css("cursor","auto");e=0===e?1:e;l=0===l?1:l;var h=Math.min(b/e,c/l),g=l*h,t=e*h;1>h?(gb?a.css("cursor","url('"+f.staticImages.zoomIn+"'), auto"):(a.css("cursor",
"-webkit-zoom-in"),a.css("cursor","-moz-zoom-in"),a.css("cursor","zoom-in")),Na=!0):Na=!1;e=Math.min(t,e);l=Math.min(g-20,l);d.css({"margin-top":(c-l)/2,"margin-left":(b-e)/2,height:l,width:e});a.css("visibility","visible");Ma=!1}function O(a){var b=k.find("#ivLargeImage");b.css("visibility","hidden");b.empty();x.animateStageIn(b);b.append(a);K()}function na(){db&&db.pause();k.find("#ivLarge360").css("display","none");k.find("#ivLargeVideo").css("display","none");k.find("#ivLargeImage").css("display",
"none");y()}function Z(b){na();k.find("#ivLargeImage").css("display","block");var d;"hero-image"===b?c.isDefined(M)&&(d=ha(M[l.index])):c.isDefined(fa)&&(d=ha(fa[l.index]));if(c.isDefined(d)){k.find(".fullscreen").remove();var va=a("\x3cimg\x3e").attr("src",d).addClass("fullscreen"),e=k.find("#ivLargeImage");x.animateStageOut(e,function(){va.load(function(){O(va)});if(va[0].complete)O(va);else{e.empty();var b=(e.height()-104)/2,c=(e.width()-80)/2;a("\x3cimg\x3e").attr("src",f.staticImages.spinner).css({position:"relative",
top:b+"px",left:c+"px"}).appendTo(e)}})}}function N(){var a;c.isDefined(ia)&&(a=ia[l.index]);c.isDefined(a)&&na()}function Y(){z();var a="hero-image"===l.type?k.find("#ivHeroImage_"+l.index):"image"===l.type?k.find("#ivImage_"+l.index):"chromeful-video"===l.type||"chromeless-video"===l.type?k.find("#ivVideo_"+l.index):"360-spin"===l.type?k.find("#iv360"):c.isDefined(M)?k.find("#ivHeroImage_"+l.index):k.find("#ivImage_"+l.index);c.isjQueryObjDefined(a)||(a=k.find("#ivImage_0"));U(a)}function U(a){k.find(".ivThumb").removeClass("selected");
a.addClass("selected");a.hasClass("ivThumbVideo")?(l.type="chromeful-video",l.index=a.attr("id").split("_")[1],N()):a.hasClass("ivHeroImage")?(l.type="hero-image",l.index=a.attr("id").split("_")[1],Z(l.type)):a.hasClass("iv360Image")?(l.type="360-spin",l.index=0,D()):(l.type="image",l.index=a.attr("id").split("_")[1],Z(l.type))}function D(){na();k.find("#ivLarge360").css("display","block");H();var a=k.find("#ivLarge360");a.css({opacity:0});setTimeout(function(){a.css({opacity:.4});x.animateStageIn(a)},
200);T();n.postCountMetric("dppc_click360");za=Date.now()}function y(){0<za&&(r("dppc_duration360",Date.now()-za),za=0)}function r(a,b){C.ue&&C.ue.count(a,b)}function T(){if(0<ta){var a=k.find(".iv360Hint");a.removeClass("iv360HintFaded");a.animate({opacity:1},200)}}function G(b,c){if(ta<b.length){var d=a("\x3cimg /\x3e").css({display:"block",width:6*ra+"px",height:wa+"px"});d.hide();c.append(d);d.get(0).onload=function(){c.closest(document.documentElement).length&&(ta++,1===ta&&(T(),0<za&&r("dppc_loadTime360",
Date.now()-za)),0<$a&&r("dppc_perSpriteloadTime360",Date.now()-$a),k.find("#iv360Spinner").hide(),d.show(),Ja=5*ba.imageLocations[Math.floor(Ia/ba.imageLocations[0].length)][Ia%ba.imageLocations[0].length],G(b,c))};d.attr("src",b[ta].replace(/(\._SP)\d+(,)\d+/,"$1"+ya+"$2"+xa));$a=Date.now()}}function B(a){if(c.isDefined(ba.spriteWidthSizes)&&0<ba.spriteWidthSizes.length){var b=ba.spriteWidthSizes,d=b.length,e=b[0],f=b[d-1];if(a<=e)return e;if(a>f)return f;for(e=0;e<d;e++)if(a>b[e]&&a<=b[e+1])return b[e+
1]}else return a}function H(){var b=k.find("#ivLarge360");b.children("#image-360-sprites").length||(b.append("\x3cdiv id\x3d'image-360-sprites'\x3e\x3c/div\x3e"),b.css({"margin-left":0,"margin-top":0,width:b.parent().width(),height:b.parent().height(),overflow:"hidden",position:"relative","-ms-user-select":"none","-webkit-user-select":"none","-mos-user-select":"none"}),a("\x3cimg\x3e").attr("src",f.staticImages.spinnerNoLabel).attr("id","iv360Spinner").css({position:"absolute",top:"50%",left:"50%",
transform:"translate(-50%, -50%)",display:"block"}).appendTo(b),Ya=!0,m())}function m(){if(c.isDefined(ba.spriteURLs)&&c.isDefined(k)&&Ya&&!Za){var b=k.find("#ivLarge360"),d=a("\x3cdiv\x3e").addClass("iv360Hint").css({position:"absolute",width:"100%",bottom:0,opacity:0,display:"block"});c.isDefined(ba.staticImages.hint360)&&a("\x3cimg\x3e").css({"margin-left":"auto","margin-right":"auto",display:"block"}).attr("src",ba.staticImages.hint360).appendTo(d);a("\x3cdiv\x3e").css({"text-align":"center"}).text(f.staticStrings.dragToSpin).appendTo(d);
d.appendTo(b);d=ba.imageWidth;var e=ba.imageHeight,l=b.parent().width(),g=b.parent().height(),m=0,n=0;d/e>l/g?(ya=B(l),xa=Math.round(e/d*ya),ra=Math.ceil(l),wa=Math.ceil(xa/ya*l),n=(g-wa)/2):(xa=B(g),ya=Math.round(d/e*xa),wa=Math.ceil(g),ra=Math.ceil(ya/xa*g),m=(l-ra)/2);b.css({"margin-left":m,"margin-top":n,width:ra+"px",height:wa+"px",overflow:"hidden",position:"relative"});b.children("#image-360-sprites").css("width",6*ra+"px");G(ba.spriteURLs,k.find("#image-360-sprites"),0);d=k.find("#ivLarge360");
d.bind("mousedown",w);d.bind("touchstart",t);d.bind("touchmove",W);d.bind("touchend",h);a(document).bind("mousemove",I);a(document).bind("mouseup",p);c.isDefined(f.staticImages.grab)&&b.css("cursor","url('"+f.staticImages.grab+"'), auto");Za=!0}}function t(a){La=!0;Xa=a.originalEvent.targetTouches[0].clientX}function W(a){La&&(q(a.originalEvent.targetTouches[0].clientX-Xa),Xa=a.originalEvent.targetTouches[0].clientX)}function h(a){La&&(La=!1)}function w(a){Ka=!0;Wa=a.originalEvent.clientX;c.isDefined(f.staticImages.grabbing)&&
(a=k.find("#ivLarge360"),a.css("cursor","url('"+f.staticImages.grabbing+"'), auto"),a.parents(".a-declarative").last().css("cursor","url('"+f.staticImages.grabbing+"'), auto"));return!1}function I(a){Ka&&(q(a.originalEvent.clientX-Wa),Wa=a.originalEvent.clientX)}function p(a){Ka&&(Ka=!1,c.isDefined(f.staticImages.grab)&&(a=k.find("#ivLarge360"),a.css("cursor","url('"+f.staticImages.grab+"'), auto"),a.parents(".a-declarative").last().css("cursor","auto")))}function q(a){for(a=Ja-=a/ra*180;0>a;)a+=
360;for(;360<a;)a-=360;Ja=a;a=360;for(var b=0;b<ta;b++)for(var d=0;d<ba.imageLocations[b].length;d++){var e=Math.abs(Ja-5*ba.imageLocations[b][d]);if(e<a){a=e;var f=b*ba.imageLocations[0].length+d}}f!==Ia&&(a=Math.floor(f/ba.imageLocations[0].length),a!==Math.floor(Ia/ba.imageLocations[0].length)&&(c.isDefined(ab)||(ab=document.createElement("canvas").getContext("2d")),b=k.find("#image-360-sprites").children(),ab.drawImage(b[a],0,0)),a=k.find(".iv360Hint").not(".iv360HintFaded"),c.isDefined(a)&&(a.addClass("iv360HintFaded"),
a.animate({opacity:0},750)));Ia=f;a=f%ba.imageLocations[0].length*-1*ra;f=-1*Math.floor(f/ba.imageLocations[0].length)*wa;b=k.find("#ivLarge360").children("#image-360-sprites");b.css("-webkit-transform","translate3d("+a+"px, "+f+"px, 0)");b.css("transform","translate3d("+a+"px, "+f+"px, 0)")}function E(){k.delegate(".ivThumb","click",function(){var b=a(this);U(b)});k.delegate(".ivThumbVideoListOuter","click",function(){k.find(".ivThumbVideoListOuter").removeClass("selected");var b=a(this);b.addClass("selected");
l.type="chromeful-video";l.index=b.attr("id").split("_")[1];N()})}function F(){k.find("#ivLargeImage").empty();y()}function ca(a,b){return 0<b?b/2:Math.min(0,Math.max(b,a))}function P(b){var c=ua.left-(b.pageX-Qa[0])*Pa;g.capabilities.rtl&&(c=ua.left-(a(C).width()-b.pageX-Qa[0])*Pa);b=ua.top-(b.pageY-Qa[1])*Pa;c=ca(c,Oa.left);b=ca(b,Oa.top);k.find(".fullscreen").css({left:c,top:b})}function ea(){k.delegate("#ivLargeImage","click",function(a){if(Ma)K();else if(Na){k.find(".fullscreen").removeAttr("style");
if(Na){var b=k.find("#ivLargeImage"),c=b.find(".fullscreen");gb?b.css("cursor","url('"+f.staticImages.zoomOut+"'), auto"):(b.css("cursor","-webkit-zoom-out"),b.css("cursor","-moz-zoom-out"),b.css("cursor","zoom-out"));Ma=!0;var d=k.find("#ivLargeImage");Oa.left=d.width()-c.width();Oa.top=d.height()-c.height();d=b.height()/2;var e=b.width()/2;Qa=[b.offset().left+e,b.offset().top+d];ua.top=d-c.height()/2;ua.left=e-c.width()/2;c.css({position:"relative",left:ua.left,top:ua.top});Pa=Math.max(c.height()/
b.height(),c.width()/b.width())}P(a)}});k.delegate("#ivLargeImage","mousemove",function(a){Ma&&P(a)})}function aa(e){if(c.isImmersiveViewEnabled(f,L.getCurrentItem().color))if(cb){var l=e.$event.originalEvent;l.acknowledge&&l.acknowledge(e.$currentTarget[0]);fb=c.isDefined(e)&&"button-360-click"===e.action;A.isEnabled&&v.logImmersiveViewRequestServed(A);n.postCountMetric("dppc_immersiveViewOpened");if(c.isDefined(X))X.show();else{e=a("#auiImmersiveViewDiv");l=a(C).height()-150;var h=a(C).width()-
75;X=cb.create(e,{name:"immersiveView",activate:"onclick",width:h,height:l,popoverLabel:"ImmersiveView",hideHeader:!0});e.click()}if(bb){k=a("#ivMain");e=L.getCurrentItem().color;fa=f.colorImages[e];M=f.heroImage[e];ia=f.useChildVideos?f.colorToVideo[e]:f.videos;eb=la()&&f.spin360ColorEnabled[e];ba=la()?f.spin360ColorData[e]:ja;z();b=da=d=V=0;c.isDefined(M)&&(da=M.length);c.isDefined(fa)&&(V=fa.length);c.isDefined(ia)&&(d=ia.length);eb&&(b=1);x.populateTitle(k.find("#ivTitle"),45,f);x.populateVariationSelection(k.find("#ivVariationSelection"));
e=k.find("#ivMediaSelect");0===V+b||0===d?(e.parent().hide(),k.find("#ivThumbs").addClass("noMediaSelection")):(e.empty(),a("\x3coption/\x3e").attr("value","all").prop("selected",!0).text(f.staticStrings.allMedia+" ("+(da+V+b+d)+")").appendTo(e),a("\x3coption/\x3e").attr("value","images").text(f.staticStrings.images+" ("+(da+V+b)+")").appendTo(e),a("\x3coption/\x3e").attr("value","videos").text(f.staticStrings.videos+" ("+d+")").appendTo(e),e.parent().show(),e.val("all"));e=k.find("#ivThumbs");e.find(".ivRow").not(".placeholder").remove();
l=da+V+d+b;for(var t=h=0;h<l;)for(var m=e.find(".ivRow.placeholder").clone().removeClass("placeholder").appendTo(e),p=0;3>p&&h<l;p++,h++,t++)if(t<da){var q=M[h].thumb,r=e.find(".ivThumb.placeholder").clone().removeClass("placeholder").addClass("ivHeroImage").attr("id","ivHeroImage_"+h).appendTo(m);r.find(".ivThumbImage").css("background",'url("'+x.getResizedThumbnailURL(q)+'") center no-repeat')}else if(t>=da&&t<V+da)q=fa[h-da].thumb,r=e.find(".ivThumb.placeholder").clone().removeClass("placeholder").attr("id",
"ivImage_"+(h-da)).appendTo(m),r.find(".ivThumbImage").css("background",'url("'+x.getResizedThumbnailURL(q)+'") center no-repeat');else if(t>=da+V&&t<V+da+b)r=e.find(".ivThumb.placeholder").clone().removeClass("placeholder").addClass("iv360Image").attr("id","iv360").appendTo(m),r.find(".ivThumbImage").css("background",'url("'+(c.isDefined(f.staticImages.icon360)?x.getResizedThumbnailURL(f.staticImages.icon360,!0):"")+'") center no-repeat');else if(q=ia[h-V-da-b],r=e.find(".ivThumb.placeholder").clone().removeClass("placeholder").addClass("ivThumbVideo").attr("id",
"ivVideo_"+(h-V-da-b)).appendTo(m),r.find(".ivThumbImage").css("background",'url("'+q.thumbUrl+'") center no-repeat'),c.isDefined(q)){var w={position:"triggerTop"},u=k.find("#ivThumbs").find(".ivThumbVideoPopover.placeholder").clone().removeClass("placeholder");u.find(".ivVideoPopoverTitle").text(q.title);u.find(".ivVideoPopoverDuration").text(q.durationTimestamp);w.inlineContent=u[0];g.declarative.create(r,"a-tooltip",w)}e=k.find("#ivVideoList");e.find(".ivThumbVideoListOuter").not(".placeholder").remove();
l=e.find(".placeholder");for(h=0;h<d;h++)t=ia[h],m=l.clone().removeClass("placeholder").appendTo(e),m.attr("id","ivVideoList_"+h),m.find(".ivThumbImage").css("background",'url("'+t.thumbUrl+'") center no-repeat'),m.find(".ivThumbTitle").text(t.title),m.find(".ivThumbDuration").text(t.durationTimestamp);k.find("#ivLarge360").empty();ta=0;bb=Za=Ya=!1;Gb()}}else C.performance&&performance.now&&C.ue&&ue.count&&ue.count("DPIBClickFailedInteractionCount",(ue.count("DPIBClickFailedInteractionCount")||0)+
1);else n.postCountMetric("immersiveViewNotExistsClickCount")}function e(a){var b=f.colorToAsin[a],d={},e=500;if(b&&b.asin){d.params={asin:b.asin};var l="360"+b.asin,h=Date.now();d.success=function(b){r("dppc_asyncRequestTime360",Date.now()-h);b&&c.isDefined(b.spin360.spin360Model)?(c.ajaxState(l,"success"),f.spin360ColorData[a]=b.spin360.spin360Model,a===L.getCurrentItem().color&&(ba=f.spin360ColorData[a],m())):d.error()};d.error=function(){n.postCountMetric("dppc_asyncFailed360");r("dppc_asyncRequestTime360",
Date.now()-h);e*=2;16E3>=e?setTimeout(function(){h=Date.now();u.load("/gp/product/features/apparel-main-image/360.html",d)},e):c.ajaxState(l,"fail")};c.ajaxState(l)&&"fail"!==c.ajaxState(l)||(u.load("/gp/product/features/apparel-main-image/360.html",d),c.ajaxState(l,"sent"))}}function la(){return c.isDefined(f.spin360ConfigEnabled)&&f.spin360ConfigEnabled}var ka,f,L,R,X,k,M,fa,ia,da,V,d,b,l,db,ba,eb,ra,wa,xa,ya,Wa,Xa,fb=!1,Ya=!1,Za=!1,Ja=0,Ia=0,za=0,$a=0,Ka=!1,La=!1,ta=0,ab,gb=navigator.userAgent.match(/msie|trident/i),
bb=!0,Ma=!1,Na=!1,Oa={},ua={},Pa,Qa,cb;J.when("a-modal").execute(function(a){cb=a});var Gb=g.once(function(){Q();E();ea();g.on("a:popover:afterUpdatePosition:immersiveView",S);g.on("a:popover:afterShow:immersiveView",Y);g.on("a:popover:afterHide:immersiveView",F);pa()});return function(b,d,l,h){ka=this;f=b;L=d;A.refToModel=L;R=h;la()&&(f.spin360ColorData[f.landingAsinColor]=f.spin360ColorData[f.defaultColor],f.spin360ColorEnabled[f.landingAsinColor]=f.spin360ColorEnabled[f.defaultColor]);c.isDefined(f.staticImages.icon360)&&
a("#imageBlock #altImages ul").find(".360IngressTemplate").find("img").attr("src",x.addStyleCodeToURL(f.staticImages.icon360,"_FMpng_RI_"));ka.render=function(a,b,d,l,h,k){bb=!0;la()&&f.spin360ColorEnabled[a]&&!c.isDefined(f.spin360ColorData[a])&&(f.spin360ColorData[a]={},e(a));c.isImmersiveViewEnabled(f,L.getCurrentItem().color)&&la()&&f.spin360ColorEnabled[a]&&(b===f.maxAlts&&(a=l.find(".item.imageThumbnail"),d=l.find(".item.videoThumbnail"),c.isDefined(d)&&1<d.length?d.last().remove():a.last().remove(),
b--),a=l.find(".360IngressTemplate").clone().removeClass("360IngressTemplate").removeClass("aok-hidden").addClass("item"),g.declarative.create(a,"button-360-click"),l.append(a),b++,n.postCountMetric("dppc_display360"));return b};ka.update=function(a){};c.isImmersiveViewEnabled(f,L.getCurrentItem().color)||c.addTag("immersiveViewNotAvailable");R.register("imageClick",aa);R.register("button360Click",aa);R.register("captionClick",aa)}});"use strict";J.when("A","jQuery","imageBlockUtils","ImageBlockLoader",
"nexusLogger360","postMetric","imageBlockImmersiveViewUtils","hit-spin360-feature-data","hit-spin360-constants").register("ImageBlockImmersiveView360",function(g,a,c,u,n,A,v,x,C){function ha(){var b=a("#iv360Tab").height();p.css("height",b);var d=p.find("#ivTitle360").outerHeight(!0),c=p.find("#ivVariationSelection360").outerHeight(!0),e=p.find("#ivThumbs360"),f=v.getDimension(e,"margin-top")+v.getDimension(e,"margin-bottom");e.css("height",b-d-c-f);b=p.find("#ivStage360");d=p[0]&&p[0].getBoundingClientRect&&
Math.floor(p[0].getBoundingClientRect().width)||p.width();b.css("width",d-v.getDimension(p,"padding-left")-v.getDimension(p,"padding-right")-p.find("#ivThumbColumn360").width()-v.getDimension(b,"margin-left")-v.getDimension(b,"margin-right"))}function z(){O();var a=p.find("#ivLarge360");a.css({opacity:0});setTimeout(function(){a.css({opacity:.4});v.animateStageIn(a)},200);S()}function S(){if(0<M){var a=p.find(".iv360Hint");a.removeClass("iv360HintFaded");a.animate({opacity:1},200)}}function Q(b,d){if(M<
b.length){var c=a("\x3cimg /\x3e").css({display:"block",width:6*E+"px",height:F+"px"});c.hide();d.append(c);c.get(0).onload=function(){d.closest(document.documentElement).length&&(M++,1===M&&(S(),0<L&&(n.time("dppc_loadTime360",Date.now()-L,h.mediaAsin),A.postTimeMetric("dppc_loadTime360",Date.now()-L))),0<R&&(n.time("dppc_perSpriteloadTime360",Date.now()-R,h.mediaAsin),A.postTimeMetric("dppc_perSpriteloadTime360",Date.now()-R)),p.find("#iv360Spinner").hide(),c.show(),ka=5*q.imageLocations[Math.floor(f/
q.imageLocations[0].length)][f%q.imageLocations[0].length],Q(b,d))};c.attr("src",b[M].replace(/(\._SP)\d+(,)\d+/,"$1"+P+"$2"+ca));R=Date.now()}}function K(a){if(c.isDefined(q.spriteWidthSizes)&&0<q.spriteWidthSizes.length){var b=q.spriteWidthSizes,d=b.length,e=b[0],f=b[d-1];if(a<=e)return e;if(a>f)return f;for(e=0;e<d;e++)if(a>b[e]&&a<=b[e+1])return b[e+1]}else return a}function O(){var b=p.find("#ivLarge360");b.children("#image-360-sprites").length||(b.append("\x3cdiv id\x3d'image-360-sprites'\x3e\x3c/div\x3e"),
b.css({"margin-left":0,"margin-top":0,width:b.parent().width(),height:b.parent().height(),overflow:"hidden",position:"relative","-ms-user-select":"none","-webkit-user-select":"none","-mos-user-select":"none"}),a("\x3cimg\x3e").attr("src",h.staticImages.spinnerNoLabel).attr("id","iv360Spinner").css({position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",display:"block"}).appendTo(b),e=!0,J())}function J(){if(c.isDefined(q.spriteURLs)&&c.isDefined(p)&&e&&!la){var b=p.find("#ivLarge360"),
d=a("\x3cdiv\x3e").addClass("iv360Hint").css({position:"absolute",width:"100%",bottom:0,opacity:0,display:"block"});c.isDefined(q.staticImages.hint360)&&a("\x3cimg\x3e").css({"margin-left":"auto","margin-right":"auto",display:"block"}).attr("src",q.staticImages.hint360).appendTo(d);a("\x3cdiv\x3e").css({"text-align":"center"}).text(h.staticStrings.dragToSpin).appendTo(d);d.appendTo(b);d=q.imageWidth;var f=q.imageHeight,g=b.parent().width(),k=b.parent().height(),t=0,m=0;d/f>g/k?(P=K(g),ca=Math.round(f/
d*P),E=Math.ceil(g),F=Math.ceil(ca/P*g),m=(k-F)/2):(ca=K(k),P=Math.round(d/f*ca),F=Math.ceil(k),E=Math.ceil(P/ca*k),t=(g-E)/2);b.css({"margin-left":t,"margin-top":m,width:E+"px",height:F+"px",overflow:"hidden",position:"relative"});b.children("#image-360-sprites").css("width",6*E+"px");Q(q.spriteURLs,p.find("#image-360-sprites"),0);d=p.find("#ivLarge360");d.bind("mousedown",U);d.bind("touchstart",Z);d.bind("touchmove",N);d.bind("touchend",Y);a(document).bind("mousemove",D);a(document).bind("mouseup",
y);c.isDefined(h.staticImages.grab)&&b.css("cursor","url('"+h.staticImages.grab+"'), auto");la=!0}}function Z(a){k=!0;aa=a.originalEvent.targetTouches[0].clientX}function N(a){k&&(r(a.originalEvent.targetTouches[0].clientX-aa),aa=a.originalEvent.targetTouches[0].clientX)}function Y(a){k&&(k=!1)}function U(a){X=!0;ea=a.originalEvent.clientX;c.isDefined(h.staticImages.grabbing)&&(a=p.find("#ivLarge360"),a.css("cursor","url('"+h.staticImages.grabbing+"'), auto"),a.parents(".a-declarative").last().css("cursor",
"url('"+h.staticImages.grabbing+"'), auto"));return!1}function D(a){X&&(r(a.originalEvent.clientX-ea),ea=a.originalEvent.clientX)}function y(a){X&&(X=!1,c.isDefined(h.staticImages.grab)&&(a=p.find("#ivLarge360"),a.css("cursor","url('"+h.staticImages.grab+"'), auto"),a.parents(".a-declarative").last().css("cursor","auto")))}function r(a){ka-=a/E*180;ia&&(n.count("dppc_360dragToSpin",h.mediaAsin),A.postCountMetric("dppc_360dragToSpin"));ia=!1;for(a=ka;0>a;)a+=360;for(;360<a;)a-=360;ka=a;a=360;for(var b=
0;b<M;b++)for(var d=0;d<q.imageLocations[b].length;d++){var e=Math.abs(ka-5*q.imageLocations[b][d]);if(e<a){a=e;var g=b*q.imageLocations[0].length+d}}g!==f&&(a=Math.floor(g/q.imageLocations[0].length),a!==Math.floor(f/q.imageLocations[0].length)&&(c.isDefined(fa)||(fa=document.createElement("canvas").getContext("2d")),b=p.find("#image-360-sprites").children(),fa.drawImage(b[a],0,0)),a=p.find(".iv360Hint").not(".iv360HintFaded"),c.isDefined(a)&&(a.addClass("iv360HintFaded"),a.animate({opacity:0},750)));
f=g;a=g%q.imageLocations[0].length*-1*E;g=-1*Math.floor(g/q.imageLocations[0].length)*F;b=p.find("#ivLarge360").children("#image-360-sprites");b.css("-webkit-transform","translate3d("+a+"px, "+g+"px, 0)");b.css("transform","translate3d("+a+"px, "+g+"px, 0)")}function T(){if(V){p=a("#ivMain360");var b=w.getCurrentItem().color;B()&&H(b);q=B()?h.spin360ColorData[b]:ja;v.populateTitle(p.find("#ivTitle360"),160,h);v.populateVariationSelection(p.find("#ivVariationSelection360"));p.find("#ivLarge360").empty();
M=0;la=e=!1;f=ka=0;d();V=!1}0!==a("#iv360Tab").height()&&(v.detachImmersiveViewResizeHandler(T),ha(),z(),L=Date.now(),da=ia=!0,n.count("dppc_click360",h.mediaAsin),A.postCountMetric("dppc_click360"))}function G(a,d,e){a=h.colorToAsin[e];var b={},f=500;if(!a||!a.asin)if(e===h.defaultColor)a={asin:h.winningAsin};else return;b.params={asin:a.asin};var g="360"+a.asin,k=Date.now();b.success=function(a){n.time("dppc_asyncRequestTime360",Date.now()-k,h.mediaAsin);A.postTimeMetric("dppc_asyncRequestTime360",
Date.now()-k);a&&c.isDefined(a.spin360)?((a=a.spin360.spin360Model)&&x.setData(a),c.ajaxState(g,"success")):b.error()};b.error=function(){n.count("dppc_asyncFailedTransient360",h.mediaAsin);A.postCountMetric("dppc_asyncFailedTransient360");n.time("dppc_asyncRequestTime360",Date.now()-k,h.mediaAsin);A.postTimeMetric("dppc_asyncRequestTime360",Date.now()-k);f*=2;16E3>=f?setTimeout(function(){k=Date.now();u.load("/gp/product/features/apparel-main-image/360.html",b)},f):(n.count("dppc_asyncFailed360",
h.mediaAsin),A.postCountMetric("dppc_asyncFailed360"),c.ajaxState(g,"fail"))};c.ajaxState(g)&&"fail"!==c.ajaxState(g)||(u.load("/gp/product/features/apparel-main-image/360.html",b),c.ajaxState(g,"sent"))}function B(){return h&&c.isDefined(h.spin360ConfigEnabled)&&h.spin360ConfigEnabled}function H(a){return c.isDefinedAndNotEmpty(h.spin360ColorData[a])?!0:c.isDefined(h.spin360LazyLoadEnabled)&&h.spin360LazyLoadEnabled}function m(){da&&(n.time("dppc_duration360",Date.now()-L,h.mediaAsin),A.postTimeMetric("dppc_duration360",
Date.now()-L),da=!1)}function t(a){a=h.colorToAsin[a.color]&&h.colorToAsin[a.color].asin;a||(a=h.mediaAsin);return a}var W,h,w,I,p,q,E,F,ca,P,ea,aa,e=!1,la=!1,ka=0,f=0,L=0,R=0,X=!1,k=!1,M=0,fa,ia=!0,da=!1,V=!0,d=g.once(function(){v.attachImmersiveViewResizeHandler(T);v.attachImmersiveViewResizeHandler(ha);v.attachImmersiveViewResetHandler(m);v.attachTabDeselectHandler("iv360Tab",m)});return function(b,d,e,f){W=this;h=b;w=d;I=f;b=h.landingAsinColor;d=h.defaultColor;c.isDefined(h.staticImages.icon360)&&
a("#imageBlock #altImages ul").find(".360IngressTemplate").find("img").attr("src",v.addStyleCodeToURL(h.staticImages.icon360,"_FMpng_RI_"));B()&&(h.spin360ColorData||(h.spin360ColorData={}),b===d&&c.isDefinedAndEmpty(h.spin360ColorData[d])&&delete h.spin360ColorData[d]);g.on(C.TWISTER_DATA_EVENT,function(a){t(w.getCurrentItem())===a&&(q=x.getData(a),J(),a={type:"updatedData",data:w.getCurrentItem()},I.dispatch("updateView",a))});W.render=function(b,d,e,f,k,l){V=!0;!B()||c.isDefinedAndEmpty(h.spin360ColorData[b])&&
!x.getData(t(w.getCurrentItem()))?v.hideTabHeading("iv360TabHeading"):(h.spin360ColorData[b]=x.getData(t(w.getCurrentItem())),c.isDefinedAndNotEmpty(h.spin360ColorData[b])?(a("#ivThumbs360").hide(),v.unhideTabHeading("iv360TabHeading"),c.isImmersiveViewEnabled(h,w.getCurrentItem().color)&&B()&&H(b)&&(d===h.maxAlts&&(b=f.find(".item.imageThumbnail"),e=f.find(".item.videoThumbnail"),c.isDefined(e)&&1<e.length?e.last().remove():b.last().remove(),d--),b=f.find(".360IngressTemplate").clone().removeClass("360IngressTemplate").removeClass("aok-hidden").addClass("item"),
g.declarative.create(b,"button-360-click"),f.append(b),n.count("dppc_display360",h.mediaAsin),A.postCountMetric("dppc_display360"))):c.isDefined(h.spin360LazyLoadEnabled)&&h.spin360LazyLoadEnabled?(h.spin360ColorData[b]={},v.hideTabHeading("iv360TabHeading"),G(f,d,b)):v.hideTabHeading("iv360TabHeading"))};W.update=function(a){};v.attachTabSelectHandler("iv360Tab",T)}});J.register("nexusLogger360",function(){return{count:function(g,a){C.ue&&C.ue.event({asin:a,metricName:g,metricValue:1},"hit-360",
"hit360.clientEvent.3")},time:function(g,a,c){C.ue&&C.ue.event({asin:c,metricName:g,metricValue:a},"hit-360","hit360.clientEvent.3")}}});J.register("hit-spin360-constants",function(){return{TWISTER_DATA_EVENT:"spin360TwisterData"}});J.when("A","hit-spin360-constants").register("hit-spin360-feature-data",function(g,a){var c={};return{setData:function(u){var n=u.asin;c[n]||(c[n]=u,g.trigger(a.TWISTER_DATA_EVENT,n))},getData:function(a){return c[a]}}});"use strict";J.when("postMetric").register("ImageBlockImmersiveViewShowroom",
function(g){function a(){this.render=function(){};this.update=function(){}}return function(c,u,n,A){var v=!1,x=new a;J.now("showroom-image-block-view").execute("showroom-image-block-view-decider",function(a){a!==ja&&(v=!0,x=new a(c,u,n,A))});c&&!0===c.showroomEnabled&&!1===v&&g.postCountMetric("showroom:atf:imageBlock:hiddenDueToAssetsNotPresentInTime");return x}});"use strict";J.when("A","jQuery","imageBlockUtils","postMetric","imageBlockImmersiveViewUtils","vse_ns_preLoaderHook","vse_ns_lazyLoaderHook").register("ImageBlockImmersiveViewVideos",
function(g,a,c,u,n,A,v){function x(){G.delegate(".ivThumb","click",function(){var e=a(this);G.find(".ivThumb").removeClass("selected");e.addClass("selected");e.hasClass("ivThumbVideo")&&(B.type="chromeful-video",B.index=e.attr("id").split("_")[1])})}function J(){if(aa){var e=a("#ivVideosTab").height();G.css("height",e);var c=G.find(".vse-lb-container");H=e-n.getDimension(c,"padding-top")-n.getDimension(c,"padding-bottom");c.css({"max-height":e,overflow:"hidden"});if(F){G.css({"max-width":Math.floor(1.77*
H)});return}e=G.find(".vse-player-container");c=G.find(".vse-video-action-strip");var f=G.find(".vse-lb-video-metadata"),h=Math.floor(H-n.getDimension(f,"height")-n.getDimension(c,"height")),g=Math.floor(1.77*h);e.css({"max-height":h,"max-width":g,marginLeft:"auto",marginRight:"auto"});f.css({"max-width":g,marginLeft:"auto",marginRight:"auto"});c.css({"max-width":g,marginLeft:"auto",marginRight:"auto"})}ca&&(e=G.find(".vse-vertical-scroll"),c=n.getDimension(e,"margin-top")+n.getDimension(e,"margin-bottom"),
e.css("max-height",H-c))}function ja(){z();m&&m.pause();P=!1;q=!0;w=null;ea=!0;aa=!1}function z(){P=!1;m&&m.pause()}function S(e){w=e.clickTimeStamp?e.clickTimeStamp:g.now();c.isDefined(T)&&(T.eventTimestamp=w);P=!0;E&&(v.get(g,"#ivVideoBlock",r,X,k),G=a("#ivVideoBlock"),y.getCurrentItem(),B=y.getCurrentItem(),f(),N());J();E=!1;O()}function Q(e){E&&(G=a("#ivVideoBlock"),y.getCurrentItem(),B=y.getCurrentItem(),f());P&&O();J()}function K(a){m=a.player;u.postTimeMetric("vse_ib_desktop_player_initialisation_duration",
g.now()-ka);D.imageBlockRenderingStartTime&&u.postTimeMetric("vse_ib_desktop_time_to_player_interactive",g.now()-D.imageBlockRenderingStartTime);aa&&(N(),O())}function O(){if(m&&P&&(G.find(".vse-lb-container").animate({opacity:1},200),m.play(T),u.postCountMetric("dpcc_vse_videoBlock_video_played"),q)){var a=C.ue;a&&(a=a.count("dpcc_vse_videoingressclick"),a=(new Date).getTime()-a,u.postTimeMetric("dpcc_vse_vitff",a),q=!1)}}function na(){g.trigger("vse:detailpage-imageblock:page:lightBoxClosed")}function Z(a){t=
a.popover.$popover;aa=!0;N()}function N(){if(aa&&ea&&P&&m){t.addClass(g.$(t).find(".vse-lb-container").data("cssClass"));var a=T;e&&(a=la,e=!1);g.trigger("vse:detailpage-imageblock:page:lightBoxOpened",{lightBoxId:"ivVideoBlock",assetSpec:a});J();ea=!1}}function Y(a){document.getElementsByClassName("videoBlockIngress")[0].click();la=a;e=!0}var U,D,y,r,T,G,B,H,m,t,W,h,w,I,p,q=!0,E=!0,F=!1,ca=!1,P=!1,ea=!0,aa=!1,e=!1,la,ka=0,f=g.once(function(){x();n.attachImmersiveViewResizeHandler(Q);n.attachTabDeselectHandler("ivVideosTab",
z);n.attachImmersiveViewResetHandler(ja)}),L=function(e,c,f){a("#ivVideoBlockSpinner").addClass("aok-hidden");u.postCountMetric("dpcc_vse_videoBlock_preload_failed_"+c.placement);F=!0;a("#ivVideoBlock").css({"max-width":1.77*H,margin:"0 auto"})},R=function(e,c,f){E||v.get(e,"#ivVideoBlock",r,X,k);a("#ivVideoBlockSpinner").addClass("aok-hidden")},X=function(a,e,c){ca=!0;J()},k=function(a,e,c){u.postCountMetric("dpcc_vse_videoBlock_lazyload_failed_"+e.pageContext.placement+"_"+e.configuration.type)};
return function(a,e,f,k){U=this;D=a;y=e;U.render=function(a,d,b,e,f,k){a=y.getCurrentItem().color;d=c.getVideoHash(a,0,D);!0===k?W=D.mediaAsin:(W=D.colorToAsin[a]&&D.colorToAsin[a].asin,W=c.isDefined(W)?W:D.mediaAsin);h=!0===D.useVSEVideos?"VIDEO_ID":"physicalID";I=D.contentWeblab;p=D.contentWeblabTreatment;E=!0;-1===d?n.hideTabHeading("ivVideosTabHeading"):(n.unhideTabHeading("ivVideosTabHeading"),r={page:"DetailPage",placement:"ImageBlock",device:"Desktop",marketplaceID:d.marketPlaceID,locale:d.languageCode,
product:{contentID:W,contentIDType:"ASIN"},video:{contentID:d.mediaObjectId,contentIDType:h,videoURL:d.url,imageURL:d.slateUrl,rankingStrategy:d.rankingStrategy},requestId:D.dpRequestId,weblabContext:[{name:I,assignment:p,ignoreForG2S2Key:!0}],metadata:{ProductTitle:D.title}},T={videoUrl:r.video.videoURL,contentId:r.video.contentID,duration:0,vendorCode:"",eventTimestamp:c.isDefined(w)?w:g.now(),imageUrl:r.video.imageURL,productAsin:r.product.contentID,rankingStrategy:r.video.rankingStrategy,index:0},
c.isDefinedAndNotEmpty(m)&&(m.destroy(),m=null),ka=g.now(),A.get(g,"#ivVideoBlock",r,R,L))};U.update=function(a){};n.attachTabSelectHandler("ivVideosTab",S);g.on("vsePlayer-detailpage-imageblock",K);g.on("a:popover:afterShow:immersiveView",Z);g.on("a:popover:beforeHide:immersiveView",na);g.on("detailpage-imageblock-leave-pip",Y)}});"use strict";J.when("A","jQuery","imageBlockUtils","postMetric","imageBlockImmersiveViewUtils").register("ImageBlockShoppableSceneImmersiveView",function(g,a,c,u,n){function A(c,
g){if(c){T=D.getCurrentItem();0==Object.entries(m).length&&v();var h=T.shoppableScene;h==ja?(c=N(Object.values(m)[0]),h=Object.values(m)[0].shoppableScene):c=N(r[T.index]);H=h.physicalId;var t=a(".shoppable-scene-image-block-placeholder-in-iv");if(0<t.length){var n=a("\x3cimg\x3e");n.attr("id","shoppableSceneIvImage");n.attr("src",c);n.css({"max-height":"500px","max-width":"650px"});t.replaceWith(n);c=x(h);h=a(".shoppable-scene-image-block-tags-in-iv");h.empty();c.appendTo(h)}else y.hide(),K();pa();
c=T.shoppableScene?T.shoppableScene:Object.values(m)[0].shoppableScene;z(c);O(g,G,null,H)}}function v(){r=U.colorImages[T.color];G=U.colorToAsin[T.color].asin;r.forEach(function(a){a.shoppableScene!=ja&&(m[a.shoppableScene.physicalId]=a)})}function x(c){var t=a("\x3cspan\x3e");g.each(c.tags,function(h){var m=a("\x3cdiv\x3e").css({position:"absolute",left:100*h.left+"%",top:100*h.top+"%",height:"auto",width:"auto"});m.append(C(!1));m.append(C(!0));g.declarative.create(m,"scenes-show-details-tags-ib-iv-click",
{tagId:h.link,physicalId:c.physicalId});t.append(m)});return t.children()}function C(c){var g=a("\x3cimg src\x3d'"+(c?U.staticImages.shoppableSceneDotHighlighted:U.staticImages.shoppableSceneDot)+"' alt\x3d''\x3e");g.css({display:c?"none":"inline-block"});g.addClass("mirai-scene-tag-in-iv").addClass(c?"active-tag":"inactive-tag");return g}function pa(){var c=a(".ivBottomThumbImagesShoppableScene");c.empty();Object.keys(m).forEach(function(t){var h=m[t],n=a("\x3cimg\x3e");h=N(h);n.attr("id","shoppable-scene-thumbnail-"+
t);n.attr("src",h);n.addClass("shoppable-scene-thumbnail");g.declarative.create(n,"scenes-thumbnail-ib-iv-click",{physicalId:t});n.appendTo(c)})}function z(a){Z();J.when("mirai-shoppable-scene-immersive-view").execute("shoppable-scene-image-recommendation-col-render",function(){g.trigger("mirai:scene-immersive-recommendation-col-init",{scene:a})})}function S(a,c){Z();J.when("mirai-shoppable-scene-immersive-view").execute("shoppable-scene-image-recommendation-col-updater",function(){g.trigger("mirai:scene-immersive-recommendation-col-update",
{tagId:a,physicalId:c})})}function Q(){var c=m[H].shoppableScene,g=a(".shoppable-scene-image-block-tags-in-iv");g.hide();c=x(c);g.empty();c.appendTo(g);g.show();y.show()}function K(){var c=N(m[H]),g=a("#shoppableSceneIvImage");g.bind("load",Q);g.attr("src",c)}function O(a,c,h,m){var t="shoppable-scene-dp-iv:mirai:"+a;J.when("mirai-shoppable-scene-immersive-view").execute("shoppable-scene-image-recommendation-col-updater",function(){g.trigger("mirai:scene-immersive-publish-metric",{nexusTargetName:a,
csmCounterName:t,asin:c,tagId:h,physicalId:m})})}function na(){var c=a(".shoppable-scene-image-block-tags-in-iv").find(".mirai-scene-tag-in-iv");c.removeClass("mirai-scene-dot-pulsate").addClass("mirai-scene-dot-pulsate");g.delay(function(){c.removeClass("mirai-scene-dot-pulsate")},3600)}function Z(){var c=a("#shoppable-scene-iv-recommendation-waiting-spinner");0<c.length&&c.remove();c=a("#shoppableSceneRecommendationColumn");a(".shoppable-scene-recommendation-iv").hide();var g=a("\x3cimg\x3e");g.attr("id",
"shoppable-scene-iv-recommendation-waiting-spinner");g.attr("src",U.staticImages.spinner);g.css({position:"relative"}).appendTo(c)}function N(a){return a.hiRes||a.large||a.main[a.main.length-1]}var Y=void 0,U=void 0,D=void 0,y=void 0,r=void 0,T=void 0,G=void 0,B=void 0,H=void 0,m={};g.declarative("shoppable-scene-image-click","click",function(a){A(!0,"IMAGE_BLOCK_SHOPPABLE_SCENE")});g.declarative("scenes-show-details-tags-ib-iv-click","click",function(a){var c=a.$currentTarget;if(null!=B){var g=B.find(".active-tag"),
m=B.find(".inactive-tag");g.css({display:"none"});m.css({display:"inline-block"})}g=c.find(".active-tag");m=c.find(".inactive-tag");g.css({display:"inline-block"});g.addClass("mirai-scene-dot-pulsate");m.css({display:"none"});B=c;na();S(a.data.tagId,a.data.physicalId);O("IMMERSIVE_VIEW_PRODUCT_TAG",G,a.data.tagId,a.data.physicalId)});g.declarative("scenes-thumbnail-ib-iv-click","click",function(a){H=a.data.physicalId;K();z(m[H].shoppableScene)});return function(c,g,h,m){Y=this;U=c;D=g;y=a("#ivMainShoppableScene");
Y.render=function(a,c,g,h,m,n){};Y.update=function(a){};(c=document.getElementById("ivShoppableSceneHeading"))&&c.addEventListener("click",function(a){a=D.getCurrentItem();A(null==T||T.index!=a.index,"IMMERSIVE_VIEW_TAB")})}})});
/* ******** */
(function(c){var g=window.AmazonUIPageJS||window.P,l=g._namespace||g.attributeErrors,a=l?l("DetailPageImageBlockSubAssets@logging","DetailPageImageBlockSubAssets"):g;a.guardFatal?a.guardFatal(c)(a,window):a.execute(function(){c(a,window)})})(function(c,g,l){c.when("A","postMetric","ready").execute("feature-bullets-tailoring-metrics",function(a,b){try{var d=a.$,h=d("#featurebullets_feature_div"),m=d("#productOverview_feature_div");if(h&&0<h.length&&(b.postCountMetric("FeatureBulletsRendered.GV"),m&&
0<m.length)){b.postCountMetric("FeatureBulletsRenderedWithPO.GV");var f=d("#featurebullets_feature_div .a-expander-container");f&&0<f.length&&"feature-bullets-expander"===f.data("aExpanderName")&&(b.postCountMetric("FeatureBulletsRenderedCollapsed.GV"),a.on("a:expander:feature-bullets-expander:toggle:expand",function(e){b.postCountMetric("FeatureBulletsInteraction.Expanded")}),a.on("a:expander:feature-bullets-expander:toggle:collapse",function(e){b.postCountMetric("FeatureBulletsInteraction.Collapsed")}))}}catch(e){c.log("Feature bullets metric logging failed with error: ( "+
e+" )","ERROR","FeatureBulletsTailoringMetrics")}});"use strict";c.when("A","ImageBlockATF","ImageBlockBTF","imageBlockUtils","postMetric").execute(function(a,b,d,h,m){var f=[0,50,100,500,1E3,2E3,3E3,3500];(function(){var e=d.colorImages,a=0,b;for(b in e)e[b]&&e[b].length&&(a+=e[b].length);e="image_size_bucket:gt"+f[f.length-1];for(b=1;b<f.length;b++)if(a<=f[b]){e="image_size_bucket:"+f[b-1]+"-"+f[b];break}m.postCountMetric(e);h.addTag(e)})();(function(){var a=b.colorImages;a&&a.initial&&a.initial.length&&
(a=a.initial.length,g.ue&&ue.count&&ue.count("altImageCount",a))})();(function(){var a=d.lazyLoadExperienceDisabled;h.isDefined(d.lazyLoadExperienceDisabled)&&!a&&(m.postCountMetric("lazyLoadingExperienceOnTwisterUpdateEnabled"),h.addTag("lazyLoadingExperienceOnTwisterUpdateEnabled"))})()});"use strict";c.register("logFailedInteractionMetric",function(){return{isEnabled:!1}});c.register("postEarlyMetric",function(){return null});"use strict";c.register("postMetric",function(){return{postCountMetric:function(a){if("undefined"!==
typeof a){var b=g.ue;if(b){var d=b.count(a)||0;b.count(a,d+1)}}},postTimeMetric:function(a,b){if("undefined"!==typeof a&&"undefined"!==typeof b){var d=g.ue;d&&d.count(a,b)}},emitNexusMetric:function(a){g.ue&&ue.event&&ue.event(a,"VSEImageBlockEvents","vse.VSEImageBlockEvents.6",{ssd:!1})},buildNexusMetric:function(a,b,d,h,m,f,e,c,n,p){e="";c=c||"";try{e=g.location.href;var k=e.match(/\/dp\/([A-Z0-9]{10})|\/gp\/product\/([A-Z0-9]{10})|\/gp\/aw\/d\/([A-Z0-9]{10})/);k&&(k[1]||k[2]||k[3])&&(c=k[1]||k[2]||
k[3])}catch(q){(k=g.ue)&&k.count("PostMetricsUtil:cannotBuildNexusPayload",1)}return{eventSource:"IBCarousel",placementContext:p,clientId:"VSE",userAgentData:navigator.userAgent,titleSessionId:"0",eventName:a,intPayload:+b,videoAsin:d,videoAsinList:"",rankingStrategy:h===l?"":h,groupType:f===l?"":f,pageUrl:e,pageAsin:c,weblabIds:n===l?"":n,customerId:m||""}}}});"use strict";c.when("A","get-resource-time","postMetric","afterLoad").execute(function(a,b,d){var c=a.state("desktop-landing-image-data");
c&&(c=a.values(c),b=b.getResourceTimeByName("img",c),a.each(b,function(a){a&&(a.responseEnd!=l&&d.postCountMetric("ibDesktopLandingImageDownloadTime",g.parseInt(a.responseEnd)),a.transferSize!=l&&(0===a.transferSize?d.postCountMetric("ibDesktopLandingImageCached",1):(d.postCountMetric("ibDesktopLandingImageSizeInBytes",g.parseInt(a.transferSize)),d.postCountMetric("ibDesktopLandingImageNotCached",1))))}))});"use strict"});
/* ******** */
(function(l){var h=window.AmazonUIPageJS||window.P,p=h._namespace||h.attributeErrors,d=p?p("DetailPageImageBlockSubAssets@utils","DetailPageImageBlockSubAssets"):h;d.guardFatal?d.guardFatal(l)(d,window):d.execute(function(){l(d,window)})})(function(l,h,p){l.when("A","jQuery").execute(function(d,g){d.on("a:image:load:landingImage",function(){h.performance&&performance.now&&h.ue&&ue.count&&ue.count("DPLandingImageHighResDownloadTime",performance.now())});d.loadDynamicImage(g("#landingImage"))});"use strict";
l.when("jQuery","imageBlockUtils").register("ImageBlockHeroUtils",function(d,g){function k(a,c){if(c.repositionHeroImage){c=a[1];a=a[0];if(768>=(h.innerHeight||document.documentElement.clientHeight||document.body.clientHeight))c*=.7,a*=.7;else{var b=Math.max(Math.min(((h.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)-1024)/256,1),0);c*=.7+.3*b;a*=.7+.3*b}b=[c,a]}return b}function e(a,c,b){if(b.repositionHeroImage){var d=h.innerWidth||document.documentElement.clientWidth||
document.body.clientWidth;b=b.heroFocalPoint;if(g.isDefined(b)){var e=Math.max((d-Math.min(1500,a))/2,0);var f=Math.max((d-a)/2,0);d=Math.max(Math.min(d,1500),1024);e=e-f+(d-420-23)/2-a/c[1]*b}}return e}function f(a,c,b){a=a.heroImage;return!(g.isDefined(a)&&g.isDefined(a[c])&&g.isDefined(a[c][b])&&g.isDefined(a[c][b].main))||1>d.map(a[c][b].main,function(a,b){return b}).length?-1:a[c][b]}return{getHeroImageHash:f,getHeroDimParams:function(a,c,b){if(a.repositionHeroImage){if(!g.isDefined(b)){b=f(a,
c.color,c.index);if(-1===b)return;c=d.map(b.main,function(a,b){return b})[0];b=b.main[c]}c=k(b,a);a=e(c[0],b,a);return{height:c[1],width:c[0],xPos:a,yPos:75}}}}});"use strict";l.when("A","jQuery","imageBlockUtils").register("imageBlockImmersiveViewUtils",function(d,g,k){function e(a,c){var b=d.copy(a);if(k.isDefined(a)&&a.length>c){try{for(var e=-1,f=0;f<a.length;f++){var g=a.charAt(f);if(" "===g||"."===g||"?"===g||";"===g||","===g||":"===g)e=f;if(f===c-4){b=a.substring(0,-1===e?f:e);break}}}catch(m){b=
a.substring(0,c-3)}b+="..."}return b}function f(a,c){var b=a.lastIndexOf(".");return a="_"===a.charAt(b-1)?a.substring(0,b-1)+c+a.substring(b):a.substring(0,b)+"."+c+a.substring(b)}return{getDimension:function(a,c){a=parseInt(a.css(c),10);return isNaN(a)?0:a},attachTabSelectHandler:function(a,c){d.on("dp:ivTabs:"+a+":select",c)},attachTabDeselectHandler:function(a,c){d.on("dp:ivTabs:"+a+":deselect",c)},attachImmersiveViewResizeHandler:function(a){d.on("dp:image-block:immersive-view:resize",a)},detachImmersiveViewResizeHandler:function(a){d.off("dp:image-block:immersive-view:resize",
a)},attachImmersiveViewResetHandler:function(a){d.on("a:popover:afterHide:immersiveView",a)},hideTabHeading:function(a){g("#"+a).hide()},unhideTabHeading:function(a){g("#"+a).show()},addStyleCodeToURL:f,getResizedThumbnailURL:function(a,c){a=a.replace(/\._(AA|SS)\d+_/,"").replace(/\._SX\d+_SY\d+_CR,0,0,\d+,\d+_/,"");a=a.replace(/\._(US)\d+_/,"").replace(/\._SR\d+,\d+_/,"").replace(/\._SP[0-9,C]+_/,"");a=a.replace(/\._CB\d+_SS\d+_/,"");var b="_AA50_";c&&(b+="FMpng_RI_");return f(a,b)},populateVariationSelection:function(a){if(k.isDefined(h.DetailPage)&&
k.isDefined(h.DetailPage.StateController)){a.empty();var c=h.DetailPage.StateController.getState(),b=c.variation_label_order,d;for(d in b)if(b.hasOwnProperty(d)){var e=b[d],f=c.selected_variations[e];e=c.variation_display_labels[e];f&&g("\x3cdiv/\x3e").addClass("ivVariations").text(e+":"+f).appendTo(a)}}},populateTitle:function(a,c,b){a.html(b.title);a.attr("title",a.text());a.html(e(b.title,c))},animateStageIn:function(a){a.animate({opacity:1},200)},animateStageOut:function(a,c){a.animate({opacity:.4},
100,c)},logError:function(a,c,b,d){h.ueLogError&&h.ueLogError(d,{logLevel:a,attribution:c,message:b})}}});"use strict";l.when("A").register("ImageBlockLoader",function(d){return{load:function(g,k){k=k||{};k.timeout=k.timeout||4E3;d.ajax(g,k)}}});"use strict";l.when("postMetric","imageBlockImmersiveViewUtils").execute("vse-ns-ajax-calls",function(d,g){l.register("vse_ns_preLoaderHook",function(){function k(e,f){try{var a=e.A,c=e.block,b=e.request,t=e.handleFailure,h=e.handleSuccess,l=a.$;f--;var m=
3-f-1,n=a.now();a.ajax("/vap/ew/componentbuilder",{params:b,paramsFormat:"json",crossDomain:!0,method:"post",contentType:"application/json",timeout:b.timeout||5E3,withCredentials:!0,success:function(e){var f=a.now()-n;d.postTimeMetric("vse_preLoaderHook:success:",f);d.postCountMetric("vse_preLoaderHook:success:"+b.page+":"+b.placement+":"+m);l(c).html(e);h(a,b,e)},error:function(c){d.postCountMetric("vse_preLoaderHook:error:"+b.page+":"+b.placement+":"+m);(0===c.http.status||500<=c.http.status&&599>=
c.http.status)&&0<f?k(e,f):(d.postCountMetric("vse_preLoaderHook:error:",1),t(a,b,c))}})}catch(q){g.logError("FATAL","vse_ns_desktop","[vse_ns_preLoaderHook] ",q)}}return{get:function(e,d,a,c,b){k({A:e,block:d,request:a,handleFailure:b,handleSuccess:c},3)}}});l.register("vse_ns_lazyLoaderHook",function(){function k(e,f,a){try{var c=e.A,b=e.context,h=e.handleFailure,l=e.handleSuccess;f.attr("data-configuration");var p=atob(f.attr("data-configuration")),m=JSON.parse(p),n={pageContext:b,configuration:m},
q=c.now();a--;var r=3-a-1;c.ajax("/vap/ew/subcomponent/"+m.type,{params:n,paramsFormat:"json",method:"post",contentType:"application/json",timeout:b.timeout||5E3,withCredentials:!0,success:function(a){var e=c.now()-q;d.postTimeMetric("vse_lazyLoaderHook:success:",e);d.postCountMetric("vse_lazyLoaderHook:success:"+b.page+":"+b.placement+":"+m.type+":"+r);f.html(a);l(c,n,a)},error:function(g){d.postCountMetric("vse_lazyLoaderHook:error:"+b.page+":"+b.placement+":"+m.type+":"+r);(0===g.http.status||
500<=g.http.status&&599>=g.http.status)&&0<a?k(e,f,a):(d.postCountMetric("vse_lazyLoaderHook:error:",1),h(c,n,g))}})}catch(u){g.logError("FATAL","vse_ns_desktop","[vse_ns_lazyLoaderHook] ",u)}}return{get:function(e,d,a,c,b){var f=e.$;f(d+" div[data-configuration]").each(function(){k({A:e,context:a,handleFailure:b,handleSuccess:c},f(this),3)})}}});l.register("vse_ns_videoPlayer",function(){function k(e,f,a){try{var c=e.A,b=e.block,h=e.request,l=e.handleFailure,p=e.handleSuccess,m=c.$;a--;var n=3-a-
1,q=c.now();c.ajax("/vap/ew/subcomponent/vseplayer",{params:h,paramsFormat:"json",crossDomain:!0,method:"post",contentType:"application/json",timeout:h.timeout||5E3,withCredentials:!0,success:function(a){var e=c.now()-q;d.postTimeMetric("vse_lightPlayerLoaderHook:success:",e);d.postCountMetric("vse_lightPlayerLoaderHook:success:"+h.page+":"+h.placement+":"+n);m(b).html(a);p(c,h,a)},error:function(b){d.postCountMetric("vse_lightPlayerLoaderHook:error:"+h.page+":"+h.placement+":"+n);(0===b.http.status||
500<=b.http.status&&599>=b.http.status)&&0<a?k(e,a):(d.postCountMetric("vse_lightPlayerLoaderHook:error:",1),l(c,h,b))}})}catch(r){g.logError("FATAL","vse_ns_lightPlayer","[vse_ns_lightPlayerLoaderHook] ",r)}}return{get:function(e,d,a,c,b){k({A:e,block:d,request:a,handleFailure:b,handleSuccess:c},3)}}})})});
/* ******** */
