/* Minification failed. Returning unminified contents.
(11,53-54): run-time error JS1195: Expected expression: >
(17,19-22): run-time error JS1004: Expected ';': new
(17,40-41): run-time error JS1195: Expected expression: >
(17,67-68): run-time error JS1004: Expected ';': )
(22,1-2): run-time error JS1002: Syntax error: }
(24,29-30): run-time error JS1195: Expected expression: )
(24,31-32): run-time error JS1004: Expected ';': {
(66,37-45): run-time error JS1193: Expected ',' or ')': function
(66,54-55): run-time error JS1004: Expected ';': {
(69,19-22): run-time error JS1004: Expected ';': new
(69,40-41): run-time error JS1195: Expected expression: >
(69,67-68): run-time error JS1004: Expected ';': )
(75,6-7): run-time error JS1195: Expected expression: )
(80,5-6): run-time error JS1197: Too many errors. The file might not be a JavaScript file: $
 */
/*
 * Note that this is toastr v2.1.3, the "latest" version in url has no more maintenance,
 * please go to https://cdnjs.com/libraries/toastr.js and pick a certain version you want to use,
 * make sure you copy the url from the website since the url may change between versions.
 * */
!function(e){e(["jquery"],function(e){return function(){function t(e,t,n){return g({type:O.error,iconClass:m().iconClasses.error,message:e,optionsOverride:n,title:t})}function n(t,n){return t||(t=m()),v=e("#"+t.containerId),v.length?v:(n&&(v=d(t)),v)}function o(e,t,n){return g({type:O.info,iconClass:m().iconClasses.info,message:e,optionsOverride:n,title:t})}function s(e){C=e}function i(e,t,n){return g({type:O.success,iconClass:m().iconClasses.success,message:e,optionsOverride:n,title:t})}function a(e,t,n){return g({type:O.warning,iconClass:m().iconClasses.warning,message:e,optionsOverride:n,title:t})}function r(e,t){var o=m();v||n(o),u(e,o,t)||l(o)}function c(t){var o=m();return v||n(o),t&&0===e(":focus",t).length?void h(t):void(v.children().length&&v.remove())}function l(t){for(var n=v.children(),o=n.length-1;o>=0;o--)u(e(n[o]),t)}function u(t,n,o){var s=!(!o||!o.force)&&o.force;return!(!t||!s&&0!==e(":focus",t).length)&&(t[n.hideMethod]({duration:n.hideDuration,easing:n.hideEasing,complete:function(){h(t)}}),!0)}function d(t){return v=e("<div/>").attr("id",t.containerId).addClass(t.positionClass),v.appendTo(e(t.target)),v}function p(){return{tapToDismiss:!0,toastClass:"toast",containerId:"toast-container",debug:!1,showMethod:"fadeIn",showDuration:300,showEasing:"swing",onShown:void 0,hideMethod:"fadeOut",hideDuration:1e3,hideEasing:"swing",onHidden:void 0,closeMethod:!1,closeDuration:!1,closeEasing:!1,closeOnHover:!0,extendedTimeOut:1e3,iconClasses:{error:"toast-error",info:"toast-info",success:"toast-success",warning:"toast-warning"},iconClass:"toast-info",positionClass:"toast-top-right",timeOut:5e3,titleClass:"toast-title",messageClass:"toast-message",escapeHtml:!1,target:"body",closeHtml:'<button type="button">&times;</button>',closeClass:"toast-close-button",newestOnTop:!0,preventDuplicates:!1,progressBar:!1,progressClass:"toast-progress",rtl:!1}}function f(e){C&&C(e)}function g(t){function o(e){return null==e&&(e=""),e.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function s(){c(),u(),d(),p(),g(),C(),l(),i()}function i(){var e="";switch(t.iconClass){case"toast-success":case"toast-info":e="polite";break;default:e="assertive"}I.attr("aria-live",e)}function a(){E.closeOnHover&&I.hover(H,D),!E.onclick&&E.tapToDismiss&&I.click(b),E.closeButton&&j&&j.click(function(e){e.stopPropagation?e.stopPropagation():void 0!==e.cancelBubble&&e.cancelBubble!==!0&&(e.cancelBubble=!0),E.onCloseClick&&E.onCloseClick(e),b(!0)}),E.onclick&&I.click(function(e){E.onclick(e),b()})}function r(){I.hide(),I[E.showMethod]({duration:E.showDuration,easing:E.showEasing,complete:E.onShown}),E.timeOut>0&&(k=setTimeout(b,E.timeOut),F.maxHideTime=parseFloat(E.timeOut),F.hideEta=(new Date).getTime()+F.maxHideTime,E.progressBar&&(F.intervalId=setInterval(x,10)))}function c(){t.iconClass&&I.addClass(E.toastClass).addClass(y)}function l(){E.newestOnTop?v.prepend(I):v.append(I)}function u(){if(t.title){var e=t.title;E.escapeHtml&&(e=o(t.title)),M.append(e).addClass(E.titleClass),I.append(M)}}function d(){if(t.message){var e=t.message;E.escapeHtml&&(e=o(t.message)),B.append(e).addClass(E.messageClass),I.append(B)}}function p(){E.closeButton&&(j.addClass(E.closeClass).attr("role","button"),I.prepend(j))}function g(){E.progressBar&&(q.addClass(E.progressClass),I.prepend(q))}function C(){E.rtl&&I.addClass("rtl")}function O(e,t){if(e.preventDuplicates){if(t.message===w)return!0;w=t.message}return!1}function b(t){var n=t&&E.closeMethod!==!1?E.closeMethod:E.hideMethod,o=t&&E.closeDuration!==!1?E.closeDuration:E.hideDuration,s=t&&E.closeEasing!==!1?E.closeEasing:E.hideEasing;if(!e(":focus",I).length||t)return clearTimeout(F.intervalId),I[n]({duration:o,easing:s,complete:function(){h(I),clearTimeout(k),E.onHidden&&"hidden"!==P.state&&E.onHidden(),P.state="hidden",P.endTime=new Date,f(P)}})}function D(){(E.timeOut>0||E.extendedTimeOut>0)&&(k=setTimeout(b,E.extendedTimeOut),F.maxHideTime=parseFloat(E.extendedTimeOut),F.hideEta=(new Date).getTime()+F.maxHideTime)}function H(){clearTimeout(k),F.hideEta=0,I.stop(!0,!0)[E.showMethod]({duration:E.showDuration,easing:E.showEasing})}function x(){var e=(F.hideEta-(new Date).getTime())/F.maxHideTime*100;q.width(e+"%")}var E=m(),y=t.iconClass||E.iconClass;if("undefined"!=typeof t.optionsOverride&&(E=e.extend(E,t.optionsOverride),y=t.optionsOverride.iconClass||y),!O(E,t)){T++,v=n(E,!0);var k=null,I=e("<div/>"),M=e("<div/>"),B=e("<div/>"),q=e("<div/>"),j=e(E.closeHtml),F={intervalId:null,hideEta:null,maxHideTime:null},P={toastId:T,state:"visible",startTime:new Date,options:E,map:t};return s(),r(),a(),f(P),E.debug&&console&&console.log(P),I}}function m(){return e.extend({},p(),b.options)}function h(e){v||(v=n()),e.is(":visible")||(e.remove(),e=null,0===v.children().length&&(v.remove(),w=void 0))}var v,C,w,T=0,O={error:"error",info:"info",success:"success",warning:"warning"},b={clear:r,remove:c,error:t,getContainer:n,info:o,options:{},subscribe:s,success:i,version:"2.1.3",warning:a};return b}()})}("function"==typeof define&&define.amd?define:function(e,t){"undefined"!=typeof module&&module.exports?module.exports=t(require("jquery")):window.toastr=t(window.jQuery)});
//# sourceMappingURL=toastr.js.map
;
var alreadyAgreed = "false";

document.addEventListener("keydown", async (event) => {
    if (event.key === "Enter") {
        $("#metro-banner").showWaitingPopUp();
        var siginForm = document.getElementById('signin-form');

        if (siginForm.style.display !== "none") {
            await new Promise(resolve => setTimeout(resolve, 1000));
            await signIn();
        }
    }

});

$(document).ready(function () {
    // alert box close action 
    if ($(".alert").length > 0) {
        $(".alert").slideDown(600);
    }

    $(".alert__close").click(function () {
        $(".alert").clearQueue().slideUp(600);
    });
    var contentHeight = $("#metro-banner").outerHeight(true);
    $("#placeFiller-left").height(contentHeight + 30);
    $("#placeFiller-right").height(contentHeight + 30);
    $("#metro-right").css("background", "none");


    $(".faq-answer").hide();
    $(".faq-question").click(function (event) {
        if ($(this).hasClass("faq-icon-right"))
            $(this).removeClass("faq-icon-right").addClass("faq-icon-down");
        else
            $(this).removeClass("faq-icon-down").addClass("faq-icon-right");
        $(this).nextUntil(".faq-question").slideToggle("fast");
    });

    $(".expand-clopse").click(function () {
        if ($(this).hasClass("expand")) {
            $(this).removeClass("expand");
            $(this).addClass("clopse");
            $(".faq-question").removeClass("faq-icon-down").addClass("faq-icon-right");
            $(this).text("Expand All");
            $(".faq-answer").hide();
        }
        else {
            $(this).removeClass("clopse");
            $(this).addClass("expand");
            $(".faq-question").removeClass("faq-icon-right").addClass("faq-icon-down");
            $(this).text("Collapse All");
            $(".faq-answer").show();
        }

    });

    $("#sign-in").on('click', async function (event) {
        $("#metro-banner").showWaitingPopUp();
        try {
            await new Promise(resolve => setTimeout(resolve, 1000));
            await signIn();
        }
        catch (error) {
            toastr.error("Error occurred while processing. Please try again later.");
        }
    });

    $(".layout30f ").removeClass("segment");
    $(".layout30e").removeClass("segment");

    $("#video_link").click(function () {
        var videoFile = $("#metro-banner-video").attr("src");
        videoFile += "?autoplay=1";
        $("#video_link").css("display", "none");
        $("#metro-banner-video").css("display", "block").attr("src", videoFile);

        var contentHeight = $("#metro-banner").outerHeight(true);
        $("#placeFiller-left").height(contentHeight);
        $("#placeFiller-right").height(contentHeight);

    });


});

$(window).resize(function () {
    $("#iFramePopup_outer_frame").hide();
    $("#iFramePopup_outerOverlay").hide();

    var contentHeight = $("#metro-banner").outerHeight(true);
    $("#placeFiller-left").height(contentHeight + 30);
    $("#placeFiller-right").height(contentHeight + 30);
    $("#metro-right").css("background", "none");
});

// Dialog for showing the consent message
$("#metrostudio-popup").ejDialog({ width: "700px", showHeader: false, draggable: false, enableResize: false, enableModal: true, closeOnEscape: false, "showOnInit": false });

// Click event for verifying the Customer subscription status
$("#metro-submitbutton").on("click", function () {
    $.ajax({
        type: "POST",
        url: "/downloads/checksubscribeduser",
        contentType: 'application/json;',
        dataType: 'json',
        success: function (data) {
            if (data.isSubscribedCustomer != undefined && data.isSubscribedCustomer) {
                $('#intiate-download').trigger("click");
            }
            else if (data.isSubscribedCustomer != undefined && !data.isSubscribedCustomer) {
                if (alreadyAgreed == "true") {
                    $('#updateconsent').trigger("click");
                }
                else {

                    if (window.innerWidth < 767) {
                        $("#metrostudio-popup").ejDialog({ width: "400px" })
                    }
                    else {
                        $("#metrostudio-popup").ejDialog({ width: "700px" })
                    }

                    $("#metrostudio-popup").ejDialog('open');
                }
            }
        },
        error: function () {
            toastr.error("Error occurred while processing. Please try again later.");
        }
    })
});

$('#updateconsent').on('click', function () {
    $.ajax({
        type: "POST",
        url: "/downloads/metrostudiosusbcriptiondetailsupdate",
        beforeSend: function () {
            $("#metrostudio-popup").showWaitingPopUp();
        },
        success: function (data) {
            if (data.Success != 'undefined' && data.Success) {
                $("#metrostudio-popup").removeWaitingPopUp();
                $("#metrostudio-popup").ejDialog('close');
                alreadyAgreed = "true";
                toastr.success("To download Metro Studio, you must provide additional confirmation. An email has been sent to your email address. Please confirm receipt.");
            }
            else if (data.Success != 'undefined' && !data.Success) {
                $("#metrostudio-popup").removeWaitingPopUp();
                $("#metrostudio-popup").ejDialog('close');
                toastr.error("Error occurred while processing. Please try again later.");
            }
        },
        error: function () {
            $("#metrostudio-popup").removeWaitingPopUp();
            $("#metrostudio-popup").ejDialog('close');
            toastr.error("Error occurred while processing. Please try again later.");
        }
    })
});

$("#close").on("click", function () {
    $("#metrostudio-popup").ejDialog('close');
});

$("#close-consent-dialog").on("click", function () {
    $("#metrostudio-popup").ejDialog('close');
});

function clearExistingValidations() {
    "use strict";
    var fieldValidation = document.getElementsByClassName("field-validation-error");
    var i = 0;
    for (i = 0; i < fieldValidation.length; i++) {
        fieldValidation[i].innerHTML = "";
    }
}

async function signIn() {
    var test = document.getElementById("g-captcha-v2-validation-message");
    var emailValidationStatus = false;
    var passwordValidationStatus = false;
    var commonFunctions = new Utility.CommonMethod();
    var emailElement = document.getElementById("user-name");
    var passwordElement = document.getElementById("password");
    var emailAddress = emailElement.value.trim();
    var newPassword = passwordElement.value;

    // to clear existing validation messgaes
    clearExistingValidations();
    var classValue;
    var validationMessage;
    var emailFilter = /^([a-zA-Z0-9_\.\-\+])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
    // email validation.
    if (emailAddress === "" || emailAddress.trim().length < 1 || emailAddress === null) {
        $("#metro-banner").removeWaitingPopUp();
        commonFunctions.addClass("input-validation-error", emailElement);
        classValue = emailElement.parentElement.nextElementSibling !== null ? emailElement.parentElement.nextElementSibling.getAttribute("class") : null;
        if (classValue !== null && classValue.indexOf("field-validation-error") > -1) {
            emailElement.parentElement.nextElementSibling.textContent = "Please enter your email";
        }
        else {
            validationMessage = document.createElement("span");
            validationMessage.appendChild(document.createTextNode("Please enter your email"));
            emailElement.parentElement.parentElement.appendChild(validationMessage);
            emailElement.parentElement.nextElementSibling.setAttribute("class", "field-validation-error");
        }
    }
    else if (!emailFilter.test(emailAddress)) {
        $("#metro-banner").removeWaitingPopUp();
        commonFunctions.addClass("input-validation-error", emailElement);
        classValue = emailElement.parentElement.nextElementSibling !== null ? emailElement.parentElement.nextElementSibling.getAttribute("class") : null;
        if (classValue !== null && classValue.indexOf("field-validation-error") > -1) {
            emailElement.parentElement.nextElementSibling.textContent = "Please enter a valid email";
        }
        else {
            validationMessage = document.createElement("span");
            validationMessage.appendChild(document.createTextNode("Please enter a valid email"));
            emailElement.parentElement.parentElement.appendChild(validationMessage);
            emailElement.parentElement.nextElementSibling.setAttribute("class", "field-validation-error");
        }
    }
    else {
        commonFunctions.removeClass("input-validation-error", emailElement);
        emailValidationStatus = true;
    }
    // password validation.
    if (newPassword === "" || newPassword.trim().length < 1 || newPassword === null) {
        $("#metro-banner").removeWaitingPopUp();
        commonFunctions.addClass("input-validation-error", passwordElement);
        classValue = passwordElement.parentElement.nextElementSibling !== null ? passwordElement.parentElement.nextElementSibling.getAttribute("class") : null;
        if (classValue !== null && classValue.indexOf("field-validation-error") > -1) {
            passwordElement.parentElement.nextElementSibling.textContent = "Please enter your password";
        }
        else {
            validationMessage = document.createElement("span");
            validationMessage.appendChild(document.createTextNode("Please enter your password"));
            passwordElement.parentElement.parentElement.appendChild(validationMessage);
            passwordElement.parentElement.nextElementSibling.setAttribute("class", "field-validation-error");
        }
    }
    else {
        commonFunctions.removeClass("input-validation-error", passwordElement);
        passwordValidationStatus = true;
    }
    if (emailValidationStatus == true && passwordValidationStatus == true) {
        $("#metro-banner").removeWaitingPopUp();
        loginValidation();
    }
}

// login client side validation.
function loginValidation() {
    $("#metro-banner").showWaitingPopUp();
    document.getElementById("sign-in").disabled = false;
    var emailElement = document.getElementById("user-name");
    var passwordElement = document.getElementById("password");
    var emailAddress = emailElement.value.trim();
    var newPassword = passwordElement.value;
    var RememberMeValue = rememberMe;
    var returnUrl = returnURL;
    var headers = {};
    var token = $('input[name="__RequestVerificationToken"]').val();
    var loginInfo = { UserName: emailAddress, Password: newPassword, Token: token, Returnurl: returnUrl, RememberMe: RememberMeValue };
    headers["__RequestVerificationToken"] = token;
    $.ajax({
        type: 'POST',
        url: '/downloads/metrostudiologin',
        headers: headers,
        async: false,
        data: JSON.stringify(loginInfo),
        contentType: "application/json",
        success: function (result) {
            if (!result.isValid && result.fieldName != null && result.errorMessage != null) {
                $("#metro-banner").removeWaitingPopUp();
                var fieldName = result.fieldName;
                var errorMessage = result.errorMessage;
                if (fieldName == "UserName") {
                    $("#user-name").addClass("input-validation-error");
                    $("#userNameError").text(errorMessage);

                } else if (fieldName == "Password") {
                    $("#passwordError").text(errorMessage);
                    $("#password").addClass("input-validation-error");
                } else {
                    $("#user-name").removeClass("input-validation-error");
                    $("#password").removeClass("input-validation-error");
                }
            }
            else if (result != null) {
                var isHTML = isHTMLContent(result);
                if (isHTML) {
                    $("#metro-banner").removeWaitingPopUp();
                    var partialValue = $(result).find('#TwoFactorAuthenticationStatus').text();
                    if (partialValue == "True") {
                        $('#signin-form').hide();
                        $('.separator-section').hide();
                        $('#metro-logo').hide();
                        $('#twoFactorAuthentication').html(result);
                        setmetroHeight();
                    }
                }
                else {
                    window.location.href = result;
                }
            }
        },
        error: function (xhr, status, error) {
            alert("error");
            toastr["error"]("An error occurred while processing your request.");
        }
    });
}
function isHTMLContent(content) {
    // Regular expression to check if content contains HTML tags
    var htmlPattern = /<\/?[a-z][\s\S]*>/i;
    return htmlPattern.test(content);
}
function setmetroHeight() {
    var contentHeight = $("#metro-banner").outerHeight(true);
    $("#placeFiller-left").height(contentHeight + 30);
    $("#placeFiller-right").height(contentHeight + 30);
    $("#metro-right").css("background", "none");
};
var fixedMenuHeight = "";
$(window).load(function () {
    fixedMenuHeight = $(".static-menu-navigation").height();
    if (window.location.pathname == "/downloads") {
        fixedMenuHeight = $("#static-menu").outerHeight();
        $(".static-menu-navigation li").removeClass("selected");
    }
});
$(document).ready(function () {
    StaticMenuScroll();
});

function StaticMenuScroll()
{
    var fixedMenutop = "";
    fixedMenuHeight = $(".static-menu-navigation").height();
    if (window.location.pathname == "/downloads") {
        fixedMenuHeight = $("#static-menu").outerHeight();
        $(".static-menu-navigation li").removeClass("selected");
    }
    // Scripts for fixed menu
    if ($(".static-menu-navigation").offset() != undefined) {
        fixedMenutop = $(".static-menu-navigation").offset().top;
    }
    StartNaivgationAnimation($(".static-menu-navigation li:eq(0)"));
    $(window).scroll(function () {
        if ($(window).scrollTop() >= fixedMenutop) {
            $(".static-menu-navigation").addClass('fixed-menu');
        } else {
            $(".static-menu-navigation").removeClass('fixed-menu');
        }
        if (window.location.pathname == "/downloads") {
            if ($(window).scrollTop() + fixedMenuHeight > $("#free-products").offset().top) {
                $(".static-menu-navigation").fadeOut("slow");
            } else {
                $(".static-menu-navigation").fadeIn("slow");
            }
        }

        if ($(".static-menu-navigation").hasClass('fixed-menu')) {
            $(".fixed-arrow").show();
            if ($(".static-menu-navigation li").length == 7) {

                if ($(window).scrollTop() > $("body .segment:eq(7)").offset().top - (fixedMenuHeight + 1)) {
                    if ($(document).scrollTop().valueOf() > 7447) {
                        $(".fixed-arrow").hide();
                    }
                    else {
                        StartNaivgationAnimation($(".static-menu-navigation li:eq(6)"));
                    }
                }
                else if ($(window).scrollTop() > $("body .segment:eq(6)").offset().top - (fixedMenuHeight + 1)) {
                    StartNaivgationAnimation($(".static-menu-navigation li:eq(5)"));
                }

                else if ($(window).scrollTop() > $("body .segment:eq(5)").offset().top - (fixedMenuHeight + 1)) {
                    StartNaivgationAnimation($(".static-menu-navigation li:eq(4)"));
                } else if ($(window).scrollTop() > $("body .segment:eq(4)").offset().top - (fixedMenuHeight + 1)) {
                    StartNaivgationAnimation($(".static-menu-navigation li:eq(3)"));
                } else if ($(window).scrollTop() > $("body .segment:eq(3)").offset().top - (fixedMenuHeight + 1)) {
                    StartNaivgationAnimation($(".static-menu-navigation li:eq(2)"));
                } else if ($(window).scrollTop() > $("body .segment:eq(2)").offset().top - (fixedMenuHeight + 1)) {
                    StartNaivgationAnimation($(".static-menu-navigation li:eq(2)"));
                } else if ($(window).scrollTop() > $("body .segment:eq(1)").offset().top - (fixedMenuHeight + 1)) {
                    StartNaivgationAnimation($(".static-menu-navigation li:eq(1)"));
                } else if ($(window).scrollTop() > $("body .segment:eq(0)").offset().top) {
                    StartNaivgationAnimation($(".static-menu-navigation li:eq(0)"));
                }
            }
            if ($(".static-menu-navigation li").length == 6) {
                if ($(window).scrollTop() > $("body .segment:eq(6)").offset().top - (fixedMenuHeight + 1)) {
                    $(".fixed-arrow").hide();
                }
                else if ($(window).scrollTop() > $("body .segment:eq(5)").offset().top - (fixedMenuHeight + 1)) {
                    StartNaivgationAnimation($(".static-menu-navigation li:eq(5)"));
                } else if ($(window).scrollTop() > $("body .segment:eq(4)").offset().top - (fixedMenuHeight + 1)) {
                    StartNaivgationAnimation($(".static-menu-navigation li:eq(4)"));
                } else if ($(window).scrollTop() > $("body .segment:eq(3)").offset().top - (fixedMenuHeight + 1)) {
                    StartNaivgationAnimation($(".static-menu-navigation li:eq(3)"));
                } else if ($(window).scrollTop() > $("body .segment:eq(2)").offset().top - (fixedMenuHeight + 1)) {
                    StartNaivgationAnimation($(".static-menu-navigation li:eq(2)"));
                } else if ($(window).scrollTop() > $("body .segment:eq(1)").offset().top - (fixedMenuHeight + 1)) {
                    StartNaivgationAnimation($(".static-menu-navigation li:eq(1)"));
                } else if ($(window).scrollTop() > $("body .segment:eq(0)").offset().top) {
                    StartNaivgationAnimation($(".static-menu-navigation li:eq(0)"));
                }
            }
            if ($(".static-menu-navigation li").length == 5) {
                if ($(window).scrollTop() > $("body .segment:eq(5)").offset().top - (fixedMenuHeight + 1)) {
                    $(".fixed-arrow").hide();
                }
                else if ($(window).scrollTop() > $("body .segment:eq(4)").offset().top - (fixedMenuHeight + 1)) {
                    StartNaivgationAnimation($(".static-menu-navigation li:eq(4)"));
                } else if ($(window).scrollTop() > $("body .segment:eq(3)").offset().top - (fixedMenuHeight + 1)) {
                    StartNaivgationAnimation($(".static-menu-navigation li:eq(3)"));
                } else if ($(window).scrollTop() > $("body .segment:eq(2)").offset().top - (fixedMenuHeight + 1)) {
                    StartNaivgationAnimation($(".static-menu-navigation li:eq(2)"));
                } else if ($(window).scrollTop() > $("body .segment:eq(1)").offset().top - (fixedMenuHeight + 1)) {
                    StartNaivgationAnimation($(".static-menu-navigation li:eq(1)"));
                } else if ($(window).scrollTop() > $("body .segment:eq(0)").offset().top) {
                    StartNaivgationAnimation($(".static-menu-navigation li:eq(0)"));
                }
            }
            if ($(".static-menu-navigation li").length == 4) {
                if ($("body .segment").length == 4)
                {
                    if ($(window).scrollTop() > $("body .segment:eq(4)").offset().top - (fixedMenuHeight + 1)) {
                        $(".fixed-arrow").hide();
                    }
                    else if ($(window).scrollTop() > $("body .segment:eq(3)").offset().top - (fixedMenuHeight + 1)) {
                        StartNaivgationAnimation($(".static-menu-navigation li:eq(3)"));
                    } else if ($(window).scrollTop() > $("body .segment:eq(2)").offset().top - (fixedMenuHeight + 1)) {
                        StartNaivgationAnimation($(".static-menu-navigation li:eq(2)"));
                    } else if ($(window).scrollTop() > $("body .segment:eq(1)").offset().top - (fixedMenuHeight + 1)) {
                        StartNaivgationAnimation($(".static-menu-navigation li:eq(1)"));
                    } else if ($(window).scrollTop() > $("body .segment:eq(0)").offset().top) {
                        StartNaivgationAnimation($(".static-menu-navigation li:eq(0)"));
                    }
                }
                else {
                    if ($(window).scrollTop() > $("body .segment:eq(5)").offset().top - (fixedMenuHeight + 1)) {
                        $(".fixed-arrow").hide();
                    }
                    else if ($(window).scrollTop() > $("body .segment:eq(4)").offset().top - (fixedMenuHeight + 1)) {
                        StartNaivgationAnimation($(".static-menu-navigation li:eq(3)"));
                    }
                    else if ($(window).scrollTop() > $("body .segment:eq(3)").offset().top - (fixedMenuHeight + 1)) {
                        StartNaivgationAnimation($(".static-menu-navigation li:eq(3)"));
                    } else if ($(window).scrollTop() > $("body .segment:eq(2)").offset().top - (fixedMenuHeight + 1)) {
                        StartNaivgationAnimation($(".static-menu-navigation li:eq(2)"));
                    } else if ($(window).scrollTop() > $("body .segment:eq(1)").offset().top - (fixedMenuHeight + 1)) {
                        StartNaivgationAnimation($(".static-menu-navigation li:eq(1)"));
                    } else if ($(window).scrollTop() > $("body .segment:eq(0)").offset().top) {
                        StartNaivgationAnimation($(".static-menu-navigation li:eq(0)"));
                    }
                }
            }
            if ($(".static-menu-navigation li").length == 3) {
                if ($(window).scrollTop() > $("body .segment:eq(3)").offset().top - (fixedMenuHeight + 1)) {
                    $(".fixed-arrow").hide();
                }
                else if ($(window).scrollTop() > $("body .segment:eq(2)").offset().top - (fixedMenuHeight + 1)) {
                    StartNaivgationAnimation($(".static-menu-navigation li:eq(2)"));
                } else if ($(window).scrollTop() > $("body .segment:eq(1)").offset().top - (fixedMenuHeight + 1)) {
                    StartNaivgationAnimation($(".static-menu-navigation li:eq(1)"));
                } else if ($(window).scrollTop() > $("body .segment:eq(0)").offset().top) {
                    StartNaivgationAnimation($(".static-menu-navigation li:eq(0)"));
                }
            }
            if ($(".static-menu-navigation li").length == 2) {
                if ($(window).scrollTop() > $("body .segment:eq(2)").offset().top - (fixedMenuHeight + 1)) {
                    $(".fixed-arrow").hide();
                }
                else if ($(window).scrollTop() > $("body .segment:eq(1)").offset().top - (fixedMenuHeight + 1)) {
                    StartNaivgationAnimation($(".static-menu-navigation li:eq(1)"));
                } else if ($(window).scrollTop() > $("body .segment:eq(0)").offset().top) {
                    StartNaivgationAnimation($(".static-menu-navigation li:eq(0)"));
                }
            }
        }
    });

    $(".static-menu-navigation li").click(function () {
        var selectedChild = $(this);
        StartNaivgationAnimation(selectedChild);

        var moveTo = selectedChild.data("move-to");

        if (moveTo == "community-license") {
            moveTo = "ft-community-license";
        }

        if (moveTo == "logo-assets") {
            var movePosition1 = $('#logo-assets').offset();
            var movePosition = movePosition1.top;
        }
        else {
            var movePosition = $("#" + moveTo).offset().top;

        }	
      
        if (selectedChild.index() == 0) {                        
            if (!$(".static-menu-navigation").hasClass('fixed-menu')) {
                movePosition = movePosition - (fixedMenuHeight + 2);
            } else {
                movePosition = movePosition - 1;
            }            
        } else {
            if (!$(".static-menu-navigation").hasClass('fixed-menu')) {
                movePosition = movePosition - (2 * fixedMenuHeight);
            } else {
                movePosition = movePosition - fixedMenuHeight;
            }
        }

        $("body, html").animate({
            scrollTop: movePosition
        }, 1000);
    });
    // End of scripts for fixed menu
}

function StartNaivgationAnimation(element) {

    if (element.length > 0) {
        $(".static-menu-navigation li").removeClass("selected");
        var selectedChild = element;
        selectedChild.addClass("selected");
        var elementPosition = selectedChild.position();
        var elementPositionLeft = elementPosition.left;
        var elementPositionTop = elementPosition.top;
        var elementWidth = selectedChild.width();
        var elementHeight = selectedChild.height();

        var arrowPositionLeft = elementPositionLeft + elementWidth / 2 - $(".fixed-arrow").width() / 2;
        var arrowPositionTop = elementPositionTop + elementHeight / 2;

        $(".fixed-arrow").show();
        $(".fixed-arrow").stop(false, false).animate({
            left: arrowPositionLeft + "px"
        }, 500);
    }    
};
$(document).ready(function () {
    var hasMoreThanAscii = /^[\u0000-\u00ff]*$/;
    setTimeout(PlatformName, 1000);

    function PlatformName() {
        if ($("#product-name").val() == "dashboard") {
            $("#platform-name").text("Dashboard");
        }
        else if ($("#product-name").val() == "report") {
            $("#report-title").text("To get additional pricing and additional information about the Syncfusion Report Platform, fill out the fields below. ");
        }
    }

    var filter = /^([a-zA-Z0-9_\.\-\+])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
    var numeric = /^[0-9]/;
    var specialcharfilter = /[!@#$%^&*()+\=[\]{};:"\\|,~<>\/?]/;
    var phonefilter = /[!$%^&*_|~=`{}\[\]:";'<>?,\/]/;
    var hasMoreThanAscii = /^[\u0000-\u00ff]*$/;
    var companyFilter = /[!%^*+|~=`{}\[\]:";'<>?\/]/;  // We don not allow these special character in company name for security purpose.
  
    function validatecompanyfield(company) {
        company = company.replace(/ /g, '');
        if (/^[0-9a-zA-Z]+$/.test(company)) {
            return true;
        }
        else {
            return false;
        }
    }
      function validateErrorNamefield() {
        $("#contact-name").css("border", "1px solid #a32626");
        $("#validation-name").html("Non-ASCII characters are not allowed.");
        $("#validation-name").css("display", "block");
        $("#contact-us-segment").removeWaitingPopUp();
    }
    function validateErrorEmailfield() {
        $("#contact-email").css("border", "1px solid #a32626");
        $("#validation-email").html("Non-ASCII characters are not allowed.");
        $("#validation-email").css("display", "block");
        $("#contact-us-segment").removeWaitingPopUp();
    }
    function validateErrorCompanyfield() {
        $("#contact-company ").css("border", "1px solid #a32626");
        $("#validation-company").html("Non-ASCII characters are not allowed.");
        $("#validation-company").css("display", "block");
        $("#contact-us-segment").removeWaitingPopUp();
    }
    
    //contactus form submission
    $("#contacus-form").on('click', '#contact-submit', function (e) {
        $("#contact-us-segment").showWaitingPopUp();
        var validatationError = false;
        var email = $("#contact-email").val();
        var name = $("#contact-name").val();
        var message = $("#contact-message").val();
        var company = $("#contact-company").val();
        var phone = $("#contact-phone").val();
        var isvalidcompanyname = validatecompanyfield(company);
        $(".contactus-inputs").css("border", "1px solid #a6a6a6");
        $(".contactus-label").css("display", "none");
        var headers = {};
        token = $('input[name="__RequestVerificationToken"]').val();
        headers["__RequestVerificationToken"] = token;
        var hasNumber = /^\d+$/;
        if (company == "" || company.trim().length < 1 || company == null) {
            validatationError = true;
            $("#contact-company ").css("border", "1px solid #a32626");
            $("#validation-company").html("Please enter your company name");
            $("#validation-company").css("display", "block");
            $("#contact-us-segment").removeWaitingPopUp();
        }
        else if (company.trim().length < 2) {
            validatationError = true;
            $("#contact-company ").css("border", "1px solid #a32626");
            $("#validation-company").html("Please enter at least two characters");
            $("#validation-company").css("display", "block");
            $("#contact-us-segment").removeWaitingPopUp();
        }
        else if (company.trim().length >= 2 && companyFilter.test(company)) {
            validatationError = true;
            $("#contact-company ").css("border", "1px solid #a32626");
            $("#validation-company").html("Letters, numbers, and the following special characters (-$()_&@,.) are allowed");
            $("#validation-company").css("display", "block");
            $("#contact-us-segment").removeWaitingPopUp();
        }
        else if (/^[0-9]+$/.test(company)) {
            validatationError = true;
            $("#contact-company ").css("border", "1px solid #a32626");
            $("#validation-company").css("display", "block");
            $("#validation-company").html("Company names cannot be only numbers and special characters. Please include at least one alphabetic character.");
            $("#contact-us-segment").removeWaitingPopUp();
        }


        else if ((!/^\d+$/.test(company)) && (!/[a-zA-Z]/.test(company))) {
            validatationError = true;
            $("#contact-company ").css("border", "1px solid #a32626");
            $("#validation-company").css("display", "block");
            $("#validation-company").html("Company names cannot be only numbers and special characters. Please include at least one alphabetic character.");
            $("#contact-us-segment").removeWaitingPopUp();
        }
        else {
            if (!hasMoreThanAscii.test(company)) {
                validatationError = true;
                validateErrorCompanyfield();
            }
        }
        if (email == "" || email == null) {
            validatationError = true;
            $("#contact-email").css("border", "1px solid #a32626");
            $("#validation-email").html("Please enter your email address");
            $("#validation-email").css("display", "block");
            $("#contact-us-segment").removeWaitingPopUp();
        } else if (!filter.test(email)) {
            validatationError = true;
            $("#contact-email").css("border", "1px solid #a32626");
            $("#validation-email").css("display", "block");
            $("#validation-email").html("Please enter a valid email address");
            $("#contact-us-segment").removeWaitingPopUp();
        }
        else {
            if (!hasMoreThanAscii.test(email)) {
                validatationError = true;
                validateErrorEmailfield();
            }
        }
        if (name == "" || name.trim().length < 1 || name == null) {
            validatationError = true;
            $("#contact-name").css("border", "1px solid #a32626");
            $("#validation-name").html("Please enter your name");
            $("#validation-name").css("display", "block");
            $("#contact-us-segment").removeWaitingPopUp();
        }
        else if (specialcharfilter.test(name)) {
            validatationError = true;
            $("#contact-name").css("border", "1px solid #a32626");
            $("#validation-name").css("display", "block");
            $("#validation-name").html("Only letters and the special characters (-_\'`.) are allowed.");
            $("#request-license").removeWaitingPopUp();
        }
        else if (numeric.test(name)){
            validatationError = true;
            $("#contact-name").css("border", "1px solid #a32626");
            $("#validation-name").css("display", "block");
            $("#validation-name").html("Only letters and the special characters (-_\'`.) are allowed.");
            $("#request-license").removeWaitingPopUp();
        }
        else {

            if (!hasMoreThanAscii.test(name)) {
                validatationError = true;
                validateErrorNamefield();
            }
        }
        if ($("#product-name").val().toString() != "JSLanding") {
            if (phone == null || phone == "" || phone.trim().length < 1 ) {
                validatationError = true;
                $("#contact-phone").css("border", "1px solid #a32626");
                $("#validation-phone").html("Please enter your phone number");
                $("#validation-phone").css("display", "block");
                $("#contact-us-segment").removeWaitingPopUp();
            }
            else if ((/[a-zA-Z]/.test(phone)) || (phonefilter.test(phone))) {
                validatationError = true;
                $("#contact-phone").css("border", "1px solid #a32626");
                $("#validation-phone").html("Please enter a valid phone number");
                $("#validation-phone").css("display", "block");
                $("#contact-us-segment").removeWaitingPopUp();
            }
        }

     if (message == "" || message.trim().length < 1 || message == null) {
            validatationError = true;
            $("#contact-message").css("border", "1px solid #a32626");
            $("#validation-message").html("Please state what information you would like to receive");
            $("#validation-message").css("display", "block");
            $("#validation-message").css('margin-bottom', '-23px');
            $('#contact-submit').css('margin-top', '30px');
            $("#contact-us-segment").removeWaitingPopUp();
        }
        else {
            if (!hasMoreThanAscii.test(message)) {
                validatationError = true;
                $("#contact-message").css("border", "1px solid #a32626");
                $("#validation-message").html("Please enter valid infromation");
                $("#validation-message").css("display", "block");
                $("#validation-message").css('margin-bottom', '-23px');
                $('#contact-submit').css('margin-top', '30px');
                $("#contact-us-segment").removeWaitingPopUp();
            }
            else if (companyFilter.test(message)) {
                validatationError = true;
                $("#contact-message").css("border", "1px solid #a32626");
                $("#validation-message").html("Letters, numbers, and the following special characters (-$()_&@,.) are allowed");
                $("#validation-message").css("display", "block");
                $("#validation-message").css('margin-bottom', '-23px');
                $('#contact-submit').css('margin-top', '30px');
                $("#contact-us-segment").removeWaitingPopUp();
            }
         }
         if ($("#product-name").val().toString() == "JSLanding") {
             if (message == "" || message.trim().length < 1 || message == null) {
                 validatationError = true;
                 $("#validation-message").html("Please provide your feedback");
             }
         }
        var productName = $("#product-name").val().toString();
        
        if (productName == "JSLanding") {
            var formDetails = { EMail: email, Name: name, Company: company, Message: message, SourceId: 3 };
            if (!validatationError) {
                $.ajax({
                    type: 'POST',
                    url: "/account/UpdateFeedbackForm/",
                    headers: headers,
                    data: JSON.stringify({ feedbackDetails: formDetails }),
                    cache: true,
                    contentType: "application/json; charset=utf-8",
                    dataType: "json",
                    success: function (result) {
                        if (result.success) {
                            $("#contact-us-segment").removeWaitingPopUp();
                            $("#contacus-form").css("display", "none");
                            $("#contactus-confirmation").css("display", "block");
                            $("#greeting").html("Dear " + name + ",");
                        }
                        else {
                            $("#contact-us-segment").removeWaitingPopUp();
                            $("#contacus-form").css("display", "none");
                            $("#contactus-failure").css("display", "block");
                        }
                    }
                });
            }
        }
        else {
            var formDetails = { Name: name, Company: company, Phone: phone, Email: email, Info: message };
            if (!validatationError) {
                $.ajax({
                    type: 'POST',
                    url: "/sales/salescontactus/" + productName,
                    headers: headers,
                    data: formDetails,
                    cache: true,
                    success: function (result) {
                        if (result.success && result.ValidationMessage == "") {
                            $("#contact-us-segment").removeWaitingPopUp();
                            $("#contacus-form").css("display", "none");
                            $("#contactus-confirmation").css("display", "block");
                            $("#greeting").html("Dear " + name + ",");
                        }
                        else if (result.ValidationMessage != "" && result.ValidationMessage != null) {
                            $("#contact-us-segment").removeWaitingPopUp();
                            $("#validation-email").html(result.ValidationMessage);
                            $("#validation-email").css("display", "block");
                            $("#contact-email").css("border", "1px solid #E3464D ");
                        }
                        else {
                            $("#contact-us-segment").removeWaitingPopUp();
                            $("#contacus-form").css("display", "none");
                            $("#contactus-failure").css("display", "block");
                        }
                    }
                });
            }
        }
    });
});

;
var Utility;
(function (Utility) {
    var CommonMethod = /** @class */ (function () {
        function CommonMethod() {
        }
        CommonMethod.prototype.regExpression = function () {
            this.emailFilter = /^([a-zA-Z0-9_\.\-\+])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
            this.specialcharfilter = /[!@#$%^&*()+\=[\]{};:"\\|,~<>\/?]/;
            this.phonefilter = /[!$%^&*_|~=`{}\[\]:";'<>?,\/]/;
            this.numeric = /[0123456789]/;
            this.hasMoreThanAscii = /^[\u0000-\u00ff]*$/;
        };
        CommonMethod.prototype.addClass = function (className, element) {
            if (element.className.indexOf(className) == -1) {
                element.className += " " + className;
            }
        };
        CommonMethod.prototype.removeClass = function (className, element) {
            element.className = element.className.replace(className, "");
        };
        CommonMethod.prototype.outerHeight = function (elementId) {
            var elementHeight = elementId.offsetHeight;
            elementHeight += parseInt(window.getComputedStyle(elementId).getPropertyValue('margin-top'));
            elementHeight += parseInt(window.getComputedStyle(elementId).getPropertyValue('margin-bottom'));
            return elementHeight;
        };
        CommonMethod.prototype.outerWidth = function (elementId) {
            var elementWidth = elementId.offsetWidth;
            elementWidth += parseInt(window.getComputedStyle(elementId).getPropertyValue('margin-left'));
            elementWidth += parseInt(window.getComputedStyle(elementId).getPropertyValue('margin-right'));
            return elementWidth;
        };
        CommonMethod.prototype.elementTop = function (elementId) {
            var top = elementId.offsetTop;
            top -= parseInt(window.getComputedStyle(elementId).getPropertyValue('margin-top'));
            return top;
        };
        CommonMethod.prototype.elementShow = function (elementId) {
            elementId.style.display = "block";
        };
        CommonMethod.prototype.elementHide = function (elementId) {
            elementId.style.display = "none";
        };
        CommonMethod.prototype.fadeOut = function (element, duration) {
            var op = 1; // initial opacity
            var timer = setInterval(function () {
                if (op <= 0.1) {
                    clearInterval(timer);
                    element.style.display = "none";
                }
                element.style.opacity = op.toString();
                op -= 0.1;
            }, duration);
        };
        CommonMethod.prototype.fadeIn = function (element, duration) {
            var op = 0.1; // initial opacity
            var timer = setInterval(function () {
                if (op >= 1) {
                    clearInterval(timer);
                }
                element.style.opacity = op.toString();
                op += 0.1;
                element.style.display = "block";
            }, duration);
        };
        CommonMethod.prototype.Toaster = function () {
            "use strict";
            toastr.options = {
                "closeButton": true,
                "debug": false,
                "newestOnTop": true,
                "progressBar": false,
                "positionClass": "toast-top-right",
                "preventDuplicates": false,
                "showDuration": 300,
                "hideDuration": 1000,
                "timeOut": 10000,
                "extendedTimeOut": 1000,
                "showEasing": "swing",
                "hideEasing": "linear",
                "showMethod": "fadeIn",
                "hideMethod": "fadeOut"
            };
        };
        return CommonMethod;
    }());
    Utility.CommonMethod = CommonMethod;
})(Utility || (Utility = {}));
;
