!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,}))$/,b=/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d).{8,}$/,T="signIn",L="signUp",x="resetPassword",M="signIn",V="EMAIL_PASSWORD",O="forgotPassword",F="candidateProfileUpdated",R="ph:candidateLoggedinEvent",I="getUserProfileData",_="fyf_container",q="ph:bot:removeProfile",A="ph:site:removeProfile",U="apply",H="ph:hash:triggerCandidatePopup",j=27,K=9,B=13,N={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}},W=[{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:"'"}],$="fyfSignInHeading",J="fyfSignUpHeading",G="applySignInHeading",Y="applySignUpHeading",z="savedJobsSignUpHeading",Z="savedJobsSignInHeading",Q="loginEmail",X="loginPassword",ee="pcs-candidate-login-v1";function te(){this.constructor=w}function ie(){var e=null!==p&&p.apply(this,arguments)||this;return e.flowType="",e.elementTag=ee,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=M,e.isValidEmail=!1,e.isValidPassword=!1,e.isDropdownOpen=!1,e.socialProvider="",e.invalidCredentials=!1,e.resendEmail=!1,e.resetPasswordModel={rpToken:"",newPassword:""},e.pwdRegexMap=N,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.oneTimeLoginLink=!1,e.deviceType="",e.emailSendTried=!1,e.isMagicEmailLinkSent=!1,e.isShowOneTimeLoginPopup=!1,e.maskedEmail="",e.signUpStep=V,e.isEventRaisedFromApplyThankYouPage=!1,e}return{component:(p=r.BaseComponent,i(w=ie,C=p),w.prototype=null===C?Object.create(C):(te.prototype=C.prototype,new te),ie.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.oneTimeLoginLink=this.commonService.getSiteSettings("oneTimeLoginLink"),this.oneTimeLoginLink&&(this.signUpStep="LOGIN_LINK");var i=window.location.hash;r.EventBus.$on(H,function(e){if(o.deviceType=o.phenomAppManager.getDeviceType(),o.widgetContext&&"header"==o.widgetContext.context){if(o.isDialogOpen=!1,"mobile"===o.deviceType){var t=document.querySelector('[data-ph-at-id="mobile-hamburger-icon"]');t&&t.click()}o.element.childElementCount||(o.ignoreMulTriggerHashPopup=!0),setTimeout(function(){o.isEventRaisedForTriggerHashPopup&&!o.isLoggedIn&&("#profilelogin"===i?o.handleDialogModal(T):"#createprofile"===i&&o.handleDialogModal(L))},150)}}),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(H,{}));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||L,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(),document.addEventListener("openCreateProfilePopup",function(){setTimeout(function(){o.handleDialogModal("signUp"),o.isEventRaisedFromApplyThankYouPage=!0},100)})},ie.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)},ie.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