"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[206],{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})}},17206:(e,t,a)=>{a.d(t,{D:()=>R});var i=a(37876),r=a(37477),n=a(16741),o=a(34305),s=a(1144),l=a(66885),c=a(62227),d=a(14232),u=a(46884),m=a(49097),g=a(53100),p=a(92261),h=a(96079),b=a(32246),C=a(53310),x=a(47811),f=a(56931),D=a(74161),y=a(45383),I=a(20058),v=a(92749);let E=e=>(0,i.jsx)(r.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});E.Image=e=>(0,i.jsx)(r.Image,{flex:1,objectFit:"contain",...e}),E.Description=e=>(0,i.jsx)(r.Text,{variant:"text-body-floating-label-regular",color:"text-secondary",textAlign:"center",...e}),E.Title=e=>(0,i.jsx)(r.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}),E.Frame=e=>(0,i.jsx)(r.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 S=e=>{let{onSelectWorkflow:t}=e,{track:a}=(0,D.useAnalytics)(),s=e=>()=>(a("".concat(e,"_selected"),{partner:e}),t(e)),l=Object.entries(v.s);return(0,i.jsxs)(y.s,{direction:"column",gap:"spacer-9",children:[(0,i.jsx)(r.Flex,{direction:"column",gap:"spacer-2",children:(0,i.jsxs)(r.Text,{variant:"text-header-XL",color:"text-secondary-negative",children:["Welcome!"," ",(0,i.jsxs)(r.Text,{as:"span",variant:"text-header-XL",color:"text-primary",children:["To get started, please select your benefit program."," "]})]})}),(0,i.jsxs)(r.Flex,{direction:"column",gap:{base:"spacer-9"},children:[(0,i.jsx)(r.Flex,{direction:"column",gap:"spacer-4",flex:1}),(0,i.jsxs)(r.Flex,{direction:"column",gap:"spacer-4",pb:{base:"spacer-9",md:"spacer-6"},flex:1,children:[(0,i.jsx)(r.Flex,{direction:{base:"column",md:"row"},gap:{base:"spacer-6",md:"spacer-3"},justifyContent:{md:"space-between"},alignItems:{md:"end"},children:(0,i.jsxs)(r.Flex,{gap:"spacer-3",alignItems:"center",flex:1,children:[(0,i.jsx)(r.IconArrowRight,{color:"primary-default",size:"l"}),(0,i.jsx)(r.Text,{variant:"text-body-large-medium",color:"text-primary",children:"Available Programs:"})]})}),(0,i.jsxs)(r.Grid,{spacingX:"spacer-4",spacingY:{base:"spacer-4",lg:"spacer-6"},columns:{base:2,md:3,lg:4,xxl:5},children:[l.map(e=>{let[t,{asset:a,description:r,name:n}]=e;return(0,i.jsxs)(E,{onClick:s(t),children:[(0,i.jsxs)(E.Frame,{children:[(0,i.jsx)(E.Image,{...a}),(0,i.jsx)(E.Description,{children:r})]}),(0,i.jsx)(E.Title,{children:n})]},t)}),(0,i.jsxs)(E,{"aria-label":"Provider Referral",onClick:s(o.fz.Flyte),maxWidth:"16rem",children:[(0,i.jsx)(E.Frame,{p:0,width:"100%",minHeight:{base:"7.5rem",md:"10rem"},children:(0,i.jsx)(E.Image,{src:n.k[o.fz.KaiserPermanente],width:"123px",height:"40px",alt:"Kaiser Permanente Logo"})}),(0,i.jsx)(E.Title,{children:"Provider Referral"})]}),(0,i.jsxs)(E,{onClick:s(o.fz.Flyte),maxWidth:"16rem",children:[(0,i.jsx)(E.Frame,{p:0,width:"100%",minHeight:{base:"7.5rem",md:"10rem"},children:(0,i.jsx)(E.Image,{src:n.k[o.fz.Sone],width:"123px",height:"40px",alt:"Sone Logo"})}),(0,i.jsx)(E.Title,{children:"Provider Referral"})]})]})]})]}),(0,i.jsxs)(r.Flex,{direction:"column",gap:"spacer-1",children:[(0,i.jsx)(r.Text,{color:"text-secondary",variant:"text-body-bold",children:"Need some help?"}),(0,i.jsxs)(r.Text,{color:"text-secondary",variant:"text-body-regular",children:["Please call"," ",(0,i.jsx)(I.C,{})," ","to speak with a Care Coordinator."]})]})]})};var w=a(33841),L=a(65159);let P={WorkflowSelector:"workflowSelector",...w.fz},A=(0,L.mj)({types:{},guards:{isCareCompassSelected:e=>{let{event:t}=e;return t.data.workflow===w.fz.CareCompass},isAetnaSelected:e=>{let{event:t}=e;return t.data.workflow===w.fz.Aetna},isRiverspringSelected:e=>{let{event:t}=e;return t.data.workflow===w.fz.RiverSpringLiving},isPequotSelected:e=>{let{event:t}=e;return t.data.workflow===w.fz.PequotHealthCare},isPyleSelected:e=>{let{event:t}=e;return t.data.workflow===w.fz.PyleFamilyInsurance},isMDSaveSelected:e=>{let{event:t}=e;return t.data.workflow===w.fz.MDSave},isChristianaCareSelected:e=>{let{event:t}=e;return t.data.workflow===w.fz.ChristianaCare},is1199SEIUSelected:e=>{let{event:t}=e;return t.data.workflow===w.fz["1199SEIU"]}}}).createMachine({id:"workflowManagerMachine",initial:P.WorkflowSelector,states:{[P.WorkflowSelector]:{id:P.WorkflowSelector,on:{SUBMIT:[{guard:"isCareCompassSelected",target:P.CareCompass},{guard:"isAetnaSelected",target:P.Aetna},{guard:"isRiverspringSelected",target:P.RiverSpringLiving},{guard:"isPequotSelected",target:P.PequotHealthCare},{guard:"isPyleSelected",target:P.PyleFamilyInsurance},{guard:"isMDSaveSelected",target:P.MDSave},{guard:"isChristianaCareSelected",target:P.ChristianaCare},{guard:"is1199SEIUSelected",target:P["1199SEIU"]},{target:P.Flyte}]}},[P.PequotHealthCare]:{},[P.RiverSpringLiving]:{},[P.CareCompass]:{},[P.Aetna]:{},[P.Flyte]:{},[P.PyleFamilyInsurance]:{},[P.MDSave]:{},[P.ChristianaCare]:{},[P["1199SEIU"]]:{}}}),R=e=>{let{render:t}=e,[a,D]=(0,c.zl)(A),y=(0,d.useMemo)(()=>(0,l.r)(a.value),[a.value]),I=(0,d.useCallback)(e=>{D({type:"SUBMIT",data:{workflow:e}})},[D]);return(0,d.useCallback)(()=>{switch(y){case P.WorkflowSelector:return t({header:(0,i.jsx)(n.E,{partner:o.fz.Flyte}),body:(0,i.jsx)(S,{onSelectWorkflow:I}),currentWorkFlowStep:y});case P.Aetna:return(0,i.jsx)(r.ComposerProvider,{theme:s.w4.aetna,children:(0,i.jsx)(u.j,{render:t})});case P.CareCompass:return(0,i.jsx)(r.ComposerProvider,{theme:s.w4.careCompass,children:(0,i.jsx)(m.Z,{render:t})});case P.RiverSpringLiving:return(0,i.jsx)(r.ComposerProvider,{theme:s.w4.riverspring,children:(0,i.jsx)(x.D,{render:t})});case P.PequotHealthCare:return(0,i.jsx)(r.ComposerProvider,{theme:s.w4.pequot,children:(0,i.jsx)(b.K,{render:t})});case P.PyleFamilyInsurance:return(0,i.jsx)(r.ComposerProvider,{theme:s.w4.pyle,children:(0,i.jsx)(C.A,{render:t})});case P.MDSave:return(0,i.jsx)(r.ComposerProvider,{theme:s.w4.standard,children:(0,i.jsx)(h.Y,{render:t})});case P.ChristianaCare:return(0,i.jsx)(r.ComposerProvider,{theme:s.w4.standard,children:(0,i.jsx)(g.z,{render:t})});case P["1199SEIU"]:return(0,i.jsx)(r.ComposerProvider,{theme:s.w4.standard,children:(0,i.jsx)(f.A,{render:t})});case P.Flyte:default:return(0,i.jsx)(p.q,{render:t})}},[y])()}},32246:(e,t,a)=>{a.d(t,{K:()=>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(18681),m=a(39946),g=a(63583),p=a(53154),h=a(30435),b=a(42037),C=a(70587),x=a(11427),f=a(86535),D=a(27297),y=a(43483),I=a(81488),v=a(93511),E=a(34305),S=a(80072),w=a(66885),L=a(62227),P=a(14232),A=a(11969),R=a(10758),T=a(85007),M=a(20411),j=a(31346),U=a(38360),k=a(39648),B=a(77944),F=a(47353),O=a(83928),N=a(33841),_=a(13751),V=a(92323),H=a(86687),X=a(89225),z=a(97793),W=a(68792),q=a(38088),Y=a(65159),K=a(39777),G=a(45352),Q=a(63826),J=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}(J||{});let $={...z.f,...J},Z=X.Ek[N.fz.PequotHealthCare],ee={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},et={..._.AU,..._.gQ,..._.pE,..._.UH,..._.yF,..._.n6,..._.uN,..._.yS,..._.RW,..._.i_,...(0,_.rS)(ee).reset},ea=(0,Y.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:H.L,isAthenaRecordCreated:V.z},actions:et}).createMachine({context:()=>ee,id:"pequotMachine",initial:$.PreEligibility,states:{[$.PreEligibility]:{id:$.PreEligibility,initial:$.Idle,states:{[$.Idle]:{on:{SUBMIT:{target:$.Submitting,actions:"updateFormData"}}},[$.Submitting]:{entry:"assignBMI",always:[{target:"#".concat($.ContactDetails),guard:"isPreEligibilityMet"},{target:"#".concat($.EligibilityUnmet)}]}}},[$.ContactDetails]:{id:$.ContactDetails,initial:$.Idle,states:{[$.Idle]:{on:{SUBMIT:{target:"#".concat($.InsuranceDetails),actions:"updateFormData"}}}}},[$.InsuranceDetails]:{id:$.InsuranceDetails,initial:$.Idle,states:{[$.Idle]:{on:{BACK:{target:"#".concat($.ContactDetails)},SUBMIT:{target:"#".concat($.InsuranceDetailsReview),actions:"updateFormData"}}}}},[$.InsuranceDetailsReview]:{id:$.InsuranceDetailsReview,initial:$.Idle,states:{[$.Idle]:{on:{SUBMIT:{actions:"updateFormData",target:$.Submitting}}},[$.Submitting]:{id:$.Submitting,initial:$.CheckEligibility,states:{[$.CheckEligibility]:{id:$.CheckEligibility,invoke:{src:(0,K.Sx)(async e=>{let{input:t}=e,a={...t,insurance:X.w[N.fz.PequotHealthCare],benefitProgram:X.Nl[N.fz.PequotHealthCare]};return await (0,k.w)(a)}),input:e=>{let{context:{formData:t}}=e;return t},onDone:[{actions:(0,G.a)({eligibilityCheckMatchType:e=>{let{event:t}=e;return t.output.data.matchType}}),target:"#".concat($.CheckBenefits)}],onError:"#".concat($.InsuranceDetailsReview,".").concat($.Error)}},[$.CheckBenefits]:{id:$.CheckBenefits,invoke:{src:(0,K.Sx)(async e=>{let{input:t}=e,a={...t,payerCode:X.dT[N.lk["Pequot HealthCare"]]};return await (0,M.R)(a)}),input:e=>{let{context:{formData:t}}=e;return t},onDone:[{actions:(0,G.a)({benefitsCheck:e=>{let{event:t}=e;return t.output.data}}),target:"#".concat($.DetermineContactOrLead)}],onError:"#".concat($.DetermineContactOrLead)}},[$.DetermineContactOrLead]:{id:$.DetermineContactOrLead,always:[{guard:"isApplicationReviewRequired",target:$.CreateLead},{target:$.CreateContact}]},[$.CreateContact]:{id:$.CreateContact,invoke:{src:(0,K.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:Z,insurance:X.Ft[N.fz.PequotHealthCare],evolveOrganization:N.PM["Pequot Tribal Family Health Plan"],accountId:X.f3[N.fz.PequotHealthCare]};return await (0,U.vY)(a)}),input:e=>{let{context:t}=e;return t},onDone:{actions:"assignContactData",target:"#".concat($.EmailVerification)},onError:[{guard:"isApplicationDetected",target:"#".concat($.ApplicationDetected)},{target:"#".concat($.InsuranceDetailsReview,".").concat($.Error)}]}},[$.CreateLead]:{id:$.CreateLead,invoke:{src:(0,K.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:Z,insurance:X.Ft[N.fz.PequotHealthCare],evolveOrganization:N.PM["Pequot Tribal Family Health Plan"],leadStatus:(e=>{switch(e){case Q.w.PERSON_MATCH:case Q.w.INSURANCE_MATCH:case Q.w.EXPIRED:case Q.w.NOT_FOUND:return E.XN.EligibleWaiting;case Q.w.FULL_MATCH:case Q.w.ELIGIBLE_MATCH:default:return}})(t.eligibilityCheckMatchType),automateEvolveEnrollment:(e=>e===Q.w.FULL_MATCH||e===Q.w.ELIGIBLE_MATCH)(t.eligibilityCheckMatchType)};return await (0,F.t)(a)}),input:e=>{let{context:t}=e;return t},onDone:[{guard:"isApplicationReviewRequired",target:"#".concat($.ApplicationReview)},{target:"#".concat($.ApplicationComplete)}],onError:[{guard:"isApplicationDetected",target:"#".concat($.ApplicationDetected)},{target:"#".concat($.InsuranceDetailsReview,".").concat($.Error)}]}}}},[$.Error]:{id:"".concat($.InsuranceDetailsReview,".").concat($.Error),on:{SUBMIT:{actions:["updateFormData","resetBenefitsCheck"],target:$.Submitting}}}}},[$.EmailVerification]:{id:$.EmailVerification,initial:$.Idle,states:{[$.Idle]:{id:"".concat($.EmailVerification,".").concat($.Idle),on:{SUBMIT:{actions:"assignOtpCode",target:$.Submitting},RESEND_EMAIL_VERIFICATION:{target:$.Idle,reenter:!0},UPDATE_EMAIL:{target:$.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,K.Sx)(async e=>{let{input:t}=e,a={email:t.email,firstName:t.firstName};return{token:(await (0,R.v)(a)).data.token,onSuccess:t.onSuccess}}),onDone:{actions:[(0,G.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:$.Error}},[$.Submitting]:{invoke:{src:(0,K.Sx)(async e=>{let{input:t}=e,a={email:t.formData.email,token:t.otpData.token,otp:t.otpData.otp};return await (0,T.R)(a)}),input:e=>{let{context:t}=e;return t},onDone:"#".concat($.OnboardingChecklist),onError:$.Error}},[$.Error]:{on:{SUBMIT:{actions:"assignOtpCode",target:$.Submitting},RESEND_EMAIL_VERIFICATION:{target:$.Idle},UPDATE_EMAIL:{target:$.UpdateEmail}}},[$.UpdateEmail]:{initial:$.Idle,states:{[$.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,K.Sx)(async e=>{let{input:t}=e,a={contactId:t.contactId,email:t.email};return await (0,U.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($.EmailVerification,".").concat($.Idle)},onError:$.Error}},[$.Error]:{on:{SUBMIT:{target:"#".concat($.EmailVerification,".").concat($.Idle)},RESEND_EMAIL_VERIFICATION:{target:"#".concat($.EmailVerification,".").concat($.Idle)},UPDATE_EMAIL:{target:$.Idle}}}}}}},[$.ReviewConsents]:{id:$.ReviewConsents,initial:$.FetchConsents,states:{[$.Idle]:{on:{SUBMIT:{actions:["assignUserConsentStatus"],target:$.Submitting}}},[$.FetchConsents]:{invoke:{src:(0,K.Sx)(async()=>await (0,j.i)()),onDone:{actions:"assignConsents",target:$.Idle},onError:$.Error}},[$.Submitting]:{invoke:{src:(0,K.Sx)(async e=>{let{input:t}=e,a="yes"===t.formData.diabetes,i="yes"===t.formData.bariatricSurgery,r=(0,q.C)(a,i),n={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,programName:r};return await (0,B.Y)(n)}),input:e=>{let{context:t}=e;return t},onDone:[{actions:"assignFlyteUserData",target:$.UpdateContact}],onError:"#".concat($.OnboardingUserError)}},[$.UpdateContact]:{invoke:{src:(0,K.Sx)(async e=>{let{input:t}=e,a={contactId:t.contactData.contactId,evolvePatientID:t.flyteUserData.patientId};return await (0,U.CI)(a)}),input:e=>{let{context:t}=e;return t},onDone:[{guard:"isAthenaRecordCreated",target:"#".concat($.CreatePassword)},{target:"#".concat($.OnboardingUserError)}],onError:"#".concat($.OnboardingUserError)}},[$.Error]:{on:{SUBMIT:{actions:["assignUserConsentStatus"],target:$.Submitting}}}}},[$.CreatePassword]:{id:$.CreatePassword,initial:$.Idle,states:{[$.Idle]:{on:{SUBMIT:{actions:"assignPasswordData",target:$.Submitting}}},[$.Submitting]:{invoke:{src:(0,K.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($.RequestLabs),onError:{target:$.Error,actions:"assignError"}}},[$.Error]:{on:{SUBMIT:{actions:["resetError","assignPasswordData"],target:$.Submitting}}}}},[$.RequestLabs]:{id:$.RequestLabs,on:{PROCEED_TO_SUBMIT_LABS:"#".concat($.SubmitLabs),LAB_REQUESTED:{target:"#".concat($.AppDownload),actions:"assignLabLocation"},SUBMIT_LABS_LATER:{actions:"assignLabsSkipped",target:"#".concat($.AppDownload)}}},[$.SubmitLabs]:{id:$.SubmitLabs,on:{GO_BACK_TO_REQUEST_LABS:"#".concat($.RequestLabs),LAB_SUBMITTED:{actions:"registerLabsUploaded",target:"#".concat($.AppDownload)},SUBMIT_LABS_LATER:{actions:"assignLabsSkipped",target:"#".concat($.AppDownload)}}},[$.OnboardingChecklist]:{id:$.OnboardingChecklist,on:{SUBMIT:{target:"#".concat($.ReviewConsents)}}},[$.AppDownload]:{id:$.AppDownload},[$.ApplicationReview]:{id:$.ApplicationReview},[$.OnboardingUserError]:{id:$.OnboardingUserError},[$.ApplicationComplete]:{id:$.ApplicationComplete},[$.ApplicationDetected]:{id:$.ApplicationDetected},[$.EligibilityUnmet]:{id:$.EligibilityUnmet,initial:$.Idle,states:{[$.Idle]:{on:{SUBMIT:{target:$.Submitting,actions:"updateFormData"}}},[$.Submitting]:{invoke:{src:(0,K.Sx)(async e=>{let{input:t}=e,a={...t,company:Z,leadStatus:N.XN.Ineligible,ineligibilityReason:N.hT.BMI,insurance:X.Ft[N.fz.PequotHealthCare],automateEvolveEnrollment:!1};return await (0,F.t)(a)}),input:e=>{let{context:{formData:t}}=e;return t},onDone:$.Success,onError:$.Error}},[$.Success]:{},[$.Error]:{on:{SUBMIT:{actions:"updateFormData",target:$.Submitting}}}}}},on:{RESET:{target:"#".concat($.PreEligibility),actions:"reset"}}});var ei=a(69443);let er={[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]:ei.M[S.C.EmailVerification],[S.C.OnboardingChecklist]:ei.M[S.C.OnboardingChecklist],[S.C.CreatePassword]:ei.M[S.C.CreatePassword],[S.C.AppDownload]:ei.M[S.C.AppDownload],[S.C.ReviewConsents]:ei.M[S.C.ReviewConsents]};var en=a(82393);let eo=[E.UX.BenefitsWebsite,E.UX.ProviderReferral,E.UX.WordOfMouth,E.UX.Other],es={[S.C.ContactDetails]:{state:{options:en.rI},howDidYouFindUs:{options:eo}},[S.C.InsuranceDetails]:{insuranceMemberID:{}},[S.C.InsuranceDetailsReview]:{insuranceMemberID:{}}},el=E.fz.PequotHealthCare,ec=e=>{let{render:t}=e,[a,A]=(0,L.zl)(ea),R=(0,P.useMemo)(()=>(0,w.r)(a.value),[a.value]);(0,v.t)(R,el);let T=(0,P.useCallback)(e=>{A({type:"SUBMIT",data:e})},[A]),M=(0,P.useCallback)(()=>{A({type:"BACK"})},[A]),j=(0,P.useCallback)(()=>{var e,t;switch(R){case $.PreEligibility:return(0,i.jsx)(f.P,{configuration:{contentResources:er[S.C.PreEligibility]},onSubmit:T});case $.ContactDetails:return(0,i.jsx)(u.x,{configuration:{contentResources:er[S.C.ContactDetails],fields:es[S.C.ContactDetails]},onSubmit:T,defaultValues:a.context.formData});case $.EligibilityUnmet:return(0,i.jsx)(g.B,{configuration:{contentResources:er[S.C.EligibilityUnmet]},onSubmit:T,loading:a.matches({[$.EligibilityUnmet]:$.Submitting}),isEmailSent:a.matches({[$.EligibilityUnmet]:$.Success}),hasError:a.matches({[$.EligibilityUnmet]:$.Error})});case $.InsuranceDetails:return(0,i.jsx)(h.d,{configuration:{contentResources:er[S.C.InsuranceDetails],fields:es[S.C.InsuranceDetails]},onSubmit:T,onBack:M});case $.InsuranceDetailsReview:return(0,i.jsx)(b.h,{configuration:{contentResources:er[S.C.InsuranceDetailsReview],fields:es[S.C.InsuranceDetailsReview]},onSubmit:T,loading:a.matches({[$.InsuranceDetailsReview]:$.Submitting}),hasError:a.matches({[$.InsuranceDetailsReview]:$.Error}),defaultValues:a.context.formData});case $.ApplicationComplete:return(0,i.jsx)(o.Q,{...er[S.C.ApplicationComplete],email:a.context.formData.email});case $.ApplicationReview:return(0,i.jsx)(l.l,{...er[S.C.ApplicationReview]});case $.ApplicationDetected:return(0,i.jsx)(s.r,{...er[S.C.ApplicationDetected],email:a.context.formData.email});case $.EmailVerification:return(0,i.jsx)(p.e,{configuration:{contentResources:{title:er[S.C.EmailVerification](a.context.formData.email).title}},email:a.context.formData.email,hasError:a.matches({[$.EmailVerification]:$.Error}),loading:a.matches({[$.EmailVerification]:$.Submitting}),isUpdateEmailLoading:a.matches({[$.EmailVerification]:{[$.UpdateEmail]:$.Idle}}),hasUpdateEmailError:a.matches({[$.EmailVerification]:{[$.UpdateEmail]:$.Error}}),onSubmit:T,onResendCode:e=>A({type:"RESEND_EMAIL_VERIFICATION",data:{onSuccess:e}}),onEditEmail:(e,t)=>A({type:"UPDATE_EMAIL",data:{email:e,onSuccess:t}})});case $.OnboardingChecklist:return(0,i.jsx)(C.E,{showLabs:!0,configuration:{contentResources:er[S.C.OnboardingChecklist]},onSubmit:T});case $.ReviewConsents:return(0,i.jsx)(y.U,{configuration:{contentResources:er[S.C.ReviewConsents]},consents:a.context.consentsData.items,hasError:a.matches({[$.ReviewConsents]:$.Error}),loading:a.matches({[$.ReviewConsents]:$.FetchConsents})||a.matches({[$.ReviewConsents]:$.Submitting})||a.matches({[$.ReviewConsents]:$.UpdateContact}),onSubmit:T});case $.CreatePassword:return(0,i.jsx)(m.i,{configuration:{contentResources:er[S.C.CreatePassword]},loading:a.matches({[$.CreatePassword]:$.Submitting}),error:a.context.error,onSubmit:T});case $.AppDownload:return(0,i.jsx)(n.a,{title:"SUBMIT_LATER"===a.context.labs?er[S.C.AppDownload].titleLabSkipped:"LABS_UPLOADED"===a.context.labs?er[S.C.AppDownload].titleLabSubmitted:er[S.C.AppDownload].titleLabRequested,checklist:er[S.C.AppDownload].checklist});case $.OnboardingUserError:return(0,i.jsx)(x.C,{});case $.RequestLabs:return(0,i.jsx)(D.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 $.SubmitLabs:return(0,i.jsx)(I.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}},[R,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:R})]}),body:j(),currentWorkFlowStep:R})}},46884:(e,t,a)=>{a.d(t,{j:()=>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(533),u=a(18681),m=a(39946),g=a(63583),p=a(53154),h=a(30435),b=a(42037),C=a(70587),x=a(11427),f=a(86535),D=a(27297),y=a(43483),I=a(81488),v=a(93511),E=a(34305),S=a(80072),w=a(66885),L=a(62227),P=a(14232),A=a(11969),R=a(10758),T=a(85007),M=a(20411),j=a(31346),U=a(38360),k=a(39648),B=a(77944),F=a(47353),O=a(83928),N=a(33841),_=a(13751),V=a(92323),H=a(86687),X=a(89225),z=a(97793),W=a(68792),q=a(38088),Y=a(65159),K=a(39777),G=a(45352),Q=a(63826),J=function(e){return e.CheckEligibility="checkEligibility",e.CreateLead="createLead",e.CreateContact="createContact",e.CheckBenefits="checkBenefits",e.DetermineContactOrLead="determineContactOrLead",e.UpdateEmail="updateEmail",e.FetchConsents="fetchConsents",e.UpdateContact="updateContact",e}(J||{});let $={...z.f,...J},Z=X.Ek[N.fz.Aetna],ee={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,contactData:{},consentsData:{items:[],userConsentStatus:[]},passwordData:{password:"",confirmPassword:""},flyteUserData:void 0,error:void 0,labs:void 0},et={..._.AU,..._.gQ,..._.pE,..._.UH,..._.yF,..._.n6,..._.uN,..._.yS,..._.RW,..._.i_,...(0,_.rS)(ee).reset},ea=(0,Y.mj)({types:{},guards:{isPreEligibilityMet:e=>{let{context:{formData:t,bmi:a}}=e;return W.J0.aetna({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:H.L,isAthenaRecordCreated:V.z},actions:et}).createMachine({context:()=>ee,id:"aetnaMachine",initial:$.PreEligibility,states:{[$.PreEligibility]:{id:$.PreEligibility,initial:$.Idle,states:{[$.Idle]:{on:{SUBMIT:{target:$.Submitting,actions:"updateFormData"}}},[$.Submitting]:{entry:"assignBMI",always:[{target:"#".concat($.ContactDetails),guard:"isPreEligibilityMet"},{target:"#".concat($.EligibilityUnmet)}]}}},[$.ContactDetails]:{id:$.ContactDetails,initial:$.Idle,states:{[$.Idle]:{on:{SUBMIT:{target:"#".concat($.InsuranceDetails),actions:"updateFormData"}}}}},[$.InsuranceDetails]:{id:$.InsuranceDetails,initial:$.Idle,states:{[$.Idle]:{on:{BACK:{target:"#".concat($.ContactDetails)},SUBMIT:{target:"#".concat($.InsuranceDetailsReview),actions:"updateFormData"}}}}},[$.InsuranceDetailsReview]:{id:$.InsuranceDetailsReview,initial:$.Idle,states:{[$.Idle]:{on:{SUBMIT:{actions:"updateFormData",target:$.Submitting}}},[$.Submitting]:{type:"parallel",states:{[$.CheckEligibility]:{id:$.CheckEligibility,initial:$.Idle,states:{[$.Idle]:{invoke:{src:(0,K.Sx)(async e=>{let{input:t}=e,a={...t,insurance:X.w[N.fz.Aetna],benefitProgram:X.Nl[N.fz.Aetna]};return await (0,k.w)(a)}),input:e=>{let{context:{formData:t}}=e;return t},onDone:{actions:(0,G.a)({eligibilityCheckMatchType:e=>{let{event:t}=e;return t.output.data.matchType}}),target:$.Success},onError:$.Success}},[$.Success]:{type:"final"}}},[$.CheckBenefits]:{id:$.CheckBenefits,initial:$.Idle,states:{[$.Idle]:{invoke:{src:(0,K.Sx)(async e=>{let{input:t}=e,a={...t,payerCode:X.dT[N.lk["Aetna Medicare"]]};return await (0,M.R)(a)}),input:e=>{let{context:{formData:t}}=e;return t},onDone:{actions:(0,G.a)({benefitsCheck:e=>{let{event:t}=e;return t.output.data}}),target:$.Success},onError:{target:$.Success}}},[$.Success]:{type:"final"}}}},onDone:{target:"#".concat($.DetermineContactOrLead)}},[$.DetermineContactOrLead]:{id:$.DetermineContactOrLead,always:[{guard:"isApplicationReviewRequired",target:$.CreateLead},{target:$.CreateContact}]},[$.CreateLead]:{id:$.CreateLead,invoke:{src:(0,K.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:Z,insurance:X.Ft[N.fz.Aetna],evolveOrganization:N.PM["State of Connecticut Retirees"],leadStatus:(e=>{switch(e){case Q.w.PERSON_MATCH:case Q.w.INSURANCE_MATCH:case Q.w.EXPIRED:case Q.w.NOT_FOUND:return E.XN.EligibleWaiting;case Q.w.FULL_MATCH:case Q.w.ELIGIBLE_MATCH:default:return}})(t.eligibilityCheckMatchType),automateEvolveEnrollment:(e=>e===Q.w.FULL_MATCH||e===Q.w.ELIGIBLE_MATCH)(t.eligibilityCheckMatchType)};return await (0,F.t)(a)}),input:e=>{let{context:t}=e;return t},onDone:"#".concat($.ApplicationReview),onError:[{guard:"isApplicationDetected",target:"#".concat($.ApplicationDetected)},{target:"#".concat($.InsuranceDetailsReview,".").concat($.Error)}]}},[$.CreateContact]:{id:$.CreateContact,invoke:{src:(0,K.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:Z,insurance:X.Ft[N.fz.Aetna],evolveOrganization:N.PM["State of Connecticut Retirees"],accountId:X.f3[N.fz.Aetna]};return await (0,U.vY)(a)}),input:e=>{let{context:t}=e;return t},onDone:{actions:"assignContactData",target:"#".concat($.EmailVerification)},onError:[{guard:"isApplicationDetected",target:"#".concat($.ApplicationDetected)},{target:"#".concat($.Error)}]}},[$.Error]:{id:$.Error,on:{SUBMIT:{actions:["updateFormData","resetBenefitsCheck"],target:$.Submitting}}}}},[$.EmailVerification]:{id:$.EmailVerification,initial:$.Idle,states:{[$.Idle]:{id:"".concat($.EmailVerification,".").concat($.Idle),on:{SUBMIT:{actions:"assignOtpCode",target:$.Submitting},RESEND_EMAIL_VERIFICATION:{target:$.Idle,reenter:!0},UPDATE_EMAIL:{target:$.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,K.Sx)(async e=>{let{input:t}=e,a={email:t.email,firstName:t.firstName};return{token:(await (0,R.v)(a)).data.token,onSuccess:t.onSuccess}}),onDone:{actions:[(0,G.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:$.Error}},[$.Submitting]:{invoke:{src:(0,K.Sx)(async e=>{let{input:t}=e,a={email:t.formData.email,token:t.otpData.token,otp:t.otpData.otp};return await (0,T.R)(a)}),input:e=>{let{context:t}=e;return t},onDone:"#".concat($.OnboardingChecklist),onError:$.Error}},[$.Error]:{on:{SUBMIT:{actions:"assignOtpCode",target:$.Submitting},RESEND_EMAIL_VERIFICATION:{target:$.Idle},UPDATE_EMAIL:{target:$.UpdateEmail}}},[$.UpdateEmail]:{initial:$.Idle,states:{[$.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,K.Sx)(async e=>{let{input:t}=e,a={contactId:t.contactId,email:t.email};return await (0,U.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($.EmailVerification,".").concat($.Idle)},onError:$.Error}},[$.Error]:{on:{SUBMIT:{target:"#".concat($.EmailVerification,".").concat($.Idle)},RESEND_EMAIL_VERIFICATION:{target:"#".concat($.EmailVerification,".").concat($.Idle)},UPDATE_EMAIL:{target:$.Idle}}}}}}},[$.OnboardingChecklist]:{id:$.OnboardingChecklist,on:{SUBMIT:{target:"#".concat($.ReviewConsents)}}},[$.ReviewConsents]:{id:$.ReviewConsents,initial:$.FetchConsents,states:{[$.Idle]:{on:{SUBMIT:{actions:["assignUserConsentStatus"],target:$.Submitting}}},[$.FetchConsents]:{invoke:{src:(0,K.Sx)(async()=>await (0,j.i)()),onDone:{actions:"assignConsents",target:$.Idle},onError:$.Error}},[$.Submitting]:{invoke:{src:(0,K.Sx)(async e=>{let{input:t}=e,a="yes"===t.formData.diabetes,i="yes"===t.formData.bariatricSurgery,r=(0,q.C)(a,i),n={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["State of Connecticut Retirees"],consents:t.consentsData.userConsentStatus,programName:r};return await (0,B.Y)(n)}),input:e=>{let{context:t}=e;return t},onDone:[{actions:"assignFlyteUserData",target:$.UpdateContact}],onError:"#".concat($.OnboardingUserError)}},[$.UpdateContact]:{invoke:{src:(0,K.Sx)(async e=>{let{input:t}=e,a={contactId:t.contactData.contactId,evolvePatientID:t.flyteUserData.patientId};return await (0,U.CI)(a)}),input:e=>{let{context:t}=e;return t},onDone:[{guard:"isAthenaRecordCreated",target:"#".concat($.CreatePassword)},{target:"#".concat($.OnboardingUserError)}],onError:"#".concat($.OnboardingUserError)}},[$.Error]:{on:{SUBMIT:{actions:["assignUserConsentStatus"],target:$.Submitting}}}}},[$.CreatePassword]:{id:$.CreatePassword,initial:$.Idle,states:{[$.Idle]:{on:{SUBMIT:{actions:"assignPasswordData",target:$.Submitting}}},[$.Submitting]:{invoke:{src:(0,K.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($.RequestLabs),onError:{target:$.Error,actions:"assignError"}}},[$.Error]:{on:{SUBMIT:{actions:["resetError","assignPasswordData"],target:$.Submitting}}}}},[$.RequestLabs]:{id:$.RequestLabs,on:{PROCEED_TO_SUBMIT_LABS:"#".concat($.SubmitLabs),LAB_REQUESTED:{target:"#".concat($.AppDownload),actions:"assignLabLocation"},SUBMIT_LABS_LATER:{actions:"assignLabsSkipped",target:"#".concat($.AppDownload)}}},[$.SubmitLabs]:{id:$.SubmitLabs,on:{GO_BACK_TO_REQUEST_LABS:"#".concat($.RequestLabs),LAB_SUBMITTED:{actions:"registerLabsUploaded",target:"#".concat($.AppDownload)},SUBMIT_LABS_LATER:{actions:"assignLabsSkipped",target:"#".concat($.AppDownload)}}},[$.OnboardingUserError]:{id:$.OnboardingUserError},[$.ApplicationReview]:{id:$.ApplicationReview},[$.AppDownload]:{id:$.AppDownload},[$.ApplicationComplete]:{id:$.ApplicationComplete},[$.ApplicationDetected]:{id:$.ApplicationDetected},[$.EligibilityUnmet]:{id:$.EligibilityUnmet,initial:$.Idle,states:{[$.Idle]:{on:{SUBMIT:{target:$.Submitting,actions:"updateFormData"}}},[$.Submitting]:{invoke:{src:(0,K.Sx)(async e=>{let{input:t}=e,a={...t,company:Z,leadStatus:N.XN.Ineligible,insurance:X.Ft[N.fz.Aetna],ineligibilityReason:N.hT.BMI,automateEvolveEnrollment:!1};return await (0,F.t)(a)}),input:e=>{let{context:{formData:t}}=e;return t},onDone:$.Success,onError:$.Error}},[$.Success]:{},[$.Error]:{on:{SUBMIT:{target:$.Submitting}}}}}},on:{RESET:{target:"#".concat($.PreEligibility),actions:"reset"}}});var ei=a(69443);let er={[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 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."})},[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 Flyte 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 health plan, tell us about yourself. Next, we'll ask about your Aetna 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 Aetna 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]:ei.M[S.C.EmailVerification],[S.C.OnboardingChecklist]:ei.M[S.C.OnboardingChecklist],[S.C.CreatePassword]:ei.M[S.C.CreatePassword],[S.C.AppDownload]:ei.M[S.C.AppDownload],[S.C.ReviewConsents]:ei.M[S.C.ReviewConsents]};var en=a(82393);let eo=[E.UX.BenefitsWebsite,E.UX.ProviderReferral,E.UX.WordOfMouth,E.UX.Other],es={[S.C.ContactDetails]:{state:{options:en.rI},howDidYouFindUs:{options:eo}},[S.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"})]})}},[S.C.InsuranceDetailsReview]:{insuranceMemberID:{}}},el=E.fz.Aetna,ec=e=>{let{render:t}=e,[a,A]=(0,L.zl)(ea),R=(0,P.useMemo)(()=>(0,w.r)(a.value),[a.value]);(0,v.t)(R,el);let T=(0,P.useCallback)(e=>{A({type:"SUBMIT",data:e})},[A]),M=(0,P.useCallback)(()=>{A({type:"BACK"})},[A]),j=(0,P.useCallback)(()=>{var e,t;switch(R){case $.PreEligibility:return(0,i.jsx)(f.P,{configuration:{contentResources:er[S.C.PreEligibility]},onSubmit:T});case $.ContactDetails:return(0,i.jsx)(u.x,{configuration:{contentResources:er[S.C.ContactDetails],fields:es[S.C.ContactDetails]},onSubmit:T,defaultValues:a.context.formData});case $.EligibilityUnmet:return(0,i.jsx)(g.B,{configuration:{contentResources:er[S.C.EligibilityUnmet]},onSubmit:T,loading:a.matches({[$.EligibilityUnmet]:$.Submitting}),isEmailSent:a.matches({[$.EligibilityUnmet]:$.Success}),hasError:a.matches({[$.EligibilityUnmet]:$.Error})});case $.InsuranceDetails:return(0,i.jsx)(h.d,{configuration:{contentResources:er[S.C.InsuranceDetails],fields:es[S.C.InsuranceDetails]},onSubmit:T,onBack:M});case $.InsuranceDetailsReview:return(0,i.jsx)(b.h,{configuration:{contentResources:er[S.C.InsuranceDetailsReview],fields:es[S.C.InsuranceDetailsReview]},onSubmit:T,loading:a.matches({[$.InsuranceDetailsReview]:$.Submitting})||a.matches({[$.InsuranceDetailsReview]:$.DetermineContactOrLead})||a.matches({[$.InsuranceDetailsReview]:$.CreateLead})||a.matches({[$.InsuranceDetailsReview]:$.CreateContact}),hasError:a.matches({[$.InsuranceDetailsReview]:$.Error}),defaultValues:a.context.formData});case $.EmailVerification:return(0,i.jsx)(p.e,{configuration:{contentResources:{title:er[S.C.EmailVerification](a.context.formData.email).title}},email:a.context.formData.email,hasError:a.matches({[$.EmailVerification]:$.Error}),loading:a.matches({[$.EmailVerification]:$.Submitting}),isUpdateEmailLoading:a.matches({[$.EmailVerification]:{[$.UpdateEmail]:$.Idle}}),hasUpdateEmailError:a.matches({[$.EmailVerification]:{[$.UpdateEmail]:$.Error}}),onSubmit:T,onResendCode:e=>A({type:"RESEND_EMAIL_VERIFICATION",data:{onSuccess:e}}),onEditEmail:(e,t)=>A({type:"UPDATE_EMAIL",data:{email:e,onSuccess:t}})});case $.OnboardingChecklist:return(0,i.jsx)(C.E,{showLabs:!0,configuration:{contentResources:er[S.C.OnboardingChecklist]},onSubmit:T});case $.ReviewConsents:return(0,i.jsx)(y.U,{configuration:{contentResources:er[S.C.ReviewConsents]},consents:a.context.consentsData.items,hasError:a.matches({[$.ReviewConsents]:$.Error}),loading:a.matches({[$.ReviewConsents]:$.FetchConsents})||a.matches({[$.ReviewConsents]:$.Submitting})||a.matches({[$.ReviewConsents]:$.UpdateContact}),onSubmit:T});case $.CreatePassword:return(0,i.jsx)(m.i,{configuration:{contentResources:er[S.C.CreatePassword]},loading:a.matches({[$.CreatePassword]:$.Submitting}),error:a.context.error,onSubmit:T});case $.ApplicationComplete:return(0,i.jsx)(o.Q,{...er[S.C.ApplicationComplete],email:a.context.formData.email});case $.ApplicationDetected:return(0,i.jsx)(s.r,{...er[S.C.ApplicationDetected],email:a.context.formData.email});case $.ApplicationReview:return(0,i.jsx)(l.l,{...er[S.C.ApplicationReview]});case $.AppDownload:{let e=er[S.C.AppDownload].BrickAndMortarLabSkipped.image;return(0,i.jsx)(n.a,{title:(()=>{let{labs:e}=a.context;switch(!0){case"SUBMIT_LATER"===e:return er[S.C.AppDownload].titleLabSkipped;case"LABS_UPLOADED"===e:return er[S.C.AppDownload].titleLabSubmitted;default:return er[S.C.AppDownload].titleLabRequested}})(),image:e,checklist:er[S.C.AppDownload].checklist})}case $.OnboardingUserError:return(0,i.jsx)(x.C,{});case $.RequestLabs:return(0,i.jsx)(D.I,{organizationName:"State of Connecticut Retirees",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 $.SubmitLabs:return(0,i.jsx)(I.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}},[R,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.f,{currentStep:R})]}),body:j(),currentWorkFlowStep:R})}},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(18681),m=a(39946),g=a(53154),p=a(42037),h=a(70587),b=a(11427),C=a(86535),x=a(27297),f=a(43483),D=a(81488),y=a(93511),I=a(34305),v=a(80072),E=a(61415),S=a(66885),w=a(62227),L=a(14232),P=a(82393),A=a(45383),R=a(76692),T=a(19847),M=a(88992);let j="participantDepartmentorOrg",U=["Hebrew Home at Riverdale","RiverSpring Services Corp","RiverSpring Licensed Home Care Services Agency","RiverSpring Health Plans (ElderServe Health, Inc.)"],k=()=>{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:j,children:"Participating organization"}),(0,i.jsx)(r.Select,{"data-test":j,id:j,size:"l",variant:"flushed",placeholder:"Select organization",...e(j,{required:!0}),value:t(j),children:U.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,T.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)(k,{}),(null==l?void 0:l.insurance)&&(0,i.jsx)(R._8,{isDisabled:a,isRequired:!0,...null==l?void 0:l.insurance}),(0,i.jsx)(R.kV,{isDisabled:a,isRequired:!0,pb:{base:"spacer-24",lg:0},...null==l?void 0:l.insuranceMemberID}),d?(0,i.jsx)(P.cI,{children:u()}):u()]})]})})};var V=a(11969),H=a(10758),X=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(38088),ei=a(65159),er=a(45352),en=a(39777);let eo={Guided:I.PM["RiverSpring Living - Guided"],"Self-Guided":I.PM["RiverSpring Living - Self Guided"]},es=(e,t,a)=>{if(a===I.PM["RiverSpring Living - Self Guided"])return!0;switch(e){case I.lk["1199SEIU"]:return!0;case I.lk.Aetna:return[I.yj["New York"],I.yj["New Jersey"],I.yj.Connecticut].includes(t);default:return!1}};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,ei.mj)({types:{},guards:{isApplicationReviewRequired:e=>{let{context:{formData:t,evolveOrganization:a}}=e;return!G.A.shouldBypassIsApplicationReviewRequired({email:t.email})&&!es(t.insurance,t.state,a)},isApplicationDetected:Z.L,isAthenaRecordCreated:$.z},actions:{...em,assignEvolveOrganization:(0,er.a)({evolveOrganization:e=>{let{context:t}=e;return eo[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,en.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,er.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,en.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:((e,t,a)=>{if(!es(e,t,a))return I.XN.EligibleWaiting})(t.formData.insurance,t.formData.state,t.evolveOrganization),automateEvolveEnrollment:es(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,en.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,en.Sx)(async e=>{let{input:t}=e,a={email:t.email,firstName:t.firstName};return{token:(await (0,H.v)(a)).data.token,onSuccess:t.onSuccess}}),onDone:{actions:[(0,er.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,en.Sx)(async e=>{let{input:t}=e,a={email:t.formData.email,token:t.otpData.token,otp:t.otpData.otp};return await (0,X.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,en.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,en.Sx)(async()=>await (0,W.i)()),onDone:{actions:"assignConsents",target:ec.Idle},onError:ec.Error}},[ec.Submitting]:{invoke:{src:(0,en.Sx)(async e=>{let{input:t}=e,a="yes"===t.formData.diabetes,i="yes"===t.formData.bariatricSurgery,r=(0,ea.C)(a,i),n={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,programName:r};return await (0,Y.Y)(n)}),input:e=>{let{context:t}=e;return t},onDone:[{actions:"assignFlyteUserData",target:ec.UpdateContact}],onError:"#".concat(ec.OnboardingUserError)}},[ec.UpdateContact]:{invoke:{src:(0,en.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,en.Sx)(async e=>{let{input:t}=e,a={email:t.formData.email,password:t.passwordData.password,confirmPassword:t.passwordData.confirmPassword};return await (0,V.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={[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.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."})},[v.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."})]})}),[v.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."]})]})},[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.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."]})},[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."})]}),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."]})},[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]:ep.M[v.C.EmailVerification],[v.C.OnboardingChecklist]:ep.M[v.C.OnboardingChecklist],[v.C.CreatePassword]:ep.M[v.C.CreatePassword],[v.C.AppDownload]:ep.M[v.C.AppDownload],[v.C.ReviewConsents]:ep.M[v.C.ReviewConsents]},eb=[I.UX.BenefitsWebsite,I.UX.CoworkerReferral,I.UX.OnsiteMonitor,I.UX.Poster,I.UX.ProviderReferral,I.UX.WordOfMouth,I.UX.Other],eC={[v.C.ContactDetails]:{state:{options:P.rI},howDidYouFindUs:{options:eb}},[v.C.InsuranceDetails]:e=>({insurance:{insuranceCarriers:[I.lk.Aetna,I.lk["1199SEIU"]]},insuranceMemberID:{},evolveProgram:e?{}:void 0}),[v.C.InsuranceDetailsReview]:{insurance:{insuranceCarriers:[I.lk.Aetna,I.lk["1199SEIU"]]}}},ex=I.fz.RiverSpringLiving,ef=e=>{let{render:t}=e,[a,P]=(0,w.zl)(eg),A=(0,L.useMemo)(()=>(0,S.r)(a.value),[a.value]);(0,y.t)(A,ex);let R=(0,L.useCallback)(e=>{P({type:"SUBMIT",data:e})},[P]),T=(0,L.useCallback)(()=>{P({type:"BACK"})},[P]),M=(0,L.useCallback)(()=>{var e,t;switch(A){case ec.PreEligibility:return(0,i.jsx)(C.P,{configuration:{contentResources:eh[v.C.PreEligibility]},onSubmit:R});case ec.ContactDetails:return(0,i.jsx)(u.x,{configuration:{contentResources:eh[v.C.ContactDetails](a.context.bmi,a.context.formData.comorbidity),fields:eC[v.C.ContactDetails]},onSubmit:R,defaultValues:a.context.formData});case ec.InsuranceDetails:return(0,i.jsx)(_,{configuration:{contentResources:eh[v.C.InsuranceDetails],fields:eC[v.C.InsuranceDetails](E.J.riverSpringLiving({bmi:a.context.bmi}))},onSubmit:R,onBack:T});case ec.InsuranceDetailsReview:return(0,i.jsx)(p.h,{configuration:{contentResources:eh[v.C.InsuranceDetailsReview],fields:eC[v.C.InsuranceDetailsReview]},onSubmit:R,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[v.C.ApplicationComplete],email:a.context.formData.email});case ec.ApplicationReview:return(0,i.jsx)(l.l,{...eh[v.C.ApplicationReview]});case ec.ApplicationDetected:return(0,i.jsx)(s.r,{...eh[v.C.ApplicationDetected],email:a.context.formData.email});case ec.EmailVerification:return(0,i.jsx)(g.e,{configuration:{contentResources:{title:eh[v.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:R,onResendCode:e=>P({type:"RESEND_EMAIL_VERIFICATION",data:{onSuccess:e}}),onEditEmail:(e,t)=>P({type:"UPDATE_EMAIL",data:{email:e,onSuccess:t}})});case ec.OnboardingChecklist:return(0,i.jsx)(h.E,{showLabs:!0,configuration:{contentResources:eh[v.C.OnboardingChecklist]},onSubmit:R});case ec.ReviewConsents:return(0,i.jsx)(f.U,{configuration:{contentResources:eh[v.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:R});case ec.CreatePassword:return(0,i.jsx)(m.i,{configuration:{contentResources:eh[v.C.CreatePassword]},loading:a.matches({[ec.CreatePassword]:ec.Submitting}),error:a.context.error,onSubmit:R});case ec.AppDownload:return(0,i.jsx)(n.a,{title:"SUBMIT_LATER"===a.context.labs?eh[v.C.AppDownload].titleLabSkipped:"LABS_UPLOADED"===a.context.labs?eh[v.C.AppDownload].titleLabSubmitted:eh[v.C.AppDownload].titleLabRequested,checklist:eh[v.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:()=>P({type:"PROCEED_TO_SUBMIT_LABS"}),onLabRequested:e=>P({type:"LAB_REQUESTED",data:{lab:e}}),formData:a.context.formData});case ec.SubmitLabs:return(0,i.jsx)(D.x,{onGoBackToRequestLabs:()=>P({type:"GO_BACK_TO_REQUEST_LABS"}),onSubmitLabsLater:()=>P({type:"SUBMIT_LABS_LATER"}),onLabSubmitted:()=>P({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:I.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:()=>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(18681),m=a(39946),g=a(63583),p=a(53154),h=a(30435),b=a(42037),C=a(70587),x=a(11427),f=a(86535),D=a(27297),y=a(43483),I=a(81488),v=a(93511),E=a(34305),S=a(80072),w=a(66885),L=a(62227),P=a(14232),A=a(11969),R=a(10758),T=a(85007),M=a(20411),j=a(31346),U=a(38360),k=a(77944),B=a(47353),F=a(83928),O=a(33841),N=a(13751),_=a(92323),V=a(86687),H=a(89225),X=a(97793),z=a(68792),W=a(38088),q=a(65159),Y=a(39777),K=a(45352);let G=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},Q=e=>e===E.yj.Maryland?H.Ft["ChristianaCare - MD"]:(E.yj.Delaware,H.Ft["ChristianaCare - DE"]);var J=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}(J||{});let $={...X.f,...J},Z=H.Ek[O.fz.ChristianaCare],ee={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},et={...N.AU,...N.gQ,...N.pE,...N.UH,...N.yF,...N.n6,...N.uN,...N.yS,...N.RW,...N.i_,...(0,N.rS)(ee)},ea=(0,q.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})&&!G({groupNumber:null==i||null==(t=i.coverage)?void 0:t.groupNumber,status:null==i||null==(a=i.coverage)?void 0:a.status})},isApplicationDetected:V.L,isAthenaRecordCreated:_.z},actions:et}).createMachine({context:()=>ee,id:"christianaCareMachine",initial:$.PreEligibility,states:{[$.PreEligibility]:{id:$.PreEligibility,initial:$.Idle,states:{[$.Idle]:{on:{SUBMIT:{target:$.Submitting,actions:"updateFormData"}}},[$.Submitting]:{entry:"assignBMI",always:[{target:"#".concat($.ContactDetails),guard:"isPreEligibilityMet"},{target:"#".concat($.EligibilityUnmet)}]}}},[$.ContactDetails]:{id:$.ContactDetails,initial:$.Idle,states:{[$.Idle]:{on:{SUBMIT:{target:"#".concat($.InsuranceDetails),actions:"updateFormData"}}}}},[$.InsuranceDetails]:{id:$.InsuranceDetails,initial:$.Idle,states:{[$.Idle]:{on:{BACK:{target:"#".concat($.ContactDetails)},SUBMIT:{target:"#".concat($.InsuranceDetailsReview),actions:"updateFormData"}}}}},[$.InsuranceDetailsReview]:{id:$.InsuranceDetailsReview,initial:$.Idle,states:{[$.Idle]:{on:{SUBMIT:{actions:"updateFormData",target:$.Submitting}}},[$.Submitting]:{id:$.Submitting,initial:$.CheckBenefits,states:{[$.CheckBenefits]:{id:$.CheckBenefits,invoke:{src:(0,Y.Sx)(async e=>{let{input:t}=e,a={...t,payerCode:H.dT[O.lk.Highmark]};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($.DetermineContactOrLead)}],onError:"#".concat($.DetermineContactOrLead)}},[$.DetermineContactOrLead]:{id:$.DetermineContactOrLead,always:[{guard:"isApplicationReviewRequired",target:$.CreateLead},{target:$.CreateContact}]},[$.CreateContact]:{id:$.CreateContact,invoke:{src:(0,Y.Sx)(async e=>{let{input:t}=e,a={...t.formData,...t.benefitsCheck&&{benefitsCheck:t.benefitsCheck},company:Z,insurance:Q(t.formData.state),evolveOrganization:O.PM["ChristianaCare - Caregivers"],accountId:H.f3[O.fz.ChristianaCare],eligibilityVerifiedBy:O.h9.Pverify};return await (0,U.vY)(a)}),input:e=>{let{context:t}=e;return t},onDone:{actions:"assignContactData",target:"#".concat($.EmailVerification)},onError:[{guard:"isApplicationDetected",target:"#".concat($.ApplicationDetected)},{target:"#".concat($.InsuranceDetailsReview,".").concat($.Error)}]}},[$.CreateLead]:{id:$.CreateLead,invoke:{src:(0,Y.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},...G({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:Q(g.formData.state),evolveOrganization:O.PM["ChristianaCare - Caregivers"],company:Z,leadStatus:(e=>{let{groupNumber:t,status:a}=e;if(!G({groupNumber:t,status:a}))return E.XN.EligibleWaiting})({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:G({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($.ApplicationReview)},{target:"#".concat($.ApplicationComplete)}],onError:[{guard:"isApplicationDetected",target:"#".concat($.ApplicationDetected)},{target:"#".concat($.InsuranceDetailsReview,".").concat($.Error)}]}}}},[$.Error]:{id:"".concat($.InsuranceDetailsReview,".").concat($.Error),on:{SUBMIT:{actions:["updateFormData","resetBenefitsCheck"],target:$.Submitting}}}}},[$.EmailVerification]:{id:$.EmailVerification,initial:$.Idle,states:{[$.Idle]:{id:"".concat($.EmailVerification,".").concat($.Idle),on:{SUBMIT:{actions:"assignOtpCode",target:$.Submitting},RESEND_EMAIL_VERIFICATION:{target:$.Idle,reenter:!0},UPDATE_EMAIL:{target:$.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,R.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:$.Error}},[$.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,T.R)(a)}),input:e=>{let{context:t}=e;return t},onDone:"#".concat($.OnboardingChecklist),onError:$.Error}},[$.Error]:{on:{SUBMIT:{actions:"assignOtpCode",target:$.Submitting},RESEND_EMAIL_VERIFICATION:{target:$.Idle},UPDATE_EMAIL:{target:$.UpdateEmail}}},[$.UpdateEmail]:{initial:$.Idle,states:{[$.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,U.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($.EmailVerification,".").concat($.Idle)},onError:$.Error}},[$.Error]:{on:{SUBMIT:{target:"#".concat($.EmailVerification,".").concat($.Idle)},RESEND_EMAIL_VERIFICATION:{target:"#".concat($.EmailVerification,".").concat($.Idle)},UPDATE_EMAIL:{target:$.Idle}}}}}}},[$.ReviewConsents]:{id:$.ReviewConsents,initial:$.FetchConsents,states:{[$.Idle]:{on:{SUBMIT:{actions:["assignUserConsentStatus"],target:$.Submitting}}},[$.FetchConsents]:{invoke:{src:(0,Y.Sx)(async()=>await (0,j.i)()),onDone:{actions:"assignConsents",target:$.Idle},onError:$.Error}},[$.Submitting]:{invoke:{src:(0,Y.Sx)(async e=>{let{input:t}=e,a="yes"===t.formData.diabetes,i="yes"===t.formData.bariatricSurgery,r=(0,W.C)(a,i),n={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,programName:r};return await (0,k.Y)(n)}),input:e=>{let{context:t}=e;return t},onDone:[{actions:"assignFlyteUserData",target:$.UpdateContact}],onError:"#".concat($.OnboardingUserError)}},[$.UpdateContact]:{invoke:{src:(0,Y.Sx)(async e=>{let{input:t}=e,a={contactId:t.contactData.contactId,evolvePatientID:t.flyteUserData.patientId};return await (0,U.CI)(a)}),input:e=>{let{context:t}=e;return t},onDone:[{guard:"isAthenaRecordCreated",target:"#".concat($.CreatePassword)},{target:"#".concat($.OnboardingUserError)}],onError:"#".concat($.OnboardingUserError)}},[$.Error]:{on:{SUBMIT:{actions:["assignUserConsentStatus"],target:$.Submitting}}}}},[$.CreatePassword]:{id:$.CreatePassword,initial:$.Idle,states:{[$.Idle]:{on:{SUBMIT:{actions:"assignPasswordData",target:$.Submitting}}},[$.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($.RequestLabs),onError:{target:$.Error,actions:"assignError"}}},[$.Error]:{on:{SUBMIT:{actions:["resetError","assignPasswordData"],target:$.Submitting}}}}},[$.OnboardingChecklist]:{id:$.OnboardingChecklist,on:{SUBMIT:{target:"#".concat($.ReviewConsents)}}},[$.RequestLabs]:{id:$.RequestLabs,on:{PROCEED_TO_SUBMIT_LABS:"#".concat($.SubmitLabs),LAB_REQUESTED:{target:"#".concat($.AppDownload),actions:"assignLabLocation"},SUBMIT_LABS_LATER:{actions:"assignLabsSkipped",target:"#".concat($.AppDownload)}}},[$.SubmitLabs]:{id:$.SubmitLabs,on:{GO_BACK_TO_REQUEST_LABS:"#".concat($.RequestLabs),LAB_SUBMITTED:{actions:"registerLabsUploaded",target:"#".concat($.AppDownload)},SUBMIT_LABS_LATER:{actions:"assignLabsSkipped",target:"#".concat($.AppDownload)}}},[$.AppDownload]:{id:$.AppDownload},[$.ApplicationReview]:{id:$.ApplicationReview},[$.OnboardingUserError]:{id:$.OnboardingUserError},[$.ApplicationComplete]:{id:$.ApplicationComplete},[$.ApplicationDetected]:{id:$.ApplicationDetected},[$.EligibilityUnmet]:{id:$.EligibilityUnmet,initial:$.Idle,states:{[$.Idle]:{on:{SUBMIT:{target:$.Submitting,actions:"updateFormData"}}},[$.Submitting]:{invoke:{src:(0,Y.Sx)(async e=>{let{input:t}=e,a={...t,company:Z,leadStatus:O.XN.Ineligible,ineligibilityReason:O.hT.BMI,automateEvolveEnrollment:!1,insurance:"CCHS DE"};return await (0,B.t)(a)}),input:e=>{let{context:{formData:t}}=e;return t},onDone:$.Success,onError:$.Error}},[$.Success]:{},[$.Error]:{on:{SUBMIT:{actions:"updateFormData",target:$.Submitting}}}}}},on:{RESET:{target:"#".concat($.PreEligibility),actions:"reset"}}});var ei=a(69443);let er={[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]:ei.M[S.C.EmailVerification],[S.C.OnboardingChecklist]:ei.M[S.C.OnboardingChecklist],[S.C.CreatePassword]:ei.M[S.C.CreatePassword],[S.C.AppDownload]:ei.M[S.C.AppDownload],[S.C.ReviewConsents]:ei.M[S.C.ReviewConsents]};var en=a(82393);let eo=[E.UX.BenefitsWebsite,E.UX.CoworkerReferral,E.UX.PrescriptionDenial,E.UX.ProviderReferral,E.UX.WordOfMouth,E.UX.Other],es={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"},el={[S.C.ContactDetails]:{state:{options:en.rI},howDidYouFindUs:{options:eo}},[S.C.InsuranceDetails]:{insuranceMemberID:{...es,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:es}},ec=E.fz.ChristianaCare,ed=e=>{let{render:t}=e,[a,A]=(0,L.zl)(ea),R=(0,P.useMemo)(()=>(0,w.r)(a.value),[a.value]);(0,v.t)(R,ec);let T=(0,P.useCallback)(e=>{A({type:"SUBMIT",data:e})},[A]),M=(0,P.useCallback)(()=>{A({type:"BACK"})},[A]),j=(0,P.useCallback)(()=>{switch(R){case $.PreEligibility:return(0,i.jsx)(f.P,{configuration:{contentResources:er[S.C.PreEligibility]},onSubmit:T});case $.ContactDetails:return(0,i.jsx)(u.x,{configuration:{contentResources:er[S.C.ContactDetails],fields:el[S.C.ContactDetails]},onSubmit:T,defaultValues:a.context.formData});case $.EligibilityUnmet:return(0,i.jsx)(g.B,{configuration:{contentResources:er[S.C.EligibilityUnmet]},onSubmit:T,loading:a.matches({[$.EligibilityUnmet]:$.Submitting}),isEmailSent:a.matches({[$.EligibilityUnmet]:$.Success}),hasError:a.matches({[$.EligibilityUnmet]:$.Error})});case $.InsuranceDetails:return(0,i.jsx)(h.d,{configuration:{contentResources:er[S.C.InsuranceDetails],fields:el[S.C.InsuranceDetails]},onSubmit:T,onBack:M});case $.InsuranceDetailsReview:return(0,i.jsx)(b.h,{configuration:{contentResources:er[S.C.InsuranceDetailsReview],fields:el[S.C.InsuranceDetailsReview]},onSubmit:T,loading:a.matches({[$.InsuranceDetailsReview]:$.Submitting}),hasError:a.matches({[$.InsuranceDetailsReview]:$.Error}),defaultValues:a.context.formData});case $.ApplicationComplete:return(0,i.jsx)(o.Q,{...er[S.C.ApplicationComplete],email:a.context.formData.email});case $.ApplicationDetected:return(0,i.jsx)(s.r,{...er[S.C.ApplicationDetected],email:a.context.formData.email});case $.ApplicationReview:return(0,i.jsx)(l.l,{...er[S.C.ApplicationReview]});case $.EmailVerification:return(0,i.jsx)(p.e,{configuration:{contentResources:{title:er[S.C.EmailVerification](a.context.formData.email).title}},email:a.context.formData.email,hasError:a.matches({[$.EmailVerification]:$.Error}),loading:a.matches({[$.EmailVerification]:$.Submitting}),isUpdateEmailLoading:a.matches({[$.EmailVerification]:{[$.UpdateEmail]:$.Idle}}),hasUpdateEmailError:a.matches({[$.EmailVerification]:{[$.UpdateEmail]:$.Error}}),onSubmit:T,onResendCode:e=>A({type:"RESEND_EMAIL_VERIFICATION",data:{onSuccess:e}}),onEditEmail:(e,t)=>A({type:"UPDATE_EMAIL",data:{email:e,onSuccess:t}})});case $.OnboardingChecklist:return(0,i.jsx)(C.E,{showLabs:!0,configuration:{contentResources:er[S.C.OnboardingChecklist]},onSubmit:T});case $.ReviewConsents:return(0,i.jsx)(y.U,{configuration:{contentResources:er[S.C.ReviewConsents]},consents:a.context.consentsData.items,hasError:a.matches({[$.ReviewConsents]:$.Error}),loading:a.matches({[$.ReviewConsents]:$.FetchConsents})||a.matches({[$.ReviewConsents]:$.Submitting})||a.matches({[$.ReviewConsents]:$.UpdateContact}),onSubmit:T});case $.CreatePassword:return(0,i.jsx)(m.i,{configuration:{contentResources:er[S.C.CreatePassword]},loading:a.matches({[$.CreatePassword]:$.Submitting}),error:a.context.error,onSubmit:T});case $.AppDownload:return(0,i.jsx)(n.a,{title:"SUBMIT_LATER"===a.context.labs?er[S.C.AppDownload].titleLabSkipped:"LABS_UPLOADED"===a.context.labs?er[S.C.AppDownload].titleLabSubmitted:er[S.C.AppDownload].titleLabRequested,checklist:er[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 $.OnboardingUserError:return(0,i.jsx)(x.C,{});case $.RequestLabs:var e;return(0,i.jsx)(D.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 $.SubmitLabs:return(0,i.jsx)(I.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}},[R,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:R})]}),body:j(),currentWorkFlowStep:R})}},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(18681),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),D=a(33841),y=a(86687),I=a(89225),v=a(68792),E=a(65159),S=a(45352),w=a(39777),L=function(e){return e.CreateLead="createLead",e}(L||{});let P={...h.f,...L},A=I.Ek[D.fz.PyleFamilyInsurance],R={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},T=(0,E.mj)({types:{},guards:{isPreEligibilityMet:e=>{let{context:{bmi:t}}=e;return v.J0.pyleFamilyInsurance({bmi:t})},isApplicationDetected:y.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,v.Hv)({heightFeet:(0,v.sC)(a),heightInches:(0,v.sC)(i),weightPounds:(0,v.sC)(r)})}}),reset:(0,S.a)({...R})}}).createMachine({context:()=>R,id:"pyleMachine",initial:P.PreEligibility,states:{[P.PreEligibility]:{id:P.PreEligibility,initial:P.Idle,states:{[P.Idle]:{on:{SUBMIT:{target:P.Submitting,actions:"updateFormData"}}},[P.Submitting]:{entry:"assignBMI",always:[{target:"#".concat(P.ContactDetails),guard:"isPreEligibilityMet"},{target:"#".concat(P.EligibilityUnmet)}]}}},[P.ContactDetails]:{id:P.ContactDetails,initial:P.Idle,states:{[P.Idle]:{on:{SUBMIT:{actions:"updateFormData",target:P.Submitting}}},[P.Submitting]:{id:P.Submitting,initial:P.CreateLead,states:{[P.CreateLead]:{id:P.CreateLead,invoke:{src:(0,w.Sx)(async e=>{let{input:t}=e,a={...t.formData,company:A,evolveOrganization:D.PM["A Duie Pyle"],leadStatus:D.XN.EligibleWaiting,insurance:I.Ft[D.fz.PyleFamilyInsurance],automateEvolveEnrollment:!1};return await (0,f.t)(a)}),input:e=>{let{context:t}=e;return t},onDone:"#".concat(P.ApplicationReview),onError:[{guard:"isApplicationDetected",target:"#".concat(P.ApplicationDetected)},{target:"#".concat(P.Error)}]}}}},[P.Error]:{id:P.Error,on:{SUBMIT:{actions:"updateFormData",target:P.Submitting}}}}},[P.ApplicationReview]:{id:P.ApplicationReview},[P.ApplicationDetected]:{id:P.ApplicationDetected},[P.EligibilityUnmet]:{id:P.EligibilityUnmet,initial:P.Idle,states:{[P.Idle]:{on:{SUBMIT:{target:P.Submitting,actions:"updateFormData"}}},[P.Submitting]:{invoke:{src:(0,w.Sx)(async e=>{let{input:t}=e,a={...t,company:A,leadStatus:D.XN.Ineligible,ineligibilityReason:D.hT.BMI,automateEvolveEnrollment:!1,insurance:I.Ft[D.fz.PyleFamilyInsurance]};return await (0,f.t)(a)}),input:e=>{let{context:{formData:t}}=e;return t},onDone:P.Success,onError:P.Error}},[P.Success]:{},[P.Error]:{on:{SUBMIT:{target:P.Submitting}}}}}},on:{RESET:{target:"#".concat(P.PreEligibility),actions:"reset"}}});var M=a(69443);let j={[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 U=a(82393);let k=[g.UX.BenefitsWebsite,g.UX.CoworkerReferral,g.UX.ProviderReferral,g.UX.WordOfMouth,g.UX.Other],B={[p.C.ContactDetails]:{state:{options:U.rI},howDidYouFindUs:{options:k}}},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)(T),D=(0,x.useMemo)(()=>(0,b.r)(a.value),[a.value]);(0,m.t)(D,O);let y=(0,x.useCallback)(e=>{f({type:"SUBMIT",data:e})},[f]),I=(0,x.useCallback)(()=>{switch(D){case h.f.PreEligibility:return(0,i.jsx)(u.P,{configuration:{contentResources:j[p.C.PreEligibility]},onSubmit:y});case h.f.ContactDetails:return(0,i.jsx)(c.x,{configuration:{contentResources:j[p.C.ContactDetails],fields:B[p.C.ContactDetails]},loading:a.matches({[h.f.ContactDetails]:h.f.Submitting}),onSubmit:y,defaultValues:a.context.formData});case h.f.EligibilityUnmet:return(0,i.jsx)(d.B,{configuration:{contentResources:j[p.C.EligibilityUnmet]},onSubmit:y,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,{...j[p.C.ApplicationReview]});case h.f.ApplicationDetected:return(0,i.jsx)(n.r,{...j[p.C.ApplicationDetected],email:a.context.formData.email});default:return null}},[D,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:D,steps:F})]}),body:I(),currentWorkFlowStep:D})}},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(18681),m=a(39946),g=a(63583),p=a(53154),h=a(42037),b=a(70587),C=a(11427),x=a(86535),f=a(43483),D=a(93511),y=a(34305),I=a(80072),v=a(66885),E=a(62227),S=a(14232);Object.values(y.lk).filter(e=>e!==y.lk.SelfPay);var w=a(82393),L=a(45383),P=a(19847),A=a(88992),R=a(76692),T=a(43400),M=a(82492);let j="insuranceMemberID",U=(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:"}),k=e=>{let{label:t="1199SEIU Unique ID",placeholder:a="Unique ID Number",description:n=U,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)(j,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:j,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)(T.I,{"data-test":j,id:j,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(j,t,{shouldValidate:a})},...C(j,{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:j})]})},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,P.a)(),u=c.watch(R.uQ)===y.RS.SelfPay,m=c.watch(R.ag)===y.lk.Other;(0,S.useEffect)(()=>{u&&(c.resetField(R.ag),c.resetField(R.JB))},[u,c]),(0,S.useEffect)(()=>{c.resetField(R.E6)},[c.watch(R.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)(L.X,{as:"form",onSubmit:c.handleSubmit(n),noValidate:!0,children:[(0,i.jsx)(L.X.Side,{gap:0,flex:{base:"none",lg:1},children:s.title}),(0,i.jsxs)(L.X.Form,{children:[(null==l?void 0:l.insuranceCoverage)&&(0,i.jsx)(R.Xq,{isDisabled:a}),(null==l?void 0:l.insurance)&&(0,i.jsx)(R._8,{isDisabled:a||u,isRequired:!u,...null==l?void 0:l.insurance},u.toString()),m&&(0,i.jsx)(R.jP,{isDisabled:a,...null==l?void 0:l.insuranceOther}),(0,i.jsx)(k,{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),V=a(38360),H=a(39648),X=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(38088),ee=a(65159),et=a(39777),ea=a(45352),ei=a(63826);let er=e=>e===ei.w.FULL_MATCH||e===ei.w.ELIGIBLE_MATCH||e===ei.w.PERSON_MATCH;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,ee.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})&&!er(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,et.Sx)(async e=>{let{input:t}=e,a={...t,insurance:Q.w[q.fz["1199SEIU"]],benefitProgram:Q.Nl[q.fz["1199SEIU"]]};return await (0,H.w)(a)}),input:e=>{let{context:{formData:t}}=e;return t},onDone:[{actions:(0,ea.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,et.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,V.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,et.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:(e=>{switch(e){case ei.w.INSURANCE_MATCH:case ei.w.EXPIRED:case ei.w.NOT_FOUND:return y.XN.EligibleWaiting;case ei.w.PERSON_MATCH:case ei.w.FULL_MATCH:case ei.w.ELIGIBLE_MATCH:default:return}})(a.eligibilityCheckMatchType),automateEvolveEnrollment:er(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,et.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,ea.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,et.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,et.Sx)(async e=>{let{input:t}=e,a={contactId:t.contactId,email:t.email};return await (0,V.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,et.Sx)(async()=>await (0,_.i)()),onDone:{actions:"assignConsents",target:eo.Idle},onError:eo.Error}},[eo.Submitting]:{invoke:{src:(0,et.Sx)(async e=>{let{input:t}=e,a="yes"===t.formData.diabetes,i="yes"===t.formData.bariatricSurgery,r=(0,Z.C)(a,i),n={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,programName:r};return await (0,X.Y)(n)}),input:e=>{let{context:t}=e;return t},onDone:[{actions:"assignFlyteUserData",target:eo.UpdateContact}],onError:"#".concat(eo.OnboardingUserError)}},[eo.UpdateContact]:{invoke:{src:(0,et.Sx)(async e=>{let{input:t}=e,a={contactId:t.contactData.contactId,evolvePatientID:t.flyteUserData.patientId};return await (0,V.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,et.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,et.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={[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.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."})},[I.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+."})]})},[I.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."]})]})},[I.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?"})]})},[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.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."})},[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."})]})},[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]:eu.M[I.C.EmailVerification],[I.C.OnboardingChecklist]:eu.M[I.C.OnboardingChecklist],[I.C.CreatePassword]:eu.M[I.C.CreatePassword],[I.C.AppDownload]:eu.M[I.C.AppDownload],[I.C.ReviewConsents]:eu.M[I.C.ReviewConsents]},eg=[y.UX.BenefitsWebsite,y.UX.CoworkerReferral,y.UX.PrescriptionDenial,y.UX.ProviderReferral,y.UX.WordOfMouth,y.UX.Other],ep={[I.C.ContactDetails]:{state:{options:w.rI},howDidYouFindUs:{options:eg}},[I.C.InsuranceDetails]:{insuranceMemberID:{}},[I.C.InsuranceDetailsReview]:{insuranceMemberID:{}}},eh=e=>{let{render:t}=e,[a,w]=(0,E.zl)(ed),L=(0,S.useMemo)(()=>(0,v.r)(a.value),[a.value]);(0,D.t)(L);let P=(0,S.useCallback)(e=>{w({type:"SUBMIT",data:e})},[w]),A=(0,S.useCallback)(()=>{w({type:"BACK"})},[w]),R=(0,S.useCallback)(()=>{switch(L){case eo.PreEligibility:return(0,i.jsx)(x.P,{configuration:{contentResources:em[I.C.PreEligibility]},onSubmit:P});case eo.ContactDetails:return(0,i.jsx)(u.x,{configuration:{contentResources:em[I.C.ContactDetails],fields:ep[I.C.ContactDetails]},onSubmit:P,defaultValues:a.context.formData});case eo.EligibilityUnmet:return(0,i.jsx)(g.B,{configuration:{contentResources:em[I.C.EligibilityUnmet]},onSubmit:P,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[I.C.InsuranceDetails],fields:ep[I.C.InsuranceDetails]},onSubmit:P,onBack:A});case eo.InsuranceDetailsReview:return(0,i.jsx)(h.h,{configuration:{contentResources:em[I.C.InsuranceDetailsReview],fields:ep[I.C.InsuranceDetailsReview]},onSubmit:P,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[I.C.ApplicationComplete],email:a.context.formData.email});case eo.ApplicationDetected:return(0,i.jsx)(s.r,{...em[I.C.ApplicationDetected],email:a.context.formData.email});case eo.ApplicationReview:return(0,i.jsx)(l.l,{...em[I.C.ApplicationReview]});case eo.EmailVerification:return(0,i.jsx)(p.e,{configuration:{contentResources:{title:em[I.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:P,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[I.C.OnboardingChecklist]},onSubmit:P});case eo.ReviewConsents:return(0,i.jsx)(f.U,{configuration:{contentResources:em[I.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:P});case eo.CreatePassword:return(0,i.jsx)(m.i,{configuration:{contentResources:em[I.C.CreatePassword]},loading:a.matches({[eo.CreatePassword]:eo.Submitting}),error:a.context.error,onSubmit:P});case eo.AppDownload:return(0,i.jsx)(n.a,{title:em[I.C.AppDownload].title,checklist:em[I.C.AppDownload].checklist});case eo.OnboardingUserError:return(0,i.jsx)(C.C,{});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:y.fz.Flyte}),(0,i.jsx)(r.Divider,{orientation:"vertical",alignSelf:"stretch",height:"auto"}),(0,i.jsx)(c.E,{partner:y.fz["1199SEIU"]})]}),(0,i.jsx)(d.f,{currentStep:L})]}),body:R(),currentWorkFlowStep:L})}},77944:(e,t,a)=>{a.d(t,{Y:()=>i.Y});var i=a(87665)},92261:(e,t,a)=>{a.d(t,{q:()=>eL});var i=a(37876),r=a(59004),n=a(91366),o=a(48934),s=a(14901),l=a(16741),c=a(533),d=a(39946),u=a(63583),m=a(53154),g=a(30435),p=a(42037),h=a(70587),b=a(11427),C=a(86535),x=a(43483),f=a(93511),D=a(34305),y=a(80072),I=a(66885),v=a(62227),E=a(14232),S=a(37477),w=a(82393),L=a(45383),P=a(84441),A=a(15986),R=a(48496),T=a(19847),M=a(88992),j=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 U="referralProgram",k=Object.values(j),B=e=>{let{options:t=k,isRequired:a,isDisabled:r,defaultSelectedItem:n,placeholder:o}=e,{watch:s,control:l}=(0,M.xW)(),[c,d]=(0,E.useState)(""),u=c?t.filter(e=>e.toLowerCase().includes(c.toLowerCase())):t;return(0,i.jsxs)(S.Flex,{direction:"column",gap:"spacer-2",children:[(0,i.jsxs)(S.Box,{children:[(0,i.jsx)(S.Text,{as:"label",variant:"text-body-large-bold",color:"text-primary-negative",htmlFor:U,children:"Were you referred to FlyteHealth?"}),(0,i.jsx)(S.Text,{variant:"text-body-meta-regular",color:"text-secondary",children:"If yes, select the healthcare organization, clinic, or provider."})]}),(0,i.jsx)(M.xI,{control:l,name:U,rules:{required:a},render:e=>{let{field:{onChange:t,onBlur:a}}=e;return(0,i.jsxs)(S.Autocomplete,{id:"".concat(U,"-autocomplete"),items:u,onInputValueChange:e=>{let{inputValue:a}=e;d(a||""),a||t(a)},onSelectedItemChange:e=>{let{selectedItem:a}=e;return t(a)},initialSelectedItem:n,selectedItem:s(U)||"",children:[(0,i.jsx)(S.Autocomplete.Input,{"data-test":U,id:U,size:"l",placeholder:o,clearButtonMode:r?"never":"has-value",leadingIcon:(0,i.jsx)(S.IconSearch,{}),variant:"flushed",isDisabled:r,onBlur:a}),(0,i.jsx)(S.Autocomplete.List,{"data-test":"".concat(U,"List"),zIndex:2,renderItem:e=>(0,i.jsx)(S.Text,{variant:"text-body-regular",children:e}),overflowY:"auto",maxHeight:"13.5rem"})]})}})]})},F=[D.yj.California,D.yj.Connecticut,D.yj.Massachusetts,D.yj["New York"],D.yj["Rhode Island"],D.yj["New Hampshire"],D.yj.Vermont],O=[D.yj.California,D.yj.Colorado,D.yj.Oregon,D.yj.Georgia,D.yj.Hawaii,D.yj.Maryland,D.yj.Virginia,D.yj.Washington,D.yj["Washington D.C."]],N=e=>{let{configuration:t,loading:a=!1,onSubmit:r,defaultValues:n}=e,{contentResources:o,fields:s}=t,l=(0,M.mN)({mode:"onBlur",defaultValues:n,shouldUnregister:!1}),c=(0,E.useRef)(null==n?void 0:n.state),d=(0,E.useRef)(null==n?void 0:n.referralProgram),{watch:u}=l,m=(0,T.a)(),g=u(R.b),p=u(U),h=g&&(F.includes(g)||O.includes(g)),b=!g||a||!h,C=g&&!h?"There are no organizations or clinics in your state":"Select referral location",x=!!p,f=!g||a||h&&!x,D=h&&!x,y="Not referred"===p||""===p?s.howDidYouFindUs.options.notReferrerOptions:s.howDidYouFindUs.options.referrerOptions;(0,E.useEffect)(()=>{p!==d.current&&(l.resetField(A.l,{defaultValue:""}),d.current=p)},[p,l]),(0,E.useEffect)(()=>{g!==c.current&&(l.resetField(U,{defaultValue:""}),l.resetField(A.l,{defaultValue:""}),c.current=g)},[g,l]);let I=()=>(0,i.jsx)(S.Button,{type:"submit",size:{base:"m",lg:"l"},isDisabled:!l.formState.isValid,width:"100%",isLoading:a,trailingIcon:(0,i.jsx)(S.IconArrowRight,{}),"aria-label":"Continue",children:"Continue"});return(0,i.jsx)(M.Op,{...l,children:(0,i.jsxs)(L.X,{as:"form",onSubmit:l.handleSubmit(r),noValidate:!0,children:[(0,i.jsx)(L.X.Side,{gap:0,flex:{base:"none",lg:1},children:o.title}),(0,i.jsxs)(L.X.Form,{children:[(0,i.jsx)(w.d5,{isDisabled:a}),(0,i.jsx)(w.LP,{inputProps:{isDisabled:a}}),(0,i.jsxs)(S.Flex,{direction:{base:"column",lg:"row"},gap:"spacer-9",children:[(0,i.jsx)(P.PV,{isDisabled:a,flex:1}),(null==s?void 0:s.state)&&(0,i.jsx)(R.X,{isDisabled:a,flex:1,options:s.state.options})]}),(0,i.jsx)(B,{isDisabled:b,isRequired:D,placeholder:C,options:O.includes(g)?[j.KaiserPermanente]:Object.values(j).filter(e=>e!==j.KaiserPermanente&&e!==j.Other&&e!==j.NotReferred)}),(0,i.jsx)(A.h,{isDisabled:f,options:y}),(0,i.jsx)(P.Ci,{isDisabled:a,pb:{base:"spacer-24",lg:0}}),m?(0,i.jsx)(w.cI,{children:I()}):I()]})]})})};var _=a(11969),V=a(10758),H=a(85007),X=a(20411),z=a(31346),W=a(38360),q=a(77944),Y=a(12342);let K=async e=>{let t=(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"}})(e);return await Y.A.post("/api/hra-questionnaire",t)};var G=a(47353),Q=a(83928),J=a(33841),$=a(13751),Z=a(92323),ee=a(86687),et=a(89225),ea=a(97793),ei=a(68792),er=a(38088),en=a(65159),eo=a(39777),es=a(45352),el=a(99221);let ec=e=>e===j.KaiserPermanente?D.PM["Kaiser Permanente"]:D.PM["SoNE Health"],ed=(e,t)=>{if(e===j.KaiserPermanente)return t},eu=(e,t)=>{switch(e){case D.lk["1199SEIU"]:return!0;case D.lk.Aetna:case D.lk.Cigna:return[D.yj["New York"],D.yj["New Jersey"],D.yj.Connecticut].includes(t);case D.lk.BCBS:case D.lk.United:return t===D.yj["New York"];case D.lk.BCBSPPO:case D.lk.Other:case D.lk["Kaiser Colorado"]:case D.lk["Kaiser Georgia"]:case D.lk["Kaiser Hawaii"]:case D.lk["Kaiser MidAtlantic"]:case D.lk["Kaiser Northern California"]:case D.lk["Kaiser Northwest"]:case D.lk["Kaiser Southern California"]:case D.lk["Kaiser Washington"]:case D.lk["Kaiser Washington Options"]:default:return!1}},em=e=>{let{bmi:t,comorbidity:a,insurance:i,insuranceCoverage:r,state:n}=e;return(!(t>=27)||!(t<=30)||a!==el.Y9.Yes)&&r!==D.RS.SelfPay&&eu(i,n)},eg=e=>{let{insurance:t,insuranceCoverage:a}=e;return a===D.RS.SelfPay?D.lk.SelfPay:t};var ep=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}(ep||{});let eh={...ea.f,...ep},eb=et.Ek[J.fz.Flyte],eC={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},ex={...$.AU,...$.gQ,...$.pE,...$.UH,...$.yF,...$.n6,...$.uN,...$.yS,...$.RW,...(0,$.rS)(eC)},ef=(0,en.mj)({types:{},guards:{isPreEligibilityMet:e=>{let{context:{formData:t,bmi:a}}=e;return ei.J0.flyte({bmi:a,comorbidity:t.comorbidity})},isApplicationReviewRequired:e=>{let{context:{formData:t,bmi:a}}=e;return!Q.A.shouldBypassIsApplicationReviewRequired({email:t.email})&&!em({bmi:a,comorbidity:t.comorbidity,insuranceCoverage:t.insuranceCoverage,insurance:t.insurance,state:t.state})},isApplicationDetected:ee.L,isInsurerSelected:e=>{let{context:{formData:t}}=e;return!!t.insurance&&t.insurance!==J.lk.Other},isAthenaRecordCreated:Z.z},actions:ex}).createMachine({context:()=>eC,id:"flyteMachine",initial:eh.PreEligibility,states:{[eh.PreEligibility]:{id:eh.PreEligibility,initial:eh.Idle,states:{[eh.Idle]:{on:{SUBMIT:{target:eh.Submitting,actions:"updateFormData"}}},[eh.Submitting]:{entry:"assignBMI",always:[{guard:"isPreEligibilityMet",target:"#".concat(eh.ContactDetails)},{target:"#".concat(eh.EligibilityUnmet)}]}}},[eh.ContactDetails]:{id:eh.ContactDetails,initial:eh.Idle,states:{[eh.Idle]:{on:{SUBMIT:{target:"#".concat(eh.InsuranceDetails),actions:"updateFormData"}}}}},[eh.InsuranceDetails]:{id:eh.InsuranceDetails,initial:eh.Idle,states:{[eh.Idle]:{on:{BACK:{target:"#".concat(eh.ContactDetails)},SUBMIT:{target:"#".concat(eh.InsuranceDetailsReview),actions:"updateFormData"}}}}},[eh.InsuranceDetailsReview]:{id:eh.InsuranceDetailsReview,initial:eh.Idle,states:{[eh.Idle]:{on:{SUBMIT:{actions:"updateFormData",target:eh.Submitting}}},[eh.Submitting]:{initial:eh.DetermineBenefitsOrLead,states:{[eh.DetermineBenefitsOrLead]:{id:eh.DetermineBenefitsOrLead,always:[{guard:"isInsurerSelected",target:eh.CheckBenefits},{target:eh.CreateLead}]},[eh.CheckBenefits]:{id:eh.CheckBenefits,invoke:{src:(0,eo.Sx)(async e=>{let{input:t}=e,a={...t,payerCode:et.dT[t.insurance]};return await (0,X.R)(a)}),input:e=>{let{context:{formData:t}}=e;return t},onDone:{actions:(0,es.a)({benefitsCheck:e=>{let{event:t}=e;return t.output.data}}),target:eh.DetermineContactOrLead},onError:eh.DetermineContactOrLead}},[eh.DetermineContactOrLead]:{id:eh.DetermineContactOrLead,always:[{guard:"isApplicationReviewRequired",target:eh.CreateLead},{target:eh.CreateContact}]},[eh.CreateContact]:{id:eh.CreateContact,invoke:{src:(0,eo.Sx)(async e=>{let{input:t}=e,a={...t.formData,referralProgram:t.formData.referralProgram,...t.benefitsCheck&&{benefitsCheck:t.benefitsCheck},company:eb,insurance:eg({insuranceCoverage:t.formData.insuranceCoverage,insurance:t.formData.insurance}),evolveOrganization:ec(t.formData.referralProgram),participantDepartmentorOrg:ed(t.formData.referralProgram,t.formData.insurance),accountId:et.f3[J.fz.Flyte]};return await (0,W.vY)(a)}),input:e=>{let{context:t}=e;return t},onDone:{actions:"assignContactData",target:"#".concat(eh.EmailVerification)},onError:[{guard:"isApplicationDetected",target:"#".concat(eh.ApplicationDetected)},{target:"#".concat(eh.InsuranceDetailsReview,".").concat(eh.Error)}]}},[eh.CreateLead]:{id:eh.CreateLead,invoke:{src:(0,eo.Sx)(async e=>{let{input:t}=e,a={...t.formData,referralProgram:t.formData.referralProgram,...t.benefitsCheck&&{benefitsCheck:t.benefitsCheck},company:eb,insurance:eg({insuranceCoverage:t.formData.insuranceCoverage,insurance:t.formData.insurance}),evolveOrganization:ec(t.formData.referralProgram),ineligibilityReason:(e=>{let{insuranceCoverage:t,insurance:a,state:i}=e;return t===D.RS.SelfPay?D.hT.CashPay:eu(a,i)?void 0:D.hT.Insurance})({insuranceCoverage:t.formData.insuranceCoverage,insurance:t.formData.insurance,state:t.formData.state}),leadStatus:(e=>{let{bmi:t,comorbidity:a,insuranceCoverage:i,insurance:r,state:n}=e;if(!em({bmi:t,comorbidity:a,insurance:r,insuranceCoverage:i,state:n}))return D.XN.EligibleWaiting})({bmi:t.bmi,comorbidity:t.formData.comorbidity,insuranceCoverage:t.formData.insuranceCoverage,insurance:t.formData.insurance,state:t.formData.state}),automateEvolveEnrollment:em({bmi:t.bmi,comorbidity:t.formData.comorbidity,insuranceCoverage:t.formData.insuranceCoverage,insurance:t.formData.insurance,state:t.formData.state}),participantDepartmentorOrg:ed(t.formData.referralProgram,t.formData.insurance)};return await (0,G.t)(a)}),input:e=>{let{context:t}=e;return t},onDone:[{guard:"isApplicationReviewRequired",target:"#".concat(eh.ApplicationReview)},{target:"#".concat(eh.ApplicationComplete)}],onError:[{guard:"isApplicationDetected",target:"#".concat(eh.ApplicationDetected)},{target:"#".concat(eh.InsuranceDetailsReview,".").concat(eh.Error)}]}}}},[eh.Error]:{id:"".concat(eh.InsuranceDetailsReview,".").concat(eh.Error),on:{SUBMIT:{actions:["updateFormData","resetBenefitsCheck"],target:eh.Submitting}}}}},[eh.EmailVerification]:{id:eh.EmailVerification,initial:eh.Idle,states:{[eh.Idle]:{id:"".concat(eh.EmailVerification,".").concat(eh.Idle),on:{SUBMIT:{actions:"assignOtpCode",target:eh.Submitting},RESEND_EMAIL_VERIFICATION:{target:eh.Idle,reenter:!0},UPDATE_EMAIL:{target:eh.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,eo.Sx)(async e=>{let{input:t}=e,a={email:t.email,firstName:t.firstName};return{token:(await (0,V.v)(a)).data.token,onSuccess:t.onSuccess}}),onDone:{actions:[(0,es.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:eh.Error}},[eh.Submitting]:{invoke:{src:(0,eo.Sx)(async e=>{let{input:t}=e,a={email:t.formData.email,token:t.otpData.token,otp:t.otpData.otp};return await (0,H.R)(a)}),input:e=>{let{context:t}=e;return t},onDone:"#".concat(eh.OnboardingChecklist),onError:eh.Error}},[eh.Error]:{on:{SUBMIT:{actions:"assignOtpCode",target:eh.Submitting},RESEND_EMAIL_VERIFICATION:{target:eh.Idle},UPDATE_EMAIL:{target:eh.UpdateEmail}}},[eh.UpdateEmail]:{initial:eh.Idle,states:{[eh.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,eo.Sx)(async e=>{let{input:t}=e,a={contactId:t.contactId,email:t.email};return await (0,W.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(eh.EmailVerification,".").concat(eh.Idle)},onError:eh.Error}},[eh.Error]:{on:{SUBMIT:{target:"#".concat(eh.EmailVerification,".").concat(eh.Idle)},RESEND_EMAIL_VERIFICATION:{target:"#".concat(eh.EmailVerification,".").concat(eh.Idle)},UPDATE_EMAIL:{target:eh.Idle}}}}}}},[eh.ReviewConsents]:{id:eh.ReviewConsents,initial:eh.FetchConsents,states:{[eh.Idle]:{on:{SUBMIT:{actions:["assignUserConsentStatus"],target:eh.Submitting}}},[eh.FetchConsents]:{invoke:{src:(0,eo.Sx)(async()=>await (0,z.i)()),onDone:{actions:"assignConsents",target:eh.Idle},onError:eh.Error}},[eh.Submitting]:{invoke:{src:(0,eo.Sx)(async e=>{let{input:t}=e,a="yes"===t.formData.diabetes,i="yes"===t.formData.bariatricSurgery,r=(0,er.C)(a,i),n={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:J.PM.Flyte,consents:t.consentsData.userConsentStatus,programName:r};return await (0,q.Y)(n)}),input:e=>{let{context:t}=e;return t},onDone:[{actions:"assignFlyteUserData",target:eh.SubmitHRA}],onError:"#".concat(eh.OnboardingUserError)}},[eh.SubmitHRA]:{id:eh.SubmitHRA,invoke:{src:(0,eo.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 K(a)}),input:e=>{let{context:t}=e;return t},onDone:{target:eh.UpdateContact},onError:{target:eh.UpdateContact}}},[eh.UpdateContact]:{invoke:{src:(0,eo.Sx)(async e=>{let{input:t}=e,a={contactId:t.contactData.contactId,evolvePatientID:t.flyteUserData.patientId};return await (0,W.CI)(a)}),input:e=>{let{context:t}=e;return t},onDone:[{guard:"isAthenaRecordCreated",target:"#".concat(eh.CreatePassword)},{target:"#".concat(eh.OnboardingUserError)}],onError:"#".concat(eh.OnboardingUserError)}},[eh.Error]:{on:{SUBMIT:{actions:["assignUserConsentStatus"],target:eh.Submitting}}}}},[eh.CreatePassword]:{id:eh.CreatePassword,initial:eh.Idle,states:{[eh.Idle]:{on:{SUBMIT:{actions:"assignPasswordData",target:eh.Submitting}}},[eh.Submitting]:{invoke:{src:(0,eo.Sx)(async e=>{let{input:t}=e,a={email:t.formData.email,password:t.passwordData.password,confirmPassword:t.passwordData.confirmPassword};return await (0,_.I)(t.flyteUserData.verifyToken,a)}),input:e=>{let{context:t}=e;return t},onDone:"#".concat(eh.AppDownload),onError:{target:eh.Error,actions:"assignError"}}},[eh.Error]:{on:{SUBMIT:{actions:["resetError","assignPasswordData"],target:eh.Submitting}}}}},[eh.OnboardingChecklist]:{id:eh.OnboardingChecklist,on:{SUBMIT:{target:"#".concat(eh.ReviewConsents)}}},[eh.AppDownload]:{id:eh.AppDownload},[eh.ApplicationReview]:{id:eh.ApplicationReview},[eh.OnboardingUserError]:{id:eh.OnboardingUserError},[eh.ApplicationComplete]:{id:eh.ApplicationComplete},[eh.ApplicationDetected]:{id:eh.ApplicationDetected},[eh.EligibilityUnmet]:{id:eh.EligibilityUnmet,initial:eh.Idle,states:{[eh.Idle]:{on:{SUBMIT:{target:eh.Submitting,actions:"updateFormData"}}},[eh.Submitting]:{invoke:{src:(0,eo.Sx)(async e=>{let{input:t}=e,a={...t,company:et.Ek[J.fz.Flyte],leadStatus:J.XN.Ineligible,ineligibilityReason:J.hT.BMI,automateEvolveEnrollment:!1};return await (0,G.t)(a)}),input:e=>{let{context:{formData:t}}=e;return t},onDone:eh.Success,onError:eh.Error}},[eh.Success]:{},[eh.Error]:{on:{SUBMIT:{target:eh.Submitting}}}}}},on:{RESET:{target:"#".concat(eh.PreEligibility),actions:"reset"}}});var eD=a(69443);let ey={[y.C.PreEligibility]:{title:(0,i.jsxs)(S.TextPairing,{variant:"textpairing-header-2XL",children:[(0,i.jsxs)(S.TextPairing.Label,{color:"text-secondary-negative",children:["We're so glad you're here!"," ",(0,i.jsx)(S.Text,{as:"span",variant:"text-header-2XL",color:"text-primary",children:"Let's make sure you're eligible for FlyteHealth."})]}),(0,i.jsx)(S.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)(S.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."})},[y.C.EligibilityUnmet]:{title:(0,i.jsxs)(S.TextPairing,{variant:"textpairing-header-2XL",children:[(0,i.jsx)(S.TextPairing.Label,{color:"text-secondary-negative",children:"Unfortunately, you are not eligible to join FlyteHealth at this time."}),(0,i.jsx)(S.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+"})]})},[y.C.ContactDetails]:{title:(0,i.jsxs)(S.TextPairing,{variant:"textpairing-header-2XL",children:[(0,i.jsx)(S.TextPairing.Label,{color:"text-secondary-negative",children:"Congratulations! You're eligible for the FlyteHealth program"}),(0,i.jsx)(S.TextPairing.SubLabel,{color:"text-secondary",children:"Tell us a little more about yourself."})]})},[y.C.InsuranceDetails]:{title:(0,i.jsxs)(S.Text,{variant:"text-header-2XL",color:"text-secondary-negative",children:["One more thing:"," ",(0,i.jsx)(S.Text,{as:"span",variant:"text-header-2XL",color:"text-primary",children:"Do you have health insurance?"})]})},[y.C.InsuranceDetailsReview]:{title:(0,i.jsxs)(S.TextPairing,{variant:"textpairing-header-2XL",children:[(0,i.jsx)(S.TextPairing.Label,{children:"Let's review: Is your info correct?"}),(0,i.jsx)(S.TextPairing.SubLabel,{color:"text-secondary",children:"Please double-check the information you provided to make sure everything is correct."})]})},[y.C.ApplicationComplete]:{title:(0,i.jsxs)(S.TextPairing,{variant:"textpairing-header-2XL",children:[(0,i.jsx)(S.TextPairing.Label,{color:"text-secondary-negative",children:"Welcome aboard! We're so excited you're here."}),(0,i.jsx)(S.TextPairing.SubLabel,{color:"text-secondary",children:"Next, we need to confirm your email. Click the link we sent to:"})]}),description:(0,i.jsx)(S.Text,{mt:"spacer-8",color:"text-secondary",variant:"text-body-regular",children:"Can’t find the email? Make sure to check your Spam folder."})},[y.C.ApplicationReview]:{title:(0,i.jsxs)(S.TextPairing,{variant:"textpairing-header-2XL",children:[(0,i.jsx)(S.TextPairing.Label,{color:"text-primary",children:"You're almost finished!"}),(0,i.jsx)(S.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."})]})},[y.C.ApplicationDetected]:{title:(0,i.jsx)(S.Text,{variant:"text-header-2XL",color:"text-primary",children:"We found an existing account for:"}),description:(0,i.jsx)(S.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."})},[y.C.EmailVerification]:eD.M[y.C.EmailVerification],[y.C.OnboardingChecklist]:eD.M[y.C.OnboardingChecklist],[y.C.CreatePassword]:eD.M[y.C.CreatePassword],[y.C.AppDownload]:eD.M[y.C.AppDownload],[y.C.ReviewConsents]:eD.M[y.C.ReviewConsents]},eI=[D.lk["1199SEIU"],D.lk.Aetna,D.lk.BCBS,D.lk.BCBSPPO,D.lk.Cigna,D.lk["Kaiser Colorado"],D.lk["Kaiser Georgia"],D.lk["Kaiser Hawaii"],D.lk["Kaiser MidAtlantic"],D.lk["Kaiser Northern California"],D.lk["Kaiser Northwest"],D.lk["Kaiser Southern California"],D.lk["Kaiser Washington"],D.lk["Kaiser Washington Options"],D.lk.United,D.lk.Other],ev=[D.UX.Brochure,D.UX.Email,D.UX.Mailer,D.UX.OnsiteMonitor,D.UX.Poster,D.UX.ProviderReferral,D.UX.Other],eE=[D.UX.Brochure,D.UX.CoworkerReferral,D.UX.Email,D.UX.GoogleAd,D.UX.Poster,D.UX.PrintAd,D.UX.ProviderReferral,D.UX.SocialMedia,D.UX.TradeShow,D.UX.TVAd,D.UX.WebSearch,D.UX.WordOfMouth,D.UX.Other],eS={[y.C.ContactDetails]:{state:{options:w.rI},howDidYouFindUs:{options:{referrerOptions:ev,notReferrerOptions:eE}}},[y.C.InsuranceDetails]:{insuranceCoverage:{},insurance:{label:"Insurance Company",insuranceCarriers:eI},insuranceOther:{description:(0,i.jsx)(S.Text,{variant:"text-body-meta-regular",color:"text-secondary",children:"Enter the name of your insurance company"})},insuranceMemberID:{}},[y.C.InsuranceDetailsReview]:{insurance:{label:"Insurance Company",insuranceCarriers:eI}}},ew=D.fz.Flyte,eL=e=>{let{render:t}=e,[a,D]=(0,v.zl)(ef),S=(0,E.useMemo)(()=>(0,I.r)(a.value),[a.value]);(0,f.t)(S,ew);let w=(0,E.useCallback)(e=>{D({type:"SUBMIT",data:e})},[D]),L=(0,E.useCallback)(()=>{D({type:"BACK"})},[D]),P=(0,E.useCallback)(()=>{switch(S){case eh.PreEligibility:return(0,i.jsx)(C.P,{configuration:{contentResources:ey[y.C.PreEligibility]},onSubmit:w});case eh.ContactDetails:return(0,i.jsx)(N,{configuration:{contentResources:ey[y.C.ContactDetails],fields:eS[y.C.ContactDetails]},onSubmit:w,defaultValues:a.context.formData});case eh.EligibilityUnmet:return(0,i.jsx)(u.B,{configuration:{contentResources:ey[y.C.EligibilityUnmet]},onSubmit:w,loading:a.matches({[eh.EligibilityUnmet]:eh.Submitting}),isEmailSent:a.matches({[eh.EligibilityUnmet]:eh.Success}),hasError:a.matches({[eh.EligibilityUnmet]:eh.Error})});case eh.InsuranceDetails:return(0,i.jsx)(g.d,{configuration:{contentResources:ey[y.C.InsuranceDetails],fields:eS[y.C.InsuranceDetails]},onSubmit:w,onBack:L});case eh.InsuranceDetailsReview:return(0,i.jsx)(p.h,{configuration:{contentResources:ey[y.C.InsuranceDetailsReview],fields:eS[y.C.InsuranceDetailsReview]},onSubmit:w,loading:a.matches({[eh.InsuranceDetailsReview]:eh.Submitting}),hasError:a.matches({[eh.InsuranceDetailsReview]:eh.Error}),defaultValues:a.context.formData});case eh.ApplicationComplete:return(0,i.jsx)(n.Q,{...ey[y.C.ApplicationComplete],email:a.context.formData.email});case eh.ApplicationReview:return(0,i.jsx)(s.l,{...ey[y.C.ApplicationReview]});case eh.ApplicationDetected:return(0,i.jsx)(o.r,{...ey[y.C.ApplicationDetected],email:a.context.formData.email});case eh.EmailVerification:return(0,i.jsx)(m.e,{configuration:{contentResources:{title:ey[y.C.EmailVerification](a.context.formData.email).title}},email:a.context.formData.email,hasError:a.matches({[eh.EmailVerification]:eh.Error}),loading:a.matches({[eh.EmailVerification]:eh.Submitting}),isUpdateEmailLoading:a.matches({[eh.EmailVerification]:{[eh.UpdateEmail]:eh.Idle}}),hasUpdateEmailError:a.matches({[eh.EmailVerification]:{[eh.UpdateEmail]:eh.Error}}),onSubmit:w,onResendCode:e=>D({type:"RESEND_EMAIL_VERIFICATION",data:{onSuccess:e}}),onEditEmail:(e,t)=>D({type:"UPDATE_EMAIL",data:{email:e,onSuccess:t}})});case eh.OnboardingChecklist:return(0,i.jsx)(h.E,{configuration:{contentResources:ey[y.C.OnboardingChecklist]},onSubmit:w});case eh.ReviewConsents:return(0,i.jsx)(x.U,{configuration:{contentResources:ey[y.C.ReviewConsents]},consents:a.context.consentsData.items,hasError:a.matches({[eh.ReviewConsents]:eh.Error}),loading:a.matches({[eh.ReviewConsents]:eh.FetchConsents})||a.matches({[eh.ReviewConsents]:eh.Submitting})||a.matches({[eh.ReviewConsents]:eh.UpdateContact})||a.matches({[eh.ReviewConsents]:eh.SubmitHRA}),onSubmit:w});case eh.CreatePassword:return(0,i.jsx)(d.i,{configuration:{contentResources:ey[y.C.CreatePassword]},loading:a.matches({[eh.CreatePassword]:eh.Submitting}),error:a.context.error,onSubmit:w});case eh.AppDownload:return(0,i.jsx)(r.a,{title:ey[y.C.AppDownload].title,checklist:ey[y.C.AppDownload].checklist});case eh.OnboardingUserError:return(0,i.jsx)(b.C,{});default:return null}},[S,a]);return t({header:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(l.E,{partner:ew}),(0,i.jsx)(c.f,{currentStep:S})]}),body:P(),currentWorkFlowStep:S})}},92749:(e,t,a)=>{a.d(t,{s:()=>n});var i=a(16741),r=a(34305);let n={[r.fz.CareCompass]:{asset:{src:i.k[r.fz.CareCompass],width:"64px",height:"64px",alt:"Care Compass Logo"},name:"Care Compass",description:"State of Connecticut Health Plan Members"},[r.fz.Aetna]:{asset:{src:i.k[r.fz.Aetna],width:"141px",height:"32px",alt:"Aetna Logo"},name:"State of Connecticut: Aetna",description:"Aetna MA for State of Connecticut Retirees"},[r.fz.PequotHealthCare]:{asset:{src:i.k[r.fz.PequotHealthCare],width:"103px",height:"40px",alt:"Pequot Health Care Logo"},name:"Mashantucket Pequot Tribal Nation",description:"Pequot Healthy Weight Program"},[r.fz.RiverSpringLiving]:{asset:{src:i.k[r.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"},[r.fz.PyleFamilyInsurance]:{asset:{src:i.k[r.fz.PyleFamilyInsurance],width:"157px",height:"48px",alt:"Pyle Family Insurance Logo"},name:"A. Duie Pyle",description:"Pyle Weight Management Program for Employees"},[r.fz.MDSave]:{asset:{src:i.k[r.fz.MDSave],width:"56px",height:"56px",alt:"MDsave Logo"},name:"MDsave",description:"Patients in partnership with MDsave"},[r.fz["1199SEIU"]]:{asset:{src:i.k[r.fz["1199SEIU"]],width:"211px",height:"122px",alt:"1199SEIU Logo"},name:"1199SEIU",description:"1199SEIU"}}},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(18681),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),D=a(33841),y=a(86687),I=a(89225),v=a(68792),E=a(65159),S=a(45352),w=a(39777),L=function(e){return e.CreateLead="createLead",e}(L||{});let P={...h.f,...L},A=I.Ek[D.fz.MDSave],R={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},T=(0,E.mj)({types:{},guards:{isPreEligibilityMet:e=>{let{context:{bmi:t,formData:a}}=e;return v.J0.mdSave({bmi:t,comorbidity:a.comorbidity})},isApplicationDetected:y.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,v.Hv)({heightFeet:(0,v.sC)(a),heightInches:(0,v.sC)(i),weightPounds:(0,v.sC)(r)})}}),reset:(0,S.a)({...R})}}).createMachine({context:()=>R,id:"mdSaveMachine",initial:P.PreEligibility,states:{[P.PreEligibility]:{id:P.PreEligibility,initial:P.Idle,states:{[P.Idle]:{on:{SUBMIT:{target:P.Submitting,actions:"updateFormData"}}},[P.Submitting]:{entry:"assignBMI",always:[{target:"#".concat(P.ContactDetails),guard:"isPreEligibilityMet"},{target:"#".concat(P.EligibilityUnmet)}]}}},[P.ContactDetails]:{id:P.ContactDetails,initial:P.Idle,states:{[P.Idle]:{on:{SUBMIT:{actions:"updateFormData",target:P.Submitting}}},[P.Submitting]:{id:P.Submitting,initial:P.CreateLead,states:{[P.CreateLead]:{id:P.CreateLead,invoke:{src:(0,w.Sx)(async e=>{let{input:t}=e,a={...t.formData,company:A,evolveOrganization:D.PM.MDsave,leadStatus:D.XN.EligibleWaiting,automateEvolveEnrollment:!1};return await (0,f.t)(a)}),input:e=>{let{context:t}=e;return t},onDone:"#".concat(P.ApplicationReview),onError:[{guard:"isApplicationDetected",target:"#".concat(P.ApplicationDetected)},{target:"#".concat(P.Error)}]}}}},[P.Error]:{id:P.Error,on:{SUBMIT:{actions:"updateFormData",target:P.Submitting}}}}},[P.ApplicationReview]:{id:P.ApplicationReview},[P.ApplicationDetected]:{id:P.ApplicationDetected},[P.EligibilityUnmet]:{id:P.EligibilityUnmet,initial:P.Idle,states:{[P.Idle]:{on:{SUBMIT:{target:P.Submitting,actions:"updateFormData"}}},[P.Submitting]:{invoke:{src:(0,w.Sx)(async e=>{let{input:t}=e,a={...t,company:A,leadStatus:D.XN.Ineligible,ineligibilityReason:D.hT.BMI,automateEvolveEnrollment:!1};return await (0,f.t)(a)}),input:e=>{let{context:{formData:t}}=e;return t},onDone:P.Success,onError:P.Error}},[P.Success]:{},[P.Error]:{on:{SUBMIT:{target:P.Submitting}}}}}},on:{RESET:{target:"#".concat(P.PreEligibility),actions:"reset"}}});var M=a(69443);let j={[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 U=a(82393);let k=[g.UX.WordOfMouth,g.UX.Other],B={[p.C.ContactDetails]:{state:{options:U.rI},howDidYouFindUs:{options:k}}},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)(T),D=(0,x.useMemo)(()=>(0,b.r)(a.value),[a.value]);(0,m.t)(D,O);let y=(0,x.useCallback)(e=>{f({type:"SUBMIT",data:e})},[f]),I=(0,x.useCallback)(()=>{switch(D){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:j[p.C.PreEligibility]},onSubmit:y})]});case h.f.ContactDetails:return(0,i.jsx)(c.x,{configuration:{contentResources:j[p.C.ContactDetails],fields:B[p.C.ContactDetails]},loading:a.matches({[h.f.ContactDetails]:h.f.Submitting}),onSubmit:y,defaultValues:a.context.formData});case h.f.EligibilityUnmet:return(0,i.jsx)(d.B,{configuration:{contentResources:j[p.C.EligibilityUnmet]},onSubmit:y,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,{...j[p.C.ApplicationReview]});case h.f.ApplicationDetected:return(0,i.jsx)(n.r,{...j[p.C.ApplicationDetected],email:a.context.formData.email});default:return null}},[D,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:D,steps:F})]}),body:I(),currentWorkFlowStep:D})}}}]);