$(document).ready(function(){function l(){var n=$("#event-type-container");a()?n.removeClass("hide").slideDown():n.slideUp(400,"swing",function(){n.addClass("hide")})}function o(){var n=$("#event-name-container");v()?n.removeClass("hide").slideDown():($("#BasicInfo_EventName").val(""),n.slideUp(400,"swing",function(){n.addClass("hide")}))}function s(){var n=$("#copy-shipping-values").prop("checked");n?(e(),$.each($("#checkout-shipping-address-container input, #checkout-shipping-address-container select"),function(){i($(this))}),$("#checkout-billing-details input").prop("readonly",!0),$("#checkout-billing-details select").prop("disabled",!0),$("#checkout-billing-details").addClass("hide")):($("#checkout-billing-details input").prop("readonly",!1),$("#checkout-billing-details select").prop("disabled",!1),$("#checkout-billing-details").removeClass("hide"))}function tt(){var t=$(this),i=t.val(),n=$("#"+t.data("update-target"));n.find(".shipping-state-option").addClass("hide");i==="US"?n.children('.shipping-state-option[data-country="US"]').removeClass("hide"):i==="CA"?n.children('.shipping-state-option[data-country="CA"]').removeClass("hide"):n.children('.shipping-state-option[data-country="other"]').removeClass("hide");g()}function d(){$("#paypal-button-container").html("");var t=$("#Payment_Balance").val(),i=$("#Payment_Subtotal").val(),r=$("#Payment_Tax").val(),u=$("#Payment_Shipping").val(),f=$("#Payment_Promo").val(),n=$("#paypal_env").val();console.log(n);paypal.Button.render({env:n,style:{layout:"horizontal",size:"responsive",shape:"rect",color:"silver"},funding:{allowed:[paypal.FUNDING.CARD],disallowed:[]},commit:!0,client:{sandbox:"Ad0uSJYdjSmEeNJP98W42ZHi7tGys_SuyOMHH0Cqw6h6qxh1YCE0hLT73MjLA2WD1jbUWHDlnJQ5gBPN",production:"AUC4Ev8CjqU_-9fkWZevRyfTfiY440cJ1JUqeWCd35zrMN-URWikIGDcMUP5bIaH9bvWnmMJyFmhnV8X"},payment:function(n,e){return e.payment.create({payment:{transactions:[{amount:{total:t,currency:"USD",details:{subtotal:i,tax:r,shipping:u,discount:f}},description:"ºÚÁÏÍø Purchase"}]}})},onAuthorize:function(n,t){return t.payment.execute().then(function(){$.ajax({url:"/checkout/paypal-start",data:n,type:"POST",success:function(n){window.location=n}})})}},"#paypal-button-container")}function g(){let n=$("#ShippingAddress_Country").val()==="US";$('input[name="paymenttype"]').prop("checked","");n?($("#checkout-payment-options .payment-option").removeClass("hide"),$("#international-payment-option-text").addClass("hide")):($(".sezzle-option, .credit-card-option").addClass("hide"),$(".paypal-option, .gift-card-option").removeClass("hide"),$("#international-payment-option-text").removeClass("hide"));$('.payment-option:not(.hide) input[name="paymenttype"]').first().click()}function nt(n){n&&($element=$(n),$element&&$("html, body").animate({scrollTop:$element.offset().top-200},500))}var c=$('input[name="__RequestVerificationToken"]').val(),e,a,v,i,n,y,p,t,h,ut,k,r,u;const f=$("#phone-order-promise-date");$(".panel-heading h4").on("click",function(n){var t=$(this);t.parents(".panel").children(".panel-collapse").hasClass("in")&&n.stopPropagation();setTimeout(function(){theOffset=t.offset();$("body,html").animate({scrollTop:theOffset.top-100})},310)});$(".panel").on("show.bs.collapse",function(n){var r=$(this),t=r.data("step"),i=$("#checkout-container-basics .checkout-step-status").hasClass("complete"),u=$("#checkout-container-shipping .checkout-step-status").hasClass("complete");t!==3||i&&u||(n.preventDefault(),$.sticky("You must complete steps 1 & 2 first",{classList:"error"}));t!==2||i||(n.preventDefault(),$.sticky("You must complete step 1 first",{classList:"error"}))});$("#checkout-container").on("keypress change","#checkout-shipping-address-container input, #checkout-shipping-address-container select",function(){$("#copy-shipping-values").prop("checked")&&(i($(this)),$(this).prop("id")==="ShippingAddress_Country"&&e())});e=function(){var t=$("#ShippingAddress_Country").val(),n=$("#BillingAddress-address-state");n.find(".shipping-state-option").addClass("hide");t==="US"?n.children('.shipping-state-option[data-country="US"]').removeClass("hide"):t==="CA"?n.children('.shipping-state-option[data-country="CA"]').removeClass("hide"):n.children('.shipping-state-option[data-country="other"]').removeClass("hide")};$("#checkout-container").on("change","#copy-shipping-values",function(){s()});$("#checkout-container").on("change","#check-subscribe",function(){$("#BasicInfo_Subscribe").val($("#check-subscribe").prop("checked"))});$("#checkout-container").on("change","#ShippingAddress_State",l);$("#checkout-container").on("change","#ShippingAddress_State",o);$("#checkout-container").on("change","#BasicInfo_EventType",o);a=function(){return t()&&$("#cart-has-dress").val()==="true"};v=function(){var n=$("#BasicInfo_EventType").val();return(n==="Homecoming"||n==="Prom"||n==="Winter Formal")&&t()&&$("#cart-has-dress").val()=="true"};i=function(n){var t=n.data("property"),i=n.val(),r;(t!="Country"||t=="Country"&&(i=="US"||i=="CA"))&&(r=$("#BillingAddress_"+t),r.val(i))};$("#checkout-container").on("click",".checkout-button.next",function(){var n=$(this),t=$("#"+n.data("form-name"));t.validate();t.valid()&&($("#shipping-address-validated").val()==="true"?(t.find("input, select").removeAttr("disabled"),$.post("/checkout/save-form/"+n.data("step"),t.serialize(),function(){}).done(function(t){if(n.data("update-section")&&it(n.data("update-section"),n.data("update-target")),n.data("step")===1){t.Data.Shipping.UseEstimatedShippingDates==!0?($("#checkout-shipping-calendar").hide(),$("#shipping-options-container").removeClass("col-md-6").addClass("col-md-12")):($("#checkout-shipping-calendar").show(),$("#shipping-options-container").removeClass("col-md-12").addClass("col-md-6"));k(t.Data.Shipping.MinimumNeedDateString);w($("#Shipping_NeedDate").val());let n=$("#Payment_CardholderName");n&&n.val().length==0&&n.val($("#BasicInfo_FirstName").val()+" "+$("#BasicInfo_LastName").val())}b(n.data("target-panel"),n.data("home-panel"),!0);window._loq=window._loq||[];n.data("target-panel")=="checkout-container-shipping"?window._loq.push(["tag","checkout/shipping"]):n.data("target-panel")=="checkout-container-payment"&&(window._loq.push(["tag","checkout/payment"]),$("#ShippingAddress_Country").val()=="US"?$(".sezzle-option").show():$(".sezzle-option").hide())})):y())});y=function(){var i=$("#ShippingAddress_Address1").val(),t=$("#ShippingAddress_Address2").val(),r=$("#ShippingAddress_City").val(),u=$("#ShippingAddress_State").val(),f=$("#ShippingAddress_Zip").val(),e=$("#ShippingAddress_Country").val(),o="/checkout/validate-address?street="+encodeURI(i+" "+t)+"&city="+encodeURI(r)+"&state="+encodeURI(u)+"&zip="+encodeURI(f)+"&country="+encodeURI(e);$.get(o,function(e){if(e.Status===0){n=e.AddressCandidates;var o=i;t.length>0&&(o+="
"+t);o+="
"+r+" "+u+" "+f;$("#submitted-address").html(o);p();$("#validate-shipping-address-modal").modal({show:!0,backdrop:"static",keyboard:!1})}else $("#shipping-address-validated").val("true"),$("#checkout-submit-basic").click()})};p=function(){for(var i,r=$("#suggested-addresses"),t=0;t

Suggested Address<\/h4>
'+n[t].Street+"
"+n[t].Region+'<\/div>