var ProductDetail2Module;(function(n){var t=function(){function n(n,t){var i=this;this.AddToWishList=function(n){i.Scope.TrackEvent_(TrackingEventType.AddToWishlist,{ProductModel:n},i.GetDataForAddToWishlistEvent)}
;this.GetDataForAddToWishlistEvent=function(n,t){switch(t){case 1:return{event_name:"add_to_wishlist"};case 2:return{event:"Add to Wishlist",eventAction:n.ProductModel.Name,id:n.ProductModel.Id.toString(
),eventLabel:n.ProductModel.Level2.Slug}}};this.GetDataForProductDetailLoadEvent=function(n,t){switch(t){case 1:return null;case 2:return i.GetGtmDataForProductDetailLoadEvent(n.ProductView,n.Context,
n.ListName);default:throw new Error("Tracker service type ("+t+") is not implemented");}};this.GetGtmDataForProductDetailLoadEvent=function(n,t,i){var r=n.Product,u=!!r.ListPrice&&!!r.SalePrice?r.ListPrice-
r.SalePrice:0;return{event:"dlReadyDetail",ecommerce:{detail:{products:[{id:r.Id,name:r.Name,list:i,position:1,category:r.Category?r.Category:"N/A",brand:r.Brand?r.Brand:"N/A",variant:"N/A",price:r.SalePrice||
r.ListPrice,dimension14:TrackerHelperModule.TrackerHelperService.GetCategoryData(r.Categories,0,"PDept"),dimension15:TrackerHelperModule.TrackerHelperService.GetCategoryData(r.Categories,0,"Dept"),dimension20:
r.Availability?"yes":"no",dimension21:r.IsNew?"yes":"no",dimension22:r.IsOnSale?"yes":"no",dimension35:u,dimension36:r.ListPrice,dimension49:r.ProfileNumber,dimension50:t.Market,dimension51:t.Cluster,
metric3:u,metric4:r.ListPrice}]}}}};this.GetDataForAddToCartEvent=function(n,t){switch(t){case 1:return null;case 2:return n.SelectedProduct.Quantity>0?i.GetGtmDataForAddToCartEvent(n.Product,n.SelectedProduct,
n.Context,n.ListName):i.GetGtmDataForRemoveFromBasketEvent(n.Product,n.SelectedProduct,n.Context,n.ListName);default:throw new Error("Tracker service type ("+t+") is not implemented");}};this.GetGtmDataForAddToCartEvent=
function(n,t,i,r){var u=n.SalePrice!=null?n.ListPrice-n.SalePrice:"0";return{event:"addToCart",ecommerce:{add:{products:[{id:n.Id,name:n.Name,list:r,position:"1",category:n.Category?n.Category:"N/A",brand:
n.Brand?n.Brand:"N/A",variant:t.VariantName?t.VariantName:"N/A",price:n.SalePrice||n.ListPrice,quantity:t.Quantity,dimension14:TrackerHelperModule.TrackerHelperService.GetCategoryData(n.Categories,0,"PDept"),
dimension15:TrackerHelperModule.TrackerHelperService.GetCategoryData(n.Categories,0,"Dept"),dimension20:n.Availability?"yes":"no",dimension21:n.IsNew?"yes":"no",dimension22:n.IsOnSale?"yes":"no",dimension35:
u,dimension36:n.ListPrice,dimension49:n.ProfileNumber,dimension50:i.Market,dimension51:i.Cluster,dimension59:"checkout",metric3:u,metric4:n.ListPrice}]}}}};this.GetGtmDataForRemoveFromBasketEvent=function(
n,t,i,r){var u=n.SalePrice!=null?n.ListPrice-n.SalePrice:"0";return{event:"removeFromCart",ecommerce:{remove:{products:[{id:n.Id,name:n.Name,list:r,position:"1",category:n.Category?n.Category:"N/A",brand:
n.Brand?n.Brand:"N/A",variant:t.VariantName?t.VariantName:"N/A",price:n.SalePrice||n.ListPrice,quantity:Math.abs(t.Quantity),dimension14:n.PDept!=null?n.PDept.Name:"N/A",dimension15:n.Dept!=null?n.Dept.
Name:"N/A",dimension20:n.Availability?"yes":"no",dimension21:n.IsNew?"yes":"no",dimension22:n.IsOnSale?"yes":"no",dimension35:u,dimension36:n.ListPrice,dimension49:n.ProfileNumber,dimension50:i.Market,
dimension51:i.Cluster,dimension59:"checkout",metric3:u,metric4:n.ListPrice}]}}}};this.AddToCart=function(n,t,r,u){i.Scope.TrackEvent_(t.Quantity>0?TrackingEventType.AddToCart:TrackingEventType.RemoveFromBasket,
{Product:n,SelectedProduct:t,Context:r,ListName:u},i.GetDataForAddToCartEvent,2)};this.Scope=n;this.NotifyMeTrackerService=t}return n.prototype.SetAvonAnalyticsObject=function(n){try{var t={product_page_url:
window.location.href};n.Product!==null&&(t.product_name=n.Product.Name);n.Product.Level2!==null&&(t.product_brand=n.BrandName,t.product_category=n.Product.Level2.Name);n.Product.PDept!==null&&(t.product_subcategory=
n.Product.PDept.Name);n.Product.ListPrice!==null&&(t.product_unit_price=n.Product.ListPrice.toString());n.Product.SalePrice!==null&&(t.product_sale_price=n.Product.SalePrice.toString());t.product_onsale=
n.Product.IsOnSale?"yes":"no";t.product_isnew=n.Product.IsNew?"yes":"no";t.product_isavailable=n.Product.Availability===1?"yes":"no";t.product_SKUs=[];n.Product.SingleVariantSku===""?(n.NonShadeVariants!==
null&&n.NonShadeVariants.length!==0&&(t.product_SKUs=_.pluck(n.NonShadeVariants,"Value")),n.ShadeVariants.length!==0&&(t.product_SKUs=_.pluck(n.ShadeVariants[0].Variants,"Sku"))):t.product_SKUs.push(n.
Product.SingleVariantSku);this.Scope.Analytics.MergeAnalytics(t)}catch(i){}},n.prototype.NotifyMe=function(n){this.Scope.TrackEvent_(TrackingEventType.NotifyMe,n,this.NotifyMeTrackerService.GetDataForNotifyMeEvent)}
,n.prototype.IncreaseQty=function(){this.Scope.Analytics.TrackEvent(TrackingEventType.ChooseQuantityUp,null)},n.prototype.DecreaseQty=function(){this.Scope.Analytics.TrackEvent(TrackingEventType.ChooseQuantityDown,
null)},n.prototype.SocialShareButton=function(){this.Scope.Analytics.TrackEvent(TrackingEventType.ProductDetailShareIntent,null)},n.prototype.OnSocialShare=function(n){this.Scope.Analytics.TrackEvent(
TrackingEventType.ProductDetailShareType,{content_share_type:n,content_share_url:window.location.href})},n}();n.ProductDetailTrackerService=t;var i=function(){function n(){}return n}();n.GetDataForAddToCartEventModel=
i;var r=function(){function n(){}return n}();n.GetDataForProductDetailLoadEventModel=r;var u=function(){function n(){}return n}();n.GetDataForAddToWishlistEventModel=u})(ProductDetail2Module||(ProductDetail2Module=
{}));app.service("ProductDetailTrackerService",["$rootScope","NotifyMeTrackerService",ProductDetail2Module.ProductDetailTrackerService]);var ProductDetail2Module;(function(n){var t=function(){function n(
){}return n}();n.NotifyMeFormModel=t})(ProductDetail2Module||(ProductDetail2Module={}));var ProductDetail2Module;(function(n){var t=function(){function n(){}return n}();n.SelectedProductModel=t})(ProductDetail2Module||
(ProductDetail2Module={}));var ProductDetail2Module;(function(n){var t=["$scope","CartService","ProductService","WishListService","ProductDetailTrackerService","ApptusNotificationService","RecommendationEngineService",
function(t,i,r,u,f,e,o){var s;s=t.isQuantitySelectorAddsToBag?new n.AddToCartDirectiveQuantitySelectorAddsBehaviour(t,f,i):new n.AddToCartDirectiveQuantitySelectorDoesNotAddBehaviour(t);t.addedToWishlist=
!1;t.notifyMeFormModel=new n.NotifyMeFormModel;t.notifyMeFormModel.customerEmail=t.customerEmail;s.initialization();t.product.IsConditional&&t.product.Conditional&&(!t.conditionalProductMessages||t.conditionalProductMessages.
length<1)&&(t.conditionalProductMessages=t.product.Conditional.Messages);t.isAddToBagVisible=function(){return s.isAddToBagVisible()};t.isQuantitySelectorVisible=function(){return s.isQuantitySelectorVisible(
)};t.addToCartClick=function(){var n=s.quantityToAdd();t.addToCart(n)};t.addToCart=function(n){var u,r=t.selectedProduct();if(r.Sku!=""){u={Sku:r.Sku,Quantity:n,Campaign:_ShopContext.CampaignNumber};i.
AddToCart(u,"",t.product.SalePrice);e.AddtoCartNotification(t.product.Id,r.Sku,t.product.NotificationTicket);r.Quantity=n;f.AddToCart(t.product,r,_ShopContext,window.location.pathname);var s={Type:6,ProductId:
t.product.ProductId};o.SendRecommendationEvent(s)}};t.setQuantity=function(){var n=t.selectedProduct(),r=_ShopContext.CampaignNumber;i.GetCartItem(n.Sku,r)};t.notifyMeSubmit=function(){var i,n,u;u=t.notifyMeFormModel.
customerEmail;n=t.product;i={EmailAddress:u,LanguageId:0,ProductId:n.Id,ProductName:n.Name};r.AddNotification(i)};t.notifyMe=function(){t.notifyMeSubmitted=!1;t.showModal("NotifyMeModal",{DisableClose:
!0,Model:null,Scope:null})};t.closeNotifyMe=function(){t.closeModal("NotifyMeModal")};t.increaseQty=function(){return s.increaseQty()};t.decreaseQty=function(){return s.decreaseQty()};t.addToWishlist=
function(){var n;n=t.product;u.Add(n.Id).then(h)};t.removeFromWishlist=function(){var n;n=t.product;u.RemoveProduct(n.Id).then(h)};t.hasActiveVariantOrConditionalCanAdd=function(){return t.product.Availability==
1&&t.product.HasActiveVariant||t.product.Conditional.CanAddToCart};t.hasActiveVariant=function(){return t.product.Availability==1&&t.product.HasActiveVariant};t.hasSelectedVariant=function(){var n=t.selectedProduct(
);return n.Sku!=""};t.selectedProduct=function(){var i=new n.SelectedProductModel;return i.Sku=t.product.SingleVariantSku,t.selectedShadeVariant!=null&&typeof t.selectedShadeVariant!="undefined"?(i.Sku=
t.selectedShadeVariant.Sku,i.VariantName=t.selectedShadeVariant.Name,i.DisplayLineNumber=t.selectedShadeVariant.DisplayLineNumber):t.selectedSizeVariant!=null&&typeof t.selectedSizeVariant!="undefined"&&
(i.Sku=t.selectedSizeVariant.Value),i.Sku=i==null?"":i.Sku.trim(),i};t.isConditional=function(){return t.product.Availability===5};t.$on("ProductService_AddNotificationSuccess",function(){t.notifyMeSubmitted=
!0;f.NotifyMe(t.product)});t.$on("WishListService_AddWishListSuccess",function(){t.addedToWishlist=!0;f.AddToWishList(t.product);var n={Type:7,ProductId:t.product.Id};o.SendRecommendationEvent(n)});t.
$on("CartService_GetCartItemSuccess",function(n,t){s.setNewQuantity(t.Quantity)});t.$watch("selectedShadeVariant",function(){t.setQuantity()});t.$watch("selectedSizeVariant",function(){t.setQuantity()}
);t.$on("CartService_AddSuccess",function(n,i){t.setQuantity();c(i.ConditionalProducts)});t.$on("SessionService_GetSessionSuccess",function(n,t){c(t.CartSummary.ConditionalProducts)});function h(){u.GetWishList(
).then(function(n){var r;r=t.product;t.addedToWishlist=!1;for(var i=0;i<n.length;i++)if(n[i].Id===r.Id){t.addedToWishlist=!0;break}})}function c(n){n&&n.forEach(function(n){n.ProductId===t.product.Id&&
(t.conditionalProductMessages=n.Messages,t.product.Conditional.CanAddToCart=n.CanAddToCart)})}h()}],i=function(){function n(n,i){return{restrict:"E",replace:!1,template:"",scope:{product:"=",selectedShadeVariant:
"=",customerEmail:"=",showModal:"=",closeModal:"=",selectedSizeVariant:"=",quantity:"=",isQuantitySelectorAddsToBag:"="},controller:t,link:function(t,r){var u=n.get("addToCart.html");r.append(i(u)(t));
t.setQuantity()}}}return n}();n.AddToCartDirective=i})(ProductDetail2Module||(ProductDetail2Module={}));app.directive("pdpAddToCart",["$templateCache","$compile",ProductDetail2Module.AddToCartDirective]);
var ProductDetail2Module;(function(n){var t=function(){function n(n,t,i){this.scope=n;this.productDetailTrackerService=t;this.cartService=i}return n.prototype.initialization=function(){this.scope.quantity=
1},n.prototype.isAddToBagVisible=function(){return!this.scope.quantity},n.prototype.isQuantitySelectorVisible=function(){return!!this.scope.quantity},n.prototype.quantityToAdd=function(){return 1},n.prototype.
increaseQty=function(){this.scope.addToCart(1);this.productDetailTrackerService.IncreaseQty()},n.prototype.decreaseQty=function(){var n=this.scope.quantity;if(this.scope.quantity>0&&(this.scope.quantity--,
this.scope.addToCart(-1),this.productDetailTrackerService.DecreaseQty(),n==1)){var t=this.scope.selectedProduct();this.cartService.RemoveProduct(t.Sku,_ShopContext.CampaignNumber.toString())}},n.prototype.
setNewQuantity=function(n){this.scope.quantity=typeof n!="undefined"?n:0},n}();n.AddToCartDirectiveQuantitySelectorAddsBehaviour=t})(ProductDetail2Module||(ProductDetail2Module={}));var ProductDetail2Module;
(function(n){var t=function(){function n(n){this.scope=n}return n.prototype.initialization=function(){},n.prototype.isAddToBagVisible=function(){return!0},n.prototype.isQuantitySelectorVisible=function(
){return!0},n.prototype.quantityToAdd=function(){return this.scope.quantity},n.prototype.increaseQty=function(){this.scope.quantity++},n.prototype.decreaseQty=function(){this.scope.quantity>1&&this.scope.
quantity--},n.prototype.setNewQuantity=function(){this.scope.quantity=1},n}();n.AddToCartDirectiveQuantitySelectorDoesNotAddBehaviour=t})(ProductDetail2Module||(ProductDetail2Module={}));var ProductDetail2Module;
(function(){})(ProductDetail2Module||(ProductDetail2Module={}));var ProductDetail2Module;(function(){})(ProductDetail2Module||(ProductDetail2Module={}));var ProductDetail2Module;(function(n){var t=["$scope",
"$location","$rootScope",function(n){n.availableShadeVariants=_.where(n.shadeVariants,function(n){return n.IsAvailable});n.showShadeColorHexSwatches=n.availableShadeVariants.every(function(n){return!!n.
ColorHex});n.isSectionExpanded=!0;n.selectShade=function(t){n.selectedShadeVariant=t;window.YMK.isLoaded()&&window.YMK.applyMakeupBySku(t.TryItOnMakeupSku)};n.hasShadeVariants&&(n.selectedShadeVariant=
n.availableShadeVariants[0]);n.toggleSectionExpansion=function(){n.isSectionExpanded=!n.isSectionExpanded;n.isSectionExpanded||n.scrollIntoView()};n.format=function(n,t){return n.replace("{0}",t)}}],i=
function(){function n(n,i,r){return{restrict:"E",replace:!1,template:"",scope:{hasShadeVariants:"@",selectedShadeVariant:"=",shadeVariants:"=",shadeSelectionChanged:"&",isDesktopLayout:"=",swatchZoomEnabled:
"="},controller:t,link:function(t,u){var f=n.get("shadeSelector.html");u.append(i(f)(t));r(function(){var n=$(u).find(".Selector"),i=n.first(),r=n.last();i.length>0&&r.length>0&&i[0].getBoundingClientRect(
).top!==r[0].getBoundingClientRect().top&&(t.isShadeExpanderVisible=!0)},200);t.scrollIntoView=function(){$(u).scrollintoview({duration:150})}}}}return n}();n.ShadeSelectorDirective=i})(ProductDetail2Module||
(ProductDetail2Module={}));app.directive("pdpShadeSelector",["$templateCache","$compile","$timeout",ProductDetail2Module.ShadeSelectorDirective]);var __extends=this.__extends||function(n,t){for(var i in
t)t.hasOwnProperty(i)&&(n[i]=t[i]);function r(){this.constructor=n}r.prototype=t.prototype;n.prototype=new r},ProductDetail2Module;(function(n){var t=function(n){__extends(t,n);function t($scope,t,i,r,
u,f,e,o,s,h,c,l,a){var v=this;n.call(this,$scope);this.CartService=f;this.ProductService=e;this.WishListService=o;this.ProductDetailTrackerService=s;this.ProductDetailRatingService=h;this.SocialShareTrackerService=
c;this.ApptusNotificationService=l;this.recommendationEngineService=a;this.timer=null;this.clicks=0;this.notifyMeSubmitted=!1;this.addedToWishlist=!1;this.waitingForSecondClick=!1;this.SectionOpenStates=
[];this.SectionExpandedStates=[];this.DesktopOpenSection="Description";this.GetHQYouTubeImage=function(n){return n?n.replace("/1.","/hqdefault."):""};this.HideElementByClass=function(n){$("."+n).hide(
)};this.Scope=$scope;this.Zoom=new ZoomModule.ZoomController;this.ViewModel.ImageUrls=[];this.ViewModel.HasShadeVariants=this.ViewModel.ShadeVariants!==undefined&&this.ViewModel.ShadeVariants!==null&&
this.ViewModel.ShadeVariants.length>0&&this.ViewModel.ShadeVariants[0]!==undefined&&this.ViewModel.ShadeVariants[0]!==null&&this.ViewModel.ShadeVariants[0].Variants!==null&&this.ViewModel.ShadeVariants[
0].Variants.length>0;this.SetDefaultShadeAndSize();this.ViewModel.HasShortDescription=this.ViewModel.Product.ShortDescription!==undefined&&this.ViewModel.Product.ShortDescription!==null&&this.ViewModel.
Product.ShortDescription.trim()!=="";this.ViewModel.Product.ImageUrl=this.Scope.Cdn.ProductImageLarge(this.ViewModel.Product.ProfileNumber,1);this.ViewModel.Product.Url=window.location.href;a.DisableDefaultRecommendations(
);$scope.$on("RecommendationEngineService.CustomRecommendation",function(){var n={Type:1,ProductId:v.ViewModel.Product.Id};a.GetRecommendedProducts(n)});$scope.$on("SocialSharingDirective_SocialShare",
function(n,t){v.Scope.TrackEvent_(TrackingEventType.ProductDetailShareType,{ShareType:t.sharetype,ShareUrl:window.location.href},v.SocialShareTrackerService.GetDataForSocialShareEvent)});$scope.$on("Carousel_SlideShown",
function(n,t){v.OnCarouselSlideShown(t)});$scope.GetRatingIcon=this.ProductDetailRatingService.GetRatingIcon;$scope.PartialViewLoaded=this.Initialize;_.delay(function(){v.LoadImages();v.InitializeBazaarVoiceApi(
);v.ProductDetailTrackerService.SetAvonAnalyticsObject(v.ViewModel);v.TrackProductDetailLoad();v.TrackReady();v.SetupTryItOn()},2)}return t.prototype.ImageOrVideoClick=function(){$("#popupTryItOnThumb").
hide();$("#tryItOnThumb").show();$('<div class="popupTryItOn" id="YMK-module"><\/div>').appendTo("#popupCarouselTryItOn");$(".tryItOn").remove()},t.prototype.CloseImagePopup=function(){if(this.Scope.ViewModel.
IsPopupOpen=!1,this.ViewModel.Media.length>0&&this.CarouselPopupScope&&this.CarouselPopupScope.currentIndex>=this.ViewModel.ImageUrls.length){var n=this.CarouselPopupScope.currentIndex,t=".Slides .DesktopYouTubeFrame"+
n,i=".YoutubeThumbnail"+n;$(t).attr("src","");$(t).hide();$(i).show()}$("#PdpImageCarouselDesktop").appendTo(".PdpImageCarouselDesktop");$(".PdpImagePopupBackground").hide();$("body").css("overflow","visible")}
,t.prototype.InitThumbnail=function(n){n==0&&$($(".Item.ThumbItem")[n]).addClass("Selected");this.Scope.SafeApply()},t.prototype.InitImageAndVideoThumbUrls=function(){this.ViewModel.ImageAndVideoThumbUrls=
[];for(var n=0;n<this.ViewModel.ImageUrls.length;n++)this.ViewModel.ImageAndVideoThumbUrls.push(this.ViewModel.ImageUrls[n]);for(var n=0;n<this.ViewModel.Media.length;n++)this.ViewModel.ImageAndVideoThumbUrls.
push(this.GetHQYouTubeImage(this.ViewModel.Media[n].ThumbnailUrl))},t.prototype.ShowImageGalleryPopup=function(){$(".PdpImagePopupBackground").show();$(".PdpImagePopupBackground").css("display","table");
this.CarouselPopup=$("#PdpImageCarouselDesktopPopup carousel");this.CarouselPopupScope=this.CarouselPopup.scope();$("body").css("overflow","hidden");this.Scope.ViewModel.IsPopupOpen=!0;this.ImageOrVideoClick(
)},t.prototype.ShowNextThumbImage=function(){var i=$(".Item.ThumbItem").length,n=$(".Item.ThumbItem:visible").last().attr("id");if(+n<i-1){var r=+n+1,t=$(".Item.ThumbItem").get(r);$(t).removeClass("ng-hide");
var u=$(".Item.ThumbItem:visible").first();u.hide();$(t).show()}},t.prototype.ShowPrevThumbImage=function(){var n=$(".Item.ThumbItem:visible").first().attr("id");if(+n>0){var i=+n-1,t=$(".Item.ThumbItem").
get(i);$(t).removeClass("ng-hide");var r=$(".Item.ThumbItem:visible").last();r.hide();$(t).show()}},t.prototype.ShowThumbImageInit=function(n){var t=!0;return n>4&&(t=!1),t},t.prototype.GoToItem=function(
n){this.Carousel=$("#PdpImageCarouselDesktop carousel");this.CarouselPopup=$("#PdpImageCarouselDesktopPopup carousel");this.CarouselScope=this.Carousel.scope();this.CarouselPopupScope=this.CarouselPopup.
scope();var t=this.CarouselScope.currentIndex;this.CarouselScope.showSlide(n,!0,!0);this.CarouselPopupScope.showSlide(n,!0,!0);n<t?(this.SetArrowsWhenSlidePrevious(this.CarouselScope.currentIndex,this.
CarouselScope),this.SetArrowsWhenSlidePrevious(this.CarouselScope.currentIndex,this.CarouselPopupScope)):n>t&&(this.SetArrowsWhenSlideNext(this.CarouselScope.currentIndex,this.CarouselScope),this.SetArrowsWhenSlideNext(
this.CarouselScope.currentIndex,this.CarouselPopupScope))},t.prototype.SetArrowsWhenSlideNext=function(n,t){n>0&&($(".PdpLeftArrowActive").show(),$(".PdpLeftArrowInactive").hide());t.slideCount-1==n?(
$(".PdpRightArrowActive").hide(),$(".PdpRightArrowInactive").show()):($(".PdpRightArrowActive").show(),$(".PdpRightArrowInactive").hide())},t.prototype.SetArrowsWhenSlidePrevious=function(n,t){n<t.slideCount-
1&&($(".PdpRightArrowActive").show(),$(".PdpRightArrowInactive").hide());n==0?($(".PdpLeftArrowActive").hide(),$(".PdpLeftArrowInactive").show()):($(".PdpLeftArrowActive").show(),$(".PdpLeftArrowInactive").
hide())},t.prototype.SelectThumbnail=function(n){$($(".ThumbItem")).removeClass("Selected");$($(".Item.ThumbItem")[n]).addClass("Selected")},t.prototype.GetYouTubeVideoUrl=function(n){return n?"https:"+
n+"?autohide=1&amp;start=0&amp;rel=0&amp;wmode=transparent&amp;autoplay=0":""},t.prototype.ShowImageGalleryVideo=function(n,t,i){var u=+i-this.ViewModel.ImageUrls.length,f=this.ViewModel.Media[u],e="."+
n+i,r=".Slides ."+t+i;$(r).attr("src",this.GetYouTubeVideoUrl(f.EmbeddedUrl));$(e).hide();$(r).show()},t.prototype.ShowImageGalleryVideoPopup=function(n){this.ShowImageGalleryVideo("YoutubeThumbnail",
"DesktopYouTubeFrame",n);this.ShowImageGalleryPopup()},t.prototype.OnCarouselSlideShown=function(n){if(this.Carousel=$("#PdpImageCarouselDesktop carousel"),this.CarouselScope=this.Carousel.scope(),this.
CarouselPopup=$("#PdpImageCarouselDesktopPopup carousel"),this.CarouselPopupScope=this.CarouselPopup.scope(),this.CarouselPopup&&this.Carousel&&typeof this.CarouselPopup!="undefined"&&typeof this.CarouselPopupScope!=
"undefined"&&this.CarouselPopupScope.currentIndex!=this.CarouselScope.currentIndex){if(this.Carousel.is(n.container))this.CarouselPopupScope.showSlide(n.currentIndex,!0,!0);else if(this.CarouselPopup.
is(n.container)){if(this.ViewModel.Media.length>0){var f=this.ViewModel.ImageUrls.length,r=n.currentIndex;if(n.isNextClicked&&r>f){var t=r-1,i=".Slides .DesktopYouTubeFrame"+t,u=".YoutubeThumbnail"+t;
$(i).attr("src","");$(i).hide();$(u).show()}if(n.isPreviousClicked&&r>=f-1){var t=r+1,i=".Slides .DesktopYouTubeFrame"+t,u=".YoutubeThumbnail"+t;$(i).attr("src","");$(i).hide();$(u).show()}}this.CarouselScope.
showSlide(n.currentIndex,!0,!0)}this.SelectThumbnail(n.currentIndex);n.isNextClicked&&n.currentIndex>4&&this.ShowNextThumbImage();n.isPreviousClicked&&n.currentIndex<4&&this.ShowPrevThumbImage()}},t.prototype.
RatingIcon=function(n){var t=Math.floor(this.ViewModel.Product.Rating+.5);return t>n?"pdp_star_filled":"pdp_star_empty"},t.prototype.WriteReview=function(){var t=null;if(this.ViewModel.BazaarvoiceShouldUseNewApi)
{var n=$("bv_button_buttonMinimalist");n!=null&&n.length>0&&(t=n[0])}else{var n=$("#BVSubmissionLink");n!=null&&n.length>0&&(t=n[0])}t!=null&&t.click()},t.prototype.ToggleRatingsHistogram=function(n){
var t=$(".RatingHistogram");if(this.Scope.Layout.IsPhone)t.hide();else{if(!this.IsRatingHistogramInitialized){var i=$(".BVRRRatingsHistogramButtonPopin");i.length>0?(i.css("display","block"),t.append(
i),this.IsRatingHistogramInitialized=!0):n=!1}n?t.show():t.hide()}},t.prototype.GoToPromotion=function(n){window.location.href=this.Scope.Url.GetPromotionUrl(n)},t.prototype.TogglePromotionOverlay=function(
){var n=$(".PromotionOverlay");n.fadeToggle(200)},t.prototype.ToggleSharingOverlay=function(){var n=$("#PdpShareLink"),i=n.width()/2,t=$(".SharingOverlay"),r=n.position().left+i;t.offset({left:r});t.fadeToggle(
200);this.ProductDetailTrackerService.SocialShareButton()},t.prototype.IsSectionExpanded=function(n){return this.SectionExpandedStates[n]===!0},t.prototype.IsSectionOpen=function(n){return this.SectionOpenStates[
n]===!0},t.prototype.ToggleSection=function(n){var t=this.IsSectionOpen(n);this.SectionOpenStates[n]=!t},t.prototype.ToggleSectionExpansion=function(n){var t=this.IsSectionExpanded(n);this.SectionExpandedStates[
n]=!t;t&&$("#Section"+n).scrollintoview({duration:150})},t.prototype.ToggleSectionDesktop=function(n){this.DesktopOpenSection=n},t.prototype.IsSectionOpenDesktop=function(n){return this.DesktopOpenSection===
n},t.prototype.SetDefaultShadeAndSize=function(){if(this.ViewModel.Quantity=this.ViewModel.Product.Quantity,this.ViewModel.SelectedSizeVariant=null,this.ViewModel.HasShadeVariants){var n=this.ViewModel.
ShadeVariants[0].Variants.filter(function(n){return!!n.IsAvailable});n.length>0&&(this.ViewModel.SelectedShadeVariant=n[0])}},Object.defineProperty(t.prototype,"ViewModel",{get:function(){return this.
Scope.ViewModel},enumerable:!0,configurable:!0}),t.prototype.InitializeBazaarVoiceApi=function(){if(!this.ViewModel.BazaarvoiceShouldUseNewApi){var n=window.$BV;n!=null&&this.Scope.ShopContext.Bazaarvoice!=
null&&(n.configure("global",{submissionContainerUrl:this.Scope.ShopContext.Bazaarvoice.SubmissionContainerUrl}),n.ui("rr","show_reviews",{productId:this.ViewModel.Product.Id,contentContainerDiv:"BVRRContainer",
summaryContainerDiv:"BVRRSummaryContainer"}))}},t.prototype.LoadImages=function(){for(var n=this,h=[],r=1,u=9,f=u-r+1,e=[],o=[],t=r;t<=u;t++){var s=this.Scope.Cdn.ProductImageXtraLarge(this.ViewModel.
Product.ProfileNumber,t);o.push(s);var i=this.Scope.Url.FileExists(s);i.then(function(t){e[o.indexOf(t)]=t;n.Scope.SafeApply()},function(){});i.finally(function(){n.Scope.ViewModel.ImageUrls=e.filter(
function(n){return!!n});f--;f<=0&&_.delay(function(){var t=$(".GalleryImages");n.Zoom.zoom(t,n.Scope.Layout.IsPhone);n.Scope.ViewModel.CarouselElementCount=n.Scope.ViewModel.Media.length+n.Scope.ViewModel.
ImageUrls.length;n.Scope.ViewModel.Product.IsTryItOnProduct&&(n.Scope.ViewModel.CarouselElementCount+=1);n.InitImageAndVideoThumbUrls();n.SelectThumbnail(0)},3)});h.push(i)}},t.prototype.SetupTryItOn=
function(){window.ymkAsyncInit=function(){window.YMK.init({autoOpen:!0,width:document.getElementById("PdpImageCarouselDesktop").offsetWidth-60,height:document.getElementById("PdpImageCarouselDesktop").
offsetHeight})};window.onresize=function(){if(typeof window.YMK!="undefined"){var n=document.getElementById("tryItOnThumb");n&&(n.style.display="block");window.YMK.close();clearTimeout(window.TryItOnResizeTimeOut);
window.TryItOnResizeTimeOut=setTimeout(function(){console.log("init");window.YMK.init({autoOpen:!0,width:document.getElementById("PdpImageCarouselDesktop").offsetWidth-60,height:document.getElementById(
"PdpImageCarouselDesktop").offsetHeight});document.getElementById("tryItOnThumb").style.display="none"},1e3)}};function n(){if(typeof window.YMK!="undefined"){window.YMK.close();$("#popupTryItOnThumb").
hide();$("#tryItOnThumb").show();$('<div class="popupTryItOn" id="YMK-module"><\/div>').appendTo("#popupCarouselTryItOn");$(".tryItOn").remove();window.YMK.init({autoOpen:!0,width:440,height:490})}}$(
document).on("click",".SmallImage",function(){n()});$(document).on("click",".VideoImage",function(){n()})},t.prototype.TrackReady=function(){this.Scope.Analytics.TrackReady(["dlReadyDetail"])},t.prototype.
Initialize=function(){_.delay(function(){window.IncludeYotpoScript&&window.IncludeYotpoScript()},2)},t.prototype.TrackProductDetailLoad=function(){this.Scope.TrackEvent_(TrackingEventType.ProductDetailLoad,
{ProductView:this.Scope.ViewModel,Context:this.Scope.ShopContext,ListName:window.location.pathname},this.ProductDetailTrackerService.GetDataForProductDetailLoadEvent,2)},t.$inject=["$scope","$anchorScroll",
"$filter","$cookies","$locale","CartService","ProductService","WishListService","ProductDetailTrackerService","ProductDetailRatingService","SocialShareTrackerService","ApptusNotificationService","RecommendationEngineService"],
t}(BaseController);n.ProductDetail2Controller=t})(ProductDetail2Module||(ProductDetail2Module={}));app.controller("ProductDetail2Controller",ProductDetail2Module.ProductDetail2Controller);var ZoomModule;
(function(n){var t=function(){function n(){}return n.prototype.zoom=function(n,t){n.each(function(i){var u={url:"",callback:!1,target:!1,duration:120,on:"mouseover",touch:!0,magnify:385/613*3},c=n[i],
o=n[i],f=$(o),r=document.createElement("img"),s=$(r),h=!1,e;(u.url||(e=f.find("img"),e[0]&&(u.url=e.data("src")||e.attr("src")),u.url))&&(function(){var t=n[i].style.position,r=n[i].style.overflow;f.one(
"zoom.destroy",function(){f.off(".zoom");n[i].style.position=t;n[i].style.overflow=r;s.remove()})}(),r.onload=function(){if(!t){var l=null,a=null;f.on("mouseenter.zoom",function(n){l=$("#PdpImageCarouselDesktop .CarouselPrevious:visible");
a=$("#PdpImageCarouselDesktop .CarouselNext:visible");l.hide();a.hide();$(".Magnify").hide();e(!0);d(n.pageX,n.pageY)});f.on("mouseleave.zoom",function(){g();l.show();a.show();$(".Magnify").show()});f.
on("mousemove",function(n){var s=document.body.getBoundingClientRect().top,h=$("#PdpImageCarouselDesktop")[0].getBoundingClientRect().top,c=h-s,l=document.body.getBoundingClientRect().left,a=$("#PdpImageCarouselDesktop")[
0].getBoundingClientRect().left,v=a-l,e=$("#PdpImageCarouselDesktop")[0].clientWidth,o=$("#PdpImageCarouselDesktop")[0].clientHeight,y=$("body").position().left,p=$("body").position().top,w=n.pageX-v-
y,b=n.pageY-c-p,t=w/e,i=b/o;t>1&&(t=1);i>1&&(i=1);var u=+String(r.style.width).replace("px",""),f=+String(r.style.height).replace("px","");r.style.left=-(t*u*(u-e)/u)+"px";r.style.top=-(i*f*(f-o)/f)+"px"}
)}var p=new Hammer.Manager(n[i]),nt=new Hammer.Tap({event:"doubletap",taps:2,threshold:500,posThreshold:500});p.add(nt);var v=null,y=null;p.on("doubletap",function(n){t&&(h?(h=!1,v.show(),y.show(),g(),
$(".MagnifyMobile").css("visibility","visible"),setTimeout(function(){$(".zoomImg").each(function(n){$(".zoomImg")[n].style.opacity="0"})},500)):(v=$(".PdpImageMobile .CarouselPrevious:visible"),y=$(".PdpImageMobile .CarouselNext:visible"),
e(!0),h=!0,$(".MagnifyMobile").css("visibility","hidden"),d(n.center.x,n.center.y),v.hide(),y.hide()))});function tt(n,t,i){this.targetWidth=$(n).outerWidth();this.targetHeight=$(n).outerHeight();t===
n?(this.sourceWidth=this.targetWidth,this.sourceHeight=this.targetHeight):(this.sourceWidth=t.outerWidth(),this.sourceHeight=t.outerHeight());this.xRatio=(i.width-this.targetWidth)/this.sourceWidth;this.
yRatio=(i.height-this.targetHeight)/this.sourceHeight;ut(i);ft(i)}function w(n,t,i){var f=et(),e=ot();if(this.isStartMoving){this.isStartMoving=!1;var o=f/2,s=e/2;n.style.left=o+"px";n.style.top=s+"px"}
else{var h=t-this.startTapX,c=i-this.startTapY,r=this.imgStartLeft+h,u=this.imgStartTop+c;this.startTapX<t?r=k(r,0):this.startTapX>t;r=b(r,f);this.startTapY<i?u=k(u,0):this.startTapY>i;u=b(u,e);n.style.
left=r+"px";n.style.top=u+"px"}}function b(n,t){return Math.max(n,t)}function k(n,t){return Math.min(n,t)}function it(n,t,i,r){var u=$(n).css("position"),f=$(t);n.style.position=/(absolute|fixed)/.test(
u)?u:"relative";n.style.overflow="hidden";i.style.width=i.style.height="";$(i).addClass("zoomImg").css({position:"absolute",top:0,left:0,opacity:0,width:i.width*r,height:i.height*r,border:"none",maxWidth:
"none",maxHeight:"none"}).appendTo(n)}function rt(n,t,i){this.startTapX=n;this.startTapY=t;this.imgStartLeft=+String(i.style.left).replace("px","");this.imgStartTop=+String(i.style.top).replace("px","")}
function e(n){this.isStartMoving=n}function ut(n){var t=$(".GalleryImage").first().height(),i=$(".GalleryImage").css("margin-top").replace("px",""),r=+n.clientWidth-+t-+i;this.offsetY=r*-1}function ft(
n){var t=$(".GalleryImages").width(),i=+n.clientWidth-+t;this.offsetX=i*-1}function et(){return this.offsetX}function ot(){return this.offsetY}it(c,o,r,u.magnify);e(!0);function d(n,t){tt(c,o,r);w(r,n,
t);r.style.opacity="1";s.stop().fadeTo($.support.opacity?u.duration:0,1)}function g(){s.stop().fadeTo(u.duration,0);e(!0)}if(u.touch){f.on("touchstart",function(n){rt(n.originalEvent.touches[0].pageX,
n.originalEvent.touches[0].pageY,r)});f.on("touchmove.zoom",function(n){n.preventDefault();w(r,n.originalEvent.touches[0].pageX,n.originalEvent.touches[0].pageY)})}},r.src=u.url)})},n}();n.ZoomController=
t})(ZoomModule||(ZoomModule={}));app.controller("ZoomController",ZoomModule.ZoomController)