var NewsletterSubscribe;(function(n){var t=function(){function n(n,t){var i=this;this.jqueryElement=n;this.subscribedTo=t.subscribedTo;this.email=ko.observable("");this.formSubmitted=ko.observable(!1);this.showIsRequired=ko.observable(!1);this.showIsWrongFormat=ko.observable(!1);this.recaptchaInputSelector=t.recaptchaInputSelector;this.recaptchaSiteKey=t.recaptchaSiteKey;ko.applyBindings(this,this.jqueryElement[0]);jQuery(this.jqueryElement).on("keyup","[data-selector='subscribe-email-box']",function(n){return i.onSubscribeEmailBoxKeypress(n)})}return n.prototype.handleInlineSubscribe=function(){var n=this,t;Components.EmailValidationHelper.validateEmailAndUpdateObservableTextValidation(this.email(),this.showIsRequired,this.showIsWrongFormat)&&(t=jQuery(this.recaptchaInputSelector).val().toString(),Components.ReCaptchaHelper.validateCaptcha(t).done(function(t){if(t)n.jqueryElement.find("[data-selector='submit-form-loader']").show(),Components.Marketo.NewsletterSubscribeFormHelper.submitNewsletterSubscribeForm(n.email(),"InlineNewsletterSubscribe",n.subscribedTo,function(){n.jqueryElement.find("[data-selector='submit-form-loader']").hide();n.formSubmitted(!0);grecaptcha.execute(n.recaptchaSiteKey,{action:"recaptcha"}).then(function(n){jQuery(".recaptcha").val(n)})});else return}).fail(function(){return}))},n.prototype.onSubscribeEmailBoxKeypress=function(n){n.keyCode===13&&this.handleInlineSubscribe()},n}();n.NewsletterSubscribeComponent=t})(NewsletterSubscribe||(NewsletterSubscribe={}))