{"version":3,"file":"static/js/main.e36d3222.js","mappings":"qoBAEA,IAAYA,EAoBAC,EAKAC,EAUAC,E,wEAnCZ,SAAYH,GACV,0CACA,iCACA,iCACA,8CACA,6CACA,qCACA,uDACA,gDACA,+BACA,+BACA,kCACA,iCACA,aACD,CAdD,CAAYA,IAAAA,EAAuB,KAoBnC,SAAYC,GACV,oCACA,2BACD,CAHD,CAAYA,IAAAA,EAAW,KAKvB,SAAYC,GACV,oBACA,sCACA,wBACA,8BACA,0BACA,oDACA,iDACD,CARD,CAAYA,IAAAA,EAAU,KAUtB,SAAYC,GACV,eACA,cACA,eACA,gBACA,kBACA,gBACA,mBACA,gBACA,4BACA,eACA,eACA,cACA,aACA,gBACA,eACA,YACA,cACA,gBACA,iBACA,aACA,gBACA,qBACA,gBACA,iBACA,mBACA,gBACA,eACA,gBACA,cACA,qBACA,kBACA,kBACA,gBACA,sBACA,oBACA,YACA,gBACA,cACA,oBACA,oBACA,sBACA,oBACA,iBACA,aACA,YACA,eACA,gBACA,kBACA,qBACA,iBACA,cACD,CApDD,CAAYA,IAAAA,EAAO,KAsDZ,IAAMC,EAA2B,CACtCC,QAAS,KACTC,OAAQ,GACRC,KAAM,GACNC,SAAU,GACVC,SAAU,GACVC,QAAS,IAGEC,EAAoB,IAEpBC,EAAU,IACVC,EAAU,E,iBCvGvB,IAAYC,E,8QAAZ,SAAYA,GACV,kDACA,UACA,UACA,aACD,CALD,CAAYA,IAAAA,EAAU,K,ICAVC,ECIAC,EAKAC,EAKAC,EAMAC,EAOAC,EAKAC,E,WDhCZ,SAAYN,GACV,oBACA,8BACA,qBACD,CAJD,CAAYA,IAAAA,EAAqB,KCIjC,SAAYC,GACV,+BACA,kEACD,CAHD,CAAYA,IAAAA,EAAU,KAKtB,SAAYC,GACV,YACA,eACD,CAHD,CAAYA,IAAAA,EAA2B,KAKvC,SAAYC,GACV,cACA,cACA,mCACD,CAJD,CAAYA,IAAAA,EAAwB,KAMpC,SAAYC,GACV,UACA,gCACA,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T,QAAS,KAAQ,IACtB,gBAACwY,GAAgB,CAACE,YAAU,IAC5B,gBAAC,KAAM,CACL/c,YAAY,UACZ1G,UAAW6e,EACXpY,KAAK,KACLrM,KAAK,UAAQ,SARgB,IAkB7C,GC4PA,SAnMwD,CACtDonC,WAAY,CACV,CACEhzB,YAAa,mBACb9B,WAAY,GACZ4B,UAAW,CACTihB,GACArD,GACAG,GACA+D,KAGJ,CACE5hB,YAAa,eACb9B,WAAY,GACZ4B,UAAW,CACT2lB,GACA6H,GACA5N,GACA+G,GACAY,GACArB,GACAc,GACAQ,GACA5F,GACA2J,GACAgD,GACAgE,GACArI,GACAC,GACA3G,GACA8J,GACAnG,GACAM,GACAkI,GACA/L,KAGJ,CACE1jB,YAAa,gBACb9B,WAAY,GACZ4B,UAAW,CACTsyB,GACAE,GACAE,GACAD,KAGJ,CACEvyB,YAAa,iBACb9B,WAAY,GACZ4B,UAAW,CACTsvB,GACA9J,GACAmJ,GACAc,GACA3F,GACAzF,GACAI,GACAG,GACAzH,GACAI,GACA+M,GACAe,GACAK,GACAG,GACAG,GACAG,GACAuC,GACAD,GACAV,GACA1K,GACAsE,GACA6B,GACAd,GACAlH,GACA0G,GACAsH,GACAvC,GACA5G,GACAlD,GACA0J,GACA1N,GACAmC,GACAgH,GACAvD,GACAgM,KAGJ,CACE7wB,YAAa,6BACb9B,WAAY,GACZ4B,UAAW,CACT2wB,GACA1B,GACAY,GACA7Q,GACA4Q,KAGJ,CACE1vB,YAAa,mBACb9B,WAAY,GACZ4B,UAAW,CAACkuB,GAAgBjQ,MAGhCkV,mBAAoB,CAClB,CACEjzB,YAAa,oBACb9B,WAAY,IACZ4B,UAAW,CACTgzB,GACAvN,GACAsE,GACAzF,GACAO,GACAzH,GACAmN,GACAe,GACAI,GACAG,GACAG,GACAG,GACAwG,GACAG,GACAD,MAINO,gBAAiB,CACf,CACElzB,YAAa,yBACb9B,WAAY,IACZ4B,UAAW,CACT0Q,GACAyV,GACAtG,GACAgC,GACA0J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AAK,GACtC,CAUO,SAASW,EACdhiD,EACAi9B,GAEAskB,IACItkB,EACF,KAAsBj9B,EAASi9B,GAG/B,KAAsBj9B,EAE1B,C,yCCpHO,IAAMiiD,EAAmB,WAE9B,MAAyC,YADrB,IAAI5/D,gBAAgBN,OAAOgJ,SAASxB,QACrC9F,IAAI,aACzB,EAGMy+D,EAAe,CACnB,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KAIA,KACA,MAGWC,EAAO,SAACppD,GAAwB,OAAAmpD,EAAar7D,SAASkS,EAAtB,C,sCC3CzCqpD,E,u3CACEC,EAAc,IAAI9mD,SAAc,SAAC+mD,GACrCF,EAAqBE,CACvB,IAWO,SAAeC,I,0FACpB,UAAM,OACJ,yDACA,CAAC,KAAcxK,mBACf,CAIE57C,YAAY,EACZ+jD,SAAU,CACRC,QAAS,CACPqC,aAAczgE,OAAOC,IAAIygE,yB,OAOjC,OAjBA,SAiBA,GAAMJ,G,OAEN,OAFA,SAEO,CAAP,EAAO,CACLn+C,SAAUniB,OAAOmiB,SACjBw0C,aAAc32D,OAAO2gE,uB,OA/BpB3gE,OAAOmiB,WAEVniB,OAAOmiB,SAAW,CAAC,GAGpBniB,OAAe4gE,eAAiB,WAC/BP,GACF,C","sources":["constants/enrollment.ts","constants/Curriculum.ts","constants/success.ts","constants/survey-answers.ts","constants/retriage.ts","constants/index.ts","hooks/useAnalyticsIds.ts","contexts/app-context.tsx","constants/Partners.ts","utils/partners.ts","utils/age.ts","utils/calculateBMI.ts","utils/dpp.ts","hooks/useSaveTriageData.ts","hooks/useQueryParams.ts","utils/pixels/urlParamsPii.ts","utils/proto.ts","models/Eligibility.ts","models/EnrollmentInformation.ts","models/experiments.ts","utils/programs.ts","hooks/useExperiment.ts","hooks/useTrackEvent.ts","hooks/useAnswerSurveyQuestion.ts","models/User.ts","models/MedEnrollmentData.ts","utils/location.ts","models/Partner.ts","utils/vendors/facebook.ts","utils/vendors/google.ts","utils/vendors/horizon.ts","utils/vendors/index.ts","utils/vendors/vwo.ts","utils/ConversionTracker.ts","hooks/useEnrollMed.ts","hooks/useGoto.ts","hooks/useCreateAccount.ts","utils/cookies.ts","hooks/useCreateLoginToken.ts","utils/eligibility.ts","hooks/useEligibility.ts","hooks/useGeolocation.ts","hooks/usePartnerInfo.ts","hooks/useRetriageEligibility.ts","utils/UnitUtils.ts","utils/survey/phq.ts","utils/survey/outcomes.ts","hooks/useStoreOutcomes.ts","hooks/useSubmitPasscode.ts","components/survey/questionTypes/retriage/RetriageResult.tsx","hooks/useUpdateLastTriageTimestamp.ts","components/noom-branding/GenericConsent.tsx","components/noom-branding/NoomEmailAddressLink.tsx","components/noom-branding/NoomHeader.tsx","components/noom-branding/NoomSupportLink.tsx","components/noom-branding/NoomVirtualAssistantLink.tsx","components/survey/questionTypes/core/BaseOutline.tsx","components/survey/questionTypes/core/BaseInterstitial.tsx","components/survey-progress-bar/SurveyProgressBar.tsx","components/SurveyHeader.tsx","hooks/useSurveyProgressBar.ts","components/survey/questionTypes/core/BaseQuestion.tsx","components/survey/checkbox/Checkbox.tsx","components/survey/checkbox/CheckboxButton.tsx","components/survey/checkbox/CheckboxOptions.tsx","components/survey/questionTypes/core/CheckboxQuestion.tsx","components/survey/multipleChoice/MultipleChoiceOptions.tsx","components/survey/questionTypes/core/MultipleChoiceQuestion.tsx","components/survey/questionTypes/core/ImageBulletListCard.tsx","components/survey/questionTypes/core/SelectQuestion.tsx","components/survey/questionTypes/core/InformationalScreen.tsx","components/survey/questionTypes/retriage/ConfirmChangeProgram.tsx","components/survey/questionTypes/retriage/DppInformation.tsx","components/form/AgeInput.tsx","app/themes/reskin/defaultFieldStyles.ts","components/form/DateInput.tsx","components/form/InputWithSuffix.tsx","components/form/PasswordInput.tsx","components/form/PhoneInput.tsx","components/form/PreferredLanguageSelector.tsx","components/forms/EligibilityCheckForm.tsx","components/survey/questionTypes/retriage/RetriageEligibilityCheckQuestion.tsx","components/survey/questionTypes/retriage/RetriageExclusion.tsx","components/survey/questionTypes/retriage/RetriageFinished.tsx","components/forms/AddressForm.tsx","components/forms/CreateAccountForm.tsx","components/forms/HealthDataConsentForm.tsx","components/form/utils.ts","components/forms/HeightWeightForm.tsx","components/survey/questionTypes/retriage/RetriageMedSignup.tsx","components/survey/questionTypes/retriage/RetriageKeepPlanConfirmation.tsx","components/survey/questionTypes/retriage/RetriagePersonalizingProgram.tsx","components/survey/questionTypes/core/BaseSuccess.tsx","components/ConfettiBox.tsx","utils/retriage.ts","hooks/useMigrateUser.ts","components/survey/questionTypes/retriage/RetriageTransition.tsx","views/DeeplinkView.tsx","components/survey/Survey.tsx","components/survey/questionTypes/b2c-to-b2b/interstitials/ActiveSubscription.tsx","components/survey/questionTypes/b2c-to-b2b/interstitials/TransitionExplainer.tsx","utils/qualification.ts","utils/survey/retriage.ts","components/survey/questionTypes/dpp-triage/A1cQuestion.tsx","components/survey/questionTypes/dpp-triage/BloodGlucoseTrackingQuestion.tsx","components/survey/questionTypes/dpp-triage/CreateAccountQuestion.tsx","components/survey/questionTypes/dpp-triage/CreatePasswordQuestion.tsx","components/survey/questionTypes/dpp-triage/CompleteProfileQuestion.tsx","utils/survey/contentPersonalization.ts","components/survey/questionTypes/dpp-triage/CoursePackSelectionQuestion.tsx","components/survey/questionTypes/dpp-triage/DifficultiesQuestion.tsx","components/survey/questionTypes/dpp-triage/EatingDisorderQuestion.tsx","components/ContinueToDownloadButton.tsx","components/FullscreenMessage.tsx","components/TryAgainVideo.tsx","components/survey/questionTypes/dpp-triage/EligibilityCheckQuestion.tsx","components/survey/questionTypes/dpp-triage/EducationQuestion.tsx","components/survey/questionTypes/dpp-triage/EnrolledInMedicareQuestion.tsx","components/survey/questionTypes/dpp-triage/EthnicityQuestion.tsx","components/survey/questionTypes/dpp-triage/ExistingPasswordQuestion.tsx","components/survey/questionTypes/dpp-triage/FamilyHistoryQuestion.tsx","components/survey/questionTypes/dpp-triage/FamilyHistoryWeightQuestion.tsx","components/survey/questionTypes/dpp-triage/GenderQuestion.tsx","components/survey/questionTypes/dpp-triage/GestationalDiabetesQuestion.tsx","utils/bmi.ts","components/survey/questionTypes/dpp-triage/Glp1MedicationQuestion.tsx","components/survey/questionTypes/dpp-triage/Glp1WeightQuestion.tsx","utils/survey/glp1.ts","components/survey/questionTypes/dpp-triage/HadA1cTestedQuestion.tsx","components/survey/questionTypes/dpp-triage/HealthCareProfessionalQuestion.tsx","components/survey/questionTypes/dpp-triage/HealthConditionsQuestion.tsx","components/survey/questionTypes/dpp-triage/HealthGoalQuestion.tsx","components/survey/questionTypes/dpp-triage/HeightWeightQuestion.tsx","components/survey/questionTypes/dpp-triage/HypertensionQuestion.tsx","components/survey/questionTypes/dpp-triage/LiabilityWaiverAlert.tsx","components/survey/questionTypes/dpp-triage/LiabilityWaiver.tsx","components/survey/questionTypes/dpp-triage/LocationStateQuestion.tsx","components/survey/questionTypes/dpp-triage/MedicareConsentQuestion.tsx","components/survey/questionTypes/dpp-triage/MotivationQuestion.tsx","components/survey/questionTypes/dpp-triage/NoomMedMoreOptionsQuestion.tsx","components/survey/questionTypes/dpp-triage/NoomMedOverviewQuestion.tsx","components/survey/questionTypes/dpp-triage/MedicationsQuestion.tsx","utils/survey/womensHealth.ts","components/survey/questionTypes/dpp-triage/MenopauseQuestion.tsx","components/survey/questionTypes/dpp-triage/MenstrualCycleQuestion.tsx","components/survey/questionTypes/dpp-triage/MskPainQuestion.tsx","components/survey/questionTypes/dpp-triage/MskPainLevelQuestion.tsx","components/survey/questionTypes/dpp-triage/OtherEthnicityQuestion.tsx","components/survey/questionTypes/dpp-triage/phq/Phq1Question.tsx","components/survey/questionTypes/dpp-triage/phq/Phq2Question.tsx","components/survey/questionTypes/dpp-triage/phq/Phq3Question.tsx","components/survey/questionTypes/dpp-triage/phq/Phq4Question.tsx","components/survey/questionTypes/dpp-triage/PhysicalActivityQuestion.tsx","components/survey/questionTypes/dpp-triage/PrediabetesHistoryQuestion.tsx","components/survey/questionTypes/dpp-triage/PregnantQuestion.tsx","components/survey/questionTypes/dpp-triage/ProgramOverviewQuestion.tsx","components/survey/questionTypes/dpp-triage/ReasonForLosingWeightQuestion.tsx","components/survey/questionTypes/dpp-triage/ScaleOptIn.tsx","components/survey/questionTypes/dpp-triage/SexQuestion.tsx","components/survey/questionTypes/dpp-triage/SleepQuestion.tsx","components/survey/questionTypes/dpp-triage/StressEatingQuestion.tsx","components/survey/questionTypes/dpp-triage/PrimaryCareProviderQuestion.tsx","components/survey/questionTypes/dpp-triage/programSet/DppDescriptionForMed.tsx","components/survey/questionTypes/dpp-triage/programSet/ProgramSet.tsx","components/survey/questionTypes/dpp-triage/interstitials/BaselineHealth.tsx","components/survey/questionTypes/dpp-triage/interstitials/ContinueProgram.tsx","components/survey/questionTypes/dpp-triage/interstitials/DiabetesSupport.tsx","components/survey/questionTypes/dpp-triage/interstitials/Nursing.tsx","components/survey/questionTypes/dpp-triage/interstitials/PersonalizationConfirmation.tsx","components/survey/questionTypes/dpp-triage/interstitials/PersonalizationIntro.tsx","components/ProgressBar.tsx","components/survey/questionTypes/dpp-triage/interstitials/PersonalizingProgram.tsx","components/survey/questionTypes/dpp-triage/interstitials/ScreenedOut.tsx","utils/survey/sdoh.ts","components/survey/questionTypes/dpp-triage/interstitials/SocialDeterminantsOfHealth.tsx","components/survey/questionTypes/dpp-triage/interstitials/WomensHealth.tsx","components/survey/questionTypes/dpp-triage/sdoh/NutritionBasicsQuestion.tsx","components/survey/questionTypes/dpp-triage/sdoh/CulturalImpactsQuestion.tsx","components/survey/questionTypes/dpp-triage/sdoh/EatingMovingAffordablyQuestion.tsx","components/survey/questionTypes/outcomes/ExerciseQuestion.tsx","components/survey/questionTypes/outcomes/OutcomesSurveyComplete.tsx","components/survey/questionTypes/outcomes/ReachingHealthGoalsQuestion.tsx","components/survey/questionTypes/outcomes/WeightQuestion.tsx","components/survey/questionSets/questionSets.ts","views/DevView.tsx","views/DoNotShareView.tsx","utils/formatAsUserData.ts","views/DppTriageView.tsx","views/NotFoundView.tsx","views/RecurringOutcomesView.tsx","views/RetriageAuthView.tsx","views/RetriageView.tsx","views/TransitionView.tsx","hooks/useTransitionB2CAccount.ts","views/error/ErrorView.tsx","components/animation/fade.tsx","components/WelcomeToNoomAnimation.tsx","app/i18n.ts","views/reskin/EnrollmentStaticContent.tsx","views/reskin/enrollment/BaseSideForm.tsx","views/reskin/code-input/PasscodeInputForm.tsx","views/reskin/code-input/UpidInputForm.tsx","views/reskin/code-input/CodeInputForm.tsx","views/reskin/enrollment/TriageLandingForm.tsx","views/reskin/enrollment/EntryForm.tsx","views/reskin/success/PostEnrollmentRefreshView.tsx","views/reskin/ReskinView.tsx","views/reskin/success/DownloadView.tsx","views/reskin/success/ProgressView.tsx","views/reskin/success/SuccessView.tsx","views/reskin/virgin-pulse/VirginPulseRedirect.tsx","app/themes/reskin/components/Button.ts","app/themes/reskin/components/Input.ts","app/themes/reskin/components/Select.ts","app/themes/reskin/theme.ts","app/App.tsx","api/account/create.ts","api/account/createLoginToken.ts","api/account/enrollMed.ts","api/account/getB2bEmailAvailabilityInformation.ts","api/account/getConsent.ts","api/account/migrateToB2B.ts","api/account/passwordResets.ts","api/account/submitConsent.ts","api/account/validateUpid.ts","api/address/validate.ts","api/dpp/alertUserCoach.ts","api/dpp/saveTriageData.ts","api/dpp/updateLastTriageTimestamp.ts","api/outcomes/getUserProfile.ts","api/outcomes/store.ts","api/partner/checkEligibility.ts","api/partner/getPartnerBySlug.ts","api/partner/getPartnerByUpid.ts","api/partner/getPartnerRedirect.ts","api/partner/retriageEligibility.ts","api/retriage.ts","api/telehealth/getEligibleTelehealthStates.ts","api/upid/getEnrollmentInformation.ts","api/upid/getPasscode.ts","api/upid/getVirginPulse.ts","api/upid/updateUpidCurriculumMapping.ts","utils/bootstrap.ts","index.tsx","utils/consent/index.ts","utils/consent/one-trust.ts","utils/consent/opt-out.ts","utils/cryptography.ts","utils/pixels/handler.tsx","utils/pixels/FacebookCapiApi.ts","utils/pixels/eltvAdjustment.ts","utils/pixels/publishers/facebook.tsx","utils/pixels/publishers/healthline.tsx","utils/pixels/publishers/horizon.tsx","utils/pixels/publishers/index.ts","utils/pixels/publishers/adwords.tsx","utils/pixels/utils.tsx","utils/scriptLoader.ts","utils/sentry.ts","utils/userSegment.ts","utils/vendors/onetrust.ts"],"sourcesContent":["import type { Address } from \"@/models\";\n\nexport enum HealthConditionOptionId {\n HIGH_BLOOD_PRESSURE = \"highBloodPressure\",\n TYPE1_DIABETES = \"type1Diabetes\",\n TYPE2_DIABETES = \"type2Diabetes\",\n DEPRESSION_OR_ANXIETY = \"depressionOrAnxiety\",\n ABNORMAL_CHOLESTEROL = \"abnormalCholesterol\",\n LOW_TESTOSTERONE = \"lowTestosterone\",\n PCOS_OR_FERTILITY_PROBLEMS = \"pcosOrFertilityProblems\",\n CANCER_UNDER_TREATMENT = \"cancerUnderTreatment\",\n LIVER_DISEASE = \"liverDisease\",\n HEART_DISEASE = \"heartDisease\",\n OSTEOARTHRITIS = \"osteoarthritis\",\n SLEEP_PROBLEMS = \"sleepProblems\",\n NONE = \"none\",\n}\n\n/**\n * Used to group programs - it is different than curriculum as a weight loss\n * program could refer to Noom Weight or Noom DPP curriculums.\n */\nexport enum ProgramType {\n MENTAL_WELLNESS = \"MENTAL_WELLNESS\",\n WEIGHT_LOSS = \"WEIGHT_LOSS\",\n}\n\nexport enum ResultType {\n SUCCESS = \"Success\",\n ACCOUNT_EXISTS = \"B2B Account exists\",\n ERROR = \"Generic error\",\n CODE_CLAIMED = \"UPID claimed\",\n BATCH_FULL = \"Batch full\",\n PENDING_DELETION_REQUEST = \"Pending delete request\",\n PAST_CONTRACT_END_DATE = \"Past contract end date\",\n}\n\nexport enum USState {\n AL = \"Alabama\",\n AK = \"Alaska\",\n AZ = \"Arizona\",\n AR = \"Arkansas\",\n CA = \"California\",\n CO = \"Colorado\",\n CT = \"Connecticut\",\n DE = \"Delaware\",\n DC = \"District of Columbia\",\n FL = \"Florida\",\n GA = \"Georgia\",\n HI = \"Hawaii\",\n ID = \"Idaho\",\n IL = \"Illinois\",\n IN = \"Indiana\",\n IA = \"Iowa\",\n KS = \"Kansas\",\n KY = \"Kentucky\",\n LA = \"Louisiana\",\n ME = \"Maine\",\n MD = \"Maryland\",\n MA = \"Massachusetts\",\n MI = \"Michigan\",\n MN = \"Minnesota\",\n MS = \"Mississippi\",\n MO = \"Missouri\",\n MT = \"Montana\",\n NE = \"Nebraska\",\n NV = \"Nevada\",\n NH = \"New Hampshire\",\n NJ = \"New Jersey\",\n NM = \"New Mexico\",\n NY = \"New York\",\n NC = \"North Carolina\",\n ND = \"North Dakota\",\n OH = \"Ohio\",\n OK = \"Oklahoma\",\n OR = \"Oregon\",\n PA = \"Pennsylvania\",\n RI = \"Rhode Island\",\n SC = \"South Carolina\",\n SD = \"South Dakota\",\n TN = \"Tennessee\",\n TX = \"Texas\",\n UT = \"Utah\",\n VT = \"Vermont\",\n VA = \"Virginia\",\n WA = \"Washington\",\n WV = \"West Virginia\",\n WI = \"Wisconsin\",\n WY = \"Wyoming\",\n}\n\nexport const DEFAULT_ADDRESS: Address = {\n country: \"US\",\n region: \"\",\n city: \"\",\n address1: \"\",\n address2: \"\",\n zipcode: \"\",\n};\n\nexport const INPUT_FIELD_WIDTH = 400;\n\nexport const MAX_AGE = 110;\nexport const MIN_AGE = 18;\n","export enum Curriculum {\n CURRICULUM_UNSPECIFIED = \"CURRICULUM_UNSPECIFIED\",\n HW = \"HW\",\n HM = \"HM\",\n DPP = \"PT2V2\",\n}\n","export enum EnrollmentSuccessType {\n CREATED = \"created\",\n TRANSITIONED = \"transitioned\",\n UPGRADED = \"upgraded\",\n}\n","import { type QuestionOption } from \"@/components/survey/Question\";\n\n// TODO (@jason.pao): Convert survey answer IDs to enums and move to this file\n\nexport enum HealthGoal {\n LOSING_WEIGHT = \"losingWeight\",\n REDUCING_STRESS_ANXIOUS_FEELINGS = \"reducingStressAnxiousFeelings\",\n}\n\nexport enum NoomMedMoreOptionsSelection {\n MED = \"med\",\n OTHER = \"other\",\n}\n\nexport enum NoomMedOverviewSelection {\n JOIN = \"join\",\n NEXT = \"next\",\n SEE_MORE_OPTIONS = \"seeMoreOptions\",\n}\n\nexport enum PregnantSelection {\n NO = \"no\",\n NO_BUT_NURSING = \"noButNursing\",\n NO_BUT_PLANNING = \"noButPlanning\",\n YES = \"yes\",\n}\n\nexport enum PrimaryCareProviderSelection {\n YES = \"yes\",\n NO = \"no\",\n}\n\nexport enum BloodGlucoseTrackingSelection {\n YES = \"yes\",\n NO = \"no\",\n}\n\nexport const PHQ_OPTIONS: (QuestionOption & { weight: number })[] = [\n { id: \"notAtAll\", text: \"Not at all\", weight: 0 },\n { id: \"severalDays\", text: \"Several days\", weight: 1 },\n { id: \"moreThanHalfTheDays\", text: \"More than half the days\", weight: 2 },\n { id: \"nearlyEveryDay\", text: \"Nearly every day\", weight: 3 },\n];\n","export enum RetriageFinishedStatus {\n ALREADY_MED = \"ALREADY_MED\",\n RECENTLY_RETRIAGED = \"RECENTLY_RETRIAGED\",\n}\n","import { CoursePackProto_CoursePackSlug_Value } from \"@noom/noom-contracts/noom_contracts/backend/program/model/course_pack\";\nimport { B2BEnrollmentEnumsProto_Program } from \"@noom/noom-contracts/noom_contracts/events/web/b2b/shared\";\n\nexport const ASSET_URL = `${window.ENV.CDN_URL}/assets`;\n\nexport const buildDeeplink = (email?: string) => {\n const queryParams = new URLSearchParams();\n // must pass at least one param in querystring or the link doesn't behavior properly\n // so set email to empty string if no value supplied\n queryParams.append(\"email\", email || \"\");\n\n /**\n * 1) If the user does not have the app, this will open the app store\n * 2) If the user is not logged in, this will load the login screen\n * 3) If the user is logged in, this will load the home page\n */\n queryParams.append(\"open\", \"HOME\");\n\n const baseUrl =\n window.ENV.NOOM_ENVIRONMENT === \"production\"\n ? \"https://noomcoach.app.link\"\n : \"https://noomcoach.test-app.link\";\n\n return `${baseUrl}/?${queryParams.toString()}`;\n};\n\nexport enum ErrorState {\n DEFAULT = \"Generic error\",\n ACCOUNT_EXISTS = \"Account exists\",\n SSO_ACCOUNT_EXISTS = \"SSO_ACCOUNT_EXISTS\",\n BATCH_FULL = \"Batch full\",\n EXISTING_VIRGIN_PULSE_USER = \"Already linked to Virgin Pulse\",\n CODE_CLAIMED = \"UPID claimed\",\n ELIGIBILITY_CHECK_EXISTING_ACCOUNT = \"Account with eligibility information already exists\",\n FAILED_ELIGIBILITY_CHECK = \"FAILED_ELIGIBILITY_CHECK\",\n SSO_INELIGIBLE = \"SSO_INELIGIBLE\",\n SUPPORT_REQUEST_CREATED = \"SUPPORT_REQUEST_CREATED\",\n PENDING_DELETION_REQUEST = \"PENDING_DELETION_REQUEST\",\n BEFORE_GOLIVE_DATE = \"Partner is not live yet\",\n PAST_CONTRACT_END_DATE = \"PAST_CONTRACT_END_DATE\",\n PRIOR_TO_EFFECTIVE_DATE = \"PRIOR_TO_EFFECTIVE_DATE\",\n ELIGIBILITY_CHECK_API_ERROR = \"ELIGIBILITY_CHECK_API_ERROR\",\n ELIGIBILITY_CHECK_MULTIPLE_MATCHES = \"ELIGIBILITY_CHECK_MULTIPLE_MATCHES\",\n}\n\nexport enum ErrorCode {\n MED_ENROLLMENT_FAILED = \"MED_ENROLLMENT_FAILED\",\n}\n\nexport type ProgramOffering = Exclude<\n B2BEnrollmentEnumsProto_Program,\n \"PROGRAM_UNSPECIFIED\" | \"UNRECOGNIZED\"\n>;\n\nexport type CoursePackSlug = CoursePackProto_CoursePackSlug_Value;\n\nexport enum ScreenedOutReason {\n BMI_TOO_LOW = \"bmi_too_low\",\n EATING_DISORDER = \"eating_disorder\",\n PREGNANT = \"pregnant\",\n}\n\n/**\n * List of states with consumer health laws.\n */\nexport const CONSUMER_HEALTH_LAW_STATES = [\"CT\", \"NV\", \"WA\"];\n\nexport const DOB_FORMAT = \"MM/dd/yyyy\";\n\n/**\n * Allowlist of questions where the answers do not contain PII. This is used\n * so that we can log user answers to these questions.\n */\nexport const NON_PII_QUESTIONS = [\n \"healthGoal\",\n \"programOverview\",\n \"programSelection\",\n \"scaleOptIn\",\n \"noomMedOverview\",\n \"noomMedMoreOptions\",\n \"healthConditions\",\n \"medications\",\n \"glp1Medication\",\n \"hadA1cTested\",\n \"a1c\",\n \"mskPain\",\n \"mskPainLevel\",\n \"phq1\",\n \"phq2\",\n \"phq3\",\n \"phq4\",\n \"enrolledInMedicare\",\n \"medicareConsent\",\n \"confirmChangeProgramDpp\",\n \"confirmChangeProgramMed\",\n \"nutritionBasics\",\n \"culturalImpacts\",\n \"eatingMovingAffordably\",\n];\n\nexport const NOOM_SUPPORTED_LANGUAGES = [\n \"en\",\n \"en-AU\",\n \"en-CA\",\n \"en-GB\",\n \"en-US\",\n \"es\",\n \"de\",\n \"ko\",\n];\n\nexport const NOOM_SUPPORTED_ENGLISH_LOCALES = NOOM_SUPPORTED_LANGUAGES.filter(\n (language) => language.slice(0, 2) === \"en\",\n);\n\n/**\n * List of states with opt out laws.\n */\nexport const OPT_OUT_STATES = [\n \"CA\",\n \"CO\",\n \"CT\",\n \"NV\",\n \"OR\",\n \"TX\",\n \"UT\",\n \"VA\",\n \"WA\",\n];\nexport const OPT_OUT_MHMDA_STATES = [\"CT\", \"NV\", \"WA\"];\n\nexport * from \"./Curriculum\";\nexport * from \"./enrollment\";\nexport * from \"./success\";\nexport * from \"./survey-answers\";\nexport * from \"./retriage\";\n","import Cookies from \"js-cookie\";\nimport { customAlphabet } from \"nanoid\";\nimport { useEffect, useMemo, useState } from \"react\";\n\nimport { toSha256 } from \"@/utils/cryptography\";\nimport { captureException } from \"@/utils/sentry\";\n\nexport type AnalyticsUserDetails = {\n email: string;\n};\n\nenum CookieName {\n ANONYMOUS_ID = \"b2b_anonymous_user_id\",\n IDENTIFIED_ID = \"b2b_identified_user_id\",\n IDENTITY_HASH = \"b2b_identity_hash\",\n}\n\n// Generate user ids in the same format as the growth Buyflow (32-char lowercase hex string)\nconst generateUserId = customAlphabet(\"0123456789abcdef\", 32);\nconst validateIdFormat = (id?: string) =>\n id && /^[0-9a-f]{32}$/.test(id) ? id : undefined;\n\nfunction getCookieOrDefault(name: CookieName, createValue: () => string) {\n const value = Cookies.get(name);\n if (value) {\n return value;\n }\n const newValue = createValue();\n Cookies.set(name, newValue);\n return newValue;\n}\n\nasync function checkAndUpdateIdentifiableId(\n details: AnalyticsUserDetails | undefined,\n) {\n let identifiableId = getCookieOrDefault(\n CookieName.IDENTIFIED_ID,\n generateUserId,\n );\n\n if (details) {\n const currentHash = await toSha256(`${details.email}`);\n const storedHash = getCookieOrDefault(\n CookieName.IDENTITY_HASH,\n () => currentHash,\n );\n if (storedHash !== currentHash) {\n identifiableId = generateUserId();\n Cookies.set(CookieName.IDENTIFIED_ID, identifiableId);\n Cookies.set(CookieName.IDENTITY_HASH, currentHash);\n }\n }\n return identifiableId;\n}\n\nexport const clearAnalyticsCookies = () => {\n Cookies.remove(CookieName.ANONYMOUS_ID);\n Cookies.remove(CookieName.IDENTIFIED_ID);\n Cookies.remove(CookieName.IDENTITY_HASH);\n};\n\nexport const useAnalyticsIds = () => {\n const [userDetails, setUserDetails] = useState<\n AnalyticsUserDetails | undefined\n >();\n\n const anonymousId = useMemo(\n () => getCookieOrDefault(CookieName.ANONYMOUS_ID, generateUserId),\n [],\n );\n const [identifiableId, setIdentifiableId] = useState(() => {\n const initialId = getCookieOrDefault(\n CookieName.IDENTIFIED_ID,\n generateUserId,\n );\n // some old clients may have an incorrectly formatted identified id (before 12/2023)\n if (!validateIdFormat(initialId)) {\n const newId = generateUserId();\n Cookies.set(CookieName.IDENTIFIED_ID, newId);\n return newId;\n }\n return initialId;\n });\n\n useEffect(() => {\n checkAndUpdateIdentifiableId(userDetails)\n .then((id) => {\n setIdentifiableId(id);\n })\n .catch((err) => {\n captureException(err);\n });\n }, [userDetails]);\n\n return {\n anonymousId,\n identifiableId,\n setUserDetails,\n };\n};\n","import React, { useContext, useEffect, useMemo, useState } from \"react\";\n\nimport type { QuestionSection } from \"@/components/survey/Question\";\nimport {\n ErrorState,\n type ProgramOffering,\n ScreenedOutReason,\n RetriageFinishedStatus,\n} from \"@/constants\";\nimport type { SurveyProgressBarState } from \"@/hooks\";\nimport { useAnalyticsIds } from \"@/hooks/useAnalyticsIds\";\nimport type {\n EligibilityInfo,\n EnrollmentInformation,\n Partner,\n RetriageEligibility,\n User,\n UserProfile,\n} from \"@/models\";\nimport { toSha256 } from \"@/utils/cryptography\";\n\ntype EnrollmentType = \"INITIAL_ENROLLMENT\" | \"RETRIAGE\";\ntype SurveyMetadata = {\n name: \"RECURRING_OUTCOMES\";\n instance: string | undefined;\n};\n\nexport type SurveyAnswer =\n | boolean\n | number\n | string\n | string[]\n | Date\n | null\n | undefined\n | Record<\n string,\n boolean | number | string | string[] | Date | null | Record\n >;\n\nexport interface SurveyAnswers {\n [key: string]: SurveyAnswer | undefined;\n}\n\nexport type AppContextType = {\n b2bAnonymousUserId: string;\n b2bIdentifiedUserId: string;\n eligibilityInfo?: EligibilityInfo;\n enrollmentInfo?: EnrollmentInformation;\n enrollmentType?: EnrollmentType;\n errorState: ErrorState;\n hasB2cAccount?: boolean;\n hashedEmail?: string;\n maskedEmail?: string;\n partnerInfo: Partner | null;\n questionSet: QuestionSection[];\n retriageEligibility?: RetriageEligibility;\n retriageFinishedStatus?: RetriageFinishedStatus;\n screenedOutReason?: ScreenedOutReason;\n selectedProgram: ProgramOffering | null;\n ssTriageUuid: string | null;\n surveyAnswers: SurveyAnswers;\n surveyMetadata?: SurveyMetadata;\n surveyProgressBarState: SurveyProgressBarState;\n userData?: User;\n userProfile: UserProfile | null;\n telehealthEligibleStates: string[] | null;\n setEligibilityInfo: React.Dispatch;\n setEnrollmentInfo: React.Dispatch;\n setEnrollmentType: React.Dispatch;\n setErrorState: React.Dispatch;\n setHasB2cAccount: React.Dispatch;\n setMaskedEmail: React.Dispatch;\n setPartnerInfo: React.Dispatch;\n setQuestionSet: React.Dispatch;\n setRetriageEligibility: React.Dispatch;\n setRetriageFinishedStatus: React.Dispatch;\n setScreenedOutReason: React.Dispatch;\n setSelectedProgram: React.Dispatch;\n setSsTriageUuid: React.Dispatch;\n setSurveyAnswers: React.Dispatch;\n setSurveyMetadata: React.Dispatch;\n setSurveyProgressBarState: React.Dispatch;\n setUserData: React.Dispatch;\n setUserProfile: React.Dispatch;\n setTelehealthEligibleStates: React.Dispatch;\n};\n\nexport const AppContext = React.createContext(\n undefined,\n);\n\ntype AppProviderProps = {\n children: React.ReactNode;\n};\n\nexport const AppProvider = ({ children }: AppProviderProps) => {\n const {\n anonymousId: b2bAnonymousUserId,\n identifiableId: b2bIdentifiedUserId,\n setUserDetails: setAnalyticsUserDetails,\n } = useAnalyticsIds();\n const [eligibilityInfo, setEligibilityInfo] = useState();\n const [enrollmentInfo, setEnrollmentInfo] = useState();\n const [enrollmentType, setEnrollmentType] = useState();\n const [errorState, setErrorState] = useState(ErrorState.DEFAULT);\n const [hasB2cAccount, setHasB2cAccount] = useState();\n const [hashedEmail, setHashedEmail] = useState();\n const [maskedEmail, setMaskedEmail] = useState();\n const [partnerInfo, setPartnerInfo] = useState(null);\n const [questionSet, setQuestionSet] = useState([]);\n const [retriageEligibility, setRetriageEligibility] =\n useState();\n const [screenedOutReason, setScreenedOutReason] =\n useState();\n const [selectedProgram, setSelectedProgram] =\n useState(null);\n const [ssTriageUuid, setSsTriageUuid] = useState(null);\n const [surveyAnswers, setSurveyAnswers] = useState({});\n const [surveyProgressBarState, setSurveyProgressBarState] =\n useState({\n currentProgress: 0,\n currentQuestionId: \"\",\n lastProgress: 0,\n currentSectionDescription: \"\",\n currentSectionIndex: 0,\n percentages: [],\n });\n const [surveyMetadata, setSurveyMetadata] = useState();\n const [userData, setUserData] = useState();\n const [userProfile, setUserProfile] = useState(null);\n const [retriageFinishedStatus, setRetriageFinishedStatus] =\n useState();\n\n const [telehealthEligibleStates, setTelehealthEligibleStates] = useState<\n string[] | null\n >(null);\n\n const email = surveyAnswers?.createAccount?.email;\n\n useEffect(() => {\n if (email) {\n setAnalyticsUserDetails({ email });\n toSha256(email).then((sha) => setHashedEmail(sha));\n } else {\n setAnalyticsUserDetails(undefined);\n }\n }, [setAnalyticsUserDetails, email]);\n\n const value: AppContextType = useMemo(\n () => ({\n b2bAnonymousUserId,\n b2bIdentifiedUserId,\n eligibilityInfo,\n enrollmentInfo,\n enrollmentType,\n errorState,\n hasB2cAccount,\n hashedEmail,\n maskedEmail,\n partnerInfo,\n questionSet,\n retriageEligibility,\n retriageFinishedStatus,\n screenedOutReason,\n selectedProgram,\n ssTriageUuid,\n surveyAnswers,\n surveyMetadata,\n surveyProgressBarState,\n userData,\n userProfile,\n telehealthEligibleStates,\n setEligibilityInfo,\n setEnrollmentInfo,\n setEnrollmentType,\n setErrorState,\n setHasB2cAccount,\n setMaskedEmail,\n setPartnerInfo,\n setQuestionSet,\n setRetriageEligibility,\n setRetriageFinishedStatus,\n setScreenedOutReason,\n setSelectedProgram,\n setSsTriageUuid,\n setSurveyAnswers,\n setSurveyMetadata,\n setSurveyProgressBarState,\n setUserData,\n setUserProfile,\n setTelehealthEligibleStates,\n }),\n [\n b2bAnonymousUserId,\n b2bIdentifiedUserId,\n eligibilityInfo,\n enrollmentInfo,\n enrollmentType,\n errorState,\n hasB2cAccount,\n hashedEmail,\n maskedEmail,\n partnerInfo,\n questionSet,\n retriageEligibility,\n retriageFinishedStatus,\n screenedOutReason,\n selectedProgram,\n ssTriageUuid,\n surveyAnswers,\n surveyMetadata,\n surveyProgressBarState,\n userData,\n userProfile,\n telehealthEligibleStates,\n ],\n );\n\n return {children};\n};\n\nexport const useAppContext = () => {\n const context = useContext(AppContext);\n\n if (context === undefined) {\n throw new Error(\"useAppContext must be used within a AppContextProvider\");\n }\n return context;\n};\n","import { Partner } from \"@/models\";\n\nconst CAREFIRST_PARTNER_ID_PROD = 11;\nconst CAREFIRST_PARTNER_ID_TEST = 20;\nconst CARRINGTON_PARTNER_ID_PROD = 207;\nconst CARRINGTON_PARTNER_ID_TEST = 114;\nconst DEMO_DPP_PARTNER_ID_PROD = 95;\nconst JASON_PARTNER_ID_TEST = 58;\nconst PENDULUM_PARTNER_ID_PROD = 266;\nconst PENDULUM_PARTNER_ID_TEST = 788;\nconst NOOM_TEST_PARTNER_ID_PROD = 268;\nconst NOOM_TEST_PARTNER_ID_TEST = 898;\nconst EXTERNAL_COACH_PARTNER_ID_PROD = 283;\nconst EXTERNAL_COACH_PARTNER_ID_TEST = 1590;\nconst BCBS_NC_PARTNER_ID_PROD = 18;\nconst BCBS_NC_PARTNER_ID_TEST = 0; // TODO (osman): Update with correct test partner id\nconst ACCOLADE_PARTNER_ID_PROD = 307;\nconst ACCOLADE_PARTNER_ID_TEST = 2487;\nconst STATE_FARM_PARTNER_ID_PROD = 302;\nconst STATE_FARM_PARTNER_ID_TEST = 2488;\nconst CYPRESS_STATE_FARM_PARTNER_ID_TEST = 0;\n\nconst BAPTIST_HEALTH_SLUG = \"baptisthealth\";\nconst CAREFIRST_SLUG = \"carefirst\";\nconst KENT_COUNTY_SLUG = \"kentcounty\";\nconst PENDULUM_SLUG = \"pendulum\";\nconst STAGING_CF_SLUG = \"cfy2\";\n\nconst PROD_DPP_PARTNERS = [\n CAREFIRST_PARTNER_ID_PROD,\n CARRINGTON_PARTNER_ID_PROD,\n BCBS_NC_PARTNER_ID_PROD,\n DEMO_DPP_PARTNER_ID_PROD,\n];\nconst TEST_DPP_PARTNERS = [\n CAREFIRST_PARTNER_ID_TEST,\n CARRINGTON_PARTNER_ID_TEST,\n JASON_PARTNER_ID_TEST,\n];\n\nconst PROD_B2C_PARTNERS = [\n PENDULUM_PARTNER_ID_PROD,\n NOOM_TEST_PARTNER_ID_PROD,\n EXTERNAL_COACH_PARTNER_ID_PROD,\n];\n\nconst TEST_B2C_PARTNERS = [\n PENDULUM_PARTNER_ID_TEST,\n NOOM_TEST_PARTNER_ID_TEST,\n EXTERNAL_COACH_PARTNER_ID_TEST,\n];\n\nconst PROD_STATE_FARM_PARTNERS = [STATE_FARM_PARTNER_ID_PROD];\nconst TEST_STATE_FARM_PARTNERS = [\n CYPRESS_STATE_FARM_PARTNER_ID_TEST,\n STATE_FARM_PARTNER_ID_TEST,\n];\n\nexport const CAREFIRST_PARTNER_ID =\n window.ENV.NOOM_ENVIRONMENT === \"production\"\n ? CAREFIRST_PARTNER_ID_PROD\n : CAREFIRST_PARTNER_ID_TEST;\n\nexport const BCBS_NC_PARTNER_ID =\n window.ENV.NOOM_ENVIRONMENT === \"production\"\n ? BCBS_NC_PARTNER_ID_PROD\n : BCBS_NC_PARTNER_ID_TEST;\n\nexport const DPP_PARTNERS =\n window.ENV.NOOM_ENVIRONMENT === \"production\"\n ? PROD_DPP_PARTNERS\n : TEST_DPP_PARTNERS;\n\nexport const B2C_PARTNERS =\n window.ENV.NOOM_ENVIRONMENT === \"production\"\n ? PROD_B2C_PARTNERS\n : TEST_B2C_PARTNERS;\n\nexport const PENDULUM_PARTNER_ID =\n window.ENV.NOOM_ENVIRONMENT === \"production\"\n ? PENDULUM_PARTNER_ID_PROD\n : PENDULUM_PARTNER_ID_TEST;\n\nexport const NOOM_TEST_PARTNER_ID =\n window.ENV.NOOM_ENVIRONMENT === \"production\"\n ? NOOM_TEST_PARTNER_ID_PROD\n : NOOM_TEST_PARTNER_ID_TEST;\n\nexport const EXTERNAL_COACH_PARTNER_ID =\n window.ENV.NOOM_ENVIRONMENT === \"production\"\n ? EXTERNAL_COACH_PARTNER_ID_PROD\n : EXTERNAL_COACH_PARTNER_ID_TEST;\n\nexport const ACCOLADE_PARTNER_ID =\n window.ENV.NOOM_ENVIRONMENT === \"production\"\n ? ACCOLADE_PARTNER_ID_PROD\n : ACCOLADE_PARTNER_ID_TEST;\n\nexport const STATE_FARM_PARTNERS =\n window.ENV.NOOM_ENVIRONMENT === \"production\"\n ? PROD_STATE_FARM_PARTNERS\n : TEST_STATE_FARM_PARTNERS;\n\n/**\n * List of partners that should see the GLP-1 weight question.\n */\nexport const GLP1_WEIGHT_LOGIC_PARTNERS = [CAREFIRST_SLUG, KENT_COUNTY_SLUG];\n\n/**\n * List of partners that should not display the health data consent form.\n */\nexport const HEALTH_DATA_CONSENT_DISABLED_PARTNERS = [\n BAPTIST_HEALTH_SLUG,\n CAREFIRST_SLUG,\n PENDULUM_SLUG,\n STAGING_CF_SLUG,\n];\n\n/**\n * List of partners that should not display the ability to opt out.\n */\nexport const OPT_OUT_DISABLED_PARTNERS = [\n BAPTIST_HEALTH_SLUG,\n CAREFIRST_SLUG,\n STAGING_CF_SLUG,\n];\n\nconst DO_NOT_TRACK_PARTNERS = [\n BAPTIST_HEALTH_SLUG,\n CAREFIRST_SLUG,\n STAGING_CF_SLUG,\n];\n\nexport const isDoNotTrackPartner = (partnerInfo: Partner) =>\n DPP_PARTNERS.includes(partnerInfo.id) ||\n DO_NOT_TRACK_PARTNERS.includes(partnerInfo.slug);\n","/* eslint-disable no-console */\nimport libphonenumber from \"google-libphonenumber\";\n\nimport { B2C_PARTNERS, CAREFIRST_PARTNER_ID } from \"@/constants/Partners\";\nimport type { Partner } from \"@/models\";\n\n/**\n * Formats the partner's custom support link into a more user friendly string.\n * Supports https, mailto, and tel URIs\n *\n * Examples:\n *\n * \"https://www.noom.com\" -> \"https://www.noom.com\"\n *\n * \"mailto:partnersupport@noom.com\" -> \"partnersupport@noom.com\"\n *\n * \"tel:+18882665071\" -> \"(888) 266-5071\"\n *\n * @param supportLink custom support link for the partner\n * @returns formatted support link, or empty string\n */\nexport const formatCustomSupportLink = (supportLink: string) => {\n const parts = supportLink.split(\":\", 2);\n\n if (parts.length !== 2) {\n console.error(`Invalid custom support link: ${supportLink}`);\n return \"\";\n }\n\n const [scheme, value] = parts;\n\n if (scheme === \"https\") {\n return supportLink;\n }\n\n if (scheme === \"mailto\") {\n return value;\n }\n\n if (scheme === \"tel\") {\n const phoneNumberUtil = libphonenumber.PhoneNumberUtil.getInstance();\n const PNF = libphonenumber.PhoneNumberFormat;\n\n try {\n const number = phoneNumberUtil.parse(supportLink, \"US\");\n return phoneNumberUtil.format(number, PNF.NATIONAL);\n } catch (error) {\n console.error(`Invalid phone number: ${supportLink}`, error);\n return \"\";\n }\n }\n\n console.error(`Unsupported URI scheme: ${supportLink}`);\n return \"\";\n};\n\nexport const isB2CPartner = (partnerInfo: Partner | null) =>\n B2C_PARTNERS.includes(partnerInfo?.id as number);\n\nexport const isCareFirstPartner = (partnerInfo: Partner | null) =>\n partnerInfo?.id === CAREFIRST_PARTNER_ID;\n","import { differenceInYears } from \"date-fns\";\n\nimport { AppContextType } from \"@/contexts\";\n\nexport function getDateOfBirth({\n surveyAnswers,\n retriageEligibility,\n}: Pick):\n | Date\n | undefined {\n if (surveyAnswers.eligibilityCheck?.dob) {\n return surveyAnswers.eligibilityCheck.dob;\n }\n if (retriageEligibility?.userProfile?.dateOfBirth) {\n const dob = retriageEligibility.userProfile.dateOfBirth;\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n return new Date(dob.year!, dob.month! - 1, dob.day!);\n }\n return undefined;\n}\n\nexport function getAge({\n surveyAnswers,\n retriageEligibility,\n}: Pick) {\n const { eligibilityCheck } = surveyAnswers;\n if (eligibilityCheck?.age) {\n return eligibilityCheck.age;\n }\n const dob = getDateOfBirth({ surveyAnswers, retriageEligibility });\n if (dob) {\n return differenceInYears(new Date(), dob);\n }\n return undefined;\n}\n","export const calculateBMI = (\n heightFeetPortion: number,\n heightInchesPortion: number,\n weightInLbs: number,\n): number => {\n const heightInInches = heightFeetPortion * 12 + heightInchesPortion;\n\n return (weightInLbs / heightInInches ** 2) * 703;\n};\n","import { format } from \"date-fns\";\nimport { omit } from \"lodash\";\n\nimport { AppContextType, SurveyAnswers } from \"@/contexts\";\n\nimport { getAge } from \"./age\";\nimport { calculateBMI } from \"./calculateBMI\";\n\nexport const calculateDppRiskScore = (\n context: Pick,\n) => {\n const {\n familyHistory,\n gestationalDiabetes,\n heightWeight,\n hypertension,\n physicalActivity,\n prediabetesHistory,\n sex,\n } = <\n {\n familyHistory: string;\n gestationalDiabetes: string;\n heightWeight: {\n heightFeetPortion: number;\n heightInchesPortion: number;\n weight: number;\n };\n hypertension: string;\n physicalActivity: string;\n prediabetesHistory: string[];\n sex: string;\n }\n >context.surveyAnswers;\n\n let dppRiskScore = 0;\n\n const bmi = calculateBMI(\n heightWeight?.heightFeetPortion,\n heightWeight?.heightInchesPortion,\n heightWeight?.weight,\n );\n\n if (bmi >= 23 && bmi < 30) {\n dppRiskScore += 1;\n } else if (bmi >= 30 && bmi < 40) {\n dppRiskScore += 2;\n } else if (bmi >= 40) {\n dppRiskScore += 3;\n } else {\n dppRiskScore += 0;\n }\n\n const age = getAge(context);\n if (!age) {\n dppRiskScore += 0;\n } else if (age >= 40 && age < 50) {\n dppRiskScore += 1;\n } else if (age >= 50 && age < 60) {\n dppRiskScore += 2;\n } else if (age >= 60) {\n dppRiskScore += 3;\n } else {\n dppRiskScore += 0;\n }\n\n dppRiskScore +=\n prediabetesHistory?.reduce(\n (acc, risk) =>\n acc +\n ([\"prediabetes\", \"a1c\", \"fastingBloodSugarLevel\"].includes(risk)\n ? 5\n : 0),\n 0,\n ) || 0;\n\n dppRiskScore += sex === \"male\" ? 1 : 0;\n dppRiskScore += gestationalDiabetes === \"yes\" ? 5 : 0;\n dppRiskScore += hypertension === \"yes\" ? 1 : 0;\n dppRiskScore += familyHistory === \"yes\" ? 1 : 0;\n dppRiskScore += physicalActivity === \"no\" ? 1 : 0;\n\n return dppRiskScore;\n};\n\nexport const sanitizeDppSurveyAnswers = (\n surveyAnswers: SurveyAnswers,\n): Record => {\n const QUESTION_BLOCKLIST = [\n \"createAccount\",\n \"createPassword\",\n \"completeProfile\",\n \"existingPassword\",\n \"phoneNumber\",\n ];\n let sanitizedSurveyAnswers: Record = omit(\n surveyAnswers,\n QUESTION_BLOCKLIST,\n );\n\n // convert date to string (don't need/want time info)\n if (surveyAnswers.eligibilityCheck?.dob) {\n sanitizedSurveyAnswers = {\n ...sanitizedSurveyAnswers,\n eligibilityCheck: {\n ...surveyAnswers.eligibilityCheck,\n dob: format(surveyAnswers.eligibilityCheck.dob as Date, \"yyyy-MM-dd\"),\n },\n };\n }\n return sanitizedSurveyAnswers;\n};\n","import { DppTriageProto_CompletionStatus } from \"@noom/noom-contracts/noom_contracts/healthcare/dpp_triage\";\nimport { Api } from \"@noom/noomscape\";\n\nimport { SurveyAnswers, useAppContext } from \"@/contexts\";\nimport { sanitizeDppSurveyAnswers } from \"@/utils/dpp\";\n\nexport const useSaveTriageData = (partnerId: number | undefined) => {\n const { eligibilityInfo, ssTriageUuid, setSsTriageUuid } = useAppContext();\n\n const saveTriageData = async (\n surveyAnswers: SurveyAnswers,\n completionStatus: DppTriageProto_CompletionStatus,\n ) => {\n const participantId =\n surveyAnswers.eligibilityCheck?.employeeId || eligibilityInfo?.employeeId;\n\n const { key } = await Api.call(\n \"dpp.saveTriageData\",\n Api.api.dpp.saveTriageData,\n {\n completionStatus,\n partnerId,\n survey: sanitizeDppSurveyAnswers(surveyAnswers),\n ...(!!participantId && { participantId }),\n ...(!!ssTriageUuid && { resourceKey: ssTriageUuid }),\n },\n );\n\n if (!ssTriageUuid) {\n setSsTriageUuid(key);\n }\n\n return key;\n };\n\n return { saveTriageData };\n};\n","import { useLocation } from \"react-router-dom\";\n\nexport type QueryParamsWithoutPii = {\n data?: string;\n eligibilityId?: string;\n enrollmentSlug?: string;\n passcode?: string;\n pwResetRedirect?: string;\n sharedEligibility?: string;\n upid?: string;\n leadSource?: string;\n utm_source?: string;\n utm_medium?: string;\n utm_campaign?: string;\n};\n\n// List of parameters that can contain PII and need to be hidden from pixels and third parties.\n// These will be re-appended for some API calls, since they can be important for backend handling.\nexport const paramNamesWithPii = [\n \"name\",\n \"email\",\n\n // Referrals\n \"ref_email\",\n\n // UTM params that can contain PII.\n \"utm_term\",\n \"utm_content\",\n] as const;\n\nexport type PiiQueryParams = {\n [K in (typeof paramNamesWithPii)[number]]?: string;\n};\n\nexport type QueryParamsWithPii = QueryParamsWithoutPii & PiiQueryParams;\n\nexport const useQueryParams = (): QueryParamsWithoutPii => {\n const { search } = useLocation();\n const rawQueryParams = new URLSearchParams(search);\n return {\n data: rawQueryParams.get(\"data\") ?? undefined,\n eligibilityId: rawQueryParams.get(\"eligibilityId\") ?? undefined,\n enrollmentSlug: rawQueryParams.get(\"enrollmentSlug\") ?? undefined,\n passcode: rawQueryParams.get(\"passcode\") ?? undefined,\n pwResetRedirect: rawQueryParams.get(\"pwResetRedirect\") ?? undefined,\n sharedEligibility: rawQueryParams.get(\"sharedEligibility\") ?? undefined,\n upid: rawQueryParams.get(\"upid\")?.toLowerCase(),\n leadSource: rawQueryParams.get(\"leadSource\") ?? undefined,\n utm_source: rawQueryParams.get(\"utm_source\") ?? undefined,\n utm_medium: rawQueryParams.get(\"utm_medium\") ?? undefined,\n utm_campaign: rawQueryParams.get(\"utm_campaign\") ?? undefined,\n };\n};\n","import {\n paramNamesWithPii,\n QueryParamsWithoutPii,\n QueryParamsWithPii,\n} from \"@/hooks/useQueryParams\";\n\nexport function updateURLParams(newParams: Record) {\n const url = new URL(window.location.href);\n\n Object.entries(newParams).forEach(([key, value]) => {\n if (value == null) {\n url.searchParams.delete(key);\n } else {\n url.searchParams.set(key, `${value}`);\n }\n });\n\n window.history.replaceState(window.history.state, \"\", url.toString());\n}\n\nconst URL_PARAMS_PII_KEY = \"urlpSession\";\n\ntype QueryParametersState = Record;\n\nlet urlParamsPiiSessionStore: QueryParametersState;\ntry {\n urlParamsPiiSessionStore = JSON.parse(\n sessionStorage.getItem(URL_PARAMS_PII_KEY) || \"{}\",\n );\n} catch {\n urlParamsPiiSessionStore = {};\n}\n\nexport function getUrlParamsPii(): QueryParametersState {\n return urlParamsPiiSessionStore;\n}\n\nfunction setUrlParamsPii(params: QueryParametersState) {\n urlParamsPiiSessionStore = params;\n sessionStorage.setItem(\n URL_PARAMS_PII_KEY,\n JSON.stringify(urlParamsPiiSessionStore),\n );\n}\n\n// Determines which params need to be hidden and which can remain.\nexport function categorizeParams(params: URLSearchParams) {\n const paramObj = Object.fromEntries(params.entries());\n const hiddenParams: Record = {};\n paramNamesWithPii.forEach((deny) => {\n if (paramObj[deny]) {\n hiddenParams[deny] = paramObj[deny];\n delete paramObj[deny];\n }\n });\n return {\n params: paramObj,\n hidden: hiddenParams,\n };\n}\n\n// Modifies the current URL to hide params. Should be called before any third-party code (pixels)\n// is loaded.\nexport function init() {\n const urlParams = new URLSearchParams(window.location.search);\n const prevHiddenParams = getUrlParamsPii();\n const { hidden } = categorizeParams(urlParams);\n // Keys set to null are removed from the URL\n updateURLParams(\n Object.keys(hidden).reduce(\n (ret, key) => ({\n ...ret,\n [key]: null,\n }),\n {},\n ),\n );\n setUrlParamsPii({ ...prevHiddenParams, ...hidden });\n}\n\n// Modifies the given params by adding the hidden params to it.\nexport function appendPiiParams(params: URLSearchParams) {\n const piiParams = getUrlParamsPii();\n const newParams = new URLSearchParams(params);\n Object.keys(piiParams).forEach((key) => {\n if (piiParams[key]) {\n newParams.set(key, `${piiParams[key]}`);\n }\n });\n return newParams;\n}\n\n// As appendPiiParams, but with stronger typing on inputs and outputs and without pass-through of arbitrary parameters.\nexport function withPiiQueryParams(\n params: QueryParamsWithoutPii,\n): QueryParamsWithPii {\n const piiParams = getUrlParamsPii();\n return {\n ...params,\n name: piiParams.name?.toString(),\n email: piiParams.email?.toString(),\n ref_email: piiParams.ref_email?.toString(),\n utm_term: piiParams.utm_term?.toString(),\n utm_content: piiParams.utm_content?.toString(),\n };\n}\n","import {\n CivilDateProto,\n CivilDateTimeProto,\n} from \"@noom/noom-contracts/noom_contracts/lib/time/civil_time\";\n\nexport function createCivilDate(d: Date): CivilDateProto {\n return {\n day: d.getDate(),\n // CivilDateProto expects month in range [1, 12]\n month: d.getMonth() + 1,\n year: d.getFullYear(),\n };\n}\n\nexport function createCivilDateTime(t: Date): CivilDateTimeProto {\n return {\n date: createCivilDate(t),\n time: {\n hour: t.getHours(),\n minute: t.getMinutes(),\n second: t.getSeconds(),\n },\n };\n}\n","import { UpfrontEligibilityEnforcementProto_Value } from \"@noom/noom-contracts/noom_contracts/backend/enrollment/deployments/upfront_eligibility_enforcement\";\nimport { CheckEligibilityResponseProto } from \"@noom/noom-contracts/noom_contracts/backend/partner/service/partner_eligibility_service\";\n\nimport type { Address } from \"./Address\";\n\nexport type EligibilityEnforcementType = Exclude<\n UpfrontEligibilityEnforcementProto_Value,\n \"UNKNOWN\" | \"UNRECOGNIZED\"\n>;\n\nexport enum EligibilityReason {\n ELIGIBLE = \"ELIGIBLE\",\n EXISTING_ACCOUNT = \"EXISTING_ACCOUNT\",\n INELIGIBLE = \"INELIGIBLE\",\n NOT_IN_LATEST_FILE = \"NOT_IN_LATEST_FILE\",\n PRIOR_TO_EFFECTIVE_DATE = \"PRIOR_TO_EFFECTIVE_DATE\",\n API_ERROR = \"API_ERROR\",\n MULTIPLE_MATCHES = \"MULTIPLE_MATCHES\",\n}\n\nexport type EligibilityVerificationProperties = {\n email?: string;\n firstName?: string;\n lastName?: string;\n dateOfBirth?: string;\n participantId?: string;\n eligibilityId?: string;\n policyId?: string;\n};\n\nexport type EligibilityExtras = Partial<{\n address: Address;\n phoneNumber: string;\n policyId: string;\n}>;\n\nexport type EligibilityResponse = CheckEligibilityResponseProto;\n\nexport type EligibilityInfo = Partial<{\n dob: Date;\n effectiveDate: Date;\n email: string;\n employeeId: string;\n firstName: string;\n lastName: string;\n isMedEligible: boolean;\n segmentId: string;\n segmentName: string;\n}> &\n EligibilityExtras;\n","/**\n * Analytics Data model type\n *\n * Copyright (C) 2020A Noom, Inc.\n * @author todd.blank\n */\n\nimport { Curriculum } from \"@/constants/Curriculum\";\n\nimport { EligibilityEnforcementType } from \"./Eligibility\";\n\nexport enum BusinessType {\n UNKNOWN = \"UNKNOWN\",\n B2B = \"B2B\",\n B2C = \"B2C\",\n TEST = \"TEST\",\n}\n\nexport type EnrollmentInformation = {\n batchId: number;\n batchName: string;\n customSupportEmail?: string;\n deploymentId: number;\n deploymentName: string;\n eligiblePrograms: Curriculum[];\n partnerId: number;\n partnerName: string;\n triagePrograms: Curriculum[];\n upfrontEligibilityEnforcement: EligibilityEnforcementType;\n businessType: BusinessType;\n};\n","import { ProgramOffering } from \"@/constants\";\nimport { AppContextType } from \"@/contexts\";\n\n/**\n * Represents a mapping of experiment names to their assigned variations\n * Used to track which variation a user is assigned to for each experiment\n */\nexport type ExperimentAssignments = Record;\n\nexport type Context = {\n partnerId: string;\n selectedProgram: AppContextType[\"selectedProgram\"];\n partnerOfferings: ProgramOffering[];\n};\n\n/**\n * Represents an ECT (separate core product experiments) configuration\n * Contains the experiment name and variation information\n */\nexport type EctExperiment = {\n /** The name/identifier of the experiment */\n name: string;\n /** The specific variation assigned to this experiment */\n variation: string;\n};\n\n/**\n * Represents a variation within an experiment\n * Contains configuration for how the variation should be weighted and any mapped ECT experiments\n */\nexport type Variation = {\n /** The name/identifier of the variation */\n name: string;\n /** The weight/probability of this variation being assigned (used for traffic allocation) */\n weight: number;\n /** Optional nested experiments that should be triggered when this variation is assigned */\n ectExperiments?: EctExperiment[];\n};\n\nexport type Operator =\n | \"EQUALS\" // Exact match\n | \"NOT EQUALS\" // Exact mismatch\n | \"IN\" // Context value is in the list of target values\n | \"NOT IN\" // Context value is not in the list of target values\n | \"CONTAINS\" // Context value contains the target value\n | \"NOT CONTAINS\"; // Context value does not contain the target value\n\nexport type TargetingValue = T extends \"IN\" | \"NOT IN\"\n ? string[]\n : string;\n\nexport type ContextValue = T extends\n | \"CONTAINS\"\n | \"NOT CONTAINS\"\n ? string[]\n : string;\n\n/**\n * Represents a targeting rule that determines which users are eligible for an experiment\n */\nexport type Targeting = {\n /** The context key being targeted (e.g., partnerId, selectedProgram, partnerOfferings, etc.) */\n key: keyof Context;\n} & {\n [K in Operator]: {\n /** The operator to use for comparison (equals, contains, etc.) */\n operator: K;\n /** The value to compare against */\n value: TargetingValue;\n };\n}[Operator];\n\n/**\n * Represents a complete experiment configuration\n * Contains all the necessary information to run an experiment including variations and targeting rules\n */\nexport type Experiment = {\n /** The name/identifier of the experiment */\n name: string;\n /** List of variations available in this experiment */\n variations: Variation[];\n /** Optional targeting rules that determine which users are eligible for the experiment */\n targeting?: Targeting[];\n /** Whether this experiment should be exclusive (exclusive with other experiments) */\n isExclusive?: boolean;\n};\n\n// See experiment.example.ts for examples of how to use the Experiment type\n// Selection Process:\n// 1. Filters eligible experiments based on targeting rules\n// 2. Select one experiment deterministically based on user ID\n// 3. If the selected experiment is exclusive it will be the sole experiment the user is assigned\n// 4. Else the user is assigned all eligible non-exclusive experiments\nexport const EXPERIMENT_CONFIG: Experiment[] = [];\n","import { B2BProductOfferingProto } from \"@noom/noom-contracts/noom_contracts/backend/enrollment/b2b/enrollment_offerings\";\n\nimport { Curriculum, ProgramOffering } from \"@/constants\";\nimport { EnrollmentInformation, Partner } from \"@/models\";\n\nconst CURRICULUM_TO_PROGRAM_OFFERING_MAP: Record<\n Curriculum,\n ProgramOffering | undefined\n> = {\n [Curriculum.CURRICULUM_UNSPECIFIED]: undefined,\n [Curriculum.DPP]: \"DPP\",\n [Curriculum.HM]: \"MOOD\",\n [Curriculum.HW]: \"WEIGHT\",\n};\n\nexport const PROGRAM_OFFERING_TO_CURRICULUM_MAP: Record<\n ProgramOffering,\n Curriculum\n> = {\n DPP: Curriculum.DPP,\n MED: Curriculum.HW,\n MOOD: Curriculum.HM,\n NMPBA: Curriculum.HW,\n WEIGHT: Curriculum.HW,\n};\n\n/**\n * Gets the curriculum associated with a program.\n *\n * @param {ProgramOffering | null} program\n * @returns {Curriculum}\n */\nexport const getCurriculumFromProgramOffering = (\n program: ProgramOffering | null,\n): Curriculum => {\n if (program === null) {\n return Curriculum.CURRICULUM_UNSPECIFIED;\n }\n\n return PROGRAM_OFFERING_TO_CURRICULUM_MAP[program];\n};\n\n/**\n * Get partner offerings all of the given programs - used to know if\n * certain pages or features should be gated behind those programs.\n *\n * @param enrollmentInfo Enrollment info of the UPID - used to check what\n * programs the UPID can be enrolled into\n * @param partnerInfo Information about the partner - used to check if certain\n * configs are enabled (e.g. if Noom Med is offered)\n * @returns List of programs that the partner offers\n */\nexport const getPartnerProgramOfferings = (\n enrollmentInfo: EnrollmentInformation | undefined,\n partnerInfo: Partner | null,\n): ProgramOffering[] => {\n const { eligiblePrograms = [], triagePrograms = [] } = enrollmentInfo || {};\n const { configs: { OFFERS_MED = false } = {} } = partnerInfo || {};\n\n const partnerProgramOfferings = [...eligiblePrograms, ...triagePrograms]\n .map((curriculum) => CURRICULUM_TO_PROGRAM_OFFERING_MAP[curriculum])\n .filter((program) => program) as ProgramOffering[];\n\n if (OFFERS_MED) {\n partnerProgramOfferings.push(\"MED\");\n }\n return partnerProgramOfferings;\n};\n\n/**\n * Determines if a partner offers all of the given programs - used to know if\n * certain pages or features should be gated behind those programs.\n *\n * @param programs List of programs to check against\n * @param enrollmentInfo Enrollment info of the UPID - used to check what\n * programs the UPID can be enrolled into\n * @param partnerInfo Information about the partner - used to check if certain\n * configs are enabled (e.g. if Noom Med is offered)\n * @returns True if the given programs are offered, false otherwise\n */\nexport const partnerOffersPrograms = (\n programs: ProgramOffering[],\n enrollmentInfo: EnrollmentInformation | undefined,\n partnerInfo: Partner | null,\n): boolean =>\n programs.every((program) =>\n getPartnerProgramOfferings(enrollmentInfo, partnerInfo).includes(program),\n );\n\n/**\n * Reads a B2B product offering composed of program and coursepacks to\n * determine the matching frontend program offering\n *\n * @param productOffering the product offering representation\n * @returns\n */\nexport const getProgramFromOffering = (\n productOffering: B2BProductOfferingProto | undefined,\n): ProgramOffering | null => {\n if (!productOffering) {\n return null;\n }\n\n const { program, coursePacks } = productOffering;\n\n switch (program) {\n case \"DIABETES_PREVENTION\":\n return \"DPP\";\n case \"HEALTHY_MIND\":\n return \"MOOD\";\n case \"HEALTHY_WEIGHT\":\n if (coursePacks.find(({ value }) => value === \"MED\")) {\n return \"MED\";\n }\n\n return \"WEIGHT\";\n default:\n return null;\n }\n};\n\nexport const getOfferingFromProgram = (\n program: ProgramOffering,\n): B2BProductOfferingProto => {\n // currently we are building hardcoded offerings and ignoring coursepacks sent from the backend.\n // Supporting coursepacks sent from the backend is another level of complexity which we don't need yet.\n switch (program) {\n case \"WEIGHT\":\n return {\n program: \"HEALTHY_WEIGHT\",\n coursePacks: [],\n };\n case \"MED\":\n return {\n program: \"HEALTHY_WEIGHT\",\n coursePacks: [{ value: \"MED\" }],\n };\n case \"DPP\":\n return {\n program: \"DIABETES_PREVENTION\",\n coursePacks: [],\n };\n default:\n throw new Error(`Cannot convert unsupported program: ${program}`);\n }\n};\n\n/**\n * Determines the list of programs a user is eligible for based on the product\n * offerings the user is eligible for\n *\n * @param eligibleOfferings List of product offerings that a user is eligible for\n * @returns List of programs that the product offerings represent\n */\nexport const getEligibleProgramsFromEligibleOfferings = (\n eligibleOfferings: B2BProductOfferingProto[],\n): ProgramOffering[] =>\n eligibleOfferings\n .map((offering) => getProgramFromOffering(offering))\n .filter((program): program is ProgramOffering => program !== null);\n","import { sha256 } from \"@noble/hashes/sha2\";\nimport { bytesToHex as toHex } from \"@noble/hashes/utils\";\n\nimport { useAppContext } from \"@/contexts\";\nimport {\n Context,\n ContextValue,\n EctExperiment,\n Experiment,\n EXPERIMENT_CONFIG,\n ExperimentAssignments,\n Operator,\n TargetingValue,\n} from \"@/models/experiments\";\nimport { getPartnerProgramOfferings } from \"@/utils/programs\";\nimport { captureException } from \"@/utils/sentry\";\n\n/**\n * Evaluates a targeting condition against a context value using various operators\n * @param operator - The comparison operator to use for evaluation\n * @param value - The target value to compare against (single value or array)\n * @param contextValue - The current context value to evaluate\n * @returns boolean indicating if the condition is met\n * @example\n * evaluateCondition(\"IN\", [\"1\", \"2\"], \"1\") // returns true\n * evaluateCondition(\"CONTAINS\", \"DPP\", [\"DPP\", \"Other\"]) // returns true\n */\nexport const evaluateCondition = (\n operator: T,\n value: TargetingValue,\n contextValue: ContextValue,\n): boolean => {\n const conditions: {\n [K in Operator]: (v: TargetingValue, cv: ContextValue) => boolean;\n } = {\n EQUALS: (v, cv) => cv === v,\n \"NOT EQUALS\": (v, cv) => cv !== v,\n IN: (v, cv) => v.includes(cv),\n \"NOT IN\": (v, cv) => !v.includes(cv),\n CONTAINS: (v, cv) => cv.includes(v),\n \"NOT CONTAINS\": (v, cv) => !cv.includes(v),\n };\n return conditions[operator](value, contextValue);\n};\n\n/**\n * Determines if an experiment should be active based on its targeting conditions\n * @param experiment - The experiment configuration to evaluate\n * @param context - The current user/session context\n * @returns boolean indicating if the experiment is eligible\n */\nexport const isEligibleForExperiment = (\n experiment: Experiment,\n context: Context,\n): boolean => {\n // If no targeting rules, experiment is always eligible\n if (!experiment.targeting) return true;\n\n return experiment.targeting.every((condition) => {\n const contextValue = context[condition.key];\n return (\n contextValue !== null &&\n evaluateCondition(condition.operator, condition.value, contextValue)\n );\n });\n};\n\n/**\n * Assigns a variation to a user based on their ID and variation weights\n * Uses a deterministic hashing approach to ensure consistent assignment\n * @param experiment - The experiment configuration containing variations\n * @param userId - The user's ID used for consistent assignment\n * @returns The name of the assigned variation\n */\nexport const assignVariation = (\n experiment: Experiment,\n userId: string,\n): string => {\n // Calculate total weight for normalization\n const totalWeight = experiment.variations.reduce(\n (sum, variation) => sum + variation.weight,\n 0,\n );\n\n // Combine userId and experiment name such that assignments are deterministic but independent across experiments\n const hex = toHex(sha256(`${userId}-${experiment.name}`));\n // Convert hash to a number within the weight range\n const weightedIndex = Number(BigInt(`0x${hex}`) % BigInt(totalWeight));\n\n // Find the variation that corresponds to the weighted index\n let cumulativeWeight = 0;\n for (let i = 0; i < experiment.variations.length; i += 1) {\n cumulativeWeight += experiment.variations[i].weight;\n if (weightedIndex < cumulativeWeight) {\n return experiment.variations[i].name;\n }\n }\n\n // Alert and default to the first variation if none selected (should never happen)\n captureException(\n Error(`No variation selected for experiment ${experiment.name}`),\n );\n return experiment.variations[0].name;\n};\n\n/**\n * Retrieves all ECT experiments associated with the current experiment assignments\n * @param experiments - Map of experiment names to their assigned variations\n * @returns Array of enabled ECT experiments\n * @example\n * const assignments = { \"pricingTest\": \"variantA\" };\n * const ectExperiments = getEctExperiments(assignments);\n * // Returns: [{ name: \"ectExp1\", variations: \"control\" }, ...]\n */\nexport const getEctExperiments = (experiments: ExperimentAssignments): EctExperiment[] =>\n Object.entries(experiments).flatMap(([name, variation]) => {\n const experiment = EXPERIMENT_CONFIG.find((exp) => exp.name === name);\n const assignedVariation = experiment?.variations.find(\n (v) => v.name === variation,\n );\n return assignedVariation?.ectExperiments ?? [];\n });\n\nexport const useExperiment = () => {\n const { b2bAnonymousUserId, partnerInfo, selectedProgram, enrollmentInfo } =\n useAppContext();\n\n const context: Context = {\n partnerId: String(partnerInfo?.id),\n selectedProgram,\n partnerOfferings: getPartnerProgramOfferings(enrollmentInfo, partnerInfo),\n };\n\n /**\n * Gets the current experiment assignments for the user\n * For exclusive experiments, only one will be assigned\n * For non-exclusive experiments, all eligible ones will be assigned\n * @returns Record of experiment names to their assigned variations\n */\n function getExperimentAssignments(): ExperimentAssignments {\n const eligibleExperiments = EXPERIMENT_CONFIG.filter((experiment) =>\n isEligibleForExperiment(experiment, context),\n );\n\n if (eligibleExperiments.length === 0) {\n return {};\n }\n\n // Deterministically select an experiment based on user ID\n const randomExperiment =\n eligibleExperiments[\n Number(\n BigInt(`0x${b2bAnonymousUserId}`) %\n BigInt(eligibleExperiments.length),\n )\n ];\n\n // If exclusive, only return the selected experiment\n if (randomExperiment.isExclusive) {\n return {\n [randomExperiment.name]: assignVariation(\n randomExperiment,\n b2bAnonymousUserId,\n ),\n };\n }\n\n // Otherwise, return all non-exclusive experiments\n return eligibleExperiments\n .filter((experiment) => !experiment.isExclusive)\n .reduce(\n (assignments, experiment) => ({\n ...assignments,\n [experiment.name]: assignVariation(experiment, b2bAnonymousUserId),\n }),\n {},\n );\n }\n\n return { getExperimentAssignments };\n};\n","import { KinesisClient, PutRecordCommand } from \"@aws-sdk/client-kinesis\";\nimport { fromCognitoIdentityPool } from \"@aws-sdk/credential-providers\";\nimport Cookies from \"js-cookie\";\nimport { v4 as uuidv4 } from \"uuid\";\n\nimport type { NoomEventProto } from \"@noom/noom-contracts/noom_contracts/events/noom_event\";\nimport type { NoomB2BEnrollmentEventProto } from \"@noom/noom-contracts/noom_contracts/events/web/b2b/enrollment\";\nimport type { NoomB2BEnrollmentAnonEventProto } from \"@noom/noom-contracts/noom_contracts/events/web/b2b/enrollment_anon\";\nimport type {\n NoomB2BEnrollmentIdentifiedEventProto,\n NoomB2BEnrollmentIdentifiedEventProto_SharedPropertiesProto,\n} from \"@noom/noom-contracts/noom_contracts/events/web/b2b/enrollment_identified\";\nimport { NoomB2BSurveyEventProto } from \"@noom/noom-contracts/noom_contracts/events/web/b2b/survey\";\nimport {\n NoomB2BSurveyAnonEventProto,\n NoomB2BSurveyAnonEventProto_SharedPropertiesProto,\n} from \"@noom/noom-contracts/noom_contracts/events/web/b2b/survey_anon\";\nimport {\n NoomB2BSurveyIdentifiedEventProto,\n NoomB2BSurveyIdentifiedEventProto_SharedPropertiesProto,\n} from \"@noom/noom-contracts/noom_contracts/events/web/b2b/survey_identified\";\n\nimport { useAppContext } from \"@/contexts\";\nimport { withPiiQueryParams } from \"@/utils/pixels/urlParamsPii\";\nimport { createCivilDateTime } from \"@/utils/proto\";\nimport { captureException } from \"@/utils/sentry\";\nimport { isBuyflowTraffic } from \"@/utils/userSegment\";\n\nimport { useExperiment } from \"./useExperiment\";\nimport { useQueryParams } from \"./useQueryParams\";\n\nconst AWS_REGION = \"us-east-1\";\n\nexport const useTrackEvent = () => {\n const {\n b2bAnonymousUserId,\n b2bIdentifiedUserId,\n eligibilityInfo,\n enrollmentType,\n partnerInfo,\n retriageEligibility,\n surveyMetadata,\n userProfile,\n } = useAppContext();\n const { getExperimentAssignments } = useExperiment();\n const queryParams = useQueryParams();\n\n const growthUserId = Cookies.get(\"_userId\");\n const shouldUseGrowthUserId = isBuyflowTraffic() && !!growthUserId;\n\n const identifiedEventPartitionKey = shouldUseGrowthUserId\n ? growthUserId\n : b2bIdentifiedUserId;\n\n const getTransformedExperimentAssignments = () =>\n Object.entries(getExperimentAssignments()).map(\n ([name, variation]) => `${name}_${variation}`,\n );\n\n /**\n * Gets segment info from eligibility or user profile response (mutually exclusive).\n */\n const getSegmentInfo: () => {\n segmentId?: string;\n segmentName?: string;\n } = () => {\n if (eligibilityInfo) {\n return {\n segmentId: eligibilityInfo.segmentId,\n segmentName: eligibilityInfo.segmentName,\n };\n }\n if (retriageEligibility) {\n return {\n segmentId: retriageEligibility.segmentId,\n segmentName: retriageEligibility.segmentName,\n };\n }\n if (userProfile) {\n return {\n segmentId: userProfile.segmentId,\n segmentName: userProfile.segmentName,\n };\n }\n return {};\n };\n\n /**\n * Sends the event to AWS Kinesis to be picked up by the data team.\n *\n * @param event Event structure specified by the noom-contracts schema\n */\n const sendEvent = async (event: NoomEventProto, partitionKey: string) => {\n const command = new PutRecordCommand({\n Data: new TextEncoder().encode(JSON.stringify(event)),\n PartitionKey: partitionKey,\n StreamName: \"event-stream\",\n });\n\n try {\n const kinesisClient = new KinesisClient({\n credentials: fromCognitoIdentityPool({\n clientConfig: {\n region: AWS_REGION,\n },\n identityPoolId: window.ENV.COGNITO_IDENTITY_POOL,\n }),\n region: AWS_REGION,\n });\n\n await kinesisClient.send(command);\n } catch (e) {\n captureException(e);\n }\n };\n\n /**\n * Constructs a Noom Event object with shared properties across B2B\n * enrollment events - both anonymous and identified events.\n *\n * @param eventPayload Specific event payload to be nested under the top\n * level Noom Event.\n * @returns Noom Event object that will be sent using Kinesis.\n */\n const constructEnrollmentEvent = (\n eventPayload: Omit,\n ): NoomEventProto => {\n const now = new Date(Date.now());\n const timestamp = now.toISOString();\n const localDateTime = createCivilDateTime(now);\n const experimentAssignments = getTransformedExperimentAssignments();\n\n return {\n noomB2bEnrollmentEvent: {\n sharedProperties: {\n experimentAssignments,\n b2bPartnerId: partnerInfo?.id || -1,\n // Use the internal name instead of the display name.\n b2bPartnerName: partnerInfo?.name || \"\",\n enrollmentType: enrollmentType || \"UNKNOWN\",\n eventLocalDatetime: localDateTime,\n ...getSegmentInfo(),\n },\n ...eventPayload,\n },\n sharedProperties: {\n eventTimestamp: timestamp,\n eventUuid: uuidv4(),\n experimentalProperties: {},\n },\n };\n };\n\n /**\n * Constructs a Noom Event object with shared properties across B2B\n * survey events - both anonymous and identified events.\n *\n * @param eventPayload Specific event payload to be nested under the top\n * level Noom Event.\n * @returns Noom Event object that will be sent using Kinesis.\n */\n const constructSurveyEvent = (\n eventPayload: Omit,\n ): NoomEventProto => {\n const now = new Date(Date.now());\n const timestamp = now.toISOString();\n const localDateTime = createCivilDateTime(now);\n const experimentAssignments = getTransformedExperimentAssignments();\n\n return {\n noomB2bSurveyEvent: {\n sharedProperties: {\n surveyInstance: surveyMetadata?.instance,\n surveyName: surveyMetadata?.name || \"UNKNOWN\",\n experimentAssignments,\n eventLocalDatetime: localDateTime,\n ...getSegmentInfo(),\n },\n ...eventPayload,\n },\n sharedProperties: {\n eventTimestamp: timestamp,\n eventUuid: uuidv4(),\n experimentalProperties: {},\n },\n };\n };\n\n /**\n * Tracking function for anonymous survey events.\n * These are sent to the B2B Anonymous project in Mixpanel.\n *\n * @param eventType One of the events in NoomB2BSurveyAnonEventProto\n * @param eventProperties Properties for the event of \"eventType\"\n */\n const trackSurveyAnonEvent = async <\n T extends keyof Omit,\n >(\n eventType: T,\n eventProperties: NoomB2BSurveyAnonEventProto[T],\n ) => {\n const sharedProperties: NoomB2BSurveyAnonEventProto_SharedPropertiesProto =\n {\n anonymousUserId: b2bAnonymousUserId,\n };\n\n const event = constructSurveyEvent({\n noomB2bSurveyAnonEvent: {\n sharedProperties,\n [eventType]: eventProperties,\n },\n });\n\n await sendEvent(event, b2bAnonymousUserId);\n };\n\n /**\n * Tracking function for identified survey events.\n * These are sent to the Growth project in Mixpanel.\n *\n * @param eventType One of the events in NoomB2BSurveyIdentifiedEventProto\n * @param eventProperties Properties for the event of \"eventType\"\n */\n const trackSurveyIdentifiedEvent = async <\n T extends keyof Omit,\n >(\n eventType: T,\n eventProperties: NoomB2BSurveyIdentifiedEventProto[T],\n ) => {\n const sharedProperties: NoomB2BSurveyIdentifiedEventProto_SharedPropertiesProto =\n {\n b2bUserId: b2bIdentifiedUserId,\n };\n\n const event = constructSurveyEvent({\n noomB2bSurveyIdentifiedEvent: {\n sharedProperties,\n [eventType]: eventProperties,\n },\n });\n\n await sendEvent(event, b2bIdentifiedUserId);\n };\n\n /**\n * Tracking function for anonymous enrollment events (e.g. DPP triage). These are sent\n * to the B2B Anonymous project in Mixpanel.\n *\n * @param eventType Event defined in noom-contracts\n * @param payload Additional properties to send with the event\n */\n const trackAnonEvent = async <\n T extends keyof Omit,\n >(\n eventType: T,\n payload: NoomB2BEnrollmentAnonEventProto[T],\n ) => {\n const event = constructEnrollmentEvent({\n noomB2bEnrollmentAnonEvent: {\n sharedProperties: {\n anonymousUserId: b2bAnonymousUserId,\n },\n [eventType]: payload,\n },\n });\n await sendEvent(event, b2bAnonymousUserId);\n };\n\n /**\n * Tracking function for identified enrollment events. These are sent to the Growth\n * project in Mixpanel.\n *\n * @param eventType Event defined in noom-contracts\n * @param payload Additional properties to send with the event\n */\n const trackIdentifiedEvent = async <\n T extends keyof Omit<\n NoomB2BEnrollmentIdentifiedEventProto,\n \"sharedProperties\"\n >,\n >(\n eventType: T,\n payload: NoomB2BEnrollmentIdentifiedEventProto[T],\n ) => {\n const sharedProperties: NoomB2BEnrollmentIdentifiedEventProto_SharedPropertiesProto =\n shouldUseGrowthUserId\n ? {\n growthUserId,\n }\n : {\n b2bUserId: b2bIdentifiedUserId,\n };\n\n const event = constructEnrollmentEvent({\n noomB2bEnrollmentIdentifiedEvent: {\n sharedProperties,\n [eventType]: payload,\n },\n });\n\n await sendEvent(event, identifiedEventPartitionKey);\n };\n\n /**\n * Helper function to call the appropriate page viewed\n * event depending on whether the user is an enrollment\n * or general survey flow.\n *\n * @param pageId\n */\n const trackAnonPageViewed = async (pageId: string) => {\n if (surveyMetadata) {\n trackSurveyAnonEvent(\"b2bSurveyAnonPageViewed\", { pageId });\n } else {\n trackAnonEvent(\"b2bEnrollmentAnonPageViewed\", { pageId });\n }\n };\n\n const trackIdentifiedPageViewed = async (pageId: string) => {\n const queryParamsWithPii = withPiiQueryParams(queryParams);\n trackIdentifiedEvent(\"b2bEnrollmentIdentifiedPageViewed\", {\n pageId,\n leadSource: queryParamsWithPii.leadSource,\n utmCampaign: queryParamsWithPii.utm_campaign,\n utmContent: queryParamsWithPii.utm_content,\n utmMedium: queryParamsWithPii.utm_medium,\n utmSource: queryParamsWithPii.utm_source,\n utmTerm: queryParamsWithPii.utm_term,\n });\n };\n\n const linkB2BIdentity = async (\n accessCode: string,\n emailAddress?: string,\n upid?: string,\n ) => {\n const now = new Date(Date.now());\n const eventTimestamp = now.toISOString();\n\n const userIdObject = shouldUseGrowthUserId\n ? {\n growthUserId,\n }\n : {\n b2bUserId: b2bIdentifiedUserId,\n };\n\n const event: NoomEventProto = {\n b2bIdentityLinked: {\n accessCode,\n emailAddress,\n source: \"b2b_enrollment\",\n upid,\n ...userIdObject,\n },\n sharedProperties: {\n eventTimestamp,\n eventUuid: uuidv4(),\n experimentalProperties: {},\n },\n };\n await sendEvent(event, identifiedEventPartitionKey);\n };\n\n return {\n linkB2BIdentity,\n trackAnonEvent,\n trackAnonPageViewed,\n trackIdentifiedEvent,\n trackIdentifiedPageViewed,\n trackSurveyAnonEvent,\n trackSurveyIdentifiedEvent,\n };\n};\n","import { NON_PII_QUESTIONS } from \"@/constants\";\nimport { SurveyAnswer, useAppContext } from \"@/contexts\";\nimport { isCareFirstPartner } from \"@/utils/partners\";\n\nimport { useSaveTriageData } from \"./useSaveTriageData\";\nimport { useTrackEvent } from \"./useTrackEvent\";\n\nexport const useAnswerSurveyQuestion = () => {\n const {\n enrollmentType,\n partnerInfo,\n surveyAnswers,\n surveyMetadata,\n setSurveyAnswers,\n } = useAppContext();\n const { saveTriageData } = useSaveTriageData(partnerInfo?.id);\n\n const { trackAnonEvent, trackSurveyAnonEvent } = useTrackEvent();\n\n const getNewSurveyAnswersState = (\n questionId: string,\n answer: SurveyAnswer,\n additionalAnswers?: Record,\n ) => ({\n ...surveyAnswers,\n [questionId]: answer,\n ...(!!additionalAnswers && additionalAnswers),\n });\n\n const answerSurveyQuestion = async (\n questionId: string,\n answer: SurveyAnswer,\n additionalAnswers?: Record,\n skipTracking = false,\n ) => {\n const newSurveyAnswers = getNewSurveyAnswersState(\n questionId,\n answer,\n additionalAnswers,\n );\n\n const allAnswerIds: string[] = Array.isArray(answer)\n ? answer\n : [answer?.toString() || \"\"];\n\n const trackedAnswerIds = NON_PII_QUESTIONS.includes(questionId)\n ? allAnswerIds\n : [];\n\n if (!skipTracking) {\n if (surveyMetadata) {\n trackSurveyAnonEvent(\"b2bSurveyAnonQuestionAnswered\", {\n answerIds: trackedAnswerIds,\n pageId: questionId,\n questionId,\n });\n } else {\n trackAnonEvent(\"b2bEnrollmentAnonQuestionAnswered\", {\n answerIds: trackedAnswerIds,\n answerTexts: [],\n pageId: questionId,\n questionId,\n });\n }\n }\n\n if (\n isCareFirstPartner(partnerInfo) &&\n enrollmentType === \"INITIAL_ENROLLMENT\"\n ) {\n await saveTriageData(newSurveyAnswers, \"PARTIAL\");\n }\n\n setSurveyAnswers(newSurveyAnswers);\n };\n\n return { answerSurveyQuestion, getNewSurveyAnswersState };\n};\n","/**\n * User model type\n *\n * Copyright (C) 2020A Noom, Inc.\n * @author nikola\n */\nimport { StatusEnumProto_Value } from \"@noom/noom-contracts/noom_contracts/backend/privacy/user_policy_options\";\n\nimport { CoursePackSlug, ProgramOffering } from \"@/constants\";\nimport type { SurveyAnswers } from \"@/contexts\";\n\nimport { Address } from \"./Address\";\nimport { EctExperiment } from \"./experiments\";\n\nexport enum Gender {\n FEMALE = \"FEMALE\",\n MALE = \"MALE\",\n SELF_ID = \"SELF_ID\",\n}\n\nexport type User = {\n coursePacks: CoursePackSlug[];\n email: string;\n name: string;\n password: string;\n phoneNumber?: string;\n weightInKg: number;\n heightInCm: number;\n gender?: Gender;\n age: number;\n locale: string;\n surveyAnswers?: SurveyAnswers;\n forceExperimentsToAssign?: EctExperiment[];\n extras: {\n address: Address;\n b2bUserId: string;\n consentSignature?: string;\n consentStatus?: StatusEnumProto_Value;\n dob?: string;\n dppTriageKey?: string;\n employeeId?: string;\n enrolledInMedicare?: string;\n experimentAssignments?: Record;\n firstName?: string;\n lastName?: string;\n liabilityWaiverConsent?: string;\n medicareConsent?: string;\n mhmdaOptIn?: boolean;\n orderScale?: boolean;\n partnerName?: string;\n phoneNumber?: string;\n policyId?: string;\n program: ProgramOffering;\n shippingAddress?: Address;\n };\n};\n","import { format } from \"date-fns\";\n\nimport { PregnantSelection } from \"@/constants\";\nimport type { Partner, User } from \"@/models\";\nimport { getRegionAbbreviation } from \"@/utils/location\";\n\nexport type MedEnrollmentData = {\n userId: string;\n accessCode: string;\n firstName: string;\n lastName: string;\n dateOfBirth: string;\n gender: string;\n email: string;\n address1: string;\n address2: string;\n city: string;\n stateCode: string;\n zipCode: string;\n phoneNumber: string;\n mainReason: string;\n familyHistory: string;\n pregnant: PregnantSelection;\n healthConditions: string[];\n heightFeet: number;\n heightInch: number;\n weightLbs: number;\n partnerId: number;\n useMedications: string;\n suicideOrSelfHarm1: string;\n suicideOrSelfHarm2: string;\n};\n\nexport const formatAsMedEnrollmentData = ({\n accessCode,\n b2bIdentifiedUserId,\n partner,\n userData,\n}: {\n accessCode: string;\n b2bIdentifiedUserId: string;\n partner: Partner;\n userData: User;\n}): MedEnrollmentData => {\n const { id: partnerId } = partner;\n // using phoneNumber from userData (vs surveyAnswers) as there is already formatting applied.\n const { extras, phoneNumber, surveyAnswers } = userData;\n const {\n eligibilityCheck,\n gender,\n createAccount,\n mainReason,\n familyHistoryWeight,\n pregnant,\n healthConditions,\n heightWeight,\n medications,\n phq3,\n phq4,\n } = surveyAnswers!;\n const { firstName, lastName, dob } = eligibilityCheck!;\n // reading address from extras (vs surveyAnswers) as there is validation / correction applied.\n const { address1, address2, city, region, zipcode, country } = extras.address;\n const stateCode = getRegionAbbreviation(country, region)!;\n\n const { heightFeetPortion, heightInchesPortion, weight } = heightWeight!;\n\n return {\n userId: b2bIdentifiedUserId,\n accessCode,\n firstName,\n lastName,\n dateOfBirth: format(dob!, \"yyyy-MM-dd\"),\n gender: gender!,\n email: createAccount!.email,\n address1,\n address2,\n city,\n stateCode,\n zipCode: zipcode,\n phoneNumber: phoneNumber!,\n mainReason: mainReason!,\n familyHistory: familyHistoryWeight!,\n pregnant: pregnant || PregnantSelection.NO,\n healthConditions: healthConditions!,\n heightFeet: heightFeetPortion!,\n heightInch: heightInchesPortion!,\n weightLbs: weight!,\n partnerId,\n useMedications: Number(medications) > 0 ? \"yes\" : \"no\",\n suicideOrSelfHarm1: phq4!,\n suicideOrSelfHarm2: phq3!,\n };\n};\n","import { CountryRegionData } from \"react-country-region-selector\";\n\n// Format of CountryRegionData:\n// [[\"Long Country Name\",\"ShortName\",\"Region1~Region1Short|Region2~Region2Short|...\"]]\nexport const getRegionAbbreviation = (\n countryCode: string,\n regionLong: string,\n) =>\n CountryRegionData.find((country) => country[1] === countryCode)?.[2]\n .split(\"|\")\n .find((regionData) => regionData.includes(regionLong))\n ?.split(\"~\")[1];\n","import { PartnerProto_EligibilityKeyProto_Value } from \"@noom/noom-contracts/noom_contracts/backend/partner/model/partner\";\n\nimport { EligibilityEnforcementType } from \"./Eligibility\";\n\nexport type EligibilityKeyType = Exclude<\n PartnerProto_EligibilityKeyProto_Value,\n \"UNKNOWN\" | \"UNRECOGNIZED\"\n>;\n\nexport type PartnerEligibilityFileLocation = {\n id: number;\n location: string;\n filenameRegex?: string;\n lastFileIngested?: string;\n lastFileIngestedTimeStamp?: Date;\n};\n\nexport type Partner = {\n configs: {\n ACCOLADE_PARTNER: boolean;\n CUSTOM_SUPPORT_LINK?: string;\n DISPLAY_NAME?: string;\n DIVISIONAL_ONLY_PARTNER: boolean;\n ELIGIBILITY_KEY: string;\n ENROLL_PASSCODE: boolean;\n ENROLL_UHC: boolean;\n ENROLL_UPID: boolean;\n ENROLL_VIRGIN_PULSE: boolean;\n HIDE_COST: boolean;\n MAINTAIN_ORIGINAL_LOGO: boolean;\n MEDICARE_PARTNER: boolean;\n OFFERS_DIABETES_MANAGEMENT: boolean;\n OFFERS_MED: boolean;\n OFFERS_RETRIAGE: boolean;\n OFFER_SCALE_SHIPMENT: boolean;\n REQUIRES_DOB: boolean;\n REQUIRES_PARTICIPANT_ID: boolean;\n UPFRONT_ELIGIBILITY_ENFORCEMENT: EligibilityEnforcementType;\n };\n defaultBatch: number;\n deploymentId: number;\n division: string;\n eligibilityKey: EligibilityKeyType;\n enrollPasscode: boolean;\n enrollUPID: boolean;\n enrollVirginPulse: boolean;\n goLiveDate?: Date;\n hideCost: boolean;\n id: number;\n name: string;\n requireDob: boolean;\n requireParticipantId: boolean;\n slug: string;\n supportedLocales: string[];\n upfrontEligibilityEnforcement: EligibilityEnforcementType;\n eligibilityFileLocations: PartnerEligibilityFileLocation[];\n};\n\nexport const getDisplayName = (partner?: Partner | null) =>\n partner?.configs?.DISPLAY_NAME || partner?.name;\n","/* eslint-disable prefer-rest-params, prefer-spread, no-unused-expressions, no-underscore-dangle */\nimport { LibCategories } from \"@/utils/consent\";\nimport { loadScript } from \"@/utils/scriptLoader\";\n\ndeclare const window: Window & {\n fbq?: () => void;\n _fbq?: () => void;\n};\n\n// eslint-disable-next-line func-names\nconst fbq: any = function () {\n fbq.callMethod\n ? fbq.callMethod.apply(fbq, arguments)\n : fbq.queue.push(arguments);\n};\nwindow.fbq = fbq;\n\nif (!window._fbq) {\n window._fbq = fbq;\n}\nfbq.push = fbq;\nfbq.loaded = !0;\nfbq.version = \"2.0\";\nfbq.queue = [];\n\nexport function loadFacebookPixel() {\n return loadScript(\n \"https://connect.facebook.net/en_US/fbevents.js\",\n [LibCategories.targetingCookies],\n { enableCORS: false },\n );\n}\n","import { LibCategories } from \"@/utils/consent\";\nimport { loadScript } from \"@/utils/scriptLoader\";\n\ndeclare const gtag: any;\ndeclare const dataLayer: any;\ndeclare const window: Window & {\n gtag: any;\n dataLayer: any;\n};\n\nwindow.dataLayer = window.dataLayer || [];\nwindow.gtag = (...args: any) => {\n dataLayer.push(args);\n};\ngtag(\"js\", new Date());\n\nexport function loadGA() {\n gtag(\"config\", \"G-6R0EQ2V6YH\");\n return Promise.all([\n loadScript(\"https://www.googletagmanager.com/gtag/js?id=G-6R0EQ2V6YH\", [\n LibCategories.targetingCookies,\n ]),\n ]).catch(() => {\n // no-op\n });\n}\n\nexport function loadAdWords() {\n gtag(\"config\", \"AW-783925782\");\n return Promise.all([\n // \n loadScript(\"https://www.googletagmanager.com/gtag/js?id=AW-783925782\", [\n LibCategories.targetingCookies,\n ]),\n ]);\n}\n","/* eslint-disable prefer-rest-params */\nimport { LibCategories } from \"@/utils/consent\";\nimport { loadScript } from \"@/utils/scriptLoader\";\n\ndeclare const window: Window & {\n GlobalSnowplowNamespace?: any;\n nf0?: any;\n};\n\nif (!window.nf0) {\n window.GlobalSnowplowNamespace = window.GlobalSnowplowNamespace || [];\n window.GlobalSnowplowNamespace.push(\"nf0\");\n window.nf0 = function hrzn() {\n (window.nf0.q = window.nf0.q || []).push(arguments);\n };\n window.nf0.q = window.nf0.q || [];\n window.nf0(\"newTracker\", \"nf0\", \"l.hrzn-nxt.com\", {\n appId: \"noom-9c32533d-fbf7-4114-86f1-f2952cbc06be\",\n cookieDomain: null,\n cookieName: \"_nxt_\",\n stateStorageStrategy: \"localStorage\",\n forceSecureTracker: true,\n discoverRootDomain: true,\n eventMethod: \"get\",\n sessionCookieTimeout: 1800,\n });\n}\n\nexport async function loadHorizon() {\n return loadScript(\n \"https://c.hrzn-nxt.com/js/v2.12.0/connect.min.js\",\n [LibCategories.targetingCookies],\n { enableCORS: false },\n );\n}\n","import { loadFacebookPixel } from \"./facebook\";\nimport { loadAdWords, loadGA } from \"./google\";\nimport { loadHorizon } from \"./horizon\";\nimport { loadVWO } from \"./vwo\";\n\nexport function initializeGlobalVendorScripts() {\n loadGA();\n loadVWO();\n}\n\nexport function initializePixels() {\n loadFacebookPixel();\n loadAdWords();\n loadHorizon();\n}\n","import { LibCategories, waitForConsent } from \"@/utils/consent\";\n\nexport async function loadVWO() {\n waitForConsent([LibCategories.performanceCookies]).then(() => {\n // DO NOT EDIT\n const script = document.createElement(\"script\");\n script.id = \"vwoCode\";\n script.innerHTML = `\n window._vwo_code || (function() {\n var account_id=736215,\n version=2.0,\n settings_tolerance=2000,\n hide_element='body',\n hide_element_style = 'opacity:0 !important;filter:alpha(opacity=0) !important;background:none !important',\n /* DO NOT EDIT BELOW THIS LINE */\n f=false,d=document,v=d.querySelector('#vwoCode'),cK='_vwo_'+account_id+'_settings',cc={};try{var c=JSON.parse(localStorage.getItem('_vwo_'+account_id+'_config'));cc=c&&typeof c==='object'?c:{}}catch(e){}var stT=cc.stT==='session'?window.sessionStorage:window.localStorage;code={use_existing_jquery:function(){return typeof use_existing_jquery!=='undefined'?use_existing_jquery:undefined},library_tolerance:function(){return typeof library_tolerance!=='undefined'?library_tolerance:undefined},settings_tolerance:function(){return cc.sT||settings_tolerance},hide_element_style:function(){return'{'+(cc.hES||hide_element_style)+'}'},hide_element:function(){return typeof cc.hE==='string'?cc.hE:hide_element},getVersion:function(){return version},finish:function(){if(!f){f=true;var e=d.getElementById('_vis_opt_path_hides');if(e)e.parentNode.removeChild(e)}},finished:function(){return f},load:function(e){var t=this.getSettings(),n=d.createElement('script'),i=this;if(t){n.textContent=t;d.getElementsByTagName('head')[0].appendChild(n);if(!window.VWO||VWO.caE){stT.removeItem(cK);i.load(e)}}else{n.fetchPriority='high';n.src=e;n.type='text/javascript';n.onerror=function(){_vwo_code.finish()};d.getElementsByTagName('head')[0].appendChild(n)}},getSettings:function(){try{var e=stT.getItem(cK);if(!e){return}e=JSON.parse(e);if(Date.now()>e.e){stT.removeItem(cK);return}return e.s}catch(e){return}},init:function(){if(d.URL.indexOf('__vwo_disable__')>-1)return;var e=this.settings_tolerance();window._vwo_settings_timer=setTimeout(function(){_vwo_code.finish();stT.removeItem(cK)},e);var t=d.currentScript,n=d.createElement('style'),i=this.hide_element(),r=t&&!t.async&&i?i+this.hide_element_style():'',o=d.getElementsByTagName('head')[0];n.setAttribute('id','_vis_opt_path_hides');v&&n.setAttribute('nonce',v.nonce);n.setAttribute('type','text/css');if(n.styleSheet)n.styleSheet.cssText=r;else n.appendChild(d.createTextNode(r));o.appendChild(n);this.load('https://dev.visualwebsiteoptimizer.com/j.php?a='+account_id+'&u='+encodeURIComponent(d.URL)+'&vn='+version)}};window._vwo_code=code;code.init();})();\n `;\n document.head.appendChild(script);\n // END DO NOT EDIT\n });\n}\n","import { Curriculum } from \"@/constants\";\nimport { init as urlParamsPiiInit } from \"@/utils/pixels/urlParamsPii\";\n\nimport { EVENTS, firePixelEvent, initializeHandlers } from \"./pixels/handler\";\nimport { initializePixels } from \"./vendors\";\n\nconst ensureInit = () => {\n urlParamsPiiInit();\n initializePixels();\n initializeHandlers();\n};\n\nconst getRevenueMetrics = (curriculum: Curriculum) => {\n // Revenue values should end in $0.01 to be uniquely identifiable.\n if (curriculum === Curriculum.HM) {\n return {\n eltv_25_months: 119.01,\n erev_13_months: 169.01,\n };\n }\n if (curriculum === Curriculum.HW) {\n return {\n eltv_25_months: 131.01,\n erev_13_months: 169.01,\n };\n }\n if (curriculum === Curriculum.DPP) {\n return {\n eltv_25_months: 261.01,\n erev_13_months: 405.01,\n };\n }\n throw Error(\"Unknown curriculum\");\n};\n\nexport const trackBuyflowConversion = (\n curriculum: Curriculum,\n email: string,\n userId: string,\n) => {\n ensureInit();\n const eventname: EVENTS = \"purchase\";\n\n const { eltv_25_months, erev_13_months } = getRevenueMetrics(curriculum);\n firePixelEvent(eventname, {\n userId,\n eltv_25_months,\n erev_13_months,\n email,\n });\n};\n","import { Api } from \"@noom/noomscape\";\n\nimport { ErrorCode } from \"@/constants\";\nimport { useAppContext } from \"@/contexts\";\nimport { MedEnrollmentData, User, formatAsMedEnrollmentData } from \"@/models\";\nimport { captureException } from \"@/utils/sentry\";\n\nexport const useEnrollMed = () => {\n const { b2bIdentifiedUserId, partnerInfo } = useAppContext();\n const enrollMed = async (accessCode: string, userData: User) => {\n if (!partnerInfo) {\n throw Error(\"partnerInfo expected\");\n }\n\n const medEnrollmentData: MedEnrollmentData = formatAsMedEnrollmentData({\n accessCode,\n b2bIdentifiedUserId,\n partner: partnerInfo,\n userData,\n });\n\n return Api.call(\"account.enrollMed\", Api.api.account.enrollMed, {\n medEnrollmentData,\n }).catch((e: unknown) => {\n captureException(e);\n throw Error(ErrorCode.MED_ENROLLMENT_FAILED);\n });\n };\n\n return { enrollMed };\n};\n","import { isMobile } from \"react-device-detect\";\nimport { useLocation, useNavigate } from \"react-router-dom\";\n\nimport {\n buildDeeplink,\n EnrollmentSuccessType,\n ErrorState,\n RetriageFinishedStatus,\n ScreenedOutReason,\n} from \"@/constants\";\nimport { useAppContext } from \"@/contexts\";\nimport { AutologinData } from \"@/utils/cookies\";\n\nexport const useGoto = () => {\n const { setScreenedOutReason, setErrorState, setRetriageFinishedStatus } =\n useAppContext();\n const { pathname, search } = useLocation();\n const navigate = useNavigate();\n\n const success = (type: EnrollmentSuccessType) => {\n const qs = new URLSearchParams();\n qs.append(\"type\", type);\n navigate({\n pathname: \"/success\",\n search: qs.toString(),\n });\n };\n\n const error = (errorState?: ErrorState) => {\n if (errorState) {\n setErrorState(errorState);\n }\n navigate({\n pathname: \"/error\",\n search,\n });\n };\n\n const notFound = () => {\n navigate({\n pathname: \"/not-found\",\n });\n };\n\n const retriageFinished = (status: RetriageFinishedStatus) => {\n setRetriageFinishedStatus(status);\n navigate({\n pathname: \"/rt/finished\",\n });\n };\n\n const medIntake = (userId: string) => {\n window.location.href = `${window.ENV.BUYFLOW_CLIENT_URL}/telehealth?userId=${userId}&isB2B=true#/steadyPatientIntake`;\n };\n\n const screenOut = (reason: ScreenedOutReason) => {\n setScreenedOutReason(reason);\n\n // This logic redirects to the screen out page by taking the current\n // pathname and replacing the last segment with the /ineligible route.\n // This is needed to support flows with different segment lengths.\n const segments = pathname.split(\"/\");\n const baseRoute = segments.slice(0, segments.length - 1).join(\"/\");\n navigate({ pathname: `${baseRoute}/ineligible`, search });\n };\n\n const openApp = (autologinData?: AutologinData, email?: string) => {\n if (autologinData) {\n window.location.href = \"https://unknown.noom.com/?score=1&close=1\";\n } else if (isMobile) {\n window.location.href = buildDeeplink(email);\n }\n };\n\n return {\n error,\n medIntake,\n notFound,\n openApp,\n retriageFinished,\n screenOut,\n success,\n };\n};\n","import Cookies from \"js-cookie\";\nimport { useLocation, useNavigate } from \"react-router-dom\";\n\nimport { Api } from \"@noom/noomscape\";\n\nimport { AccountErrorResponse } from \"@/api/account/create\";\nimport {\n DEFAULT_ADDRESS,\n EnrollmentSuccessType,\n ErrorCode,\n ErrorState,\n ProgramOffering,\n ResultType,\n} from \"@/constants\";\nimport { isDoNotTrackPartner } from \"@/constants/Partners\";\nimport { useAppContext } from \"@/contexts\";\nimport { Address, EnrollmentInformation, getDisplayName, User } from \"@/models\";\nimport { trackBuyflowConversion } from \"@/utils/ConversionTracker\";\nimport { getCurriculumFromProgramOffering } from \"@/utils/programs\";\nimport { captureException } from \"@/utils/sentry\";\nimport { isBuyflowTraffic } from \"@/utils/userSegment\";\n\nimport { AxiosError } from \"axios\";\n\nimport { useEnrollMed } from \"./useEnrollMed\";\nimport { useExperiment } from \"./useExperiment\";\nimport { useGoto } from \"./useGoto\";\nimport { useTrackEvent } from \"./useTrackEvent\";\n\nexport const useCreateAccount = () => {\n const { partnerInfo, setEnrollmentInfo, setErrorState, setUserData } =\n useAppContext();\n const { enrollMed } = useEnrollMed();\n const { getExperimentAssignments } = useExperiment();\n const goto = useGoto();\n const { search } = useLocation();\n const navigate = useNavigate();\n const { linkB2BIdentity, trackAnonEvent, trackIdentifiedEvent } =\n useTrackEvent();\n\n const validateAndGetCorrectedAddress = async (\n address: Address,\n ): Promise
=>\n Api.call(\"address.validate\", Api.api.address.validate, {\n address,\n })\n .then((_correctedAddress: Address) =>\n // The address returned by the address validation service omits null address fields.\n // We need to include all address fields (even if they are empty) when saving to the backend.\n ({\n ...DEFAULT_ADDRESS,\n ..._correctedAddress,\n }),\n )\n .catch(() => address);\n\n const createAccount = async (\n upid: string,\n user: User,\n selectedProgram: ProgramOffering | null,\n ): Promise => {\n const userData = { ...user };\n const curriculum = getCurriculumFromProgramOffering(selectedProgram);\n\n try {\n // Currently, we don't know which curriculum associated with a UPID.\n // As a workaround, always update the mapping if there are multiple curriculum choices.\n if (selectedProgram !== null) {\n await Api.call(\n \"upid.updateUpidCurriculumMapping\",\n Api.api.upid.updateUpidCurriculumMapping,\n {\n curriculum,\n upid,\n },\n );\n }\n\n userData.extras.address = await validateAndGetCorrectedAddress(\n userData.extras.address,\n );\n\n userData.extras = {\n ...userData.extras,\n experimentAssignments: getExperimentAssignments(),\n partnerName: getDisplayName(partnerInfo),\n };\n\n // We need to get updated enrollment information in case the upid was moved to a new batch\n const updatedEnrollmentInfo: EnrollmentInformation = await Api.call(\n \"upid.getEnrollmentInformation\",\n Api.api.upid.getEnrollmentInformation,\n {\n upid,\n },\n );\n setEnrollmentInfo(updatedEnrollmentInfo);\n\n // cache userdata to enable use elsewhere (ie transitioning B2C->B2B)\n setUserData(userData);\n const { accessCode, wasCreated } = await Api.call(\n \"account.create\",\n Api.api.account.create,\n {\n upid,\n userData,\n },\n );\n\n if (selectedProgram === \"MED\") {\n await enrollMed(accessCode, userData);\n }\n\n // Set cookie expiration to 1 hour\n Cookies.set(\"lastEnrolledUpid\", upid, { expires: 1 / 24 });\n\n linkB2BIdentity(accessCode, userData.email, upid);\n\n trackIdentifiedEvent(\"b2bEnrollmentIdentifiedSignupSubmitted\", {\n b2bProgram: selectedProgram || \"PROGRAM_UNSPECIFIED\",\n b2bSignupResult: ResultType.SUCCESS,\n b2cTransitionedAccount: false,\n coursePacks: userData.coursePacks,\n freeAccountExists: !wasCreated,\n upid,\n });\n\n trackAnonEvent(\"b2bEnrollmentAnonSignupSubmitted\", {\n b2bProgram: selectedProgram || \"PROGRAM_UNSPECIFIED\",\n b2bSignupResult: ResultType.SUCCESS,\n b2cTransitionedAccount: false,\n coursePacks: userData.coursePacks,\n freeAccountExists: !wasCreated,\n });\n\n const growthUserId = Cookies.get(\"_userId\");\n if (\n partnerInfo &&\n !isDoNotTrackPartner(partnerInfo) &&\n isBuyflowTraffic() &&\n growthUserId\n ) {\n trackBuyflowConversion(curriculum, userData.email, growthUserId);\n }\n\n const successType = wasCreated\n ? EnrollmentSuccessType.CREATED\n : EnrollmentSuccessType.UPGRADED;\n goto.success(successType);\n return accessCode;\n } catch (e: unknown) {\n // Existing accounts have a dedicated error message\n const errorMessage = (e as AxiosError)?.response\n ?.data?.message;\n\n const existingB2BAccount =\n errorMessage === \"ALREADY_ENROLLED_IN_B2B_PROGRAM\";\n const existingB2CAccount = errorMessage === \"NON_FREE_ACCOUNT_EXISTS\";\n const pendingDeleteRequest = errorMessage === \"PENDING_DELETION_REQUEST\";\n const claimed = errorMessage === \"Invalid UPID parameter\";\n const isIneligible = errorMessage === \"B2B_INELIGIBLE\";\n\n const medEnrollmentFailed =\n (e as Error)?.message === ErrorCode.MED_ENROLLMENT_FAILED;\n\n if (existingB2CAccount) {\n navigate({\n pathname: \"/transition\",\n search,\n });\n return undefined;\n }\n\n if (isIneligible) {\n throw new Error(\"B2B_INELIGIBLE\");\n }\n\n let resultType = ResultType.ERROR;\n\n if (existingB2BAccount) {\n resultType = ResultType.ACCOUNT_EXISTS;\n setErrorState(ErrorState.ACCOUNT_EXISTS);\n } else if (claimed) {\n resultType = ResultType.CODE_CLAIMED;\n setErrorState(ErrorState.CODE_CLAIMED);\n } else if (pendingDeleteRequest) {\n resultType = ResultType.PENDING_DELETION_REQUEST;\n setErrorState(ErrorState.PENDING_DELETION_REQUEST);\n } else if (medEnrollmentFailed) {\n setErrorState(ErrorState.SUPPORT_REQUEST_CREATED);\n } else {\n setErrorState(ErrorState.DEFAULT);\n }\n\n trackIdentifiedEvent(\"b2bEnrollmentIdentifiedSignupSubmitted\", {\n b2bProgram: selectedProgram || \"PROGRAM_UNSPECIFIED\",\n b2bSignupResult: resultType,\n b2cTransitionedAccount: false,\n coursePacks: userData.coursePacks,\n freeAccountExists: false,\n upid,\n });\n\n trackAnonEvent(\"b2bEnrollmentAnonSignupSubmitted\", {\n b2bProgram: selectedProgram || \"PROGRAM_UNSPECIFIED\",\n b2bSignupResult: resultType,\n b2cTransitionedAccount: false,\n coursePacks: userData.coursePacks,\n freeAccountExists: false,\n });\n\n if (resultType === ResultType.ERROR) {\n captureException(e);\n }\n navigate(\"/error\");\n return undefined;\n }\n };\n\n return {\n createAccount,\n };\n};\n","import Cookies from \"js-cookie\";\n\nimport { SurveyAnswers } from \"@/contexts/app-context\";\nimport { captureException } from \"@/utils/sentry\";\n\nexport type AutologinData = {\n accessCode: string;\n accessToken: string;\n};\n\nconst IDENTITY_COOKIE_KEY = \"identity_data\";\n\ntype IdentityData = {\n email: string;\n accessCode: string;\n accessToken: string;\n clientId: string;\n};\n\nexport const setIdentityData = (data: IdentityData) => {\n Cookies.set(IDENTITY_COOKIE_KEY, JSON.stringify(data), {\n // expires in 24 hours\n expires: new Date(Date.now() + 24 * 60 * 60 * 1000),\n domain: window.ENV.COOKIE_DOMAIN,\n path: \"/\",\n secure: true,\n sameSite: \"strict\",\n });\n}\n\n/**\n * Attempts to read autologin_data cookie set by the mobile app in web views.\n * If its not present or an error occurs, return undefined and let the caller handle it.\n *\n * To set up an autologindata cookie:\n * 1. Go to https://account.test.wsli.dev\n * 2. Login with a user\n * 3. Open the console and run the command \"JSON.stringify(window.reduxStore.getState().auth)\"\n * 4. Paste the result into a cookie called \"autologin_data\" wherever you are testing autologin data\n * (make sure not to have single quotes around the string)\n */\nexport const getAutologinData = (): AutologinData | undefined => {\n try {\n const autologinDataCookie = Cookies.get(\"autologin_data\");\n\n if (!autologinDataCookie) {\n return undefined;\n }\n const autologinData: AutologinData = JSON.parse(autologinDataCookie);\n\n if (!autologinData.accessCode || !autologinData.accessToken) {\n throw Error(\"autologin_data cookie is missing expected data\");\n }\n return autologinData;\n } catch (error) {\n captureException(error);\n }\n return undefined;\n};\n\nconst SURVEY_ANSWER_COOKIE_NAME = \"noom_b2b_wea_sa\";\n\n// IMPORTANT - Before expanding the allow list, we need to ensure the survey answers will be properly parsed in getSurveyAnswersFromCookie.\n// Due to type conversions of objects that don't have corresponding primitive value (ie Date)\n// we need to make sure we recreate the expected object/type before returning the surveyAnswer object.\ntype SURVEY_ANSWER_ALLOW_LIST = \"eligibilityCheck\" | \"createAccount\";\n\n/**\n * Stores survey answers (from SURVEY_ANSWER_ALLOW_LIST) in a cookie.\n * @param surveyAnswers\n */\nexport const setSurveyAnswerCookie = (\n surveyAnswers: Pick,\n) => {\n Cookies.set(SURVEY_ANSWER_COOKIE_NAME, JSON.stringify(surveyAnswers), {\n expires: 1,\n });\n};\n\nexport const getSurveyAnswersFromCookie = (): SurveyAnswers | undefined => {\n const surveyAnswerCookie = Cookies.get(SURVEY_ANSWER_COOKIE_NAME);\n try {\n if (surveyAnswerCookie) {\n let surveyAnswersFromCookie: SurveyAnswers =\n JSON.parse(surveyAnswerCookie);\n\n // dob is actually a string here due to surveyAnswersFromCookie\n // having been stringified and re-parsed so convert it back to a Date.\n if (surveyAnswersFromCookie.eligibilityCheck?.dob) {\n surveyAnswersFromCookie = {\n ...surveyAnswersFromCookie,\n eligibilityCheck: {\n ...surveyAnswersFromCookie.eligibilityCheck,\n dob: new Date(surveyAnswersFromCookie.eligibilityCheck.dob),\n },\n };\n }\n return surveyAnswersFromCookie;\n }\n } catch (error) {\n captureException(error);\n }\n return undefined;\n};\n","\nimport { Api } from \"@noom/noomscape\";\n\nimport type { CreateLoginTokenResponse } from \"@/api/account/createLoginToken\";\nimport { setIdentityData } from \"@/utils/cookies\"\nimport { captureException } from \"@/utils/sentry\";\n\nimport { AxiosError } from \"axios\";\n\n// this is the client id which represents our end users\n// logged in via web or native applications\nconst CLIENT_ID = \"noom-coach\"\n\nexport const useCreateLoginToken = () => {\n const createLoginToken = async (email: string, password: string) => {\n const response: CreateLoginTokenResponse = await Api.call(\n \"account.createLoginToken\",\n Api.api.account.createLoginToken,\n {\n email,\n password,\n },\n );\n\n // we set this cookie on login so that if we end up sending the user to medical intake\n // they will not be prompted to log in again\n setIdentityData({\n accessCode: response.accessCode,\n accessToken: response.access_token,\n email: response.accountEmail,\n clientId: CLIENT_ID,\n })\n\n return response.access_token;\n };\n\n const isProvidingValidPassword = async (email: string, password: string) => {\n try {\n await createLoginToken(email, password);\n return true;\n } catch (e: unknown) {\n let errorCode;\n if (e instanceof AxiosError) {\n errorCode = e.response?.data.errorCode;\n\n if (errorCode === \"INCORRECT_PASSWORD\") {\n return false;\n }\n\n if (errorCode === \"NO_ACCOUNT_FOR_INFO\") {\n return true;\n }\n }\n\n captureException(e, { errorCode });\n return false;\n }\n };\n\n return { createLoginToken, isProvidingValidPassword };\n};\n","import { parse } from \"date-fns\";\n\nimport { CivilDateProto } from \"@noom/noom-contracts/noom_contracts/lib/time/civil_time\";\n\nimport type { EligibilityCheckFormValues } from \"@/components/forms/EligibilityCheckForm\";\nimport { RetriageEligibility } from \"@/models\";\n\nexport const getEligibilityCheckFormValues = (\n retriageEligibility: RetriageEligibility,\n): EligibilityCheckFormValues | undefined => {\n if (!retriageEligibility.eligibilityProperties) {\n return undefined;\n }\n\n const { firstName, lastName, dateOfBirth, participantId } =\n retriageEligibility.eligibilityProperties;\n // month is [0-11]\n const { year, month, day } = dateOfBirth || {};\n return {\n dob: year && month && day ? new Date(year, month - 1, day) : null,\n employeeId: participantId,\n firstName: firstName || \"\",\n lastName: lastName || \"\",\n };\n};\n\nexport const parseEligibilityFileDate = (\n date?: CivilDateProto,\n): Date | undefined =>\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-extra-non-null-assertion\n date ? new Date(date.year!!, date.month!! - 1, date.day) : undefined;\n","import { useState } from \"react\";\nimport { useNavigate } from \"react-router-dom\";\n\nimport { CheckEligibilityResponseProto_EligibilityReason } from \"@noom/noom-contracts/noom_contracts/backend/partner/service/partner_eligibility_service\";\nimport { Api } from \"@noom/noomscape\";\n\nimport { ErrorState } from \"@/constants\";\nimport { useAppContext } from \"@/contexts\";\nimport {\n EligibilityInfo,\n EligibilityReason,\n EligibilityResponse,\n EligibilityVerificationProperties,\n Partner,\n} from \"@/models\";\nimport { parseEligibilityFileDate } from \"@/utils/eligibility\";\nimport { captureException } from \"@/utils/sentry\";\n\nimport { useGoto } from \"./useGoto\";\nimport { QueryParamsWithoutPii, useQueryParams } from \"./useQueryParams\";\nimport { useTrackEvent } from \"./useTrackEvent\";\n\nexport type EligibilityResult = {\n eligibilityInfo: EligibilityInfo;\n eligibilityReason: CheckEligibilityResponseProto_EligibilityReason;\n isEligible: boolean;\n isMedEligible: boolean;\n participantEligibilityId: string | undefined;\n participantPartnerId: number | undefined;\n upid: string | undefined;\n};\n\nexport const useEligibility = () => {\n const { setEligibilityInfo } = useAppContext();\n const goto = useGoto();\n const navigate = useNavigate();\n const queryParams = useQueryParams();\n const [hasEligibilityError, setHasEligibilityError] =\n useState(false);\n const { trackAnonEvent, trackIdentifiedEvent } = useTrackEvent();\n\n const redirectToParticipantPartner = async (\n eligibilityId: string | undefined,\n participantPartnerId: number | undefined,\n upid: string | undefined,\n ) => {\n if (!(!!eligibilityId && !!participantPartnerId && !!upid)) {\n captureException(\n Error(\n \"Attempted to redirect for shared eligibility partner(s) but required redirect params are missing\",\n ),\n );\n navigate(\"/error\");\n return;\n }\n const partner: Partner = await Api.call(\n \"partner.getPartnerByUpid\",\n Api.api.partner.getPartnerByUpid,\n { upid },\n );\n\n const newParams: QueryParamsWithoutPii = {\n ...queryParams,\n eligibilityId,\n sharedEligibility: \"true\",\n upid,\n };\n const qs = new URLSearchParams(\n Object.entries(newParams).filter(([, v]) => v !== undefined),\n );\n\n window.location.href = `${window.location.origin}/employer/${partner.slug}?${qs.toString()}`;\n };\n\n const checkEligibility = async (\n eligibilityVerificationProperties: EligibilityVerificationProperties,\n partnerId: number,\n leadSource?: string,\n ): Promise => {\n // Reset the eligibility error\n setHasEligibilityError(false);\n const {\n dateOfBirth,\n email,\n effectiveDate: effectiveDateString,\n eligible: isEligible,\n eligibilityId: participantEligibilityId,\n eligibilityReason,\n extras,\n firstName,\n lastName,\n medEligible: isMedEligible,\n partnerId: participantPartnerId,\n participantId: employeeId,\n upid,\n segmentId,\n segmentName,\n }: EligibilityResponse = await Api.call(\n \"partner.checkEligibility\",\n Api.api.partner.checkEligibility,\n {\n eligibilityVerificationProperties,\n leadSource,\n partnerId,\n },\n );\n\n const { address: addressProto, ...passthroughExtras } = extras || {};\n const eligibilityInfo: EligibilityInfo = {\n dob: parseEligibilityFileDate(dateOfBirth),\n effectiveDate: parseEligibilityFileDate(effectiveDateString),\n email,\n employeeId,\n isMedEligible,\n firstName,\n lastName,\n segmentId,\n segmentName,\n ...passthroughExtras,\n };\n if (addressProto) {\n eligibilityInfo.address = {\n country: addressProto.country || \"\",\n region: addressProto.region || \"\",\n city: addressProto.city || \"\",\n address1: addressProto.addressLine1 || \"\",\n address2: addressProto.addressLine2 || \"\",\n zipcode: addressProto.zipcode || \"\",\n };\n }\n setEligibilityInfo({ ...eligibilityInfo });\n\n const eventParams = {\n eligibleForEnrollment: isEligible,\n eligibilityStatus: eligibilityReason,\n };\n\n trackAnonEvent(\"b2bEnrollmentAnonEligibilityChecked\", eventParams);\n trackIdentifiedEvent(\n \"b2bEnrollmentIdentifiedEligibilityChecked\",\n eventParams,\n );\n\n if (isEligible === false) {\n if (eligibilityReason === EligibilityReason.EXISTING_ACCOUNT) {\n goto.error(ErrorState.ELIGIBILITY_CHECK_EXISTING_ACCOUNT);\n } else if (\n eligibilityReason === EligibilityReason.PRIOR_TO_EFFECTIVE_DATE\n ) {\n goto.error(ErrorState.PRIOR_TO_EFFECTIVE_DATE);\n } else if (eligibilityReason === EligibilityReason.API_ERROR) {\n goto.error(ErrorState.ELIGIBILITY_CHECK_API_ERROR);\n } else if (eligibilityReason === EligibilityReason.MULTIPLE_MATCHES) {\n goto.error(ErrorState.ELIGIBILITY_CHECK_MULTIPLE_MATCHES);\n } else {\n setHasEligibilityError(true);\n }\n }\n\n return {\n eligibilityInfo,\n eligibilityReason,\n isEligible,\n isMedEligible,\n participantEligibilityId,\n participantPartnerId,\n upid,\n };\n };\n\n const fetchEligibilityInfo = async (\n eligibilityId: string,\n partnerId: number,\n ) =>\n Api.call(\"partner.checkEligibility\", Api.api.partner.checkEligibility, {\n eligibilityVerificationProperties: { eligibilityId },\n partnerId,\n });\n\n return {\n checkEligibility,\n fetchEligibilityInfo,\n hasEligibilityError,\n redirectToParticipantPartner,\n setHasEligibilityError,\n };\n};\n","import { useEffect, useState } from \"react\";\n\nimport { OPT_OUT_MHMDA_STATES, OPT_OUT_STATES } from \"@/constants\";\nimport { loadOneTrust } from \"@/utils/vendors/onetrust\";\n\nexport const useGeolocation = () => {\n const [isLoading, setIsLoading] = useState(true);\n\n useEffect(() => {\n if (!isLoading) {\n return;\n }\n\n const loadGeolocationData = async () => {\n await loadOneTrust();\n setIsLoading(false);\n };\n\n loadGeolocationData();\n }, [isLoading]);\n\n const country = window.OneTrust?.getGeolocationData?.().country || \"\";\n const state = window.OneTrust?.getGeolocationData?.().state || \"\";\n const canOptOut = () => country === \"US\" && OPT_OUT_STATES.includes(state);\n const canOptOutMHMDA = () =>\n country === \"US\" && OPT_OUT_MHMDA_STATES.includes(state);\n\n return {\n canOptOut,\n canOptOutMHMDA,\n country,\n isLoading,\n state,\n };\n};\n","import { useEffect, useState } from \"react\";\nimport { useParams } from \"react-router-dom\";\n\nimport { Api } from \"@noom/noomscape\";\n\nimport { ErrorState } from \"@/constants\";\nimport { useAppContext } from \"@/contexts\";\nimport { Partner } from \"@/models\";\nimport { captureException } from \"@/utils/sentry\";\n\nimport { AxiosError } from \"axios\";\n\nimport { useGoto } from \"./useGoto\";\nimport { useQueryParams } from \"./useQueryParams\";\n\nconst getPartnerBySlug = async (slug: string): Promise => {\n try {\n const partner = await Api.call(\n \"partner.getPartnerBySlug\",\n Api.api.partner.getPartnerBySlug,\n {\n slug,\n },\n );\n\n return partner;\n } catch (e) {\n const { response } = e as AxiosError;\n if (response?.status === 404) {\n return null;\n }\n throw e;\n }\n};\n\nconst getPartnerByUpid = async (upid: string): Promise => {\n try {\n const partner: Partner = await Api.call(\n \"partner.getPartnerByUpid\",\n Api.api.partner.getPartnerByUpid,\n {\n upid,\n },\n );\n\n return partner;\n } catch (e) {\n const { response } = e as AxiosError;\n if (response?.status === 404) {\n return null;\n }\n throw e;\n }\n};\n\nexport const usePartnerInfo = () => {\n const { partnerInfo, setPartnerInfo } = useAppContext();\n const goto = useGoto();\n const { employerSlug } = useParams();\n const { upid } = useQueryParams();\n const [isPartnerInfoLoading, setPartnerInfoLoading] = useState(false);\n const [hasPartnerError, setPartnerError] = useState(false);\n\n useEffect(() => {\n if (partnerInfo?.goLiveDate && partnerInfo.goLiveDate > new Date()) {\n goto.error(ErrorState.BEFORE_GOLIVE_DATE);\n return;\n }\n\n // (osman) this will not fetch a new partnerInfo if the upid is changed, but we don't need to handle\n // that use case right now\n if (partnerInfo || isPartnerInfoLoading || hasPartnerError) {\n return;\n }\n\n if (!employerSlug && !upid) {\n return;\n }\n\n const handlePartnerStateOrError = (partner: Partner | null) => {\n if (!partner) {\n goto.notFound();\n return;\n }\n\n setPartnerInfo(partner);\n };\n\n async function fetch() {\n setPartnerInfoLoading(true);\n\n try {\n let partner: Partner | null = null;\n\n if (employerSlug && upid) {\n const [partnerBySlug, partnerByUpid] = await Promise.all([\n getPartnerBySlug(employerSlug),\n getPartnerByUpid(upid),\n ]);\n\n if (partnerBySlug?.id !== partnerByUpid?.id) {\n goto.error();\n return;\n }\n\n partner = partnerByUpid;\n } else if (upid) {\n partner = await getPartnerByUpid(upid);\n } else if (employerSlug) {\n partner = await getPartnerBySlug(employerSlug);\n }\n\n handlePartnerStateOrError(partner);\n } catch (e) {\n captureException(e);\n setPartnerError(true);\n }\n\n setPartnerInfoLoading(false);\n }\n fetch();\n }, [\n employerSlug,\n goto,\n hasPartnerError,\n isPartnerInfoLoading,\n partnerInfo,\n setPartnerInfo,\n upid,\n ]);\n\n return {\n partnerInfo,\n hasPartnerError,\n isPartnerInfoLoading,\n };\n};\n","import { parse } from \"date-fns\";\nimport { useEffect, useState } from \"react\";\n\nimport { RetriageEligibilityResponseProto } from \"@noom/noom-contracts/noom_contracts/backend/partner/service/partner_eligibility_service\";\nimport { Api } from \"@noom/noomscape\";\n\nimport { DOB_FORMAT } from \"@/constants\";\nimport { useAppContext } from \"@/contexts\";\nimport { RetriageEligibilityVerificationProperties } from \"@/models\";\nimport { getAutologinData } from \"@/utils/cookies\";\nimport {\n getProgramFromOffering,\n getEligibleProgramsFromEligibleOfferings,\n} from \"@/utils/programs\";\nimport { createCivilDate } from \"@/utils/proto\";\nimport { captureException } from \"@/utils/sentry\";\n\nimport { useGoto } from \"./useGoto\";\nimport { useTrackEvent } from \"./useTrackEvent\";\n\nexport const useRetriageEligibility = (partnerId?: number) => {\n const { retriageEligibility, setRetriageEligibility } = useAppContext();\n const goto = useGoto();\n const [isLoadingRetriageEligibility, setIsLoadingRetriageEligibility] =\n useState(false);\n const [checkingAutologinData, setCheckingAutologinData] = useState(false);\n const [verificationProperties, setVerificationProperties] =\n useState();\n const { linkB2BIdentity } = useTrackEvent();\n\n const resetRetriageEligibility = () => {\n setRetriageEligibility(undefined);\n setVerificationProperties(undefined);\n };\n\n const handleRetriageEligibilityResponse = (\n response: RetriageEligibilityResponseProto,\n didVerifyUsingAutologinData = false,\n ) => {\n const {\n accessCode,\n currentOffering,\n eligibilityReason,\n eligibleRetriageOfferings,\n userProfile,\n partnerSlug,\n segmentId,\n segmentName,\n } = response;\n\n const currentProgram = getProgramFromOffering(currentOffering);\n const eligibleRetriagePrograms = getEligibleProgramsFromEligibleOfferings(\n eligibleRetriageOfferings,\n );\n\n setRetriageEligibility({\n accessCode,\n currentProgram,\n didVerifyUsingAutologinData,\n eligibilityReason,\n eligibleRetriagePrograms,\n userProfile,\n partnerSlug,\n segmentId,\n segmentName,\n });\n\n if (accessCode) {\n linkB2BIdentity(accessCode);\n }\n };\n\n useEffect(() => {\n if (retriageEligibility || !partnerId || !verificationProperties) {\n return () => undefined;\n }\n\n let ignore = false;\n async function fetch() {\n if (!verificationProperties) {\n return;\n }\n\n setIsLoadingRetriageEligibility(true);\n\n try {\n const { dateOfBirth, ...rest } = verificationProperties;\n\n const response: RetriageEligibilityResponseProto = await Api.call(\n \"partner.retriageEligibilityByEligibilityInfo\",\n Api.api.partner.retriageEligibilityByEligibilityInfo,\n {\n partnerId,\n ...rest,\n ...(dateOfBirth && {\n dateOfBirth: createCivilDate(\n parse(dateOfBirth, DOB_FORMAT, new Date()),\n ),\n }),\n },\n );\n\n if (ignore) {\n return;\n }\n\n handleRetriageEligibilityResponse(response);\n } catch (e) {\n if (ignore) {\n return;\n }\n\n goto.error();\n }\n setIsLoadingRetriageEligibility(false);\n }\n fetch();\n return () => {\n ignore = true;\n };\n }, [verificationProperties, partnerId, retriageEligibility]);\n\n useEffect(() => {\n const autologinData = getAutologinData();\n if (!autologinData) {\n return () => undefined;\n }\n\n const { accessCode, accessToken } = autologinData;\n\n if (retriageEligibility && retriageEligibility.accessCode === accessCode) {\n // already fetched the user's eligibility on a previous page\n return () => undefined;\n }\n\n let ignore = false;\n async function fetch() {\n setCheckingAutologinData(true);\n try {\n const response: RetriageEligibilityResponseProto = await Api.call(\n \"partner.retriageEligibilityForAccessCode\",\n Api.api.partner.retriageEligibilityForAccessCode,\n {\n accessCode,\n accessToken,\n },\n );\n\n if (ignore) {\n return;\n }\n\n handleRetriageEligibilityResponse(response, true);\n } catch (e) {\n if (ignore) {\n return;\n }\n captureException(e);\n }\n setCheckingAutologinData(false);\n }\n fetch();\n return () => {\n ignore = true;\n };\n }, []);\n\n return {\n verificationProperties,\n setVerificationProperties,\n resetRetriageEligibility,\n checkingAutologinData,\n isLoadingRetriageEligibility,\n };\n};\n","// These are all nearly the same, so this is in some fashion for docs only\nexport interface PoundsValue {\n /** value in pounds. */ mainUnitValue: number;\n}\nexport interface KilosValue {\n /** value in kilograms. */ mainUnitValue: number;\n}\nexport interface StoneValue {\n /** value in strong. */ mainUnitValue: number;\n /** value in stones */ secondaryUnitValue: number;\n}\n\nexport interface InchValue {\n /** value in inches. */ mainUnitValue: number;\n}\nexport interface FootValue {\n /** value in feet. */ mainUnitValue: number;\n /** value in inches. */ secondaryUnitValue?: number;\n}\nexport interface CentimeterValue {\n /** value in centimeters. */ mainUnitValue: number;\n}\n\n/**\n * Converts given value in pounds to be in kilograms.\n */\nexport function convertLbToKg({ mainUnitValue }: PoundsValue): KilosValue {\n return { mainUnitValue: mainUnitValue / 2.205 };\n}\n\n/**\n * Converts given value in kilograms to be in pounds.\n */\nexport function convertKgToLb({ mainUnitValue }: KilosValue): PoundsValue {\n return { mainUnitValue: mainUnitValue * 2.205 };\n}\n\n/**\n * Converts given value in kilograms to be in pounds.\n */\nexport function convertLbToSt({ mainUnitValue }: PoundsValue): StoneValue {\n const roundedLbValue = Math.round(mainUnitValue); // Round value before applying calculations to avoid off by one errors\n return {\n mainUnitValue: Math.floor(roundedLbValue / 14.0),\n secondaryUnitValue: roundedLbValue % 14.0,\n };\n}\n\n/**\n * Converts given value in stones and pounds to be in pounds.\n */\nexport function convertStToLb({\n mainUnitValue,\n secondaryUnitValue = 0,\n}: StoneValue): PoundsValue {\n return {\n mainUnitValue: mainUnitValue * 14.0 + secondaryUnitValue,\n };\n}\n\n/**\n * Converts given value in kilograms to be in stones and pounds.\n */\nexport function convertKgToSt({ mainUnitValue }: KilosValue) {\n const valueInLb = convertKgToLb({ mainUnitValue });\n return convertLbToSt(valueInLb);\n}\n\n/**\n * Converts given value in stones and pounds to be in kilogram.\n */\nexport function convertStToKg({\n mainUnitValue,\n secondaryUnitValue = 0,\n}: StoneValue) {\n const valueInLb = convertStToLb({ mainUnitValue, secondaryUnitValue });\n return convertLbToKg(valueInLb);\n}\n\n/**\n * Converts given value in inches to be in centimeters.\n *\n * @param {number} mainUnitValue - value in inches.\n */\nexport function convertInToCm({ mainUnitValue }: InchValue): CentimeterValue {\n return { mainUnitValue: mainUnitValue * 2.54 };\n}\n\n/**\n * Converts given value in centimeters to be in inches.\n */\nexport function convertCmToIn({ mainUnitValue }: CentimeterValue): InchValue {\n return { mainUnitValue: mainUnitValue / 2.54 };\n}\n\n/**\n * Converts given value in feet to be in inches.\n */\nexport function convertFtToIn({\n mainUnitValue,\n secondaryUnitValue = 0,\n}: FootValue): InchValue {\n return {\n mainUnitValue: mainUnitValue * 12 + secondaryUnitValue,\n };\n}\n\n/**\n * Converts given value in inches to be in feet.\n */\nexport function convertInToFt({ mainUnitValue }: InchValue): FootValue {\n return {\n mainUnitValue: Math.floor(mainUnitValue / 12.0),\n secondaryUnitValue: Math.floor(mainUnitValue % 12.0),\n };\n}\n\n/**\n * Converts given value in feet to be in centimeters.\n */\nexport function convertFtToCm({\n mainUnitValue,\n secondaryUnitValue = 0,\n}: FootValue) {\n const valueInIn = convertFtToIn({ mainUnitValue, secondaryUnitValue });\n return convertInToCm(valueInIn);\n}\n\n/**\n * Converts given value in centimeters to be in feet.\n *\n * @param {number} mainUnitValue - value in centimeters.\n */\nexport function convertCmToFt({ mainUnitValue }: CentimeterValue) {\n const valueInIn = convertCmToIn({ mainUnitValue });\n return convertInToFt(valueInIn);\n}\n","import { PHQ_OPTIONS } from \"@/constants\";\nimport { SurveyAnswers } from \"@/contexts\";\n\nexport const calculatePhqScore = ({\n phq1,\n phq2,\n phq3,\n phq4,\n}: SurveyAnswers): number => {\n const phqAnswers = [phq1, phq2, phq3, phq4];\n if (phqAnswers.some((phqAnswer) => !phqAnswer)) {\n throw Error(\"PHQ survey answers expected\");\n }\n\n return phqAnswers.reduce((acc, phqAnswer) => {\n const phqOption = PHQ_OPTIONS.find((option) => option.id === phqAnswer);\n if (!phqOption) {\n throw Error(\"encountered unexpected PHQ survey answer\");\n }\n return acc + phqOption.weight;\n }, 0);\n};\n","import { isPlainObject } from \"lodash\";\n\nimport { DynamicSurveyCompletedProto_SurveyCompleted_SurveyAnswer } from \"@noom/noom-contracts/noom_contracts/events/app/dynamic_survey/dynamic_survey_completed\";\n\nimport { ProgramOffering } from \"@/constants\";\nimport { SurveyAnswers } from \"@/contexts\";\nimport type { Partner, UserProfile } from \"@/models\";\n\nimport { convertFtToCm, convertLbToKg } from \"../UnitUtils\";\nimport { isB2CPartner } from \"../partners\";\n\nimport { calculatePhqScore } from \"./phq\";\n\nexport const OUTCOMES_QUESTION_ID_TO_UUID_MAP: Record = {\n a1c: \"23bc4a0b-9238-447d-ae66-5097432d87b9\",\n exercise: \"9da70ec9-b269-4367-8027-caf358a55541\",\n glp1Medication: \"d18dbd57-8172-4a38-876f-c08988266787\",\n hadA1cTested: \"61d55259-a724-4b06-9244-bc00f9f40919\",\n healthConditions: \"0c4d1ad1-4515-4e37-a1b5-6b091e6ab8f0\",\n medications: \"47ad5ef2-4600-4d94-a815-141554ff91cf\",\n mskPain: \"a4c7a4bf-ffd7-4248-bdd1-c96af906f713\",\n mskPainLevel: \"4014ef5d-9266-47ff-a695-2cb8e29c2aa0\",\n phq1: \"b957ba0c-5625-4f88-b2a1-6786f3bdac36\",\n phq2: \"29bd3e1d-25a2-42b1-a480-8bbd28d2fb54\",\n phq3: \"fe6f21eb-7ae3-40c7-b3df-1b1e148c6ca0\",\n phq4: \"780539bf-e97c-488a-8b47-5a0f6e0508dd\",\n reachingHealthGoals: \"0ae3cb75-dd2d-4c0e-a2e1-fb6eebfe67c9\",\n};\n\nexport const BASELINE_OUTCOMES_SURVEY_EXPERIENCE_SLUG = \"b2b_baseline_outcomes\";\nexport const RECURRING_OUTCOMES_SURVEY_EXPERIENCE_SLUG =\n \"b2b_recurring_outcomes\";\nexport const BASELINE_OUTCOMES_SURVEY_UUID =\n \"d396e01d-d6cf-4437-bf1f-bfe1fac932e9\";\nexport const RECURRING_OUTCOMES_SURVEY_UUID =\n \"c74ee122-712c-478d-b32b-33e86687ee30\";\n\nexport const PHQ_SCORE_UUID = \"dc583140-a421-402c-a57e-eed41f621835\";\nexport const HEIGHT_CM_UUID = \"0e4486fe-6109-446b-ae1b-52320fcefc26\";\nexport const WEIGHT_KG_UUID = \"16d6e698-acd7-4101-a055-e17e20cadb53\";\n\nexport const extractOutcomesSurveyAnswers = ({\n program,\n surveyAnswers,\n userProfile,\n}: {\n program: ProgramOffering | null;\n surveyAnswers: SurveyAnswers;\n userProfile?: UserProfile | null;\n}): DynamicSurveyCompletedProto_SurveyCompleted_SurveyAnswer[] => {\n const outcomesSurveyAnswers: DynamicSurveyCompletedProto_SurveyCompleted_SurveyAnswer[] =\n Object.entries(OUTCOMES_QUESTION_ID_TO_UUID_MAP)\n .filter(([questionId]) => {\n const surveyAnswer = surveyAnswers[questionId];\n\n return surveyAnswer !== undefined && !isPlainObject(surveyAnswer);\n })\n .map(([questionId, uuid]) => {\n const surveyAnswer = surveyAnswers[questionId];\n\n return {\n questionId: uuid,\n answerSlugs: Array.isArray(surveyAnswer)\n ? surveyAnswer\n : [String(surveyAnswer)],\n };\n });\n\n // store additional answer for PHQ score\n outcomesSurveyAnswers.push({\n questionId: PHQ_SCORE_UUID,\n answerSlugs: [String(calculatePhqScore(surveyAnswers))],\n });\n\n // Flatten and store height and weight for metabolic programs\n // For recurring outcomes, we only ask weight.\n if (program !== \"MOOD\" && userProfile?.latestWeightKgs === undefined) {\n const weight = surveyAnswers.heightWeight?.weight || surveyAnswers.weight;\n const { heightFeetPortion, heightInchesPortion } =\n surveyAnswers.heightWeight || {};\n\n if (\n !weight ||\n (surveyAnswers.heightWeight &&\n (!heightFeetPortion || heightInchesPortion === undefined))\n ) {\n throw Error(\n `Expected weight${surveyAnswers.heightWeight ? \" and height\" : \"\"}`,\n );\n }\n\n const weightInKg = convertLbToKg({\n mainUnitValue: weight,\n }).mainUnitValue;\n\n outcomesSurveyAnswers.push({\n questionId: WEIGHT_KG_UUID,\n answerSlugs: [String(weightInKg)],\n });\n\n if (heightFeetPortion) {\n const heightInCm = convertFtToCm({\n mainUnitValue: heightFeetPortion,\n secondaryUnitValue: heightInchesPortion,\n }).mainUnitValue;\n\n outcomesSurveyAnswers.push({\n questionId: HEIGHT_CM_UUID,\n answerSlugs: [String(heightInCm)],\n });\n }\n }\n return outcomesSurveyAnswers;\n};\n\n/**\n * Determines if the baseline outcomes question should be asked.\n *\n * @param partnerInfo used to determine if the partner is a B2C partner\n * @returns\n */\nexport const shouldAskBaselineOutcomes = (partnerInfo: Partner | null) => {\n if (partnerInfo?.id === undefined) {\n return true;\n }\n\n return !isB2CPartner(partnerInfo);\n};\n\n/**\n * Determines if the user's number of days in the program is within the first\n * two weeks of the month since the user started the program.\n *\n * This only applies to Mood and not cardiometabolic programs, because surveys\n * for cardiometabolic programs are sent every 30 days so monthly questions\n * should always be asked for cardiometabolic programs.\n * @param userProfile Profile data containing the days in program for the user\n * @returns\n */\nexport const shouldAskMonthlyQuestion = (userProfile: UserProfile | null) => {\n if (!userProfile) {\n return false;\n }\n\n const days = userProfile.daysInProgram % 30;\n\n return days >= 0 && days < 15;\n};\n\n/**\n * Determines if the user's number of days in the program is within the first\n * month of the quarter since the user started the program.\n * @param userProfile Profile data containing the days in program for the user\n * @returns\n */\nexport const shouldAskQuarterlyQuestion = (userProfile: UserProfile | null) => {\n if (!userProfile) {\n return false;\n }\n\n const questionCadence = userProfile.currentProgram === \"MOOD\" ? 15 : 30;\n\n const days = userProfile.daysInProgram % 90;\n\n return days >= 0 && days < questionCadence;\n};\n","import { Api } from \"@noom/noomscape\";\n\nimport { useAppContext } from \"@/contexts\";\nimport { getAutologinData } from \"@/utils/cookies\";\nimport { captureMessage } from \"@/utils/sentry\";\nimport {\n BASELINE_OUTCOMES_SURVEY_EXPERIENCE_SLUG,\n BASELINE_OUTCOMES_SURVEY_UUID,\n extractOutcomesSurveyAnswers,\n RECURRING_OUTCOMES_SURVEY_EXPERIENCE_SLUG,\n RECURRING_OUTCOMES_SURVEY_UUID,\n shouldAskBaselineOutcomes,\n} from \"@/utils/survey/outcomes\";\n\nimport { useCreateLoginToken } from \"./useCreateLoginToken\";\nimport { useGoto } from \"./useGoto\";\n\nexport const useStoreOutcomes = () => {\n const {\n hasB2cAccount,\n partnerInfo,\n selectedProgram,\n surveyAnswers,\n userProfile,\n } = useAppContext();\n const { createLoginToken } = useCreateLoginToken();\n const goto = useGoto();\n\n const {\n createAccount: { email } = {},\n createPassword,\n existingPassword,\n } = surveyAnswers;\n\n const password = hasB2cAccount ? existingPassword : createPassword;\n\n const storeBaselineOutcomesAnswers = async (accessCode: string) => {\n // The only case this will happen is if the user goes through the single\n // page enrollment form because we don't store email and password in App\n // state. But we don't ask baseline outcomes survey questions on the single\n // page enrollment flow so this wouldn't have any effect anyway.\n if (!email || !password) {\n return;\n }\n\n if (!shouldAskBaselineOutcomes(partnerInfo)) {\n return;\n }\n\n const accessToken = await createLoginToken(email, password);\n\n Api.call(\"outcomes.store\", Api.api.outcomes.store, {\n accessCode,\n accessToken,\n surveyAnswers: extractOutcomesSurveyAnswers({\n program: selectedProgram,\n surveyAnswers,\n }),\n surveyExperienceSlug: BASELINE_OUTCOMES_SURVEY_EXPERIENCE_SLUG,\n surveyId: BASELINE_OUTCOMES_SURVEY_UUID,\n });\n };\n\n const storeRecurringOutcomesAnswers = async () => {\n const autologinData = getAutologinData();\n\n if (!autologinData) {\n captureMessage(\"No autologin data provided for survey completion\");\n goto.error();\n return;\n }\n\n const { accessCode, accessToken } = autologinData;\n\n Api.call(\"outcomes.store\", Api.api.outcomes.store, {\n accessCode,\n accessToken,\n surveyAnswers: extractOutcomesSurveyAnswers({\n program: userProfile?.currentProgram || null,\n surveyAnswers,\n userProfile,\n }),\n surveyExperienceSlug: RECURRING_OUTCOMES_SURVEY_EXPERIENCE_SLUG,\n surveyId: RECURRING_OUTCOMES_SURVEY_UUID,\n });\n };\n\n return { storeBaselineOutcomesAnswers, storeRecurringOutcomesAnswers };\n};\n","import { useLocation, useNavigate, useParams } from \"react-router-dom\";\n\nimport { B2BEnrollmentEnumsProto_PasscodeInputMethod } from \"@noom/noom-contracts/noom_contracts/events/web/b2b/shared\";\nimport { Api } from \"@noom/noomscape\";\n\nimport { useTrackEvent } from \"./useTrackEvent\";\n\nasync function getUpidFromPasscode(\n passcode: string,\n partnerSlug: string,\n): Promise {\n const response = await Api.call(\n \"upid.getPasscode\",\n Api.api.upid.getPasscode,\n {\n partnerSlug,\n passcode,\n },\n );\n return response.upid;\n}\n\nexport const useSubmitPasscode = () => {\n const { search } = useLocation();\n const navigate = useNavigate();\n const { employerSlug } = useParams();\n const { trackAnonEvent, trackIdentifiedEvent } = useTrackEvent();\n\n return async (\n passcode: string,\n inputMethod: B2BEnrollmentEnumsProto_PasscodeInputMethod,\n ) => {\n let upid: string;\n try {\n upid = await getUpidFromPasscode(passcode, employerSlug || \"\");\n upid = upid?.toLowerCase();\n } catch (e) {\n trackIdentifiedEvent(\"b2bEnrollmentIdentifiedPasscodeChecked\", {\n inputMethod,\n passcodeCorrect: false,\n });\n\n trackAnonEvent(\"b2bEnrollmentAnonPasscodeChecked\", {\n passcodeCorrect: false,\n });\n\n throw e;\n }\n const qs = new URLSearchParams(search);\n qs.append(\"upid\", upid);\n qs.delete(\"passcode\");\n\n trackIdentifiedEvent(\"b2bEnrollmentIdentifiedPasscodeChecked\", {\n inputMethod,\n passcodeCorrect: true,\n });\n\n trackAnonEvent(\"b2bEnrollmentAnonPasscodeChecked\", {\n passcodeCorrect: true,\n });\n\n navigate(`/employer/${employerSlug}?${qs.toString()}`, { replace: true });\n };\n};\n","import React, { useEffect, useMemo } from \"react\";\nimport { isMobile } from \"react-device-detect\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { B2BEnrollmentAnonRetriageResultPresentedProto } from \"@noom/noom-contracts/noom_contracts/events/web/b2b/enrollment_anon\";\nimport { B2BEnrollmentEnumsProto_Program } from \"@noom/noom-contracts/noom_contracts/events/web/b2b/shared\";\n\nimport {\n QuestionComponentProps,\n QuestionDefinition,\n} from \"@/components/survey/Question\";\nimport { useAppContext } from \"@/contexts\";\nimport { useTrackEvent, useUpdateLastTriageTimestamp } from \"@/hooks\";\n\nimport { BaseSuccess } from \"../core/BaseSuccess\";\n\nconst QUESTION_ID = \"retriageResult\";\n\nenum ResultValue {\n WEIGHT = \"weight\",\n CURRENT_PROGRAM = \"currentProgram\",\n DPP = \"dpp\",\n}\n\nfunction getNoomEventProgram(\n v: ResultValue,\n): B2BEnrollmentEnumsProto_Program | undefined {\n switch (v) {\n case ResultValue.WEIGHT:\n return \"WEIGHT\";\n case ResultValue.DPP:\n return \"DPP\";\n default:\n return undefined;\n }\n}\n\nconst RetriageResult: React.FC = ({\n onClickNext,\n surveyAnswers: { dppEligible },\n}) => {\n const { retriageEligibility } = useAppContext();\n const { trackAnonEvent } = useTrackEvent();\n const { t } = useTranslation();\n const { updateLastTriageTimestamp } = useUpdateLastTriageTimestamp();\n\n const { firstName } = retriageEligibility?.userProfile || {\n firstName: \"Noomer\",\n };\n const result: ResultValue = useMemo(\n () => (dppEligible ? ResultValue.DPP : ResultValue.CURRENT_PROGRAM),\n [dppEligible],\n );\n\n const accessCode = retriageEligibility?.accessCode\n useEffect(() => {\n if (accessCode && result === ResultValue.CURRENT_PROGRAM) {\n updateLastTriageTimestamp(accessCode, \"KEPT_SAME_OFFERING\");\n }\n const params: B2BEnrollmentAnonRetriageResultPresentedProto = {\n currentProgram:\n retriageEligibility?.currentProgram || \"PROGRAM_UNSPECIFIED\",\n };\n const eligibleProgram = getNoomEventProgram(result);\n if (eligibleProgram) {\n params.eligibleProgram = eligibleProgram;\n }\n trackAnonEvent(\"b2bEnrollmentAnonRetriageResultPresented\", params);\n }, [accessCode, result]);\n\n return (\n onClickNext(null)}\n questionId={QUESTION_ID}\n headingText={t(\n `retriageResult.${result}.heading`,\n `We've got just the program for you, ${firstName}.`,\n )}\n bodyContent={t(\n `retriageResult.${result}.body`,\n \"Based on your answers, we're confident that your current Noom program is the best match for you. Let's keep Noomin'!\",\n )}\n ctaText={\n result === ResultValue.CURRENT_PROGRAM && !isMobile\n ? \"\"\n : t(`retriageResult.${result}.cta`, \"Next\")\n }\n />\n );\n};\n\nexport const Q_RETRIAGE_RESULT: QuestionDefinition = {\n id: QUESTION_ID,\n shouldShowQuestion: ({\n selectedProgram,\n surveyAnswers: { dppEligible, confirmChangeProgramMed, medicareConsent },\n }) =>\n confirmChangeProgramMed !== false &&\n // if the user disagrees with medicare consent and is dpp eligible,\n // they could still see this screen\n !(medicareConsent === \"disagree\" && !dppEligible) &&\n selectedProgram !== \"MED\" &&\n selectedProgram !== \"NMPBA\",\n component: RetriageResult,\n};\n","import { TriageResultProto_Value } from \"@noom/noom-contracts/noom_contracts/backend/dpp/dpp_service\";\nimport { Api } from \"@noom/noomscape\";\n\nimport { UpdateLastTriageTimestampRequest } from \"@/api/dpp/updateLastTriageTimestamp\";\nimport { useAppContext } from \"@/contexts\";\nimport { isB2CPartner } from \"@/utils/partners\";\nimport { captureException } from \"@/utils/sentry\";\n\nexport const useUpdateLastTriageTimestamp = () => {\n const { partnerInfo, surveyAnswers } = useAppContext();\n const updateLastTriageTimestamp = async (\n accessCode: string,\n triageResult: TriageResultProto_Value,\n ) => {\n if (isB2CPartner(partnerInfo)) {\n return null;\n }\n\n const request: UpdateLastTriageTimestampRequest = {\n accessCode,\n newLastTriageTimestamp: new Date().toISOString(),\n triageResult,\n wasOfferedDpp: !!surveyAnswers.wasOfferedDpp,\n wasOfferedMed: !!surveyAnswers.wasOfferedMed,\n };\n return Api.call(\n \"dpp.updateLastTriageTimestamp\",\n Api.api.dpp.updateLastTriageTimestamp,\n request,\n ).catch((e: unknown) => {\n captureException(e);\n });\n };\n\n return { updateLastTriageTimestamp };\n};\n","import i18next from \"i18next\";\nimport React from \"react\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { Loader, Text } from \"@noom/wax-component-library\";\n\nimport { OPT_OUT_DISABLED_PARTNERS } from \"@/constants/Partners\";\nimport { useAppContext } from \"@/contexts\";\nimport { useGeolocation } from \"@/hooks\";\nimport { getDisplayName } from \"@/models\";\nimport { isB2CPartner } from \"@/utils/partners\";\n\nexport const GenericConsent: React.FC<{ ctaText: string }> = ({ ctaText }) => {\n const { partnerInfo } = useAppContext();\n const { canOptOut, canOptOutMHMDA, isLoading } = useGeolocation();\n const { t } = useTranslation();\n\n const getTosHtml = () => {\n const hasCustomCopy = i18next.exists(\n `termsOfService.partners.${partnerInfo?.slug}`,\n );\n\n const shouldShowGeoCopy =\n canOptOut() &&\n !OPT_OUT_DISABLED_PARTNERS.includes(partnerInfo?.slug || \"\");\n\n const yourPrivacyChoices = t(\"termsOfService.yourPrivacyChoices\");\n\n if (hasCustomCopy) {\n const customTos = t(`termsOfService.partners.${partnerInfo?.slug}`, {\n signUpButton: ctaText,\n });\n\n if (shouldShowGeoCopy) {\n return `${customTos} ${yourPrivacyChoices}`;\n }\n\n return customTos;\n }\n\n const baseTos = t(\"termsOfService.default\", {\n signUpButton: ctaText,\n });\n\n const noomMayShareHtml = t(\"termsOfService.noomMayShareInformation\", {\n partnerName: getDisplayName(partnerInfo),\n });\n\n if (shouldShowGeoCopy) {\n return `${baseTos} ${noomMayShareHtml}${yourPrivacyChoices}`;\n }\n\n return baseTos;\n };\n\n const getTosHtmlB2C = () => {\n const translationKey = canOptOutMHMDA()\n ? \"termsOfService.b2cMHMDA\"\n : \"termsOfService.b2c\";\n\n return t(translationKey, { signUpButton: ctaText });\n };\n\n if (isLoading) {\n return ;\n }\n\n return (\n \n );\n};\n","import React from \"react\";\n\nexport const NoomEmailAddressLink = (\n partnersupport@noom.com\n);\n","import React, { useState } from \"react\";\n\nimport { Box, CompassColor, Image } from \"@noom/wax-component-library\";\n\nimport { ASSET_URL } from \"@/constants\";\nimport { DPP_PARTNERS } from \"@/constants/Partners\";\nimport { useAppContext } from \"@/contexts\";\nimport { getDisplayName } from \"@/models\";\nimport { getAutologinData } from \"@/utils/cookies\";\n\nexport const NoomHeader: React.FC<{ forceHeader?: boolean }> = ({\n forceHeader,\n}) => {\n const { partnerInfo } = useAppContext();\n const [isImageLoaded, setIsImageLoaded] = useState(false);\n\n const autologinData = getAutologinData();\n\n // Hide header if B2B WEA is loaded through a webview in the Noom app because the Noom app already loads its own header\n if (!forceHeader && autologinData) {\n // eslint-disable-next-line react/jsx-no-useless-fragment\n return <>;\n }\n\n return (\n \n \"Noom\"\n {partnerInfo?.slug && (\n <>\n \n setIsImageLoaded(true)}\n opacity={isImageLoaded ? 1 : 0}\n transition=\"opacity 0.1s ease-in-out\"\n />\n \n )}\n \n );\n};\n","import React from \"react\";\n\nexport const NoomSupportLink = (\n \n https://www.noom.com/support/\n \n);\n","import React, { ReactNode } from \"react\";\n\nexport const NoomVirtualAssistantLink: React.FC<{ children: ReactNode }> = ({\n children,\n}) => (\n \n {children}\n \n);\n","import React from \"react\";\n\nimport { Box, CompassColor, useMediaQuery } from \"@noom/wax-component-library\";\n\nimport { NoomHeader } from \"@/components/noom-branding\";\n\ntype BaseOutlineProps = {\n backgroundColor?: CompassColor;\n children?: React.ReactNode;\n};\n\nexport const BaseOutline: React.FC = ({\n backgroundColor = CompassColor.white,\n children,\n}) => {\n const [isBrowser] = useMediaQuery(\"(min-width: 1160px)\");\n\n if (!isBrowser) {\n return (\n \n \n \n {children}\n \n \n );\n }\n\n return (\n \n \n \n {/*\n The question height is the content height (100vh - 64px) minus the\n padding on each side: var(--spacing-l) (24px)\n\n 100vh - 64px - 24px - 24px = 100vh - 112px\n */}\n \n {children}\n \n \n \n );\n};\n","import React, { useEffect } from \"react\";\n\nimport {\n Box,\n Button,\n CompassColor,\n Heading,\n Image,\n Spacing,\n Stack,\n StackItem,\n Text,\n useMediaQuery,\n} from \"@noom/wax-component-library\";\n\nimport { QuestionComponentProps } from \"@/components/survey/Question\";\nimport { useTrackEvent } from \"@/hooks\";\n\nimport { BaseOutline } from \"./BaseOutline\";\n\nconst DEFAULT_AUTO_ADVANCE_MS = 6000;\n\ntype BaseInterstitialProps = {\n autoAdvance?: boolean;\n autoAdvanceMs?: number;\n backgroundColor?: CompassColor;\n centerChildren?: boolean;\n children?: React.ReactNode;\n color?: CompassColor;\n ctaText?: string;\n footerText?: string;\n headerText?: string;\n helperText?: string;\n imageAlt?: string;\n imageSrc?: string;\n onClickBack: () => void;\n onClickNext: QuestionComponentProps[\"onClickNext\"];\n questionId: string;\n showBackButton?: boolean;\n width?: string;\n margin?: string;\n};\n\nexport const BaseInterstitial: React.FC = ({\n autoAdvance = false,\n autoAdvanceMs = DEFAULT_AUTO_ADVANCE_MS,\n backgroundColor,\n centerChildren = false,\n children,\n color,\n ctaText,\n footerText,\n headerText,\n helperText,\n imageAlt,\n imageSrc,\n onClickBack,\n onClickNext,\n questionId,\n showBackButton = false,\n width = \"400px\",\n margin,\n}) => {\n const [isBrowser] = useMediaQuery(\"(min-width: 1160px)\");\n const { trackAnonPageViewed } = useTrackEvent();\n\n useEffect(() => {\n let timeoutId: NodeJS.Timeout;\n if (autoAdvance) {\n timeoutId = setTimeout(() => onClickNext(null), autoAdvanceMs);\n }\n return () => {\n if (timeoutId) clearTimeout(timeoutId);\n };\n }, []);\n\n useEffect(() => {\n trackAnonPageViewed(questionId);\n }, [questionId]);\n\n return (\n \n \n {showBackButton && (\n \n )}\n \n {(headerText || helperText) && (\n \n {headerText && (\n \n {headerText}\n \n )}\n {helperText && {helperText}}\n \n )}\n {imageSrc ? (\n \n ) : (\n children\n )}\n {ctaText && (\n \n onClickNext(null)}\n size=\"xl\"\n type=\"submit\"\n _focus={{\n boxShadow: \"none\",\n }}\n >\n {ctaText}\n \n \n )}\n \n {footerText && (\n \n \n {footerText}\n \n \n )}\n \n \n );\n};\n","import React, { Fragment, useEffect, useState } from \"react\";\n\nimport { Box, CompassColor, Image } from \"@noom/wax-component-library\";\n\nconst BAR_ZINDEX = 50;\nconst ICON_ZINDEX = 100;\n\nconst ICON_SIZE_HALF = 5;\nconst ICON_SIZE_FULL = 10;\n\nexport type SurveyProgressBarProps = {\n currentProgress: number;\n currentSectionIndex: number;\n lastProgress: number;\n percentages: number[];\n};\n\n/**\n * Calculates the elements needed to render the progress bar with the correct\n * bars, icons, and styles for all pieces of the complete bar.\n *\n * @param percentages The list of percentages that the bar should be divided\n * into (e.g. [25, 50, 25] means the bar will be divided into three parts with\n * the inner bar being twice as long as the end bars).\n * @param currentSectionIndex The index of the current section, used to\n * determine the coloring and icons for the rest of the sections.\n * @param progress The progress within the current section (e.g. 35 is 35%\n * within the current section).\n * @returns an array of elements used to render the progress bar data\n */\nconst getSectionBars = (\n percentages: number[],\n currentSectionIndex: number,\n progress: number,\n shouldAnimate: boolean,\n) => {\n const bars = [];\n let sectionPercentageRunningSum = 0;\n\n for (let i = 0; i < percentages.length; i += 1) {\n const percentage = percentages[i];\n const isCompletedSection = i < currentSectionIndex;\n const isCurrentSection = i === currentSectionIndex;\n\n const isFirstSection = i === 0;\n const isLastSection = i === percentages.length - 1;\n const isEndSection = isFirstSection || isLastSection;\n\n let barColor: CompassColor = CompassColor.offWhite;\n if (isCompletedSection) {\n barColor = CompassColor.lagoon;\n } else if (isCurrentSection) {\n barColor = CompassColor.stream;\n }\n\n // The bar should extend beyond the icon in order to contain the icon. The\n // distance is half the width of an icon if it is an end bar, otherwise the\n // full width of an icon.\n const barWidth = `calc(${percentage}% + ${\n isEndSection ? ICON_SIZE_HALF : ICON_SIZE_FULL\n }px)`;\n\n // The bar should overlap with the icon so it is moved back halfway the\n // size of the icon if the bar is not the first one.\n const barLeftOffset = `calc(${sectionPercentageRunningSum}% - ${\n isFirstSection ? 0 : ICON_SIZE_HALF\n }px)`;\n\n sectionPercentageRunningSum += percentage;\n\n // The icon should fit completely inside the bar if it is the last one,\n // otherwise it should be halfway between bars\n const iconLeftOffset = `calc(${sectionPercentageRunningSum}% - ${\n isLastSection ? ICON_SIZE_FULL : ICON_SIZE_HALF\n }px)`;\n\n bars.push(\n \n \n \n \n {percentages.length > 1 && (\n \n )}\n ,\n );\n }\n\n return bars;\n};\n\nexport const SurveyProgressBar: React.FC = ({\n currentProgress,\n currentSectionIndex,\n lastProgress,\n percentages,\n}) => {\n const [progress, setProgress] = useState(currentProgress || lastProgress);\n const [sectionIndex, setSectionIndex] = useState(currentSectionIndex);\n const [shouldAnimate, setShouldAnimate] = useState(true);\n\n useEffect(() => {\n // This allows us to animate the progress difference when the props change\n if (progress !== currentProgress) {\n setTimeout(() => setProgress(currentProgress), 10);\n }\n }, [currentProgress, progress]);\n\n useEffect(() => {\n // This prevents a bug where switching to the first question in a new\n // section will cause the bar to seem like it's going backwards\n setShouldAnimate(sectionIndex === currentSectionIndex);\n setSectionIndex(currentSectionIndex);\n }, [currentSectionIndex]);\n\n return (\n \n {getSectionBars(\n percentages,\n currentSectionIndex,\n progress,\n shouldAnimate,\n )}\n \n );\n};\n","import React from \"react\";\n\nimport { Box, CompassColor, Image, Text } from \"@noom/wax-component-library\";\n\nimport { useSurveyProgressBar } from \"@/hooks\";\n\nimport { SurveyProgressBar } from \"./survey-progress-bar/SurveyProgressBar\";\n\ntype SurveyHeaderProps = {\n headerImageSrc?: string;\n hideBackButton?: boolean;\n hideSurveyProgressBar?: boolean;\n onClickBack: () => void;\n};\n\nexport const SurveyHeader: React.FC = ({\n headerImageSrc,\n hideBackButton,\n hideSurveyProgressBar,\n onClickBack,\n}) => {\n const {\n currentProgress,\n currentSectionDescription,\n currentSectionIndex,\n lastProgress,\n percentages,\n } = useSurveyProgressBar();\n\n return (\n \n \n {!hideBackButton && (\n \n )}\n {!hideSurveyProgressBar && (\n \n \n {currentSectionDescription}\n \n \n )}\n \n {!hideSurveyProgressBar && (\n \n \n \n )}\n {headerImageSrc && (\n \n \n \n )}\n \n );\n};\n","import { useEffect } from \"react\";\nimport { useLocation } from \"react-router-dom\";\n\nimport { useAppContext } from \"@/contexts\";\n\nexport type SurveyProgressBarState = {\n currentProgress: number;\n currentQuestionId: string;\n lastProgress: number;\n currentSectionDescription: string;\n currentSectionIndex: number;\n percentages: number[];\n};\n\nexport const useSurveyProgressBar = (): SurveyProgressBarState => {\n const { questionSet, surveyProgressBarState, setSurveyProgressBarState } =\n useAppContext();\n const { pathname } = useLocation();\n\n const { currentProgress, currentQuestionId, currentSectionIndex } =\n surveyProgressBarState;\n const questionId = pathname.split(\"/\").pop() || \"\";\n\n useEffect(() => {\n if (!questionSet.length) {\n return;\n }\n\n if (questionId === currentQuestionId) {\n return;\n }\n\n const newSectionIndex = questionSet.findIndex((section) =>\n section.questions.find((definition) => definition.id === questionId),\n );\n const { description, questions } = questionSet[newSectionIndex];\n\n const questionIndex = questions.findIndex(\n (definition) => definition.id === questionId,\n );\n\n const newProgress = (questionIndex / questions.length) * 100;\n\n setSurveyProgressBarState({\n currentProgress: newProgress,\n currentQuestionId: questionId,\n currentSectionDescription: description,\n currentSectionIndex: newSectionIndex,\n lastProgress:\n newSectionIndex !== currentSectionIndex ? 0 : currentProgress,\n percentages: questionSet.flatMap((section) => section.percentage),\n });\n }, [\n questionId,\n questionSet,\n currentProgress,\n currentQuestionId,\n currentSectionIndex,\n setSurveyProgressBarState,\n ]);\n\n return surveyProgressBarState;\n};\n","import React, { useEffect } from \"react\";\n\nimport {\n Box,\n Heading,\n Image,\n Spacing,\n Stack,\n Text,\n} from \"@noom/wax-component-library\";\n\nimport { SurveyHeader } from \"@/components/SurveyHeader\";\nimport { useTrackEvent } from \"@/hooks\";\n\nimport { BaseOutline } from \"./BaseOutline\";\n\ntype BaseQuestionProps = {\n children?: React.ReactNode;\n footer?: React.ReactNode;\n footerPosition?: \"absolute\" | \"static\";\n headerImageSrc?: string;\n hideBackButton?: boolean;\n hideHeader?: boolean;\n hideSurveyProgressBar?: boolean;\n imageSrc?: string;\n onClickBack: () => void;\n questionDescription?: string;\n questionHelperText?: string;\n questionId: string;\n questionText: string;\n};\n\nexport const BaseQuestion: React.FC = ({\n children,\n footer,\n footerPosition = \"absolute\",\n headerImageSrc,\n hideBackButton,\n hideHeader,\n hideSurveyProgressBar,\n imageSrc,\n onClickBack,\n questionDescription,\n questionId,\n questionHelperText,\n questionText,\n}) => {\n const { trackAnonPageViewed } = useTrackEvent();\n\n useEffect(() => {\n trackAnonPageViewed(questionId);\n }, [questionId]);\n\n return (\n \n {!hideHeader && (\n \n \n \n )}\n \n \n \n {imageSrc && (\n \n \n \n )}\n {questionDescription && (\n \n {questionDescription}\n \n )}\n \n {questionText}\n \n {questionHelperText && {questionHelperText}}\n \n {children}\n \n {footer && (\n \n {footer}\n \n )}\n \n \n );\n};\n","import styled from \"@emotion/styled\";\nimport React from \"react\";\n\nimport { CompassColor } from \"@noom/wax-component-library\";\n\ntype CheckboxProps = {\n checked?: boolean;\n};\n\nconst CheckmarkSvg = styled.svg`\n height: 70%;\n margin: 15%;\n transform: ${(props) => (props.checked ? \"scale(1)\" : \"scale(0)\")};\n transition: 166ms transform ease-in-out;\n width: 70%;\n`;\n\nconst Container = styled.div`\n background-color: ${CompassColor.white};\n border: 1px solid\n ${(props) => (props.checked ? CompassColor.lagoon : CompassColor.sand02)};\n border-radius: 4px;\n box-sizing: border-box;\n flex-shrink: 0;\n height: 24px;\n margin-right: var(--spacing-m);\n width: 24px;\n`;\n\nexport const Checkbox: React.FC = ({ checked }) => (\n \n \n \n \n \n);\n","import styled from \"@emotion/styled\";\nimport React, { InputHTMLAttributes } from \"react\";\n\nimport { CompassColor } from \"@noom/wax-component-library\";\n\nimport { Checkbox } from \"./Checkbox\";\n\nconst Label = styled.label<{ checked?: boolean }>`\n align-items: center;\n background-color: ${(props) =>\n props.checked ? CompassColor.lagoon : CompassColor.offWhite};\n border: none;\n border-radius: 8px;\n box-sizing: border-box;\n color: ${(props) =>\n props.checked ? CompassColor.white : CompassColor.black};\n display: flex;\n justify-content: flex-start;\n min-height: 60px;\n padding: 0 var(--spacing-m);\n position: relative;\n width: 100%;\n\n &:hover {\n background-color: ${(props) =>\n props.checked ? CompassColor.lagoon : CompassColor.sand02};\n }\n`;\n\nconst CheckboxInput = styled.input`\n appearance: none;\n border: 0;\n cursor: pointer;\n height: 100%;\n left: 0;\n position: absolute;\n top: 0;\n width: 100%;\n`;\n\ntype CheckboxButtonProps = InputHTMLAttributes & {\n invertLabelColorsOnChecked?: boolean;\n};\n\nexport const CheckboxButton: React.FC = ({\n checked,\n children,\n invertLabelColorsOnChecked = true,\n ...rest\n}) => (\n \n);\n","import React from \"react\";\n\nimport { Spacing, Stack } from \"@noom/wax-component-library\";\n\nimport { QuestionOption } from \"@/components/survey/Question\";\n\nimport { CheckboxButton } from \"./CheckboxButton\";\n\nexport type CheckboxOption = QuestionOption & {\n subtext?: string;\n};\n\ntype CheckboxOptionsProps = {\n checkedItems: string[];\n options: CheckboxOption[];\n submitCheckboxQuestion: () => void;\n toggleCheckedState: (optionId: string, currentCheckedState: boolean) => void;\n};\n\nexport const CheckboxOptions: React.FC = ({\n checkedItems,\n options,\n submitCheckboxQuestion,\n toggleCheckedState,\n}) => (\n \n {options.map((option) => {\n const checked = !!checkedItems.find(\n (checkedItem) => checkedItem === option.id,\n );\n\n return (\n toggleCheckedState(option.id, checked)}\n onKeyPress={(e) => {\n if (e.key === \"Enter\") {\n submitCheckboxQuestion();\n }\n }}\n >\n \n \n {option.text}\n \n {option.subtext && {option.subtext}}\n \n \n );\n })}\n \n);\n","import React, { useState } from \"react\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { Button, Text } from \"@noom/wax-component-library\";\n\nimport { CheckboxOptions, CheckboxOption } from \"@/components/survey/checkbox\";\n\nimport { QuestionComponentProps } from \"../../Question\";\n\nimport { BaseQuestion } from \"./BaseQuestion\";\n\ntype CheckboxQuestionComponentProps = Omit<\n QuestionComponentProps,\n \"surveyAnswers\"\n> & {\n options: CheckboxOption[];\n hiddenOptions?: CheckboxOption[];\n questionHelperText?: string;\n questionId: string;\n questionText: string;\n selectedItems: string[];\n};\n\nconst isSpecialCheckbox = (optionId: string) =>\n optionId === \"none\" || optionId === \"preferNotToSay\";\n\nexport const CheckboxQuestion: React.FC = ({\n canProceedWithoutAnswer = false,\n onClickBack,\n onClickNext,\n options,\n hiddenOptions,\n questionHelperText,\n questionId,\n questionText,\n selectedItems,\n}) => {\n const { t } = useTranslation();\n const [checkedItems, setCheckedItems] = useState(selectedItems);\n const [showHiddenItems, setShowHiddenItems] = useState(false);\n const selectedHiddenOptions =\n hiddenOptions?.filter((option) => selectedItems.includes(option.id)) ?? [];\n const notSelectedHiddenOptions =\n hiddenOptions?.filter((option) => !selectedItems.includes(option.id)) ?? [];\n\n const toggleCheckedState = (\n optionId: string,\n currentCheckedState: boolean,\n ) => {\n /**\n * If the item is currently checked: remove the item from the array.\n * If the item is currently not checked:\n * - if it is a special checkbox, make that the only checked item\n * - otherwise, remove existing special checkboxes and add the item to the\n * array\n */\n let newCheckedItems: string[];\n if (currentCheckedState) {\n newCheckedItems = checkedItems.filter(\n (checkedItem) => checkedItem !== optionId,\n );\n } else if (isSpecialCheckbox(optionId)) {\n newCheckedItems = [optionId];\n } else {\n newCheckedItems = [\n ...checkedItems.filter(\n (checkedItem) => !isSpecialCheckbox(checkedItem),\n ),\n optionId,\n ];\n }\n setCheckedItems(newCheckedItems);\n };\n\n const submitCheckboxQuestion = () => {\n if (checkedItems.length === 0 && !canProceedWithoutAnswer) {\n return;\n }\n onClickNext(checkedItems);\n };\n\n return (\n \n \n {!!notSelectedHiddenOptions.length && !showHiddenItems && (\n setShowHiddenItems(true)}\n >\n \n {t(\"checkboxQuestion.showHiddenOptionsText\")}\n \n \n )}\n submitCheckboxQuestion()}\n size=\"xl\"\n >\n {t(\"checkboxQuestion.ctaText\")}\n \n \n );\n};\n","import styled from \"@emotion/styled\";\nimport React from \"react\";\n\nimport {\n Button,\n ButtonProps,\n CompassColor,\n Spacing,\n Stack,\n} from \"@noom/wax-component-library\";\n\nimport { QuestionOption } from \"@/components/survey/Question\";\n\ntype MultipleChoiceOptionsProps = {\n onClick: (optionId: string) => void;\n options: QuestionOption[];\n selectedItem?: string;\n};\n\ntype SurveyButtonProps = ButtonProps & {\n selected: boolean;\n};\n\nconst SurveyButton = styled(Button)`\n background-color: ${(props) =>\n props.selected ? CompassColor.lagoon : CompassColor.offWhite};\n border: 2px solid\n ${(props) => (props.selected ? CompassColor.lagoon : CompassColor.offWhite)};\n border-radius: 8px;\n color: ${(props) =>\n props.selected ? CompassColor.white : CompassColor.black};\n font-weight: normal;\n height: 60px;\n white-space: normal;\n width: 100%;\n word-break: break-word;\n\n &:hover {\n background-color: ${(props) =>\n props.selected ? CompassColor.lagoon : CompassColor.sand02};\n border: 2px solid\n ${(props) => (props.selected ? CompassColor.lagoon : CompassColor.sand02)};\n }\n`;\n\nexport const MultipleChoiceOptions: React.FC = ({\n onClick,\n options,\n selectedItem,\n}) => (\n \n {options.map((option) => {\n const selected = option.id === selectedItem;\n\n return (\n onClick(option.id)}\n >\n {option.text}\n \n );\n })}\n \n);\n","import React from \"react\";\n\nimport { Button } from \"@noom/wax-component-library\";\n\nimport { MultipleChoiceOptions } from \"@/components/survey/multipleChoice\";\n\nimport { QuestionComponentProps, QuestionOption } from \"../../Question\";\n\nimport { BaseQuestion } from \"./BaseQuestion\";\n\ntype MultipleChoiceQuestionProps = Omit<\n QuestionComponentProps,\n \"surveyAnswers\"\n> & {\n confirmationElement?: React.ReactElement;\n ctaText?: string;\n options: QuestionOption[];\n questionDescription?: string;\n questionHelperText?: string;\n questionId: string;\n questionText: string;\n selectedItem: string;\n};\n\nexport const MultipleChoiceQuestion: React.FC = ({\n confirmationElement,\n ctaText,\n onClickBack,\n onClickNext,\n options,\n questionDescription,\n questionHelperText,\n questionId,\n questionText,\n selectedItem,\n}) => (\n \n \n onClickNext(optionId, undefined, undefined, \"option\")\n }\n />\n {confirmationElement}\n {ctaText && (\n \n onClickNext(selectedItem, undefined, undefined, \"button\")\n }\n size=\"xl\"\n >\n {ctaText}\n \n )}\n \n);\n","import React from \"react\";\n\nimport {\n Box,\n CompassColor,\n Heading,\n Image,\n Spacing,\n Stack,\n Text,\n} from \"@noom/wax-component-library\";\n\nexport type ItemDefinition = {\n text: string;\n image: string;\n alt?: string;\n};\n\ntype ComponentProps = {\n items: Array;\n headingText?: string;\n};\n\nexport const ImageBulletListCard: React.FC = ({\n items,\n headingText,\n}) => (\n \n \n {headingText && (\n \n {headingText}\n \n )}\n {items.map(({ image, text, alt }) => (\n \n {alt}\n {text}\n \n ))}\n \n \n);\n","import React, { useState } from \"react\";\nimport { isMobile } from \"react-device-detect\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { Button, Select, SelectOption } from \"@noom/wax-component-library\";\n\nimport { QuestionComponentProps, QuestionOption } from \"../../Question\";\n\nimport { BaseQuestion } from \"./BaseQuestion\";\n\ntype SelectQuestionProps = Pick<\n QuestionComponentProps,\n \"onClickBack\" | \"onClickNext\"\n> & {\n autoFocus?: boolean;\n initialValue?: string;\n options: QuestionOption[];\n placeholder?: string;\n questionDescription?: string;\n questionHelperText?: string;\n questionId: string;\n questionText: string;\n};\n\nexport const SelectQuestion: React.FC = ({\n autoFocus = true,\n initialValue,\n onClickBack,\n onClickNext,\n options,\n placeholder,\n questionDescription,\n questionHelperText,\n questionId,\n questionText,\n}) => {\n const [value, setValue] = useState(initialValue);\n const { t } = useTranslation();\n\n const selectOptions: SelectOption[] = options.map((option) => ({\n label: option.text,\n value: option.id,\n }));\n\n return (\n \n ) =>\n setValue(e.target.value)\n }\n value={value}\n // Chakra checks if placeholder is falsy, so use \" \" instead of \"\"\n placeholder={placeholder === \"\" ? \" \" : placeholder}\n // On mobile, auto focusing the select causes the dropdown to open immediately potentially covering content\n autoFocus={autoFocus && !isMobile}\n />\n value && onClickNext(value)}\n size=\"xl\"\n >\n {t(\"selectQuestion.ctaText\")}\n \n \n );\n};\n","import React, { ReactNode } from \"react\";\n\nimport {\n CompassColor,\n Image,\n useMediaQuery,\n} from \"@noom/wax-component-library\";\n\nimport { BaseInterstitial } from \"@/components/survey/questionTypes/core/BaseInterstitial\";\n\ntype InformationalScreenProps = {\n children: ReactNode;\n questionId: string;\n backgroundColor?: CompassColor;\n};\n\nexport const InformationalScreen: React.FC = ({\n children,\n questionId,\n backgroundColor,\n}) => {\n const [isBrowser] = useMediaQuery(\"(min-width: 1160px)\");\n\n return (\n null}\n onClickNext={() => Promise.resolve()}\n questionId={questionId}\n width={isBrowser ? \"600px\" : undefined}\n >\n \n {children}\n \n );\n};\n","import React from \"react\";\nimport { isMobile } from \"react-device-detect\";\nimport { Trans, useTranslation } from \"react-i18next\";\n\nimport {\n Button,\n List,\n ListItem,\n Spacing,\n Stack,\n} from \"@noom/wax-component-library\";\n\nimport {\n QuestionComponentProps,\n QuestionDefinition,\n} from \"@/components/survey/Question\";\nimport { NoomMedOverviewSelection } from \"@/constants\";\nimport { useAppContext } from \"@/contexts\";\n\nimport { BaseQuestion } from \"../core\";\n\nconst QUESTION_ID_DPP = \"confirmChangeProgramDpp\";\nconst QUESTION_ID_MED = \"confirmChangeProgramMed\";\n\ndeclare module \"@/contexts\" {\n interface SurveyAnswers {\n [QUESTION_ID_DPP]?: boolean;\n [QUESTION_ID_MED]?: boolean;\n }\n}\n\ntype ConfirmChangeProgramProps = QuestionComponentProps & {\n questionId: string;\n};\n\nconst ConfirmChangeProgram: React.FC = ({\n onClickBack,\n onClickNext,\n questionId,\n}) => {\n const { setSelectedProgram } = useAppContext();\n const { t } = useTranslation();\n\n const newProgram = questionId === QUESTION_ID_MED ? \"MED\" : \"DPP\";\n const programKey = newProgram.toLowerCase();\n\n const medValueProps = (\n \n \n {t(\"confirmChangeProgram.valueProp1\")}\n \n \n {t(\"confirmChangeProgram.valueProp2\")}\n \n \n );\n\n const imageProps = isMobile\n ? {\n headerImageSrc: `/assets/img/app-preview-${programKey}-mobile.svg`,\n }\n : {\n imageSrc: `/assets/img/app-preview-${programKey}-desktop.svg`,\n };\n\n const handleOptIn = (didOptIn: boolean) => {\n const updatedProgram = didOptIn ? newProgram : null;\n\n setSelectedProgram(updatedProgram);\n onClickNext(didOptIn, { updatedProgram });\n };\n\n return (\n \n \n \n \n {\n handleOptIn(true);\n }}\n size=\"xl\"\n type=\"submit\"\n >\n {t(`confirmChangeProgram.continue.${programKey}`)}\n \n {\n handleOptIn(false);\n }}\n size=\"xl\"\n variant=\"outline\"\n >\n {t(\"confirmChangeProgram.cancel\")}\n \n \n \n \n );\n};\n\nconst ConfirmChangeProgramDpp: React.FC = (props) => (\n \n);\n\nconst ConfirmChangeProgramMed: React.FC = (props) => (\n \n);\n\nexport const Q_CONFIRM_CHANGE_PROGRAM_DPP: QuestionDefinition = {\n id: QUESTION_ID_DPP,\n shouldShowQuestion: ({\n surveyAnswers: { dppEligible, confirmChangeProgramMed, medicareConsent },\n }) =>\n !(confirmChangeProgramMed === false || medicareConsent === \"disagree\") &&\n dppEligible === true,\n component: ConfirmChangeProgramDpp,\n};\n\nexport const Q_CONFIRM_CHANGE_PROGRAM_MED: QuestionDefinition = {\n id: QUESTION_ID_MED,\n shouldShowQuestion: ({\n retriageEligibility,\n selectedProgram,\n surveyAnswers: { noomMedOverview },\n }) =>\n noomMedOverview === NoomMedOverviewSelection.NEXT &&\n selectedProgram === \"MED\" &&\n retriageEligibility?.currentProgram === \"DPP\",\n component: ConfirmChangeProgramMed,\n};\n","import React from \"react\";\nimport { useTranslation } from \"react-i18next\";\n\nimport {\n Button,\n CompassColor,\n Link,\n Size,\n Spacing,\n Stack,\n} from \"@noom/wax-component-library\";\n\nimport {\n QuestionComponentProps,\n QuestionDefinition,\n} from \"@/components/survey/Question\";\n\nimport { BaseQuestion, ImageBulletListCard } from \"../core\";\n\nconst QUESTION_ID = \"dppInformation\";\n\ndeclare module \"@/contexts\" {\n interface SurveyAnswers {\n wasOfferedDpp?: boolean;\n }\n}\n\nconst DppInformation: React.FC = ({ onClickNext }) => {\n const { t } = useTranslation();\n const bulletListItems = [\n {\n image: \"/assets/img/dppInformation-icon-graph.svg\",\n text: t(\"dppInformation.listItems.0\"),\n },\n {\n image: \"/assets/img/dppInformation-icon-party.svg\",\n text: t(\"dppInformation.listItems.1\"),\n },\n {\n image: \"/assets/img/dppInformation-icon-mountain.svg\",\n text: t(\"dppInformation.listItems.2\"),\n },\n ];\n const footer = (\n <>\n *\n \n {t(\"dppInformation.studyLinkText\", \"See published study\")}\n \n \n );\n return (\n undefined}\n questionId={QUESTION_ID}\n questionText={t(\"dppInformation.questionText\")}\n >\n \n \n {\n onClickNext(null, { wasOfferedDpp: true });\n }}\n size=\"xl\"\n type=\"submit\"\n >\n Next\n \n \n \n );\n};\n\nexport const Q_DPP_INFORMATION: QuestionDefinition = {\n id: QUESTION_ID,\n shouldShowQuestion: ({\n surveyAnswers: { dppEligible, confirmChangeProgramMed, medicareConsent },\n }) =>\n !(confirmChangeProgramMed === false || medicareConsent === \"disagree\") &&\n dppEligible === true,\n component: DppInformation,\n};\n","import { useField } from \"formik\";\nimport i18next from \"i18next\";\nimport React from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport * as Yup from \"yup\";\n\nimport { Input, InputProps } from \"@noom/wax-component-library\";\n\nimport { MAX_AGE, MIN_AGE } from \"@/constants\";\n\nexport const AgeInputValidationSchema = Yup.object({\n age: Yup.number()\n .nullable(true)\n .transform((value) => (Number.isNaN(value) ? null : value))\n .required(() => i18next.t(\"form.age.errors.required\"))\n .positive(() => i18next.t(\"form.age.errors.invalid\"))\n .min(MIN_AGE, () => i18next.t(\"form.age.errors.tooYoung\"))\n .max(MAX_AGE, () => i18next.t(\"form.age.errors.invalid\")),\n});\n\ntype AgeInputProps = InputProps & {\n name: string;\n};\n\nexport const AgeInput: React.FC = ({ name, ...rest }) => {\n const [field, { touched, error }] = useField({ name });\n const { t } = useTranslation();\n\n return (\n \n );\n};\n","import { CompassColor } from \"@noom/wax-component-library\";\n\nexport const defaultFieldStyles = {\n borderColor: CompassColor.grey2,\n borderRadius: \"8px\",\n height: \"62px\",\n maxWidth: \"400px\",\n width: \"100%\",\n _focus: {\n borderColor: CompassColor.lagoon,\n boxShadow: \"none\",\n },\n _hover: {\n borderColor: CompassColor.lagoon,\n },\n};\n","import {\n FormControl,\n FormErrorMessage,\n FormHelperText,\n FormLabel,\n} from \"@chakra-ui/react\";\nimport styled from \"@emotion/styled\";\nimport {\n createTheme,\n TextField,\n TextFieldProps,\n ThemeProvider,\n} from \"@mui/material\";\nimport { DesktopDatePicker, LocalizationProvider } from \"@mui/x-date-pickers\";\nimport { AdapterDateFns } from \"@mui/x-date-pickers/AdapterDateFns\";\nimport { differenceInYears, isFuture, isValid as isValidDate } from \"date-fns\";\nimport { useField, useFormikContext } from \"formik\";\nimport i18next from \"i18next\";\nimport React from \"react\";\nimport * as Yup from \"yup\";\n\nimport { CompassColor, InputProps, Spacing } from \"@noom/wax-component-library\";\n\nimport { defaultFieldStyles } from \"@/app/themes/reskin/defaultFieldStyles\";\nimport { DOB_FORMAT } from \"@/constants\";\nimport { MAX_AGE, MIN_AGE } from \"@/constants/enrollment\";\n\ntype DateInputProps = InputProps & {\n name: string;\n};\n\nexport const DOBSchema = Yup.object({\n /**\n * Date validation in this form is complex because of the nature of the\n * custom date input field.\n *\n * The date input component (through @mui/x-date-pickers) parses the input\n * value as a Date, but since users can type in the input, partial input\n * would be treated as an invalid date (e.g. \"12/\", \"12/31/\", 12/3). Thus\n * we need to handle all input scenarios and validate them accordingly.\n *\n * 1) An empty date gets returned as null, and not the empty string \"\".\n * This will be handled by the .required() check.\n * 2) Partial dates will be returned in a couple different ways.\n * a) Anything without a year (e.g. \"12/\", \"12/31\") will be returned as\n * an \"Invalid Date\", but as a Date object, not a string.\n * b) Anything with a partial year (e.g. 12/31/20, 12/31/1) could be\n * parsed. The Date constructor treats 12/31/1 as\n * \"Mon Dec 31 0001 00:00:00\" which is a valid date, but we don't\n * want to accept these dates.\n * 3) A valid date will be returned as is. It will be run through the two\n * tests, the first to make sure the user is less than 110 years old and\n * the second to make sure the user is at least 18 years old.\n *\n * The .transform in the beginning is necessary because passing the\n * \"Invalid Date\" object will throw a yup() validation error that we can't\n * modify. If we encounter an invalid date we will just pass \"0001-01-01\"\n * as a value, because it will be caught by the first date test to make\n * sure it is less than 110 years old.\n */\n dob: Yup.date()\n .transform((_, originalValue) => {\n // Pass null along to be caught by the .required() check.\n if (!originalValue) {\n return originalValue;\n }\n\n // If the date isn't valid, purposely pass \"0001-01-01\" as a Date.\n return isValidDate(originalValue)\n ? originalValue\n : new Date(\"0001-01-01\");\n })\n .nullable()\n .required(() => i18next.t(\"form.dob.errors.required\"))\n .test({\n message: () => i18next.t(\"form.dob.errors.invalid\"),\n name: \"is-valid-date\",\n test: (date?: Date | null) => {\n if (\n !date ||\n // 110 is the max age that can be passed to account creation\n differenceInYears(new Date(), date) > MAX_AGE ||\n isFuture(date)\n ) {\n return false;\n }\n return true;\n },\n })\n .test({\n message: () => i18next.t(\"form.dob.errors.tooYoung\"),\n name: \"is-at-least-18\",\n test: (date?: Date | null) =>\n // !date is just to satisfy the type definition - if it passes the\n // first date test it will be a valid date\n !!date && differenceInYears(new Date(), date) >= MIN_AGE,\n }),\n});\n\nconst StyledTextField = styled(TextField)(({ error }) => ({\n \"& .MuiOutlinedInput-root\": {\n ...defaultFieldStyles,\n fontFamily: \"Untitled Sans\",\n fontSize: \"18px\",\n padding: \"0 var(--spacing-m)\",\n\n \"& fieldset\": {\n borderColor: error ? CompassColor.cinnamon : CompassColor.grey2,\n boxShadow: error ? `0 0 0 1px ${CompassColor.cinnamon}` : \"none\",\n transitionDuration: \"var(--chakra-transition-duration-normal)\",\n },\n\n \"& input\": {\n padding: 0,\n },\n\n \"&:hover fieldset\": {\n borderColor: error ? CompassColor.cinnamon : CompassColor.lagoon,\n },\n\n \"&.Mui-focused fieldset\": {\n borderColor: CompassColor.lagoon,\n borderWidth: \"1px\",\n boxShadow: \"none\",\n },\n },\n}));\n\nexport const DateInput: React.FC = ({\n isReadOnly,\n error,\n helper,\n label,\n name,\n placeholder,\n}) => {\n const [field] = useField({ name });\n const { setFieldValue, submitCount } = useFormikContext();\n\n const isInvalid = typeof error === \"string\";\n\n return (\n \n {label && {label}}\n {/**\n * This component is to prevent a runtime error when\n * trying to access a theme property from a bug in the\n * @mui/x-date-pickers library.\n */}\n \n \n \n // Hacky solution to only validate all fields after form\n // submission. If shouldValidate is just always set to true,\n // other fields would be validated here if they've been touched\n // previously - we want to delay this to after submission.\n setFieldValue(field.name, value, submitCount > 0)\n }\n readOnly={isReadOnly}\n renderInput={(params: TextFieldProps) => (\n \n )}\n value={field.value}\n />\n \n \n {helper && !error && {helper}}\n {isInvalid && (\n \n {error}\n \n )}\n \n );\n};\n","import React, { forwardRef, useRef } from \"react\";\n\nimport { Box, Input, InputProps, Text } from \"@noom/wax-component-library\";\n\ntype InputWithSuffixProps = InputProps & {\n suffix: string | React.ReactNode;\n};\n\n// This is a temp component because the current Input component in WAX\n// does not adjust the suffix with height adjustments.\nexport const InputWithSuffix = forwardRef(\n (\n { maxWidth, suffix, ...props }: InputWithSuffixProps,\n ref: React.ForwardedRef,\n ) => {\n const inputRef = useRef();\n return (\n \n {\n if (ref as any) (ref as any).current = el;\n if (inputRef) inputRef.current = el;\n }}\n textAlign=\"center\"\n {...props}\n />\n inputRef.current?.focus()}\n >\n {suffix}\n \n \n );\n },\n);\n","import { useField } from \"formik\";\nimport i18next from \"i18next\";\nimport React, { lazy, Suspense, useState } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport * as Yup from \"yup\";\n\nimport {\n Box,\n CompassColor,\n Image,\n Input,\n InputProps,\n Spacing,\n Stack,\n} from \"@noom/wax-component-library\";\n\nconst PasswordStrengthBar = lazy(() => import(\"react-password-strength-bar\"));\n\nconst PASSWORD_MIN_LENGTH = 8;\nconst PASSWORD_MAX_LENGTH = 50;\nconst PASSWORD_MIN_SCORE = 3;\n\nlet passwordScore = 0;\nconst getPasswordScore = () => passwordScore;\n\nexport const PasswordInputWithoutStrengthValidationSchema = Yup.object({\n password: Yup.string()\n .min(PASSWORD_MIN_LENGTH, () => i18next.t(\"form.password.errors.length\"))\n .max(PASSWORD_MAX_LENGTH, () => i18next.t(\"form.password.errors.length\"))\n .required(() => i18next.t(\"form.password.errors.required\")),\n});\n\nexport const PasswordInputValidationSchema = Yup.object({\n password: Yup.string()\n .min(PASSWORD_MIN_LENGTH, () => i18next.t(\"form.password.errors.length\"))\n .max(PASSWORD_MAX_LENGTH, () => i18next.t(\"form.password.errors.length\"))\n .required(() => i18next.t(\"form.password.errors.required\"))\n .test({\n message: () => i18next.t(\"form.password.errors.notStrong\"),\n name: \"is-password-strong\",\n test: () => getPasswordScore() >= PASSWORD_MIN_SCORE,\n }),\n});\n\ntype PasswordInputProps = InputProps & {\n name: string;\n onChange: React.ChangeEventHandler;\n showPasswordStrengthBar?: boolean;\n userInputs: string[];\n};\n\nexport const PasswordInput: React.FC = ({\n name,\n onChange,\n showPasswordStrengthBar = true,\n userInputs,\n}) => {\n const [field, { touched, error }] = useField({ name });\n const [showPassword, setShowPassword] = useState(false);\n const { t } = useTranslation();\n\n const togglePasswordVisibility = () => {\n setShowPassword((prevValue) => !prevValue);\n };\n\n const imgVisibilityOnPath = \"/assets/img/visibility.svg\";\n const imgVisibilityOffPath = \"/assets/img/visibility_off.svg\";\n // Preload the visibility off image so it's loaded when visibility is toggled\n const imgVisibilityOff = new window.Image();\n imgVisibilityOff.src = imgVisibilityOffPath;\n\n return (\n \n \n }\n type={showPassword ? \"text\" : \"password\"}\n />\n {/* The fallback is just a div of height 12px, the height of the strength bar */}\n {showPasswordStrengthBar && (\n }>\n {\n passwordScore = score;\n }}\n password={field.value}\n scoreWords={[\n t(\"form.password.scoreWords.weak\"),\n t(\"form.password.scoreWords.weak\"),\n t(\"form.password.scoreWords.okay\"),\n t(\"form.password.scoreWords.strong\"),\n t(\"form.password.scoreWords.veryStrong\"),\n ]}\n shortScoreWord={\n field.value.length ? t(\"form.password.shortScoreWord\") : \"\"\n }\n userInputs={userInputs}\n />\n \n )}\n \n );\n};\n","import {\n FormControl,\n FormErrorMessage,\n FormHelperText,\n FormLabel,\n} from \"@chakra-ui/react\";\nimport styled from \"@emotion/styled\";\nimport { useField, useFormikContext } from \"formik\";\nimport libphonenumber from \"google-libphonenumber\";\nimport i18next from \"i18next\";\nimport React from \"react\";\nimport ReactPhoneInput from \"react-phone-input-2\";\nimport * as Yup from \"yup\";\n\nimport {\n Box,\n CompassColor,\n InputProps,\n Spacing,\n} from \"@noom/wax-component-library\";\n\nimport { defaultFieldStyles } from \"@/app/themes/reskin/defaultFieldStyles\";\n\nimport \"react-phone-input-2/lib/style.css\";\n\ntype PhoneInputProps = InputProps & {\n focusPhoneNumber?: boolean;\n name: string;\n};\n\nexport type PhoneNumber = {\n value: string;\n country: string;\n dialCode: string;\n};\n\nconst StyledCountryInput = styled(ReactPhoneInput)(({ isInvalid }) => ({\n flex: 1,\n\n \".flag-dropdown\": {\n backgroundColor: CompassColor.offWhite,\n border: \"none\",\n borderRadius: \"8px 0 0 8px\",\n fontFamily: \"Untitled Sans\",\n margin: \"1px\",\n\n \"&.open\": {\n borderRadius: \"8px 0 0 8px\",\n \".selected-flag\": {\n borderRadius: \"8px 0 0 8px\",\n },\n },\n },\n \".selected-flag\": {\n borderRadius: \"8px 0 0 8px\",\n\n \"&:hover\": {\n backgroundColor: CompassColor.sand01,\n },\n },\n \"input.form-control\": {\n ...defaultFieldStyles,\n borderColor: isInvalid ? CompassColor.cinnamon : CompassColor.grey2,\n boxShadow: isInvalid ? `0 0 0 1px ${CompassColor.cinnamon}` : \"none\",\n fontFamily: \"Untitled Sans\",\n fontSize: \"18px\",\n transitionDuration: \"var(--chakra-transition-duration-normal)\",\n\n \":hover\": {\n borderColor: isInvalid ? CompassColor.cinnamon : CompassColor.lagoon,\n },\n\n \":focus\": {\n borderColor: CompassColor.lagoon,\n boxShadow: \"none\",\n },\n },\n}));\n\nconst StyledPhoneInput = styled(StyledCountryInput)({\n flex: 2,\n\n \".flag-dropdown\": {\n display: \"none\",\n },\n \"input.form-control\": {\n paddingLeft: \"var(--spacing-m)\",\n },\n});\n\nconst isValidPhoneNumber = ({ country, value, dialCode }: PhoneNumber) => {\n if (!value) {\n return false;\n }\n\n const phoneNumberUtil = libphonenumber.PhoneNumberUtil.getInstance();\n\n try {\n const number = `+${dialCode}${value}`;\n const phoneNumber = phoneNumberUtil.parse(number, country);\n\n if (!phoneNumber) {\n return false;\n }\n\n return phoneNumberUtil.isValidNumber(phoneNumber);\n } catch (e) {\n return false;\n }\n};\n\nexport const PhoneInputSchema = Yup.mixed()\n .required(() => i18next.t(\"form.phoneNumber.errors.required\"))\n .test({\n message: () => i18next.t(\"form.phoneNumber.errors.invalid\"),\n name: \"is-valid-phone-number\",\n test: isValidPhoneNumber,\n });\n\nexport const PhoneInput: React.FC = ({\n focusPhoneNumber,\n helper,\n label,\n name,\n placeholder,\n}) => {\n const [field, meta, helpers] = useField({ name });\n const { validateField } = useFormikContext();\n\n const error = meta.touched && meta.error;\n\n const handleInputChange = async (value: PhoneNumber) => {\n // This is a hacky method to get each field to validate on change\n // individually.\n await helpers.setValue(value);\n validateField(name);\n };\n\n return (\n \n {label && {label}}\n \n attribute\n // workaround: use `autoComplete: `\n // https://stackoverflow.com/questions/12374442/chrome-ignores-autocomplete-off?page=1&tab=scoredesc#tab-top\n autoComplete: \"none\",\n \"aria-label\": \"country code\",\n id: `${name}Country`,\n name,\n tabIndex: -1,\n }}\n isInvalid={!!error}\n onBlur={() => helpers.setTouched(true)}\n onChange={(dialCode: string, country: { countryCode: string }) => {\n handleInputChange({\n ...field.value,\n country: country.countryCode,\n dialCode,\n });\n }}\n placeholder=\"+1\"\n value={field.value.dialCode}\n />\n helpers.setTouched(true)}\n onChange={(value: string) => {\n handleInputChange({ ...field.value, value });\n }}\n placeholder={placeholder}\n showDropdown={false}\n value={field.value.value}\n />\n \n {helper && !error && {helper}}\n {typeof error === \"string\" && (\n \n {error}\n \n )}\n \n );\n};\n","import i18next from \"i18next\";\nimport React from \"react\";\n\nimport { Select } from \"@noom/wax-component-library\";\n\nimport {\n NOOM_SUPPORTED_ENGLISH_LOCALES,\n NOOM_SUPPORTED_LANGUAGES,\n} from \"@/constants\";\n\ntype DropdownOption = {\n label: string;\n value: string;\n};\n\ntype PreferredLanguageSelectorProps = {\n helper?: string;\n label?: string;\n name?: string;\n supportedLocales: string[];\n onBlur?: React.FocusEventHandler;\n onChange?: React.ChangeEventHandler;\n};\n\nexport const getDefaultLanguageValue = (): string => {\n const browserLanguages = window.navigator.languages;\n\n for (let i = 0; i < browserLanguages.length; i += 1) {\n const browserLanguage = browserLanguages[i];\n if (NOOM_SUPPORTED_LANGUAGES.includes(browserLanguage)) {\n return browserLanguage;\n }\n\n if (NOOM_SUPPORTED_LANGUAGES.includes(browserLanguage.slice(0, 2))) {\n return browserLanguage.slice(0, 2);\n }\n }\n\n return \"en\";\n};\n\nexport const getAllLanguageOptions = (): DropdownOption[] => {\n const supportedLocalizedEnglishVersion =\n window.navigator.languages.find((browserLanguage) =>\n NOOM_SUPPORTED_ENGLISH_LOCALES.includes(browserLanguage),\n ) || \"en\";\n\n return [\n {\n label: i18next.t(\"form.preferredLanguageSelector.options.english\"),\n value: supportedLocalizedEnglishVersion,\n },\n {\n label: i18next.t(\"form.preferredLanguageSelector.options.spanish\"),\n value: \"es\",\n },\n {\n label: i18next.t(\"form.preferredLanguageSelector.options.german\"),\n value: \"de\",\n },\n {\n label: i18next.t(\"form.preferredLanguageSelector.options.korean\"),\n value: \"ko\",\n },\n ];\n};\n\nexport const PreferredLanguageSelector: React.FC<\n PreferredLanguageSelectorProps\n> = ({ supportedLocales, ...rest }) => {\n const languageOptions: DropdownOption[] = getAllLanguageOptions().filter(\n ({ value }) =>\n supportedLocales.find((language) => language === value.slice(0, 2)) ||\n false,\n );\n\n return (\n \n {languageOptions.map(({ label, value }: DropdownOption) => (\n \n ))}\n \n );\n};\n","import { Formik } from \"formik\";\nimport { TFunction } from \"i18next\";\nimport React, { useEffect } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport * as Yup from \"yup\";\n\nimport { Button, Input, Spacing, Stack } from \"@noom/wax-component-library\";\n\nimport {\n AgeInput,\n AgeInputValidationSchema,\n DateInput,\n DOBSchema,\n} from \"@/components/form\";\nimport { useAppContext } from \"@/contexts\";\nimport { useQueryParams, useTrackEvent } from \"@/hooks\";\n\nexport type EligibilityCheckFormValues = {\n age?: number;\n dob: Date | null;\n employeeId?: string;\n firstName: string;\n lastName: string;\n isMedEligible?: boolean;\n policyId?: string;\n};\n\nexport const defaultEligibilityCheckFormValues: EligibilityCheckFormValues = {\n age: undefined,\n dob: null,\n employeeId: \"\",\n firstName: \"\",\n lastName: \"\",\n isMedEligible: false,\n policyId: \"\",\n};\n\nconst getValidationSchema = (\n t: TFunction,\n showDobField: boolean,\n showEmployeeIdField: boolean,\n isUhcPartner: boolean,\n) => {\n const MAX_LENGTH = 150;\n const baseSchema = Yup.object().shape({\n firstName: Yup.string()\n .max(\n MAX_LENGTH,\n t(\"form.errors.maxLength\", {\n label: t(\"form.firstName.label\"),\n maxLength: MAX_LENGTH,\n }),\n )\n .required(t(\"form.firstName.errors.required\")),\n lastName: Yup.string()\n .max(\n MAX_LENGTH,\n t(\"form.errors.maxLength\", {\n label: t(\"form.lastName.label\"),\n maxLength: MAX_LENGTH,\n }),\n )\n .required(t(\"form.lastName.errors.required\")),\n });\n\n const employeeIdSchema = Yup.object({\n employeeId: Yup.string()\n .max(\n MAX_LENGTH,\n t(\"form.errors.maxLength\", {\n label: t(\"form.employeeId.label\"),\n maxLength: MAX_LENGTH,\n }),\n )\n .required(\n t(\"form.employeeId.errors.required\", {\n context: isUhcPartner ? \"member\" : \"\",\n }),\n ),\n });\n\n let validationSchema = baseSchema;\n\n const ageSchema = showDobField ? DOBSchema : AgeInputValidationSchema;\n validationSchema = validationSchema.concat(ageSchema);\n\n if (showEmployeeIdField) {\n validationSchema = validationSchema.concat(employeeIdSchema);\n }\n\n if (isUhcPartner) {\n const policyIdSchema = Yup.object({\n policyId: Yup.string()\n .max(\n MAX_LENGTH,\n t(\"form.errors.maxLength\", {\n label: t(\"form.policyId.label\"),\n maxLength: MAX_LENGTH,\n }),\n )\n .required(t(\"form.policyId.errors.required\")),\n });\n\n validationSchema = validationSchema.concat(policyIdSchema);\n }\n\n return validationSchema;\n};\n\nexport const EligibilityCheckForm: React.FC<{\n initialValues: EligibilityCheckFormValues;\n isLoading?: boolean;\n onSubmit: (values: EligibilityCheckFormValues) => void;\n pageId: string;\n setInitialValues: React.Dispatch;\n}> = ({\n initialValues,\n isLoading,\n pageId,\n setInitialValues,\n onSubmit: onParentSubmit,\n}) => {\n const { enrollmentType, partnerInfo } = useAppContext();\n const queryParams = useQueryParams();\n const { trackIdentifiedPageViewed } = useTrackEvent();\n const { i18n, t } = useTranslation();\n\n const { configs, slug } = partnerInfo || {};\n const { eligibilityId } = queryParams;\n\n const isUhcPartner =\n configs?.UPFRONT_ELIGIBILITY_ENFORCEMENT === \"UHC_OPTUM_BIG_FIVE\";\n\n const ctaText =\n configs?.UPFRONT_ELIGIBILITY_ENFORCEMENT === \"NONE\" ||\n enrollmentType === \"RETRIAGE\"\n ? t(\"eligibilityCheck.ctaText.next\")\n : t(\"eligibilityCheck.ctaText.checkEligibility\");\n const showDobField =\n configs?.UPFRONT_ELIGIBILITY_ENFORCEMENT === \"FULL_NAME_DOB\" ||\n configs?.UPFRONT_ELIGIBILITY_ENFORCEMENT === \"LN_DOB\" ||\n configs?.REQUIRES_DOB ||\n false;\n const showEmployeeIdField =\n configs?.UPFRONT_ELIGIBILITY_ENFORCEMENT === \"PARTICIPANT_ID\" ||\n configs?.UPFRONT_ELIGIBILITY_ENFORCEMENT === \"PARTICIPANT_ID_LAST_NAME\" ||\n configs?.UPFRONT_ELIGIBILITY_ENFORCEMENT === \"PARTICIPANT_ID_FULL_NAME\" ||\n isUhcPartner;\n\n const onSubmit = async (values: EligibilityCheckFormValues) => {\n const trimmedValues: EligibilityCheckFormValues = {\n ...values,\n firstName: values.firstName.trim(),\n lastName: values.lastName.trim(),\n };\n\n // Store the values in local React state so that they persist when clicking\n // back on the eligibility error state\n setInitialValues(trimmedValues);\n onParentSubmit(trimmedValues);\n };\n\n useEffect(() => {\n trackIdentifiedPageViewed(pageId);\n }, []);\n\n return (\n \n {({\n errors,\n getFieldProps,\n handleChange,\n handleSubmit,\n isSubmitting,\n touched,\n validateField,\n }) => {\n const handleInputChange = async (\n e: React.ChangeEvent,\n fieldName: keyof EligibilityCheckFormValues,\n ) => {\n // This is a hacky method to get each field to validate on change\n // individually.\n await handleChange(e);\n validateField(fieldName);\n };\n\n return (\n
\n \n handleInputChange(e, \"firstName\")}\n placeholder={t(\"form.firstName.placeholder\")}\n isReadOnly={Boolean(\n initialValues.firstName &&\n eligibilityId &&\n configs?.UPFRONT_ELIGIBILITY_ENFORCEMENT ===\n \"FULL_NAME_DOB\",\n )}\n />\n handleInputChange(e, \"lastName\")}\n placeholder={t(\"form.lastName.placeholder\")}\n isReadOnly={Boolean(\n initialValues.lastName &&\n eligibilityId &&\n (configs?.UPFRONT_ELIGIBILITY_ENFORCEMENT ===\n \"FULL_NAME_DOB\" ||\n configs?.UPFRONT_ELIGIBILITY_ENFORCEMENT === \"LN_DOB\"),\n )}\n />\n {showDobField ? (\n validateField(\"dob\")}\n placeholder={t(\"form.dob.placeholder\")}\n isReadOnly={Boolean(\n initialValues.dob &&\n eligibilityId &&\n (configs?.UPFRONT_ELIGIBILITY_ENFORCEMENT ===\n \"FULL_NAME_DOB\" ||\n configs?.UPFRONT_ELIGIBILITY_ENFORCEMENT === \"LN_DOB\"),\n )}\n />\n ) : (\n handleInputChange(e, \"age\")}\n />\n )}\n {showEmployeeIdField && (\n handleInputChange(e, \"employeeId\")}\n placeholder={t(\"form.employeeId.placeholder\", {\n context: isUhcPartner ? \"member\" : \"\",\n })}\n isReadOnly={Boolean(\n initialValues.employeeId &&\n eligibilityId &&\n (configs?.UPFRONT_ELIGIBILITY_ENFORCEMENT ===\n \"PARTICIPANT_ID\" ||\n configs?.UPFRONT_ELIGIBILITY_ENFORCEMENT ===\n \"PARTICIPANT_ID_LAST_NAME\" ||\n configs?.UPFRONT_ELIGIBILITY_ENFORCEMENT ===\n \"PARTICIPANT_ID_FULL_NAME\" ||\n configs?.UPFRONT_ELIGIBILITY_ENFORCEMENT ===\n \"UHC_OPTUM_BIG_FIVE\"),\n )}\n />\n )}\n {isUhcPartner && (\n handleInputChange(e, \"policyId\")}\n placeholder={t(\"form.policyId.placeholder\")}\n />\n )}\n \n {ctaText}\n \n \n
\n );\n }}\n \n );\n};\n","import { format } from \"date-fns\";\nimport React, { useEffect, useState } from \"react\";\nimport { Trans, useTranslation } from \"react-i18next\";\n\nimport {\n Box,\n Button,\n CompassColor,\n Image,\n Loader,\n useMediaQuery,\n} from \"@noom/wax-component-library\";\n\nimport {\n defaultEligibilityCheckFormValues,\n EligibilityCheckForm,\n EligibilityCheckFormValues,\n} from \"@/components/forms/EligibilityCheckForm\";\nimport {\n QuestionComponentProps,\n QuestionDefinition,\n} from \"@/components/survey/Question\";\nimport { DOB_FORMAT, RetriageFinishedStatus } from \"@/constants\";\nimport { useAppContext } from \"@/contexts\";\nimport {\n useGoto,\n useQueryParams,\n useRetriageEligibility,\n useTrackEvent,\n} from \"@/hooks\";\nimport { getAutologinData } from \"@/utils/cookies\";\nimport { getEligibilityCheckFormValues } from \"@/utils/eligibility\";\nimport { withPiiQueryParams } from \"@/utils/pixels/urlParamsPii\";\n\nimport { BaseInterstitial, BaseOutline, BaseQuestion } from \"../core\";\n\nconst QUESTION_ID = \"retriageEligibilityCheck\";\n\ndeclare module \"@/contexts\" {\n interface SurveyAnswers {\n retriageEligibilityCheck?: EligibilityCheckFormValues;\n }\n}\n\nconst RetriageEligibilityCheckQuestion: React.FC = ({\n onClickBack,\n onClickNext,\n surveyAnswers,\n}) => {\n const { partnerInfo, retriageEligibility } = useAppContext();\n const { retriageFinished } = useGoto();\n const [isBrowser] = useMediaQuery(\"(min-width: 1160px)\");\n const partnerId = partnerInfo?.id;\n const {\n resetRetriageEligibility,\n verificationProperties,\n setVerificationProperties,\n isLoadingRetriageEligibility,\n checkingAutologinData,\n } = useRetriageEligibility(partnerId);\n const queryParams = useQueryParams();\n const { trackAnonEvent } = useTrackEvent();\n const [initialValues, setInitialValues] = useState(\n surveyAnswers[QUESTION_ID] || defaultEligibilityCheckFormValues,\n );\n const { t } = useTranslation();\n\n const autologindata = getAutologinData();\n\n const onSubmit = async (values: EligibilityCheckFormValues) => {\n if (isLoadingRetriageEligibility || !partnerId) {\n return;\n }\n setVerificationProperties({\n dateOfBirth: values?.dob\n ? format(values.dob as Date, DOB_FORMAT)\n : undefined,\n firstName: values.firstName,\n lastName: values.lastName,\n participantId: values?.employeeId,\n });\n };\n\n useEffect(() => {\n if (!retriageEligibility) {\n return;\n }\n\n const { currentProgram, eligibilityReason } = retriageEligibility;\n\n const isEligible = eligibilityReason === \"ELIGIBLE\";\n\n trackAnonEvent(\"b2bEnrollmentAnonEligibilityChecked\", {\n eligibleForEnrollment: isEligible,\n eligibilityStatus: eligibilityReason,\n currentProgram: currentProgram || \"PROGRAM_UNSPECIFIED\",\n });\n\n if (currentProgram === \"MED\") {\n retriageFinished(RetriageFinishedStatus.ALREADY_MED);\n return;\n }\n\n if (eligibilityReason === \"RECENTLY_RETRIAGED\") {\n retriageFinished(RetriageFinishedStatus.RECENTLY_RETRIAGED);\n return;\n }\n\n if (isEligible) {\n // save form values in case user comes back\n onClickNext(\n getEligibilityCheckFormValues(retriageEligibility) || initialValues,\n );\n }\n // (osman): adding a dependency on trackAnonEvent() here is causing the effect\n // to run on every render. Perhaps trackAnonEvent needs to be cached with useMemo\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [retriageEligibility]);\n\n useEffect(() => {\n // if we have autlogindata, do not reset the eligibliity\n // data, as it was automatically loaded from autologin data\n if (retriageEligibility && !autologindata) {\n resetRetriageEligibility();\n }\n const queryParamsWithPii = withPiiQueryParams(queryParams);\n trackAnonEvent(\"b2bEnrollmentAnonTriageFlowStarted\", {\n leadSource: queryParamsWithPii.leadSource,\n utmSource: queryParamsWithPii.utm_source,\n utmMedium: queryParamsWithPii.utm_medium,\n utmCampaign: queryParamsWithPii.utm_campaign,\n utmTerm: queryParamsWithPii.utm_term,\n utmContent: queryParamsWithPii.utm_content,\n });\n }, []);\n\n if (\n retriageEligibility &&\n retriageEligibility.eligibilityReason !== \"ELIGIBLE\" &&\n // if we don't have verificationProperties, we verified using the autologin cookie set by the mobile app\n // and shouldn't show this error messaging\n verificationProperties\n ) {\n return (\n null}\n onClickNext={() => Promise.resolve()}\n questionId={QUESTION_ID}\n width={isBrowser ? \"600px\" : undefined}\n >\n \n \n We can’t find an account matching that information.\n
\n
\n Please try again. If you still have trouble, contact\n partnersupport@noom.com with your name and the email address\n associated with your account.\n
\n \n \n {t(\"retriageEligibilityCheck.ctaText\")}\n \n \n \n );\n }\n\n if (checkingAutologinData) {\n return (\n \n \n \n \n \n );\n }\n return (\n \n \n \n );\n};\n\nexport const Q_RETRIAGE_ELIGIBILITY_CHECK: QuestionDefinition = {\n id: QUESTION_ID,\n shouldShowQuestion: () => true,\n component: RetriageEligibilityCheckQuestion,\n};\n","import React, { useEffect } from \"react\";\nimport { isMobile } from \"react-device-detect\";\nimport { Trans } from \"react-i18next\";\n\nimport { Api } from \"@noom/noomscape\";\nimport {\n Box,\n Button,\n Heading,\n Spacing,\n Stack,\n} from \"@noom/wax-component-library\";\n\nimport type {\n QuestionComponentProps,\n QuestionDefinition,\n} from \"@/components/survey/Question\";\nimport { InformationalScreen } from \"@/components/survey/questionTypes/core\";\nimport { useAppContext } from \"@/contexts\";\nimport { useTrackEvent, useUpdateLastTriageTimestamp } from \"@/hooks\";\n\n// This question is only reachable via direct navigation. Use caution when updating this ID.\nconst QUESTION_ID = \"ineligible\";\n\nexport const RetriageExclusion: React.FC = ({\n onClickNext,\n}) => {\n const {\n retriageEligibility: {\n accessCode,\n currentProgram,\n eligibleRetriagePrograms = [],\n } = {},\n screenedOutReason,\n } = useAppContext();\n const { trackAnonEvent } = useTrackEvent();\n const { updateLastTriageTimestamp } = useUpdateLastTriageTimestamp();\n\n const bodyContext = currentProgram === \"WEIGHT\" ? \"weight\" : \"dpp\";\n\n const canRetriageIntoDpp = eligibleRetriagePrograms.includes(\"DPP\");\n const canRetriageIntoMed = eligibleRetriagePrograms.includes(\"MED\");\n\n let eligibilityTextContext;\n if (canRetriageIntoDpp && canRetriageIntoMed) {\n eligibilityTextContext = \"can_retriage_dpp_and_med\";\n } else if (canRetriageIntoDpp) {\n eligibilityTextContext = \"can_retriage_dpp\";\n } else if (canRetriageIntoMed) {\n eligibilityTextContext = \"can_retriage_med\";\n }\n\n useEffect(() => {\n if (!accessCode) {\n return;\n }\n updateLastTriageTimestamp(accessCode, \"KEPT_SAME_OFFERING\");\n Api.call(\"dpp.alertUserCoach\", Api.api.dpp.alertUserCoach, {\n accessCode,\n });\n }, [accessCode]);\n\n useEffect(() => {\n if (!screenedOutReason) {\n return;\n }\n\n trackAnonEvent(\"b2bEnrollmentAnonUserExcluded\", {\n exclusionReason: screenedOutReason,\n });\n }, [screenedOutReason]);\n\n return (\n \n \n \n \n \n {currentProgram === \"WEIGHT\" && (\n \n )}\n \n {isMobile && (\n \n onClickNext(null)}\n size=\"xl\"\n whiteSpace=\"unset\"\n >\n Return to app\n \n \n )}\n \n \n );\n};\n\nexport const Q_RETRIAGE_EXCLUSION: QuestionDefinition = {\n id: QUESTION_ID,\n shouldShowQuestion: () => false,\n component: RetriageExclusion,\n};\n","import React, { useEffect } from \"react\";\nimport { isMobile } from \"react-device-detect\";\nimport { Trans } from \"react-i18next\";\n\nimport {\n Box,\n Button,\n Heading,\n Link,\n Spacing,\n Stack,\n} from \"@noom/wax-component-library\";\n\nimport { InformationalScreen } from \"@/components/survey/questionTypes/core\";\nimport { RetriageFinishedStatus } from \"@/constants\";\nimport { useAppContext } from \"@/contexts\";\nimport { useGoto, useTrackEvent, useUpdateLastTriageTimestamp } from \"@/hooks\";\nimport { getAutologinData } from \"@/utils/cookies\";\n\nconst QUESTION_ID = \"retriageFinished\";\n\nexport const RetriageFinished: React.FC = () => {\n const { retriageEligibility: { accessCode } = {}, retriageFinishedStatus } =\n useAppContext();\n const autologinData = getAutologinData();\n const { notFound, openApp } = useGoto();\n const { updateLastTriageTimestamp } = useUpdateLastTriageTimestamp();\n const { trackAnonEvent } = useTrackEvent();\n\n useEffect(() => {\n if (\n !retriageFinishedStatus &&\n window.ENV.NOOM_ENVIRONMENT !== \"development\"\n ) {\n notFound();\n return;\n }\n\n if (retriageFinishedStatus) {\n trackAnonEvent(\"b2bEnrollmentAnonUserExcluded\", {\n exclusionReason: retriageFinishedStatus,\n });\n }\n\n if (\n retriageFinishedStatus !== RetriageFinishedStatus.RECENTLY_RETRIAGED &&\n accessCode\n ) {\n updateLastTriageTimestamp(accessCode, \"KEPT_SAME_OFFERING\");\n }\n }, [retriageFinishedStatus]);\n\n const supportLink = (\n \n partnersupport@noom.com\n \n );\n\n return (\n \n \n \n \n \n \n \n \n \n {isMobile && (\n \n openApp(autologinData)}\n padding=\"unset\"\n size=\"xl\"\n whiteSpace=\"unset\"\n >\n \n \n \n )}\n \n );\n};\n","import { getIn, useFormikContext } from \"formik\";\nimport i18next from \"i18next\";\nimport React from \"react\";\nimport { CountryRegionData } from \"react-country-region-selector\";\nimport * as Yup from \"yup\";\n\nimport { Input, Select, Spacing, Stack } from \"@noom/wax-component-library\";\n\nimport { defaultFieldStyles } from \"@/app/themes/reskin/defaultFieldStyles\";\nimport { DEFAULT_ADDRESS } from \"@/constants\";\nimport { Address } from \"@/models\";\n\ntype AddressFieldName = keyof Address;\ntype Props = {\n countryCode: string;\n countrySelectDisabled?: boolean;\n formName?: string;\n hideTaxRegHelper?: boolean;\n};\n\n// Maps the order in which address fields should be displayed\nconst addressFieldPositionCountryMap: Record = {\n US: [\"address1\", \"address2\", \"city\", \"region\", \"zipcode\"],\n CA: [\"address1\", \"address2\", \"city\", \"region\", \"zipcode\"],\n AU: [\"address1\", \"address2\", \"zipcode\", \"city\", \"region\"],\n GB: [\"address1\", \"address2\", \"city\", \"zipcode\"],\n default: [\"address1\", \"address2\", \"city\", \"region\", \"zipcode\"],\n};\n\nconst STREET_MAX_LENGTH = 120;\nconst CITY_REGION_MAX_LENGTH = 100;\nconst ZIPCODE_MAX_LENGTH = 20;\n\nconst getTranslationForCountryCode = (\n formName: string,\n localTranslationKey: string,\n countryCode: string,\n): string =>\n i18next.t([\n `form.${formName}.${localTranslationKey}.${countryCode}`,\n `form.${formName}.${localTranslationKey}.default`,\n ]);\n\nconst shouldValidateFieldForCountry = (\n field: AddressFieldName,\n countryCode: string,\n) =>\n addressFieldPositionCountryMap[countryCode]?.includes(field) ||\n (countryCode && addressFieldPositionCountryMap[countryCode] === undefined);\n\nexport const buildAddressSchema = (formName: string) => {\n // returns an error message with the form field's label interpolated into the message\n const tError = (\n errorKey: \"required\" | \"maxLength\",\n fieldName: string,\n countryCode: string,\n props?: object,\n ): string => {\n const label = getTranslationForCountryCode(\n formName,\n `${fieldName}.label`,\n countryCode,\n );\n return i18next.t(`form.errors.${errorKey}`, { ...props, label });\n };\n\n return Yup.object({\n country: Yup.string().required(() => tError(\"required\", \"country\", \"\")),\n region: Yup.string()\n .when(\"country\", (country: string, schema) =>\n schema.max(\n CITY_REGION_MAX_LENGTH,\n tError(\"maxLength\", \"region\", country, {\n maxLength: CITY_REGION_MAX_LENGTH,\n }),\n ),\n )\n .when(\"country\", (country: string, schema) =>\n shouldValidateFieldForCountry(\"region\", country)\n ? schema.required(tError(\"required\", \"region\", country))\n : schema,\n ),\n city: Yup.string()\n .when(\"country\", (country: string, schema) =>\n schema.max(\n CITY_REGION_MAX_LENGTH,\n tError(\"maxLength\", \"city\", country, {\n maxLength: CITY_REGION_MAX_LENGTH,\n }),\n ),\n )\n .when(\"country\", (country: string, schema) =>\n shouldValidateFieldForCountry(\"city\", country)\n ? schema.required(tError(\"required\", \"city\", country))\n : schema,\n ),\n address1: Yup.string()\n .when(\"country\", (country: string, schema) =>\n schema.max(\n STREET_MAX_LENGTH,\n tError(\"maxLength\", \"address1\", country, {\n maxLength: STREET_MAX_LENGTH,\n }),\n ),\n )\n .when(\"country\", (country: string, schema) =>\n shouldValidateFieldForCountry(\"address1\", country)\n ? schema.required(tError(\"required\", \"address1\", country))\n : schema,\n ),\n address2: Yup.string().when(\"country\", (country: string, schema) =>\n schema.max(\n STREET_MAX_LENGTH,\n tError(\"maxLength\", \"address2\", country, {\n maxLength: STREET_MAX_LENGTH,\n }),\n ),\n ),\n zipcode: Yup.string()\n .when(\"country\", (country: string, schema) =>\n schema.max(\n ZIPCODE_MAX_LENGTH,\n tError(\"maxLength\", \"zipcode\", country, {\n maxLength: ZIPCODE_MAX_LENGTH,\n }),\n ),\n )\n .when(\"country\", (country: string, schema) =>\n shouldValidateFieldForCountry(\"zipcode\", country)\n ? schema.required(tError(\"required\", \"zipcode\", country))\n : schema,\n ),\n });\n};\n\nexport const AddressSchema = buildAddressSchema(\"address\");\n\n// Format of CountryRegionData:\n// [[\"Long Country Name\",\"ShortName\",\"Region1~Region1Short|Region2~Region2Short\"]]\n// This creates an array of tuples where each tuple is [Region, RegionShort]\nconst getRegionDataForCountry = (countryCode: string): string[][] =>\n CountryRegionData.find((country) => country[1] === countryCode)?.[2]\n .split(\"|\")\n .map((region) => region.split(\"~\")) || [];\n\nexport const AddressForm: React.FC = ({\n countryCode,\n countrySelectDisabled = false,\n formName = \"address\",\n hideTaxRegHelper = false,\n}) => {\n const {\n errors,\n getFieldProps,\n handleChange,\n setFieldError,\n setFieldValue,\n validateField,\n } = useFormikContext();\n\n const handleInputChange = async (\n e:\n | React.ChangeEvent\n | React.ChangeEvent,\n fieldName: string,\n ) => {\n // This is a hacky method to get each field to validate on change\n // individually.\n await handleChange(e);\n validateField(fieldName);\n };\n\n const formPath = (field: AddressFieldName) => `${formName}.${field}`;\n const getError = (field: AddressFieldName) => getIn(errors, formPath(field));\n\n const addressFieldComponentMap: Record = {\n country: (\n ) => {\n // Since which address fields are displayed is a function of the country,\n // we'll reset the address form values to ensure only the latest inputs are recorded.\n setFieldValue(formName, DEFAULT_ADDRESS);\n setFieldError(formPath(\"address1\"), \"\");\n setFieldError(formPath(\"city\"), \"\");\n setFieldError(formPath(\"region\"), \"\");\n setFieldError(formPath(\"zipcode\"), \"\");\n\n setFieldValue(formPath(\"country\"), e.target.value);\n validateField(formPath(\"country\"));\n }}\n placeholder={getTranslationForCountryCode(\n formName,\n \"country.placeholder\",\n countryCode,\n )}\n >\n {CountryRegionData.map((country) => (\n \n ))}\n \n ),\n region: (\n ) =>\n handleInputChange(e, formPath(\"region\"))\n }\n maxWidth={defaultFieldStyles.maxWidth}\n placeholder={getTranslationForCountryCode(\n formName,\n \"region.placeholder\",\n countryCode,\n )}\n >\n {getRegionDataForCountry(countryCode).map(([label, value]) => (\n \n ))}\n \n ),\n city: (\n handleInputChange(e, formPath(\"city\"))}\n placeholder={getTranslationForCountryCode(\n formName,\n \"city.placeholder\",\n countryCode,\n )}\n />\n ),\n address1: (\n handleInputChange(e, formPath(\"address1\"))}\n placeholder={getTranslationForCountryCode(\n formName,\n \"address1.placeholder\",\n countryCode,\n )}\n />\n ),\n address2: (\n handleInputChange(e, formPath(\"address2\"))}\n placeholder={getTranslationForCountryCode(\n formName,\n \"address2.placeholder\",\n countryCode,\n )}\n />\n ),\n zipcode: (\n handleInputChange(e, formPath(\"zipcode\"))}\n placeholder={getTranslationForCountryCode(\n formName,\n \"zipcode.placeholder\",\n countryCode,\n )}\n />\n ),\n };\n\n const addressFieldConfig =\n addressFieldPositionCountryMap[countryCode] ||\n addressFieldPositionCountryMap.default;\n\n return (\n \n {addressFieldComponentMap.country}\n {addressFieldConfig.map((field) => (\n \n {addressFieldComponentMap[field]}\n \n ))}\n \n );\n};\n","import { Formik } from \"formik\";\nimport i18next, { TFunction } from \"i18next\";\nimport React, { useEffect, useState } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport * as Yup from \"yup\";\n\nimport { GetB2bEmailAvailabilityInformationResponseProto } from \"@noom/noom-contracts/noom_contracts/backend/enrollment/b2b/enrollment_information\";\nimport { Api } from \"@noom/noomscape\";\nimport {\n Input,\n Spacing,\n Stack,\n Button,\n Checkbox,\n} from \"@noom/wax-component-library\";\n\nimport { GenericConsent } from \"@/components/noom-branding\";\nimport { ErrorState } from \"@/constants\";\nimport { useAppContext } from \"@/contexts\";\nimport { useGeolocation, useGoto, useQueryParams } from \"@/hooks\";\nimport { isB2CPartner } from \"@/utils/partners\";\nimport { captureException } from \"@/utils/sentry\";\n\nconst EMAIL_MAX_LENGTH = 190; // Account table supports emails of 191 characters\n\nexport type CreateAccountFormValues = {\n email: string;\n mhmdaOptIn?: boolean;\n};\n\nexport const defaultInitialValues: CreateAccountFormValues = {\n email: \"\",\n};\n\nexport const defaultInitialValuesMHMDA: CreateAccountFormValues = {\n ...defaultInitialValues,\n mhmdaOptIn: false,\n};\n\nconst getValidationSchema = (t: TFunction) =>\n Yup.object().shape({\n email: Yup.string()\n .max(\n EMAIL_MAX_LENGTH,\n t(\"form.errors.maxLength\", {\n label: t(\"form.email.label\"),\n maxLength: EMAIL_MAX_LENGTH,\n }),\n )\n .email(t(\"form.email.errors.invalid\"))\n .required(t(\"form.email.errors.required\")),\n });\n\nexport const CreateAccountForm: React.FC<{\n initialValues?: CreateAccountFormValues;\n onSubmit: (values: CreateAccountFormValues) => void;\n}> = ({ onSubmit, initialValues = defaultInitialValues }) => {\n const { hasB2cAccount, partnerInfo, setHasB2cAccount } = useAppContext();\n const { canOptOutMHMDA } = useGeolocation();\n const goto = useGoto();\n const { eligibilityId } = useQueryParams();\n const [submittedValues, setSubmittedValues] = useState<\n CreateAccountFormValues | undefined\n >();\n const { t } = useTranslation();\n\n const showMhmdaCheckBox = isB2CPartner(partnerInfo) && canOptOutMHMDA();\n\n async function getB2bEmailAvailabilityInformation(\n values: CreateAccountFormValues,\n ) {\n try {\n const {\n availabilityResult,\n }: GetB2bEmailAvailabilityInformationResponseProto = await Api.call(\n \"account.getB2bEmailAvailabilityInformation\",\n Api.api.account.getB2bEmailAvailabilityInformation,\n {\n email: values.email,\n },\n );\n\n if (availabilityResult === \"HAS_B2B_ACCOUNT\") {\n goto.error(ErrorState.ACCOUNT_EXISTS);\n return;\n }\n\n setHasB2cAccount(availabilityResult === \"HAS_B2C_ACCOUNT\");\n } catch (e) {\n captureException(e);\n goto.error(ErrorState.DEFAULT);\n }\n }\n\n // getB2bEmailAvailabilityInformation after the form values are set in local state\n useEffect(() => {\n if (submittedValues) {\n getB2bEmailAvailabilityInformation(submittedValues);\n }\n }, [submittedValues]);\n\n // Clear hasB2cAccount on mount so an effect can react to it.\n // If we were to leave it as a previously set boolean value, we don't know if its been re-evaluated.\n useEffect(() => {\n setHasB2cAccount(undefined);\n }, []);\n\n // only call onSubmit after hasB2cAccount has been evaluated and updated in app state.\n useEffect(() => {\n if (hasB2cAccount === undefined || submittedValues === undefined) {\n return;\n }\n onSubmit(submittedValues);\n }, [hasB2cAccount, submittedValues]);\n\n return (\n setSubmittedValues({ ...values })}\n validateOnBlur={false}\n validateOnChange={false}\n validationSchema={getValidationSchema(t)}\n >\n {({\n errors,\n getFieldProps,\n handleChange,\n handleSubmit,\n isSubmitting,\n touched,\n validateField,\n values,\n }) => {\n const handleInputChange = async (\n e: React.ChangeEvent,\n fieldName: keyof CreateAccountFormValues,\n ) => {\n // This is a hacky method to get each field to validate on change\n // individually.\n await handleChange(e);\n validateField(fieldName);\n };\n\n return (\n
\n \n handleInputChange(e, \"email\")}\n placeholder={t(\"form.email.placeholder\")}\n type=\"email\"\n helper={\n i18next.exists(\n `form.email.helper.partners.${partnerInfo?.slug}`,\n )\n ? t(`form.email.helper.partners.${partnerInfo?.slug}`)\n : undefined\n }\n />\n {showMhmdaCheckBox && (\n \n {t(\"form.mhmdaOptIn.label\")}\n \n )}\n \n \n {t(\"createAccount.ctaText\")}\n \n \n
\n );\n }}\n \n );\n};\n","import { useFormikContext } from \"formik\";\nimport React, { useEffect } from \"react\";\nimport { Trans, useTranslation } from \"react-i18next\";\n\nimport { StatusEnumProto_Value } from \"@noom/noom-contracts/noom_contracts/backend/privacy/user_policy_options\";\nimport { Input, Spacing, Stack, Text } from \"@noom/wax-component-library\";\n\nimport { useAppContext } from \"@/contexts\";\nimport { useTrackEvent } from \"@/hooks\";\nimport { getDisplayName } from \"@/models\";\n\nimport { NoomEmailAddressLink } from \"../noom-branding\";\nimport { QuestionOption } from \"../survey/Question\";\nimport { MultipleChoiceOptions } from \"../survey/multipleChoice\";\nimport type { FormValues } from \"../survey/questionTypes/dpp-triage/CompleteProfileQuestion\";\n\nexport const HealthDataConsentForm: React.FC = () => {\n const { partnerInfo } = useAppContext();\n const {\n errors,\n getFieldProps,\n handleChange,\n setFieldValue,\n touched,\n validateField,\n values,\n } = useFormikContext();\n const { trackAnonEvent } = useTrackEvent();\n const { t } = useTranslation();\n\n const options: (QuestionOption & { id: StatusEnumProto_Value })[] = [\n {\n id: \"OPT_IN_MAY_SHARE\",\n text: t(\"form.healthDataConsent.options.optIn\"),\n },\n {\n id: \"OPT_OUT_DO_NOT_SHARE\",\n text: t(\"form.healthDataConsent.options.optOut\"),\n },\n ];\n\n const handleInputChange = async (\n e: React.ChangeEvent,\n fieldName: string,\n ) => {\n // This is a hacky method to get each field to validate on change\n // individually.\n await handleChange(e);\n validateField(fieldName);\n };\n\n useEffect(() => {\n trackAnonEvent(\"b2bEnrollmentAnonHealthDataConsentFormViewed\", {});\n }, []);\n\n return (\n \n \n \n \n setFieldValue(\"consentStatus\", optionId)}\n options={options}\n selectedItem={values.consentStatus}\n />\n handleInputChange(e, \"consentSignature\")}\n placeholder={t(\"form.healthDataConsent.consentSignature.placeholder\")}\n />\n \n \n This authorization lasts for 1 year. Enrollment not conditioned on\n agreement to share data. Data shared may be subject to additional\n disclosures. Consent may be revoked by emailing\n {NoomEmailAddressLink}. Additional details can be found in\n \n Noom’s Consumer Health Data Privacy Notice\n \n .\n \n \n \n );\n};\n","const FLOAT_DISALLOWED_CHARS = [\"e\", \"-\"];\nconst INTEGER_DISALLOWED_CHARS = [\".\", \"e\", \"-\"];\n\n/**\n * Prevents certain keys from being entered to enforce the input to be a\n * positive float. This ensures we can still support backspace, delete, enter,\n * copy/paste, etc. operations.\n */\nexport const enforcePositiveFloat = (\n e: React.KeyboardEvent,\n) => {\n if (FLOAT_DISALLOWED_CHARS.includes(e.key)) {\n e.preventDefault();\n }\n};\n\n/**\n * Prevents certain keys from being entered to enforce the input to be a\n * positive integer. This ensures we can still support backspace, delete,\n * enter, copy/paste, etc. operations.\n */\nexport const enforcePositiveInt = (\n e: React.KeyboardEvent,\n) => {\n if (INTEGER_DISALLOWED_CHARS.includes(e.key)) {\n e.preventDefault();\n }\n};\n","import { useFormikContext } from \"formik\";\nimport i18next from \"i18next\";\nimport React from \"react\";\nimport * as Yup from \"yup\";\n\nimport { Box, Spacing, Stack } from \"@noom/wax-component-library\";\n\nimport { InputWithSuffix } from \"@/components/form\";\nimport { INPUT_FIELD_WIDTH } from \"@/constants/enrollment\";\n\nimport { enforcePositiveInt } from \"../form/utils\";\n\nconst FEET_INPUT_FIELD_WIDTH = Math.ceil((INPUT_FIELD_WIDTH - 16) / 2);\nconst INCHES_INPUT_FIELD_WIDTH = Math.floor((INPUT_FIELD_WIDTH - 16) / 2);\n\ntype HeightWeightProps = {\n focusHeightFeet?: boolean;\n hideHeight?: boolean;\n};\n\nexport type HeightWeightFormValues = {\n heightFeetPortion?: number;\n heightInchesPortion?: number;\n weight?: number;\n};\n\nexport const HeightWeightSchema = Yup.object({\n heightFeetPortion: Yup.number()\n .nullable(true)\n .transform((value) => (Number.isNaN(value) ? null : value))\n .required(() => i18next.t(\"form.height.errors.required\"))\n .positive(() => i18next.t(\"form.height.errors.invalid\"))\n .min(0, () => i18next.t(\"form.height.errors.invalid\"))\n .max(8, () => i18next.t(\"form.height.errors.invalid\")),\n heightInchesPortion: Yup.number()\n .nullable(true)\n .transform((value) => (Number.isNaN(value) ? null : value))\n .required(() => i18next.t(\"form.height.errors.required\"))\n .positive(() => i18next.t(\"form.height.errors.invalid\"))\n .min(0, () => i18next.t(\"form.height.errors.invalid\"))\n .max(11, () => i18next.t(\"form.height.errors.invalid\")),\n weight: Yup.number()\n .nullable(true)\n .transform((value) => (Number.isNaN(value) ? null : value))\n .required(() => i18next.t(\"form.weight.errors.required\"))\n .positive(() => i18next.t(\"form.weight.errors.invalid\"))\n // 335 kg is maximum value for account creation - 741 lbs = 336 kg\n // https://github.com/noom/backend/blob/d9f504457c5392cf99f058972eb4d25b6c14bb9f/com.noom.api/src/main/java/com/noom/api/user/account/model/CreateAccountRequest.kt\n .max(740, () => i18next.t(\"form.weight.errors.invalid\")),\n});\n\nexport const HeightWeightForm: React.FC = ({\n focusHeightFeet,\n hideHeight = false,\n}) => {\n const { errors, getFieldProps, handleChange, touched, validateField } =\n useFormikContext();\n\n const handleInputChange = async (\n e: React.ChangeEvent,\n fieldName: keyof HeightWeightFormValues,\n ) => {\n // This is a hacky method to get each field to validate on change\n // individually.\n await handleChange(e);\n validateField(fieldName);\n };\n\n return (\n \n {!hideHeight && (\n \n handleInputChange(e, \"heightFeetPortion\")}\n onKeyDown={enforcePositiveInt}\n suffix=\"ft.\"\n type=\"number\"\n />\n handleInputChange(e, \"heightInchesPortion\")}\n onKeyDown={enforcePositiveInt}\n suffix=\"in.\"\n type=\"number\"\n />\n \n )}\n handleInputChange(e, \"weight\")}\n onKeyDown={enforcePositiveInt}\n suffix=\"lbs.\"\n type=\"number\"\n />\n \n );\n};\n","import { Formik } from \"formik\";\nimport React from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport * as Yup from \"yup\";\n\nimport {\n Button,\n Checkbox,\n Spacing,\n Stack,\n Text,\n} from \"@noom/wax-component-library\";\n\nimport { PhoneInput, PhoneInputSchema, PhoneNumber } from \"@/components/form\";\nimport {\n AddressForm,\n AddressSchema,\n buildAddressSchema,\n} from \"@/components/forms\";\nimport {\n QuestionComponentProps,\n QuestionDefinition,\n} from \"@/components/survey/Question\";\nimport { DEFAULT_ADDRESS } from \"@/constants\";\nimport { useAppContext } from \"@/contexts\";\nimport { Address } from \"@/models\";\n\nimport { BaseQuestion } from \"../core\";\n\nconst QUESTION_ID = \"medSignup\";\n\nexport type FormValues = {\n address: Address;\n sameShippingAddress?: boolean;\n shippingAddress?: Address;\n phoneNumber: PhoneNumber;\n};\n\ndeclare module \"@/contexts\" {\n interface SurveyAnswers {\n medSignup?: Omit;\n }\n}\n\nconst getValidationSchema = () =>\n Yup.object({\n address: AddressSchema,\n sameShippingAddress: Yup.boolean(),\n phoneNumber: PhoneInputSchema,\n shippingAddress: buildAddressSchema(\"shippingAddress\").when(\n \"sameShippingAddress\",\n {\n is: true,\n then: () => Yup.mixed().notRequired(),\n otherwise: (s) => s.required(),\n },\n ),\n });\n\nconst RetriageMedSignup: React.FC = ({\n onClickBack,\n onClickNext,\n surveyAnswers,\n}) => {\n const { eligibilityInfo, selectedProgram } = useAppContext();\n const { t } = useTranslation();\n\n const defaultInitialValues: FormValues = {\n address: eligibilityInfo?.address || DEFAULT_ADDRESS,\n phoneNumber: {\n country: \"us\",\n dialCode: \"1\",\n value: eligibilityInfo?.phoneNumber || \"\",\n },\n sameShippingAddress: true,\n shippingAddress: eligibilityInfo?.address || DEFAULT_ADDRESS,\n };\n\n const onSubmit = (values: FormValues) => {\n const { sameShippingAddress, ...answers } = values;\n if (sameShippingAddress) {\n delete answers.shippingAddress;\n }\n\n onClickNext(answers);\n };\n\n return (\n \n \n {({ getFieldProps, handleSubmit, isSubmitting, values }) => (\n
\n \n \n \n {surveyAnswers.scaleOptIn && (\n \n {t(\"retriageMedSignup.sameShippingAddress\")}\n \n )}\n {surveyAnswers.scaleOptIn && !values.sameShippingAddress && (\n \n \n {t(\"retriageMedSignup.differentShippingAddress\")}\n \n \n \n )}\n \n {t(\"retriageMedSignup.cta\")}\n \n \n
\n )}\n \n \n );\n};\nexport const Q_RETRIAGE_MED_SIGNUP: QuestionDefinition = {\n id: QUESTION_ID,\n shouldShowQuestion: ({ selectedProgram }) =>\n selectedProgram === \"MED\" || selectedProgram === \"NMPBA\",\n component: RetriageMedSignup,\n};\n","import React, { useEffect } from \"react\";\nimport { isMobile } from \"react-device-detect\";\n\nimport {\n Box,\n Button,\n Heading,\n Image,\n Size,\n Stack,\n} from \"@noom/wax-component-library\";\n\nimport {\n QuestionComponentProps,\n QuestionDefinition,\n} from \"@/components/survey/Question\";\nimport { useAppContext } from \"@/contexts\";\nimport { useUpdateLastTriageTimestamp } from \"@/hooks\";\n\nimport { BaseOutline } from \"../core\";\n\nconst QUESTION_ID = \"retriageKeepPlan\";\n\nconst RetriageKeepPlanConfirmation: React.FC = ({\n onClickNext,\n}) => {\n const { retriageEligibility: { accessCode } = {} } = useAppContext();\n const { updateLastTriageTimestamp } = useUpdateLastTriageTimestamp();\n\n useEffect(() => {\n if (!accessCode) {\n return;\n }\n updateLastTriageTimestamp(accessCode, \"KEPT_SAME_OFFERING\");\n }, [accessCode]);\n\n return (\n \n \n \"\"\n \n You got it. We’ll keep you in your existing program.\n \n\n {isMobile && (\n \n onClickNext(null)}\n size=\"md\"\n whiteSpace=\"unset\"\n >\n Return to App\n \n \n )}\n \n \n );\n};\n\nexport const Q_RETRIAGE_KEEP_PLAN: QuestionDefinition = {\n id: QUESTION_ID,\n shouldShowQuestion: ({\n surveyAnswers: {\n confirmChangeProgramDpp,\n confirmChangeProgramMed,\n medicareConsent,\n },\n }) =>\n confirmChangeProgramDpp === false ||\n confirmChangeProgramMed === false ||\n medicareConsent === \"disagree\",\n component: RetriageKeepPlanConfirmation,\n};\n","import React from \"react\";\nimport { useTranslation } from \"react-i18next\";\n\nimport {\n CompassColor,\n CompassLoader,\n Heading,\n Stack,\n} from \"@noom/wax-component-library\";\n\nimport {\n QuestionComponentProps,\n QuestionDefinition,\n} from \"@/components/survey/Question\";\n\nimport { BaseInterstitial } from \"../core\";\n\nconst QUESTION_ID = \"personalizingProgram\";\n\nconst RetriagePersonalizingProgram: React.FC = ({\n onClickBack,\n onClickNext,\n}) => {\n const { t } = useTranslation();\n\n return (\n \n \n \n \n \n {t(\"retriagePersonalizingProgram.message\")}\n \n \n );\n};\n\nexport const Q_RETRIAGE_PERSONALIZING_PROGRAM: QuestionDefinition = {\n id: QUESTION_ID,\n shouldShowQuestion: ({\n selectedProgram,\n retriageEligibility: { currentProgram } = {},\n }) => currentProgram === \"WEIGHT\" && selectedProgram !== \"MED\",\n component: RetriagePersonalizingProgram,\n};\n","import React, { ReactNode } from \"react\";\nimport { isMobile } from \"react-device-detect\";\nimport { useTranslation } from \"react-i18next\";\n\nimport {\n Box,\n Button,\n CompassColor,\n Heading,\n Image,\n Spacing,\n Stack,\n Text,\n} from \"@noom/wax-component-library\";\n\nimport { BaseInterstitial } from \"@/components/survey/questionTypes/core\";\n\ntype BaseSuccessProps = {\n onClickNext: () => void;\n headingText: string;\n bodyContent: ReactNode | string;\n questionId: string;\n ctaText: string;\n};\n\nexport const BaseSuccess: React.FC = ({\n onClickNext,\n headingText,\n bodyContent,\n ctaText,\n questionId,\n}) => {\n useTranslation();\n\n return (\n null}\n onClickNext={() => Promise.resolve()}\n questionId={questionId}\n width=\"550px\"\n margin={isMobile ? \"var(--spacing-xxxl) var(--spacing-l)\" : undefined}\n >\n \n \n {headingText}\n \n {bodyContent}\n \n \n {ctaText && (\n \n \n {ctaText}\n \n \n )}\n \n );\n};\n","import React, { useEffect, useState } from \"react\";\n\nimport { Box, Image, useMediaQuery } from \"@noom/wax-component-library\";\n\n// The confetti gifs are 500x500 (desktop) and 300x300 (mobile), but they both\n// have whitespace at the top and bottom each equal to 24% of the height. The\n// whitespace therefore takes up 48% of the height, leaving 52% as the actual\n// height we're looking for (52% * 500 = 260, 52% * 300 = 156)\nconst CONFETTI_HEIGHT_DESKTOP = \"260px\";\nconst CONFETTI_HEIGHT_MOBILE = \"156px\";\nconst CONFETTI_WIDTH_DESKTOP = \"500px\";\nconst CONFETTI_WIDTH_MOBILE = \"300px\";\n\nexport const ConfettiBox = () => {\n const [isBrowser] = useMediaQuery(\"(min-width: 1160px)\");\n const [isAnimationComplete, setIsAnimationComplete] = useState(false);\n\n useEffect(() => {\n setTimeout(() => setIsAnimationComplete(true), 3000);\n }, []);\n\n return (\n \n \n {!isAnimationComplete && (\n \n )}\n \n );\n};\n","import { format } from \"date-fns\";\nimport { omit } from \"lodash\";\n\nimport { SurveyAnswers } from \"@/contexts\";\nimport { RetriageUserProfile } from \"@/models\";\n\nimport { convertKgToLb } from \"./UnitUtils\";\n\nexport function sanitizeRetriageAnswers(surveyAnswers: SurveyAnswers): string {\n const QUESTION_BLOCKLIST = [\n \"completeProfile\",\n \"medSignup\",\n \"existingPassword\",\n ];\n let sanitizedSurveyAnswers: Record = omit(\n surveyAnswers,\n QUESTION_BLOCKLIST,\n );\n\n // convert date to string (don't need/want time info)\n if (surveyAnswers.retriageEligibilityCheck?.dob) {\n sanitizedSurveyAnswers = {\n ...sanitizedSurveyAnswers,\n retriageEligibilityCheck: {\n ...surveyAnswers.retriageEligibilityCheck,\n dob: format(\n surveyAnswers.retriageEligibilityCheck.dob as Date,\n \"yyyy-MM-dd\",\n ),\n },\n };\n }\n return JSON.stringify(sanitizedSurveyAnswers);\n}\n\nexport const getWeightInLbs = ({\n weightInKg,\n weightInLb,\n}: RetriageUserProfile): number | undefined => {\n if (weightInLb) {\n return weightInLb;\n }\n if (weightInKg) {\n return convertKgToLb({\n mainUnitValue: weightInKg,\n }).mainUnitValue;\n }\n return undefined;\n};\n","/* eslint-disable @typescript-eslint/no-non-null-assertion */\nimport { useState } from \"react\";\n\nimport { MigrateUserRequestProto_Body } from \"@noom/noom-contracts/noom_contracts/backend/retriage/retriage_service\";\nimport { AddressProto } from \"@noom/noom-contracts/noom_contracts/billing/address/address\";\nimport { Api } from \"@noom/noomscape\";\n\nimport { PhoneNumber } from \"@/components/form\";\nimport { ProgramOffering } from \"@/constants\";\nimport { useAppContext } from \"@/contexts\";\nimport { SurveyAnswers } from \"@/contexts/app-context\";\nimport { Address, Partner, RetriageEligibility } from \"@/models\";\nimport { getOfferingFromProgram } from \"@/utils/programs\";\nimport { sanitizeRetriageAnswers } from \"@/utils/retriage\";\n\nfunction buildAddressProto(\n address: Address,\n phoneNumber?: PhoneNumber,\n): AddressProto {\n const proto: AddressProto = {\n addressLine1: address.address1,\n addressLine2: address.address2,\n city: address.city,\n zoneCode: address.region,\n postalCode: address.zipcode,\n countryCode: address.country,\n };\n if (phoneNumber) {\n proto.phoneNumber = phoneNumber.dialCode.concat(phoneNumber.value);\n }\n return proto;\n}\n\nfunction buildRequest(\n surveyAnswers: SurveyAnswers,\n selectedProgram: ProgramOffering | null,\n retriageEligibility: RetriageEligibility,\n partnerInfo: Partner,\n b2bIdentifiedUserId: string,\n): MigrateUserRequestProto_Body {\n if (!selectedProgram) {\n throw new Error(\"Cannot migrate user: no selected program\");\n }\n\n const request: MigrateUserRequestProto_Body = {\n accessCode: retriageEligibility.accessCode!,\n survey: {},\n surveyJson: sanitizeRetriageAnswers(surveyAnswers),\n offering: getOfferingFromProgram(selectedProgram),\n partnerId: partnerInfo.id,\n completionStatus: \"COMPLETE\",\n wasOfferedDpp: !!surveyAnswers.wasOfferedDpp,\n wasOfferedMed: !!surveyAnswers.wasOfferedMed,\n };\n if (selectedProgram === \"MED\") {\n request.medRetriageData = {\n userId: b2bIdentifiedUserId,\n homeAddress: buildAddressProto(\n surveyAnswers.medSignup!.address,\n surveyAnswers.medSignup!.phoneNumber,\n ),\n mainReason: surveyAnswers.mainReason!,\n familyHistory: surveyAnswers.familyHistory!,\n pregnant: surveyAnswers.pregnant! || \"no\",\n healthConditions: surveyAnswers.healthConditions || [],\n heightFeet: surveyAnswers.heightWeight!.heightFeetPortion!,\n heightInch: surveyAnswers.heightWeight!.heightInchesPortion!,\n weightLbs: surveyAnswers.heightWeight!.weight!,\n useMedications: Number(surveyAnswers.medications) > 0 ? \"yes\" : \"no\",\n suicideOrSelfHarm1: surveyAnswers.phq4!,\n suicideOrSelfHarm2: surveyAnswers.phq3!,\n };\n }\n if (surveyAnswers.scaleOptIn) {\n request.scaleShippingAddress = buildAddressProto(\n surveyAnswers.medSignup!.shippingAddress ||\n surveyAnswers.medSignup!.address,\n );\n }\n return request;\n}\n\nexport const useMigrateUser = () => {\n const [apiError, setError] = useState();\n const [apiLoading, setApiLoading] = useState(true);\n const {\n surveyAnswers,\n retriageEligibility,\n partnerInfo,\n b2bIdentifiedUserId,\n selectedProgram,\n } = useAppContext();\n\n const migrateUser = async () => {\n if (!retriageEligibility) {\n throw Error(\"Cannot migrate to med: No RetriageEligibility found\");\n }\n if (!partnerInfo) {\n throw Error(\"Cannot migrate to med: No partner info\");\n }\n\n try {\n await Api.call(\n \"retriage.migrateUser\",\n Api.api.retriage.migrateUser,\n buildRequest(\n surveyAnswers,\n selectedProgram,\n retriageEligibility,\n partnerInfo,\n b2bIdentifiedUserId,\n ),\n );\n setApiLoading(false);\n } catch (e) {\n const err = e as Error;\n setError(err.message);\n setApiLoading(false);\n }\n };\n\n return { migrateUser, apiLoading, apiError };\n};\n","import React, { useEffect, useState } from \"react\";\nimport { isMobile } from \"react-device-detect\";\nimport { Trans } from \"react-i18next\";\n\nimport {\n Box,\n Button,\n CompassColor,\n CompassLoader,\n Heading,\n Size,\n Stack,\n} from \"@noom/wax-component-library\";\n\nimport { ConfettiBox } from \"@/components/ConfettiBox\";\nimport {\n QuestionComponentProps,\n QuestionDefinition,\n} from \"@/components/survey/Question\";\nimport { useAppContext } from \"@/contexts\";\nimport { useGoto, useTrackEvent, useUpdateLastTriageTimestamp } from \"@/hooks\";\nimport { useMigrateUser } from \"@/hooks/useMigrateUser\";\nimport { captureException, captureMessage } from \"@/utils/sentry\";\n\nimport { BaseOutline } from \"../core\";\n\nconst QUESTION_ID = \"retriageTransition\";\n\nconst RetriageTransition: React.FC = ({\n onClickNext,\n}) => {\n const [hasMinTimeElapsed, setHasMinTimeElapsed] = useState(false);\n const [isSuccess, setIsSuccess] = useState(false);\n const {\n b2bIdentifiedUserId,\n retriageEligibility: { accessCode, currentProgram } = {},\n selectedProgram,\n } = useAppContext();\n const { migrateUser, apiLoading, apiError } = useMigrateUser();\n const goto = useGoto();\n const { updateLastTriageTimestamp } = useUpdateLastTriageTimestamp();\n const { trackAnonEvent } = useTrackEvent();\n\n useEffect(() => {\n if (!apiLoading && !apiError && hasMinTimeElapsed) {\n setIsSuccess(true);\n }\n }, [apiLoading, apiError, hasMinTimeElapsed]);\n\n useEffect(() => {\n if (!isSuccess || !accessCode) {\n return;\n }\n updateLastTriageTimestamp(accessCode, \"CHANGED_OFFERING\");\n if (selectedProgram === \"MED\") {\n setTimeout(() => goto.medIntake(b2bIdentifiedUserId), 2500);\n }\n }, [isSuccess, accessCode, selectedProgram]);\n\n useEffect(() => {\n if (selectedProgram) {\n trackAnonEvent(\"b2bEnrollmentAnonRetriageNewProgramSelected\", {\n currentProgram: currentProgram || \"PROGRAM_UNSPECIFIED\",\n newProgram: selectedProgram,\n });\n setTimeout(() => setHasMinTimeElapsed(true), 2500);\n migrateUser();\n } else {\n captureMessage(\"RetriageTransition was displayed when it shouldn't be\");\n goto.error();\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n useEffect(() => {\n if (hasMinTimeElapsed && apiError) {\n captureException(apiError);\n goto.error();\n }\n }, [hasMinTimeElapsed, apiError, goto]);\n\n return (\n \n \n {isSuccess ? (\n \n \n \n \n \n {isMobile && selectedProgram !== \"MED\" && (\n \n onClickNext(null)}\n size=\"md\"\n whiteSpace=\"unset\"\n >\n Return to App\n \n \n )}\n \n ) : (\n \n \n \n Updating your program...\n \n \n )}\n \n \n );\n};\n\nexport const Q_RETRIAGE_TRANSITION: QuestionDefinition = {\n id: QUESTION_ID,\n shouldShowQuestion: ({\n selectedProgram,\n surveyAnswers: { medicareConsent },\n }) =>\n ((selectedProgram === \"MED\" || selectedProgram === \"NMPBA\") &&\n medicareConsent !== \"disagree\") ||\n selectedProgram === \"DPP\",\n component: RetriageTransition,\n};\n","import React, { useEffect } from \"react\";\nimport { isMobile } from \"react-device-detect\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { Api } from \"@noom/noomscape\";\nimport {\n Box,\n CompassColor,\n Image,\n Loader,\n Spacing,\n Stack,\n Text,\n} from \"@noom/wax-component-library\";\n\nimport { NoomHeader } from \"@/components/noom-branding\";\nimport { buildDeeplink } from \"@/constants\";\nimport { useAppContext } from \"@/contexts\";\nimport { useQueryParams, useTrackEvent } from \"@/hooks\";\nimport { Partner } from \"@/models\";\nimport { captureException } from \"@/utils/sentry\";\n\n/**\n * Landing page for users that attempt to open deep links on desktop.\n */\nexport const DeeplinkView: React.FC = () => {\n const { enrollmentSlug } = useQueryParams();\n const { partnerInfo, setPartnerInfo } = useAppContext();\n const { trackIdentifiedPageViewed } = useTrackEvent();\n const { t } = useTranslation();\n\n useEffect(() => {\n trackIdentifiedPageViewed(\"deeplink\");\n\n if (isMobile) {\n window.location.replace(buildDeeplink());\n }\n }, []);\n\n useEffect(() => {\n const getPartnerInfo = () => {\n Api.call(\"partner.getPartnerBySlug\", Api.api.partner.getPartnerBySlug, {\n slug: enrollmentSlug,\n })\n .then((partnerInformation: Partner) =>\n setPartnerInfo(partnerInformation),\n )\n .catch((e: Error) => captureException(e));\n };\n\n if (!partnerInfo) {\n getPartnerInfo();\n }\n }, [partnerInfo, enrollmentSlug, setPartnerInfo]);\n\n return isMobile ? (\n \n \n \n \n \n \n ) : (\n \n \n \n \n \n {t(\"deeplink.openLink\")}\n \n \n \n {t(\"deeplink.or\")}\n \n \n \n {t(\"deeplink.scanQRCode\")}\n \n \n \n \n \n \n );\n};\n","import React, { useCallback, useEffect } from \"react\";\nimport { Route, Routes, useLocation, useNavigate } from \"react-router-dom\";\n\nimport { ScreenedOutReason } from \"@/constants\";\nimport { SurveyAnswer, SurveyAnswers, useAppContext } from \"@/contexts\";\nimport {\n useAnswerSurveyQuestion,\n useExperiment,\n useGoto,\n useTrackEvent,\n} from \"@/hooks\";\n\nimport { QuestionSection } from \"./Question\";\n\ntype SurveyProps = {\n baseRoute: string;\n onSurveyComplete: (surveyAnswers: SurveyAnswers) => Promise;\n questionSet: QuestionSection[];\n resetOnOpen?: boolean;\n};\n\nexport const Survey: React.FC = ({\n baseRoute,\n onSurveyComplete,\n questionSet,\n resetOnOpen = true,\n}) => {\n const { answerSurveyQuestion, getNewSurveyAnswersState } =\n useAnswerSurveyQuestion();\n const {\n enrollmentInfo,\n hasB2cAccount,\n partnerInfo,\n retriageEligibility,\n screenedOutReason,\n selectedProgram,\n surveyAnswers,\n surveyMetadata,\n telehealthEligibleStates,\n userProfile,\n setQuestionSet,\n setSurveyAnswers,\n } = useAppContext();\n const { getExperimentAssignments } = useExperiment();\n const { screenOut } = useGoto();\n const { pathname, search } = useLocation();\n const navigate = useNavigate();\n const { trackSurveyAnonEvent, trackSurveyIdentifiedEvent } = useTrackEvent();\n\n const questions = questionSet.flatMap(\n (questionSection) => questionSection.questions,\n );\n\n const getQuestionIdFromPath = useCallback(\n () => pathname.split(\"/\").pop() || \"\",\n [pathname],\n );\n\n const pushHistoryPreserveQuerystring = (newPathName: string) => {\n navigate({\n pathname: newPathName,\n search,\n });\n };\n\n // TODO: Remove newState as an argument - it was added as a hack because\n // state updates occur asynchronously\n const findNextQuestion = (startingIndex: number, newState: SurveyAnswers) => {\n const updatedProgram =\n newState?.updatedProgram === undefined\n ? selectedProgram\n : newState?.updatedProgram;\n\n return questions.find(\n (question, index) =>\n index >= startingIndex &&\n question.shouldShowQuestion({\n enrollmentInfo,\n experiments: getExperimentAssignments(),\n hasB2cAccount,\n partnerInfo,\n retriageEligibility,\n screenedOutReason,\n selectedProgram: updatedProgram,\n surveyAnswers: newState,\n telehealthEligibleStates,\n userProfile,\n }),\n );\n };\n\n const goToFirstQuestion = () => {\n const firstQuestion = findNextQuestion(0, surveyAnswers);\n\n if (!firstQuestion) {\n return;\n }\n\n navigate(\n {\n pathname: `${baseRoute}/${firstQuestion.id}`,\n search,\n },\n { replace: true },\n );\n };\n\n const getQuestionIndexById = (questionId: string): number =>\n questions.findIndex((question) => question.id === questionId);\n\n /**\n *\n * @param answer to be stored at surveyAnswers[questionId]\n * @param additionalAnswers to be stored at their specified key\n */\n const onClickNext = async (\n answer: SurveyAnswer,\n additionalAnswers?: Record,\n reason?: ScreenedOutReason,\n ) => {\n const questionId = getQuestionIdFromPath();\n\n const newSurveyAnswers = getNewSurveyAnswersState(\n questionId,\n answer,\n additionalAnswers,\n );\n await answerSurveyQuestion(questionId, answer, additionalAnswers);\n\n const questionIndex = getQuestionIndexById(questionId);\n const nextQuestion = findNextQuestion(questionIndex + 1, newSurveyAnswers);\n\n if (reason) {\n screenOut(reason);\n return;\n }\n\n if (!nextQuestion) {\n if (surveyMetadata) {\n trackSurveyAnonEvent(\"b2bSurveyAnonSurveyCompleted\", {});\n trackSurveyIdentifiedEvent(\"b2bSurveyIdentifiedSurveyCompleted\", {});\n }\n await onSurveyComplete(newSurveyAnswers);\n } else {\n const nextQuestionPath = pathname.replace(questionId, nextQuestion.id);\n pushHistoryPreserveQuerystring(nextQuestionPath);\n }\n };\n\n const onClickBack = () => {\n /**\n * This clears the answer for the question before going back so we don't\n * store answers that may not be relevant after changing previous answers.\n *\n * Examples:\n * - pregnant question will be skipped after going back and changing sex\n * from female to male\n * - locationState question will be skipped after going back and proceeding\n * again if a Noom Med ineligible state is selected the first time\n */\n const newSurveyAnswers = { ...surveyAnswers };\n delete newSurveyAnswers[getQuestionIdFromPath()];\n setSurveyAnswers(newSurveyAnswers);\n\n navigate(-1);\n };\n\n useEffect(() => {\n if (resetOnOpen) {\n goToFirstQuestion();\n\n if (surveyMetadata) {\n trackSurveyAnonEvent(\"b2bSurveyAnonSurveyStarted\", {});\n trackSurveyIdentifiedEvent(\"b2bSurveyIdentifiedSurveyStarted\", {});\n }\n }\n }, []);\n\n useEffect(() => {\n setQuestionSet(questionSet);\n }, [questionSet]);\n\n return (\n \n {questions.map((question) => {\n const { id: questionId, component: Component } = question;\n return (\n \n }\n />\n );\n })}\n \n );\n};\n","import React, { useEffect } from \"react\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { Heading, Image } from \"@noom/wax-component-library\";\n\nimport {\n QuestionComponentProps,\n QuestionDefinition,\n} from \"@/components/survey/Question\";\nimport { useTrackEvent } from \"@/hooks\";\n\nimport { BaseInterstitial } from \"../../core\";\n\nconst QUESTION_ID = \"activeSubscription\";\n\nconst ActiveSubscription: React.FC = ({\n onClickBack,\n onClickNext,\n}) => {\n const { trackIdentifiedPageViewed } = useTrackEvent();\n const { t } = useTranslation();\n\n useEffect(() => {\n trackIdentifiedPageViewed(\"activeSubscription\");\n }, []);\n\n return (\n \n \n \n {t(\"activeSubscription.heading\")}\n \n \n );\n};\n\nexport const Q_ACTIVE_SUBSCRIPTION: QuestionDefinition = {\n id: QUESTION_ID,\n shouldShowQuestion: () => true,\n component: ActiveSubscription,\n};\n","import styled from \"@emotion/styled\";\nimport React, { useEffect, useState } from \"react\";\nimport { Trans, useTranslation } from \"react-i18next\";\n\nimport {\n Button,\n Heading,\n Image,\n StackItem,\n Text,\n} from \"@noom/wax-component-library\";\n\nimport { NoomEmailAddressLink } from \"@/components/noom-branding\";\nimport {\n QuestionComponentProps,\n QuestionDefinition,\n} from \"@/components/survey/Question\";\nimport { useTrackEvent } from \"@/hooks\";\n\nimport { BaseInterstitial } from \"../../core\";\n\nconst QUESTION_ID = \"transitionExplainer\";\n\nconst BoldListItem = styled.li`\n font-weight: 500;\n`;\n\nconst Bullet = styled.li`\n list-style-type: disc;\n margin-left: 20px;\n`;\n\nconst TransitionExplainer: React.FC = ({\n onClickBack,\n onClickNext,\n}) => {\n const [isSubmitting, setIsSubmitting] = useState(false);\n const { trackIdentifiedPageViewed } = useTrackEvent();\n const { t } = useTranslation();\n\n useEffect(() => {\n trackIdentifiedPageViewed(\"transitionExplainer\");\n }, []);\n\n return (\n \n \n \n {t(\"transitionExplainer.heading\")}\n \n
    \n \n {t(\"transitionExplainer.listItem1.description\")}\n \n
      \n {t(\"transitionExplainer.listItem1.bullet1\")}\n {t(\"transitionExplainer.listItem1.bullet2\")}\n
    \n
    \n \n {t(\"transitionExplainer.listItem2.description\")}\n \n
      \n {t(\"transitionExplainer.listItem2.bullet\")}\n
    \n
\n \n \n \n \n {\n setIsSubmitting(true);\n onClickNext(null);\n }}\n size=\"xl\"\n type=\"submit\"\n >\n {t(\"transitionExplainer.ctaText\")}\n \n \n \n );\n};\n\nexport const Q_TRANSITION_EXPLAINER: QuestionDefinition = {\n id: QUESTION_ID,\n shouldShowQuestion: () => true,\n component: TransitionExplainer,\n};\n","import { QuestionVisibilityState } from \"@/components/survey/Question\";\nimport {\n HealthConditionOptionId,\n NoomMedMoreOptionsSelection,\n PregnantSelection,\n} from \"@/constants\";\nimport { STATE_FARM_PARTNERS } from \"@/constants/Partners\";\n\nimport { calculateBMI } from \"./calculateBMI\";\n\nconst ELIGIBLE_COMORBIDITIES = [\n HealthConditionOptionId.ABNORMAL_CHOLESTEROL,\n HealthConditionOptionId.LIVER_DISEASE,\n HealthConditionOptionId.LOW_TESTOSTERONE,\n HealthConditionOptionId.HEART_DISEASE,\n HealthConditionOptionId.HIGH_BLOOD_PRESSURE,\n HealthConditionOptionId.OSTEOARTHRITIS,\n HealthConditionOptionId.PCOS_OR_FERTILITY_PROBLEMS,\n HealthConditionOptionId.TYPE2_DIABETES,\n];\n\n/**\n * Returns whether or not a user would qualify for Med based on their BMI and\n * health conditions\n *\n * A user would not qualify if\n * - BMI < 27 or\n * - BMI is between 27-30 and user does not have an eligible comorbodity\n *\n * @param healthConditions the user's answers to the health conditions question\n * @param heightFeetPortion the feet portion of the user's height\n * @param heightInchesPortion the inches portion of the user's height\n * @param weight the user's weight\n * @returns true if the user would qualify for Med, false otherwise\n */\nexport const meetsMedBmiAndComorbityCriteria = (\n healthConditions: string[] | undefined,\n heightFeetPortion: number,\n heightInchesPortion: number,\n weight: number,\n) => {\n const hasEligibleComorbidity = !!healthConditions?.some((hc) =>\n ELIGIBLE_COMORBIDITIES.includes(hc as HealthConditionOptionId),\n );\n\n const bmi = calculateBMI(heightFeetPortion, heightInchesPortion, weight);\n\n return bmi >= 30 || (bmi >= 27 && hasEligibleComorbidity);\n};\n\n/**\n * An extension of the meetsMedBmiAndComorbityCriteria function that also checks that the\n * user does not have an exclusionary health condition (e.g. type 1 diabetes)\n *\n * @param healthConditions the user's answers to the health conditions question\n * @param heightFeetPortion the feet portion of the user's height\n * @param heightInchesPortion the inches portion of the user's height\n * @param weight the user's weight\n * @returns true if the user would qualify for Med, false otherwise\n */\nexport const meetsMedBmiAndHealthConditionsCriteria = (\n healthConditions: string[] | undefined,\n heightFeetPortion: number,\n heightInchesPortion: number,\n weight: number,\n) => {\n if (\n !!healthConditions &&\n healthConditions.includes(HealthConditionOptionId.TYPE1_DIABETES)\n ) {\n return false;\n }\n\n return meetsMedBmiAndComorbityCriteria(\n healthConditions,\n heightFeetPortion,\n heightInchesPortion,\n weight,\n );\n};\n\n/**\n * This function returns whether a user qualifies for Noom Med based on the\n * current visibility state. This is used to determine question visibility\n * so it does mean it will return true if some questions are not answered\n * (e.g. if a user does not answer the pregnant question - user is male, or has\n * not answered the state of residency question yet)\n *\n * @param {QuestionVisibilityState} state The entire visibility state\n * @returns {boolean} True if the user qualifies for Noom Med, false otherwise\n */\nexport const qualifiesForNoomMed = ({\n partnerInfo,\n retriageEligibility,\n surveyAnswers,\n telehealthEligibleStates,\n}: QuestionVisibilityState): boolean => {\n const {\n eligibilityCheck,\n glp1Medication,\n glp1Weight,\n healthConditions,\n heightWeight: { heightFeetPortion, heightInchesPortion, weight } = {},\n liabilityWaiverBMI,\n liabilityWaiverEatingDisorder,\n liabilityWaiverPregnant,\n locationState,\n noomMedMoreOptions,\n pregnant,\n retriageEligibilityCheck,\n } = surveyAnswers;\n\n if (\n liabilityWaiverBMI ||\n liabilityWaiverEatingDisorder ||\n liabilityWaiverPregnant\n ) {\n return false;\n }\n\n let dob;\n if (retriageEligibility) {\n const { eligibleRetriagePrograms, userProfile: { dateOfBirth } = {} } =\n retriageEligibility;\n\n if (!eligibleRetriagePrograms.includes(\"MED\")) {\n return false;\n }\n\n let userProfileDob;\n if (dateOfBirth?.year && dateOfBirth?.month && dateOfBirth?.day) {\n userProfileDob = new Date(\n dateOfBirth.year,\n // Date constructor takes month as an index in range [0,11]\n dateOfBirth.month - 1,\n dateOfBirth.day,\n );\n }\n\n dob = userProfileDob || retriageEligibilityCheck?.dob;\n } else {\n const { configs: { OFFERS_MED = false } = {} } = partnerInfo || {};\n\n if (!OFFERS_MED || !eligibilityCheck?.isMedEligible) {\n return false;\n }\n\n /**\n * https://noomhq.atlassian.net/browse/B2B-2158\n *\n * State Farm users qualify for Noom Med powered by Accolade and bypass\n * normal criteria if they are taking or have a prescription for a GLP-1.\n */\n if (\n STATE_FARM_PARTNERS.includes(partnerInfo?.id as number) &&\n (glp1Medication === \"yes\" ||\n glp1Medication === \"prescriptionNotYetStarted\")\n ) {\n return true;\n }\n\n dob = eligibilityCheck?.dob;\n }\n\n if (\n !dob ||\n heightFeetPortion === undefined ||\n heightInchesPortion === undefined ||\n weight === undefined\n ) {\n return false;\n }\n\n if (pregnant && pregnant !== PregnantSelection.NO) {\n return false;\n }\n\n if (\n locationState &&\n !(telehealthEligibleStates || []).includes(locationState)\n ) {\n return false;\n }\n\n /**\n * Currently the only users who will answer the GLP-1 weight question are\n * CareFirst users. If a user answers the GLP-1 weight question, they must\n * meet both of the following criteria to be eligible for Med:\n *\n * - The user must have BMI 30+ or 27+ with comorbidity when starting GLP-1\n * - The user must have lost at least 5% body weight\n *\n * https://www.figma.com/design/FAbvdVlekwEEUoVF9QvVx2/CareFirst%3A-Existing-GLP-1-users-who-don't-meed-med-criteria?node-id=2-15287&t=zAjFCAdal2WOeCoW-0\n */\n if (glp1Weight !== undefined) {\n return (\n meetsMedBmiAndComorbityCriteria(\n healthConditions,\n heightFeetPortion,\n heightInchesPortion,\n glp1Weight,\n ) && (glp1Weight - weight) / glp1Weight >= 0.05\n );\n }\n\n return (\n meetsMedBmiAndHealthConditionsCriteria(\n healthConditions,\n heightFeetPortion,\n heightInchesPortion,\n weight,\n ) &&\n (!noomMedMoreOptions ||\n noomMedMoreOptions === NoomMedMoreOptionsSelection.MED)\n );\n};\n","import {\n GenderProto_Value,\n SexProto_Value,\n} from \"@noom/noom-contracts/noom_contracts/backend/user/model/sex_and_gender\";\n\nimport { QuestionVisibilityState } from \"@/components/survey/Question\";\nimport { NoomMedMoreOptionsSelection } from \"@/constants\";\nimport { SurveyAnswers } from \"@/contexts/app-context\";\nimport { RetriageEligibility } from \"@/models\";\n\nimport { qualifiesForNoomMed } from \"../qualification\";\n\nexport const shouldShowCardiometabolicQuestionForRetriage = (\n retriageEligibility: RetriageEligibility | undefined,\n): boolean => {\n const { currentProgram, eligibleRetriagePrograms = [] } =\n retriageEligibility || {};\n\n // The retriage eligibility API will not return a retriage program if it is\n // the user's current program (e.g. DPP -> DPP)\n return (\n (currentProgram === \"WEIGHT\" || currentProgram === \"DPP\") &&\n (eligibleRetriagePrograms.includes(\"DPP\") ||\n eligibleRetriagePrograms.includes(\"MED\"))\n );\n};\n\n// Only the following sex and gender values can be cleanly mapped to their respective question options.\n// For other values, we'll need to ask the question again.\nexport const GenderProtoMap: Partial> = {\n MALE: \"male\",\n FEMALE: \"female\",\n};\nexport const SexProtoMap: Partial> = {\n MALE: \"male\",\n FEMALE: \"female\",\n INTERSEX: \"intersex\",\n};\n\n/**\n * Returns true if we prepopulated both sex and gender from retriage eligibility.\n * @param surveyAnswers\n * @param retriageEligibility\n * @returns\n */\nexport const areSexAndGenderPrePopulated = (\n surveyAnswers: SurveyAnswers,\n retriageEligibility?: RetriageEligibility,\n): boolean => {\n const { gender, sex } = retriageEligibility?.userProfile || {};\n\n if (!(sex && gender)) {\n return false;\n }\n\n const isGenderPrePopulated = surveyAnswers.gender && !!GenderProtoMap[gender];\n const isSexPrePopulated = surveyAnswers.sex && !!SexProtoMap[sex];\n\n return !!(isGenderPrePopulated && isSexPrePopulated);\n};\n\nexport const shouldShowDppQualification = (\n state: QuestionVisibilityState,\n): boolean => {\n const {\n retriageEligibility: { currentProgram, eligibleRetriagePrograms = [] } = {},\n selectedProgram,\n surveyAnswers: { dppEligible, noomMedMoreOptions },\n } = state;\n return (\n (!qualifiesForNoomMed(state) ||\n noomMedMoreOptions === NoomMedMoreOptionsSelection.OTHER) &&\n currentProgram === \"WEIGHT\" &&\n eligibleRetriagePrograms.includes(\"DPP\") &&\n selectedProgram !== \"MED\" &&\n selectedProgram !== \"MOOD\" &&\n selectedProgram !== \"NMPBA\" &&\n dppEligible !== false\n );\n};\n","import { Form, Formik } from \"formik\";\nimport React from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport * as Yup from \"yup\";\n\nimport { Button, Spacing, Stack, Text } from \"@noom/wax-component-library\";\n\nimport { InputWithSuffix } from \"@/components/form\";\nimport { enforcePositiveFloat } from \"@/components/form/utils\";\nimport { shouldAskQuarterlyQuestion } from \"@/utils/survey/outcomes\";\nimport { shouldShowDppQualification } from \"@/utils/survey/retriage\";\n\nimport { QuestionComponentProps, QuestionDefinition } from \"../../Question\";\nimport { BaseQuestion } from \"../core\";\n\nconst QUESTION_ID = \"a1c\";\n\ndeclare module \"@/contexts\" {\n interface SurveyAnswers {\n a1c?: number;\n }\n}\n\ntype A1cFormValues = {\n a1c?: number;\n};\n\nconst A1cQuestion: React.FC = ({\n onClickBack,\n onClickNext,\n surveyAnswers,\n}) => {\n const { t } = useTranslation();\n\n const initialValues: A1cFormValues = {\n a1c: surveyAnswers.a1c,\n };\n\n const validationSchema = Yup.object({\n a1c: Yup.number()\n .required(t(\"a1c.form.a1c.errors.required\"))\n .min(3, t(\"a1c.form.a1c.errors.invalid\"))\n .max(20, t(\"a1c.form.a1c.errors.invalid\")),\n });\n\n return (\n \n onClickNext(a1c!)}\n validateOnBlur={false}\n validationSchema={validationSchema}\n >\n {({ errors, getFieldProps, handleSubmit, touched }) => (\n
\n \n \n \n onClickNext(undefined)}\n >\n \n {t(\"a1c.ctaText.forgot\")}\n \n \n \n
\n )}\n \n \n );\n};\n\nexport const Q_A1C: QuestionDefinition = {\n id: QUESTION_ID,\n shouldShowQuestion: ({ selectedProgram, surveyAnswers: { hadA1cTested } }) =>\n selectedProgram !== \"MOOD\" && hadA1cTested === \"yes\",\n component: A1cQuestion,\n};\n\nexport const Q_OUTCOMES_A1C: QuestionDefinition = {\n id: QUESTION_ID,\n shouldShowQuestion: ({ surveyAnswers: { hadA1cTested }, userProfile }) =>\n userProfile?.currentProgram !== \"MOOD\" &&\n hadA1cTested === \"yes\" &&\n shouldAskQuarterlyQuestion(userProfile),\n component: A1cQuestion,\n};\n\nexport const Q_RETRIAGE_A1C: QuestionDefinition = {\n id: QUESTION_ID,\n shouldShowQuestion: (state) => {\n const {\n surveyAnswers: { prediabetesHistory },\n } = state;\n return (\n shouldShowDppQualification(state) && !!prediabetesHistory?.includes(\"a1c\")\n );\n },\n component: A1cQuestion,\n};\n","import React from \"react\";\nimport { useTranslation } from \"react-i18next\";\n\nimport {\n QuestionComponentProps,\n QuestionDefinition,\n QuestionOption,\n} from \"@/components/survey/Question\";\nimport { MultipleChoiceQuestion } from \"@/components/survey/questionTypes/core\";\nimport {\n BloodGlucoseTrackingSelection, HealthConditionOptionId, PrimaryCareProviderSelection\n} from \"@/constants\";\n\nconst QUESTION_ID = \"bloodGlucoseTracking\";\n\ndeclare module \"@/contexts\" {\n interface SurveyAnswers {\n bloodGlucoseTracking?: BloodGlucoseTrackingSelection;\n }\n}\n\nconst BloodGlucoseTrackingQuestion: React.FC = ({\n onClickBack,\n onClickNext,\n surveyAnswers,\n}) => {\n const { t } = useTranslation();\n\n const options: QuestionOption[] = [\n {\n id: BloodGlucoseTrackingSelection.YES,\n text: t(\"bloodGlucoseTracking.options.yes\"),\n },\n {\n id: BloodGlucoseTrackingSelection.NO,\n text: t(\"bloodGlucoseTracking.options.no\"),\n },\n ];\n\n return (\n \n );\n};\n\nexport const Q_BLOOD_GLUCOSE_TRACKING: QuestionDefinition = {\n id: QUESTION_ID,\n shouldShowQuestion: ({ partnerInfo, surveyAnswers: { primaryCareProvider, healthConditions } }) =>\n !!(partnerInfo?.configs.OFFERS_DIABETES_MANAGEMENT &&\n healthConditions?.includes(HealthConditionOptionId.TYPE2_DIABETES) &&\n primaryCareProvider === PrimaryCareProviderSelection.YES),\n component: BloodGlucoseTrackingQuestion,\n};\n","import React from \"react\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { CreateAccountForm, CreateAccountFormValues } from \"@/components/forms\";\nimport { useAppContext } from \"@/contexts\";\nimport { isBuyflowTraffic } from \"@/utils/userSegment\";\n\nimport { QuestionComponentProps, QuestionDefinition } from \"../../Question\";\nimport { BaseQuestion } from \"../core\";\n\nconst QUESTION_ID = \"createAccount\";\nexport const CREATE_ACCOUNT_QUESTION_ID = QUESTION_ID;\n\ndeclare module \"@/contexts\" {\n interface SurveyAnswers {\n createAccount?: CreateAccountFormValues;\n }\n}\n\nconst CreateAccountQuestion: React.FC = ({\n onClickBack,\n onClickNext,\n surveyAnswers,\n}) => {\n const {\n enrollmentInfo: { upfrontEligibilityEnforcement } = {},\n partnerInfo,\n } = useAppContext();\n\n const { t } = useTranslation();\n\n const onSubmit = (values: CreateAccountFormValues) => {\n onClickNext(values);\n };\n\n const firstName = surveyAnswers.eligibilityCheck?.firstName;\n\n const context =\n // eslint-disable-next-line no-nested-ternary\n upfrontEligibilityEnforcement !== \"NONE\"\n ? partnerInfo?.configs.HIDE_COST\n ? \"upfrontEligibilityEnforcement_hideCost\"\n : \"upfrontEligibilityEnforcement\"\n : \"\";\n\n return (\n \n \n \n );\n};\n\nexport const Q_CREATE_ACCOUNT: QuestionDefinition = {\n id: QUESTION_ID,\n shouldShowQuestion: () => {\n const queryParams = new URLSearchParams(window.location.search);\n return !queryParams.get(\"eligibilityId\") || isBuyflowTraffic();\n },\n component: CreateAccountQuestion,\n};\n","import { Form, Formik } from \"formik\";\nimport React from \"react\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { Button, Spacing, Stack } from \"@noom/wax-component-library\";\n\nimport {\n PasswordInput,\n PasswordInputValidationSchema,\n} from \"@/components/form\";\n\nimport { QuestionComponentProps, QuestionDefinition } from \"../../Question\";\nimport { BaseQuestion } from \"../core\";\n\nconst QUESTION_ID = \"createPassword\";\n\ndeclare module \"@/contexts\" {\n interface SurveyAnswers {\n createPassword?: string;\n }\n}\n\ntype CreatePasswordFormValues = {\n password: string;\n};\n\nconst CreatePasswordQuestion: React.FC = ({\n onClickBack,\n onClickNext,\n surveyAnswers,\n}) => {\n const { t } = useTranslation();\n\n const initialValues: CreatePasswordFormValues = {\n password: surveyAnswers.createPassword || \"\",\n };\n\n const onSubmit = ({ password }: CreatePasswordFormValues) => {\n onClickNext(password);\n };\n\n return (\n \n \n {({ handleChange, handleSubmit, validateField }) => {\n const handleInputChange = async (\n e: React.ChangeEvent,\n fieldName: keyof CreatePasswordFormValues,\n ) => {\n // This is a hacky method to get each field to validate on change\n // individually.\n await handleChange(e);\n validateField(fieldName);\n };\n\n return (\n
\n \n handleInputChange(e, \"password\")}\n userInputs={[]}\n />\n \n \n
\n );\n }}\n \n \n );\n};\n\nexport const Q_CREATE_PASSWORD: QuestionDefinition = {\n id: QUESTION_ID,\n shouldShowQuestion: ({ hasB2cAccount }) => !hasB2cAccount,\n component: CreatePasswordQuestion,\n};\n","import { Formik } from \"formik\";\nimport { TFunction } from \"i18next\";\nimport Cookies from \"js-cookie\";\nimport React, { useEffect } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport * as Yup from \"yup\";\n\nimport { StatusEnumProto_Value } from \"@noom/noom-contracts/noom_contracts/backend/privacy/user_policy_options\";\nimport {\n Button,\n Checkbox,\n Input,\n Spacing,\n Stack,\n Text,\n} from \"@noom/wax-component-library\";\n\nimport {\n getAllLanguageOptions,\n PhoneInput,\n PhoneInputSchema,\n PhoneNumber,\n PreferredLanguageSelector,\n} from \"@/components/form\";\nimport {\n AddressForm,\n AddressSchema,\n buildAddressSchema,\n HealthDataConsentForm,\n} from \"@/components/forms\";\nimport {\n QuestionComponentProps,\n QuestionDefinition,\n} from \"@/components/survey/Question\";\nimport { CONSUMER_HEALTH_LAW_STATES, DEFAULT_ADDRESS } from \"@/constants\";\nimport { HEALTH_DATA_CONSENT_DISABLED_PARTNERS } from \"@/constants/Partners\";\nimport { useAppContext } from \"@/contexts\";\nimport { useTrackEvent } from \"@/hooks\";\nimport { Address } from \"@/models\";\nimport { OPT_OUT_COOKIE_NAME } from \"@/utils/consent/opt-out\";\nimport { isCareFirstPartner } from \"@/utils/partners\";\n\nimport { BaseQuestion } from \"../core\";\n\nconst QUESTION_ID = \"completeProfile\";\n\nexport type FormValues = {\n address: Address;\n sameShippingAddress?: boolean;\n shippingAddress?: Address;\n employeeId?: string;\n locale?: string;\n phoneNumber: PhoneNumber;\n consentStatus?: StatusEnumProto_Value;\n consentSignature?: string;\n};\n\ndeclare module \"@/contexts\" {\n interface SurveyAnswers {\n completeProfile?: Omit;\n }\n}\n\n/**\n * Determines if the health data consent form should be shown based on the\n * partner and the user's home state.\n *\n * @param region Selected region (US state) in the address form\n * @param partnerSlug Slug of the partner for which the user is enrolling into\n * @returns True if the form is able to be shown to that partner and user is\n * located in an applicable state, false otherwise\n */\nconst shouldShowHealthDataConsent = (region: string, partnerSlug = \"\") =>\n !HEALTH_DATA_CONSENT_DISABLED_PARTNERS.includes(partnerSlug) &&\n CONSUMER_HEALTH_LAW_STATES.includes(region);\n\nconst getValidationSchema = (\n t: TFunction,\n showEmployeeIdField: boolean,\n partnerSlug = \"\",\n) => {\n let baseSchema = Yup.object({\n address: AddressSchema,\n sameShippingAddress: Yup.boolean(),\n phoneNumber: PhoneInputSchema,\n shippingAddress: buildAddressSchema(\"shippingAddress\").when(\n \"sameShippingAddress\",\n {\n is: true,\n then: () => Yup.mixed().notRequired(),\n otherwise: (s) => s.required(),\n },\n ),\n consentStatus: Yup.string().when(\"address.region\", {\n is: (region: string) => shouldShowHealthDataConsent(region, partnerSlug),\n then: (schema) => schema.required(),\n otherwise: (schema) => schema,\n }),\n consentSignature: Yup.string().when(\"address.region\", {\n is: (region: string) => shouldShowHealthDataConsent(region, partnerSlug),\n then: (schema) =>\n schema\n .trim()\n .required(\n t(\"form.healthDataConsent.consentSignature.errors.required\"),\n )\n .test(\n \"is-valid-length\",\n t(\"form.healthDataConsent.consentSignature.errors.tooLong\"),\n (value = \"\") => value.length <= 100,\n ),\n otherwise: (schema) => schema,\n }),\n });\n\n if (showEmployeeIdField) {\n baseSchema = baseSchema.shape({\n employeeId: Yup.string().required(t(\"form.employeeId.errors.required\")),\n });\n }\n\n return baseSchema;\n};\n\nconst CompleteProfileQuestion: React.FC = ({\n onClickBack,\n onClickNext,\n surveyAnswers,\n}) => {\n const {\n eligibilityInfo,\n enrollmentInfo: { upfrontEligibilityEnforcement } = {},\n partnerInfo,\n selectedProgram,\n } = useAppContext();\n const { trackAnonEvent } = useTrackEvent();\n const { i18n, t } = useTranslation();\n\n // The Employee ID field is typically shown on the eligibility page. We want\n // to show it on the complete profile page if it is not used in eligibility\n // but should still be collected.\n\n const showEmployeeIdFieldOnEligibilityCheck =\n upfrontEligibilityEnforcement === \"PARTICIPANT_ID\" ||\n upfrontEligibilityEnforcement === \"PARTICIPANT_ID_LAST_NAME\" ||\n upfrontEligibilityEnforcement === \"PARTICIPANT_ID_FULL_NAME\" ||\n upfrontEligibilityEnforcement === \"UHC_OPTUM_BIG_FIVE\";\n\n const showEmployeeIdFieldOnCompleteProfile =\n !showEmployeeIdFieldOnEligibilityCheck &&\n (partnerInfo?.configs?.REQUIRES_PARTICIPANT_ID || false);\n\n const isNoomWeightProgram = selectedProgram === \"WEIGHT\";\n const supportedLocales = partnerInfo?.supportedLocales || [\"en\"];\n const showLanguageDropdown =\n isNoomWeightProgram && supportedLocales.length > 1;\n\n const defaultInitialValues: FormValues = {\n address: eligibilityInfo?.address || DEFAULT_ADDRESS,\n phoneNumber: {\n country: \"us\",\n dialCode: \"1\",\n value: eligibilityInfo?.phoneNumber || \"\",\n },\n sameShippingAddress: true,\n shippingAddress: eligibilityInfo?.address || DEFAULT_ADDRESS,\n ...(showLanguageDropdown && { locale: getAllLanguageOptions()[0]?.value }),\n };\n\n const onSubmit = (values: FormValues) => {\n const { sameShippingAddress, ...answers } = values;\n if (sameShippingAddress) {\n delete answers.shippingAddress;\n }\n\n if (values.consentStatus === \"OPT_OUT_DO_NOT_SHARE\") {\n Cookies.set(OPT_OUT_COOKIE_NAME, \"true\");\n }\n\n onClickNext(answers);\n };\n\n useEffect(() => {\n trackAnonEvent(\"b2bEnrollmentAnonProgramAssigned\", {\n b2bProgram: selectedProgram || \"PROGRAM_UNSPECIFIED\",\n });\n }, []);\n\n return (\n \n \n {({\n errors,\n getFieldProps,\n handleChange,\n handleSubmit,\n isSubmitting,\n touched,\n validateField,\n values,\n }) => {\n const showHealthDataConsent = shouldShowHealthDataConsent(\n values.address.region,\n partnerInfo?.slug,\n );\n\n const handleInputChange = async (\n e:\n | React.ChangeEvent\n | React.ChangeEvent,\n fieldName: keyof FormValues,\n ) => {\n // This is a hacky method to get each field to validate on change\n // individually.\n await handleChange(e);\n validateField(fieldName);\n };\n return (\n
\n \n {showEmployeeIdFieldOnCompleteProfile && (\n handleInputChange(e, \"employeeId\")}\n placeholder={t(\"form.employeeId.placeholder\")}\n />\n )}\n \n {showLanguageDropdown && (\n \n )}\n \n {surveyAnswers.scaleOptIn && (\n \n {t(\"completeProfile.scaleOptIn.sameAddress\")}\n \n )}\n {surveyAnswers.scaleOptIn && !values.sameShippingAddress && (\n \n \n {t(\"completeProfile.scaleOptIn.differentAddress\")}\n \n \n \n )}\n {showHealthDataConsent && }\n \n {t(\"completeProfile.ctaText\")}\n \n {isCareFirstPartner(partnerInfo) && (\n {t(\"completeProfile.disclaimer.carefirst\")}\n )}\n \n
\n );\n }}\n \n \n );\n};\nexport const Q_COMPLETE_PROFILE: QuestionDefinition = {\n id: QUESTION_ID,\n shouldShowQuestion: () => true,\n component: CompleteProfileQuestion,\n};\n","import { differenceInYears } from \"date-fns\";\n\nimport { CoursePackSlug, ProgramOffering } from \"@/constants\";\nimport { type SurveyAnswers } from \"@/contexts\";\nimport { Partner } from \"@/models\";\nimport { captureException } from \"@/utils/sentry\";\n\nimport { isB2CPartner } from \"../partners\";\n\nexport const getRecommendedCoursePacks = (\n program: ProgramOffering | null,\n surveyAnswers: SurveyAnswers,\n): CoursePackSlug[] => {\n const recommendedCoursePacks: CoursePackSlug[] = [];\n\n const { eligibilityCheck, glp1Medication, sleep, stressEating } =\n surveyAnswers;\n\n const { age, dob } = eligibilityCheck ?? {};\n\n const missingAnswers = Object.entries({\n ...(!dob && { age }),\n ...(!age && { dob }),\n glp1Medication,\n sleep,\n stressEating,\n })\n .filter(([, v]) => !v)\n .map(([k]) => k);\n\n if (missingAnswers.length) {\n captureException(\n Error(\n \"Missing expected survey answer(s) when calculating recommended course packs.\",\n ),\n { missingAnswers },\n );\n return [];\n }\n\n if ([\"frequently\", \"everyNight\"].includes(sleep ?? \"\")) {\n recommendedCoursePacks.push(\"SLEEP\");\n }\n\n if (\n glp1Medication === \"yes\" ||\n glp1Medication === \"prescriptionNotYetStarted\"\n ) {\n recommendedCoursePacks.push(\"GLP1\");\n }\n\n if ([\"agree\", \"stronglyAgree\"].includes(stressEating ?? \"\")) {\n recommendedCoursePacks.push(\"NW_PLUS\");\n }\n\n const calculatedAge = dob\n ? differenceInYears(new Date(), dob as Date)\n : Number(age);\n if (calculatedAge >= 40) {\n recommendedCoursePacks.push(\"AGING_AND_METABOLISM\");\n }\n\n return recommendedCoursePacks;\n};\n\nexport const isPersonalizationEnabled = (\n partnerInfo: Partner | null,\n selectedProgram: ProgramOffering | null,\n) =>\n [\"MED\", \"NMPBA\", \"WEIGHT\"].includes(selectedProgram ?? \"\") &&\n !isB2CPartner(partnerInfo);\n\nexport const shouldShowPersonalizationFlow = (\n partnerInfo: Partner | null,\n selectedProgram: ProgramOffering | null,\n surveyAnswers: SurveyAnswers,\n) =>\n isPersonalizationEnabled(partnerInfo, selectedProgram) &&\n getRecommendedCoursePacks(selectedProgram, surveyAnswers).length > 0;\n","import React, { useEffect } from \"react\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { CheckboxOption } from \"@/components/survey/checkbox\";\nimport { CoursePackSlug } from \"@/constants\";\nimport { SurveyAnswer, useAppContext } from \"@/contexts\";\nimport { useTrackEvent } from \"@/hooks\";\nimport {\n getRecommendedCoursePacks,\n shouldShowPersonalizationFlow,\n} from \"@/utils/survey/contentPersonalization\";\n\nimport { QuestionComponentProps, QuestionDefinition } from \"../../Question\";\nimport { CheckboxQuestion } from \"../core\";\n\nconst QUESTION_ID = \"coursePackSelection\";\n\ndeclare module \"@/contexts\" {\n interface SurveyAnswers {\n coursePackSelection?: CoursePackSlug[];\n }\n}\n\nconst CoursePackSelectionQuestion: React.FC = ({\n onClickBack,\n onClickNext,\n surveyAnswers,\n}) => {\n const { selectedProgram } = useAppContext();\n const { trackAnonEvent } = useTrackEvent();\n const { t } = useTranslation();\n\n const recommendedCoursePacks = getRecommendedCoursePacks(\n selectedProgram,\n surveyAnswers,\n );\n\n const options: (Omit & {\n id: CoursePackSlug;\n })[] = [\n {\n id: \"AGING_AND_METABOLISM\",\n text: t(\"coursePackSelection.options.agingAndMetabolism.text\"),\n subtext: t(\"coursePackSelection.options.agingAndMetabolism.subtext\"),\n },\n\n {\n id: \"NW_PLUS\",\n text: t(\"coursePackSelection.options.stressEating.text\"),\n subtext: t(\"coursePackSelection.options.stressEating.subtext\"),\n },\n\n {\n id: \"SLEEP\",\n text: t(\"coursePackSelection.options.sleep.text\"),\n subtext: t(\"coursePackSelection.options.sleep.subtext\"),\n },\n\n {\n id: \"GLP1\",\n text: t(\"coursePackSelection.options.glp1.text\"),\n subtext: t(\"coursePackSelection.options.glp1.subtext\"),\n },\n ];\n\n const trackSelectedCoursePacksAndProceed = async (answer: SurveyAnswer) => {\n const selectedCoursePacks = answer as CoursePackSlug[];\n\n trackAnonEvent(\"b2bEnrollmentAnonCoursePacksSelected\", {\n recommendedCoursePacks,\n selectedCoursePacks,\n });\n\n onClickNext(selectedCoursePacks);\n };\n\n useEffect(() => {\n trackAnonEvent(\"b2bEnrollmentAnonCoursePacksRecommended\", {\n recommendedCoursePacks,\n });\n }, []);\n\n return (\n \n recommendedCoursePacks.includes(option.id),\n )}\n hiddenOptions={options.filter(\n (option) => !recommendedCoursePacks.includes(option.id),\n )}\n questionHelperText={t(\"coursePackSelection.questionHelperText\")}\n questionId={QUESTION_ID}\n questionText={t(\"coursePackSelection.questionText\")}\n selectedItems={surveyAnswers[QUESTION_ID] || recommendedCoursePacks}\n />\n );\n};\n\nexport const Q_COURSE_PACK_SELECTION: QuestionDefinition = {\n id: QUESTION_ID,\n shouldShowQuestion: ({ partnerInfo, selectedProgram, surveyAnswers }) =>\n shouldShowPersonalizationFlow(partnerInfo, selectedProgram, surveyAnswers),\n component: CoursePackSelectionQuestion,\n};\n","import React from \"react\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { partnerOffersPrograms } from \"@/utils/programs\";\nimport { shouldShowDppQualification } from \"@/utils/survey/retriage\";\n\nimport {\n QuestionComponentProps,\n QuestionDefinition,\n QuestionOption,\n} from \"../../Question\";\nimport { CheckboxQuestion } from \"../core\";\n\nconst QUESTION_ID = \"difficulties\";\n\ndeclare module \"@/contexts\" {\n interface SurveyAnswers {\n difficulties?: string[];\n }\n}\n\nconst DifficultiesQuestion: React.FC = ({\n onClickBack,\n onClickNext,\n surveyAnswers,\n}) => {\n const { t } = useTranslation();\n\n const options: QuestionOption[] = [\n { id: \"hearing\", text: t(\"difficulties.options.hearing\") },\n { id: \"vision\", text: t(\"difficulties.options.vision\") },\n { id: \"cognitive\", text: t(\"difficulties.options.cognitive\") },\n { id: \"mobility\", text: t(\"difficulties.options.mobility\") },\n { id: \"selfCare\", text: t(\"difficulties.options.selfCare\") },\n {\n id: \"independentLiving\",\n text: t(\"difficulties.options.independentLiving\"),\n },\n { id: \"none\", text: t(\"difficulties.options.none\") },\n { id: \"preferNotToSay\", text: t(\"difficulties.options.preferNotToSay\") },\n ];\n\n return (\n \n );\n};\n\nexport const Q_DIFFICULTIES: QuestionDefinition = {\n id: QUESTION_ID,\n shouldShowQuestion: ({\n enrollmentInfo,\n partnerInfo,\n selectedProgram,\n surveyAnswers: { dppEligible },\n }) =>\n partnerOffersPrograms([\"DPP\"], enrollmentInfo, partnerInfo) &&\n selectedProgram !== \"MED\" &&\n selectedProgram !== \"MOOD\" &&\n selectedProgram !== \"NMPBA\" &&\n dppEligible === true,\n component: DifficultiesQuestion,\n};\n\nexport const Q_RETRIAGE_DIFFICULTIES: QuestionDefinition = {\n id: QUESTION_ID,\n shouldShowQuestion: (state) => shouldShowDppQualification(state),\n component: DifficultiesQuestion,\n};\n","import React, { useState } from \"react\";\nimport { Trans, useTranslation } from \"react-i18next\";\n\nimport { ScreenedOutReason } from \"@/constants\";\nimport { SurveyAnswer, useAppContext } from \"@/contexts\";\nimport { shouldShowCardiometabolicQuestionForRetriage } from \"@/utils/survey/retriage\";\n\nimport {\n QuestionComponentProps,\n QuestionDefinition,\n QuestionOption,\n} from \"../../Question\";\nimport { MultipleChoiceQuestion } from \"../core\";\n\nconst QUESTION_ID = \"eatingDisorder\";\n\ndeclare module \"@/contexts\" {\n interface SurveyAnswers {\n eatingDisorder?: string;\n }\n}\n\nconst EatingDisorderQuestion: React.FC = ({\n onClickBack,\n onClickNext,\n surveyAnswers,\n}) => {\n const { enrollmentType } = useAppContext();\n const [shouldShowConfirmation, setShouldShowConfirmation] = useState(false);\n const [selectedItem, setSelectedItem] = useState(\n surveyAnswers[QUESTION_ID] || \"\",\n );\n const { t } = useTranslation();\n\n const options: QuestionOption[] = [\n { id: \"yes\", text: t(\"eatingDisorder.options.yes\") },\n { id: \"no\", text: t(\"eatingDisorder.options.no\") },\n ];\n\n const handleAnswerBeforeProceeding = async (\n answer: SurveyAnswer,\n _additionalAnswers?: Record,\n _screenedOutReason?: ScreenedOutReason,\n source?: \"button\" | \"option\",\n ) => {\n setSelectedItem(answer as string);\n\n if (answer === \"yes\" && enrollmentType !== \"INITIAL_ENROLLMENT\") {\n onClickNext(answer, {}, ScreenedOutReason.EATING_DISORDER);\n return;\n }\n\n if (source === \"button\") {\n onClickNext(answer);\n return;\n }\n\n if (shouldShowConfirmation) {\n return;\n }\n\n if (\n enrollmentType === \"INITIAL_ENROLLMENT\" &&\n answer === \"yes\" &&\n !shouldShowConfirmation\n ) {\n setShouldShowConfirmation(true);\n return;\n }\n\n onClickNext(answer);\n };\n\n return (\n \n ) : undefined\n }\n ctaText={shouldShowConfirmation ? t(\"eatingDisorder.ctaText\") : \"\"}\n onClickBack={onClickBack}\n onClickNext={handleAnswerBeforeProceeding}\n options={options}\n questionId={QUESTION_ID}\n questionText={t(\"eatingDisorder.questionText\")}\n selectedItem={selectedItem}\n />\n );\n};\n\nexport const Q_EATING_DISORDER: QuestionDefinition = {\n id: QUESTION_ID,\n shouldShowQuestion: ({ selectedProgram }) => selectedProgram !== \"MOOD\",\n component: EatingDisorderQuestion,\n};\n\nexport const Q_RETRIAGE_EATING_DISORDER: QuestionDefinition = {\n id: QUESTION_ID,\n shouldShowQuestion: ({ retriageEligibility }) =>\n shouldShowCardiometabolicQuestionForRetriage(retriageEligibility),\n component: EatingDisorderQuestion,\n};\n","import React from \"react\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { Button, Link } from \"@noom/wax-component-library\";\n\nimport { buildDeeplink } from \"@/constants\";\n\ntype ContinueToDownloadButtonProps = {\n email?: string;\n};\n\nexport const ContinueToDownloadButton: React.FC<\n ContinueToDownloadButtonProps\n> = ({ email }) => {\n const { t } = useTranslation();\n\n return (\n \n \n \n );\n};\n","import React from \"react\";\n\nimport { Box, Heading, Text } from \"@noom/wax-component-library\";\n\nimport { NoomHeader } from \"@/components/noom-branding\";\n\ntype FullscreenMessageProps = {\n button?: React.ReactElement;\n heading: string;\n message: React.ReactElement;\n visual: React.ReactElement;\n};\n\nexport const FullscreenMessage: React.FC = ({\n button,\n heading,\n message,\n visual,\n}) => (\n \n \n \n \n {visual}\n \n \n {heading}\n \n \n {message}\n \n {button && {button}}\n \n \n);\n","import styled from \"@emotion/styled\";\nimport React, { useRef, useState } from \"react\";\n\n// The video shows black borders around the sides, so this is the\n// only component that uses emotion to remove the styling\n// https://stackoverflow.com/questions/20771971/video-player-shows-black-border\nconst VideoComponent = styled.video`\n clip-path: inset(21px 1px);\n margin: auto;\n`;\n\nexport const TryAgainVideo: React.FC = () => {\n const videoRef = useRef(null);\n const [hasLoopedOnce, setHasLoopedOnce] = useState(false);\n\n const onEndedVideo = () => {\n if (hasLoopedOnce) {\n return;\n }\n\n setHasLoopedOnce(true);\n\n if (videoRef?.current) {\n try {\n videoRef.current.play().catch(() => null);\n } catch (e) {\n // noop\n }\n }\n };\n\n return (\n \n );\n};\n","import { format } from \"date-fns\";\nimport React, { useEffect, useState } from \"react\";\nimport { Trans, useTranslation } from \"react-i18next\";\n\nimport { Box, Heading, Image, Text } from \"@noom/wax-component-library\";\n\nimport { TryAgainVideo } from \"@/components\";\nimport {\n defaultEligibilityCheckFormValues,\n EligibilityCheckForm,\n EligibilityCheckFormValues,\n} from \"@/components/forms/EligibilityCheckForm\";\nimport { NoomEmailAddressLink } from \"@/components/noom-branding\";\nimport {\n QuestionComponentProps,\n QuestionDefinition,\n} from \"@/components/survey/Question\";\nimport { DOB_FORMAT } from \"@/constants\";\nimport { useAppContext } from \"@/contexts\";\nimport {\n EligibilityResult,\n useEligibility,\n useQueryParams,\n useTrackEvent,\n} from \"@/hooks\";\nimport { getDisplayName } from \"@/models\";\nimport { isCareFirstPartner } from \"@/utils/partners\";\nimport { withPiiQueryParams } from \"@/utils/pixels/urlParamsPii\";\nimport { isBuyflowTraffic } from \"@/utils/userSegment\";\n\nimport { BaseOutline, BaseQuestion } from \"../core\";\n\nconst QUESTION_ID = \"eligibilityCheck\";\nexport const ELIGIBILITY_CHECK_QUESTION_ID = QUESTION_ID;\n\ndeclare module \"@/contexts\" {\n interface SurveyAnswers {\n eligibilityCheck?: EligibilityCheckFormValues;\n }\n}\n\nconst EligibilityCheckQuestion: React.FC = ({\n onClickBack,\n onClickNext,\n surveyAnswers,\n}) => {\n const { eligibilityInfo, partnerInfo } = useAppContext();\n const {\n checkEligibility,\n hasEligibilityError,\n redirectToParticipantPartner,\n setHasEligibilityError,\n } = useEligibility();\n const { trackAnonEvent } = useTrackEvent();\n const queryParams = useQueryParams();\n const [initialValues, setInitialValues] = useState(\n surveyAnswers[QUESTION_ID] || defaultEligibilityCheckFormValues,\n );\n const [localEligibilityResult, setLocalEligibilityResult] = useState<\n EligibilityResult | undefined\n >();\n const [submittedValues, setSubmittedValues] = useState<\n EligibilityCheckFormValues | undefined\n >();\n const { t } = useTranslation();\n\n const partnerId = partnerInfo?.id;\n\n const getEligibilityResult = async (values: EligibilityCheckFormValues) => {\n if (!partnerId) {\n return;\n }\n\n const result = await checkEligibility(\n {\n dateOfBirth: values?.dob\n ? format(values.dob as Date, DOB_FORMAT)\n : undefined,\n firstName: values.firstName,\n lastName: values.lastName,\n participantId: values?.employeeId,\n policyId: values?.policyId,\n },\n partnerId,\n queryParams.leadSource,\n );\n setLocalEligibilityResult(result);\n };\n\n const onSubmit = async (values: EligibilityCheckFormValues) => {\n if (!localEligibilityResult) {\n return;\n }\n\n const {\n isEligible,\n isMedEligible,\n participantEligibilityId,\n participantPartnerId,\n upid,\n } = localEligibilityResult;\n\n if (!isEligible) {\n setHasEligibilityError(true);\n return;\n }\n\n if (partnerId !== participantPartnerId) {\n redirectToParticipantPartner(\n participantEligibilityId,\n participantPartnerId,\n upid,\n );\n } else {\n onClickNext({ ...values, isMedEligible });\n }\n };\n\n // Call getEligibilityResult after the form values are set in local state\n useEffect(() => {\n if (!submittedValues) {\n return;\n }\n getEligibilityResult(submittedValues);\n }, [submittedValues]);\n\n // Only call onSubmit after eligibilityInfo has been evaluated and updated in\n // app state through the checkEligibility call.\n useEffect(() => {\n if (!(eligibilityInfo && localEligibilityResult && submittedValues)) {\n return;\n }\n onSubmit(submittedValues);\n }, [eligibilityInfo, localEligibilityResult, submittedValues]);\n\n useEffect(() => {\n const queryParamsWithPii = withPiiQueryParams(queryParams);\n trackAnonEvent(\"b2bEnrollmentAnonTriageFlowStarted\", {\n leadSource: queryParamsWithPii.leadSource,\n utmSource: queryParamsWithPii.utm_source,\n utmMedium: queryParamsWithPii.utm_medium,\n utmCampaign: queryParamsWithPii.utm_campaign,\n utmTerm: queryParamsWithPii.utm_term,\n utmContent: queryParamsWithPii.utm_content,\n });\n }, []);\n\n const partnerName = getDisplayName(partnerInfo);\n\n const hideNoomCostMention = partnerInfo?.configs?.HIDE_COST || false;\n\n const getQuestionHelperContext = () => {\n if (isCareFirstPartner(partnerInfo)) {\n return \"carefirst\";\n }\n\n return hideNoomCostMention ? \"notFree\" : \"free\";\n };\n\n const questionHelperText = t(\"eligibilityCheck.questionHelperText\", {\n context: getQuestionHelperContext(),\n partnerName,\n });\n\n return hasEligibilityError ? (\n // TODO (@jason.pao): Integrate with existing error view\n \n \n \n \n \n {t(\"error.failedEligibilityCheck.errorMessage\")}\n \n \n \n We need a match in order to confirm your eligibility. Please go back\n and double check the details you provided.\n
\n
\n Still having issues? Email {NoomEmailAddressLink} with your name,\n email, and membership sponsor and our team will do our best to help\n you out.\n
\n
\n If you aren't eligible and still want to use Noom, you can sign\n up and pay for a membership at\n noom.com.\n
\n
\n \n
\n ) : (\n \n setSubmittedValues({ ...values })}\n pageId=\"eligibilityCheck\"\n setInitialValues={setInitialValues}\n />\n \n );\n};\n\nexport const Q_ELIGIBILITY_CHECK: QuestionDefinition = {\n id: QUESTION_ID,\n shouldShowQuestion: () => {\n const queryParams = new URLSearchParams(window.location.search);\n return isBuyflowTraffic() && !queryParams.get(\"eligibilityId\");\n },\n component: EligibilityCheckQuestion,\n};\n","import React from \"react\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { partnerOffersPrograms } from \"@/utils/programs\";\nimport { shouldShowDppQualification } from \"@/utils/survey/retriage\";\n\nimport {\n QuestionComponentProps,\n QuestionDefinition,\n QuestionOption,\n} from \"../../Question\";\nimport { MultipleChoiceQuestion } from \"../core\";\n\nconst QUESTION_ID = \"education\";\n\ndeclare module \"@/contexts\" {\n interface SurveyAnswers {\n education?: string;\n }\n}\n\nconst EducationQuestion: React.FC = ({\n onClickBack,\n onClickNext,\n surveyAnswers,\n}) => {\n const { t } = useTranslation();\n\n const optionIds = [\n \"lessThanHighSchool\",\n \"highSchool\",\n \"collegeNoDegree\",\n \"collegeDegree\",\n \"preferNotToSay\",\n ];\n\n const options: QuestionOption[] = optionIds.map((id) => ({\n id,\n text: t(`education.options.${id}`),\n }));\n\n return (\n \n );\n};\n\nexport const Q_EDUCATION: QuestionDefinition = {\n id: QUESTION_ID,\n shouldShowQuestion: ({\n enrollmentInfo,\n partnerInfo,\n selectedProgram,\n surveyAnswers: { dppEligible },\n }) =>\n partnerOffersPrograms([\"DPP\"], enrollmentInfo, partnerInfo) &&\n selectedProgram !== \"MED\" &&\n selectedProgram !== \"MOOD\" &&\n selectedProgram !== \"NMPBA\" &&\n dppEligible === true,\n component: EducationQuestion,\n};\n\nexport const Q_RETRIAGE_EDUCATION: QuestionDefinition = {\n id: QUESTION_ID,\n shouldShowQuestion: (state) => shouldShowDppQualification(state),\n component: EducationQuestion,\n};\n","import React from \"react\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { getAge, getDateOfBirth } from \"@/utils/age\";\nimport { captureException } from \"@/utils/sentry\";\n\nimport {\n QuestionComponentProps,\n QuestionDefinition,\n QuestionOption,\n} from \"../../Question\";\nimport { MultipleChoiceQuestion } from \"../core\";\n\nconst QUESTION_ID = \"enrolledInMedicare\";\n\ndeclare module \"@/contexts\" {\n interface SurveyAnswers {\n enrolledInMedicare?: string;\n }\n}\n\nconst EnrolledInMedicareQuestion: React.FC = ({\n onClickBack,\n onClickNext,\n surveyAnswers,\n}) => {\n const { t } = useTranslation();\n\n const options: QuestionOption[] = [\n { id: \"yes\", text: t(\"enrolledInMedicare.options.yes\") },\n { id: \"no\", text: t(\"enrolledInMedicare.options.no\") },\n { id: \"notSure\", text: t(\"enrolledInMedicare.options.notSure\") },\n ];\n\n return (\n \n );\n};\n\nexport const Q_ENROLLED_IN_MEDICARE: QuestionDefinition = {\n id: QUESTION_ID,\n shouldShowQuestion: ({\n selectedProgram,\n surveyAnswers,\n retriageEligibility,\n }) => {\n if (selectedProgram !== \"MED\" && selectedProgram !== \"NMPBA\") {\n return false;\n }\n\n const age = getAge({ surveyAnswers, retriageEligibility });\n if (!age) {\n const dob = getDateOfBirth({ surveyAnswers, retriageEligibility });\n const message = `Age was not able to be calculated - DOB: ${dob}, age: ${age}`;\n captureException(message);\n return true;\n }\n\n return age > 64;\n },\n component: EnrolledInMedicareQuestion,\n};\n","import React from \"react\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { ScreenedOutReason } from \"@/constants\";\nimport { SurveyAnswer, useAppContext } from \"@/contexts\";\nimport { calculateBMI } from \"@/utils/calculateBMI\";\nimport { isCareFirstPartner } from \"@/utils/partners\";\nimport { partnerOffersPrograms } from \"@/utils/programs\";\n\nimport {\n QuestionComponentProps,\n QuestionDefinition,\n QuestionOption,\n} from \"../../Question\";\nimport { CheckboxQuestion } from \"../core\";\n\nconst QUESTION_ID = \"ethnicity\";\ndeclare module \"@/contexts\" {\n interface SurveyAnswers {\n ethnicity?: string[];\n }\n}\n\nconst EthnicityQuestion: React.FC = ({\n onClickBack,\n onClickNext,\n surveyAnswers,\n}) => {\n const { partnerInfo } = useAppContext();\n const { t } = useTranslation();\n\n const options: QuestionOption[] = [\n { id: \"hispanic\", text: t(\"ethnicity.options.hispanic\") },\n { id: \"white\", text: t(\"ethnicity.options.white\") },\n { id: \"asian\", text: t(\"ethnicity.options.asian\") },\n { id: \"americanIndian\", text: t(\"ethnicity.options.americanIndian\") },\n { id: \"black\", text: t(\"ethnicity.options.black\") },\n { id: \"nativeHawaiian\", text: t(\"ethnicity.options.nativeHawaiian\") },\n { id: \"middleEastern\", text: t(\"ethnicity.options.middleEastern\") },\n { id: \"other\", text: t(\"ethnicity.options.other\") },\n { id: \"preferNotToSay\", text: t(\"ethnicity.options.preferNotToSay\") },\n ];\n\n const screenOutOrProceed = async (answer: SurveyAnswer) => {\n // Have to typecast \"answer\" as string[] since ethnicity question is of\n // type string[] but \"answer\" is generic\n const ethnicities = answer as string[];\n\n const { heightWeight } = surveyAnswers;\n\n const bmi = calculateBMI(\n heightWeight?.heightFeetPortion!,\n heightWeight?.heightInchesPortion!,\n heightWeight?.weight!,\n );\n\n if (\n bmi < 25 &&\n (!ethnicities.includes(\"asian\") || ethnicities.includes(\"preferNotToSay\"))\n ) {\n if (isCareFirstPartner(partnerInfo)) {\n onClickNext(answer, {}, ScreenedOutReason.BMI_TOO_LOW);\n return;\n }\n\n onClickNext(answer, { dppEligible: false });\n return;\n }\n\n onClickNext(answer);\n };\n\n return (\n \n );\n};\n\nexport const Q_ETHNICITY: QuestionDefinition = {\n id: QUESTION_ID,\n /**\n * Ethnicity question will be shown if\n * 1) the user could be eligible for DPP\n * or\n * 2) the user has a BMI between 23-25\n *\n *\n * Users with BMI < 18.5 will be screened out.\n *\n * Users with BMI 18.5-23 will be screened out if CareFirst\n * and placed into HW otherwise, which is why we don't need to ask ethnicity\n */\n shouldShowQuestion: ({\n enrollmentInfo,\n partnerInfo,\n selectedProgram,\n surveyAnswers: { dppEligible, heightWeight },\n }) => {\n const bmi = calculateBMI(\n heightWeight?.heightFeetPortion!,\n heightWeight?.heightInchesPortion!,\n heightWeight?.weight!,\n );\n\n return (\n selectedProgram !== \"MOOD\" &&\n partnerOffersPrograms([\"DPP\"], enrollmentInfo, partnerInfo) &&\n (dppEligible !== false || (bmi >= 23 && bmi < 25))\n );\n },\n component: EthnicityQuestion,\n};\n\nexport const Q_RETRIAGE_ETHNICITY: QuestionDefinition = {\n id: QUESTION_ID,\n shouldShowQuestion: ({\n retriageEligibility: { currentProgram, eligibleRetriagePrograms = [] } = {},\n surveyAnswers: { dppEligible, heightWeight },\n }) => {\n const bmi = calculateBMI(\n heightWeight?.heightFeetPortion!,\n heightWeight?.heightInchesPortion!,\n heightWeight?.weight!,\n );\n\n return (\n currentProgram === \"WEIGHT\" &&\n (eligibleRetriagePrograms.includes(\"DPP\") ||\n eligibleRetriagePrograms.includes(\"MED\")) &&\n (dppEligible !== false || (bmi >= 23 && bmi < 25))\n );\n },\n component: EthnicityQuestion,\n};\n","import { Form, Formik, FormikHelpers } from \"formik\";\nimport React, { useState } from \"react\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { Api } from \"@noom/noomscape\";\nimport {\n Alert,\n Button,\n Spacing,\n Stack,\n useToast,\n} from \"@noom/wax-component-library\";\n\nimport {\n PasswordInput,\n PasswordInputWithoutStrengthValidationSchema,\n} from \"@/components/form\";\nimport { ErrorState } from \"@/constants\";\nimport { useAppContext } from \"@/contexts\";\nimport {\n useCreateLoginToken,\n useGoto,\n useQueryParams,\n useTrackEvent,\n} from \"@/hooks\";\nimport { setSurveyAnswerCookie } from \"@/utils/cookies\";\nimport { withPiiQueryParams } from \"@/utils/pixels/urlParamsPii\";\n\nimport { QuestionComponentProps, QuestionDefinition } from \"../../Question\";\nimport { BaseQuestion } from \"../core\";\n\nconst QUESTION_ID = \"existingPassword\";\n\ndeclare module \"@/contexts\" {\n interface SurveyAnswers {\n existingPassword?: string;\n }\n}\n\ntype ExistingPasswordFormValues = {\n password: string;\n};\n\nconst ExistingPasswordQuestion: React.FC = ({\n onClickBack,\n onClickNext,\n surveyAnswers,\n}) => {\n const { partnerInfo } = useAppContext();\n const { isProvidingValidPassword } = useCreateLoginToken();\n const { error } = useGoto();\n const queryParams = useQueryParams();\n const [isCheckingPassword, setIsCheckingPassword] = useState(false);\n const [isSendingResetPasswordEmail, setIsSendingResetPasswordEmail] =\n useState(false);\n const toast = useToast();\n const toastId = \"password-reset-email-toast\";\n const { trackAnonEvent } = useTrackEvent();\n const { t } = useTranslation();\n\n const isPwResetRedirect: boolean = queryParams.pwResetRedirect === \"true\";\n\n const initialValues: ExistingPasswordFormValues = {\n password: surveyAnswers.existingPassword || \"\",\n };\n\n const onSubmit = async (\n { password }: ExistingPasswordFormValues,\n { setFieldError }: FormikHelpers,\n ) => {\n const { email } = surveyAnswers.createAccount || {};\n if (!email) {\n return;\n }\n\n setIsCheckingPassword(true);\n const wasSuccessful = await isProvidingValidPassword(email, password);\n setIsCheckingPassword(false);\n\n trackAnonEvent(\"b2bEnrollmentAnonExistingAccountPasswordChecked\", {\n passwordCorrect: wasSuccessful,\n });\n\n if (!wasSuccessful) {\n setFieldError(\n \"password\",\n t(\"existingPassword.form.password.errors.incorrect\"),\n );\n return;\n }\n onClickNext(password);\n };\n\n const handleResetPassword = async () => {\n setIsSendingResetPasswordEmail(true);\n\n trackAnonEvent(\"b2bEnrollmentAnonButtonClicked\", {\n buttonName: \"resetPassword\",\n pageId: \"existingPassword\",\n });\n\n const paramsWithPii = {\n ...withPiiQueryParams(queryParams),\n pwResetRedirect: \"true\",\n };\n const qs = new URLSearchParams(\n Object.entries(paramsWithPii).filter(([, v]) => v !== undefined),\n );\n const postResetRedirectUrl = `${window.location.origin}/employer/${partnerInfo?.slug}/?${qs.toString()}`;\n\n await Api.call(\"account.passwordResets\", Api.api.account.passwordResets, {\n email: surveyAnswers.createAccount?.email,\n postResetRedirectUrl,\n })\n .then(() => {\n const { eligibilityCheck, createAccount } = surveyAnswers;\n setSurveyAnswerCookie({ eligibilityCheck, createAccount });\n setIsSendingResetPasswordEmail(false);\n if (!toast.isActive(toastId)) {\n toast({\n id: toastId,\n duration: 3000,\n render: () => {t(\"existingPassword.emailSent\")},\n });\n }\n })\n .catch(() => {\n error(ErrorState.DEFAULT);\n });\n };\n\n return (\n \n \n {({ handleChange, handleSubmit, resetForm, validateField }) => {\n const handleInputChange = async (\n e: React.ChangeEvent,\n fieldName: keyof ExistingPasswordFormValues,\n ) => {\n // This is a hacky method to get each field to validate on change\n // individually.\n await handleChange(e);\n validateField(fieldName);\n };\n\n return (\n
\n \n handleInputChange(e, \"password\")}\n showPasswordStrengthBar={false}\n userInputs={[]}\n />\n \n \n {t(\"existingPassword.form.continue\")}\n \n \n handleResetPassword().then(() => resetForm())\n }\n variant=\"unstyled\"\n isLoading={isSendingResetPasswordEmail}\n display=\"flex\"\n >\n {t(\"existingPassword.form.resetPassword\")}\n \n \n \n
\n );\n }}\n \n \n );\n};\n\nexport const Q_EXISTING_PASSWORD: QuestionDefinition = {\n id: QUESTION_ID,\n shouldShowQuestion: ({ hasB2cAccount }) => !!hasB2cAccount,\n component: ExistingPasswordQuestion,\n};\n","import React from \"react\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { partnerOffersPrograms } from \"@/utils/programs\";\nimport { shouldShowDppQualification } from \"@/utils/survey/retriage\";\n\nimport {\n QuestionComponentProps,\n QuestionDefinition,\n QuestionOption,\n} from \"../../Question\";\nimport { MultipleChoiceQuestion } from \"../core\";\n\nconst QUESTION_ID = \"familyHistory\";\n\ndeclare module \"@/contexts\" {\n interface SurveyAnswers {\n familyHistory?: string;\n }\n}\n\nconst FamilyHistoryQuestion: React.FC = ({\n onClickBack,\n onClickNext,\n surveyAnswers,\n}) => {\n const { t } = useTranslation();\n\n const options: QuestionOption[] = [\n { id: \"yes\", text: t(\"familyHistory.options.yes\") },\n { id: \"no\", text: t(\"familyHistory.options.no\") },\n ];\n\n return (\n \n );\n};\n\nexport const Q_FAMILY_HISTORY: QuestionDefinition = {\n id: QUESTION_ID,\n shouldShowQuestion: ({\n enrollmentInfo,\n partnerInfo,\n selectedProgram,\n surveyAnswers: { dppEligible },\n }) =>\n partnerOffersPrograms([\"DPP\"], enrollmentInfo, partnerInfo) &&\n selectedProgram !== \"MED\" &&\n selectedProgram !== \"MOOD\" &&\n selectedProgram !== \"NMPBA\" &&\n dppEligible !== false,\n component: FamilyHistoryQuestion,\n};\n\nexport const Q_RETRIAGE_FAMILY_HISTORY: QuestionDefinition = {\n id: QUESTION_ID,\n shouldShowQuestion: (state) => shouldShowDppQualification(state),\n component: FamilyHistoryQuestion,\n};\n","import React from \"react\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { qualifiesForNoomMed } from \"@/utils/qualification\";\n\nimport {\n QuestionComponentProps,\n QuestionDefinition,\n QuestionOption,\n} from \"../../Question\";\nimport { MultipleChoiceQuestion } from \"../core\";\n\nconst QUESTION_ID = \"familyHistoryWeight\";\n\ndeclare module \"@/contexts\" {\n interface SurveyAnswers {\n familyHistoryWeight?: string;\n }\n}\n\nconst FamilyHistoryWeightQuestion: React.FC = ({\n onClickBack,\n onClickNext,\n surveyAnswers,\n}) => {\n const { t } = useTranslation();\n\n const options: QuestionOption[] = [\n { id: \"yes\", text: t(\"familyHistoryWeight.options.yes\") },\n { id: \"no\", text: t(\"familyHistoryWeight.options.no\") },\n ];\n\n return (\n \n );\n};\n\nexport const Q_FAMILY_HISTORY_WEIGHT: QuestionDefinition = {\n id: QUESTION_ID,\n shouldShowQuestion: (state) =>\n state.selectedProgram !== \"MOOD\" && qualifiesForNoomMed(state),\n component: FamilyHistoryWeightQuestion,\n};\n","import React from \"react\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { ScreenedOutReason } from \"@/constants\";\nimport {\n shouldShowCardiometabolicQuestionForRetriage,\n areSexAndGenderPrePopulated,\n} from \"@/utils/survey/retriage\";\n\nimport {\n QuestionComponentProps,\n QuestionDefinition,\n QuestionOption,\n} from \"../../Question\";\nimport { MultipleChoiceQuestion } from \"../core\";\n\nconst QUESTION_ID = \"gender\";\nexport const GENDER_QUESTION_ID = QUESTION_ID;\n\ndeclare module \"@/contexts\" {\n interface SurveyAnswers {\n gender?: string;\n }\n}\n\nconst GenderQuestion: React.FC = ({\n onClickBack,\n onClickNext,\n surveyAnswers,\n}) => {\n const { t } = useTranslation();\n\n const options: QuestionOption[] = [\n { id: \"male\", text: t(\"gender.options.male\") },\n { id: \"female\", text: t(\"gender.options.female\") },\n { id: \"transgender\", text: t(\"gender.options.transgender\") },\n { id: \"other\", text: t(\"gender.options.other\") },\n { id: \"preferNotToSay\", text: t(\"gender.options.preferNotToSay\") },\n ];\n\n return (\n \n );\n};\n\nexport const Q_GENDER: QuestionDefinition = {\n id: QUESTION_ID,\n shouldShowQuestion: ({\n screenedOutReason,\n selectedProgram,\n surveyAnswers: { gender },\n }) =>\n // Hide question if the user answered in the metabolic path and was screened out.\n !(\n gender &&\n selectedProgram === \"MOOD\" &&\n // Should include its own ScreenedOutReason (if applicable) and any that follow this question.\n [ScreenedOutReason.PREGNANT].includes(\n screenedOutReason as ScreenedOutReason,\n )\n ),\n component: GenderQuestion,\n};\n\nexport const Q_RETRIAGE_GENDER: QuestionDefinition = {\n id: QUESTION_ID,\n shouldShowQuestion: ({ retriageEligibility, surveyAnswers }) =>\n !areSexAndGenderPrePopulated(surveyAnswers, retriageEligibility) &&\n shouldShowCardiometabolicQuestionForRetriage(retriageEligibility),\n component: GenderQuestion,\n};\n","import React from \"react\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { partnerOffersPrograms } from \"@/utils/programs\";\n\nimport {\n QuestionComponentProps,\n QuestionDefinition,\n QuestionOption,\n} from \"../../Question\";\nimport { MultipleChoiceQuestion } from \"../core\";\n\nconst QUESTION_ID = \"gestationalDiabetes\";\n\ndeclare module \"@/contexts\" {\n interface SurveyAnswers {\n gestationalDiabetes?: string;\n }\n}\n\nconst GestationalDiabetesQuestion: React.FC = ({\n onClickBack,\n onClickNext,\n surveyAnswers,\n}) => {\n const { t } = useTranslation();\n\n const options: QuestionOption[] = [\n { id: \"yes\", text: t(\"gestationalDiabetes.options.yes\") },\n { id: \"no\", text: t(\"gestationalDiabetes.options.no\") },\n ];\n\n return (\n \n );\n};\n\nexport const Q_GESTATIONAL_DIABETES: QuestionDefinition = {\n id: QUESTION_ID,\n shouldShowQuestion: ({\n enrollmentInfo,\n partnerInfo,\n selectedProgram,\n surveyAnswers: { dppEligible, sex },\n }) =>\n partnerOffersPrograms([\"DPP\"], enrollmentInfo, partnerInfo) &&\n selectedProgram !== \"MOOD\" &&\n dppEligible !== false &&\n (sex === \"female\" || sex === \"intersex\" || sex === \"preferNotToSay\"),\n component: GestationalDiabetesQuestion,\n};\n\nexport const Q_RETRIAGE_GESTATIONAL_DIABETES: QuestionDefinition = {\n id: QUESTION_ID,\n shouldShowQuestion: ({\n retriageEligibility: { currentProgram, eligibleRetriagePrograms = [] } = {},\n surveyAnswers: { dppEligible, sex },\n }) =>\n currentProgram === \"WEIGHT\" &&\n eligibleRetriagePrograms.includes(\"DPP\") &&\n dppEligible !== false &&\n (sex === \"female\" || sex === \"intersex\" || sex === \"preferNotToSay\"),\n component: GestationalDiabetesQuestion,\n};\n","/**\n * Calculate current BMI using Metric measures\n */\nexport function calculateBMIMetric(heightCm: number, currentWeightKg: number) {\n const heightInMeter = heightCm / 100;\n return currentWeightKg / (heightInMeter * heightInMeter);\n}\n\n/**\n * Calculate weight in metric units from a BMI value and height in metric units\n * <=> bmi * (heightInMeters^2) = targetWeight\n */\nexport function calculateMetricWeightFromBMI(height: number, bmi: number) {\n const heightInMeters = height / 100;\n return bmi * (heightInMeters * heightInMeters);\n}\n","import React from \"react\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { useAppContext } from \"@/contexts\";\nimport { convertLbToKg } from \"@/utils/UnitUtils\";\nimport { calculateBMIMetric } from \"@/utils/bmi\";\nimport { meetsMedBmiAndComorbityCriteria } from \"@/utils/qualification\";\nimport { shouldAskBaselineOutcomes } from \"@/utils/survey/outcomes\";\n\nimport {\n QuestionComponentProps,\n QuestionDefinition,\n QuestionOption,\n} from \"../../Question\";\nimport { MultipleChoiceQuestion } from \"../core\";\n\nconst QUESTION_ID = \"glp1Medication\";\n\nconst GLP1_OPTION_IDS = [\n \"yes\",\n \"prescriptionNotYetStarted\",\n \"noButConsidering\",\n \"no\",\n] as const;\n\ntype Glp1MedicationAnswer = (typeof GLP1_OPTION_IDS)[number];\n\nconst RETRIAGE_GLP1_OPTION_IDS: Glp1MedicationAnswer[] = [\"yes\", \"no\"];\n\ndeclare module \"@/contexts\" {\n interface SurveyAnswers {\n glp1Medication?: Glp1MedicationAnswer;\n }\n}\n\nconst Glp1MedicationQuestion: React.FC = ({\n onClickBack,\n onClickNext,\n surveyAnswers,\n}) => {\n const { enrollmentType } = useAppContext();\n const { t } = useTranslation();\n\n const optionIds =\n enrollmentType === \"RETRIAGE\" ? RETRIAGE_GLP1_OPTION_IDS : GLP1_OPTION_IDS;\n\n const options: QuestionOption[] = optionIds.map((id) => ({\n id,\n text: t(`glp1Medication.options.${id}`),\n }));\n\n return (\n \n );\n};\n\nexport const Q_GLP1_MEDICATION: QuestionDefinition = {\n id: QUESTION_ID,\n shouldShowQuestion: ({ partnerInfo, selectedProgram }) =>\n selectedProgram !== \"MOOD\" && shouldAskBaselineOutcomes(partnerInfo),\n component: Glp1MedicationQuestion,\n};\n\nexport const Q_OUTCOMES_GLP1_MEDICATION: QuestionDefinition = {\n id: QUESTION_ID,\n shouldShowQuestion: ({\n surveyAnswers: { weight: weightInLbs },\n userProfile,\n }) => {\n const { currentProgram, heightCms, latestWeightKgs } = userProfile || {};\n\n // Only show for cardiometabolic programs\n if (currentProgram === \"MOOD\") {\n return false;\n }\n\n // Only show for BMI >= 27\n\n // Use BMI obtained from user profile & latest weigh-in if it is available\n if (heightCms !== undefined && latestWeightKgs !== undefined) {\n return calculateBMIMetric(heightCms, latestWeightKgs) >= 27;\n }\n\n // Fallback to BMI obtained from height on user profile (if available) and weight from survey\n if (heightCms !== undefined && weightInLbs !== undefined) {\n return (\n calculateBMIMetric(\n heightCms,\n convertLbToKg({\n mainUnitValue: weightInLbs,\n }).mainUnitValue,\n ) >= 27\n );\n }\n\n // If we weren't able to calculate BMI for some reason default to showing question.\n return true;\n },\n\n component: Glp1MedicationQuestion,\n};\n\nexport const Q_RETRIAGE_GLP1_MEDICATION: QuestionDefinition = {\n id: QUESTION_ID,\n shouldShowQuestion: ({\n retriageEligibility: { eligibleRetriagePrograms = [] } = {},\n surveyAnswers: {\n healthConditions,\n heightWeight: { heightFeetPortion, heightInchesPortion, weight } = {},\n },\n }) => {\n // This question differs from Med specific questions in that it only\n // requires not meeting BMI and comorbidity criteria\n if (!eligibleRetriagePrograms.includes(\"MED\")) {\n return false;\n }\n\n if (\n heightFeetPortion === undefined ||\n heightInchesPortion === undefined ||\n weight === undefined\n ) {\n return false;\n }\n\n return !meetsMedBmiAndComorbityCriteria(\n healthConditions,\n heightFeetPortion,\n heightInchesPortion,\n weight,\n );\n },\n component: Glp1MedicationQuestion,\n};\n","import { Form, Formik } from \"formik\";\nimport React from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport * as Yup from \"yup\";\n\nimport { Button, Spacing, Stack } from \"@noom/wax-component-library\";\n\nimport { InputWithSuffix } from \"@/components/form\";\nimport { enforcePositiveInt } from \"@/components/form/utils\";\nimport { shouldShowGlp1WeightQuestion } from \"@/utils/survey/glp1\";\n\nimport { QuestionComponentProps, QuestionDefinition } from \"../../Question\";\nimport { BaseQuestion } from \"../core\";\n\nconst QUESTION_ID = \"glp1Weight\";\n\ndeclare module \"@/contexts\" {\n interface SurveyAnswers {\n glp1Weight?: number;\n }\n}\n\ntype Glp1WeightFormValues = {\n glp1Weight?: number;\n};\n\nconst Glp1WeightQuestion: React.FC = ({\n onClickBack,\n onClickNext,\n surveyAnswers,\n}) => {\n const { t } = useTranslation();\n\n const initialValues: Glp1WeightFormValues = {\n glp1Weight: surveyAnswers.glp1Weight,\n };\n\n const validationSchema = Yup.object({\n glp1Weight: Yup.number()\n .required(t(\"form.weight.errors.required\"))\n .positive(t(\"form.weight.errors.invalid\"))\n .max(740, t(\"form.weight.errors.invalid\")),\n });\n\n return (\n \n {\n if (glp1Weight === undefined) {\n return;\n }\n\n onClickNext(glp1Weight);\n }}\n validateOnBlur={false}\n validationSchema={validationSchema}\n >\n {({ errors, getFieldProps, handleSubmit, touched }) => (\n
\n \n \n \n \n
\n )}\n \n \n );\n};\n\nexport const Q_GLP1_WEIGHT: QuestionDefinition = {\n id: QUESTION_ID,\n shouldShowQuestion: (state) => shouldShowGlp1WeightQuestion(state),\n component: Glp1WeightQuestion,\n};\n","import { QuestionVisibilityState } from \"@/components/survey/Question\";\nimport { GLP1_WEIGHT_LOGIC_PARTNERS } from \"@/constants/Partners\";\n\nimport { meetsMedBmiAndHealthConditionsCriteria } from \"../qualification\";\n\nexport const shouldShowGlp1WeightQuestion = (\n state: QuestionVisibilityState,\n): boolean => {\n const {\n partnerInfo,\n surveyAnswers: {\n healthConditions,\n heightWeight: { heightFeetPortion, heightInchesPortion, weight } = {},\n glp1Medication,\n },\n } = state;\n\n if (!GLP1_WEIGHT_LOGIC_PARTNERS.includes(partnerInfo?.slug || \"\")) {\n return false;\n }\n\n if (\n heightFeetPortion === undefined ||\n heightInchesPortion === undefined ||\n weight === undefined\n ) {\n return false;\n }\n\n return (\n (glp1Medication === \"yes\" ||\n glp1Medication === \"prescriptionNotYetStarted\") &&\n !meetsMedBmiAndHealthConditionsCriteria(\n healthConditions,\n heightFeetPortion,\n heightInchesPortion,\n weight,\n )\n );\n};\n","import React from \"react\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { useAppContext } from \"@/contexts\";\nimport {\n shouldAskBaselineOutcomes,\n shouldAskQuarterlyQuestion,\n} from \"@/utils/survey/outcomes\";\n\nimport {\n QuestionComponentProps,\n QuestionDefinition,\n QuestionOption,\n} from \"../../Question\";\nimport { MultipleChoiceQuestion } from \"../core\";\n\nconst QUESTION_ID = \"hadA1cTested\";\n\ndeclare module \"@/contexts\" {\n interface SurveyAnswers {\n hadA1cTested?: string;\n }\n}\n\nconst HadA1cTestedQuestion: React.FC = ({\n onClickBack,\n onClickNext,\n surveyAnswers,\n}) => {\n const { surveyMetadata } = useAppContext();\n const { t } = useTranslation();\n\n const options: QuestionOption[] = [\n { id: \"yes\", text: t(\"hadA1cTested.options.yes\") },\n { id: \"no\", text: t(\"hadA1cTested.options.no\") },\n { id: \"notSure\", text: t(\"hadA1cTested.options.notSure\") },\n ];\n\n const questionText =\n surveyMetadata?.name === \"RECURRING_OUTCOMES\"\n ? t(\"hadA1cTested.questionText.recurringOutcomes\")\n : t(\"hadA1cTested.questionText.enrollment\");\n\n return (\n \n );\n};\n\nexport const Q_HAD_A1C_TESTED: QuestionDefinition = {\n id: QUESTION_ID,\n shouldShowQuestion: ({ partnerInfo, selectedProgram }) =>\n selectedProgram !== \"MOOD\" && shouldAskBaselineOutcomes(partnerInfo),\n component: HadA1cTestedQuestion,\n};\n\nexport const Q_OUTCOMES_HAD_A1C_TESTED: QuestionDefinition = {\n id: QUESTION_ID,\n shouldShowQuestion: ({ userProfile }) =>\n userProfile?.currentProgram !== \"MOOD\" &&\n shouldAskQuarterlyQuestion(userProfile),\n component: HadA1cTestedQuestion,\n};\n","import React from \"react\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { partnerOffersPrograms } from \"@/utils/programs\";\nimport { shouldShowDppQualification } from \"@/utils/survey/retriage\";\n\nimport {\n QuestionComponentProps,\n QuestionDefinition,\n QuestionOption,\n} from \"../../Question\";\nimport { MultipleChoiceQuestion } from \"../core\";\n\nconst QUESTION_ID = \"healthCareProfessional\";\n\ndeclare module \"@/contexts\" {\n interface SurveyAnswers {\n healthCareProfessional?: string;\n }\n}\n\nconst HealthCareProfessionalQuestion: React.FC = ({\n onClickBack,\n onClickNext,\n surveyAnswers,\n}) => {\n const { t } = useTranslation();\n\n const options: QuestionOption[] = [\n { id: \"doctor\", text: t(\"healthCareProfessional.options.doctor\") },\n { id: \"pharmacist\", text: t(\"healthCareProfessional.options.pharmacist\") },\n {\n id: \"anotherProfessional\",\n text: t(\"healthCareProfessional.options.anotherProfessional\"),\n },\n { id: \"no\", text: t(\"healthCareProfessional.options.no\") },\n ];\n\n return (\n \n );\n};\n\nexport const Q_HEALTH_CARE_PROFESSIONAL: QuestionDefinition = {\n id: QUESTION_ID,\n shouldShowQuestion: ({\n enrollmentInfo,\n partnerInfo,\n selectedProgram,\n surveyAnswers: { dppEligible },\n }) =>\n partnerOffersPrograms([\"DPP\"], enrollmentInfo, partnerInfo) &&\n selectedProgram !== \"MED\" &&\n selectedProgram !== \"MOOD\" &&\n selectedProgram !== \"NMPBA\" &&\n dppEligible === true,\n component: HealthCareProfessionalQuestion,\n};\n\nexport const Q_RETRIAGE_HEALTH_CARE_PROFESSIONAL: QuestionDefinition = {\n id: QUESTION_ID,\n shouldShowQuestion: (state) => shouldShowDppQualification(state),\n component: HealthCareProfessionalQuestion,\n};\n","import React from \"react\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { HealthConditionOptionId } from \"@/constants\";\nimport { SurveyAnswer, useAppContext } from \"@/contexts\";\nimport { isB2CPartner } from \"@/utils/partners\";\nimport { shouldAskQuarterlyQuestion } from \"@/utils/survey/outcomes\";\nimport { shouldShowCardiometabolicQuestionForRetriage } from \"@/utils/survey/retriage\";\n\nimport {\n QuestionComponentProps,\n QuestionDefinition,\n QuestionOption,\n} from \"../../Question\";\nimport { CheckboxQuestion } from \"../core\";\n\nconst QUESTION_ID = \"healthConditions\";\n\ndeclare module \"@/contexts\" {\n interface SurveyAnswers {\n healthConditions?: string[];\n }\n}\n\nconst HealthConditionsQuestion: React.FC = ({\n onClickBack,\n onClickNext,\n surveyAnswers,\n}) => {\n const { surveyMetadata, userProfile } = useAppContext();\n const { t } = useTranslation();\n\n const isMale =\n userProfile?.gender === \"MALE\" || surveyAnswers?.sex === \"male\";\n\n const questionText =\n surveyMetadata?.name === \"RECURRING_OUTCOMES\"\n ? t(\"healthConditions.questionText.recurringOutcomes\")\n : t(\"healthConditions.questionText.enrollment\");\n\n const options: (Omit & {\n id: HealthConditionOptionId;\n })[] = [\n {\n id: HealthConditionOptionId.HIGH_BLOOD_PRESSURE,\n text: t(\"healthConditions.options.highBloodPressure\"),\n },\n {\n id: HealthConditionOptionId.TYPE1_DIABETES,\n text: t(\"healthConditions.options.type1Diabetes\"),\n },\n {\n id: HealthConditionOptionId.TYPE2_DIABETES,\n text: t(\"healthConditions.options.type2Diabetes\"),\n },\n {\n id: HealthConditionOptionId.DEPRESSION_OR_ANXIETY,\n text: t(\"healthConditions.options.depressionOrAnxiety\"),\n },\n {\n id: HealthConditionOptionId.ABNORMAL_CHOLESTEROL,\n text: t(\"healthConditions.options.abnormalCholesterol\"),\n },\n {\n id: HealthConditionOptionId.OSTEOARTHRITIS,\n text: t(\"healthConditions.options.osteoarthritis\"),\n },\n {\n id: HealthConditionOptionId.SLEEP_PROBLEMS,\n text: t(\"healthConditions.options.sleepApneaOrSnoring\"),\n },\n {\n id: HealthConditionOptionId.LIVER_DISEASE,\n text: t(\"healthConditions.options.liverDisease\"),\n },\n {\n id: HealthConditionOptionId.HEART_DISEASE,\n text: t(\"healthConditions.options.heartDisease\"),\n },\n isMale\n ? {\n id: HealthConditionOptionId.LOW_TESTOSTERONE,\n text: t(\"healthConditions.options.lowTestosterone\"),\n }\n : {\n id: HealthConditionOptionId.PCOS_OR_FERTILITY_PROBLEMS,\n text: t(\"healthConditions.options.pcosOrFertilityProblems\"),\n },\n {\n id: HealthConditionOptionId.CANCER_UNDER_TREATMENT,\n text: t(\"healthConditions.options.cancerUnderTreatment\"),\n },\n {\n id: HealthConditionOptionId.NONE,\n text: t(\"healthConditions.options.none\"),\n },\n ];\n\n const screenOutOrProceed = async (answer: SurveyAnswer) => {\n const dppIneligibleConditions = [\n HealthConditionOptionId.TYPE1_DIABETES,\n HealthConditionOptionId.TYPE2_DIABETES,\n ];\n\n const healthConditions = answer as HealthConditionOptionId[];\n\n if (healthConditions.some((hc) => dppIneligibleConditions.includes(hc))) {\n onClickNext(answer, {\n dppEligible: false,\n });\n } else {\n onClickNext(answer);\n }\n };\n\n return (\n \n );\n};\n\nexport const Q_HEALTH_CONDITIONS: QuestionDefinition = {\n id: QUESTION_ID,\n shouldShowQuestion: ({ partnerInfo }) => !isB2CPartner(partnerInfo),\n component: HealthConditionsQuestion,\n};\n\nexport const Q_OUTCOMES_HEALTH_CONDITIONS: QuestionDefinition = {\n id: QUESTION_ID,\n shouldShowQuestion: ({ userProfile }) =>\n shouldAskQuarterlyQuestion(userProfile),\n component: HealthConditionsQuestion,\n};\n\nexport const Q_RETRIAGE_HEALTH_CONDITIONS: QuestionDefinition = {\n id: QUESTION_ID,\n shouldShowQuestion: ({ retriageEligibility }) =>\n shouldShowCardiometabolicQuestionForRetriage(retriageEligibility),\n component: HealthConditionsQuestion,\n};\n","import React from \"react\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { HealthGoal } from \"@/constants\";\nimport { partnerOffersPrograms } from \"@/utils/programs\";\n\nimport {\n QuestionComponentProps,\n QuestionDefinition,\n QuestionOption,\n} from \"../../Question\";\nimport { MultipleChoiceQuestion } from \"../core\";\n\nconst QUESTION_ID = \"healthGoal\";\n\ndeclare module \"@/contexts\" {\n interface SurveyAnswers {\n healthGoal?: HealthGoal;\n }\n}\n\nconst HealthGoalQuestion: React.FC = ({\n onClickBack,\n onClickNext,\n surveyAnswers,\n}) => {\n const { t } = useTranslation();\n\n const options: QuestionOption[] = [\n {\n id: HealthGoal.REDUCING_STRESS_ANXIOUS_FEELINGS,\n text: t(\"healthGoal.options.reducingStressAnxiousFeelings\"),\n },\n {\n id: HealthGoal.LOSING_WEIGHT,\n text: t(\"healthGoal.options.losingWeight\"),\n },\n ];\n\n return (\n \n );\n};\n\nexport const Q_HEALTH_GOAL: QuestionDefinition = {\n id: QUESTION_ID,\n shouldShowQuestion: ({ enrollmentInfo, partnerInfo }) =>\n partnerOffersPrograms([\"MOOD\", \"WEIGHT\"], enrollmentInfo, partnerInfo),\n component: HealthGoalQuestion,\n};\n","import { Formik } from \"formik\";\nimport React, { useState } from \"react\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { Button, Spacing, Stack, Text } from \"@noom/wax-component-library\";\n\nimport { HeightWeightForm, HeightWeightSchema } from \"@/components/forms\";\nimport {\n QuestionComponentProps,\n QuestionDefinition,\n} from \"@/components/survey/Question\";\nimport { ScreenedOutReason } from \"@/constants\";\nimport { useAppContext } from \"@/contexts\";\n// import { RetriageEligibility } from \"@/models\";\nimport { calculateBMI } from \"@/utils/calculateBMI\";\nimport { isCareFirstPartner } from \"@/utils/partners\";\n// import { getWeightInLbs } from \"@/utils/retriage\";\nimport { shouldShowCardiometabolicQuestionForRetriage } from \"@/utils/survey/retriage\";\n\nimport { BaseQuestion } from \"../core\";\n\nconst QUESTION_ID = \"heightWeight\";\n\ntype FormValues = {\n heightFeetPortion?: number;\n heightInchesPortion?: number;\n weight?: number;\n};\n\ndeclare module \"@/contexts\" {\n interface SurveyAnswers {\n heightWeight?: FormValues;\n }\n}\n\nconst getDefaultInitialValues = () // retriageEligibility?: RetriageEligibility,\n: FormValues => {\n let weight: FormValues[\"weight\"];\n\n // disabled until we can autopopulate height as well\n // see https://noomhq.atlassian.net/browse/B2B-2390\n // if (retriageEligibility?.userProfile) {\n // weight = getWeightInLbs(retriageEligibility.userProfile);\n // }\n\n return {\n heightFeetPortion: undefined,\n heightInchesPortion: undefined,\n weight: weight ? Math.round(weight) : undefined,\n };\n};\n\nconst HeightWeightQuestion: React.FC = ({\n onClickBack,\n onClickNext,\n surveyAnswers,\n}) => {\n const { enrollmentType, partnerInfo, retriageEligibility } = useAppContext();\n const [shouldShowConfirmation, setShouldShowConfirmation] = useState(false);\n const { t } = useTranslation();\n\n const { liabilityWaiverEatingDisorder } = surveyAnswers;\n const hasAlreadySignedLiabilityWaiver = !!liabilityWaiverEatingDisorder;\n\n const handleAnswerBeforeProceeding = (values: FormValues) => {\n if (\n values.heightFeetPortion === undefined ||\n values.heightInchesPortion === undefined ||\n values.weight === undefined\n ) {\n return;\n }\n\n const bmi = calculateBMI(\n values.heightFeetPortion,\n values.heightInchesPortion,\n values.weight,\n );\n\n if (\n (bmi < 18.5 && enrollmentType !== \"INITIAL_ENROLLMENT\") ||\n (isCareFirstPartner(partnerInfo) && bmi < 23)\n ) {\n onClickNext(values, {}, ScreenedOutReason.BMI_TOO_LOW);\n return;\n }\n\n if (\n enrollmentType === \"INITIAL_ENROLLMENT\" &&\n bmi < 18.5 &&\n !hasAlreadySignedLiabilityWaiver &&\n !shouldShowConfirmation\n ) {\n setShouldShowConfirmation(true);\n return;\n }\n\n if (bmi < 23) {\n onClickNext(values, { dppEligible: false });\n } else {\n onClickNext(values);\n }\n };\n\n const initialValues = surveyAnswers[QUESTION_ID] || getDefaultInitialValues();\n\n const retriageQuestionTextContext =\n retriageEligibility?.didVerifyUsingAutologinData ? \"firstTouch\" : \"\";\n\n const questionText =\n enrollmentType === \"RETRIAGE\"\n ? t(\"heightWeight.questionText.retriage\", {\n context: retriageQuestionTextContext,\n })\n : t(\"heightWeight.questionText.enrollment\");\n\n let questionHelperText = \"\";\n if (enrollmentType === \"RETRIAGE\") {\n questionHelperText = t(\"heightWeight.questionHelperText.retriage\");\n } else if (enrollmentType === \"INITIAL_ENROLLMENT\") {\n questionHelperText = t(\"heightWeight.questionHelperText.enrollment\");\n }\n\n return (\n \n handleAnswerBeforeProceeding(values)}\n validateOnBlur={false}\n validateOnChange={false}\n validationSchema={HeightWeightSchema}\n >\n {({ handleSubmit }) => (\n
\n \n \n {shouldShowConfirmation && (\n {t(\"heightWeight.confirmation\")}\n )}\n \n \n
\n )}\n \n \n );\n};\n\nexport const Q_HEIGHT_WEIGHT: QuestionDefinition = {\n id: QUESTION_ID,\n shouldShowQuestion: ({ selectedProgram }) => selectedProgram !== \"MOOD\",\n component: HeightWeightQuestion,\n};\n\nexport const Q_RETRIAGE_HEIGHT_WEIGHT: QuestionDefinition = {\n id: QUESTION_ID,\n shouldShowQuestion: ({ retriageEligibility }) =>\n shouldShowCardiometabolicQuestionForRetriage(retriageEligibility),\n component: HeightWeightQuestion,\n};\n","import React from \"react\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { partnerOffersPrograms } from \"@/utils/programs\";\nimport { shouldShowDppQualification } from \"@/utils/survey/retriage\";\n\nimport {\n QuestionComponentProps,\n QuestionDefinition,\n QuestionOption,\n} from \"../../Question\";\nimport { MultipleChoiceQuestion } from \"../core\";\n\nconst QUESTION_ID = \"hypertension\";\n\ndeclare module \"@/contexts\" {\n interface SurveyAnswers {\n hypertension?: string;\n }\n}\n\nconst HypertensionQuestion: React.FC = ({\n onClickBack,\n onClickNext,\n surveyAnswers,\n}) => {\n const { t } = useTranslation();\n\n const options: QuestionOption[] = [\n { id: \"yes\", text: t(\"hypertension.options.yes\") },\n { id: \"no\", text: t(\"hypertension.options.no\") },\n ];\n\n return (\n \n );\n};\n\nexport const Q_HYPERTENSION: QuestionDefinition = {\n id: QUESTION_ID,\n shouldShowQuestion: ({\n enrollmentInfo,\n partnerInfo,\n selectedProgram,\n surveyAnswers: { dppEligible },\n }) =>\n partnerOffersPrograms([\"DPP\"], enrollmentInfo, partnerInfo) &&\n selectedProgram !== \"MED\" &&\n selectedProgram !== \"MOOD\" &&\n selectedProgram !== \"NMPBA\" &&\n dppEligible !== false,\n component: HypertensionQuestion,\n};\n\nexport const Q_RETRIAGE_HYPERTENSION: QuestionDefinition = {\n id: QUESTION_ID,\n shouldShowQuestion: (state) => shouldShowDppQualification(state),\n component: HypertensionQuestion,\n};\n","import React, { useEffect } from \"react\";\nimport { Trans, useTranslation } from \"react-i18next\";\n\nimport { Button, Heading, Spacing, Stack } from \"@noom/wax-component-library\";\n\nimport {\n QuestionComponentProps,\n QuestionDefinition,\n} from \"@/components/survey/Question\";\nimport { InformationalScreen } from \"@/components/survey/questionTypes/core\";\nimport { PregnantSelection } from \"@/constants\";\nimport { useAppContext } from \"@/contexts\";\nimport { calculateBMI } from \"@/utils/calculateBMI\";\nimport { partnerOffersPrograms } from \"@/utils/programs\";\nimport { captureException } from \"@/utils/sentry\";\n\ndeclare module \"@/contexts\" {\n interface SurveyAnswers {\n liabilityWaiverAlertEatingDisorder?: boolean;\n liabilityWaiverAlertBMI?: boolean;\n liabilityWaiverAlertPregnant?: boolean;\n }\n}\n\nconst LiabilityWaiverAlert: (\n questionId: string,\n) => React.FC = (questionId) => {\n const Component: React.FC = ({\n onClickNext,\n surveyAnswers,\n }) => {\n const { enrollmentInfo, partnerInfo, setSurveyAnswers } = useAppContext();\n useTranslation();\n\n const offersDpp = partnerOffersPrograms(\n [\"DPP\"],\n enrollmentInfo,\n partnerInfo,\n );\n const offersMed = partnerOffersPrograms(\n [\"MED\"],\n enrollmentInfo,\n partnerInfo,\n );\n\n let eligibilityTextContext = \"weight\";\n if (offersDpp && offersMed) {\n eligibilityTextContext = \"dpp_and_med\";\n } else if (offersDpp) {\n eligibilityTextContext = \"dpp\";\n } else if (offersMed) {\n eligibilityTextContext = \"med\";\n }\n\n useEffect(() => {\n // clear prior answer in case of back navigation.\n setSurveyAnswers({ ...surveyAnswers, [questionId]: undefined });\n }, []);\n\n return (\n \n \n \n \n \n \n \n \n \n onClickNext(true)}\n size=\"xl\"\n display=\"flex\"\n margin=\"auto\"\n maxWidth=\"400px\"\n >\n \n \n \n \n );\n };\n\n return Component;\n};\n\nconst QUESTION_ID_EATING_DISORDER = \"liabilityWaiverAlertEatingDisorder\";\nexport const Q_LIABILITY_WAIVER_ALERT_EATING_DISORDER: QuestionDefinition = {\n id: QUESTION_ID_EATING_DISORDER,\n shouldShowQuestion: ({\n surveyAnswers: {\n eatingDisorder,\n liabilityWaiverAlertBMI,\n liabilityWaiverAlertPregnant,\n },\n }) =>\n eatingDisorder === \"yes\" &&\n !(liabilityWaiverAlertBMI || liabilityWaiverAlertPregnant),\n component: LiabilityWaiverAlert(QUESTION_ID_EATING_DISORDER),\n};\n\nconst QUESTION_ID_BMI = \"liabilityWaiverAlertBMI\";\nexport const Q_LIABILITY_WAIVER_ALERT_BMI: QuestionDefinition = {\n id: QUESTION_ID_BMI,\n shouldShowQuestion: ({\n selectedProgram,\n surveyAnswers: {\n heightWeight,\n liabilityWaiverAlertEatingDisorder,\n liabilityWaiverAlertPregnant,\n },\n }) => {\n if (selectedProgram === \"MOOD\") {\n return false;\n }\n\n if (!heightWeight) {\n captureException(\n Error(\n \"Height and weight answers missing when determining is liabilityWaiverAlertBMI is shown\",\n ),\n );\n return false;\n }\n const bmi = calculateBMI(\n heightWeight.heightFeetPortion!,\n heightWeight.heightInchesPortion!,\n heightWeight.weight!,\n );\n\n if (\n bmi < 18.5 &&\n !(liabilityWaiverAlertEatingDisorder || liabilityWaiverAlertPregnant)\n ) {\n return true;\n }\n return false;\n },\n component: LiabilityWaiverAlert(QUESTION_ID_BMI),\n};\n\nconst QUESTION_ID_PREGNANT = \"liabilityWaiverAlertPregnant\";\nexport const Q_LIABILITY_WAIVER_ALERT_PREGNANT: QuestionDefinition = {\n id: QUESTION_ID_PREGNANT,\n shouldShowQuestion: ({\n surveyAnswers: {\n pregnant,\n liabilityWaiverAlertEatingDisorder,\n liabilityWaiverAlertBMI,\n },\n }) => {\n if (\n pregnant === PregnantSelection.YES &&\n !(liabilityWaiverAlertEatingDisorder || liabilityWaiverAlertBMI)\n ) {\n return true;\n }\n return false;\n },\n component: LiabilityWaiverAlert(QUESTION_ID_PREGNANT),\n};\n","import React, { useState } from \"react\";\nimport { Trans, useTranslation } from \"react-i18next\";\n\nimport {\n Button,\n CompassColor,\n Heading,\n Spacing,\n Stack,\n Text,\n} from \"@noom/wax-component-library\";\n\nimport {\n QuestionComponentProps,\n QuestionDefinition,\n} from \"@/components/survey/Question\";\nimport { InformationalScreen } from \"@/components/survey/questionTypes/core\";\n\nimport { CheckboxButton } from \"../../checkbox\";\n\ndeclare module \"@/contexts\" {\n interface SurveyAnswers {\n liabilityWaiverEatingDisorder?: boolean;\n liabilityWaiverBMI?: boolean;\n liabilityWaiverPregnant?: boolean;\n }\n}\n\nconst LiabilityWaiver: (\n questionId: string,\n) => React.FC = (questionId) => {\n const Component: React.FC = ({ onClickNext }) => {\n useTranslation();\n\n const [didAgree, setDidAgree] = useState(false);\n\n return (\n \n \n \n \n \n \n \n \n \n \n setDidAgree(!didAgree)}\n >\n \n \n onClickNext(true, { dppEligible: false })}\n isDisabled={!didAgree}\n size=\"xl\"\n display=\"flex\"\n margin=\"auto\"\n maxWidth=\"400px\"\n >\n \n \n \n \n );\n };\n\n return Component;\n};\n\nconst QUESTION_ID_EATING_DISORDER = \"liabilityWaiverEatingDisorder\";\nexport const Q_LIABILITY_WAIVER_EATING_DISORDER: QuestionDefinition = {\n id: QUESTION_ID_EATING_DISORDER,\n shouldShowQuestion: ({\n surveyAnswers: { liabilityWaiverAlertEatingDisorder },\n }) => !!liabilityWaiverAlertEatingDisorder,\n component: LiabilityWaiver(QUESTION_ID_EATING_DISORDER),\n};\n\nconst QUESTION_ID_BMI = \"liabilityWaiverBMI\";\nexport const Q_LIABILITY_WAIVER_BMI: QuestionDefinition = {\n id: QUESTION_ID_BMI,\n shouldShowQuestion: ({ surveyAnswers: { liabilityWaiverAlertBMI } }) =>\n !!liabilityWaiverAlertBMI,\n component: LiabilityWaiver(QUESTION_ID_BMI),\n};\n\nconst QUESTION_ID_PREGNANT = \"liabilityWaiverPregnant\";\nexport const Q_LIABILITY_WAIVER_PREGNANT: QuestionDefinition = {\n id: QUESTION_ID_PREGNANT,\n shouldShowQuestion: ({ surveyAnswers: { liabilityWaiverAlertPregnant } }) =>\n !!liabilityWaiverAlertPregnant,\n component: LiabilityWaiver(QUESTION_ID_PREGNANT),\n};\n","import { Form, Formik } from \"formik\";\nimport React, { useEffect } from \"react\";\nimport { useTranslation } from \"react-i18next\";\n\nimport type { GetTelehealthEligibleStatesResponseProto } from \"@noom/noom-contracts/noom_contracts/healthcare/eligible_states_service\";\nimport { Api } from \"@noom/noomscape\";\nimport { Button, Select, Spacing, Stack } from \"@noom/wax-component-library\";\n\nimport { USState } from \"@/constants\";\nimport { useAppContext } from \"@/contexts\";\nimport { qualifiesForNoomMed } from \"@/utils/qualification\";\nimport { captureException } from \"@/utils/sentry\";\n\nimport { QuestionComponentProps, QuestionDefinition } from \"../../Question\";\nimport { BaseQuestion } from \"../core\";\n\nconst QUESTION_ID = \"locationState\";\n\ndeclare module \"@/contexts\" {\n interface SurveyAnswers {\n locationState?: string;\n }\n}\n\ntype LocationStateFormValues = {\n locationState?: string;\n};\n\nconst US_STATE_ABBREVIATIONS = Object.keys(USState) as (keyof typeof USState)[];\n\nconst stateOptions = US_STATE_ABBREVIATIONS.map((key) => ({\n id: key,\n text: USState[key],\n}));\n\nconst LocationStateQuestion: React.FC = ({\n onClickBack,\n onClickNext,\n surveyAnswers,\n}) => {\n const { t } = useTranslation();\n\n const initialValues: LocationStateFormValues = {\n locationState: surveyAnswers?.locationState,\n };\n\n const { telehealthEligibleStates, setTelehealthEligibleStates } =\n useAppContext();\n\n useEffect(() => {\n async function loadTelehealthEligibleStates() {\n try {\n const result: GetTelehealthEligibleStatesResponseProto = await Api.call(\n \"telehealth.getEligibleTelehealthStates\",\n Api.api.telehealth.getEligibleTelehealthStates,\n );\n setTelehealthEligibleStates(result.eligibleStates);\n } catch (err) {\n // set an empty array as default so users can continue the enrollment\n // but not enrolling in Med\n // log the error to sentry\n setTelehealthEligibleStates([]);\n captureException(err);\n }\n }\n\n if (!telehealthEligibleStates) {\n loadTelehealthEligibleStates();\n }\n }, [telehealthEligibleStates, setTelehealthEligibleStates]);\n\n return (\n \n {\n if (!locationState) {\n return;\n }\n\n onClickNext(locationState);\n }}\n >\n {({ handleSubmit, getFieldProps, values }) => (\n
\n \n \n \n {t(\"locationState.ctaText\")}\n \n \n
\n )}\n \n \n );\n};\n\nexport const Q_LOCATION_STATE: QuestionDefinition = {\n id: QUESTION_ID,\n shouldShowQuestion: (state) =>\n !state.partnerInfo?.configs.ACCOLADE_PARTNER &&\n state.selectedProgram !== \"MOOD\" &&\n qualifiesForNoomMed(state),\n component: LocationStateQuestion,\n};\n","import React, { useState } from \"react\";\nimport { Trans, useTranslation } from \"react-i18next\";\n\nimport { Button, Text } from \"@noom/wax-component-library\";\n\nimport { type ProgramOffering } from \"@/constants\";\nimport { useAppContext } from \"@/contexts\";\nimport { getDisplayName } from \"@/models\";\n\nimport {\n QuestionComponentProps,\n QuestionDefinition,\n QuestionOption,\n} from \"../../Question\";\nimport { CheckboxOptions } from \"../../checkbox\";\nimport { BaseQuestion } from \"../core\";\n\nconst QUESTION_ID = \"medicareConsent\";\n\ntype MedicareConsentOption = \"agree\" | \"disagree\";\n\ndeclare module \"@/contexts\" {\n interface SurveyAnswers {\n medicareConsent?: MedicareConsentOption;\n }\n}\n\nconst MedicareConsentQuestion: React.FC = ({\n onClickBack,\n onClickNext,\n surveyAnswers,\n}) => {\n const { partnerInfo, setSelectedProgram } = useAppContext();\n const [checkedItems, setCheckedItems] = useState(\n surveyAnswers[QUESTION_ID] ? [surveyAnswers[QUESTION_ID]] : [],\n );\n const { t } = useTranslation();\n\n const options: (QuestionOption & { id: MedicareConsentOption })[] = [\n { id: \"agree\", text: t(\"medicareConsent.options.agree\") },\n { id: \"disagree\", text: t(\"medicareConsent.options.disagree\") },\n ];\n\n const toggleCheckedState = (\n optionId: string,\n currentCheckedState: boolean,\n ) => {\n // For this question we want the checkboxes to behave more like radio\n // buttons where only one option is allowed to be selected.\n const newCheckedItems = currentCheckedState ? [] : [optionId];\n\n setCheckedItems(newCheckedItems);\n };\n\n const submitCheckboxQuestion = () => {\n if (checkedItems.length !== 1) {\n return;\n }\n\n const medicareConsent = checkedItems[0] as MedicareConsentOption;\n\n const medProgram: ProgramOffering = partnerInfo?.configs.ACCOLADE_PARTNER\n ? \"NMPBA\"\n : \"MED\";\n const updatedProgram = medicareConsent === \"disagree\" ? null : medProgram;\n\n setSelectedProgram(updatedProgram);\n onClickNext(medicareConsent, { updatedProgram });\n };\n\n return (\n \n \n \n PATIENT RESTRICTION ON MEDICARE CLAIMS SUBMISSION\n
\n
\n “I have been informed that the healthcare services being made\n available to me through this program will not be covered by Medicare.\n I further understand that, given my status as a Medicare beneficiary,\n any provider that provides covered services to me, such as the\n services included in this program, is required to submit my claim to\n Medicare unless I, exercising my own free will, restrict such provider\n from doing so. As such, by signing this attestation, I hereby restrict\n any provider that provides me healthcare services in this program from\n sharing any claims information, including any protected health\n information (as defined in the Health Insurance Portability and\n Accountability Act), with Medicare.”\n
\n
\n \n submitCheckboxQuestion()}\n size=\"xl\"\n >\n {t(\"medicareConsent.buttonText\")}\n \n \n );\n};\n\nexport const Q_MEDICARE_CONSENT: QuestionDefinition = {\n id: QUESTION_ID,\n shouldShowQuestion: ({\n selectedProgram,\n surveyAnswers: { enrolledInMedicare },\n }) =>\n (selectedProgram === \"MED\" || selectedProgram === \"NMPBA\") &&\n (enrolledInMedicare === \"yes\" || enrolledInMedicare === \"notSure\"),\n component: MedicareConsentQuestion,\n};\n","import React from \"react\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { partnerOffersPrograms } from \"@/utils/programs\";\nimport { shouldShowDppQualification } from \"@/utils/survey/retriage\";\n\nimport {\n QuestionComponentProps,\n QuestionDefinition,\n QuestionOption,\n} from \"../../Question\";\nimport { MultipleChoiceQuestion } from \"../core\";\n\nconst QUESTION_ID = \"motivation\";\n\ndeclare module \"@/contexts\" {\n interface SurveyAnswers {\n motivation?: string;\n }\n}\n\nconst MotivationQuestion: React.FC = ({\n onClickBack,\n onClickNext,\n surveyAnswers,\n}) => {\n const { t } = useTranslation();\n\n const options: QuestionOption[] = [\n {\n id: \"healthCareProfessional\",\n text: t(\"motivation.options.healthCareProfessional\"),\n },\n { id: \"bloodTestResults\", text: t(\"motivation.options.bloodTestResults\") },\n { id: \"wellnessPlan\", text: t(\"motivation.options.wellnessPlan\") },\n {\n id: \"healthInsurancePlan\",\n text: t(\"motivation.options.healthInsurancePlan\"),\n },\n { id: \"noomAd\", text: t(\"motivation.options.noomAd\") },\n { id: \"familyOrFriend\", text: t(\"motivation.options.familyOrFriend\") },\n { id: \"knowsNoomUser\", text: t(\"motivation.options.knowsNoomUser\") },\n { id: \"community\", text: t(\"motivation.options.community\") },\n {\n id: \"healthRiskAssessment\",\n text: t(\"motivation.options.healthRiskAssessment\"),\n },\n { id: \"programChampion\", text: t(\"motivation.options.programChampion\") },\n ];\n\n return (\n \n );\n};\n\nexport const Q_MOTIVATION: QuestionDefinition = {\n id: QUESTION_ID,\n shouldShowQuestion: ({\n enrollmentInfo,\n partnerInfo,\n selectedProgram,\n surveyAnswers: { dppEligible },\n }) =>\n partnerOffersPrograms([\"DPP\"], enrollmentInfo, partnerInfo) &&\n selectedProgram !== \"MED\" &&\n selectedProgram !== \"MOOD\" &&\n selectedProgram !== \"NMPBA\" &&\n dppEligible === true,\n component: MotivationQuestion,\n};\n\nexport const Q_RETRIAGE_MOTIVATION: QuestionDefinition = {\n id: QUESTION_ID,\n shouldShowQuestion: (state) => shouldShowDppQualification(state),\n component: MotivationQuestion,\n};\n","import type { TOptions } from \"i18next\";\nimport React, { useEffect, useState } from \"react\";\nimport { useTranslation } from \"react-i18next\";\n\nimport {\n Box,\n Button,\n CompassColor,\n Image,\n Spacing,\n Stack,\n Text,\n} from \"@noom/wax-component-library\";\n\nimport {\n QuestionComponentProps,\n QuestionDefinition,\n} from \"@/components/survey/Question\";\nimport {\n NoomMedMoreOptionsSelection,\n NoomMedOverviewSelection,\n type ProgramOffering,\n} from \"@/constants\";\nimport { useAppContext } from \"@/contexts\";\nimport { partnerOffersPrograms } from \"@/utils/programs\";\nimport { qualifiesForNoomMed } from \"@/utils/qualification\";\n\nimport { BaseQuestion } from \"../core\";\n\nconst QUESTION_ID = \"noomMedMoreOptions\";\n\ndeclare module \"@/contexts\" {\n interface SurveyAnswers {\n noomMedMoreOptions?: string;\n }\n}\n\ntype CardProps = {\n isSelected?: boolean;\n onClick?: () => void;\n};\n\nconst Card: React.FC = ({ children, isSelected, onClick }) => (\n \n {children}\n \n);\n\nconst NoomMedMoreOptionsQuestion: React.FC = ({\n onClickBack,\n onClickNext,\n}) => {\n const {\n enrollmentInfo,\n partnerInfo,\n retriageEligibility: { eligibleRetriagePrograms = [] } = {},\n setSelectedProgram,\n setSurveyAnswers,\n surveyAnswers,\n } = useAppContext();\n const [selectedCard, setSelectedCard] =\n useState();\n const { t } = useTranslation();\n\n useEffect(() => {\n // if the user back navigates through this question we should delete the answer\n // as its used to determine med qualification and in question visibility\n const newSurveyAnswers = { ...surveyAnswers };\n delete newSurveyAnswers[QUESTION_ID];\n setSurveyAnswers(newSurveyAnswers);\n }, []);\n\n const isAccolade = partnerInfo?.configs?.ACCOLADE_PARTNER || false;\n const partnerOffersDpp = eligibleRetriagePrograms.length\n ? eligibleRetriagePrograms.includes(\"DPP\")\n : partnerOffersPrograms([\"DPP\", \"WEIGHT\"], enrollmentInfo, partnerInfo);\n\n const accoladeTranslationOptions: TOptions = {\n context: isAccolade ? \"accolade\" : \"\",\n };\n const otherCardTranslationOptions: TOptions = {\n context: partnerOffersDpp ? \"offersDpp\" : \"\",\n };\n const otherCardTitle = t(\n \"noomMedMoreOptions.otherCard.title\",\n otherCardTranslationOptions,\n );\n const otherCardDescription = t(\n \"noomMedMoreOptions.otherCard.description\",\n otherCardTranslationOptions,\n );\n const questionText = t(\"noomMedMoreOptions.questionText\", {\n context: partnerOffersDpp ? \"offersDpp\" : \"\",\n });\n\n return (\n \n \n setSelectedCard(NoomMedMoreOptionsSelection.MED)}\n >\n \n \n \n {t(\n \"noomMedMoreOptions.medCard.title\",\n accoladeTranslationOptions,\n )}\n \n \n \n {t(\"noomMedMoreOptions.medCard.recommended\")}\n \n \n \n \n \n {t(\n \"noomMedMoreOptions.medCard.description\",\n accoladeTranslationOptions,\n )}\n \n \n \n \"Group\n \n {t(\"noomMedMoreOptions.medCard.valueProp1\")}\n \n \n \n \"Meds\"\n \n {t(\"noomMedMoreOptions.medCard.valueProp2\")}\n \n \n \n \n setSelectedCard(NoomMedMoreOptionsSelection.OTHER)}\n >\n \n \n {otherCardTitle}\n \n \n \"Scale\"\n \n {otherCardDescription}\n \n \n \n \n \n {\n if (!selectedCard) {\n return;\n }\n\n const medProgram: ProgramOffering = isAccolade ? \"NMPBA\" : \"MED\";\n\n const updatedProgram =\n selectedCard === NoomMedMoreOptionsSelection.MED\n ? medProgram\n : null;\n\n setSelectedProgram(updatedProgram);\n onClickNext(selectedCard, { updatedProgram });\n }}\n size=\"xl\"\n type=\"submit\"\n >\n {t(\"noomMedMoreOptions.ctaText\")}\n \n \n {t(\"noomMedMoreOptions.disclaimer\", accoladeTranslationOptions)}\n \n \n );\n};\n\nexport const Q_NOOM_MED_MORE_OPTIONS: QuestionDefinition = {\n id: QUESTION_ID,\n shouldShowQuestion: (state) =>\n state.selectedProgram !== \"MOOD\" &&\n qualifiesForNoomMed(state) &&\n state.surveyAnswers.noomMedOverview ===\n NoomMedOverviewSelection.SEE_MORE_OPTIONS,\n component: NoomMedMoreOptionsQuestion,\n};\n","import type { TOptions } from \"i18next\";\nimport React, { ReactElement, useEffect } from \"react\";\nimport { Trans, useTranslation } from \"react-i18next\";\n\nimport {\n Box,\n Button,\n CompassColor,\n Image,\n Spacing,\n Stack,\n Text,\n} from \"@noom/wax-component-library\";\n\nimport {\n QuestionComponentProps,\n QuestionDefinition,\n} from \"@/components/survey/Question\";\nimport { NoomMedOverviewSelection, ProgramOffering } from \"@/constants\";\nimport { useAppContext } from \"@/contexts\";\nimport { useTrackEvent } from \"@/hooks\";\nimport { qualifiesForNoomMed } from \"@/utils/qualification\";\n\nimport { BaseQuestion } from \"../core\";\n\nconst QUESTION_ID = \"noomMedOverview\";\n\ndeclare module \"@/contexts\" {\n interface SurveyAnswers {\n noomMedOverview?: NoomMedOverviewSelection;\n updatedProgram?: ProgramOffering | null;\n wasOfferedMed?: boolean;\n }\n}\n\ntype ValueProp = {\n caption: ReactElement;\n url: string;\n};\n\nconst VALUE_PROPS: ValueProp[] = [\n {\n caption: (\n \n Get tested\n for conditions that contribute to weight gain\n \n ),\n url: \"/assets/img/icon-recipes.svg\",\n },\n {\n caption: (\n \n Get 1:1 virtual support from a \n specially-trained clinician*\n \n ),\n url: \"/assets/img/icon-group-feed.svg\",\n },\n {\n caption: (\n \n Learn about \n medication options\n that can support your weight loss\n \n ),\n url: \"/assets/img/icon-meds.svg\",\n },\n];\n\nconst NoomMedOverviewQuestion: React.FC = ({\n onClickBack,\n onClickNext,\n surveyAnswers,\n}) => {\n const {\n enrollmentType,\n retriageEligibility,\n partnerInfo,\n setSelectedProgram,\n setSurveyAnswers,\n } = useAppContext();\n const { t } = useTranslation();\n const { trackAnonEvent } = useTrackEvent();\n\n const currentProgram =\n enrollmentType === \"RETRIAGE\"\n ? retriageEligibility?.currentProgram\n : undefined;\n\n const isAccolade = partnerInfo?.configs?.ACCOLADE_PARTNER || false;\n const accoladeTranslationOptions: TOptions = {\n context: isAccolade ? \"accolade\" : \"\",\n };\n\n const handleJoinMed = (selection: NoomMedOverviewSelection) => {\n const updatedProgram: ProgramOffering = isAccolade ? \"NMPBA\" : \"MED\";\n\n setSelectedProgram(updatedProgram);\n onClickNext(selection, {\n updatedProgram,\n wasOfferedMed: true,\n });\n };\n\n useEffect(() => {\n // 1 of 2 places we assign selectedProgram to MED is in this question.\n // if the user back navigates through this question we should nullify selectedProgram\n setSelectedProgram(null);\n // also delete updatedProgram\n const newSurveyAnswers = { ...surveyAnswers };\n delete newSurveyAnswers.updatedProgram;\n setSurveyAnswers(newSurveyAnswers);\n\n if (currentProgram) {\n trackAnonEvent(\"b2bEnrollmentAnonRetriageResultPresented\", {\n currentProgram,\n eligibleProgram: isAccolade ? \"NMPBA\" : \"MED\",\n });\n }\n }, []);\n\n return (\n \n \n {VALUE_PROPS.map(({ caption, url }) => (\n \n \"\"\n \n {caption}\n \n \n ))}\n \n \n \n \n \n {t(\"noomMedOverview.graphDisclaimer\")}\n \n \n \n {currentProgram === \"DPP\" ? (\n handleJoinMed(NoomMedOverviewSelection.NEXT)}\n size=\"xl\"\n type=\"submit\"\n >\n {t(\"noomMedOverview.ctaText.next\")}\n \n ) : (\n \n handleJoinMed(NoomMedOverviewSelection.JOIN)}\n size=\"xl\"\n type=\"submit\"\n >\n {t(\"noomMedOverview.ctaText.join\", accoladeTranslationOptions)}\n \n \n onClickNext(\n NoomMedOverviewSelection.SEE_MORE_OPTIONS,\n { wasOfferedMed: true }\n )\n }\n size=\"xl\"\n type=\"submit\"\n variant=\"outline\"\n >\n {t(\"noomMedOverview.ctaText.seeMoreOptions\")}\n \n \n )}\n \n {t(\"noomMedOverview.disclaimer\", accoladeTranslationOptions)}\n \n \n );\n};\n\nexport const Q_NOOM_MED_OVERVIEW: QuestionDefinition = {\n id: QUESTION_ID,\n shouldShowQuestion: (state) =>\n state.selectedProgram !== \"MOOD\" && qualifiesForNoomMed(state),\n component: NoomMedOverviewQuestion,\n};\n","import React from \"react\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { useAppContext } from \"@/contexts\";\nimport {\n shouldAskBaselineOutcomes,\n shouldAskQuarterlyQuestion,\n} from \"@/utils/survey/outcomes\";\n\nimport { QuestionComponentProps, QuestionDefinition } from \"../../Question\";\nimport { SelectQuestion } from \"../core\";\n\nconst QUESTION_ID = \"medications\";\n\ndeclare module \"@/contexts\" {\n interface SurveyAnswers {\n medications?: string;\n }\n}\n\nconst MedicationsQuestion: React.FC = ({\n onClickBack,\n onClickNext,\n surveyAnswers,\n}) => {\n const { surveyMetadata } = useAppContext();\n const { t } = useTranslation();\n\n const questionText =\n surveyMetadata?.name === \"RECURRING_OUTCOMES\"\n ? t(\"medications.questionText.recurringOutcomes\")\n : t(\"medications.questionText.enrollment\");\n\n return (\n 20]\n options={Array(21)\n .fill(0)\n .map((_, i) => ({ id: `${i}`, text: `${i}` }))}\n placeholder=\"\"\n questionHelperText={t(\"medications.questionHelperText\")}\n questionId={QUESTION_ID}\n questionText={questionText}\n />\n );\n};\n\nexport const Q_MEDICATIONS: QuestionDefinition = {\n id: QUESTION_ID,\n shouldShowQuestion: ({ partnerInfo }) =>\n shouldAskBaselineOutcomes(partnerInfo),\n component: MedicationsQuestion,\n};\n\nexport const Q_OUTCOMES_MEDICATIONS: QuestionDefinition = {\n id: QUESTION_ID,\n shouldShowQuestion: ({ userProfile }) =>\n shouldAskQuarterlyQuestion(userProfile),\n component: MedicationsQuestion,\n};\n","import { QuestionVisibilityState } from \"@/components/survey/Question\";\n\nimport { isB2CPartner } from \"../partners\";\n\nexport function shouldShowWomensHealthQuestions({\n partnerInfo,\n selectedProgram,\n surveyAnswers: { sex },\n}: QuestionVisibilityState) {\n return (\n [\"female\", \"intersex\"].includes(sex ?? \"\") &&\n selectedProgram !== \"MOOD\" &&\n !isB2CPartner(partnerInfo)\n );\n}\n","import React from \"react\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { shouldShowWomensHealthQuestions } from \"@/utils/survey/womensHealth\";\n\nimport {\n QuestionComponentProps,\n QuestionDefinition,\n QuestionOption,\n} from \"../../Question\";\nimport { MultipleChoiceQuestion } from \"../core\";\n\nconst QUESTION_ID = \"menopause\";\nconst MENOPAUSE_ANSWERS = [\n \"noSymptoms\",\n \"perimenopause\",\n \"menopause\",\n \"postMenopause\",\n \"preferNotToSay\",\n] as const;\nexport type MenopauseAnswer = (typeof MENOPAUSE_ANSWERS)[number];\n\ndeclare module \"@/contexts\" {\n interface SurveyAnswers {\n menopause?: MenopauseAnswer;\n }\n}\n\nconst MenopauseQuestion: React.FC = ({\n onClickBack,\n onClickNext,\n surveyAnswers,\n}) => {\n const { t } = useTranslation();\n\n const options: QuestionOption[] = MENOPAUSE_ANSWERS.map((id) => ({\n id,\n text: t(`menopause.options.${id}`),\n }));\n\n return (\n \n );\n};\n\nexport const Q_MENOPAUSE: QuestionDefinition = {\n id: QUESTION_ID,\n shouldShowQuestion: (state) => shouldShowWomensHealthQuestions(state),\n component: MenopauseQuestion,\n};\n","import React from \"react\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { shouldShowWomensHealthQuestions } from \"@/utils/survey/womensHealth\";\n\nimport {\n QuestionComponentProps,\n QuestionDefinition,\n QuestionOption,\n} from \"../../Question\";\nimport { MultipleChoiceQuestion } from \"../core\";\n\nconst QUESTION_ID = \"menstrualCycle\";\n\ndeclare module \"@/contexts\" {\n interface SurveyAnswers {\n menstrualCycle?: string;\n }\n}\n\nconst MenstrualCycleQuestion: React.FC = ({\n onClickBack,\n onClickNext,\n surveyAnswers,\n}) => {\n const { t } = useTranslation();\n\n const options: QuestionOption[] = [\n {\n id: \"yes\",\n text: t(\"menstrualCycle.options.yes\"),\n },\n { id: \"no\", text: t(\"menstrualCycle.options.no\") },\n { id: \"preferNotToSay\", text: t(\"menstrualCycle.options.preferNotToSay\") },\n ];\n return (\n \n );\n};\n\nexport const Q_MENSTRUAL_CYCLE: QuestionDefinition = {\n id: QUESTION_ID,\n shouldShowQuestion: (state) =>\n shouldShowWomensHealthQuestions(state) &&\n (state.surveyAnswers.menopause === \"noSymptoms\" ||\n state.surveyAnswers.menopause === \"perimenopause\"),\n component: MenstrualCycleQuestion,\n};\n","import React from \"react\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { useAppContext } from \"@/contexts\";\nimport { shouldAskBaselineOutcomes } from \"@/utils/survey/outcomes\";\n\nimport {\n QuestionComponentProps,\n QuestionDefinition,\n QuestionOption,\n} from \"../../Question\";\nimport { CheckboxQuestion } from \"../core\";\n\nconst QUESTION_ID = \"mskPain\";\n\ndeclare module \"@/contexts\" {\n interface SurveyAnswers {\n mskPain?: string[];\n }\n}\n\nconst MskPainQuestion: React.FC = ({\n onClickBack,\n onClickNext,\n surveyAnswers,\n}) => {\n const { surveyMetadata } = useAppContext();\n const { t } = useTranslation();\n\n const options: QuestionOption[] = [\n { id: \"knee\", text: t(\"mskPain.options.knee\") },\n { id: \"hip\", text: t(\"mskPain.options.hip\") },\n {\n id: \"lowerBack\",\n text: t(\"mskPain.options.lowerBack\"),\n },\n {\n id: \"upperBack\",\n text: t(\"mskPain.options.upperBack\"),\n },\n { id: \"none\", text: t(\"mskPain.options.none\") },\n ];\n\n const questionText =\n surveyMetadata?.name === \"RECURRING_OUTCOMES\"\n ? t(\"mskPain.questionText.recurringOutcomes\")\n : t(\"mskPain.questionText.enrollment\");\n\n return (\n \n );\n};\n\nexport const Q_MSK_PAIN: QuestionDefinition = {\n id: QUESTION_ID,\n shouldShowQuestion: ({ partnerInfo, selectedProgram }) =>\n selectedProgram !== \"MOOD\" && shouldAskBaselineOutcomes(partnerInfo),\n component: MskPainQuestion,\n};\n\nexport const Q_OUTCOMES_MSK_PAIN: QuestionDefinition = {\n id: QUESTION_ID,\n shouldShowQuestion: ({ userProfile }) =>\n userProfile?.currentProgram !== \"MOOD\",\n component: MskPainQuestion,\n};\n","import { Slider, SliderMark, SliderThumb, SliderTrack } from \"@chakra-ui/react\";\nimport { TFunction } from \"i18next\";\nimport React, { useState } from \"react\";\nimport { useTranslation } from \"react-i18next\";\n\nimport {\n Box,\n Button,\n CompassColor,\n Image,\n Text,\n useMediaQuery,\n} from \"@noom/wax-component-library\";\n\nimport { QuestionComponentProps, QuestionDefinition } from \"../../Question\";\nimport { BaseQuestion } from \"../core\";\n\nconst QUESTION_ID = \"mskPainLevel\";\n\ndeclare module \"@/contexts\" {\n interface SurveyAnswers {\n mskPainLevel?: number;\n }\n}\n\ntype LevelConfig = {\n altText: string;\n imgSrc: string;\n text: string;\n};\n\nexport const getLevelConfig = (level: number, t: TFunction): LevelConfig => {\n switch (level) {\n case 0:\n return {\n altText: t(\"mskPainLevel.levels.noPain.altText\"),\n text: t(\"mskPainLevel.levels.noPain.text\"),\n imgSrc: \"/assets/img/noPain.svg\",\n };\n case 1:\n case 2:\n return {\n altText: t(\"mskPainLevel.levels.veryMild.altText\"),\n text: t(\"mskPainLevel.levels.veryMild.text\"),\n imgSrc: \"/assets/img/veryMildPain.svg\",\n };\n case 3:\n case 4:\n return {\n altText: t(\"mskPainLevel.levels.mild.altText\"),\n text: t(\"mskPainLevel.levels.mild.text\"),\n imgSrc: \"/assets/img/mildPain.svg\",\n };\n case 5:\n case 6:\n return {\n altText: t(\"mskPainLevel.levels.moderate.altText\"),\n text: t(\"mskPainLevel.levels.moderate.text\"),\n imgSrc: \"/assets/img/moderatePain.svg\",\n };\n case 7:\n case 8:\n return {\n altText: t(\"mskPainLevel.levels.severe.altText\"),\n text: t(\"mskPainLevel.levels.severe.text\"),\n imgSrc: \"/assets/img/severePain.svg\",\n };\n case 9:\n case 10:\n return {\n altText: t(\"mskPainLevel.levels.verySevere.altText\"),\n text: t(\"mskPainLevel.levels.verySevere.text\"),\n imgSrc: \"/assets/img/verySeverePain.svg\",\n };\n default:\n throw Error(\"Unexpected slider value\");\n }\n};\n\n/**\n * A slider (range type input) question prompting the user for their pain level based on Visual Analog Scale (VAS) pain scale.\n *\n * To avoid anchoring, the slider thumb is translucent (and VAS imagery/labeling hidden) until after the user clicks/touches\n * a location on the scale or the thumb gains focus via keyboard/accessible navigation.\n */\nconst MskPainLevelQuestion: React.FC = ({\n onClickBack,\n onClickNext,\n surveyAnswers,\n}) => {\n const { t } = useTranslation();\n const [mskPainLevel, setMskPainLevel] = useState(\n surveyAnswers.mskPainLevel || 0,\n );\n const [touched, setTouched] = useState(\n surveyAnswers.mskPainLevel !== undefined,\n );\n\n const mskPainLevelConfig = getLevelConfig(mskPainLevel, t);\n\n const [isBrowser] = useMediaQuery(\"(min-width: 1160px)\");\n\n return (\n \n \n {\n setMskPainLevel(val);\n setTouched(true);\n }}\n value={mskPainLevel}\n >\n {Array(11)\n .fill(0)\n .map((_, i) => (\n \n |\n {i}\n \n ))}\n {touched && (\n \n \n \n {mskPainLevelConfig.text}\n \n \n )}\n \n setTouched(true)}\n bgColor={CompassColor.lagoon}\n opacity={Number(touched)}\n />\n \n \n \n {t(\"mskPainLevel.scaleMin\")}\n {t(\"mskPainLevel.scaleMax\")}\n \n onClickNext(mskPainLevel)}\n disabled={!touched}\n size=\"xl\"\n >\n {t(\"mskPainLevel.nextButton\")}\n \n \n );\n};\n\nexport const Q_MSK_PAIN_LEVEL: QuestionDefinition = {\n id: QUESTION_ID,\n shouldShowQuestion: ({ surveyAnswers }) =>\n !!surveyAnswers.mskPain && !surveyAnswers.mskPain.includes(\"none\"),\n component: MskPainLevelQuestion,\n};\n\nexport const Q_OUTCOMES_MSK_PAIN_LEVEL: QuestionDefinition = {\n id: QUESTION_ID,\n shouldShowQuestion: ({ surveyAnswers, userProfile }) =>\n userProfile?.currentProgram !== \"MOOD\" &&\n !!surveyAnswers.mskPain &&\n !surveyAnswers.mskPain.includes(\"none\"),\n component: MskPainLevelQuestion,\n};\n","import { Form, Formik } from \"formik\";\nimport React from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport * as Yup from \"yup\";\n\nimport { Button, Input, Spacing, Stack } from \"@noom/wax-component-library\";\n\nimport { QuestionComponentProps, QuestionDefinition } from \"../../Question\";\nimport { BaseQuestion } from \"../core\";\n\nconst MAX_LENGTH = 100;\nconst QUESTION_ID = \"otherEthnicity\";\n\ndeclare module \"@/contexts\" {\n interface SurveyAnswers {\n otherEthnicity?: string;\n }\n}\n\ntype OtherEthnicityFormValues = {\n otherEthnicity?: string;\n};\n\nconst OtherEthnicityQuestion: React.FC = ({\n onClickBack,\n onClickNext,\n surveyAnswers,\n}) => {\n const { t } = useTranslation();\n\n const initialValues: OtherEthnicityFormValues = {\n otherEthnicity: surveyAnswers.otherEthnicity,\n };\n\n const validationSchema = Yup.object({\n otherEthnicity: Yup.string()\n .required(t(\"otherEthnicity.errors.required\"))\n .max(\n MAX_LENGTH,\n t(\"form.errors.maxLength\", {\n label: \"Ethnicity\",\n maxLength: MAX_LENGTH,\n }),\n ),\n });\n\n return (\n \n \n onClickNext(otherEthnicity)\n }\n validateOnBlur={false}\n validationSchema={validationSchema}\n >\n {({ errors, getFieldProps, handleSubmit, touched }) => (\n
\n \n \n \n \n
\n )}\n \n \n );\n};\n\nexport const Q_OTHER_ETHNICITY: QuestionDefinition = {\n id: QUESTION_ID,\n shouldShowQuestion: ({ surveyAnswers: { ethnicity } }) =>\n (ethnicity || []).includes(\"other\"),\n component: OtherEthnicityQuestion,\n};\n","import React from \"react\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { PHQ_OPTIONS } from \"@/constants\";\nimport { useAppContext } from \"@/contexts\";\nimport { qualifiesForNoomMed } from \"@/utils/qualification\";\nimport { shouldAskBaselineOutcomes } from \"@/utils/survey/outcomes\";\n\nimport { QuestionComponentProps, QuestionDefinition } from \"../../../Question\";\nimport { MultipleChoiceQuestion } from \"../../core\";\n\nconst QUESTION_ID = \"phq1\";\n\ndeclare module \"@/contexts\" {\n interface SurveyAnswers {\n phq1?: string;\n }\n}\n\nconst Phq1Question: React.FC = ({\n onClickBack,\n onClickNext,\n surveyAnswers,\n}) => {\n const { enrollmentType, surveyMetadata } = useAppContext();\n const { t } = useTranslation();\n\n const questionDescription =\n enrollmentType === \"INITIAL_ENROLLMENT\"\n ? t(\"phq1.questionDescription.enrollment\")\n : \"\";\n const questionText =\n surveyMetadata?.name === \"RECURRING_OUTCOMES\"\n ? t(\"phq1.questionText.recurringOutcomes\")\n : t(\"phq1.questionText.enrollment\");\n\n return (\n \n );\n};\n\nexport const Q_PHQ_1: QuestionDefinition = {\n id: QUESTION_ID,\n shouldShowQuestion: ({ partnerInfo }) =>\n shouldAskBaselineOutcomes(partnerInfo),\n component: Phq1Question,\n};\n\nexport const Q_RETRIAGE_PHQ_1: QuestionDefinition = {\n id: QUESTION_ID,\n shouldShowQuestion: (state) => qualifiesForNoomMed(state),\n component: Phq1Question,\n};\n","import React from \"react\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { PHQ_OPTIONS } from \"@/constants\";\nimport { useAppContext } from \"@/contexts\";\nimport { qualifiesForNoomMed } from \"@/utils/qualification\";\nimport { shouldAskBaselineOutcomes } from \"@/utils/survey/outcomes\";\n\nimport { QuestionComponentProps, QuestionDefinition } from \"../../../Question\";\nimport { MultipleChoiceQuestion } from \"../../core\";\n\nconst QUESTION_ID = \"phq2\";\n\ndeclare module \"@/contexts\" {\n interface SurveyAnswers {\n phq2?: string;\n }\n}\n\nconst Phq2Question: React.FC = ({\n onClickBack,\n onClickNext,\n surveyAnswers,\n}) => {\n const { surveyMetadata } = useAppContext();\n const { t } = useTranslation();\n\n const questionText =\n surveyMetadata?.name === \"RECURRING_OUTCOMES\"\n ? t(\"phq2.questionText.recurringOutcomes\")\n : t(\"phq2.questionText.enrollment\");\n return (\n \n );\n};\n\nexport const Q_PHQ_2: QuestionDefinition = {\n id: QUESTION_ID,\n shouldShowQuestion: ({ partnerInfo }) =>\n shouldAskBaselineOutcomes(partnerInfo),\n component: Phq2Question,\n};\n\nexport const Q_RETRIAGE_PHQ_2: QuestionDefinition = {\n id: QUESTION_ID,\n shouldShowQuestion: (state) => qualifiesForNoomMed(state),\n component: Phq2Question,\n};\n","import React from \"react\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { PHQ_OPTIONS } from \"@/constants\";\nimport { useAppContext } from \"@/contexts\";\nimport { qualifiesForNoomMed } from \"@/utils/qualification\";\nimport { shouldAskBaselineOutcomes } from \"@/utils/survey/outcomes\";\n\nimport { QuestionComponentProps, QuestionDefinition } from \"../../../Question\";\nimport { MultipleChoiceQuestion } from \"../../core\";\n\nconst QUESTION_ID = \"phq3\";\n\ndeclare module \"@/contexts\" {\n interface SurveyAnswers {\n phq3?: string;\n }\n}\n\nconst Phq3Question: React.FC = ({\n onClickBack,\n onClickNext,\n surveyAnswers,\n}) => {\n const { surveyMetadata } = useAppContext();\n const { t } = useTranslation();\n\n const questionText =\n surveyMetadata?.name === \"RECURRING_OUTCOMES\"\n ? t(\"phq3.questionText.recurringOutcomes\")\n : t(\"phq3.questionText.enrollment\");\n return (\n \n );\n};\n\nexport const Q_PHQ_3: QuestionDefinition = {\n id: QUESTION_ID,\n shouldShowQuestion: ({ partnerInfo }) =>\n shouldAskBaselineOutcomes(partnerInfo),\n component: Phq3Question,\n};\n\nexport const Q_RETRIAGE_PHQ_3: QuestionDefinition = {\n id: QUESTION_ID,\n shouldShowQuestion: (state) => qualifiesForNoomMed(state),\n component: Phq3Question,\n};\n","import React from \"react\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { PHQ_OPTIONS } from \"@/constants\";\nimport { useAppContext } from \"@/contexts\";\nimport { qualifiesForNoomMed } from \"@/utils/qualification\";\nimport { shouldAskBaselineOutcomes } from \"@/utils/survey/outcomes\";\n\nimport { QuestionComponentProps, QuestionDefinition } from \"../../../Question\";\nimport { MultipleChoiceQuestion } from \"../../core\";\n\nconst QUESTION_ID = \"phq4\";\n\ndeclare module \"@/contexts\" {\n interface SurveyAnswers {\n phq4?: string;\n }\n}\n\nconst Phq4Question: React.FC = ({\n onClickBack,\n onClickNext,\n surveyAnswers,\n}) => {\n const { surveyMetadata } = useAppContext();\n const { t } = useTranslation();\n\n const questionText =\n surveyMetadata?.name === \"RECURRING_OUTCOMES\"\n ? t(\"phq4.questionText.recurringOutcomes\")\n : t(\"phq4.questionText.enrollment\");\n return (\n \n );\n};\n\nexport const Q_PHQ_4: QuestionDefinition = {\n id: QUESTION_ID,\n shouldShowQuestion: ({ partnerInfo }) =>\n shouldAskBaselineOutcomes(partnerInfo),\n component: Phq4Question,\n};\n\nexport const Q_RETRIAGE_PHQ_4: QuestionDefinition = {\n id: QUESTION_ID,\n shouldShowQuestion: (state) => qualifiesForNoomMed(state),\n component: Phq4Question,\n};\n","import React from \"react\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { SurveyAnswer, useAppContext } from \"@/contexts\";\nimport { calculateDppRiskScore } from \"@/utils/dpp\";\nimport { partnerOffersPrograms } from \"@/utils/programs\";\nimport { shouldShowDppQualification } from \"@/utils/survey/retriage\";\n\nimport {\n QuestionComponentProps,\n QuestionDefinition,\n QuestionOption,\n} from \"../../Question\";\nimport { MultipleChoiceQuestion } from \"../core\";\n\nconst QUESTION_ID = \"physicalActivity\";\n\ndeclare module \"@/contexts\" {\n interface SurveyAnswers {\n physicalActivity?: string;\n riskScore?: number;\n dppEligible?: boolean;\n }\n}\n\nconst PhysicalActivityQuestion: React.FC = ({\n onClickBack,\n onClickNext,\n surveyAnswers,\n}) => {\n const { retriageEligibility } = useAppContext();\n const { t } = useTranslation();\n\n const options: QuestionOption[] = [\n { id: \"yes\", text: t(\"physicalActivity.options.yes\") },\n { id: \"no\", text: t(\"physicalActivity.options.no\") },\n ];\n\n const calculateDppRiskAndProceed = async (answer: SurveyAnswer) => {\n const riskScore = calculateDppRiskScore({\n retriageEligibility,\n surveyAnswers: {\n ...surveyAnswers,\n [QUESTION_ID]: answer as string,\n },\n });\n\n onClickNext(answer, {\n riskScore,\n dppEligible: surveyAnswers.dppEligible !== false && riskScore >= 5,\n });\n };\n\n return (\n \n );\n};\n\nexport const Q_PHYSICAL_ACTIVITY: QuestionDefinition = {\n id: QUESTION_ID,\n shouldShowQuestion: ({\n enrollmentInfo,\n partnerInfo,\n selectedProgram,\n surveyAnswers: { dppEligible },\n }) =>\n partnerOffersPrograms([\"DPP\"], enrollmentInfo, partnerInfo) &&\n selectedProgram !== \"MED\" &&\n selectedProgram !== \"MOOD\" &&\n selectedProgram !== \"NMPBA\" &&\n dppEligible !== false,\n component: PhysicalActivityQuestion,\n};\n\nexport const Q_RETRIAGE_PHYSICAL_ACTIVITY: QuestionDefinition = {\n id: QUESTION_ID,\n shouldShowQuestion: (state) => shouldShowDppQualification(state),\n component: PhysicalActivityQuestion,\n};\n","import React from \"react\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { useAppContext } from \"@/contexts\";\nimport { partnerOffersPrograms } from \"@/utils/programs\";\nimport { shouldShowDppQualification } from \"@/utils/survey/retriage\";\n\nimport {\n QuestionComponentProps,\n QuestionDefinition,\n QuestionOption,\n} from \"../../Question\";\nimport { CheckboxQuestion } from \"../core\";\n\nconst QUESTION_ID = \"prediabetesHistory\";\n\ndeclare module \"@/contexts\" {\n interface SurveyAnswers {\n prediabetesHistory?: string[];\n }\n}\n\nconst PrediabetesQuestion: React.FC = ({\n onClickBack,\n onClickNext,\n surveyAnswers,\n}) => {\n const { partnerInfo } = useAppContext();\n const { t } = useTranslation();\n\n const options: QuestionOption[] = [\n { id: \"prediabetes\", text: t(\"prediabetesHistory.options.prediabetes\") },\n { id: \"a1c\", text: t(\"prediabetesHistory.options.a1c\") },\n {\n id: \"fastingBloodSugarLevel\",\n text: t(\"prediabetesHistory.options.fastingBloodSugarLevel\", {\n context: partnerInfo?.configs.MEDICARE_PARTNER ? \"medicare\" : \"\",\n }),\n },\n { id: \"none\", text: t(\"prediabetesHistory.options.none\") },\n ];\n\n return (\n \n );\n};\n\nexport const Q_PREDIABETES_HISTORY: QuestionDefinition = {\n id: QUESTION_ID,\n shouldShowQuestion: ({\n enrollmentInfo,\n partnerInfo,\n selectedProgram,\n surveyAnswers: { dppEligible },\n }) =>\n partnerOffersPrograms([\"DPP\"], enrollmentInfo, partnerInfo) &&\n selectedProgram !== \"MED\" &&\n selectedProgram !== \"MOOD\" &&\n selectedProgram !== \"NMPBA\" &&\n dppEligible !== false,\n component: PrediabetesQuestion,\n};\n\nexport const Q_RETRIAGE_PREDIABETES_HISTORY: QuestionDefinition = {\n id: QUESTION_ID,\n shouldShowQuestion: (state) => shouldShowDppQualification(state),\n component: PrediabetesQuestion,\n};\n","import React, { useState } from \"react\";\nimport { Trans, useTranslation } from \"react-i18next\";\n\nimport { PregnantSelection, ScreenedOutReason } from \"@/constants\";\nimport { SurveyAnswer, useAppContext } from \"@/contexts\";\nimport { shouldShowCardiometabolicQuestionForRetriage } from \"@/utils/survey/retriage\";\n\nimport {\n QuestionComponentProps,\n QuestionDefinition,\n QuestionOption,\n} from \"../../Question\";\nimport { MultipleChoiceQuestion } from \"../core\";\n\nconst QUESTION_ID = \"pregnant\";\n\ndeclare module \"@/contexts\" {\n interface SurveyAnswers {\n pregnant?: PregnantSelection;\n }\n}\n\nconst PregnantQuestion: React.FC = ({\n onClickBack,\n onClickNext,\n surveyAnswers,\n}) => {\n const { enrollmentType } = useAppContext();\n const [shouldShowConfirmation, setShouldShowConfirmation] = useState(false);\n const [selectedItem, setSelectedItem] = useState(\n surveyAnswers[QUESTION_ID] || \"\",\n );\n const { t } = useTranslation();\n\n const { liabilityWaiverBMI, liabilityWaiverEatingDisorder } = surveyAnswers;\n const hasAlreadySignedLiabilityWaiver =\n !!liabilityWaiverEatingDisorder || !!liabilityWaiverBMI;\n\n const options: QuestionOption[] = [\n { id: PregnantSelection.YES, text: t(\"pregnant.options.yes\") },\n // In the future, we may want to include this option for weight loss pacing calculation\n // Currently, this question appears after pacing so it isn't useful.\n {\n id: PregnantSelection.NO_BUT_NURSING,\n text: t(\"pregnant.options.noButNursing\"),\n },\n {\n id: PregnantSelection.NO_BUT_PLANNING,\n text: t(\"pregnant.options.noButPlanning\"),\n },\n { id: PregnantSelection.NO, text: t(\"pregnant.options.no\") },\n ];\n\n const handleAnswerBeforeProceeding = async (\n answer: SurveyAnswer,\n _additionalAnswers?: Record,\n _screenedOutReason?: ScreenedOutReason,\n source?: \"button\" | \"option\",\n ) => {\n setSelectedItem(answer as string);\n\n if (\n answer === PregnantSelection.YES &&\n enrollmentType !== \"INITIAL_ENROLLMENT\"\n ) {\n onClickNext(answer, {}, ScreenedOutReason.PREGNANT);\n return;\n }\n\n if (source === \"button\") {\n onClickNext(answer);\n return;\n }\n\n if (shouldShowConfirmation) {\n return;\n }\n\n if (\n enrollmentType === \"INITIAL_ENROLLMENT\" &&\n answer === PregnantSelection.YES &&\n !hasAlreadySignedLiabilityWaiver &&\n !shouldShowConfirmation\n ) {\n setShouldShowConfirmation(true);\n return;\n }\n\n onClickNext(answer);\n };\n\n return (\n \n ) : undefined\n }\n ctaText={shouldShowConfirmation ? t(\"pregnant.ctaText\") : \"\"}\n onClickBack={onClickBack}\n onClickNext={handleAnswerBeforeProceeding}\n options={options}\n questionId={QUESTION_ID}\n questionText={t(\"pregnant.questionText\")}\n selectedItem={selectedItem}\n />\n );\n};\n\nexport const Q_PREGNANT: QuestionDefinition = {\n id: QUESTION_ID,\n shouldShowQuestion: ({ selectedProgram, surveyAnswers: { sex } }) =>\n selectedProgram !== \"MOOD\" &&\n (sex === \"female\" || sex === \"intersex\" || sex === \"preferNotToSay\"),\n component: PregnantQuestion,\n};\n\nexport const Q_RETRIAGE_PREGNANT: QuestionDefinition = {\n id: QUESTION_ID,\n shouldShowQuestion: ({ retriageEligibility, surveyAnswers: { sex } }) =>\n shouldShowCardiometabolicQuestionForRetriage(retriageEligibility) &&\n (sex === \"female\" || sex === \"intersex\" || sex === \"preferNotToSay\"),\n component: PregnantQuestion,\n};\n","import i18next from \"i18next\";\nimport React, { useEffect } from \"react\";\nimport { isBrowser } from \"react-device-detect\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { Button, Spacing, Stack } from \"@noom/wax-component-library\";\n\nimport {\n QuestionComponentProps,\n QuestionDefinition,\n} from \"@/components/survey/Question\";\nimport { HealthGoal, ProgramOffering } from \"@/constants\";\nimport { useAppContext } from \"@/contexts\";\nimport { Partner } from \"@/models\";\nimport { isB2CPartner } from \"@/utils/partners\";\nimport { partnerOffersPrograms } from \"@/utils/programs\";\n\nimport {\n BaseQuestion,\n ImageBulletListCard,\n ItemDefinition as BulletItemDefinition,\n} from \"../core\";\n\nconst QUESTION_ID = \"programOverview\";\n\ndeclare module \"@/contexts\" {\n interface SurveyAnswers {\n programOverview?: string;\n }\n}\n\ntype ProgramOverviewConfig = {\n buttonText: string;\n program: ProgramOffering | null;\n questionText: string;\n listItems: BulletItemDefinition[];\n};\n\nconst getProgramMap: (\n partnerInfo: Partner | null,\n) => Record = (partnerInfo) => ({\n [HealthGoal.REDUCING_STRESS_ANXIOUS_FEELINGS]: {\n buttonText: i18next.t(\n \"programOverview.ctaText.reducingStressAnxiousFeelings\",\n ),\n program: \"MOOD\",\n questionText: i18next.t(\n \"programOverview.questionText.reducingStressAnxiousFeelings\",\n ),\n listItems: [\n {\n text: i18next.t(\n \"programOverview.valueProps.item1.reducingStressAnxiousFeelings\",\n ),\n image: \"/assets/img/illustration-lightbulb.svg\",\n },\n {\n text: i18next.t(\n \"programOverview.valueProps.item2.reducingStressAnxiousFeelings\",\n ),\n image: \"/assets/img/illustration-brain.svg\",\n },\n ],\n },\n [HealthGoal.LOSING_WEIGHT]: {\n buttonText: i18next.t(\"programOverview.ctaText.losingWeight\"),\n program: null,\n questionText: i18next.t(\"programOverview.questionText.losingWeight\"),\n listItems: [\n {\n text: i18next.t(\"programOverview.valueProps.item1.losingWeight\", {\n context:\n isB2CPartner(partnerInfo) || partnerInfo?.configs?.HIDE_COST\n ? \"notFree\"\n : \"free\",\n }),\n image: \"/assets/img/illustration-weight.svg\",\n },\n {\n text: i18next.t(\"programOverview.valueProps.item2.losingWeight\"),\n image: \"/assets/img/illustration-food-logging.svg\",\n },\n ],\n },\n});\n\nconst ProgramOverview: React.FC = ({\n onClickBack,\n onClickNext,\n surveyAnswers,\n}) => {\n const { enrollmentInfo, partnerInfo, setSelectedProgram, setSurveyAnswers } =\n useAppContext();\n const { t } = useTranslation();\n\n const { healthGoal } = surveyAnswers;\n\n const PROGRAM_MAP = getProgramMap(partnerInfo);\n\n let assignedHealthGoal = healthGoal || HealthGoal.LOSING_WEIGHT;\n\n if (\n !healthGoal &&\n partnerOffersPrograms([\"MOOD\"], enrollmentInfo, partnerInfo)\n ) {\n assignedHealthGoal = HealthGoal.REDUCING_STRESS_ANXIOUS_FEELINGS;\n }\n\n const { buttonText, program, questionText, listItems } =\n PROGRAM_MAP[assignedHealthGoal];\n\n useEffect(() => {\n setSelectedProgram(program);\n }, [program]);\n\n return (\n {\n // Don't persist the selection if navigating before this question\n setSurveyAnswers({ ...surveyAnswers, [QUESTION_ID]: undefined });\n onClickBack();\n }}\n questionId={QUESTION_ID}\n questionText={questionText}\n >\n \n \n {\n onClickNext(assignedHealthGoal);\n }}\n size=\"xl\"\n type=\"submit\"\n _focus={{\n boxShadow: \"none\",\n }}\n >\n {buttonText}\n \n \n \n );\n};\n\nexport const Q_PROGRAM_OVERVIEW: QuestionDefinition = {\n id: QUESTION_ID,\n shouldShowQuestion: () => true,\n component: ProgramOverview,\n};\n","import React from \"react\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { qualifiesForNoomMed } from \"@/utils/qualification\";\n\nimport {\n QuestionComponentProps,\n QuestionDefinition,\n QuestionOption,\n} from \"../../Question\";\nimport { MultipleChoiceQuestion } from \"../core\";\n\nconst QUESTION_ID = \"mainReason\";\n\ndeclare module \"@/contexts\" {\n interface SurveyAnswers {\n mainReason?: string;\n }\n}\n\nconst ReasonForLosingWeightQuestion: React.FC = ({\n onClickBack,\n onClickNext,\n surveyAnswers,\n}) => {\n const { t } = useTranslation();\n\n const options: QuestionOption[] = [\n {\n id: \"physicalAppearance\",\n text: t(\"reasonForLosingWeight.options.physicalAppearance\"),\n },\n {\n id: \"engageFamily\",\n text: t(\"reasonForLosingWeight.options.engageFamily\"),\n },\n { id: \"healthier\", text: t(\"reasonForLosingWeight.options.healthier\") },\n { id: \"feelBetter\", text: t(\"reasonForLosingWeight.options.feelBetter\") },\n { id: \"other\", text: t(\"reasonForLosingWeight.options.other\") },\n ];\n\n return (\n \n );\n};\n\nexport const Q_REASON_FOR_LOSING_WEIGHT: QuestionDefinition = {\n id: QUESTION_ID,\n shouldShowQuestion: (state) =>\n state.selectedProgram !== \"MOOD\" && qualifiesForNoomMed(state),\n component: ReasonForLosingWeightQuestion,\n};\n","import React from \"react\";\nimport { Trans, useTranslation } from \"react-i18next\";\n\nimport { Button, Spacing, Stack, Text } from \"@noom/wax-component-library\";\n\nimport {\n QuestionComponentProps,\n QuestionDefinition,\n} from \"@/components/survey/Question\";\nimport { ProgramOffering } from \"@/constants\";\nimport { useAppContext } from \"@/contexts\";\n\nimport { BaseQuestion, ImageBulletListCard } from \"../core\";\n\nconst QUESTION_ID = \"scaleOptIn\";\n\ndeclare module \"@/contexts\" {\n interface SurveyAnswers {\n scaleOptIn?: boolean;\n }\n}\n\nconst ScaleOptIn: React.FC = ({ onClickNext }) => {\n const { selectedProgram } = useAppContext();\n const { t } = useTranslation();\n const bulletListItems = [\n {\n image: \"/assets/img/scaleOptIn-chart.png\",\n text: t(\"scaleOptIn.valueProps.item1\"),\n },\n {\n image: \"/assets/img/scaleOptIn-scale.png\",\n text: t(\"scaleOptIn.valueProps.item2\"),\n },\n ];\n\n const DEFERRED_SHIPPING_TEXT: Partial> =\n {\n NMPBA: (\n \n \n \n ),\n MED: {t(\"scaleOptIn.deferredShippingText.med\")},\n };\n\n return (\n undefined}\n questionId={QUESTION_ID}\n questionText={t(\"scaleOptIn.questionText\")}\n >\n \n \n \n \n {selectedProgram && DEFERRED_SHIPPING_TEXT[selectedProgram]}\n \n {\n onClickNext(true);\n }}\n size=\"xl\"\n type=\"submit\"\n >\n {t(\"scaleOptIn.ctaText.yes\")}\n \n {\n onClickNext(false);\n }}\n size=\"xl\"\n variant=\"outline\"\n >\n {t(\"scaleOptIn.ctaText.no\")}\n \n \n \n );\n};\n\nexport const Q_SCALE_OPT_IN: QuestionDefinition = {\n id: QUESTION_ID,\n shouldShowQuestion: ({ partnerInfo, selectedProgram }) =>\n selectedProgram !== \"MOOD\" &&\n (selectedProgram === \"MED\" ||\n selectedProgram === \"NMPBA\" ||\n partnerInfo?.configs.OFFER_SCALE_SHIPMENT === true),\n component: ScaleOptIn,\n};\n\nexport const Q_RETRIAGE_SCALE_OPT_IN: QuestionDefinition = {\n id: QUESTION_ID,\n shouldShowQuestion: ({ selectedProgram }) =>\n selectedProgram === \"MED\" || selectedProgram === \"NMPBA\",\n component: ScaleOptIn,\n};\n","import React from \"react\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { ScreenedOutReason } from \"@/constants\";\nimport { useAppContext } from \"@/contexts\";\nimport {\n shouldShowCardiometabolicQuestionForRetriage,\n areSexAndGenderPrePopulated,\n} from \"@/utils/survey/retriage\";\n\nimport {\n QuestionComponentProps,\n QuestionDefinition,\n QuestionOption,\n} from \"../../Question\";\nimport { MultipleChoiceQuestion } from \"../core\";\n\nconst QUESTION_ID = \"sex\";\nexport const SEX_QUESTION_ID = QUESTION_ID;\n\ndeclare module \"@/contexts\" {\n interface SurveyAnswers {\n sex?: string;\n }\n}\n\nconst SexQuestion: React.FC = ({\n onClickBack,\n onClickNext,\n surveyAnswers,\n}) => {\n const { selectedProgram } = useAppContext();\n const { t } = useTranslation();\n\n const options: QuestionOption[] = [\n { id: \"male\", text: t(\"sex.options.male\") },\n { id: \"female\", text: t(\"sex.options.female\") },\n { id: \"intersex\", text: t(\"sex.options.intersex\") },\n { id: \"preferNotToSay\", text: t(\"sex.options.preferNotToSay\") },\n ];\n\n const questionDescription =\n selectedProgram === \"MOOD\" ? \"\" : t(\"sex.questionDescription\");\n\n return (\n \n );\n};\n\nexport const Q_SEX: QuestionDefinition = {\n id: QUESTION_ID,\n shouldShowQuestion: ({\n screenedOutReason,\n selectedProgram,\n surveyAnswers: { sex },\n }) =>\n // Hide question if the user answered in the metabolic path and was screened out.\n !(\n sex &&\n selectedProgram === \"MOOD\" &&\n // Should include its own ScreenedOutReason (if applicable) and any that follow this question.\n [ScreenedOutReason.PREGNANT].includes(\n screenedOutReason as ScreenedOutReason,\n )\n ),\n component: SexQuestion,\n};\n\nexport const Q_RETRIAGE_SEX: QuestionDefinition = {\n id: QUESTION_ID,\n shouldShowQuestion: ({ retriageEligibility, surveyAnswers }) =>\n !areSexAndGenderPrePopulated(surveyAnswers, retriageEligibility) &&\n shouldShowCardiometabolicQuestionForRetriage(retriageEligibility),\n component: SexQuestion,\n};\n","import React from \"react\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { isB2CPartner } from \"@/utils/partners\";\n\nimport {\n QuestionComponentProps,\n QuestionDefinition,\n QuestionOption,\n} from \"../../Question\";\nimport { MultipleChoiceQuestion } from \"../core\";\n\nconst QUESTION_ID = \"sleep\";\n\ndeclare module \"@/contexts\" {\n interface SurveyAnswers {\n sleep?: string;\n }\n}\n\nconst SleepQuestion: React.FC = ({\n onClickBack,\n onClickNext,\n surveyAnswers,\n}) => {\n const { t } = useTranslation();\n\n const options: QuestionOption[] = [\n { id: \"never\", text: t(\"sleep.options.never\") },\n { id: \"rarely\", text: t(\"sleep.options.rarely\") },\n { id: \"occasionally\", text: t(\"sleep.options.occasionally\") },\n { id: \"frequently\", text: t(\"sleep.options.frequently\") },\n { id: \"everyNight\", text: t(\"sleep.options.everyNight\") },\n ];\n\n return (\n \n );\n};\n\nexport const Q_SLEEP: QuestionDefinition = {\n id: QUESTION_ID,\n shouldShowQuestion: ({ partnerInfo, selectedProgram }) =>\n selectedProgram !== \"MOOD\" && !isB2CPartner(partnerInfo),\n component: SleepQuestion,\n};\n","import React from \"react\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { isB2CPartner } from \"@/utils/partners\";\n\nimport {\n QuestionComponentProps,\n QuestionDefinition,\n QuestionOption,\n} from \"../../Question\";\nimport { MultipleChoiceQuestion } from \"../core\";\n\nconst QUESTION_ID = \"stressEating\";\n\ndeclare module \"@/contexts\" {\n interface SurveyAnswers {\n stressEating?: string;\n }\n}\n\nconst StressEatingQuestion: React.FC = ({\n onClickBack,\n onClickNext,\n surveyAnswers,\n}) => {\n const { t } = useTranslation();\n\n const options: QuestionOption[] = [\n {\n id: \"stronglyDisagree\",\n text: t(\"stressEating.options.stronglyDisagree\"),\n },\n { id: \"disagree\", text: t(\"stressEating.options.disagree\") },\n { id: \"agree\", text: t(\"stressEating.options.agree\") },\n { id: \"stronglyAgree\", text: t(\"stressEating.options.stronglyAgree\") },\n ];\n return (\n \n );\n};\n\nexport const Q_STRESS_EATING: QuestionDefinition = {\n id: QUESTION_ID,\n shouldShowQuestion: ({ partnerInfo, selectedProgram }) =>\n selectedProgram !== \"MOOD\" && !isB2CPartner(partnerInfo),\n component: StressEatingQuestion,\n};\n","import React from \"react\";\nimport { useTranslation } from \"react-i18next\";\n\nimport {\n QuestionComponentProps,\n QuestionDefinition,\n QuestionOption,\n} from \"@/components/survey/Question\";\nimport { MultipleChoiceQuestion } from \"@/components/survey/questionTypes/core\";\nimport { HealthConditionOptionId, PrimaryCareProviderSelection } from \"@/constants\";\n\nconst QUESTION_ID = \"primaryCareProvider\";\n\ndeclare module \"@/contexts\" {\n interface SurveyAnswers {\n primaryCareProvider?: PrimaryCareProviderSelection;\n }\n}\n\nconst PrimaryCareProviderQuestion: React.FC = ({ onClickBack, onClickNext, surveyAnswers }) => {\n const { t } = useTranslation();\n\n const options: QuestionOption[] = [\n {\n id: PrimaryCareProviderSelection.YES,\n text: t(\"primaryCareProvider.options.yes\"),\n },\n { id: PrimaryCareProviderSelection.NO, text: t(\"primaryCareProvider.options.no\") },\n ];\n\n return (\n \n );\n}\n\nexport const Q_PRIMARY_CARE_PROVIDER: QuestionDefinition = {\n id: QUESTION_ID,\n shouldShowQuestion: ({ partnerInfo, surveyAnswers: { healthConditions } }) =>\n !!(partnerInfo?.configs.OFFERS_DIABETES_MANAGEMENT && healthConditions?.includes(HealthConditionOptionId.TYPE2_DIABETES)),\n component: PrimaryCareProviderQuestion,\n};\n","import React from \"react\";\nimport { Trans, useTranslation } from \"react-i18next\";\n\nimport {\n Box,\n Button,\n CompassColor,\n Image,\n Link,\n Size,\n Spacing,\n Stack,\n Text,\n} from \"@noom/wax-component-library\";\n\nimport { QuestionComponentProps } from \"@/components/survey/Question\";\n\nimport { BaseQuestion } from \"../../core\";\n\ntype DppDescriptionForMedProps = Pick<\n QuestionComponentProps,\n \"onClickBack\" | \"onClickNext\"\n> & {\n questionId: string;\n firstName: string;\n};\n\nexport const DppDescriptionForMed: React.FC = ({\n onClickBack,\n onClickNext,\n questionId,\n firstName,\n}) => {\n const { t } = useTranslation();\n const footer = (\n \n *{\" \"}\n \n {t(\"dppInformation.studyLinkText\", \"See published study\")}\n \n \n );\n return (\n \n {/* This isn't using the prop in BaseQuestion cause of the font size */}\n \n \n \n \n {t(\"programSet.dppDescriptionForMed.listItems\", {\n returnObjects: true,\n }).map((item: { icon: string; text: string }) => (\n \n \"\"\n \n {item.text}\n \n \n ))}\n \n \n \n \n onClickNext(null)}\n size=\"xl\"\n type=\"submit\"\n >\n {t(\"programSet.dppDescriptionForMed.ctaText\")}\n \n \n {t(\"programSet.dppDescriptionForMed.disclaimer\")}\n \n \n );\n};\n","import React, { ReactElement } from \"react\";\nimport { Trans, useTranslation } from \"react-i18next\";\n\nimport {\n Box,\n Button,\n CompassColor,\n Image,\n Spacing,\n Stack,\n Text,\n} from \"@noom/wax-component-library\";\n\nimport {\n QuestionComponentProps,\n QuestionDefinition,\n} from \"@/components/survey/Question\";\nimport { NoomMedMoreOptionsSelection, PrimaryCareProviderSelection, ProgramOffering } from \"@/constants\";\nimport { useAppContext } from \"@/contexts\";\nimport { partnerOffersPrograms } from \"@/utils/programs\";\n\nimport { BaseInterstitial, BaseQuestion } from \"../../core\";\n\nimport { DppDescriptionForMed } from \"./DppDescriptionForMed\";\n\nconst QUESTION_ID = \"programSet\";\n\ntype ProgramSetConfig = {\n backgroundColor?: CompassColor;\n ctaText: string;\n footerText: string;\n headerText: string;\n helperText: string;\n imageAlt: string;\n imageSrc: string;\n};\n\ntype ValueProp = {\n caption: ReactElement;\n url: string;\n};\n\n// Mood program does not show this question\ntype WeightLossProgram = Exclude;\n\nconst VALUE_PROPS: ValueProp[] = [\n {\n caption: ,\n url: \"/assets/img/icon-trophy.svg\",\n },\n {\n caption: ,\n url: \"/assets/img/icon-graph.svg\",\n },\n {\n caption: ,\n url: \"/assets/img/icon-fire.svg\",\n },\n];\n\nconst WeightDescriptionForMedQuestion: React.FC = ({\n onClickBack,\n onClickNext,\n surveyAnswers,\n}) => {\n const { t } = useTranslation();\n\n const { eligibilityCheck, noomMedMoreOptions } = surveyAnswers;\n\n return (\n \n {/* This isn't using the prop in BaseQuestion cause of the font size */}\n \n {t(\"programSet.weightDescriptionForMed.questionHelperText\")}\n \n \n {VALUE_PROPS.map(({ caption, url }) => (\n \n \"\"\n \n {caption}\n \n \n ))}\n \n \n \n \n onClickNext(null)}\n size=\"xl\"\n type=\"submit\"\n >\n {t(\"programSet.weightDescriptionForMed.ctaText\")}\n \n {noomMedMoreOptions !== NoomMedMoreOptionsSelection.OTHER && (\n \n {t(\"programSet.weightDescriptionForMed.disclaimer\")}\n \n )}\n \n );\n};\n\nconst ProgramSet: React.FC = ({\n onClickBack,\n onClickNext,\n surveyAnswers,\n}) => {\n const { enrollmentInfo, partnerInfo, selectedProgram } = useAppContext();\n const { primaryCareProvider, diabetesSupport } = surveyAnswers\n const { t } = useTranslation();\n\n const { firstName = \"\" } = surveyAnswers.eligibilityCheck || {};\n\n const programSetConfigMap: Record = {\n DPP: {\n ctaText: t(\"programSet.baseInterstitial.ctaText.dpp\"),\n footerText: t(\"programSet.baseInterstitial.footerText.dpp\"),\n headerText: t(\"programSet.baseInterstitial.headerText.dpp\", {\n firstName,\n }),\n helperText: t(\"programSet.baseInterstitial.helperText.dpp\"),\n imageAlt:\n \"A graph representing how conventional diets can result in regaining weight vs. keeping it off with Noom\",\n imageSrc: \"/assets/img/yoyo-graph.svg\",\n },\n MED: {\n backgroundColor: CompassColor.salmon,\n ctaText: t(\"programSet.baseInterstitial.ctaText.med\"),\n footerText: t(\"programSet.baseInterstitial.footerText.med\"),\n headerText: t(\"programSet.baseInterstitial.headerText.med\"),\n helperText: t(\"programSet.baseInterstitial.helperText.med\"),\n imageAlt: \"A big thumb with two people climbing up it\",\n imageSrc: \"/assets/img/big-thumb-mountain.webp\",\n },\n NMPBA: {\n backgroundColor: CompassColor.salmon,\n ctaText: t(\"programSet.baseInterstitial.ctaText.med\"),\n footerText: t(\"programSet.baseInterstitial.footerText.med\"),\n headerText: t(\"programSet.baseInterstitial.headerText.med\"),\n helperText: t(\"programSet.baseInterstitial.helperText.med\", {\n context: \"accolade\",\n }),\n imageAlt: \"A big thumb with two people climbing up it\",\n imageSrc: \"/assets/img/big-thumb-mountain.webp\",\n },\n WEIGHT: {\n ctaText: t(\"programSet.baseInterstitial.ctaText.weight\"),\n footerText: t(\"programSet.baseInterstitial.footerText.weight\"),\n headerText: t(\"programSet.baseInterstitial.headerText.weight\", {\n firstName,\n }),\n helperText: t(\"programSet.baseInterstitial.helperText.weight\"),\n imageAlt:\n \"A graph representing how conventional diets can result in regaining weight vs. keeping it off with Noom\",\n imageSrc: \"/assets/img/yoyo-graph.svg\",\n },\n };\n\n if (partnerOffersPrograms([\"MED\"], enrollmentInfo, partnerInfo)) {\n if (selectedProgram === \"DPP\") {\n return (\n \n );\n }\n if (selectedProgram === \"WEIGHT\") {\n return (\n \n );\n }\n }\n\n const interstitialProps =\n programSetConfigMap[selectedProgram as WeightLossProgram];\n\n /* TODO: The condition for diabetes support should be updated after the requirements are finalized.\n Current condition added for E2E testing purposes. */\n if (primaryCareProvider === PrimaryCareProviderSelection.YES && diabetesSupport) {\n return (\n \n );\n }\n\n return (\n \n );\n};\n\nexport const Q_PROGRAM_SET: QuestionDefinition = {\n id: QUESTION_ID,\n shouldShowQuestion: ({ selectedProgram }) => selectedProgram !== \"MOOD\",\n component: ProgramSet,\n};\n","import React from \"react\";\nimport { Trans, useTranslation } from \"react-i18next\";\n\nimport {\n CompassColor,\n Image,\n Spacing,\n Stack,\n Text,\n} from \"@noom/wax-component-library\";\n\nimport {\n QuestionComponentProps,\n QuestionDefinition,\n} from \"@/components/survey/Question\";\nimport { shouldAskBaselineOutcomes } from \"@/utils/survey/outcomes\";\n\nimport { BaseInterstitial } from \"../../core\";\n\nconst QUESTION_ID = \"baselineHealth\";\n\nconst BaselineHealth: React.FC = ({\n onClickBack,\n onClickNext,\n}) => {\n const { t } = useTranslation();\n\n return (\n \n \n \n \n {t(\"baselineHealth.title\")}\n \n \n \n \n \n \n );\n};\n\nexport const Q_BASELINE_HEALTH: QuestionDefinition = {\n id: QUESTION_ID,\n shouldShowQuestion: ({ partnerInfo }) =>\n shouldAskBaselineOutcomes(partnerInfo),\n component: BaselineHealth,\n};\n","import React from \"react\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { CompassColor, Heading } from \"@noom/wax-component-library\";\n\nimport {\n QuestionComponentProps,\n QuestionDefinition,\n} from \"@/components/survey/Question\";\nimport { NoomMedMoreOptionsSelection } from \"@/constants\";\n\nimport { BaseInterstitial } from \"../../core\";\n\nconst QUESTION_ID = \"continueProgram\";\n\nconst ContinueProgram: React.FC = ({\n onClickBack,\n onClickNext,\n}) => {\n const { t } = useTranslation();\n\n return (\n \n \n {t(\"continueProgram.message\")}\n \n \n );\n};\n\nexport const Q_CONTINUE_PROGRAM: QuestionDefinition = {\n id: QUESTION_ID,\n shouldShowQuestion: ({\n surveyAnswers: { dppEligible, noomMedMoreOptions },\n }) =>\n noomMedMoreOptions === NoomMedMoreOptionsSelection.OTHER &&\n dppEligible !== false,\n component: ContinueProgram,\n};\n","import React from \"react\";\nimport { useTranslation } from \"react-i18next\";\n\nimport {\n Box,\n Button,\n CompassColor,\n Heading,\n Image,\n Text\n} from \"@noom/wax-component-library\";\n\nimport {\n QuestionComponentProps,\n QuestionDefinition,\n} from \"@/components/survey/Question\";\nimport { BaseInterstitial } from \"@/components/survey/questionTypes/core\";\nimport { PrimaryCareProviderSelection } from \"@/constants\";\n\nconst QUESTION_ID = \"diabetesSupport\";\n\ndeclare module \"@/contexts\" {\n interface SurveyAnswers {\n diabetesSupport?: boolean;\n }\n}\n\nconst DiabetesSupport: React.FC = ({ onClickNext }) => {\n const { t } = useTranslation();\n\n return (\n null}\n onClickNext={() => Promise.resolve()}\n questionId={QUESTION_ID}\n width=\"550px\"\n >\n \n \n \n \n {t(\"diabetesSupport.subHeading\")}\n \n \n {t(\"diabetesSupport.heading\")}\n \n \n {t(\"diabetesSupport.body\")}\n \n \n \n \n onClickNext(true)}\n padding=\"unset\"\n size=\"xl\"\n >\n {t(\"diabetesSupport.cta\")}\n \n \n \n );\n}\n\nexport const Q_DIABETES_SUPPORT: QuestionDefinition = {\n id: QUESTION_ID,\n shouldShowQuestion: ({ partnerInfo, surveyAnswers: { primaryCareProvider } }) =>\n !!(partnerInfo?.configs.OFFERS_DIABETES_MANAGEMENT && primaryCareProvider === PrimaryCareProviderSelection.YES),\n component: DiabetesSupport,\n};\n","import React from \"react\";\nimport { Trans, useTranslation } from \"react-i18next\";\n\nimport {\n Box,\n Button,\n CompassColor,\n Image,\n Text,\n useMediaQuery,\n} from \"@noom/wax-component-library\";\n\nimport {\n QuestionComponentProps,\n QuestionDefinition,\n} from \"@/components/survey/Question\";\nimport { BaseInterstitial } from \"@/components/survey/questionTypes/core\";\nimport { PregnantSelection } from \"@/constants\";\n\nconst QUESTION_ID = \"nursing\";\n\nconst Nursing: React.FC = ({\n onClickBack,\n onClickNext,\n}) => {\n const [isBrowser] = useMediaQuery(\"(min-width: 1160px)\");\n const { t } = useTranslation();\n\n return (\n \n \n \n \n Thanks for sharing!\n \n When you're nursing, you may have different weight loss needs,\n so we'll adjust your plan.\n \n
\n
\n Once you feel ready to begin your weight loss journey post partum, we\n recommend discussing any specific adjustments with a medical\n professional to safely lose weight with Noom. Noom will allow you to\n manually customize your weight loss pace to match your needs both\n during and after nursing.\n
\n
\n \n onClickNext(null)}\n size=\"xl\"\n _focus={{\n boxShadow: \"none\",\n }}\n >\n {t(\"survey.questions.nursing.ctaText\")}\n \n \n \n );\n};\n\nexport const Q_NURSING: QuestionDefinition = {\n id: QUESTION_ID,\n shouldShowQuestion: ({ selectedProgram, surveyAnswers: { pregnant } }) =>\n selectedProgram !== \"MOOD\" && pregnant === PregnantSelection.NO_BUT_NURSING,\n component: Nursing,\n};\n","import React from \"react\";\nimport { Trans, useTranslation } from \"react-i18next\";\n\nimport {\n Box,\n Button,\n CompassColor,\n Heading,\n Image,\n Spacing,\n Stack,\n} from \"@noom/wax-component-library\";\n\nimport {\n QuestionComponentProps,\n QuestionDefinition,\n} from \"@/components/survey/Question\";\nimport { shouldShowPersonalizationFlow } from \"@/utils/survey/contentPersonalization\";\n\nimport { BaseInterstitial } from \"../../core\";\n\nconst QUESTION_ID = \"personalizationConfirmation\";\n\nconst PersonalizationConfirmation: React.FC = ({\n onClickNext,\n}) => {\n const { t } = useTranslation();\n\n return (\n null}\n onClickNext={() => Promise.resolve()}\n questionId={QUESTION_ID}\n width=\"400px\"\n >\n \n \n \n {t(\"personalizationConfirmation.heading\")}\n \n \n \n onClickNext(null)}\n padding=\"unset\"\n size=\"xl\"\n whiteSpace=\"unset\"\n >\n Next\n \n \n \n );\n};\n\nexport const Q_PERSONALIZATION_CONFIRMATION: QuestionDefinition = {\n id: QUESTION_ID,\n shouldShowQuestion: ({ partnerInfo, selectedProgram, surveyAnswers }) =>\n shouldShowPersonalizationFlow(partnerInfo, selectedProgram, surveyAnswers),\n component: PersonalizationConfirmation,\n};\n","import React from \"react\";\nimport { Trans, useTranslation } from \"react-i18next\";\n\nimport {\n Box,\n Button,\n CompassColor,\n Heading,\n Image,\n Spacing,\n Stack,\n Text,\n} from \"@noom/wax-component-library\";\n\nimport {\n QuestionComponentProps,\n QuestionDefinition,\n} from \"@/components/survey/Question\";\nimport { shouldShowPersonalizationFlow } from \"@/utils/survey/contentPersonalization\";\n\nimport { BaseInterstitial } from \"../../core\";\n\nconst QUESTION_ID = \"personalizationIntro\";\n\nconst PersonalizationIntro: React.FC = ({\n onClickNext,\n}) => {\n const { t } = useTranslation();\n\n return (\n null}\n onClickNext={() => Promise.resolve()}\n questionId={QUESTION_ID}\n width=\"550px\"\n >\n \n \n \n {t(\"personalizationIntro.heading\")}\n \n \n \n At Noom, we take a holistic approach to sustainable weight loss.\n Science tells us that factors like stress, metabolism, movement, and\n sleep can all greatly affect your ability to lose weight.\n
\n
\n We've analyzed your responses so far, and recommend extra\n support in certain areas. Head to the next screen to learn more.\n
\n
\n
\n \n onClickNext(null)}\n padding=\"unset\"\n size=\"xl\"\n whiteSpace=\"unset\"\n >\n Next\n \n \n \n );\n};\n\nexport const Q_PERSONALIZATION_INTRO: QuestionDefinition = {\n id: QUESTION_ID,\n shouldShowQuestion: ({ partnerInfo, selectedProgram, surveyAnswers }) =>\n shouldShowPersonalizationFlow(partnerInfo, selectedProgram, surveyAnswers),\n component: PersonalizationIntro,\n};\n","import { Progress } from \"@chakra-ui/react\";\nimport React, { useEffect, useState } from \"react\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { Box, Text } from \"@noom/wax-component-library\";\n\ntype ProgressBarProps = {\n onComplete?: () => void;\n totalTimeMs: number;\n};\n\nexport const ProgressBar: React.FC = ({\n onComplete,\n totalTimeMs,\n}) => {\n const [percentage, setPercentage] = useState(0);\n const { t } = useTranslation();\n\n useEffect(() => {\n const intervalId = setInterval(\n () =>\n setPercentage((percent) => {\n if (percent === 100) {\n clearInterval(intervalId);\n return percent;\n }\n return percent + 1;\n }),\n totalTimeMs / 100,\n );\n\n return () => clearInterval(intervalId);\n }, []);\n\n useEffect(() => {\n if (percentage === 100) {\n onComplete?.();\n }\n }, [percentage]);\n\n return (\n \n \n {t(\"personalizingProgram.progressBarMessage\")}\n \n \n \n \n {percentage}%\n \n \n \n );\n};\n","import React, { useEffect } from \"react\";\nimport { isBrowser } from \"react-device-detect\";\nimport { useTranslation } from \"react-i18next\";\n\nimport {\n Box,\n CompassColor,\n Image,\n Spacing,\n Stack,\n Text,\n} from \"@noom/wax-component-library\";\n\nimport { ProgressBar } from \"@/components/ProgressBar\";\nimport {\n QuestionComponentProps,\n QuestionDefinition,\n} from \"@/components/survey/Question\";\nimport { useAppContext } from \"@/contexts\";\n\nimport { BaseInterstitial } from \"../../core\";\n\nconst QUESTION_ID = \"personalizingProgram\";\n\ntype TestimonialProps = {\n imageSrc: string;\n name: string;\n quote: string;\n};\n\nconst femaleTestimonialProps: TestimonialProps = {\n imageSrc: \"/assets/img/testimonial-female.png\",\n name: \"Jennifer\",\n quote:\n // eslint-disable-next-line quotes\n `\"Noom fits into my lifestyle perfectly. I can turn to this app day or night and they're there for me.\"`,\n};\n\nconst maleTestimonialProps: TestimonialProps = {\n imageSrc: \"/assets/img/testimonial-male.png\",\n name: \"Mike\",\n quote:\n // eslint-disable-next-line quotes\n `\"Noom changed the way I think about portion control. It changed my relationship with food.\"`,\n};\n\nconst Testimonial: React.FC = ({ imageSrc, name, quote }) => {\n const { t } = useTranslation();\n\n return (\n \n \n \"\"\n \n \n {quote}\n \n \n -{name}\n \n \n \n \n {t(\"personalizingProgram.disclaimer\")}\n \n \n );\n};\n\nconst PersonalizingProgram: React.FC = ({\n onClickBack,\n onClickNext,\n surveyAnswers,\n}) => {\n const { selectedProgram, setSelectedProgram } = useAppContext();\n const { t } = useTranslation();\n // If gender is defined, use gender, otherwise use sex.\n const gender = surveyAnswers.gender ?? surveyAnswers.sex;\n const isMale = gender === \"male\";\n\n const testimonialProps = isMale\n ? maleTestimonialProps\n : femaleTestimonialProps;\n\n useEffect(() => {\n // if this is the first time the user is seeing this screen selectedProgram may be null\n // if they've back navigated, we'll have set selectedProgram to either DPP or WEIGHT\n // setting selectedProgram again ensure that the correct program is set in the event\n // the user back navigated and dpp eligibility changed\n if ([null, \"DPP\", \"WEIGHT\"].includes(selectedProgram)) {\n setSelectedProgram(surveyAnswers.dppEligible ? \"DPP\" : \"WEIGHT\");\n }\n }, []);\n\n return (\n \n \n \n {\n onClickNext(null, { updatedProgram: selectedProgram });\n }}\n totalTimeMs={window.Cypress ? 500 : 6000}\n />\n \n \n );\n};\n\nexport const Q_PERSONALIZING_PROGRAM: QuestionDefinition = {\n id: QUESTION_ID,\n shouldShowQuestion: ({ selectedProgram }) => selectedProgram !== \"MOOD\",\n component: PersonalizingProgram,\n};\n","import React, { useEffect, useState } from \"react\";\nimport { Trans, useTranslation } from \"react-i18next\";\nimport { useLocation, useNavigate } from \"react-router-dom\";\n\nimport {\n Box,\n Button,\n CompassColor,\n Image,\n Link,\n Loader,\n Spacing,\n Text,\n useMediaQuery,\n} from \"@noom/wax-component-library\";\n\nimport { QuestionDefinition } from \"@/components/survey/Question\";\nimport {\n BaseInterstitial,\n BaseOutline,\n} from \"@/components/survey/questionTypes/core\";\nimport { HealthGoal, ScreenedOutReason } from \"@/constants\";\nimport { useAppContext } from \"@/contexts\";\nimport { useTrackEvent } from \"@/hooks\";\nimport { getDisplayName } from \"@/models\";\nimport {\n formatCustomSupportLink,\n isB2CPartner,\n isCareFirstPartner,\n} from \"@/utils/partners\";\nimport { partnerOffersPrograms } from \"@/utils/programs\";\n\n// This questions is only reachable via direct navigation. Use caution when updating this ID.\nconst QUESTION_ID = \"ineligible\";\n\ntype ScreenedOutReasonMoodWhitelist = Extract<\n ScreenedOutReason,\n ScreenedOutReason.PREGNANT\n>;\n\ntype ScreenedOutReasonB2CWhitelist = Extract<\n ScreenedOutReason,\n | ScreenedOutReason.PREGNANT\n | ScreenedOutReason.EATING_DISORDER\n | ScreenedOutReason.BMI_TOO_LOW\n>;\n\nconst supportButton = (\n \n);\n\nexport const ScreenedOut: React.FC = () => {\n const {\n enrollmentInfo,\n partnerInfo,\n screenedOutReason,\n surveyAnswers,\n setSelectedProgram,\n setSurveyAnswers,\n } = useAppContext();\n const { search } = useLocation();\n const navigate = useNavigate();\n const [showNotInterestedInMood, setShowNotInterestedInMood] = useState(false);\n const { trackAnonEvent, trackIdentifiedEvent } = useTrackEvent();\n useTranslation();\n\n const [isBrowser] = useMediaQuery(\"(min-width: 1160px)\");\n\n const isAccolade = partnerInfo?.configs?.ACCOLADE_PARTNER || false;\n const customSupportLink =\n partnerInfo?.configs?.CUSTOM_SUPPORT_LINK ||\n \"mailto:partnersupport@noom.com\";\n const formattedSupportLink = formatCustomSupportLink(customSupportLink);\n\n const partnerOffersMood = partnerOffersPrograms(\n [\"MOOD\"],\n enrollmentInfo,\n partnerInfo,\n );\n\n useEffect(() => {\n if (!screenedOutReason) return;\n trackAnonEvent(\"b2bEnrollmentAnonUserExcluded\", {\n exclusionReason: screenedOutReason,\n });\n\n trackIdentifiedEvent(\"b2bEnrollmentIdentifiedUserExcluded\", {});\n }, [screenedOutReason]);\n\n const proceedWithMood = () => {\n setSurveyAnswers({\n ...surveyAnswers,\n healthGoal: HealthGoal.REDUCING_STRESS_ANXIOUS_FEELINGS,\n });\n navigate({ pathname: \"/enrollment/programOverview\", search });\n };\n\n const partnerName = getDisplayName(partnerInfo);\n const supportLink = (\n \n );\n\n const accoladeSnippet = isAccolade ? (\n \n ) : (\n // eslint-disable-next-line react/jsx-no-useless-fragment\n <>\n );\n\n const screenedOutTextConfigs: {\n [key in ScreenedOutReason]: React.ReactElement;\n } = {\n [ScreenedOutReason.BMI_TOO_LOW]: (\n \n ),\n [ScreenedOutReason.EATING_DISORDER]: (\n \n ),\n [ScreenedOutReason.PREGNANT]: (\n \n ),\n };\n\n const screenedOutTextConfigsMoodOffered: {\n [key in ScreenedOutReasonMoodWhitelist]: React.ReactElement;\n } = {\n [ScreenedOutReason.PREGNANT]: (\n \n ),\n };\n\n const notInterestedInMoodTextConfigsMoodOffered: {\n [key in ScreenedOutReasonMoodWhitelist]: React.ReactElement;\n } = {\n [ScreenedOutReason.PREGNANT]: (\n \n ),\n };\n\n const screenedOutTextConfigsB2C: {\n [key in ScreenedOutReasonB2CWhitelist]: React.ReactElement;\n } = {\n [ScreenedOutReason.BMI_TOO_LOW]: (\n \n ),\n [ScreenedOutReason.EATING_DISORDER]: (\n \n ),\n [ScreenedOutReason.PREGNANT]: (\n \n ),\n };\n\n const notInterestedInMoodText: React.ReactElement | undefined =\n notInterestedInMoodTextConfigsMoodOffered[\n screenedOutReason as unknown as ScreenedOutReasonMoodWhitelist\n ];\n\n const showMoodCTAs: boolean =\n partnerOffersMood &&\n !!screenedOutTextConfigsMoodOffered[\n screenedOutReason as unknown as ScreenedOutReasonMoodWhitelist\n ] &&\n !showNotInterestedInMood;\n\n useEffect(() => {\n // if the user back navigates here and we show Mood CTAs, we can assume\n // that they were screened out of the metabolic path.\n // Restore state to what would be expected at this stage of the metabolic path\n // (nullify selectedProgram and restore healthGoal)\n if (showMoodCTAs) {\n setSelectedProgram(null);\n setSurveyAnswers({\n ...surveyAnswers,\n healthGoal: HealthGoal.LOSING_WEIGHT,\n });\n }\n }, [showMoodCTAs]);\n\n if (!screenedOutReason) {\n return (\n \n \n \n \n \n );\n }\n\n // Not all screened out reasons allow continuing with mood, so fallback if not.\n const screenedOutText: React.ReactElement =\n (partnerOffersMood &&\n screenedOutTextConfigsMoodOffered[\n screenedOutReason as unknown as ScreenedOutReasonMoodWhitelist\n ]) ||\n (isB2CPartner(partnerInfo) &&\n screenedOutTextConfigsB2C[\n screenedOutReason as unknown as ScreenedOutReasonB2CWhitelist\n ]) ||\n screenedOutTextConfigs[screenedOutReason];\n\n return (\n null}\n onClickNext={() => Promise.resolve()}\n questionId={QUESTION_ID}\n width={isBrowser ? \"600px\" : undefined}\n >\n \n \n {showNotInterestedInMood ? notInterestedInMoodText : screenedOutText}\n \n {showMoodCTAs && (\n \n \n Yes, let's work on mental wellness\n \n setShowNotInterestedInMood(true)}\n padding=\"unset\"\n size=\"xl\"\n variant=\"outline\"\n whiteSpace=\"unset\"\n borderRadius=\"8px\"\n >\n No thanks, I'm not interested\n \n \n )}\n \n );\n};\n\nexport const Q_SCREENED_OUT: QuestionDefinition = {\n id: QUESTION_ID,\n shouldShowQuestion: () => false,\n component: ScreenedOut,\n};\n","import { ProgramOffering } from \"@/constants\";\nimport { Partner } from \"@/models\";\n\nimport { isB2CPartner } from \"../partners\";\n\n/**\n * Determines if the SDOH questions should be asked.\n *\n * @param partnerInfo used to determine if the partner is a B2C partner\n * @param selectedProgram\n * @returns\n */\nexport const shouldAskSDOH = (\n partnerInfo: Partner | null,\n selectedProgram: ProgramOffering | null,\n) => {\n if (partnerInfo?.id === undefined) {\n return false;\n }\n\n return selectedProgram !== \"MOOD\" && !isB2CPartner(partnerInfo);\n};\n","import React from \"react\";\nimport { Trans, useTranslation } from \"react-i18next\";\n\nimport {\n CompassColor,\n Image,\n Spacing,\n Stack,\n Text,\n useMediaQuery,\n} from \"@noom/wax-component-library\";\n\nimport {\n QuestionComponentProps,\n QuestionDefinition,\n} from \"@/components/survey/Question\";\nimport { shouldAskSDOH } from \"@/utils/survey/sdoh\";\n\nimport { BaseInterstitial } from \"../../core\";\n\nconst QUESTION_ID = \"socialDeterminantsOfHealth\";\n\nconst SocialDeterminantsOfHealth: React.FC = ({\n onClickBack,\n onClickNext,\n}) => {\n const [isBrowser] = useMediaQuery(\"(min-width: 1160px)\");\n const { t } = useTranslation();\n\n return (\n \n \n \n \n {t(\"socialDeterminantsOfHealth.heading\")}\n \n \n \n \n \n \n );\n};\nexport const Q_SOCIAL_DETERMINANTS_OF_HEALTH: QuestionDefinition = {\n id: QUESTION_ID,\n shouldShowQuestion: ({ partnerInfo, selectedProgram }) =>\n shouldAskSDOH(partnerInfo, selectedProgram),\n component: SocialDeterminantsOfHealth,\n};\n","import React from \"react\";\nimport { Trans } from \"react-i18next\";\n\nimport {\n CompassColor,\n Image,\n Spacing,\n Stack,\n Text,\n} from \"@noom/wax-component-library\";\n\nimport {\n QuestionComponentProps,\n QuestionDefinition,\n} from \"@/components/survey/Question\";\nimport { shouldShowWomensHealthQuestions } from \"@/utils/survey/womensHealth\";\n\nimport { BaseInterstitial } from \"../../core\";\n\nconst QUESTION_ID = \"womensHealth\";\n\nconst WomensHealth: React.FC = ({\n onClickBack,\n onClickNext,\n}) => (\n \n \n \n \n \n While each body is unique, there are certain{\" \"}\n biological and hormonal changes associated with\n female physiology that can influence weight loss.\n
\n
\n We have a couple questions that let us customize your plan with{\" \"}\n science-backed, women's health tools.\n
\n
\n
\n \n);\n\nexport const Q_WOMENS_HEALTH: QuestionDefinition = {\n id: QUESTION_ID,\n shouldShowQuestion: (state) => shouldShowWomensHealthQuestions(state),\n component: WomensHealth,\n};\n","import React from \"react\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { shouldAskSDOH } from \"@/utils/survey/sdoh\";\n\nimport {\n QuestionComponentProps,\n QuestionDefinition,\n QuestionOption,\n} from \"../../../Question\";\nimport { MultipleChoiceQuestion } from \"../../core\";\n\nconst QUESTION_ID = \"nutritionBasics\";\n\ndeclare module \"@/contexts\" {\n interface SurveyAnswers {\n nutritionBasics?: \"veryConfident\" | \"somewhatConfident\" | \"notConfident\";\n }\n}\n\nconst NutritionBasicsQuestion: React.FC = ({\n onClickBack,\n onClickNext,\n surveyAnswers,\n}) => {\n const { t } = useTranslation();\n\n const options: QuestionOption[] = [\n { id: \"veryConfident\", text: t(\"nutritionBasics.options.veryConfident\") },\n {\n id: \"somewhatConfident\",\n text: t(\"nutritionBasics.options.somewhatConfident\"),\n },\n { id: \"notConfident\", text: t(\"nutritionBasics.options.notConfident\") },\n ];\n\n return (\n \n );\n};\n\nexport const Q_NUTRITION_BASICS: QuestionDefinition = {\n id: QUESTION_ID,\n shouldShowQuestion: ({ partnerInfo, selectedProgram }) => shouldAskSDOH(partnerInfo, selectedProgram),\n component: NutritionBasicsQuestion,\n};\n","import React from \"react\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { shouldAskSDOH } from \"@/utils/survey/sdoh\";\n\nimport {\n QuestionComponentProps,\n QuestionDefinition,\n QuestionOption,\n} from \"../../../Question\";\nimport { MultipleChoiceQuestion } from \"../../core\";\n\nconst QUESTION_ID = \"culturalImpacts\";\n\ndeclare module \"@/contexts\" {\n interface SurveyAnswers {\n culturalImpacts?: \"always\" | \"occasionally\" | \"never\";\n }\n}\n\nconst CulturalImpactsQuestion: React.FC = ({\n onClickBack,\n onClickNext,\n surveyAnswers,\n}) => {\n const { t } = useTranslation();\n\n const options: QuestionOption[] = [\n { id: \"always\", text: t(\"culturalImpacts.options.always\") },\n {\n id: \"occasionally\",\n text: t(\"culturalImpacts.options.occasionally\"),\n },\n { id: \"never\", text: t(\"culturalImpacts.options.never\") },\n ];\n\n return (\n \n );\n};\n\nexport const Q_CULTURAL_IMPACTS: QuestionDefinition = {\n id: QUESTION_ID,\n shouldShowQuestion: ({ partnerInfo, selectedProgram }) => shouldAskSDOH(partnerInfo, selectedProgram),\n component: CulturalImpactsQuestion,\n};\n","import React from \"react\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { shouldAskSDOH } from \"@/utils/survey/sdoh\";\n\nimport {\n QuestionComponentProps,\n QuestionDefinition,\n QuestionOption,\n} from \"../../../Question\";\nimport { CheckboxQuestion } from \"../../core\";\n\nconst QUESTION_ID = \"eatingMovingAffordably\";\n\ntype EatingMovingAnswer =\n | \"affordingHealthyFood\"\n | \"timeToPrepare\"\n | \"makingFoodLast\"\n | \"fewStores\"\n | \"fewHealthyOptions\"\n | \"transportion\"\n | \"none\";\n\ndeclare module \"@/contexts\" {\n interface SurveyAnswers {\n eatingMovingAffordably?: EatingMovingAnswer[];\n }\n}\n\nconst EatingMovingAffordablyQuestion: React.FC = ({\n onClickBack,\n onClickNext,\n surveyAnswers,\n}) => {\n const { t } = useTranslation();\n\n const options: QuestionOption[] = [\n {\n id: \"affordingHealthyFood\",\n text: t(\"eatingMovingAffordably.options.affordingHealthyFood\"),\n },\n {\n id: \"timeToPrepare\",\n text: t(\"eatingMovingAffordably.options.timeToPrepare\"),\n },\n {\n id: \"makingFoodLast\",\n text: t(\"eatingMovingAffordably.options.makingFoodLast\"),\n },\n { id: \"fewStores\", text: t(\"eatingMovingAffordably.options.fewStores\") },\n {\n id: \"fewHealthyOptions\",\n text: t(\"eatingMovingAffordably.options.fewHealthyOptions\"),\n },\n {\n id: \"transportion\",\n text: t(\"eatingMovingAffordably.options.transportion\"),\n },\n { id: \"none\", text: t(\"eatingMovingAffordably.options.none\") },\n ];\n\n return (\n \n );\n};\n\nexport const Q_EATING_MOVING_AFFORDABLY: QuestionDefinition = {\n id: QUESTION_ID,\n shouldShowQuestion: ({ partnerInfo, selectedProgram }) => shouldAskSDOH(partnerInfo, selectedProgram),\n component: EatingMovingAffordablyQuestion,\n};\n","import { Form, Formik } from \"formik\";\nimport React from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport * as Yup from \"yup\";\n\nimport { Button, Input, Spacing, Stack } from \"@noom/wax-component-library\";\n\nimport { enforcePositiveFloat } from \"@/components/form/utils\";\n\nimport { QuestionComponentProps, QuestionDefinition } from \"../../Question\";\nimport { BaseQuestion } from \"../core\";\n\nconst QUESTION_ID = \"exercise\";\n\ndeclare module \"@/contexts\" {\n interface SurveyAnswers {\n exercise?: number;\n }\n}\n\ntype ExerciseFormValues = {\n exercise?: number;\n};\n\nconst ExerciseQuestion: React.FC = ({\n onClickBack,\n onClickNext,\n surveyAnswers,\n}) => {\n const { t } = useTranslation();\n\n const initialValues: ExerciseFormValues = {\n exercise: surveyAnswers.exercise,\n };\n\n const MAX_MINUTES = 10000; // roughtly 10000 minutes in a week\n const validationSchema = Yup.object({\n exercise: Yup.number()\n .min(0, t(\"exercise.errors.invalid\"))\n .max(MAX_MINUTES, t(\"exercise.errors.invalid\"))\n .required(t(\"exercise.errors.required\")),\n });\n\n return (\n \n {\n if (exercise === undefined) {\n return;\n }\n\n onClickNext(exercise);\n }}\n validateOnBlur={false}\n validationSchema={validationSchema}\n >\n {({ errors, getFieldProps, handleSubmit, touched }) => (\n
\n \n \n \n \n
\n )}\n \n \n );\n};\n\nexport const Q_EXERCISE: QuestionDefinition = {\n id: QUESTION_ID,\n shouldShowQuestion: ({ userProfile }) =>\n userProfile?.currentProgram !== \"MOOD\" &&\n !userProfile?.loggedExerciseMinsPastTwoWks,\n component: ExerciseQuestion,\n};\n","import React, { useEffect } from \"react\";\nimport { Trans, useTranslation } from \"react-i18next\";\n\nimport {\n Box,\n Button,\n CompassColor,\n Heading,\n Image,\n Spacing,\n Stack,\n Text,\n} from \"@noom/wax-component-library\";\n\nimport {\n QuestionComponentProps,\n QuestionDefinition,\n} from \"@/components/survey/Question\";\nimport { useAppContext } from \"@/contexts\";\nimport { useStoreOutcomes } from \"@/hooks\";\n\nimport { BaseInterstitial } from \"../core\";\n\nconst QUESTION_ID = \"outcomesSurveyComplete\";\n\nconst OutcomesSurveyComplete: React.FC = ({\n onClickNext,\n}) => {\n const { userProfile } = useAppContext();\n const { storeRecurringOutcomesAnswers } = useStoreOutcomes();\n const { t } = useTranslation();\n\n const firstName = userProfile?.firstName || \"Noomer\";\n\n useEffect(() => {\n storeRecurringOutcomesAnswers();\n }, []);\n\n return (\n null}\n onClickNext={() => Promise.resolve()}\n questionId={QUESTION_ID}\n width=\"550px\"\n >\n \n \n \n {t(\"outcomesSurveyComplete.heading\", { firstName })}\n \n \n \n Each check in is a great opportunity to reflect on your health and\n how it's changing as you make progress towards your goals.\n We're thrilled to be your partner in this.\n
\n
\n See you next month!\n
\n
\n
\n \n onClickNext(null)}\n padding=\"unset\"\n size=\"xl\"\n whiteSpace=\"unset\"\n >\n Finish\n \n \n \n );\n};\n\nexport const Q_OUTCOMES_SURVEY_COMPLETE: QuestionDefinition = {\n id: QUESTION_ID,\n shouldShowQuestion: () => true,\n component: OutcomesSurveyComplete,\n};\n","import React from \"react\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { shouldAskMonthlyQuestion } from \"@/utils/survey/outcomes\";\n\nimport {\n QuestionComponentProps,\n QuestionDefinition,\n QuestionOption,\n} from \"../../Question\";\nimport { MultipleChoiceQuestion } from \"../core\";\n\nconst QUESTION_ID = \"reachingHealthGoals\";\n\ndeclare module \"@/contexts\" {\n interface SurveyAnswers {\n reachingHealthGoals?: string;\n }\n}\n\nconst ReachingHealthGoalsQuestion: React.FC = ({\n onClickBack,\n onClickNext,\n surveyAnswers,\n}) => {\n const { t } = useTranslation();\n\n const options: QuestionOption[] = [\n {\n id: \"didNotImproveAtAll\",\n text: t(\"reachingHealthGoals.options.didNotImproveAtAll\"),\n },\n {\n id: \"minimallyImproved\",\n text: t(\"reachingHealthGoals.options.minimallyImproved\"),\n },\n {\n id: \"somewhatImproved\",\n text: t(\"reachingHealthGoals.options.somewhatImproved\"),\n },\n {\n id: \"moderatelyImproved\",\n text: t(\"reachingHealthGoals.options.moderatelyImproved\"),\n },\n {\n id: \"veryMuchImproved\",\n text: t(\"reachingHealthGoals.options.veryMuchImproved\"),\n },\n ];\n\n return (\n \n );\n};\n\nexport const Q_REACHING_HEALTH_GOALS: QuestionDefinition = {\n id: QUESTION_ID,\n shouldShowQuestion: ({ userProfile }) =>\n userProfile?.currentProgram !== \"MOOD\" ||\n shouldAskMonthlyQuestion(userProfile),\n component: ReachingHealthGoalsQuestion,\n};\n","import { Formik } from \"formik\";\nimport React from \"react\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { Button, Spacing, Stack } from \"@noom/wax-component-library\";\n\nimport {\n HeightWeightForm,\n HeightWeightFormValues,\n HeightWeightSchema,\n} from \"@/components/forms\";\nimport {\n QuestionComponentProps,\n QuestionDefinition,\n} from \"@/components/survey/Question\";\n\nimport { BaseQuestion } from \"../core\";\n\nconst QUESTION_ID = \"weight\";\n\ndeclare module \"@/contexts\" {\n interface SurveyAnswers {\n weight?: number;\n }\n}\n\nconst WeightQuestion: React.FC = ({\n onClickBack,\n onClickNext,\n surveyAnswers,\n}) => {\n const { t } = useTranslation();\n\n const initialValues: Pick = {\n weight: surveyAnswers[QUESTION_ID],\n };\n\n return (\n \n onClickNext(values.weight)}\n validateOnBlur={false}\n validateOnChange={false}\n validationSchema={HeightWeightSchema.pick([\"weight\"])}\n >\n {({ handleSubmit, isSubmitting }) => (\n
\n \n \n \n Next\n \n \n
\n )}\n \n \n );\n};\n\nexport const Q_OUTCOMES_WEIGHT: QuestionDefinition = {\n id: QUESTION_ID,\n shouldShowQuestion: ({ userProfile }) =>\n userProfile?.currentProgram !== \"MOOD\" &&\n userProfile?.latestWeightKgs === undefined,\n component: WeightQuestion,\n};\n","import { QuestionSection } from \"../Question\";\nimport {\n Q_ACTIVE_SUBSCRIPTION,\n Q_TRANSITION_EXPLAINER,\n} from \"../questionTypes/b2c-to-b2b\";\nimport {\n Q_A1C,\n Q_BASELINE_HEALTH,\n Q_BLOOD_GLUCOSE_TRACKING,\n Q_COMPLETE_PROFILE,\n Q_CONTINUE_PROGRAM,\n Q_COURSE_PACK_SELECTION,\n Q_CREATE_ACCOUNT,\n Q_CREATE_PASSWORD,\n Q_CULTURAL_IMPACTS,\n Q_DIABETES_SUPPORT,\n Q_DIFFICULTIES,\n Q_EATING_DISORDER,\n Q_EATING_MOVING_AFFORDABLY,\n Q_EDUCATION,\n Q_ELIGIBILITY_CHECK,\n Q_ENROLLED_IN_MEDICARE,\n Q_ETHNICITY,\n Q_EXISTING_PASSWORD,\n Q_FAMILY_HISTORY,\n Q_FAMILY_HISTORY_WEIGHT,\n Q_GENDER,\n Q_GESTATIONAL_DIABETES,\n Q_GLP1_MEDICATION,\n Q_GLP1_WEIGHT,\n Q_HAD_A1C_TESTED,\n Q_HEALTH_CARE_PROFESSIONAL,\n Q_HEALTH_CONDITIONS,\n Q_HEALTH_GOAL,\n Q_HEIGHT_WEIGHT,\n Q_HYPERTENSION,\n Q_LIABILITY_WAIVER_ALERT_BMI,\n Q_LIABILITY_WAIVER_ALERT_EATING_DISORDER,\n Q_LIABILITY_WAIVER_ALERT_PREGNANT,\n Q_LIABILITY_WAIVER_BMI,\n Q_LIABILITY_WAIVER_EATING_DISORDER,\n Q_LIABILITY_WAIVER_PREGNANT,\n Q_LOCATION_STATE,\n Q_MEDICARE_CONSENT,\n Q_MEDICATIONS,\n Q_MENOPAUSE,\n Q_MENSTRUAL_CYCLE,\n Q_MOTIVATION,\n Q_MSK_PAIN,\n Q_MSK_PAIN_LEVEL,\n Q_NOOM_MED_MORE_OPTIONS,\n Q_NOOM_MED_OVERVIEW,\n Q_NURSING,\n Q_NUTRITION_BASICS,\n Q_OTHER_ETHNICITY,\n Q_OUTCOMES_A1C,\n Q_OUTCOMES_GLP1_MEDICATION,\n Q_OUTCOMES_HAD_A1C_TESTED,\n Q_OUTCOMES_HEALTH_CONDITIONS,\n Q_OUTCOMES_MEDICATIONS,\n Q_OUTCOMES_MSK_PAIN,\n Q_OUTCOMES_MSK_PAIN_LEVEL,\n Q_PERSONALIZATION_CONFIRMATION,\n Q_PERSONALIZATION_INTRO,\n Q_PERSONALIZING_PROGRAM,\n Q_PHQ_1,\n Q_PHQ_2,\n Q_PHQ_3,\n Q_PHQ_4,\n Q_PHYSICAL_ACTIVITY,\n Q_PREDIABETES_HISTORY,\n Q_PREGNANT,\n Q_PRIMARY_CARE_PROVIDER,\n Q_PROGRAM_OVERVIEW,\n Q_PROGRAM_SET,\n Q_REASON_FOR_LOSING_WEIGHT,\n Q_RETRIAGE_A1C,\n Q_RETRIAGE_DIFFICULTIES,\n Q_RETRIAGE_EATING_DISORDER,\n Q_RETRIAGE_EDUCATION,\n Q_RETRIAGE_ETHNICITY,\n Q_RETRIAGE_FAMILY_HISTORY,\n Q_RETRIAGE_GENDER,\n Q_RETRIAGE_GESTATIONAL_DIABETES,\n Q_RETRIAGE_GLP1_MEDICATION,\n Q_RETRIAGE_HEALTH_CARE_PROFESSIONAL,\n Q_RETRIAGE_HEALTH_CONDITIONS,\n Q_RETRIAGE_HEIGHT_WEIGHT,\n Q_RETRIAGE_HYPERTENSION,\n Q_RETRIAGE_MOTIVATION,\n Q_RETRIAGE_PHQ_1,\n Q_RETRIAGE_PHQ_2,\n Q_RETRIAGE_PHQ_3,\n Q_RETRIAGE_PHQ_4,\n Q_RETRIAGE_PHYSICAL_ACTIVITY,\n Q_RETRIAGE_PREDIABETES_HISTORY,\n Q_RETRIAGE_PREGNANT,\n Q_RETRIAGE_SCALE_OPT_IN,\n Q_RETRIAGE_SEX,\n Q_SCALE_OPT_IN,\n Q_SCREENED_OUT,\n Q_SEX,\n Q_SLEEP,\n Q_SOCIAL_DETERMINANTS_OF_HEALTH,\n Q_STRESS_EATING,\n Q_WOMENS_HEALTH,\n} from \"../questionTypes/dpp-triage\";\nimport {\n Q_EXERCISE,\n Q_OUTCOMES_SURVEY_COMPLETE,\n Q_OUTCOMES_WEIGHT,\n Q_REACHING_HEALTH_GOALS,\n} from \"../questionTypes/outcomes\";\nimport {\n Q_CONFIRM_CHANGE_PROGRAM_DPP,\n Q_CONFIRM_CHANGE_PROGRAM_MED,\n Q_DPP_INFORMATION,\n Q_RETRIAGE_ELIGIBILITY_CHECK,\n Q_RETRIAGE_EXCLUSION,\n Q_RETRIAGE_KEEP_PLAN,\n Q_RETRIAGE_MED_SIGNUP,\n Q_RETRIAGE_PERSONALIZING_PROGRAM,\n Q_RETRIAGE_RESULT,\n Q_RETRIAGE_TRANSITION,\n} from \"../questionTypes/retriage\";\n\nconst QuestionSets: Record = {\n DPP_SURVEY: [\n {\n description: \"Account Creation\",\n percentage: 10,\n questions: [\n Q_ELIGIBILITY_CHECK,\n Q_CREATE_ACCOUNT,\n Q_CREATE_PASSWORD,\n Q_EXISTING_PASSWORD,\n ],\n },\n {\n description: \"Demographics\",\n percentage: 20,\n questions: [\n Q_HEALTH_GOAL,\n Q_PROGRAM_OVERVIEW,\n Q_EATING_DISORDER,\n Q_LIABILITY_WAIVER_ALERT_EATING_DISORDER,\n Q_LIABILITY_WAIVER_EATING_DISORDER,\n Q_HEIGHT_WEIGHT,\n Q_LIABILITY_WAIVER_ALERT_BMI,\n Q_LIABILITY_WAIVER_BMI,\n Q_ETHNICITY,\n Q_OTHER_ETHNICITY,\n Q_SEX,\n Q_WOMENS_HEALTH,\n Q_MENOPAUSE,\n Q_MENSTRUAL_CYCLE,\n Q_GENDER,\n Q_PREGNANT,\n Q_LIABILITY_WAIVER_ALERT_PREGNANT,\n Q_LIABILITY_WAIVER_PREGNANT,\n Q_NURSING,\n Q_GESTATIONAL_DIABETES,\n ],\n },\n {\n description: \"Eating Habits\",\n percentage: 10,\n questions: [\n Q_SOCIAL_DETERMINANTS_OF_HEALTH,\n Q_NUTRITION_BASICS,\n Q_EATING_MOVING_AFFORDABLY,\n Q_CULTURAL_IMPACTS,\n ],\n },\n {\n description: \"Health Profile\",\n percentage: 40,\n questions: [\n Q_BASELINE_HEALTH,\n Q_HEALTH_CONDITIONS,\n Q_PRIMARY_CARE_PROVIDER,\n Q_DIABETES_SUPPORT,\n Q_MEDICATIONS,\n Q_GLP1_MEDICATION,\n Q_GLP1_WEIGHT,\n Q_HAD_A1C_TESTED,\n Q_A1C,\n Q_BLOOD_GLUCOSE_TRACKING,\n Q_MSK_PAIN,\n Q_MSK_PAIN_LEVEL,\n Q_PHQ_1,\n Q_PHQ_2,\n Q_PHQ_3,\n Q_PHQ_4,\n Q_STRESS_EATING,\n Q_SLEEP,\n Q_REASON_FOR_LOSING_WEIGHT,\n Q_FAMILY_HISTORY_WEIGHT,\n Q_LOCATION_STATE,\n Q_NOOM_MED_OVERVIEW,\n Q_NOOM_MED_MORE_OPTIONS,\n Q_ENROLLED_IN_MEDICARE,\n Q_MEDICARE_CONSENT,\n Q_CONTINUE_PROGRAM,\n Q_PREDIABETES_HISTORY,\n Q_HYPERTENSION,\n Q_FAMILY_HISTORY,\n Q_PHYSICAL_ACTIVITY,\n Q_DIFFICULTIES,\n Q_EDUCATION,\n Q_MOTIVATION,\n Q_HEALTH_CARE_PROFESSIONAL,\n Q_SCREENED_OUT,\n ],\n },\n {\n description: \"Curriculum Personalization\",\n percentage: 10,\n questions: [\n Q_PERSONALIZING_PROGRAM,\n Q_PROGRAM_SET,\n Q_PERSONALIZATION_INTRO,\n Q_COURSE_PACK_SELECTION,\n Q_PERSONALIZATION_CONFIRMATION,\n ],\n },\n {\n description: \"Profile Creation\",\n percentage: 10,\n questions: [Q_SCALE_OPT_IN, Q_COMPLETE_PROFILE],\n },\n ],\n RECURRING_OUTCOMES: [\n {\n description: \"Progress Check-in\",\n percentage: 100,\n questions: [\n Q_OUTCOMES_WEIGHT,\n Q_OUTCOMES_HEALTH_CONDITIONS,\n Q_OUTCOMES_MEDICATIONS,\n Q_OUTCOMES_GLP1_MEDICATION,\n Q_OUTCOMES_HAD_A1C_TESTED,\n Q_OUTCOMES_A1C,\n Q_OUTCOMES_MSK_PAIN,\n Q_OUTCOMES_MSK_PAIN_LEVEL,\n Q_PHQ_1,\n Q_PHQ_2,\n Q_PHQ_3,\n Q_PHQ_4,\n Q_EXERCISE,\n Q_REACHING_HEALTH_GOALS,\n Q_OUTCOMES_SURVEY_COMPLETE,\n ],\n },\n ],\n RETRIAGE_SURVEY: [\n {\n description: \"Health Risk Assessment\",\n percentage: 100,\n questions: [\n Q_RETRIAGE_ELIGIBILITY_CHECK,\n Q_RETRIAGE_HEIGHT_WEIGHT,\n Q_RETRIAGE_EATING_DISORDER,\n Q_RETRIAGE_ETHNICITY,\n Q_OTHER_ETHNICITY,\n Q_RETRIAGE_SEX,\n Q_RETRIAGE_GENDER,\n Q_RETRIAGE_PREGNANT,\n Q_RETRIAGE_GESTATIONAL_DIABETES,\n Q_RETRIAGE_HEALTH_CONDITIONS,\n Q_RETRIAGE_GLP1_MEDICATION,\n Q_GLP1_WEIGHT,\n Q_RETRIAGE_PHQ_1,\n Q_RETRIAGE_PHQ_2,\n Q_RETRIAGE_PHQ_3,\n Q_RETRIAGE_PHQ_4,\n Q_REASON_FOR_LOSING_WEIGHT,\n Q_FAMILY_HISTORY_WEIGHT,\n Q_LOCATION_STATE,\n Q_NOOM_MED_OVERVIEW,\n Q_NOOM_MED_MORE_OPTIONS,\n Q_CONFIRM_CHANGE_PROGRAM_MED,\n Q_ENROLLED_IN_MEDICARE,\n Q_MEDICARE_CONSENT,\n Q_RETRIAGE_PREDIABETES_HISTORY,\n Q_RETRIAGE_A1C,\n Q_RETRIAGE_HYPERTENSION,\n Q_RETRIAGE_FAMILY_HISTORY,\n Q_RETRIAGE_PHYSICAL_ACTIVITY,\n Q_RETRIAGE_DIFFICULTIES,\n Q_RETRIAGE_EDUCATION,\n Q_RETRIAGE_MOTIVATION,\n Q_RETRIAGE_HEALTH_CARE_PROFESSIONAL,\n Q_RETRIAGE_PERSONALIZING_PROGRAM,\n Q_RETRIAGE_SCALE_OPT_IN,\n Q_RETRIAGE_MED_SIGNUP,\n Q_RETRIAGE_RESULT,\n Q_DPP_INFORMATION,\n Q_CONFIRM_CHANGE_PROGRAM_DPP,\n Q_RETRIAGE_TRANSITION,\n Q_RETRIAGE_KEEP_PLAN,\n Q_RETRIAGE_EXCLUSION,\n ],\n },\n ],\n TRANSITION_SURVEY: [\n {\n description: \"Transition\",\n percentage: 100,\n questions: [Q_ACTIVE_SUBSCRIPTION, Q_TRANSITION_EXPLAINER],\n },\n ],\n WIP: [\n {\n description: \"\",\n percentage: 0,\n questions: [],\n },\n ],\n};\n\nexport default QuestionSets;\n","import React from \"react\";\nimport { useParams } from \"react-router-dom\";\n\nimport { Survey } from \"@/components/survey/Survey\";\nimport QuestionSets from \"@/components/survey/questionSets/questionSets\";\n\n/*\n * DevView is a wrapper to enable viewing a single question page for development.\n * See\n *\n */\nexport const DevView: React.FC = () => {\n const { questionSetName } = useParams<{ questionSetName: string }>();\n\n const questionSet = QuestionSets[questionSetName || \"\"];\n\n const baseRoute = {\n DPP_SURVEY: \"/enrollment\",\n RETRIAGE_SURVEY: \"/employer/test/rt\",\n TRANSITION_SURVEY: \"/transition\",\n }[questionSetName!];\n\n if (window.ENV.NOOM_ENVIRONMENT !== \"development\" || !questionSet) {\n return null;\n }\n return (\n new Promise(() => {})}\n questionSet={questionSet}\n resetOnOpen={false}\n />\n );\n};\n","import { Formik, FormikHelpers } from \"formik\";\nimport React, { useState } from \"react\";\nimport { Trans, useTranslation } from \"react-i18next\";\nimport * as Yup from \"yup\";\n\nimport {\n Box,\n Button,\n CompassColor,\n Heading,\n Input,\n Loader,\n Spacing,\n Stack,\n Text,\n} from \"@noom/wax-component-library\";\n\nimport { NoomEmailAddressLink, NoomHeader } from \"@/components/noom-branding\";\nimport { useGeolocation } from \"@/hooks\";\nimport { setOptOut } from \"@/utils/consent/opt-out\";\n\ntype FormValues = {\n email: string;\n};\n\nconst initialValues: FormValues = {\n email: \"\",\n};\n\nconst OptOutForm = () => {\n const { canOptOut, country, isLoading, state } = useGeolocation();\n const [isOptOutSuccessful, setIsOptOutSuccessful] = useState(false);\n const { t } = useTranslation();\n\n const MAX_LENGTH = 180;\n const validationSchema = Yup.object().shape({\n email: Yup.string()\n .max(\n MAX_LENGTH,\n t(\"form.errors.maxLength\", {\n label: \"Email address\",\n maxLength: MAX_LENGTH,\n }),\n )\n .email(t(\"form.email.errors.invalid\"))\n .required(t(\"form.email.errors.required\")),\n });\n\n const onSubmit = async (\n { email }: FormValues,\n actions: FormikHelpers,\n ) => {\n try {\n await setOptOut(country, email, state);\n setIsOptOutSuccessful(true);\n } catch (e) {\n actions.setFieldError(\"email\", t(\"doNotShare.optOutError\"));\n }\n };\n\n if (isLoading) {\n return ;\n }\n\n if (!canOptOut()) {\n return (\n \n \n \n );\n }\n\n return (\n <>\n \n {({\n dirty,\n errors,\n getFieldProps,\n handleSubmit,\n isSubmitting,\n isValid,\n touched,\n }) => (\n
\n \n \n \n {t(\"doNotShare.ctaText\")}\n \n \n
\n )}\n \n {isOptOutSuccessful && (\n \n {t(\"doNotShare.optOutSuccess\")}\n \n )}\n \n );\n};\n\nexport const DoNotShareView: React.FC = () => {\n const { t } = useTranslation();\n\n return (\n \n \n \n \n \n {t(\"doNotShare.header\")}\n \n {t(\"doNotShare.description1\")}\n {t(\"doNotShare.description2\")}\n {t(\"doNotShare.description3\")}\n \n \n \n \n \n \n );\n};\n","import { differenceInYears, format } from \"date-fns\";\n\nimport {\n CoursePackSlug,\n DOB_FORMAT,\n HealthConditionOptionId,\n PrimaryCareProviderSelection,\n ProgramOffering,\n} from \"@/constants\";\nimport { SurveyAnswers } from \"@/contexts\";\nimport { getEctExperiments } from \"@/hooks\";\nimport { Partner, User } from \"@/models\";\nimport type { SignupFormData } from \"@/models/SignupFormData\";\nimport { ExperimentAssignments } from \"@/models/experiments\";\n\nimport { isPersonalizationEnabled } from \"./survey/contentPersonalization\";\n\n// Height and weight are required to create an account, but we don't show\n// Noom Mood enrollees these fields and pass default values instead.\n// The actual values aren't important.\nconst DEFAULT_HEIGHT_FT = 5;\nconst DEFAULT_HEIGHT_IN = 7;\nconst DEFAULT_WEIGHT_LB = 150;\nconst HEIGHT_MULTIPLIER_IN_TO_CM = 2.54;\nconst WEIGHT_MULTIPLIER_LB_TO_KG = 0.453592;\n\nexport const getCoursePacksToAssign = (\n program: ProgramOffering,\n surveyAnswers: SurveyAnswers,\n partnerInfo: Partner | null,\n): CoursePackSlug[] => {\n const {\n healthConditions,\n primaryCareProvider,\n coursePackSelection = [],\n nutritionBasics,\n eatingMovingAffordably,\n culturalImpacts,\n } = surveyAnswers;\n\n const coursePacks: CoursePackSlug[] = [];\n\n if (\n healthConditions?.includes(HealthConditionOptionId.TYPE2_DIABETES) &&\n primaryCareProvider === PrimaryCareProviderSelection.YES\n ) {\n coursePacks.push(\"DIABETES_SUPPORT\");\n }\n\n if (program === \"WEIGHT\" || program === \"MED\" || program === \"NMPBA\") {\n if (\n nutritionBasics === \"notConfident\" ||\n nutritionBasics === \"somewhatConfident\"\n ) {\n coursePacks.push(\"NUTRITION_BASICS\");\n }\n if (eatingMovingAffordably && !eatingMovingAffordably.includes(\"none\")) {\n coursePacks.push(\"EAT_AND_MOVE\");\n }\n if (culturalImpacts === \"always\" || culturalImpacts === \"occasionally\") {\n coursePacks.push(\"NUTRITION_AND_CULTURE\");\n }\n }\n\n if (isPersonalizationEnabled(partnerInfo, program)) {\n return [...coursePackSelection, ...coursePacks];\n }\n // DPP currently isn't shown content personalization.\n if (program === \"DPP\" && surveyAnswers.glp1Medication === \"yes\") {\n return [\"GLP1\"];\n }\n return coursePacks;\n};\n\nexport const formatAsUserData = ({\n formData,\n b2bUserId,\n program,\n dppTriageKey,\n surveyAnswers,\n policyId,\n coursePacks,\n experiments,\n}: {\n formData: SignupFormData;\n b2bUserId: string;\n program: ProgramOffering;\n dppTriageKey?: string;\n surveyAnswers: SurveyAnswers;\n policyId?: string;\n coursePacks: CoursePackSlug[];\n experiments: ExperimentAssignments;\n}): User => {\n const {\n address,\n age,\n consentSignature,\n consentStatus,\n dob,\n email,\n employeeId,\n firstName,\n gender,\n heightFeetPortion = DEFAULT_HEIGHT_FT,\n heightInchesPortion = DEFAULT_HEIGHT_IN,\n lastName,\n locale,\n orderScale,\n password,\n phoneNumber: { dialCode, value },\n shippingAddress,\n weight = DEFAULT_WEIGHT_LB,\n mhmdaOptIn,\n } = formData;\n\n const formattedPhoneNumber = `+${dialCode}${value}`;\n\n const calculatedAge = dob\n ? differenceInYears(new Date(), dob as Date)\n : (age as number);\n\n const userData: User = {\n coursePacks,\n gender,\n locale,\n password,\n surveyAnswers,\n age: calculatedAge,\n email: email.trim(),\n heightInCm:\n (heightFeetPortion * 12 + heightInchesPortion) *\n HEIGHT_MULTIPLIER_IN_TO_CM,\n name: firstName.trim(),\n phoneNumber: formattedPhoneNumber,\n weightInKg: weight * WEIGHT_MULTIPLIER_LB_TO_KG,\n extras: {\n address,\n b2bUserId,\n consentStatus,\n mhmdaOptIn,\n orderScale,\n program,\n consentSignature: consentSignature?.trim(),\n employeeId: employeeId?.trim(),\n firstName: firstName.trim(),\n lastName: lastName.trim(),\n phoneNumber: formattedPhoneNumber,\n },\n };\n\n if (dob) {\n userData.extras = {\n ...userData.extras,\n dob: format(dob as Date, DOB_FORMAT),\n };\n }\n\n if (dppTriageKey) {\n userData.extras = {\n ...userData.extras,\n dppTriageKey,\n };\n }\n\n if (orderScale) {\n userData.extras = {\n ...userData.extras,\n shippingAddress: { ...(shippingAddress || address) },\n };\n }\n\n if (policyId) {\n userData.extras = {\n ...userData.extras,\n policyId,\n };\n }\n\n /**\n * Only store the medicare question answers if the user stays in Med and is\n * 65+ - we don't need to store these if the user opts out of Med\n *\n * Context: https://noom.slack.com/archives/C06T19HJWD9/p1715291960358249\n */\n if ((program === \"MED\" || program === \"NMPBA\") && calculatedAge > 64) {\n userData.extras = {\n ...userData.extras,\n enrolledInMedicare: surveyAnswers?.enrolledInMedicare,\n medicareConsent: surveyAnswers?.medicareConsent,\n };\n }\n\n if (\n surveyAnswers.liabilityWaiverBMI ||\n surveyAnswers.liabilityWaiverEatingDisorder ||\n surveyAnswers.liabilityWaiverPregnant\n ) {\n userData.extras = {\n ...userData.extras,\n liabilityWaiverConsent: \"AGREE\",\n };\n }\n\n const ectExperiments = getEctExperiments(experiments);\n if (ectExperiments.length) {\n userData.forceExperimentsToAssign = ectExperiments;\n }\n\n return userData;\n};\n","import React, { useEffect } from \"react\";\nimport { useLocation, useNavigate } from \"react-router-dom\";\n\nimport { Survey } from \"@/components/survey/Survey\";\nimport QuestionSets from \"@/components/survey/questionSets/questionSets\";\nimport { ErrorState } from \"@/constants\";\nimport { SurveyAnswers, useAppContext } from \"@/contexts\";\nimport {\n useCreateAccount,\n useExperiment,\n useQueryParams,\n useSaveTriageData,\n useStoreOutcomes,\n useUpdateLastTriageTimestamp,\n} from \"@/hooks\";\nimport { Gender } from \"@/models\";\nimport type { SignupFormData } from \"@/models/SignupFormData\";\nimport {\n formatAsUserData,\n getCoursePacksToAssign,\n} from \"@/utils/formatAsUserData\";\nimport { captureException } from \"@/utils/sentry\";\n\nexport const DppTriageView: React.FC = () => {\n const {\n b2bIdentifiedUserId,\n eligibilityInfo,\n enrollmentInfo,\n hasB2cAccount,\n partnerInfo,\n selectedProgram,\n setErrorState,\n setEnrollmentType,\n } = useAppContext();\n const { createAccount } = useCreateAccount();\n const { getExperimentAssignments } = useExperiment();\n const { saveTriageData } = useSaveTriageData(partnerInfo?.id);\n const { storeBaselineOutcomesAnswers } = useStoreOutcomes();\n // state associated with a particular navigation event / entry on the browser history stack\n // see: https://developer.mozilla.org/en-US/docs/Web/API/History/state\n const { search, state: historyState } = useLocation();\n const { resetOnOpen } = historyState ?? {};\n const navigate = useNavigate();\n const { upid: rawUpid } = useQueryParams();\n const { updateLastTriageTimestamp } = useUpdateLastTriageTimestamp();\n const upid = rawUpid ?? \"\";\n\n if (!enrollmentInfo) {\n navigate({\n pathname: \"/\",\n search,\n });\n }\n\n if (!upid) {\n navigate(\"/error\");\n }\n\n useEffect(() => {\n setEnrollmentType(\"INITIAL_ENROLLMENT\");\n }, []);\n\n const onSurveyComplete = async (surveyAnswers: SurveyAnswers) => {\n const sexToGenderMap: { [key: string]: Gender } = {\n female: Gender.FEMALE,\n male: Gender.MALE,\n intersex: Gender.SELF_ID,\n preferNotToSay: Gender.SELF_ID,\n };\n\n const {\n completeProfile,\n createAccount: createAccountAnswer,\n createPassword,\n existingPassword,\n eligibilityCheck,\n scaleOptIn,\n sex,\n heightWeight,\n } = surveyAnswers;\n\n const password = hasB2cAccount ? existingPassword : createPassword;\n\n if (\n !completeProfile?.address ||\n !createAccountAnswer?.email ||\n !eligibilityCheck?.firstName ||\n !eligibilityCheck?.lastName ||\n !password\n ) {\n setErrorState(ErrorState.DEFAULT);\n navigate(\"/error\");\n return;\n }\n\n const employeeId =\n eligibilityCheck?.employeeId || completeProfile?.employeeId;\n\n const formValues: SignupFormData = {\n age: eligibilityCheck?.age,\n address: completeProfile?.address,\n consentSignature: completeProfile?.consentSignature,\n consentStatus: completeProfile?.consentStatus,\n dob: eligibilityCheck?.dob,\n email: createAccountAnswer?.email,\n employeeId,\n firstName: eligibilityCheck?.firstName,\n gender: sexToGenderMap[sex as keyof typeof sexToGenderMap],\n heightFeetPortion: heightWeight?.heightFeetPortion,\n heightInchesPortion: heightWeight?.heightInchesPortion,\n lastName: eligibilityCheck?.lastName,\n locale: completeProfile?.locale || \"en\",\n mhmdaOptIn: createAccountAnswer?.mhmdaOptIn,\n orderScale: scaleOptIn === true,\n password,\n phoneNumber: completeProfile?.phoneNumber,\n shippingAddress: completeProfile.shippingAddress,\n weight: heightWeight?.weight,\n };\n\n try {\n if (!selectedProgram) {\n throw new Error(\"No selected program\");\n }\n const key = await saveTriageData(surveyAnswers, \"COMPLETE\");\n const coursePacks = getCoursePacksToAssign(\n selectedProgram,\n surveyAnswers,\n partnerInfo,\n );\n\n const userData = formatAsUserData({\n surveyAnswers,\n coursePacks,\n b2bUserId: b2bIdentifiedUserId,\n dppTriageKey: key,\n formData: formValues,\n policyId: eligibilityInfo?.policyId || eligibilityCheck?.policyId,\n program: selectedProgram,\n experiments: getExperimentAssignments(),\n });\n\n const accessCode = await createAccount(upid, userData, selectedProgram);\n\n if (!accessCode) {\n return;\n }\n updateLastTriageTimestamp(accessCode, \"ASSIGNED_INITIAL_OFFERING\");\n\n // If this fails for some reason don't break execution\n storeBaselineOutcomesAnswers(accessCode).catch((e) =>\n captureException(e),\n );\n } catch (e) {\n captureException(e);\n setErrorState(ErrorState.DEFAULT);\n navigate(\"/error\");\n }\n };\n\n return (\n \n );\n};\n","import React, { useEffect } from \"react\";\nimport { Trans, useTranslation } from \"react-i18next\";\n\nimport { Box } from \"@noom/wax-component-library\";\n\nimport { FullscreenMessage } from \"@/components\";\nimport { NoomEmailAddressLink } from \"@/components/noom-branding\";\nimport { useTrackEvent } from \"@/hooks\";\n\n/**\n * Landing page for users that attempt to open deep links on desktop.\n */\nexport const NotFoundView: React.FC = () => {\n const { trackIdentifiedPageViewed } = useTrackEvent();\n const { t } = useTranslation();\n const queryParams = new URLSearchParams(window.location.search);\n const reason = queryParams.get(\"reason\");\n\n useEffect(() => {\n trackIdentifiedPageViewed(\"notFound\");\n }, []);\n\n return (\n \n }\n visual={}\n />\n );\n};\n","/* eslint-disable react-hooks/exhaustive-deps */\nimport { differenceInDays } from \"date-fns\";\nimport React, { useEffect } from \"react\";\n\nimport { GetOutcomesUserProfileResponseProto } from \"@noom/noom-contracts/noom_contracts/backend/outcomes/service/outcomes_service\";\nimport { Api } from \"@noom/noomscape\";\n\nimport { Survey } from \"@/components/survey/Survey\";\nimport QuestionSets from \"@/components/survey/questionSets/questionSets\";\nimport { ErrorState, ProgramOffering } from \"@/constants\";\nimport { useAppContext } from \"@/contexts\";\nimport { useGoto, useTrackEvent } from \"@/hooks\";\nimport { getAutologinData } from \"@/utils/cookies\";\nimport { captureException, captureMessage } from \"@/utils/sentry\";\n\nexport const RecurringOutcomesView: React.FC = () => {\n const {\n setSurveyMetadata,\n surveyMetadata = null,\n setErrorState,\n setUserProfile,\n userProfile,\n } = useAppContext();\n const autologinData = getAutologinData();\n const goto = useGoto();\n const { linkB2BIdentity } = useTrackEvent();\n\n const onSurveyComplete = async () => {\n goto.openApp(autologinData);\n };\n\n useEffect(() => {\n const getUserProfile = async () => {\n if (!autologinData) {\n captureMessage(\"No autologin data provided for getting user profile\");\n goto.error();\n return;\n }\n\n const { accessCode, accessToken } = autologinData;\n\n try {\n const {\n activeProgram,\n firstName,\n gender,\n heightCms,\n latestWeightKgs,\n loggedExerciseMinsPastTwoWks,\n segmentId,\n segmentName,\n }: GetOutcomesUserProfileResponseProto = await Api.call(\n \"outcomes.getUserProfile\",\n Api.api.outcomes.getUserProfile,\n {\n accessCode,\n accessToken,\n },\n );\n\n const { programConfigurationSlug = \"\", timeStarted } =\n activeProgram || {};\n\n let currentProgram: ProgramOffering = \"WEIGHT\";\n if (programConfigurationSlug.startsWith(\"HEALTHY_MIND\")) {\n currentProgram = \"MOOD\";\n } else if (programConfigurationSlug.startsWith(\"DIABETES_PREVENTION\")) {\n currentProgram = \"DPP\";\n }\n\n const daysInProgram = differenceInDays(\n Date.now(),\n new Date(timeStarted || Date.now()),\n );\n\n const surveyPeriod = currentProgram === \"MOOD\" ? 15 : 30;\n const surveyInstance = Math.floor(daysInProgram / surveyPeriod);\n setSurveyMetadata({\n name: \"RECURRING_OUTCOMES\",\n instance: `${surveyInstance}`,\n });\n\n setUserProfile({\n currentProgram,\n daysInProgram,\n firstName,\n gender,\n heightCms,\n latestWeightKgs,\n loggedExerciseMinsPastTwoWks,\n segmentId,\n segmentName,\n });\n\n linkB2BIdentity(accessCode);\n } catch (e) {\n captureException(e);\n setErrorState(ErrorState.DEFAULT);\n goto.error();\n }\n };\n\n if (!userProfile) {\n getUserProfile();\n }\n }, [autologinData, userProfile]);\n\n return (\n surveyMetadata &&\n userProfile && (\n \n )\n );\n};\n","import React, { useEffect } from \"react\";\nimport { useNavigate } from \"react-router-dom\";\n\nimport {\n Box,\n CompassColor,\n CompassLoader,\n Stack,\n StyleProps,\n} from \"@noom/wax-component-library\";\n\nimport { useAppContext } from \"@/contexts\";\nimport { useGoto, useRetriageEligibility } from \"@/hooks\";\nimport { getAutologinData } from \"@/utils/cookies\";\nimport { captureMessage } from \"@/utils/sentry\";\n\nconst defaultStyles: StyleProps = {\n display: \"flex\",\n w: \"100vw\",\n h: \"100vh\",\n position: \"relative\",\n flexDir: \"column\",\n alignItems: \"center\",\n justifyContent: \"center\",\n color: CompassColor.black,\n fontFamily: \"Untitled Sans\",\n fontWeight: 500,\n};\n\nexport const RetriageAuthView: React.FC = () => {\n const navigate = useNavigate();\n const goto = useGoto();\n const autologinData = getAutologinData();\n const { retriageEligibility } = useAppContext();\n useRetriageEligibility();\n\n useEffect(() => {\n if (!autologinData) {\n captureMessage(\"No retriage auth found\", \"fatal\");\n goto.error();\n }\n }, [autologinData]);\n\n useEffect(() => {\n if (!retriageEligibility) {\n return;\n }\n if (!retriageEligibility.partnerSlug) {\n goto.error();\n return;\n }\n navigate(`/employer/${retriageEligibility.partnerSlug}/rt`);\n }, [retriageEligibility]);\n\n return (\n \n \n \n \n \n );\n};\n","import React, { useEffect } from \"react\";\nimport { useLocation, useNavigate, useParams } from \"react-router-dom\";\n\nimport { Api } from \"@noom/noomscape\";\n\nimport { Survey } from \"@/components/survey/Survey\";\nimport QuestionSets from \"@/components/survey/questionSets/questionSets\";\nimport {\n GENDER_QUESTION_ID,\n SEX_QUESTION_ID,\n} from \"@/components/survey/questionTypes/dpp-triage\";\nimport { ErrorState } from \"@/constants\";\nimport { useAppContext } from \"@/contexts\";\nimport { useAnswerSurveyQuestion, useGoto } from \"@/hooks\";\nimport { Partner } from \"@/models\";\nimport { getAutologinData } from \"@/utils/cookies\";\nimport { captureException } from \"@/utils/sentry\";\nimport { GenderProtoMap, SexProtoMap } from \"@/utils/survey/retriage\";\n\nexport const RetriageView: React.FC = () => {\n const {\n partnerInfo,\n retriageEligibility,\n setErrorState,\n setPartnerInfo,\n setEnrollmentType,\n surveyAnswers,\n } = useAppContext();\n const { answerSurveyQuestion } = useAnswerSurveyQuestion();\n const { openApp } = useGoto();\n const { search } = useLocation();\n const navigate = useNavigate();\n const { employerSlug } = useParams();\n\n const autologinData = getAutologinData();\n\n const onSurveyComplete = async () => {\n openApp(autologinData);\n };\n\n useEffect(() => {\n if (surveyAnswers.sex || surveyAnswers.gender) {\n return;\n }\n\n const { gender, sex } = retriageEligibility?.userProfile || {};\n\n if (!(gender && sex)) {\n return;\n }\n\n // Only pre-populate sex and gender if both values map cleanly to a respective question options.\n if (SexProtoMap[sex] && GenderProtoMap[gender]) {\n answerSurveyQuestion(\n SEX_QUESTION_ID,\n SexProtoMap[sex],\n {\n [GENDER_QUESTION_ID]: GenderProtoMap[gender],\n },\n true,\n );\n }\n }, [retriageEligibility, surveyAnswers]);\n\n useEffect(() => {\n setEnrollmentType(\"RETRIAGE\");\n }, []);\n\n useEffect(() => {\n const getPartnerInfo = async () => {\n try {\n const partnerInformation: Partner = await Api.call(\n \"partner.getPartnerBySlug\",\n Api.api.partner.getPartnerBySlug,\n {\n slug: employerSlug,\n },\n );\n\n if (!partnerInformation.configs.OFFERS_RETRIAGE) {\n navigate({ pathname: `/employer/${employerSlug}`, search });\n return;\n }\n\n setPartnerInfo(partnerInformation);\n } catch (e) {\n captureException(e);\n setErrorState(ErrorState.DEFAULT);\n navigate(\"/error\");\n }\n };\n\n getPartnerInfo();\n }, [employerSlug]);\n\n return (\n partnerInfo && (\n \n )\n );\n};\n","import React from \"react\";\nimport { useLocation, useNavigate } from \"react-router-dom\";\n\nimport { Survey } from \"@/components/survey/Survey\";\nimport QuestionSets from \"@/components/survey/questionSets/questionSets\";\nimport { ErrorState, EnrollmentSuccessType } from \"@/constants\";\nimport { useAppContext } from \"@/contexts\";\nimport {\n useGoto,\n useQueryParams,\n useTransitionB2CAccount,\n useStoreOutcomes,\n useUpdateLastTriageTimestamp,\n} from \"@/hooks\";\nimport { captureException } from \"@/utils/sentry\";\n\nexport const TransitionView: React.FC = () => {\n const { enrollmentInfo, selectedProgram, setErrorState } = useAppContext();\n const goto = useGoto();\n const { storeBaselineOutcomesAnswers } = useStoreOutcomes();\n const { transitionB2CAccount } = useTransitionB2CAccount();\n const { updateLastTriageTimestamp } = useUpdateLastTriageTimestamp();\n const { search } = useLocation();\n const navigate = useNavigate();\n\n if (!enrollmentInfo) {\n navigate({\n pathname: \"/\",\n search,\n });\n }\n\n const { upid } = useQueryParams();\n\n if (!upid) {\n navigate(\"/error\");\n }\n\n const onSurveyComplete = async () => {\n try {\n // TODO(eric): Technically, this could throw B2B_INELIGIBLE error, but shouldn't happen in practice\n // as eligibility should have already been checked. Currently, we don't have a standalone Ineligible ErrorState,\n // but we should handle this error and send there when we do.\n const accessCode = await transitionB2CAccount(selectedProgram);\n\n if (!accessCode) return;\n\n try {\n // If this fails for some reason don't break execution\n await storeBaselineOutcomesAnswers(accessCode);\n } catch (e) {\n captureException(e);\n }\n\n try {\n await updateLastTriageTimestamp(accessCode, \"ASSIGNED_INITIAL_OFFERING\");\n } catch (e) {\n captureException(e);\n }\n\n goto.success(EnrollmentSuccessType.TRANSITIONED);\n } catch (e) {\n captureException(e);\n setErrorState(ErrorState.DEFAULT);\n navigate(\"/error\");\n }\n };\n\n return (\n \n );\n};\n","import Cookies from \"js-cookie\";\nimport { useNavigate } from \"react-router-dom\";\n\nimport { Api } from \"@noom/noomscape\";\n\nimport {\n ErrorCode,\n ErrorState,\n ProgramOffering,\n ResultType,\n} from \"@/constants\";\nimport { useAppContext } from \"@/contexts\";\nimport { useQueryParams } from \"@/hooks/useQueryParams\";\nimport { captureException } from \"@/utils/sentry\";\n\nimport { AxiosError } from \"axios\";\n\nimport { useEnrollMed } from \"./useEnrollMed\";\nimport { useTrackEvent } from \"./useTrackEvent\";\n\nexport const useTransitionB2CAccount = () => {\n const { setErrorState, userData } = useAppContext();\n const { enrollMed } = useEnrollMed();\n const { upid } = useQueryParams();\n const navigate = useNavigate();\n const { linkB2BIdentity, trackAnonEvent, trackIdentifiedEvent } =\n useTrackEvent();\n\n const transitionB2CAccount = async (\n selectedProgram: ProgramOffering | null,\n ): Promise => {\n if (!userData || !upid) {\n setErrorState(ErrorState.DEFAULT);\n navigate(\"/error\");\n return undefined;\n }\n\n try {\n const { accessCode } = await Api.call(\n \"account.migrateToB2B\",\n Api.api.account.migrateToB2B,\n {\n upid,\n userData,\n },\n );\n\n if (selectedProgram === \"MED\") {\n await enrollMed(accessCode, userData);\n }\n\n // Set cookie expiration to 1 hour\n Cookies.set(\"lastEnrolledUpid\", upid, { expires: 1 / 24 });\n\n linkB2BIdentity(accessCode, userData.email, upid);\n\n trackIdentifiedEvent(\"b2bEnrollmentIdentifiedSignupSubmitted\", {\n b2bProgram: selectedProgram || \"PROGRAM_UNSPECIFIED\",\n b2bSignupResult: ResultType.SUCCESS,\n b2cTransitionedAccount: true,\n coursePacks: userData.coursePacks,\n freeAccountExists: false,\n upid,\n });\n\n trackAnonEvent(\"b2bEnrollmentAnonSignupSubmitted\", {\n b2bProgram: selectedProgram || \"PROGRAM_UNSPECIFIED\",\n b2bSignupResult: ResultType.SUCCESS,\n b2cTransitionedAccount: true,\n coursePacks: userData.coursePacks,\n freeAccountExists: false,\n });\n return accessCode;\n } catch (e: unknown) {\n const errorMessage = (e as AxiosError)?.response\n ?.data?.errorCode;\n const isIneligible = errorMessage === \"B2B_INELIGIBLE\";\n const migrationRequestCreated =\n errorMessage === \"B2B_MIGRATION_REQUEST_CREATED\";\n\n const medEnrollmentFailed =\n (e as Error)?.message === ErrorCode.MED_ENROLLMENT_FAILED;\n\n if (isIneligible) {\n throw new Error(\"B2B_INELIGIBLE\");\n }\n\n const resultType = ResultType.ERROR;\n if (migrationRequestCreated || medEnrollmentFailed) {\n setErrorState(ErrorState.SUPPORT_REQUEST_CREATED);\n } else {\n setErrorState(ErrorState.DEFAULT);\n captureException(e);\n }\n\n trackIdentifiedEvent(\"b2bEnrollmentIdentifiedSignupSubmitted\", {\n b2bProgram: selectedProgram || \"PROGRAM_UNSPECIFIED\",\n b2bSignupResult: resultType,\n b2cTransitionedAccount: true,\n coursePacks: userData.coursePacks,\n freeAccountExists: false,\n upid,\n });\n\n trackAnonEvent(\"b2bEnrollmentAnonSignupSubmitted\", {\n b2bProgram: selectedProgram || \"PROGRAM_UNSPECIFIED\",\n b2bSignupResult: resultType,\n b2cTransitionedAccount: true,\n coursePacks: userData.coursePacks,\n freeAccountExists: false,\n });\n\n navigate(\"/error\");\n return undefined;\n }\n };\n\n return {\n transitionB2CAccount,\n };\n};\n","import React, { useEffect } from \"react\";\nimport { useTranslation, Trans } from \"react-i18next\";\n\nimport { Image } from \"@noom/wax-component-library\";\n\nimport { FullscreenMessage, TryAgainVideo } from \"@/components\";\nimport {\n NoomEmailAddressLink,\n NoomSupportLink,\n} from \"@/components/noom-branding\";\nimport { ErrorState } from \"@/constants\";\nimport { useAppContext } from \"@/contexts\";\nimport { useTrackEvent } from \"@/hooks\";\nimport { getDisplayName } from \"@/models\";\nimport { isB2CPartner } from \"@/utils/partners\";\n\ntype ErrorStateTextConfig = {\n callToAction: React.ReactElement;\n errorMessage: string;\n visual?: React.ReactElement;\n};\n\ntype ErrorStateB2CWhitelist = Extract<\n ErrorState,\n ErrorState.DEFAULT | ErrorState.CODE_CLAIMED | ErrorState.ACCOUNT_EXISTS\n>;\n\nexport const ErrorView: React.FC = () => {\n const {\n eligibilityInfo,\n errorState,\n maskedEmail,\n partnerInfo,\n surveyMetadata,\n } = useAppContext();\n const {\n trackAnonEvent,\n trackIdentifiedEvent,\n trackSurveyAnonEvent,\n trackSurveyIdentifiedEvent,\n } = useTrackEvent();\n const { t } = useTranslation();\n\n const goLiveDate =\n errorState === ErrorState.BEFORE_GOLIVE_DATE &&\n partnerInfo?.goLiveDate?.toLocaleString([], {\n dateStyle: \"full\",\n ...((partnerInfo?.goLiveDate?.getHours() > 0 ||\n (partnerInfo?.goLiveDate?.getHours() === 0 &&\n partnerInfo?.goLiveDate?.getMinutes() > 0)) && {\n timeStyle: \"short\",\n }),\n });\n\n const effectiveDate =\n errorState === ErrorState.PRIOR_TO_EFFECTIVE_DATE\n ? eligibilityInfo?.effectiveDate?.toLocaleString([], {\n dateStyle: \"full\",\n timeZone: \"UTC\",\n }) || \"\"\n : \"\";\n\n const errorTextConfigs: { [key in ErrorState]: ErrorStateTextConfig } = {\n [ErrorState.CODE_CLAIMED]: {\n callToAction: (\n \n Each signup link contains a code that lets one person sign up for Noom\n - and it looks like this code has already been claimed. Please contact\n your employer for support. If you believe this message is an error,\n contact\n {NoomEmailAddressLink}\n for assistance.\n \n ),\n errorMessage: t(\"error.codeClaimed.errorMessage\"),\n },\n [ErrorState.DEFAULT]: {\n callToAction: (\n \n Please reach out to\n {NoomEmailAddressLink}\n if you have questions or need help.\n \n ),\n errorMessage: t(\"error.default.errorMessage\"),\n },\n [ErrorState.ELIGIBILITY_CHECK_EXISTING_ACCOUNT]: {\n callToAction: (\n \n Each eligible user can sign up for Noom one time, and a spot has\n already been claimed with the information you provided. Please contact\n your Noom sponsor for support.\n
\n
\n If you believe this message is an error, contact\n {NoomEmailAddressLink} for assistance.\n
\n ),\n errorMessage: t(\"error.eligibilityCheckExistingAccount.errorMessage\"),\n },\n [ErrorState.ACCOUNT_EXISTS]: {\n callToAction: (\n \n Please login to your existing account via the Noom app. If you\n can't remember your password, you can\n \n reset your password here\n \n . Still having problems? Contact {NoomEmailAddressLink} for additional\n support.\n \n ),\n errorMessage: t(\"error.existingAccount.errorMessage\"),\n },\n [ErrorState.SSO_ACCOUNT_EXISTS]: {\n callToAction: (\n \n Please login to your existing account via the Noom app. If you\n can't remember your password, you can\n \n reset your password here\n \n . Still having problems? Contact {NoomEmailAddressLink} for additional\n support.\n \n ),\n errorMessage: t(\"error.ssoExistingAccount.errorMessage\"),\n visual: \"\",\n },\n [ErrorState.EXISTING_VIRGIN_PULSE_USER]: {\n callToAction: (\n \n Having trouble accessing your account or have a question? Please reach\n out to\n {NoomEmailAddressLink}\n for assistance.\n \n ),\n errorMessage: t(\"error.existingVirginPulseUser.errorMessage\", {\n context: maskedEmail ? \"hasEmail\" : \"\",\n email: maskedEmail,\n }),\n },\n [ErrorState.BATCH_FULL]: {\n callToAction: (\n \n We're sorry about that. Please reach out to your employer if you\n have any questions about program capacity. Other issues? Drop us a\n line at\n {NoomEmailAddressLink}.\n \n ),\n errorMessage: t(\"error.fullBatch.errorMessage\"),\n },\n [ErrorState.SUPPORT_REQUEST_CREATED]: {\n callToAction: (\n \n Unfortunately we encountered an issue while setting up your account.\n Hang tight - we've alerted our support team and they will reach\n out to you soon to set up your Noom program.\n
\n
\n If you have any questions before then, you can reach out to us at\n partnersupport@noom.com.\n
\n ),\n errorMessage: t(\"error.supportRequestCreated.errorMessage\"),\n },\n [ErrorState.PENDING_DELETION_REQUEST]: {\n callToAction: (\n \n Our records show that an account using this email address was recently\n deleted. For privacy reasons we cannot create a new account using that\n email right now.\n
\n
\n Please sign up again using a different email address. If you are still\n having issues you can reach out to our customer support team at\n partnersupport@noom.com.\n
\n ),\n errorMessage: t(\"error.pendingDeletion.errorMessage\"),\n },\n [ErrorState.BEFORE_GOLIVE_DATE]: {\n callToAction: (\n \n We haven't launched with {getDisplayName(partnerInfo)} yet.\n Please come back on {goLiveDate} to sign up for Noom.\n \n ),\n errorMessage: t(\"error.beforeGoliveDate.errorMessage\"),\n },\n [ErrorState.FAILED_ELIGIBILITY_CHECK]: {\n callToAction: (\n \n We need a match in order to confirm your eligibility. Please go back\n and double check the details you provided.\n
\n
\n Still having issues? Email {NoomEmailAddressLink} with your name,\n email, and membership sponsor and our team will do our best to help\n you out.\n
\n
\n If you aren't eligible and still want to use Noom, you can sign\n up and pay for a membership at\n noom.com.\n
\n ),\n errorMessage: t(\"error.failedEligibilityCheck.errorMessage\"),\n },\n [ErrorState.SSO_INELIGIBLE]: {\n callToAction: (\n \n Something went wrong while trying to confirm your eligibility.\n
\n
\n Please email {NoomEmailAddressLink} with your name, email, and\n membership sponsor and our team will do our best to help you out.\n
\n
\n If you aren't eligible and still want to use Noom, you can sign\n up and pay for a membership at\n noom.com.\n
\n ),\n errorMessage: t(\"error.ssoIneligible.errorMessage\"),\n },\n [ErrorState.PAST_CONTRACT_END_DATE]: {\n callToAction: (\n \n Thanks for your interest in Noom! Right now,{\" \"}\n {getDisplayName(partnerInfo)} isn't sponsoring more Noom\n memberships. However, you can still sign up for the Noom program on\n your own by going to noom.com.\n
\n
\n If you have questions or are concerned you're seeing this message\n in error, please email {NoomEmailAddressLink} or contact your Noom\n sponsor.\n
\n ),\n errorMessage: t(\"error.pastContractEndDate.errorMessage\", {\n partnerName: getDisplayName(partnerInfo),\n }),\n },\n [ErrorState.PRIOR_TO_EFFECTIVE_DATE]: {\n callToAction: t(\"error.priorToEffectiveDate.callToAction\", {\n effectiveDate,\n }),\n errorMessage: t(\"error.priorToEffectiveDate.errorMessage\"),\n },\n [ErrorState.ELIGIBILITY_CHECK_API_ERROR]: {\n callToAction: t(\"error.eligibilityCheckApiError.callToAction\"),\n errorMessage: t(\"error.eligibilityCheckApiError.errorMessage\"),\n },\n [ErrorState.ELIGIBILITY_CHECK_MULTIPLE_MATCHES]: {\n callToAction: (\n \n Please email {NoomEmailAddressLink} with your name, email, and\n membership sponsor and our team will do our best to help you out.\n \n ),\n errorMessage: t(\"error.eligibilityCheckMultipleMatches.errorMessage\"),\n },\n };\n\n const errorTextB2CConfigs: {\n [key in ErrorStateB2CWhitelist]: ErrorStateTextConfig;\n } = {\n [ErrorState.CODE_CLAIMED]: {\n callToAction: (\n \n ),\n errorMessage: t(\"error.codeClaimed.errorMessage\"),\n },\n [ErrorState.DEFAULT]: {\n callToAction: (\n \n ),\n errorMessage: t(\"error.default.errorMessage\"),\n },\n [ErrorState.ACCOUNT_EXISTS]: {\n callToAction: (\n \n ),\n errorMessage: t(\"error.existingAccount.errorMessage\"),\n },\n };\n\n const errorText =\n (isB2CPartner(partnerInfo) &&\n errorTextB2CConfigs[errorState as unknown as ErrorStateB2CWhitelist]) ||\n errorTextConfigs[errorState];\n\n const { callToAction, errorMessage, visual } = errorText;\n\n useEffect(() => {\n if (surveyMetadata) {\n trackSurveyAnonEvent(\"b2bSurveyAnonErrorPageViewed\", {\n errorType: errorState,\n });\n trackSurveyIdentifiedEvent(\"b2bSurveyIdentifiedErrorPageViewed\", {\n errorType: errorState,\n });\n } else {\n trackAnonEvent(\"b2bEnrollmentAnonErrorPageViewed\", {\n b2bErrorType: errorState,\n });\n trackIdentifiedEvent(\"b2bEnrollmentIdentifiedErrorPageViewed\", {\n b2bErrorType: errorState,\n });\n }\n }, [errorState]);\n\n return (\n }\n />\n );\n};\n","import { css, keyframes } from \"@emotion/react\";\nimport styled from \"@emotion/styled\";\n\nconst fadeIn = keyframes`\n from {\n opacity: 0;\n }\n\n to {\n opacity: 1;\n }\n`;\nexport const FadeIn = styled.div<{ duration?: number; delay?: number }>`\n opacity: 0;\n animation-name: ${fadeIn};\n animation-duration: ${(props) => props.duration || 2}s;\n animation-delay: ${(props) => (props.delay !== undefined ? props.delay : 1)}s;\n animation-fill-mode: forwards;\n`;\n\nexport const delayedFadeIn = keyframes`\n 0% {\n opacity: 0;\n }\n 50% {\n opacity: 0;\n }\n 100% {\n opacity: 1;\n }\n`;\n\nconst fadeInAndOut = keyframes`\n from {\n opacity: 0;\n }\n\n 25%,\n 75% {\n opacity: 1;\n }\n\n to {\n opacity: 0;\n }\n`;\n\nexport const FadeInAndOut = styled.div<{ duration?: number; delay?: number }>`\n opacity: 0;\n animation-name: ${fadeInAndOut};\n animation-duration: ${(props) => props.duration || 3}s;\n animation-delay: ${(props) => props.delay || 0}s;\n animation-fill-mode: forwards;\n`;\n\nconst fadeOut = keyframes`\nfrom {\n opacity: 1;\n}\nto {\n opacity: 0;\n}`;\n\nexport const fadeOutAnimation = css`\n opacity: 1;\n animation: ${fadeOut} 3s ease-in;\n`;\n\nexport const FadeOut = styled.div<{ duration?: number; delay?: number }>`\n animation-name: ${fadeOut};\n animation-duration: ${(props) => props.duration || 2}s;\n animation-delay: ${(props) => (props.delay !== undefined ? props.delay : 1)}s;\n animation-fill-mode: forwards;\n`;\n","import { keyframes } from \"@emotion/react\";\nimport styled from \"@emotion/styled\";\nimport React, { useEffect, useState } from \"react\";\n\nimport { CompassColor, Image } from \"@noom/wax-component-library\";\n\nimport { useTrackEvent } from \"@/hooks\";\n\nimport { FadeIn, FadeInAndOut } from \"./animation/fade\";\n\nconst open = keyframes`\n from {\n height: 0;\n width: 0;\n top: 50%;\n left: 50%;\n opacity: 0;\n }\n\n to {\n height: 300vh;\n width: 300vh;\n top: calc(50% - 150vh);\n left: calc(50% - 150vh);\n opacity: 1;\n }\n `;\n\nconst ExpandingCircleCover = styled.div`\n position: fixed;\n background-color: ${CompassColor.offWhite};\n border-radius: 50%;\n opacity: 0;\n\n animation: ${open};\n animation-duration: 2s;\n animation-delay: 3.5s;\n animation-fill-mode: forwards;\n`;\n\nconst Container = styled.div`\n position: fixed;\n left: 0;\n top: 0;\n display: flex;\n flex-direction: column;\n align-items: center;\n height: 100vh;\n width: 100vw;\n background-color: ${CompassColor.blueberry};\n\n h1 {\n font-family: \"Brown LL\", sans-serif;\n font-style: normal;\n font-weight: 500;\n letter-spacing: 0.03em;\n color: ${CompassColor.white};\n font-size: 14px;\n line-height: 21px;\n text-transform: uppercase;\n text-align: center;\n margin-bottom: 24px;\n }\n`;\n\nconst slideUpSmall = keyframes`\n from {\n opacity: 0;\n transform: translate(0, 20px);\n }\n\n to {\n opacity: 1;\n transform: translate(0, 0);\n }\n `;\n\nconst Logo = styled.img`\n opacity: 0;\n animation-name: ${slideUpSmall};\n animation-duration: 0.5s;\n animation-delay: 2s;\n animation-fill-mode: forwards;\n height: 36px;\n`;\n\nconst Slide = styled.div<{ bgColor?: string }>`\n position: fixed;\n height: 100vh;\n padding-top: 30vh;\n background-color: ${(props) => props.bgColor || CompassColor.offWhite};\n width: 100%;\n display: flex;\n flex-direction: column;\n`;\n\nconst SlideText = styled.div`\n font-family: \"Untitled Serif\", sans-serif;\n font-style: normal;\n font-weight: 500;\n color: ${CompassColor.black};\n font-size: 24px;\n text-align: center;\n margin: 24px;\n`;\n\ntype Slide = {\n content: React.ReactElement;\n canProceed?: () => boolean;\n};\n\nconst WelcomeToNoomAnimation: React.FC<{\n animationDone: () => void;\n isEligible?: boolean;\n}> = ({ animationDone, isEligible }) => {\n const { trackAnonPageViewed, trackIdentifiedPageViewed } = useTrackEvent();\n\n useEffect(() => {\n trackAnonPageViewed(\"ssoEligibilityVerification\");\n trackIdentifiedPageViewed(\"ssoEligibilityVerification\");\n }, []);\n\n const [currentSlideIdx, setCurrentSlideIdx] = useState(0);\n const slides: Slide[] = [\n {\n content: (\n \n \n

WELCOME TO

\n
\n \n {\n setCurrentSlideIdx(currentSlideIdx + 1);\n }}\n />\n
\n ),\n },\n {\n content: (\n \n {\n if (!isEligible) {\n animationDone();\n }\n setCurrentSlideIdx(currentSlideIdx + 1);\n }}\n >\n \n Verifying eligibility information...\n \n \n ),\n },\n {\n content: (\n \n {\n animationDone();\n }}\n >\n \n Eligibility verified\n \n \n ),\n },\n ];\n\n return {slides[currentSlideIdx].content};\n};\n\nexport default WelcomeToNoomAnimation;\n","/**\n * Translation configuration\n *\n * Copyright (C) 2019D Noom, Inc.\n * @author nikola\n */\n\nimport i18next from \"i18next\";\nimport LanguageDetector from \"i18next-browser-languagedetector\";\nimport Backend from \"i18next-xhr-backend\";\nimport { initReactI18next } from \"react-i18next\";\n\nimport { enu } from \"@noom/noomscape\";\n\n// TODO Uncomment languages when translation files are added\nexport type Language = \"en\" /* | \"es\" | \"de\" | \"ko\" | \"ja\" */;\n\nexport const LANGUAGES: Record = {\n en: \"English\",\n // es: \"Español\",\n // de: \"Deutsch\",\n // ko: \"한국어\",\n // ja: \"日本語\",\n};\n\nexport const NAMESPACES = enu([\"enrollment\", \"employerLanding\"]);\n\nexport function init(): void {\n i18next\n .use(Backend)\n .use(LanguageDetector)\n .use(initReactI18next)\n .init({\n debug: false,\n fallbackLng: \"en\",\n whitelist: Object.keys(LANGUAGES),\n interpolation: {\n escapeValue: false,\n },\n ns: Object.keys(NAMESPACES),\n defaultNS: NAMESPACES.enrollment,\n fallbackNS: NAMESPACES.enrollment,\n backend: {\n loadPath: \"/assets/locales/{{lng}}/{{ns}}.json\",\n },\n detection: {\n lookupQuerystring: \"lang\",\n checkWhitelist: true,\n },\n });\n}\n","import React, { useState } from \"react\";\nimport { Trans, useTranslation } from \"react-i18next\";\n\nimport {\n Box,\n CompassColor,\n Heading,\n Image,\n Spacing,\n Stack,\n Text,\n useMediaQuery,\n} from \"@noom/wax-component-library\";\n\nimport { NAMESPACES } from \"@/app/i18n\";\nimport { ASSET_URL } from \"@/constants\";\n\ntype ValueProp = {\n alt: string;\n captionKey: string;\n url: string;\n};\n\nconst STATIC_CONTENT_IMAGES: ValueProp[] = [\n {\n alt: \"Hike\",\n captionKey: \"enrollmentStaticContent.valueProp1\",\n url: \"/assets/img/hike.png\",\n },\n {\n alt: \"Swim\",\n captionKey: \"enrollmentStaticContent.valueProp2\",\n url: \"/assets/img/swim.png\",\n },\n {\n alt: \"Stretch\",\n captionKey: \"enrollmentStaticContent.valueProp3\",\n url: \"/assets/img/stretch.png\",\n },\n];\n\ntype EnrollmentStaticContentProps = {\n employerName?: string;\n employerSlug?: string;\n showPricePill: boolean;\n showOriginalLogo?: boolean;\n isLoading: boolean;\n};\n\nexport const EnrollmentStaticContent: React.FC<\n EnrollmentStaticContentProps\n> = ({\n employerName,\n employerSlug,\n showPricePill,\n showOriginalLogo,\n isLoading,\n}) => {\n const [isBrowser] = useMediaQuery(\"(min-width: 1160px)\");\n const [isImageLoaded, setIsImageLoaded] = useState(false);\n const { t } = useTranslation(NAMESPACES.employerLanding);\n\n const imageUrl = `${ASSET_URL}/img/${employerSlug}/logo.png`;\n\n const showWhiteLogo = employerSlug && !showOriginalLogo;\n\n return (\n \n \n \n \n {employerSlug && !isLoading && (\n <>\n \n setIsImageLoaded(true)}\n height=\"24px\"\n filter={showWhiteLogo ? \"brightness(0) invert(1)\" : \"none\"}\n opacity={isImageLoaded ? 1 : 0}\n transition=\"opacity 0.1s ease-in-out\"\n />\n \n )}\n \n {showPricePill && isBrowser && (\n \n \n $199\n \n \n {t(\"enrollmentStaticContent.free\")}\n \n \n )}\n \n \n {t(\"enrollmentStaticContent.heading\")}\n \n \n {t(\"enrollmentStaticContent.description\")}\n \n {isBrowser && (\n \n {STATIC_CONTENT_IMAGES.map(({ alt, captionKey, url }) => (\n \n {alt}\n \n \n ),\n }}\n i18nKey={captionKey}\n ns={NAMESPACES.employerLanding}\n />\n \n \n ))}\n \n )}\n
\n );\n};\n","import React from \"react\";\n\nimport { Heading, Spacing, Stack, Text } from \"@noom/wax-component-library\";\n\ntype BaseSideFormProps = {\n children?: React.ReactNode;\n headerText?: string;\n helperText: string;\n};\n\nexport const BaseSideForm: React.FC = ({\n children,\n headerText = \"Welcome to Noom.\",\n helperText,\n}) => (\n \n \n \n {headerText}\n \n {helperText}\n \n {children}\n \n);\n","import { Formik, FormikHelpers } from \"formik\";\nimport React, { ChangeEvent, useEffect } from \"react\";\nimport { Trans, useTranslation } from \"react-i18next\";\nimport { useLocation, useNavigate } from \"react-router-dom\";\nimport * as Yup from \"yup\";\n\nimport {\n Button,\n CompassColor,\n Heading,\n Image,\n Input,\n Spacing,\n Stack,\n Text,\n} from \"@noom/wax-component-library\";\n\nimport { NAMESPACES } from \"@/app/i18n\";\nimport { NoomEmailAddressLink } from \"@/components/noom-branding\";\nimport { useAppContext } from \"@/contexts\";\nimport { useSubmitPasscode, useTrackEvent } from \"@/hooks\";\n\ntype PasscodeInputFormValues = {\n passcode: string;\n};\n\nconst initialValues: PasscodeInputFormValues = {\n passcode: \"\",\n};\n\nexport const PasscodeInputForm = () => {\n const { partnerInfo } = useAppContext();\n const { search } = useLocation();\n const navigate = useNavigate();\n const submitPasscode = useSubmitPasscode();\n const { trackIdentifiedPageViewed } = useTrackEvent();\n const { t } = useTranslation(NAMESPACES.employerLanding);\n\n const isVpSponsor = partnerInfo?.configs?.ENROLL_VIRGIN_PULSE || false;\n const isPasscodeEnrollment = partnerInfo?.configs?.ENROLL_PASSCODE || false;\n\n const MAX_LENGTH = 50;\n const validationSchema = Yup.object().shape({\n passcode: Yup.string()\n .max(\n MAX_LENGTH,\n t(\"form.errors.maxLength\", {\n label: \"Passcode\",\n maxLength: MAX_LENGTH,\n }),\n )\n .required(t(\"form.passcode.errors.required\")),\n });\n\n const onSubmitPasscode = async (\n values: PasscodeInputFormValues,\n actions: FormikHelpers,\n ) => {\n try {\n await submitPasscode(values.passcode, \"MANUAL\");\n } catch {\n actions.setFieldError(\"passcode\", t(\"form.passcode.errors.invalid\"));\n }\n };\n\n useEffect(() => {\n trackIdentifiedPageViewed(\"passcodeInput\");\n }, []);\n\n return (\n \n {isVpSponsor && (\n \n \n {t(\"passcode.personifyHealth.heading\")}\n \n {t(\"passcode.personifyHealth.description\")}\n \n navigate({\n pathname: \"/personify-health\",\n search,\n })\n }\n size=\"xl\"\n >\n \n {t(\"passcode.personifyHealth.ctaText\")}\n \n \n \n \n )}\n {isPasscodeEnrollment && (\n \n \n {({\n errors,\n getFieldProps,\n handleSubmit,\n isSubmitting,\n setFieldValue,\n touched,\n }) => (\n
\n {isVpSponsor ? (\n \n {t(\"passcode.headingSecondary\")}\n \n ) : (\n \n {t(\"passcode.headingPrimary\")}\n \n )}\n ) =>\n setFieldValue(\"passcode\", e.target.value.toUpperCase())\n }\n placeholder={t(\"form.passcode.placeholder\")}\n size=\"lg\"\n />\n \n {t(\"passcode.ctaText\")}\n \n \n )}\n \n
\n )}\n \n \n Have a question? Drop us a line at\n {NoomEmailAddressLink}\n
\n \n \n );\n};\n","import { Formik, FormikHelpers } from \"formik\";\nimport React, { useEffect } from \"react\";\nimport { Trans, useTranslation } from \"react-i18next\";\nimport { useLocation, useNavigate } from \"react-router-dom\";\nimport * as Yup from \"yup\";\n\nimport { Api } from \"@noom/noomscape\";\nimport {\n Button,\n Heading,\n Input,\n Spacing,\n Stack,\n Text,\n} from \"@noom/wax-component-library\";\n\nimport { NAMESPACES } from \"@/app/i18n\";\nimport { NoomEmailAddressLink } from \"@/components/noom-branding\";\nimport { ErrorState } from \"@/constants\";\nimport { useAppContext } from \"@/contexts\";\nimport { useTrackEvent } from \"@/hooks\";\nimport { captureException } from \"@/utils/sentry\";\n\ntype UpidInputFormValues = {\n upid: string;\n};\n\nconst initialValues: UpidInputFormValues = {\n upid: \"\",\n};\n\nexport const UpidInputForm = () => {\n const { setErrorState } = useAppContext();\n const { search } = useLocation();\n const navigate = useNavigate();\n const { trackIdentifiedPageViewed } = useTrackEvent();\n const { t } = useTranslation(NAMESPACES.employerLanding);\n\n const MAX_LENGTH = 150;\n const validationSchema = Yup.object().shape({\n upid: Yup.string()\n .max(\n MAX_LENGTH,\n t(\"form.errors.maxLength\", {\n label: \"UPID\",\n maxLength: MAX_LENGTH,\n }),\n )\n .required(t(\"form.upid.errors.required\")),\n });\n\n const onSubmitUpid = async (\n values: UpidInputFormValues,\n actions: FormikHelpers,\n ) => {\n const { upid } = values;\n\n try {\n await Api.call(\n \"upid.getEnrollmentInformation\",\n Api.api.upid.getEnrollmentInformation,\n {\n upid,\n },\n );\n\n const qs = new URLSearchParams(search);\n qs.append(\"upid\", upid);\n navigate(`/?${qs.toString()}`);\n } catch (e) {\n if ((e as Error).message === \"Request failed with status code 404\") {\n actions.setFieldError(\"upid\", t(\"form.upid.errors.invalid\"));\n return;\n }\n\n captureException(e);\n setErrorState(ErrorState.DEFAULT);\n navigate(\"/error\");\n }\n };\n\n useEffect(() => {\n trackIdentifiedPageViewed(\"upidInput\");\n }, []);\n\n return (\n \n \n \n {({ errors, getFieldProps, handleSubmit, isSubmitting, touched }) => (\n
\n \n {t(\"upid.heading\")}\n \n \n \n {t(\"upid.ctaText\")}\n \n \n )}\n \n
\n \n \n \n
\n );\n};\n","import React from \"react\";\nimport { useParams } from \"react-router-dom\";\n\nimport { DPP_PARTNERS } from \"@/constants/Partners\";\nimport { useAppContext } from \"@/contexts\";\nimport { getDisplayName } from \"@/models\";\n\nimport { BaseSideForm } from \"../enrollment/BaseSideForm\";\n\nimport { PasscodeInputForm } from \"./PasscodeInputForm\";\nimport { UpidInputForm } from \"./UpidInputForm\";\n\nexport const CodeInputForm = () => {\n const { partnerInfo } = useAppContext();\n const { employerSlug } = useParams();\n\n const isPasscodeEnrollment = !!partnerInfo?.configs?.ENROLL_PASSCODE;\n const isVpSponsor = !!partnerInfo?.configs?.ENROLL_VIRGIN_PULSE;\n\n // Partners without Passcode or Virgin Pulse enrollment are typically\n // using UPID enrollment but for the edge case when none are selected\n // it's suitable to use the same messaging as UPID enrollment.\n const enrollmentBlurb =\n !isPasscodeEnrollment && !isVpSponsor\n ? `Contact ${getDisplayName(partnerInfo)} for enrollment information.`\n : \"Sign up below to get started.\";\n\n const helperText =\n // eslint-disable-next-line no-nested-ternary\n partnerInfo?.id && DPP_PARTNERS.includes(partnerInfo.id)\n ? `Join Noom at no cost to you as a benefit from ${getDisplayName(\n partnerInfo,\n )}! Create a Noom account below to get started.`\n : partnerInfo?.configs?.HIDE_COST\n ? enrollmentBlurb\n : `Join Noom at no cost to you! ${enrollmentBlurb}`;\n\n return (\n \n {employerSlug ? : }\n \n );\n};\n","import { format } from \"date-fns\";\nimport React, { useEffect, useState } from \"react\";\nimport { Trans, useTranslation } from \"react-i18next\";\nimport { useLocation, useNavigate } from \"react-router-dom\";\n\nimport { Spacing, Stack } from \"@noom/wax-component-library\";\n\nimport {\n CreateAccountForm,\n CreateAccountFormValues,\n defaultInitialValues as defaultCreateAccountFormValues,\n} from \"@/components/forms\";\nimport {\n defaultEligibilityCheckFormValues,\n EligibilityCheckForm,\n EligibilityCheckFormValues,\n} from \"@/components/forms/EligibilityCheckForm\";\nimport { NoomEmailAddressLink } from \"@/components/noom-branding\";\nimport {\n CREATE_ACCOUNT_QUESTION_ID,\n ELIGIBILITY_CHECK_QUESTION_ID,\n} from \"@/components/survey/questionTypes/dpp-triage\";\nimport { DOB_FORMAT, ErrorState } from \"@/constants\";\nimport {\n ACCOLADE_PARTNER_ID,\n EXTERNAL_COACH_PARTNER_ID,\n NOOM_TEST_PARTNER_ID,\n PENDULUM_PARTNER_ID,\n} from \"@/constants/Partners\";\nimport { useAppContext } from \"@/contexts\";\nimport {\n EligibilityResult,\n useAnswerSurveyQuestion,\n useEligibility,\n useGoto,\n useQueryParams,\n useTrackEvent,\n} from \"@/hooks\";\nimport { EligibilityReason, getDisplayName } from \"@/models\";\nimport { isCareFirstPartner } from \"@/utils/partners\";\nimport { withPiiQueryParams } from \"@/utils/pixels/urlParamsPii\";\n\nimport { BaseSideForm } from \"./BaseSideForm\";\n\n// TriageLandingForm acts as a standalone question (outside of a survey)\ndeclare module \"@/contexts\" {\n interface SurveyAnswers {\n createAccount?: CreateAccountFormValues;\n eligibilityCheck?: EligibilityCheckFormValues;\n }\n}\n\nexport const TriageLandingForm: React.FC = () => {\n const { answerSurveyQuestion } = useAnswerSurveyQuestion();\n const {\n eligibilityInfo,\n enrollmentInfo: { customSupportEmail, upfrontEligibilityEnforcement } = {},\n partnerInfo,\n surveyAnswers,\n } = useAppContext();\n const { email, firstName } = eligibilityInfo || {};\n const createAccountSurveyAnswer: CreateAccountFormValues = surveyAnswers[\n CREATE_ACCOUNT_QUESTION_ID\n ] as CreateAccountFormValues;\n const [createAccountFormInitialValues] = useState(\n createAccountSurveyAnswer && Object.keys(createAccountSurveyAnswer).length\n ? createAccountSurveyAnswer\n : {\n ...defaultCreateAccountFormValues,\n email: (upfrontEligibilityEnforcement === \"EMAIL\" && email) || \"\",\n },\n );\n const eligibilityCheckSurveyAnswer = surveyAnswers[\n ELIGIBILITY_CHECK_QUESTION_ID\n ] as EligibilityCheckFormValues;\n const [\n eligibilityCheckFormInitialValues,\n setEligibilityCheckFormInitialValues,\n ] = useState(\n eligibilityCheckSurveyAnswer || defaultEligibilityCheckFormValues,\n );\n\n const { checkEligibility, redirectToParticipantPartner } = useEligibility();\n const goto = useGoto();\n const { search } = useLocation();\n const navigate = useNavigate();\n const queryParams = useQueryParams();\n const [localEligibilityResult, setLocalEligibilityResult] = useState<\n EligibilityResult | undefined\n >();\n const [\n submittedEligibilityCheckFormValues,\n setSubmittedEligibilityCheckFormValues,\n ] = useState();\n const [isEligibilityCheckLoading, setIsEligibilityCheckLoading] =\n useState(false);\n const { trackAnonEvent, trackAnonPageViewed } = useTrackEvent();\n const { t } = useTranslation();\n\n const partnerId = partnerInfo?.id;\n const { eligibilityId, sharedEligibility } = queryParams;\n\n const getEligibilityResult = async (values: EligibilityCheckFormValues) => {\n if (!partnerId) {\n return;\n }\n\n try {\n setIsEligibilityCheckLoading(true);\n const eligibilityResult = await checkEligibility(\n {\n dateOfBirth: values?.dob\n ? format(values.dob as Date, DOB_FORMAT)\n : undefined,\n firstName: values.firstName,\n lastName: values.lastName,\n participantId: values?.employeeId,\n policyId: values?.policyId,\n },\n partnerId,\n queryParams.leadSource,\n );\n setLocalEligibilityResult(eligibilityResult);\n } finally {\n setIsEligibilityCheckLoading(false);\n }\n };\n\n const onSubmitEligibilityCheckForm = async (\n values: EligibilityCheckFormValues,\n ) => {\n if (!localEligibilityResult) {\n return;\n }\n\n const {\n isEligible,\n isMedEligible,\n eligibilityReason,\n participantEligibilityId,\n participantPartnerId,\n upid,\n } = localEligibilityResult;\n\n try {\n setIsEligibilityCheckLoading(true);\n await answerSurveyQuestion(ELIGIBILITY_CHECK_QUESTION_ID, {\n ...values,\n isMedEligible,\n });\n } finally {\n setIsEligibilityCheckLoading(false);\n }\n\n if (!isEligible) {\n // Some eligibility reasons already trigger navigation via the checkEligibility call.\n // If the eligibility reason isn't one of those specifically handled, just show the generic FAILED_ELIGIBILITY_CHECK error state\n if (\n ![\n EligibilityReason.EXISTING_ACCOUNT,\n EligibilityReason.PRIOR_TO_EFFECTIVE_DATE,\n EligibilityReason.API_ERROR,\n EligibilityReason.MULTIPLE_MATCHES,\n ].some((checkedReason) => checkedReason === eligibilityReason)\n ) {\n goto.error(ErrorState.FAILED_ELIGIBILITY_CHECK);\n }\n return;\n }\n\n if (partnerId !== participantPartnerId) {\n redirectToParticipantPartner(\n participantEligibilityId,\n participantPartnerId,\n upid,\n );\n } else {\n navigate({\n pathname: \"/enrollment\",\n search,\n });\n }\n };\n\n const handleCreateAccountFormSubmit = async (\n values: CreateAccountFormValues,\n ) => {\n // save responses for both eligibility check and create account questions.\n await answerSurveyQuestion(CREATE_ACCOUNT_QUESTION_ID, values, {\n [ELIGIBILITY_CHECK_QUESTION_ID]: eligibilityInfo,\n });\n\n navigate({\n pathname: \"/enrollment\",\n search,\n });\n };\n\n useEffect(() => {\n const queryParamsWithPii = withPiiQueryParams(queryParams);\n trackAnonEvent(\"b2bEnrollmentAnonTriageFlowStarted\", {\n leadSource:\n eligibilityId && sharedEligibility !== \"true\"\n ? \"sso\"\n : queryParamsWithPii.leadSource,\n utmSource: queryParamsWithPii.utm_source,\n utmMedium: queryParamsWithPii.utm_medium,\n utmCampaign: queryParamsWithPii.utm_campaign,\n utmTerm: queryParamsWithPii.utm_term,\n utmContent: queryParamsWithPii.utm_content,\n });\n trackAnonPageViewed(\n eligibilityId\n ? CREATE_ACCOUNT_QUESTION_ID\n : ELIGIBILITY_CHECK_QUESTION_ID,\n );\n }, []);\n\n // Call getEligibilityResult after the form values are set in local state\n useEffect(() => {\n if (!submittedEligibilityCheckFormValues) {\n return;\n }\n getEligibilityResult(submittedEligibilityCheckFormValues);\n }, [submittedEligibilityCheckFormValues]);\n\n // Only call onSubmitEligibilityCheckForm after eligibilityInfo has been\n // evaluated and updated in app state through the checkEligibility call.\n useEffect(() => {\n if (\n !(\n eligibilityInfo &&\n localEligibilityResult &&\n submittedEligibilityCheckFormValues\n )\n ) {\n return;\n }\n onSubmitEligibilityCheckForm(submittedEligibilityCheckFormValues);\n }, [\n eligibilityInfo,\n localEligibilityResult,\n submittedEligibilityCheckFormValues,\n ]);\n\n /**\n * https://noomhq.atlassian.net/browse/B2B-2231\n *\n * We are not allowed to mention Accolade by name only for the Accolade\n * top-level partner.\n */\n const partnerName =\n partnerId === ACCOLADE_PARTNER_ID\n ? \"your employer\"\n : getDisplayName(partnerInfo);\n\n const hideNoomCostMention = partnerInfo?.configs?.HIDE_COST || false;\n\n let headerText = \"Welcome to Noom.\";\n const benefitText =\n `Noom is a ${ \n !hideNoomCostMention ? \"free \" : \"\" \n }benefit through ${partnerName}.`;\n let helperText =\n `${benefitText \n } Please enter your details below to confirm your eligibility.`;\n\n if (eligibilityId) {\n headerText = `Welcome, ${firstName}! Noom is ${\n !hideNoomCostMention ? \"free for you\" : \"a benefit\"\n } through ${partnerName}.`;\n helperText =\n \"Create your account below to get started. Remember these credentials - you'll use them to log into our app.\";\n } else if (isCareFirstPartner(partnerInfo)) {\n headerText = `Noom is free for eligible ${partnerName} members.`;\n helperText =\n \"Members must be age 18+ and have coverage via an employer health plan. Enter your details below to confirm your eligibility.\";\n } else if (\n partnerId === PENDULUM_PARTNER_ID ||\n partnerId === NOOM_TEST_PARTNER_ID\n ) {\n helperText =\n \"Let's finish up setting up your Noom subscription purchased through Pendulum.\";\n } else if (partnerId === EXTERNAL_COACH_PARTNER_ID) {\n helperText =\n \"Let's finish setting up your complimentary Noom subscription from your Noom Mindset Coach program.\";\n } else if (upfrontEligibilityEnforcement === \"NONE\") {\n helperText = `${benefitText } Enter your details below to get started.`;\n }\n\n return (\n \n \n {!eligibilityId ? (\n \n setSubmittedEligibilityCheckFormValues({ ...values })\n }\n initialValues={eligibilityCheckFormInitialValues}\n setInitialValues={setEligibilityCheckFormInitialValues}\n isLoading={isEligibilityCheckLoading}\n />\n ) : (\n \n )}\n
\n \n Have a question? Drop us a line at\n {NoomEmailAddressLink}\n \n
\n
\n
\n );\n};\n","import React, { useEffect } from \"react\";\nimport { useParams } from \"react-router-dom\";\n\nimport { B2BEnrollmentEnumsProto_EntryPoint } from \"@noom/noom-contracts/noom_contracts/events/web/b2b/shared\";\n\nimport { useQueryParams, useTrackEvent } from \"@/hooks\";\nimport { EnrollmentInformation } from \"@/models\";\n\nimport { TriageLandingForm } from \"./TriageLandingForm\";\n\ntype EntryFormProps = {\n enrollmentInfo: EnrollmentInformation;\n upid: string;\n};\n\nexport const EntryForm: React.FC = ({\n enrollmentInfo,\n upid,\n}) => {\n const { employerSlug } = useParams();\n const { eligibilityId, sharedEligibility } = useQueryParams();\n const { trackIdentifiedEvent } = useTrackEvent();\n\n useEffect(() => {\n let entryPoint: B2BEnrollmentEnumsProto_EntryPoint =\n \"ENTRY_POINT_UNSPECIFIED\";\n\n if (eligibilityId && sharedEligibility !== \"true\") {\n entryPoint = \"SSO\";\n } else if (employerSlug) {\n entryPoint = \"PASSCODE\";\n } else {\n entryPoint = \"UPID\";\n }\n\n trackIdentifiedEvent(\"b2bEnrollmentIdentifiedEnrollmentFlowStarted\", {\n entryPoint,\n });\n }, [employerSlug, upid]);\n\n return ;\n};\n","import React, { useEffect } from \"react\";\nimport { isBrowser } from \"react-device-detect\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { Image } from \"@noom/wax-component-library\";\n\nimport { ContinueToDownloadButton, FullscreenMessage } from \"@/components\";\nimport { useTrackEvent } from \"@/hooks\";\n\nexport const PostEnrollmentRefreshView: React.FC = () => {\n const { trackIdentifiedPageViewed } = useTrackEvent();\n const { t } = useTranslation();\n\n useEffect(() => {\n trackIdentifiedPageViewed(\"postEnrollmentRefresh\");\n }, []);\n\n return (\n }\n heading={t(\"success.postEnrollmentRefresh.heading\")}\n message={t(\"success.postEnrollmentRefresh.message\", {\n context: isBrowser ? \"desktop\" : \"mobile\",\n })}\n visual={\"\"}\n />\n );\n};\n","import { format } from \"date-fns\";\nimport Cookies from \"js-cookie\";\nimport React, { useEffect, useState } from \"react\";\nimport { useLocation, useNavigate, useParams } from \"react-router-dom\";\n\nimport { Api } from \"@noom/noomscape\";\nimport { Box, CompassColor, Loader } from \"@noom/wax-component-library\";\n\nimport { ResponseData as UpidValidationData } from \"@/api/account/validateUpid\";\nimport WelcomeToNoomAnimation from \"@/components/WelcomeToNoomAnimation\";\nimport {\n CREATE_ACCOUNT_QUESTION_ID,\n ELIGIBILITY_CHECK_QUESTION_ID,\n} from \"@/components/survey/questionTypes/dpp-triage\";\nimport { DOB_FORMAT, ErrorState, ResultType } from \"@/constants\";\nimport { useAppContext } from \"@/contexts\";\nimport {\n EligibilityResult,\n useAnswerSurveyQuestion,\n useEligibility,\n useGoto,\n usePartnerInfo,\n useQueryParams,\n useSubmitPasscode,\n useTrackEvent,\n} from \"@/hooks\";\nimport {\n EligibilityExtras,\n EligibilityInfo,\n EligibilityResponse,\n EnrollmentInformation,\n getDisplayName,\n} from \"@/models\";\nimport { getSurveyAnswersFromCookie } from \"@/utils/cookies\";\nimport { parseEligibilityFileDate } from \"@/utils/eligibility\";\nimport { captureException, captureMessage } from \"@/utils/sentry\";\nimport { isBuyflowTraffic } from \"@/utils/userSegment\";\n\nimport { EnrollmentStaticContent } from \"./EnrollmentStaticContent\";\nimport { CodeInputForm } from \"./code-input/CodeInputForm\";\nimport { EntryForm } from \"./enrollment/EntryForm\";\nimport { PostEnrollmentRefreshView } from \"./success/PostEnrollmentRefreshView\";\n\nasync function validateUpid(upid: string) {\n const validationData: UpidValidationData = await Api.call(\n \"account.validateUpid\",\n Api.api.account.validateUpid,\n {\n upid,\n },\n );\n\n return validationData;\n}\n\nasync function getEnrollmentInformation(upid: string) {\n const enrollmentInformation: EnrollmentInformation = await Api.call(\n \"upid.getEnrollmentInformation\",\n Api.api.upid.getEnrollmentInformation,\n {\n upid,\n },\n );\n\n return enrollmentInformation;\n}\n\nexport const ReskinView: React.FC = () => {\n const { answerSurveyQuestion } = useAnswerSurveyQuestion();\n const {\n eligibilityInfo,\n enrollmentInfo,\n selectedProgram,\n setEligibilityInfo,\n setEnrollmentInfo,\n setEnrollmentType,\n setErrorState,\n setHasB2cAccount,\n } = useAppContext();\n const { partnerInfo } = usePartnerInfo();\n const { checkEligibility, fetchEligibilityInfo } = useEligibility();\n const goto = useGoto();\n const { search } = useLocation();\n const navigate = useNavigate();\n const { employerSlug } = useParams();\n const [eligibilityResponse, setEligibilityResponse] =\n useState();\n const [hasAlreadyEnrolled, setHasAlreadyEnrolled] = useState(false);\n // Used for storing the result from the check eligibility API and triggers\n // effects off it needed for storing triage data based on eligibility info\n const [localEligibilityResult, setLocalEligibilityResult] = useState<\n EligibilityResult | undefined\n >();\n const [ssoAnimationDone, setSsoAnimationDone] = useState(false);\n const submitPasscode = useSubmitPasscode();\n const { trackAnonEvent, trackIdentifiedEvent } = useTrackEvent();\n\n const {\n eligibilityId,\n leadSource,\n passcode,\n pwResetRedirect,\n sharedEligibility,\n upid: rawUpid,\n } = useQueryParams();\n const upid = rawUpid ?? \"\";\n\n const surveyAnswersFromCookie = getSurveyAnswersFromCookie();\n const [checkingSurveyAnswerCookie, setCheckingSurveyAnswerCookie] = useState(\n !!(surveyAnswersFromCookie && pwResetRedirect === \"true\"),\n );\n\n const isLoading =\n !!(upid || passcode) &&\n !(enrollmentInfo && partnerInfo && !(eligibilityId && !eligibilityInfo));\n\n const hideNoomCostMention = partnerInfo?.configs?.HIDE_COST ?? true;\n\n const validateUpidAndGetEnrollmentInfo = async () => {\n if (Cookies.get(\"lastEnrolledUpid\")?.toLowerCase() === upid) {\n setHasAlreadyEnrolled(true);\n return;\n }\n\n if (partnerInfo?.goLiveDate && partnerInfo.goLiveDate > new Date()) {\n goto.error(ErrorState.BEFORE_GOLIVE_DATE);\n return;\n }\n\n try {\n const [validationData, enrollmentInformation] = await Promise.all([\n validateUpid(upid),\n getEnrollmentInformation(upid),\n ]);\n\n setEnrollmentInfo(enrollmentInformation);\n\n if (!validationData.available) {\n const errorStateMap = {\n ERROR_ACTIVATION_CODE_CLAIMED: ErrorState.CODE_CLAIMED,\n ERROR_ACTIVATION_CODE_DOESNT_EXIST: ErrorState.DEFAULT,\n ERROR_BATCH_FULL: ErrorState.BATCH_FULL,\n ERROR_PAST_CONTRACT_END_DATE: ErrorState.PAST_CONTRACT_END_DATE,\n };\n\n const resultTypeMap = {\n ERROR_ACTIVATION_CODE_CLAIMED: ResultType.CODE_CLAIMED,\n ERROR_ACTIVATION_CODE_DOESNT_EXIST: ResultType.ERROR,\n ERROR_BATCH_FULL: ResultType.BATCH_FULL,\n ERROR_PAST_CONTRACT_END_DATE: ResultType.PAST_CONTRACT_END_DATE,\n };\n\n const errorState = validationData.requestError\n ? errorStateMap[validationData.requestError] || ErrorState.DEFAULT\n : ErrorState.DEFAULT;\n\n const resultType = validationData.requestError\n ? resultTypeMap[validationData.requestError] || ResultType.ERROR\n : ResultType.ERROR;\n\n trackIdentifiedEvent(\"b2bEnrollmentIdentifiedSignupSubmitted\", {\n b2bProgram: selectedProgram || \"PROGRAM_UNSPECIFIED\",\n b2bSignupResult: resultType,\n b2cTransitionedAccount: false,\n coursePacks: [],\n freeAccountExists: false,\n upid,\n });\n\n trackAnonEvent(\"b2bEnrollmentAnonSignupSubmitted\", {\n b2bProgram: selectedProgram || \"PROGRAM_UNSPECIFIED\",\n b2bSignupResult: resultType,\n b2cTransitionedAccount: false,\n coursePacks: [],\n freeAccountExists: false,\n });\n\n setErrorState(errorState);\n navigate(\"/error\");\n }\n } catch (e) {\n captureException(e);\n setErrorState(ErrorState.DEFAULT);\n navigate(\"/error\");\n }\n };\n\n useEffect(() => {\n setEnrollmentType(\"INITIAL_ENROLLMENT\");\n }, []);\n\n useEffect(() => {\n if (!partnerInfo || !upid) {\n return;\n }\n\n validateUpidAndGetEnrollmentInfo();\n }, [partnerInfo, upid]);\n\n useEffect(() => {\n if (passcode && employerSlug) {\n submitPasscode(passcode, \"AUTOFILLED\").catch(() => {\n const qs = new URLSearchParams(search);\n qs.delete(\"passcode\");\n navigate(`/employer/${employerSlug}?${qs.toString()}`);\n });\n }\n }, [passcode, employerSlug]);\n\n useEffect(() => {\n if (!isBuyflowTraffic()) {\n return;\n }\n\n if (eligibilityInfo) {\n answerSurveyQuestion(\n ELIGIBILITY_CHECK_QUESTION_ID,\n eligibilityInfo,\n {},\n true,\n );\n }\n\n if (!isLoading) {\n navigate(\n {\n pathname: \"/enrollment\",\n search,\n },\n { replace: true },\n );\n }\n }, [enrollmentInfo, partnerInfo, eligibilityInfo]);\n\n useEffect(() => {\n if (eligibilityId && enrollmentInfo?.partnerId && !eligibilityInfo) {\n fetchEligibilityInfo(eligibilityId, enrollmentInfo.partnerId).then(\n (res: EligibilityResponse) => setEligibilityResponse(res),\n );\n }\n }, [eligibilityId, enrollmentInfo]);\n\n useEffect(() => {\n if (eligibilityId && !upid) {\n setErrorState(ErrorState.DEFAULT);\n navigate(\"/error\");\n }\n }, [eligibilityId, upid]);\n\n const handleEligibilityResponse = () => {\n if (eligibilityResponse) {\n const {\n accessCode,\n dateOfBirth,\n effectiveDate: effectiveDateString,\n eligible,\n email,\n participantId,\n firstName,\n lastName,\n medEligible,\n extras: extrasProto,\n segmentId,\n segmentName,\n } = eligibilityResponse;\n if (!eligible && accessCode) {\n setErrorState(ErrorState.SSO_ACCOUNT_EXISTS);\n return navigate(\"/error\");\n }\n if (!eligible) {\n setErrorState(ErrorState.SSO_INELIGIBLE);\n return navigate(\"/error\");\n }\n\n if (!(dateOfBirth && firstName && lastName)) {\n setErrorState(ErrorState.DEFAULT);\n return navigate(\"/error\");\n }\n\n let extras: EligibilityExtras = {};\n if (extrasProto) {\n const { address: addressProto, ...passThroughExtras } = extrasProto;\n extras = { ...passThroughExtras };\n if (addressProto) {\n extras.address = {\n country: addressProto.country || \"\",\n region: addressProto.region || \"\",\n city: addressProto.city || \"\",\n address1: addressProto.addressLine1 || \"\",\n address2: addressProto.addressLine2 || \"\",\n zipcode: addressProto.zipcode || \"\",\n };\n }\n }\n\n setEligibilityInfo({\n email,\n firstName,\n lastName,\n dob: parseEligibilityFileDate(dateOfBirth),\n effectiveDate: parseEligibilityFileDate(effectiveDateString),\n employeeId: participantId,\n isMedEligible: medEligible,\n segmentId,\n segmentName,\n ...extras,\n });\n }\n };\n\n useEffect(() => {\n if (sharedEligibility === \"true\") {\n handleEligibilityResponse();\n }\n }, [eligibilityResponse, sharedEligibility]);\n\n useEffect(() => {\n if (\n !(checkingSurveyAnswerCookie && surveyAnswersFromCookie && partnerInfo)\n ) {\n return;\n }\n\n const wrappedCheckEligibility = async () => {\n const { eligibilityCheck } = surveyAnswersFromCookie;\n const eligibilityResult = await checkEligibility(\n {\n dateOfBirth: eligibilityCheck?.dob\n ? format(eligibilityCheck.dob, DOB_FORMAT)\n : undefined,\n firstName: eligibilityCheck?.firstName,\n lastName: eligibilityCheck?.lastName,\n participantId: eligibilityCheck?.employeeId,\n policyId: eligibilityCheck?.policyId,\n },\n partnerInfo.id,\n leadSource,\n );\n\n setLocalEligibilityResult(eligibilityResult);\n };\n\n wrappedCheckEligibility();\n }, [partnerInfo]);\n\n const maybeNavigateToExistingPasswordQuestion = async () => {\n if (!(localEligibilityResult && surveyAnswersFromCookie)) {\n return;\n }\n\n const { eligibilityInfo: freshEligibilityInfo, isEligible } =\n localEligibilityResult;\n\n // If the user is ineligible for some reason show them the landing page\n // (rather than immediately sending them to an error page)\n if (!isEligible) {\n captureMessage(\"User redirected from password reset is ineligible\");\n setCheckingSurveyAnswerCookie(false);\n return;\n }\n const { createAccount, eligibilityCheck } = surveyAnswersFromCookie;\n\n // Delete any undefined values from the fresh eligibility info before using it to update the eligibility check survey answer.\n // This is necessary in the event the user provided info not present in the eligibility info from the backend\n // or the partner doesn't use upfront eligibility checking and we didn't match a user from an eligibility file.\n Object.keys(freshEligibilityInfo).forEach(\n (key) =>\n freshEligibilityInfo[key as keyof EligibilityInfo] === undefined &&\n delete freshEligibilityInfo[key as keyof EligibilityInfo],\n );\n\n await answerSurveyQuestion(\n ELIGIBILITY_CHECK_QUESTION_ID,\n {\n ...eligibilityCheck,\n ...freshEligibilityInfo,\n },\n { [CREATE_ACCOUNT_QUESTION_ID]: createAccount },\n true,\n );\n\n setHasB2cAccount(true);\n navigate(\n {\n pathname: \"/enrollment/existingPassword\",\n search,\n },\n { replace: true, state: { resetOnOpen: false } },\n );\n };\n\n // Only call maybeNavigateToExistingPasswordQuestion after eligibilityInfo\n // has been evaluated and updated in app state through the checkEligibility\n // call.\n useEffect(() => {\n if (!(eligibilityInfo && localEligibilityResult)) {\n return;\n }\n maybeNavigateToExistingPasswordQuestion();\n }, [eligibilityInfo, localEligibilityResult]);\n\n if (hasAlreadyEnrolled) {\n return ;\n }\n\n // if we don't have a passcode or upid for some reason, the user should see the\n // CodeInputForm and the rest of the landing page content.\n // Also using !(enrollmentInfo && partnerInfo) rather than isLoading as isLoading isn't reliable due to it being\n // mutated in multiple async actions.\n if ((isLoading && isBuyflowTraffic()) || checkingSurveyAnswerCookie) {\n return (\n \n \n \n );\n }\n\n if (\n eligibilityId &&\n sharedEligibility !== \"true\" &&\n !ssoAnimationDone &&\n !eligibilityInfo\n ) {\n return (\n {\n handleEligibilityResponse();\n setSsoAnimationDone(true);\n }}\n isEligible={Boolean(\n eligibilityResponse?.eligible &&\n eligibilityResponse?.dateOfBirth &&\n eligibilityResponse?.firstName &&\n eligibilityResponse?.lastName,\n )}\n />\n );\n }\n\n const renderFormContent = () => {\n if (isLoading) {\n return (\n \n \n \n );\n }\n\n if (!upid) {\n return ;\n }\n\n if (enrollmentInfo) {\n return ;\n }\n\n return null;\n };\n\n return (\n \n \n \n \n \n \n \n \n {renderFormContent()}\n \n \n \n );\n};\n\nexport default ReskinView;\n","import React from \"react\";\nimport { isBrowser } from \"react-device-detect\";\nimport { Trans, useTranslation } from \"react-i18next\";\n\nimport {\n Box,\n CompassColor,\n Heading,\n Image,\n Spacing,\n Stack,\n Text,\n useMediaQuery,\n} from \"@noom/wax-component-library\";\n\nimport { ContinueToDownloadButton } from \"@/components\";\nimport {\n NoomEmailAddressLink,\n NoomHeader,\n NoomVirtualAssistantLink,\n} from \"@/components/noom-branding\";\nimport { EnrollmentSuccessType } from \"@/constants\";\nimport { useAppContext } from \"@/contexts\";\nimport { isB2CPartner } from \"@/utils/partners\";\n\ntype DownloadStep = {\n description: string;\n stepNumber: number;\n};\n\ntype ListMarkerProps = {\n stepNumber: number;\n};\n\ntype Texts = {\n downloadSteps: DownloadStep[];\n headline: string;\n success?: string;\n};\n\nconst ListMarker = ({ stepNumber }: ListMarkerProps) => (\n \n \n {stepNumber}\n \n \n);\n\nexport const DownloadView: React.FC<{\n enrollmentSuccessType: EnrollmentSuccessType;\n}> = ({ enrollmentSuccessType }) => {\n const { userData, partnerInfo } = useAppContext();\n const [showDesktopStyle] = useMediaQuery(\"(min-width: 1160px)\");\n const { t } = useTranslation();\n\n const { email } = userData || {};\n\n const enrollmentSuccessTypeTextMap: Record = {\n [EnrollmentSuccessType.TRANSITIONED]: {\n headline: t(\"success.download.heading.transitioned\"),\n downloadSteps: [\n {\n description: t(\"success.download.downloadSteps.step1.transitioned\"),\n stepNumber: 1,\n },\n {\n description: t(\"success.download.downloadSteps.step2.transitioned\"),\n stepNumber: 2,\n },\n {\n description: t(\"success.download.downloadSteps.step3.transitioned\"),\n stepNumber: 3,\n },\n ],\n },\n [EnrollmentSuccessType.CREATED]: {\n headline: t(\"success.download.heading.created\"),\n downloadSteps: [\n {\n description: t(\"success.download.downloadSteps.step1.created\", {\n context: isBrowser ? \"desktop\" : \"mobile\",\n }),\n stepNumber: 1,\n },\n {\n description: t(\"success.download.downloadSteps.step2.created\"),\n stepNumber: 2,\n },\n {\n description: t(\"success.download.downloadSteps.step3.created\", {\n context: email ? \"hasEmail\" : undefined,\n email,\n }),\n stepNumber: 3,\n },\n ],\n success: t(\"success.download.success\"),\n },\n [EnrollmentSuccessType.UPGRADED]: {\n headline: t(\"success.download.heading.created\"),\n downloadSteps: [\n {\n description: t(\"success.download.downloadSteps.step1.created\", {\n context: isBrowser ? \"desktop\" : \"mobile\",\n }),\n stepNumber: 1,\n },\n {\n description: t(\"success.download.downloadSteps.step2.created\"),\n stepNumber: 2,\n },\n {\n description: t(\"success.download.downloadSteps.step3.created\", {\n context: email ? \"hasEmail\" : undefined,\n email,\n }),\n stepNumber: 3,\n },\n ],\n success: t(\"success.download.success\"),\n },\n };\n\n const textsForEnrollmentSuccessType =\n enrollmentSuccessTypeTextMap[enrollmentSuccessType];\n\n return (\n \n \n \n \n {showDesktopStyle && (\n \n )}\n \n \n {textsForEnrollmentSuccessType.success && (\n \n \"\"\n {textsForEnrollmentSuccessType.success}\n \n )}\n \n {textsForEnrollmentSuccessType.headline}\n \n \n {textsForEnrollmentSuccessType.downloadSteps.map(\n ({ description, stepNumber }) => (\n \n \n \n {description}\n \n \n ),\n )}\n \n {enrollmentSuccessType !== EnrollmentSuccessType.TRANSITIONED &&\n (isBrowser ? (\n \n \n {t(\"success.download.dontSeeText.header\")}\n \n \n {t(\"success.download.dontSeeText.description\", {\n context: email ? \"hasEmail\" : undefined,\n email,\n })}\n \n \n ) : (\n \n ))}\n \n {isB2CPartner(partnerInfo) ? (\n \n Have a question? Drop us a line\n here\n \n ) : (\n \n Have a question? Drop us a line at\n {NoomEmailAddressLink}\n
\n )}\n \n {!showDesktopStyle && (\n \n )}\n \n \n \n );\n};\n","import React, { useEffect, useState } from \"react\";\nimport { useTranslation } from \"react-i18next\";\n\nimport {\n Box,\n CompassColor,\n CompassLoader,\n Heading,\n Stack,\n useMediaQuery,\n} from \"@noom/wax-component-library\";\n\nimport { ConfettiBox } from \"@/components/ConfettiBox\";\nimport { NoomHeader } from \"@/components/noom-branding\";\nimport { EnrollmentSuccessType, ProgramOffering } from \"@/constants\";\n\ntype ProgressViewProps = {\n setIsDoneShowingProgress: React.Dispatch>;\n selectedProgram: ProgramOffering | null;\n enrollmentSuccessType: EnrollmentSuccessType;\n};\n\ntype ProgressTexts = {\n inProgress: string;\n complete: string;\n};\n\nexport const ProgressView: React.FC = ({\n setIsDoneShowingProgress,\n selectedProgram,\n enrollmentSuccessType,\n}) => {\n const [isBrowser] = useMediaQuery(\"(min-width: 1160px)\");\n const [isDoneSpinning, setIsDoneSpinning] = useState(false);\n const { t } = useTranslation();\n\n const enrollmentSuccessTypeProgressTextsMap: Record<\n EnrollmentSuccessType,\n ProgressTexts\n > = {\n [EnrollmentSuccessType.TRANSITIONED]: {\n inProgress: t(\"success.progress.inProgress.transitioned\"),\n complete: t(\"success.progress.complete.transitioned\"),\n },\n [EnrollmentSuccessType.CREATED]: {\n inProgress: t(\"success.progress.inProgress.created\"),\n complete: t(\"success.progress.complete.created\"),\n },\n [EnrollmentSuccessType.UPGRADED]: {\n inProgress: t(\"success.progress.inProgress.created\"),\n complete: t(\"success.progress.complete.created\"),\n },\n };\n\n const texts = enrollmentSuccessTypeProgressTextsMap[enrollmentSuccessType];\n const inProgressText = texts.inProgress;\n const completeText =\n selectedProgram === \"MED\"\n ? t(\"success.progress.complete.med\")\n : texts.complete;\n\n useEffect(() => {\n // The default CompassLoader finishes spinning in 2.5s.\n // The setTimeout for 3.75s will allow it to spin for 1.5 rotations.\n window.setTimeout(() => setIsDoneSpinning(true), 3750);\n }, []);\n\n useEffect(() => {\n if (!isDoneSpinning) {\n return;\n }\n\n // This will display the confetti gif for 3s after the loader has finished\n // spinning before proceeding to the Download screen.\n window.setTimeout(() => setIsDoneShowingProgress(true), 3000);\n }, [isDoneSpinning]);\n\n return (\n \n {isBrowser && }\n \n {isDoneSpinning && selectedProgram !== \"MED\" ? (\n \n ) : (\n \n \n \n )}\n \n {!isDoneSpinning ? inProgressText : completeText}\n \n \n \n );\n};\n","import React, { useEffect, useState } from \"react\";\nimport { useLocation } from \"react-router-dom\";\n\nimport { B2BEnrollmentEnumsProto_AccountType } from \"@noom/noom-contracts/noom_contracts/events/web/b2b/shared\";\n\nimport { EnrollmentSuccessType } from \"@/constants\";\nimport { useAppContext } from \"@/contexts\";\nimport { useGoto, useTrackEvent } from \"@/hooks\";\nimport { clearAnalyticsCookies } from \"@/hooks/useAnalyticsIds\";\n\nimport { DownloadView } from \"./DownloadView\";\nimport { ProgressView } from \"./ProgressView\";\n\nexport const SuccessView: React.FC = () => {\n const { b2bIdentifiedUserId, selectedProgram } = useAppContext();\n const { search } = useLocation();\n const [isDoneShowingProgress, setIsDoneShowingProgress] = useState(false);\n const { trackIdentifiedEvent } = useTrackEvent();\n const goto = useGoto();\n\n const type =\n (new URLSearchParams(search).get(\"type\") as EnrollmentSuccessType) ||\n EnrollmentSuccessType.CREATED;\n\n useEffect(() => {\n // Clear analytics cookies after successful enrollment\n // to avoid data issues if the session is re-used by different users.\n clearAnalyticsCookies();\n }, []);\n\n useEffect(() => {\n const accountTypeMap: Record<\n EnrollmentSuccessType,\n B2BEnrollmentEnumsProto_AccountType\n > = {\n [EnrollmentSuccessType.CREATED]: \"CREATED\",\n [EnrollmentSuccessType.TRANSITIONED]: \"TRANSITIONED\",\n [EnrollmentSuccessType.UPGRADED]: \"UPGRADED\",\n };\n\n trackIdentifiedEvent(\"b2bEnrollmentIdentifiedSuccessPageViewed\", {\n accountType: accountTypeMap[type],\n });\n }, [type]);\n\n useEffect(() => {\n if (selectedProgram === \"MED\" && isDoneShowingProgress) {\n goto.medIntake(b2bIdentifiedUserId);\n }\n }, [isDoneShowingProgress]);\n\n return isDoneShowingProgress && selectedProgram !== \"MED\" ? (\n \n ) : (\n \n );\n};\n","import React, { useEffect } from \"react\";\nimport { useLocation, useNavigate } from \"react-router-dom\";\n\nimport { Api } from \"@noom/noomscape\";\n\nimport { PartnerRedirectUrl } from \"@/api/partner/getPartnerRedirect\";\nimport { VirginPulseGenerateUpidResponseError } from \"@/api/upid/getVirginPulse\";\nimport { ErrorState } from \"@/constants\";\nimport { useAppContext } from \"@/contexts\";\nimport { captureException, captureMessage } from \"@/utils/sentry\";\n\nimport { AxiosError } from \"axios\";\n\nconst DEFAULT_STATE = \"vp-7Nf7uAwTcKrs9WFRk5ZD\";\nconst REDIRECT_PATH_SUFFIX =\n \"/protocol/openid-connect/auth?client_id=pif-noom&client_secret=77f50d80-b2f3-4b95-9fcb-6992ee1c78fd&scope=events%20offline_access&state=:state&response_type=code&redirect_uri=:callbackURL\";\n\nfunction buildCallbackUrl(partnerId: number) {\n return `${window.location.protocol}//${window.location.host}${window.location.pathname}?partnerId=${partnerId}`;\n}\n\nasync function buildVpLoginUrl(\n partnerId: number,\n url: PartnerRedirectUrl | undefined,\n state: string = DEFAULT_STATE,\n) {\n const partnerRedirect = await Api.call(\n \"partner.getPartnerRedirect\",\n Api.api.partner.getPartnerRedirect,\n {\n partnerId,\n url,\n },\n );\n\n if (!partnerRedirect) {\n return null;\n }\n\n return (\n partnerRedirect +\n REDIRECT_PATH_SUFFIX.replace(\n \":callbackURL\",\n encodeURIComponent(buildCallbackUrl(partnerId)),\n ).replace(\":state\", encodeURIComponent(state))\n );\n}\n\nexport const VirginPulseRedirect: React.FC<{\n redirectType: PartnerRedirectUrl;\n}> = ({ redirectType }) => {\n const { setErrorState, setMaskedEmail, partnerInfo } = useAppContext();\n const navigate = useNavigate();\n const { search } = useLocation();\n const queryParams = new URLSearchParams(search);\n\n const code = queryParams.get(\"code\");\n const state = queryParams.get(\"state\");\n const callbackError = queryParams.get(\"error\");\n const partnerId = Number(queryParams.get(\"partnerId\")); // this comes in when we get the callback from Personify Health - partnerInfo will be empty\n\n const handleAuthorizationCodeValidation = async (\n authorizationCode: string,\n ) => {\n try {\n if (Number.isNaN(partnerId)) {\n captureMessage(\n `Partner id \"${partnerId}\" from queryParams is not a number`,\n );\n // there should always be a partner id in the query parameters we get back from VP\n setErrorState(ErrorState.DEFAULT);\n navigate(\"/error\");\n return;\n }\n const { upid } = await Api.call(\n \"upid.getVirginPulse\",\n Api.api.upid.getVirginPulse,\n {\n authorizationCode,\n partnerId,\n redirectUri: buildCallbackUrl(partnerId),\n },\n );\n\n if (!upid) {\n throw new Error(\"Missing UPID\");\n }\n\n const qs = new URLSearchParams({ upid });\n navigate({\n pathname: \"/\",\n search: qs.toString(),\n });\n } catch (e: unknown) {\n const userAlreadyAssigned = (e as AxiosError)?.response?.status === 409;\n\n if (userAlreadyAssigned) {\n const maskedEmail =\n (e as AxiosError)?.response\n ?.data?.email || \"\";\n setMaskedEmail(maskedEmail);\n setErrorState(ErrorState.EXISTING_VIRGIN_PULSE_USER);\n } else {\n captureException(e);\n setErrorState(ErrorState.DEFAULT);\n }\n\n navigate(\"/error\");\n }\n };\n\n useEffect(() => {\n if (callbackError) {\n captureMessage(\n `Received error callback from Personify Health portal: ${callbackError}`,\n \"error\",\n );\n navigate(\"/error\");\n } else if (code) {\n handleAuthorizationCodeValidation(code);\n } else {\n const doNavigate = async () => {\n // We may not have partnerInfo if the user just navigated straight to /virgin-pulse.\n // Use 0 for the partnerId and the backend will return the legacy VP login URI\n const pId = partnerInfo?.id ?? 0;\n const url = await buildVpLoginUrl(\n pId,\n pId === 0 ? redirectType : undefined,\n );\n if (url) {\n window.location.replace(url);\n } else {\n captureMessage(\n `Failed to get personify health redirect url for partner ${pId}`,\n \"error\",\n );\n navigate(\"/error\");\n }\n };\n doNavigate();\n }\n }, [code, state, callbackError]);\n\n return null;\n};\n","import { CompassColor } from \"@noom/wax-component-library\";\n\nimport { defaultFieldStyles } from \"../defaultFieldStyles\";\n\nexport const Button = {\n defaultProps: {\n size: \"xl\",\n variant: \"solid\",\n },\n sizes: {\n xl: {\n borderRadius: \"4px\",\n fontSize: \"lg\",\n maxWidth: \"400px\",\n width: \"100%\",\n },\n },\n variants: {\n // This is a hacky way of implementing the \"tertiary button\" in the\n // Noom Design System, which is not supported by WAX\n outline: {\n ...defaultFieldStyles,\n backgroundColor: \"unset\",\n borderColor: CompassColor.black,\n borderRadius: \"4px\",\n cursor: \"pointer\",\n _active: {\n backgroundColor: \"unset\",\n borderWidth: \"1.5px\",\n color: CompassColor.black,\n },\n _hover: {\n backgroundColor: \"unset\",\n borderColor: CompassColor.grey3,\n color: CompassColor.grey3,\n },\n },\n },\n};\n","import { defaultFieldStyles } from \"../defaultFieldStyles\";\n\nexport const Input = {\n defaultProps: {\n size: \"lg\",\n variant: \"outline\",\n },\n variants: {\n outline: {\n field: {\n ...defaultFieldStyles,\n },\n },\n },\n};\n","import { CompassColor } from \"@noom/wax-component-library\";\n\nimport { defaultFieldStyles } from \"../defaultFieldStyles\";\n\nexport const Select = {\n defaultProps: {\n size: \"lg\",\n variant: \"filled\",\n },\n variants: {\n filled: {\n field: {\n ...defaultFieldStyles,\n backgroundColor: CompassColor.offWhite,\n borderColor: CompassColor.offWhite,\n cursor: \"pointer\",\n _focus: {\n borderColor: CompassColor.gold,\n },\n _hover: {\n backgroundColor: CompassColor.sand01,\n borderColor: CompassColor.sand01,\n },\n },\n },\n },\n};\n","import { CompassColor, extendCompassTheme } from \"@noom/wax-component-library\";\n\nimport { Button, Input, Select } from \"./components\";\n\nexport const reskinTheme = extendCompassTheme({\n breakpoints: {\n sm: \"503px\",\n md: \"768px\",\n lg: \"1160px\",\n xl: \"1440px\",\n \"2xl\": \"1820px\",\n },\n colors: {\n error: {\n 500: CompassColor.cinnamon,\n },\n },\n components: {\n Button,\n FormLabel: {\n baseStyle: {\n fontWeight: 400,\n },\n },\n Input,\n Select,\n },\n styles: {\n global: {\n body: {\n color: CompassColor.black,\n },\n a: {\n // Denim Compass color\n color: \"#2457C5\",\n },\n },\n },\n});\n","/**\n * Top level component\n *\n * Copyright (C) 2020A Noom, Inc.\n * @author nikola\n */\n\nimport React, { Suspense, useEffect } from \"react\";\nimport { BrowserRouter, Route, Routes, Navigate } from \"react-router-dom\";\n\nimport { LoaderView, ThemeProvider } from \"@noom/wax-component-library\";\n\nimport { RetriageFinished } from \"@/components/survey/questionTypes/retriage\";\nimport { useTrackEvent } from \"@/hooks\";\nimport { bootstrapConsent } from \"@/utils/consent\";\nimport { initializeGlobalVendorScripts } from \"@/utils/vendors\";\nimport { DeeplinkView } from \"@/views/DeeplinkView\";\nimport { DevView } from \"@/views/DevView\";\nimport { DoNotShareView } from \"@/views/DoNotShareView\";\nimport { DppTriageView } from \"@/views/DppTriageView\";\nimport { NotFoundView } from \"@/views/NotFoundView\";\nimport { RecurringOutcomesView } from \"@/views/RecurringOutcomesView\";\nimport { RetriageAuthView } from \"@/views/RetriageAuthView\";\nimport { RetriageView } from \"@/views/RetriageView\";\nimport { TransitionView } from \"@/views/TransitionView\";\nimport { ErrorView } from \"@/views/error\";\nimport { ReskinView } from \"@/views/reskin\";\nimport { SuccessView } from \"@/views/reskin/success/SuccessView\";\nimport { VirginPulseRedirect } from \"@/views/reskin/virgin-pulse/VirginPulseRedirect\";\n\nimport { init as init18n } from \"./i18n\";\nimport { reskinTheme } from \"./themes/reskin/theme\";\n\ninit18n();\n\nconst AppInitializer = ({ children }: { children: React.ReactNode }) => {\n const { trackIdentifiedEvent } = useTrackEvent();\n\n useEffect(() => {\n bootstrapConsent(trackIdentifiedEvent).then(() => {\n // Need to wait for consent to be reset as prior consent may not match new consent\n initializeGlobalVendorScripts();\n });\n }, []);\n // eslint-disable-next-line react/jsx-no-useless-fragment\n return <>{children};\n};\n\nconst App: React.FC = () => (\n \n \n \n }>\n \n } />\n } />\n \n }\n />\n {/* The /enroll route was used in a previous version of the app\n See: https://noom.slack.com/archives/C039LQPS6KZ/p1673385869755929 */}\n } />\n } />\n } />\n }\n />\n }\n />\n } />\n }\n />\n } />\n } />\n } />\n }\n />\n } />\n } />\n } />\n } />\n \n \n \n \n \n);\n\nexport default App;\n","/**\n * Endpoint for creating an account\n *\n * Copyright (C) 2020A Noom, Inc.\n * @author nikola\n */\n\n\nimport { Api } from \"@noom/noomscape\";\n\nimport { User } from \"@/models\";\n\nimport axios from \"axios\";\n\nexport type ResponseData = {\n accessCode: string;\n wasCreated: boolean;\n businessType: string;\n pricingType: string;\n credentialsType: \"EMAIL_AND_PASSWORD\" | \"FACEBOOK\" | \"GOOGLE\";\n};\n\nexport type AccountErrorResponse = {\n message: string;\n};\n\n/*\n Request to create account through local coachserver:\n {\n url: \"/users/create\",\n urlWithPathParams: \"/users/create\",\n baseURL: \"http://localhost:9090/servlets\",\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n \"Authorization\": \"Bearer \",\n },\n*/\n\nApi.register(\n \"account.create\",\n async ({ upid, userData }: { upid: string; userData: User }) => {\n const response = await axios({\n url: \"/account/users\",\n urlWithPathParams: \"/account/users\",\n baseURL: window.ENV.PRODUCT_API_URL,\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n data: { ...userData, upid },\n });\n\n return response.data;\n },\n);\n","import { Api } from \"@noom/noomscape\";\n\nimport axios, { AxiosResponse } from \"axios\";\n\n\ntype CreateLoginTokenRequest = {\n email: string;\n password: string;\n};\n\nexport type CreateLoginTokenResponse = {\n access_token: string;\n accessCode: string;\n accountEmail: string;\n};\n\nApi.register(\n \"account.createLoginToken\",\n async ({ email, password }: CreateLoginTokenRequest) => {\n const response: AxiosResponse = await axios({\n baseURL: window.ENV.SERVER_URL,\n data: {\n client_id: \"noom-coach\",\n grant_type: \"password\",\n request: JSON.stringify({\n credentials: password,\n mode: \"LOGIN\",\n principal: email,\n type: \"EMAIL_AND_PASSWORD\",\n }),\n },\n headers: {\n \"Content-Type\": \"application/x-www-form-urlencoded\",\n },\n method: \"POST\",\n url: \"/oauth/token\",\n urlWithPathParams: \"/oauth/token\",\n });\n\n return response.data;\n },\n);\n","/**\n * Endpoint for enrolling a B2B user in Med program\n */\n\n\nimport { Api } from \"@noom/noomscape\";\n\nimport { MedEnrollmentData } from \"@/models\";\n\nimport axios from \"axios\";\n\nApi.register(\n \"account.enrollMed\",\n async ({ medEnrollmentData }: { medEnrollmentData: MedEnrollmentData }) =>\n axios({\n url: `/telehealth/${medEnrollmentData.accessCode}:enrollB2bUser?notifySupportOnFail=true`,\n urlWithPathParams: \"/telehealth/{accessCode}:enrollB2bUser\",\n baseURL: window.ENV.SERVER_URL,\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n data: medEnrollmentData,\n }),\n);\n","import type {\n GetB2bEmailAvailabilityInformationRequestProto_Body,\n GetB2bEmailAvailabilityInformationResponseProto,\n} from \"@noom/noom-contracts/noom_contracts/backend/enrollment/b2b/enrollment_information\";\nimport { Api } from \"@noom/noomscape\";\n\nimport axios from \"axios\";\n\nApi.register(\n \"account.getB2bEmailAvailabilityInformation\",\n async (\n data: GetB2bEmailAvailabilityInformationRequestProto_Body,\n ): Promise => {\n const response = await axios({\n data,\n baseURL: window.ENV.SERVER_URL,\n method: \"POST\",\n url: \"/b2b-enrollment/getB2bEmailAvailabilityInformation\",\n urlWithPathParams: \"/b2b-enrollment/getB2bEmailAvailabilityInformation\",\n });\n\n return response.data;\n },\n);\n","\nimport type {\n GetUserPolicyOptionsV3RequestProto,\n GetUserPolicyOptionsV3ResponseProto,\n} from \"@noom/noom-contracts/noom_contracts/backend/privacy/user_policy_options\";\nimport { Api } from \"@noom/noomscape\";\n\nimport axios from \"axios\";\n\nApi.register(\n \"account.getConsent\",\n async (\n data: GetUserPolicyOptionsV3RequestProto,\n ): Promise => {\n const response = await axios({\n baseURL: window.ENV.SERVER_URL,\n data,\n method: \"POST\",\n url: \"/userData/v3/consent/get\",\n urlWithPathParams: \"/userData/v3/consent/get\",\n });\n\n return response.data;\n },\n);\n","\nimport { Api } from \"@noom/noomscape\";\n\nimport { User } from \"@/models\";\n\nimport axios from \"axios\";\n\nexport type MigrateToB2BErrorResponse = {\n email: string;\n};\n\nApi.register(\n \"account.migrateToB2B\",\n async ({ upid, userData }: { upid: string; userData: User }) => {\n const response = await axios({\n url: \"/users/migrateToB2B\",\n urlWithPathParams: \"/users/migrateToB2B\",\n baseURL: window.ENV.SERVER_URL,\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n data: { ...userData, upid },\n });\n\n return response.data;\n },\n);\n","/**\n * Endpoint for trigger a password reset email to be sent\n */\n\nimport { Api } from \"@noom/noomscape\";\n\nimport axios from \"axios\";\n\n\nApi.register(\n \"account.passwordResets\",\n ({\n email,\n postResetRedirectUrl,\n }: {\n email: string;\n postResetRedirectUrl: string;\n }) =>\n axios({\n url: \"/account/passwordResets\",\n urlWithPathParams: \"/account/passwordResets\",\n baseURL: window.ENV.PRODUCT_API_URL,\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n data: {\n email,\n postResetRedirectUrl,\n // Without these properties the endpoint will error despite them being made NO-OP do to security vulnerability.\n // TODO: remove once account lambda no longer requires them in the payload.\n from: \"NO-OP\",\n resetUrl: \"NO-OP\",\n },\n }),\n);\n","\nimport type {\n PostUserPolicyOptionsV3RequestProto_Body,\n PostUserPolicyOptionsV3ResponseProto,\n} from \"@noom/noom-contracts/noom_contracts/backend/privacy/user_policy_options\";\nimport { Api } from \"@noom/noomscape\";\n\nimport axios from \"axios\";\n\nApi.register(\n \"account.submitConsent\",\n async (\n data: PostUserPolicyOptionsV3RequestProto_Body,\n ): Promise => {\n const response = await axios({\n baseURL: window.ENV.SERVER_URL,\n data,\n method: \"POST\",\n url: \"/userData/v3/consent/create\",\n urlWithPathParams: \"/userData/v3/consent/create\",\n });\n\n return response.data;\n },\n);\n","/**\n * Endpoint for validating the upid\n *\n * Copyright (C) 2020A Noom, Inc.\n * @author nikola\n */\n\nimport { Api } from \"@noom/noomscape\";\n\nimport axios from \"axios\";\n\n\nexport type ResponseData = {\n activationCode: string;\n available: boolean;\n requestError?:\n | \"ERROR_ACTIVATION_CODE_CLAIMED\"\n | \"ERROR_ACTIVATION_CODE_DOESNT_EXIST\"\n | \"ERROR_BATCH_FULL\"\n | \"ERROR_PAST_CONTRACT_END_DATE\";\n};\n\nApi.register(\"account.validateUpid\", async ({ upid }: { upid: string }) => {\n const response = await axios({\n url: `/account/upid/${upid}/validate`,\n urlWithPathParams: \"/account/upid/{upid}/validate\",\n baseURL: window.ENV.PRODUCT_API_URL,\n method: \"GET\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n });\n\n return response.data as ResponseData;\n});\n","/**\n * Endpoint for validating address\n *\n * Copyright (C) 2022 Noom, Inc.\n * @author eric\n */\n\n\nimport { Api } from \"@noom/noomscape\";\n\nimport { Address } from \"@/models\";\n\nimport axios from \"axios\";\n\nApi.register(\"address.validate\", async ({ address }: { address: Address }) => {\n const response = await axios({\n url: \"/billing/v2/billingAddress:validate\",\n urlWithPathParams: \"/billing/v2/billingAddress:validate\",\n baseURL: window.ENV.SERVER_URL,\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n data: {\n // CoachServer expects an address to be passed under \"billingAddress\"\n billingAddress: address,\n },\n });\n\n return response.data as Address;\n});\n","import { Api } from \"@noom/noomscape\";\n\nimport axios from \"axios\";\n\n\ntype AlertUserCoachRequest = {\n accessCode: string;\n};\n\nApi.register(\n \"dpp.alertUserCoach\",\n async ({ accessCode }: AlertUserCoachRequest) => {\n await axios({\n baseURL: window.ENV.SERVER_URL,\n headers: {\n \"Content-Type\": \"application/json\",\n },\n method: \"POST\",\n url: `dpp/v1/alertUserCoach/${accessCode}`,\n urlWithPathParams: \"dpp/v1/alertUserCoach/{accessCode}\",\n });\n },\n);\n","import { DppTriageProto_CompletionStatus } from \"@noom/noom-contracts/noom_contracts/healthcare/dpp_triage\";\nimport { Api } from \"@noom/noomscape\";\n\nimport axios, { AxiosResponse } from \"axios\";\n\ntype DppTriageRequest = {\n completionStatus: DppTriageProto_CompletionStatus;\n partnerId?: number | undefined;\n participantId?: string | undefined;\n resourceKey?: string | undefined;\n survey: Record;\n};\n\ntype DppTriageResponse = {\n key: string;\n};\n\nApi.register(\n \"dpp.saveTriageData\",\n async ({\n completionStatus,\n participantId,\n partnerId,\n resourceKey,\n survey,\n }: DppTriageRequest) => {\n const response: AxiosResponse = await axios({\n baseURL: window.ENV.SERVER_URL,\n data: {\n completionStatus,\n participantId,\n partnerId,\n resourceKey,\n survey,\n },\n headers: {\n \"Content-Type\": \"application/json\",\n },\n method: \"POST\",\n url: \"/dpp/v1/triage\",\n urlWithPathParams: \"/dpp/v1/triage\",\n });\n\n return response.data;\n },\n);\n","import {\n TriageResultProto_Value\n} from \"@noom/noom-contracts/noom_contracts/backend/dpp/dpp_service\";\nimport { Api } from \"@noom/noomscape\";\n\nimport axios from \"axios\";\n\n\nexport type UpdateLastTriageTimestampRequest = {\n accessCode: string;\n newLastTriageTimestamp: string;\n triageResult: TriageResultProto_Value;\n wasOfferedDpp: boolean;\n wasOfferedMed: boolean;\n};\n\nApi.register(\n \"dpp.updateLastTriageTimestamp\",\n (requestBody: UpdateLastTriageTimestampRequest) =>\n axios({\n baseURL: window.ENV.SERVER_URL,\n data: requestBody,\n headers: {\n \"Content-Type\": \"application/json\",\n },\n method: \"POST\",\n url: \"/dpp/v1/updateLastTriageTimestamp\",\n urlWithPathParams: \"/dpp/v1/updateLastTriageTimestamp\",\n }),\n);\n","\nimport {\n GetOutcomesUserProfileRequestProto,\n GetOutcomesUserProfileResponseProto,\n} from \"@noom/noom-contracts/noom_contracts/backend/outcomes/service/outcomes_service\";\nimport { Api } from \"@noom/noomscape\";\n\nimport axios, { AxiosResponse } from \"axios\";\n\nApi.register(\n \"outcomes.getUserProfile\",\n async ({\n accessCode,\n accessToken,\n }: GetOutcomesUserProfileRequestProto & { accessToken: string }) => {\n const response: AxiosResponse =\n await axios({\n baseURL: window.ENV.SERVER_URL,\n headers: {\n Authorization: `Bearer ${accessToken}`,\n \"Content-Type\": \"application/json\",\n },\n method: \"GET\",\n url: `/outcomes/v1/userprofiles/${accessCode}`,\n urlWithPathParams: \"/outcomes/v1/userprofiles/{accessCode}\",\n });\n\n return response.data;\n },\n);\n","/**\n * Endpoint for storing outcome question responses\n */\n\n\nimport { StoreOutcomesSurveyRequestProto_StoreOutcomesSurveyRequestBodyProto } from \"@noom/noom-contracts/noom_contracts/backend/outcomes/service/outcomes_service\";\nimport { DynamicSurveyCompletedProto_SurveyCompleted_SurveyAnswer } from \"@noom/noom-contracts/noom_contracts/events/app/dynamic_survey/dynamic_survey_completed\";\nimport { Api } from \"@noom/noomscape\";\n\nimport axios from \"axios\";\n\nApi.register(\n \"outcomes.store\",\n ({\n accessCode,\n accessToken,\n surveyAnswers,\n surveyId,\n surveyExperienceSlug,\n }: {\n accessCode: string;\n accessToken: string;\n surveyAnswers: DynamicSurveyCompletedProto_SurveyCompleted_SurveyAnswer[];\n surveyId: string;\n surveyExperienceSlug: string;\n }) => {\n const data: StoreOutcomesSurveyRequestProto_StoreOutcomesSurveyRequestBodyProto =\n {\n survey: {\n surveysCompleted: [\n {\n surveyId,\n surveyExperienceSlug,\n surveyAnswers,\n },\n ],\n },\n };\n return axios({\n url: `/outcomes/v1/outcomes/${accessCode}`,\n urlWithPathParams: \"/outcomes/v1/outcomes/{accessCode}\",\n baseURL: window.ENV.SERVER_URL,\n method: \"POST\",\n headers: {\n Authorization: `Bearer ${accessToken}`,\n \"Content-Type\": \"application/json\",\n },\n data,\n });\n },\n);\n","import { parse } from \"date-fns\";\n\nimport { CheckEligibilityRequestProto_Body } from \"@noom/noom-contracts/noom_contracts/backend/partner/service/partner_eligibility_service\";\nimport { Api } from \"@noom/noomscape\";\n\nimport { DOB_FORMAT } from \"@/constants\";\nimport {\n EligibilityResponse,\n EligibilityVerificationProperties,\n} from \"@/models\";\n\nimport axios from \"axios\";\n\nfunction generateRequestBody(\n properties: EligibilityVerificationProperties,\n partnerId: number,\n leadSource?: string,\n): CheckEligibilityRequestProto_Body {\n const { dateOfBirth, ...params } = properties;\n const body: CheckEligibilityRequestProto_Body = {\n ...params,\n partnerId,\n leadSource,\n };\n if (dateOfBirth) {\n const dob = parse(dateOfBirth, DOB_FORMAT, new Date());\n body.dateOfBirth = {\n year: dob.getFullYear(),\n month: dob.getMonth() + 1,\n day: dob.getDate(),\n };\n }\n return body;\n}\n\nApi.register(\n \"partner.checkEligibility\",\n async ({\n eligibilityVerificationProperties,\n leadSource,\n partnerId,\n }: {\n eligibilityVerificationProperties: EligibilityVerificationProperties;\n leadSource?: string;\n partnerId: number;\n }) => {\n const response = await axios({\n url: \"/partners/checkEligibility\",\n urlWithPathParams: \"/partners/checkEligibility\",\n baseURL: window.ENV.SERVER_URL,\n data: generateRequestBody(\n eligibilityVerificationProperties,\n partnerId,\n leadSource,\n ),\n method: \"POST\",\n });\n\n return response.data as EligibilityResponse;\n },\n);\n","\nimport { Api } from \"@noom/noomscape\";\n\nimport { Partner } from \"@/models\";\n\nimport axios from \"axios\";\n\ntype RequestParams = {\n slug: string;\n};\n\nApi.register(\"partner.getPartnerBySlug\", async ({ slug }: RequestParams) => {\n const response = await axios({\n baseURL: window.ENV.SERVER_URL,\n method: \"GET\",\n params: {\n slug,\n },\n url: \"/partners/v1/getBySlug\",\n urlWithPathParams: \"/partners/v1/getBySlug\",\n });\n const partnerInfo: Partner = response.data;\n if (partnerInfo.goLiveDate) {\n partnerInfo.goLiveDate = new Date(partnerInfo.goLiveDate);\n }\n return partnerInfo;\n});\n","\nimport { Api } from \"@noom/noomscape\";\n\nimport { Partner } from \"@/models\";\n\nimport axios from \"axios\";\n\ntype RequestParams = {\n upid: string;\n};\n\nApi.register(\"partner.getPartnerByUpid\", async ({ upid }: RequestParams) => {\n const response = await axios({\n baseURL: window.ENV.SERVER_URL,\n method: \"GET\",\n params: {\n upid,\n },\n url: \"/partners/v1/getByUpid\",\n urlWithPathParams: \"/partners/v1/getByUpid\",\n });\n const partnerInfo: Partner = response.data;\n if (partnerInfo.goLiveDate) {\n partnerInfo.goLiveDate = new Date(partnerInfo.goLiveDate);\n }\n return partnerInfo;\n});\n","import { Api } from \"@noom/noomscape\";\n\nimport axios from \"axios\";\n\nexport type PartnerRedirectUrl = \"personify-health\" | \"virgin-pulse\";\ntype RequestParams = {\n partnerId: number;\n url?: PartnerRedirectUrl;\n};\n\nApi.register(\n \"partner.getPartnerRedirect\",\n async ({ partnerId, url }: RequestParams) => {\n const response = await axios({\n baseURL: window.ENV.SERVER_URL,\n method: \"GET\",\n url: `/personifyhealth/v3/partners/${partnerId}/redirect`,\n urlWithPathParams: \"/personifyhealth/v3/partners/{partner_id}/redirect\",\n params: { url },\n });\n if (response.status !== 200) {\n return null;\n }\n return response.data.redirectUri;\n },\n);\n","import {\n RetriageEligibilityByEligibilityInfoRequestProto_Body,\n RetriageEligibilityForAccessCodeRequestProto,\n RetriageEligibilityResponseProto,\n} from \"@noom/noom-contracts/noom_contracts/backend/partner/service/partner_eligibility_service\";\nimport { Api } from \"@noom/noomscape\";\n\nimport axios from \"axios\";\n\nApi.register(\n \"partner.retriageEligibilityByEligibilityInfo\",\n async (data: RetriageEligibilityByEligibilityInfoRequestProto_Body) => {\n const response = await axios({\n baseURL: window.ENV.SERVER_URL,\n data,\n method: \"POST\",\n url: \"/partners/retriageEligibility\",\n urlWithPathParams: \"/partners/retriageEligibility\",\n });\n\n return response.data as RetriageEligibilityResponseProto;\n },\n);\n\nApi.register(\n \"partner.retriageEligibilityForAccessCode\",\n async ({\n accessCode,\n accessToken,\n }: RetriageEligibilityForAccessCodeRequestProto & {\n accessToken: string;\n }) => {\n const response = await axios({\n baseURL: window.ENV.SERVER_URL,\n headers: {\n Authorization: `Bearer ${accessToken}`,\n },\n method: \"GET\",\n url: `/partners/retriageEligibility/${accessCode}`,\n urlWithPathParams: \"/partners/retriageEligibility/{accessCode}\",\n });\n\n return response.data as RetriageEligibilityResponseProto;\n },\n);\n","import { MigrateUserRequestProto_Body } from \"@noom/noom-contracts/noom_contracts/backend/retriage/retriage_service\";\nimport { Api } from \"@noom/noomscape\";\n\nimport axios from \"axios\";\n\nApi.register(\n \"retriage.migrateUser\",\n async (request: MigrateUserRequestProto_Body) => {\n await axios({\n url: \"/retriage/migrateUser\",\n urlWithPathParams: \"/retriage/migrateUser\",\n baseURL: window.ENV.SERVER_URL,\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n data: request,\n });\n },\n);\n","\nimport type {\n GetTelehealthEligibleStatesResponseProto,\n TelehealthUserProgramEnumProto_Value,\n} from \"@noom/noom-contracts/noom_contracts/healthcare/eligible_states_service\";\nimport { Api } from \"@noom/noomscape\";\n\nimport axios, { AxiosResponse } from \"axios\";\n\nApi.register(\"telehealth.getEligibleTelehealthStates\", async () => {\n const telehealthUserProgramValue: TelehealthUserProgramEnumProto_Value =\n \"B2B\";\n\n const response: AxiosResponse =\n await axios({\n baseURL: window.ENV.GROWTH_API_DOMAIN,\n params: {\n telehealthUserProgram: telehealthUserProgramValue,\n },\n method: \"GET\",\n url: \"/api/insurance/v1/eligibility/eligible_states/\",\n urlWithPathParams: \"/api/insurance/v1/eligibility/eligible_states/\",\n });\n\n return response.data;\n});\n","/**\n * Endpoint for getting an upid for a given batch\n *\n * Copyright (C) 2020C Noom, Inc.\n * @author Hubert\n */\n\nimport { Api } from \"@noom/noomscape\";\n\nimport axios from \"axios\";\n\nApi.register(\n \"upid.getEnrollmentInformation\",\n async ({ upid }: { upid: string }) => {\n const response = await axios({\n url: `/programs/upid/${upid}:getEnrollmentInformation`,\n urlWithPathParams: \"/programs/upid/{upid}:getEnrollmentInformation\",\n baseURL: window.ENV.SERVER_URL,\n method: \"GET\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n });\n\n return response.data;\n },\n);\n","/**\n * Endpoint for getting an upid for a given passcode\n *\n * Copyright (C) 2021 Noom, Inc.\n * @author eric\n */\n\nimport { Api } from \"@noom/noomscape\";\n\nimport axios from \"axios\";\n\nApi.register(\n \"upid.getPasscode\",\n async ({\n partnerSlug,\n passcode,\n }: {\n partnerSlug: string;\n passcode: string;\n }) => {\n const response = await axios({\n url: `/batches/-/batchPasscodes/${passcode}:generateUpidForPartner`,\n urlWithPathParams:\n \"/batches/-/batchPasscodes/{passcode}:generateUpidForPartner\",\n baseURL: window.ENV.SERVER_URL,\n method: \"POST\",\n params: { partnerSlug },\n headers: {\n \"Content-Type\": \"application/json\",\n },\n });\n\n return response.data as string;\n },\n);\n","/**\n * Endpoint for getting an upid for a given Virgin Pulse / Personify Health authorization code\n */\n\nimport { Api } from \"@noom/noomscape\";\n\nimport axios from \"axios\";\n\nexport type VirginPulseGenerateUpidResponseError = {\n email: string;\n};\n\nApi.register(\n \"upid.getVirginPulse\",\n async ({\n authorizationCode,\n partnerId,\n redirectUri,\n }: {\n authorizationCode: string;\n partnerId?: number;\n redirectUri: string;\n }) => {\n const response = await axios({\n url: \"/virginpulse/v1/users:generateUpid\",\n urlWithPathParams: \"/virginpulse/v1/users:generateUpid\",\n baseURL: window.ENV.SERVER_URL,\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n data: {\n authorizationCode,\n partnerId,\n redirectUri,\n },\n });\n\n return response.data as string;\n },\n);\n","/**\n * Endpoint for updating the curriculum associated with a given upid\n *\n * Copyright (C) 2022 Noom, Inc.\n * @author eric\n */\n\n\nimport { Api } from \"@noom/noomscape\";\n\nimport { Curriculum } from \"@/constants\";\n\nimport axios from \"axios\";\n\nApi.register(\n \"upid.updateUpidCurriculumMapping\",\n async ({ upid, curriculum }: { upid: string; curriculum: Curriculum }) => {\n const response = await axios({\n url: `/programs/upid/${upid}:updateUpidCurriculumMapping`,\n urlWithPathParams: \"/programs/upid/{upid}:updateUpidCurriculumMapping\",\n baseURL: window.ENV.SERVER_URL,\n method: \"POST\",\n headers: {\n \"Content-Type\": \"text/plain\",\n },\n data: curriculum,\n });\n\n return response.data;\n },\n);\n","import { initializeSentry } from \"./sentry\";\n\nexport default function bootstrap() {\n // Init Sentry\n initializeSentry();\n}\n","/**\n * Main front end point of entry.\n *\n * Copyright (C) 2018D Noom, Inc.\n * @author hubert\n */\n\nimport React from \"react\";\nimport ReactDOM from \"react-dom\";\n\nimport App from \"@/app/App\";\nimport bootstrap from \"@/utils/bootstrap\";\n\nimport \"@/api/index\";\nimport { AppProvider } from \"./contexts/app-context\";\n\nbootstrap();\n\n// Render the app\nReactDOM.render(\n \n \n ,\n document.getElementById(\"root\"),\n);\n","import Cookies from \"js-cookie\";\n\nimport { NoomB2BEnrollmentIdentifiedEventProto } from \"@noom/noom-contracts/noom_contracts/events/web/b2b/enrollment_identified\";\n\nimport { OPT_OUT_STATES } from \"@/constants\";\nimport { bootstrapOneTrust } from \"@/utils/consent/one-trust\";\nimport { bootstrapOptOut, OPT_OUT_COOKIE_NAME } from \"@/utils/consent/opt-out\";\nimport { isEU } from \"@/utils/userSegment\";\nimport { loadOneTrust } from \"@/utils/vendors/onetrust\";\n\nexport enum LibCategories {\n strictlyNecessary = \"C0001\",\n performanceCookies = \"C0002\",\n functionalCookies = \"C0003\",\n targetingCookies = \"C0004\",\n socialMediaCookies = \"C0005\",\n}\n\nconst waiting = new Set<() => void>();\n\nconst CONSENT_KEY = \"noom_consent\";\nlet consent: LibCategories[] = (() => {\n try {\n return JSON.parse(localStorage.getItem(CONSENT_KEY) || \"\");\n } catch (err) {\n return undefined;\n }\n})();\n\n/** Which consent framework should be applied for a given user. */\nexport function consentFramework() {\n const country = window.OneTrust?.getGeolocationData?.().country || \"\";\n const state = window.OneTrust?.getGeolocationData?.().state || \"\";\n if (isEU(country)) {\n return \"gdpr\";\n }\n if (country === \"US\") {\n if (\n OPT_OUT_STATES.includes(state) ||\n // honor past opt-out cookie set even if the user is no longer in the affected\n // jurisdiction. does not cover the case where we need to check the submitted\n // email to determine opt-out status.\n Cookies.get(OPT_OUT_COOKIE_NAME) === \"true\"\n ) {\n return \"optOut\";\n }\n // cookie banner should be shown to all US users even if not in an opt-out state.\n return \"cookieBanner\";\n }\n\n return \"none\";\n}\n\n// eslint-disable-next-line no-underscore-dangle\nlet _trackingCallback: <\n T extends keyof Omit<\n NoomB2BEnrollmentIdentifiedEventProto,\n \"sharedProperties\"\n >,\n>(\n eventType: T,\n payload: NoomB2BEnrollmentIdentifiedEventProto[T],\n) => void;\n\nexport function setConsent(categories: LibCategories[]) {\n consent = categories;\n\n // Store consent in local storage for immediate init on future visits.\n // This lets us short-circuit lib loading once user has consented.\n try {\n localStorage.setItem(CONSENT_KEY, JSON.stringify(categories));\n } catch {\n // no-op, as this is a non-essential optimization\n }\n\n _trackingCallback?.(\"b2bEnrollmentIdentifiedConsentSet\", {\n categories,\n });\n\n waiting.forEach((waiter) => waiter());\n}\n\nlet consentLoader: Promise | undefined;\n\nexport async function bootstrapConsent(\n trackingCallback: typeof _trackingCallback,\n) {\n if (!_trackingCallback) {\n _trackingCallback = trackingCallback;\n }\n\n if (consentLoader) {\n return consentLoader;\n }\n\n await loadOneTrust();\n\n if (consentFramework() === \"optOut\") {\n consentLoader = bootstrapOptOut();\n } else if ([\"gdpr\", \"cookieBanner\"].includes(consentFramework())) {\n // cookie banner should be shown to all EU and US users, but we are keeping them\n // in separate frameworks in anticipation of future legal divergences.\n consentLoader = bootstrapOneTrust();\n } else {\n // No consent framework, grant implicit consent\n setConsent([\n LibCategories.strictlyNecessary,\n LibCategories.performanceCookies,\n LibCategories.functionalCookies,\n LibCategories.targetingCookies,\n LibCategories.socialMediaCookies,\n ]);\n consentLoader = Promise.resolve();\n }\n return consentLoader;\n}\n\nexport function getConsent(): readonly LibCategories[] {\n return consent;\n}\n\n/**\n * Checks if all of the given categories currently have consent.\n */\nexport function allowCategories(categories: LibCategories[]) {\n return categories\n .filter((category) => category !== LibCategories.strictlyNecessary)\n .every((category) => consent?.includes(category));\n}\n\nexport function waitForConsent(categories: LibCategories[]): Promise {\n return new Promise((resolve) => {\n if (allowCategories(categories)) {\n resolve();\n } else {\n waiting.add(function waiter() {\n if (allowCategories(categories)) {\n waiting.delete(waiter);\n resolve();\n }\n });\n }\n });\n}\n","import Cookies from \"js-cookie\";\n\nimport { loadOneTrust } from \"@/utils/vendors/onetrust\";\n\nimport { getConsent, LibCategories, setConsent } from \".\";\n\nconst localLoadTime = Date.now();\n\n// Create seedConsent function that sets the groups values in the OptanonConsent cookie,\n// per https://community.cookiepro.com/s/article/UUID-1e75fb0d-bb79-2af8-cb85-f905d16f1220?language=en_US\nexport function seedOneTrustConsent(consent: readonly LibCategories[]) {\n const seedConsent = consent.map((category) => `${category}:1`).join(\",\");\n\n Cookies.set(\"OptanonConsent\", `groups=${seedConsent}`, {\n path: \"/\",\n sameSite: \"Lax\",\n });\n}\n\nexport function bootstrapOneTrust() {\n return loadOneTrust().then(({ OneTrust, ActiveGroups }) => {\n try {\n const onetrustConsent = ActiveGroups?.split(/,/)\n ?.filter(Boolean)\n .sort() as LibCategories[];\n\n // Reset consent state to the one returned by OneTrust\n // Always do this to ensure that incorrect storage is cleared.\n if (ActiveGroups !== null) {\n setConsent(onetrustConsent);\n }\n } catch (err) {\n /* NOP */\n }\n\n // Keep consent list in sync on any future consent updates.\n OneTrust?.OnConsentChanged((event) => {\n setConsent(event.detail);\n });\n });\n}\n","import Cookies from \"js-cookie\";\n\nimport {\n GetUserPolicyOptionsV3RequestProto_Body,\n GetUserPolicyOptionsV3ResponseProto,\n PostUserPolicyOptionsV3ResponseProto,\n} from \"@noom/noom-contracts/noom_contracts/backend/privacy/user_policy_options\";\nimport { Api } from \"@noom/noomscape\";\n\nimport { applyLDUFlag } from \"@/utils/pixels/publishers/facebook\";\n\nimport { captureException } from \"../sentry\";\n\nimport { bootstrapOneTrust, seedOneTrustConsent } from \"./one-trust\";\n\nimport { consentFramework, getConsent, LibCategories, setConsent } from \".\";\n\nexport const OPT_OUT_COOKIE_NAME = \"ccpaOptOut\";\n\nasync function fetchConsentStatus(email: string) {\n const formattedEmail = email.trim().toLowerCase();\n const requestData: GetUserPolicyOptionsV3RequestProto_Body = {\n userIdentifier: {\n email: formattedEmail,\n },\n };\n const response: GetUserPolicyOptionsV3ResponseProto = await Api.call(\n \"account.getConsent\",\n Api.api.account.getConsent,\n requestData,\n );\n\n if (response.error) {\n throw new Error(response.error.message);\n }\n\n return response;\n}\n\nexport function optOutAllowsCookies() {\n return Cookies.get(OPT_OUT_COOKIE_NAME) === \"false\";\n}\n\nfunction applyOptOut() {\n // If not opted out, grant implicit full consent\n if (optOutAllowsCookies()) {\n setConsent([\n LibCategories.strictlyNecessary,\n LibCategories.performanceCookies,\n LibCategories.functionalCookies,\n LibCategories.targetingCookies,\n LibCategories.socialMediaCookies,\n ]);\n } else {\n setConsent([LibCategories.strictlyNecessary]);\n }\n}\n\nexport async function ensureCookie(email?: string) {\n const cookie = Cookies.get(OPT_OUT_COOKIE_NAME);\n // If the cookie is not set, attempt to determine from the server\n if (!cookie && email) {\n try {\n const consentState = await fetchConsentStatus(email);\n const optedOut = !!consentState.userPolicyOptions?.userPolicyOptions.some(\n (userPolicyOption) =>\n userPolicyOption.status === \"OPT_OUT_DO_NOT_SHARE\",\n );\n Cookies.set(OPT_OUT_COOKIE_NAME, optedOut ? \"true\" : \"false\");\n applyOptOut();\n } catch (err) {\n console.log(err);\n captureException(err);\n }\n } else {\n if (!cookie && !email) {\n // We need to set this to show that we've evaluated the opt out status\n // Cookies will only load when cookie is explicitly false\n Cookies.set(OPT_OUT_COOKIE_NAME, \"false\");\n }\n applyOptOut();\n }\n}\n\nexport async function setOptOutEmail(newEmail: string) {\n if (\n consentFramework() !== \"optOut\" ||\n // Don't reset if the session is opted out\n Cookies.get(OPT_OUT_COOKIE_NAME) === \"true\"\n ) {\n return;\n }\n\n Cookies.remove(OPT_OUT_COOKIE_NAME);\n setConsent([LibCategories.strictlyNecessary]);\n await ensureCookie(newEmail);\n}\n\nexport async function bootstrapOptOut() {\n ensureCookie();\n\n applyOptOut();\n\n seedOneTrustConsent(getConsent());\n await bootstrapOneTrust();\n}\n\nexport async function setOptOut(country: string, email: string, state: string) {\n const response: PostUserPolicyOptionsV3ResponseProto = await Api.call(\n \"account.submitConsent\",\n Api.api.account.submitConsent,\n {\n country,\n userIdentifier: {\n email,\n },\n status: \"OPT_OUT_DO_NOT_SHARE\",\n subdivision: state,\n },\n );\n\n if (response.error) {\n throw new Error(response.error.message);\n }\n\n Cookies.set(OPT_OUT_COOKIE_NAME, \"true\");\n\n // Set the LDU flag for the Facebook pixel.\n // Note that this is not considered compliant but we are\n // retaining as an extra layer of protection.\n applyLDUFlag();\n}\n","async function hash(algorithm: string, text: string): Promise {\n const buf = await window.crypto.subtle.digest(\n algorithm,\n new TextEncoder().encode(text),\n );\n return Array.prototype.map\n .call(new Uint8Array(buf), (x: number) => `00${x.toString(16)}`.slice(-2))\n .join(\"\");\n}\n\nexport async function toSha256(text: string): Promise {\n return text ? hash(\"SHA-256\", text) : \"\";\n}\n\nexport async function toSha512(text: string): Promise {\n return text ? hash(\"SHA-512\", text) : \"\";\n}\n\nexport async function toSha1(text: string): Promise {\n return text ? hash(\"SHA-1\", text) : \"\";\n}\n","import { LibCategories, waitForConsent } from \"@/utils/consent\";\nimport { toSha1, toSha256 } from \"@/utils/cryptography\";\nimport { initializePublishers } from \"@/utils/pixels/publishers\";\n\nimport {\n fireCallbackWithRetry,\n PIXEL_RETRY_DELAY_MS,\n PIXEL_RETRY_MAX_ATTEMPTS,\n} from \"./utils\";\n\nexport type PurchaseArgs = {\n email: string;\n eltv_25_months: number;\n erev_13_months: number;\n userId: string;\n};\n\ntype EmailHashes = {\n sha1: string;\n sha256: string;\n};\n\nexport type CleanPurchaseArgs = {\n emailHashes: EmailHashes;\n eltv_25_months: number;\n erev_13_months: number;\n userId: string;\n};\n\nexport type HandlerCallback = (args: T) => void;\n\nexport interface HandlerOptions {\n retry?: boolean;\n}\n\ntype incomingEvents = {\n purchase: PurchaseArgs;\n};\n\nconst cleanEvents = {\n purchase: [] as HandlerCallback[],\n};\n\nexport type EVENTS = keyof typeof cleanEvents;\n\nexport async function cleanProps(\n props: incomingEvents[T],\n): Promise[0]> {\n const result = { ...props } as any;\n // if (props === null || result === null) {\n // return null;\n // }\n\n if (props?.email) {\n result.emailHashes = {\n sha1: await toSha1(props.email),\n sha256: await toSha256(props.email),\n } as EmailHashes;\n delete result.email;\n }\n\n return result;\n}\n\nlet initGate: Promise;\n\n/**\n * Fire a conversion pixel event and pass in necessary props.\n * */\nexport async function firePixelEvent(\n event: T,\n props: incomingEvents[T],\n): Promise {\n const cleanedProps = await cleanProps(props);\n await initGate;\n\n const handlers = cleanEvents[event];\n const promises = handlers.map((handler) => handler(cleanedProps));\n\n await Promise.all(promises);\n}\n\n/**\n * Register a conversion pixel event handler.\n * */\nexport function registerHandler(\n event: T,\n callback: (typeof cleanEvents)[T][0],\n options: HandlerOptions = {},\n) {\n // Retry is on by default. Need to explicitly pass in false to turn off.\n const maxAttempts = options?.retry === false ? 1 : PIXEL_RETRY_MAX_ATTEMPTS;\n\n function wrappedCallback(\n args: Parameters[0],\n ): Promise {\n return fireCallbackWithRetry(\n callback,\n args,\n PIXEL_RETRY_DELAY_MS,\n maxAttempts,\n );\n }\n\n cleanEvents[event].push(wrappedCallback);\n}\n\n/**\n * Util for unit tests -- unlikely you would ever want to call this in production code\n */\nexport function clearAllHandlers() {\n Object.keys(cleanEvents).forEach((key) => {\n cleanEvents[key as EVENTS] = [];\n });\n}\n\nexport async function initializeHandlers() {\n if (initGate) {\n return initGate;\n }\n\n // Break into async loaded task. Doing this both to prioritize our own\n // code loading and to avoid circular dependencies within the pixels.\n initGate = waitForConsent([LibCategories.targetingCookies])\n .then(() => import(/* webpackChunkName: \"publishers\" */ \"./publishers\"))\n .then(() => {\n initializePublishers();\n });\n\n return initGate;\n}\n","\nimport { LibCategories, waitForConsent } from \"@/utils/consent\";\nimport {\n shouldApplyLDUFlag,\n FacebookPixelParameters,\n} from \"@/utils/pixels/publishers/facebook\";\n\nimport axios from \"axios\";\n\ntype ActionSource = \"website\" | \"email\";\ntype DataProcessingOption = \"LDU\";\n\ninterface FBCapiUserData {\n external_id?: string;\n email?: string;\n phone?: string;\n}\n\ninterface FBCapiCustomData {\n content_category?: string;\n content_ids?: string;\n content_type?: string;\n value?: number;\n currency?: string;\n order_id?: string;\n custom_properties?: Record;\n}\n\ninterface FBCapiEventData {\n event_id: string;\n event_name: string;\n event_source_url: string;\n pixel_id: string;\n action_source: ActionSource;\n user_data: FBCapiUserData;\n custom_data: FBCapiCustomData;\n\n data_processing_options?: DataProcessingOption[];\n data_processing_options_country?: number;\n data_processing_options_state?: number;\n opt_out?: boolean;\n\n // Used only for debugging/testing\n test_event_code?: string;\n}\n\ninterface FBCapiPayload extends FacebookPixelParameters {\n eventID: string;\n customProperties?: Record;\n email?: string;\n phone?: string;\n}\n\n/**\n * Extracts the value for testEventCode URL query param will be send further to the CAPI server\n * Only used for testing\n */\nfunction getTestEventCodeUrlParameter() {\n const urlParams = new URLSearchParams(window.location.search);\n const testEventCode = urlParams.get(\"testEventCode\");\n\n return testEventCode || null;\n}\n\nexport function fireFacebookCapi(\n pixelId: string,\n eventName: string,\n payload: FBCapiPayload,\n) {\n const userData: FBCapiUserData = {\n external_id: payload.external_id,\n email: payload.email,\n phone: payload.phone,\n };\n\n const customData: FBCapiCustomData = {\n value: payload.value,\n currency: payload.currency,\n custom_properties: payload.customProperties,\n };\n\n const eventData: FBCapiEventData = {\n event_id: payload.eventID,\n event_name: eventName,\n event_source_url: window.location.href,\n action_source: \"website\",\n user_data: userData,\n custom_data: customData,\n pixel_id: pixelId,\n };\n\n if (shouldApplyLDUFlag()) {\n Object.assign(eventData, {\n data_processing_options: [\"LDU\"],\n data_processing_options_country: 1,\n data_processing_options_state: 1000,\n opt_out: true,\n });\n }\n\n const testEventCode = getTestEventCodeUrlParameter();\n if (testEventCode) {\n Object.assign(eventData, {\n test_event_code: testEventCode,\n });\n }\n\n return waitForConsent([LibCategories.targetingCookies]).then(() =>\n axios({\n method: \"POST\",\n baseURL: window.ENV.GROWTH_API_DOMAIN,\n url: \"/pixel/v1/i/facebookCapiPixel/\",\n urlWithPathParams: \"/pixel/v1/i/facebookCapiPixel/\",\n data: eventData,\n }),\n );\n}\n","// March 2021: As a temporary solution we will adjust eLTV Value Passback to FB on the growth side.\n// Below we have the adjustment rates for multiple campaigns and countries.\n\nconst TUBE_SCIENCE_AD_NAME = \"TS\";\nconst NARRATIVE = \"NRV\";\n\n// TubeScience(TS) Media Fee Adjustment.\nexport const ELTV_ADJUSTMENT_VALUES_TS: Record = {\n US: 6.42,\n CA: 6.42,\n GB: 4.22,\n UK: 4.22,\n IE: 4.21,\n AU: 5.29,\n NZ: 5.37,\n};\n\n// Narrative (NRV) Media Fee Adjustment.\nexport const ELTV_ADJUSTMENT_VALUES_NRV: Record = {\n US: 5.08,\n CA: 5.47,\n GB: 3.91,\n UK: 3.91,\n IE: 3.35,\n AU: 5.72,\n NZ: 5.77,\n};\n\nexport function extractAdName() {\n const url = new URL(window.location.href);\n const searchParams = new URLSearchParams(url.search);\n return searchParams.get(\"ad_name\");\n}\n\nexport function shouldAdjustELTV() {\n const adName = extractAdName();\n return (\n !!adName &&\n (adName.startsWith(TUBE_SCIENCE_AD_NAME) || adName.startsWith(NARRATIVE))\n );\n}\n\nexport function adjustELTV(value: number, country: string) {\n const adName = extractAdName();\n if (\n !!adName &&\n adName.startsWith(TUBE_SCIENCE_AD_NAME) &&\n ELTV_ADJUSTMENT_VALUES_TS[country]\n ) {\n return value - ELTV_ADJUSTMENT_VALUES_TS[country];\n }\n if (\n !!adName &&\n adName.startsWith(NARRATIVE) &&\n ELTV_ADJUSTMENT_VALUES_NRV[country]\n ) {\n return value - ELTV_ADJUSTMENT_VALUES_NRV[country];\n }\n return value;\n}\n","import {\n allowCategories,\n consentFramework,\n LibCategories,\n} from \"@/utils/consent\";\nimport { optOutAllowsCookies } from \"@/utils/consent/opt-out\";\nimport { fireFacebookCapi } from \"@/utils/pixels/FacebookCapiApi\";\nimport { registerHandler } from \"@/utils/pixels/handler\";\nimport { generateEventId } from \"@/utils/pixels/utils\";\n\nimport { shouldAdjustELTV, adjustELTV } from \"../eltvAdjustment\";\n\ndeclare const fbq: any;\n\nexport interface FacebookPixelParameters {\n external_id?: string;\n value?: number;\n currency?: string;\n product?: string;\n}\n\nconst FB_EREV9_PIXEL = \"1204952429523059\";\nconst FB_ELTV13_PIXEL = \"1557275494440599\";\n\n/**\n * Workaround for being able to add information as advanced matching latter in the funnel (if the purchase is successful)\n * This would have not been possible otherwise as the advanced matching parameters can only be added at the first call of 'init'\n */\nfunction reinitForMatchingParameters() {\n if (allowCategories([LibCategories.targetingCookies])) {\n const script = document.createElement(\"script\");\n script.type = \"text/javascript\";\n script.src = `https://connect.facebook.net/signals/config/${FB_ELTV13_PIXEL}?v=2.9.48&r=stable`;\n script.id = \"facebookEltv13PixelScript\";\n\n const head = document.getElementsByTagName(\"head\")[0];\n head.appendChild(script);\n }\n}\n\nexport function shouldApplyLDUFlag() {\n return consentFramework() === \"optOut\" && !optOutAllowsCookies();\n}\n\nexport function applyLDUFlag() {\n fbq(\"dataProcessingOptions\", [\"LDU\"], 1, 1000);\n}\n\nexport default function registerHandlers() {\n registerHandler(\n \"purchase\",\n ({ emailHashes, erev_13_months, eltv_25_months, userId }) => {\n // Check to add LDU flag for CCPA opt out.\n if (shouldApplyLDUFlag()) {\n applyLDUFlag();\n }\n\n // refresh facebook script as early as possible\n reinitForMatchingParameters();\n\n const pixelProperties: FacebookPixelParameters = {\n value: erev_13_months,\n currency: \"USD\",\n external_id: userId,\n };\n\n const country = window.OneTrust?.getGeolocationData?.().country;\n const eltv13Value =\n shouldAdjustELTV() && country\n ? adjustELTV(eltv_25_months, country)\n : eltv_25_months;\n\n fbq(\"init\", FB_EREV9_PIXEL, {\n em: emailHashes.sha256,\n });\n fbq(\"trackSingle\", FB_EREV9_PIXEL, \"Purchase\", pixelProperties);\n\n const eventID = generateEventId(userId);\n const fbParamsELTV13: FacebookPixelParameters = {\n ...pixelProperties,\n value: eltv13Value,\n };\n\n fbq(\"init\", FB_ELTV13_PIXEL, {\n em: emailHashes.sha256,\n });\n fbq(\"trackSingle\", FB_ELTV13_PIXEL, \"Purchase\", fbParamsELTV13, {\n eventID,\n });\n fireFacebookCapi(FB_ELTV13_PIXEL, \"Purchase\", {\n ...fbParamsELTV13,\n eventID,\n email: emailHashes.sha256,\n });\n },\n );\n}\n","import { LibCategories, waitForConsent } from \"@/utils/consent\";\n\nimport { registerHandler } from \"../handler\";\n\nfunction getHealthlineUrl() {\n const queryParams = new URLSearchParams(window.location.search);\n\n // For the healthline pixel the revenue is hardcoded.\n let revenue =\n window.OneTrust?.getGeolocationData?.().country === \"US\" ? 40 : 30;\n\n if (queryParams.get(\"utm_campaign\") === \"cpm\") {\n revenue = 0;\n }\n\n const healthLineURL = new URL(\n \"https://activation.healthline.com/api/member-offers/postback\",\n );\n healthLineURL.searchParams.append(\"clid\", queryParams.get(\"clid\") || \"-1\");\n healthLineURL.searchParams.append(\"rev\", revenue.toString());\n\n return healthLineURL.toString();\n}\n\nexport default function registerHandlers() {\n registerHandler(\"purchase\", () => {\n waitForConsent([LibCategories.targetingCookies]).then(() => {\n fetch(getHealthlineUrl())\n .then((response) => {\n if (!response.ok) {\n throw new Error(\"Healthline pixel failed\");\n }\n })\n\n .catch(() => {\n /* NOP */\n });\n });\n });\n}\n","import { registerHandler } from \"../handler\";\n\ndeclare const window: Window & {\n nf0?: any;\n};\n\nlet didInit = false;\n\nfunction ensureInit() {\n if (didInit) {\n return;\n }\n if (window.nf0) {\n // For this pixel, tracking properties for a user is another event\n window.nf0(\n \"trackStructEvent\",\n \"country_code\",\n window.OneTrust?.getGeolocationData?.().country,\n );\n didInit = true;\n }\n}\n\nexport default function registerHandlers() {\n registerHandler(\"purchase\", () => {\n ensureInit();\n window.nf0?.(\n \"trackStructEvent\",\n \"custom_conversion\",\n \"signup\",\n window.OneTrust?.getGeolocationData?.().country,\n );\n });\n}\n","import GoogleAdwordsHandlers from \"./adwords\";\nimport FacebookHandlers from \"./facebook\";\nimport HealthlineHandlers from \"./healthline\";\nimport HorizonHandlers from \"./horizon\";\n\nexport function initializePublishers() {\n FacebookHandlers();\n GoogleAdwordsHandlers();\n HealthlineHandlers();\n HorizonHandlers();\n}\n","import { registerHandler } from \"@/utils/pixels/handler\";\n\ndeclare const gtag: any;\n\nexport default function registerHandlers() {\n registerHandler(\"purchase\", ({ erev_13_months }) => {\n gtag(\"event\", \"conversion\", {\n send_to: \"AW-783925782/XdY_CJWPuYsBEJaE5_UC\",\n value: erev_13_months,\n currency: \"USD\",\n });\n });\n}\n","import { HandlerCallback } from \"@/utils/pixels/handler\";\nimport { captureException } from \"@/utils/sentry\";\n\nexport const PIXEL_RETRY_DELAY_MS = 5000;\nexport const PIXEL_RETRY_MAX_ATTEMPTS = 10;\n\nexport async function fireCallbackWithRetry(\n callback: HandlerCallback,\n args: T,\n delay = PIXEL_RETRY_DELAY_MS,\n maxAttempts = PIXEL_RETRY_MAX_ATTEMPTS,\n attempt = 0,\n): Promise {\n try {\n await callback(args);\n } catch (e) {\n // In Non-Production environments, log the exception for easy debugging.\n if (process.env.NODE_ENV !== \"production\") {\n // eslint-disable-next-line no-console\n console.error(e);\n }\n const nextAttempt = attempt + 1;\n if (nextAttempt < maxAttempts) {\n await new Promise((resolve) => {\n setTimeout(resolve, delay);\n });\n await fireCallbackWithRetry(\n callback,\n args,\n delay,\n maxAttempts,\n nextAttempt,\n );\n } else {\n captureException(e);\n }\n }\n}\n\n/**\n * This function is used by some of the Facebook Pixels for creating our custom event_id\n * Used for deduplication between browser pixel and server pixel\n */\nexport function generateEventId(userId: string) {\n const currentTimestamp = new Date().getTime();\n const randomString = (Math.random() + 1).toString(36).substring(8);\n\n return `${userId}_${currentTimestamp}_${randomString}`;\n}\n","import { LibCategories, waitForConsent } from \"./consent\";\nimport { captureException } from \"./sentry\";\n\nconst loaderCache: Record> = {};\n\nclass ScriptLoadError extends Error {\n constructor(public readonly src: string) {\n super(`Failed to load script: ${src}`);\n }\n}\n\ntype HtmlAttrTypes = Partial;\n\nexport const pendingScripts = new Set();\n\nexport async function loadScript(\n src: string,\n categories: LibCategories[],\n {\n enableCORS = true,\n htmlAttr: { dataset, ...htmlAttributes } = {},\n }: {\n enableCORS?: boolean;\n htmlAttr?: HtmlAttrTypes;\n } = {},\n): Promise {\n pendingScripts.add(src);\n await waitForConsent(categories);\n\n if (!loaderCache[src]) {\n loaderCache[src] = new Promise((resolve, reject) => {\n const script = document.createElement(\"script\");\n if (htmlAttributes) {\n Object.assign(script, htmlAttributes);\n }\n if (dataset) {\n Object.assign(script.dataset, dataset);\n }\n\n // Before setting src\n script.onload = () => {\n pendingScripts.delete(src);\n\n resolve();\n };\n\n script.onerror = () => {\n pendingScripts.delete(src);\n\n // Purge cache to allow retry\n delete loaderCache[src];\n\n const e = new ScriptLoadError(src);\n captureException(e);\n reject(e);\n };\n\n script.async = true;\n if (enableCORS) {\n script.crossOrigin = \"anonymous\";\n }\n\n // Do these last\n script.src = src;\n document.body.appendChild(script);\n });\n }\n return loaderCache[src];\n}\n","import * as Sentry from \"@sentry/react\";\n\nimport { AxiosError } from \"axios\";\n\nlet sentryInitialized = false;\n\nconst isNetworkError = (error: Sentry.Event): boolean => {\n const exception = error.exception?.values?.[0];\n const value = exception?.value || \"\";\n\n // Ignore Apple \"Load Failed\" and \"Failed to fetch\" errors - they could be any network error\n // https://sentry.io/answers/load-failed-javascript/\n // https://sentry.io/answers/failed-to-fetch-javascript/\n const ignoredTypeErrors = [\"Load failed\", \"Failed to fetch\"];\n if (exception?.type === \"TypeError\" && ignoredTypeErrors.includes(value)) {\n return true;\n }\n return false;\n};\n\nconst transformAxiosEvent = (event: Sentry.Event, hint: Sentry.EventHint) => {\n const err = hint.originalException as AxiosError;\n if (!err?.isAxiosError) {\n return event;\n }\n return {\n ...event,\n fingerprint: [err.name, err.message, err.config?.urlWithPathParams || \"\"],\n transaction: err.config?.urlWithPathParams,\n extra: {\n ...event.extra,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n errorMessage: (err.response?.data as any)?.errorMessage,\n },\n };\n};\n\nconst beforeSend = (\n event: Sentry.Event,\n hint: Sentry.EventHint,\n): Sentry.Event | null => {\n if (window.ENV.NOOM_ENVIRONMENT === \"development\") {\n // eslint-disable-next-line no-console\n console.log(\"Sentry Event (not sent)\", event);\n return null;\n }\n if (isNetworkError(event)) {\n return null;\n }\n\n return transformAxiosEvent(event, hint);\n};\n\nexport function initializeSentry() {\n if (sentryInitialized) {\n return;\n }\n sentryInitialized = true;\n\n Sentry.init({\n beforeSend,\n release: process.env.HIVE_SHA || \"dev\",\n dsn: \"https://60703e580c164301b457b00b9df7c1ae@o1000882.ingest.sentry.io/6528389\",\n environment: window.ENV.NOOM_ENVIRONMENT,\n ignoreErrors: [\n \"__gCrWeb.learningToolsRuntimeBridge.raiseMessageFromHost\",\n \"AbortError: The play() request was interrupted because video-only background media was paused to save power.\",\n \"ceCurrentVideo.currentTime\",\n \"ChunkLoadError\",\n \"R.tracking_details\",\n \"Network Error\",\n \"Failed to load script\",\n \"Request aborted\",\n \"updateAndCleanExtractedContent\",\n // These two are errors experienced by Microsoft crawlers as part of Outlook Safe Links checking.\n \"Non-Error exception captured\",\n \"Non-Error promise rejection captured\",\n ],\n denyUrls: [\n \"cookielaw.org\",\n \"googleapis.com\", // Errors in minified Google Translate scripts\n ],\n integrations: [\n Sentry.browserTracingIntegration(),\n Sentry.captureConsoleIntegration({ levels: [\"error\"] }),\n ],\n });\n}\n\nexport function captureException(\n err: Error | unknown,\n extra?: Record,\n) {\n initializeSentry();\n Sentry.captureException(err, { extra });\n}\n\n// https://docs.sentry.io/platforms/javascript/enriching-events/level/\ntype SentrySeverityLevel =\n | \"fatal\"\n | \"error\"\n | \"warning\"\n | \"log\"\n | \"info\"\n | \"debug\";\nexport function captureMessage(\n message: string,\n level?: SentrySeverityLevel,\n) {\n initializeSentry();\n if (level) {\n Sentry.captureMessage(message, level);\n } else {\n // don't pass level so that the default level will be used\n Sentry.captureMessage(message);\n }\n}\n","export const isBuyflowTraffic = () => {\n const queryParams = new URLSearchParams(window.location.search);\n return queryParams.get(\"leadSource\") === \"buyflow\";\n};\n\n// The list of EU (and EEA / EFTA) country codes.\nconst EU_COUNTRIES = [\n \"AT\",\n \"BE\",\n \"BG\",\n \"CH\",\n \"CY\",\n \"CZ\",\n \"DE\",\n \"DK\",\n \"EE\",\n \"ES\",\n \"FI\",\n \"FR\",\n \"GB\",\n \"GR\",\n \"HR\",\n \"HU\",\n \"IE\",\n \"IS\",\n \"IT\",\n \"LI\",\n \"LT\",\n \"LU\",\n \"LV\",\n \"MT\",\n \"NL\",\n \"NO\",\n \"PL\",\n \"PT\",\n \"RO\",\n \"SE\",\n \"SI\",\n \"SK\",\n // http://ec.europa.eu/eurostat/statistics-explained/index.php/Tutorial:Country_codes_and_protocol_order\n // The two-letter ISO code is used (ISO 3166 alpha-2) except for Greece and the United Kingdom,\n // for which the abbreviations EL and UK have to be used.\n \"EL\",\n \"UK\",\n];\n\nexport const isEU = (countryCode: string) => EU_COUNTRIES.includes(countryCode);\n","import { LibCategories } from \"@/utils/consent\";\nimport { loadScript } from \"@/utils/scriptLoader\";\n\nlet resolveFullyLoaded: () => void;\nconst fullyLoaded = new Promise((_resolve) => {\n resolveFullyLoaded = _resolve;\n});\n\nif (!window.OneTrust) {\n // @ts-expect-error will be populated by one trust code\n window.OneTrust = {};\n}\n\n(window as any).OptanonWrapper = function OptanonWrapper() {\n resolveFullyLoaded();\n};\n\nexport async function loadOneTrust() {\n await loadScript(\n \"https://cdn.cookielaw.org/scripttemplates/otSDKStub.js\",\n [LibCategories.strictlyNecessary],\n {\n // They appear to support it but this breaks their geolocation API,\n // but in an inconsistent fashion. Disabling as they don't seem to\n // have sufficient QA in CORS mode.\n enableCORS: false,\n htmlAttr: {\n dataset: {\n domainScript: window.ENV.ONE_TRUST_DOMAIN_ID,\n },\n },\n },\n );\n\n // Chaining promise here to allow upstream visibility should the first scrip call fail\n await fullyLoaded;\n\n return {\n OneTrust: window.OneTrust,\n ActiveGroups: window.OnetrustActiveGroups,\n };\n}\n"],"names":["HealthConditionOptionId","ProgramType","ResultType","USState","DEFAULT_ADDRESS","country","region","city","address1","address2","zipcode","INPUT_FIELD_WIDTH","MAX_AGE","MIN_AGE","Curriculum","EnrollmentSuccessType","HealthGoal","NoomMedMoreOptionsSelection","NoomMedOverviewSelection","PregnantSelection","PrimaryCareProviderSelection","BloodGlucoseTrackingSelection","RetriageFinishedStatus","PHQ_OPTIONS","id","text","weight","ErrorState","ErrorCode","ScreenedOutReason","ASSET_URL","window","ENV","CDN_URL","buildDeeplink","email","queryParams","URLSearchParams","append","baseUrl","NOOM_ENVIRONMENT","toString","CONSUMER_HEALTH_LAW_STATES","DOB_FORMAT","NON_PII_QUESTIONS","NOOM_SUPPORTED_ENGLISH_LOCALES","filter","language","slice","OPT_OUT_STATES","OPT_OUT_MHMDA_STATES","CookieName","generateUserId","getCookieOrDefault","name","createValue","value","get","newValue","set","useAnalyticsIds","useState","userDetails","setUserDetails","anonymousId","useMemo","ANONYMOUS_ID","initialId","IDENTIFIED_ID","test","undefined","newId","identifiableId","setIdentifiableId","useEffect","details","IDENTITY_HASH","checkAndUpdateIdentifiableId","then","catch","err","AppContext","useAppContext","context","useContext","Error","BAPTIST_HEALTH_SLUG","CAREFIRST_SLUG","STAGING_CF_SLUG","PROD_DPP_PARTNERS","TEST_DPP_PARTNERS","PROD_B2C_PARTNERS","TEST_B2C_PARTNERS","PROD_STATE_FARM_PARTNERS","TEST_STATE_FARM_PARTNERS","CAREFIRST_PARTNER_ID","DPP_PARTNERS","B2C_PARTNERS","PENDULUM_PARTNER_ID","NOOM_TEST_PARTNER_ID","EXTERNAL_COACH_PARTNER_ID","ACCOLADE_PARTNER_ID","STATE_FARM_PARTNERS","GLP1_WEIGHT_LOGIC_PARTNERS","HEALTH_DATA_CONSENT_DISABLED_PARTNERS","OPT_OUT_DISABLED_PARTNERS","DO_NOT_TRACK_PARTNERS","isB2CPartner","partnerInfo","includes","isCareFirstPartner","getDateOfBirth","surveyAnswers","retriageEligibility","eligibilityCheck","dob","userProfile","dateOfBirth","Date","year","month","day","getAge","age","differenceInYears","calculateBMI","heightFeetPortion","heightInchesPortion","weightInLbs","heightInInches","sanitizeDppSurveyAnswers","sanitizedSurveyAnswers","omit","format","useSaveTriageData","partnerId","eligibilityInfo","ssTriageUuid","setSsTriageUuid","saveTriageData","completionStatus","participantId","employeeId","call","api","dpp","survey","resourceKey","key","paramNamesWithPii","useQueryParams","search","rawQueryParams","data","eligibilityId","enrollmentSlug","passcode","pwResetRedirect","sharedEligibility","upid","toLowerCase","leadSource","utm_source","utm_medium","utm_campaign","urlParamsPiiSessionStore","URL_PARAMS_PII_KEY","JSON","parse","sessionStorage","getItem","getUrlParamsPii","init","params","urlParams","location","prevHiddenParams","hidden","paramObj","Object","fromEntries","entries","hiddenParams","forEach","deny","categorizeParams","newParams","url","URL","href","searchParams","delete","history","replaceState","state","updateURLParams","keys","reduce","ret","setItem","stringify","withPiiQueryParams","piiParams","ref_email","utm_term","utm_content","createCivilDate","d","getDate","getMonth","getFullYear","createCivilDateTime","t","date","time","hour","getHours","minute","getMinutes","second","getSeconds","EligibilityReason","BusinessType","EXPERIMENT_CONFIG","CURRICULUM_TO_PROGRAM_OFFERING_MAP","CURRICULUM_UNSPECIFIED","DPP","HM","HW","PROGRAM_OFFERING_TO_CURRICULUM_MAP","MED","MOOD","NMPBA","WEIGHT","getPartnerProgramOfferings","enrollmentInfo","eligiblePrograms","triagePrograms","OFFERS_MED","partnerProgramOfferings","map","curriculum","program","push","partnerOffersPrograms","programs","every","getProgramFromOffering","productOffering","coursePacks","find","getOfferingFromProgram","assignVariation","experiment","userId","totalWeight","variations","sum","variation","hex","sha256","weightedIndex","Number","BigInt","cumulativeWeight","i","length","useExperiment","b2bAnonymousUserId","selectedProgram","String","partnerOfferings","getExperimentAssignments","eligibleExperiments","targeting","condition","contextValue","operator","EQUALS","v","cv","IN","CONTAINS","evaluateCondition","isEligibleForExperiment","randomExperiment","isExclusive","assignments","AWS_REGION","useTrackEvent","b2bIdentifiedUserId","enrollmentType","surveyMetadata","growthUserId","shouldUseGrowthUserId","identifiedEventPartitionKey","getTransformedExperimentAssignments","getSegmentInfo","segmentId","segmentName","sendEvent","event","partitionKey","command","PutRecordCommand","Data","TextEncoder","encode","PartitionKey","StreamName","KinesisClient","credentials","fromCognitoIdentityPool","clientConfig","identityPoolId","COGNITO_IDENTITY_POOL","send","constructEnrollmentEvent","eventPayload","now","timestamp","toISOString","localDateTime","experimentAssignments","noomB2bEnrollmentEvent","sharedProperties","b2bPartnerId","b2bPartnerName","eventLocalDatetime","eventTimestamp","eventUuid","experimentalProperties","constructSurveyEvent","noomB2bSurveyEvent","surveyInstance","instance","surveyName","trackSurveyAnonEvent","eventType","eventProperties","noomB2bSurveyAnonEvent","anonymousUserId","trackAnonEvent","payload","noomB2bEnrollmentAnonEvent","trackIdentifiedEvent","noomB2bEnrollmentIdentifiedEvent","b2bUserId","linkB2BIdentity","accessCode","emailAddress","b2bIdentityLinked","source","trackAnonPageViewed","pageId","trackIdentifiedPageViewed","queryParamsWithPii","utmCampaign","utmContent","utmMedium","utmSource","utmTerm","trackSurveyIdentifiedEvent","noomB2bSurveyIdentifiedEvent","useAnswerSurveyQuestion","setSurveyAnswers","getNewSurveyAnswersState","questionId","answer","additionalAnswers","answerSurveyQuestion","skipTracking","newSurveyAnswers","allAnswerIds","Array","isArray","trackedAnswerIds","answerIds","answerTexts","Gender","formatAsMedEnrollmentData","partner","userData","extras","phoneNumber","gender","createAccount","mainReason","familyHistoryWeight","pregnant","healthConditions","heightWeight","medications","phq3","phq4","firstName","lastName","address","stateCode","countryCode","regionLong","split","regionData","getRegionAbbreviation","zipCode","familyHistory","NO","heightFeet","heightInch","weightLbs","useMedications","suicideOrSelfHarm1","suicideOrSelfHarm2","getDisplayName","configs","DISPLAY_NAME","fbq","callMethod","apply","arguments","queue","_fbq","loaded","version","dataLayer","gtag","args","nf0","GlobalSnowplowNamespace","q","appId","cookieDomain","cookieName","stateStorageStrategy","forceSecureTracker","discoverRootDomain","eventMethod","sessionCookieTimeout","initializeGlobalVendorScripts","Promise","all","targetingCookies","performanceCookies","script","document","createElement","innerHTML","head","appendChild","loadVWO","initializePixels","enableCORS","loadHorizon","trackBuyflowConversion","eltv_25_months","erev_13_months","getRevenueMetrics","useEnrollMed","enrollMed","medEnrollmentData","account","e","MED_ENROLLMENT_FAILED","useGoto","setScreenedOutReason","setErrorState","setRetriageFinishedStatus","pathname","navigate","error","errorState","medIntake","BUYFLOW_CLIENT_URL","notFound","openApp","autologinData","retriageFinished","status","screenOut","reason","segments","baseRoute","join","success","type","qs","useCreateAccount","setEnrollmentInfo","setUserData","goto","user","updateUpidCurriculumMapping","validate","_correctedAddress","partnerName","getEnrollmentInformation","updatedEnrollmentInfo","create","wasCreated","expires","b2bProgram","b2bSignupResult","SUCCESS","b2cTransitionedAccount","freeAccountExists","slug","isDoNotTrackPartner","successType","CREATED","UPGRADED","errorMessage","response","message","existingB2BAccount","existingB2CAccount","pendingDeleteRequest","claimed","isIneligible","medEnrollmentFailed","resultType","ERROR","ACCOUNT_EXISTS","CODE_CLAIMED","PENDING_DELETION_REQUEST","SUPPORT_REQUEST_CREATED","DEFAULT","getAutologinData","autologinDataCookie","accessToken","SURVEY_ANSWER_COOKIE_NAME","useCreateLoginToken","createLoginToken","password","access_token","accountEmail","clientId","domain","COOKIE_DOMAIN","path","secure","sameSite","isProvidingValidPassword","errorCode","parseEligibilityFileDate","useEligibility","setEligibilityInfo","hasEligibilityError","setHasEligibilityError","checkEligibility","eligibilityVerificationProperties","effectiveDateString","isEligible","participantEligibilityId","eligibilityReason","isMedEligible","participantPartnerId","addressProto","passthroughExtras","effectiveDate","addressLine1","addressLine2","eventParams","eligibleForEnrollment","eligibilityStatus","EXISTING_ACCOUNT","ELIGIBILITY_CHECK_EXISTING_ACCOUNT","PRIOR_TO_EFFECTIVE_DATE","API_ERROR","ELIGIBILITY_CHECK_API_ERROR","MULTIPLE_MATCHES","ELIGIBILITY_CHECK_MULTIPLE_MATCHES","fetchEligibilityInfo","redirectToParticipantPartner","getPartnerByUpid","origin","useGeolocation","isLoading","setIsLoading","OneTrust","getGeolocationData","canOptOut","canOptOutMHMDA","getPartnerBySlug","usePartnerInfo","setPartnerInfo","employerSlug","isPartnerInfoLoading","setPartnerInfoLoading","hasPartnerError","setPartnerError","goLiveDate","BEFORE_GOLIVE_DATE","partnerBySlug","partnerByUpid","handlePartnerStateOrError","fetch","useRetriageEligibility","setRetriageEligibility","isLoadingRetriageEligibility","setIsLoadingRetriageEligibility","checkingAutologinData","setCheckingAutologinData","verificationProperties","setVerificationProperties","handleRetriageEligibilityResponse","didVerifyUsingAutologinData","currentOffering","eligibleRetriageOfferings","partnerSlug","currentProgram","eligibleRetriagePrograms","offering","ignore","rest","retriageEligibilityByEligibilityInfo","retriageEligibilityForAccessCode","resetRetriageEligibility","convertLbToKg","mainUnitValue","calculatePhqScore","phqAnswers","some","phqAnswer","acc","phqOption","option","OUTCOMES_QUESTION_ID_TO_UUID_MAP","a1c","exercise","glp1Medication","hadA1cTested","mskPain","mskPainLevel","phq1","phq2","reachingHealthGoals","extractOutcomesSurveyAnswers","outcomesSurveyAnswers","surveyAnswer","isPlainObject","uuid","answerSlugs","latestWeightKgs","weightInKg","heightInCm","secondaryUnitValue","valueInIn","convertFtToIn","convertInToCm","convertFtToCm","shouldAskBaselineOutcomes","shouldAskQuarterlyQuestion","questionCadence","days","daysInProgram","useStoreOutcomes","hasB2cAccount","createPassword","existingPassword","storeBaselineOutcomesAnswers","outcomes","store","surveyExperienceSlug","surveyId","storeRecurringOutcomesAnswers","getUpidFromPasscode","getPasscode","ResultValue","useSubmitPasscode","inputMethod","passcodeCorrect","replace","useUpdateLastTriageTimestamp","updateLastTriageTimestamp","triageResult","request","newLastTriageTimestamp","wasOfferedDpp","wasOfferedMed","GenericConsent","ctaText","size","colorScheme","dangerouslySetInnerHTML","__html","translationKey","signUpButton","getTosHtmlB2C","hasCustomCopy","i18next","exists","shouldShowGeoCopy","yourPrivacyChoices","customTos","baseTos","noomMayShareHtml","getTosHtml","NoomEmailAddressLink","NoomHeader","forceHeader","isImageLoaded","setIsImageLoaded","display","gap","padding","base","lg","alt","height","src","backgroundColor","black","width","onLoad","opacity","transition","NoomSupportLink","target","rel","NoomVirtualAssistantLink","children","BaseOutline","white","flexDirection","overflowY","position","minHeight","BaseInterstitial","autoAdvance","autoAdvanceMs","centerChildren","color","footerText","headerText","helperText","imageAlt","imageSrc","onClickBack","onClickNext","showBackButton","margin","isBrowser","timeoutId","setTimeout","clearTimeout","flexGrow","tabIndex","cursor","onClick","paddingBottom","maxWidth","spacing","fontSize","fontWeight","lineHeight","justifyContent","autoFocus","marginBottom","marginTop","_focus","boxShadow","bottom","SurveyProgressBar","currentProgress","currentSectionIndex","lastProgress","percentages","progress","setProgress","sectionIndex","setSectionIndex","shouldAnimate","setShouldAnimate","background","offWhite","borderRadius","bars","sectionPercentageRunningSum","percentage","isCompletedSection","isCurrentSection","isFirstSection","isLastSection","isEndSection","barColor","lagoon","stream","barWidth","barLeftOffset","iconLeftOffset","Fragment","left","zIndex","getSectionBars","SurveyHeader","headerImageSrc","hideBackButton","hideSurveyProgressBar","questionSet","surveyProgressBarState","setSurveyProgressBarState","currentQuestionId","pop","newSectionIndex","findIndex","section","questions","definition","description","newProgress","currentSectionDescription","flatMap","useSurveyProgressBar","gridTemplateColumns","justifySelf","fontFamily","fontStyle","letterSpacing","textTransform","BaseQuestion","footer","footerPosition","hideHeader","questionDescription","questionHelperText","questionText","md","CheckmarkSvg","svg","props","checked","Container","div","sand02","Checkbox","fill","viewBox","xmlns","Label","label","CheckboxInput","input","CheckboxButton","invertLabelColorsOnChecked","CheckboxOptions","checkedItems","options","submitCheckboxQuestion","toggleCheckedState","checkedItem","onChange","onKeyPress","subtext","style","isSpecialCheckbox","optionId","CheckboxQuestion","canProceedWithoutAnswer","hiddenOptions","selectedItems","setCheckedItems","showHiddenItems","setShowHiddenItems","selectedHiddenOptions","notSelectedHiddenOptions","currentCheckedState","newCheckedItems","variant","w","textDecoration","disabled","SurveyButton","selected","MultipleChoiceOptions","selectedItem","MultipleChoiceQuestion","confirmationElement","ImageBulletListCard","items","headingText","border","sand01","image","alignItems","SelectQuestion","initialValue","placeholder","setValue","selectOptions","InformationalScreen","blueberry","resolve","QUESTION_ID_DPP","QUESTION_ID_MED","ConfirmChangeProgram","setSelectedProgram","newProgram","programKey","medValueProps","marginLeft","imageProps","handleOptIn","didOptIn","updatedProgram","components","i18nKey","pt","Q_CONFIRM_CHANGE_PROGRAM_DPP","shouldShowQuestion","dppEligible","confirmChangeProgramMed","medicareConsent","component","Q_CONFIRM_CHANGE_PROGRAM_MED","NEXT","QUESTION_ID","Q_DPP_INFORMATION","bulletListItems","sm","AgeInputValidationSchema","nullable","transform","isNaN","required","positive","min","max","AgeInput","field","touched","defaultFieldStyles","borderColor","grey2","_hover","DOBSchema","_","originalValue","isValid","isFuture","StyledTextField","TextField","cinnamon","transitionDuration","borderWidth","DateInput","isReadOnly","helper","setFieldValue","submitCount","isInvalid","htmlFor","ThemeProvider","theme","createTheme","LocalizationProvider","dateAdapter","AdapterDateFns","DesktopDatePicker","disableOpenPicker","inputFormat","readOnly","renderInput","fullWidth","top","InputWithSuffix","forwardRef","ref","suffix","inputRef","useRef","el","current","textAlign","marginRight","right","focus","PasswordStrengthBar","lazy","passwordScore","PasswordInputWithoutStrengthValidationSchema","PasswordInputValidationSchema","PasswordInput","showPasswordStrengthBar","userInputs","showPassword","setShowPassword","imgVisibilityOffPath","Image","rightElement","prevValue","Suspense","fallback","barColors","tarocco","yolk","avocado","minLength","onChangeScore","score","scoreWords","shortScoreWord","StyledCountryInput","flex","StyledPhoneInput","paddingLeft","PhoneInputSchema","dialCode","phoneNumberUtil","getInstance","number","isValidNumber","PhoneInput","focusPhoneNumber","meta","helpers","validateField","handleInputChange","autocompleteSearch","countryCodeEditable","enableSearch","inputProps","autoComplete","onBlur","setTouched","autoFormat","disableCountryCode","disableCountryGuess","disableDropdown","showDropdown","getAllLanguageOptions","supportedLocalizedEnglishVersion","navigator","languages","browserLanguage","PreferredLanguageSelector","supportedLocales","languageOptions","defaultEligibilityCheckFormValues","policyId","getValidationSchema","showDobField","showEmployeeIdField","isUhcPartner","MAX_LENGTH","baseSchema","shape","maxLength","employeeIdSchema","validationSchema","ageSchema","concat","policyIdSchema","EligibilityCheckForm","initialValues","setInitialValues","onParentSubmit","i18n","UPFRONT_ELIGIBILITY_ENFORCEMENT","REQUIRES_DOB","onSubmit","values","trimmedValues","trim","validateOnBlur","validateOnChange","errors","getFieldProps","handleChange","handleSubmit","isSubmitting","fieldName","Boolean","Q_RETRIAGE_ELIGIBILITY_CHECK","autologindata","eligibilityProperties","getEligibilityCheckFormValues","RECENTLY_RETRIAGED","ALREADY_MED","m","Q_RETRIAGE_EXCLUSION","eligibilityTextContext","screenedOutReason","bodyContext","canRetriageIntoDpp","canRetriageIntoMed","alertUserCoach","exclusionReason","whiteSpace","RetriageFinished","retriageFinishedStatus","supportLink","addressFieldPositionCountryMap","US","CA","AU","GB","default","STREET_MAX_LENGTH","CITY_REGION_MAX_LENGTH","getTranslationForCountryCode","formName","localTranslationKey","shouldValidateFieldForCountry","buildAddressSchema","tError","errorKey","when","schema","AddressSchema","getRegionDataForCountry","AddressForm","countrySelectDisabled","hideTaxRegHelper","setFieldError","formPath","getError","addressFieldComponentMap","addressFieldConfig","defaultInitialValues","defaultInitialValuesMHMDA","mhmdaOptIn","CreateAccountForm","setHasB2cAccount","submittedValues","setSubmittedValues","showMhmdaCheckBox","getB2bEmailAvailabilityInformation","availabilityResult","isChecked","HealthDataConsentForm","consentStatus","consentSignature","FLOAT_DISALLOWED_CHARS","INTEGER_DISALLOWED_CHARS","enforcePositiveFloat","preventDefault","enforcePositiveInt","FEET_INPUT_FIELD_WIDTH","Math","ceil","INCHES_INPUT_FIELD_WIDTH","floor","HeightWeightSchema","HeightWeightForm","focusHeightFeet","hideHeight","onKeyDown","Q_RETRIAGE_MED_SIGNUP","sameShippingAddress","shippingAddress","answers","is","notRequired","otherwise","s","pb","scaleOptIn","Q_RETRIAGE_KEEP_PLAN","confirmChangeProgramDpp","Q_RETRIAGE_PERSONALIZING_PROGRAM","BaseSuccess","bodyContent","sky","mt","mb","Q_RETRIAGE_RESULT","result","CURRENT_PROGRAM","eligibleProgram","getNoomEventProgram","CONFETTI_HEIGHT_DESKTOP","CONFETTI_HEIGHT_MOBILE","CONFETTI_WIDTH_DESKTOP","CONFETTI_WIDTH_MOBILE","ConfettiBox","isAnimationComplete","setIsAnimationComplete","objectFit","sanitizeRetriageAnswers","retriageEligibilityCheck","buildAddressProto","proto","zoneCode","postalCode","buildRequest","surveyJson","medRetriageData","homeAddress","medSignup","scaleShippingAddress","Q_RETRIAGE_TRANSITION","hasMinTimeElapsed","setHasMinTimeElapsed","isSuccess","setIsSuccess","apiError","setError","apiLoading","setApiLoading","migrateUser","retriage","useMigrateUser","DeeplinkView","partnerInformation","align","justify","borderTopLeftRadius","Survey","onSurveyComplete","resetOnOpen","telehealthEligibleStates","setQuestionSet","questionSection","getQuestionIdFromPath","useCallback","findNextQuestion","startingIndex","newState","question","index","experiments","questionIndex","getQuestionIndexById","nextQuestion","nextQuestionPath","firstQuestion","goToFirstQuestion","Component","element","Q_ACTIVE_SUBSCRIPTION","BoldListItem","li","Bullet","Q_TRANSITION_EXPLAINER","setIsSubmitting","supportEmail","ELIGIBLE_COMORBIDITIES","ABNORMAL_CHOLESTEROL","LIVER_DISEASE","LOW_TESTOSTERONE","HEART_DISEASE","HIGH_BLOOD_PRESSURE","OSTEOARTHRITIS","PCOS_OR_FERTILITY_PROBLEMS","TYPE2_DIABETES","meetsMedBmiAndComorbityCriteria","hasEligibleComorbidity","hc","bmi","meetsMedBmiAndHealthConditionsCriteria","TYPE1_DIABETES","qualifiesForNoomMed","glp1Weight","liabilityWaiverBMI","liabilityWaiverEatingDisorder","liabilityWaiverPregnant","locationState","noomMedMoreOptions","userProfileDob","shouldShowCardiometabolicQuestionForRetriage","GenderProtoMap","MALE","FEMALE","SexProtoMap","INTERSEX","areSexAndGenderPrePopulated","sex","isGenderPrePopulated","isSexPrePopulated","shouldShowDppQualification","OTHER","A1cQuestion","step","Q_A1C","Q_OUTCOMES_A1C","Q_RETRIAGE_A1C","prediabetesHistory","Q_BLOOD_GLUCOSE_TRACKING","primaryCareProvider","OFFERS_DIABETES_MANAGEMENT","YES","CREATE_ACCOUNT_QUESTION_ID","Q_CREATE_ACCOUNT","upfrontEligibilityEnforcement","HIDE_COST","Q_CREATE_PASSWORD","shouldShowHealthDataConsent","Q_COMPLETE_PROFILE","showEmployeeIdFieldOnCompleteProfile","REQUIRES_PARTICIPANT_ID","isNoomWeightProgram","showLanguageDropdown","locale","showHealthDataConsent","isDisabled","getRecommendedCoursePacks","recommendedCoursePacks","sleep","stressEating","missingAnswers","isPersonalizationEnabled","shouldShowPersonalizationFlow","Q_COURSE_PACK_SELECTION","selectedCoursePacks","DifficultiesQuestion","Q_DIFFICULTIES","Q_RETRIAGE_DIFFICULTIES","EatingDisorderQuestion","shouldShowConfirmation","setShouldShowConfirmation","setSelectedItem","_additionalAnswers","_screenedOutReason","EATING_DISORDER","Q_EATING_DISORDER","Q_RETRIAGE_EATING_DISORDER","ContinueToDownloadButton","isExternal","as","FullscreenMessage","button","heading","visual","VideoComponent","video","TryAgainVideo","videoRef","hasLoopedOnce","setHasLoopedOnce","autoPlay","muted","onEnded","play","playsInline","ELIGIBILITY_CHECK_QUESTION_ID","Q_ELIGIBILITY_CHECK","localEligibilityResult","setLocalEligibilityResult","hideNoomCostMention","EducationQuestion","Q_EDUCATION","Q_RETRIAGE_EDUCATION","Q_ENROLLED_IN_MEDICARE","EthnicityQuestion","ethnicities","BMI_TOO_LOW","Q_ETHNICITY","Q_RETRIAGE_ETHNICITY","Q_EXISTING_PASSWORD","isCheckingPassword","setIsCheckingPassword","isSendingResetPasswordEmail","setIsSendingResetPasswordEmail","toast","toastId","isPwResetRedirect","handleResetPassword","buttonName","paramsWithPii","postResetRedirectUrl","passwordResets","setSurveyAnswerCookie","isActive","duration","render","wasSuccessful","passwordCorrect","resetForm","FamilyHistoryQuestion","Q_FAMILY_HISTORY","Q_RETRIAGE_FAMILY_HISTORY","Q_FAMILY_HISTORY_WEIGHT","GENDER_QUESTION_ID","GenderQuestion","Q_GENDER","PREGNANT","Q_RETRIAGE_GENDER","GestationalDiabetesQuestion","Q_GESTATIONAL_DIABETES","Q_RETRIAGE_GESTATIONAL_DIABETES","calculateBMIMetric","heightCm","currentWeightKg","heightInMeter","GLP1_OPTION_IDS","RETRIAGE_GLP1_OPTION_IDS","Glp1MedicationQuestion","Q_GLP1_MEDICATION","Q_OUTCOMES_GLP1_MEDICATION","heightCms","Q_RETRIAGE_GLP1_MEDICATION","Q_GLP1_WEIGHT","shouldShowGlp1WeightQuestion","HadA1cTestedQuestion","Q_HAD_A1C_TESTED","Q_OUTCOMES_HAD_A1C_TESTED","HealthCareProfessionalQuestion","Q_HEALTH_CARE_PROFESSIONAL","Q_RETRIAGE_HEALTH_CARE_PROFESSIONAL","HealthConditionsQuestion","isMale","DEPRESSION_OR_ANXIETY","SLEEP_PROBLEMS","CANCER_UNDER_TREATMENT","NONE","dppIneligibleConditions","Q_HEALTH_CONDITIONS","Q_OUTCOMES_HEALTH_CONDITIONS","Q_RETRIAGE_HEALTH_CONDITIONS","Q_HEALTH_GOAL","REDUCING_STRESS_ANXIOUS_FEELINGS","LOSING_WEIGHT","HeightWeightQuestion","hasAlreadySignedLiabilityWaiver","retriageQuestionTextContext","handleAnswerBeforeProceeding","Q_HEIGHT_WEIGHT","Q_RETRIAGE_HEIGHT_WEIGHT","HypertensionQuestion","Q_HYPERTENSION","Q_RETRIAGE_HYPERTENSION","LiabilityWaiverAlert","offersDpp","offersMed","QUESTION_ID_EATING_DISORDER","Q_LIABILITY_WAIVER_ALERT_EATING_DISORDER","eatingDisorder","liabilityWaiverAlertBMI","liabilityWaiverAlertPregnant","QUESTION_ID_BMI","Q_LIABILITY_WAIVER_ALERT_BMI","liabilityWaiverAlertEatingDisorder","QUESTION_ID_PREGNANT","Q_LIABILITY_WAIVER_ALERT_PREGNANT","LiabilityWaiver","didAgree","setDidAgree","Q_LIABILITY_WAIVER_EATING_DISORDER","Q_LIABILITY_WAIVER_BMI","Q_LIABILITY_WAIVER_PREGNANT","stateOptions","Q_LOCATION_STATE","ACCOLADE_PARTNER","setTelehealthEligibleStates","telehealth","getEligibleTelehealthStates","eligibleStates","loadTelehealthEligibleStates","Q_MEDICARE_CONSENT","enrolledInMedicare","medProgram","MotivationQuestion","Q_MOTIVATION","Q_RETRIAGE_MOTIVATION","Card","isSelected","Q_NOOM_MED_MORE_OPTIONS","noomMedOverview","SEE_MORE_OPTIONS","selectedCard","setSelectedCard","isAccolade","partnerOffersDpp","accoladeTranslationOptions","otherCardTranslationOptions","otherCardTitle","otherCardDescription","grey3","VALUE_PROPS","caption","Q_NOOM_MED_OVERVIEW","handleJoinMed","selection","grey1","JOIN","MedicationsQuestion","Q_MEDICATIONS","Q_OUTCOMES_MEDICATIONS","shouldShowWomensHealthQuestions","MENOPAUSE_ANSWERS","Q_MENOPAUSE","Q_MENSTRUAL_CYCLE","menopause","MskPainQuestion","Q_MSK_PAIN","Q_OUTCOMES_MSK_PAIN","MskPainLevelQuestion","setMskPainLevel","mskPainLevelConfig","level","altText","imgSrc","getLevelConfig","val","ml","h","bgColor","onFocus","sx","Q_MSK_PAIN_LEVEL","Q_OUTCOMES_MSK_PAIN_LEVEL","Q_OTHER_ETHNICITY","otherEthnicity","Phq1Question","Q_PHQ_1","Q_RETRIAGE_PHQ_1","Phq2Question","Q_PHQ_2","Q_RETRIAGE_PHQ_2","Phq3Question","Q_PHQ_3","Q_RETRIAGE_PHQ_3","Phq4Question","Q_PHQ_4","Q_RETRIAGE_PHQ_4","PhysicalActivityQuestion","riskScore","gestationalDiabetes","hypertension","physicalActivity","dppRiskScore","risk","calculateDppRiskScore","Q_PHYSICAL_ACTIVITY","Q_RETRIAGE_PHYSICAL_ACTIVITY","PrediabetesQuestion","MEDICARE_PARTNER","Q_PREDIABETES_HISTORY","Q_RETRIAGE_PREDIABETES_HISTORY","PregnantQuestion","NO_BUT_NURSING","NO_BUT_PLANNING","Q_PREGNANT","Q_RETRIAGE_PREGNANT","Q_PROGRAM_OVERVIEW","healthGoal","PROGRAM_MAP","buttonText","listItems","getProgramMap","assignedHealthGoal","Q_REASON_FOR_LOSING_WEIGHT","ScaleOptIn","DEFERRED_SHIPPING_TEXT","Q_SCALE_OPT_IN","OFFER_SCALE_SHIPMENT","Q_RETRIAGE_SCALE_OPT_IN","SEX_QUESTION_ID","SexQuestion","Q_SEX","Q_RETRIAGE_SEX","Q_SLEEP","Q_STRESS_EATING","Q_PRIMARY_CARE_PROVIDER","DppDescriptionForMed","returnObjects","item","icon","WeightDescriptionForMedQuestion","Q_PROGRAM_SET","diabetesSupport","programSetConfigMap","salmon","interstitialProps","Q_BASELINE_HEALTH","maxW","Q_CONTINUE_PROGRAM","Q_DIABETES_SUPPORT","alignSelf","Q_NURSING","Q_PERSONALIZATION_CONFIRMATION","Q_PERSONALIZATION_INTRO","ProgressBar","onComplete","totalTimeMs","setPercentage","intervalId","setInterval","percent","clearInterval","femaleTestimonialProps","quote","maleTestimonialProps","Testimonial","paddingTop","Q_PERSONALIZING_PROGRAM","testimonialProps","Cypress","supportButton","Q_SCREENED_OUT","showNotInterestedInMood","setShowNotInterestedInMood","customSupportLink","CUSTOM_SUPPORT_LINK","formattedSupportLink","parts","console","scheme","PNF","NATIONAL","formatCustomSupportLink","partnerOffersMood","accoladeSnippet","screenedOutTextConfigs","screenedOutTextConfigsMoodOffered","notInterestedInMoodTextConfigsMoodOffered","screenedOutTextConfigsB2C","notInterestedInMoodText","showMoodCTAs","screenedOutText","_active","shouldAskSDOH","Q_SOCIAL_DETERMINANTS_OF_HEALTH","Q_WOMENS_HEALTH","Q_NUTRITION_BASICS","Q_CULTURAL_IMPACTS","Q_EATING_MOVING_AFFORDABLY","Q_EXERCISE","loggedExerciseMinsPastTwoWks","Q_OUTCOMES_SURVEY_COMPLETE","Q_REACHING_HEALTH_GOALS","shouldAskMonthlyQuestion","Q_OUTCOMES_WEIGHT","pick","DPP_SURVEY","RECURRING_OUTCOMES","RETRIAGE_SURVEY","TRANSITION_SURVEY","WIP","DevView","questionSetName","OptOutForm","isOptOutSuccessful","setIsOptOutSuccessful","actions","dirty","kale","DoNotShareView","formatAsUserData","formData","dppTriageKey","orderScale","formattedPhoneNumber","calculatedAge","liabilityWaiverConsent","ectExperiments","exp","assignedVariation","getEctExperiments","forceExperimentsToAssign","DppTriageView","setEnrollmentType","historyState","rawUpid","sexToGenderMap","female","male","intersex","SELF_ID","preferNotToSay","completeProfile","createAccountAnswer","formValues","coursePackSelection","nutritionBasics","eatingMovingAffordably","culturalImpacts","getCoursePacksToAssign","NotFoundView","RecurringOutcomesView","setSurveyMetadata","setUserProfile","getUserProfile","activeProgram","programConfigurationSlug","timeStarted","startsWith","differenceInDays","surveyPeriod","defaultStyles","flexDir","RetriageAuthView","RetriageView","OFFERS_RETRIAGE","TransitionView","transitionB2CAccount","migrateToB2B","migrationRequestCreated","useTransitionB2CAccount","TRANSITIONED","ErrorView","maskedEmail","toLocaleString","dateStyle","timeStyle","timeZone","errorTextConfigs","callToAction","SSO_ACCOUNT_EXISTS","EXISTING_VIRGIN_PULSE_USER","BATCH_FULL","FAILED_ELIGIBILITY_CHECK","SSO_INELIGIBLE","PAST_CONTRACT_END_DATE","errorTextB2CConfigs","errorText","errorType","b2bErrorType","fadeIn","FadeIn","delay","fadeInAndOut","FadeInAndOut","fadeOut","ExpandingCircleCover","slideUpSmall","Logo","img","Slide","SlideText","animationDone","currentSlideIdx","setCurrentSlideIdx","slides","content","onAnimationEnd","visibility","LANGUAGES","en","NAMESPACES","STATIC_CONTENT_IMAGES","captionKey","EnrollmentStaticContent","employerName","showPricePill","showOriginalLogo","employerLanding","imageUrl","showWhiteLogo","isInline","boldText","ns","BaseSideForm","PasscodeInputForm","submitPasscode","isVpSponsor","ENROLL_VIRGIN_PULSE","isPasscodeEnrollment","ENROLL_PASSCODE","toUpperCase","UpidInputForm","CodeInputForm","enrollmentBlurb","TriageLandingForm","customSupportEmail","createAccountSurveyAnswer","createAccountFormInitialValues","eligibilityCheckSurveyAnswer","eligibilityCheckFormInitialValues","setEligibilityCheckFormInitialValues","submittedEligibilityCheckFormValues","setSubmittedEligibilityCheckFormValues","isEligibilityCheckLoading","setIsEligibilityCheckLoading","eligibilityResult","checkedReason","benefitText","EntryForm","entryPoint","PostEnrollmentRefreshView","validateUpid","ReskinView","eligibilityResponse","setEligibilityResponse","hasAlreadyEnrolled","setHasAlreadyEnrolled","ssoAnimationDone","setSsoAnimationDone","surveyAnswersFromCookie","surveyAnswerCookie","getSurveyAnswersFromCookie","checkingSurveyAnswerCookie","setCheckingSurveyAnswerCookie","validationData","enrollmentInformation","available","errorStateMap","ERROR_ACTIVATION_CODE_CLAIMED","ERROR_ACTIVATION_CODE_DOESNT_EXIST","ERROR_BATCH_FULL","ERROR_PAST_CONTRACT_END_DATE","resultTypeMap","requestError","res","handleEligibilityResponse","eligible","medEligible","extrasProto","passThroughExtras","freshEligibilityInfo","borderBottomRightRadius","xl","MAINTAIN_ORIGINAL_LOGO","ListMarker","stepNumber","minWidth","DownloadView","enrollmentSuccessType","showDesktopStyle","textsForEnrollmentSuccessType","headline","downloadSteps","wordBreak","ProgressView","setIsDoneShowingProgress","isDoneSpinning","setIsDoneSpinning","texts","inProgress","complete","inProgressText","completeText","SuccessView","isDoneShowingProgress","remove","accountTypeMap","accountType","buildCallbackUrl","protocol","host","buildVpLoginUrl","getPartnerRedirect","partnerRedirect","encodeURIComponent","VirginPulseRedirect","redirectType","setMaskedEmail","code","callbackError","authorizationCode","getVirginPulse","redirectUri","pId","Button","defaultProps","sizes","variants","outline","Input","Select","filled","gold","reskinTheme","breakpoints","colors","FormLabel","baseStyle","styles","global","body","a","use","debug","fallbackLng","whitelist","interpolation","escapeValue","defaultNS","enrollment","fallbackNS","backend","loadPath","detection","lookupQuerystring","checkWhitelist","AppInitializer","resetCSS","to","register","urlWithPathParams","baseURL","PRODUCT_API_URL","method","headers","SERVER_URL","client_id","grant_type","mode","principal","from","resetUrl","billingAddress","requestBody","Authorization","surveysCompleted","generateRequestBody","properties","GROWTH_API_DOMAIN","telehealthUserProgram","setAnalyticsUserDetails","hashedEmail","setHashedEmail","sha","Provider","getElementById","LibCategories","_trackingCallback","consentLoader","waiting","Set","CONSENT_KEY","consent","localStorage","consentFramework","setConsent","categories","waiter","bootstrapConsent","trackingCallback","strictlyNecessary","functionalCookies","socialMediaCookies","getConsent","allowCategories","category","waitForConsent","add","seedOneTrustConsent","seedConsent","bootstrapOneTrust","ActiveGroups","onetrustConsent","sort","OnConsentChanged","detail","OPT_OUT_COOKIE_NAME","fetchConsentStatus","formattedEmail","requestData","userIdentifier","optOutAllowsCookies","applyOptOut","ensureCookie","cookie","consentState","optedOut","userPolicyOptions","userPolicyOption","log","bootstrapOptOut","setOptOut","submitConsent","subdivision","hash","algorithm","crypto","subtle","digest","buf","prototype","Uint8Array","x","toSha256","toSha1","initGate","cleanEvents","purchase","cleanProps","sha1","emailHashes","firePixelEvent","cleanedProps","handlers","promises","handler","registerHandler","callback","maxAttempts","retry","initializeHandlers","initializePublishers","fireFacebookCapi","pixelId","eventName","external_id","phone","customData","currency","custom_properties","customProperties","eventData","event_id","eventID","event_name","event_source_url","action_source","user_data","custom_data","pixel_id","shouldApplyLDUFlag","assign","data_processing_options","data_processing_options_country","data_processing_options_state","opt_out","testEventCode","test_event_code","axios","TUBE_SCIENCE_AD_NAME","NARRATIVE","ELTV_ADJUSTMENT_VALUES_TS","UK","IE","NZ","ELTV_ADJUSTMENT_VALUES_NRV","extractAdName","FB_EREV9_PIXEL","FB_ELTV13_PIXEL","applyLDUFlag","registerHandlers","getElementsByTagName","reinitForMatchingParameters","pixelProperties","eltv13Value","adName","shouldAdjustELTV","adjustELTV","em","fbParamsELTV13","revenue","healthLineURL","getHealthlineUrl","ok","didInit","ensureInit","send_to","PIXEL_RETRY_DELAY_MS","PIXEL_RETRY_MAX_ATTEMPTS","fireCallbackWithRetry","attempt","nextAttempt","generateEventId","currentTimestamp","getTime","randomString","random","substring","loaderCache","pendingScripts","loadScript","htmlAttr","dataset","htmlAttributes","reject","onload","onerror","ScriptLoadError","async","crossOrigin","sentryInitialized","beforeSend","hint","exception","isNetworkError","originalException","isAxiosError","fingerprint","config","transaction","extra","transformAxiosEvent","initializeSentry","release","dsn","environment","ignoreErrors","denyUrls","integrations","levels","captureException","captureMessage","isBuyflowTraffic","EU_COUNTRIES","isEU","resolveFullyLoaded","fullyLoaded","_resolve","loadOneTrust","domainScript","ONE_TRUST_DOMAIN_ID","OnetrustActiveGroups","OptanonWrapper"],"sourceRoot":""}