(function(n,t){return n.viewModel=null,n.PromotionViewModel=function(n){function c(){var n,r;t("#spinner-overlay").spin(!1);n="";t("#abbtnAddToCart")!=undefined&&t("#abbtnAddToCart").prop("disabled",!1);t("#btnAddToCart")!=undefined&&t("#btnAddToCart").prop("disabled",!1);t("#PromotionQuickViewModal").modal("hide");n==""&&(n=i.isQuickBuy()?"/Checkout/QuickBuy?returnStatus=0&cm_re=GN-_-CART-_-N":"/cart/minicart/?returnStatus=0&cm_re=GN-_-CART-_-N");i.displayMiniCart()?shopHq.minicart.displayMiniCart(n):!i.displayMiniCart()&&i.isQuickBuy()&&n!==null&&n!==undefined&&n!==""&&(window.location=i.cartUrl);r=window.location.href;r.toUpperCase().indexOf("PRODUCT")<0&&i.parentPromotionList.removeAll();ko.mapping.resetDefaultOptions()}function v(n){var i,r,t,u;if(n!==undefined&&n!==null){for(n=n.replace(/^\s+|\s+$/g,""),n=n.toLowerCase(),i="ãàáäâẽèéëêìíïîõòóöôùúüûñç·/_,:;",r="aaaaaeeeeeiiiiooooouuuunc------",t=0,u=i.length;t<u;t++)n=n.replace(new RegExp(i.charAt(t),"g"),r.charAt(t));n=n.replace(/[^a-z0-9 -]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-")}return n}function y(){var i=t.cookie("Basket1204"),n="",r;i&&i.indexOf("1=")>=0&&(n=i.substring(2).split("|")[0],t.isNumeric(n)&&(r=document.getElementById("CartQuantity"),r&&(r.innerHTML=n==1?n+" item":n+" items")))}function p(n){var f,e,t;if(r=null,u=null,i.parentPromotionList()[n].ProductDetail.Colors().length>0){for(r=[],f=0;f<i.parentPromotionList()[n].ProductDetail.Colors().length;f++)r[i.parentPromotionList()[n].ProductDetail.Colors()[f].Value()]={Skus:[],AvailableSkuCount:0,AlmostGoneSkuCount:0};i.parentPromotionList()[n].ProductDetail.Colors().length==1&&(i.promotionViewModelList()[n].SelectedColorValue(i.parentPromotionList()[n].ProductDetail.Colors()[0].Value()),i.promotionViewModelList()[n].SelectedColorText(i.parentPromotionList()[n].ProductDetail.Colors()[0].Text()))}if(i.parentPromotionList()[n].ProductDetail.Sizes().length>0){for(u=[],f=0;f<i.parentPromotionList()[n].ProductDetail.Sizes().length;f++)u[i.parentPromotionList()[n].ProductDetail.Sizes()[f].Value()]={Skus:[],AvailableSkuCount:0,AlmostGoneSkuCount:0};i.parentPromotionList()[n].ProductDetail.Sizes().length==1&&(i.promotionViewModelList[n].SelectedSizeValue(i.parentPromotionList()[n].ProductDetail.Sizes()[0].Value()),i.promotionViewModelList[n].SelectedSizeText(i.parentPromotionList()[n].ProductDetail.Sizes()[0].Text()))}for(f=0;f<i.parentPromotionList()[n].ProductDetail.Skus().length;f++)t=i.parentPromotionList()[n].ProductDetail.Skus()[f],r!==null&&r!==""&&t.ColorCode()!==null&&t.ColorCode()!=="00000"&&(e=r[t.ColorCode()],e.Skus[e.Skus.length]=t,t.AvailabilityStatus()===0&&e.AvailableSkuCount++,t.AvailabilityStatus()===4&&e.AlmostGoneSkuCount++),u!==null&&u!==""&&t.SizeCode()!==null&&t.SizeCode()!=="00000"&&(e=u[t.SizeCode()],e.Skus[e.Skus.length]=t,t.AvailabilityStatus()===0&&e.AvailableSkuCount++,t.AvailabilityStatus()===4&&e.AlmostGoneSkuCount++);(r==null||Object.keys(r).length==1)&&u==null&&i.parentPromotionList()[n].ProductDetail.DeliveryOptions().length>0?i.promotionViewModelList()[n].deliveryProgramOptions(i.parentPromotionList()[n].ProductDetail.DeliveryOptions()):i.promotionViewModelList()[n].deliveryProgramOptions.removeAll();i.promotionViewModelList()[n].ColorDictionary=r;i.promotionViewModelList()[n].SizeDictionary=u}function l(n,t){var u,f,r;if(t.AutoDeliveryPrograms()!==null){for(i.promotionViewModelList()[n].deliveryProgramOptions.removeAll(),r=0;r<i.parentPromotionList()[n].ProductDetail.DeliveryOptions().length;r++)u=i.parentPromotionList()[n].ProductDetail.DeliveryOptions()[r],(u.Value()=="-2"||u.Value()=="-1")&&i.promotionViewModelList()[n].deliveryProgramOptions.push(u);for(f=0;f<t.AutoDeliveryPrograms().length;f++)for(r=0;r<i.parentPromotionList()[n].ProductDetail.DeliveryOptions().length;r++)i.parentPromotionList()[n].ProductDetail.DeliveryOptions()[r].Value()===t.AutoDeliveryPrograms()[f].ProgramId()&&i.promotionViewModelList()[n].deliveryProgramOptions.push(i.parentPromotionList()[n].ProductDetail.DeliveryOptions()[r])}}function w(n){b("Colors",i.promotionViewModelList()[n].ColorDictionary,n);k("Sizes",i.promotionViewModelList()[n].SizeDictionary,n)}function b(n,t,r){for(var u,f=0;f<i.parentPromotionList()[r].ProductDetail.ColorSwatches().length;f++)u=i.promotionViewModelList()[r].ColorSwatches[f],i.promotionViewModelList()[r].ColorDictionary[u.Id()].AlmostGoneSkuCount===i.promotionViewModelList()[r].ColorDictionary[u.Id()].Skus.length?u.Caption(i.promotionViewModelList()[r].ColorDictionary[u.Id()].Skus[0].ColorText()+" - Almost Gone"):i.promotionViewModelList()[r].ColorDictionary[u.Id()].AvailableSkuCount===0&&i.promotionViewModelList()[r].ColorDictionary[u.Id()].AlmostGoneSkuCount===0?u.Caption(i.promotionViewModelList()[r].ColorDictionary[u.Id()].Skus[0].ColorText()+" - Sold Out"):u.Caption(i.promotionViewModelList()[r].ColorDictionary[u.Id()].Skus[0].ColorText())}function k(n,t,r){for(var u,f=0;f<i.parentPromotionList()[r].ProductDetail.Sizes().length;f++)u=i.promotionViewModelList()[r].Sizes()[f],i.promotionViewModelList()[r].SizeDictionary[u.Value()].AlmostGoneSkuCount===i.promotionViewModelList()[r].SizeDictionary[u.Value()].Skus.length?u.Text(i.promotionViewModelList()[r].SizeDictionary[u.Value()].Skus[0].SizeText()+" - Almost Gone"):i.promotionViewModelList()[r].SizeDictionary[u.Value()].AvailableSkuCount===0&&i.promotionViewModelList()[r].SizeDictionary[u.Value()].AlmostGoneSkuCount===0?u.Text(i.promotionViewModelList()[r].SizeDictionary[u.Value()].Skus[0].SizeText()+" - Sold Out"):u.Text(i.promotionViewModelList()[r].SizeDictionary[u.Value()].Skus[0].SizeText())}function d(n,t,i){switch(i.AvailabilityStatus()){case 1:n.Text(i[t+"Text"]()+" - Sold Out");break;case 4:n.Text(i[t+"Text"]()+" - Almost Gone");break;default:n.Text(i[t+"Text"]())}}function e(n,t,r){var f=r.ShippingPrice(),e,u;if(i.promotionViewModelList()!==undefined&&i.promotionViewModelList()!==null&&i.promotionViewModelList()[n]!==undefined&&i.promotionViewModelList().length>0&&r.AutoDeliveryPrograms()!==null&&r.AutoDeliveryPrograms()!==undefined&&r.AutoDeliveryPrograms().length>0&&i.promotionViewModelList()[n].selectedDeliveryOption()>0)for(e=0;e<r.AutoDeliveryPrograms().length;e++)f=r.AutoDeliveryPrograms()[e].ShippingPrice();return u=t.SHPricePerc(),t.PromotionType()==="PWP"?u!==-1&&(t.ShippingDiscountType()===1?u=f-u/100*f:t.ShippingDiscountType()!==0&&(u=f-u)):u===0&&t.PromotionType()==="GWP"&&u--,u}function o(n,t,r){var u=t.Price(),f=r.Price(),e;if(i.promotionViewModelList()!==undefined&&i.promotionViewModelList()!==null&&i.promotionViewModelList()[n]!==undefined&&i.promotionViewModelList().length>0&&r.AutoDeliveryPrograms()!==null&&r.AutoDeliveryPrograms()!==undefined&&r.AutoDeliveryPrograms().length>0)for(e=0;e<r.AutoDeliveryPrograms().length;e++)f=r.AutoDeliveryPrograms()[e].Price();return t.PromotionType()==="PWP"?u!==-1&&(t.PriceDiscountType()===1?u=f-u/100*f:t.PriceDiscountType()!==0&&(u=f-u)):u===0&&t.PromotionType()==="GWP"&&u--,u}function g(n){var r=s(n),t=0;return r===null&&i.promotionViewModelList()[n].ShippingPriceLow!==i.promotionViewModelList()[n].ShippingPriceHigh?i.promotionViewModelList()[n].ShippingPriceLow<0?"FREE SHIPPING":"$"+shopHq.pageUtils.parseMoneyToString(i.promotionViewModelList()[n].ShippingPriceLow)+" - $"+shopHq.pageUtils.parseMoneyToString(i.promotionViewModelList()[n].ShippingPriceHigh):(r!==null&&r!==undefined?t===0&&(t=i.promotionViewModelList()[n].ShippingPrice()):t=i.promotionViewModelList()[n].ShippingPriceLow,t<0)?"FREE SHIPPING":"$"+shopHq.pageUtils.parseMoneyToString(t)}function a(n,t,i,r){var u=shopHq.images.SECURE_IMAGE_PATH,e=n.lastIndexOf("/")+1,o=n.lastIndexOf("?"),f,s;if(o<e&&(o=n.indexOf("&",e)),f=n.substring(e,o),i){s=r===null||typeof r=="undefined"?0:r.AvailabilityStatus();switch(s){case 1:u+="soldout_2008_overlay_1?$product=ShopHQ/"+f+"&$"+t+"x"+t+"_jpg$&op_sharpen=1";break;case 4:u+="almostgone_2015_overlay_1?$product=ShopHQ/"+f+"&$"+t+"x"+t+"_jpg$&op_sharpen=1";break;default:u+=f+"?DefaultImage=1&$"+t+"x"+t+"_jpg$&op_sharpen=1"}}else u+=f+"?DefaultImage=1&$"+t+"x"+t+"_jpg$&op_sharpen=1";return u}function s(n){for(var r=i.promotionViewModelList()[n].SelectedSizeValue()===undefined?"00000":i.promotionViewModelList()[n].SelectedSizeValue(),u=i.promotionViewModelList()[n].SelectedColorValue()===undefined?"00000":i.promotionViewModelList()[n].SelectedColorValue(),t=0;t<i.parentPromotionList()[n].ProductDetail.Skus().length;t++)if(u===i.parentPromotionList()[n].ProductDetail.Skus()[t].ColorCode()&&(r===i.parentPromotionList()[n].ProductDetail.Skus()[t].SizeCode()||i.parentPromotionList()[n].ProductDetail.Sizes().length==="0")||i.promotionViewModelList()[n].selectedDeliveryOption()>0)return i.parentPromotionList()[n].ProductDetail.Skus()[t];return null}function nt(n){var t=s(n),r,u;if(t===null&&i.promotionViewModelList()[n].PriceLow!==i.promotionViewModelList()[n].PriceHigh)return i.promotionViewModelList()[n].PriceLow<0?"FREE":"$"+shopHq.pageUtils.parseMoneyToString(i.promotionViewModelList()[n].PriceLow)+" - $"+shopHq.pageUtils.parseMoneyToString(i.promotionViewModelList()[n].PriceHigh);if(r=0,t!==null){if(t.AutoDeliveryPrograms()!==null&&t.AutoDeliveryPrograms()!==undefined&&t.AutoDeliveryPrograms().length>0)for(u=0;u<t.AutoDeliveryPrograms().length;u++)t.AutoDeliveryPrograms()[u].ProgramId()===i.promotionViewModelList()[n].selectedDeliveryOption()&&(r=t.AutoDeliveryPrograms()[u].Price());r===0&&(r=i.promotionViewModelList()[n].DisplayPrice())}else r=i.promotionViewModelList()[n].PriceLow;return r<0?"FREE":"$"+shopHq.pageUtils.parseMoneyToString(r)}function tt(n){var t=s(n),r=0,u;if(t!==null&&t!==undefined){if(t.AutoDeliveryPrograms()!==null&&t.AutoDeliveryPrograms()!==undefined&&t.AutoDeliveryPrograms().length>0)for(u=0;u<t.AutoDeliveryPrograms().length;u++)t.AutoDeliveryPrograms()[u].ProgramId()===i.promotionViewModelList()[n].selectedDeliveryOption()&&(r=t.AutoDeliveryPrograms()[u].PaymentTerm());r===0&&(r=i.parentPromotionList()[n].ProductDetail.PaymentTerm())}else r=i.parentPromotionList()[n].ProductDetail.PaymentTerm();return r}function it(n){var t=s(n),r=0,u;if(t===null&&i.parentPromotionList()[n].ProductDetail.ValuePayPrice.Low()!==i.parentPromotionList()[n].ProductDetail.ValuePayPrice.High())return"$"+shopHq.pageUtils.parseMoneyToString(i.parentPromotionList()[n].ProductDetail.ValuePayPrice.Low())+" - $"+shopHq.pageUtils.parseMoneyToString(i.parentPromotionList()[n].ProductDetail.ValuePayPrice.High());if(t!==null&&t!==undefined){if(t.AutoDeliveryPrograms()!==null&&t.AutoDeliveryPrograms()!==undefined&&t.AutoDeliveryPrograms().length>0)for(u=0;u<t.AutoDeliveryPrograms().length;u++)t.AutoDeliveryPrograms()[u].ProgramId()===i.promotionViewModelList()[n].selectedDeliveryOption()&&(r=t.AutoDeliveryPrograms()[u].ValuePayPrice());r===0&&(r=t.ValuePayPrice())}else r=i.parentPromotionList()[n].ProductDetail.ValuePayPrice.Low();return"$"+shopHq.pageUtils.parseMoneyToString(r)}function f(n,t,i,r){for(var f=t===null?"00000":t,e=n===null?"00000":n,u=0;u<r.length;u++)if(e===r[u].ColorCode()&&(f===r[u].SizeCode()||i.length===0))return r[u];return null}function rt(n,i,r,u,f,e,o){var s=!1;if(n!=null&&u.length>0&&t.map(n.AutoDeliveryPrograms(),function(i,r){t.map(u,function(t,i){u[i].Value()===n.AutoDeliveryPrograms()[r].ProgramId()&&(s=!0)})}),n==null||u.length>0){if(e.length>0&&i==null&&o.length>0&&r==null)return"Please select color and size";if(e.length>0&&i==null)return"Please select color";if(o.length>0&&r==null)return"Please select size";if(s&&u.length>0&&parseInt(f)<-1)return"Please select a valid Subscription"}return n!=null&&n.AvailabilityStatus()!==0&&n.AvailabilityStatus()!==4?"This combination is not available":null}function ut(n,t){for(var u,f,e,r=0;r<i.promotionViewModelList()[n].Sizes().length;r++){for(u=i.promotionViewModelList()[n].Sizes()[r],f=!1,index=0;index<i.promotionViewModelList()[n].SizeDictionary[u.Value()].Skus.length;index++)e=i.promotionViewModelList()[n].SizeDictionary[u.Value()].Skus[index],e.ColorCode()===t&&(d(u,"Size",e),f=!0);f||(i.promotionViewModelList()[n].Sizes.remove(u),r--)}}function ft(){var n,t;try{for(n=0;n<i.parentPromotionList().length;n++)t={Index:n,PromoType:i.parentPromotionList()[n].PromotionType(),PromoMessage:i.parentPromotionList()[n].PromotionMessage(),Method:"LoadPromotionView"},console.log(t),jQuery(window).trigger("PromoDisplay",t)}catch(r){console.log("Data Layer - PromotionModalView"+r)}}function et(n,t){var r;try{console.log(n);console.log(t);var u=t.Sku(),f=t.Price(),e=t.ShippingPrice();u!=null&&f>0&&(r={Action:"AddToCart",Units:1,Quickbuy:!1,OfferCode:n.OfferCode(),Brand:i.parentPromotionList()[n.PromoIndex()].ProductDetail.Brand(),Category:i.parentPromotionList()[n.PromoIndex()].ProductDetail.Category(),SKU:u,Price:f,ShippingPrice:e},console.log(r),jQuery(window).trigger("dataLayerAddToCart",r))}catch(o){console.log("Data Layer - PromotionView"+o)}}function ot(n){var u=nt(n),t=g(n),f=tt(n),e=it(n),r;i.promotionViewModelList()[n].DisplayPrice(u==="$0.00"?"FREE":i.promotionViewModelList()[n].PromotionType()==="GWP"?"FREE":u);i.promotionViewModelList()[n].ShippingPrice(t==="$0.00"?"FREE SHIPPING":i.promotionViewModelList()[n].PromotionType()==="GWP"?"":t);i.promotionViewModelList()[n].OriginalPrice("$"+shopHq.pageUtils.parseMoneyToString(i.promotionViewModelList()[n].OriginalPrice()));i.promotionViewModelList()[n].OriginalShippingPrice(t!=="$0.00"?"$"+shopHq.pageUtils.parseMoneyToString(i.promotionViewModelList()[n].OriginalShippingPrice()):"");i.promotionViewModelList()[n].PaymentTermVar(f);i.promotionViewModelList()[n].PaymentTermPrice(e);r=i.promotionViewModelList()[n].DisplayPrice()!==i.promotionViewModelList()[n].OriginalPrice()&&i.promotionViewModelList()[n].ShippingPrice()!==i.promotionViewModelList()[n].OriginalShippingPrice()?"P":i.promotionViewModelList()[n].ShippingPrice()!==i.promotionViewModelList()[n].OriginalShippingPrice()?"S":"P";i.promotionViewModelList()[n].IsBMSM()?i.promotionViewModelList()[n].SavedPrice(i.promotionViewModelList()[n].PromotionType()==="GWP"?"Gift With Purchase":r==="S"?i.promotionViewModelList()[n].ShippingPrice()==="FREE SHIPPING"?"FREE SHIPPING":"Save $"+shopHq.pageUtils.parseMoneyToString(i.promotionViewModelList()[n].OriginalShippingPrice().substr(1,i.promotionViewModelList()[n].OriginalShippingPrice().length)-i.promotionViewModelList()[n].ShippingPrice().substr(1,i.promotionViewModelList()[n].ShippingPrice().length))+"  on each additional purchase of this item.":"Save $"+shopHq.pageUtils.parseMoneyToString(i.promotionViewModelList()[n].OriginalPrice().substr(1,i.promotionViewModelList()[n].OriginalPrice().length)-i.promotionViewModelList()[n].DisplayPrice().substr(1,i.promotionViewModelList()[n].DisplayPrice().length))+"  on each additional purchase of this item."):i.promotionViewModelList()[n].SavedPrice(i.promotionViewModelList()[n].PromotionType()==="GWP"?"Gift With Purchase":r==="S"?i.promotionViewModelList()[n].ShippingPrice()==="FREE SHIPPING"?"FREE SHIPPING":"Save $"+shopHq.pageUtils.parseMoneyToString(i.promotionViewModelList()[n].OriginalShippingPrice().substr(1,i.promotionViewModelList()[n].OriginalShippingPrice().length)-i.promotionViewModelList()[n].ShippingPrice().substr(1,i.promotionViewModelList()[n].ShippingPrice().length))+"  on additional purchase of this item.":"Save $"+shopHq.pageUtils.parseMoneyToString(i.promotionViewModelList()[n].OriginalPrice().substr(1,i.promotionViewModelList()[n].OriginalPrice().length)-i.promotionViewModelList()[n].DisplayPrice().substr(1,i.promotionViewModelList()[n].DisplayPrice().length))+"  on additional purchase of this item.")}var i=this,r=null,u=null,h;ko.mapping.fromJS(n,{},i);i.parentPromotionList=ko.observableArray();i.selectedParentImage=ko.observable();i.selectedParentOfferCode=ko.observable();i.promotionViewModelList=ko.observableArray(null);i.temppromotionViewModelList=ko.observableArray();i.originalList=ko.observableArray(null);i.displayMiniCart=ko.observable(!1);i.isQuickBuy=ko.observable(!1);h=function(n,r,u,s,h,c){var a=this;this.PromoIndex=ko.observable();this.SelectedImage=ko.observable(null);this.SelectedColor=ko.observable(null);this.SelectedSize=ko.observable(null);this.OfferCode=ko.observable(null);this.SetSelectedImage=ko.observable(null);this.OfferDescription=ko.observable(null);this.OriginalPrice=n;this.DiscountedPrice=r;this.SelectedColorValue=ko.observable();this.SelectedColorText=ko.observable();this.SelectedSizeValue=ko.observable();this.SelectedSizeText=ko.observable();this.selectedDeliveryOption=ko.observable(null);this.deliveryProgramOptions=ko.observableArray();this.ColorDictionary=ko.observableArray(u);this.SizeDictionary=ko.observableArray(s);this.PriceLow=h;this.PriceHigh=c;this.ShippingPriceLow=ko.observable();this.ShippingPriceHigh=ko.observable();this.DisplayPrice=ko.observable();this.PriceLabel=ko.observable();this.OriginalPrice=ko.observable();this.PaymentTermVar=ko.observable();this.PaymentTermPrice=ko.observable();this.Colors=ko.observableArray();this.Sizes=ko.observableArray();this.SkusList=ko.observableArray();this.AdditionalPhotos=ko.observableArray();this.ColorSwatches=ko.observableArray();this.learnMoreLink=ko.observable();this.OriginalShippingPrice=ko.observable();this.ShippingPrice=ko.observable();this.ShippingPricePer=ko.observable();this.SavedPrice=ko.observable();this.SkuMessage=ko.observable();this.IsAddedToCart=ko.observable("0");this.AddToCartText=ko.observable("Add Offer to Cart");this.AddToCartClass=ko.observable("active");this.ParentBasketItemId=ko.observable();this.PromotionType=ko.observable();this.IsSingleSKU=ko.observable();this.IsDisplayItem=ko.observable();this.IsBMSM=ko.observable();this.SelectADProgram=function(n){var t,u,s,h,c,r,l;if(a.selectedDeliveryOption(n.selectedDeliveryOption()),t="",n.selectedDeliveryOption()>-2){if(u=n.SelectedSizeValue(),s=n.SelectedColorValue(),u!==null||s!==null)t=f(s,u,i.parentPromotionList()[n.PromoIndex()].ProductDetail.Sizes(),i.parentPromotionList()[n.PromoIndex()].ProductDetail.Skus()),a.OriginalShippingPrice(t.ShippingPrice()!=="$0.00"?"$"+shopHq.pageUtils.parseMoneyToString(t.ShippingPrice()):""),a.OriginalPrice(t.Price()!=="$0.00"?"$"+shopHq.pageUtils.parseMoneyToString(t.Price()):""),a.ShippingPrice(e(n.PromoIndex(),i.parentPromotionList()[n.PromoIndex()],t)),a.DisplayPrice(o(n.PromoIndex(),i.parentPromotionList()[n.PromoIndex()],t));else if(t=i.parentPromotionList()[n.PromoIndex()].ProductDetail.Skus()[0],a.OriginalShippingPrice(t.ShippingPrice()!=="$0.00"?"$"+shopHq.pageUtils.parseMoneyToString(t.ShippingPrice()):""),a.OriginalPrice(t.Price()!=="$0.00"?"$"+shopHq.pageUtils.parseMoneyToString(t.Price()):""),a.ShippingPrice(e(n.PromoIndex(),i.parentPromotionList()[n.PromoIndex()],t)),a.DisplayPrice(o(n.PromoIndex(),i.parentPromotionList()[n.PromoIndex()],t)),t.AutoDeliveryPrograms()!==null&&t.AutoDeliveryPrograms()!==undefined&&t.AutoDeliveryPrograms().length>0&&n.selectedDeliveryOption()>0)for(h=0;h<t.AutoDeliveryPrograms().length;h++)c=t.AutoDeliveryPrograms()[h].ShippingPrice(),a.OriginalShippingPrice(c!=="$0.00"?"$"+shopHq.pageUtils.parseMoneyToString(c):"");if(a.ShippingPrice("$"+shopHq.pageUtils.parseMoneyToString(a.ShippingPrice())),a.DisplayPrice("$"+shopHq.pageUtils.parseMoneyToString(a.DisplayPrice())),a.PaymentTermPrice("$"+shopHq.pageUtils.parseMoneyToString(t.ValuePayPrice())),(u!==null||s!==null)&&t.AutoDeliveryPrograms()!==null&&t.AutoDeliveryPrograms()!==undefined&&t.AutoDeliveryPrograms().length>0)for(r=0;r<t.AutoDeliveryPrograms().length;r++)t.AutoDeliveryPrograms()[r].ProgramId()===n.selectedDeliveryOption()&&(a.DisplayPrice("$"+shopHq.pageUtils.parseMoneyToString(t.AutoDeliveryPrograms()[r].Price())),a.ShippingPrice("$"+shopHq.pageUtils.parseMoneyToString(t.AutoDeliveryPrograms()[r].ShippingPrice())),a.PaymentTermPrice("$"+shopHq.pageUtils.parseMoneyToString(t.AutoDeliveryPrograms()[r].ValuePayPrice())));a.DisplayPrice(a.DisplayPrice()==="$0.00"?"FREE":n.PromotionType()==="GWP"?"GIFT":a.DisplayPrice());a.ShippingPrice(a.ShippingPrice()==="$0.00"?"FREE SHIPPING":n.PromotionType()==="GWP"?"GIFT":a.ShippingPrice());l=a.DisplayPrice()!==a.OriginalPrice()&&a.ShippingPrice()!==a.OriginalShippingPrice()?"P":a.ShippingPrice()!==a.OriginalShippingPrice()?"S":"P";a.IsBMSM()?a.SavedPrice(n.PromotionType()==="GWP"?"Gift with Purchase":l==="S"?a.ShippingPrice()==="FREE SHIPPING"?"FREE SHIPPING":"Save $"+shopHq.pageUtils.parseMoneyToString(a.OriginalShippingPrice().substr(1,a.OriginalShippingPrice().length)-a.ShippingPrice().substr(1,a.ShippingPrice().length))+"  on each additional purchase of this item.":"Save $"+shopHq.pageUtils.parseMoneyToString(a.OriginalPrice().substr(1,a.OriginalPrice().length)-a.DisplayPrice().substr(1,a.DisplayPrice().length))+"  on each additional purchase of this item."):a.SavedPrice(n.PromotionType()==="GWP"?"Gift with Purchase":l==="S"?a.ShippingPrice()==="FREE SHIPPING"?"FREE SHIPPING":"Save $"+shopHq.pageUtils.parseMoneyToString(a.OriginalShippingPrice().substr(1,a.OriginalShippingPrice().length)-a.ShippingPrice().substr(1,a.ShippingPrice().length))+"  on additional purchase of this item.":"Save $"+shopHq.pageUtils.parseMoneyToString(a.OriginalPrice().substr(1,a.OriginalPrice().length)-a.DisplayPrice().substr(1,a.DisplayPrice().length))+"  on additional purchase of this item.")}};this.SelectColor=function(n){var s,t,r,u;a.SelectedColorText(n.Caption());a.SelectedColorValue(n.Id());a.SetSelectedImage(n.Url());s=f(a.SelectedColorValue(),a.SelectedSizeValue(),i.parentPromotionList()[a.PromoIndex()].ProductDetail.Sizes(),i.originalList()[a.PromoIndex()].ProductDetail.Skus());ut(a.PromoIndex(),n.Id());t=f(a.SelectedColorValue(),a.SelectedSizeValue(),i.promotionViewModelList()[a.PromoIndex()].Sizes(),i.promotionViewModelList()[a.PromoIndex()].SkusList());r=f(a.SelectedColorValue(),a.SelectedSizeValue(),i.parentPromotionList()[a.PromoIndex()].ProductDetail.Sizes(),i.originalList()[a.PromoIndex()].ProductDetail.Skus());a.OriginalShippingPrice(t.ShippingPrice()!=="$0.00"?"$"+shopHq.pageUtils.parseMoneyToString(t.ShippingPrice()):"");a.OriginalPrice(r.Price()!=="$0.00"?"$"+shopHq.pageUtils.parseMoneyToString(r.Price()):"");a.ShippingPrice(e(a.PromoIndex(),i.parentPromotionList()[a.PromoIndex()],t));a.DisplayPrice(o(a.PromoIndex(),i.parentPromotionList()[a.PromoIndex()],t));a.ShippingPrice("$"+shopHq.pageUtils.parseMoneyToString(a.ShippingPrice()));a.DisplayPrice("$"+shopHq.pageUtils.parseMoneyToString(a.DisplayPrice()));a.DisplayPrice(a.DisplayPrice()==="$0.00"?"FREE":a.PromotionType()==="GWP"?"GIFT":a.DisplayPrice());a.ShippingPrice(a.ShippingPrice()==="$0.00"?"FREE SHIPPING":a.PromotionType()==="GWP"?"GIFT":a.ShippingPrice());a.PaymentTermPrice("$"+shopHq.pageUtils.parseMoneyToString(t.ValuePayPrice()));u=a.DisplayPrice()!==a.OriginalPrice()&&a.ShippingPrice()!==a.OriginalShippingPrice()?"P":a.ShippingPrice()!==a.OriginalShippingPrice()?"S":"P";a.IsBMSM()?a.SavedPrice(a.PromotionType()==="GWP"?"Gift with Purchase":u==="S"?a.ShippingPrice()==="FREE SHIPPING"?"FREE SHIPPING":"Save $"+shopHq.pageUtils.parseMoneyToString(a.OriginalShippingPrice().substr(1,a.OriginalShippingPrice().length)-a.ShippingPrice().substr(1,a.ShippingPrice().length))+"  on each additional purchase of this item.":"Save $"+shopHq.pageUtils.parseMoneyToString(a.OriginalPrice().substr(1,a.OriginalPrice().length)-a.DisplayPrice().substr(1,a.DisplayPrice().length))+"  on each additional purchase of this item."):a.SavedPrice(a.PromotionType()==="GWP"?"Gift with Purchase":u==="S"?a.ShippingPrice()==="FREE SHIPPING"?"FREE SHIPPING":"Save $"+shopHq.pageUtils.parseMoneyToString(a.OriginalShippingPrice().substr(1,a.OriginalShippingPrice().length)-a.ShippingPrice().substr(1,a.ShippingPrice().length))+"  on additional purchase of this item.":"Save $"+shopHq.pageUtils.parseMoneyToString(a.OriginalPrice().substr(1,a.OriginalPrice().length)-a.DisplayPrice().substr(1,a.DisplayPrice().length))+"  on additional purchase of this item.");t!=null&&(t.AvailabilityStatus()!==0&&t.AvailabilityStatus()!==4?i.parentPromotionList()[a.PromoIndex()].ProductDetail.Colors().length>1&&i.parentPromotionList()[a.PromoIndex()].ProductDetail.Sizes().length>1?a.SkuMessage("This combination is not available"):a.SkuMessage("This option is not available"):a.SkuMessage(""));i.parentPromotionList()[a.PromoIndex()].ProductDetail.DeliveryOptions().length>0&&(i.promotionViewModelList()[a.PromoIndex()].deliveryProgramOptions.removeAll(),t!=null&&l(a.PromoIndex(),t))};this.SelectSize=function(n){var t,r,u;a.SelectedSizeText(n.Text());a.SelectedSizeValue(n.Value());t=f(a.SelectedColorValue(),a.SelectedSizeValue(),i.promotionViewModelList()[a.PromoIndex()].Sizes(),i.promotionViewModelList()[a.PromoIndex()].SkusList());r=f(a.SelectedColorValue(),a.SelectedSizeValue(),i.parentPromotionList()[a.PromoIndex()].ProductDetail.Sizes(),i.originalList()[a.PromoIndex()].ProductDetail.Skus());a.OriginalShippingPrice(t.ShippingPrice()!=="$0.00"?"$"+shopHq.pageUtils.parseMoneyToString(t.ShippingPrice()):"");a.OriginalPrice(r.Price()!=="$0.00"?"$"+shopHq.pageUtils.parseMoneyToString(r.Price()):"");a.ShippingPrice(e(a.PromoIndex(),i.parentPromotionList()[a.PromoIndex()],t));a.DisplayPrice(o(a.PromoIndex(),i.parentPromotionList()[a.PromoIndex()],t));a.ShippingPrice("$"+shopHq.pageUtils.parseMoneyToString(a.ShippingPrice()));a.DisplayPrice("$"+shopHq.pageUtils.parseMoneyToString(a.DisplayPrice()));a.DisplayPrice(a.DisplayPrice()==="$0.00"?"FREE":a.PromotionType()==="GWP"?"GIFT":a.DisplayPrice());a.ShippingPrice(a.ShippingPrice()==="$0.00"?"FREE SHIPPING":a.PromotionType()==="GWP"?"GIFT":a.ShippingPrice());a.PaymentTermPrice("$"+shopHq.pageUtils.parseMoneyToString(t.ValuePayPrice()));u=a.DisplayPrice()!==a.OriginalPrice()&&a.ShippingPrice()!==a.OriginalShippingPrice()?"P":a.ShippingPrice()!==a.OriginalShippingPrice()?"S":"P";a.IsBMSM()?a.SavedPrice(a.PromotionType()==="GWP"?"Gift with Purchase":u==="S"?a.ShippingPrice()==="FREE SHIPPING"?"FREE SHIPPING":"Save $"+shopHq.pageUtils.parseMoneyToString(a.OriginalShippingPrice().substr(1,a.OriginalShippingPrice().length)-a.ShippingPrice().substr(1,a.ShippingPrice().length))+"  on each additional purchase of this item.":"Save $"+shopHq.pageUtils.parseMoneyToString(a.OriginalPrice().substr(1,a.OriginalPrice().length)-a.DisplayPrice().substr(1,a.DisplayPrice().length))+"  on each additional purchase of this item."):a.SavedPrice(a.PromotionType()==="GWP"?"Gift with Purchase":u==="S"?a.ShippingPrice()==="FREE SHIPPING"?"FREE SHIPPING":"Save $"+shopHq.pageUtils.parseMoneyToString(a.OriginalShippingPrice().substr(1,a.OriginalShippingPrice().length)-a.ShippingPrice().substr(1,a.ShippingPrice().length))+"  on additional purchase of this item.":"Save $"+shopHq.pageUtils.parseMoneyToString(a.OriginalPrice().substr(1,a.OriginalPrice().length)-a.DisplayPrice().substr(1,a.DisplayPrice().length))+"  on additional purchase of this item.");t!=null&&(t.AvailabilityStatus()!==0&&t.AvailabilityStatus()!==4?i.parentPromotionList()[a.PromoIndex()].ProductDetail.Colors().length>1&&i.parentPromotionList()[a.PromoIndex()].ProductDetail.Sizes().length>1?a.SkuMessage("This combination is not available"):a.SkuMessage("This option is not available"):a.SkuMessage(""));i.parentPromotionList()[a.PromoIndex()].ProductDetail.DeliveryOptions().length>0&&(i.promotionViewModelList()[a.PromoIndex()].deliveryProgramOptions.removeAll(),t!=null&&l(a.PromoIndex(),t))};this.AddToCart=function(n){var r=f(n.SelectedColorValue(),n.SelectedSizeValue(),n.Sizes(),n.SkusList()),o=rt(r,n.SelectedColorValue(),n.SelectedSizeValue(),n.deliveryProgramOptions(),n.selectedDeliveryOption(),n.Colors,n.Sizes()),u,e;o!==null?this.SkuMessage(o):(n.SkuMessage(""),u="",n.deliveryProgramOptions().length>0&&parseInt(n.selectedDeliveryOption())>0&&(u=n.selectedDeliveryOption()),e=0,n.PaymentTermVar()>0&&n.PaymentTermVar()>1&&n.PromotionType()!="GWP"&&(e=1),url=i.isQuickBuy()?"/cart/AddItem?carttype=2&offercode="+n.OfferCode()+"&skuid="+r.Id()+"&qty=1&programId="+u+"&warrantyType=&ispromoitem=true&itemType="+n.PromotionType()+"&parentBasketItemId="+n.ParentBasketItemId()+"&paymode="+e:"/cart/AddItem?carttype=1&offercode="+n.OfferCode()+"&skuid="+r.Id()+"&qty=1&programId="+u+"&warrantyType=&ispromoitem=true&itemType="+n.PromotionType()+"&parentBasketItemId="+n.ParentBasketItemId()+"&paymode="+e,t.get(url,function(n){n!==null&&n!==undefined&&n!==""&&(n.Status=="0"||n.Status=="4"||n.Status=="6"||n.Status=="3")&&(a.IsAddedToCart("1"),a.AddToCartText(a.IsAddedToCart()?"Item Added":"Add Offer to Cart"),a.AddToCartClass(a.IsAddedToCart()?"disabled":"active"),y())}),r!==null&&et(n,r))}};i.load=function(n,r){var d,u,f,y,s,l,nt;for(r!==null&&(d={},ko.mapping.fromJS(r.Promotions,d,i.parentPromotionList)),i.promotionViewModelList.removeAll(),i.temppromotionViewModelList.removeAll(),i.originalList.removeAll(),u=0;u<i.parentPromotionList().length;u++){if(f=new h,i.parentPromotionList()[u].ProductDetail.AdditionalPhotos().length>0&&(f.SetSelectedImage(a(i.parentPromotionList()[u].ProductDetail.AdditionalPhotos()[0].Url(),40,!1,i.parentPromotionList()[u].ProductDetail.Skus()[0])),i.parentPromotionList()[u].ProductDetail.ColorSwatches().map(function(n,t){i.parentPromotionList()[u].ProductDetail.ColorSwatches()[t].Url(a(i.parentPromotionList()[u].ProductDetail.ColorSwatches()[t].Url(),40,!1,i.parentPromotionList()[u].ProductDetail.Skus()[t]))})),f.PromoIndex(u),f.ParentBasketItemId(n),f.PromotionType(i.parentPromotionList()[u].PromotionType()),f.IsSingleSKU(i.parentPromotionList()[u].IsSingleSKU()),f.IsDisplayItem(!(f.PromotionType()==="GWP"&&f.IsSingleSKU())),f.IsBMSM(i.parentPromotionList()[u].IsBMSM()),f.OfferDescription(i.parentPromotionList()[u].ProductDetail.Title()),f.OfferCode(i.parentPromotionList()[u].ProductDetail.OfferCode()),f.DiscountedPrice="",f.OriginalPrice(""),f.SelectedColorText(null),f.SelectedColorValue(null),f.SelectedSizeValue(null),f.SelectedSizeText(null),f.DisplayPrice(""),f.PriceLabel(f.PromotionType()==="GWP"?"Your Price ":i.parentPromotionList()[u].Price()!==0?"Your Price: ":i.parentPromotionList()[u].ProductDetail.PriceLabel()),f.Colors=i.parentPromotionList()[u].ProductDetail.Colors(),f.AdditionalPhotos=i.parentPromotionList()[u].ProductDetail.AdditionalPhotos(),f.ColorSwatches=i.parentPromotionList()[u].ProductDetail.ColorSwatches(),f.Sizes(i.parentPromotionList()[u].ProductDetail.Sizes()),f.SkusList(i.parentPromotionList()[u].ProductDetail.Skus()),f.learnMoreLink="/Product/"+v(i.parentPromotionList()[u].ProductDetail.Title())+"/"+i.parentPromotionList()[u].ProductDetail.OfferCode()+"?track=-10102&ciid=11281",i.originalList.push(i.parentPromotionList()[u]),y=[],i.parentPromotionList().length>0){var c=0,b=0,g=0,k=0;for(s=0;s<i.parentPromotionList()[u].ProductDetail.Skus().length;s++)c=o(u,i.parentPromotionList()[u],i.parentPromotionList()[u].ProductDetail.Skus()[s]),b=e(u,i.parentPromotionList()[u],i.parentPromotionList()[u].ProductDetail.Skus()[s]),k=i.parentPromotionList()[u].ProductDetail.Skus()[s].Price(),g=i.parentPromotionList()[u].ProductDetail.Skus()[s].ShippingPrice(),y[s]=k,i.parentPromotionList()[u].ProductDetail.Skus()[s].Price(c);f.PriceLow=c;f.PriceHigh=c;f.ShippingPriceLow=b;f.ShippingPriceHigh=b;f.OriginalPrice(k);f.OriginalShippingPrice(g)}i.promotionViewModelList.push(f);l=u;ot(l);i.temppromotionViewModelList.push(f);p(l);w(l);i.promotionViewModelList.removeAll();i.temppromotionViewModelList().map(function(n){i.promotionViewModelList.push(n)});y.map(function(n,t){i.originalList()[u].ProductDetail.Skus()[t].Price(n)})}ft();nt=t("#promotion-quick-view-dialog");t("#quick-view-product-notfound").hide();nt.show();t("#PromotionQuickViewModal").modal("show");t("body").addClass("modal-open")};i.close=function(){c()};i.continueCheckout=function(){c()}},t(document).ready(function(){ko.applyBindings(n.viewModel,document.getElementById("PromotionQuickViewModal"))}),n})(shopHq.promotionview=shopHq.promotionview||{},jQuery),function(n,t){return n.enableMiniCart=null,n.miniCartPosition=null,n.close=function(){t(".js-mini-cart-body").dialog("close")},n.updateProtectionPlan=function(n,i,r){t(i).prop("checked")?(t("#dvWarranty-"+n+" .warranty-checkbox").prop("checked",!1),t(i).prop("checked",!0)):r="";t.ajax({async:!1,dataType:"json",type:"GET",url:"/cart/UpdateSppFromMiniCart/?basketitemid="+n+"&warrantyType="+encodeURIComponent(r)}).done(function(i){i!=""&&(i.ProductTotal=="$0.00"?this.goToCart():(t(".js-mini-cart-body").find("#minicart-subtotal-"+n).html(i.ProductTotal),t(".js-mini-cart-body").find("#minicart-order-total").html(i.OrderTotal)))}).fail(function(n,t,i){console&&console.log(i)}).always(function(){})},n.displayMiniCart=function(n){t("#spinner-overlay").spin();t.ajax({url:n,type:"GET",cache:!1}).done(function(n){t(".js-mini-cart-body").html(n);t(".js-mini-cart-body").show();t(".js-mini-cart").modal("show")}).fail(function(n,t,i){console&&console.log(i)}).always(function(){t("#spinner-overlay").spin(!1);isSubmitted=!1})},n.updateCartItemsInGlobalNav=function(n){n===1?(t("#cart-items-count").html(n),t("#cart-items-count:contains('item')").html(n+" item")):(t("#cart-items-count").html(n),t("#cart-items-count:contains('item')").html(n+" items"));t("#mobile-cart-quantity").html(n);n>0?t("#mobile-cart-quantity").show():t("#mobile-cart-quantity").hide()},n.goToCart=function(){document.location.href="//"+document.location.host+"/Checkout/"},n}(shopHq.minicart=shopHq.minicart||{},jQuery)