PageSourceSearch

https://www.philips.co.uk/_ui/responsive/common/js/checkout.js?id=f1789893287809

js philips.co.uk collected 2026-10-01 10:26:08 UTC 184,474 bytes, 2 lines download raw bytes

1function mphTrackAjax_pageName(e){trace("mphTrackAjax_pageName("+e+")")}function trace(e){Philips.janrainWidget.traceEnabled&&"object"==typeof console&&void 0!==console.log&&console.log(e)}function checkForProperty(e,t){void 0===e&&trace("[!] Missing property '"+t+"'")}function janrainCaptureWidgetOnLoad(){$(".capture_btn").on("click",function(){$(".errorMessage").css("display","none"),$(".capture_form_error").css("display","none")}),janrain.capture.ui.start(),janrain.events.onCaptureSessionFound.addHandler(function(){trace("onCaptureSessionFound")}),janrain.events.onCaptureSessionNotFound.addHandler(function(e){trace("onCaptureSessionNotFound"),trace(e)}),janrain.events.onCaptureLoginSuccess.addHandler(function(e){trace("onCaptureLoginSuccess"),trace("User has success fully logged in and we can now retrieve user detail from janrain API(ServerSide) with accessToken: "+e.accessToken),trace("success uri = "+janrain.settings.capture.successUri),Philips.myphilips.janrain.onCaptureLoginSuccess(e)}),janrain.events.onCaptureSaveSuccess.addHandler(function(e){trace("onCaptureSaveSuccess"),trace("save success handler "+e),trace("success uri = "+janrain.settings.capture.successUri),Philips.myphilips.janrain.onCaptureSaveSuccess(e,janrain.settings.currentScreenName)}),janrain.events.onCaptureLoginFailed.addHandler(function(){trace("onCaptureLoginFailed"),janrain.customError=!0,ACC.phicustom.loginfailure()}),janrain.events.onCaptureServerValidationFailed.addHandler(function(e){trace("onCaptureServerValidationFailed"),trace(e)}),janrain.events.onProviderLoginToken.addHandler(function(e){e&&e.janrainWidgetParameters&&e.janrainWidgetParameters.provider&&(trace("onProviderLoginToken="+e.janrainWidgetParameters.provider),(e=e.janrainWidgetParameters.provider)&&(Philips.myphilips.loggedInProvider=e),document.getElementById("sm3").innerHTML=e)}),janrain.events.onProviderLoginStart.addHandler(function(e){trace("Login with '"+e.provider+"'")}),janrain.events.onProviderLoginError.addHandler(function(e){trace("onProviderLoginError"),Philips.myphilips.janrain.onProviderLoginError(e)}),janrain.events.onCaptureValidationFailed.addHandler(function(e){trace("validation Failed"),Philips.myphilips.janrain.onCaptureValidationFailed(e)}),janrain.events.onCaptureError.addHandler(function(e){trace("onCaptureError"),trace(e)}),janrain.events.onCaptureRegistrationSuccess.addHandler(function(e){trace("onCaptureRegistrationSuccess"),Philips.myphilips.janrain.onCaptureRegistrationSuccess(e)}),janrain.events.onReturnExperienceFound.addHandler(function(e){trace("onReturnExperienceFound"),trace(e),trace("sinetubg")}),janrain.events.onCaptureScreenShow.addHandler(function(e){trace("onCaptureScreenShow"),trace(e)}),janrain.events.onCaptureRenderComplete.addHandler(function(e){var t=$(".janrainwidget");$(".other-options").show(),$(".janrainwidget #loader").css("display","none"),t.removeClass("ph-janrain--loading"),"createAccount"!==janrain.settings.currentScreenName&&"#createaccount"!==janrain.settings.currentScreenName&&"#createaccount"===window.location.hash&&($(".ph-login-switch__item").removeClass("ph-login-switch__item--active"),$(".ph-login-switch").find("li:nth-child(2)").addClass("ph-login-switch__item--active"),Philips.myphilips.janrain.toggleRegister()),$(".ph-login-switch, .ph-loginrightsection").removeClass("hidden"),""!==t.attr("data-email")&&($(".capture_traditionalSignIn_emailAddressOrMobile").val(t.attr("data-email")),$(".capture_form_item_traditionalSignIn_emailAddressOrMobile").addClass("capture_validated")),Philips.myphilips.janrain.passwordResetUrl=janrain.settings.capture.redirectUri,Philips.myphilips.janrain.confirmationUrl=janrain.settings.capture.activateUri,Philips.myphilips.janrain.onCaptureRenderComplete(e,janrain.settings.currentScreenName)})}window.philips=window.philips||{},philips.hybris=philips.hybris||{},window.Philips||(window.Philips={}),Philips.myphilips||(Philips.myphilips={}),Philips.myphilips.janrain||(Philips.myphilips.janrain={}
1),Philips.myphilips.janrain.toggleLogin=function(){var e=$("#registrationSuccess_loginplaceholder").html(),t=$(".registrationSuccess").html();$("#registrationSuccess").html(e),$(".registrationSuccess").html(t);e=$("#mergeAccounts_loginplaceholder").html(),t=$(".mergeAccounts").html();$("#mergeAccounts").html(e),$(".mergeAccounts").html(t);e=$("#resendVerification_loginplaceholder").html(),t=$(".resendVerification").html();$("#resendVerification").html(e),$(".resendVerification").html(t);e=$("#socialRegistrationNoEmail_emailFound_loginplaceholder").html(),t=$(".socialRegistrationNoEmail_emailFound").html();$("#socialRegistrationNoEmail_emailFound").html(e),$(".socialRegistrationNoEmail_emailFound").html(t);e=$("#socialRegistrationNoEmail_almostDone_loginplaceholder").html(),t=$(".socialRegistrationNoEmail_almostDone").html();$("#socialRegistrationNoEmail_almostDone").html(e),$(".socialRegistrationNoEmail_almostDone").html(t);e=$("#socialRegistrationNoEmail_createNewAccount_loginplaceholder").html(),t=$(".socialRegistrationNoEmail_createNewAccount").html();$("#socialRegistrationNoEmail_createNewAccount").html(e),$(".socialRegistrationNoEmail_createNewAccount").html(t);e=$("#socialRegistrationNoEmailFinish_loginplaceholder").html(),t=$(".socialRegistrationNoEmailFinish").html();$("#socialRegistrationNoEmailFinish").html(e),$(".socialRegistrationNoEmailFinish").html(t);e=$("#traditionalAuthenticateMerge_loginplaceholder").html(),t=$(".traditionalAuthenticateMerge").html();$("#traditionalAuthenticateMerge").html(e),$(".traditionalAuthenticateMerge").html(t),$(".ph-loginbanner, .ph-registrationbanner").toggle(),$("#traditionalRegistrationBlank").hide(),janrain.capture.ui.renderScreen("signIn")}
1,Philips.myphilips.janrain.toggleRegister=function(){var e=$("#registrationSuccess").html(),t=$(".registrationSuccess_register").html();$("#registrationSuccess_loginplaceholder").html(e),$("#registrationSuccess").html(t);e=$("#mergeAccounts").html(),t=$(".mergeAccounts_register").html();$("#mergeAccounts_loginplaceholder").html(e),$("#mergeAccounts").html(t);e=$("#resendVerification").html(),t=$(".resendVerification_register").html();$("#resendVerification_loginplaceholder").html(e),$("#resendVerification").html(t);e=$("#socialRegistrationNoEmail_emailFound").html(),t=$(".socialRegistrationNoEmail_emailFound_register").html();$("#socialRegistrationNoEmail_emailFound_loginplaceholder").html(e),$("#socialRegistrationNoEmail_emailFound").html(t);e=$("#socialRegistrationNoEmail_almostDone").html(),t=$(".socialRegistrationNoEmail_almostDone_register").html();$("#socialRegistrationNoEmail_almostDone_loginplaceholder").html(e),$("#socialRegistrationNoEmail_almostDone").html(t);e=$("#socialRegistrationNoEmail_createNewAccount").html(),t=$(".socialRegistrationNoEmail_createNewAccount_register").html();$("#socialRegistrationNoEmail_createNewAccount_loginplaceholder").html(e),$("#socialRegistrationNoEmail_createNewAccount").html(t);e=$("#socialRegistrationNoEmailFinish").html(),t=$(".socialRegistrationNoEmailFinish_register").html();$("#socialRegistrationNoEmailFinish_loginplaceholder").html(e),$("#socialRegistrationNoEmailFinish").html(t);e=$("#traditionalAuthenticateMerge").html(),t=$(".traditionalAuthenticateMerge_register").html();$("#traditionalAuthenticateMerge_loginplaceholder").html(e),$("#traditionalAuthenticateMerge").html(t),janrain.settings.currentScreenName="createAccount",janrain.fromPage="login",$(".ph-loginbanner, .ph-registrationbanner").toggle(),$("#signIn").hide(),janrain.capture.ui.renderScreen("traditionalRegistrationBlank")},Philips.myphilips.janrain.toggleSocialButton=function(e){var t=$(e).parent(),i=$(t).parent().find(".inner-container")[0],a=$(i).find("a").length;a%2!=0&&a++,$(e).hasClass("more")?($(t).find("a.more").hide(),$(t).find("a.less").show(),$(i).animate({height:20*a+"px"},200)):($(t).find("a.more").show(),$(t).find("a.less").hide(),$(i).animate({height:"75px"},200))},Philips.myphilips.janrain.showServiceLoader=function(e){"popup"===e?$("#janrainModal").find(".capture_header").parent().append('<div class="container-service-loader-popup"><img src="/_ui/responsive/theme-b2c-campaigns/images/loadingimage.gif"></div>'):$("#loader").parent().prepend('<div class="container-service-loader"><img src="/_ui/responsive/theme-b2c-campaigns/images/loadingimage.gif"></div>')},Philips.myphilips.janrain.hideServiceLoaders=function(){$(".container-service-loader-popup").remove(),$(".container-service-loader").remove()},Philips.myphilips.janrain.showFirstTimeLoginPopup=function(){var e=$
1("#firstTimeLogin");janrain.capture.ui.modal.close(),0===$("#closeFirstTimeLoginPopup").length&&trace("[!] popup not found for first time login"),e.css("top","160px"),$("#lightBackground").css({display:"block",width:screen.width,height:$(document).height(),opacity:.7}),e.css({display:"block",left:screen.width/2-245}),$("#passwordForgotEmailId").focus(),e.dropShadow(),$("#accountLogin").css({display:"none"}),$("#accountLogin_dropShadow").css({display:"none",left:screen.width/2-245}),$("#closeFirstTimeLoginPopup").click(function(){$("#firstTimeLogin").css({display:"none"}),$("#lightBackground").css({display:"none"}),$("#firstTimeLogin_dropShadow").css({display:"none"})})},Philips.myphilips.janrain.redirectToSuccessUrl=function(e){trace(">>redirectToSuccessUrl(sURL):"),trace(e),window.location.replace(e)},Philips.myphilips.janrain.onProviderLoginError=function(e){$(".errorMessage").html(e.err.msg).show()},Philips.myphilips.janrain.onCaptureLoginSuccess=function(e){trace(">>onCaptureLoginSuccess(result):"),trace('socialmedia="'+Philips.myphilips.loggedInProvider+'"'),""!==Philips.myphilips.loggedInProvider?void 0!==philips.analytics&&philips.analytics.trackConversion({name:"user_login",description:Philips.myphilips.loggedInProvider}):void 0!==philips.analytics&&philips.analytics.trackConversion({name:"user_login"}),Philips.myphilips.janrain.showServiceLoader("");e=$('<form action="'+janrain.settings.capture.successUri+'" method="post"><input type="hidden" name="j_username" value="'+e.userData.email+'" /><input type="hidden" name="j_password" value="'+e.accessToken+'"/></form>');$("body").append(e),e.submit(),Philips.myphilips.loggedInProvider=""},Philips.myphilips.janrain.onCaptureSaveSuccess=function(e,t){"createAccount"===t&&null!=e.accessToken&&"login"!==frompage&&$.ajax({url:janrain.settings.hybris_web_service_login,data:{accessToken:e.accessToken},type:"POST",dataType:"html",success:function(e){$.isEmptyObject(e)?window.location="janrain.settings.capture.successUri":(username=e.substring(2,e.indexOf('","')),password=e.substring(e.indexOf('","')+3,e.length-2),$.ajax({url:janrain.settings.capture.successUri,data:{j_username:username,j_password:password},type:"POST",dataType:"html"}))}}),"updatePersonalDetails"===t&&(trace("We are in edit profile"),trace(">>onCaptureEditProfileSuccess(result, sURL, country, language):"),trace('socialmedia="'+Philips.myphilips.loggedInProvider+'"'),Philips.myphilips.janrain.showServiceLoader(""),$.ajax({url:janrain.settings.hybris_web_service_editprofile,data:{userId:e.userData.uuid},type:"POST",dataType:"html",success:function(e){$.isEmptyObject(e)&&(window.location="janrain.settings.capture.successUri")}})),"updateEmail"===t&&(trace("We are in edit profile email"),trace(">>onCaptureEditProfileSuccess(result, sURL, country, language):"),trace('socialmedia="'+Philips.myphilips.loggedInProvider+'"'),Philips.myphilips.janrain.showServiceLoader(""),$.ajax({url:janrain.settings.hybris_web_service_editprofile,data:{userId:e.userData.uuid},type:"POST",dataType:"html",success:function(e){$.isEmptyObject(e)&&(window.location="janrain.settings.capture.successUri")}}))},Philips.myphilips.janrain.onCaptureRegistrationSuccess=function(e){trace(">>onCaptureRegistrationSuccess(result):"),trace('socialmedia="'+Philips.myphilips.loggedInProvider+'"'),""!==Philips.myphilips.loggedInProvider?void 0!==philips.analytics&&philips.analytics.trackConversion({name:"user_login",description:Philips.myphilips.loggedInProvider}):void 0!==philips.analytics&&philips.analytics.trackConversion({name:"user_registration"}),Philips.myphilips.janrain.showServiceLoader("popup"),$.isEmptyObject(Philips.myphilips.loggedInProvider)||$.ajax({url:janrain.settings.hybris_web_service_login,data:{accessToken:e.accessToken,fromPage:frompage},type:"POST",dataType:"html",success:function(e){$.isEmptyObject(e)?window.location="janrain.settings.capture.successUri":(username=e.substring(2,e.indexOf('","')),password=e.substring(e.indexOf('","')+3,e.length-2),e=$('<form action="'+janrain.settings.capture.successUri+'" method="post"><input type="hidden" name="j_username" value='+username+' /><input type="hidden" name="j_password" value='+password+" /></form>"),$("body").append(e),e.submit())}}),$(".registration-confirm-close").on("click",function(){$("#resendVerification, #janrainModalOverlay").hide(),$.ajax({url:janrain.settings.hybris_web_service_login,data:{accessToken:e.accessToken,fromPage:frompage},type:"POST",dataType:"html",success:function(e){$.isEmptyObject(e)?window.location="janrain.settings.capture.successUri":(username=e.substring(2,e.indexOf('","')),password=e.substring(e.indexOf('","')+3,e.length-2),e=$('<form action="'+janrain.settings.capture.successUri+'" method="post"><input type="hidden" name="j_username" value='+username+' /><input type="hidden" name="j_password" value='+password+" /></form>"),$("body").append(e),e.submit())}})}),Philips.myphilips.loggedInProvider=""}
1,Philips.myphilips.janrain.onCaptureRenderComplete=function(e,t){trace("onCaptureRenderComplete"),trace(">"+t),trace(">>"+e.screen),$("#capture_traditionalRegistrationBlank_catalogLocaleItem").val($("#phi-catalog").val()),$("#capture_traditionalRegistrationBlank_country").val($("#phi-country").val()),$("#capture_traditionalRegistrationBlank_preferredLanguage").val($("#phi-language").val()),"resetPasswordSuccess"===e.screen?void 0!==philips.analytics&&philips.analytics.trackConversion({name:"interaction",description:"forget_your_password:submit"}):"forgotPasswordSuccess"===e.screen&&void 0!==philips.analytics&&philips.analytics.trackConversion({name:"interaction",description:"forget_your_password:send"}),"editProfile"===e.screen&&($(".phi-janrainEditProfile #capture_editProfile_submitButton").click(function(){void 0!==philips.analytics&&philips.analytics.trackConversion({name:"interaction",description:"personal_data:update"})}),$(".updatepasswordBtn #capture_editProfile_submitButton").click(function(){void 0!==philips.analytics&&philips.analytics.trackConversion({name:"interaction",description:"change_password:update"})}),$(".phi-updateEmail #capture_editProfile_submitButton").click(function(){void 0!==philips.analytics&&philips.analytics.trackConversion({name:"interaction",description:"email_address:update"})}),$(".p-button-wrapper #capture_editProfile_submitButton").click(function(){$("#capture_editProfile_receiveMarketingEmail").is(":checked")?void 0!==philips.analytics&&philips.analytics.trackConversion({name:"interaction",description:"opt_preferences:update:check"}):void 0!==philips.analytics&&philips.analytics.trackConversion({name:"interaction",description:"opt_preferences:update:uncheck"})}));var i,a=$(".phi-janrainOptIn"),n=$(".phi-optionblock"),s=$("#capture_traditionalRegistrationBlank_informationOptIn"),o=$("#capture_editProfile_receiveMarketingEmail"),r=$("#capture_editProfile_form_item_inner_receiveMarketingEmail");switch(trace(">>>"+a.val()),"traditionalRegistrationBlank"===e.screen&&(n.css("position","relative"),n.css("top","1px"),s.addClass("ph-traditionalregistrationinformationoptin"),$("#capture_traditionalRegistrationBlank_form_item_informationOptIn").addClass("ph-traditionalregistrationformiteminformationoptin"),$("#capture_traditionalRegistrationBlank_form_item_inner_informationOptIn").addClass("ph-traditionalregistrationformiteminformationinneroptin"),s.css("position","relative"),$(".phi-optinTxt").addClass("ph-traditionalregistrationoptin"),0<$(".ph-plprivacytext").length&&($(".ph-plPrivacytext").appendTo("#capture_traditionalRegistrationBlank_form_item_inner_personalDataTransferAcceptance"),$(".ph-plprivacytext").insertAfter("#capture_traditionalRegistrationBlank_personalDataTransferAcceptance")),$("label[for=capture_traditionalRegistrationBlank_informationOptIn], label[for=capture_traditionalRegistrationBlank_informationOptIn] a").css("color","#fff"),$(".phi-optinlink").click(function(e){e.preventDefault(),$.colorbox({maxWidth:"700px",width:"100%",title:'<div class="headline"><span class="headline-text">'+$(".phiPopUpHeading").html()+"</span></div>",html:$(".phiPopUpText").html(),close:'<span class="ph-icon-cross"></span>',onComplete:function(){$("#cboxLoadedContent").find("button.phi-optionokbtn").click(function(){$.colorbox.close()}),$("html").css("overflow-y","hidden")},onClosed:function(){$("html").css("overflow-y","auto")}}),void 0!==philips.analytics&&philips.analytics.trackConversion({name:"interaction",description:"link:what_does_this_mean"})}),$("#capture_traditionalRegistrationBlank_form_item_inner_informationOptIn").click(function(){void 0!==philips.analytics&&philips.analytics.trackConversion({name:"interaction",description:"newsletter_optin"})})),"editProfile"===e.screen&&(o.css("position","relative"),o.css("left","2px"),o.css("color","#fff !important"),$('label[for="capture_editProfile_receiveMarketingEmail"]').css("margin-left","0px"),o.css("margin-right","15px"),r.css("margin","0px"),r.css("padding","0px"),r.css("min-height","0px"),$("#capture_editProfile_form_item_receiveMarketingEmail, #capture_editProfile_form_item_inner_receiveMarketingEmail").css("height","0px"),r.css("min-height","0px"),s.css("position","relative"),$("label[for=capture_traditionalRegistrationBlank_informationOptIn], label[for=capture_traditionalRegistrationBlank_informationOptIn] a").css("color","#fff"),$(".phi-optinlink").click(function(e){e.preventDefault(),$.colorbox({maxWidth:"700px",width:"100%",title:'<div class="headline"><span class="headline-text">'+$(".phiPopUpHeading").html()+"</span></div>",html:$(".phiPopUpText").html(),close:'<span class="ph-icon-cross"></span>',onComplete:function(){$("#cboxLoadedContent").find("button.phi-optionokbtn").click(function(){$.colorbox.close()}),$("html").css("overflow-y","hidden")},onClosed:function(){$("html").css("overflow-y","auto")}}),void 0!==philips.analytics&&philips.analytics.trackConversion({name:"interaction",description:"link:what_does_this_mean"})}),r.click(function(){void 0!==philips.analytics&&philips.analytics.trackConversion({name:"interaction",description:"newsletter_optin"})})),"optinchecked"===a.val()&&s.prop("checked",!0),"optinunchecked"===a.val()&&s.prop("checked",!1),$(".social-logos .inner-container a").click(function(){$(".errorMessage").css("display","none"),$(".capture_error").removeClass("capture_error")}),$("#capture_returnTraditional_traditionalSignIn_signInButton").click(function(){$(".errorMessage").css("display","none"),$(".capture_error").removeClass("capture_error")}),$("#capture_socialRegistrationNoEmail_socialRegistration_signInButton").on("click",function(){$("#capture_socialRegistrationNoEmail_registration_emailAddressOrMobile").val($("#capture_socialRegistrationNoEmail_mobileNumberRegistration").val()||$("#capture_socialRegistrationNoEmail_socialRegistrationNoEmail_emailAddress").val())}),t){case"createAccount":switch($("#capture_traditionalRegistrationBlank_form_item_registration_birthday").addClass("dob-hidden"),janrain.capture.ui.registerFunction("passwordValidation",function(e,t){return/([a-zA-Z].*[0-9._@$])|([0-9].*[a-zA-Z._@$])|([._@$].*[a-zA-Z0-9])/.test(t)}),$(".registration-confirm-close").on("click",function(){$("#registrationSuccess, #janrainModalOverlay, #janrainModal .janrain_modal_closebutton span").hide()}),$("#capture_traditionalRegistrationBlank_createAccountButton").on("click",function(){$("#capture_traditionalRegistrationBlank_registration_emailAddressOrMobile").val($("#capture_traditionalRegistrationBlank_traditionalRegistration_emailAddressBlank").val())}),Philips.myphilips.janrain.createAccountHelpBoxDataSet=[{helpBoxId:"dob-help",content:Philips.myphilips.siteTexts.dob_help,insertAfterElementId:"capture_traditionalRegistrationBlank_registration_birthday_dateselectyear",inlineStyleHelpIcon:"margin-top:2px;"},{helpBoxId:"email-help",content:Philips.myphilips.siteTexts.email_help,insertAfterElementId:"capture_traditionalRegistrationBlank_traditionalRegistration_emailAddressBlank",inlineStyleHelpIcon:""},{helpBoxId:"password-help",content:Philips.myphilips.siteTexts.password_help,insertAfterElementId:"capture_traditionalRegistrationBlank_traditionalRegistration_passwordBlank",inlineStyleHelpIcon:"",openHelpBoxOnInputFieldFocus:["capture_traditionalRegistrationBlank_traditionalRegistration_passwordBlank"]}],Philips.myphilips.janrain.socialRegistrationHelpBoxDataSet=[{helpBoxId:"dob-help",content:Philips.myphilips.siteTexts.dob_help,insertAfterElementId:"capture_socialRegistration_registration_birthday_dateselectyear",inlineStyleHelpIcon:"margin-top:2px;"},{helpBoxId:"email-help",content:Philips.myphilips.siteTexts.email_help,insertAfterElementId:"capture_socialRegistration_socialRegistration_emailAddress",inlineStyleHelpIcon:""}],Philips.myphilips.janrain.socialRegistrationNoEmailFinishHelpBoxDataSet=[{helpBoxId:"dob2-help",content:Philips.myphilips.siteTexts.dob_help,insertAfterElementId:"capture_socialRegistrationNoEmailFinish_registration_birthday_dateselectyear",inlineStyleHelpIcon:"margin-top:2px;"}],Philips.myphilips.janrain.setMailRedirectUrls(Philips.myphilips.janrain.passwordResetUrl,Philips.myphilips.janrain.confirmationUrl),e.screen){case"traditionalRegistrationBlank":for(var l in Philips.myphilips.janrain.changeLabelStyleOnCheckboxSelect("capture_traditionalRegistrationBlank_informationOptIn"),$("#capture_traditionalRegistrationBlank_registration_salutation_male_0").click(function(){$("#capture_traditionalRegistrationBlank_form_collection_registration_salutation").removeClass("capture_error")}),$("#capture_traditionalRegistrationBlank_registration_salutation_female_1").click(function(){$("#capture_traditionalRegistrationBlank_form_collection_registration_salutation").removeClass("capture_error")}),"undefined"!=typeof preFillUserEmail&&$(".capture_traditionalRegistration_emailAddressBlank").val(preFillUserEmail),"undefined"!=typeof preFillUserFirstName&&$("#capture_traditionalRegistrationBlank_registration_firstName").val(preFillUserFirstName),"undefined"!=typeof preFillUserLastName&&$("#capture_traditionalRegistrationBlank_registration_lastName").val(preFillUserLastName),document.forms)document.forms[l].capture_traditionalRegistrationBlank_traditionalRegistration_passwordBlank&&$("#capture_traditionalRegistrationBlank_traditionalRegistration_passwordBlank").on("keyup",Philips.myphilips.janrain.updatePasswordRating);$("#traditionalRegistrationBlank").keypress(function(e){13===e.which&&$("#capture_traditionalRegistrationBlank_createAccountButton").click()}),void 0!==Philips.myphilips.janrain.createAccountHelpBoxDataSet&&null!==Philips.myphilips.janrain.createAccountHelpBoxDataSet?Philips.myphilips.janrain.insertHelpBoxes(Philips.myphilips.janrain.createAccountHelpBoxDataSet):trace("Error: createAccountHelpBoxDataSet not found; help boxes not created");break;case"mergeAccounts":mphTrackAjax_pageName("duplicate_account"),$("#philips-merge-account-radiobuttons-content").hide(),$("#philips-merge-account-create").hide(),setTimeout(function(){$("#capture_mergeAccounts_form_item_mergeAccounts_mergeRadio_2_1").find("label").html($("#capture_mergeAccounts_mergeAccounts_mergeRadio_2_1")[0]),$("#capture_mergeAccounts_form_item_mergeAccounts_mergeRadio_2_1").find("label").append(Philips.myphilips.siteTexts.createNewAccount),$("#capture_mergeAccounts_mergeAccounts_mergeRadio_1_0").click(function(){$("#philips-merge-account-create").hide(),$("#philips-merge-account-connect").show()}),$("#capture_mergeAccounts_mergeAccounts_mergeRadio_2_1").click(function(){$("#philips-merge-account-connect").hide(),$("#philips-merge-account-create").show()}),$("#philips-merge-account-radiobuttons-content").show()},400);break;case"socialRegistration":c.remove(),p.val("1"),h.remove(),u.val("1"),m.remove(),g.val("1900"),f.addClass("dob-hidden"),$("label[for=capture_socialRegistration_informationOptIn]").css("color","#fff"),Philips.myphilips.janrain.changeLabelStyleOnCheckboxSelect("capture_socialRegistration_informationOptIn"),mp
1hTrackAjax_pageName("login_completion:"+(Philips.myphilips.loggedInProvider||"NA")),void 0!==Philips.myphilips.janrain.socialRegistrationHelpBoxDataSet&&null!==Philips.myphilips.janrain.socialRegistrationHelpBoxDataSet?Philips.myphilips.janrain.insertHelpBoxes(Philips.myphilips.janrain.socialRegistrationHelpBoxDataSet):trace("Error: socialRegistrationHelpBoxDataSet not found; help boxes not created"),$("#capture_socialRegistration_registration_salutation_male_0").click(function(){$("#capture_socialRegistration_form_collection_registration_salutation").removeClass("capture_error")}),$("#capture_socialRegistration_registration_salutation_female_1").click(function(){$("#capture_socialRegistration_form_collection_registration_salutation").removeClass("capture_error")});break;case"socialRegistrationNoEmailFinish":c.remove(),p.val("1"),h.remove(),u.val("1"),m.remove(),g.val("1900"),f.addClass("dob-hidden"),Philips.myphilips.janrain.changeLabelStyleOnCheckboxSelect("capture_socialRegistrationNoEmailFinish_informationOptIn"),void 0!==Philips.myphilips.janrain.socialRegistrationNoEmailFinishHelpBoxDataSet&&null!==Philips.myphilips.janrain.socialRegistrationNoEmailFinishHelpBoxDataSet?Philips.myphilips.janrain.insertHelpBoxes(Philips.myphilips.janrain.socialRegistrationNoEmailFinishHelpBoxDataSet):trace("Error: socialRegistrationNoEmailFinishHelpBoxDataSet not found; help boxes not created"),$("#capture_socialRegistrationNoEmailFinish_registration_salutation_male_0").click(function(){$("#capture_socialRegistrationNoEmailFinish_form_collection_registration_salutation").removeClass("capture_error")}),$("#capture_socialRegistrationNoEmailFinish_registration_salutation_female_1").click(function(){$("#capture_socialRegistrationNoEmailFinish_form_collection_registration_salutation").removeClass("capture_error")});break;case"registrationSuccess":$("#registrationSuccess").parent().find(".janrain_modal_closebutton").hide();break;case"resendVerification":var d=$("#redirectUri").val();$(".registration-confirm-close").click(function(){window.location=d+"/checkout/multi/delivery-method/choose"}),$("#resendVerification").parent().find(".janrain_modal_closebutton").click(function(){window.location=d+"/login"});break;default:trace("(Note: No specific onCaptureRenderComplete() Javascript for:"+e.screen+")")}break;case"resetPassword":switch(Philips.myphilips.janrain.resetPasswordHelpBoxDataSet=[{helpBoxId:"password-help",content:Philips.myphilips.siteTexts.password_help,insertAfterElementId:"capture_resetPassword_newPassword",inlineStyleHelpIcon:"",openHelpBoxOnInputFieldFocus:["capture_resetPassword_newPassword"]}],janrain.capture.ui.registerFunction("passwordValidation",function(e,t){return/([a-zA-Z].*[0-9._@$])|([0-9].*[a-zA-Z._@$])|([._@$].*[a-zA-Z0-9])/.test(t)}),e.screen){case"resetPassword":for(var l in $(".shippingDetail").parent().remove(),document.forms)document.forms[l].capture_resetPassword_newPassword&&$("#capture_resetPassword_newPassword").on("keyup",Philips.myphilips.janrain.updatePasswordRating);void 0!==Philips.myphilips.janrain.resetPasswordHelpBoxDataSet&&null!==Philips.myphilips.janrain.resetPasswordHelpBoxDataSet?Philips.myphilips.janrain.insertHelpBoxes(Philips.myphilips.janrain.resetPasswordHelpBoxDataSet):trace("Error: resetPasswordHelpBoxDataSet not found; help boxes not created");break;case"resetPasswordRequestCode":$(".shippingDetail").parent().remove();break;default:trace("(Note: No specific onCaptureRenderComplete() Javascript for:"+e.screen+")")}break;case"login":Philips.myphilips.janrain.setMailRedirectUrls(Philips.myphilips.janrain.passwordResetUrl,Philips.myphilips.janrain.confirmationUrl),$(".traditional-box").keypress(function(e){13===e.which&&$(".traditional-box .blueBtn.submitBtn").click()});var c=$("#capture_socialRegistration_registration_birthday_dateselectmonth").find("option[value='']"),p=$("#capture_socialRegistration_registration_birthday_dateselectmonth"),h=$("#capture_socialRegistration_registration_birthday_dateselectday").find("option[value='']"),u=$("#capture_socialRegistration_registration_birthday_dateselectday"),m=$("#capture_socialRegistration_registration_birthday_dateselectyear").find("option[value='']"),g=$("#capture_socialRegistration_registration_birthday_dateselectyear"),f=$("#capture_socialRegistration_form_item_registration_birthday"),v=$(".capture_traditionalSignIn_emailAddressOrMobile");switch(e.screen){case"socialRegistration":c.remove(),p.val("1"),h.remove(),u.val("1"),m.remove(),g.val("1900"),f.addClass("dob-hidden"),$("label[for=capture_socialRegistration_informationOptIn]").css("color","#fff"),n.addClass("ph-socialmediaoptionblock"),$(".phi-optinTxt").addClass("ph-socialregisterationoptin"),Philips.myphilips.janrain.changeLabelStyleOnCheckboxSelect("capture_socialRegistration_informationOptIn"),mp
1hTrackAjax_pageName("login_completion:"+(Philips.myphilips.loggedInProvider||"NA")),void 0!==Philips.myphilips.janrain.socialRegistrationHelpBoxDataSet&&null!==Philips.myphilips.janrain.socialRegistrationHelpBoxDataSet?Philips.myphilips.janrain.insertHelpBoxes(Philips.myphilips.janrain.socialRegistrationHelpBoxDataSet):trace("Error: socialRegistrationHelpBoxDataSet not found; help boxes not created"),$("#capture_socialRegistration_registration_salutation_male_0").click(function(){$("#capture_socialRegistration_form_collection_registration_salutation").removeClass("capture_error")}),$("#capture_socialRegistration_registration_salutation_female_1").click(function(){$("#capture_socialRegistration_form_collection_registration_salutation").removeClass("capture_error")});break;case"socialRegistrationNoEmailFinish":$("#capture_socialRegistrationNoEmailFinish_registration_birthday_dateselectmonth").find("option[value='']").remove(),$("#capture_socialRegistrationNoEmailFinish_registration_birthday_dateselectmonth").val("1"),$("#capture_socialRegistrationNoEmailFinish_registration_birthday_dateselectday").find("option[value='']").remove(),$("#capture_socialRegistrationNoEmailFinish_registration_birthday_dateselectday").val("1"),$("#capture_socialRegistrationNoEmailFinish_registration_birthday_dateselectyear").find("option[value='']").remove(),$("#capture_socialRegistrationNoEmailFinish_registration_birthday_dateselectyear").val("1900"),$("#capture_socialRegistrationNoEmailFinish_form_item_registration_birthday").addClass("dob-hidden"),$("#capture_socialRegistrationNoEmailFinish_form_item_informationOptIn").css("display","none"),Philips.myphilips.janrain.changeLabelStyleOnCheckboxSelect("capture_socialRegistrationNoEmailFinish_informationOptIn"),void 0!==Philips.myphilips.janrain.socialRegistrationNoEmailFinishHelpBoxDataSet&&null!==Philips.myphilips.janrain.socialRegistrationNoEmailFinishHelpBoxDataSet?Philips.myphilips.janrain.insertHelpBoxes(Philips.myphilips.janrain.socialRegistrationNoEmailFinishHelpBoxDataSet):trace("Error: socialRegistrationNoEmailFinishHelpBoxDataSet not found; help boxes not created"),$("#capture_socialRegistrationNoEmailFinish_registration_salutation_male_0").click(function(){$("#capture_socialRegistrationNoEmailFinish_form_collection_registration_salutation").removeClass("capture_error")}),$("#capture_socialRegistrationNoEmailFinish_registration_salutation_female_1").click(function(){$("#capture_socialRegistrationNoEmailFinish_form_collection_registration_salutation").removeClass("capture_error")});break;case"signIn":Philips.myphilips.janrain.setAutoLogin(),"undefined"!=typeof preFillUserEmail?v.val(preFillUserEmail):trace("preFillUserEmail not defined; email address not prefilled");break;case"returnSocial":"undefined"!=typeof preFillUserEmail?v.val(preFillUserEmail):trace("preFillUserEmail not defined; email address not prefilled"),janrain.customError&&($("#returnSocial .traditional-box .login-by-philips ").hide(),$("#returnSocial .traditional-box .capture_signin").show()),Philips.myphilips.janrain.setAutoLogin(),Philips.myphilips.janrain.removeForgotPasswordLink();break;case"returnTraditional":"undefined"!=typeof preFillUserEmail?v.val(preFillUserEmail):trace("preFillUserEmail not defined; email address not prefilled"),Philips.myphilips.janrain.setAutoLogin();break;case"registrationSuccess":break;case"mergeAccounts":mphTrackAjax_pageName("duplicate_account"),$("#philips-merge-account-radiobuttons-content").hide(),$("#philips-merge-account-create").hide(),setTimeout(function(){$("#capture_mergeAccounts_form_item_mergeAccounts_mergeRadio_2_1").find("label").html($("#capture_mergeAccounts_mergeAccounts_mergeRadio_2_1")[0]),$("#capture_mergeAccounts_form_item_mergeAccounts_mergeRadio_2_1").find("label").append(Philips.myphilips.siteTexts.createNewAccount),$("#capture_mergeAccounts_mergeAccounts_mergeRadio_1_0").click(function(){$("#philips-merge-account-create").hide(),$("#philips-merge-account-connect").show()}),$("#capture_mergeAccounts_mergeAccounts_mergeRadio_2_1").click(function(){$("#philips-merge-account-connect").hide(),$("#philips-merge-account-create").show()}),$("#philips-merge-account-radiobuttons-content").show()},400);break;case"resendVerification":$("#resendVerification").parent().find(".janrain_modal_closebutton").click(function(){var e=$
1("#redirectUri").val();window.location=e+"/login"}),mphTrackAjax_pageName("login:email_not_activated"),$("#capture_resendVerification_resendLink").click(function(){$("#resendVerification").find(".resent-verification-message").hide(),$("#resendVerification").find(".mail-sent-message").show(),mphTrackAjax_pageName("login:resend_activation")});break;default:trace("(Note: No specific onCaptureRenderComplete() Javascript for:"+e.screen+")")}break;case"updateAccountManagement":trace(e),e.renderingBuiltInScreen||($("#editProfile").find("#capture_editProfile_accountManagementTab").show(),i=Philips.myphilips.janrain.currentSocialProviders=[],0<(C=$("#capture_editProfile_linkedAccounts_linkedproviderlist").find("li.capture_provider_linked")).length&&$(C).each(function(){var e,t;trace($(this).html()),t=0<$(this).find("span.capture_remove_linkedaccount").length?(t=' <a id="'+(e=$($(this).find("span.capture_remove_linkedaccount")[0]).attr("data-captureprovider"))+'" href="javascript:void(0);" title="'+e+'" class="social-'+e+'"><span style="display:block;"></span></a>',$($(this).find("span.capture_remove_linkedaccount")).hide(),(t+=$($(this).find("span.capture_remove_linkedaccount"))[0].outerHTML)+('<a  class="capture_remove_linkedaccount_link" href="javascript:void(0);" id="remove-'+e+'"onclick="removeSocialLink(this)">'+Philips.myphilips.siteTexts.profileAccountMangeRemoveLink)+"</a>"):' <a id="'+(e=(e=$($(this).find("span")[1]).html().split("- "))[e.length-1].toLowerCase())+'" href="javascript:void(0);" title="'+e+'" class="social-'+e+'"><span style="display:block;"></span></a>',i.push(e),$(this).addClass("social-logos").addClass("small"),trace(t),$(this).html(t)}),(y=$("#capture_editProfile_linkedAccounts_linknewlink")).html("<span>"+y.html()+"</span>"),y.addClass("blueBtn"),$("#editProfile").find(".col3").fadeIn(),$(".jainrain-widget-preloader").hide(),$("#update-form .update-right .social-logos").fadeIn());break;case"updateEmail":Philips.myphilips.janrain.setMailRedirectUrls(Philips.myphilips.janrain.passwordResetUrl,Philips.myphilips.janrain.confirmationUrl),e.renderingBuiltInScreen||($("#editProfile").find("#capture_editProfile_emailAddressTab").show(),$("#editProfile").find(".col3").show());var C=$(".page-update-optIn"),y=$("#capture_editProfile_submitButton");C.find(y).prop("disabled",!1),trace($("#updateEmail").val()),$("#capture_editProfile_email").val(""),$("#capture_editProfile_emailConfirm").val(""),$(".account-exist-message").hide(),y.prop("disabled",!0),y.css("background","#CCCCCC"),C.find(y).prop("disabled",!1),C.find(y).css("background","#ff8600"),$("#capture_editProfile_email, #capture_editProfile_emailConfirm").on("input keyup",function(){trace("We are in edit profile update email");var e=$("#capture_editProfile_email").val(),t=$("#capture_editProfile_emailConfirm").val();e===t?(Philips.myphilips.janrain.showServiceLoader(""),$.ajax({url:janrain.settings.hybris_web_service_verifyprofile,data:{emailId:t},type:"POST",dataType:"html",success:function(e){var t=$("#capture_editProfile_submitButton"),i=$(".page-update-optIn");'"Exist"'===e?($(".account-exist-message").show(),t.prop("disabled",!0),t.css("background","#CCCCCC"),i.find(t).prop("disabled",!1),i.find(t).css("background","#ff8600")):'"Exist"'!==e&&($(".account-exist-message").hide(),t.prop("disabled",!1),t.css("background","#ff8600"),i.find(t).prop("disabled",!1),i.find(t).css("background","#ff8600"))}})):e!==t&&(t=$("#capture_editProfile_submitButton"),$(".account-exist-message").hide(),t.prop("disabled",!0),t.css("background","#CCCCCC"),$(".page-update-optIn").find(t).prop("disabled",!1),$(".page-update-optIn").find(t).css("background","#ff8600"))});break;case"updatePassword":if(e.renderingBuiltInScreen||($("#editProfile").find("#capture_editProfile_passwordTab").show(),$("#editProfile").find(".col3").show()),1===$("#capture_editProfile_currentPassword").length)for(var l in trace("change password: traditional account"),$("#capture_editProfile_socialPasswordForm").hide(),$('<div id="passwordRating" class="password_strength_indicator"></div>').insertAfter("#capture_editProfile_form_item_changePassword"),void 0!==Philips.myphilips.janrain.profilePasswordTraditionalHelpBoxDataSet&&null!==Philips.myphilips.janrain.profilePasswordTraditionalHelpBoxDataSet?Philips.myphilips.janrain.insertHelpBoxes(Philips.myphilips.janrain.profilePasswordTraditionalHelpBoxDataSet):trace("Error: profilePasswordTraditionalHelpBoxDataSet not found; help boxes not created"),document.forms)document.forms[l].capture_editProfile_changePassword&&$("#capture_editProfile_changePassword").on("keyup",Philips.myphilips.janrain.updatePasswordRating);else if(1===$("#capture_editProfile_newPassword").length)for(var l in trace("change password: social account"),$("#capture_editProfile_traditionalPasswordForm").hide(),$('<div id="passwordRating" class="password_strength_
1indicator"></div>').insertAfter("#capture_editProfile_form_item_newPassword"),void 0!==Philips.myphilips.janrain.profilePasswordSocialHelpBoxDataSet&&null!==Philips.myphilips.janrain.profilePasswordSocialHelpBoxDataSet?Philips.myphilips.janrain.insertHelpBoxes(Philips.myphilips.janrain.profilePasswordSocialHelpBoxDataSet):trace("Error: profilePasswordSocialHelpBoxDataSet not found; help boxes not created"),document.forms)document.forms[l].capture_editProfile_newPassword&&$("#capture_editProfile_newPassword").on("keyup",Philips.myphilips.janrain.updatePasswordRating);else trace("change password: no action taken");break;default:trace("(Note: No specific onCaptureRenderComplete() Javascript for:"+e.screen+")")}},Philips.myphilips.janrain.setMailRedirectUrls=function(t,i){trace("setMailRedirectUrls:"),trace(t),trace(i);function e(e){e.value=t}function a(e){var t=i;e.value=t,janrain.settings.capture.redirectUri=t}var n,s={emailAddressForm:a,forgotPasswordForm:e,registrationForm:a,registrationFormBrowser:a,registrationFormBlank:a,resendVerificationForm:a,resetPasswordForm:e,socialRegistrationForm:a,socialRegistrationNoEmailFinishForm:a};for(n in document.forms){var o=document.forms[n];s[o.name]&&o.redirect_uri&&s[o.name](o.redirect_uri)}},Philips.myphilips.janrain.updatePasswordRating=function(){var e=this.value;8<=e.length?$("#validationTip1").removeClass("validation-green").addClass("validation-green"):$("#validationTip1").removeClass("validation-green");for(var t=[/[A-Za-z]/,/[0-9]/,/[^a-zA-Z0-9]/],i=0,a=0;a<t.length;a++)t[a].test(e)&&i++;2<=i?$("#validationTip2").removeClass("validation-green").addClass("validation-green"):$("#validationTip2").removeClass("validation-green");var n,s=document.getElementById("passwordRating");s&&(0===(n=Philips.myphilips.janrain.getPasswordRating(this))?s.innerHTML="<span></span>":0<=n&&n<2||2===n?s.innerHTML="<span class='weak'>"+Philips.myphilips.siteTexts.passwordStrengthWeak+"</span>":3===n?s.innerHTML="<span class='moderate'>"+Philips.myphilips.siteTexts.passwordStrengthModerate+"</span>":3<n&&(s.innerHTML="<span class='strong'>"+Philips.myphilips.siteTexts.passwordStrengthStrong+"</span>"))},Philips.myphilips.janrain.getPasswordRating=function(e){var t=e.value,i=[/[A-Za-z]/,/[0-9]/,/[^a-zA-Z0-9]/],e=0;if(0===t.length)return e;if(t.length<8)return e=1;for(var e=1,a=0,n=0;n<i.length;n++)i[n].test(t)&&a++;return 2<(e+=a)&&12<=t.length&&(e+=1),e},Philips.myphilips.janrain.openTraditionalLogin=function(){$(".errorMessage").css("display","none"),$(".login-by-philips").fadeOut(function(){$(".login-by-philips").parent().parent().find(".traditional-box .capture_signin").fadeIn({duration:1e3,queue:!1}).css("display","none").slideDown(700)}),$(".other-options").css("display","block"),$("#forgot-pasword-link").css("display","block")},Philips.myphilips.janrain.removeForgotPasswordLink=function(){"block"!==$(".traditional-box.p-clearfix .capture_signin").css("display")&&($("#forgot-pasword-link").css("display","none"),"none"===$("#create-account").css("display")&&$(".other-options").css("display","none"))},Philips.myphilips.janrain.removeCreateAccountLink=function(){$("#create-account").css("display","none"),"none"===$("#forgot-pasword-link").css("display")&&$(".other-options").css("display","none")},Philips.myphilips.janrain.setAutoLogin=function(){Philips.myphilips.autoLoginCheck&&$(".autoLogin").attr("checked",!0),$(".autoLogin").click(function(){Philips.myphilips.autoLoginCheck=void 0!==$(this).attr("checked")})},Philips.myphilips.janrain.changeLabelStyleOnCheckboxSelect=function(e){$("#"+e).change(function(){"checked"===$(this).attr("checked")?$(this).parent().addClass("checked"):$(this).parent().removeClass("checked")})},Philips.myphilips.janrain.insertHelpBoxes=function(e){for(var t=0;t<e.length;t++){var i=e[t];if($instertAfterMe=$("#"+i.insertAfterElementId),0<$instertAfterMe.length)if(0<$("#"+i.helpBoxId).length)trace("Element id #"+i.helpBoxId+" already on page");else{var a='<div class="phi-janrain-hint"><a tabindex="-1" title="" class="help-icon" href="#'+i.helpBoxId+'" style="'+i.inlineStyleHelpIcon+'"></a><div id="'+i.helpBoxId+'" class="help-box">'+i.content+"</div></div>";if($instertAfterMe.after(a),"object"==typeof i.openHelpBoxOnInputFieldFocus)for(var n,s=0;s<i.openHelpBoxOnInputFieldFocus.length;s++)0<(n=$("#"+i.openHelpBoxOnInputFieldFocus[s])).length?(n.addClass("help-focus-element"),n.attr("help-box-data","#"+i.helpBoxId)):trace("Element specified in helpBoxData.openHelpBoxOnInputFieldFocus does not exist:"+i.openHelpBoxOnInputFieldFocus[s]);else trace("Not an object")}else trace("Element id #"+i.helpBoxId+" not found")}void 0!==Philips.myphilips.help?Philips.myphilips.help.setupHelp():trace("Could not initialise help boxes (Philips.myphilips.help)")},Philips.myphilips.janrain.onCaptureValidationFailed=function(e){var t,i,a,n,s,o,r;e&&e.field&&e.field.id&&" "===e.message&&"capture_socialRegistrationNoEmail_socialRegistrationNoEmail_emailAddress"===e.field.id&&(t=document.getElementById("usedEmail"),i=document.getElementById("usedEmail2"),a=document.getElementById("socialRegistrationNoEmail_emailFound"),n=document.getElementById("socialRegistrationNoEmail_almostDone"),s=document.getElementById("socialRegistrationNoEmail_createNewAccount"),o=document.getElementById("sm1"),r=document.getElementById("sm2"),t&&(t.innerHTML=e.field.value),i&&(i.innerHTML=e.field.value),e.field.value="",e.field.focus&&e.field.focus(),o&&loggedInProvider&&(o.innerHTML=Philips.myphilips.loggedInProvider),r&&loggedInProvider&&(r.innerHTML=Philips.myphilips.loggedInProvider),n&&(n.style.display="none"),a&&($(a).is(":visible")?$(a).find("p.emailFound_Content").hide().fadeIn():a.style.display="block"),e.field.focus(),s&&(s.style.display="block"))},Philips.myphilips.janrain.fixDateDropdownLocalization=function(){var e="",t=!0;if(trace(" | Checking if temporary solution to fix Janrain date dropdown localization can be applied:"),void 0===Philips.myphilips.siteTexts.dateSelectSitetexts)trace(" |  - Philips.myphilips.siteTexts.dateSelectSitetexts is not defined"),t=!1;else{""===(e=Philips.myphilips.siteTexts.dateSelectSitetexts).dateSelectDay&&(trace(" |  - Philips.myphilips.siteTexts.dateSelectSitetexts.dateSelectDay is empty string"),t=!1),""===e.dateSelectMonth&&(trace(" |  - Philips.myphilips.siteTexts.dateSelectSitetexts.dateSelectMonth is empty string"),t=!1),""===e.dateSelectYear&&(trace(" |  - Philips.myphilips.siteTexts.dateSelectSitetexts.dateSelectYear is empty string"),t=!1);for(var i=1;i<=12;i++)""===e.dateSelectMonthNames[i-1]&&(trace(" |  - Philips.myphilips.siteTexts.dateSelectSitetexts.dateSelectMonthNames["+i+"] is empty string"),t=!1)}var a=$(".capture_dateselect_month"),n=$(".capture_dateselect_day"),s=$(".capture_dateselect_year");
1if(0===a.length&&(trace(" |  - no month select element found"),t=!1),0===n.length&&(trace(" |  - no day select element found"),t=!1),0===s.length&&(trace(" |  - no year select element found"),t=!1),t){trace(" | All checks passed: applying temporary solution to fix Janrain date dropdown!"),a.find("option:first").html(e.dateSelectMonth),n.find("option:first").html(e.dateSelectDay),s.find("option:first").html(e.dateSelectYear);for(var o=1;o<=12;o++)a.find('option[value="'+o+'"]').html(e.dateSelectMonthNames[o-1])}else trace(" | Not applying temporary solution to fix Janrain date dropdown (see reason(s) above) ")},Philips.myphilips.janrain.switchAccount=function(e,t){$(e).parent().find(".switch-account-logos .inner-container a").each(function(){$(this).attr("id")===t&&$(this).hide()}),$(e).fadeOut(function(){$(this).parent().find(".switch-account-logos").fadeIn({duration:2e3,queue:!1}).css("display","none").slideDown(700)})},$(document).ready(function(){$(".philips-logout").click(function(){JANRAIN.SSO.logout({sso_server:janrain.settings.capture.federateServer},(localStorage.removeItem("janrainCaptureToken"),localStorage.removeItem("janrainUserProfile"),window.location.reload(!0),void(window.location="https://"+window.location.hostname)))})}),Philips.myphilips.siteTexts||(Philips.myphilips.siteTexts={}),Philips.myphilips.siteTexts={dob_help:"<span>Our Privacy Policy requires that you fill in your date of birth as a verification that you are older than 18. Consumers younger than 18 cannot register with Philips.</span>
1",email_help:"<span>"+$("#emailHelp").val()+"</span>",password_help:"<h3>"+$("#passwordHelp1").val()+"</h3><b>"+$("#passwordHelp2").val()+"</b><ul><li>"+$("#passwordHelp3").val()+"</li><li>"+$("#passwordHelp4").val()+"<br/><li>"+$("#passwordHelp5").val()+"</li></ul>",passwordStrengthWeak:$("#passwordstrength1").val(),passwordStrengthModerate:$("#passwordstrength2").val(),passwordStrengthStrong:$("#passwordstrength3").val()},void 0===window.Philips&&(window.Philips={}),Philips.janrainWidget=Philips.janrainWidget||{},Philips.janrainWidget.traceEnabled=!1,Philips.janrainWidget.leftMouseClick=function(e,t){(void 0===e||2!==e.which&&3!==e.which)&&t.click()},Philips.janrainWidget.insertHelpBoxes=function(e){for(var t=0;t<e.length;t++){var i=e[t],a=$("#"+i.insertAfterElementId);if(0<a.length)if(0<$("#"+i.helpBoxId).length)trace("Element id #"+i.helpBoxId+" already on page");else{var n='<a tabindex="-1" title="" class="help-icon" href="#'+i.helpBoxId+'" style="'+i.inlineStyleHelpIcon+'"></a><div id="'+i.helpBoxId+'" class="help-box">'+i.content+"</div>";if(a.after(n),"object"==typeof i.openHelpBoxOnInputFieldFocus)for(var s,o=0;o<i.openHelpBoxOnInputFieldFocus.length;o++)0<(s=$("#"+i.openHelpBoxOnInputFieldFocus[o])).length?(s.addClass("help-focus-element"),s.attr("help-box-data","#"+i.helpBoxId)):trace("Element specified in helpBoxData.openHelpBoxOnInputFieldFocus does not exist:"+i.openHelpBoxOnInputFieldFocus[o]);else trace("Not an object")}else trace("Element id #"+i.helpBoxId+" not found")}trace("Philips.janrainWidget.help="+Philips.janrainWidget.help),void 0!==Philips.janrainWidget.help?Philips.janrainWidget.help.setupHelp():trace("Could not initialise help boxes")},Philips.janrainWidget.switchAccount=function(e,t){$(e).parent().find(".switch-account-logos .inner-container a").each(function(){$(this).hasClass("social-"+t)&&$(this).hide()}),$(e).fadeOut(function(){$(this).parent().find(".switch-account-logos").fadeIn({duration:2e3,queue:!1}).css("display","none").slideDown(700)})},Philips.janrainWidget.validatePassword=function(e){8<=e.length?$("#validationTip1").removeClass("validation-green").addClass("validation-green"):$("#validationTip1").removeClass("validation-green");for(var t=[/[A-Za-z]/,/[0-9]/,/[^a-zA-Z0-9]/],i=0,a=0;a<t.length;a++)t[a].test(e)&&i++;2<=i?$("#validationTip2").removeClass("validation-green").addClass("validation-green"):$("#validationTip2").removeClass("validation-green")},Philips.janrainWidget.updatePasswordRating=function(){var e=this.value;Philips.janrainWidget.validatePassword(e);var t=document.getElementById("passwordRating");t&&(0===(e=Philips.janrainWidget.getPasswordRating(this))?t.innerHTML="<span></span>":0<=e&&e<2||2===e?t.innerHTML="<span class='weak'>Invalid</span>":3===e?t.innerHTML="<span class='moderate'>Moderate</span>":3<e&&(t.innerHTML="<span class='strong'>Strong</span>"))},Philips.janrainWidget.getPasswordRating=function(e){var t=e.value,i=[/[A-Za-z]/,/[0-9]/,/[^a-zA-Z0-9]/],e=0;if(0===t.length)return e;if(t.length<8)return e=1;for(var e=1,a=0,n=0;n<i.length;n++)i[n].test(t)&&a++;return 2<(e+=a)&&12<=t.length&&(e+=1),e},Philips.janrainWidget.removeParam=function(e,t){var i=/\?(.*)/,a=i.exec(e);if(a){e=e.replace(i,"");var n,s=a[1].split("&"),o=!0;for(n in s)s[n].split("=")[0]!==t&&(o?(e+="?",o=!1):e+="&",e+=s[n])}return e},Philips.janrainWidget.setMailRedirectUrls=function(t,i){trace("setMailRedirectUrls:"),trace(t),trace(i);function e(e){e.value=t}function a(e){var t=i;e.value=t,janrain.settings.capture.redirectUri=t}var n,s={emailAddressForm:a,forgotPasswordForm:e,registrationForm:a,registrationFormBlank:a,resendVerificationForm:a,resetPasswordForm:e,socialRegistrationForm:a,socialRegistrationNoEmailFinishForm:a};for(n in document.forms){var o=document.forms[n];s[o.name]&&o.redirect_uri&&s[o.name](o.redirect_uri)}},Philips.janrainWidget.removeSocialLink=function(e){$(e).siblings(".capture_remove_linkedaccount").trigger("click")},function(){function e(){janrain.ready=!0}trace("--- Starting JanRain widget ---"),Philips.myphilips.loggedInProvider="","object"!=typeof window.janrain&&(window.janrain={}),"object"!=typeof window.janrain.settings&&(window.janrain.settings={}),"object"!=typeof window.janrain.settings.capture&&(window.janrain.settings.capture={}),"object"!=typeof window.janrain.settings&&(window.janrain.settings={}),"object"==typeof jr?(checkForProperty(jr.settings.pageName,"pageName"),checkForProperty(jr.settings.languageCode,"language"),checkForProperty(jr.settings.country,"country"),janrain.settings.hybris_web_service_login=jr.settings.hybris_web_service_login,janrain.settings.hybris_web_service_register=jr.settings.hybris_web_service_register,janrain.settings.hybris_web_service_editprofile=jr.settings.hybris_web_service_editprofile,janrain.settings.hybris_web_service_verifyprofile=jr.settings.hybris_web_service_verifyprofile,janrain.settings.country=jr.settings.country,janrain.settings.languageCode=jr.settings.languageCode,janrain.settings.pageName=jr.settings.pageName,janrain.settings.increaseRegOrderId=jr.settings.increaseRegOrderId,janrain.settings.appId=jr.settings.appId,janrain.settings.appUrl=jr.settings.appUrl,janrain.settings.flowFile=jr.settings.flowFile,janrain.settings.capture.flowVersion=jr.settings.capture.flowVersion,janrain.settings.language=jr.settings.language,janrain.settings.currentScreenName=jr.settings.currentScreenName,janrain.settings.capture.screenToRender=jr.settings.capture.screenToRender,janrain.settings.capture.flowName=jr.settings.capture.flowName,janrain.settings.capture.clientId=jr.settings.capture.clientId,janrain.settings.capture.appId=jr.settings.capture.appId,janrain.settings.capture.captureServer=jr.settings.capture.captureServer,janrain.settings.capture.redirectUri=jr.settings.capture.redirectUri,janrain.settings.capture.activateUri=jr.settings.capture.activateUri,janrain.settings.capture.successUri=jr.settings.capture.successUri,janrain.settings.capture.recaptchaVersion=2,janrain.settings.capture.federate=jr.settings.capture.federate,janrain.settings.capture.federateServer=jr.settings.capture.federateServer,janrain.settings.capture.federateXdReceiver=jr.settings.capture.federateXdReceiver,janrain.settings.capture.federateLogoutUri=jr.settings.capture.federateLogoutUri,janrain.customError=!1,janrain.settings.currentScreenName||(janrain.settings.currentScreenName="login"),janrain.settings.increaseRegOrderId||(janrain.settings.increaseRegOrderId=""),jr.settings.hideForgotPassword&&Philips.myphilips.janrain.removeForgotPasswordLink()):trace("[!] Missing JanRain settings object (jr)"),janrain.settings.capture.stylesheets="",janrain.settings.capture.responseType="token",janrain.settings.capture.confirmModalClose="",janrain.settings.capture.modalCloseHtml='<span class="ph-icon-cross"></span>',janrain.settings.capture.modalBorderColor="#7AB433",janrain.settings.capture.noModalBorderInlineCss=!0,janrain.settings.capture.registerFlow="socialRegistration",janrain.settings.capture.setProfileData="",janrain.settings.tokenUrl="https://localhost/",janrain.settings.custom=!0,janrain.settings.type="embed",janrain.settings.tokenAction="event",janrain.settings.packages=["login","capture"],janrain.settings.providersPerPage="4",j
1anrain.settings.format="two column",janrain.settings.actionText=" ",janrain.settings.showAttribution=!0,janrain.settings.fontColor="#965151",janrain.settings.fontFamily="Verdana, Arial, Helvetica, sans-serif",janrain.settings.backgroundColor="#ffffff",janrain.settings.width="262",janrain.settings.borderColor="#ffffff",janrain.settings.borderRadius="0",janrain.settings.buttonBorderColor="#ffffff",janrain.settings.buttonBorderRadius="0",janrain.settings.buttonBackgroundStyle="gradient",document.addEventListener?document.addEventListener("DOMContentLoaded",e,!1):window.attachEvent("onload",e);var t,i=$("body");(i.hasClass("page-login")||i.hasClass("page-registrationpage")||i.hasClass("page-orderConfirmationPage")||i.hasClass("page-update-profile")||i.hasClass("page-update-optIn")||i.hasClass("page-checkout-login")||i.hasClass("page-emplogin")||i.hasClass("page-accountverifiedpage")||i.hasClass("page-updatePassword")||i.hasClass("page-microSiteLogin")||i.hasClass("template-pages-MultiStepCheckoutSummaryPageTemplate"))&&void 0!==janrain.settings.flowFile&&((t=document.createElement("script")).type="text/javascript",t.id="janrainAuthWidget",t.src=janrain.settings.flowFile,(i=document.getElementsByTagName("script")[0]).parentNode.insertBefore(t,i))}(),function(n,e){e.myphilips||(e.myphilips={}),e.myphilips.help={toggleHelpBox:function(e,t){var i,a;t?(e.show(),a=0,(i=n(window).scrollTop()+n(window).height())<(t=e.offset().top+e.height())+20&&(a=Number(e.position().top)-(t-i),e.css("top",(a-=40)+"px"))):e.hide()},handleHelpBoxEvent:function(e){var t=e.data.$target,i=e.data.$link,a=e.data.self;if("click"!==e.type)return"mouseover"===e.type?(a.setHelpBoxPosition(t,i),void a.toggleHelpBox(t,!0)):"mouseout"===e.type?(a.setHelpBoxPosition(t,i),void a.toggleHelpBox(t,!1)):"focus"===e.type||"keydown"===e.type?(a.setHelpBoxPosition(t,i),void a.toggleHelpBox(t,!0)):void("blur"===e.type&&(a.setHelpBoxPosition(t,i),a.toggleHelpBox(t,!1)))},stopHelpBoxToggle:function(e){e.preventDefault(),e.data.$target.stop(!0)},hideHelp:function(){n(".help-icon").each(function(){n(this).hide()})},setHelpBoxPosition:function(e,t){var i,a;void 0!==n("html").attr("dir")&&"rtl"===n("html").attr("dir").toString().toLowerCase()?e.css({top:t.position().top,left:t.position().left-332}):(i=isNaN(parseInt(t.css("margin-top"),10))?0:parseInt(t.css("margin-top"),10),a=isNaN(parseInt(t.css("margin-left"),10))?0:parseInt(t.css("margin-left"),10),e.css({top:t.position().top+i,left:t.position().left+a+12}))},setupHelp:function(){var a=this;n(document).ready(function(){n(".help-icon").click(function(e){n(this).toggleClass("active"),e.preventDefault(),n(this).hasClass("active")?n(this).next().show():n(this).next().hide(),n("#email-help, #password-help").outerWidth(n("#capture_traditionalRegistrationBlank_traditionalRegistration_emailAddressBlank, #password").outerWidth()+n(".help-icon").outerWidth(!0))})}),n(document).on("tap mouseup",function(e){0===n(e.target).closest(".help-icon").length&&(n(".help-icon").removeClass("active"),n(".help-icon").next().hide())}),n(".help-focus-element").each(function(){var e=n(this),t=n(document).find('.help-icon[href*="'+e.attr("help-box-data")+'"]'),i=n(t.next());e.bind("focus",{self:a,$target:i,$link:t},a.handleHelpBoxEvent).bind("keydown",{self:a,$target:i,$link:t},a.handleHelpBoxEvent).bind("blur",{self:a,$target:i,$link:t},a.handleHelpBoxEvent),e.parent().keypress(function(){t.trigger("mouseover")}),e.parent().focusout(function(){t.trigger("mouseout")}),e.parent().focusin(function(){t.trigger("mouseover")})})}}}(jQuery,Philips),$(document).ready(function(){void 0!==Philips.myphilips.help&&Philips.myphilips.help.setupHelp()}),ACC.forgottenpassword={_autoload:["bindLink"],bindLink:function(){$(document).on("click",".js-password-forgotten",function(e){e.preventDefault(),ACC.colorbox.open($(this).attr("data-cboxTitle"),{href:$(this).attr("href"),width:"350px",onComplete:function(){ACC.forgottenpassword.bindforgottenPwdForm()}})})},bindforgottenPwdForm:function(){$("form#forgottenPwdForm").ajaxForm({target:".forgotten-password",success:function(){ACC.colorbox.resize(),ACC.forgottenpassword.bindforgottenPwdForm()}})}},ACC.phiEmployeeRegistration={_autoload:["initJS"],initJS:function(){var c=this;$(document).ready(function(){"true"===$(".isEmailExpired").html()&&c.showLightBox($(".phi-link-expired-lightbox-header").html(),$(".phi-link-expired-lightbox").html()),"true"===$(".isFromEmail").html()&&$("#employeeId").attr("readonly","true"),$(".phi-what-it-means-link").click(function(){c.showLightBox($(".phi-what-it-means-lightbox-header").html(),$(".phi-what-it-means-lightbox").html())}),$("#empRegistrationSubmit").click(function(){var e,t=$("#employeeId").val(),i=$("#employeeId").val(),a=$("#firstName").val(),n=$("#lastName").val(),s=$("#emailId").val(),o=$("#password").val(),r=[],l=$("#empRegisterForm").attr("action"),d=$("#empRegisterForm").find("input[name=salutation]").val();$.each($("input[type=checkbox]:checked"),function(e,t){r.push(t.getAttribute("data-id"))}),e=JSON.stringify(r),c.validatedForm()&&$.ajax({url:l,data:{emailId:s,employeeId:t,firstName:a,lastName:n,password:o,salutation:d,checkedOptins:e,dpId:i},type:"POST",datatype:"json",success:function(e){e=$.parseJSON(JSON.stringify(e));"success"===e.status?(c.showLightBox($(".phi-account-created-lightbox-header").html(),$(".phi-account-created-lightbox").html()),void 0!==philips.analytics&&philips.analytics.trackConversion({name:"user_registration"})):"alreadyExists"===e.status?c.showLightBox($(".phi-account-create-update-lightbox-header").html(),$(".phi-account-create-update-lightbox").html()):"employeeNotExists"===e.status?location.href=ACC.config.encodedContextPath+"/employee/registrationIssue?empID="+t+"&myShopID="+t+"&eMail="+s+"&fName="+a+"&lName="+n+"&sal="+d:c.showLightBox($(".phi-account-create-failure-lightbox-header").html(),$(".phi-account-create-failure-lightbox").html())}})}),$(".phi-privacy").click(function(){void 0!==philips.analytics&&philips.analytics.trackConversion({name:"interaction",description:"link:privacy_notice"})}),$(".phi-what-it-means-link").click(function(){void 0!==philips.analytics&&philips.analytics.trackConversion({name:"interaction",description:"link:what_does_this_mean"})}),$("#empMyAccountOptinSubmit").click(function(){var e,i=[],t=$(".phi-empEmailID").html().trim();$.each($("input[type=checkbox]:checked"),function(e,t){i.push(t.getAttribute("data-id"))}),e=JSON.stringify(i),$.ajax({url:ACC.config.encodedContextPath+"/janrain/empMyAccountOptin",data:{emailId:t,checkedOptins:e},type:"POST",datatype:"json",success:function(){$("#phi-optin-update-message").removeClass("hidden")}})})})},showLightBox:function(e,t){$.colorbox({inline:!0,title:'<div class="headline"><span class="headline-text">'+e+"</span></div>",maxWidth:"90%",maxHeight:"80%",width:"870px",href:t,close:'<span class="ph-icon-cross"></span>'})},sendEmailAgain:function(){var t=this,e=$(".resendUrl").text(),i=$("#employeeId").val();$.colorbox.close(),$.ajax({url:e,data:{empId:$(".empId").text(),custID:$(".empCustId").text(),dpId:i},type:"GET",contentType:"application/json",datatype:"json",success:function(e){e&&setTimeout(function(){t.showLightBox($(".phi-link-request-lightbox-header").html(),$(".phi-link-request-lightbox").html())},1e3)}}),void 0!==philips.analytics&&philips.analytics.trackConversion({name:"interaction",description:"button:request_registration_email"})},closepopup:function(){$.colorbox.close()},gotoEmployeeshop:function(){$.colorbox.close(),void 0!==philips.analytics&&philips.analytics.trackConversion({name:"interaction",description:"button:go_to_eshop"}),location.href=ACC.config.encodedContextPath},gotoLoginPage:function(){$.colorbox.close(),location.href=ACC.config.encodedContextPath+"/login",void 0!==philips.analytics&&philips.analytics.trackConversion({name:"interaction",description:"button:login_page"})},sendEmpIdNotFoundInfo:function(){var e=this,t=$("#employeeId").val(),i=$("#firstName").val(),a=$("#lastName").val(),n=$("#emailId").val(),s=$("#postalCode").val(),o=$("#houseNumber").val(),r=$("input[name=salutation]:checked").val();e.validatedForm()&&($.ajax({url:"/employee/sendInfo",data:{emailId:n,employeeId:t,firstName:i,lastName:a,salutation:r,houseNumber:o,postalCode:s},type:"GET",contentType:"application/json",datatype:"json",success:function(){e.showLightBox($(".phi-information-sent-lightbox-header").html(),$(".phi-information-sent-lightbox").html())}}),void 0!==philips.analytics&&philips.analytics.trackConversion({name:"info_request"}))},validatedForm:function(){var e=$.merge($(".phi-reg-page-container input[type=text]"),$("input[type=password]")),t=$(".phi-pwd-vali
1dation-error"),i=$("#confirmPassword");if(e){$(".phi-employee-validation-error").addClass("hidden"),$(".phi-pwd-not-matched").addClass("hidden"),$(".phi-email-format-error").addClass("hidden"),t.addClass("hidden");for(var a=!0,n=0;n<e.length;n+=1){var s=e[n];""===$(s).val()?($(s).siblings(".phi-employee-validation-error").removeClass("hidden"),a=!1):$(s).siblings(".phi-employee-validation-error").addClass("hidden")}if(0<$(".page-nonPublicRegistration").length&&""!==$("#password").val()&&""!==i.val())if($("#password").val()===i.val()){i.val().length<8&&(t.removeClass("hidden"),a=!1);for(var o=i.val().toUpperCase(),r=[/\d/,/[A-Z]/,/[$.@_]/],l=0,d=0;d<r.length;d+=1)0<(o.match(r[d])||[]).length&&(l+=1);l<2&&(a=!1,t.removeClass("hidden"))}else $(".phi-pwd-not-matched").removeClass("hidden"),a=!1;var c=$("#emailId");return""!==c.val()&&(i=c.val().indexOf("@"),t=c.val().lastIndexOf("."),(i<1||t<i+2||t+2>=c.val().length)&&($(".phi-email-format-error").removeClass("hidden"),a=!1)),a}return!1}},ACC.address={_autoload:["bindinitialload","bindToChangeAddressButton","bindCreateUpdateAddressForm","bindSuggestedDeliveryAddresses","bindCountrySpecificAddressForms","showAddressFormButtonPanel","bindViewAddressBook","bindToColorboxClose"],addressID:"",bindinitialload:function(){$(document).ready(function(){var e,t,i,a;$(".template-pages-MultiStepCheckoutSummaryPageTemplate").find(".ph-newcheckoutform").length<=0&&0<$("#addressForm").length&&(e=$("#countrySelector"),$('select[name="countryIso"]').prop("selectedIndex","1"),0<$(".ph-alerts-wrapper").length?(t=$('input[name="postcode"]'),1<e.find("option").length?(e.find("select").prop("selectedIndex","1"),e.insertAfter(t.parent())):0<$("input:hidden#address\\.country, #countrySelector").length&&e.insertAfter(t.parent())):1<e.find("option").length?(e.find("select").prop("selectedIndex","1"),i={addressCode:(a=e.find("select").prop("selectedIndex","1")).val(),countryIsoCode:a.val()},ACC.address.displayCountrySpecificAddressForm(i,ACC.address.showAddressFormButtonPanel)):0<$("input:hidden#address\\.country, #countrySelector").length&&(i={addressCode:a=$("input:hidden#address\\.country").val(),countryIsoCode:a},ACC.address.displayCountrySpecificAddressForm(i,ACC.address.showAddressFormButtonPanel)))})},handleChangeAddressButtonClick:function(){return ACC.address.addressID="",$(this).attr("data-address")&&(ACC.address.addressID=$(this).attr("data-address")),$("#summaryDeliveryAddressFormContainer").show(),$("#summaryOverlayViewAddressBook").show(),$("#summaryDeliveryAddressBook").hide(),$.getJSON(getDeliveryAddressesUrl,ACC.address.handleAddressDataLoad),!1},handleAddressDataLoad:function(e){ACC.address.setupDeliveryAddressPopupForm(e),ACC.colorbox.open("",{inline:!0,href:"#summaryDeliveryAddressOverlay",overlayClose:!1,onOpen:function(){ACC.address.emptyAddressForm(),$(document).on("change","#saveAddress",function(){var e=$
1(this).prop("checked");$("#defaultAddress").prop("disabled",!e),e||$("#defaultAddress").prop("checked",!1)})}})},setupDeliveryAddressPopupForm:function(e){var t=$("#summaryDeliveryAddressBook");t.html($("#deliveryAddressesTemplate").tmpl({addresses:e})),t.find("button.use_address").click(ACC.address.handleSelectExistingAddressClick),t.find("button.edit").click(ACC.address.handleEditAddressClick),t.find("button.default").click(ACC.address.handleDefaultAddressClick)},emptyAddressForm:function(){var e={url:getDeliveryAddressFormUrl,data:{addressId:ACC.address.addressID,createUpdateStatus:""},type:"GET",success:function(e){$("#summaryDeliveryAddressFormContainer").html(e),ACC.address.bindCreateUpdateAddressForm()}};$.ajax(e)},handleSelectExistingAddressClick:function(){var e=$(this).attr("data-address");return $.postJSON(setDeliveryAddressUrl,{addressId:e},ACC.address.handleSelectExitingAddressSuccess),!1},handleEditAddressClick:function(){$("#summaryDeliveryAddressFormContainer").show(),$("#summaryOverlayViewAddressBook").show(),$("#summaryDeliveryAddressBook").hide();var e=$(this).attr("data-address"),e={url:getDeliveryAddressFormUrl,data:{addressId:e,createUpdateStatus:""},target:"#summaryDeliveryAddressFormContainer",type:"GET",success:function(){ACC.address.bindCreateUpdateAddressForm(),ACC.colorbox.resize()}};return $(this).ajaxSubmit(e),!1}
1,handleDefaultAddressClick:function(){var e=$(this).attr("data-address"),e={url:setDefaultAddressUrl,data:{addressId:e},type:"GET",success:function(e){ACC.address.setupDeliveryAddressPopupForm(e)}};return $(this).ajaxSubmit(e),!1},handleSelectExitingAddressSuccess:function(e){null!==e&&(ACC.refresh.refreshPage(e),ACC.colorbox.close())},bindCreateUpdateAddressForm:function(){$(".create_update_address_form").each(function(){var e={type:"POST",success:function(e){$("#summaryDeliveryAddressFormContainer").html(e);e=$(".create_update_address_id").attr("status");null!==e&&"success"===e.toLowerCase()?(ACC.refresh.getCheckoutCartDataAndRefreshPage(),ACC.colorbox.close()):(ACC.address.bindCreateUpdateAddressForm(),ACC.colorbox.resize())}};$(this).ajaxForm(e)})},refreshDeliveryAddressSection:function(e){$(".summaryDeliveryAddress").replaceWith($("#deliveryAddressSummaryTemplate").tmpl(e))},bindSuggestedDeliveryAddresses:function(){var e=$(".add_edit_delivery_address_id").attr("status");null!==e&&"hasSuggestedAddresses"===e&&ACC.address.showSuggestedAddressesPopup()},showSuggestedAddressesPopup:function(){ACC.colorbox.open("",{href:"#popup_suggested_delivery_addresses",inline:!0,overlayClose:!1,width:525})},bindCountrySpecificAddressForms:function(){var e;0<$("select","#countrySelector").length&&($("#countrySelector").find("select").val(""),$(document).on("change","#countrySelector select",function(){e={addressCode:"",countryIsoCode:$(this).val()},ACC.address.displayCountrySpecificAddressForm(e,ACC.address.showAddressFormButtonPanel)}))},showAddressFormButtonPanel:function(){""!==$("#countrySelector").find(":input").val()&&$("#addressform_button_panel").show()},bindToColorboxClose:function(){$(document).on("click",".js-close-colorbox",function(){ACC.colorbox.close()})},displayCountrySpecificAddressForm:function(a,n){$.ajax({url:ACC.config.encodedContextPath+"/checkout/multi/delivery-address/addressform",async:!0,data:a,dataType:"html",beforeSend:function(){$("#addressSubmit").attr("disabled","disabled"),$("#i18nAddressForm").parents("div.checkout-shipping").addClass("ph-blockloader")}}).done(function(e){var t=$("#countrySelector"),i=t.closest("form");t.addClass("hidden"),t.insertBefore(i),$("#addressSubmit").removeAttr("disabled"),$("#i18nAddressForm").html($(e).html()),$("#i18nAddressForm").parents("div.checkout-shipping").removeClass("ph-blockloader"),t.insertBefore($("#address\\.phonenumber").parents(".ph-hintboxcontainer")),t.removeClass("hidden"),0<$("#address\\.addressLocator").length&&ACC.pcaautofill.initPcaAutofill(),$(".ph-customselectbox").selectBox(),"function"==typeof n&&n.call(),0<$("select","#countrySelector").length&&$("select","#countrySelector").selectBox("value",a.countryIsoCode),0<$(".i18nAddressForm").length&&(0<$('input[name="address.phoneNumber"]').length?ACC.intltelInput.initJSIntltelinput("address.phoneNumber"):0<$('input[name="phoneNumber"]').length&&ACC.intltelInput.initJSIntltelinput("phoneNumber"),$(".ph-hint-button").click(function(){$(this).closest(".ph-hintboxcontainer").find(".ph-hintboxpopup").toggle(),$(".ph-hintboxpopup").outerWidth($(".ph-hintboxcontainer").find("input").outerWidth()+$(".ph-hintboxbtn").outerWidth()+10)}),$(document).on("tap mouseup",function(e){var t=$(".ph-hintboxpopup");t.is(e.target)||0!==t.has(e.target).length||t.hide()})),$(".selectAddressCheckout").on("click",function(){""===$(this).attr("data-housenumber")?($("#addressId").val($(this).attr("data-addressid")),$("#addressForm").submit()):$(this).closest("form").submit()})})},bindToChangeAddressButton:function(){$(document).on("click",".summaryDeliveryAddress .editButton",ACC.address.handleChangeAddressButtonClick)},bindViewAddressBook:function(){$(document).on("click",".js-address-book",function(e){e.preventDefault(),ACC.colorbox.open($("#phi-savedaddress").html(),{href:"#addressbook",inline:!0,width:"320px"})}),$(document).on("click","#summaryOverlayViewAddressBook",function(){$("#summaryDeliveryAddressFormContainer").hide(),$("#summaryOverlayViewAddressBook").hide(),$("#summaryDeliveryAddressBook").show(),ACC.colorbox.resize()})}},ACC.checkoutaddress={addressID:"",showAddressBook:function(){$(document).on("click","#viewAddressBook",function(){var e=$
1("#savedAddressListHolder").html();$.colorbox({height:!1,html:e,onComplete:function(){$(this).colorbox.resize()}})})},showRemoveAddressConfirmation:function(){$(document).on("click",".removeAddressButton",function(){var e=$(this).attr("data-addressId");$.colorbox({inline:!0,height:!1,href:"#popup_confirm_address_removal_"+e,onComplete:function(){$(this).colorbox.resize()}})})}},$(document).ready(function(){ACC.checkoutaddress.showAddressBook(),ACC.checkoutaddress.showRemoveAddressConfirmation()}),ACC.silentorderpost={bindUseDeliveryAddress:function(){var e;$("#useDeliveryAddress").on("change",function(){var e;$("#useDeliveryAddress").is(":checked")?(e={countryIsoCode:$("#useDeliveryAddressData").attr("data-countryisocode"),useDeliveryAddress:!0},ACC.silentorderpost.enableAddressForm(),ACC.silentorderpost.displayCreditCardAddressForm(e,ACC.silentorderpost.useDeliveryAddressSelected),ACC.silentorderpost.disableAddressForm()):(ACC.silentorderpost.clearAddressForm(),ACC.silentorderpost.enableAddressForm())}),$("#useDeliveryAddress").is(":checked")&&(e={countryIsoCode:$("#useDeliveryAddressData").attr("data-countryisocode"),useDeliveryAddress:!0},ACC.silentorderpost.enableAddressForm(),ACC.silentorderpost.displayCreditCardAddressForm(e,ACC.silentorderpost.useDeliveryAddressSelected),ACC.silentorderpost.disableAddressForm())},bindSubmitSilentOrderPostForm:function(){$(".submit_silentOrderPostForm").click(function(){ACC.common.blockFormAndShowProcessingMessage($(this)),$(".billingAddressForm").filter(":hidden").remove(),ACC.silentorderpost.enableAddressForm(),$("#silentOrderPostForm").submit()})},bindCycleFocusEvent:function(){$("#lastInTheForm").blur(function(){$("#silentOrderPostForm").find('[tabindex$="10"]').focus()})},isEmpty:function(e){return null==e||""===e},disableAddressForm:function(){$('input[id^="address\\."]').prop("disabled",!0),$('select[id^="address\\."]').prop("disabled",!0)},enableAddressForm:function(){$('input[id^="address\\."]').prop("disabled",!1),$('select[id^="address\\."]').prop("disabled",!1)},clearAddressForm:function(){$('input[id^="address\\."]').val(""),$('select[id^="address\\."]').val("")},useDeliveryAddressSelected:function(){$("#useDeliveryAddress").is(":checked")?($("#address\\.country").val($("#useDeliveryAddressData").attr("data-countryisocode")),ACC.silentorderpost.disableAddressForm()):(ACC.silentorderpost.clearAddressForm(),ACC.silentorderpost.enableAddressForm())},bindCreditCardAddressForm:function(){$("#billingCountrySelector").find(":input").on("change",function(){var e=$
1(this).val();ACC.silentorderpost.displayCreditCardAddressForm({countryIsoCode:e,useDeliveryAddress:!1})})},displayCreditCardAddressForm:function(e,t){$.ajax({url:ACC.config.encodedContextPath+"/checkout/multi/sop/billingaddressform",async:!0,data:e,dataType:"html",beforeSend:function(){$("#billingAddressForm").addClass("ph-blockloader")}}).done(function(e){$("#billingAddressForm").html(e),$("#billingAddressForm").removeClass("ph-blockloader"),"function"==typeof t&&t.call()})}},$(document).ready(function(){ACC.silentorderpost.bindUseDeliveryAddress(),ACC.silentorderpost.bindSubmitSilentOrderPostForm(),ACC.silentorderpost.bindCreditCardAddressForm(),$("#useDeliveryAddress").click()}),ACC.termsandconditions={bindTermsAndConditionsLink:function(){$(document).on("click",".termsAndConditionsLink",function(e){e.preventDefault(),$.colorbox({maxWidth:"700px",width:"100%",maxHeight:"80%",scrolling:!0,href:$(this).attr("href"),close:'<span class="ph-icon-cross"></span>',title:'<div class="headline"><span class="headline-text">'+$("#phi-termsandcondition").html()+"</span></div>"})})}},$(function(){ACC.termsandconditions.bindTermsAndConditionsLink()}),ACC.pcaautofill={initPcaAutofill:function(){var e,t,i;e=window,t=document,e.pca=e.pca||{},e.pca.initial={accountCode:"PHILI11123",host:"PHILI11123.pcapredict.com"},e.pca.on=e.pca.on||function(){(e.pca.onq=e.pca.onq||[]).push(arguments)},(i=t.createElement("script")).async=!0,i.src="https://PHILI11123.pcapredict.com/js/sensor.js",(t=t.querySelectorAll("script")[1]).parentNode.insertBefore(i,t),$(document).on("input","#deliveryAddress\\.addressLocator",function(){void 0===pca.on()&&pca.load()}),pca.on("load",function(e,t,i){i.listen("prepopulate",function(e){var t,i=$("html").attr("lang"),a=$("#address\\.regionIso");$("#deliveryAddress\\.addressLocator").val(""),"pl"===i&&5===e.PostalCode.length&&(e.PostalCode=e.PostalCode.substr(0,2)+"-"+e.PostalCode.substr(2,3)),"ro"===i?("BU"===e.ProvinceCode&&(e.ProvinceCode="B"),t="RO-"+e.ProvinceCode):"cs"===i?t="CZ-"+e.ProvinceCode:"en_US"===i&&(t="US-"+e.ProvinceCode),0<a.length&&(a.val(t),a.siblings(".ph-customselectbox").find(".selectBox-label").html($('option[value="'+t+'"]').html()))})})}},ACC.newCheckoutHelpers={setRadioButtonValue:function(e,i){$.each(e,function(e,t){$(t).val()===i&&$(t).prop("checked",!0)})},emptyForm:function(e){var t=e.find("#address\\.title");t.val(""),t.selectBox("value",""),e.find("#address\\.firstName").val(""),e.find("#address\\.surname, #address\\.lastName").val(""),e.find("#address\\.phonenumber").val(""),e.find("#address\\.line1").val(""),e.find("#address\\.street2").val(""),e.find("#address\\.townCity").val(""),e.find("#address\\.regionIso").val(""),e.find("#address\\.regionIso").selectBox("value",""),e.find("#address\\.postcode").val(""),e.find("#address\\.houseNumber").val("")},populateFormParent:function(e,a){$.each(e,function(e,t){var i=a.find('[name="'+e+'"]');"INPUT"===i.prop("nodeName")?"titleCode"===e||"billingTitle"===e||"billingDevMethod"===e?ACC.newCheckoutHelpers.setRadioButtonValue(i,t):i.val(t):"SELECT"===i.prop("nodeName")&&(i.val(t),i.selectBox("value",t),i.parents(".form-group").find("label").addClass("ph-focusedlabel"))})},popuateFormDirect:function(e){var t,i;e.titleCode&&(i=e.titleCode.toLowerCase(),t=$('[name="titleCode"]'),ACC.newCheckoutHelpers.setRadioButtonValue(t,i)),""!==e.regionIso&&((i=$('[name="regionIso"]')).val(e.regionIso),i.selectBox("value",e.regionIso)),$('input[name="companyId"]').val(e.billingCompanyName),$('input[name="billingCompanyName"]').val(e.billingCompanyName),$('input[name="firstName"]').val(e.firstName),$('input[name="lastName"]').val(e.lastName),$('input[name="houseNumber"]').val(e.houseNumber),$('input[name="line1"]').val(e.line1),$('input[name="street2"]').val(e.street2),$('input[name="townCity"]').val(e.townCity),$('input[name="postcode"]').val(e.postcode),$('input[name="phoneNumber"]').val(e.phone)},populateForm:function(e,t){e=$.parseJSON(e.attr("data-address"));t?ACC.newCheckoutHelpers.populateFormParent(e,t):ACC.newCheckoutHelpers.popuateFormDirect(e)},setNewCheckoutCookie:function(e,t){document.cookie=e+"="+encodeURI(t)},deleteCheckoutCookie:function(e){document.cookie=e+"= ; expires = Thu, 01 Jan 1970 00:00:00 GMT"},saveAddressFormToCookie:function(e,t,i){var a={};e.find('input[type="text"],input[type="radio"]:checked,input[type="checkbox"],select').each(function(){var e=$
1(this).attr("name"),t=$(this).val();a[e]=t}),ACC.newCheckoutHelpers.setNewCheckoutCookie(t,JSON.stringify(a)),$('input[name="'+i+'"]').attr("data-address",JSON.stringify(a))},getNewCheckoutCookie:function(t){var e,i="";return-1!==document.cookie.indexOf(t)&&(e="",(e=document.cookie.split(";").filter(function(e){return-1!==e.indexOf(t)}))[0]&&(i=e[0].substr(e[0].indexOf("=")+1))),decodeURI(i)},populateFromCookie:function(e,t,i){var e=ACC.newCheckoutHelpers.getNewCheckoutCookie(e);e&&("INPUT"===t.prop("nodeName")?(t.attr("data-address",e),ACC.newCheckoutHelpers.populateForm(t,i)):(e=ACC.phiupslocations.renderUpsStoreView($.parseJSON(e)),$(".ph-newcheckout__shippingmethod--form").show(),$(".ph-ups-pickup").html(e))),ACC.newBilling.addressTypeSelected()},removeErrorMessages:function(e){e.find(".js-formsalutation").removeClass("has-error").find(".js-salutation-err").remove(),e.find(".form-group").removeClass("has-error"),e.find(".form-group").parents(".col-xs-12").find(".help-block").remove()},setHashTag:function(e){location.hash=e}},ACC.intltelInput={initJSIntltelinput:function(e){var t=$("#address\\.country"),i=0<t.length&&null!==t.val()&&0!==t.val().length?t.val():$('meta[name="PHILIPS.METRICS.COUNTRY"]').attr("content");$('input[name="'+e+'"]').intlTelInput({customPlaceholder:function(e){return e.split(" ").join("")},formatOnDisplay:!1,nationalMode:!1,preferredCountries:[i],utilsScript:"/_ui/responsive/common/js/legacy/vendor/utils.js"}
1),$(document).ready(function(){var e=$(".selected-flag").attr("title");0<$('input[name="phoneNumber"]').length&&(void 0===e&&$(".selected-flag .iti-flag").addClass(i.toLowerCase()),$("body").on("keyup",'input[name="phoneNumber"]',function(){"Unknown"===$(".selected-flag").prop("title")&&$(".iti-flag").addClass(i.toLowerCase())}))})}},ACC.newCheckout={_autoload:["initNewCheckout"],uiChangesForAddress:function(){var e=$('[name="deliverymethod"]'),t=$(".ph-newcheckout__validaddress--length"),i=$("#ph-newcheckout__shippingaddress"),a=$(".ph-newcheckout__billingaddress"),n=$(".ph-newcheckout__billingaddress--selection input"),s=$('input[name="sameAsDeliveryAddress"]'),o=$(".ph-newcheckout__useraddress--info.active");"deliverbyups"!==e.val()&&"deliverbydhl"!==e.val()||ACC.newCheckoutHelpers.emptyForm(i),$('[name="upsAddress"]').val(!1),$(".ph-checkout-ups-location").hide(),void 0!==t.val()&&""!==t.val()&&"0"!==t.val()&&($(".ph-newcheckout__addaddress").hide(),$(".ph-newcheckout__addaddress--link,.ph-newcheckout__addaddress--actionbtns").show()),void 0!==t.val()&&""!==t.val()&&"0"===t.val()&&($(".ph-newcheckout__addaddress--actionbtns").show(),$(".ph-newcheckout__addaddress--actionbtns .ph-newcheckout__addaddress--cancel").hide()),$(".ph-newcheckout__shippingmethod--address a").removeClass("ph-checkout-forms-disable-element"),e.val("deliverbyaddress"),e.attr("data-ups","No"),ACC.newBilling.addressTypeSelected(),$(".ph-addresstypeprivate").parent().show(),$(".js-hide-for-ups").parents(".form-group").show(),$(".js-disable-for-ups").prop("readonly",!1),$('[name="regionIso"]').selectBox("enable"),$(".ph-newcheckout__billingaddress--selection, .ph-newcheckout__useraddress").show(),!0===$(".ph-billingaddresscheckbox").prop("checked")?a.hide():a.show(),0<$(".ph-newcheckout__useraddress--content").length&&0<a.length&&(a.hide(),n.prop("checked",!0),n.prop("disabled",!1),s.val(!0),0<o.length&&""!==o.find(".ph-newcheckout__useraddress--info--companyname").val()&&(a.show(),n.prop("checked",!1),n.prop("disabled",!0),s.val(!1),$(".ph-addresstypecompany").click()))},savedAddressSelection:function(e){$(".ph-newcheckout__useraddress--info").removeClass("active"),e.closest(".ph-newcheckout__useraddress--info").addClass("active"),e.siblings('input[name="deliveryadrs"]').prop("checked",!0),$(".ph-newcheckout__useraddress--selectedaddresscode").val(e.siblings(".ph-newcheckout__useraddress--info--addresscode").attr("value")),$(".ph-newcheckout__useraddress--addupdateaddress").val("updateAddress")},setDefaultAddress:function(e){e.$addAddressBlock.find(".ph-newcheckout__useraddress--info--addressblock--isdefault").each(function(){"true"===$(this).attr("value")&&ACC.newCheckoutHelpers.populateForm($(this).parent().find(".ph-newcheckout__useraddress--data"))}),$(".ph-formrow__companyid").find("input").val($(".ph-newcheckout__useraddress--info.active .ph-newcheckout__useraddress--info--companyname").val())},validationFail:function(e,t,i){0<$(e+" .has-error").length&&$(e).show(),0<$(t+" .has-error").length&&$(t).show(),0<$(i+" .has-error").length&&$(i).show()}
1,setDeliveryMethodOnLoad:function(){var e=$("#delbyadd"),t=$("#delbyUPS"),i=$(".ph-preferreddeliverymethod"),a=$("input[id='dhlCollectionPoints']");"home_pickUp"===i.attr("data-value")?($("#deliverymethodSelected").val(e.val()),e.prop("checked","checked"),t.removeAttr("checked"),$("#delivery_method").prop("disabled",!1),$("#delivery_method_hide").prop("disabled",!0),$(".phi-deliverymethodwithups .ph-customselectbox").removeClass("selectBox-disabled")):"UPS_pickUp"===i.attr("data-value")&&($("#deliverymethodSelected").val(t.val()),e.removeAttr("checked"),t.prop("checked","checked"),$("#delivery_method_hide").prop("disabled",!1),$("#delivery_method").prop("disabled",!0),$(".phi-deliverymethodwithups .ph-customselectbox").addClass("selectBox-disabled"),localStorage.setItem("dhlCollections",a.val()),$("input[id='dhlPoints']").val(localStorage.getItem("dhlCollections")))},setDeliveryMethodLoggedInUser:function(e){var t,i;$(e.shippingMethodSelection).removeClass("active"),"No"===e.$deliveryMethod.attr("data-ups")?($(".ph-newcheckout__shippingmethod--address").addClass("active"),""!==e.$deliveryMode.val()&&(i=e.$deliveryMode.val(),(t=$('[name="delivery_method"]')).selectBox("value",i),t.val(i)),ACC.newCheckout.uiChangesForAddress()):0<!$(".ph-list-for-new-checkout").length&&(i=$(".ph-newcheckout__shippingmethod--pickup"),$(e.sameAsDeliveryAddress).val(!1),i.addClass("active"),i.find("input").prop("checked",!0),ACC.phiupslocations.uiChangesForUPS())}
1,showFormOnError:function(){var e=$(".ph-newcheckout__billingaddress--form"),t=$(".ph-newcheckout__shippingaddress--form"),i=$(".ph-newcheckout__continuetopayment--submit");0<e.find(".has-error").length?ACC.newCheckoutHelpers.setHashTag("personal"):0<t.find(".has-error").length&&ACC.newCheckoutHelpers.setHashTag("delivery"),!0===$('.ph-guest-shippingmethod--pickup input[name="deliveryType"]').prop("checked")&&(0<$(".ph-delivery-method .ph-ups-pickup .ph-minicart__loader").length?i.prop("disabled",!0):(i.prop("disabled",!1),$('[name="pickupPointID"]').val($(".ph-pickupPointID").text())))},locationHashChanged:function(){""===location.hash?($(".ph-checkout-block--hidden").hide(),$(".ph-checkout-login").show()):($(".ph-checkout-block--hidden").show(),$(".ph-checkout-login").hide())},formPersistenceOnNavigation:function(){0<$(".ph-checkout-login").length&&"paymentDetails"!==localStorage.getItem("paymentNav")&&0===$(".ph-alerts-wrapper").length?ACC.newCheckout.locationHashChanged():($(".ph-checkout-block--hidden").show(),$(".ph-checkout-login, .ph-newcheckout__toggleuser").hide(),"paymentDeliveryMethod"===localStorage.getItem("delMethod")&&$(".ph-newcheckout-paymentmethod").hide(),localStorage.removeItem("paymentNav"),ACC.newShippping.setDeliveryTypeSelection(),ACC.newCheckoutHelpers.populateFromCookie("philips_hybris_personal_data",$('input[name="personalAdrsCookie"]'),$("#ph-newcheckout__billingaddress")),ACC.newCheckoutHelpers.populateFromCookie("philips_hybris_ups_data",$(".ph-ups-pickup")),ACC.newCheckoutHelpers.populateFromCookie("philips_hybris_billing_address_data",$('input[name="anotherAdrsCookie"]'),$("#ph-newcheckout__shippingaddress")),$(".ph-guest-shippingtype, .ph-guest-shippingmethod--pickup").removeClass("active"),0<$(".ph-list-for-new-checkout").length&&ACC.newCheckout.showFormOnError(),localStorage.removeItem("delMethod"))},preselectDefaultAddress:function(e){e.$addAddressBlock.find(e.userAddressInfo).each(function(){"true"===$(this).attr("value")&&(ACC.newCheckout.savedAddressSelection($(this)),ACC.newCheckoutHelpers.populateForm($(this).parent().find(".ph-newcheckout__useraddress--data")))})},preselectSelectedAddress:function(e,t){e.$addAddressBlock.find(e.addAddressCode).each(function(){$(this).attr("value")===t&&(ACC.newCheckout.savedAddressSelection($(this).siblings(".ph-newcheckout__useraddress--info--addressblock--isdefault")),ACC.newCheckoutHelpers.populateForm($(this).parent().find(".ph-newcheckout__useraddress--data")))})},toggleBusinessEntityFields:function(e){0<$(".ph-businessflag").length&&("true"===e.$addressType.attr("value")?($(e.billingAddressForm).show(),e.$inputBillingAddress.prop("checked",!1),e.$inputBillingAddress.prop("disabled",!0),$(e.sameAsDeliveryAddress).val(!1),$(e.companySelect).click()):($(e.billingAddressForm).hide(),e.$inputBillingAddress.prop("checked",!0),e.$inputBillingAddress.prop("disabled",!1),$(e.sameAsDeliveryAddress).val(!0),$(e.privateSelect).click()))},preselectPickpointFromCartpage:function(e){e=ACC.config.encodedContextPath+"/checkout-new/multi/delivery-address/updateTax?selectedDeliveryMethod="+e;ACC.vertex.retrieveVertexInfoForCartItems(e)},setDefaultShippingMethod:function(e){e.each(function(e,t){0===e&&$(t).prop("checked","checked")})}
1,selectDefaultShippingMethod:function(){var e=$(".ph-newcheckout__shippingaddress--item--label").find("input[name='billingDevMethod']"),t=$(".ph-newcheckout__shippingaddress--item--label").find("input[name='deliveryMethod']");ACC.newCheckout.setDefaultShippingMethod(e),ACC.newCheckout.setDefaultShippingMethod(t)},setPreferredDeliveryMethod:function(){var e,t,i;null!==localStorage.getItem("selDeliveryType")&&(e=$("#billingAdrs"),t=$("#upsPickup"),"home_pickUp"===(i=$(".ph-preferreddeliverymethod").val())?(e.prop("checked","checked"),t.removeAttr("checked")):"UPS_pickUp"===i&&(e.removeAttr("checked"),t.prop("checked","checked"),ACC.newCheckout.selectDefaultShippingMethod(),ACC.newCheckout.upsPickupPoint()))},upsPickupPoint:function(){var e=$('[name="deliverymethod"]');$(".ph-newcheckout__shippingaddress--form").hide(),$(".ph-ups-pickup").show(),$(".ph-ups-pickup .ph-delivery-details").show(),$(".ph-ups-pickup .ph-minicart__loader").show(),$(".ph-newcheckout__shippingmethod--form").show(),$(".ph-newcheckout-billingaddress").hide(),ACC.newCheckoutHelpers.saveAddressFormToCookie($("#ph-newcheckout__shippingaddress"),"philips_hybris_billing_address_data","anotherAdrsCookie"),ACC.newCheckoutHelpers.populateFromCookie("philips_hybris_ups_data",$('input[name="upsAdrsCookie"]'),$("#ph-newcheckout__shippingaddress")),localStorage.setItem("selDeliveryType","upsPickup"),$('[name="sameAsDeliveryAddress"]').val(!1),e.attr("data-ups","Yes"),$('[name="upsAddress"]').val(!0),"true"===$('input[name="dhlCollectionPoints"]').val()?e.val("deliverbydhl"):e.val("deliverbyups"),localStorage.setItem("dhlCollections",$(".js-dhlCollectionPoints").val())},initNewCheckout:function(){var e,t,r={addAddressForm:".ph-newcheckout__addaddress",billingAddressForm:".ph-newcheckout__billingaddress",shippingAddressForm:".ph-newcheckout__shippingaddress",loginGuestUser:".ph-newcheckout__toggleuser--login, .ph-newcheckout__toggleuser--guest",jainrainLoginWidget:".ph-newcheckout__janrainloginwidget",jainrainLoginContainerDiv:".phi-janrainlogincontainer > div",checkoutBorderGray:".ph-newcheckout .ph-border--gray",shippingMethodSelection:".ph-newcheckout__shippingaddress--item",$deliveryMethod:$(".ph-deliverymethod"),$deliveryMode:$(".ph-deliverymode"),privateSelect:".ph-addresstypeprivate",companySelect:".ph-addresstypecompany",$inputCompanyId:$(".ph-formrow__companyid"),$vatId:$(".ph-formrow__vatortaxId"),$addressType:$(".ph-addresstypeflag"),paymentMethod:".ph-newcheckout-paymentmethod",paymentSlots:".ph-payment-choice__slots",$inputBillingAddress:$(".ph-newcheckout__billingaddress--selection input"),$inputAddUpdateAddress:$(".ph-newcheckout__useraddress--addupdateaddress"),$selectedAddressCode:$(".ph-newcheckout__useraddress--selectedaddresscode"),savedAddressBlock:".ph-newcheckout__useraddress--info",$addAddressBlock:$(".ph-newcheckout__useraddress--info--addressblock"),addAddressCode:".ph-newcheckout__useraddress--info--addresscode",userAddressInfo:".ph-newcheckout__useraddress--info--addressblock--isdefault",$preferredeliveryMethod:$(".ph-preferreddeliverymethod"),$gcradioButton:$(".ph-giftcard-newcheckoutflow .ph-payment-choice__radiobutton"),$gcinputBox:$(".ph-giftcard-payment-content"),continuetoPaymentButton:".ph-newcheckout__continuetopayment--submit",pickupPointID:'[name="pickupPointID"]',sameAsDeliveryAddress:'input[name="sameAsDeliveryAddress"]',savedAddresscompanyName:".ph-newcheckout__useraddress--info--companyname"};"DHL_COLLECTION_POINT"!==r.$deliveryMode.val()&&"UPS_COLLECTION_POINT"!==r.$deliveryMode.val()||("DHL_COLLECTION_POINT"===r.$deliveryMode.val()?r.$deliveryMethod.val("deliverbydhl"):"UPS_COLLECTION_POINT"===r.$deliveryMode.val()&&r.$deliveryMethod.val("deliverbyups"),$(".ph-guest-shippingmethod--pickup").find('label, input[type="radio"]').click(),r.$deliveryMethod.attr("data-ups","Yes")),!0===$("#billingAdrs").prop("checked")?($(".ph-newcheckout-billingaddress").show(),$(r.pickupPointID).val("")):!0===$("#anotherAdrs").prop("checked")&&($(".ph-newcheckout__form.ph-newcheckout__shippingaddress--form").show(),$(r.pickupPointID).val("")),!0===$('.ph-billing-address input[name="deliveryType"]').prop("checked")&&(e=0,$(".ph-billing-address").find('input[name="deliveryMethod"]').each(function(){!0===$(this).is(":checked")&&(e+=1),0<e?$(r.continuetoPaymentButton).prop("disabled",!1):$(r.continuetoPaymentButton).prop("disabled",!0)}),$(r.pickupPointID).val("")),!0===$('.ph-another-address input[name="deliveryType"]').prop("checked")&&(t=0,$(".ph-another-address").find('input[name="billingDevMethod"]').each(function(){!0===$(this).is(":checked")&&(t+=1),0<t?$(r.continuetoPaymentButton).prop("disabled",!1):$(r.continuetoPaymentButton).prop("disabled",!0)}),$(r.pickupPointID).val("")),ACC.newCheckout.validationFail(r.addAddressForm,r.billingAddressForm,r.shippingAddressForm),$(document).on("click",".ph-newcheckout__toggleuser--loginbtn",function(){$(r.loginGuestUser).toggleClass("active"),$(r.jainrainLoginWidget).show().find(r.jainrainLoginContainerDiv).removeClass("col-md-5").addClass("col-md-8 no-padding"),$(r.checkoutBorderGray).toggle()}),$(document).on("click",".ph-newcheckout__toggleuser--guestbtn",function(){$(r.loginGuestUser).toggleClass("active"),$(r.jainrainLoginWidget).hide().find(r.jainrainLoginContainerDiv).removeClass("col-md-8 no-padding").addClass("col-md-5"),$(r.checkoutBorderGray).toggle()});var i,a,n=$(".ph-newcheckout__form"),s=$(".ph-hintboxcontainer"),o=$(".ph-list-for-new-checkout");function l(e,t,i){void 0!==philips.analytics&&(void 0===i?philips.analytics.trackConversion({name:"interaction",description:"payment_method:"+t.split(" ").join("_")}):philips.analytics.trackConversion({name:"interaction",description:"payment_method:credit_card:"+t.split(" ").join("_")})),"cod-multi"===e?$(".phi-codConfirm").show():$(".phi-codConfirm").hide(),$("#paymentMethod").val(e)}0<n.length&&s.children().eq(1).hasClass("help-block")&&(i=s.children().eq(1).detach(),s.after(i)),0<o.length&&null===localStorage.getItem("paymentNav")&&ACC.newCheckout.setPreferredDeliveryMethod(),null===localStorage.getItem("homepickupaddress")&&null===localStorage.getItem("paymentNav")&&ACC.newCheckout.setDeliveryMethodOnLoad(),void 0!==r.$deliveryMethod.attr("data-ups")&&""!==r.$deliveryMethod.attr("data-ups")&&ACC.newCheckout.setDeliveryMethodLoggedInUser(r),0<$(".ph-newcheckout").length&&(window.onhashchange=ACC.newCheckout.locationHashChanged),$(r.paymentMethod+" "+r.paymentSlots).click(function(){$(".phi-payment-icons .ph-paymentname input[type=radio].selected").removeClass("selected");
1var e=$(this).find("input[type=radio]");e.addClass("selected"),e.prop("checked",!0),$(r.paymentSlots).removeClass("ph-payment-choice__slots--selected"),$(this).addClass("ph-payment-choice__slots--selected");var t=$(this).siblings(".ph-payment-choice__slots--creditcard").text(),i=$(this).find("a").attr("data-name"),e=$(this).find("a").attr("data-value");0<$(r.paymentMethod).length&&(void 0===i||void 0===e)?(i=$(this).next("a").attr("data-name"),e=$(this).next("a").attr("data-value")):r.$gcradioButton.is(":checked")?r.$gcinputBox.removeClass("hidden"):r.$gcinputBox.addClass("hidden"),l(i,e,t)}),$(r.paymentMethod+" "+r.paymentSlots+" a").click(function(){$(r.paymentSlots).removeClass("ph-payment-choice__slots--selected"),$(this).parent(r.paymentSlots).addClass("ph-payment-choice__slots--selected");var e=$(this).siblings(".ph-payment-choice__slots--creditcard").text(),t=$(this).attr("data-name"),i=$(this).attr("data-value");0<$(r.paymentMethod).length&&(void 0===t||void 0===i)?(t=$(this).parent("div").next("a").attr("data-name"),i=$(this).parent("div").next("a").attr("data-value")):r.$gcradioButton.is(":checked")?r.$gcinputBox.removeClass("hidden"):r.$gcinputBox.addClass("hidden"),l(t,i,e)}),ACC.newCheckout.toggleBusinessEntityFields(r),$(document).on("click",".ph-newcheckout__useraddress--info--addressblock",function(){var e=$
1(".ph-newcheckout__addaddress--form");$(r.savedAddressBlock).removeClass("active"),$(this).parent(r.savedAddressBlock).addClass("active"),$(this).find("input").prop("checked",!0),$(r.addAddressForm).hide(),r.$selectedAddressCode.val($(this).find(r.addAddressCode).attr("value")),r.$inputAddUpdateAddress.val("updateAddress"),ACC.newCheckoutHelpers.populateForm($(this).find(".ph-newcheckout__useraddress--data"),e),ACC.newCheckoutHelpers.removeErrorMessages($("#ph-newcheckout__billingaddress")),ACC.newCheckoutHelpers.removeErrorMessages($(".ph-newcheckout__addaddress--form")),""===$(this).parent(r.savedAddressBlock).find(r.savedAddresscompanyName).val()?($(r.billingAddressForm).hide(),r.$inputBillingAddress.prop("checked",!0),r.$inputBillingAddress.prop("disabled",!1),$(r.sameAsDeliveryAddress).val(!0),$(r.privateSelect).click()):($(r.billingAddressForm).show(),r.$inputBillingAddress.prop("checked",!1),r.$inputBillingAddress.prop("disabled",!0),$(r.sameAsDeliveryAddress).val(!1),r.$inputCompanyId.find("input").val($(this).parent(r.savedAddressBlock).find(r.savedAddresscompanyName).val()),$(r.companySelect).click())}),$(document).on("click",".ph-newcheckout__useraddress--info .ph-newcheckout__useraddress--changelink",function(){var e=$
1(".ph-newcheckout__addaddress--form");$(r.savedAddressBlock).removeClass("active"),$(this).parent(r.savedAddressBlock).addClass("active"),$(this).parent(r.savedAddressBlock).find("input").prop("checked",!0),r.$inputAddUpdateAddress.val("updateAddress"),r.$selectedAddressCode.val($(this).parent(r.savedAddressBlock).find(r.addAddressCode).attr("value")),$(r.addAddressForm).show(),ACC.newCheckoutHelpers.populateForm($(this).siblings("div").find(".ph-newcheckout__useraddress--data"),e),ACC.newCheckoutHelpers.removeErrorMessages($("#ph-newcheckout__billingaddress")),0===e.find("div.help-block").length&&ACC.newCheckoutHelpers.removeErrorMessages(e),""===$(this).parent(r.savedAddressBlock).find(r.savedAddresscompanyName).val()?($(r.billingAddressForm).hide(),r.$inputBillingAddress.prop("checked",!0),r.$inputBillingAddress.prop("disabled",!1),$(r.sameAsDeliveryAddress).val(!0),$(r.privateSelect).click()):($(r.billingAddressForm).show(),r.$inputBillingAddress.prop("checked",!1),r.$inputBillingAddress.prop("disabled",!0),$(r.sameAsDeliveryAddress).val(!1),r.$inputCompanyId.find("input").val($(this).parent(r.savedAddressBlock).find(r.savedAddresscompanyName).val()),$(r.companySelect).click())}),"addAddress"!==r.$inputAddUpdateAddress.attr("data-address-value")&&""===r.$selectedAddressCode.attr("data-selected-code")||""===(a=r.$selectedAddressCode.attr("data-selected-code"))||null===a?ACC.newCheckout.preselectDefaultAddress(r):ACC.newCheckout.preselectSelectedAddress(r,a),$(document).on("click",".ph-newcheckout__addaddress--link",function(){$(r.savedAddressBlock).removeClass("active"),$(r.savedAddressBlock).find('input[name="deliveryadrs"]').prop("checked",!1),$(".ph-newcheckout__useraddress--selectedaddresscode, .ph-newcheckout__useraddress--addupdateaddress").val(""),$(r.addAddressForm).show(),$('.ph-newcheckout__addaddress--form input[name="billingCompanyName"]').val("");var e=$(".ph-newcheckout__addaddress");ACC.newCheckoutHelpers.removeErrorMessages(e),ACC.newCheckoutHelpers.emptyForm(e)}),$(document).on("click",".ph-newcheckout__addaddress--cancel",function(){$(r.addAddressForm).hide()}),$(document).on("click",".ph-newcheckout__addaddress--submit",function(e){e.preventDefault();var t=!0,i=ACC.validation.inFEValidation(!0,$(".ph-newcheckout__addaddress--form"));0<$("#sameAsDeliveryAddress:checked").length?t=i:(e=ACC.validation.inFEValidation(!0,$("#ph-newcheckout__billingaddress")),!0===i&&!0===e||(t=!1)),t&&(""===r.$selectedAddressCode.val()&&r.$inputAddUpdateAddress.val("addAddress"),$("#selectDeliveryMethodForm").submit())}),$(document).on("click",".js-newcheckout__continuetoreview--submit",function(e){e.preventDefault();var t=!0,i=!0,a=!0,n=$("#ph-newcheckout__billingaddress"),s=$(".ph-newcheckout__addaddress--form"),o=$("#ph-newcheckout__contactinfo"),e='<div class="col-xs-12 ph-alerts-wrapper"><div class="alert alert-danger">'+ACC.config.validationMessages.noDefaultAddress+"</div></div>";$(".ph-newcheckout__useraddress--info").hasClass("active")&&$(".ph-newcheckout__shippingmethod--address").hasClass("active")?0===$("#sameAsDeliveryAddress:checked").length&&(t=ACC.validation.inFEValidation(!0,n)):($(".ph-newcheckout__shippingmethod--address").hasClass("active")?0===$("#sameAsDeliveryAddress:checked").length?(i=ACC.validation.inFEValidation(!0,s),a=ACC.validation.inFEValidation(!0,n)):i=ACC.validation.inFEValidation(!0,s):a=($(".ph-newcheckout__shippingmethod--pickup").hasClass("active")&&!$(".phi-ups-loc-listItem").hasClass("phi-upsactive")&&(i=ACC.validation.inFEValidation(!0,s)),ACC.validation.inFEValidation(!0,n)),!0===i&&!0===a||(t=!1)),o=ACC.validation.inFEValidation(!0,o),!0===t&&!0===o?(""===r.$selectedAddressCode.val()&&r.$inputAddUpdateAddress.val(""),$("#selectDeliveryMethodForm").submit()):0<$(".ph-login-shippingmethod").length&&!$(".ph-newcheckout__useraddress--info").hasClass("active")&&($(".ph-alerts-wrapper").remove(),$(".ph-newcheckout__useraddress").before(e))}),"0"===$(".ph-newcheckout__validaddress--length").val()&&$(r.addAddressForm).show(),0<n.length&&$(".ph-hint-button").click(function(){$(".ph-hintboxpopup").outerWidth($(this).closest(".ph-hintboxcontainer").find("input").outerWidth()+$(".ph-hintboxbtn").outerWidth()+22)}),0<$(".ph-newcheckout__contactinfo").length&&(ACC.intltelInput.initJSIntltelinput("phoneNumber"),$(".ph-hint-button").click(function(){$(".ph-newcheckout__contactinfo .ph-hintboxpopup").outerWidth($(this).closest(".ph-hintboxcontainer").find("input").outerWidth()+$(".ph-hintboxbtn").outerWidth()+10)})),"null"!==$(".subscriptionProductinfo").attr("value")&&"true"===$(".subscriptionProductinfo").attr("value")&&$(r.jainrainLoginWidget).show(),0<$(".ph-list-for-new-checkout").length&&("true"===$(".ph-sameAsDeliveryAddress").val()&&void 0!==$('[name="deliverymethod"]').attr("data-ups")&&"Yes"!==$('[name="deliverymethod"]').attr("data-ups")?(""!==$('input[name="companyId"]').val()&&"true"===r.$addressType.attr("value")&&$(r.companySelect).click(),$(r.billingAddressForm).hide(),r.$inputBillingAddress.prop("checked",!0),$(r.sameAsDeliveryAddress).val(!0)):($(r.billingAddressForm).show(),r.$inputBillingAddress.prop("checked",!1),$(r.sameAsDeliveryAddress).val(!1))),ACC.newCheckout.formPersistenceOnNavigation(),0<$(".ph-newcheckout__useraddress--content").length&&0<$(r.billingAddressForm).length&&(""===$(".ph-newcheckout__useraddress--info.active").find(r.savedAddresscompanyName).val()?($(r.billingAddressForm).hide(),r.$inputBillingAddress.prop("checked",!0),r.$inputBillingAddress.prop("disabled",!1),$(r.sameAsDeliveryAddress).val(!0)):($(r.billingAddressForm).show(),r.$inputCompanyId.show(),r.$vatId.show(),r.$inputBillingAddress.prop("checked",!1),r.$inputBillingAddress.prop("disabled",!0),$(r.sameAsDeliveryAddress).val(!1),$(r.privateSelect).removeClass("ph-bold ph-bold-color"),$(r.companySelect).addClass("ph-bold ph-bold-color"))),$(document).on("click",".btn-guest-account",function(){var e=localStorage.getItem("selDeliveryType");ACC.newCheckoutHelpers.setHashTag("personal"),$(".ph-checkout-block--hidden").show(),$(".ph-checkout-login,  .ph-newcheckout__toggleuser, .ph-newcheckout-paymentmethod").hide(),$(".ph-personal-details").parent("li").addClass("active");
1var t={$itemLabel:$(".ph-newcheckout__shippingaddress--item--label"),name:"deliveryMethod",$selectedDeliveryMode:$(".ph-newcheckout__deliverymethod--shippingtype"),billingSelectedOption:"billingDevMethod"};"editorder"===localStorage.getItem("paymentNav")?(ACC.newCheckoutHelpers.populateFromCookie("philips_hybris_personal_data",$('input[name="personalAdrsCookie"]'),$("#ph-newcheckout__billingaddress")),ACC.newCheckoutHelpers.populateFromCookie("philips_hybris_ups_data",$(".ph-ups-pickup")),ACC.newCheckoutHelpers.populateFromCookie("philips_hybris_billing_address_data",$('input[name="anotherAdrsCookie"]'),$("#ph-newcheckout__shippingaddress")),ACC.newShippping.setDeliveryTypeSelection(),localStorage.removeItem("paymentNav")):"paymentDetails"!==localStorage.getItem("paymentNav")&&(ACC.newCheckoutHelpers.deleteCheckoutCookie("philips_hybris_personal_data"),ACC.newCheckoutHelpers.deleteCheckoutCookie("philips_hybris_ups_data"),ACC.newCheckoutHelpers.deleteCheckoutCookie("philips_hybris_billing_address_data")),"upsPickup"!==e&&null!==e?ACC.newShippping.deliverymodeSelectionPersistence(t):"upsPickup"===e&&(e=$("#upsPickup").attr("data-value"),$(".ph-deliverymode").val(e),ACC.newCheckout.preselectPickpointFromCartpage(e))}),$(document).on("click",".ph-payment-nav",function(){localStorage.setItem("paymentNav","paymentDetails"),"paymentDeliveryMethod"===$(this).attr("data-id")&&localStorage.setItem("delMethod","paymentDeliveryMethod"),window.location=$(this).attr("data-href")}),$("#address\\.title, #address\\.regionIso").change(function(){$(this).siblings("a").addClass("ph-select-box"),$(this).parent("div").siblings("label").addClass("ph-show-title").addClass("ph-focusedlabel"),$(this).siblings("a").find("span.selectBox-label").addClass("ph-selectbox-size")}),$(".ph-guest-shippingmethod--pickup").find('label, input[type="radio"]').click(function(){0<$(".ph-ups-pickup .ph-minicart__loader").length?$(r.continuetoPaymentButton).prop("disabled",!0):($(r.continuetoPaymentButton).prop("disabled",!1),$(r.pickupPointID).val($(".ph-pickupPointID").text())),ACC.newCheckout.upsPickupPoint()}
1),$("#sameAsDeliveryAddress").on("change",function(){var e=$(this).prop("checked");0===$("#sameAsDeliveryAddress:checked").length&&$(".ph-newcheckout__billingaddress--form").find(r.companySelect).hasClass("ph-bold")&&r.$inputBillingAddress.prop("disabled",!0),$(r.sameAsDeliveryAddress).val(e)}),$(document).on("click",".ph-select-ups",function(){var e=$(".ph-popuptitle").html();$.colorbox({inline:!0,height:!1,className:"ph-ups-custom",title:'<div class="headline"><span class="headline-text">'+e+"</span></div>",href:$(".ph-checkout-ups-location").show(),close:'<span class="ph-icon-cross"></span>',onComplete:function(){"undefined"!=typeof google&&void 0!==google.maps||ACC.phiupslocations.loadUPSGeoLocation()}})}),$(document).on("click",".ph-edit-text",function(){localStorage.setItem("paymentNav","editorder"),ACC.newCheckoutHelpers.saveAddressFormToCookie($("#ph-newcheckout__shippingaddress"),"philips_hybris_billing_address_data","anotherAdrsCookie"),localStorage.getItem("selDeliveryType")||ACC.newCheckoutHelpers.saveAddressFormToCookie($("#ph-newcheckout__billingaddress"),"philips_hybris_personal_data","personalAdrsCookie")}),$(document).on("click",".js-view-agreement",function(e){e.preventDefault(),$.colorbox({width:"80%",maxHeight:"80%",scrolling:!0,title:$("#ph-purchase-agreement--content").attr("data-sctransactiontext"),html:$("#ph-purchase-agreement--content").html(),close:'<span class="ph-icon-cross"></span>',overlayClose:!1,escKey:!1,closeButton:!0,trapFocus:!1})}),$(document).on("click",".js-privacy",function(e){e.preventDefault(),$.colorbox({width:"80%",maxHeight:"80%",scrolling:!0,title:$("#ph-privacy--content").attr("data-sctransactiontext"),html:$("#ph-privacy--content").html(),close:'<span class="ph-icon-cross"></span>',overlayClose:!1,escKey:!1,closeButton:!0,trapFocus:!1})}),$(document).on("click",".js-clarification",function(e){e.preventDefault(),$.colorbox({width:"80%",maxHeight:"80%",scrolling:!0,title:$("#ph-clarification-txt--content").attr("data-sctransactiontext"),html:$("#ph-clarification-txt--content").html(),close:'<span class="ph-icon-cross"></span>',overlayClose:!1,escKey:!1,closeButton:!0,trapFocus:!1})}),$(document).on("click",".js-form-dwld",function(e){e.preventDefault(),$.colorbox({width:"80%",maxHeight:"80%",scrolling:!0,title:$("#ph-preinformative-form").attr("data-sctransactiontext"),html:$("#ph-preinformative-form").html(),close:'<span class="ph-icon-cross"></span>',overlayClose:!1,escKey:!1,closeButton:!0,trapFocus:!1})})},showOptinCheckbox:function(e){var t,i;e.parents(".form-group").hasClass("has-error")||(t=e.val(),i=$("#password").val(),e=ACC.config.encodedContextPath+"/checkout-new/multi/delivery-address/checkUserExist",$.ajax({url:e,data:{emailAddress:t,password:i,CSRFToken:ACC.config.CSRFToken},type:"POST",datatype:"json",success:function(e){!1===e?$(".ph-optin-checkbox").show():$(".ph-optin-checkbox").hide()}}))}},ACC.newOrderConfirmation={_autoload:["initOrderConfirmation"],createUserAccount:function(t){var e,i,a,n,s;t.parents(".form-group").hasClass("has-error")||(e=$(".js-orderguid").val(),i=ACC.newCheckoutHelpers.getNewCheckoutCookie("p-ui-newsletter"),a='<div class="ph-alerts-wrapper"><div class="alert alert-danger alert-dismissible">'+ACC.config.validationMessages.invalidpassword+"</div></div>",n=$("#address\\.userpassword").val(),s=ACC.config.encodedContextPath+"/checkout/orderConfirmation/createAccount",$.ajax({url:s,data:{orderCode:e,password:n,CSRFToken:ACC.config.CSRFToken},type:"POST",datatype:"json",success:function(e){"true"===e.hasError?"register.pwd.invalid"===e.errorCodeKey?ACC.newCheckout.addInvalidPasswordError(ACC.config.validationMessages.invalidpassword,t):"guest.checkout.register.error"===e.errorCodeKey&&0===$(".ph-alerts-wrapper").length&&$(".phi-campaign-page .ph-thankyoucontent").before(a):("true"===e.subscribedNewsletter||i?($(".ph-agreed-newsletter").show(),$(".js-account-header,.ph-nothanks,.ph-account-listitem,.ph-newsletter-listitem,.ph-account-form,.ph-moreinfo").hide()):($(".ph-newsletter-listitem,.ph-subscription-container,.ph-moreinfo").show(),$(".ph-account-listitem,.ph-createacc-container").hide()),$(".ph-alerts-wrapper").remove())}}))}
1,newsLetterSubscription:function(){var e=$(".js-orderguid").val(),t=ACC.config.encodedContextPath+"/checkout/orderConfirmation/subscribeNewsletter";$.ajax({url:t,data:{orderCode:e,CSRFToken:ACC.config.CSRFToken},type:"POST",datatype:"json",success:function(){$(".ph-agreed-newsletter").show(),$(".ph-nothanks,.ph-newsletter-listitem,.ph-subscription-container,.js-account-header,.ph-moreinfo").hide(),ACC.newCheckoutHelpers.setNewCheckoutCookie("p-ui-newsletter",1)}})},addInvalidPasswordError:function(e,t){t.parents(".form-group").nextAll().remove(),t.parents(".form-group").after('<div><span class="help-block">'+e+"</span></div>"),t.parents(".form-group").addClass("has-error")},removeInvalidPasswordError:function(e){e.parents(".form-group").removeClass("has-error"),e.parents(".form-group").nextAll().remove()},verifyPassword:function(e){var t=!1,i=new RegExp(/^(((?=.*[A-Z])(?=.*\d))|((?=.*[A-Z])(?=.*[_.@$]))|((?=.*\d)(?=.*[_.@$])))[A-Za-z\d_.@$]{8,}$/);return""===e.val().trim()?(t=!0,ACC.newOrderConfirmation.addInvalidPasswordError(ACC.config.validationMessages.emptypassword,e)):!1===i.test(e.val())?(t=!0,ACC.newOrderConfirmation.addInvalidPasswordError(ACC.config.validationMessages.passwordLength,e)):ACC.newOrderConfirmation.removeInvalidPasswordError(e),t},checkPasswordStrength:function(e){var t=0;return e.length<8?ACC.config.validationMessages.passwordshort:(8<e.length&&(t+=1),e.match(/([a-z].*[A-Z])|([A-Z].*[a-z])/)&&(t+=1),e.match(/([a-zA-Z])/)&&e.match(/(\d)/)&&(t+=1),e.match(/([!,%,&,@,#,$,^,*,?,_,~])/)&&(t+=1),e.match(/(.*[!,%,&,@,#,$,^,*,?,_,~].*[!,%,&,@,#,$,^,*,?,_,~])/)&&(t+=1),t<2?ACC.config.validationMessages.passwordweak:2===t?ACC.config.validationMessages.passwordgood:ACC.config.validationMessages.passwordstrong)},initOrderConfirmation:function(){var e=ACC.newCheckoutHelpers.getNewCheckoutCookie("p-ui-newsletter");0<$(".ph-loggedin").length&&"1"===e&&$(".ph-create-account ,.ph-moreinfo").hide(),$(document).on("click","#create-account",function(){ACC.newOrderConfirmation.verifyPassword($("#address\\.userpassword"))||ACC.newOrderConfirmation.createUserAccount($("#address\\.userpassword"))}),$(document).on("click","#nothanks-newsletter",function(){0<$(".ph-loggedin").length?$(".ph-create-account ,.ph-moreinfo").hide():($(".ph-agreed-newsletter,.ph-newsletter-listitem,.ph-subscription-container,.js-account-header,.ph-moreinfo").hide(),$(".ph-nothanks").show())}),$(document).on("click","#agree-newsletter",function(){ACC.newOrderConfirmation.newsLetterSubscription()}),$(document).on("keyup","#address\\.userpassword",function(){$(".ph-hintboxpopup,.ph-password-strength").show(),$(".ph-form-err-msg").hide(),$("#js-pwd-strength").text(ACC.newOrderConfirmation.checkPasswordStrength($("#address\\.userpassword").val()))}),$(document).on("blur","#address\\.userpassword",function(){ACC.newOrderConfirmation.verifyPassword($(this)),$(".ph-hintboxpopup").hide()}),$(document).on("click",".ph-learn-more",function(){$(".ph-newsletter-listitem,.ph-subscription-container,.js-account-header,.ph-moreinfo").show(),$(".ph-account-listitem,.ph-createacc-container,.ph-nothanks").hide()})}},ACC.newBilling={_autoload:["initNewBilling"],formOnAddressType:function(e,t){e?(t.$vatortaxId.hide(),t.$companyId.hide(),t.$privateSelect.addClass("ph-bold ph-bold-color"),t.$companySelect.removeClass("ph-bold ph-bold-color")):(t.$vatortaxId.show(),t.$companyId.show(),t.$privateSelect.removeClass("ph-bold ph-bold-color"),t.$companySelect.addClass("ph-bold ph-bold-color"))},addressTypeSelected:function(){var e={$companyId:$(".ph-formrow__companyid"),$vatortaxId:$(".ph-formrow__vatortaxId"),$privateSelect:$(".ph-addresstypeprivate"),$companySelect:$(".ph-addresstypecompany")};"true"===$(".ph-addresstypeflag").val()?this.formOnAddressType(!1,e):this.formOnAddressType(!0,e),e.$companyId.find(".control-label").text(e.$companyId.attr("data-delivery-text"))},pickupPointID:function(){0<$(".ph-ups-pickup .ph-minicart__loader").length?$(".ph-newcheckout__continuetopayment--submit").prop("disabled",!0):($(".ph-newcheckout__continuetopayment--submit").prop("disabled",!1),$('[name="pickupPointID"]').val($(".ph-pickupPointID").text()))},selectDeliveryMethod:function(e){var t=$("#ph-newcheckout__billingaddress"),i=localStorage.getItem("selDeliveryType"),a=$('input[name="sameAsDeliveryAddress"]');ACC.validation.inFEValidation(!0,t)&&(ACC.phiupslocations.uiChangesForUPS(),ACC.newCheckoutHelpers.setHashTag("delivery"),$(this).parent("li").addClass("active"),$(this).parent("li").siblings().removeClass("active"),e.$shippingAddressItem.removeClass("active"),"US"===ACC.config.country||"AU"===ACC.config.country?e.$billingStreetNo.text($('input[name="billingLine1"]').val()):e.$billingStreetNo.text($('input[name="billingHouseNumber"]').val()+" "+$('input[name="billingLine1"]').val()),$('[name="pickupPointID"]').val(""),e.$billingStreet2.text($('input[name="billingStreet2"]').val()),e.$billingStreet3.text($('input[name="billingStreet3"]').val()),e.$billingCityZip.text($('input[name="billingTownCity"]').val()+" "+$('input[name="billingPostcode"]').val()),e.$deliveryMethodBlock.find(".ph-icon-arrow").addClass("ph-icon-arrow-up").removeClass("ph-icon-arrow-down"),e.$personalDetailsBlock.find(".ph-icon-arrow").removeClass("ph-icon-arrow-up").addClass("ph-icon-arrow-down"),ACC.newCheckoutHelpers.saveAddressFormToCookie($("#ph-newcheckout__billingaddress"),"philips_hybris_personal_data","personalAdrsCookie"),null!==i&&""!==i||(localStorage.setItem("selDeliveryType","billingAdrs"),ACC.newCheckout.setPreferredDeliveryMethod()),$("#upsPickup").prop("checked")&&(ACC.newCheckoutHelpers.populateFromCookie("philips_hybris_ups_data",$('input[name="upsAdrsCookie"]'),$("#ph-newcheckout__billingaddress")),ACC.newBilling.pickupPointID()),"billingAdrs"===(i=localStorage.getItem("selDeliveryType"))&&null!==i?a.val(!0):"upsPickup"!==i&&"anotherAdrs"!==i||a.val(!1),window.scrollTo(0,0))},initNewBilling:function(){var e={billingAddressForm:".ph-newcheckout__billingaddress",privateSelect:".ph-addresstypeprivate",companySelect:".ph-addresstypecompany",$inputCompanyId:$(".ph-formrow__companyid"),$vatortaxId:$(".ph-formrow__vatortaxId"),$addressType:$(".ph-addresstypeflag"),$inputBillingAddress:$(".ph-newcheckout__billingaddress--selection input"),$sameAsDeliveryAddress:$('input[name="sameAsDeliveryAddress"]')};e.$inputBillingAddress.change(function(){!0===e.$inputBillingAddress.prop("checked")&&ACC.newCheckoutHelpers.removeErrorMessages($("#ph-newcheckout__billingaddress")),$(e.billingAddressForm).toggle()}),$(document).on("blur",'[name="billingCompanyName"]',function(){var e=$
1('[name="billingCompanyName"]');$('[name="companyId"]').val(e.val()),$(".ph-newcheckout__form").find('[name="companyId"]').parents(".form-group").find("label").addClass("ph-focusedlabel")}),$(document).on("click touchstart",".ph-select-delivery-method, .ph-checkout__sub-block--delivery-method",function(){var e={$personalDetails:$(".ph-personal-details"),$deliveryMethod:$(".ph-delivery-method"),$shippingAddressItem:$(".ph-newcheckout__shippingaddress--item"),$billingStreetNo:$(".ph-newcheckout-billingaddress__streethno"),$billingStreet2:$(".ph-newcheckout-billingaddress__street2"),$billingStreet3:$(".ph-newcheckout-billingaddress__street3"),$billingCityZip:$(".ph-newcheckout-billingaddress__cityzip"),$personalDetailsBlock:$(".ph-checkout__sub-block--personal-details"),$deliveryMethodBlock:$(".ph-checkout__sub-block--delivery-method")};ACC.newBilling.selectDeliveryMethod(e)}),$(document).on("click",e.privateSelect,function(){$(e.companySelect).removeClass("ph-bold ph-bold-color"),$(e.privateSelect).addClass("ph-bold ph-bold-color"),e.$inputCompanyId.hide(),e.$vatortaxId.hide(),e.$addressType.val("false"),e.$inputBillingAddress.prop("disabled",!1),e.$inputCompanyId.find("input").val(""),e.$vatortaxId.find("input").val(""),e.$inputCompanyId.find(".form-group").removeClass("has-error").nextAll().remove(),e.$vatortaxId.find(".form-group").removeClass("has-error").nextAll().remove()}),$(document).on("click",e.companySelect,function(){$(e.privateSelect).removeClass("ph-bold ph-bold-color"),$(e.companySelect).addClass("ph-bold ph-bold-color"),$(e.billingAddressForm).show(),e.$inputCompanyId.show(),e.$vatortaxId.show(),e.$addressType.val("true"),e.$inputBillingAddress.prop("checked",!1),e.$inputBillingAddress.prop("disabled",!0),e.$sameAsDeliveryAddress.val(!1)}),$(document).on("click touchstart",".ph-checkout__sub-block--personal-details",function(){var e;ACC.newCheckoutHelpers.setHashTag("personal"),$(".ph-newcheckout-paymentmethod").hide(),$(this).parent("li").addClass("active"),$(this).parent("li").siblings().removeClass("active"),$(this).find(".ph-icon-arrow").addClass("ph-icon-arrow-up").removeClass("ph-icon-arrow-down"),$(".ph-checkout__sub-block--delivery-method").find(".ph-icon-arrow").removeClass("ph-icon-arrow-up").addClass("ph-icon-arrow-down"),ACC.newCheckoutHelpers.populateFromCookie("philips_hybris_personal_data",$('input[name="personalAdrsCookie"]'),$("#ph-newcheckout__billingaddress")),$(".ph-addresstypeprivate").parent().show(),$(".js-hide-for-ups").parents(".form-group").show(),$(".js-disable-for-ups").prop("readonly",!1),$('[name="regionIso"]').selectBox("enable"),"true"===$(".ph-addresstypeflag").val()&&(e=$(".ph-formrow__companyid")).find(".control-label").text(e.attr("data-delivery-text")),ACC.newCheckoutHelpers.removeErrorMessages($("#ph-newcheckout__shippingaddress"))})}},ACC.newShippping={_autoload:["initNewShipping"],setDeliveryTypeSelection:function(){var e=localStorage.getItem("selDeliveryType");"billingAdrs"===e?($("#"+e).prop("checked",!0),$('input[name="sameAsDeliveryAddress"]').val(!0),$(".ph-newcheckout-billingaddress").show(),$(".ph-newcheckout__shippingaddress--form,.ph-ups-pickup,.ph-newcheckout__shippingmethod--form").hide()):"anotherAdrs"===e?($("#"+e).prop("checked",!0),$('input[name="sameAsDeliveryAddress"]').val(!1),$(".ph-newcheckout-billingaddress,.ph-ups-pickup,.ph-newcheckout__shippingmethod--form").hide(),$(".ph-newcheckout__shippingaddress--form").show()):"upsPickup"===e?($("#"+e).prop("checked",!0),$(".ph-newcheckout-billingaddress,.ph-newcheckout__shippingaddress--form").hide(),$(".ph-ups-pickup").show()):$(".ph-newcheckout-billingaddress,.ph-newcheckout__shippingaddress--form,.ph-ups-pickup").hide()},deliverymodeSelectionPersistence:function(e){var t={$deliveryMode:$(".ph-deliverymode")},i=e.$selectedDeliveryMode.find("input[name ="+e.billingSelectedOption+"]:checked").val(),a=e.$itemLabel.find("input[name="+e.name+"]"),e=i;t.$deliveryMode.val(e),0<a.length&&a.filter("input[value="+i+"]").prop("checked",!0),void 0!==i&&(e=ACC.config.encodedContextPath+"/checkout-new/multi/delivery-address/updateTax?selectedDeliveryMethod="+e,ACC.vertex.retrieveVertexInfoForCartItems(e))},initNewShipping:function(){var n={shippingMethodSelection:".ph-newcheckout__shippingaddress--item",$addAddressBlock:$(".ph-newcheckout__useraddress--info--addressblock"),pickupPointID:'[name="pickupPointID"]',continuetoPaymentButton:".ph-newcheckout__continuetopayment--submit"};$(document).on("click",".ph-guest-shippingtype, .ph-login-shippingmethod",function(){var e;$('input[name="sameAsDeliveryAddress"]').val(!0),"pickup"===$(this).find("input").attr("data-value").trim()||"DHL_COLLECTION_POINT"===$(this).find("input").attr("data-value").trim()?(e=$(".ph-newcheckout__addaddress"),$(".ph-checkout-ups-location").removeClass("hidden"),$(".ph-ups-pickup").show(),$('input[name="sameAsDeliveryAddress"]').val(!1),ACC.newCheckoutHelpers.emptyForm(e),ACC.phiupslocations.uiChangesForUPS()):($("#sameAsDeliveryAddress").prop("checked",!0),$("#sameAsDeliveryAddress").prop("disabled",!1),$(".ph-newcheckout__billingaddress").hide(),$(".ph-addresstypeprivate").click(),ACC.newCheckout.uiChangesForAddress(),ACC.newCheckout.setDefaultAddress(n))}),$(document).on("click",".ph-checkout__sub-block__continueto-payment, .ph-newcheckout__continuetopayment--submit",function(e){e.preventDefault();e=!0;!0===(e=!0===$("#anotherAdrs").prop("checked")?ACC.validation.inFEValidation(!0,$("#ph-newcheckout__shippingaddress")):e)&&($(".ph-personal-details, ph-delivery-method").hide(),$(".ph-newcheckout-paymentmethod").show(),$(this).parent("li").removeClass("active"),$(this).parent("li").siblings().removeClass("active"),ACC.newCheckoutHelpers.saveAddressFormToCookie($("#ph-newcheckout__shippingaddress"),"philips_hybris_billing_address_data","anotherAdrsCookie"),$("#selectDeliveryMethodForm").submit())}),$('input[id = "anotherAdrs"], .ph-another-address>label').click(function(){$(".ph-newcheckout__shippingaddress--form").show(),$(".ph-ups-pickup").hide(),$(".ph-newcheckout__shippingmethod--form, .ph-newcheckout-billingaddress").hide(),$('input[name = "billingAdrs"]').prop("checked",!1),$('input[name = "anotherAdrs"]').prop("checked",!0),$('input[name="sameAsDeliveryAddress"]').val(!1),localStorage.setItem("selDeliveryType","anotherAdrs"),ACC.newCheckout.uiChangesForAddress();
1var e=$('input[name="anotherAdrsCookie"]'),t=e.attr("data-address"),i=$("#ph-newcheckout__shippingaddress"),a={$itemLabel:$(".ph-newcheckout__shippingaddress--item--label"),name:"billingDevMethod",$selectedDeliveryMode:$(".ph-newcheckout__deliverymethod--billingtype"),billingSelectedOption:"deliveryMethod"};ACC.newCheckoutHelpers.emptyForm(i),t&&ACC.newCheckoutHelpers.populateForm(e,i),ACC.newShippping.deliverymodeSelectionPersistence(a),$(n.pickupPointID).val(""),$(n.continuetoPaymentButton).prop("disabled",!1)}),$('input[id = "billingAdrs"], .ph-billing-address>label').click(function(){var e=$('[name="deliverymethod"]');$(".ph-newcheckout__shippingaddress--form, .ph-newcheckout__shippingmethod--form").hide(),$(".ph-ups-pickup").hide(),$('input[name = "anotherAdrs"]').prop("checked",!1),$('input[name = "billingAdrs"]').prop("checked",!0),$('input[name="sameAsDeliveryAddress"]').val(!0),$(".ph-newcheckout-billingaddress").show(),localStorage.setItem("selDeliveryType","billingAdrs"),e.val("deliverbyaddress"),e.attr("data-ups","No"),$('[name="upsAddress"]').val(!1);e={$itemLabel:$(".ph-newcheckout__shippingaddress--item--label"),name:"deliveryMethod",$selectedDeliveryMode:$(".ph-newcheckout__deliverymethod--shippingtype"),billingSelectedOption:"billingDevMethod"};ACC.newShippping.deliverymodeSelectionPersistence(e),ACC.newCheckoutHelpers.saveAddressFormToCookie($("#ph-newcheckout__shippingaddress"),"philips_hybris_billing_address_data","anotherAdrsCookie"),$(n.pickupPointID).val(""),$(n.continuetoPaymentButton).prop("disabled",!1)}),$(".ph-newcheckout__shippingaddress--item--label input[type='radio']").click(function(){var e=$
1(".ph-newcheckout__shippingaddress--item--label").find("input[name='billingDevMethod']"),t=$(".ph-newcheckout__shippingaddress--item--label").find("input[name='deliveryMethod']"),i=$(this).val();$(n.pickupPointID).val(""),$(n.continuetoPaymentButton).prop("disabled",!1),e.each(function(){$(this).filter("input[value="+i+"]").prop("checked",!0)}),t.each(function(){$(this).filter("input[value="+i+"]").prop("checked",!0)}),$(n.shippingMethodSelection).removeClass("active"),$(".ph-newcheckout__shippingmethod--pickup").hasClass("ph-login-shippingmethod")&&$(this).parents(n.shippingMethodSelection).addClass("active")})}},ACC.phiupslocations={_autoload:["initmap"],uiChangesForUPS:function(){var e=localStorage.getItem("selDeliveryType"),t=$(".ph-newcheckout__validaddress--length"),i=$(".ph-newcheckout__shippingaddress--selection").find(".ph-login-shippingmethod");"upsPickup"!==e&&!i.hasClass("active")||(a=$('[name="deliverymethod"]'),$(".ph-checkout-ups-location").show(),$('[name="upsAddress"]').val(!0),a.attr("data-ups","Yes"),"true"===$('[name="dhlCollectionPoints"]').val()?a.val("deliverbydhl"):a.val("deliverbyups"));i=$('input[name="billingPostcode"]').val();localStorage.setItem("savedObj",JSON.stringify({isPostCode:!0,postcode:i})),localStorage.setItem("dhlCollections",$(".js-dhlCollectionPoints").val()),ACC.phiupslocations.upsServerError();var a=ACC.newCheckoutHelpers.getNewCheckoutCookie("philips_hybris_ups_data"),i=$(".ph-newcheckout__shippingmethod--pickup").hasClass("ph-guest-shippingmethod--pickup");a&&i||ACC.phiupslocations.loadUPSGeoLocation(),$(".ph-checkout-ups-location").removeClass("hidden"),0===$(".ph-list-for-new-checkout").length&&$('[name="regionIso"]').selectBox("disable"),$(".ph-newcheckout__billingaddress,.ph-newcheckout__addaddress").show(),$(".ph-newcheckout__addaddress--actionbtns").hide(),$(".ph-newcheckout__addaddress--link").hide(),$(".ph-newcheckout__billingaddress--selection").hide(),void 0!==t.val()&&""!==t.val()&&"0"!==t.val()&&$(".ph-newcheckout__useraddress").hide(),$(".ph-newcheckout__shippingmethod--address a").addClass("ph-checkout-forms-disable-element"),$(".ph-newcheckout__useraddress--addupdateaddress").val(""),$(".ph-newcheckout__useraddress--selectedaddresscode").val("")},initmap:function(){0<$(".phi-ups-map-address-container").length&&$(".phi-ups-map-address-container").parent(".ph-checkout-ups-location").length<=0&&ACC.phiupslocations.loadUPSGeoLocation()},showDefaultMap:function(){return new google.maps.Map(document.querySelector("#map"),{zoom:3,streetViewControl:!1,mapTypeControl:!1,center:{lat:52,lng:22}})},sendUpsLocationRequest:function(t,i,a,n,s){var o=this,e=$(".js-dhlCollectionPoints"),r=$(".page-guest-confirm-return-order"),l=$('[name="pilFedexCollectionPoint"]').val(),d="";$(".phi-ups-server-error, .phi-geo-not-enabled-error").hide(),o.emptyMarkersList(n),localStorage.setItem("savedObj",JSON.stringify(t)),0<r.length&&(d="true"===l?"/nearByCollectionPoints":"/ups/neardAddressupslocations"),0===r.length&&"true"===e.val()&&(d="/dhl/locations"),0===r.length&&"true"!==e.val()&&(d="/ups/locations"),$.ajax({url:ACC.config.encodedContextPath+d,data:t,type:"post",dataType:"json",success:function(e){e?o.plotUpsLocations(e,i,a,n,t,s):o.upsServerError()},error:function(){o.upsServerError()}})},hightLightMarker:function(e,t,i,a,n){for(var s=parseInt($(t.currentTarget).attr("data-index"),10),o=0;o<e.length;o+=1)s===o+1?(e[o].setAnimation(google.maps.Animation.BOUNCE),e[o].setIcon(this.getCanvasIcon(n,o+1))):(e[o].setIcon(this.getCanvasIcon(a,o+1)),e[o].setAnimation(null));$(".phi-ups-loc-listItem").css("background-color","#d9edf6"),$(t.currentTarget).css("background-color","#0089C4"),$(".phi-ups-loc-listItem").css("color","#000000"),$(t.currentTarget).css("color","#ffffff"),$(".phi-ups-circled-num").css("background-color","#e98300"),$(t.currentTarget).find(".phi-ups-circled-num").css("background-color","#0089C4")},openingHoursforFedex:function(e){for(var t="",i=0;i<e.length;i+=1)t+=JSON.stringify(e[i]).replaceAll(/[}}]/g,";");return t.replaceAll(/[{"]/g,"")},plotUpsLocations:function(e,t,i,a,n,s){var e=JSON.parse(e),o=$(".ph-preferreddeliverymethod"),r=$('input[name="dhlCollectionPoints"]'),l=$('input[name="pilFedexCollectionPoint"]').val(),d=$(".page-guest-confirm-return-order"),c=$(".ups-housenumber"),p="",h="",u="",m="",g="",f="",v="",C="",y="",_="",k=$(".ups-address-list"),w=$(".ph-ups-pickup"),b=52,A=22,x="";if($(".phi-ups-server-error, .phi-geo-not-enabled-error").hide(),this.emptyMarkersList(a),h=e&&e.LocatorResponse?e.LocatorResponse.SearchResults.DropLocation:e&&e.collectionPoints&&"true"===l?e.collectionPoints:e){$(".ups-address-list").css("height","300px");for(var P=0;P<h.length;P+=1){var S=h[P],I=this.getCanvasIcon(s,P+1),D="";"true"===r.val()&&0===d.length?(p=S.depotServiceNo,_="",b=S.locationWithDistance.latitude,A=S.locationWithDistance.longitude,u=S.name,m=S.address.street,C=S.address.district,y=S.address.city,g=S.address.zip,f=S.address.streetNo,x=S.address.country,v=S.distance,D=new google.maps.Marker({position:{lat:parseFloat(S.locationWithDistance.latitude),lng:parseFloat(S.locationWithDistance.longitude)},map:i,icon:I,metadata:S.id})):(D="true"===l&&0<d.length?(p=S.id,_=ACC.phiupslocations.openingHoursforFedex(S.attributes.openingHours),b=S.attributes.latitude,A=S.attributes.longitude,m=S.attributes.address.line1,C=S.attributes.address.town,g=S.attributes.address.postalCode,x=S.attributes.address.country.isocode,u=S.attributes.address.firstName,v=String(S.attributes.distance.value)+" "+S.attributes.distance.unit,new google.maps.Marker({position:{lat:parseFloat(S.attributes.latitude),lng:parseFloat(S.attributes.longitude)},map:i,icon:I,metadata:S.id})):(p=S.AccessPointInformation.PublicAccessPointID,_=S.StandardHoursOfOperation,b=S.Geocode.Latitude,A=S.Geocode.Longitude,m=S.AddressKeyFormat.AddressLine,C=S.AddressKeyFormat.PoliticalDivision1,y=S.AddressKeyFormat.PoliticalDivision2,g=S.AddressKeyFormat.PostcodePrimaryLow,u=S.AddressKeyFormat.ConsigneeName,v=String(S.Distance.Value)+" "+S.Distance.UnitOfMeasurement.Code,new google.maps.Marker({position:{lat:parseFloat(S.Geocode.Latitude),lng:parseFloat(S.Geocode.Longitude)}
1,map:i,icon:I,metadata:S.AccessPointInformation.PublicAccessPointID})),c.addClass("hidden")),a.push(D),D.addListener("click",function(){$(".phi-ups-loc-listItem[data-accesspoint="+this.metadata+"]").trigger("click")});var j='<span class="js-country">'+x+'</span> <span class="ph-upsaddress__city">'+y+'</span> <span class="ph-upsaddress__state">'+C+"</span>",I=$("#hiddenText").html(),S=$(".js-openinghours"),D=$(".ph-suggestedtitle").html(),D={pickupPointID:p,firstName:u,line1:m.replace(/;/g,","),line2:j,postcode:g,houseNumber:f,townCity:y,regionIso:C,openingHours:_.replace(/;/g,", <br />"),distance:v,openingText:I,suggestedLocationText:D};0===P&&!0!==n.isSearch&&this.collectionPointsDetails(D,w,o),""!==D.openingHours&&"false"===l&&S.removeClass("hidden"),k.append('<li class="phi-ups-loc-listItem" data-accesspoint="'+p+'" data-index="'+(P+1)+'"><table><tr><td colspan="2"><strong class="phi-upsstorename">'+u+'</strong></td></tr><tr><td class="col-xs-2"><div class="phi-ups-circled-num">'+(P+1)+'</div><div class="ups-distance">'+v+'</div></td><td class="col-xs-10"><div><span class="phi-upsaddressLine1">'+m+'</span><span class="ups-housenumber">'+f+'</span></div><div class="phi-upsaddressLine2">'+j+'</div><div class="ups-postcode hidden">'+g+'</div></td></tr><tr class="js-openinghours hidden"><td class="col-xs-2"><strong>'+I+'</strong></td><td class="col-xs-10 phi-upsopeninghours">'+_+"</td></tr></table></li>")}0<d.length&&ACC.phiupslocations.setReturnAddress($('[data-index="1"]')),i.setZoom(11),i.setCenter(new google.maps.LatLng(b,A))}},collectionPointsDetails:function(e,t,i){var a=this.renderUpsStoreView(e),n=e.openingHours;ACC.newCheckoutHelpers.setNewCheckoutCookie("philips_hybris_ups_data",JSON.stringify(e)),$('input[name="upsAdrsCookie"]').attr("data-address",JSON.stringify(e)),t.html(a),""!==n&&$(".ph-openinghours").removeClass("hidden"),$(".ph-ups-pickup .ph-minicart__loader").hide(),"UPS_pickUp"===i.val()||"home_pickUp"===i.val()&&!0===$("#upsPickup").is(":checked")?($(".ph-ups-pickup .ph-delivery-details").show(),$(".ph-newcheckout__shippingmethod--form").show()):"home_pickUp"===i.val()&&($(".ph-ups-pickup .ph-delivery-details").hide(),$(".ph-newcheckout__shippingmethod--form").hide()),""===$('[name="companyId"]').val()&&$('[name="companyId"]').val(e.firstName),$('[name="firstName"]').val(e.firstName),$('[name="line1"]').val(e.line1),$('[name="townCity"]').val(e.townCity),$('[name="postcode"]').val(e.postcode),$('[name="houseNumber"]').val(e.houseNumber);e=$('[name="countryIso"]').val()+"-"+e.regionIso;$('[name="regionIso"]').val(e),$('[name="regionIso"]').selectBox("value",e)},renderUpsStoreView:function(e){return'<div class="ph-delivery-details"><p><span class="ph-suggested"><strong>'+e.suggestedLocationText+'</strong></span></p><p class="ph-zero-margin"><span class="hidden ph-pickupPointID">'+e.pickupPointID+'</span><span class="col-xs-12 ph-storelabel"><strong>'+e.firstName+'</strong></span><span class="col-xs-12 ph-storelabel">'+e.line1+" "+e.houseNumber+'</span><span class="dot-location-city">'+e.line2+'</span> <span class="dot-location-zipcode">'+e.postcode+'</span></p><p class="ph-openinghours hidden"><span class="col-xs-12 ph-storelabel"><strong>'+e.openingText+'</strong></span><span class="col-xs-12 ph-storelabel ph-opening-hours">'+e.openingHours+'</span></p><p class="ph-distance"><span>'+e.distance+" Away</span></p></div>"},getCanvasIcon:function(e,t){var i=document.createElement("canvas"),a="";return i.width=40,i.height=45,(a=i.getContext("2d")).drawImage(e,0,0),a.font="15px Arial",a.fillStyle="#ffffff",9<t?a.fillText(String(t),6,22):a.fillText(String(t),10,22),{url:i.toDataURL()}},emptyMarkersList:function(e){for(var t=0;t<e.length;t+=1)e[t].setMap(null);$(".ups-address-list").empty(),e.length=0},loadUPSGeoLocation:function(){var d=this,i=$('input[name="houseNumber"]'),e=ACC.config.locale.split("_"),e="https://maps.googleapis.com/maps/api/js?client=gme-philipsce&v=3&language="+e[0]+"&region="+e[1],a=$('input[name="orderCode"]').val(),c=$(".page-guest-confirm-return-order.template-pages-account-accountLayoutPage");$.getScript(e).done(function(){var o=[],t=new google.maps.Geocoder,r=new Image,l=new Image;l.src="/_ui/responsive/theme-b2c-campaigns/images/blue-marker.png",r.src="/_ui/responsive/theme-b2c-campaigns/images/orange-marker.png",navigator.geolocation?navigator.geolocation.getCurrentPosition(function(e){d.map=new google.maps.Map(document.querySelector("#map"),{zoom:11,streetViewControl:!1,mapTypeControl:!1,center:{lat:parseFloat(e.coords.latitude),lng:parseFloat(e.coords.longitude)}}),new google.maps.Marker({position:{lat:parseFloat(e.coords.latitude),lng:parseFloat(e.coords.longitude)},map:d.map})},function(){d.map=d.showDefaultMap()}):$(".phi-geo-not-enabled-error").show(),d.map=d.showDefaultMap();var e="";0<c.length&&(e=localStorage.getItem("savedObj"))&&setTimeout(function(){d.sendUpsLocationRequest(JSON.parse(e),t,d.map,o,r)},2e3),$('input[name="upsAddress"]').val()&&(e=localStorage.getItem("savedObj"))&&(setTimeout(function(){d.sendUpsLocationRequest(JSON.parse(e),t,d.map,o,r)},2e3),$("#ups-search-postcode").val(JSON.parse(e).postcode)),$("body").hasClass("template-pages-MultiStepCheckoutSummaryPageTemplate")||($('select[name="titleCode"]').parents(".form-group").hide(),i.parent(".form-group").hide(),$('input[name="lastName"]').parent(".form-group").hide(),$('select[name="countryIso"], input[name="firstName"], input[name="line1"], input[name="townCity"], input[name="postcode"]').attr("readonly",!0)),$(document).on("click","#ups-btn-search-postcode",function(){var e=$
1("#ups-search-postcode").val();d.sendUpsLocationRequest({isPostCode:!0,postcode:e,isSearch:!0,orderCode:a},t,d.map,o,r)}),$(document).on("click","#phi-current-location",function(){navigator.geolocation?navigator.geolocation.getCurrentPosition(function(e){e={isPostCode:!1,postcode:e.coords.latitude+"_"+e.coords.longitude,isSearch:!0};d.sendUpsLocationRequest(e,t,d.map,o,r)},function(){$(".phi-geo-not-enabled-error").show(),d.emptyMarkersList(o)}):$(".phi-geo-not-enabled-error").show()}),$(document).on("click",".phi-ups-loc-listItem",function(e){var t=$('[name="regionIso"]'),i=$('[name="houseNumber"]'),a=$('input[name="dhlCollectionPoints"]'),n=t.find("~ .ph-customselectbox"),s=$('[name="pickupPointID"]');d.hightLightMarker(o,e,d.map,r,l),$(".phi-ups-loc-listItem").removeClass("phi-upsactive"),$(this).addClass("phi-upsactive"),$(".phi-upsform").show(),$('select[name="titleCode"]').parents(".form-group").hide(),$('input[name="lastName"]').parent(".form-group").hide(),"true"===a.val()?i.parent(".form-group").show():i.parent(".form-group").hide(),$(".ph-newcheckout__addaddress--form .js-formsalutation").hide(),s.val($(".phi-ups-loc-listItem.phi-upsactive").attr("data-accesspoint")),$('[name="line1"]').val($(".phi-ups-loc-listItem.phi-upsactive .phi-upsaddressLine1").text()),i.val($(".phi-ups-loc-listItem.phi-upsactive .ups-housenumber").text()),$('[name="townCity"]').val($(".phi-ups-loc-listItem.phi-upsactive .ph-upsaddress__city").text()),$('[name="postcode"]').val($(".phi-ups-loc-listItem.phi-upsactive .ups-postcode").text());var s=$('[name="countryIso"]').val()+"-"+$(".phi-ups-loc-listItem.phi-upsactive .ph-upsaddress__state").text();t.val(s),t.selectBox("value",s),$('[name="firstName"]').val($(".phi-ups-loc-listItem.phi-upsactive .phi-upsstorename").text()),$(".phi-ups-map-address-container").parent(".ph-checkout-ups-location").length<=0?($('input[name="upsAddress"]').attr("value",!0),n.addClass("selectBox-disabled"),n.css("width","100%"),$('select[name="countryIso"], input[name="firstName"], input[name="line1"], input[name="townCity"], input[name="postcode"]').attr("readonly",!0),"true"===a.val()&&i.attr("readonly",!0).parent(".form-group").show()):($(".js-hide-for-ups").parents(".form-group").hide(),$(".js-disable-for-ups").prop("readonly",!0),"true"===a.val()&&i.removeClass("js-hide-for-ups").attr("readonly",!0).parent(".form-group").show(),a=$("#hiddenText").html(),i=$(".ph-suggestedtitle").html(),s={pickupPointID:$(this).attr("data-accesspoint"),firstName:$(this).find(".phi-upsstorename").text(),line1:$(this).find(".phi-upsaddressLine1").text().replace(/;
1/g,","),line2:$(this).find(".phi-upsaddressLine2").text(),houseNumber:$(this).find(".ups-housenumber").text(),postcode:$(this).find(".ups-postcode").text(),townCity:$(".phi-ups-loc-listItem.phi-upsactive .ph-upsaddress__city").text(),regionIso:s,openingHours:$(this).find(".phi-upsopeninghours").text().replace(/;/g," <br />"),distance:$(this).find(".ups-distance").text(),openingText:a,suggestedLocationText:i},a=d.renderUpsStoreView(s),i=$(".ph-newcheckout__continuetopayment--submit"),ACC.newCheckoutHelpers.setNewCheckoutCookie("philips_hybris_ups_data",JSON.stringify(s)),$('input[name="upsAdrsCookie"]').attr("data-address",JSON.stringify(s)),$(".ph-ups-pickup").html(a),$(".ph-suggested").hide(),$.colorbox.close(),0<$(".ph-delivery-method .ph-ups-pickup .ph-minicart__loader").length?i.prop("disabled",!0):i.prop("disabled",!1)),0<c.length&&ACC.phiupslocations.setReturnAddress($(".phi-upsactive")),ACC.newCheckoutHelpers.removeErrorMessages($(".ph-newcheckout__addaddress--form")),$(".ph-newcheckout__continuetopayment--submit").prop("disabled",!1)}),$("#ups-search-postcode").keypress(function(e){13===e.which&&(e=$("#ups-search-postcode").val(),d.sendUpsLocationRequest({isPostCode:!0,postcode:e,isSearch:!0},t,d.map,o,r))})})},setReturnAddress:function(e){var t=e.find(".phi-upsstorename").text(),i=e.find(".phi-upsaddressLine1").text(),a=e.find(".ph-upsaddress__city").text(),n=e.find(".ph-upsaddress__state").text(),s=e.find(".ups-postcode").text(),o="",r=e.find(".ups-distance").text(),l=$(".ph-order-refund"),d=l.find(".ph-return-awayText").text(),o="true"===$('input[name="pilFedexCollectionPoint"]').val()?e.find(".phi-upsopeninghours").text().split(";;"):e.find(".phi-upsopeninghours").text().split(";");l.find(".ph-return-upsName").text(t),l.find(".ph-return-addressLine1").text(i),l.find(".ph-return-city").text(a),l.find(".ph-return-state").text(n),l.find(".ph-return-postCode").text(s),l.find(".ph-ups-distance").text(r+" "+d),o[0]&&l.find(".ph-ups-hours1").text(o[0].toUpperCase()),o[1]&&l.find(".ph-ups-hours2").text(o[1].toUpperCase()),o[2]&&l.find(".ph-ups-hours3").text(o[2].toUpperCase()),o[3]&&l.find(".ph-ups-hours4").text(o[3].toUpperCase()),o[4]&&l.find(".ph-ups-hours5").text(o[4].toUpperCase()),o[5]&&l.find(".ph-ups-hours6").text(o[5].toUpperCase()),o[6]&&l.find(".ph-ups-hours7").text(o[6].toUpperCase()),$(".ph-return-ups .p-preloader").hide(),$(".ph-returnproduct-pickup--point").show()},upsServerError:function(){var e,t,i;0<$(".phi-ups-map-address-container").length&&(e=localStorage.getItem("dhlCollections"),t=$(".js-dhl-search-message"),i=$(".js-ups-search-message"),"true"===e?(t.show(),t.removeClass("hidden"),i.hide()):i.show())}},ACC.vertex={_autoload:["initVertex"],initVertex:function(){var e,i={$addressShippingOptions:$(".ph-formrow__state select"),shippingMethodSelection:".ph-newcheckout__shippingaddress--item",$deliveryMode:$(".ph-deliverymode")};""!==i.$addressShippingOptions.find("option").filter(":selected").attr("value")&&0<$("[name=countryIso]").length&&"true"===$(".ph-cart-data-net-flag").attr("value")&&(e=ACC.config.encodedContextPath+"/checkout-new/multi/delivery-address/updateNetTax?regionIso="+i.$addressShippingOptions.find("option").filter(":selected").attr("value")+"&countryIso="+$("[name=countryIso]").attr("value"),ACC.vertex.retrieveVertexInfoForCartItems(e)),$(i.shippingMethodSelection+" select").blur(function(){var e=$
1(this).find("option").filter(":selected").attr("value");i.$deliveryMode.val(e);var t=ACC.config.encodedContextPath+"/checkout-new/multi/delivery-address/updateNetTax?regionIso=&countryIso=&selectedDeliveryMethod="+e;"false"===$(".ph-cart-data-net-flag").attr("value")&&(t=ACC.config.encodedContextPath+"/checkout-new/multi/delivery-address/updateTax?selectedDeliveryMethod="+e),ACC.vertex.retrieveVertexInfoForCartItems(t)}),$(i.shippingMethodSelection+' input[type="radio"]').change(function(){var e=$(this).parents(".ph-newcheckout__shippingaddress--item").find("option").filter(":selected").attr("value");void 0===e&&(e="on"===$(this).parent().find("input").val()?$(this).parent().find("input").attr("data-value"):$(this).parent().find("input").val()),i.$deliveryMode.val(e);var t=ACC.config.encodedContextPath+"/checkout-new/multi/delivery-address/updateNetTax?regionIso=&countryIso=&selectedDeliveryMethod="+e;"false"===$(".ph-cart-data-net-flag").attr("value")&&(t=ACC.config.encodedContextPath+"/checkout-new/multi/delivery-address/updateTax?selectedDeliveryMethod="+e),ACC.vertex.retrieveVertexInfoForCartItems(t)}),$(".phi-deliverymethodwithoutups select, .phi-deliverymethodwithups select").change(function(){var e=$
1(this).find("option").filter(":selected").attr("value"),t=ACC.config.encodedContextPath+"/checkout-new/multi/delivery-address/updateNetTax?regionIso=&countryIso=&selectedDeliveryMethod="+e;"false"===$(".ph-cart-data-net-flag").attr("value")&&(t=ACC.config.encodedContextPath+"/checkout-new/multi/delivery-address/updateTax?selectedDeliveryMethod="+e),ACC.vertex.retrieveVertexInfoForCartItems(t)}),$(".phi-deliverymethodwithups input").change(function(){var e,t=$(this).attr("value");"deliverbyaddress"===t&&(t=$(".phi-deliverymethodwithups select").find("option").filter(":selected").attr("value")),e=ACC.config.encodedContextPath+"/checkout-new/multi/delivery-address/updateNetTax?regionIso=&countryIso=&selectedDeliveryMethod="+t,"false"===$(".ph-cart-data-net-flag").attr("value")&&(e=ACC.config.encodedContextPath+"/checkout-new/multi/delivery-address/updateTax?selectedDeliveryMethod="+t),ACC.vertex.retrieveVertexInfoForCartItems(e)})},retrieveVertexInfoForCartItems:function(e){$.ajax({url:e,async:!0,dataType:"json"}).done(function(e){$(".phi-cart-itemprice.ph-ordersummarysubtotaltext").html(e.subTotal),$(".totals").find("span").html(e.totalPrice),"0.00"===e.deliveryCostUnformatted?(t='<span class="ph-free-shipping">'+ACC.config.validationMessages.freeShipping+"</span>",$(".phi-voucher-total__shippingcost").html(t)):$(".phi-voucher-total__shippingcost").html(e.deliveyCost),"true"===e.releaseGc&&0<$(".ph-giftcard-applied").length&&$(".ph-giftcard-applied").hide();var t=$(".ph-real-totals-tax-text").attr("data-vat");void 0!==t&&!1!==t&&(e=(t=$(".ph-real-totals-tax-text")).attr("data-vat").replace("{0}",e.totalTax),t.text(e))})}},ACC.worldpayHop={bindCountrySelector:function(){$('select[id^="address\\.country"]').on("change",function(){ACC.worldpayHop.enableTermsCheck(),ACC.worldpayHop.unselectUseDeliverAddress()})},unselectUseDeliverAddress:function(){$("#wpUseDeliveryAddress").prop("checked",!1)},bindUseDeliveryAddress:function(){var e,t,i,a=$("#wpUseDeliveryAddress");a.on("change",function(){var e={};ACC.worldpayHop.showHideDeliveryAddress(),a.is(":checked")?(e={countryIsoCode:$("#wpUseDeliveryAddressData").attr("data-countryisocode"),useDeliveryAddress:!0},ACC.worldpayHop.enableAddressForm(),ACC.worldpayHop.displayCreditCardAddressForm(e,ACC.worldpayHop.useDeliveryAddressSelected),ACC.worldpayHop.disableAddressForm(),ACC.worldpayHop.enableTermsCheck()):(e={countryIsoCode:$("#wpUseDeliveryAddressData").attr("data-countryisocode"),useDeliveryAddress:!0},ACC.worldpayHop.displayCreditCardAddressForm(e,ACC.worldpayHop.useDeliveryAddressSelected),ACC.worldpayHop.enableTermsCheck(),ACC.worldpayHop.clearAddressForm(),ACC.worldpayHop.enableAddressForm()),$('select[name^="address.regionIso"], select[name^="address.countryIso"]').next(".selectBox-dropdown").addClass("selectBox-disabled"),$('select[name="address.countryIso"]').prop("selectedIndex","1")}),$("#businessFlag").on("change",function(){ACC.worldpayHop.showHideDeliveryAddress()}),a.is(":checked")&&(ACC.worldpayHop.enableTermsCheck(),ACC.worldpayHop.disableAddressForm()),0<a.length&&(e=$('select[name="address.countryIso"]'),t=$("input:hidden#address\\.country"),i=0<$('input[name="address.phoneNumber"]').length?$('input[name="address.phoneNumber"]'):$('input[name="phoneNumber"]'),0<e.length&&(e.parent().parent().insertBefore(i.parent().parent().parent()),e.prop("selectedIndex","1")),0<t.length&&t.parent().insertBefore(i.parent().parent()))},showHideDeliveryAddress:function(){$("#businessFlag").is(":checked")?($(".ph-janrainrequiredfields, #wpBillingAddress, .phi-inputfields").show(),$(".ph-customselectbox").css("width","100%")):$("#wpUseDeliveryAddress").is(":checked")&&!$("#businessFlag").is(":checked")?$(".ph-janrainrequiredfields, #wpBillingAddress, .phi-inputfields").hide():($("#wpBillingAddress, .ph-janrainrequiredfields").show(),$(".phi-inputfields").hide())},bindSubmitBillingAddressForm:function(){$(".submit_worldPayHopForm").click(function(){var t,e,i=$(".iframeAdyenEnabled").val(),a=$(".iframeWpEnabled").val(),n=!0;!0===(n=0===$("#wpUseDeliveryAddress:checked").length?ACC.validation.inFEValidation(!0,$("#wpBillingAddress")):n)&&("false"!==i&&""!==i||"false"!==a&&""!==a?(e=t="",n=$("#wpUseDeliveryAddressData"),a={},"true"===i&&(t=JSON.parse($(".js-adyen-iframe").attr("data-adyen"))),e=(0<$(".ph-newcheckout-paymentmethod").length?$(".ph-payment-choice__radiobutton:checked").parents(".ph-payment-choice__slots").find("a"):$(".ph-payment-choice__radiobutton:checked").siblings("a")).attr("data-name"),a=0<$("#wpUseDeliveryAddress:checked").length||0<$(".ph-newcheckout-paymentmethod #wpUseDeliveryAddressData").length?{firstName:n.attr("data-firstname"),lastName:n.attr("data-lastname"),street:n.attr("data-line1").split(",")[1],houseNumber:n.attr("data-line1").split(",")[0],postalCode:n.attr("data-postalcode"),city:n.attr("data-town"),region:n.attr("data-regionisocode"),country:n.attr("data-countryisocode")}:(n=((n="")===$("#address\\.country").val()?$("#address\\.country").eq(1):$("#address\\.country")).val(),{firstName:$("#address\\.firstName").val(),lastName:$("#address\\.lastName").val(),street:$("#address\\.line1").val(),house
1Number:$("#address\\.houseNumber").val(),postalCode:$("#address\\.postcode").val(),city:$("#address\\.townCity").val(),region:$("#address\\.region").val(),country:n}),$.ajax({url:ACC.config.encodedContextPath+"/checkout/multi/worldpay/choose-payment-method/adyen",data:{paymentMethod:e,billingAddress:a}}).done(function(e){"true"===e.adyenIframeStatus&&""!==e.adyenSessionId&&null!==e.adyenSessionId?$.getScript(t.sdk,function(){ACC.adyen.initiate(),ACC.adyen.loadForm(e.adyenSessionId)}):"true"===e.wpIframeStatus&&null===e.adyenSessionId?($("#wpIframeContainer").append($(".iframeworldpay").html()),$("#worldPayBillingAddressForm").hide()):ACC.worldpayHop.useOldPaymentSolution()})):ACC.worldpayHop.useOldPaymentSolution()),localStorage.removeItem("selDeliveryType")})},useOldPaymentSolution:function(){ACC.common.blockFormAndShowProcessingMessage($(this)),$(".wpBillingAddress").filter(":hidden").remove(),ACC.worldpayHop.enableAddressForm(),""===$("#address\\.country").val()&&$("#address\\.country").val(ACC.config.country),$("#worldPayBillingAddressForm").attr("action",$(".btnWorldPayFormSubmit").attr("data-url")),$("#worldPayBillingAddressForm").submit()},checkShowTerms:function(){(0<$(".alert.negative").length||0===$("#viewSavedPayments").length)&&ACC.worldpayHop.enableTermsCheck()},enableTermsCheck:function(){$(".terms").show()},disableAddressForm:function(){$('input[id^="address\\."]').prop("disabled",!0),$('select[id^="address\\."]').prop("disabled",!0),$('select[name^="address.regionIso"]').next(".selectBox-dropdown").addClass("selectBox-disabled")},enableAddressForm:function(){$('input[id^="address\\."]').prop("disabled",!1),$('select[id^="address\\."]').prop("disabled",!1),$('select[name^="address.regionIso"]').next(".selectBox-dropdown").removeClass("selectBox-disabled"),$('select[name^="address.countryIso"]').next(".selectBox-dropdown").children(".selectBox-label").text($('select[name^="address.countryIso"] option:eq(1)').text())},clearAddressForm:function(){$('input[id^="address\\."]').val(""),$('select[id^="address\\."]').val(""),$("select").selectBox("value","")},useDeliveryAddressSelected:function(){$("#wpUseDeliveryAddress").is(":checked")?($('select[id^="address\\.country"]').val($("#wpUseDeliveryAddressData").attr("data-countryisocode")),ACC.worldpayHop.disableAddressForm()):(ACC.worldpayHop.clearAddressForm(),ACC.worldpayHop.enableAddressForm(),$('select[id^="address\\.country"]').val($("#wpUseDeliveryAddressData").attr("data-countryisocode")))},bindCreditCardAddressForm:function(){$("#wpBillingCountrySelector").find(":input").on("change",function(){var e=$
1(this).val();ACC.worldpayHop.displayCreditCardAddressForm({countryIsoCode:e,useDeliveryAddress:!1})})},displayCreditCardAddressForm:function(e,t){var i=(i=$("#address\\.country").parent()[0].outerHTML).replace("address.countryIso","address.countryIsoCopy");$.ajax({url:ACC.config.encodedContextPath+"/checkout/multi/payment/billingaddressform",async:!0,data:e,dataType:"html",beforeSend:function(){$("#wpBillingAddress").parents("div.checkout-paymentmethod").addClass("ph-blockloader")}}).done(function(e){$("#wpBillingAddress").html(e),$("#wpBillingAddress").parents("div.checkout-paymentmethod").removeClass("ph-blockloader"),$(".ph-customselectbox").selectBox(),"function"==typeof t&&t.call(),$('input[name="address.phoneNumber"]').parents(".ph-hintboxcontainer").before(i),0<$(".i18nAddressForm").length&&(0<$('input[name="address.phoneNumber"]').length?ACC.intltelInput.initJSIntltelinput("address.phoneNumber"):0<$('input[name="phoneNumber"]').length&&ACC.intltelInput.initJSIntltelinput("phoneNumber"),$(".ph-hint-button").click(function(){$(this).closest(".ph-hintboxcontainer").find(".ph-hintboxpopup").toggle(),$(".ph-hintboxpopup").outerWidth($(".ph-hintboxcontainer").find("input").outerWidth()+$(".ph-hintboxbtn").outerWidth()+10)}),$(document).on("tap mouseup",function(e){var t=$(".ph-hintboxpopup");t.is(e.target)||0!==t.has(e.target).length||t.hide()}))})}
1,bindPaymentMethod:function(){var e=$("#paymentMethod").val();function s(e,t,i){void 0!==philips.analytics&&(void 0===i?philips.analytics.trackConversion({name:"interaction",description:"payment_method:"+t.split(" ").join("_")}):philips.analytics.trackConversion({name:"interaction",description:"payment_method:credit_card:"+t.split(" ").join("_")})),"cod-multi"===e?$(".phi-codConfirm").show():$(".phi-codConfirm").hide(),$("#paymentMethod").val(e)}$('[data-name="'+e+'"]').addClass("selected"),"cod-multi"===e&&($(".phi-codConfirm").show(),$(".btnWorldPayFormSubmit").click(function(){philips.analytics.trackConversion({name:"interaction",description:"place_order"})})),$(".ph-payment-choice__radiobutton").click(function(){$(this).addClass("selected");var e=$(this).parents(".ph-payment-choice__slots--creditcard").html(),t=$(this).next("a").attr("data-name"),i=$(this).next("a").attr("data-value"),a=$(".ph-giftcard-oldcheckoutflow .ph-payment-choice__radiobutton"),n=$(".ph-giftcard-payment-content");0<$(".ph-newcheckout-paymentmethod").length&&(void 0===t||void 0===i)?(t=$(this).parents(".ph-payment-choice__slots").find("a").attr("data-name"),i=$(this).parents(".ph-payment-choice__slots").find("a").attr("data-value")):a.is(":checked")?n.removeClass("hidden"):n.addClass("hidden"),s(t,i,e)}),$(".ph-payment-choice__slots a").click(function(){$(this).parents(".ph-payment-choice__slots").find("input").prop("checked",!0);var e=$(this).parents(".ph-payment-choice__slots--creditcard").html();$(".phi-payment-icons div a.selected").removeClass("selected"),$(this).addClass("selected");var t=$(this).attr("data-name"),i=$(this).attr("data-value"),a=$(".ph-giftcard-oldcheckoutflow .ph-payment-choice__radiobutton"),n=$(".ph-giftcard-payment-content");return 0<$(".ph-newcheckout-paymentmethod").length&&(void 0===t||void 0===i)?(t=$(this).parent("div").next("a").attr("data-name"),i=$(this).parent("div").next("a").attr("data-value")):a.is(":checked")?n.removeClass("hidden"):n.addClass("hidden"),s(t,i,e),!1})}},$(document).ready(function(){ACC.worldpayHop.bindUseDeliveryAddress(),ACC.worldpayHop.bindCountrySelector(),ACC.worldpayHop.bindSubmitBillingAddressForm(),ACC.worldpayHop.showHideDeliveryAddress(),ACC.worldpayHop.bindCreditCardAddressForm(),ACC.worldpayHop.checkShowTerms(),ACC.worldpayHop.bindPaymentMethod();var e=$("#wpUseDeliveryAddress");$(".ph-alerts-wrapper")[0]||e.click(),"true"===$("#lock").val()&&(e.attr("disabled",!0),e.attr("checked","checked")),"Yes"===$(".upsstatus").val()&&($("#wpBillingCountrySelector").find("select option:eq(1)").attr("selected","selected"),e={countryIsoCode:$("#wpUseDeliveryAddressData").attr("data-countryisocode"),useDeliveryAddress:!0},ACC.worldpayHop.enableAddressForm(),ACC.worldpayHop.displayCreditCardAddressForm(e,ACC.worldpayHop.useDeliveryAddressSelected),ACC.worldpayHop.enableTermsCheck())}),ACC.hopdebug={bindAll:function(){this.bindShowDebugMode()}
1,bindShowDebugMode:function(){var e=$("#hostedOrderPagePostForm");"GET"===e.prop("method")||"get"===e.prop("method")?$("#hopDebugMode").attr("data-hopDebugMode")?$(".phi-hostedOrderPagePostForm").click(function(){window.location=e.prop("action")}):window.location=e.prop("action"):"POST"!==e.prop("method")&&"post"!==e.prop("method")||($("#hopDebugMode").attr("data-hopDebugMode")?$(".phi-hostedOrderPagePostForm").click(function(){e.submit()}):e.submit())}},$(document).ready(function(){ACC.hopdebug.bindAll()}),ACC.payment={activateSavedPaymentButton:function(){$(document).on("click",".js-saved-payments",function(e){e.preventDefault();e=$("#savedpaymentstitle").html();$.colorbox({href:"#savedpaymentsbody",inline:!0,maxWidth:"100%",opacity:.7,width:"320px",title:e,close:'<span class="ph-icon-cross"></span>'})})},bindPaymentCardTypeSelect:function(){ACC.payment.filterCardInformationDisplayed(),$("#card_cardType").change(function(){"024"===$(this).val()?$("#startDate, #issueNum").show():$("#startDate, #issueNum").hide()})},filterCardInformationDisplayed:function(){"024"===$("#card_cardType").val()?$("#startDate, #issueNum").show():$("#startDate, #issueNum").hide()}},$(document).ready(function(){ACC.payment.activateSavedPaymentButton(),ACC.payment.bindPaymentCardTypeSelect()}),ACC.paymentmethods={_autoload:["initJS"],initJS:function(){0<$(".ph-payment-choice__container").length&&$(".ph-payment-choice__container--toggler").click(function(){$(this).next().toggle(),$(".ph-payment-choice__creditclosesection").toggle(),$(".ph-payment-choice__container--toggler").toggleClass("ph-icon-arrow-down"),$(".ph-payment-choice__container--toggler").toggleClass("ph-icon-arrow-up")})}},ACC.adyen={initiate:function(){var i;chckt.hooks.beforeComplete=function(e,t){return i={payload:t.payload},$.ajax({url:ACC.config.encodedContextPath+"/checkout/multi/payment/hopresponseadyenpost/",headers:{"Content-Type":"application/json","Access-Control-Allow-Origin":"*","Access-Control-Allow-Methods":"POST","Access-Control-Allow-Headers":"*","X-API-key":"AQErhmfxLYnJbBJBw0m/n3Q5qf3VeINEAZpaS0dgSR/kqZxo2T5a1qwqjVUw+RDBXVsNvuR83LVYjEgiTGAH-Hk/X+b7E3kW81FCKpIsqNU14fiDtqaccJdVDAkDD1o4=-DSHmY7yEY46qKx3k"},data:JSON.stringify(i),method:"POST",type:"POST"}).done(function(e){location.href=e.replace("redirect:","")}),!1}},loadForm:function(e){var t=JSON.parse(e),i=JSON.parse($(".js-adyen-iframe").attr("data-adyen")),e='<div class="ph-adyen__wrapper"><div id="ph-adyen"></div><div class="ph-adyen__close ph-icon-cross"></div></div>';(0<$(".ph-newcheckout-paymentmethod").length?0<$(".ph-list-for-new-checkout").length?$(".ph-list-for-new-checkout"):$(".checkout-indent .ph-checkoutpagesborder"):$(".checkout-paymentmethod")).append(e);i={context:i.env,consolidateCards:!1,paymentMethods:{card:{sfStyles:{error:{color:"#983222"}}}}};$(".create_update_payment_form").addClass("hidden"),chckt.checkout(t.paymentSession,"#ph-adyen",i),setTimeout(function(){$(".chckt-button").addClass("btn btn-primary")},0),$(document).on("click",".ph-adyen__close",function(){ACC.adyen.removeForm()})},removeForm:function(){$(".ph-adyen__wrapper").remove(),$(".create_update_payment_form").removeClass("hidden")}},function(t){"function"==typeof define&&define.amd?define(["jquery"],function(e){t(e,window,document)}):"object"==typeof module&&module.exports?module.exports=t(require("jquery"),window,document):t(jQuery,window,document)}(function(r,s,e,o){"use strict";var l="intlTelInput",i=1,a={allowDropdown:!0,autoHideDialCode:!0,autoPlaceholder:"polite",customPlaceholder:null,dropdownContainer:"",excludeCountries:[],formatOnDisplay:!0,geoIpLookup:null,initialCountry:"",nationalMode:!0,onlyCountries:[],placeholderNumberType:"MOBILE",preferredCountries:["us","gb"],separateDialCode:!1,utilsScript:""},d=38,c=40,p=13,h=27,t=43,u=65,m=90,g=32,n=9,f=["800","822","833","844","855","866","877","880","881","882","883","884","885","886","887","888","889"];function v(e,t){this.telInput=r(e),this.options=r.extend({},a,t),this.ns="."+l+i++,this.isGoodBrowser=Boolean(e.setSelectionRange),this.hadInitialPlaceholder=Boolean(r(e).attr("placeholder"))}r(s).on("load",function(){r.fn[l].windowLoaded=!0}),v.prototype={_init:function(){return this.options.nationalMode&&(this.options.autoHideDialCode=!1),this.options.separateDialCode&&(this.options.autoHideDialCode=this.options.nationalMode=!1),this.isMobile=/Android.+Mobile|webOS|iPhone|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),this.isMobile&&(r("body").addClass("iti-mobile"),this.options.dropdownContainer||(this.options.dropdownContainer="body")),this.autoCountryDeferred=new r.Deferred,this.utilsScriptDeferred=new r.Deferred,this.selectedCountryData={},this._processCountryData(),this._generateMarkup(),this._setInitialState(),this._initListeners(),this._initRequests(),[this.autoCountryDeferred,this.utilsScriptDeferred]},_processCountryData:function(){this._processAllCountries(),this._processCountryCodes(),this._processPreferredCountries()},_addCountryCode:function(e,t,i){t in this.countryCodes||(this.countryCodes[t]=[]),this.countryCodes[t][i||0]=e},_processAllCountries:function(){var t,i;this.options.onlyCountries.length?(t=this.options.onlyCountries.map(function(e){return e.toLowerCase()}),this.countries=C.filter(function(e){return-1<t.indexOf(e.iso2)})):this.options.excludeCountries.length?(i=this.options.excludeCountries.map(function(e){return e.toLowerCase()}),this.countries=C.filter(function(e){return-1===i.indexOf(e.iso2)})):this.countries=C},_processCountryCodes:function(){this.countryCodes={};for(var e=0;e<this.countries.length;e++){var t=this.countries[e];if(this._addCountryCode(t.iso2,t.dialCode,t.priority),t.areaCodes)for(var i=0;i<t.areaCodes.length;i++)this._addCountryCode(t.iso2,t.dialCode+t.areaCodes[i])}},_processPreferredCountries:function(){this.preferredCountries=[];for(var e=0;e<this.options.preferredCountries.length;e++){var t=this.options.preferredCountries[e].toLowerCase(),t=this._getCountryData(t,!1,!0);t&&this.preferredCountries.push(t)}},_generateMarkup:function(){this.telInput.attr("autocomplete","off");var e="intl-tel-input";this.options.allowDropdown&&(e+=" allow-dropdown"),this.options.separateDialCode&&(e+=" separate-dial-code"),this.telInput.wrap(r("<div>",{class:e})),this.flagsContainer=r("<div>",{class:"flag-container"}).insertBefore(this.telInput);e=r("<div>",{class:"selected-flag"});e.appendTo(this.flagsContainer),this.selectedFlagInner=r("<div>",{class:"iti-flag"}).appendTo(e),this.options.separateDialCode&&(this.selectedDialCode=r("<div>",{class:"selected-dial-code"}).appendTo(e)),this.options.allowDropdown?(e.attr("tabindex","0"),r("<div>",{class:"iti-arrow"}).appendTo(e),this.countryList=r("<ul>",{class:"country-list hide"}),this.preferredCountries.length&&(this._appendListItems(this.preferredCountries,"preferred"),r("<li>",{class:"divider"}).appendTo(this.countryList)),this._appendListItems(this.countries,""),this.countryListItems=this.countryList.children(".country"),this.options.dropdownContainer?this.dropdown=r("<div>",{class:"intl-tel-input iti-container"}).append(this.countryList):this.countryList.appendTo(this.flagsContainer)):this.countryListItems=r()},_appendListItems:function(e,t){for(var i="",a=0;a<e.length;a++){var n=e[a];i+="<li class='country "+t+"' data-dial-code='"+n.dialCode+"' data-country-code='"+n.iso2+"'>",i+="<div class='flag-box'><div class='iti-flag "+n.iso2+"'></div></div>
1",i+="<span class='country-name'>"+n.name+"</span>",i+="<span class='dial-code'>+"+n.dialCode+"</span>",i+="</li>"}this.countryList.append(i)},_setInitialState:function(){var e=this.telInput.val();this._getDialCode(e)&&!this._isRegionlessNanp(e)?this._updateFlagFromNumber(e):"auto"!==this.options.initialCountry&&(this.options.initialCountry?this._setFlag(this.options.initialCountry.toLowerCase()):(this.defaultCountry=(this.preferredCountries.length?this.preferredCountries:this.countries)[0].iso2,e||this._setFlag(this.defaultCountry)),e||this.options.nationalMode||this.options.autoHideDialCode||this.options.separateDialCode||this.telInput.val("+"+this.selectedCountryData.dialCode)),e&&this._updateValFromNumber(e)},_initListeners:function(){this._initKeyListeners(),this.options.autoHideDialCode&&this._initFocusListeners(),this.options.allowDropdown&&this._initDropdownListeners()},_initDropdownListeners:function(){var t=this,e=this.telInput.closest("label");e.length&&e.on("click"+this.ns,function(e){t.countryList.hasClass("hide")?t.telInput.focus():e.preventDefault()}),this.selectedFlagInner.parent().on("click"+this.ns,function(e){!t.countryList.hasClass("hide")||t.telInput.prop("disabled")||t.telInput.prop("readonly")||t._showDropdown()}),this.flagsContainer.on("keydown"+t.ns,function(e){!t.countryList.hasClass("hide")||e.which!=d&&e.which!=c&&e.which!=g&&e.which!=p||(e.preventDefault(),e.stopPropagation(),t._showDropdown()),e.which==n&&t._closeDropdown()})},_initRequests:function(){var e=this;this.options.utilsScript?r.fn[l].windowLoaded?r.fn[l].loadUtils(this.options.utilsScript,this.utilsScriptDeferred):r(s).on("load",function(){r.fn[l].loadUtils(e.options.utilsScript,e.utilsScriptDeferred)}):this.utilsScriptDeferred.resolve(),"auto"===this.options.initialCountry?this._loadAutoCountry():this.autoCountryDeferred.resolve()},_loadAutoCountry:function(){r.fn[l].autoCountry?this.handleAutoCountry():r.fn[l].startedLoadingAutoCountry||(r.fn[l].startedLoadingAutoCountry=!0,"function"==typeof this.options.geoIpLookup&&this.options.geoIpLookup(function(e){r.fn[l].autoCountry=e.toLowerCase(),setTimeout(function(){r(".intl-tel-input input").intlTelInput("handleAutoCountry")})}))},_initKeyListeners:function(){var e=this;this.telInput.on("keyup"+this.ns,function(){e._updateFlagFromNumber(e.telInput.val())&&e._triggerCountryChange()}),this.telInput.on("cut"+this.ns+" paste"+this.ns,function(){setTimeout(function(){e._updateFlagFromNumber(e.telInput.val())&&e._triggerCountryChange()})})},_cap:function(e){var t=this.telInput.attr("maxlength");return t&&e.length>t?e.substr(0,t):e},_initFocusListeners:function(){var i=this;this.telInput.on("mousedown"+this.ns,function(e){i.telInput.is(":focus")||i.telInput.val()||(e.preventDefault(),i.telInput.focus())}),this.telInput.on("focus"+this.ns,function(e){i.telInput.val()||i.telInput.prop("readonly")||!i.selectedCountryData.dialCode||(i.telInput.val("+"+i.selectedCountryData.dialCode),i.telInput.one("keypress.plus"+i.ns,function(e){e.which==t&&i.telInput.val("")}),setTimeout(function(){var e,t=i.telInput[0];i.isGoodBrowser&&(e=i.telInput.val().length,t.setSelectionRange(e,e))}))});var e=this.telInput.prop("form");e&&r(e).on("submit"+this.ns,function(){i._removeEmptyDialCode()}),this.telInput.on("blur"+this.ns,function(){i._removeEmptyDialCode()})},_removeEmptyDialCode:function(){var e=this.telInput.val();"+"==e.charAt(0)&&((e=this._getNumeric(e))&&this.selectedCountryData.dialCode!=e||this.telInput.val("")),this.telInput.off("keypress.plus"+this.ns)},_getNumeric:function(e){return e.replace(/\D/g,"")},_showDropdown:function(){this._setDropdownPosition();var e=this.countryList.children(".active");e.length&&(this._highlightListItem(e),this._scrollTo(e)),this._bindDropdownListeners(),this.selectedFlagInner.children(".iti-arrow").addClass("up")},_setDropdownPosition:function(){var e,t,i,a,n=this;this.options.dropdownContainer&&this.dropdown.appendTo(this.options.dropdownContainer),this.dropdownHeight=this.countryList.removeClass("hide").outerHeight(),this.isMobile||(t=(e=this.telInput.offset()).top,a=r(s).scrollTop(),i=t+this.telInput.outerHeight()+this.dropdownHeight<a+r(s).height(),a=t-this.dropdownHeight>a,this.countryList.toggleClass("dropup",!i&&a),this.options.dropdownContainer&&(a=!i&&a?0:this.telInput.innerHe
1ight(),this.dropdown.css({top:t+a,left:e.left}),r(s).on("scroll"+this.ns,function(){n._closeDropdown()})))},_bindDropdownListeners:function(){var t=this;this.countryList.on("mouseover"+this.ns,".country",function(e){t._highlightListItem(r(this))}),this.countryList.on("click"+this.ns,".country",function(e){t._selectListItem(r(this))});var i=!0;r("html").on("click"+this.ns,function(e){i||t._closeDropdown(),i=!1});var a="",n=null;r(e).on("keydown"+this.ns,function(e){e.preventDefault(),e.which==d||e.which==c?t._handleUpDownKey(e.which):e.which==p?t._handleEnterKey():e.which==h?t._closeDropdown():(e.which>=u&&e.which<=m||e.which==g)&&(n&&clearTimeout(n),a+=String.fromCharCode(e.which),t._searchForCountry(a),n=setTimeout(function(){a=""},1e3))})},_handleUpDownKey:function(e){var t=this.countryList.children(".highlight").first(),t=e==d?t.prev():t.next();t.length&&(t.hasClass("divider")&&(t=e==d?t.prev():t.next()),this._highlightListItem(t),this._scrollTo(t))},_handleEnterKey:function(){var e=this.countryList.children(".highlight").first();e.length&&this._selectListItem(e)},_searchForCountry:function(e){for(var t=0;t<this.countries.length;t++)if(this._startsWith(this.countries[t].name,e)){var i=this.countryList.children("[data-country-code="+this.countries[t].iso2+"]").not(".preferred");this._highlightListItem(i),this._scrollTo(i,!0);break}},_startsWith:function(e,t){return e.substr(0,t.length).toUpperCase()==t},_updateValFromNumber:function(e){var t;this.options.formatOnDisplay&&s.intlTelInputUtils&&this.selectedCountryData&&(t=this.options.separateDialCode||!this.options.nationalMode&&"+"==e.charAt(0)?intlTelInputUtils.numberFormat.INTERNATIONAL:intlTelInputUtils.numberFormat.NATIONAL,e=intlTelInputUtils.formatNumber(e,this.selectedCountryData.iso2,t)),e=this._beforeSetNumber(e),this.telInput.val(e)},_updateFlagFromNumber:function(e){e&&this.options.nationalMode&&"1"==this.selectedCountryData.dialCode&&"+"!=e.charAt(0)&&(e="+"+(e="1"!=e.charAt(0)?"1"+e:e));var t=this._getDialCode(e),i=null,a=this._getNumeric(e);if(t){var n=this.countryCodes[this._getNumeric(t)],s=-1<r.inArray(this.selectedCountryData.iso2,n),t="+1"==t&&4<=a.length;if(!("1"==this.selectedCountryData.dialCode&&this._isRegionlessNanp(a)||s&&!t))for(var o=0;o<n.length;o++)if(n[o]){i=n[o];break}}else"+"==e.charAt(0)&&a.length?i="":e&&"+"!=e||(i=this.defaultCountry);return null!==i&&this._setFlag(i)},_isRegionlessNanp:function(e){e=this._getNumeric(e);if("1"!=e.charAt(0))return!1;e=e.substr(1,3);return-1<r.inArray(e,f)},_highlightListItem:function(e){this.countryListItems.removeClass("highlight"),e.addClass("highlight")},_getCountryData:function(e,t,i){for(var a=t?C:this.countries,n=0;n<a.length;n++)if(a[n].iso2==e)return a[n];if(i)return null;throw new Error("No country data for '"+e+"'")},_setFlag:function(e){var t=this.selectedCountryData.iso2?this.selectedCountryData:{};this.selectedCountryData=e?this._getCountryData(e,!1,!1):{},this.selectedCountryData.iso2&&(this.defaultCountry=this.selectedCountryData.iso2),this.selectedFlagInner.attr("class","iti-flag "+e);var i,a=e?this.selectedCountryData.name+": +"+this.selectedCountryData.dialCode:"Unknown";return this.selectedFlagInner.parent().attr("title",a),this.options.separateDialCode&&(i=this.selectedCountryData.dialCode?"+"+this.selectedCountryData.dialCode:"",a=this.telInput.parent(),t.dialCode&&a.removeClass("iti-sdc-"+(t.dialCode.length+1)),i&&a.addClass("iti-sdc-"+i.length),this.selectedDialCode.text(i)),this._updatePlaceholder(),this.countryListItems.removeClass("active"),e&&this.countryListItems.find(".iti-flag."+e).first().closest(".country").addClass("active"),t.iso2!==e},_updatePlaceholder:function(){var e="aggressive"===this.options.autoPlaceholder||!this.hadInitialPlaceholder&&(!0===this.options.autoPlaceholder||"polite"===this.options.autoPlaceholder);s.intlTelInputUtils&&e&&(e=intlTelInputUtils.numberType[this.options.placeholderNumberType],e=this.selectedCountryData.iso2?intlTelInputUtils.getExampleNumber(this.selectedCountryData.iso2,this.options.nationalMode,e):"",e=this._beforeSetNumber(e),"function"==typeof this.options.customPlaceholder&&(e=this.options.customPlaceholder(e,this.selectedCountryData)),this.telInput.attr("placeholder",e))},_selectListItem:function(e){var t=this._setFlag(e.attr("data-country-code"));this._closeDropdown(),this._updateDialCode(e.attr("data-dial-code"),!0),this.telInput.focus(),this.isGoodBrowser&&(e=this.telInput.val().length,this.telInput[0].setSelectionRange(e,e)),t&&this._triggerCountryChange()},_closeDropdown:function(){this.countryList.addClass("hide"),this.selectedFlagInner.children(".iti-arrow").removeClass("up"),r(e).off(this.ns),r("html").off(this.ns),this.countryList.off(this.ns),this.options.dropdownContainer&&(this.isMobile||r(s).off("scroll"+this.ns),this.dropdown.detach())},_scrollTo:function(e,t){var i=this.countryList,a=i.height(),n=i.offset().top,s=n+a,o=e.outerHeight(),r=e.offset().top,l=r+o,d=r-n+i.scrollTop(),e=a/2-o/2;r<n?(t&&(d-=e),i.scrollTop(d)):s<l&&(t&&(d+=e),i.scrollTop(d-(a-o)))},_updateDialCode:function(e,t){var i=this.telInput.val();if(e="+"+e,"+"==i.charAt(0))var a=this._getDialCode(i),a=a?i.replace(a,e):e;else{if(this.options.nationalMode||this.options.separateDialCode)return;if(i)a=e+i;else{if(!t&&this.options.autoHideDialCode)return;a=e}}this.telInput.val(a)},_getDialCode:function(e){var t="";if("+"==e.charAt(0))for(var i="",a=0;a<e.length;a++){var n=e.charAt(a);if(!isNaN(n)&&(i+=n,this.countryCodes[i]&&(t=e.substr(0,a+1)),4==i.length))break}return t},_getFullNumber:function(){var e=r.trim(this.telInput.val()),t=this.selectedCountryData.dialCode,i=this._getNumeric(e),i="1"==i.charAt(0)?i:"1"+i,t=this.options.separateDialCode?"+"+t:"+"!=e.charAt(0)&&"1"!=e.charAt(0)&&t&&"1"==t.charAt(0)&&4==t.length&&t!=i.substr(0,4)?t.substr(1):"";return t+e},_beforeSetNumber:function(e){var t;return!this.options.separateDialCode||(t=this._getDialCode(e))&&(t=" "===e[(t=null!==this.selectedCountryData.areaCodes?"+"+this.selectedCountryData.dialCode:t).length]||"-"===e[t.length]?t.length+1:t.length,e=e.substr(t)),this._cap(e)},_triggerCountryChange:function(){this.telInput.trigger("countrychange",this.selectedCountryData)},handleAutoCountry:function(){"auto"===this.options.initialCountry&&(this.defaultCountry=r.fn[l].autoCountry,this.telInput.val()||this.setCountry(this.defaultCountry),this.autoCountryDeferred.resolve())},handleUtils:function(){s.intlTelInputUtils&&(this.telInput.val()&&this._updateV
1alFromNumber(this.telInput.val()),this._updatePlaceholder()),this.utilsScriptDeferred.resolve()},destroy:function(){var e;this.allowDropdown&&(this._closeDropdown(),this.selectedFlagInner.parent().off(this.ns),this.telInput.closest("label").off(this.ns)),!this.options.autoHideDialCode||(e=this.telInput.prop("form"))&&r(e).off(this.ns),this.telInput.off(this.ns),this.telInput.parent().before(this.telInput).remove()},getExtension:function(){return s.intlTelInputUtils?intlTelInputUtils.getExtension(this._getFullNumber(),this.selectedCountryData.iso2):""},getNumber:function(e){return s.intlTelInputUtils?intlTelInputUtils.formatNumber(this._getFullNumber(),this.selectedCountryData.iso2,e):""},getNumberType:function(){return s.intlTelInputUtils?intlTelInputUtils.getNumberType(this._getFullNumber(),this.selectedCountryData.iso2):-99},getSelectedCountryData:function(){return this.selectedCountryData},getValidationError:function(){return s.intlTelInputUtils?intlTelInputUtils.getValidationError(this._getFullNumber(),this.selectedCountryData.iso2):-99},isValidNumber:function(){var e=r.trim(this._getFullNumber()),t=this.options.nationalMode?this.selectedCountryData.iso2:"";return s.intlTelInputUtils?intlTelInputUtils.isValidNumber(e,t):null},setCountry:function(e){e=e.toLowerCase(),this.selectedFlagInner.hasClass(e)||(this._setFlag(e),this._updateDialCode(this.selectedCountryData.dialCode,!1),this._triggerCountryChange())},setNumber:function(e){var t=this._updateFlagFromNumber(e);this._updateValFromNumber(e),t&&this._triggerCountryChange()}},r.fn[l]=function(i){var t,a=arguments;if(i===o||"object"==typeof i){var n=[];return this.each(function(){var e,t;r.data(this,"plugin_"+l)||(t=(e=new v(this,i))._init(),n.push(t[0]),n.push(t[1]),r.data(this,"plugin_"+l,e))}),r.when.apply(null,n)}if("string"==typeof i&&"_"!==i[0])return this.each(function(){var e=r.data(this,"plugin_"+l);e instanceof v&&"function"==typeof e[i]&&(t=e[i].apply(e,Array.prototype.slice.call(a,1))),"destroy"===i&&r.data(this,"plugin_"+l,null)}),t!==o?t:this},r.fn[l].getCountryData=function(){return C},r.fn[l].loadUtils=function(e,t){r.fn[l].loadedUtilsScript?t&&t.resolve():(r.fn[l].loadedUtilsScript=!0,r.ajax({type:"GET",url:e,complete:function(){r(".intl-tel-input input").intlTelInput("handleUtils")},dataType:"script",cache:!0}))},r.fn[l].defaults=a,r.fn[l].version="11.0.15";for(var C=[["Afghanistan (‫افغانستان‬‎)","af","93"],["Albania (Shqipëri)","al","355"],["Algeria (‫الجزائر‬‎)","dz","213"],["American Samoa","as","1684"],["Andorra","ad","376"],["Angola","ao","244"],["Anguilla","ai","1264"],["Antigua and Barbuda","ag","1268"],["Argentina","ar","54"],["Armenia (Հայաստան)","am","374"],["Aruba","aw","297"],["Australia","au","61",0],["Austria (Österreich)","at","43"],["Azerbaijan (Azərbaycan)","az","994"],["Bahamas","bs","1242"],["Bahrain (‫البحرين‬‎)","bh","973"],["Bangladesh (বাংলাদেশ)","bd","880"],["Barbados","bb","1246"],["Belarus (Беларусь)","by","375"],["Belgium (België)","be","32"],["Belize","bz","501"],["Benin (Bénin)","bj","229"],["Bermuda","bm","1441"],["Bhutan (འབྲུག)","bt","975"],["Bolivia","bo","591"],["Bosnia and Herzegovina (Босна и Херцеговина)","ba","387"],["Botswana","bw","267"],["Brazil (Brasil)","br","55"],["British Indian Ocean Territory","io","246"],["British Virgin Islands","vg","1284"],["Brunei","bn","673"],["Bulgaria (България)","bg","359"],["Burkina Faso","bf","226"],["Burundi (Uburundi)","bi","257"],["Cambodia (កម្ពុជា)","kh","855"],["Cameroon (Cameroun)","cm","237"],["Canada","ca","1",1,["204","226","236","249","250","289","306","343","365","387","403","416","418","431","437","438","450","506","514","519","548","579","581","587","604","613","639","647","672","705","709","742","778","780","782","807","819","825","867","873","902","905"]],["Cape Verde (Kabu Verdi)","cv","238"],["Caribbean Netherlands","bq","599",1],["Cayman Islands","ky","1345"],["Central African Republic (République centrafricaine)","cf","236"],["Chad (Tchad)","td","235"],["Chile","cl","56"],["China (中国)","cn","86"],["Christmas Island","cx","61",2],["Cocos (Keeling) Islands","cc","61",1],["Colombia","co","57"],["Comoros (‫جزر القمر‬‎)","km","269"],["Congo (DRC) (Jamhuri ya Kidemokrasia ya Kongo)","cd","243"],["Congo (Republic) (Congo-Brazzaville)","cg","242"],["Cook Islands","ck","682"],["Costa Rica","cr","506"],["Côte d’Ivoire","ci","225"],["Croatia (Hrvatska)","hr","385"],["Cuba","cu","53"],["Curaçao","cw","599",0],["Cyprus (Κύπρος)","cy","357"],["Czech Republic (Česká republika)","cz","420"],["Denmark (Danmark)","dk","45"],["Djibouti","dj","253"],["Dominica","dm","1767"],["Dominican Republic (República Dominicana)","do","1",2,["809","829","849"]],["Ecuador","ec","593"],["Egypt (‫مصر‬‎)","eg","20"],["El Salvador","sv","503"],["Equatorial Guinea (Guinea Ecuatorial)","gq","240"],["Eritrea","er","291"],["Estonia (Eesti)","ee","372"],["Ethiopia","et","251"],["Falkland Islands (Islas Malvinas)","fk","500"],["Faroe Islands (Føroyar)","fo","298"],["Fiji","fj","679"],["Finland (Suomi)","fi","358",0],["France","fr","33"],["French Guiana (Guyane française)","gf","594"],["French Polynesia (Polynésie française)","pf","689"],["Gabon","ga","241"],["Gambia","gm","220"],["Georgia (საქართველო)","ge","995"],["Germany (Deutschland)","de","49"],["Ghana (Gaana)","gh","233"],["G
1ibraltar","gi","350"],["Greece (Ελλάδα)","gr","30"],["Greenland (Kalaallit Nunaat)","gl","299"],["Grenada","gd","1473"],["Guadeloupe","gp","590",0],["Guam","gu","1671"],["Guatemala","gt","502"],["Guernsey","gg","44",1],["Guinea (Guinée)","gn","224"],["Guinea-Bissau (Guiné Bissau)","gw","245"],["Guyana","gy","592"],["Haiti","ht","509"],["Honduras","hn","504"],["Hong Kong (香港)","hk","852"],["Hungary (Magyarország)","hu","36"],["Iceland (Ísland)","is","354"],["India (भारत)","in","91"],["Indonesia","id","62"],["Iran (‫ایران‬‎)","ir","98"],["Iraq (‫العراق‬‎)","iq","964"],["Ireland","ie","353"],["Isle of Man","im","44",2],["Israel (‫ישראל‬‎)","il","972"],["Italy (Italia)","it","39",0],["Jamaica","jm","1876"],["Japan (日本)","jp","81"],["Jersey","je","44",3],["Jordan (‫الأردن‬‎)","jo","962"],["Kazakhstan (Казахстан)","kz","7",1],["Kenya","ke","254"],["Kiribati","ki","686"],["Kosovo","xk","383"],["Kuwait (‫الكويت‬‎)","kw","965"],["Kyrgyzstan (Кыргызстан)","kg","996"],["Laos (ລາວ)","la","856"],["Latvia (Latvija)","lv","371"],["Lebanon (‫لبنان‬‎)","lb","961"],["Lesotho","ls","266"],["Liberia","lr","231"],["Libya (‫ليبيا‬‎)","ly","218"],["Liechtenstein","li","423"],["Lithuania (Lietuva)","lt","370"],["Luxembourg","lu","352"],["Macau (澳門)","mo","853"],["Macedonia (FYROM) (Македонија)","mk","389"],["Madagascar (Madagasikara)","mg","261"],["Malawi","mw","265"],["Malaysia","my","60"],["Maldives","mv","960"],["Mali","ml","223"],["Malta","mt","356"],["Marshall Islands","mh","692"],["Martinique","mq","596"],["Mauritania (‫موريتانيا‬‎)","mr","222"],["Mauritius (Moris)","mu","230"],["Mayotte","yt","262",1],["Mexico (México)","mx","52"],["Micronesia","fm","691"],["Moldova (Republica Moldova)","md","373"],["Monaco","mc","377"],["Mongolia (Монгол)","mn","976"],["Montenegro (Crna Gora)","me","382"],["Montserrat","ms","1664"],["Morocco (‫المغرب‬‎)","ma","212",0],["Mozambique (Moçambique)","mz","258"],["Myanmar (Burma) (မြန်မာ)","mm","95"],["Namibia (Namibië)","na","264"],["Nauru","nr","674"],["Nepal (नेपाल)","np","977"],["Netherlands (Nederland)","nl","31"],["New Caledonia (Nouvelle-Calédonie)","nc","687"],["New Zealand","nz","64"],["Nicaragua","ni","505"],["Niger (Nijar)","ne","227"],["Nigeria","ng","234"],["Niue","nu","683"],["Norfolk Island","nf","672"],["North Korea (조선 민주주의 인민 공화국)","kp","850"],["Northern Mariana Islands","mp","1670"],["Norway (Norge)","no","47",0],["Oman (‫عُمان‬‎)","om","968"],["Pakistan (‫پاکستان‬‎)","pk","92"],["Palau","pw","680"],["Palestine (‫فلسطين‬‎)","ps","970"],["Panama (Panamá)","pa","507"],["Papua New Guinea","pg","675"],["Paraguay","py","595"],["Peru (Perú)","pe","51"],["Philippines","ph","63"],["Poland (Polska)","pl","48"],["Portugal","pt","351"],["Puerto Rico","pr","1",3,["787","939"]],["Qatar (‫قطر‬‎)","qa","974"],["Réunion (La Réunion)","re","262",0],["Romania (România)","ro","40"],["Russia (Россия)","ru","7",0],["Rwanda","rw","250"],["Saint Barthélemy (Saint-Barthélemy)","bl","590",1],["Saint Helena","sh","290"],["Saint Kitts and Nevis","kn","1869"],["Saint Lucia","lc","1758"],["Saint Martin (Saint-Martin (partie française))","mf","590",2],["Saint Pierre and Miquelon (Saint-Pierre-et-Miquelon)","pm","508"],["Saint Vincent and the Grenadines","vc","1784"],["Samoa","ws","685"],["San Marino","sm","378"],["São Tomé and Príncipe (São Tomé e Príncipe)","st","239"],["Saudi Arabia (‫المملكة العربية السعودية‬‎)","sa","966"],["Senegal (Sénégal)","sn","221"],["Serbia (Србија)","rs","381"],["Seychelles","sc","248"],["Sierra Leone","sl","232"],["Singapore","sg","65"],["Sint Maarten","sx","1721"],["Slovakia (Slovensko)","sk","421"],["Slovenia (Slovenija)","si","386"],["Solomon Islands","sb","677"],["Somalia (Soomaaliya)","so","252"],["South Africa","za","27"],["South Korea (대한민국)","kr","82"],["South Sudan (‫جنوب السودان‬‎)","ss","211"],["Spain (España)","es","34"],["Sri Lanka (ශ්‍රී ලංකාව)","lk","94"],["Sudan (‫السودان‬‎)","sd","249"],["Suriname","sr","597"],["Svalbard and Jan Mayen","sj","47",1],["Swaziland","sz","268"],["Swede
1n (Sverige)","se","46"],["Switzerland (Schweiz)","ch","41"],["Syria (‫سوريا‬‎)","sy","963"],["Taiwan (台灣)","tw","886"],["Tajikistan","tj","992"],["Tanzania","tz","255"],["Thailand (ไทย)","th","66"],["Timor-Leste","tl","670"],["Togo","tg","228"],["Tokelau","tk","690"],["Tonga","to","676"],["Trinidad and Tobago","tt","1868"],["Tunisia (‫تونس‬‎)","tn","216"],["Turkey (Türkiye)","tr","90"],["Turkmenistan","tm","993"],["Turks and Caicos Islands","tc","1649"],["Tuvalu","tv","688"],["U.S. Virgin Islands","vi","1340"],["Uganda","ug","256"],["Ukraine (Україна)","ua","380"],["United Arab Emirates (‫الإمارات العربية المتحدة‬‎)","ae","971"],["United Kingdom","gb","44",0],["United States","us","1",0],["Uruguay","uy","598"],["Uzbekistan (Oʻzbekiston)","uz","998"],["Vanuatu","vu","678"],["Vatican City (Città del Vaticano)","va","39",1],["Venezuela","ve","58"],["Vietnam (Việt Nam)","vn","84"],["Wallis and Futuna","wf","681"],["Western Sahara (‫الصحراء الغربية‬‎)","eh","212",1],["Yemen (‫اليمن‬‎)","ye","967"],["Zambia","zm","260"],["Zimbabwe","zw","263"],["Åland Islands","ax","358",1]],$=0;$<C.length;$++){var y=C[$];C[$]={name:y[0],iso2:y[1],dialCode:y[2],priority:y[3]||0,areaCodes:y[4]||null}}});
2//# sourceMappingURL=checkout.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.