function updatePrice(){window.updatePriceTimeout&&clearTimeout(window.updatePriceTimeout);window.updatePriceTimeout=setTimeout(updatePriceBase,500)}function updatePriceBase(){UpdatePriceMain.prototype.updatePriceBase()}function getTotalPrice(){return UpdatePriceMain.functions.getTotalPrice()}function getFirstPaymentPrice(){return UpdatePriceMain.prototype.getFirstPaymentPrice()}function toFixed(n,t){var t=t||0,r=n<0,i=Math.pow(10,t),n=Math.round(n*i),u=String((r?Math.ceil:Math.floor)(n/i)),f=String((r?-n:n)%i),e=new Array(Math.max(t-f.length,0)+1).join("0");return t?u+"."+e+f:u}var _localization=typeof ___localization=="undefined"?defaultLocalization:___localization,UpdatePriceMain=UpdatePriceMain||{tableTemplateToRender:"",options:{allowEditCart:!1,showItems:!1,showPriceInstallments:!1,checkoutSkin:null,addTotalMargin:!0,negativeSign:"&minus;",negativeDiscount:!1,excludeCheckoutSkinList:["SkinWithBanner"],overrideTableTemplate:!1,storeOrderPrices:!0,storeOfferRowData:!1,storePromoCode:!1,storeTableSummary:!1,storeInvoiceAdditionalFee:!1,storePriceInstallments:!1,storeTfBankPayments:!1,includeShippingInOfferTotal:!0,showFreeShippingText:!1,showOriginalPrice:!1,templateOfferPath:"/Templates/UpdatePriceTemplates/updatePriceTemplateOffer.html",templateOfferEditPath:"/Templates/UpdatePriceTemplates/updatePriceTemplateOfferEdit.html"},dataKeys:{orderPricesKey:"checkout.orderprices",offerRowKey:"offer.row",promoCodeKey:"promo.code",tableSummaryKey:"prices.table.summary",invoiceAdditionalFeeKey:"invoice.additional.fee",priceInstallmentsKey:"price.installments",tfBankPaymentsKey:"tf.bank.payments"},callbacks:{getTfBankPaymentsAmountCallback:null},localization:{mesSinglePayInfo:_localization.Script.MessageSinglePayInfo,mesMultiPayInfo:_localization.Script.MessageMultiPayInfo,mesQuantity:_localization.ThankYouPage.Qty,mesDescription:_localization.ThankYouPage.ItemDescription,mesPrice:_localization.ThankYouPage.Price,mesShippingAndProcessing:_localization.ThankYouPage["{0}"],mesTotal2:_localization.ThankYouPage.Total2,mesPromoCode:_localization.ThankYouPage.PromoCode+":",mesTotalCost:_localization.Script.TotalCost,mesMonths:_localization.Checkout.Months,mesDiscount:_localization.Checkout.Discount},elementSelectors:{checkoutSkin:"#CheckoutSkin",currencySign:"#currencySign",currencyType:"#currencyType",shippingStateId:"#ShippingStateId",shippingStateIdFirstOption:"#ShippingStateId option:first",shippingAddress1:"#ShippingAddress1",shippingAddress2:"#ShippingAddress2",shippingCity:"#ShippingCity",shippingZip:"#ShippingZip",shippingEmail:"#ShippingEmail",billingEmail:"#BillingEmail",promoCode:"#PromoCode",alternativePaymentMethod:"#AlternativePaymentMethod",shippingAndProcessing:"#SP",cartDescriptionPayment:".js-cart-descriptionPayment",checkoutTableTotalFirst:".chekout-table-total:first",checkoutTableTotalFirstBody:".chekout-table-total:first tbody",promo:".promo",thankTotalFirst:".thank-total:first",itemField:".item-field-{0}",cartInfoSubtotal:".js-cart-info-subtotal",cartInfoShipping:".js-cart-info-shipping",cartInfoTax:".js-cart-info-tax",cartAdditionalFee:".js-cart-additional-fee",additionalFee:".additionalFee",todaysPayment:".todaysPayment",installments:".instalments",cartTodaysPayment:".js-cart-todaysPayment",cartInfoTotal:".js-cart-info-total",cartFirstPayment:".js-cart-firstPayment",cartInfoTotalDisclaimer:".js-cart-info-total-disclaimer",cartDiscount:".js-cart-info-discount",firstPayment:".firstPayment",summaryPriceTotal:".summary-price-table .total",cartMultiPayment:".js-cart-multiPayment",cartCountPayment:".js-cart-countPayment",subTotal:"tr.subtotal",orderAdditionalData:"#OrderAdditionalData_TvinsPaymentTerms:visible",showItems:"#showitems",showPriceInstallments:"#showPriceInstallments",allowEditCart:"#allowEditCart",cartDiscountWrap:".js-cart-info-discount-wrap",promoCodeName:null,showFreeShippingText:"#showFreeShippingText",showOriginalPrice:"#showOriginalPrice",cardBin:"#CreditCardBin",cartInfoTransactionFee:".js-cart-info-transaction-fee",transactionFee:".transactionFee",calculateCardTransactionFee:"#calculateCardTransactionFee",billingZip:"#BillingZip",billingStateId:"#BillingStateId",cardType:"#CreditCardType",cardFundingType:"#CreditCardFundingType"},objects:{labelData:function(n,t,i,r,u,f,e,o){return{labelQty:n,labelDescription:t,labelPrice:i,labelShippingPrice:r,labelTotalPrice:u,labelPromo:f,labelDiscount:e,labelOriginalPrice:o}},offerData:function(n,t,i,r,u,f,e,o,s,h,c,l,a,v,y,p,w){return{labels:e,qty:t,description:i,price:r,shippingPrice:u,totalPrice:f,mobileUpDownBtns:UpdatePriceMain.options.allowEditCart?EditCartOffersMain.functions.getUpDownBtnsTemplate(n,!0,t):"",desktopUpDownBtns:UpdatePriceMain.options.allowEditCart?EditCartOffersMain.functions.getUpDownBtnsTemplate(n,!1,t):"",removeBtn:UpdatePriceMain.options.allowEditCart?EditCartOffersMain.functions.getRemoveBtnTemplate(n):"",offerThumbnailUrl:o,descriptionText:s,shortDescriptionText:h,isEditableOfferQuantity:UpdatePriceMain.options.allowEditCart&&EditCartOffersMain.functions.isEditableOfferQuantity(n),isRemovebleOffer:UpdatePriceMain.options.allowEditCart&&EditCartOffersMain.functions.isRemovebleOffer(n),offerId:n,offerDetailedDescription:c,offerPrice:l,isOfferShippingPriceExists:!UpdatePriceMain.functions.isZero(a),offerShippingPrice:a,isUpsellOffer:v,isDiscountExists:!UpdatePriceMain.functions.isZero(y)||w,discountPrice:UpdatePriceMain.functions.setNegativeDiscount(y),originalPrice:p}},offerThumbnailData:function(n,t){return{thumbnailUrl:n,description:t}},promoData:function(n,t){return{promoLabel:n,promoCode:t}},installmentData:function(n,t){return{number:n,amount:t}},selectItemData:function(n,t){return{id:n,value:t}}},templates:{offerDescriptionTemplate:'<div class="offer-thumbnail">                    <div class="offer-thumbnail-cell">                        <img src="{{thumbnailUrl}}" alt="" class="ch-thumbnail" />                    <\/div>                    <div class="offer-thumbnail-cell ch-thumbnail-text">{{description}}<\/div>                <\/div>',promoCodeTemplate:'<tr class="promo">                    <td>{{promoLabel}}<\/td>                    <td>{{promoCode}}<\/td>                <\/tr>',installmentsTemplate:'{{#installments}}                <tr class="instalments">                    <td>'+_localization.Checkout.Installment+" {{number}}:<\/td>                    <td>{{{amount}}}<\/td>                <\/tr>                {{/installments}}",subscriptionTemplate:'<tr class="instalments">                    <td>'+_localization.Checkout.Subscription+":<\/td>                    <td>{{{amount}}}<\/td>                <\/tr>",selectTemplate:'{{#select}}<option value="{{id}}">{{value}}<\/option>{{/select}}'},prototype:{getPageOffers:function(){var n=[];return $("input.___pageOfferQuantity").filter(function(){return $(this).val()!=="0"}).each(function(){n.push({Id:$(this).data("offer-id"),Quantity:$(this).val()})}),n},getCartOffers:function(){var n=[];return $("input.___cartOfferQuantity").each(function(){n.push({Id:$(this).data("offer-id"),Quantity:$(this).val()})}),n},constructData:function(n,t,i){var r={orderId:___orderId,address1:$(UpdatePriceMain.elementSelectors.shippingAddress1).val(),address2:$(UpdatePriceMain.elementSelectors.shippingAddress2).val(),city:$(UpdatePriceMain.elementSelectors.shippingCity).val(),stateId:$(UpdatePriceMain.elementSelectors.shippingStateId).val(),zipCode:$(UpdatePriceMain.elementSelectors.shippingZip).val(),productId:___productId,contentVerisonId:___contentVersionId,stringOffers:JSON.stringify(n),code:$(UpdatePriceMain.elementSelectors.promoCode).length===0?"":$(UpdatePriceMain.elementSelectors.promoCode).val(),step:___step,altPaymentMethod:$(UpdatePriceMain.elementSelectors.alternativePaymentMethod).val(),cardBin:$(UpdatePriceMain.elementSelectors.cardBin).val(),billingZip:$(UpdatePriceMain.elementSelectors.billingZip).val(),billingStateId:$(UpdatePriceMain.elementSelectors.billingStateId).val(),cardType:$(UpdatePriceMain.elementSelectors.cardType).val(),cardFundingType:$(UpdatePriceMain.elementSelectors.cardFundingType).val(),shippingEmail:$(UpdatePriceMain.elementSelectors.shippingEmail).val(),billingEmail:$(UpdatePriceMain.elementSelectors.billingEmail).val()};return i&&UpdatePriceMain.options.allowEditCart&&(r.stringCartOffers=t?JSON.stringify(t):null,r.allowEditCart=UpdatePriceMain.options.allowEditCart),r},getTotalPrice:function(){var t=UpdatePriceMain.prototype.getPageOffers(),i=UpdatePriceMain.prototype.getCartOffers(),n=0;return window.getTotalPriceXhr&&window.getTotalPriceXhr!==4&&window.getTotalPriceXhr.abort(),window.getTotalPriceXhr=$.ajax({type:"POST",url:"/data/CalculateTaxAndSurcharge",async:!1,data:UpdatePriceMain.prototype.constructData(t,i,!0),success:function(t){n=t.Total}}),n},getFirstPaymentPrice:function(){var t=UpdatePriceMain.prototype.getPageOffers(),i=UpdatePriceMain.prototype.getCartOffers(),n=0;return window.getFirstPaymentXhr&&window.getFirstPaymentXhr!==4&&window.getFirstPaymentXhr.abort(),window.getFirstPaymentXhr=$.ajax({type:"POST",url:"/data/CalculateTaxAndSurcharge",async:!1,data:UpdatePriceMain.prototype.constructData(t,i,!0),success:function(t){n=t.FirstPayment}}),n},updatePriceBase:function(){var n=UpdatePriceMain.prototype.getPageOffers(),t=UpdatePriceMain.prototype.getCartOffers(),i=$(UpdatePriceMain.elementSelectors.currencySign).val(),r=$(UpdatePriceMain.elementSelectors.currencyType).val();$(UpdatePriceMain.elementSelectors.shippingStateId).length&&((window.updatePriceXhr&&window.updatePriceXhr!==4||window.updatePriceXhr&&!UpdatePriceMain.options.overrideTableTemplate&&window.getTemplateXhr&&window.getTemplateXhr!==4)&&window.updatePriceXhr.abort(),window.updatePriceXhr=$.ajax({type:"POST",url:"/data/CalculateTaxAndSurcharge",data:UpdatePriceMain.prototype.constructData(n,t,!0),success:function(n){var e;UpdatePriceMain.triggers.triggerCustomCheckoutEvent(CheckoutMain.eventslist.ORDER_PRICES_UPDATED,UpdatePriceMain.options.storeOrderPrices,UpdatePriceMain.dataKeys.orderPricesKey,n);var t=n.PaymentPlan.PlanPayments.length===1,i=n.PaymentPlan.PlanPayments,u=n.PaymentPlan.PlanPayments.length-1,f=$(UpdatePriceMain.elementSelectors.cartDescriptionPayment),o=[UpdatePriceMain.localization.mesSinglePayInfo,UpdatePriceMain.localization.mesMultiPayInfo.format(r)];f.length&&f.html(o[t?0:1]);e=UpdatePriceMain.updatePriceBaseFunctions.getPaymentPlansText(t,i);UpdatePriceMain.updatePriceBaseFunctions.renderItems(n);UpdatePriceMain.updatePriceBaseFunctions.renderTableSummary(n.SubTotal,n.Shipping,n.Tax,n.FirstPayment,n.Total,n.Discount,n.TransactionFee);UpdatePriceMain.updatePriceBaseFunctions.toggleInvoiceAdditionalFee(n.InvoiceAdditionalFee);UpdatePriceMain.updatePriceBaseFunctions.togglePriceInstallments(n.FirstPayment,u,i,n.PaymentPlan.IsContinuitySubscription);UpdatePriceMain.updatePriceBaseFunctions.togglePriceTableSummary(n.FirstPayment,n.Total);UpdatePriceMain.updatePriceBaseFunctions.showPaymentPlans(e,u);UpdatePriceMain.updatePriceBaseFunctions.removeSubtotal();UpdatePriceMain.updatePriceBaseFunctions.getTfBankPaymentsAmount(n,UpdatePriceMain.callbacks.getTfBankPaymentsAmountCallback);UpdatePriceMain.triggers.triggerCustomCheckoutEvent(CheckoutMain.eventslist.PRICE_CALCULATION_TABLE_RENDERED)},error:function(){$(UpdatePriceMain.elementSelectors.cartInfoTax).html(i+"0.00")}}))},getCheckoutSkin:function(){var n=$(UpdatePriceMain.elementSelectors.checkoutSkin);return n.length&&n.val()?n.val():null},isCheckoutSkinInExcludeList:function(){return UpdatePriceMain.options.excludeCheckoutSkinList.indexOf(UpdatePriceMain.options.checkoutSkin)>=0},getTemplatePath:function(){return UpdatePriceMain.options.allowEditCart?UpdatePriceMain.options.templateOfferEditPath:UpdatePriceMain.options.templateOfferPath}},updatePriceBaseFunctions:{getPaymentPlansText:function(n,t){var u="",f=$(UpdatePriceMain.elementSelectors.currencySign).val(),r,i;if(!n){for(r=[],i=0;i<t.length;i++)i!==0&&r.push(f+toFixed(parseFloat(t[i].PaymentAmount),2));u=r.join(", ")}return u},renderItems:function(n){var i,u,t;if(UpdatePriceMain.options.showItems){UpdatePriceMain.updatePriceBaseFunctions.removeOldTable();i=$(UpdatePriceMain.elementSelectors.shippingAndProcessing).val();(i==undefined||i==="")&&(i="PH");var o=i+"2",f=n.PromoCodeType!=null&&[1,2,4,5].indexOf(n.PromoCodeType)>=0,r=UpdatePriceMain.objects.labelData(UpdatePriceMain.localization.mesQuantity,UpdatePriceMain.localization.mesDescription,f&&UpdatePriceMain.options.showOriginalPrice?_localization.Script.YourPrice:UpdatePriceMain.localization.mesPrice,_localization.ThankYouPage[o],UpdatePriceMain.localization.mesTotal2,UpdatePriceMain.localization.mesPromoCode,UpdatePriceMain.localization.mesDiscount,_localization.Script.OriginalPrice),e={labels:r,offers:[],showOriginalPrice:UpdatePriceMain.options.showOriginalPrice&&(f||n.Items.some(function(n){return n.IsOriginalPriceEntered}))};for(t=0;t<n.Items.length;t++)u=UpdatePriceMain.updatePriceBaseFunctions.GetOfferDataItem(n.Items[t],r),e.offers.push(u),UpdatePriceMain.triggers.triggerCustomCheckoutEvent(CheckoutMain.eventslist.OFFER_ROW_CONSTRUCTED,UpdatePriceMain.options.storeOfferRowData,UpdatePriceMain.dataKeys.offerRowKey,u);if(UpdatePriceMain.updatePriceBaseFunctions.addPromo(r.promo,n.PromoCode),UpdatePriceMain.updatePriceBaseFunctions.insertTemplateAndChangeStyle(Mustache.render(UpdatePriceMain.tableTemplateToRender,e)),UpdatePriceMain.options.allowEditCart){for(EditCartOffersMain.prototype.initButtonEvents(),t=0;t<n.Items.length;t++)EditCartOffersMain.prototype.toggleOfferQtyButtons(n.Items[t].OriginalOfferId||n.Items[t].OfferId),EditCartOffersMain.isFirstLoad&&(EditCartOffersMain.prototype.setAttachedCartOfferQuantity(n.Items[t].OfferId,n.Items[t].Quantity),EditCartOffersMain.prototype.setBonusCartOfferQuantity(n.Items[t].OfferId,n.Items[t].Quantity));UpdatePriceMain.triggers.triggerCustomCheckoutEvent(CheckoutMain.eventslist.CART_INIT_COMPLETE)}}},removeOldTable:function(){var n=UpdatePriceMain.options.checkoutSkin==="SkinWithBanner"?"10":"30";$(UpdatePriceMain.elementSelectors.checkoutTableTotalFirst).prev().remove();UpdatePriceMain.options.addTotalMargin&&$(UpdatePriceMain.elementSelectors.checkoutTableTotalFirst).css("margin-top",n+"px")},GetOfferDataItem:function(n,t){var i=UpdatePriceMain.options.showPriceInstallments?CheckoutMain.functions.numberToCurrencyCulture(n.Price):n.FirstPaymentPrice,r=UpdatePriceMain.options.showPriceInstallments?CheckoutMain.functions.numberToCurrencyCulture(n.OriginalPrice):CheckoutMain.functions.numberToCurrencyCulture(n.OriginalFirstPaymentPrice),u=UpdatePriceMain.updatePriceBaseFunctions.getItemTotalPrice(n),f=UpdatePriceMain.objects.offerThumbnailData(n.OfferThumbnailUrl,n.Description),e=$.trim(n.OfferThumbnailUrl).length?Mustache.render(UpdatePriceMain.templates.offerDescriptionTemplate,f):"",o=UpdatePriceMain.functions.isZero(n.ShippingPrice)&&UpdatePriceMain.options.showFreeShippingText?_localization.Script.FreeShipping:n.ShippingPrice;return UpdatePriceMain.objects.offerData(n.OriginalOfferId||n.OfferId,n.Quantity,$.trim(n.OfferThumbnailUrl).length?e:n.Description,i,o,u,t,n.OfferThumbnailUrl,n.Description,n.ShortDescription,n.OfferDescription,n.OfferPrice,n.OfferShippingPrice,n.IsUpsellOffer,n.DiscountPrice,r,n.IsOriginalPriceEntered)},getItemTotalPrice:function(n){return UpdatePriceMain.options.includeShippingInOfferTotal?UpdatePriceMain.options.showPriceInstallments?n.FullTotal:n.TotalPrice:UpdatePriceMain.options.showPriceInstallments?n.FullTotalWithoutShipping:n.TotalPriceWithoutShipping},addPromo:function(n,t){if($(UpdatePriceMain.elementSelectors.promo).remove(),t!=null){var r=UpdatePriceMain.objects.promoData(n,t),i=Mustache.render(UpdatePriceMain.templates.promoCodeTemplate,r);UpdatePriceMain.elementSelectors.promoCodeName!=null?$(UpdatePriceMain.elementSelectors.promoCodeName).prepend(i):$(UpdatePriceMain.elementSelectors.checkoutTableTotalFirstBody).prepend(i);UpdatePriceMain.triggers.triggerCustomCheckoutEvent(CheckoutMain.eventslist.PROMO_CODE_RENDERED,UpdatePriceMain.options.storePromoCode,UpdatePriceMain.dataKeys.promoCodeKey,t)}},insertTemplateAndChangeStyle:function(n){$(UpdatePriceMain.elementSelectors.checkoutTableTotalFirst).before(n);$(UpdatePriceMain.elementSelectors.thankTotalFirst).css("border-spacing","0");$(UpdatePriceMain.elementSelectors.itemField.format(1)).slice(2).css("border-top","0");$(UpdatePriceMain.elementSelectors.itemField.format(2)).slice(2).css("border-top","0");for(var t=2;t<=7;t++)t!=6&&($(UpdatePriceMain.elementSelectors.itemField.format(t)).css("border-left","0"),t>2&&$(UpdatePriceMain.elementSelectors.itemField.format(t)).slice(3).css("border-top","0"))},renderTableSummary:function(n,t,i,r,u,f,e){var o={subtotal:n,shipping:t,tax:i,firstPayment:r,total:u,discount:f,transactionFee:e};$(UpdatePriceMain.elementSelectors.cartInfoSubtotal).html(CheckoutMain.functions.numberToCurrencyCulture(n));$(UpdatePriceMain.elementSelectors.cartInfoShipping).html(CheckoutMain.functions.numberToCurrencyCulture(t));$(UpdatePriceMain.elementSelectors.cartInfoTax).html(CheckoutMain.functions.numberToCurrencyCulture(i));$(UpdatePriceMain.elementSelectors.cartInfoTotal).html(CheckoutMain.functions.numberToCurrencyCulture(u));$(UpdatePriceMain.elementSelectors.cartFirstPayment).html(CheckoutMain.functions.numberToCurrencyCulture(r));$(UpdatePriceMain.elementSelectors.cartInfoTotalDisclaimer).html(UpdatePriceMain.localization.mesTotalCost+" "+CheckoutMain.functions.numberToCurrencyCulture(u));$(UpdatePriceMain.elementSelectors.cartDiscount).html(UpdatePriceMain.functions.setNegativeDiscount(CheckoutMain.functions.numberToCurrencyCulture(f)));UpdatePriceMain.functions.hideOrShowDiscount(f);typeof e!="undefined"&&e!==null?($(UpdatePriceMain.elementSelectors.cartInfoTransactionFee).html(CheckoutMain.functions.numberToCurrencyCulture(e)),$(UpdatePriceMain.elementSelectors.transactionFee).show(),UpdatePriceMain.functions.addTransactionFeeTooltip()):UpdatePriceMain.options.calculateCardTransactionFee&&CheckoutMain.paymentMethods.isCreditCardChosen()?($(UpdatePriceMain.elementSelectors.cartInfoTransactionFee).html(CheckoutMain.functions.numberToCurrencyCulture(0)),$(UpdatePriceMain.elementSelectors.transactionFee).show()):$(UpdatePriceMain.elementSelectors.transactionFee).hide();UpdatePriceMain.triggers.triggerCustomCheckoutEvent(CheckoutMain.eventslist.PRICE_TABLE_SUMMARY_RENDERED,UpdatePriceMain.options.storeTableSummary,UpdatePriceMain.dataKeys.tableSummaryKey,o)},toggleInvoiceAdditionalFee:function(n){n?($(UpdatePriceMain.elementSelectors.cartAdditionalFee).html(CheckoutMain.functions.numberToCurrencyCulture(n)),$(UpdatePriceMain.elementSelectors.additionalFee).show(),UpdatePriceMain.triggers.triggerCustomCheckoutEvent(CheckoutMain.eventslist.INVOICE_ADDITIONAL_FEE_RENDERED,UpdatePriceMain.options.storeInvoiceAdditionalFee,UpdatePriceMain.dataKeys.invoiceAdditionalFeeKey,n)):$(UpdatePriceMain.elementSelectors.additionalFee).hide()},togglePriceInstallments:function(n,t,i,r){var u,f,e;if(UpdatePriceMain.options.showPriceInstallments){for($(UpdatePriceMain.elementSelectors.cartTodaysPayment).html(CheckoutMain.functions.numberToCurrencyCulture(n)),u={installments:[]},f=1;f<=t;f++)u.installments.push(UpdatePriceMain.objects.installmentData(f,CheckoutMain.functions.numberToCurrencyCulture(i[f].PaymentAmount)));e="";e=typeof r!="undefined"&&r===!0&&u.installments.length?Mustache.render(UpdatePriceMain.templates.subscriptionTemplate,{amount:u.installments[0].amount}):Mustache.render(UpdatePriceMain.templates.installmentsTemplate,u);$(UpdatePriceMain.elementSelectors.todaysPayment).show();$(UpdatePriceMain.elementSelectors.installments).remove();$(UpdatePriceMain.elementSelectors.todaysPayment).after(e);t&&UpdatePriceMain.triggers.triggerCustomCheckoutEvent(CheckoutMain.eventslist.PRICE_INSTALLMENTS_RENDERED,UpdatePriceMain.options.storePriceInstallments,UpdatePriceMain.dataKeys.priceInstallmentsKey,u.installments)}},togglePriceTableSummary:function(n,t){Math.abs(n-t)>.01&!UpdatePriceMain.options.showPriceInstallments?($(UpdatePriceMain.elementSelectors.firstPayment).css("display",""),$(UpdatePriceMain.elementSelectors.summaryPriceTotal).hide()):($(UpdatePriceMain.elementSelectors.firstPayment).css("display","none"),$(UpdatePriceMain.elementSelectors.summaryPriceTotal).show(),$(UpdatePriceMain.elementSelectors.cartInfoTotalDisclaimer).html(""))},showPaymentPlans:function(n,t){$(UpdatePriceMain.elementSelectors.cartMultiPayment).html(n);$(UpdatePriceMain.elementSelectors.cartCountPayment).html(t===0?"":t);t&&UpdatePriceMain.triggers.triggerCustomCheckoutEvent(CheckoutMain.eventslist.PAYMENT_PLANS_RENDERED)},removeSubtotal:function(){var n=CheckoutMain.options.showSubtotal===undefined?!0:CheckoutMain.options.showSubtotal;n||$(UpdatePriceMain.elementSelectors.subTotal).remove()},getTfBankPaymentsAmount:function(n,t){var i=$(UpdatePriceMain.elementSelectors.orderAdditionalData),r;i.length&&(r=i.val(),$.ajax({type:"GET",url:"/data/GetTfBankPaymentsAmount",data:{orderId:___orderId,totalAmount:n.Total},success:function(n){var o,f,s,u,h,e,c,l;for(t&&$.isFunction(t)&&t(n),o=0,u=0;u<n.length;u++)n[u].PaymentAmount&&o++;if(o){for(f=[12,24,36],s={select:[]},u=0;u<f.length;u++){for(e=0;e<n.length;e++)if(n[e].NumberOfPayments===f[u]){h=n[e];break}c=CheckoutMain.options.thaneUIPartialPaymentItemChange?"{0} {1}, {2} / {3}".format(f[u],UpdatePriceMain.localization.mesMonths,CheckoutMain.functions.numberToCurrencyCulture(h.PaymentAmount),UpdatePriceMain.localization.mesMonths):"{0} {1}".format(f[u],UpdatePriceMain.localization.mesMonths);s.select.push(UpdatePriceMain.objects.selectItemData(f[u],c))}$("option",i).remove();l=Mustache.render(UpdatePriceMain.templates.selectTemplate,s);i.append(l).val(r?r:f[0]);UpdatePriceMain.triggers.triggerCustomCheckoutEvent(CheckoutMain.eventslist.TF_BANK_PAYMENTS_RENDERED,UpdatePriceMain.options.storeTfBankPayments,UpdatePriceMain.dataKeys.tfBankPaymentsKey,n)}},error:function(){}}))}},functions:{getTotalPrice:function(){return UpdatePriceMain.prototype.getTotalPrice()},Init:function(){UpdatePriceMain.events.Init()},hideOrShowDiscount:function(n){n>0?$(UpdatePriceMain.elementSelectors.cartDiscountWrap).show():$(UpdatePriceMain.elementSelectors.cartDiscountWrap).hide()},isZero:function(n){return n?parseFloat(n.replace(/[^0-9\.]/ig,""))===0:!1},setNegativeDiscount:function(n){return UpdatePriceMain.options.negativeDiscount?"{0} {1}".format(UpdatePriceMain.options.negativeSign,n):n},addTransactionFeeTooltip:function(){$(".transactionFee").is(":visible")||$("js-cart-info-transaction-fee-desc .mobile-title").remove()}},events:{Init:function(){var t,n;if(UpdatePriceMain.options.allowEditCart=$(UpdatePriceMain.elementSelectors.allowEditCart).length>0,UpdatePriceMain.options.showItems=$(UpdatePriceMain.elementSelectors.showItems).length>0,UpdatePriceMain.options.showPriceInstallments=$(UpdatePriceMain.elementSelectors.showPriceInstallments).length>0,UpdatePriceMain.options.checkoutSkin=UpdatePriceMain.prototype.getCheckoutSkin(),UpdatePriceMain.options.showFreeShippingText=$(UpdatePriceMain.elementSelectors.showFreeShippingText).length>0,UpdatePriceMain.options.showOriginalPrice=$(UpdatePriceMain.elementSelectors.showOriginalPrice).length>0,UpdatePriceMain.options.calculateCardTransactionFee=$(UpdatePriceMain.elementSelectors.calculateCardTransactionFee).length>0,UpdatePriceMain.options.overrideTableTemplate||!UpdatePriceMain.options.showItems||UpdatePriceMain.prototype.isCheckoutSkinInExcludeList()||(t=UpdatePriceMain.prototype.getTemplatePath(),window.getTemplateXhr=$.get(t,function(n,t,i){i.status===200&&(UpdatePriceMain.tableTemplateToRender=n)})),UpdatePriceMain.options.negativeDiscount&&window.sessionStorage&&sessionStorage.setItem("negativeSign",UpdatePriceMain.options.negativeSign),UpdatePriceMain.options.calculateCardTransactionFee){$(document).on("change","#BillingZip, #CreditCardBin, #BillingStateId",function(){updatePrice()});if(typeof CheckoutMain!="undefined")$(document).on(CheckoutMain.eventslist.PAYMENT_TYPE_SELECT_ACTIONS_EXECUTED,function(){updatePrice()});if(n=$(".transaction-fee-info").attr("title"),typeof n!="undefined"&&n!==""){$(".transaction-fee-info").removeAttr("hidden");$(document).on("click",function(){$(".js-cart-info-transaction-fee-desc .mobile-title").remove()});$(".transaction-fee-info").on("click",function(n){var t=$(".js-cart-info-transaction-fee-desc .mobile-title");t.length?t.remove():$(this).before('<span class="mobile-title">'+$(this).attr("title")+"<\/span>");n.stopPropagation()})}}}},triggers:{triggerCustomCheckoutEvent:function(n,t,i,r){t&&i&&r&&$(document).data(i,r);typeof CheckoutMain!="undefined"&&typeof CheckoutMain.eventslist!="undefined"&&$(document).trigger(n)}}};$(function(){UpdatePriceMain.functions.Init()});String.prototype.format||(String.prototype.format=function(){var n=arguments;return this.replace(/{(\d+)}/g,function(t,i){return typeof n[i]!="undefined"?n[i]:t})}),function(n,t){typeof exports=="object"&&exports&&typeof exports.nodeName!="string"?t(exports):typeof define=="function"&&define.amd?define(["exports"],t):(n.Mustache={},t(n.Mustache))}(this,function(n){function f(n){return typeof n=="function"}function l(n){return u(n)?"array":typeof n}function o(n){return n.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function s(n,t){return n!=null&&typeof n=="object"&&t in n}function v(n,t){return a.call(n,t)}function p(n){return!v(y,n)}function b(n){return String(n).replace(/[&<>"'`=\/]/g,function(n){return w[n]})}function tt(t,i){function lt(){if(ft&&!w)while(y.length)delete a[y.pop()];else y=[];ft=!1;w=!1}function ht(n){if(typeof n=="string"&&(n=n.split(d,2)),!u(n)||n.length!==2)throw new Error("Invalid tags: "+n);et=new RegExp(o(n[0])+"\\s*");v=new RegExp("\\s*"+o(n[1]));st=new RegExp("\\s*"+o("}"+n[1]))}var et,v,st,f,c,e,s,b,ot,l,tt,ct;if(!t)return[];var ut=[],a=[],y=[],ft=!1,w=!1;for(ht(i||n.tags),f=new r(t);!f.eos();){if(c=f.pos,s=f.scanUntil(et),s)for(tt=0,ct=s.length;tt<ct;++tt)b=s.charAt(tt),p(b)?y.push(a.length):w=!0,a.push(["text",b,c,c+1]),c+=1,b==="\n"&&lt();if(!f.scan(et))break;if(ft=!0,e=f.scan(nt)||"name",f.scan(k),e==="="?(s=f.scanUntil(h),f.scan(h),f.scanUntil(v)):e==="{"?(s=f.scanUntil(st),f.scan(g),f.scanUntil(v),e="&"):s=f.scanUntil(v),!f.scan(v))throw new Error("Unclosed tag at "+f.pos);if(ot=[e,s,c,f.pos],a.push(ot),e==="#"||e==="^")ut.push(ot);else if(e==="/"){if(l=ut.pop(),!l)throw new Error('Unopened section "'+s+'" at '+c);if(l[1]!==s)throw new Error('Unclosed section "'+l[1]+'" at '+c);}else e==="name"||e==="{"||e==="&"?w=!0:e==="="&&ht(s)}if(l=ut.pop(),l)throw new Error('Unclosed section "'+l[1]+'" at '+f.pos);return rt(it(a))}function it(n){for(var u=[],t,i,r=0,f=n.length;r<f;++r)t=n[r],t&&(t[0]==="text"&&i&&i[0]==="text"?(i[1]+=t[1],i[3]=t[3]):(u.push(t),i=t));return u}function rt(n){for(var u=[],r=u,i=[],t,e,f=0,o=n.length;f<o;++f){t=n[f];switch(t[0]){case"#":case"^":r.push(t);i.push(t);r=t[4]=[];break;case"/":e=i.pop();e[5]=t[2];r=i.length>0?i[i.length-1][4]:u;break;default:r.push(t)}}return u}function r(n){this.string=n;this.tail=n;this.pos=0}function i(n,t){this.view=n;this.cache={".":this.view};this.parent=t}function t(){this.cache={}}var c=Object.prototype.toString,u=Array.isArray||function(n){return c.call(n)==="[object Array]"},a=RegExp.prototype.test,y=/\S/,w={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;","`":"&#x60;","=":"&#x3D;"},k=/\s*/,d=/\s+/,h=/\s*=/,g=/\s*\}/,nt=/#|\^|\/|>|\{|&|=|!/,e;return r.prototype.eos=function(){return this.tail===""},r.prototype.scan=function(n){var i=this.tail.match(n),t;return!i||i.index!==0?"":(t=i[0],this.tail=this.tail.substring(t.length),this.pos+=t.length,t)},r.prototype.scanUntil=function(n){var i=this.tail.search(n),t;switch(i){case-1:t=this.tail;this.tail="";break;case 0:t="";break;default:t=this.tail.substring(0,i);this.tail=this.tail.substring(i)}return this.pos+=t.length,t},i.prototype.push=function(n){return new i(n,this)},i.prototype.lookup=function(n){var o=this.cache,t,i,r,u,e;if(o.hasOwnProperty(n))t=o[n];else{for(i=this,e=!1;i;){if(n.indexOf(".")>0)for(t=i.view,r=n.split("."),u=0;t!=null&&u<r.length;)u===r.length-1&&(e=s(t,r[u])),t=t[r[u++]];else t=i.view[n],e=s(i.view,n);if(e)break;i=i.parent}o[n]=t}return f(t)&&(t=t.call(this.view)),t},t.prototype.clearCache=function(){this.cache={}},t.prototype.parse=function(n,t){var r=this.cache,i=r[n];return i==null&&(i=r[n]=tt(n,t)),i},t.prototype.render=function(n,t,r){var u=this.parse(n),f=t instanceof i?t:new i(t);return this.renderTokens(u,f,r,n)},t.prototype.renderTokens=function(n,t,i,r){for(var s="",f,e,u,o=0,h=n.length;o<h;++o)u=undefined,f=n[o],e=f[0],e==="#"?u=this.renderSection(f,t,i,r):e==="^"?u=this.renderInverted(f,t,i,r):e===">"?u=this.renderPartial(f,t,i,r):e==="&"?u=this.unescapedValue(f,t):e==="name"?u=this.escapedValue(f,t):e==="text"&&(u=this.rawValue(f)),u!==undefined&&(s+=u);return s},t.prototype.renderSection=function(n,t,i,r){function l(n){return c.render(n,t,i)}var c=this,o="",e=t.lookup(n[1]),s,h;if(e){if(u(e))for(s=0,h=e.length;s<h;++s)o+=this.renderTokens(n[4],t.push(e[s]),i,r);else if(typeof e=="object"||typeof e=="string"||typeof e=="number")o+=this.renderTokens(n[4],t.push(e),i,r);else if(f(e)){if(typeof r!="string")throw new Error("Cannot use higher-order sections without the original template");e=e.call(t.view,r.slice(n[3],n[5]),l);e!=null&&(o+=e)}else o+=this.renderTokens(n[4],t,i,r);return o}},t.prototype.renderInverted=function(n,t,i,r){var f=t.lookup(n[1]);if(!f||u(f)&&f.length===0)return this.renderTokens(n[4],t,i,r)},t.prototype.renderPartial=function(n,t,i){if(i){var r=f(i)?i(n[1]):i[n[1]];if(r!=null)return this.renderTokens(this.parse(r),t,i,r)}},t.prototype.unescapedValue=function(n,t){var i=t.lookup(n[1]);if(i!=null)return i},t.prototype.escapedValue=function(t,i){var r=i.lookup(t[1]);if(r!=null)return n.escape(r)},t.prototype.rawValue=function(n){return n[1]},n.name="mustache.js",n.version="2.3.0",n.tags=["{{","}}"],e=new t,n.clearCache=function(){return e.clearCache()},n.parse=function(n,t){return e.parse(n,t)},n.render=function(n,t,i){if(typeof n!="string")throw new TypeError('Invalid template! Template should be a "string" but "'+l(n)+'" was given as the first argument for mustache#render(template, view, partials)');return e.render(n,t,i)},n.to_html=function(t,i,r,u){var e=n.render(t,i,r);if(f(u))u(e);else return e},n.escape=b,n.Scanner=r,n.Context=i,n.Writer=t,n})