!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("vue"),require("../../../../common/v1/src")):"function"==typeof def&&def.amd?def("pcs-candidate-login-v1",["vue","../../../../common/v1/src"],t):((e=e||self).phw=e.phw||{},e.phw.PcsCandidateLoginV1=t(e.Vue,e.PcsCommon))}(this,function(h,r){"use strict";h=h&&h.hasOwnProperty("default")?h.default:h,r=r&&r.hasOwnProperty("default")?r.default:r;var i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(e,t)};function e(e,t,i,o){var s,n=arguments.length,a=n<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,o);else for(var r=e.length-1;0<=r;r--)(s=e[r])&&(a=(n<3?s(a):3()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,k=/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d).{8,}$/,b="signIn",T="signUp",x="resetPassword",L="signIn",V="forgotPassword",O="candidateProfileUpdated",M="ph:candidateLoggedinEvent",F="getUserProfileData",R="fyf_container",I="ph:bot:removeProfile",_="ph:site:removeProfile",q="apply",A="ph:hash:triggerCandidatePopup",U=27,H=9,j=13,K={upperCase:{regex:/(.*[A-Z].*)/,literal:"",hasError:!1},lowerCase:{regex:/(.*[a-z].*)/,literal:"",hasError:!1},numeric:{regex:/(.*\d.*)/,literal:"",hasError:!1},passwordLength:{regex:/(.{8,})/,literal:"",hasError:!1}},B=[{key:/</g,value:"<"},{key:/>/g,value:">"},{key:/&/g,value:"&"},{key:/©/g,value:"©"},{key:/®/g,value:"®"},{key:/“/g,value:"“"},{key:/”/g,value:"”"},{key:/‘/g,value:"‘"},{key:/’/g,value:"’"},{key:/'/g,value:"'"},{key:/"/g,value:'"'},{key:/'/g,value:"'"}],N="fyfSignInHeading",$="fyfSignUpHeading",J="applySignInHeading",W="applySignUpHeading",G="savedJobsSignUpHeading",z="savedJobsSignInHeading",Z="loginEmail",Q="loginPassword",X="pcs-candidate-login-v1";function Y(){this.constructor=E}function ee(){var e=null!==p&&p.apply(this,arguments)||this;return e.flowType="",e.elementTag=X,e.bindableModel=new P,e.commonService=r.CommonService,e.localStorage=r.LocalStorage,e.phenomAppManager=r.PhenomAppManager,e.translationFilter=r.TranslationFilter,e.candidateLoginService=new l,e.initialFlowType="",e.isPasswordVisible=!1,e.staySignIn=!0,e.profileDetails={profile:{}},e.isLoggedIn=!1,e.isDialogOpen=!1,e.signInModel={email:"",password:""},e.hasErrors=!1,e.errors=new S,e.step=L,e.isValidEmail=!1,e.isValidPassword=!1,e.isDropdownOpen=!1,e.socialProvider="",e.invalidCredentials=!1,e.resendEmail=!1,e.resetPasswordModel={rpToken:"",newPassword:""},e.pwdRegexMap=K,e.isHeadingDisabled=!1,e.cvUploaded=!1,e.tokenInvalid=!1,e.anonymousEmail="",e.showPasswordSrOnly=!1,e.passwordErrorSrOnly=!1,e.isFirstTimeUser=!0,e.userState="",e.isProfileDataAvailable=!1,e.widgetContent=void 0,e.signInHeading="",e.signUpHeading="",e.isEventRaisedForTriggerHashPopup=!1,e.ignoreMulTriggerHashPopup=!1,e.signUpSuccessSr=!1,e.signInSuccessSr=!1,e.privacyDataConsent=!1,e.privacyConsentError=!1,e.privacyConsentReqFlag=!1,e.piiConsentData={},e.piiConsentError=!1,e.piiConsentContext={},e.showConsentsForm=!1,e.submitData=!1,e.masterLiteralData={},e.isDisabled=!1,e.consentPrefill=!0,e.socialLoginContext={},e.preferredName=!1,e.subscriptions=[],e.isEmailValidationEnabled=!1,e.isVerifiedUser=!1,e.isResendFailed=!1,e.isShowValidationSuccessPopup=!1,e.isShowValidationFailurePopup=!1,e.isShowEmailValidationPopup=!1,e.privacyConsentPreCheck=!1,e.tokenExpiryTimeInMinutes=240,e.tokenExpiryTimeText="",e.isEmailValidationStatus=!1,e.isAccountDeletionStatus=!1,e.isCsrfGetLogoutFlowEnabled=!1,e.isEmailResend=!1,e.isResendBtnEnable=!0,e.resendEmailTimeOut=3e4,e.isDataFetch=!1,e.candidateHubUrl="",e.deviceType="",e}return{component:(p=r.BaseComponent,i(E=ee,C=p),E.prototype=null===C?Object.create(C):(Y.prototype=C.prototype,new Y),ee.prototype.widgetViewLoaded=function(){var o=this;this.element=this.$el,this.getPiiConsentData(),this.getMasterLiteralData(),this.userState=this.phenomAppManager.getSegmentedUserState&&this.phenomAppManager.getSegmentedUserState(),this.isPrivacyDataConsentCheckBoxRequired(),this.isCsrfGetLogoutFlowEnabled=this.commonService.getSiteSettings("isCsrfGetLogoutFlowEnabled"),0==this.commonService.getSiteSettings("consentPrefill")&&(this.consentPrefill=!1),this.preferredName=this.commonService.getSiteSettings("preferredName"),this.candidateHubUrl=this.commonService.getSiteSettings("candidateHomeUrl"),this.candidateHubUrl&&(this.candidateHubUrl=this.phenomAppManager.getBaseUrl()+""+this.candidateHubUrl);var t=window.location.hash;r.EventBus.$on(A,function(e){o.deviceType=o.phenomAppManager.getDeviceType(),o.widgetContext&&"header"==o.widgetContext.context&&(o.element.childElementCount||(o.ignoreMulTriggerHashPopup=!0),setTimeout(function(){if(o.isEventRaisedForTriggerHashPopup&&!o.isLoggedIn){if("mobile"===o.deviceType&&("#profilelogin"===t||"#createprofile"===t)){var e=document.querySelector('[data-ph-at-id="mobile-hamburger-icon"]');e&&e.click(),o.isDialogOpen=!1}setTimeout(function(){"#profilelogin"===t?o.handleDialogModal(b):"#createprofile"===t&&o.handleDialogModal(T)},5)}},5))}),this.fetchValidateJwtToken().then(function(){o.getContextBasedHeading(),o.getStateBasedHeading(),o.widgetContext=o.widgetContext||{};var e=o.widgetContext.context;o.isLoggedIn||"header"!==e||o.isEventRaisedForTriggerHashPopup||o.ignoreMulTriggerHashPopup||(o.isEventRaisedForTriggerHashPopup=!0,r.EventBus.$emit(A,{}));var t=o.phenomAppManager.getSessionParams("validationStatus"),i=o.phenomAppManager.getSessionParams("accountDeletionStatus");o.isEmailValidationStatus=!!t,o.isAccountDeletionStatus=!!i,t&&"200"===t||i&&"200"===i?o.isShowValidationSuccessPopup=!0:(t&&("401"===t||"400"===t||"500"===t)||i&&("401"===i||"400"===i||"500"===i))&&(o.isShowValidationFailurePopup=!0),o.openEmailValidationStatusPopup(),(o.isShowValidationSuccessPopup||o.isShowValidationFailurePopup)&&o.candidateLoginService.makeDDORequest(n.v1.ddoKeyRemoveValidationDataFromSession,{}).then(function(e){}),o.isDataFetch=!0}),this.subscribeEvents(),this.flowType=this.flowType||T,this.initialFlowType=this.flowType,this.localStorage.getItem("_li")&&(this.isFirstTimeUser=!1),document.addEventListener("mouseup",this.handleDropdownOutsideScope,!0),document.addEventListener("keyup",this.handleDropdownOutsideScope,!0),this.initialFlowType==x&&this.checkValidToken(),(this.commonService.getSiteSettings("navItems")||{}).candidateHome||this.hideContainer(),this.updateTokenExpiry()},ee.prototype.openEmailValidationStatusPopup=function(){var s=this;(this.isShowValidationSuccessPopup||this.isShowValidationFailurePopup)&&setTimeout(function(){var e=s.element.querySelector(s.isLoggedIn?".ph-a11y-after-close-focus-elem":s.isFirstTimeUser?".create-account-link":".sign-in-link"),t=s.element.querySelector(s.isShowValidationSuccessPopup?".email-val-success .btn":".email-val-failure .btn"),i=s.element.querySelector(".popup-modal-backdrop");i&&i.classList.add("active");var o=s.element.querySelector(s.isShowValidationSuccessPopup?".ph-ally-email-validation-success":".ph-ally-email-validation-failure");document.addEventListener("keyup",s.handleValidationStatusEscape),document.addEventListener("click",s.handleValidationStatusEscape),o&&r.DialogManager.openDialog(o,t,e,null,null,!0)},250)},ee.prototype.updateTokenExpiry=function(){this.tokenExpiryTimeInMinutes=parseInt(this.commonService.getSiteSettings("emailValidationTokenExpiry"))||this.tokenExpiryTimeInMinutes;var e=Math.floor(this.tokenExpiryTimeInMinutes/60),t=this.tokenExpiryTimeInMinutes%60;e&&(this.tokenExpiryTimeText+=e+(1