"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[933],{533:(e,t,a)=>{a.d(t,{f:()=>l,n:()=>s});var i=a(37876),r=a(37477),n=a(40917),o=a(80072);a(14232);let s=new Map([[o.C.PreEligibility,{label:"Age & BMI",icon:r.IconScaleOutline}],[o.C.ContactDetails,{label:"Personal Details",icon:r.IconId}],[o.C.InsuranceDetails,{label:"Insurance Info",icon:r.IconClipboardPlus}]]),l=e=>{var t;let{currentStep:a,steps:r=s}=e,o=null==(t=r.get(a))?void 0:t.label,l=Array.from(r.values());return(0,i.jsx)(n.s,{currentStep:o,steps:l})}},32246:(e,t,a)=>{a.d(t,{K:()=>ed});var i=a(37876),r=a(37477),n=a(59004),o=a(91366),s=a(48934),l=a(14901),c=a(16741),d=a(80075),u=a(6770),m=a(39946),g=a(63583),p=a(53154),h=a(30435),b=a(42037),C=a(70587),x=a(11427),f=a(86535),y=a(27297),D=a(43483),v=a(81488),I=a(93511),E=a(34305),S=a(80072),w=a(66885),P=a(62227),j=a(14232),A=a(11969),L=a(10758),R=a(85007),M=a(20411),k=a(31346),T=a(38360),U=a(39648),B=a(77944),F=a(47353),O=a(83928),N=a(33841),_=a(13751),H=a(92323),X=a(86687),V=a(89225),z=a(97793),W=a(68792),q=a(65159),Y=a(39777),K=a(45352),G=a(63826);let Q=e=>e===G.w.FULL_MATCH||e===G.w.ELIGIBLE_MATCH,J=e=>{switch(e){case G.w.PERSON_MATCH:case G.w.INSURANCE_MATCH:case G.w.EXPIRED:case G.w.NOT_FOUND:return E.XN.EligibleWaiting;case G.w.FULL_MATCH:case G.w.ELIGIBLE_MATCH:default:return}};var $=function(e){return e.CreateLead="createLead",e.CreateContact="createContact",e.UpdateContact="updateContact",e.DetermineContactOrLead="determineContactOrLead",e.FetchConsents="fetchConsents",e.UpdateEmail="updateEmail",e.CheckEligibility="checkEligibility",e.CheckBenefits="checkBenefits",e}($||{});let Z={...z.f,...$},ee=V.Ek[N.fz.PequotHealthCare],et={formData:{birthdate:"",comorbidity:"",currentWeightInPounds:"",dateOfHighestWeightValue:"",email:"",firstName:"",heightInFoot:"",heightInInch:"",highestWeightInPounds:"",insuranceCoverage:void 0,insuranceMemberID:"",insurance:void 0,lastName:"",phone:"",state:void 0,termsAgreement:!1,howDidYouFindUS:"",comorbidities:[],diabetes:"",bariatricSurgery:""},eligibilityCheckMatchType:void 0,bmi:void 0,benefitsCheck:void 0,otpData:void 0,consentsData:{items:[],userConsentStatus:[]},contactData:{},passwordData:{password:void 0,confirmPassword:void 0},flyteUserData:void 0,error:void 0,labs:void 0},ea={..._.AU,..._.gQ,..._.pE,..._.UH,..._.yF,..._.n6,..._.uN,..._.yS,..._.RW,..._.i_,...(0,_.rS)(et).reset},ei=(0,q.mj)({types:{},guards:{isPreEligibilityMet:e=>{let{context:{formData:t,bmi:a}}=e;return W.J0.pequotHealthCare({bmi:a,comorbidity:t.comorbidity,birthdate:t.birthdate})},isApplicationReviewRequired:e=>{let{context:{eligibilityCheckMatchType:t,formData:a}}=e;return!O.A.shouldBypassIsApplicationReviewRequired({email:a.email})&&[N.wY.EXPIRED,N.wY.INSURANCE_MATCH,N.wY.PERSON_MATCH,N.wY.NOT_FOUND].includes(t)},isApplicationDetected:X.L,isAthenaRecordCreated:H.z},actions:ea}).createMachine({context:()=>et,id:"pequotMachine",initial:Z.PreEligibility,states:{[Z.PreEligibility]:{id:Z.PreEligibility,initial:Z.Idle,states:{[Z.Idle]:{on:{SUBMIT:{target:Z.Submitting,actions:"updateFormData"}}},[Z.Submitting]:{entry:"assignBMI",always:[{target:"#".concat(Z.ContactDetails),guard:"isPreEligibilityMet"},{target:"#".concat(Z.EligibilityUnmet)}]}}},[Z.ContactDetails]:{id:Z.ContactDetails,initial:Z.Idle,states:{[Z.Idle]:{on:{SUBMIT:{target:"#".concat(Z.InsuranceDetails),actions:"updateFormData"}}}}},[Z.InsuranceDetails]:{id:Z.InsuranceDetails,initial:Z.Idle,states:{[Z.Idle]:{on:{BACK:{target:"#".concat(Z.ContactDetails)},SUBMIT:{target:"#".concat(Z.InsuranceDetailsReview),actions:"updateFormData"}}}}},[Z.InsuranceDetailsReview]:{id:Z.InsuranceDetailsReview,initial:Z.Idle,states:{[Z.Idle]:{on:{SUBMIT:{actions:"updateFormData",target:Z.Submitting}}},[Z.Submitting]:{id:Z.Submitting,initial:Z.CheckEligibility,states:{[Z.CheckEligibility]:{id:Z.CheckEligibility,invoke:{src:(0,Y.Sx)(async e=>{let{input:t}=e,a={...t,insurance:V.w[N.fz.PequotHealthCare],benefitProgram:V.Nl[N.fz.PequotHealthCare]};return await (0,U.w)(a)}),input:e=>{let{context:{formData:t}}=e;return t},onDone:[{actions:(0,K.a)({eligibilityCheckMatchType:e=>{let{event:t}=e;return t.output.data.matchType}}),target:"#".concat(Z.CheckBenefits)}],onError:"#".concat(Z.InsuranceDetailsReview,".").concat(Z.Error)}},[Z.CheckBenefits]:{id:Z.CheckBenefits,invoke:{src:(0,Y.Sx)(async e=>{let{input:t}=e,a={...t,payerCode:V.dT[N.lk["Pequot HealthCare"]]};return await (0,M.R)(a)}),input:e=>{let{context:{formData:t}}=e;return t},onDone:[{actions:(0,K.a)({benefitsCheck:e=>{let{event:t}=e;return t.output.data}}),target:"#".concat(Z.DetermineContactOrLead)}],onError:"#".concat(Z.DetermineContactOrLead)}},[Z.DetermineContactOrLead]:{id:Z.DetermineContactOrLead,always:[{guard:"isApplicationReviewRequired",target:Z.CreateLead},{target:Z.CreateContact}]},[Z.CreateContact]:{id:Z.CreateContact,invoke:{src:(0,Y.Sx)(async e=>{let{input:t}=e,a={...t.formData,...t.formData.insuranceMemberID&&{employmentVerificationCode:t.formData.insuranceMemberID},...t.benefitsCheck&&{benefitsCheck:t.benefitsCheck},eligibilityVerifiedBy:N.h9.Evolve,company:ee,insurance:V.Ft[N.fz.PequotHealthCare],evolveOrganization:N.PM["Pequot Tribal Family Health Plan"],accountId:V.f3[N.fz.PequotHealthCare]};return await (0,T.vY)(a)}),input:e=>{let{context:t}=e;return t},onDone:{actions:"assignContactData",target:"#".concat(Z.EmailVerification)},onError:[{guard:"isApplicationDetected",target:"#".concat(Z.ApplicationDetected)},{target:"#".concat(Z.InsuranceDetailsReview,".").concat(Z.Error)}]}},[Z.CreateLead]:{id:Z.CreateLead,invoke:{src:(0,Y.Sx)(async e=>{let{input:t}=e,a={...t.formData,...t.formData.insuranceMemberID&&{employmentVerificationCode:t.formData.insuranceMemberID},...t.benefitsCheck&&{benefitsCheck:t.benefitsCheck},eligibilityVerifiedBy:N.h9.Evolve,company:ee,insurance:V.Ft[N.fz.PequotHealthCare],evolveOrganization:N.PM["Pequot Tribal Family Health Plan"],leadStatus:J(t.eligibilityCheckMatchType),automateEvolveEnrollment:Q(t.eligibilityCheckMatchType)};return await (0,F.t)(a)}),input:e=>{let{context:t}=e;return t},onDone:[{guard:"isApplicationReviewRequired",target:"#".concat(Z.ApplicationReview)},{target:"#".concat(Z.ApplicationComplete)}],onError:[{guard:"isApplicationDetected",target:"#".concat(Z.ApplicationDetected)},{target:"#".concat(Z.InsuranceDetailsReview,".").concat(Z.Error)}]}}}},[Z.Error]:{id:"".concat(Z.InsuranceDetailsReview,".").concat(Z.Error),on:{SUBMIT:{actions:["updateFormData","resetBenefitsCheck"],target:Z.Submitting}}}}},[Z.EmailVerification]:{id:Z.EmailVerification,initial:Z.Idle,states:{[Z.Idle]:{id:"".concat(Z.EmailVerification,".").concat(Z.Idle),on:{SUBMIT:{actions:"assignOtpCode",target:Z.Submitting},RESEND_EMAIL_VERIFICATION:{target:Z.Idle,reenter:!0},UPDATE_EMAIL:{target:Z.UpdateEmail}},invoke:{input:e=>{var t;let{context:a,event:i}=e;return{email:a.formData.email,firstName:a.formData.firstName,onSuccess:null==i||null==(t=i.data)?void 0:t.onSuccess}},src:(0,Y.Sx)(async e=>{let{input:t}=e,a={email:t.email,firstName:t.firstName};return{token:(await (0,L.v)(a)).data.token,onSuccess:t.onSuccess}}),onDone:{actions:[(0,K.a)({otpData:e=>{let{context:t,event:a}=e;return{...t.otpData,token:a.output.token}}}),e=>{var t;let{event:a}=e;(null==a||null==(t=a.output)?void 0:t.onSuccess)&&a.output.onSuccess()}]},onError:Z.Error}},[Z.Submitting]:{invoke:{src:(0,Y.Sx)(async e=>{let{input:t}=e,a={email:t.formData.email,token:t.otpData.token,otp:t.otpData.otp};return await (0,R.R)(a)}),input:e=>{let{context:t}=e;return t},onDone:"#".concat(Z.OnboardingChecklist),onError:Z.Error}},[Z.Error]:{on:{SUBMIT:{actions:"assignOtpCode",target:Z.Submitting},RESEND_EMAIL_VERIFICATION:{target:Z.Idle},UPDATE_EMAIL:{target:Z.UpdateEmail}}},[Z.UpdateEmail]:{initial:Z.Idle,states:{[Z.Idle]:{invoke:{input:e=>{let{context:t,event:a}=e;return{contactId:t.contactData.contactId,email:a.data.email,onSuccess:a.data.onSuccess}},src:(0,Y.Sx)(async e=>{let{input:t}=e,a={contactId:t.contactId,email:t.email};return await (0,T.CI)(a),{email:t.email,onSuccess:t.onSuccess}}),onDone:{actions:["assignNewEmail",e=>{var t;let{event:a}=e;(null==a||null==(t=a.output)?void 0:t.onSuccess)&&a.output.onSuccess()}],target:"#".concat(Z.EmailVerification,".").concat(Z.Idle)},onError:Z.Error}},[Z.Error]:{on:{SUBMIT:{target:"#".concat(Z.EmailVerification,".").concat(Z.Idle)},RESEND_EMAIL_VERIFICATION:{target:"#".concat(Z.EmailVerification,".").concat(Z.Idle)},UPDATE_EMAIL:{target:Z.Idle}}}}}}},[Z.ReviewConsents]:{id:Z.ReviewConsents,initial:Z.FetchConsents,states:{[Z.Idle]:{on:{SUBMIT:{actions:["assignUserConsentStatus"],target:Z.Submitting}}},[Z.FetchConsents]:{invoke:{src:(0,Y.Sx)(async()=>await (0,k.i)()),onDone:{actions:"assignConsents",target:Z.Idle},onError:Z.Error}},[Z.Submitting]:{invoke:{src:(0,Y.Sx)(async e=>{let{input:t}=e,a={patientIdentifier:t.contactData.contactId,firstName:t.formData.firstName,lastName:t.formData.lastName,phone:t.formData.phone,email:t.formData.email,birthDate:t.formData.birthdate,state:t.formData.state,heightInInch:t.formData.heightInInch,heightInFeet:t.formData.heightInFoot,currentWeightInPounds:t.formData.currentWeightInPounds,evolveOrganization:N.PM["Pequot Tribal Family Health Plan"],consents:t.consentsData.userConsentStatus};return await (0,B.Y)(a)}),input:e=>{let{context:t}=e;return t},onDone:[{actions:"assignFlyteUserData",target:Z.UpdateContact}],onError:"#".concat(Z.OnboardingUserError)}},[Z.UpdateContact]:{invoke:{src:(0,Y.Sx)(async e=>{let{input:t}=e,a={contactId:t.contactData.contactId,evolvePatientID:t.flyteUserData.patientId};return await (0,T.CI)(a)}),input:e=>{let{context:t}=e;return t},onDone:[{guard:"isAthenaRecordCreated",target:"#".concat(Z.CreatePassword)},{target:"#".concat(Z.OnboardingUserError)}],onError:"#".concat(Z.OnboardingUserError)}},[Z.Error]:{on:{SUBMIT:{actions:["assignUserConsentStatus"],target:Z.Submitting}}}}},[Z.CreatePassword]:{id:Z.CreatePassword,initial:Z.Idle,states:{[Z.Idle]:{on:{SUBMIT:{actions:"assignPasswordData",target:Z.Submitting}}},[Z.Submitting]:{invoke:{src:(0,Y.Sx)(async e=>{let{input:t}=e,a={email:t.formData.email,password:t.passwordData.password,confirmPassword:t.passwordData.confirmPassword};return await (0,A.I)(t.flyteUserData.verifyToken,a)}),input:e=>{let{context:t}=e;return t},onDone:"#".concat(Z.RequestLabs),onError:{target:Z.Error,actions:"assignError"}}},[Z.Error]:{on:{SUBMIT:{actions:["resetError","assignPasswordData"],target:Z.Submitting}}}}},[Z.RequestLabs]:{id:Z.RequestLabs,on:{PROCEED_TO_SUBMIT_LABS:"#".concat(Z.SubmitLabs),LAB_REQUESTED:{target:"#".concat(Z.AppDownload),actions:"assignLabLocation"},SUBMIT_LABS_LATER:{actions:"assignLabsSkipped",target:"#".concat(Z.AppDownload)}}},[Z.SubmitLabs]:{id:Z.SubmitLabs,on:{GO_BACK_TO_REQUEST_LABS:"#".concat(Z.RequestLabs),LAB_SUBMITTED:{actions:"registerLabsUploaded",target:"#".concat(Z.AppDownload)},SUBMIT_LABS_LATER:{actions:"assignLabsSkipped",target:"#".concat(Z.AppDownload)}}},[Z.OnboardingChecklist]:{id:Z.OnboardingChecklist,on:{SUBMIT:{target:"#".concat(Z.ReviewConsents)}}},[Z.AppDownload]:{id:Z.AppDownload},[Z.ApplicationReview]:{id:Z.ApplicationReview},[Z.OnboardingUserError]:{id:Z.OnboardingUserError},[Z.ApplicationComplete]:{id:Z.ApplicationComplete},[Z.ApplicationDetected]:{id:Z.ApplicationDetected},[Z.EligibilityUnmet]:{id:Z.EligibilityUnmet,initial:Z.Idle,states:{[Z.Idle]:{on:{SUBMIT:{target:Z.Submitting,actions:"updateFormData"}}},[Z.Submitting]:{invoke:{src:(0,Y.Sx)(async e=>{let{input:t}=e,a={...t,company:ee,leadStatus:N.XN.Ineligible,ineligibilityReason:N.hT.BMI,automateEvolveEnrollment:!1};return await (0,F.t)(a)}),input:e=>{let{context:{formData:t}}=e;return t},onDone:Z.Success,onError:Z.Error}},[Z.Success]:{},[Z.Error]:{on:{SUBMIT:{actions:"updateFormData",target:Z.Submitting}}}}}},on:{RESET:{target:"#".concat(Z.PreEligibility),actions:"reset"}}});var er=a(69443);let en={[S.C.PreEligibility]:{title:(0,i.jsxs)(r.TextPairing,{variant:"textpairing-header-2XL",children:[(0,i.jsx)(r.TextPairing.Label,{color:"text-primary",children:"Let's make sure you're eligible for the FlyteHealth program."}),(0,i.jsx)(r.TextPairing.SubLabel,{color:"text-secondary",children:"To be eligible for the FlyteHealth program through your Pequot HealthCare benefits, you must meet specific age and Body Mass Index (BMI)* requirements."})]}),bmiEnrollmentDisclaimer:(0,i.jsx)(r.Text,{variant:"text-body-meta-regular",color:"text-secondary",children:"*We acknowledge that Body Mass Index (BMI) is an imperfect way to screen for excess weight. FlyteHealth providers do not use BMI alone as a measure of overall health. Instead, BMI is used as a data point to see if someone is eligible to join the FlyteHealth program. Once someone joins the program, we'll ask each person more about their health to create a personalized treatment plan."})},[S.C.EligibilityUnmet]:{title:(0,i.jsxs)(r.TextPairing,{variant:"textpairing-header-2XL",children:[(0,i.jsx)(r.TextPairing.Label,{color:"text-secondary-negative",children:"Unfortunately, you are not eligible to join FlyteHealth at this time."}),(0,i.jsx)(r.TextPairing.SubLabel,{color:"text-secondary",children:"The FlyteHealth program requires a minimum BMI of 27+ (plus one or more weight-related health conditions) or a BMI of 30+."})]})},[S.C.ContactDetails]:{title:(0,i.jsxs)(r.TextPairing,{variant:"textpairing-header-2XL",children:[(0,i.jsx)(r.TextPairing.Label,{color:"text-secondary-negative",children:"Congratulations! You're eligible for the FlyteHealth program"}),(0,i.jsx)(r.TextPairing.SubLabel,{color:"text-secondary",children:"To help us match your information with your employer, tell us about yourself. Next, we'll ask about your Pequot Healthcare membership. Be sure to have your insurance card handy."})]})},[S.C.InsuranceDetails]:{title:(0,i.jsxs)(r.Text,{variant:"text-header-2XL",color:"text-secondary-negative",children:["One more thing:"," ",(0,i.jsx)(r.Text,{as:"span",variant:"text-header-2XL",color:"text-primary",children:"What's your Pequot HealthCare membership number?"})]})},[S.C.InsuranceDetailsReview]:{title:(0,i.jsxs)(r.TextPairing,{variant:"textpairing-header-2XL",children:[(0,i.jsx)(r.TextPairing.Label,{children:"Let's review: Is your info correct?"}),(0,i.jsx)(r.TextPairing.SubLabel,{color:"text-secondary",children:"Please double-check the information you provided to make sure everything is correct."})]})},[S.C.ApplicationComplete]:{title:(0,i.jsxs)(r.TextPairing,{variant:"textpairing-header-2XL",children:[(0,i.jsx)(r.TextPairing.Label,{color:"text-secondary-negative",children:"Welcome aboard! We're so excited you're here."}),(0,i.jsx)(r.TextPairing.SubLabel,{color:"text-secondary",children:"Next, we need to confirm your email. Click the link we sent to:"})]}),description:(0,i.jsx)(r.Text,{mt:"spacer-8",color:"text-secondary",variant:"text-body-regular",children:"Can’t find the email? Make sure to check your Spam folder."})},[S.C.ApplicationReview]:{title:(0,i.jsxs)(r.TextPairing,{variant:"textpairing-header-2XL",children:[(0,i.jsx)(r.TextPairing.Label,{color:"text-primary",children:"You're almost finished!"}),(0,i.jsx)(r.TextPairing.SubLabel,{color:"text-secondary",children:"We've received your application, but we need a little more information from you to move forward. Please call us to complete the application process."})]})},[S.C.ApplicationDetected]:{title:(0,i.jsx)(r.Text,{variant:"text-header-2XL",color:"text-primary",children:"We found an existing account for:"}),description:(0,i.jsx)(r.Text,{variant:"text-body-display-S",color:"text-secondary",children:"It looks like you already have an account with us. To continue or update your registration details, please contact our Care Coordinator team."})},[S.C.EmailVerification]:er.M[S.C.EmailVerification],[S.C.OnboardingChecklist]:er.M[S.C.OnboardingChecklist],[S.C.CreatePassword]:er.M[S.C.CreatePassword],[S.C.AppDownload]:er.M[S.C.AppDownload],[S.C.ReviewConsents]:er.M[S.C.ReviewConsents]};var eo=a(82393);let es=[E.UX.BenefitsWebsite,E.UX.ProviderReferral,E.UX.WordOfMouth,E.UX.Other],el={[S.C.ContactDetails]:{state:{options:eo.rI},howDidYouFindUs:{options:es}},[S.C.InsuranceDetails]:{insuranceMemberID:{}},[S.C.InsuranceDetailsReview]:{insuranceMemberID:{}}},ec=E.fz.PequotHealthCare,ed=e=>{let{render:t}=e,[a,A]=(0,P.zl)(ei),L=(0,j.useMemo)(()=>(0,w.r)(a.value),[a.value]);(0,I.t)(L,ec);let R=(0,j.useCallback)(e=>{A({type:"SUBMIT",data:e})},[A]),M=(0,j.useCallback)(()=>{A({type:"BACK"})},[A]),k=(0,j.useCallback)(()=>{var e,t;switch(L){case Z.PreEligibility:return(0,i.jsx)(f.P,{configuration:{contentResources:en[S.C.PreEligibility]},onSubmit:R});case Z.ContactDetails:return(0,i.jsx)(u.x,{configuration:{contentResources:en[S.C.ContactDetails],fields:el[S.C.ContactDetails]},onSubmit:R,defaultValues:a.context.formData});case Z.EligibilityUnmet:return(0,i.jsx)(g.B,{configuration:{contentResources:en[S.C.EligibilityUnmet]},onSubmit:R,loading:a.matches({[Z.EligibilityUnmet]:Z.Submitting}),isEmailSent:a.matches({[Z.EligibilityUnmet]:Z.Success}),hasError:a.matches({[Z.EligibilityUnmet]:Z.Error})});case Z.InsuranceDetails:return(0,i.jsx)(h.d,{configuration:{contentResources:en[S.C.InsuranceDetails],fields:el[S.C.InsuranceDetails]},onSubmit:R,onBack:M});case Z.InsuranceDetailsReview:return(0,i.jsx)(b.h,{configuration:{contentResources:en[S.C.InsuranceDetailsReview],fields:el[S.C.InsuranceDetailsReview]},onSubmit:R,loading:a.matches({[Z.InsuranceDetailsReview]:Z.Submitting}),hasError:a.matches({[Z.InsuranceDetailsReview]:Z.Error}),defaultValues:a.context.formData});case Z.ApplicationComplete:return(0,i.jsx)(o.Q,{...en[S.C.ApplicationComplete],email:a.context.formData.email});case Z.ApplicationReview:return(0,i.jsx)(l.l,{...en[S.C.ApplicationReview]});case Z.ApplicationDetected:return(0,i.jsx)(s.r,{...en[S.C.ApplicationDetected],email:a.context.formData.email});case Z.EmailVerification:return(0,i.jsx)(p.e,{configuration:{contentResources:{title:en[S.C.EmailVerification](a.context.formData.email).title}},email:a.context.formData.email,hasError:a.matches({[Z.EmailVerification]:Z.Error}),loading:a.matches({[Z.EmailVerification]:Z.Submitting}),isUpdateEmailLoading:a.matches({[Z.EmailVerification]:{[Z.UpdateEmail]:Z.Idle}}),hasUpdateEmailError:a.matches({[Z.EmailVerification]:{[Z.UpdateEmail]:Z.Error}}),onSubmit:R,onResendCode:e=>A({type:"RESEND_EMAIL_VERIFICATION",data:{onSuccess:e}}),onEditEmail:(e,t)=>A({type:"UPDATE_EMAIL",data:{email:e,onSuccess:t}})});case Z.OnboardingChecklist:return(0,i.jsx)(C.E,{showLabs:!0,configuration:{contentResources:en[S.C.OnboardingChecklist]},onSubmit:R});case Z.ReviewConsents:return(0,i.jsx)(D.U,{configuration:{contentResources:en[S.C.ReviewConsents]},consents:a.context.consentsData.items,hasError:a.matches({[Z.ReviewConsents]:Z.Error}),loading:a.matches({[Z.ReviewConsents]:Z.FetchConsents})||a.matches({[Z.ReviewConsents]:Z.Submitting})||a.matches({[Z.ReviewConsents]:Z.UpdateContact}),onSubmit:R});case Z.CreatePassword:return(0,i.jsx)(m.i,{configuration:{contentResources:en[S.C.CreatePassword]},loading:a.matches({[Z.CreatePassword]:Z.Submitting}),error:a.context.error,onSubmit:R});case Z.AppDownload:return(0,i.jsx)(n.a,{title:"SUBMIT_LATER"===a.context.labs?en[S.C.AppDownload].titleLabSkipped:"LABS_UPLOADED"===a.context.labs?en[S.C.AppDownload].titleLabSubmitted:en[S.C.AppDownload].titleLabRequested,checklist:en[S.C.AppDownload].checklist});case Z.OnboardingUserError:return(0,i.jsx)(x.C,{});case Z.RequestLabs:return(0,i.jsx)(y.I,{organizationName:"Pequot Tribal Family Health Plan",patientId:null==(e=a.context.flyteUserData)?void 0:e.patientId,onProceedToSubmitLabs:()=>A({type:"PROCEED_TO_SUBMIT_LABS"}),onLabRequested:e=>A({type:"LAB_REQUESTED",data:{lab:e}}),formData:a.context.formData});case Z.SubmitLabs:return(0,i.jsx)(v.x,{onGoBackToRequestLabs:()=>A({type:"GO_BACK_TO_REQUEST_LABS"}),onSubmitLabsLater:()=>A({type:"SUBMIT_LABS_LATER"}),onLabSubmitted:()=>A({type:"LAB_SUBMITTED"}),patientId:null==(t=a.context.flyteUserData)?void 0:t.patientId,diabetes:"yes"===a.context.formData.diabetes,bariatric:"yes"===a.context.formData.bariatricSurgery});default:return null}},[L,a]);return t({header:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(r.Flex,{gap:"spacer-5",alignItems:"center",children:[(0,i.jsx)(c.E,{partner:E.fz.Flyte}),(0,i.jsx)(r.Divider,{orientation:"vertical",alignSelf:"stretch",height:"auto"}),(0,i.jsx)(c.E,{partner:ec})]}),(0,i.jsx)(d.nV,{currentStep:L})]}),body:k(),currentWorkFlowStep:L})}},46884:(e,t,a)=>{a.d(t,{j:()=>Y});var i=a(37876),r=a(37477),n=a(91366),o=a(48934),s=a(14901),l=a(16741),c=a(533),d=a(6770),u=a(63583),m=a(30435),g=a(42037),p=a(86535),h=a(93511),b=a(34305),C=a(80072),x=a(97793),f=a(66885),y=a(62227),D=a(14232),v=a(20411),I=a(39648),E=a(47353),S=a(83928),w=a(33841),P=a(86687),j=a(89225),A=a(68792),L=a(65159),R=a(45352),M=a(39777),k=a(63826);let T=e=>e===k.w.FULL_MATCH||e===k.w.ELIGIBLE_MATCH,U=e=>{switch(e){case k.w.PERSON_MATCH:case k.w.INSURANCE_MATCH:case k.w.EXPIRED:case k.w.NOT_FOUND:return b.XN.EligibleWaiting;case k.w.FULL_MATCH:case k.w.ELIGIBLE_MATCH:default:return}};var B=function(e){return e.CheckEligibility="checkEligibility",e.CreateLead="createLead",e.CheckBenefits="checkBenefits",e}(B||{});let F={...x.f,...B},O=j.Ek[w.fz.Aetna],N={formData:{birthdate:"",comorbidity:"",currentWeightInPounds:"",dateOfHighestWeightValue:"",email:"",firstName:"",heightInFoot:"",heightInInch:"",highestWeightInPounds:"",insuranceCoverage:void 0,insuranceMemberID:"",insurance:void 0,lastName:"",phone:"",state:void 0,termsAgreement:!1,howDidYouFindUS:"",comorbidities:[],diabetes:"",bariatricSurgery:""},eligibilityCheckMatchType:void 0,bmi:void 0,benefitsCheck:void 0},_=(0,L.mj)({types:{},guards:{isPreEligibilityMet:e=>{let{context:{formData:t,bmi:a}}=e;return A.J0.aetna({bmi:a,comorbidity:t.comorbidity,birthdate:t.birthdate})},isApplicationReviewRequired:e=>{let{context:{eligibilityCheckMatchType:t,formData:a}}=e;return!S.A.shouldBypassIsApplicationReviewRequired({email:a.email})&&[w.wY.EXPIRED,w.wY.INSURANCE_MATCH,w.wY.PERSON_MATCH,w.wY.NOT_FOUND].includes(t)},isApplicationDetected:P.L},actions:{updateFormData:(0,R.a)({formData:e=>{let{context:t,event:a}=e;return{...t.formData,...a.data}}}),assignBMI:(0,R.a)({bmi:e=>{let{context:t}=e,{heightInFoot:a,heightInInch:i,highestWeightInPounds:r}=t.formData;return(0,A.Hv)({heightFeet:(0,A.sC)(a),heightInches:(0,A.sC)(i),weightPounds:(0,A.sC)(r)})}}),reset:(0,R.a)({...N}),resetBenefitsCheck:(0,R.a)({benefitsCheck:void 0})}}).createMachine({context:()=>N,id:"aetnaMachine",initial:F.PreEligibility,states:{[F.PreEligibility]:{id:F.PreEligibility,initial:F.Idle,states:{[F.Idle]:{on:{SUBMIT:{target:F.Submitting,actions:"updateFormData"}}},[F.Submitting]:{entry:"assignBMI",always:[{target:"#".concat(F.ContactDetails),guard:"isPreEligibilityMet"},{target:"#".concat(F.EligibilityUnmet)}]}}},[F.ContactDetails]:{id:F.ContactDetails,initial:F.Idle,states:{[F.Idle]:{on:{SUBMIT:{target:"#".concat(F.InsuranceDetails),actions:"updateFormData"}}}}},[F.InsuranceDetails]:{id:F.InsuranceDetails,initial:F.Idle,states:{[F.Idle]:{on:{BACK:{target:"#".concat(F.ContactDetails)},SUBMIT:{target:"#".concat(F.InsuranceDetailsReview),actions:"updateFormData"}}}}},[F.InsuranceDetailsReview]:{id:F.InsuranceDetailsReview,initial:F.Idle,states:{[F.Idle]:{on:{SUBMIT:{actions:"updateFormData",target:F.Submitting}}},[F.Submitting]:{id:F.Submitting,initial:F.CheckEligibility,states:{[F.CheckEligibility]:{id:F.CheckEligibility,invoke:{src:(0,M.Sx)(async e=>{let{input:t}=e,a={...t,insurance:j.w[w.fz.Aetna],benefitProgram:j.Nl[w.fz.Aetna]};return await (0,I.w)(a)}),input:e=>{let{context:{formData:t}}=e;return t},onDone:[{actions:(0,R.a)({eligibilityCheckMatchType:e=>{let{event:t}=e;return t.output.data.matchType}}),target:"#".concat(F.CheckBenefits)}],onError:"#".concat(F.Error)}},[F.CheckBenefits]:{id:F.CheckBenefits,invoke:{src:(0,M.Sx)(async e=>{let{input:t}=e,a={...t,payerCode:j.dT[w.lk["Aetna Medicare"]]};return await (0,v.R)(a)}),input:e=>{let{context:{formData:t}}=e;return t},onDone:[{actions:(0,R.a)({benefitsCheck:e=>{let{event:t}=e;return t.output.data}}),target:"#".concat(F.CreateLead)}],onError:"#".concat(F.CreateLead)}},[F.CreateLead]:{id:F.CreateLead,invoke:{src:(0,M.Sx)(async e=>{let{input:t}=e,a={...t.formData,...t.formData.insuranceMemberID&&{employmentVerificationCode:t.formData.insuranceMemberID},...t.benefitsCheck&&{benefitsCheck:t.benefitsCheck},eligibilityVerifiedBy:w.h9.Evolve,company:O,insurance:j.Ft[w.fz.Aetna],evolveOrganization:w.PM["State of Connecticut Retirees"],leadStatus:U(t.eligibilityCheckMatchType),automateEvolveEnrollment:T(t.eligibilityCheckMatchType)};return await (0,E.t)(a)}),input:e=>{let{context:t}=e;return t},onDone:[{guard:"isApplicationReviewRequired",target:"#".concat(F.ApplicationReview)},{target:"#".concat(F.ApplicationComplete)}],onError:[{guard:"isApplicationDetected",target:"#".concat(F.ApplicationDetected)},{target:"#".concat(F.Error)}]}}}},[F.Error]:{id:F.Error,on:{SUBMIT:{actions:["updateFormData","resetBenefitsCheck"],target:F.Submitting}}}}},[F.ApplicationReview]:{id:F.ApplicationReview},[F.ApplicationComplete]:{id:F.ApplicationComplete},[F.ApplicationDetected]:{id:F.ApplicationDetected},[F.EligibilityUnmet]:{id:F.EligibilityUnmet,initial:F.Idle,states:{[F.Idle]:{on:{SUBMIT:{target:F.Submitting,actions:"updateFormData"}}},[F.Submitting]:{invoke:{src:(0,M.Sx)(async e=>{let{input:t}=e,a={...t,company:O,leadStatus:w.XN.Ineligible,ineligibilityReason:w.hT.BMI,automateEvolveEnrollment:!1};return await (0,E.t)(a)}),input:e=>{let{context:{formData:t}}=e;return t},onDone:F.Success,onError:F.Error}},[F.Success]:{},[F.Error]:{on:{SUBMIT:{target:F.Submitting}}}}}},on:{RESET:{target:"#".concat(F.PreEligibility),actions:"reset"}}});var H=a(69443);let X={[C.C.PreEligibility]:{title:(0,i.jsxs)(r.TextPairing,{variant:"textpairing-header-2XL",children:[(0,i.jsx)(r.TextPairing.Label,{color:"text-primary",children:"Let's make sure you're eligible for the Flyte program."}),(0,i.jsx)(r.TextPairing.SubLabel,{color:"text-secondary",children:"To be eligible for the Flyte program through your Aetna Medicare Advantage benefits, you must meet specific age and Body Mass Index (BMI)* requirements."})]}),bmiEnrollmentDisclaimer:(0,i.jsx)(r.Text,{variant:"text-body-meta-regular",color:"text-secondary",children:"*We acknowledge that Body Mass Index (BMI) is an imperfect way to screen for excess weight. Flyte providers do not use BMI alone as a measure of overall health. Instead, BMI is used as a data point to see if someone is eligible to join the Flyte program. Once someone joins the program, we'll ask each person more about their health to create a personalized treatment plan."})},[C.C.EligibilityUnmet]:{title:(0,i.jsxs)(r.TextPairing,{variant:"textpairing-header-2XL",children:[(0,i.jsx)(r.TextPairing.Label,{color:"text-secondary-negative",children:"Unfortunately, you are not eligible to join FlyteHealth at this time."}),(0,i.jsx)(r.TextPairing.SubLabel,{color:"text-secondary",children:"The Flyte program requires a minimum BMI of 27+ (plus one or more weight-related health conditions) or a BMI of 30+."})]})},[C.C.ContactDetails]:{title:(0,i.jsxs)(r.TextPairing,{variant:"textpairing-header-2XL",children:[(0,i.jsx)(r.TextPairing.Label,{color:"text-secondary-negative",children:"Congratulations! You're eligible for the FlyteHealth program"}),(0,i.jsx)(r.TextPairing.SubLabel,{color:"text-secondary",children:"To help us match your information with your health plan, tell us about yourself. Next, we'll ask about your Aetna membership. Be sure to have your insurance card handy."})]})},[C.C.InsuranceDetails]:{title:(0,i.jsxs)(r.Text,{variant:"text-header-2XL",color:"text-secondary-negative",children:["One more thing:"," ",(0,i.jsx)(r.Text,{as:"span",variant:"text-header-2XL",color:"text-primary",children:"What's your Aetna membership number?"})]})},[C.C.InsuranceDetailsReview]:{title:(0,i.jsxs)(r.TextPairing,{variant:"textpairing-header-2XL",children:[(0,i.jsx)(r.TextPairing.Label,{children:"Let's review: Is your info correct?"}),(0,i.jsx)(r.TextPairing.SubLabel,{color:"text-secondary",children:"Please double-check the information you provided to make sure everything is correct."})]})},[C.C.ApplicationComplete]:{title:(0,i.jsxs)(r.TextPairing,{variant:"textpairing-header-2XL",children:[(0,i.jsx)(r.TextPairing.Label,{color:"text-secondary-negative",children:"Welcome aboard! We're so excited you're here."}),(0,i.jsx)(r.TextPairing.SubLabel,{color:"text-secondary",children:"Next, we need to confirm your email. Click the link we sent to:"})]}),description:(0,i.jsx)(r.Text,{mt:"spacer-8",color:"text-secondary",variant:"text-body-regular",children:"Can’t find the email? Make sure to check your Spam folder."})},[C.C.ApplicationReview]:{title:(0,i.jsxs)(r.TextPairing,{variant:"textpairing-header-2XL",children:[(0,i.jsx)(r.TextPairing.Label,{color:"text-primary",children:"You're almost finished!"}),(0,i.jsx)(r.TextPairing.SubLabel,{color:"text-secondary",children:"We've received your application, but we need a little more information from you to move forward. Please call us to complete the application process."})]})},[C.C.ApplicationDetected]:{title:(0,i.jsx)(r.Text,{variant:"text-header-2XL",color:"text-primary",children:"We found an existing account for:"}),description:(0,i.jsx)(r.Text,{variant:"text-body-display-S",color:"text-secondary",children:"It looks like you already have an account with us. To continue or update your registration details, please contact our Care Coordinator team."})},[C.C.OnboardingChecklist]:H.M[C.C.OnboardingChecklist],[C.C.CreatePassword]:H.M[C.C.CreatePassword],[C.C.AppDownload]:H.M[C.C.AppDownload],[C.C.ReviewConsents]:H.M[C.C.ReviewConsents]};var V=a(82393);let z=[b.UX.BenefitsWebsite,b.UX.ProviderReferral,b.UX.WordOfMouth,b.UX.Other],W={[C.C.ContactDetails]:{state:{options:V.rI},howDidYouFindUs:{options:z}},[C.C.InsuranceDetails]:{insuranceMemberID:{tooltip:(0,i.jsxs)(r.Box,{children:[(0,i.jsx)(r.Text,{variant:"text-body-meta-regular",color:"text-light",children:"Where to find my Membership ID Number:"}),(0,i.jsx)(r.Image,{width:"100%",height:"auto",src:"/static/assets/programs/aetna/aetna-insurance-card.png",alt:"Member ID guidance"})]})}},[C.C.InsuranceDetailsReview]:{insuranceMemberID:{}}},q=b.fz.Aetna,Y=e=>{let{render:t}=e,[a,v]=(0,y.zl)(_),I=(0,D.useMemo)(()=>(0,f.r)(a.value),[a.value]);(0,h.t)(I,q);let E=(0,D.useCallback)(e=>{v({type:"SUBMIT",data:e})},[v]),S=(0,D.useCallback)(()=>{v({type:"BACK"})},[v]),w=(0,D.useCallback)(()=>{switch(I){case x.f.PreEligibility:return(0,i.jsx)(p.P,{configuration:{contentResources:X[C.C.PreEligibility]},onSubmit:E});case x.f.ContactDetails:return(0,i.jsx)(d.x,{configuration:{contentResources:X[C.C.ContactDetails],fields:W[C.C.ContactDetails]},onSubmit:E,defaultValues:a.context.formData});case x.f.EligibilityUnmet:return(0,i.jsx)(u.B,{configuration:{contentResources:X[C.C.EligibilityUnmet]},onSubmit:E,loading:a.matches({[x.f.EligibilityUnmet]:x.f.Submitting}),isEmailSent:a.matches({[x.f.EligibilityUnmet]:x.f.Success}),hasError:a.matches({[x.f.EligibilityUnmet]:x.f.Error})});case x.f.InsuranceDetails:return(0,i.jsx)(m.d,{configuration:{contentResources:X[C.C.InsuranceDetails],fields:W[C.C.InsuranceDetails]},onSubmit:E,onBack:S});case x.f.InsuranceDetailsReview:return(0,i.jsx)(g.h,{configuration:{contentResources:X[C.C.InsuranceDetailsReview],fields:W[C.C.InsuranceDetailsReview]},onSubmit:E,loading:a.matches({[x.f.InsuranceDetailsReview]:x.f.Submitting}),hasError:a.matches({[x.f.InsuranceDetailsReview]:x.f.Error}),defaultValues:a.context.formData});case x.f.ApplicationComplete:return(0,i.jsx)(n.Q,{...X[C.C.ApplicationComplete],email:a.context.formData.email});case x.f.ApplicationDetected:return(0,i.jsx)(o.r,{...X[C.C.ApplicationDetected],email:a.context.formData.email});case x.f.ApplicationReview:return(0,i.jsx)(s.l,{...X[C.C.ApplicationReview]});default:return null}},[I,a]);return t({header:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(r.Flex,{gap:"spacer-5",alignItems:"center",children:[(0,i.jsx)(l.E,{partner:b.fz.Flyte}),(0,i.jsx)(r.Divider,{orientation:"vertical",alignSelf:"stretch",height:"auto"}),(0,i.jsx)(l.E,{partner:q})]}),(0,i.jsx)(c.f,{currentStep:I})]}),body:w(),currentWorkFlowStep:I})}},47811:(e,t,a)=>{a.d(t,{D:()=>ef});var i=a(37876),r=a(37477),n=a(59004),o=a(91366),s=a(48934),l=a(14901),c=a(16741),d=a(80075),u=a(6770),m=a(39946),g=a(53154),p=a(42037),h=a(70587),b=a(11427),C=a(86535),x=a(27297),f=a(43483),y=a(81488),D=a(93511),v=a(34305),I=a(80072),E=a(61415),S=a(66885),w=a(62227),P=a(14232),j=a(82393),A=a(45383),L=a(76692),R=a(19847),M=a(88992);let k="participantDepartmentorOrg",T=["Hebrew Home at Riverdale","RiverSpring Services Corp","RiverSpring Licensed Home Care Services Agency","RiverSpring Health Plans (ElderServe Health, Inc.)"],U=()=>{let{register:e,watch:t}=(0,M.xW)();return(0,i.jsxs)(r.Flex,{direction:"column",gap:"spacer-2",children:[(0,i.jsx)(r.Text,{as:"label",variant:"text-body-large-bold",color:"text-primary-negative",htmlFor:k,children:"Participating organization"}),(0,i.jsx)(r.Select,{"data-test":k,id:k,size:"l",variant:"flushed",placeholder:"Select organization",...e(k,{required:!0}),value:t(k),children:T.map(e=>(0,i.jsx)("option",{value:e,children:e},e))})]})};var B=a(58892);let F="evolveProgram";var O=function(e){return e.Guided="Guided",e.SelfGuided="Self-Guided",e}({});let N=()=>{let{register:e}=(0,M.xW)();return(0,i.jsxs)(r.Flex,{direction:"column",gap:"spacer-4",children:[(0,i.jsx)(r.Text,{as:"label",variant:"text-body-large-bold",color:"text-primary-negative",children:"Program selection"}),(0,i.jsxs)(r.RadioGroup,{display:"flex",gap:"spacer-3",name:F,flexDirection:{base:"column",md:"row"},"data-test":F,children:[(0,i.jsx)(B.e,{value:"Guided",size:"m",name:F,...e(F,{required:!0}),children:"Physician-guided"}),(0,i.jsx)(B.e,{value:"Self-Guided",size:"m",...e(F),name:F,children:"Self-guided"})]})]})},_=e=>{let{configuration:t,loading:a=!1,onSubmit:n,onBack:o}=e,{contentResources:s,fields:l}=t,c=(0,M.mN)({mode:"onBlur",defaultValues:{insuranceMemberID:"",insurance:void 0,evolveProgram:void 0}}),d=(0,R.a)(),u=()=>(0,i.jsxs)(r.Flex,{gap:{base:"spacer-8",md:"spacer-16"},alignItems:"center",flex:{base:1,lg:"unset"},children:[(0,i.jsx)(r.Button,{size:{base:"m",lg:"l"},isLoading:a,variant:"link","aria-label":"Back",leadingIcon:(0,i.jsx)(r.IconArrowLeft,{}),onClick:o,children:"Back"}),(0,i.jsx)(r.Button,{type:"submit",size:{base:"m",lg:"l"},isDisabled:!c.formState.isValid,flex:1,isLoading:a,trailingIcon:(0,i.jsx)(r.IconArrowRight,{}),"aria-label":"Continue",children:"Continue"})]});return(0,i.jsx)(M.Op,{...c,children:(0,i.jsxs)(A.X,{as:"form",onSubmit:c.handleSubmit(n),noValidate:!0,children:[(0,i.jsx)(A.X.Side,{gap:0,flex:{base:"none",lg:1},children:s.title}),(0,i.jsxs)(A.X.Form,{children:[(null==l?void 0:l.evolveProgram)&&(0,i.jsx)(N,{}),(0,i.jsx)(U,{}),(null==l?void 0:l.insurance)&&(0,i.jsx)(L._8,{isDisabled:a,isRequired:!0,...null==l?void 0:l.insurance}),(0,i.jsx)(L.kV,{isDisabled:a,isRequired:!0,pb:{base:"spacer-24",lg:0},...null==l?void 0:l.insuranceMemberID}),d?(0,i.jsx)(j.cI,{children:u()}):u()]})]})})};var H=a(11969),X=a(10758),V=a(85007),z=a(20411),W=a(31346),q=a(38360),Y=a(77944),K=a(47353),G=a(83928),Q=a(33841),J=a(13751),$=a(92323),Z=a(86687),ee=a(89225),et=a(97793),ea=a(65159),ei=a(45352),er=a(39777);let en={Guided:v.PM["RiverSpring Living - Guided"],"Self-Guided":v.PM["RiverSpring Living - Self Guided"]},eo=(e,t,a)=>{if(a===v.PM["RiverSpring Living - Self Guided"])return!0;switch(e){case v.lk["1199SEIU"]:return!0;case v.lk.Aetna:return[v.yj["New York"],v.yj["New Jersey"],v.yj.Connecticut].includes(t);default:return!1}},es=(e,t,a)=>{if(!eo(e,t,a))return v.XN.EligibleWaiting};var el=function(e){return e.CreateLead="createLead",e.CreateContact="createContact",e.UpdateContact="updateContact",e.CheckBenefits="checkBenefits",e.DetermineContactOrLead="determineContactOrLead",e.FetchConsents="fetchConsents",e.UpdateEmail="updateEmail",e}(el||{});let ec={...et.f,...el},ed=ee.Ek[Q.fz.RiverSpringLiving],eu={formData:{birthdate:"",comorbidity:"",currentWeightInPounds:"",dateOfHighestWeightValue:"",email:"",firstName:"",heightInFoot:"",heightInInch:"",highestWeightInPounds:"",insuranceCoverage:void 0,insuranceMemberID:"",insurance:void 0,lastName:"",phone:"",state:void 0,termsAgreement:!1,howDidYouFindUS:"",participantDepartmentorOrg:"",evolveProgram:void 0,comorbidities:[],diabetes:"",bariatricSurgery:""},evolveOrganization:void 0,bmi:void 0,benefitsCheck:void 0,otpData:void 0,consentsData:{items:[],userConsentStatus:[]},contactData:{},passwordData:{password:void 0,confirmPassword:void 0},flyteUserData:void 0,error:void 0,labs:void 0},em={...J.AU,...J.gQ,...J.pE,...J.UH,...J.yF,...J.n6,...J.uN,...J.yS,...J.RW,...J.i_,...(0,J.rS)(eu)},eg=(0,ea.mj)({types:{},guards:{isApplicationReviewRequired:e=>{let{context:{formData:t,evolveOrganization:a}}=e;return!G.A.shouldBypassIsApplicationReviewRequired({email:t.email})&&!eo(t.insurance,t.state,a)},isApplicationDetected:Z.L,isAthenaRecordCreated:$.z},actions:{...em,assignEvolveOrganization:(0,ei.a)({evolveOrganization:e=>{let{context:t}=e;return en[t.formData.evolveProgram||O.SelfGuided]}})}}).createMachine({context:()=>eu,id:"riverspringMachine",initial:ec.PreEligibility,states:{[ec.PreEligibility]:{id:ec.PreEligibility,initial:ec.Idle,states:{[ec.Idle]:{on:{SUBMIT:{target:ec.Submitting,actions:"updateFormData"}}},[ec.Submitting]:{entry:["assignBMI"],always:"#".concat(ec.ContactDetails)}}},[ec.ContactDetails]:{id:ec.ContactDetails,initial:ec.Idle,states:{[ec.Idle]:{on:{SUBMIT:{target:"#".concat(ec.InsuranceDetails),actions:"updateFormData"}}}}},[ec.InsuranceDetails]:{id:ec.InsuranceDetails,initial:ec.Idle,states:{[ec.Idle]:{on:{BACK:{target:"#".concat(ec.ContactDetails)},SUBMIT:{target:"#".concat(ec.InsuranceDetailsReview),actions:["updateFormData","assignEvolveOrganization"]}}}}},[ec.InsuranceDetailsReview]:{id:ec.InsuranceDetailsReview,initial:ec.Idle,states:{[ec.Idle]:{on:{SUBMIT:{actions:"updateFormData",target:ec.Submitting}}},[ec.Submitting]:{initial:ec.CheckBenefits,states:{[ec.CheckBenefits]:{id:ec.CheckBenefits,invoke:{src:(0,er.Sx)(async e=>{let{input:t}=e,a={...t,payerCode:ee.dT[t.insurance]};return await (0,z.R)(a)}),input:e=>{let{context:{formData:t}}=e;return t},onDone:[{actions:(0,ei.a)({benefitsCheck:e=>{let{event:t}=e;return t.output.data}}),target:"#".concat(ec.DetermineContactOrLead)}],onError:"#".concat(ec.DetermineContactOrLead)}},[ec.DetermineContactOrLead]:{id:ec.DetermineContactOrLead,always:[{guard:"isApplicationReviewRequired",target:ec.CreateLead},{target:ec.CreateContact}]},[ec.CreateLead]:{id:ec.CreateLead,invoke:{src:(0,er.Sx)(async e=>{let{input:t}=e,a={...t.formData,evolveOrganization:t.evolveOrganization,...t.formData.insuranceMemberID&&{employmentVerificationCode:t.formData.insuranceMemberID},...t.benefitsCheck&&{benefitsCheck:t.benefitsCheck},company:ed,leadStatus:es(t.formData.insurance,t.formData.state,t.evolveOrganization),automateEvolveEnrollment:eo(t.formData.insurance,t.formData.state,t.evolveOrganization),evolveProgram:t.formData.evolveProgram||O.SelfGuided};return await (0,K.t)(a)}),input:e=>{let{context:t}=e;return t},onDone:[{guard:"isApplicationReviewRequired",target:"#".concat(ec.ApplicationReview)},{target:"#".concat(ec.ApplicationComplete)}],onError:[{guard:"isApplicationDetected",target:"#".concat(ec.ApplicationDetected)},{target:"#".concat(ec.InsuranceDetailsReview,".").concat(ec.Error)}]}},[ec.CreateContact]:{id:ec.CreateContact,invoke:{src:(0,er.Sx)(async e=>{let{input:t}=e,a={...t.formData,evolveOrganization:t.evolveOrganization,...t.formData.insuranceMemberID&&{employmentVerificationCode:t.formData.insuranceMemberID},...t.benefitsCheck&&{benefitsCheck:t.benefitsCheck},company:ed,accountId:ee.f3[Q.fz.RiverSpringLiving],evolveProgram:t.formData.evolveProgram||O.SelfGuided,eligibilityVerifiedBy:Q.h9.Pverify};return await (0,q.vY)(a)}),input:e=>{let{context:t}=e;return t},onDone:{actions:"assignContactData",target:"#".concat(ec.EmailVerification)},onError:[{guard:"isApplicationDetected",target:"#".concat(ec.ApplicationDetected)},{target:"#".concat(ec.InsuranceDetailsReview,".").concat(ec.Error)}]}}}},[ec.Error]:{id:"".concat(ec.InsuranceDetailsReview,".").concat(ec.Error),on:{SUBMIT:{actions:["updateFormData","resetBenefitsCheck"],target:ec.Submitting}}}}},[ec.EmailVerification]:{id:ec.EmailVerification,initial:ec.Idle,states:{[ec.Idle]:{id:"".concat(ec.EmailVerification,".").concat(ec.Idle),on:{SUBMIT:{actions:"assignOtpCode",target:ec.Submitting},RESEND_EMAIL_VERIFICATION:{target:ec.Idle,reenter:!0},UPDATE_EMAIL:{target:ec.UpdateEmail}},invoke:{input:e=>{var t;let{context:a,event:i}=e;return{email:a.formData.email,firstName:a.formData.firstName,onSuccess:null==i||null==(t=i.data)?void 0:t.onSuccess}},src:(0,er.Sx)(async e=>{let{input:t}=e,a={email:t.email,firstName:t.firstName};return{token:(await (0,X.v)(a)).data.token,onSuccess:t.onSuccess}}),onDone:{actions:[(0,ei.a)({otpData:e=>{let{context:t,event:a}=e;return{...t.otpData,token:a.output.token}}}),e=>{var t;let{event:a}=e;(null==a||null==(t=a.output)?void 0:t.onSuccess)&&a.output.onSuccess()}]},onError:ec.Error}},[ec.Submitting]:{invoke:{src:(0,er.Sx)(async e=>{let{input:t}=e,a={email:t.formData.email,token:t.otpData.token,otp:t.otpData.otp};return await (0,V.R)(a)}),input:e=>{let{context:t}=e;return t},onDone:"#".concat(ec.OnboardingChecklist),onError:ec.Error}},[ec.Error]:{on:{SUBMIT:{actions:"assignOtpCode",target:ec.Submitting},RESEND_EMAIL_VERIFICATION:{target:ec.Idle},UPDATE_EMAIL:{target:ec.UpdateEmail}}},[ec.UpdateEmail]:{initial:ec.Idle,states:{[ec.Idle]:{invoke:{input:e=>{let{context:t,event:a}=e;return{contactId:t.contactData.contactId,email:a.data.email,onSuccess:a.data.onSuccess}},src:(0,er.Sx)(async e=>{let{input:t}=e,a={contactId:t.contactId,email:t.email};return await (0,q.CI)(a),{email:t.email,onSuccess:t.onSuccess}}),onDone:{actions:["assignNewEmail",e=>{var t;let{event:a}=e;(null==a||null==(t=a.output)?void 0:t.onSuccess)&&a.output.onSuccess()}],target:"#".concat(ec.EmailVerification,".").concat(ec.Idle)},onError:ec.Error}},[ec.Error]:{on:{SUBMIT:{target:"#".concat(ec.EmailVerification,".").concat(ec.Idle)},RESEND_EMAIL_VERIFICATION:{target:"#".concat(ec.EmailVerification,".").concat(ec.Idle)},UPDATE_EMAIL:{target:ec.Idle}}}}}}},[ec.ReviewConsents]:{id:ec.ReviewConsents,initial:ec.FetchConsents,states:{[ec.Idle]:{on:{SUBMIT:{actions:["assignUserConsentStatus"],target:ec.Submitting}}},[ec.FetchConsents]:{invoke:{src:(0,er.Sx)(async()=>await (0,W.i)()),onDone:{actions:"assignConsents",target:ec.Idle},onError:ec.Error}},[ec.Submitting]:{invoke:{src:(0,er.Sx)(async e=>{let{input:t}=e,a={patientIdentifier:t.contactData.contactId,firstName:t.formData.firstName,lastName:t.formData.lastName,phone:t.formData.phone,email:t.formData.email,birthDate:t.formData.birthdate,state:t.formData.state,heightInInch:t.formData.heightInInch,heightInFeet:t.formData.heightInFoot,currentWeightInPounds:t.formData.currentWeightInPounds,evolveOrganization:t.evolveOrganization,consents:t.consentsData.userConsentStatus};return await (0,Y.Y)(a)}),input:e=>{let{context:t}=e;return t},onDone:[{actions:"assignFlyteUserData",target:ec.UpdateContact}],onError:"#".concat(ec.OnboardingUserError)}},[ec.UpdateContact]:{invoke:{src:(0,er.Sx)(async e=>{let{input:t}=e,a={contactId:t.contactData.contactId,evolvePatientID:t.flyteUserData.patientId};return await (0,q.CI)(a)}),input:e=>{let{context:t}=e;return t},onDone:[{guard:"isAthenaRecordCreated",target:"#".concat(ec.CreatePassword)},{target:"#".concat(ec.OnboardingUserError)}],onError:"#".concat(ec.OnboardingUserError)}},[ec.Error]:{on:{SUBMIT:{actions:["assignUserConsentStatus"],target:ec.Submitting}}}}},[ec.CreatePassword]:{id:ec.CreatePassword,initial:ec.Idle,states:{[ec.Idle]:{on:{SUBMIT:{actions:"assignPasswordData",target:ec.Submitting}}},[ec.Submitting]:{invoke:{src:(0,er.Sx)(async e=>{let{input:t}=e,a={email:t.formData.email,password:t.passwordData.password,confirmPassword:t.passwordData.confirmPassword};return await (0,H.I)(t.flyteUserData.verifyToken,a)}),input:e=>{let{context:t}=e;return t},onDone:"#".concat(ec.RequestLabs),onError:{target:ec.Error,actions:"assignError"}}},[ec.Error]:{on:{SUBMIT:{actions:["resetError","assignPasswordData"],target:ec.Submitting}}}}},[ec.RequestLabs]:{id:ec.RequestLabs,on:{PROCEED_TO_SUBMIT_LABS:"#".concat(ec.SubmitLabs),LAB_REQUESTED:{target:"#".concat(ec.AppDownload),actions:"assignLabLocation"},SUBMIT_LABS_LATER:{actions:"assignLabsSkipped",target:"#".concat(ec.AppDownload)}}},[ec.SubmitLabs]:{id:ec.SubmitLabs,on:{GO_BACK_TO_REQUEST_LABS:"#".concat(ec.RequestLabs),LAB_SUBMITTED:{actions:"registerLabsUploaded",target:"#".concat(ec.AppDownload)},SUBMIT_LABS_LATER:{actions:"assignLabsSkipped",target:"#".concat(ec.AppDownload)}}},[ec.OnboardingChecklist]:{id:ec.OnboardingChecklist,on:{SUBMIT:{target:"#".concat(ec.ReviewConsents)}}},[ec.AppDownload]:{id:ec.AppDownload},[ec.ApplicationReview]:{id:ec.ApplicationReview},[ec.OnboardingUserError]:{id:ec.OnboardingUserError},[ec.ApplicationComplete]:{id:ec.ApplicationComplete},[ec.ApplicationDetected]:{id:ec.ApplicationDetected}},on:{RESET:{target:"#".concat(ec.PreEligibility),actions:"reset"}}});var ep=a(69443);let eh={[I.C.PreEligibility]:{title:(0,i.jsxs)(r.TextPairing,{variant:"textpairing-header-2XL",children:[(0,i.jsx)(r.TextPairing.Label,{color:"text-primary",children:"Let's make sure you're eligible for the FlyteHealth program."}),(0,i.jsxs)(r.TextPairing.SubLabel,{color:"text-secondary",children:["All employees are eligible to access the"," ",(0,i.jsx)("b",{children:"Self-Guided"})," ","program through the RiverSpring Living benefits.",(0,i.jsx)("br",{}),"To be eligible for the"," ",(0,i.jsx)("b",{children:"Physician-Guided"})," ","program, you must meet specific age and Body Mass Index (BMI)* requirements."]})]}),bmiEnrollmentDisclaimer:(0,i.jsx)(r.Text,{variant:"text-body-meta-regular",color:"text-secondary",children:"*We acknowledge that Body Mass Index (BMI) is an imperfect way to screen for excess weight. FlyteHealth providers do not use BMI alone as a measure of overall health. Instead, BMI is used as a data point to see if someone is eligible to join the FlyteHealth program. Once someone joins the program, we'll ask each person more about their health to create a personalized treatment plan."})},[I.C.ContactDetails]:(e,t)=>({title:(0,i.jsxs)(r.TextPairing,{variant:"textpairing-header-2XL",children:[(0,i.jsxs)(r.TextPairing.Label,{color:"text-primary",children:[(0,i.jsxs)(r.Text,{display:{base:"inline",lg:"block"},as:"label",variant:"text-header-2XL",color:"text-secondary-negative",children:["Congratulations!"," "]}),"You're eligible for the"," ",E.J.riverSpringLiving({bmi:e,comorbidity:t})?"Physician":"Self","-Guided FlyteHealth program"]}),(0,i.jsx)(r.TextPairing.SubLabel,{color:"text-secondary",children:"To help us match your information with your employer, please tell us a bit more about yourself."})]})}),[I.C.InsuranceDetails]:{title:(0,i.jsxs)(r.TextPairing,{variant:"textpairing-header-2XL",children:[(0,i.jsxs)(r.TextPairing.Label,{color:"text-secondary-negative",children:["Almost done:"," ",(0,i.jsx)(r.Text,{as:"span",variant:"text-header-2XL",color:"text-primary",children:"Select your program and let us know if you have health insurance"})]}),(0,i.jsxs)(r.TextPairing.SubLabel,{color:"text-secondary",children:["Before selecting your program, review summaries below."," ",(0,i.jsx)("br",{}),(0,i.jsx)("br",{}),(0,i.jsx)("b",{children:"Physician-Guided:"})," ","Access to the entire FlyteHealth care team and our patient app.",(0,i.jsx)("br",{}),(0,i.jsx)("br",{}),(0,i.jsx)("b",{children:"Self-Guided:"})," ","Access to the FlyteHealth patient app only."]})]})},[I.C.InsuranceDetailsReview]:{title:(0,i.jsxs)(r.TextPairing,{variant:"textpairing-header-2XL",children:[(0,i.jsx)(r.TextPairing.Label,{children:"Let's review: Is your info correct?"}),(0,i.jsx)(r.TextPairing.SubLabel,{color:"text-secondary",children:"Please double-check the information you provided to make sure everything is correct."})]})},[I.C.ApplicationComplete]:{title:(0,i.jsxs)(r.TextPairing,{variant:"textpairing-header-2XL",children:[(0,i.jsx)(r.TextPairing.Label,{color:"text-secondary-negative",children:"Welcome aboard! We're so excited you're here."}),(0,i.jsx)(r.TextPairing.SubLabel,{color:"text-secondary",children:"Next, we need to confirm your email. Click the link we sent to:"})]}),description:(0,i.jsxs)(r.Text,{color:"text-secondary",mt:"spacer-8",variant:"text-body-meta-regular",children:["Please note that for Physician-Guided users, clinical encounters and prescription costs are covered by RiverSpring Living insurance (either Aetna or 1199SEIU), and out-of-pocket costs will vary based on your plan coverage, deductibles, co-pays, and limits. For more information, please contact the RiverSpring Living Benefits Department or your insurance company.",(0,i.jsx)("br",{}),(0,i.jsx)("br",{}),"If you don't have RiverSpring Living insurance, FlyteHealth also accepts a number of other plans. Please check with a FlyteHealth Patient Coordinator about whether your insurance is accepted.",(0,i.jsx)("br",{}),(0,i.jsx)("br",{}),"For Self-Guided users, there is no cost for RiverSpring Living employees."]})},[I.C.ApplicationReview]:{title:(0,i.jsxs)(r.TextPairing,{variant:"textpairing-header-2XL",children:[(0,i.jsx)(r.TextPairing.Label,{color:"text-primary",children:"You're almost finished!"}),(0,i.jsx)(r.TextPairing.SubLabel,{color:"text-secondary",children:"We've received your application, but we need a little more information from you to move forward. Please call us to complete the application process."})]}),note:(0,i.jsxs)(r.Text,{color:"text-secondary",variant:"text-body-meta-regular",children:["Please note that for Guided users, clinical encounters and prescription costs are covered by RiverSpring Living insurance (either Aetna or 1199SEIU), and out-of-pocket costs will vary based on your plan coverage, deductibles, co-pays, and limits. For more information, please contact the RiverSpring Living Benefits Department or your insurance company."," ",(0,i.jsx)("br",{}),(0,i.jsx)("br",{}),"If you don't have RiverSpring Living insurance, FlyteHealth also accepts a number of other plans. Please check with a FlyteHealth Patient Coordinator about whether your insurance is accepted."]})},[I.C.ApplicationDetected]:{title:(0,i.jsx)(r.Text,{variant:"text-header-2XL",color:"text-primary",children:"We found an existing account for:"}),description:(0,i.jsx)(r.Text,{variant:"text-body-display-S",color:"text-secondary",children:"It looks like you already have an account with us. To continue or update your registration details, please contact our Care Coordinator team."})},[I.C.EmailVerification]:ep.M[I.C.EmailVerification],[I.C.OnboardingChecklist]:ep.M[I.C.OnboardingChecklist],[I.C.CreatePassword]:ep.M[I.C.CreatePassword],[I.C.AppDownload]:ep.M[I.C.AppDownload],[I.C.ReviewConsents]:ep.M[I.C.ReviewConsents]},eb=[v.UX.BenefitsWebsite,v.UX.CoworkerReferral,v.UX.OnsiteMonitor,v.UX.Poster,v.UX.ProviderReferral,v.UX.WordOfMouth,v.UX.Other],eC={[I.C.ContactDetails]:{state:{options:j.rI},howDidYouFindUs:{options:eb}},[I.C.InsuranceDetails]:e=>({insurance:{insuranceCarriers:[v.lk.Aetna,v.lk["1199SEIU"]]},insuranceMemberID:{},evolveProgram:e?{}:void 0}),[I.C.InsuranceDetailsReview]:{insurance:{insuranceCarriers:[v.lk.Aetna,v.lk["1199SEIU"]]}}},ex=v.fz.RiverSpringLiving,ef=e=>{let{render:t}=e,[a,j]=(0,w.zl)(eg),A=(0,P.useMemo)(()=>(0,S.r)(a.value),[a.value]);(0,D.t)(A,ex);let L=(0,P.useCallback)(e=>{j({type:"SUBMIT",data:e})},[j]),R=(0,P.useCallback)(()=>{j({type:"BACK"})},[j]),M=(0,P.useCallback)(()=>{var e,t;switch(A){case ec.PreEligibility:return(0,i.jsx)(C.P,{configuration:{contentResources:eh[I.C.PreEligibility]},onSubmit:L});case ec.ContactDetails:return(0,i.jsx)(u.x,{configuration:{contentResources:eh[I.C.ContactDetails](a.context.bmi,a.context.formData.comorbidity),fields:eC[I.C.ContactDetails]},onSubmit:L,defaultValues:a.context.formData});case ec.InsuranceDetails:return(0,i.jsx)(_,{configuration:{contentResources:eh[I.C.InsuranceDetails],fields:eC[I.C.InsuranceDetails](E.J.riverSpringLiving({bmi:a.context.bmi}))},onSubmit:L,onBack:R});case ec.InsuranceDetailsReview:return(0,i.jsx)(p.h,{configuration:{contentResources:eh[I.C.InsuranceDetailsReview],fields:eC[I.C.InsuranceDetailsReview]},onSubmit:L,loading:a.matches({[ec.InsuranceDetailsReview]:ec.Submitting}),hasError:a.matches({[ec.InsuranceDetailsReview]:ec.Error}),defaultValues:a.context.formData});case ec.ApplicationComplete:return(0,i.jsx)(o.Q,{...eh[I.C.ApplicationComplete],email:a.context.formData.email});case ec.ApplicationReview:return(0,i.jsx)(l.l,{...eh[I.C.ApplicationReview]});case ec.ApplicationDetected:return(0,i.jsx)(s.r,{...eh[I.C.ApplicationDetected],email:a.context.formData.email});case ec.EmailVerification:return(0,i.jsx)(g.e,{configuration:{contentResources:{title:eh[I.C.EmailVerification](a.context.formData.email).title}},email:a.context.formData.email,hasError:a.matches({[ec.EmailVerification]:ec.Error}),loading:a.matches({[ec.EmailVerification]:ec.Submitting}),isUpdateEmailLoading:a.matches({[ec.EmailVerification]:{[ec.UpdateEmail]:ec.Idle}}),hasUpdateEmailError:a.matches({[ec.EmailVerification]:{[ec.UpdateEmail]:ec.Error}}),onSubmit:L,onResendCode:e=>j({type:"RESEND_EMAIL_VERIFICATION",data:{onSuccess:e}}),onEditEmail:(e,t)=>j({type:"UPDATE_EMAIL",data:{email:e,onSuccess:t}})});case ec.OnboardingChecklist:return(0,i.jsx)(h.E,{showLabs:!0,configuration:{contentResources:eh[I.C.OnboardingChecklist]},onSubmit:L});case ec.ReviewConsents:return(0,i.jsx)(f.U,{configuration:{contentResources:eh[I.C.ReviewConsents]},consents:a.context.consentsData.items,hasError:a.matches({[ec.ReviewConsents]:ec.Error}),loading:a.matches({[ec.ReviewConsents]:ec.FetchConsents})||a.matches({[ec.ReviewConsents]:ec.Submitting})||a.matches({[ec.ReviewConsents]:ec.UpdateContact}),onSubmit:L});case ec.CreatePassword:return(0,i.jsx)(m.i,{configuration:{contentResources:eh[I.C.CreatePassword]},loading:a.matches({[ec.CreatePassword]:ec.Submitting}),error:a.context.error,onSubmit:L});case ec.AppDownload:return(0,i.jsx)(n.a,{title:"SUBMIT_LATER"===a.context.labs?eh[I.C.AppDownload].titleLabSkipped:"LABS_UPLOADED"===a.context.labs?eh[I.C.AppDownload].titleLabSubmitted:eh[I.C.AppDownload].titleLabRequested,checklist:eh[I.C.AppDownload].checklist});case ec.OnboardingUserError:return(0,i.jsx)(b.C,{});case ec.RequestLabs:return(0,i.jsx)(x.I,{organizationName:a.context.evolveOrganization,patientId:null==(e=a.context.flyteUserData)?void 0:e.patientId,onProceedToSubmitLabs:()=>j({type:"PROCEED_TO_SUBMIT_LABS"}),onLabRequested:e=>j({type:"LAB_REQUESTED",data:{lab:e}}),formData:a.context.formData});case ec.SubmitLabs:return(0,i.jsx)(y.x,{onGoBackToRequestLabs:()=>j({type:"GO_BACK_TO_REQUEST_LABS"}),onSubmitLabsLater:()=>j({type:"SUBMIT_LABS_LATER"}),onLabSubmitted:()=>j({type:"LAB_SUBMITTED"}),patientId:null==(t=a.context.flyteUserData)?void 0:t.patientId,diabetes:"yes"===a.context.formData.diabetes,bariatric:"yes"===a.context.formData.bariatricSurgery});default:return null}},[A,a]);return t({header:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(r.Flex,{gap:"spacer-5",alignItems:"center",children:[(0,i.jsx)(c.E,{partner:v.fz.Flyte}),(0,i.jsx)(r.Divider,{orientation:"vertical",alignSelf:"stretch",height:"auto"}),(0,i.jsx)(c.E,{partner:ex})]}),(0,i.jsx)(d.nV,{currentStep:A})]}),body:M(),currentWorkFlowStep:A})}},53100:(e,t,a)=>{a.d(t,{z:()=>ec});var i=a(37876),r=a(37477),n=a(59004),o=a(91366),s=a(48934),l=a(14901),c=a(16741),d=a(80075),u=a(6770),m=a(39946),g=a(63583),p=a(53154),h=a(30435),b=a(42037),C=a(70587),x=a(11427),f=a(86535),y=a(27297),D=a(43483),v=a(81488),I=a(93511),E=a(34305),S=a(80072),w=a(66885),P=a(62227),j=a(14232),A=a(11969),L=a(10758),R=a(85007),M=a(20411),k=a(31346),T=a(38360),U=a(77944),B=a(47353),F=a(83928),O=a(33841),N=a(13751),_=a(92323),H=a(86687),X=a(89225),V=a(97793),z=a(68792),W=a(65159),q=a(39777),Y=a(45352);let K=e=>{let{groupNumber:t,status:a}=e;return["10556700","10556701","10556702","10556703","10556704","10556705","10556706","10556707","10556708","10556709","10556710","10556711","10556712","10556713","10556714","10556715","10556716","10556717","10556718","10556719","10556720","10556721","10556722","10556723","10556724","10556725","10556726","10556727","10556728"].includes(t)&&"Active"===a},G=e=>{let{groupNumber:t,status:a}=e;if(!K({groupNumber:t,status:a}))return E.XN.EligibleWaiting};var Q=function(e){return e.CreateLead="createLead",e.CreateContact="createContact",e.UpdateContact="updateContact",e.CheckBenefits="checkBenefits",e.DetermineBenefitsOrLead="determineBenefitsOrLead",e.DetermineContactOrLead="determineContactOrLead",e.FetchConsents="fetchConsents",e.UpdateEmail="updateEmail",e}(Q||{});let J={...V.f,...Q},$=X.Ek[O.fz.ChristianaCare],Z={formData:{birthdate:"",comorbidity:"",currentWeightInPounds:"",dateOfHighestWeightValue:"",email:"",firstName:"",heightInFoot:"",heightInInch:"",highestWeightInPounds:"",insuranceCoverage:void 0,insuranceMemberID:"",insurance:void 0,lastName:"",phone:"",state:void 0,termsAgreement:!1,howDidYouFindUS:"",comorbidities:[],diabetes:"",bariatricSurgery:""},bmi:void 0,benefitsCheck:void 0,otpData:void 0,consentsData:{items:[],userConsentStatus:[]},contactData:{},passwordData:{password:void 0,confirmPassword:void 0},flyteUserData:void 0,error:void 0,labs:void 0},ee={...N.AU,...N.gQ,...N.pE,...N.UH,...N.yF,...N.n6,...N.uN,...N.yS,...N.RW,...N.i_,...(0,N.rS)(Z)},et=(0,W.mj)({types:{},guards:{isPreEligibilityMet:e=>{let{context:{formData:t,bmi:a}}=e;return z.J0.christianaCare({bmi:a,comorbidity:t.comorbidity,birthdate:t.birthdate})},isApplicationReviewRequired:e=>{var t,a;let{context:{benefitsCheck:i,formData:r}}=e;return!F.A.shouldBypassIsApplicationReviewRequired({email:r.email})&&!K({groupNumber:null==i||null==(t=i.coverage)?void 0:t.groupNumber,status:null==i||null==(a=i.coverage)?void 0:a.status})},isApplicationDetected:H.L,isAthenaRecordCreated:_.z},actions:ee}).createMachine({context:()=>Z,id:"christianaCareMachine",initial:J.PreEligibility,states:{[J.PreEligibility]:{id:J.PreEligibility,initial:J.Idle,states:{[J.Idle]:{on:{SUBMIT:{target:J.Submitting,actions:"updateFormData"}}},[J.Submitting]:{entry:"assignBMI",always:[{target:"#".concat(J.ContactDetails),guard:"isPreEligibilityMet"},{target:"#".concat(J.EligibilityUnmet)}]}}},[J.ContactDetails]:{id:J.ContactDetails,initial:J.Idle,states:{[J.Idle]:{on:{SUBMIT:{target:"#".concat(J.InsuranceDetails),actions:"updateFormData"}}}}},[J.InsuranceDetails]:{id:J.InsuranceDetails,initial:J.Idle,states:{[J.Idle]:{on:{BACK:{target:"#".concat(J.ContactDetails)},SUBMIT:{target:"#".concat(J.InsuranceDetailsReview),actions:"updateFormData"}}}}},[J.InsuranceDetailsReview]:{id:J.InsuranceDetailsReview,initial:J.Idle,states:{[J.Idle]:{on:{SUBMIT:{actions:"updateFormData",target:J.Submitting}}},[J.Submitting]:{id:J.Submitting,initial:J.CheckBenefits,states:{[J.CheckBenefits]:{id:J.CheckBenefits,invoke:{src:(0,q.Sx)(async e=>{let{input:t}=e,a={...t,payerCode:X.dT[O.lk.Highmark]};return await (0,M.R)(a)}),input:e=>{let{context:{formData:t}}=e;return t},onDone:[{actions:(0,Y.a)({benefitsCheck:e=>{let{event:t}=e;return t.output.data}}),target:"#".concat(J.DetermineContactOrLead)}],onError:"#".concat(J.DetermineContactOrLead)}},[J.DetermineContactOrLead]:{id:J.DetermineContactOrLead,always:[{guard:"isApplicationReviewRequired",target:J.CreateLead},{target:J.CreateContact}]},[J.CreateContact]:{id:J.CreateContact,invoke:{src:(0,q.Sx)(async e=>{let{input:t}=e,a={...t.formData,...t.benefitsCheck&&{benefitsCheck:t.benefitsCheck},company:$,insurance:X.Ft[O.fz.ChristianaCare],evolveOrganization:O.PM["ChristianaCare - Caregivers"],accountId:X.f3[O.fz.ChristianaCare],eligibilityVerifiedBy:O.h9.Pverify};return await (0,T.vY)(a)}),input:e=>{let{context:t}=e;return t},onDone:{actions:"assignContactData",target:"#".concat(J.EmailVerification)},onError:[{guard:"isApplicationDetected",target:"#".concat(J.ApplicationDetected)},{target:"#".concat(J.InsuranceDetailsReview,".").concat(J.Error)}]}},[J.CreateLead]:{id:J.CreateLead,invoke:{src:(0,q.Sx)(async e=>{var t,a,i,r,n,o,s,l,c,d,u,m;let{input:g}=e,p={...g.formData,...g.formData.insuranceMemberID&&{employmentVerificationCode:g.formData.insuranceMemberID},...g.benefitsCheck&&{benefitsCheck:g.benefitsCheck},...K({groupNumber:null==(a=g.benefitsCheck)||null==(t=a.coverage)?void 0:t.groupNumber,status:null==(r=g.benefitsCheck)||null==(i=r.coverage)?void 0:i.status})&&{eligibilityVerifiedBy:O.h9.Pverify},insurance:X.Ft[O.fz.ChristianaCare],evolveOrganization:O.PM["ChristianaCare - Caregivers"],company:$,leadStatus:G({groupNumber:null==(o=g.benefitsCheck)||null==(n=o.coverage)?void 0:n.groupNumber,status:null==(l=g.benefitsCheck)||null==(s=l.coverage)?void 0:s.status}),automateEvolveEnrollment:K({groupNumber:null==(d=g.benefitsCheck)||null==(c=d.coverage)?void 0:c.groupNumber,status:null==(m=g.benefitsCheck)||null==(u=m.coverage)?void 0:u.status})};return await (0,B.t)(p)}),input:e=>{let{context:t}=e;return t},onDone:[{guard:"isApplicationReviewRequired",target:"#".concat(J.ApplicationReview)},{target:"#".concat(J.ApplicationComplete)}],onError:[{guard:"isApplicationDetected",target:"#".concat(J.ApplicationDetected)},{target:"#".concat(J.InsuranceDetailsReview,".").concat(J.Error)}]}}}},[J.Error]:{id:"".concat(J.InsuranceDetailsReview,".").concat(J.Error),on:{SUBMIT:{actions:["updateFormData","resetBenefitsCheck"],target:J.Submitting}}}}},[J.EmailVerification]:{id:J.EmailVerification,initial:J.Idle,states:{[J.Idle]:{id:"".concat(J.EmailVerification,".").concat(J.Idle),on:{SUBMIT:{actions:"assignOtpCode",target:J.Submitting},RESEND_EMAIL_VERIFICATION:{target:J.Idle,reenter:!0},UPDATE_EMAIL:{target:J.UpdateEmail}},invoke:{input:e=>{var t;let{context:a,event:i}=e;return{email:a.formData.email,firstName:a.formData.firstName,onSuccess:null==i||null==(t=i.data)?void 0:t.onSuccess}},src:(0,q.Sx)(async e=>{let{input:t}=e,a={email:t.email,firstName:t.firstName};return{token:(await (0,L.v)(a)).data.token,onSuccess:t.onSuccess}}),onDone:{actions:[(0,Y.a)({otpData:e=>{let{context:t,event:a}=e;return{...t.otpData,token:a.output.token}}}),e=>{var t;let{event:a}=e;(null==a||null==(t=a.output)?void 0:t.onSuccess)&&a.output.onSuccess()}]},onError:J.Error}},[J.Submitting]:{invoke:{src:(0,q.Sx)(async e=>{let{input:t}=e,a={email:t.formData.email,token:t.otpData.token,otp:t.otpData.otp};return await (0,R.R)(a)}),input:e=>{let{context:t}=e;return t},onDone:"#".concat(J.OnboardingChecklist),onError:J.Error}},[J.Error]:{on:{SUBMIT:{actions:"assignOtpCode",target:J.Submitting},RESEND_EMAIL_VERIFICATION:{target:J.Idle},UPDATE_EMAIL:{target:J.UpdateEmail}}},[J.UpdateEmail]:{initial:J.Idle,states:{[J.Idle]:{invoke:{input:e=>{let{context:t,event:a}=e;return{contactId:t.contactData.contactId,email:a.data.email,onSuccess:a.data.onSuccess}},src:(0,q.Sx)(async e=>{let{input:t}=e,a={contactId:t.contactId,email:t.email};return await (0,T.CI)(a),{email:t.email,onSuccess:t.onSuccess}}),onDone:{actions:["assignNewEmail",e=>{var t;let{event:a}=e;(null==a||null==(t=a.output)?void 0:t.onSuccess)&&a.output.onSuccess()}],target:"#".concat(J.EmailVerification,".").concat(J.Idle)},onError:J.Error}},[J.Error]:{on:{SUBMIT:{target:"#".concat(J.EmailVerification,".").concat(J.Idle)},RESEND_EMAIL_VERIFICATION:{target:"#".concat(J.EmailVerification,".").concat(J.Idle)},UPDATE_EMAIL:{target:J.Idle}}}}}}},[J.ReviewConsents]:{id:J.ReviewConsents,initial:J.FetchConsents,states:{[J.Idle]:{on:{SUBMIT:{actions:["assignUserConsentStatus"],target:J.Submitting}}},[J.FetchConsents]:{invoke:{src:(0,q.Sx)(async()=>await (0,k.i)()),onDone:{actions:"assignConsents",target:J.Idle},onError:J.Error}},[J.Submitting]:{invoke:{src:(0,q.Sx)(async e=>{let{input:t}=e,a={patientIdentifier:t.contactData.contactId,firstName:t.formData.firstName,lastName:t.formData.lastName,phone:t.formData.phone,email:t.formData.email,birthDate:t.formData.birthdate,state:t.formData.state,heightInInch:t.formData.heightInInch,heightInFeet:t.formData.heightInFoot,currentWeightInPounds:t.formData.currentWeightInPounds,evolveOrganization:O.PM["ChristianaCare - Caregivers"],consents:t.consentsData.userConsentStatus};return await (0,U.Y)(a)}),input:e=>{let{context:t}=e;return t},onDone:[{actions:"assignFlyteUserData",target:J.UpdateContact}],onError:"#".concat(J.OnboardingUserError)}},[J.UpdateContact]:{invoke:{src:(0,q.Sx)(async e=>{let{input:t}=e,a={contactId:t.contactData.contactId,evolvePatientID:t.flyteUserData.patientId};return await (0,T.CI)(a)}),input:e=>{let{context:t}=e;return t},onDone:[{guard:"isAthenaRecordCreated",target:"#".concat(J.CreatePassword)},{target:"#".concat(J.OnboardingUserError)}],onError:"#".concat(J.OnboardingUserError)}},[J.Error]:{on:{SUBMIT:{actions:["assignUserConsentStatus"],target:J.Submitting}}}}},[J.CreatePassword]:{id:J.CreatePassword,initial:J.Idle,states:{[J.Idle]:{on:{SUBMIT:{actions:"assignPasswordData",target:J.Submitting}}},[J.Submitting]:{invoke:{src:(0,q.Sx)(async e=>{let{input:t}=e,a={email:t.formData.email,password:t.passwordData.password,confirmPassword:t.passwordData.confirmPassword};return await (0,A.I)(t.flyteUserData.verifyToken,a)}),input:e=>{let{context:t}=e;return t},onDone:"#".concat(J.RequestLabs),onError:{target:J.Error,actions:"assignError"}}},[J.Error]:{on:{SUBMIT:{actions:["resetError","assignPasswordData"],target:J.Submitting}}}}},[J.OnboardingChecklist]:{id:J.OnboardingChecklist,on:{SUBMIT:{target:"#".concat(J.ReviewConsents)}}},[J.RequestLabs]:{id:J.RequestLabs,on:{PROCEED_TO_SUBMIT_LABS:"#".concat(J.SubmitLabs),LAB_REQUESTED:{target:"#".concat(J.AppDownload),actions:"assignLabLocation"},SUBMIT_LABS_LATER:{actions:"assignLabsSkipped",target:"#".concat(J.AppDownload)}}},[J.SubmitLabs]:{id:J.SubmitLabs,on:{GO_BACK_TO_REQUEST_LABS:"#".concat(J.RequestLabs),LAB_SUBMITTED:{actions:"registerLabsUploaded",target:"#".concat(J.AppDownload)},SUBMIT_LABS_LATER:{actions:"assignLabsSkipped",target:"#".concat(J.AppDownload)}}},[J.AppDownload]:{id:J.AppDownload},[J.ApplicationReview]:{id:J.ApplicationReview},[J.OnboardingUserError]:{id:J.OnboardingUserError},[J.ApplicationComplete]:{id:J.ApplicationComplete},[J.ApplicationDetected]:{id:J.ApplicationDetected},[J.EligibilityUnmet]:{id:J.EligibilityUnmet,initial:J.Idle,states:{[J.Idle]:{on:{SUBMIT:{target:J.Submitting,actions:"updateFormData"}}},[J.Submitting]:{invoke:{src:(0,q.Sx)(async e=>{let{input:t}=e,a={...t,company:$,leadStatus:O.XN.Ineligible,ineligibilityReason:O.hT.BMI,automateEvolveEnrollment:!1};return await (0,B.t)(a)}),input:e=>{let{context:{formData:t}}=e;return t},onDone:J.Success,onError:J.Error}},[J.Success]:{},[J.Error]:{on:{SUBMIT:{actions:"updateFormData",target:J.Submitting}}}}}},on:{RESET:{target:"#".concat(J.PreEligibility),actions:"reset"}}});var ea=a(69443);let ei={[S.C.PreEligibility]:{title:(0,i.jsxs)(r.TextPairing,{variant:"textpairing-header-2XL",children:[(0,i.jsx)(r.TextPairing.Label,{color:"text-primary",children:"Let's make sure you're eligible for the FlyteHealth program."}),(0,i.jsx)(r.TextPairing.SubLabel,{color:"text-secondary",children:"To be eligible for the FlyteHealth program through ChristianaCare, you must meet specific age and Body Mass Index (BMI)* requirements."})]}),bmiEnrollmentDisclaimer:(0,i.jsx)(r.Text,{variant:"text-body-meta-regular",color:"text-secondary",children:"*We acknowledge that Body Mass Index (BMI) is an imperfect way to screen for excess weight. FlyteHealth providers do not use BMI alone as a measure of overall health. Instead, BMI is used as a data point to see if someone is eligible to join the FlyteHealth program. Once someone joins the program, we'll ask each person more about their health to create a personalized treatment plan."})},[S.C.EligibilityUnmet]:{title:(0,i.jsxs)(r.TextPairing,{variant:"textpairing-header-2XL",children:[(0,i.jsx)(r.TextPairing.Label,{color:"text-secondary-negative",children:"Unfortunately, you are not eligible to join FlyteHealth at this time."}),(0,i.jsx)(r.TextPairing.SubLabel,{color:"text-secondary",children:"The FlyteHealth program requires a minimum BMI of 27+ (plus one or more weight-related health conditions) or a BMI of 30+."})]})},[S.C.ContactDetails]:{title:(0,i.jsxs)(r.TextPairing,{variant:"textpairing-header-2XL",children:[(0,i.jsx)(r.TextPairing.Label,{color:"text-secondary-negative",children:"Congratulations! You're eligible for the FlyteHealth program"}),(0,i.jsxs)(r.TextPairing.SubLabel,{color:"text-secondary",children:["To help match your information with the ChristianaCare Caregivers with Highmark insurance plan, tell us about yourself.",(0,i.jsx)("br",{}),(0,i.jsx)("br",{}),"Next, we'll ask about your Highmark membership. Be sure to have your insurance card handy."]})]})},[S.C.InsuranceDetails]:{title:(0,i.jsx)(r.TextPairing,{variant:"textpairing-header-2XL",children:(0,i.jsxs)(r.TextPairing.Label,{color:"text-primary",children:[(0,i.jsxs)(r.Text,{display:{base:"inline",lg:"block"},as:"label",variant:"text-header-2XL",color:"text-secondary-negative",children:["One more thing:"," "]}),"What's your Highmark membership number?"]})})},[S.C.InsuranceDetailsReview]:{title:(0,i.jsxs)(r.TextPairing,{variant:"textpairing-header-2XL",children:[(0,i.jsx)(r.TextPairing.Label,{children:"Let's review: Is your info correct?"}),(0,i.jsx)(r.TextPairing.SubLabel,{color:"text-secondary",children:"Please double-check the information you provided to make sure everything is correct."})]})},[S.C.ApplicationComplete]:{title:(0,i.jsxs)(r.TextPairing,{variant:"textpairing-header-2XL",children:[(0,i.jsx)(r.TextPairing.Label,{color:"text-secondary-negative",children:"Welcome aboard! We're so excited you're here."}),(0,i.jsx)(r.TextPairing.SubLabel,{color:"text-secondary",children:"Next, we need to confirm your email. Click the link we sent to:"})]}),description:(0,i.jsx)(r.Text,{mt:"spacer-8",color:"text-secondary",variant:"text-body-regular",children:"Can’t find the email? Make sure to check your Spam folder."})},[S.C.ApplicationReview]:{title:(0,i.jsxs)(r.TextPairing,{variant:"textpairing-header-2XL",children:[(0,i.jsx)(r.TextPairing.Label,{color:"text-primary",children:"You're almost finished!"}),(0,i.jsx)(r.TextPairing.SubLabel,{color:"text-secondary",children:"We've received your application, but we need a little more information from you to move forward. Please call us to complete the application process."})]})},[S.C.ApplicationDetected]:{title:(0,i.jsx)(r.Text,{variant:"text-header-2XL",color:"text-primary",children:"We found an existing account for:"}),description:(0,i.jsx)(r.Text,{variant:"text-body-display-S",color:"text-secondary",children:"It looks like you already have an account with us. To continue or update your registration details, please contact our Care Coordinator team."})},[S.C.EmailVerification]:ea.M[S.C.EmailVerification],[S.C.OnboardingChecklist]:ea.M[S.C.OnboardingChecklist],[S.C.CreatePassword]:ea.M[S.C.CreatePassword],[S.C.AppDownload]:ea.M[S.C.AppDownload],[S.C.ReviewConsents]:ea.M[S.C.ReviewConsents]};var er=a(82393);let en=[E.UX.BenefitsWebsite,E.UX.CoworkerReferral,E.UX.PrescriptionDenial,E.UX.ProviderReferral,E.UX.WordOfMouth,E.UX.Other],eo={maxLength:15,minLength:15,registerOptions:{minLength:{value:15,message:"Enter the 15-character member ID number."},maxLength:{value:15,message:"Enter the 15-character member ID number."},pattern:{value:/^(C9I|C9O)/i,message:"Member ID must begin with C9i or C9o."}},label:"Highmark Membership ID Number",placeholder:"C9XXXXXXXXXXXXX"},es={[S.C.ContactDetails]:{state:{options:er.rI},howDidYouFindUs:{options:en}},[S.C.InsuranceDetails]:{insuranceMemberID:{...eo,description:(0,i.jsx)(r.Text,{variant:"text-body-meta-regular",color:"text-secondary",children:"Enter the 15-digit Member ID as displayed on your Highmark Membership ID Card."}),tooltip:(0,i.jsxs)(r.Box,{children:[(0,i.jsx)(r.Text,{variant:"text-body-meta-regular",color:"text-light",children:"Where to find my Membership ID Number:"}),(0,i.jsx)(r.Image,{width:"100%",height:"auto",src:"/static/assets/programs/christiana-care/christiana-care-insurance-card.png",alt:"Member ID guidance"})]})}},[S.C.InsuranceDetailsReview]:{insuranceMemberID:eo}},el=E.fz.ChristianaCare,ec=e=>{let{render:t}=e,[a,A]=(0,P.zl)(et),L=(0,j.useMemo)(()=>(0,w.r)(a.value),[a.value]);(0,I.t)(L,el);let R=(0,j.useCallback)(e=>{A({type:"SUBMIT",data:e})},[A]),M=(0,j.useCallback)(()=>{A({type:"BACK"})},[A]),k=(0,j.useCallback)(()=>{switch(L){case J.PreEligibility:return(0,i.jsx)(f.P,{configuration:{contentResources:ei[S.C.PreEligibility]},onSubmit:R});case J.ContactDetails:return(0,i.jsx)(u.x,{configuration:{contentResources:ei[S.C.ContactDetails],fields:es[S.C.ContactDetails]},onSubmit:R,defaultValues:a.context.formData});case J.EligibilityUnmet:return(0,i.jsx)(g.B,{configuration:{contentResources:ei[S.C.EligibilityUnmet]},onSubmit:R,loading:a.matches({[J.EligibilityUnmet]:J.Submitting}),isEmailSent:a.matches({[J.EligibilityUnmet]:J.Success}),hasError:a.matches({[J.EligibilityUnmet]:J.Error})});case J.InsuranceDetails:return(0,i.jsx)(h.d,{configuration:{contentResources:ei[S.C.InsuranceDetails],fields:es[S.C.InsuranceDetails]},onSubmit:R,onBack:M});case J.InsuranceDetailsReview:return(0,i.jsx)(b.h,{configuration:{contentResources:ei[S.C.InsuranceDetailsReview],fields:es[S.C.InsuranceDetailsReview]},onSubmit:R,loading:a.matches({[J.InsuranceDetailsReview]:J.Submitting}),hasError:a.matches({[J.InsuranceDetailsReview]:J.Error}),defaultValues:a.context.formData});case J.ApplicationComplete:return(0,i.jsx)(o.Q,{...ei[S.C.ApplicationComplete],email:a.context.formData.email});case J.ApplicationDetected:return(0,i.jsx)(s.r,{...ei[S.C.ApplicationDetected],email:a.context.formData.email});case J.ApplicationReview:return(0,i.jsx)(l.l,{...ei[S.C.ApplicationReview]});case J.EmailVerification:return(0,i.jsx)(p.e,{configuration:{contentResources:{title:ei[S.C.EmailVerification](a.context.formData.email).title}},email:a.context.formData.email,hasError:a.matches({[J.EmailVerification]:J.Error}),loading:a.matches({[J.EmailVerification]:J.Submitting}),isUpdateEmailLoading:a.matches({[J.EmailVerification]:{[J.UpdateEmail]:J.Idle}}),hasUpdateEmailError:a.matches({[J.EmailVerification]:{[J.UpdateEmail]:J.Error}}),onSubmit:R,onResendCode:e=>A({type:"RESEND_EMAIL_VERIFICATION",data:{onSuccess:e}}),onEditEmail:(e,t)=>A({type:"UPDATE_EMAIL",data:{email:e,onSuccess:t}})});case J.OnboardingChecklist:return(0,i.jsx)(C.E,{showLabs:!0,configuration:{contentResources:ei[S.C.OnboardingChecklist]},onSubmit:R});case J.ReviewConsents:return(0,i.jsx)(D.U,{configuration:{contentResources:ei[S.C.ReviewConsents]},consents:a.context.consentsData.items,hasError:a.matches({[J.ReviewConsents]:J.Error}),loading:a.matches({[J.ReviewConsents]:J.FetchConsents})||a.matches({[J.ReviewConsents]:J.Submitting})||a.matches({[J.ReviewConsents]:J.UpdateContact}),onSubmit:R});case J.CreatePassword:return(0,i.jsx)(m.i,{configuration:{contentResources:ei[S.C.CreatePassword]},loading:a.matches({[J.CreatePassword]:J.Submitting}),error:a.context.error,onSubmit:R});case J.AppDownload:return(0,i.jsx)(n.a,{title:"SUBMIT_LATER"===a.context.labs?ei[S.C.AppDownload].titleLabSkipped:"LABS_UPLOADED"===a.context.labs?ei[S.C.AppDownload].titleLabSubmitted:ei[S.C.AppDownload].titleLabRequested,checklist:ei[S.C.AppDownload].checklist,image:(0,i.jsx)(r.Image,{m:"auto",mt:8,maxWidth:"300px",src:"/static/assets/app-download.png",alt:"app-download"})});case J.OnboardingUserError:return(0,i.jsx)(x.C,{});case J.RequestLabs:var e;return(0,i.jsx)(y.I,{organizationName:"ChristianaCare - Caregivers",patientId:null==(e=a.context.flyteUserData)?void 0:e.patientId,onProceedToSubmitLabs:()=>A({type:"PROCEED_TO_SUBMIT_LABS"}),onLabRequested:e=>A({type:"LAB_REQUESTED",data:{lab:e}}),formData:a.context.formData});case J.SubmitLabs:return(0,i.jsx)(v.x,{onGoBackToRequestLabs:()=>A({type:"GO_BACK_TO_REQUEST_LABS"}),onSubmitLabsLater:()=>A({type:"SUBMIT_LABS_LATER"}),onLabSubmitted:()=>A({type:"LAB_SUBMITTED"}),patientId:a.context.flyteUserData.patientId,diabetes:"yes"===a.context.formData.diabetes,bariatric:"yes"===a.context.formData.bariatricSurgery});default:return null}},[L,a]);return t({header:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(r.Flex,{gap:"spacer-5",alignItems:"center",children:[(0,i.jsx)(c.E,{partner:E.fz.Flyte}),(0,i.jsx)(r.Divider,{orientation:"vertical",alignSelf:"stretch",height:"auto"}),(0,i.jsx)(c.E,{partner:el})]}),(0,i.jsx)(d.nV,{currentStep:L})]}),body:k(),currentWorkFlowStep:L})}},53310:(e,t,a)=>{a.d(t,{A:()=>N});var i=a(37876),r=a(37477),n=a(48934),o=a(14901),s=a(16741),l=a(533),c=a(6770),d=a(63583),u=a(86535),m=a(93511),g=a(34305),p=a(80072),h=a(97793),b=a(66885),C=a(62227),x=a(14232),f=a(47353),y=a(33841),D=a(86687),v=a(89225),I=a(68792),E=a(65159),S=a(45352),w=a(39777),P=function(e){return e.CreateLead="createLead",e}(P||{});let j={...h.f,...P},A=v.Ek[y.fz.PyleFamilyInsurance],L={formData:{birthdate:"",comorbidity:"",currentWeightInPounds:"",dateOfHighestWeightValue:"",email:"",firstName:"",heightInFoot:"",heightInInch:"",highestWeightInPounds:"",insuranceCoverage:void 0,insuranceMemberID:"",insurance:void 0,lastName:"",phone:"",state:void 0,termsAgreement:!1,howDidYouFindUS:"",comorbidities:[],diabetes:"",bariatricSurgery:""},bmi:void 0},R=(0,E.mj)({types:{},guards:{isPreEligibilityMet:e=>{let{context:{bmi:t}}=e;return I.J0.pyleFamilyInsurance({bmi:t})},isApplicationDetected:D.L},actions:{updateFormData:(0,S.a)({formData:e=>{let{context:t,event:a}=e;return{...t.formData,...a.data}}}),assignBMI:(0,S.a)({bmi:e=>{let{context:t}=e,{heightInFoot:a,heightInInch:i,highestWeightInPounds:r}=t.formData;return(0,I.Hv)({heightFeet:(0,I.sC)(a),heightInches:(0,I.sC)(i),weightPounds:(0,I.sC)(r)})}}),reset:(0,S.a)({...L})}}).createMachine({context:()=>L,id:"pyleMachine",initial:j.PreEligibility,states:{[j.PreEligibility]:{id:j.PreEligibility,initial:j.Idle,states:{[j.Idle]:{on:{SUBMIT:{target:j.Submitting,actions:"updateFormData"}}},[j.Submitting]:{entry:"assignBMI",always:[{target:"#".concat(j.ContactDetails),guard:"isPreEligibilityMet"},{target:"#".concat(j.EligibilityUnmet)}]}}},[j.ContactDetails]:{id:j.ContactDetails,initial:j.Idle,states:{[j.Idle]:{on:{SUBMIT:{actions:"updateFormData",target:j.Submitting}}},[j.Submitting]:{id:j.Submitting,initial:j.CreateLead,states:{[j.CreateLead]:{id:j.CreateLead,invoke:{src:(0,w.Sx)(async e=>{let{input:t}=e,a={...t.formData,company:A,evolveOrganization:y.PM["A Duie Pyle"],leadStatus:y.XN.EligibleWaiting,automateEvolveEnrollment:!1};return await (0,f.t)(a)}),input:e=>{let{context:t}=e;return t},onDone:"#".concat(j.ApplicationReview),onError:[{guard:"isApplicationDetected",target:"#".concat(j.ApplicationDetected)},{target:"#".concat(j.Error)}]}}}},[j.Error]:{id:j.Error,on:{SUBMIT:{actions:"updateFormData",target:j.Submitting}}}}},[j.ApplicationReview]:{id:j.ApplicationReview},[j.ApplicationDetected]:{id:j.ApplicationDetected},[j.EligibilityUnmet]:{id:j.EligibilityUnmet,initial:j.Idle,states:{[j.Idle]:{on:{SUBMIT:{target:j.Submitting,actions:"updateFormData"}}},[j.Submitting]:{invoke:{src:(0,w.Sx)(async e=>{let{input:t}=e,a={...t,company:A,leadStatus:y.XN.Ineligible,ineligibilityReason:y.hT.BMI,automateEvolveEnrollment:!1};return await (0,f.t)(a)}),input:e=>{let{context:{formData:t}}=e;return t},onDone:j.Success,onError:j.Error}},[j.Success]:{},[j.Error]:{on:{SUBMIT:{target:j.Submitting}}}}}},on:{RESET:{target:"#".concat(j.PreEligibility),actions:"reset"}}});var M=a(69443);let k={[p.C.PreEligibility]:{title:(0,i.jsxs)(r.TextPairing,{variant:"textpairing-header-2XL",children:[(0,i.jsx)(r.TextPairing.Label,{color:"text-primary",children:"Let's make sure you're eligible for the FlyteHealth program."}),(0,i.jsx)(r.TextPairing.SubLabel,{color:"text-secondary",children:"To be eligible for the FlyteHealth program through your A-Duie Pyle benefits, you must meet specific age and Body Mass Index (BMI)* requirements."})]}),bmiEnrollmentDisclaimer:(0,i.jsx)(r.Text,{variant:"text-body-meta-regular",color:"text-secondary",children:"*We acknowledge that Body Mass Index (BMI) is an imperfect way to screen for excess weight. FlyteHealth providers do not use BMI alone as a measure of overall health. Instead, BMI is used as a data point to see if someone is eligible to join the FlyteHealth program. Once someone joins the program, we'll ask each person more about their health to create a personalized treatment plan."})},[p.C.EligibilityUnmet]:{title:(0,i.jsxs)(r.TextPairing,{variant:"textpairing-header-2XL",children:[(0,i.jsx)(r.TextPairing.Label,{color:"text-secondary-negative",children:"Unfortunately, you are not eligible to join FlyteHealth at this time."}),(0,i.jsx)(r.TextPairing.SubLabel,{color:"text-secondary",children:"The FlyteHealth program requires a minimum BMI of 27+ (plus one or more weight-related health conditions) or a BMI of 30+."})]})},[p.C.ContactDetails]:{title:(0,i.jsxs)(r.TextPairing,{variant:"textpairing-header-2XL",children:[(0,i.jsx)(r.TextPairing.Label,{color:"text-secondary-negative",children:"Congratulations! You're eligible for the FlyteHealth program"}),(0,i.jsx)(r.TextPairing.SubLabel,{color:"text-secondary",children:"To help us match your information with your employer, tell us about yourself."})]})},[p.C.ApplicationReview]:{title:(0,i.jsxs)(r.TextPairing,{variant:"textpairing-header-2XL",children:[(0,i.jsx)(r.TextPairing.Label,{color:"text-primary",children:"You're almost finished!"}),(0,i.jsx)(r.TextPairing.SubLabel,{color:"text-secondary",children:"We've received your application, but we need a little more information from you to move forward. Please call us to complete the application process."})]}),note:(0,i.jsx)(r.Text,{variant:"text-body-large-regular",color:"text-secondary",children:"There is a one-time $235 FlyteHealth program fee for eligible employees collected during scheduling. A portion of this fee ($150) will be reimbursed by A-Duie Pyle upon confirmation of eligibility and program start. Please contact Pyle HR for instructions on how to obtain this reimbursement."})},[p.C.ApplicationDetected]:{title:(0,i.jsx)(r.Text,{variant:"text-header-2XL",color:"text-primary",children:"We found an existing account for:"}),description:(0,i.jsx)(r.Text,{variant:"text-body-display-S",color:"text-secondary",children:"It looks like you already have an account with us. To continue or update your registration details, please contact our Care Coordinator team."})},[p.C.OnboardingChecklist]:M.M[p.C.OnboardingChecklist],[p.C.CreatePassword]:M.M[p.C.CreatePassword],[p.C.AppDownload]:M.M[p.C.AppDownload],[p.C.ReviewConsents]:M.M[p.C.ReviewConsents]};var T=a(82393);let U=[g.UX.BenefitsWebsite,g.UX.CoworkerReferral,g.UX.ProviderReferral,g.UX.WordOfMouth,g.UX.Other],B={[p.C.ContactDetails]:{state:{options:T.rI},howDidYouFindUs:{options:U}}},F=new Map([[p.C.PreEligibility,l.n.get(p.C.PreEligibility)],[p.C.ContactDetails,l.n.get(p.C.ContactDetails)]]),O=g.fz.PyleFamilyInsurance,N=e=>{let{render:t}=e,[a,f]=(0,C.zl)(R),y=(0,x.useMemo)(()=>(0,b.r)(a.value),[a.value]);(0,m.t)(y,O);let D=(0,x.useCallback)(e=>{f({type:"SUBMIT",data:e})},[f]),v=(0,x.useCallback)(()=>{switch(y){case h.f.PreEligibility:return(0,i.jsx)(u.P,{configuration:{contentResources:k[p.C.PreEligibility]},onSubmit:D});case h.f.ContactDetails:return(0,i.jsx)(c.x,{configuration:{contentResources:k[p.C.ContactDetails],fields:B[p.C.ContactDetails]},loading:a.matches({[h.f.ContactDetails]:h.f.Submitting}),onSubmit:D,defaultValues:a.context.formData});case h.f.EligibilityUnmet:return(0,i.jsx)(d.B,{configuration:{contentResources:k[p.C.EligibilityUnmet]},onSubmit:D,loading:a.matches({[h.f.EligibilityUnmet]:h.f.Submitting}),isEmailSent:a.matches({[h.f.EligibilityUnmet]:h.f.Success}),hasError:a.matches({[h.f.EligibilityUnmet]:h.f.Error})});case h.f.ApplicationReview:return(0,i.jsx)(o.l,{...k[p.C.ApplicationReview]});case h.f.ApplicationDetected:return(0,i.jsx)(n.r,{...k[p.C.ApplicationDetected],email:a.context.formData.email});default:return null}},[y,a]);return t({header:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(r.Flex,{gap:"spacer-5",alignItems:"center",children:[(0,i.jsx)(s.E,{partner:g.fz.Flyte}),(0,i.jsx)(r.Divider,{orientation:"vertical",alignSelf:"stretch",height:"auto"}),(0,i.jsx)(s.E,{partner:O})]}),(0,i.jsx)(l.f,{currentStep:y,steps:F})]}),body:v(),currentWorkFlowStep:y})}},56931:(e,t,a)=>{a.d(t,{A:()=>eh});var i=a(37876),r=a(37477),n=a(59004),o=a(91366),s=a(48934),l=a(14901),c=a(16741),d=a(533),u=a(6770),m=a(39946),g=a(63583),p=a(53154),h=a(42037),b=a(70587),C=a(11427),x=a(86535),f=a(43483),y=a(93511),D=a(34305),v=a(80072),I=a(66885),E=a(62227),S=a(14232);Object.values(D.lk).filter(e=>e!==D.lk.SelfPay);var w=a(82393),P=a(45383),j=a(19847),A=a(88992),L=a(76692),R=a(43400),M=a(82492);let k="insuranceMemberID",T=(0,i.jsx)(r.Text,{variant:"text-body-meta-regular",color:"text-secondary",children:"Your Unique ID is your ten-digit Benefit Funds’ Member ID Number. For Eligible dependents, use the guidance below:"}),U=e=>{let{label:t="1199SEIU Unique ID",placeholder:a="Unique ID Number",description:n=T,tooltip:o,type:s,maxLength:l,minLength:c,maskOptions:d,inputMode:u,registerOptions:m,isDisabled:g=!1,isRequired:p=!0,...h}=e,{setValue:b,register:C,formState:{errors:x}}=(0,A.xW)(),f=(0,M.Q)(k,x,["minLength","maxLength","pattern"]);return(0,i.jsxs)(r.Flex,{direction:"column",gap:"spacer-2",...h,children:[(0,i.jsxs)(r.Box,{children:[(0,i.jsxs)(r.Flex,{gap:"spacer-2",alignItems:"center",children:[(0,i.jsx)(r.Text,{as:"label",variant:"text-body-large-bold",color:"text-primary-negative",htmlFor:k,children:t}),o&&(0,i.jsx)(r.Tooltip,{label:o,placement:"auto-end",children:(0,i.jsx)(r.Flex,{children:(0,i.jsx)(r.IconInfoCircle,{size:"m",color:"text-link-primary-default"})})})]}),n]}),(0,i.jsx)(R.I,{"data-test":k,id:k,isInvalid:f,isDisabled:g,placeholder:a,type:s,inputMode:u,maxLength:l,minLength:c,maskOptions:d,onInput:e=>{let t=e.currentTarget.value,a=!c||c&&t.length>=c;b(k,t,{shouldValidate:a})},...C(k,{required:p,...m})}),(0,i.jsxs)(r.Text,{variant:"text-body-regular",fontSize:12,color:"text-secondary",children:[(0,i.jsx)("b",{children:"- For Spouse:"})," ","member’s ID number + first nine characters of spouse’s first name + S."," ",(0,i.jsx)("br",{}),"Example: 1234567890JohnathonS",(0,i.jsx)("br",{}),(0,i.jsx)("b",{children:"- For Child (18 or older)"}),": member’s ID number + first nine characters of dependent’s first name + D. Example: 1234567890MariaD"]}),f&&(0,i.jsx)(w.gO,{errors:x,name:k})]})},B=e=>{let{configuration:t,loading:a=!1,onSubmit:n,onBack:o}=e,{contentResources:s,fields:l}=t,c=(0,A.mN)({mode:"onBlur"}),d=(0,j.a)(),u=c.watch(L.uQ)===D.RS.SelfPay,m=c.watch(L.ag)===D.lk.Other;(0,S.useEffect)(()=>{u&&(c.resetField(L.ag),c.resetField(L.JB))},[u,c]),(0,S.useEffect)(()=>{c.resetField(L.E6)},[c.watch(L.ag),c]);let g=()=>(0,i.jsxs)(r.Flex,{gap:{base:"spacer-8",md:"spacer-16"},alignItems:"center",flex:{base:1,lg:"unset"},children:[(0,i.jsx)(r.Button,{size:{base:"m",lg:"l"},isLoading:a,variant:"link","aria-label":"Back",leadingIcon:(0,i.jsx)(r.IconArrowLeft,{}),onClick:o,children:"Back"}),(0,i.jsx)(r.Button,{type:"submit",size:{base:"m",lg:"l"},isDisabled:!c.formState.isValid,flex:1,isLoading:a,trailingIcon:(0,i.jsx)(r.IconArrowRight,{}),"aria-label":"Continue",children:"Continue"})]});return(0,i.jsx)(A.Op,{...c,children:(0,i.jsxs)(P.X,{as:"form",onSubmit:c.handleSubmit(n),noValidate:!0,children:[(0,i.jsx)(P.X.Side,{gap:0,flex:{base:"none",lg:1},children:s.title}),(0,i.jsxs)(P.X.Form,{children:[(null==l?void 0:l.insuranceCoverage)&&(0,i.jsx)(L.Xq,{isDisabled:a}),(null==l?void 0:l.insurance)&&(0,i.jsx)(L._8,{isDisabled:a||u,isRequired:!u,...null==l?void 0:l.insurance},u.toString()),m&&(0,i.jsx)(L.jP,{isDisabled:a,...null==l?void 0:l.insuranceOther}),(0,i.jsx)(U,{isDisabled:a||u,isRequired:!u,pb:{base:"spacer-24",lg:0},...null==l?void 0:l.insuranceMemberID}),d?(0,i.jsx)(w.cI,{children:g()}):g()]})]})})};var F=a(11969),O=a(10758),N=a(85007),_=a(31346),H=a(38360),X=a(39648),V=a(77944),z=a(47353),W=a(83928),q=a(33841),Y=a(13751),K=a(92323),G=a(86687),Q=a(89225),J=a(97793),$=a(68792),Z=a(65159),ee=a(39777),et=a(45352),ea=a(63826);let ei=e=>e===ea.w.FULL_MATCH||e===ea.w.ELIGIBLE_MATCH||e===ea.w.PERSON_MATCH,er=e=>{switch(e){case ea.w.INSURANCE_MATCH:case ea.w.EXPIRED:case ea.w.NOT_FOUND:return D.XN.EligibleWaiting;case ea.w.PERSON_MATCH:case ea.w.FULL_MATCH:case ea.w.ELIGIBLE_MATCH:default:return}};var en=function(e){return e.CreateLead="createLead",e.CreateContact="createContact",e.UpdateContact="updateContact",e.DetermineContactOrLead="determineContactOrLead",e.FetchConsents="fetchConsents",e.UpdateEmail="updateEmail",e.CheckEligibility="checkEligibility",e}(en||{});let eo={...J.f,...en},es=Q.Ek[q.fz["1199SEIU"]],el={formData:{birthdate:"",comorbidity:"",currentWeightInPounds:"",dateOfHighestWeightValue:"",email:"",ssn:"",firstName:"",heightInFoot:"",heightInInch:"",highestWeightInPounds:"",insuranceCoverage:void 0,insuranceMemberID:"",insurance:void 0,lastName:"",phone:"",termsAgreement:!1,howDidYouFindUS:"",diabetes:"",bariatricSurgery:"",comorbidities:[""]},eligibilityCheckMatchType:void 0,matchingRecord:void 0,bmi:void 0,otpData:void 0,consentsData:{items:[],userConsentStatus:[]},contactData:{},passwordData:{password:void 0,confirmPassword:void 0},flyteUserData:void 0,error:void 0},ec={...Y.AU,...Y.gQ,...Y.pE,...Y.UH,...Y.yF,...Y.n6,...Y.uN,...Y.yS,...Y.RW,...(0,Y.rS)(el).reset},ed=(0,Z.mj)({types:{},guards:{isPreEligibilityMet:e=>{let{context:{formData:t,bmi:a}}=e;return $.J0["1199SEIU"]({bmi:a,comorbidity:t.comorbidity,birthdate:t.birthdate})},isApplicationReviewRequired:e=>{let{context:{eligibilityCheckMatchType:t,formData:a}}=e;return!W.A.shouldBypassIsApplicationReviewRequired({email:a.email})&&!ei(t)},isApplicationDetected:G.L,isAthenaRecordCreated:K.z},actions:ec}).createMachine({context:()=>el,id:"SEIUMachine",initial:eo.PreEligibility,states:{[eo.PreEligibility]:{id:eo.PreEligibility,initial:eo.Idle,states:{[eo.Idle]:{on:{SUBMIT:{target:eo.Submitting,actions:"updateFormData"}}},[eo.Submitting]:{entry:"assignBMI",always:[{target:"#".concat(eo.ContactDetails),guard:"isPreEligibilityMet"},{target:"#".concat(eo.EligibilityUnmet)}]}}},[eo.ContactDetails]:{id:eo.ContactDetails,initial:eo.Idle,states:{[eo.Idle]:{on:{SUBMIT:{target:"#".concat(eo.InsuranceDetails),actions:"updateFormData"}}}}},[eo.InsuranceDetails]:{id:eo.InsuranceDetails,initial:eo.Idle,states:{[eo.Idle]:{on:{BACK:{target:"#".concat(eo.ContactDetails)},SUBMIT:{target:"#".concat(eo.InsuranceDetailsReview),actions:"updateFormData"}}}}},[eo.InsuranceDetailsReview]:{id:eo.InsuranceDetailsReview,initial:eo.Idle,states:{[eo.Idle]:{on:{SUBMIT:{actions:"updateFormData",target:eo.Submitting}}},[eo.Submitting]:{id:eo.Submitting,initial:eo.CheckEligibility,states:{[eo.CheckEligibility]:{id:eo.CheckEligibility,invoke:{src:(0,ee.Sx)(async e=>{let{input:t}=e,a={...t,insurance:Q.w[q.fz["1199SEIU"]],benefitProgram:Q.Nl[q.fz["1199SEIU"]]};return await (0,X.w)(a)}),input:e=>{let{context:{formData:t}}=e;return t},onDone:[{actions:(0,et.a)({eligibilityCheckMatchType:e=>{let{event:t}=e;return t.output.data.matchType},matchingRecord:e=>{let{event:t}=e;return t.output.data.matchingRecord}}),target:"#".concat(eo.DetermineContactOrLead)}],onError:"#".concat(eo.InsuranceDetailsReview,".").concat(eo.Error)}},[eo.DetermineContactOrLead]:{id:eo.DetermineContactOrLead,always:[{guard:"isApplicationReviewRequired",target:eo.CreateLead},{target:eo.CreateContact}]},[eo.CreateContact]:{id:eo.CreateContact,invoke:{src:(0,ee.Sx)(async e=>{var t;let{input:a}=e,i=null==(t=a.matchingRecord)?void 0:t.accountName,r={...a.formData,employmentVerificationCode:a.formData.insuranceMemberID,eligibilityVerifiedBy:q.h9.Evolve,insuranceMemberID:a.formData.insuranceMemberID,company:es,insurance:Q.Ft[q.fz["1199SEIU"]],evolveOrganization:q.PM["1199SEIU"],accountId:Q.f3[q.fz["1199SEIU"]],...i&&{participantDepartmentorOrg:i}};return await (0,H.vY)(r)}),input:e=>{let{context:t}=e;return t},onDone:{actions:"assignContactData",target:"#".concat(eo.EmailVerification)},onError:[{guard:"isApplicationDetected",target:"#".concat(eo.ApplicationDetected)},{target:"#".concat(eo.InsuranceDetailsReview,".").concat(eo.Error)}]}},[eo.CreateLead]:{id:eo.CreateLead,invoke:{src:(0,ee.Sx)(async e=>{var t;let{input:a}=e,i=null==(t=a.matchingRecord)?void 0:t.accountName,r={...a.formData,employmentVerificationCode:a.formData.insuranceMemberID,insuranceMemberID:a.formData.insuranceMemberID,company:es,insurance:Q.Ft[q.fz["1199SEIU"]],evolveOrganization:q.PM["1199SEIU"],leadStatus:er(a.eligibilityCheckMatchType),automateEvolveEnrollment:ei(a.eligibilityCheckMatchType),...i&&{participantDepartmentorOrg:i}};return await (0,z.t)(r)}),input:e=>{let{context:t}=e;return t},onDone:[{guard:"isApplicationReviewRequired",target:"#".concat(eo.ApplicationReview)},{target:"#".concat(eo.ApplicationComplete)}],onError:[{guard:"isApplicationDetected",target:"#".concat(eo.ApplicationDetected)},{target:"#".concat(eo.InsuranceDetailsReview,".").concat(eo.Error)}]}}}},[eo.Error]:{id:"".concat(eo.InsuranceDetailsReview,".").concat(eo.Error),on:{SUBMIT:{actions:"updateFormData",target:eo.Submitting}}}}},[eo.EmailVerification]:{id:eo.EmailVerification,initial:eo.Idle,states:{[eo.Idle]:{id:"".concat(eo.EmailVerification,".").concat(eo.Idle),on:{SUBMIT:{actions:"assignOtpCode",target:eo.Submitting},RESEND_EMAIL_VERIFICATION:{target:eo.Idle,reenter:!0},UPDATE_EMAIL:{target:eo.UpdateEmail}},invoke:{input:e=>{var t;let{context:a,event:i}=e;return{email:a.formData.email,firstName:a.formData.firstName,onSuccess:null==i||null==(t=i.data)?void 0:t.onSuccess}},src:(0,ee.Sx)(async e=>{let{input:t}=e,a={email:t.email,firstName:t.firstName};return{token:(await (0,O.v)(a)).data.token,onSuccess:t.onSuccess}}),onDone:{actions:[(0,et.a)({otpData:e=>{let{context:t,event:a}=e;return{...t.otpData,token:a.output.token}}}),e=>{var t;let{event:a}=e;(null==a||null==(t=a.output)?void 0:t.onSuccess)&&a.output.onSuccess()}]},onError:eo.Error}},[eo.Submitting]:{invoke:{src:(0,ee.Sx)(async e=>{let{input:t}=e,a={email:t.formData.email,token:t.otpData.token,otp:t.otpData.otp};return await (0,N.R)(a)}),input:e=>{let{context:t}=e;return t},onDone:"#".concat(eo.OnboardingChecklist),onError:eo.Error}},[eo.Error]:{on:{SUBMIT:{actions:"assignOtpCode",target:eo.Submitting},RESEND_EMAIL_VERIFICATION:{target:eo.Idle},UPDATE_EMAIL:{target:eo.UpdateEmail}}},[eo.UpdateEmail]:{initial:eo.Idle,states:{[eo.Idle]:{invoke:{input:e=>{let{context:t,event:a}=e;return{contactId:t.contactData.contactId,email:a.data.email,onSuccess:a.data.onSuccess}},src:(0,ee.Sx)(async e=>{let{input:t}=e,a={contactId:t.contactId,email:t.email};return await (0,H.CI)(a),{email:t.email,onSuccess:t.onSuccess}}),onDone:{actions:["assignNewEmail",e=>{var t;let{event:a}=e;(null==a||null==(t=a.output)?void 0:t.onSuccess)&&a.output.onSuccess()}],target:"#".concat(eo.EmailVerification,".").concat(eo.Idle)},onError:eo.Error}},[eo.Error]:{on:{SUBMIT:{target:"#".concat(eo.EmailVerification,".").concat(eo.Idle)},RESEND_EMAIL_VERIFICATION:{target:"#".concat(eo.EmailVerification,".").concat(eo.Idle)},UPDATE_EMAIL:{target:eo.Idle}}}}}}},[eo.ReviewConsents]:{id:eo.ReviewConsents,initial:eo.FetchConsents,states:{[eo.Idle]:{on:{SUBMIT:{actions:["assignUserConsentStatus"],target:eo.Submitting}}},[eo.FetchConsents]:{invoke:{src:(0,ee.Sx)(async()=>await (0,_.i)()),onDone:{actions:"assignConsents",target:eo.Idle},onError:eo.Error}},[eo.Submitting]:{invoke:{src:(0,ee.Sx)(async e=>{let{input:t}=e,a={patientIdentifier:t.contactData.contactId,firstName:t.formData.firstName,lastName:t.formData.lastName,phone:t.formData.phone,email:t.formData.email,birthDate:t.formData.birthdate,state:t.formData.state,heightInInch:t.formData.heightInInch,heightInFeet:t.formData.heightInFoot,currentWeightInPounds:t.formData.currentWeightInPounds,evolveOrganization:q.PM["1199SEIU"],consents:t.consentsData.userConsentStatus};return await (0,V.Y)(a)}),input:e=>{let{context:t}=e;return t},onDone:[{actions:"assignFlyteUserData",target:eo.UpdateContact}],onError:"#".concat(eo.OnboardingUserError)}},[eo.UpdateContact]:{invoke:{src:(0,ee.Sx)(async e=>{let{input:t}=e,a={contactId:t.contactData.contactId,evolvePatientID:t.flyteUserData.patientId};return await (0,H.CI)(a)}),input:e=>{let{context:t}=e;return t},onDone:[{guard:"isAthenaRecordCreated",target:"#".concat(eo.CreatePassword)},{target:"#".concat(eo.OnboardingUserError)}],onError:"#".concat(eo.OnboardingUserError)}},[eo.Error]:{on:{SUBMIT:{actions:["assignUserConsentStatus"],target:eo.Submitting}}}}},[eo.CreatePassword]:{id:eo.CreatePassword,initial:eo.Idle,states:{[eo.Idle]:{on:{SUBMIT:{actions:"assignPasswordData",target:eo.Submitting}}},[eo.Submitting]:{invoke:{src:(0,ee.Sx)(async e=>{let{input:t}=e,a={email:t.formData.email,password:t.passwordData.password,confirmPassword:t.passwordData.confirmPassword};return await (0,F.I)(t.flyteUserData.verifyToken,a)}),input:e=>{let{context:t}=e;return t},onDone:"#".concat(eo.AppDownload),onError:{target:eo.Error,actions:"assignError"}}},[eo.Error]:{on:{SUBMIT:{actions:["resetError","assignPasswordData"],target:eo.Submitting}}}}},[eo.OnboardingChecklist]:{id:eo.OnboardingChecklist,on:{SUBMIT:{target:"#".concat(eo.ReviewConsents)}}},[eo.AppDownload]:{id:eo.AppDownload},[eo.ApplicationReview]:{id:eo.ApplicationReview},[eo.OnboardingUserError]:{id:eo.OnboardingUserError},[eo.ApplicationComplete]:{id:eo.ApplicationComplete},[eo.ApplicationDetected]:{id:eo.ApplicationDetected},[eo.EligibilityUnmet]:{id:eo.EligibilityUnmet,initial:eo.Idle,states:{[eo.Idle]:{on:{SUBMIT:{target:eo.Submitting,actions:"updateFormData"}}},[eo.Submitting]:{invoke:{src:(0,ee.Sx)(async e=>{let{input:t}=e,a={...t,company:es,leadStatus:q.XN.Ineligible,ineligibilityReason:q.hT.BMI,automateEvolveEnrollment:!1};return await (0,z.t)(a)}),input:e=>{let{context:{formData:t}}=e;return t},onDone:eo.Success,onError:eo.Error}},[eo.Success]:{},[eo.Error]:{on:{SUBMIT:{target:eo.Submitting}}}}}},on:{RESET:{target:"#".concat(eo.PreEligibility),actions:"reset"}}});var eu=a(69443);let em={[v.C.PreEligibility]:{title:(0,i.jsxs)(r.TextPairing,{variant:"textpairing-header-2XL",children:[(0,i.jsx)(r.TextPairing.Label,{color:"text-primary",children:"Let's make sure you're eligible for the FlyteHealth program."}),(0,i.jsx)(r.TextPairing.SubLabel,{color:"text-secondary",children:"To be eligible for the FlyteHealth program through the 1199SEIU Benefit Funds, you must meet specific age and Body Mass Index (BMI)* requirements."})]}),bmiEnrollmentDisclaimer:(0,i.jsx)(r.Text,{variant:"text-body-meta-regular",color:"text-secondary",children:"*We acknowledge that Body Mass Index (BMI) is an imperfect way to screen for excess weight. FlyteHealth providers do not use BMI alone as a measure of overall health. Instead, BMI is used as a data point to see if someone is eligible to join the FlyteHealth program. Once someone joins the program, we'll ask each person more about their health to create a personalized treatment plan."})},[v.C.EligibilityUnmet]:{title:(0,i.jsxs)(r.TextPairing,{variant:"textpairing-header-2XL",children:[(0,i.jsx)(r.TextPairing.Label,{color:"text-secondary-negative",children:"Unfortunately, you are not eligible to join FlyteHealth at this time."}),(0,i.jsx)(r.TextPairing.SubLabel,{color:"text-secondary",children:"The FlyteHealth program requires a minimum BMI of 27+ (plus one or more weight-related health conditions) or a BMI of 30+."})]})},[v.C.ContactDetails]:{title:(0,i.jsxs)(r.TextPairing,{variant:"textpairing-header-2XL",children:[(0,i.jsx)(r.TextPairing.Label,{color:"text-secondary-negative",children:"Next, tell us about yourself"}),(0,i.jsxs)(r.TextPairing.SubLabel,{color:"text-secondary",children:["To help match your information with the 1199SEIU Health Benefits Plan, we need to verify a few personal details.",(0,i.jsx)("br",{})," ",(0,i.jsx)("br",{}),"Be sure to have your member ID card handy for the next step."]})]})},[v.C.InsuranceDetails]:{title:(0,i.jsxs)(r.Text,{variant:"text-header-2XL",color:"text-secondary-negative",children:["One more thing:"," ",(0,i.jsx)(r.Text,{as:"span",variant:"text-header-2XL",color:"text-primary",children:"Do you have health insurance?"})]})},[v.C.InsuranceDetailsReview]:{title:(0,i.jsxs)(r.TextPairing,{variant:"textpairing-header-2XL",children:[(0,i.jsx)(r.TextPairing.Label,{children:"Let's review: Is your info correct?"}),(0,i.jsx)(r.TextPairing.SubLabel,{color:"text-secondary",children:"Please double-check the information you provided to make sure everything is correct."})]})},[v.C.ApplicationComplete]:{title:(0,i.jsxs)(r.TextPairing,{variant:"textpairing-header-2XL",children:[(0,i.jsx)(r.TextPairing.Label,{color:"text-secondary-negative",children:"Welcome aboard! We're so excited you're here."}),(0,i.jsx)(r.TextPairing.SubLabel,{color:"text-secondary",children:"Next, we need to confirm your email. Click the link we sent to:"})]}),description:(0,i.jsx)(r.Text,{mt:"spacer-8",color:"text-secondary",variant:"text-body-regular",children:"Can’t find the email? Make sure to check your Spam folder."})},[v.C.ApplicationReview]:{title:(0,i.jsxs)(r.TextPairing,{variant:"textpairing-header-2XL",children:[(0,i.jsx)(r.TextPairing.Label,{color:"text-primary",children:"You're almost finished!"}),(0,i.jsx)(r.TextPairing.SubLabel,{color:"text-secondary",children:"We've received your application, but we need a little more information from you to move forward. Please call us to complete the application process."})]})},[v.C.ApplicationDetected]:{title:(0,i.jsx)(r.Text,{variant:"text-header-2XL",color:"text-primary",children:"We found an existing account for:"}),description:(0,i.jsx)(r.Text,{variant:"text-body-display-S",color:"text-secondary",children:"It looks like you already have an account with us. To continue or update your registration details, please contact our Care Coordinator team."})},[v.C.EmailVerification]:eu.M[v.C.EmailVerification],[v.C.OnboardingChecklist]:eu.M[v.C.OnboardingChecklist],[v.C.CreatePassword]:eu.M[v.C.CreatePassword],[v.C.AppDownload]:eu.M[v.C.AppDownload],[v.C.ReviewConsents]:eu.M[v.C.ReviewConsents]},eg=[D.UX.BenefitsWebsite,D.UX.CoworkerReferral,D.UX.PrescriptionDenial,D.UX.ProviderReferral,D.UX.WordOfMouth,D.UX.Other],ep={[v.C.ContactDetails]:{state:{options:w.rI},howDidYouFindUs:{options:eg}},[v.C.InsuranceDetails]:{insuranceMemberID:{}},[v.C.InsuranceDetailsReview]:{insuranceMemberID:{}}},eh=e=>{let{render:t}=e,[a,w]=(0,E.zl)(ed),P=(0,S.useMemo)(()=>(0,I.r)(a.value),[a.value]);(0,y.t)(P);let j=(0,S.useCallback)(e=>{w({type:"SUBMIT",data:e})},[w]),A=(0,S.useCallback)(()=>{w({type:"BACK"})},[w]),L=(0,S.useCallback)(()=>{switch(P){case eo.PreEligibility:return(0,i.jsx)(x.P,{configuration:{contentResources:em[v.C.PreEligibility]},onSubmit:j});case eo.ContactDetails:return(0,i.jsx)(u.x,{configuration:{contentResources:em[v.C.ContactDetails],fields:ep[v.C.ContactDetails]},onSubmit:j,defaultValues:a.context.formData});case eo.EligibilityUnmet:return(0,i.jsx)(g.B,{configuration:{contentResources:em[v.C.EligibilityUnmet]},onSubmit:j,loading:a.matches({[eo.EligibilityUnmet]:eo.Submitting}),isEmailSent:a.matches({[eo.EligibilityUnmet]:eo.Success}),hasError:a.matches({[eo.EligibilityUnmet]:eo.Error})});case eo.InsuranceDetails:return(0,i.jsx)(B,{configuration:{contentResources:em[v.C.InsuranceDetails],fields:ep[v.C.InsuranceDetails]},onSubmit:j,onBack:A});case eo.InsuranceDetailsReview:return(0,i.jsx)(h.h,{configuration:{contentResources:em[v.C.InsuranceDetailsReview],fields:ep[v.C.InsuranceDetailsReview]},onSubmit:j,loading:a.matches({[eo.InsuranceDetailsReview]:eo.Submitting}),hasError:a.matches({[eo.InsuranceDetailsReview]:eo.Error}),defaultValues:a.context.formData});case eo.ApplicationComplete:return(0,i.jsx)(o.Q,{...em[v.C.ApplicationComplete],email:a.context.formData.email});case eo.ApplicationDetected:return(0,i.jsx)(s.r,{...em[v.C.ApplicationDetected],email:a.context.formData.email});case eo.ApplicationReview:return(0,i.jsx)(l.l,{...em[v.C.ApplicationReview]});case eo.EmailVerification:return(0,i.jsx)(p.e,{configuration:{contentResources:{title:em[v.C.EmailVerification](a.context.formData.email).title}},email:a.context.formData.email,hasError:a.matches({[eo.EmailVerification]:eo.Error}),loading:a.matches({[eo.EmailVerification]:eo.Submitting}),isUpdateEmailLoading:a.matches({[eo.EmailVerification]:{[eo.UpdateEmail]:eo.Idle}}),hasUpdateEmailError:a.matches({[eo.EmailVerification]:{[eo.UpdateEmail]:eo.Error}}),onSubmit:j,onResendCode:e=>w({type:"RESEND_EMAIL_VERIFICATION",data:{onSuccess:e}}),onEditEmail:(e,t)=>w({type:"UPDATE_EMAIL",data:{email:e,onSuccess:t}})});case eo.OnboardingChecklist:return(0,i.jsx)(b.E,{configuration:{contentResources:em[v.C.OnboardingChecklist]},onSubmit:j});case eo.ReviewConsents:return(0,i.jsx)(f.U,{configuration:{contentResources:em[v.C.ReviewConsents]},consents:a.context.consentsData.items,hasError:a.matches({[eo.ReviewConsents]:eo.Error}),loading:a.matches({[eo.ReviewConsents]:eo.FetchConsents})||a.matches({[eo.ReviewConsents]:eo.Submitting})||a.matches({[eo.ReviewConsents]:eo.UpdateContact}),onSubmit:j});case eo.CreatePassword:return(0,i.jsx)(m.i,{configuration:{contentResources:em[v.C.CreatePassword]},loading:a.matches({[eo.CreatePassword]:eo.Submitting}),error:a.context.error,onSubmit:j});case eo.AppDownload:return(0,i.jsx)(n.a,{title:em[v.C.AppDownload].title,checklist:em[v.C.AppDownload].checklist});case eo.OnboardingUserError:return(0,i.jsx)(C.C,{});default:return null}},[P,a]);return t({header:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(r.Flex,{gap:"spacer-5",alignItems:"center",children:[(0,i.jsx)(c.E,{partner:D.fz.Flyte}),(0,i.jsx)(r.Divider,{orientation:"vertical",alignSelf:"stretch",height:"auto"}),(0,i.jsx)(c.E,{partner:D.fz["1199SEIU"]})]}),(0,i.jsx)(d.f,{currentStep:P})]}),body:L(),currentWorkFlowStep:P})}},77944:(e,t,a)=>{a.d(t,{Y:()=>i.Y});var i=a(87665)},80933:(e,t,a)=>{a.d(t,{h:()=>eJ});var i=a(37876),r=a(29261),n=a(74161),o=a(37477),s=a(52674),l=a(83439),c=a(80072),d=a(14232),u=a(16741),m=a(34305),g=a(1144),p=a(66885),h=a(62227),b=a(46884),C=a(76803),x=a(53100),f=a(59004),y=a(91366),D=a(48934),v=a(14901),I=a(533),E=a(39946),S=a(63583),w=a(53154),P=a(30435),j=a(42037),A=a(70587),L=a(11427),R=a(86535),M=a(43483),k=a(93511),T=a(82393),U=a(45383),B=a(84441),F=a(15986),O=a(48496),N=a(19847),_=a(88992),H=function(e){return e.NotReferred="Not referred",e.AccessHealthcare="Access Healthcare, PC",e.AnandKanjolia="Anand Kanjolia, MD, LLC",e.AnneMarieVilla="Anne Marie Villa, MD, PC",e.ArthurSkalski="Arthur H Skalski, MD Internal Medicine FACSG LLC",e.AvantaClinic="Avanta Clinic, LLC",e.ComprehensiveMedicalGroup="Comprehensive Medical Group, LLC",e.ConnecticutValleyPediatricCenter="Connecticut Valley Pediatric Center, Inc",e.DushyantParikh="Dushyant Parikh, MD",e.EastGranbyFamilyPractice="East Granby Family Practice, LLC",e.EileenComia="Eileen C Comia, MD, LLC",e.EllenMarmer="Ellen L Marmer, MD",e.FeelWellHealthCenter="Feel Well Health Center of Southington, PC dba Confidia Health Institute",e.HRobertSilverstein="H Robert Silverstein MD, FACC, PC",e.IvelisseViruet="Ivelisse Viruet, MD Internal Medicine, LLC",e.JamesHainesAndWilliamBelcastro="James Haines, MD & William Belcastro, MD",e.JudithMascolo="Judith M Mascolo, MD, LLC",e.JulieSacharko="Julie Sacharko, APRN LLC",e.KaiserPermanente="Kaiser Permanente",e.MahmoodYekta="Mahmood Yekta, MD, PC dba Shafa Medical Clinic",e.MeadowsHealthCenter="Meadows Health Center, PC",e.MobileCarePartners="Mobile Care Partners of Connecticut, PLLC",e.MouliAssociates="Mouli Associates LLC",e.OksanaKloyzner="Oksana Kloyzner, MD, LLC",e.OliverDiaz="Oliver B Diaz, MD",e.PeiSun="Pei Sun MD, LLC",e.PersonalPrimaryCare="Personal Primary Care and Weight Management LLC",e.PreferredHealthcareAssociates="Preferred Healthcare Associates, Inc",e.PrimaryPhysicalMedicine="Primary Physical Medicine, LLC",e.QuinonesMedicalGroup="Quinones Medical Group, LLC",e.RamirezMedicalPractice="Ramirez Medical Practice, PLLC",e.ReviveCenterForHealth="REVIVE Center for Health & Wellness, PLLC",e.RobertCarlson="Robert D Carlson, MD, LLC",e.RockyHillMedicalCenter="Rocky Hill Medical Center, LLC",e.RoyKellerman="Roy A Kellerman, MD, LLC",e.SoNEHealthMedicalGroup="SoNE Health Medical Group, PLLC",e.SuffieldMedicalAssociates="Suffield Medical Associates",e.WarrenPediatrics="Warren Pediatrics, LLC",e.WinstedInternalMedicine="Winsted Internal Medicine Associates",e.YounusMasih="Younus Masih, MD",e.Other="Other",e}({});let X="referralProgram",V=Object.values(H),z=e=>{let{options:t=V,isRequired:a,isDisabled:r,defaultSelectedItem:n,placeholder:s}=e,{watch:l,control:c}=(0,_.xW)(),[u,m]=(0,d.useState)(""),g=u?t.filter(e=>e.toLowerCase().includes(u.toLowerCase())):t;return(0,i.jsxs)(o.Flex,{direction:"column",gap:"spacer-2",children:[(0,i.jsxs)(o.Box,{children:[(0,i.jsx)(o.Text,{as:"label",variant:"text-body-large-bold",color:"text-primary-negative",htmlFor:X,children:"Were you referred to FlyteHealth?"}),(0,i.jsx)(o.Text,{variant:"text-body-meta-regular",color:"text-secondary",children:"If yes, select the healthcare organization, clinic, or provider."})]}),(0,i.jsx)(_.xI,{control:c,name:X,rules:{required:a},render:e=>{let{field:{onChange:t,onBlur:a}}=e;return(0,i.jsxs)(o.Autocomplete,{id:"".concat(X,"-autocomplete"),items:g,onInputValueChange:e=>{let{inputValue:a}=e;m(a||""),a||t(a)},onSelectedItemChange:e=>{let{selectedItem:a}=e;return t(a)},initialSelectedItem:n,selectedItem:l(X)||"",children:[(0,i.jsx)(o.Autocomplete.Input,{"data-test":X,id:X,size:"l",placeholder:s,clearButtonMode:r?"never":"has-value",leadingIcon:(0,i.jsx)(o.IconSearch,{}),variant:"flushed",isDisabled:r,onBlur:a}),(0,i.jsx)(o.Autocomplete.List,{"data-test":"".concat(X,"List"),zIndex:2,renderItem:e=>(0,i.jsx)(o.Text,{variant:"text-body-regular",children:e}),overflowY:"auto",maxHeight:"13.5rem"})]})}})]})},W=[m.yj.California,m.yj.Connecticut,m.yj.Massachusetts,m.yj["New York"],m.yj["Rhode Island"],m.yj["New Hampshire"],m.yj.Vermont],q=[m.yj.California,m.yj.Colorado,m.yj.Oregon,m.yj.Georgia,m.yj.Hawaii,m.yj.Maryland,m.yj.Virginia,m.yj.Washington,m.yj["Washington D.C."]],Y=e=>q.includes(e)?[H.KaiserPermanente]:Object.values(H).filter(e=>e!==H.KaiserPermanente&&e!==H.Other&&e!==H.NotReferred),K=e=>{let{configuration:t,loading:a=!1,onSubmit:r,defaultValues:n}=e,{contentResources:s,fields:l}=t,c=(0,_.mN)({mode:"onBlur",defaultValues:n,shouldUnregister:!1}),u=(0,d.useRef)(null==n?void 0:n.state),m=(0,d.useRef)(null==n?void 0:n.referralProgram),{watch:g}=c,p=(0,N.a)(),h=g(O.b),b=g(X),C=h&&(W.includes(h)||q.includes(h)),x=!h||a||!C,f=h&&!C?"There are no organizations or clinics in your state":"Select referral location",y=!!b,D=!h||a||C&&!y,v=C&&!y,I="Not referred"===b||""===b?l.howDidYouFindUs.options.notReferrerOptions:l.howDidYouFindUs.options.referrerOptions;(0,d.useEffect)(()=>{b!==m.current&&(c.resetField(F.l,{defaultValue:""}),m.current=b)},[b,c]),(0,d.useEffect)(()=>{h!==u.current&&(c.resetField(X,{defaultValue:""}),c.resetField(F.l,{defaultValue:""}),u.current=h)},[h,c]);let E=()=>(0,i.jsx)(o.Button,{type:"submit",size:{base:"m",lg:"l"},isDisabled:!c.formState.isValid,width:"100%",isLoading:a,trailingIcon:(0,i.jsx)(o.IconArrowRight,{}),"aria-label":"Continue",children:"Continue"});return(0,i.jsx)(_.Op,{...c,children:(0,i.jsxs)(U.X,{as:"form",onSubmit:c.handleSubmit(r),noValidate:!0,children:[(0,i.jsx)(U.X.Side,{gap:0,flex:{base:"none",lg:1},children:s.title}),(0,i.jsxs)(U.X.Form,{children:[(0,i.jsx)(T.d5,{isDisabled:a}),(0,i.jsx)(T.LP,{inputProps:{isDisabled:a}}),(0,i.jsxs)(o.Flex,{direction:{base:"column",lg:"row"},gap:"spacer-9",children:[(0,i.jsx)(B.PV,{isDisabled:a,flex:1}),(null==l?void 0:l.state)&&(0,i.jsx)(O.X,{isDisabled:a,flex:1,options:l.state.options})]}),(0,i.jsx)(z,{isDisabled:x,isRequired:v,placeholder:f,options:Y(h)}),(0,i.jsx)(F.h,{isDisabled:D,options:I}),(0,i.jsx)(B.Ci,{isDisabled:a,pb:{base:"spacer-24",lg:0}}),p?(0,i.jsx)(T.cI,{children:E()}):E()]})]})})};var G=a(11969),Q=a(10758),J=a(85007),$=a(20411),Z=a(31346),ee=a(38360),et=a(77944),ea=a(12342);let ei=e=>{let t={bariatricSurgery:2200,diabetes:2199,comorbidities:2201};return{answers:{[t.bariatricSurgery]:{order:1,answer:e.bariatricSurgery},[t.diabetes]:{order:2,answer:e.diabetes},[t.comorbidities]:{order:3,answer:e.comorbidities}},status:"completed",percentage:100,patientId:e.patientId,slug:"screener-questionnaire"}},er=async e=>{let t=ei(e);return await ea.A.post("/api/hra-questionnaire",t)};var en=a(47353),eo=a(83928),es=a(33841),el=a(13751),ec=a(92323),ed=a(86687),eu=a(89225),em=a(97793),eg=a(68792),ep=a(65159),eh=a(39777),eb=a(45352),eC=a(99221);let ex=e=>e===H.KaiserPermanente?m.PM["Kaiser Permanente"]:m.PM["SoNE Health"],ef=(e,t)=>{if(e===H.KaiserPermanente)return t},ey=(e,t)=>{switch(e){case m.lk["1199SEIU"]:return!0;case m.lk.Aetna:case m.lk.Cigna:return[m.yj["New York"],m.yj["New Jersey"],m.yj.Connecticut].includes(t);case m.lk.BCBS:case m.lk.United:return t===m.yj["New York"];case m.lk.BCBSPPO:case m.lk.Other:case m.lk["Kaiser Colorado"]:case m.lk["Kaiser Georgia"]:case m.lk["Kaiser Hawaii"]:case m.lk["Kaiser MidAtlantic"]:case m.lk["Kaiser Northern California"]:case m.lk["Kaiser Northwest"]:case m.lk["Kaiser Southern California"]:case m.lk["Kaiser Washington"]:case m.lk["Kaiser Washington Options"]:default:return!1}},eD=e=>{let{bmi:t,comorbidity:a,insurance:i,insuranceCoverage:r,state:n}=e;return(!(t>=27)||!(t<=30)||a!==eC.Y9.Yes)&&r!==m.RS.SelfPay&&ey(i,n)},ev=e=>{let{insuranceCoverage:t,insurance:a,state:i}=e;return t===m.RS.SelfPay?m.hT.CashPay:ey(a,i)?void 0:m.hT.Insurance},eI=e=>{let{bmi:t,comorbidity:a,insuranceCoverage:i,insurance:r,state:n}=e;if(!eD({bmi:t,comorbidity:a,insurance:r,insuranceCoverage:i,state:n}))return m.XN.EligibleWaiting},eE=e=>{let{insurance:t,insuranceCoverage:a}=e;return a===m.RS.SelfPay?m.lk.SelfPay:t};var eS=function(e){return e.CreateLead="createLead",e.CreateContact="createContact",e.UpdateContact="updateContact",e.CheckBenefits="checkBenefits",e.DetermineBenefitsOrLead="determineBenefitsOrLead",e.DetermineContactOrLead="determineContactOrLead",e.FetchConsents="fetchConsents",e.UpdateEmail="updateEmail",e.SubmitHRA="submitHRA",e}(eS||{});let ew={...em.f,...eS},eP=eu.Ek[es.fz.Flyte],ej={formData:{birthdate:"",comorbidity:"",currentWeightInPounds:"",dateOfHighestWeightValue:"",email:"",firstName:"",heightInFoot:"",heightInInch:"",highestWeightInPounds:"",insuranceCoverage:void 0,insuranceMemberID:"",insuranceOther:void 0,insurance:void 0,lastName:"",phone:"",state:void 0,termsAgreement:!1,howDidYouFindUS:"",referralProgram:void 0,comorbidities:[],diabetes:"",bariatricSurgery:""},bmi:void 0,benefitsCheck:void 0,otpData:void 0,consentsData:{items:[],userConsentStatus:[]},contactData:{},passwordData:{password:void 0,confirmPassword:void 0},flyteUserData:void 0,error:void 0},eA={...el.AU,...el.gQ,...el.pE,...el.UH,...el.yF,...el.n6,...el.uN,...el.yS,...el.RW,...(0,el.rS)(ej)},eL=(0,ep.mj)({types:{},guards:{isPreEligibilityMet:e=>{let{context:{formData:t,bmi:a}}=e;return eg.J0.flyte({bmi:a,comorbidity:t.comorbidity})},isApplicationReviewRequired:e=>{let{context:{formData:t,bmi:a}}=e;return!eo.A.shouldBypassIsApplicationReviewRequired({email:t.email})&&!eD({bmi:a,comorbidity:t.comorbidity,insuranceCoverage:t.insuranceCoverage,insurance:t.insurance,state:t.state})},isApplicationDetected:ed.L,isInsurerSelected:e=>{let{context:{formData:t}}=e;return!!t.insurance&&t.insurance!==es.lk.Other},isAthenaRecordCreated:ec.z},actions:eA}).createMachine({context:()=>ej,id:"flyteMachine",initial:ew.PreEligibility,states:{[ew.PreEligibility]:{id:ew.PreEligibility,initial:ew.Idle,states:{[ew.Idle]:{on:{SUBMIT:{target:ew.Submitting,actions:"updateFormData"}}},[ew.Submitting]:{entry:"assignBMI",always:[{guard:"isPreEligibilityMet",target:"#".concat(ew.ContactDetails)},{target:"#".concat(ew.EligibilityUnmet)}]}}},[ew.ContactDetails]:{id:ew.ContactDetails,initial:ew.Idle,states:{[ew.Idle]:{on:{SUBMIT:{target:"#".concat(ew.InsuranceDetails),actions:"updateFormData"}}}}},[ew.InsuranceDetails]:{id:ew.InsuranceDetails,initial:ew.Idle,states:{[ew.Idle]:{on:{BACK:{target:"#".concat(ew.ContactDetails)},SUBMIT:{target:"#".concat(ew.InsuranceDetailsReview),actions:"updateFormData"}}}}},[ew.InsuranceDetailsReview]:{id:ew.InsuranceDetailsReview,initial:ew.Idle,states:{[ew.Idle]:{on:{SUBMIT:{actions:"updateFormData",target:ew.Submitting}}},[ew.Submitting]:{initial:ew.DetermineBenefitsOrLead,states:{[ew.DetermineBenefitsOrLead]:{id:ew.DetermineBenefitsOrLead,always:[{guard:"isInsurerSelected",target:ew.CheckBenefits},{target:ew.CreateLead}]},[ew.CheckBenefits]:{id:ew.CheckBenefits,invoke:{src:(0,eh.Sx)(async e=>{let{input:t}=e,a={...t,payerCode:eu.dT[t.insurance]};return await (0,$.R)(a)}),input:e=>{let{context:{formData:t}}=e;return t},onDone:{actions:(0,eb.a)({benefitsCheck:e=>{let{event:t}=e;return t.output.data}}),target:ew.DetermineContactOrLead},onError:ew.DetermineContactOrLead}},[ew.DetermineContactOrLead]:{id:ew.DetermineContactOrLead,always:[{guard:"isApplicationReviewRequired",target:ew.CreateLead},{target:ew.CreateContact}]},[ew.CreateContact]:{id:ew.CreateContact,invoke:{src:(0,eh.Sx)(async e=>{let{input:t}=e,a={...t.formData,referralProgram:t.formData.referralProgram,...t.benefitsCheck&&{benefitsCheck:t.benefitsCheck},company:eP,insurance:eE({insuranceCoverage:t.formData.insuranceCoverage,insurance:t.formData.insurance}),evolveOrganization:ex(t.formData.referralProgram),participantDepartmentorOrg:ef(t.formData.referralProgram,t.formData.insurance),accountId:eu.f3[es.fz.Flyte]};return await (0,ee.vY)(a)}),input:e=>{let{context:t}=e;return t},onDone:{actions:"assignContactData",target:"#".concat(ew.EmailVerification)},onError:[{guard:"isApplicationDetected",target:"#".concat(ew.ApplicationDetected)},{target:"#".concat(ew.InsuranceDetailsReview,".").concat(ew.Error)}]}},[ew.CreateLead]:{id:ew.CreateLead,invoke:{src:(0,eh.Sx)(async e=>{let{input:t}=e,a={...t.formData,referralProgram:t.formData.referralProgram,...t.benefitsCheck&&{benefitsCheck:t.benefitsCheck},company:eP,insurance:eE({insuranceCoverage:t.formData.insuranceCoverage,insurance:t.formData.insurance}),evolveOrganization:ex(t.formData.referralProgram),ineligibilityReason:ev({insuranceCoverage:t.formData.insuranceCoverage,insurance:t.formData.insurance,state:t.formData.state}),leadStatus:eI({bmi:t.bmi,comorbidity:t.formData.comorbidity,insuranceCoverage:t.formData.insuranceCoverage,insurance:t.formData.insurance,state:t.formData.state}),automateEvolveEnrollment:eD({bmi:t.bmi,comorbidity:t.formData.comorbidity,insuranceCoverage:t.formData.insuranceCoverage,insurance:t.formData.insurance,state:t.formData.state}),participantDepartmentorOrg:ef(t.formData.referralProgram,t.formData.insurance)};return await (0,en.t)(a)}),input:e=>{let{context:t}=e;return t},onDone:[{guard:"isApplicationReviewRequired",target:"#".concat(ew.ApplicationReview)},{target:"#".concat(ew.ApplicationComplete)}],onError:[{guard:"isApplicationDetected",target:"#".concat(ew.ApplicationDetected)},{target:"#".concat(ew.InsuranceDetailsReview,".").concat(ew.Error)}]}}}},[ew.Error]:{id:"".concat(ew.InsuranceDetailsReview,".").concat(ew.Error),on:{SUBMIT:{actions:["updateFormData","resetBenefitsCheck"],target:ew.Submitting}}}}},[ew.EmailVerification]:{id:ew.EmailVerification,initial:ew.Idle,states:{[ew.Idle]:{id:"".concat(ew.EmailVerification,".").concat(ew.Idle),on:{SUBMIT:{actions:"assignOtpCode",target:ew.Submitting},RESEND_EMAIL_VERIFICATION:{target:ew.Idle,reenter:!0},UPDATE_EMAIL:{target:ew.UpdateEmail}},invoke:{input:e=>{var t;let{context:a,event:i}=e;return{email:a.formData.email,firstName:a.formData.firstName,onSuccess:null==i||null==(t=i.data)?void 0:t.onSuccess}},src:(0,eh.Sx)(async e=>{let{input:t}=e,a={email:t.email,firstName:t.firstName};return{token:(await (0,Q.v)(a)).data.token,onSuccess:t.onSuccess}}),onDone:{actions:[(0,eb.a)({otpData:e=>{let{context:t,event:a}=e;return{...t.otpData,token:a.output.token}}}),e=>{var t;let{event:a}=e;(null==a||null==(t=a.output)?void 0:t.onSuccess)&&a.output.onSuccess()}]},onError:ew.Error}},[ew.Submitting]:{invoke:{src:(0,eh.Sx)(async e=>{let{input:t}=e,a={email:t.formData.email,token:t.otpData.token,otp:t.otpData.otp};return await (0,J.R)(a)}),input:e=>{let{context:t}=e;return t},onDone:"#".concat(ew.OnboardingChecklist),onError:ew.Error}},[ew.Error]:{on:{SUBMIT:{actions:"assignOtpCode",target:ew.Submitting},RESEND_EMAIL_VERIFICATION:{target:ew.Idle},UPDATE_EMAIL:{target:ew.UpdateEmail}}},[ew.UpdateEmail]:{initial:ew.Idle,states:{[ew.Idle]:{invoke:{input:e=>{let{context:t,event:a}=e;return{contactId:t.contactData.contactId,email:a.data.email,onSuccess:a.data.onSuccess}},src:(0,eh.Sx)(async e=>{let{input:t}=e,a={contactId:t.contactId,email:t.email};return await (0,ee.CI)(a),{email:t.email,onSuccess:t.onSuccess}}),onDone:{actions:["assignNewEmail",e=>{var t;let{event:a}=e;(null==a||null==(t=a.output)?void 0:t.onSuccess)&&a.output.onSuccess()}],target:"#".concat(ew.EmailVerification,".").concat(ew.Idle)},onError:ew.Error}},[ew.Error]:{on:{SUBMIT:{target:"#".concat(ew.EmailVerification,".").concat(ew.Idle)},RESEND_EMAIL_VERIFICATION:{target:"#".concat(ew.EmailVerification,".").concat(ew.Idle)},UPDATE_EMAIL:{target:ew.Idle}}}}}}},[ew.ReviewConsents]:{id:ew.ReviewConsents,initial:ew.FetchConsents,states:{[ew.Idle]:{on:{SUBMIT:{actions:["assignUserConsentStatus"],target:ew.Submitting}}},[ew.FetchConsents]:{invoke:{src:(0,eh.Sx)(async()=>await (0,Z.i)()),onDone:{actions:"assignConsents",target:ew.Idle},onError:ew.Error}},[ew.Submitting]:{invoke:{src:(0,eh.Sx)(async e=>{let{input:t}=e,a={patientIdentifier:t.contactData.contactId,firstName:t.formData.firstName,lastName:t.formData.lastName,phone:t.formData.phone,email:t.formData.email,birthDate:t.formData.birthdate,state:t.formData.state,heightInInch:t.formData.heightInInch,heightInFeet:t.formData.heightInFoot,currentWeightInPounds:t.formData.currentWeightInPounds,evolveOrganization:es.PM.Flyte,consents:t.consentsData.userConsentStatus};return await (0,et.Y)(a)}),input:e=>{let{context:t}=e;return t},onDone:[{actions:"assignFlyteUserData",target:ew.SubmitHRA}],onError:"#".concat(ew.OnboardingUserError)}},[ew.SubmitHRA]:{id:ew.SubmitHRA,invoke:{src:(0,eh.Sx)(async e=>{let{input:t}=e,a={bariatricSurgery:t.formData.bariatricSurgery,diabetes:t.formData.diabetes,comorbidities:t.formData.comorbidities,patientId:t.flyteUserData.patientId};return await er(a)}),input:e=>{let{context:t}=e;return t},onDone:{target:ew.UpdateContact},onError:{target:ew.UpdateContact}}},[ew.UpdateContact]:{invoke:{src:(0,eh.Sx)(async e=>{let{input:t}=e,a={contactId:t.contactData.contactId,evolvePatientID:t.flyteUserData.patientId};return await (0,ee.CI)(a)}),input:e=>{let{context:t}=e;return t},onDone:[{guard:"isAthenaRecordCreated",target:"#".concat(ew.CreatePassword)},{target:"#".concat(ew.OnboardingUserError)}],onError:"#".concat(ew.OnboardingUserError)}},[ew.Error]:{on:{SUBMIT:{actions:["assignUserConsentStatus"],target:ew.Submitting}}}}},[ew.CreatePassword]:{id:ew.CreatePassword,initial:ew.Idle,states:{[ew.Idle]:{on:{SUBMIT:{actions:"assignPasswordData",target:ew.Submitting}}},[ew.Submitting]:{invoke:{src:(0,eh.Sx)(async e=>{let{input:t}=e,a={email:t.formData.email,password:t.passwordData.password,confirmPassword:t.passwordData.confirmPassword};return await (0,G.I)(t.flyteUserData.verifyToken,a)}),input:e=>{let{context:t}=e;return t},onDone:"#".concat(ew.AppDownload),onError:{target:ew.Error,actions:"assignError"}}},[ew.Error]:{on:{SUBMIT:{actions:["resetError","assignPasswordData"],target:ew.Submitting}}}}},[ew.OnboardingChecklist]:{id:ew.OnboardingChecklist,on:{SUBMIT:{target:"#".concat(ew.ReviewConsents)}}},[ew.AppDownload]:{id:ew.AppDownload},[ew.ApplicationReview]:{id:ew.ApplicationReview},[ew.OnboardingUserError]:{id:ew.OnboardingUserError},[ew.ApplicationComplete]:{id:ew.ApplicationComplete},[ew.ApplicationDetected]:{id:ew.ApplicationDetected},[ew.EligibilityUnmet]:{id:ew.EligibilityUnmet,initial:ew.Idle,states:{[ew.Idle]:{on:{SUBMIT:{target:ew.Submitting,actions:"updateFormData"}}},[ew.Submitting]:{invoke:{src:(0,eh.Sx)(async e=>{let{input:t}=e,a={...t,company:eu.Ek[es.fz.Flyte],leadStatus:es.XN.Ineligible,ineligibilityReason:es.hT.BMI,automateEvolveEnrollment:!1};return await (0,en.t)(a)}),input:e=>{let{context:{formData:t}}=e;return t},onDone:ew.Success,onError:ew.Error}},[ew.Success]:{},[ew.Error]:{on:{SUBMIT:{target:ew.Submitting}}}}}},on:{RESET:{target:"#".concat(ew.PreEligibility),actions:"reset"}}});var eR=a(69443);let eM={[c.C.PreEligibility]:{title:(0,i.jsxs)(o.TextPairing,{variant:"textpairing-header-2XL",children:[(0,i.jsxs)(o.TextPairing.Label,{color:"text-secondary-negative",children:["We're so glad you're here!"," ",(0,i.jsx)(o.Text,{as:"span",variant:"text-header-2XL",color:"text-primary",children:"Let's make sure you're eligible for FlyteHealth."})]}),(0,i.jsx)(o.TextPairing.SubLabel,{color:"text-secondary",children:"You must meet specific age and Body Mass Index (BMI) requirements* to be eligible for the FlyteHealth program."})]}),bmiEnrollmentDisclaimer:(0,i.jsx)(o.Text,{variant:"text-body-meta-regular",color:"text-secondary",children:"*We acknowledge that Body Mass Index (BMI) is an imperfect way to screen for excess weight. FlyteHealth providers do not use BMI alone as a measure of overall health. Instead, BMI is used as a data point to see if someone is eligible to join the FlyteHealth program. Once someone joins the program, we'll ask each person more about their health to create a personalized treatment plan."})},[c.C.EligibilityUnmet]:{title:(0,i.jsxs)(o.TextPairing,{variant:"textpairing-header-2XL",children:[(0,i.jsx)(o.TextPairing.Label,{color:"text-secondary-negative",children:"Unfortunately, you are not eligible to join FlyteHealth at this time."}),(0,i.jsx)(o.TextPairing.SubLabel,{color:"text-secondary",children:"FlyteHealth requires a minimum BMI of 27+ (plus one or more weight-related health conditions) or a BMI of 30+"})]})},[c.C.ContactDetails]:{title:(0,i.jsxs)(o.TextPairing,{variant:"textpairing-header-2XL",children:[(0,i.jsx)(o.TextPairing.Label,{color:"text-secondary-negative",children:"Congratulations! You're eligible for the FlyteHealth program"}),(0,i.jsx)(o.TextPairing.SubLabel,{color:"text-secondary",children:"Tell us a little more about yourself."})]})},[c.C.InsuranceDetails]:{title:(0,i.jsxs)(o.Text,{variant:"text-header-2XL",color:"text-secondary-negative",children:["One more thing:"," ",(0,i.jsx)(o.Text,{as:"span",variant:"text-header-2XL",color:"text-primary",children:"Do you have health insurance?"})]})},[c.C.InsuranceDetailsReview]:{title:(0,i.jsxs)(o.TextPairing,{variant:"textpairing-header-2XL",children:[(0,i.jsx)(o.TextPairing.Label,{children:"Let's review: Is your info correct?"}),(0,i.jsx)(o.TextPairing.SubLabel,{color:"text-secondary",children:"Please double-check the information you provided to make sure everything is correct."})]})},[c.C.ApplicationComplete]:{title:(0,i.jsxs)(o.TextPairing,{variant:"textpairing-header-2XL",children:[(0,i.jsx)(o.TextPairing.Label,{color:"text-secondary-negative",children:"Welcome aboard! We're so excited you're here."}),(0,i.jsx)(o.TextPairing.SubLabel,{color:"text-secondary",children:"Next, we need to confirm your email. Click the link we sent to:"})]}),description:(0,i.jsx)(o.Text,{mt:"spacer-8",color:"text-secondary",variant:"text-body-regular",children:"Can’t find the email? Make sure to check your Spam folder."})},[c.C.ApplicationReview]:{title:(0,i.jsxs)(o.TextPairing,{variant:"textpairing-header-2XL",children:[(0,i.jsx)(o.TextPairing.Label,{color:"text-primary",children:"You're almost finished!"}),(0,i.jsx)(o.TextPairing.SubLabel,{color:"text-secondary",children:"We've received your application, but we need a little more information from you to move forward. Please call us to complete the application process."})]})},[c.C.ApplicationDetected]:{title:(0,i.jsx)(o.Text,{variant:"text-header-2XL",color:"text-primary",children:"We found an existing account for:"}),description:(0,i.jsx)(o.Text,{variant:"text-body-display-S",color:"text-secondary",children:"It looks like you already have an account with us. To continue or update your registration details, please contact our Care Coordinator team."})},[c.C.EmailVerification]:eR.M[c.C.EmailVerification],[c.C.OnboardingChecklist]:eR.M[c.C.OnboardingChecklist],[c.C.CreatePassword]:eR.M[c.C.CreatePassword],[c.C.AppDownload]:eR.M[c.C.AppDownload],[c.C.ReviewConsents]:eR.M[c.C.ReviewConsents]},ek=[m.lk["1199SEIU"],m.lk.Aetna,m.lk.BCBS,m.lk.BCBSPPO,m.lk.Cigna,m.lk["Kaiser Colorado"],m.lk["Kaiser Georgia"],m.lk["Kaiser Hawaii"],m.lk["Kaiser MidAtlantic"],m.lk["Kaiser Northern California"],m.lk["Kaiser Northwest"],m.lk["Kaiser Southern California"],m.lk["Kaiser Washington"],m.lk["Kaiser Washington Options"],m.lk.United,m.lk.Other],eT=[m.UX.Brochure,m.UX.Email,m.UX.Mailer,m.UX.OnsiteMonitor,m.UX.Poster,m.UX.ProviderReferral,m.UX.Other],eU=[m.UX.Brochure,m.UX.CoworkerReferral,m.UX.Email,m.UX.GoogleAd,m.UX.Poster,m.UX.PrintAd,m.UX.ProviderReferral,m.UX.SocialMedia,m.UX.TradeShow,m.UX.TVAd,m.UX.WebSearch,m.UX.WordOfMouth,m.UX.Other],eB={[c.C.ContactDetails]:{state:{options:T.rI},howDidYouFindUs:{options:{referrerOptions:eT,notReferrerOptions:eU}}},[c.C.InsuranceDetails]:{insuranceCoverage:{},insurance:{label:"Insurance Company",insuranceCarriers:ek},insuranceOther:{description:(0,i.jsx)(o.Text,{variant:"text-body-meta-regular",color:"text-secondary",children:"Enter the name of your insurance company"})},insuranceMemberID:{}},[c.C.InsuranceDetailsReview]:{insurance:{label:"Insurance Company",insuranceCarriers:ek}}},eF=m.fz.Flyte,eO=e=>{let{render:t}=e,[a,r]=(0,h.zl)(eL),n=(0,d.useMemo)(()=>(0,p.r)(a.value),[a.value]);(0,k.t)(n,eF);let o=(0,d.useCallback)(e=>{r({type:"SUBMIT",data:e})},[r]),s=(0,d.useCallback)(()=>{r({type:"BACK"})},[r]),l=(0,d.useCallback)(()=>{switch(n){case ew.PreEligibility:return(0,i.jsx)(R.P,{configuration:{contentResources:eM[c.C.PreEligibility]},onSubmit:o});case ew.ContactDetails:return(0,i.jsx)(K,{configuration:{contentResources:eM[c.C.ContactDetails],fields:eB[c.C.ContactDetails]},onSubmit:o,defaultValues:a.context.formData});case ew.EligibilityUnmet:return(0,i.jsx)(S.B,{configuration:{contentResources:eM[c.C.EligibilityUnmet]},onSubmit:o,loading:a.matches({[ew.EligibilityUnmet]:ew.Submitting}),isEmailSent:a.matches({[ew.EligibilityUnmet]:ew.Success}),hasError:a.matches({[ew.EligibilityUnmet]:ew.Error})});case ew.InsuranceDetails:return(0,i.jsx)(P.d,{configuration:{contentResources:eM[c.C.InsuranceDetails],fields:eB[c.C.InsuranceDetails]},onSubmit:o,onBack:s});case ew.InsuranceDetailsReview:return(0,i.jsx)(j.h,{configuration:{contentResources:eM[c.C.InsuranceDetailsReview],fields:eB[c.C.InsuranceDetailsReview]},onSubmit:o,loading:a.matches({[ew.InsuranceDetailsReview]:ew.Submitting}),hasError:a.matches({[ew.InsuranceDetailsReview]:ew.Error}),defaultValues:a.context.formData});case ew.ApplicationComplete:return(0,i.jsx)(y.Q,{...eM[c.C.ApplicationComplete],email:a.context.formData.email});case ew.ApplicationReview:return(0,i.jsx)(v.l,{...eM[c.C.ApplicationReview]});case ew.ApplicationDetected:return(0,i.jsx)(D.r,{...eM[c.C.ApplicationDetected],email:a.context.formData.email});case ew.EmailVerification:return(0,i.jsx)(w.e,{configuration:{contentResources:{title:eM[c.C.EmailVerification](a.context.formData.email).title}},email:a.context.formData.email,hasError:a.matches({[ew.EmailVerification]:ew.Error}),loading:a.matches({[ew.EmailVerification]:ew.Submitting}),isUpdateEmailLoading:a.matches({[ew.EmailVerification]:{[ew.UpdateEmail]:ew.Idle}}),hasUpdateEmailError:a.matches({[ew.EmailVerification]:{[ew.UpdateEmail]:ew.Error}}),onSubmit:o,onResendCode:e=>r({type:"RESEND_EMAIL_VERIFICATION",data:{onSuccess:e}}),onEditEmail:(e,t)=>r({type:"UPDATE_EMAIL",data:{email:e,onSuccess:t}})});case ew.OnboardingChecklist:return(0,i.jsx)(A.E,{configuration:{contentResources:eM[c.C.OnboardingChecklist]},onSubmit:o});case ew.ReviewConsents:return(0,i.jsx)(M.U,{configuration:{contentResources:eM[c.C.ReviewConsents]},consents:a.context.consentsData.items,hasError:a.matches({[ew.ReviewConsents]:ew.Error}),loading:a.matches({[ew.ReviewConsents]:ew.FetchConsents})||a.matches({[ew.ReviewConsents]:ew.Submitting})||a.matches({[ew.ReviewConsents]:ew.UpdateContact})||a.matches({[ew.ReviewConsents]:ew.SubmitHRA}),onSubmit:o});case ew.CreatePassword:return(0,i.jsx)(E.i,{configuration:{contentResources:eM[c.C.CreatePassword]},loading:a.matches({[ew.CreatePassword]:ew.Submitting}),error:a.context.error,onSubmit:o});case ew.AppDownload:return(0,i.jsx)(f.a,{title:eM[c.C.AppDownload].title,checklist:eM[c.C.AppDownload].checklist});case ew.OnboardingUserError:return(0,i.jsx)(L.C,{});default:return null}},[n,a]);return t({header:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(u.E,{partner:eF}),(0,i.jsx)(I.f,{currentStep:n})]}),body:l(),currentWorkFlowStep:n})};var eN=a(96079),e_=a(32246),eH=a(53310),eX=a(47811),eV=a(56931),ez=a(20058);let eW={[m.fz.CareCompass]:{asset:{src:u.k[m.fz.CareCompass],width:"64px",height:"64px",alt:"Care Compass Logo"},name:"Care Compass",description:"State of Connecticut Health Plan Members"},[m.fz.Aetna]:{asset:{src:u.k[m.fz.Aetna],width:"141px",height:"32px",alt:"Aetna Logo"},name:"State of Connecticut: Aetna",description:"Aetna MA for State of Connecticut Retirees"},[m.fz.PequotHealthCare]:{asset:{src:u.k[m.fz.PequotHealthCare],width:"103px",height:"40px",alt:"Pequot Health Care Logo"},name:"Mashantucket Pequot Tribal Nation",description:"Pequot Healthy Weight Program"},[m.fz.RiverSpringLiving]:{asset:{src:u.k[m.fz.RiverSpringLiving],width:"158px",height:"24px",alt:"RiverSpring Living Logo"},name:"RiverSpring Living Employee Program",description:"Employees at The Hebrew Home at Riverdale by RiverSpring Living"},[m.fz.PyleFamilyInsurance]:{asset:{src:u.k[m.fz.PyleFamilyInsurance],width:"157px",height:"48px",alt:"Pyle Family Insurance Logo"},name:"A. Duie Pyle",description:"Pyle Weight Management Program for Employees"},[m.fz.MDSave]:{asset:{src:u.k[m.fz.MDSave],width:"56px",height:"56px",alt:"MDsave Logo"},name:"MDsave",description:"Patients in partnership with MDsave"},[m.fz["1199SEIU"]]:{asset:{src:u.k[m.fz["1199SEIU"]],width:"211px",height:"122px",alt:"1199SEIU Logo"},name:"1199SEIU",description:"1199SEIU"}},eq=e=>(0,i.jsx)(o.Flex,{direction:"column",gap:"spacer-2",alignItems:"center",cursor:"pointer",role:"group",tabIndex:0,outline:"none",as:"button",onKeyDown:t=>{"Enter"===t.key&&e.onClick()},...e});eq.Image=e=>(0,i.jsx)(o.Image,{flex:1,objectFit:"contain",...e}),eq.Description=e=>(0,i.jsx)(o.Text,{variant:"text-body-floating-label-regular",color:"text-secondary",textAlign:"center",...e}),eq.Title=e=>(0,i.jsx)(o.Text,{color:"text-secondary",variant:"text-body-meta-medium",transition:"color 100ms linear",_groupHover:{color:"text-link-primary-hover"},_groupActive:{color:"text-link-primary-pressed"},_groupFocusVisible:{color:"text-link-primary-default"},...e}),eq.Frame=e=>(0,i.jsx)(o.Flex,{px:"spacer-3",pb:"spacer-5",borderRadius:"radii-1",borderWidth:"1px",borderStyle:"solid",borderColor:"ui-element-outline-active",transition:"background-color 100ms linear, border-color 100ms linear",_groupFocusVisible:{outlineWidth:"3px",outlineStyle:"solid",outlineColor:"primary-focus"},_groupHover:{borderColor:"primary-hover",backgroundColor:"background-action-hover"},_groupActive:{borderColor:"primary-pressed",backgroundColor:"background-action-pressed"},direction:"column",alignItems:"center",minHeight:"160px",width:"100%",...e});let eY=e=>{let{onSelectWorkflow:t}=e,{track:a}=(0,n.useAnalytics)(),r=e=>()=>(a("".concat(e,"_selected"),{partner:e}),t(e)),s=Object.entries(eW);return(0,i.jsxs)(U.s,{direction:"column",gap:"spacer-9",children:[(0,i.jsx)(o.Flex,{direction:"column",gap:"spacer-2",children:(0,i.jsxs)(o.Text,{variant:"text-header-XL",color:"text-secondary-negative",children:["Welcome!"," ",(0,i.jsxs)(o.Text,{as:"span",variant:"text-header-XL",color:"text-primary",children:["To get started, please select your benefit program."," "]})]})}),(0,i.jsxs)(o.Flex,{direction:"column",gap:{base:"spacer-9"},children:[(0,i.jsx)(o.Flex,{direction:"column",gap:"spacer-4",flex:1}),(0,i.jsxs)(o.Flex,{direction:"column",gap:"spacer-4",pb:{base:"spacer-9",md:"spacer-6"},flex:1,children:[(0,i.jsx)(o.Flex,{direction:{base:"column",md:"row"},gap:{base:"spacer-6",md:"spacer-3"},justifyContent:{md:"space-between"},alignItems:{md:"end"},children:(0,i.jsxs)(o.Flex,{gap:"spacer-3",alignItems:"center",flex:1,children:[(0,i.jsx)(o.IconArrowRight,{color:"primary-default",size:"l"}),(0,i.jsx)(o.Text,{variant:"text-body-large-medium",color:"text-primary",children:"Available Programs:"})]})}),(0,i.jsxs)(o.Grid,{spacingX:"spacer-4",spacingY:{base:"spacer-4",lg:"spacer-6"},columns:{base:2,md:3,lg:4,xxl:5},children:[s.map(e=>{let[t,{asset:a,description:n,name:o}]=e;return(0,i.jsxs)(eq,{onClick:r(t),children:[(0,i.jsxs)(eq.Frame,{children:[(0,i.jsx)(eq.Image,{...a}),(0,i.jsx)(eq.Description,{children:n})]}),(0,i.jsx)(eq.Title,{children:o})]},t)}),(0,i.jsxs)(eq,{"aria-label":"Provider Referral",onClick:r(m.fz.Flyte),maxWidth:"16rem",children:[(0,i.jsx)(eq.Frame,{p:0,width:"100%",minHeight:{base:"7.5rem",md:"10rem"},children:(0,i.jsx)(eq.Image,{src:u.k[m.fz.KaiserPermanente],width:"123px",height:"40px",alt:"Kaiser Permanente Logo"})}),(0,i.jsx)(eq.Title,{children:"Provider Referral"})]}),(0,i.jsxs)(eq,{onClick:r(m.fz.Flyte),maxWidth:"16rem",children:[(0,i.jsx)(eq.Frame,{p:0,width:"100%",minHeight:{base:"7.5rem",md:"10rem"},children:(0,i.jsx)(eq.Image,{src:u.k[m.fz.Sone],width:"123px",height:"40px",alt:"Sone Logo"})}),(0,i.jsx)(eq.Title,{children:"Provider Referral"})]})]})]})]}),(0,i.jsxs)(o.Flex,{direction:"column",gap:"spacer-1",children:[(0,i.jsx)(o.Text,{color:"text-secondary",variant:"text-body-bold",children:"Need some help?"}),(0,i.jsxs)(o.Text,{color:"text-secondary",variant:"text-body-regular",children:["Please call"," ",(0,i.jsx)(ez.C,{})," ","to speak with a Care Coordinator."]})]})]})},eK={WorkflowSelector:"workflowSelector",...es.fz},eG=(0,ep.mj)({types:{},guards:{isCareCompassSelected:e=>{let{event:t}=e;return t.data.workflow===es.fz.CareCompass},isAetnaSelected:e=>{let{event:t}=e;return t.data.workflow===es.fz.Aetna},isRiverspringSelected:e=>{let{event:t}=e;return t.data.workflow===es.fz.RiverSpringLiving},isPequotSelected:e=>{let{event:t}=e;return t.data.workflow===es.fz.PequotHealthCare},isPyleSelected:e=>{let{event:t}=e;return t.data.workflow===es.fz.PyleFamilyInsurance},isMDSaveSelected:e=>{let{event:t}=e;return t.data.workflow===es.fz.MDSave},isChristianaCareSelected:e=>{let{event:t}=e;return t.data.workflow===es.fz.ChristianaCare},is1199SEIUSelected:e=>{let{event:t}=e;return t.data.workflow===es.fz["1199SEIU"]}}}).createMachine({id:"workflowManagerMachine",initial:eK.WorkflowSelector,states:{[eK.WorkflowSelector]:{id:eK.WorkflowSelector,on:{SUBMIT:[{guard:"isCareCompassSelected",target:eK.CareCompass},{guard:"isAetnaSelected",target:eK.Aetna},{guard:"isRiverspringSelected",target:eK.RiverSpringLiving},{guard:"isPequotSelected",target:eK.PequotHealthCare},{guard:"isPyleSelected",target:eK.PyleFamilyInsurance},{guard:"isMDSaveSelected",target:eK.MDSave},{guard:"isChristianaCareSelected",target:eK.ChristianaCare},{guard:"is1199SEIUSelected",target:eK["1199SEIU"]},{target:eK.Flyte}]}},[eK.PequotHealthCare]:{},[eK.RiverSpringLiving]:{},[eK.CareCompass]:{},[eK.Aetna]:{},[eK.Flyte]:{},[eK.PyleFamilyInsurance]:{},[eK.MDSave]:{},[eK.ChristianaCare]:{},[eK["1199SEIU"]]:{}}}),eQ=e=>{let{render:t}=e,[a,r]=(0,h.zl)(eG),n=(0,d.useMemo)(()=>(0,p.r)(a.value),[a.value]),s=(0,d.useCallback)(e=>{r({type:"SUBMIT",data:{workflow:e}})},[r]);return(0,d.useCallback)(()=>{switch(n){case eK.WorkflowSelector:return t({header:(0,i.jsx)(u.E,{partner:m.fz.Flyte}),body:(0,i.jsx)(eY,{onSelectWorkflow:s}),currentWorkFlowStep:n});case eK.Aetna:return(0,i.jsx)(o.ComposerProvider,{theme:g.w4.aetna,children:(0,i.jsx)(b.j,{render:t})});case eK.CareCompass:return(0,i.jsx)(o.ComposerProvider,{theme:g.w4.careCompass,children:(0,i.jsx)(C.Z,{render:t})});case eK.RiverSpringLiving:return(0,i.jsx)(o.ComposerProvider,{theme:g.w4.riverspring,children:(0,i.jsx)(eX.D,{render:t})});case eK.PequotHealthCare:return(0,i.jsx)(o.ComposerProvider,{theme:g.w4.pequot,children:(0,i.jsx)(e_.K,{render:t})});case eK.PyleFamilyInsurance:return(0,i.jsx)(o.ComposerProvider,{theme:g.w4.pyle,children:(0,i.jsx)(eH.A,{render:t})});case eK.MDSave:return(0,i.jsx)(o.ComposerProvider,{theme:g.w4.standard,children:(0,i.jsx)(eN.Y,{render:t})});case eK.ChristianaCare:return(0,i.jsx)(o.ComposerProvider,{theme:g.w4.standard,children:(0,i.jsx)(x.z,{render:t})});case eK["1199SEIU"]:return(0,i.jsx)(o.ComposerProvider,{theme:g.w4.standard,children:(0,i.jsx)(eV.A,{render:t})});case eK.Flyte:default:return(0,i.jsx)(eO,{render:t})}},[n])()},eJ=e=>{let{size:t="l",children:a="Get Started",...u}=e,[m,g]=(0,d.useState)(!1),[p,h]=(0,d.useState)(!1),{track:b}=(0,n.useAnalytics)(),C=(0,d.useCallback)(()=>{h(!1),g(!1),b(r.A.closeWorkflowEvent)},[]),x=(0,d.useCallback)(()=>h(e=>!e),[]),f=(0,d.useCallback)(e=>{[c.C.ApplicationReview,c.C.ApplicationComplete,c.C.ApplicationDetected,c.C.EligibilityUnmet,c.C.AppDownload].includes(e)?g(!1):(b(r.A.closeWorkflowConfirmationEvent),x())},[]),y=(0,d.useCallback)(()=>{b(r.A.abortCloseWorkflow),x()},[x]),D=(0,d.useCallback)(()=>{b(r.A.openPartnerSelectorEvent),g(!0)},[b,g]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(o.Button,{onClick:D,trailingIcon:(0,i.jsx)(o.IconArrowRight,{}),size:t,children:a,"data-test":"flyteSignUpLauncher",...u}),m&&(0,i.jsx)(eQ,{render:e=>{let{header:t,body:a,currentWorkFlowStep:r}=e;return(0,i.jsxs)(s.fq,{isOpen:!0,onClose:()=>f(r),children:[(0,i.jsx)(s.fq.Header,{children:t}),(0,i.jsx)(s.fq.Body,{children:a},r)]})}}),(0,i.jsx)(l.t,{isOpen:p,onContinue:y,onLeave:C})]})}},96079:(e,t,a)=>{a.d(t,{Y:()=>N});var i=a(37876),r=a(37477),n=a(48934),o=a(14901),s=a(16741),l=a(533),c=a(6770),d=a(63583),u=a(86535),m=a(93511),g=a(34305),p=a(80072),h=a(97793),b=a(66885),C=a(62227),x=a(14232),f=a(47353),y=a(33841),D=a(86687),v=a(89225),I=a(68792),E=a(65159),S=a(45352),w=a(39777),P=function(e){return e.CreateLead="createLead",e}(P||{});let j={...h.f,...P},A=v.Ek[y.fz.MDSave],L={formData:{birthdate:"",comorbidity:"",currentWeightInPounds:"",dateOfHighestWeightValue:"",email:"",firstName:"",heightInFoot:"",heightInInch:"",highestWeightInPounds:"",insuranceCoverage:void 0,insuranceMemberID:"",insurance:void 0,lastName:"",phone:"",state:void 0,termsAgreement:!1,howDidYouFindUS:"",comorbidities:[],diabetes:"",bariatricSurgery:""},bmi:void 0},R=(0,E.mj)({types:{},guards:{isPreEligibilityMet:e=>{let{context:{bmi:t,formData:a}}=e;return I.J0.mdSave({bmi:t,comorbidity:a.comorbidity})},isApplicationDetected:D.L},actions:{updateFormData:(0,S.a)({formData:e=>{let{context:t,event:a}=e;return{...t.formData,...a.data}}}),assignBMI:(0,S.a)({bmi:e=>{let{context:t}=e,{heightInFoot:a,heightInInch:i,highestWeightInPounds:r}=t.formData;return(0,I.Hv)({heightFeet:(0,I.sC)(a),heightInches:(0,I.sC)(i),weightPounds:(0,I.sC)(r)})}}),reset:(0,S.a)({...L})}}).createMachine({context:()=>L,id:"mdSaveMachine",initial:j.PreEligibility,states:{[j.PreEligibility]:{id:j.PreEligibility,initial:j.Idle,states:{[j.Idle]:{on:{SUBMIT:{target:j.Submitting,actions:"updateFormData"}}},[j.Submitting]:{entry:"assignBMI",always:[{target:"#".concat(j.ContactDetails),guard:"isPreEligibilityMet"},{target:"#".concat(j.EligibilityUnmet)}]}}},[j.ContactDetails]:{id:j.ContactDetails,initial:j.Idle,states:{[j.Idle]:{on:{SUBMIT:{actions:"updateFormData",target:j.Submitting}}},[j.Submitting]:{id:j.Submitting,initial:j.CreateLead,states:{[j.CreateLead]:{id:j.CreateLead,invoke:{src:(0,w.Sx)(async e=>{let{input:t}=e,a={...t.formData,company:A,evolveOrganization:y.PM.MDsave,leadStatus:y.XN.EligibleWaiting,automateEvolveEnrollment:!1};return await (0,f.t)(a)}),input:e=>{let{context:t}=e;return t},onDone:"#".concat(j.ApplicationReview),onError:[{guard:"isApplicationDetected",target:"#".concat(j.ApplicationDetected)},{target:"#".concat(j.Error)}]}}}},[j.Error]:{id:j.Error,on:{SUBMIT:{actions:"updateFormData",target:j.Submitting}}}}},[j.ApplicationReview]:{id:j.ApplicationReview},[j.ApplicationDetected]:{id:j.ApplicationDetected},[j.EligibilityUnmet]:{id:j.EligibilityUnmet,initial:j.Idle,states:{[j.Idle]:{on:{SUBMIT:{target:j.Submitting,actions:"updateFormData"}}},[j.Submitting]:{invoke:{src:(0,w.Sx)(async e=>{let{input:t}=e,a={...t,company:A,leadStatus:y.XN.Ineligible,ineligibilityReason:y.hT.BMI,automateEvolveEnrollment:!1};return await (0,f.t)(a)}),input:e=>{let{context:{formData:t}}=e;return t},onDone:j.Success,onError:j.Error}},[j.Success]:{},[j.Error]:{on:{SUBMIT:{target:j.Submitting}}}}}},on:{RESET:{target:"#".concat(j.PreEligibility),actions:"reset"}}});var M=a(69443);let k={[p.C.PreEligibility]:{title:(0,i.jsxs)(r.TextPairing,{variant:"textpairing-header-2XL",children:[(0,i.jsx)(r.TextPairing.Label,{color:"text-primary",children:"Let's make sure you're eligible for the FlyteHealth program."}),(0,i.jsx)(r.TextPairing.SubLabel,{color:"text-secondary",children:"To be eligible for the FlyteHealth program through your MDsave benefits, you must meet specific age and Body Mass Index (BMI)* requirements."})]}),bmiEnrollmentDisclaimer:(0,i.jsx)(r.Text,{variant:"text-body-meta-regular",color:"text-secondary",children:"*We acknowledge that Body Mass Index (BMI) is an imperfect way to screen for excess weight. FlyteHealth providers do not use BMI alone as a measure of overall health. Instead, BMI is used as a data point to see if someone is eligible to join the FlyteHealth program. Once someone joins the program, we'll ask each person more about their health to create a personalized treatment plan."})},[p.C.EligibilityUnmet]:{title:(0,i.jsxs)(r.TextPairing,{variant:"textpairing-header-2XL",children:[(0,i.jsx)(r.TextPairing.Label,{color:"text-secondary-negative",children:"Unfortunately, you are not eligible to join FlyteHealth at this time."}),(0,i.jsx)(r.TextPairing.SubLabel,{color:"text-secondary",children:"The FlyteHealth program requires a minimum BMI of 27+ (plus one or more weight-related health conditions) or a BMI of 30+."})]})},[p.C.ContactDetails]:{title:(0,i.jsxs)(r.TextPairing,{variant:"textpairing-header-2XL",children:[(0,i.jsx)(r.TextPairing.Label,{color:"text-secondary-negative",children:"Congratulations! You're eligible for the FlyteHealth program"}),(0,i.jsx)(r.TextPairing.SubLabel,{color:"text-secondary",children:"To help us match your information with your employer, tell us about yourself."})]})},[p.C.ApplicationReview]:{title:(0,i.jsxs)(r.TextPairing,{variant:"textpairing-header-2XL",children:[(0,i.jsx)(r.TextPairing.Label,{color:"text-primary",children:"You're almost finished!"}),(0,i.jsx)(r.TextPairing.SubLabel,{color:"text-secondary",children:"We've received your application, but we need a little more information from you to move forward. Please call us to complete the application process."})]})},[p.C.ApplicationDetected]:{title:(0,i.jsx)(r.Text,{variant:"text-header-2XL",color:"text-primary",children:"We found an existing account for:"}),description:(0,i.jsx)(r.Text,{variant:"text-body-display-S",color:"text-secondary",children:"It looks like you already have an account with us. To continue or update your registration details, please contact our Care Coordinator team."})},[p.C.OnboardingChecklist]:M.M[p.C.OnboardingChecklist],[p.C.CreatePassword]:M.M[p.C.CreatePassword],[p.C.AppDownload]:M.M[p.C.AppDownload],[p.C.ReviewConsents]:M.M[p.C.ReviewConsents]};var T=a(82393);let U=[g.UX.WordOfMouth,g.UX.Other],B={[p.C.ContactDetails]:{state:{options:T.rI},howDidYouFindUs:{options:U}}},F=new Map([[p.C.PreEligibility,l.n.get(p.C.PreEligibility)],[p.C.ContactDetails,l.n.get(p.C.ContactDetails)]]),O=g.fz.MDSave,N=e=>{let{render:t}=e,[a,f]=(0,C.zl)(R),y=(0,x.useMemo)(()=>(0,b.r)(a.value),[a.value]);(0,m.t)(y,O);let D=(0,x.useCallback)(e=>{f({type:"SUBMIT",data:e})},[f]),v=(0,x.useCallback)(()=>{switch(y){case h.f.PreEligibility:return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(r.Alert,{variant:"subtle",status:"warning",borderRadius:"none",justifyContent:"center",children:[(0,i.jsx)(r.Alert.Icon,{}),(0,i.jsxs)(r.Alert.Title,{children:["To continue, you must first purchase the MDsave FlyteHealth bundle. To purchase, click"," ",(0,i.jsx)(r.Link,{isExternal:!0,href:"https://www.mdsave.com/p/flyte-weight-loss-and-nutritional-counseling",fontWeight:"bold",children:"here"}),"."]})]}),(0,i.jsx)(u.P,{configuration:{contentResources:k[p.C.PreEligibility]},onSubmit:D})]});case h.f.ContactDetails:return(0,i.jsx)(c.x,{configuration:{contentResources:k[p.C.ContactDetails],fields:B[p.C.ContactDetails]},loading:a.matches({[h.f.ContactDetails]:h.f.Submitting}),onSubmit:D,defaultValues:a.context.formData});case h.f.EligibilityUnmet:return(0,i.jsx)(d.B,{configuration:{contentResources:k[p.C.EligibilityUnmet]},onSubmit:D,loading:a.matches({[h.f.EligibilityUnmet]:h.f.Submitting}),isEmailSent:a.matches({[h.f.EligibilityUnmet]:h.f.Success}),hasError:a.matches({[h.f.EligibilityUnmet]:h.f.Error})});case h.f.ApplicationReview:return(0,i.jsx)(o.l,{...k[p.C.ApplicationReview]});case h.f.ApplicationDetected:return(0,i.jsx)(n.r,{...k[p.C.ApplicationDetected],email:a.context.formData.email});default:return null}},[y,a]);return t({header:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(r.Flex,{gap:"spacer-5",alignItems:"center",children:[(0,i.jsx)(s.E,{partner:g.fz.Flyte}),(0,i.jsx)(r.Divider,{orientation:"vertical",alignSelf:"stretch",height:"auto"}),(0,i.jsx)(s.E,{partner:O})]}),(0,i.jsx)(l.f,{currentStep:y,steps:F})]}),body:v(),currentWorkFlowStep:y})}}}]);