var promiseITI=$.Deferred(),itiLoaded=!1,formsLoading=!1,formsLoaded=!1,itis=[],phoneinputs=null;function AjaxGetForms(){let e=[];$(".ajax_form").each((function(){null!=$(this).attr("data-id")&&($(this).hasClass("ajax_form_mobile")&&$(window).outerWidth()>768||e.push([$(this).attr("data-id"),$(this).attr("data-classes")]))})),e.length>0&&$.ajax({type:"GET",url:mainlocalize.ajaxurl,dataType:"json",data:{formdata:e,action:"AjaxGetForm"},success:function(e,t,o){let n=document.querySelectorAll(".ajax_form");for(var i=0;i form").each((function(){wpcf7.init(this),wpcf7.cached&&wpcf7.refill(this)}))}function formToPopup(){$(window).width()<600?($(".b2broker_form_selector").addClass("form-box-hide"),$(".b2broker_form_selector").removeClass("form-box-privacy-show")):($(".b2broker_form_selector").removeClass("form-box-hide"),$(".b2broker_form_selector").addClass("form-box-privacy-show"))}function setAmo(){for(var e=document.getElementsByTagName("form"),t=0;t'));var a=null!==e[t].querySelector(".amo_code");a?e[t].querySelector(".amo_code").value=n:(a=n,$(e[t]).append(''))}}function positionPhoneLabels(){for(var e=document.querySelectorAll(".new_form__label__phone_select .new_form__placeholder"),t=document.querySelectorAll(".new_form__label__phone_select .iti__flag-container"),o=0;o()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(e)}function sizeLimit(e){for(let t in e){let o=(e[t].size/1024/1024).toFixed(4);if(!isNaN(o)){if(!("item"!=e[t].name&&void 0!==e[t].name&&o<=5))return $(".wrapper_more_file").parent().append('

Filesize error. < 5mb

'),!1;0}}return!0}function getCookie(e){let t=e+"=",o=decodeURIComponent(document.cookie).split(";");for(let e=0;e{}),"json").always((function(o){t=o&&o.data&&o.data.countryCode?o.data.countryCode:"us",e(t)})):e(t||"us")},customPlaceholder:function(){return""},utilsScript:window.location.protocol+"//"+window.location.hostname+"/app/themes/b2broker-child/frontend/intlTelInput/js/utils.js?v=2"})),phoneinputs[e].addEventListener("input",(function(){phoneinputs[e].nextSibling.value=itis[e].getNumber()}),!0),$(document).on("click",".iti__country-list",(function(){setTimeout((()=>{phoneinputs[e].nextSibling.value=itis[e].getNumber()}),100)})),$(document).on("click",".iti__country",(function(){console.log(itis[e].getSelectedCountryData()),phoneinputs[e].parentNode.parentNode.parentNode.parentNode.querySelector(".amo_country").value=itis[e].getSelectedCountryData().name,phoneinputs[e].parentNode.parentNode.parentNode.parentNode.querySelector(".amo_code").value=itis[e].getSelectedCountryData().dialCode}));itis[itis.length-1].promise.then((()=>{promiseITI.resolve()}))}}$((function(){$(document).on("focus click","input.wpcf7-not-valid",(function(){$(this).removeClass("wpcf7-not-valid")})),$(document).on("focus click",".wpcf7-not-valid input+b",(function(){$(this).parents(".wpcf7-form-control").removeClass("wpcf7-not-valid")})),$.when(promiseAjaxFooter).then((function(){AjaxGetForms(),$(window).on("scroll mousemove touchstart",(function(){loadITI()}));for(var e=document.querySelectorAll('[name="customer-phone"]'),t=0;t0&&validateEmail(n.find('input[name="email"]').val())&&Fancybox.show([{src:"#modalSubscribe",type:"inline"}]):Fancybox.show([{src:"#modal4",type:"inline"}]),"undefined"!=typeof fbq&&fbq("track","Lead")}),!0);let o=document.querySelectorAll(".phone");for(let e=0;e