(function($,gglcptch){gglcptch=gglcptch||{};gglcptch.prepare=function(){$('.gglcptch_v2, .gglcptch_invisible').each(function(){var container=$(this).find('.gglcptch_recaptcha');if(container.is(':empty')&&(gglcptch.vars.visibility||$(this).is(':visible')===$(this).is(':not(:hidden)'))){var containerId=container.attr('id');gglcptch.display(containerId)}});if('v3'==gglcptch.options.version){grecaptcha.ready(function(){grecaptcha.execute(gglcptch.options.sitekey,{action:'BWS_reCaptcha'}).then(function(token){document.querySelectorAll("#g-recaptcha-response").forEach(function(elem){elem.value=token});if(!$('body').hasClass('wp-admin')){var gglcptchTimeout=setTimeout(function(){$('.gglcptch_error_text').each(function(){$(this).show();clearTimeout(gglcptchTimeout)})},180000)}})})} if('v2'==gglcptch.options.version||'invisible'==gglcptch.options.version){$('.g-recaptcha').each(function(){if($(this).html()===''&&$(this).text()===''){var container=$(this).attr('id');if(typeof container=='undefined'){container=get_id();$(this).attr('id',container)} var sitekey=$(this).attr('data-sitekey'),theme=$(this).attr('data-theme'),lang=$(this).attr('data-lang'),size=$(this).attr('data-size'),type=$(this).attr('data-type'),tabindex=$(this).attr('data-tabindex'),callback=$(this).attr('data-callback'),ex_call=$(this).attr('data-expired-callback'),stoken=$(this).attr('data-stoken'),params=[];params.sitekey=sitekey?sitekey:gglcptch.options.sitekey;if(!!theme){params.theme=theme} if(!!lang){params.lang=lang} if(!!size){params.size=size} if(!!type){params.type=type} if(!!tabindex){params.tabindex=tabindex} if(!!callback){params.callback=callback} if(!!ex_call){params['expired-callback']=ex_call} if(!!stoken){params.stoken=stoken} gglcptch.display(container,params)}});$('form').each(function(){if($(this).contents().find('iframe[title="recaptcha widget"]').length>1&&!$(this).children('.gglcptch_dublicate_error').length){$(this).prepend('
'+gglcptch.options.error+'

\n')}})}};gglcptch.display=function(container,params){if(typeof(container)=='undefined'||container==''||typeof(gglcptch.options)=='undefined'){return} if('v2'===gglcptch.options.version&&$('#'+container).parents('.gglcptch_custom').length>0){if($('#'+container).find('textarea#g-recaptcha-response').length==0){setTimeout(function(){$('#'+container).find('textarea#g-recaptcha-response').remove()},1000)}else{$('#'+container).find('textarea#g-recaptcha-response').remove()} $('.gglcptch.gglcptch_v2 noscript').remove()} if('v2'===gglcptch.options.version&&gglcptch.options.disable){$('#'+container).closest('form').find('input:submit, button').prop('disabled',!0);if('setupform'===$('#'+container).closest('form').attr('id')){setTimeout(function(){$('#'+container).closest('form').find('input:submit, button').prop('disabled',!0)},200)}} function storeEvents(el){var target=el,events=$._data(el.get(0),'events');if(typeof events!='undefined'){var storedEvents={};$.extend(!0,storedEvents,events);target.off();target.data('storedEvents',storedEvents)} if('undefined'!=typeof target.attr('onclick')){target.attr('gglcptch-onclick',target.attr('onclick'));target.removeAttr('onclick')}} function restoreEvents(el){var target=el,events=target.data('storedEvents');if(typeof events!='undefined'){for(var event in events){for(var i=0;i=10){clearInterval(gglcptch_timer)}},1000);function gglcptch_prepare(){if(typeof Recaptcha!="undefined"||typeof grecaptcha!="undefined"){try{gglcptch.prepare()}catch(err){console.log(err)}}} $(window).on('load',gglcptch_prepare);$('.woocommerce').on('click','.woocommerce-tabs',gglcptch_prepare);$('#recaptcha_widget_div').on('input paste change','#recaptcha_response_field',cleanError)});function cleanError(){$error=$(this).parents('#recaptcha_widget_div').next('#gglcptch_error');if($error.length){$error.remove()}} function get_id(){var id='gglcptch_recaptcha_'+Math.floor(Math.random()*1000);if($('#'+id).length){id=get_id()}else{return id}}})(jQuery,gglcptch)