var loader=new function(){var n=this,t=$(".main-content .preloader-background");n.showLoader=function(n){var i,r;$(n).css("min-height","60px");t&&(i=t.clone(),i.appendTo(n),i.addClass("active"),r=i.find(".preloader-wrapper:first"),r&&r.addClass("active"))};n.hideLoader=function(n){$(n).css("min-height","");var t=$(n).find(".preloader-background");t&&t.remove()}},info_toggle=new function(){var n=this;n.showInfo=function(n,t,i,r){var u,f;i||(i=4e3);u="toast-info";u+=t?" light-green":" red darken-2";f={html:n,displayLength:i,classes:u,completeCallback:r};M.toast(f)}},helper=new function(){var n=this;n.emptyGuid="00000000-0000-0000-0000-000000000000";n.convertJsonDate=function(n){try{return new Date(parseInt(n.substr(6)))}catch(i){return undefined}};n.disableLink=function(n){setTimeout(function(){var t=$(n);t.attr("disabled","disabled")},500);setTimeout(function(){var t=$(n);t.removeAttr("disabled")},2e3)};n.formatDate=function(n){var r,t,i;try{return r=n.getFullYear(),t=(1+n.getMonth()).toString(),t=t.length>1?t:"0"+t,i=n.getDate().toString(),i=i.length>1?i:"0"+i,t+"/"+i+"/"+r}catch(u){return undefined}};n.formatJsonDate=function(t){var i="",r=n.convertJsonDate(t);return r&&(i=n.formatDate(r)),i};n.htmlEncode=function(n){return $("<div/>").text(n).html()};n.parseReponseHeader=function(n){var i=n.getResponseHeader("X-Responded-JSON"),t;return i&&(t=jQuery.parseJSON(i),t&&t.status===401&&location.reload()),!0};n.ajaxGet=function(t,i,r){$.ajax({url:t,cache:!1}).done(function(t,r,u){n.parseReponseHeader(u)&&i&&i(t)}).fail(function(n,t,i){r&&r(n,t,i)})};n.ajaxPost=function(t,i,r,u){$.post(t,i).done(function(t,i,u){n.parseReponseHeader(u)&&r&&r(t)}).fail(function(n,t,i){u&&u(n,t,i)})};n.parseDateToLocal=function(n){n&&$("#"+n+" .utc-date").each(function(){var t=null,n=null,i=$(this).data("format");i||(i="LL");$(this).is("input")?(t=$(this).val(),n=moment(t).format(i),$(this).val(n),$(this).attr("value",n)):(t=$(this).text(),n=moment(t).format(i),$(this).text(n))})};n.stopPropagation=function(n){n&&(typeof n.stopPropagation=="function"?n.stopPropagation():n.cancelBubble=!0)};n.uniqueId=function(){return"id-"+Math.random().toString(36).substr(2,16)};n.loadAsyncPartialView=function(n,t){var i=$(n),r;i&&i.length>0&&(r=i.data("url"),r&&r.length>0&&(i.removeClass("partial-view"),loader.showLoader(n),helper.ajaxGet(r,function(r){i.html(r);loader.hideLoader(n);t&&t()})))};n.addInvalid=function(n,t){var i=$(n);i.length&&(i.parent(".form-input-wrapper").length||i.wrap($(document.createElement("div")).addClass("form-input-wrapper").outerWidth(i.outerWidth())),i.hasClass("invalid")||i.addClass("invalid").after($(document.createElement("span")).addClass("invalid-message").attr("id","span").attr("role","alert").html(t)))};n.removeInvalid=function(n){var t=$(n);t.length&&(t.removeClass("invalid"),t.siblings(".invalid-message").remove())};n.removeAllInvalid=function(){var n=$(".invalid");n.each(function(n,t){var i=$(t),r=i.siblings(".invalid-message");r.length&&(i.removeClass("invalid"),r.remove())})};n.clearAlert=function(){var n=$(".alert-wrapper");n.length&&(n.addClass("d-none"),n.find(".alert-body").html(""))};n.showAlert=function(n){var i=$(".alert-wrapper"),t=$(".alert-body");t.html(n);i.removeClass("d-none");t.removeClass("d-none")};n.getRecaptchaToken=function(n,t){grecaptcha.ready(function(){var i=document.getElementById("hidReCaptchaSiteKey"),r=i.value;grecaptcha.execute(r,{action:n}).then(function(n){t&&t(n)})})}}