$(document).ready(function(){var e=$("#switchMonthly"),a=$("#switchAnual"),i=!0,n=function(){if("month"===$(this).data("display")){if(i)return;i=!0,e.addClass("displaying-pricing"),a.removeClass("displaying-pricing"),$(".display-year").hide(),$(".display-month").show()}else if("anual"===$(this).data("display")){if(!i)return;i=!1,a.addClass("displaying-pricing"),e.removeClass("displaying-pricing"),$(".display-month").hide(),$(".display-year").show()}};e.click(n),a.click(n);var r=function(e){e.preventDefault(),$("#payment-form")[0].reset();var a=$(this).data("type");$(".modal-title").hide(),$(".modal-body").find(".pti-header").hide(),1===a&&($(".month-pro").show(),$("#paypalPayment").attr("href","/License/Professional")),2===a&&($(".annual-pro").show(),$("#paypalPayment").attr("href","/License/ProfessionalAnnual")),3===a&&($(".month-pre").show(),$("#paypalPayment").attr("href","/License/Premium")),4===a&&($(".annual-pre").show(),$("#paypalPayment").attr("href","/License/PremiumAnnual")),$("#licensePurchase").val(a),$("#goToPaymentModal").modal("show")};$(".upgrade-btn").click(r);var t=function(e,a){var i=$("#payment-form");if(a.error)i.find(".payment-errors").text(a.error.message),i.find(".submit").prop("disabled",!1);else{var n=a.id;i.append($('<input type="hidden" name="stripeToken">').val(n)),i.get(0).submit()}},s=$("#payment-form");s.submit(function(e){return e.preventDefault(),s.find(".submit").prop("disabled",!0),Stripe.card.createToken(s,t),!1});/**
     * =================================
     * Educational License Functionality
     * =================================
     */
var p=$("#payment-form-edu"),d=function(e,a){var i=$("#payment-form-edu");if(a.error)i.find(".payment-errors").text(a.error.message),i.find(".submit").prop("disabled",!1);else{var n=a.id;i.append($('<input type="hidden" name="stripeToken">').val(n)),i.get(0).submit()}};p.submit(function(e){return e.preventDefault(),p.find(".submit").prop("disabled",!0),Stripe.card.createToken(p,d),!1})});