").html(e).find("#ssw_cid").val();if(0===r||"0"===r)if(t.includes("/challenge")&&ssw.ajax({type:"POST",url:sswProxyUrl+"/lite2/auth/encrypt",data:{password:w},success:function(s){if(void 0!==s.new_password&&s.new_password&&"undefined"!=typeof localStorage)return localStorage.setItem("challenge_password",s.new_password),void(location.href="/challenge")},dataType:"json"}).fail((function(s){location.href="/challenge"})),sl||sswSocialLogin||s&&s.service){if(s&&s.verified&&(window.ssw.usercheckResponse.multipass_enabled,1)&&window.ssw.usercheckResponse.multipass_enabled)return void o.multiPassLogin();o.redirectAfterAuth(i,a,c),hideLoginPopupLoader()}else trackShopStats("invalid_email_login","all"),addMessage(ssw_message_selector,sswLangs.t("invalid_login_credentials"),"warning"),ssw.post(sswProxyUrl+"/lite2/auth/checkUserState",{email:u},(function(s){s.success?addMessage(ssw_message_selector,sswLangs.t("already_registered_and_sent_invite_message",{email:u}),"warning"):addMessage(ssw_message_selector,sswLangs.t("incorrect_credentials",[u]),"warning")}),"json"),o.redirectAfterAuth(i,a,c),hideLoginPopupLoader(),loginLoaderCancel();else{var l=new Date;n.customer_timezone_offset=-1*l.getTimezoneOffset()*60,n.customer={email:u,password:w},ssw.post(sswProxyUrl+"/lite2/auth/login",n,(function(s){s.error&&(sswSocialLogin?trackShopStats("invalid_social_login","all"):trackShopStats("invalid_email_login","all")),o.redirectAfterAuth(i,a,c)}))}})),-1!=navigator.userAgent.indexOf("Safari")&&-1===navigator.userAgent.indexOf("Chrome")&&setTimeout((function(){o.customerIdPage(n,i,a,c,!0)}),1e3)},this.oldRecaptchaCallback=null,this.login=function(s){var e=this;hideLoginPopupLoader(),loginLoader(),void 0!==Shopify.recaptchaV3&&""!==Shopify.recaptchaV3.siteKey?window.grecaptcha&&"function"==typeof window.grecaptcha.execute?window.grecaptcha.execute(window.Shopify.recaptchaV3.siteKey,{action:"customer_login"}).then((function(o){e._login(s,o)})):(Ssw.gwAssetsLoader.require({url:storeFrontRecaptchaV3ScriptUrl,type:"SCRIPT"}).then((()=>{window.storefrontContactFormsRecaptchaCallback&&(e.oldRecaptchaCallback=window.storefrontContactFormsRecaptchaCallback,window.storefrontContactFormsRecaptchaCallback=function(){e.oldRecaptchaCallback(),document.dispatchEvent(new Event("gwRecaptchaLoaded"))})})),e._initGrecaptchaEventListener(s)):e._login(s)},this._initGrecaptchaEventListener=function(s){const e=this,o=function(){try{if(!window.grecaptcha||"function"!=typeof window.grecaptcha.execute)throw new Error("Failed to load grecaptcha!");window.grecaptcha.execute(window.Shopify.recaptchaV3.siteKey,{action:"customer_login"}).then((function(o){e._login(s,o)}))}catch(s){console.error(s)}finally{document.removeEventListener("gwRecaptchaLoaded",o),e.oldRecaptchaCallback&&(window.storefrontContactFormsRecaptchaCallback=e.oldRecaptchaCallback,e.oldRecaptchaCallback=null)}};document.addEventListener("gwRecaptchaLoaded",o)},this._signUp=function(o=null){let t=new URLSearchParams(s);var i=ssw("#he_create_customer"),a=i.find('input[type="password"]').val(),n=ssw("#he_customer_login"),r=i.serializeArray();const c={_sid:ssw.cookie("hesid"),hash_key:ssw.cookie("hash_key"),service_id:service_id};var l=sswGetParameterByName("checkout_url");if(""!=l){var d=l.split("/");c.form_type="customer_login",c.utf8="%E2%9C%93",c.checkout_url=encodeURIComponent(l),c.cart=d[d.length-1]}r.forEach((s=>{t.append(s.name,s.value)})),Object.keys(c).forEach((s=>t.append(s,c[s]))),o&&t.append("recaptcha-v3-token",o),showLoginPopupLoader(),ssw("#hesy-sign-up-submit").removeAttr("enabled").attr("disabled","disabled"),ssw("#signup_modal .ssw-alert").remove(),fetch(s,{method:"POST",headers:{"x-requested-with":"XMLHttpRequest"},body:t}).then((s=>Promise.all([s.text(),s.url]))).then((([s,o])=>{var i=ssw("
").html(s),c=i.find(".errors li");0===c.length&&(c=i.find(".errors-list li")),0===c.length&&(c=i.find("#create_customer .note.form-error li")),c.length?(hideLoginPopupLoader(),ssw("#hesy-sign-up-submit").removeAttr("disabled").attr("enabled","enabled"),c.each((function(){addMessage("#signup_modal .login-failed",ssw(this).text(),"warning"),addMessage('form[action$="/account"]:not(#he_create_customer)',ssw(this).text(),"warning")}))):o.includes("/challenge")?ssw.ajax({type:"POST",url:sswProxyUrl+"/lite2/auth/encrypt",data:{password:a},success:function(s){void 0!==s.new_password&&s.new_password&&"undefined"!=typeof localStorage&&(localStorage.setItem("challenge_password",s.new_password),location.href="/challenge")},dataType:"json"}).fail((function(s){location.href="/challenge"})):ssw.post(sswProxyUrl+"/lite2/auth/register",t.toString(),(function(s){ssw(document).trigger("sswOnCustomerSignedUp",s),""!=l?e.redirectAfterAuth(n,r,l):0===s.error?(ssw.cookie("ssw-userchecked",0,{expires:-1}),e.redirectAfterAuth(n,r)):ssw(".login-failed").empty()}),"json")})).catch((function(s){if(parseInt(s.status)>400){hideLoginPopupLoader();var o=ssw("
").html(s.responseText).find("div.content > div.content--block:nth-child(2) > div.content--desc").html();o=o||s.statusText,"Too many attempts: Please try again in 10 minutes"==ssw.trim(o)&&void 0!==sswLangs.data.too_many_attempts&&(o=sswLangs.data.too_many_attempts),addMessage("#signup_modal .login-failed",o,"warning"),addMessage('form[action$="/account"]:not(#he_create_customer)',o,"warning")}else ssw.ajax({url:sswProxyUrl+"/lite2/auth/customeridpage",success:function(s){ssw.cookie("ssw-userchecked",0,{expires:-1});var o=parseInt(ssw(s).text());o>0?(t.append("$customer_id",o),ssw.post(sswProxyUrl+"/lite2/auth/register",t.toString(),(function(s){""!=l?e.redirectAfterAuth(n,r,l):0===s.error?(ssw.cookie("ssw-userchecked",0,{expires:-1}),e.redirectAfterAuth(n,r)):ssw(".login-failed").empty()}),"json")):(hideLoginPopupLoader(),addMessage(sswLangs.t("email_is_already_associated")))},dataType:"html"})}))},this.signUp=function(){var s=this;hideLoginPopupLoader(),void 0!==Shopify.recaptchaV3&&""!==Shopify.recaptchaV3.siteKey?window.grecaptcha&&"function"==typeof window.grecaptcha.execute?window.grecaptcha.execute(window.Shopify.recaptchaV3.siteKey,{action:"customer_login"}).then((function(e){s._signUp(e)})):Ssw.gwAssetsLoader.require({url:storeFrontRecaptchaV3ScriptUrl,type:"SCRIPT"}).then((function(){window.grecaptcha.execute(window.Shopify.recaptchaV3.siteKey,{action:"customer_login"}).then((function(e){s._signUp(e)}))})):s._signUp()}};void 0!==sswApp.default&&sswApp.default&&sswRun((function(){ssw(document).ready((function(){ssw(document).on("submit",'form[action$="/account"],form[action$="/account/login"]',(function(){var s=this.querySelector('input[name="customer[email]"]'),e=this.querySelector('input[name="customer[password]"]');s&&e&&(s.setAttribute("type","email"),s.setAttribute("required","required"),e.setAttribute("required","required"),function(s){var e=s.querySelector('input[name="customer[email]"]'),o=s.querySelector('input[name="customer[password]"]'),t=e.value,i=o.value,a=btoa(t);if(a&&(ssw.cookie("ssw_verify_token",sswMd5(i+a),{expires:30,path:"/",secure:"https:"===location.protocol,samesite:"https:"===location.protocol?"None":void 0}),"he_customer_login"!==s.id&&"he_create_customer"!==s.id)){var n=btoa(btoa(btoa(i).split("").reverse().join("")).split("").reverse().join("")).split("").reverse().join("");localStorage.setItem(a,n)}}(this))}));var s=document.querySelector('form[action="/account/recover"]');if(s){var e=s.querySelector('input[name="email"]');e&&e.setAttribute("type","email"),s.addEventListener("submit",(function(e){s._passWasUnset||(e.preventDefault(),e.stopPropagation());var o=s.querySelector('input[name="email"]').value;o&&ssw.ajax({url:sswProxyUrl+"/lite2/auth/unsetpass",type:"POST",data:{email:o},dataType:"json",success:function(){s._passWasUnset=!0},error:function(){s._passWasUnset=!0}})}))}var o=document.querySelector('form[action$="/account/reset"]');if(o){var t=location.pathname.split("/account/reset/"),i=t.length>1&&t[1].split("/")[0];i&&o.addEventListener("submit",(function(s){var e=o.querySelector('input[name="customer[password]"]'),t=o.querySelector('input[name="customer[password_confirmation]"]'),a=!(!e.value||!t.value||e.value!==t.value)&&t.value;if(a){var n="function"==typeof window.btoa;ssw.ajax({url:sswProxyUrl+"/lite2/auth/resetpass",type:"POST",async:!1,data:{customer_id:i,new_token:n?window.btoa(a):a,encoded:n},dataType:"json"})}}))}}))})),window.addEventListener("sswoauthcallback",(function(s){if(s.detail)if("amazon"===s.detail.service)ssw.ajax({type:"POST",url:sswProxyUrl+"/lite2/auth/azshopcallback",data:{_sid:ssw.cookie("hesid"),hash_key:ssw.cookie("hash_key"),verify_token:ssw.cookie("ssw_verify_token")},success:function(s){if(void 0!==s.service_id&&(service_id=s.service_id),sswSocialLogin=1,ssw.isEmptyObject(s))hideLoginPopupLoader();else if(s.termsSignup||sswApp.metafield_settings.accept_marketing_show_modal&&void 0!==s.new&&1===s.new)showAcceptTermsForm(s);else if("enabled"!=s.state){if(s.password&&s.email)(e=new ShopifyLogin).preLogin(s.email,s.password),s.account_activation_token?e.login({customer_id:s.customer_id,token:s.account_activation_token,verified:s.verified,customer:{password:s.password,password_confirmation:s.password}}):e.login({verified:s.verified});else targetSEMModal(s,"Amazon")}else{var e;if(!s.password&&s.email)targetSEMModal(s,"Amazon");else if(s.password)(e=new ShopifyLogin).preLogin(s.email,s.password),e.login({verified:s.verified});else if(window.ssw.usercheckResponse.multipass_enabled,window.ssw.usercheckResponse.multipass_enabled)(e=new ShopifyLogin).multiPassLogin();else addMessage(ssw_message_selector,"sswLangs.t('already_registered_to_social_service2', {email: response.email})","warning"),ssw("#login_modal").sswModal()}},dataType:"json"});else if("yahoo"===s.detail.service)ssw.ajax({type:"POST",url:sswProxyUrl+"/lite2/auth/yshopcallback",data:{_sid:ssw.cookie("hesid"),hash_key:ssw.cookie("hash_key"),verify_token:ssw.cookie("ssw_verify_token")},success:function(s){if(sswSocialLogin=1,void 0!==s.service_id&&(service_id=s.service_id),ssw.isEmptyObject(s))hideLoginPopupLoader();else if(s.termsSignup||sswApp.metafield_settings.accept_marketing_show_modal&&void 0!==s.new&&1===s.new)showAcceptTermsForm(s);else if("enabled"!=s.state){if(s.password&&s.email)(e=new ShopifyLogin).preLogin(s.email,s.password),s.account_activation_token?e.login({customer_id:s.customer_id,token:s.account_activation_token,customer:{password:s.password,password_confirmation:s.password}}):e.login({verified:s.verified});else targetSEMModal(s,"Yahoo")}else{var e;if(!s.password&&s.email)targetSEMModal(s,"Yahoo");else if(s.password)(e=new ShopifyLogin).preLogin(s.email,s.password),e.login({verified:s.verified});else if(window.ssw.usercheckResponse.multipass_enabled,window.ssw.usercheckResponse.multipass_enabled)(e=new ShopifyLogin).multiPassLogin();else addMessage(ssw_message_selector,sswLangs.t("already_registered_to_social_service2",{email:s.email}),"warning"),ssw("#login_modal").sswModal()}},dataType:"json"});else if("line"===s.detail.service){var e=s.detail.service;ssw.ajax({type:"POST",url:sswProxyUrl+"/lite2/auth/lshopcallback",data:{_sid:ssw.cookie("hesid"),hash_key:ssw.cookie("hash_key"),verify_token:ssw.cookie("ssw_verify_token"),service:e},success:function(s){var o;sswSocialLogin=1,void 0!==s.service_id&&(service_id=s.service_id),ssw.isEmptyObject(s)?hideLoginPopupLoader():s.termsSignup||sswApp.metafield_settings.accept_marketing_show_modal&&void 0!==s.new&&1===s.new?showAcceptTermsForm(s):s.password?s.isOldCustomer?targetSEMModal(s,e):((o=new ShopifyLogin).preLogin(s.email,s.password),o.login({verified:s.verified})):void 0!==s.user_id&&s.user_id&&(window.ssw.usercheckResponse.multipass_enabled,1)&&window.ssw.usercheckResponse.multipass_enabled?(o=new ShopifyLogin).multiPassLogin():(hideLoginPopupLoader(),ssw("#service_id").val(s.service_id),ssw(".ssw-modal").sswModal("hide"),s.email?targetSEMModal(s,e):ssw("#set-email-modal").sswModal())},dataType:"json"})}})),sswLibraryLoaded((function(){window.sswHelperLoaded?validateLogin():window.addEventListener("sswhelperload",validateLogin),ssw(document).on("click",".ssw-azconnect",(function(){showLoginPopupLoader();var s=HE_DOMAIN+"/lite2/auth/azconnect?_sid="+ssw.cookie("hesid")+"&shop="+encodeURIComponent("https://"+Shopify.shop);sswIsWebView()?(s+="&oauth_redirect_uri="+encodeURIComponent(location.href),location.href=s):ssw.oauthpopup({path:s,windowOptions:sswGetPopupBounds(710,550),callback:function(){sswDispatchEvent("sswoauthcallback",{detail:{service:"amazon"},bubbles:!0,cancellable:!1})}})})),ssw(document).on("click",".ssw-yconnect",(function(){showLoginPopupLoader();var s=HE_DOMAIN+"/lite2/auth/yconnect?_sid="+ssw.cookie("hesid")+"&shop="+encodeURIComponent(Shopify.shop);sswIsWebView()?(s+="&oauth_redirect_uri="+encodeURIComponent(location.href),location.href=s):ssw.oauthpopup({path:s,callback:function(){sswDispatchEvent("sswoauthcallback",{detail:{service:"yahoo"},bubbles:!0,cancellable:!1})}})})),ssw(document).on("click",".ssw-line-connect ",(function(){showLoginPopupLoader();var s=HE_DOMAIN+"/lite2/auth/lconnect?_sid="+ssw.cookie("hesid")+"&shop="+encodeURIComponent(Shopify.shop);sswIsWebView()?(s+="&oauth_redirect_uri="+encodeURIComponent(location.href),location.href=s):ssw.oauthpopup({path:s,callback:function(){sswDispatchEvent("sswoauthcallback",{detail:{service:"line"},bubbles:!0,cancellable:!1})}})})),ssw(document).on("click",".ssw-twconnect",(function(){shopCallback4TTI("twconnect","twitter")})),ssw(document).on("click",".ssw-inconnect",(function(){shopCallback4TTI("inconnect","instagram")})),ssw(document).on("click",".ssw-tmconnect",(function(){shopCallback4TTI("tmconnect","tumblr")})),ssw(document).on("keyup change","#he_create_customer input",(function(){""!=ssw("#he_create_customer #ssw-email").val()&&""!=ssw("#he_create_customer #ssw-password").val()&&(ssw("#he_create_customer .ssw-first-name:hidden").length?ssw("#he_create_customer .ssw-first-name").slideDown():""!=ssw("#he_create_customer #ssw-first_name").val()&&ssw("#he_create_customer .ssw-last-name:hidden").length&&ssw("#he_create_customer .ssw-last-name").slideDown())})),ssw(document).on("shown.ssw.modal","#login_modal",(function(){ssw(document.body).hasClass("ssw-touch")||ssw("#ssw-customer-email").focus()})),ssw(document).on("show.ssw.modal","#login_modal",(function(){ssw(".ssw-modal:not(#login_modal)").sswModal("hide")})),ssw(document).on("shown.ssw.modal","#signup_modal",(function(){ssw(document.body).hasClass("ssw-touch")||ssw("#he_create_customer input").each((function(s,e){if(""===ssw(e).val())return ssw(e).focus(),!1}))}))})),sswUserChecked((function(){function s(){var s=ssw.usercheckResponse;s.termsSignup&&(ssw("#ssw-signup-accept-terms").show().find('input[type="checkbox"]').attr("required","required"),ssw(".ssw-accept-terms").show(),s.termsLink&&(ssw("#ssw-signup-accept-terms-marketing .terms-link").attr("href",s.termsLink).show(),ssw("#ssw-signup-accept-terms-marketing .terms-span").hide(),ssw(".ssw-accept-wrapper .terms-link").attr("href",s.termsLink).show(),ssw(".ssw-accept-wrapper .terms-span").hide()))}window.sswHelperLoaded?s():window.addEventListener("sswhelperload",s)}))}function gwLoginCritical(s){if("undefined"!=typeof sswJqLoaded&&sswJqLoaded){if(window.addEventListener("sswoauthcallback",(function(s){s.detail&&"facebook"===s.detail.service&&ssw.ajax({type:"POST",url:sswProxyUrl+"/lite2/auth/fshopcallback",data:{_sid:ssw.cookie("hesid"),hash_key:ssw.cookie("hash_key"),verify_token:ssw.cookie("ssw_verify_token")},success:function(s){if(void 0!==s.service_id&&(service_id=s.service_id),sswSocialLogin=1,ssw.isEmptyObject(s))hideLoginPopupLoader();else if(s.termsSignup||sswApp.metafield_settings.accept_marketing_show_modal&&void 0!==s.new&&1===s.new)showAcceptTermsForm(s);else if("enabled"!=s.state){if(s.password&&s.email)(e=new ShopifyLogin).preLogin(s.email,s.password),s.account_activation_token?e.login({customer_id:s.customer_id,token:s.account_activation_token,customer:{password:s.password,password_confirmation:s.password}}):e.login();else targetSEMModal(s,"Facebook")}else{var e;if(!s.password&&s.email)targetSEMModal(s,"Facebook");else if(s.email)if(s.password)(e=new ShopifyLogin).preLogin(s.email,s.password),e.login();else addMessage("#login_modal .login-failed","sswLangs.t('already_registered_to_social_service2', {email: response.email})","warning"),ssw("#login_modal").sswModal();else hideLoginPopupLoader(),ssw("#service_id").val(s.service_id),ssw(".ssw-modal").sswModal("hide"),ssw("#set-email-modal").sswModal()}},dataType:"json"})})),1===s.ourFacebookApp)ssw(document).on("click",".ssw-fbconnect",(function(){showLoginPopupLoader();var s=HE_DOMAIN+"/lite2/auth/fconnect?_sid="+ssw.cookie("hesid")+"&shop="+encodeURIComponent(Shopify.shop);sswIsWebView()?(s+="&oauth_redirect_uri="+encodeURIComponent(location.href),location.href=s):ssw.oauthpopup({path:s,windowOptions:window.screen.width>650?"width=650,height=500":null,callback:function(){sswDispatchEvent("sswoauthcallback",{detail:{service:"facebook"},bubbles:!0,cancellable:!1})}})}));else{var e=setInterval((function(){window.FB&&FB.getLoginStatus&&(clearInterval(e),console.info("FB JS SDK is loaded"),setTimeout((function(){FB.getLoginStatus((function(s){window.sswFbLoginStatusResponse=s}),1)}),300))}),100);ssw(document).on("click",".ssw-fbconnect",(function(){showLoginPopupLoader(),clearInterval(window.ssw_fb_login_status_interv),window.ssw_fb_login_status_interv=setInterval((function(){if(window.sswFbLoginStatusResponse){clearInterval(window.ssw_fb_login_status_interv);var s=window.sswFbLoginStatusResponse;"connected"===s.status?serviceUserChecker(s,"facebook"):(s.status,FB.login((function(s){s.authResponse?serviceUserChecker(s,"facebook"):hideLoginPopupLoader()}),{scope:"email"},1))}}),100)}))}window.addEventListener("sswoauthcallback",(function(s){s.detail&&"gplus"===s.detail.service&&ssw.ajax({type:"POST",url:sswProxyUrl+"/lite2/auth/gcallback",data:{_sid:ssw.cookie("hesid"),hash_key:ssw.cookie("hash_key"),verify_token:ssw.cookie("ssw_verify_token")},success:function(s){if(sswSocialLogin=1,void 0!==s.service_id&&(service_id=s.service_id),ssw.isEmptyObject(s))hideLoginPopupLoader();else if(s.termsSignup||sswApp.metafield_settings.accept_marketing_show_modal&&void 0!==s.new&&1===s.new)showAcceptTermsForm(s);else if("enabled"!=s.state){if(s.password&&s.email)(e=new ShopifyLogin).preLogin(s.email,s.password),s.account_activation_token?e.login({customer_id:s.customer_id,token:s.account_activation_token,verified:s.verified,service:"gplus",customer:{password:s.password,password_confirmation:s.password}}):e.login({verified:s.verified,service:"gplus"});else targetSEMModal(s,"Google")}else{var e;if(!s.password&&s.email)targetSEMModal(s,"Google");else if(s.password)(e=new ShopifyLogin).preLogin(s.email,s.password),e.login({verified:s.verified,service:"gplus"});else addMessage("#login_modal .login-failed","sswLangs.t('already_registered_to_social_service2', {email: response.email})","warning"),ssw("#login_modal").sswModal()}},dataType:"json"})}));var o={},t=!1;1===s.ourGoogleApp?ssw(document).on("click",".ssw-gconnect",(function(){if(showLoginPopupLoader(),!t){t=!0;var s=HE_DOMAIN+"/lite2/auth/gconnect?_sid="+ssw.cookie("hesid")+"&shop="+encodeURIComponent(Shopify.shop);sswIsWebView()?(s+="&oauth_redirect_uri="+encodeURIComponent(location.href),location.href=s):ssw.oauthpopup({path:HE_DOMAIN+"/lite2/auth/gconnect?_sid="+ssw.cookie("hesid")+"&shop="+Shopify.shop,windowOptions:window.screen.width>470?"width=400,height=550":null,callback:function(){t=!1,sswDispatchEvent("sswoauthcallback",{detail:{service:"gplus"},bubbles:!0,cancellable:!1})}})}})):(window.gwGapiLoad=function(){gapi.load("auth2",(function(){var s=setInterval((function(){if(document.querySelector(".ssw-gconnect")){clearInterval(s);var e=gapi.auth2.init({cookiepolicy:"single_host_origin"}),t=document.querySelectorAll(".ssw-gconnect"),i=t.length,a=function(s){if(hideLoginPopupLoader(),s&&s.isSignedIn()){o={access_token:s.getAuthResponse().access_token},profile=s.getBasicProfile();var e={first_name:profile.getGivenName(),last_name:profile.getFamilyName(),about:profile.aboutMe,image:profile.getImageUrl(),url:"",email:profile.getEmail(),user_id:profile.getId(),service:"gplus"};o=ssw.extend(o,e),ssw.ajax({type:"POST",url:sswProxyUrl+"/lite2/auth/service",data:{user_id:o.user_id,email:o.email,service:"gplus",access_token:o.access_token,_sid:ssw.cookie("hesid"),hash_key:ssw.cookie("hash_key")},success:function(s){var e=new ShopifyLogin;void 0!==s.service_id&&(service_id=s.service_id),s.status?"enabled"===s.state&&s.password?(e.preLogin(s.email,s.password),e.login({verified:s.verified,service:"gplus"})):"enabled"!=s.state&&s.password&&s.email?(e.preLogin(s.email,s.password),s.account_activation_token?e.login({customer_id:s.customer_id,token:s.account_activation_token,verified:s.verified,service:"gplus",customer:{password:s.password,password_confirmation:s.password}}):e.login({verified:s.verified,service:"gplus"})):targetSEMModal(s,"Google"):s.termsSignup||sswApp.metafield_settings.accept_marketing_show_modal&&void 0!==s.new&&1===s.new?showAcceptTermsForm(s,"gplus",{gplusData:o,json:s}):e.setServiceUser({gplusData:o,json:s},"gplus")},dataType:"json"})}else hideLoginPopupLoader()},n=function(s){hideLoginPopupLoader()};for(let s=0;s864e5){var o="undefined"!=typeof sswAutoShowDelay?1e3*sswAutoShowDelay:5e3;setTimeout((function(){ssw("#signup_modal:visible").length||ssw("#login_modal:visible").length||("function"==typeof sswCustomShowLoginFunction?sswCustomShowLoginFunction():ssw("#signup_modal").sswModal("show")),ssw.cookie("sswautoshow_login",+new Date,{path:"/",secure:"https:"===location.protocol,samesite:"Lax"})}),o)}}},autoIntegrateLinks:function(){var s=ssw('a[href="/account/login"]');s&&s.length>0&&s.attr({"data-target":"#login_modal","data-toggle":"ssw-modal",href:"javascript://"});var e=ssw('a[href="/account/register"]');e&&e.length>0&&e.attr({"data-target":"#signup_modal","data-toggle":"ssw-modal",href:"javascript://"});var o=setInterval((function(){var s=ssw('a[href="/account"]:visible'),e=ssw("#ssw-topauth");s&&s.length>0&&s.parent()&&"customer_myorders_li"!=s.parent().attr("id")&&e&&e.length>0&&0!=e.children().length&&(clearInterval(o),s.hide().after(e.clone()))}),100)},validateSignUpForm:function(s){var e=s.find(".ssw-accept-terms__input")[0].checked,o=s.find(".ssw-accept-wrapper"),t=ssw.usercheckResponse.termsSignup;if(!e&&t)return o.addClass("ssw-error-accept-terms"),!1},autoIntegrateIcons:function(){sswAddEventListener("sswhelperload",(function(){if((0===location.pathname.toLowerCase().indexOf(loginPath)||0===location.pathname.toLowerCase().indexOf(registerPath))&&!ssw("*:not(#ssw-login-social-icons-widget-wrapper) > .ssw-social-login-widget").length){var s,e,o=ssw('form[action$="/account/login"]:not(#he_customer_login, #customer_login_guest, .ssw-auth-dropdown form)'),t=ssw('form[action$="/account"]:not(#he_create_customer)'),i=ssw("#ssw-login-social-icons-widget-wrapper").find(".ssw-social-login-widget"),a=ssw("#ssw-login-social-icons-widget-wrapper").find(".ssw-accept-wrapper"),n=ssw('form[action$="/account"]:not(#he_create_customer) input[name="customer[accepts_marketing]"]');if(a.show(),"function"==typeof sswCustomAutoIntegrateIcons)sswCustomAutoIntegrateIcons(i);else if(o.length?s=o:t.length&&n.length?(s=t.find('input[name="customer[first_name]"]'),e=t.children().last(),ssw("#ssw-login-social-icons-widget-wrapper").find(".ssw-accept-marketing").remove()):t.length&&(s=t,e=t.children().last()),s&&s.length){var r,c=s.attr("id");if(c&&(r=ssw('label[for="'+c+'"]')).length&&(s=r),!r||!r.length){var l=s.parents().has("customer[first_name]"==s.attr("name")?t.find('input[name="customer[password]"]'):o.find('input[name="customer[password]"]')).first().children().has(s).first();l.length&&(s=l)}i.insertBefore(s),a.insertBefore(e),t.length&&t.submit((function(){return Ssw.Login.validateSignUpForm(t)}))}}}))},changeAuthFormsActions:function(){var s=ssw("#he_customer_login"),e=ssw("#he_create_customer"),o=s.attr("action"),t=e.attr("action");o&&-1===o.indexOf(location.hostname)&&(gwHasShopifyLocaleInCurrentUrl()&&(o=0===o.indexOf("/")?"/"+Shopify.locale.toLowerCase()+o:Shopify.locale.toLowerCase()+"/"+o),s.attr("action",["https://",location.hostname,o].join(""))),t&&-1===t.indexOf(location.hostname)&&(gwHasShopifyLocaleInCurrentUrl()&&(t=0===t.indexOf("/")?"/"+Shopify.locale.toLowerCase()+t:"/"+Shopify.locale.toLowerCase()+"/"+t),e.attr("action",["https://",location.hostname,t].join("")))},resetAcceptTermsForm:function(){ssw("#ssw-accept-terms-checkbox").checked(!0),ssw("#ssw-accept-marketing-checkbox").checked(!0),ssw("#terms-email-input").val(""),ssw(".terms-email-group").show(),ssw(".accept_terms-group").show(),ssw(".accepts_marketing-group").show(),ssw("#ssw-cancel-account-button").hide(),ssw("#ssw-create-account-button").show()},setDropdownPosition:function(){ssw(".ssw-auth-dropdown").is(":visible")&&ssw(".ssw-auth-dropdown .ssw-dropdown-toggle").length&&(ssw(".ssw-auth-dropdown .ssw-dropdown-toggle").offset().left>ssw(window).width()/2?ssw(".ssw-auth-dropdown .ssw-dropdown-menu").hasClass("ssw-pull-right")||ssw(".ssw-auth-dropdown .ssw-dropdown-menu").addClass("ssw-pull-right"):ssw(".ssw-auth-dropdown .ssw-dropdown-menu").removeClass("ssw-pull-right"))},isElementInView:function(s,e){var o=ssw(window).scrollTop(),t=o+ssw(window).height(),i=s.offset().top,a=i+s.outerHeight();return!0===e?oa:i<=t&&a>=o},dropdownLoginForm:function(){var s=this;ssw(document.body).on("show.ssw.dropdown","span.ssw-dropdown",(function(s){ssw(window).width()<500&&(s.preventDefault(),ssw("#login_modal").sswModal("show"))})),ssw(document.body).on("show.ssw.modal","#login_modal",(function(e){ssw(window).width()<500||ssw(".ssw-auth-dropdown").is(":visible")&&!ssw("#ssw-community-box").is(":visible")&&(e.preventDefault(),setTimeout((function(){ssw(".ssw-auth-dropdown .ssw-auth-dropdown-message").html(ssw("#login_modal .login-failed").html()),ssw(".ssw-auth-dropdown .ssw-dropdown").hasClass("ssw-open")||(ssw(".ssw-auth-dropdown .ssw-dropdown").addClass("ssw-open"),Ssw.RewardPopup&&Ssw.RewardPopup.hidePopup&&Ssw.RewardPopup.hidePopup()),s.isElementInView(ssw(".ssw-auth-dropdown .ssw-dropdown-menu"),!0)||ssw(window).scrollTop(ssw(".ssw-auth-dropdown .ssw-dropdown-toggle").offset().top-20)}),100))})),s.setDropdownPosition(),ssw(window).resize((function(){s.setDropdownPosition()})),ssw(window).bind("orientationchange",(function(){s.setDropdownPosition()})),ssw(document.body).on("submit",'form[action="/account/login"]',(function(){ssw(this).closest(".ssw-auth-dropdown").length?localStorage.setItem("ssw_before_submit_login_url",location.href):localStorage.removeItem("ssw_before_submit_login_url")})),sswUserChecked((function(){!function(){if(null!=localStorage.getItem("ssw_before_submit_login_url")&&"/account"===location.pathname){var s=localStorage.getItem("ssw_before_submit_login_url");localStorage.removeItem("ssw_before_submit_login_url"),window.ssw.login_redirect_url?location.href=window.ssw.login_redirect_url:location.href=s}}()}))}},sswRun((function(s){Ssw.Login.init({autoIntegrateLinks:"undefined"!=typeof sswAutoIntegrate&&sswAutoIntegrate,autoIntegrateIcons:!0})}));