@mychoice/mychoice-sdk-modules 2.1.35 → 2.1.37

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cjs/index.js CHANGED
@@ -958,36 +958,35 @@ const SectionDriverInsurancePolicy = () => {
958
958
  const { configState } = mychoiceSdkStore.useStoreFormCarConfig();
959
959
  const { driverState, dispatchDriverInsuranceState } = mychoiceSdkStore.useStoreFormCarDriverInsurance();
960
960
  const { discountState, dispatchDiscountState } = mychoiceSdkStore.useStoreFormCarDiscount();
961
- const { quoteState: { isRequested } } = mychoiceSdkStore.useStoreFormCarQuote();
961
+ const { quoteState: { isRequested }, } = mychoiceSdkStore.useStoreFormCarQuote();
962
962
  const { listed, listedMonth = '', listedYear = '', insured, insuredDate = '', firstName, birthYear, birthMonth, birthDay, licenceInfo: { firstLicenceAge, licenceType, gLicenceYear, gLicenceMonth, g1LicenceYear, g1LicenceMonth, }, } = driverState.items[driverState.activeIndex];
963
963
  const { policyStartYear, policyStartMonth, policyStartDay } = discountState;
964
964
  const driverNameDefault = `Driver ${driverState.activeIndex + 1}`;
965
- const birthDate = birthYear && birthMonth && birthDay ? `${birthYear}-${birthMonth}-${birthDay}` : '';
966
- const { appConfigState: { appType } } = mychoiceSdkStore.useStoreAppConfig();
965
+ const birthDate = birthYear && birthMonth && birthDay
966
+ ? `${birthYear}-${birthMonth}-${birthDay}`
967
+ : '';
968
+ const { appConfigState: { appType }, } = mychoiceSdkStore.useStoreAppConfig();
967
969
  const mychoiceCls = appType === mychoiceSdkComponents.AppTypes.MyChoice ? 'mychoice' : '';
968
970
  const getPeriodOptions = (year, month) => {
969
- const options = [{ value: '', name: 'Date Period', disabled: true }];
971
+ const options = [
972
+ { value: '', name: 'Date Period', disabled: true },
973
+ ];
970
974
  if (year && month) {
971
- const listedDate = mychoiceSdkComponents.addDaysToDate(`${year}-${month}-01`, birthDay ? +birthDay + 1 : 1);
972
- const yearPeriod = mychoiceSdkComponents.getDifferenceInYears('', listedDate) || 0;
973
- for (let y = yearPeriod; y >= 0; y -= 1) {
974
- switch (true) {
975
- case y === 0:
976
- options.push({
977
- value: mychoiceSdkComponents.subMonthsFromDate('', 10),
978
- name: 'Less than 1 Year',
979
- });
980
- break;
981
- case y === 1:
982
- options.push({ value: mychoiceSdkComponents.addYearsToDate(listedDate, y), name: '1 Year' });
983
- break;
984
- default:
985
- options.push({
986
- value: mychoiceSdkComponents.addYearsToDate(listedDate, y),
987
- name: `${y} Years`,
988
- });
989
- }
975
+ const todayDate = new Date();
976
+ const month = String(todayDate.getMonth() + 1).padStart(2, '0');
977
+ const day = String(todayDate.getDate()).padStart(2, '0');
978
+ const yearsInPast = todayDate.getFullYear() - parseInt(year);
979
+ for (let i = yearsInPast; i > 0; i--) {
980
+ const pastDate = `${todayDate.getFullYear() - i}-${month}-${day}`;
981
+ options.push({
982
+ value: pastDate,
983
+ name: `${i} ${i === 1 ? 'Year' : 'Years'}`,
984
+ });
990
985
  }
986
+ options.push({
987
+ value: `${todayDate.getFullYear() - 1}-${month}-${day}`,
988
+ name: 'Less than 1 Year',
989
+ });
991
990
  }
992
991
  return options;
993
992
  };
@@ -1027,7 +1026,9 @@ you had insurance. If this is correct, please continue with the form.`);
1027
1026
  }
1028
1027
  };
1029
1028
  if (birthDate) {
1030
- const defaultMinDate = birthDate && firstLicenceAge ? mychoiceSdkComponents.addYearsToDate(birthDate, +firstLicenceAge) : '';
1029
+ const defaultMinDate = birthDate && firstLicenceAge
1030
+ ? mychoiceSdkComponents.addYearsToDate(birthDate, +firstLicenceAge)
1031
+ : '';
1031
1032
  const isOnlyG = mychoiceSdkComponents.checkDateIsSpecial(defaultMinDate, configState.minDates.g.specialDate);
1032
1033
  if (isOnlyG) {
1033
1034
  setMessage(gLicenceYear, gLicenceMonth);
@@ -1046,7 +1047,16 @@ you had insurance. If this is correct, please continue with the form.`);
1046
1047
  else {
1047
1048
  setHintMessage('');
1048
1049
  }
1049
- }, [listedYear, listedMonth, g1LicenceYear, g1LicenceMonth, firstLicenceAge, birthDate, gLicenceYear, gLicenceMonth]);
1050
+ }, [
1051
+ listedYear,
1052
+ listedMonth,
1053
+ g1LicenceYear,
1054
+ g1LicenceMonth,
1055
+ firstLicenceAge,
1056
+ birthDate,
1057
+ gLicenceYear,
1058
+ gLicenceMonth,
1059
+ ]);
1050
1060
  const handleInsuredChange = ({ value }) => {
1051
1061
  dispatchDriverInsuranceState({
1052
1062
  type: mychoiceSdkStore.StoreFormCarDriverInsuranceActionTypes.FormCarDriverInsuredSelect,
@@ -1099,12 +1109,11 @@ you had insurance. If this is correct, please continue with the form.`);
1099
1109
  });
1100
1110
  }
1101
1111
  };
1102
- return (jsxRuntime.jsxs("div", { className: `form-section ${mychoiceCls}`, children: [jsxRuntime.jsxs("div", { className: "box-container", children: [jsxRuntime.jsx(DateSelectFormBox, { name: "listedYear", dateNames: ['listedYear', 'listedMonth'], onDateChange: handleListedDateChange, defaultValue: defaultListedDate, disabled: !listed, title: `When was ${firstName || driverNameDefault} first listed as a driver on a Canadian or US insurance policy?`, description: "The selection indicates what year the main driver was first listed on a Canadian or US insurance policy. If you do not remember your age, it is acceptable to provide a best estimate for the purposes of the policy or quote.", errorMessage: listed ? getDateErrorMessage(['01', listedMonth, listedYear], driverState.inValidation) : '', error: driverState.inValidation, hintMessage: hintMessage, minDate: mychoiceSdkComponents.getMinDate(birthDate, firstLicenceAge) }), jsxRuntime.jsx(mychoiceSdkComponents.CheckboxForm, { name: "listed", label: "Never listed on an insurance policy", onChange: handleListedChange, defaultValue: !listed })] }), listed
1103
- && (jsxRuntime.jsxs("div", { className: "box-container", children: [jsxRuntime.jsx(SelectFormBox, { name: "insuredDate", onChange: handleInsuredPeriodChange, options: getPeriodOptions(listedYear, listedMonth), defaultValue: insuredDate, disabled: !insured, title: `How long has ${firstName || driverNameDefault} been with their current insurance provider?`, description: "It is common for insurers to provide loyalty rewards or discounts for valued customers. Loyalty is a positive trait in the industry, and most insurance companies will want to provide some incentive for continued customer relationships through tangible policy rewards.", errorMessage: insured ? getErrorMessage(insuredDate, driverState.inValidation) : '', error: !insuredDate && driverState.inValidation }), jsxRuntime.jsx(mychoiceSdkComponents.CheckboxForm, { name: "insured", label: "Not currently insured", onChange: handleInsuredChange, defaultValue: !insured })] })), jsxRuntime.jsx(DateSelectFormBox, { name: "policyStart", dateNames: ['policyStartYear', 'policyStartMonth', 'policyStartDay'], onDateChange: handlePolicyStartDateChange, defaultValue: defaultPolicyStartDate, title: "What is the ideal start date for your new insurance policy?", description: "Select your preferred date for the beginning of your new insurance policy.For instance, you may set the start date for the day that your current insurance expires to ensure that you\u2019re continuously covered. Alternatively, select today's date for a quote or new policy.", errorMessage: getDateErrorMessage([
1104
- policyStartDay || '',
1105
- policyStartMonth || '',
1106
- policyStartYear || '',
1107
- ], driverState.inValidation), error: driverState.inValidation, minDate: mychoiceSdkComponents.addDaysToDate('', 1), maxDate: mychoiceSdkComponents.addDaysToDate('', 60), isDay: true })] }));
1112
+ return (jsxRuntime.jsxs("div", { className: `form-section ${mychoiceCls}`, children: [jsxRuntime.jsxs("div", { className: "box-container", children: [jsxRuntime.jsx(DateSelectFormBox, { name: "listedYear", dateNames: ['listedYear', 'listedMonth'], onDateChange: handleListedDateChange, defaultValue: defaultListedDate, disabled: !listed, title: `When was ${firstName || driverNameDefault} first listed as a driver on a Canadian or US insurance policy?`, description: "The selection indicates what year the main driver was first listed on a Canadian or US insurance policy. If you do not remember your age, it is acceptable to provide a best estimate for the purposes of the policy or quote.", errorMessage: listed
1113
+ ? getDateErrorMessage(['01', listedMonth, listedYear], driverState.inValidation)
1114
+ : '', error: driverState.inValidation, hintMessage: hintMessage, minDate: mychoiceSdkComponents.getMinDate(birthDate, firstLicenceAge) }), jsxRuntime.jsx(mychoiceSdkComponents.CheckboxForm, { name: "listed", label: "Never listed on an insurance policy", onChange: handleListedChange, defaultValue: !listed })] }), listed && (jsxRuntime.jsxs("div", { className: "box-container", children: [jsxRuntime.jsx(SelectFormBox, { name: "insuredDate", onChange: handleInsuredPeriodChange, options: getPeriodOptions(listedYear, listedMonth), defaultValue: insuredDate, disabled: !insured, title: `How long has ${firstName || driverNameDefault} been with their current insurance provider?`, description: "It is common for insurers to provide loyalty rewards or discounts for valued customers. Loyalty is a positive trait in the industry, and most insurance companies will want to provide some incentive for continued customer relationships through tangible policy rewards.", errorMessage: insured
1115
+ ? getErrorMessage(insuredDate, driverState.inValidation)
1116
+ : '', error: !insuredDate && driverState.inValidation }), jsxRuntime.jsx(mychoiceSdkComponents.CheckboxForm, { name: "insured", label: "Not currently insured", onChange: handleInsuredChange, defaultValue: !insured })] })), jsxRuntime.jsx(DateSelectFormBox, { name: "policyStart", dateNames: ['policyStartYear', 'policyStartMonth', 'policyStartDay'], onDateChange: handlePolicyStartDateChange, defaultValue: defaultPolicyStartDate, title: "What is the ideal start date for your new insurance policy?", description: "Select your preferred date for the beginning of your new insurance policy.For instance, you may set the start date for the day that your current insurance expires to ensure that you\u2019re continuously covered. Alternatively, select today's date for a quote or new policy.", errorMessage: getDateErrorMessage([policyStartDay || '', policyStartMonth || '', policyStartYear || ''], driverState.inValidation), error: driverState.inValidation, minDate: mychoiceSdkComponents.addDaysToDate('', 1), maxDate: mychoiceSdkComponents.addDaysToDate('', 60), isDay: true })] }));
1108
1117
  };
1109
1118
 
1110
1119
  const SectionDriverCancellation = () => {
@@ -1752,7 +1761,7 @@ const BlockEndorsements = () => {
1752
1761
  };
1753
1762
 
1754
1763
  const SectionQuoteRecalc$1 = () => {
1755
- const { appConfigState: { appType } } = mychoiceSdkStore.useStoreAppConfig();
1764
+ const { appConfigState: { appType }, } = mychoiceSdkStore.useStoreAppConfig();
1756
1765
  const isTheBig = appType === mychoiceSdkComponents.AppTypes.TheBig;
1757
1766
  const mychoiceCls = appType === mychoiceSdkComponents.AppTypes.MyChoice ? 'mychoice' : '';
1758
1767
  const { vehicleState, dispatchVehicleState } = mychoiceSdkStore.useStoreFormCarVehicle();
@@ -3133,28 +3142,25 @@ const PageLifeQuote = () => {
3133
3142
  behavior: 'smooth',
3134
3143
  });
3135
3144
  });
3136
- console.log(items, "items");
3137
- return (jsxRuntime.jsx("div", { className: "quote-page-content", children: !appLoaderState.isOpen
3138
- && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("div", { className: "form-section-container", children: [appDeviceType === mychoiceSdkComponents.DeviceTypes.Mobile && (jsxRuntime.jsx(jsxRuntime.Fragment, { children: !!items?.length && (jsxRuntime.jsx(jsxRuntime.Fragment, { children: !quoteState.showCallMessage
3139
- ? (jsxRuntime.jsx("div", { className: "offer-container", children: jsxRuntime.jsx(OfferSection, { isBestOffer: true, offerCompany: items[0]?.company, brokerCompany: items[0]?.brokerProfile, offerPrice: {
3140
- monthly: items[0]?.priceMonthly,
3141
- yearly: items[0]?.priceYearly,
3142
- }, operationHours: {
3143
- saturdayHours: items[0]?.brokerProfile.hoursSaturday,
3144
- sundayHours: items[0]?.brokerProfile.hoursSunday,
3145
- weekdayHours: items[0]?.brokerProfile.hoursWorkdays,
3146
- }, phoneNumber: formatPhoneObject(items[0]?.brokerProfile.phone), redirectUrl: items[0]?.brokerProfile.redirectUrl || '' }) }))
3147
- : jsxRuntime.jsx(SplashScreen, {}) })) })), jsxRuntime.jsx(SectionQuoteEdit, {})] }), appDeviceType !== mychoiceSdkComponents.DeviceTypes.Mobile && quoteState.showCallMessage
3148
- && jsxRuntime.jsx(SplashScreen, {}), !quoteState.showCallMessage
3149
- && (jsxRuntime.jsx("div", { className: "offer-container", children: !!items?.length
3150
- && items.map(({ company, brokerProfile, priceMonthly, priceYearly, }, index) => (jsxRuntime.jsx("div", { children: (appDeviceType !== mychoiceSdkComponents.DeviceTypes.Mobile || (appDeviceType === mychoiceSdkComponents.DeviceTypes.Mobile && index !== 0)) && (jsxRuntime.jsx(OfferSection, { isBestOffer: index === 0, offerCompany: company, brokerCompany: brokerProfile, offerPrice: {
3151
- monthly: priceMonthly,
3152
- yearly: priceYearly,
3145
+ return (jsxRuntime.jsx("div", { className: "quote-page-content", children: !appLoaderState.isOpen && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("div", { className: "form-section-container", children: [appDeviceType === mychoiceSdkComponents.DeviceTypes.Mobile && (jsxRuntime.jsx(jsxRuntime.Fragment, { children: !!items?.length && (jsxRuntime.jsx(jsxRuntime.Fragment, { children: !quoteState.showCallMessage ? (jsxRuntime.jsx("div", { className: "offer-container", children: jsxRuntime.jsx(OfferSection, { isBestOffer: true, offerCompany: items[0]?.company, brokerCompany: items[0]?.brokerProfile, offerPrice: {
3146
+ monthly: items[0]?.priceMonthly,
3147
+ yearly: items[0]?.priceYearly,
3153
3148
  }, operationHours: {
3154
- saturdayHours: brokerProfile.hoursSaturday,
3155
- sundayHours: brokerProfile.hoursSunday,
3156
- weekdayHours: brokerProfile.hoursWorkdays,
3157
- }, phoneNumber: formatPhoneObject(brokerProfile.phone), redirectUrl: brokerProfile.redirectUrl || '' })) }, index))) }))] })) }));
3149
+ saturdayHours: items[0]?.brokerProfile.hoursSaturday,
3150
+ sundayHours: items[0]?.brokerProfile.hoursSunday,
3151
+ weekdayHours: items[0]?.brokerProfile.hoursWorkdays,
3152
+ }, phoneNumber: formatPhoneObject(items[0]?.brokerProfile.phone), redirectUrl: items[0]?.brokerProfile.redirectUrl || '' }) })) : (jsxRuntime.jsx(SplashScreen, {})) })) })), jsxRuntime.jsx(SectionQuoteEdit, {})] }), appDeviceType !== mychoiceSdkComponents.DeviceTypes.Mobile &&
3153
+ quoteState.showCallMessage && jsxRuntime.jsx(SplashScreen, {}), !quoteState.showCallMessage && (jsxRuntime.jsx("div", { className: "offer-container", children: !!items?.length &&
3154
+ items.map(({ company, brokerProfile, priceMonthly, priceYearly, }, index) => (jsxRuntime.jsx("div", { children: (appDeviceType !== mychoiceSdkComponents.DeviceTypes.Mobile ||
3155
+ (appDeviceType === mychoiceSdkComponents.DeviceTypes.Mobile &&
3156
+ index !== 0)) && (jsxRuntime.jsx(OfferSection, { isBestOffer: index === 0, offerCompany: company, brokerCompany: brokerProfile, offerPrice: {
3157
+ monthly: priceMonthly,
3158
+ yearly: priceYearly,
3159
+ }, operationHours: {
3160
+ saturdayHours: brokerProfile.hoursSaturday,
3161
+ sundayHours: brokerProfile.hoursSunday,
3162
+ weekdayHours: brokerProfile.hoursWorkdays,
3163
+ }, phoneNumber: formatPhoneObject(brokerProfile.phone), redirectUrl: brokerProfile.redirectUrl || '' })) }, index))) }))] })) }));
3158
3164
  };
3159
3165
 
3160
3166
  const getFormattedAddress = (unitNumber, streetAddress, city, provinceCode, postalCode, country) => {
@@ -3781,14 +3787,14 @@ const AppRouterListener = () => {
3781
3787
 
3782
3788
  const AppRouteWrapper = (props) => {
3783
3789
  const { children } = props;
3784
- const { appConfigState: { isReady, appType, insuranceType, localIndex, }, } = mychoiceSdkStore.useStoreAppConfig();
3790
+ const { appConfigState: { isReady, appType, insuranceType, localIndex }, } = mychoiceSdkStore.useStoreAppConfig();
3785
3791
  const { dispatchAppModalState } = mychoiceSdkStore.useStoreAppModal();
3786
3792
  const { postRequestQuote: carPostRequestQuote } = mychoiceSdkStore.CarQuoteDataHandler();
3787
3793
  const { postRequestQuote: homePostRequestQuote } = mychoiceSdkStore.HomeQuoteDataHandler();
3788
3794
  const { postRequestQuote: lifePostRequestQuote } = mychoiceSdkStore.LifeQuoteDataHandler();
3789
- const { postalState: { item: { postalCode: carPostal } } } = mychoiceSdkStore.useStoreFormCarPostal();
3790
- const { postalState: { item: { postalCode: homePostal } } } = mychoiceSdkStore.useStoreFormHomePostal();
3791
- const { postalState: { item: { postalCode: lifePostal } } } = mychoiceSdkStore.useStoreFormLifePostal();
3795
+ const { postalState: { item: { postalCode: carPostal }, }, } = mychoiceSdkStore.useStoreFormCarPostal();
3796
+ const { postalState: { item: { postalCode: homePostal }, }, } = mychoiceSdkStore.useStoreFormHomePostal();
3797
+ const { postalState: { item: { postalCode: lifePostal }, }, } = mychoiceSdkStore.useStoreFormLifePostal();
3792
3798
  // Car insurance states
3793
3799
  const { vehicleState } = mychoiceSdkStore.useStoreFormCarVehicle();
3794
3800
  const { driverState } = mychoiceSdkStore.useStoreFormCarDriverBase();
@@ -3814,9 +3820,9 @@ const AppRouteWrapper = (props) => {
3814
3820
  const { homeDiscountFormValidate, homeDiscountFormIsValid } = mychoiceSdkStore.useValidationHomeDiscount();
3815
3821
  // life insurance validation
3816
3822
  const { coverageFormValidate, coverageFormIsValid } = mychoiceSdkStore.useValidationCoverage();
3817
- const { applicantFormValidate: lifeApplicantFormValidate, applicantFormIsValid: lifeApplicantFormIsValid } = mychoiceSdkStore.useValidationLifeApplicant();
3823
+ const { applicantFormValidate: lifeApplicantFormValidate, applicantFormIsValid: lifeApplicantFormIsValid, } = mychoiceSdkStore.useValidationLifeApplicant();
3818
3824
  let postalCode = carPostal;
3819
- const { clearFormData, checkIsExpired, checkIsExpiredWithModal, } = mychoiceSdkStore.ClearFormDataHandler();
3825
+ const { clearFormData, checkIsExpired, checkIsExpiredWithModal } = mychoiceSdkStore.ClearFormDataHandler();
3820
3826
  const { appLoaderState } = mychoiceSdkStore.useStoreAppLoader();
3821
3827
  const isMychoice = appType === mychoiceSdkComponents.AppTypes.MyChoice;
3822
3828
  switch (insuranceType) {
@@ -3842,19 +3848,28 @@ const AppRouteWrapper = (props) => {
3842
3848
  key: 0,
3843
3849
  path: '/',
3844
3850
  name: 'Step 1',
3845
- validateOptions: { validate: vehicleFormValidate, isValid: vehicleFormIsValid },
3851
+ validateOptions: {
3852
+ validate: vehicleFormValidate,
3853
+ isValid: vehicleFormIsValid,
3854
+ },
3846
3855
  },
3847
3856
  {
3848
3857
  key: 1,
3849
3858
  path: '/driver',
3850
3859
  name: 'Step 2',
3851
- validateOptions: { validate: driverFormValidate, isValid: driverFormIsValid },
3860
+ validateOptions: {
3861
+ validate: driverFormValidate,
3862
+ isValid: driverFormIsValid,
3863
+ },
3852
3864
  },
3853
3865
  {
3854
3866
  key: 2,
3855
3867
  path: '/discount',
3856
3868
  name: 'Step 3',
3857
- validateOptions: { validate: carDiscountFormValidate, isValid: carDiscountFormIsValid },
3869
+ validateOptions: {
3870
+ validate: carDiscountFormValidate,
3871
+ isValid: carDiscountFormIsValid,
3872
+ },
3858
3873
  requestFn: carPostRequestQuote,
3859
3874
  },
3860
3875
  ],
@@ -3863,25 +3878,37 @@ const AppRouteWrapper = (props) => {
3863
3878
  key: 0,
3864
3879
  path: '/',
3865
3880
  name: 'Step 1',
3866
- validateOptions: { validate: addressFormValidate, isValid: addressFormIsValid },
3881
+ validateOptions: {
3882
+ validate: addressFormValidate,
3883
+ isValid: addressFormIsValid,
3884
+ },
3867
3885
  },
3868
3886
  {
3869
3887
  key: 1,
3870
3888
  path: '/applicant',
3871
3889
  name: 'Step 2',
3872
- validateOptions: { validate: applicantFormValidate, isValid: applicantFormIsValid },
3890
+ validateOptions: {
3891
+ validate: applicantFormValidate,
3892
+ isValid: applicantFormIsValid,
3893
+ },
3873
3894
  },
3874
3895
  {
3875
3896
  key: 2,
3876
3897
  path: '/property',
3877
3898
  name: 'Step 3',
3878
- validateOptions: { validate: dwellingFormValidate, isValid: dwellingFormIsValid },
3899
+ validateOptions: {
3900
+ validate: dwellingFormValidate,
3901
+ isValid: dwellingFormIsValid,
3902
+ },
3879
3903
  },
3880
3904
  {
3881
3905
  key: 3,
3882
3906
  path: '/discount',
3883
3907
  name: 'Step 4',
3884
- validateOptions: { validate: homeDiscountFormValidate, isValid: homeDiscountFormIsValid },
3908
+ validateOptions: {
3909
+ validate: homeDiscountFormValidate,
3910
+ isValid: homeDiscountFormIsValid,
3911
+ },
3885
3912
  requestFn: homePostRequestQuote,
3886
3913
  },
3887
3914
  ],
@@ -3890,25 +3917,37 @@ const AppRouteWrapper = (props) => {
3890
3917
  key: 0,
3891
3918
  path: '/',
3892
3919
  name: 'Step 1',
3893
- validateOptions: { validate: addressFormValidate, isValid: addressFormIsValid },
3920
+ validateOptions: {
3921
+ validate: addressFormValidate,
3922
+ isValid: addressFormIsValid,
3923
+ },
3894
3924
  },
3895
3925
  {
3896
3926
  key: 1,
3897
3927
  path: '/applicant',
3898
3928
  name: 'Step 2',
3899
- validateOptions: { validate: applicantFormValidate, isValid: applicantFormIsValid },
3929
+ validateOptions: {
3930
+ validate: applicantFormValidate,
3931
+ isValid: applicantFormIsValid,
3932
+ },
3900
3933
  },
3901
3934
  {
3902
3935
  key: 2,
3903
3936
  path: '/property',
3904
3937
  name: 'Step 3',
3905
- validateOptions: { validate: dwellingFormValidate, isValid: dwellingFormIsValid },
3938
+ validateOptions: {
3939
+ validate: dwellingFormValidate,
3940
+ isValid: dwellingFormIsValid,
3941
+ },
3906
3942
  },
3907
3943
  {
3908
3944
  key: 3,
3909
3945
  path: '/discount',
3910
3946
  name: 'Step 4',
3911
- validateOptions: { validate: homeDiscountFormValidate, isValid: homeDiscountFormIsValid },
3947
+ validateOptions: {
3948
+ validate: homeDiscountFormValidate,
3949
+ isValid: homeDiscountFormIsValid,
3950
+ },
3912
3951
  requestFn: homePostRequestQuote,
3913
3952
  },
3914
3953
  ],
@@ -3917,25 +3956,37 @@ const AppRouteWrapper = (props) => {
3917
3956
  key: 0,
3918
3957
  path: '/',
3919
3958
  name: 'Step 1',
3920
- validateOptions: { validate: addressFormValidate, isValid: addressFormIsValid },
3959
+ validateOptions: {
3960
+ validate: addressFormValidate,
3961
+ isValid: addressFormIsValid,
3962
+ },
3921
3963
  },
3922
3964
  {
3923
3965
  key: 1,
3924
3966
  path: '/applicant',
3925
3967
  name: 'Step 2',
3926
- validateOptions: { validate: applicantFormValidate, isValid: applicantFormIsValid },
3968
+ validateOptions: {
3969
+ validate: applicantFormValidate,
3970
+ isValid: applicantFormIsValid,
3971
+ },
3927
3972
  },
3928
3973
  {
3929
3974
  key: 2,
3930
3975
  path: '/property',
3931
3976
  name: 'Step 3',
3932
- validateOptions: { validate: dwellingFormValidate, isValid: dwellingFormIsValid },
3977
+ validateOptions: {
3978
+ validate: dwellingFormValidate,
3979
+ isValid: dwellingFormIsValid,
3980
+ },
3933
3981
  },
3934
3982
  {
3935
3983
  key: 3,
3936
3984
  path: '/discount',
3937
3985
  name: 'Step 4',
3938
- validateOptions: { validate: homeDiscountFormValidate, isValid: homeDiscountFormIsValid },
3986
+ validateOptions: {
3987
+ validate: homeDiscountFormValidate,
3988
+ isValid: homeDiscountFormIsValid,
3989
+ },
3939
3990
  requestFn: homePostRequestQuote,
3940
3991
  },
3941
3992
  ],
@@ -3944,13 +3995,19 @@ const AppRouteWrapper = (props) => {
3944
3995
  key: 0,
3945
3996
  path: '/',
3946
3997
  name: 'Step 1',
3947
- validateOptions: { validate: coverageFormValidate, isValid: coverageFormIsValid },
3998
+ validateOptions: {
3999
+ validate: coverageFormValidate,
4000
+ isValid: coverageFormIsValid,
4001
+ },
3948
4002
  },
3949
4003
  {
3950
4004
  key: 1,
3951
4005
  path: '/applicant',
3952
4006
  name: 'Step 2',
3953
- validateOptions: { validate: lifeApplicantFormValidate, isValid: lifeApplicantFormIsValid },
4007
+ validateOptions: {
4008
+ validate: lifeApplicantFormValidate,
4009
+ isValid: lifeApplicantFormIsValid,
4010
+ },
3954
4011
  requestFn: lifePostRequestQuote,
3955
4012
  },
3956
4013
  ],
@@ -3961,7 +4018,10 @@ const AppRouteWrapper = (props) => {
3961
4018
  React.useEffect(() => {
3962
4019
  let filteredSteps = formSteps[insuranceType];
3963
4020
  let filteredHooks = formValidationHooks[insuranceType];
3964
- if (isCompleted && (insuranceType === mychoiceSdkComponents.InsuranceTypes.Home || insuranceType === mychoiceSdkComponents.InsuranceTypes.Condo || insuranceType === mychoiceSdkComponents.InsuranceTypes.Tenant)) {
4021
+ if (isCompleted &&
4022
+ (insuranceType === mychoiceSdkComponents.InsuranceTypes.Home ||
4023
+ insuranceType === mychoiceSdkComponents.InsuranceTypes.Condo ||
4024
+ insuranceType === mychoiceSdkComponents.InsuranceTypes.Tenant)) {
3965
4025
  filteredSteps = formSteps[insuranceType].filter((item) => item.path !== '/property');
3966
4026
  filteredHooks = formValidationHooks[insuranceType].filter((item) => item.path !== '/property');
3967
4027
  }
@@ -4028,7 +4088,12 @@ const AppRouteWrapper = (props) => {
4028
4088
  }
4029
4089
  }
4030
4090
  }, [carPostal, homePostal, lifePostal, isReady]);
4031
- return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: isReady && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(AppHeader, {}), jsxRuntime.jsx(AppModal, {}), insuranceType && (jsxRuntime.jsx(NavigationTop, { title: `${insuranceType.replace(/^./, insuranceType[0].toUpperCase())} Insurance Quote`, postalCode: postalCode, formSteps: steps, validationHooks: validationHooks, clearForm: clearFormData, propertyIsCompleted: isCompleted })), insuranceType && appType === mychoiceSdkComponents.AppTypes.MyChoice && (jsxRuntime.jsx("div", { className: localIndex !== mychoiceSdkComponents.defaultLocalIndex ? 'step-progress-bar-partner' : 'step-progress-bar', children: jsxRuntime.jsx("span", { style: { width: progressLength } }) })), jsxRuntime.jsx("div", { className: `${insuranceType ? 'form-page-content' : ''} ${insuranceType && appType === mychoiceSdkComponents.AppTypes.MyChoice ? 'mychoice' : ''}`, children: insuranceType && appType === mychoiceSdkComponents.AppTypes.MyChoice && isDesktop && progressLength ? (jsxRuntime.jsx(jsxRuntime.Fragment, { children: jsxRuntime.jsxs("div", { className: "mychoice-content", children: [jsxRuntime.jsx(StepsBox, { className: "step-box", formSteps: steps, validationHooks: validationHooks, propertyIsCompleted: isCompleted }), children, jsxRuntime.jsx("div", { className: "empty-steps-container" })] }) })) : children }), isMychoice && !appLoaderState.isOpen && jsxRuntime.jsx(ProviderImageFooter, {})] })) }));
4091
+ return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: isReady && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(AppHeader, {}), jsxRuntime.jsx(AppModal, {}), insuranceType && (jsxRuntime.jsx(NavigationTop, { title: `${insuranceType.replace(/^./, insuranceType[0].toUpperCase())} Insurance Quote`, postalCode: postalCode, formSteps: steps, validationHooks: validationHooks, clearForm: clearFormData, propertyIsCompleted: isCompleted })), insuranceType && appType === mychoiceSdkComponents.AppTypes.MyChoice && (jsxRuntime.jsx("div", { className: localIndex !== mychoiceSdkComponents.defaultLocalIndex
4092
+ ? 'step-progress-bar-partner'
4093
+ : 'step-progress-bar', children: jsxRuntime.jsx("span", { style: { width: progressLength } }) })), jsxRuntime.jsx("div", { className: `${insuranceType ? 'form-page-content' : ''} ${insuranceType && appType === mychoiceSdkComponents.AppTypes.MyChoice ? 'mychoice' : ''}`, children: insuranceType &&
4094
+ appType === mychoiceSdkComponents.AppTypes.MyChoice &&
4095
+ isDesktop &&
4096
+ progressLength ? (jsxRuntime.jsx(jsxRuntime.Fragment, { children: jsxRuntime.jsxs("div", { className: "mychoice-content", children: [jsxRuntime.jsx(StepsBox, { className: "step-box", formSteps: steps, validationHooks: validationHooks, propertyIsCompleted: isCompleted }), children, jsxRuntime.jsx("div", { className: "empty-steps-container" })] }) })) : (children) }), isMychoice && !appLoaderState.isOpen && jsxRuntime.jsx(ProviderImageFooter, {})] })) }));
4032
4097
  };
4033
4098
  const NestedRoutes = () => {
4034
4099
  const insuranceType = mychoiceSdkComponents.getInsuranceType();
@@ -4039,10 +4104,11 @@ const NestedRoutes = () => {
4039
4104
  payload: true,
4040
4105
  });
4041
4106
  });
4042
- return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: appConfigState.drawWrapper && (jsxRuntime.jsx(jsxRuntime.Fragment, { children: jsxRuntime.jsxs(reactRouterDom.Routes, { children: [jsxRuntime.jsx(reactRouterDom.Route, { path: "*", element: jsxRuntime.jsx(reactRouterDom.Navigate, { to: { pathname: `/${appConfigState.localIndex || mychoiceSdkComponents.defaultLocalIndex}/${insuranceType}` } }) }), insuranceType === mychoiceSdkComponents.InsuranceTypes.Car
4043
- && (jsxRuntime.jsxs(reactRouterDom.Route, { path: "car", children: [jsxRuntime.jsx(reactRouterDom.Route, { index: true, element: (jsxRuntime.jsx(AppRouteWrapper, { insuranceType: insuranceType, children: jsxRuntime.jsx(RouteWrapperPublic, { children: jsxRuntime.jsx(PageVehicle, {}) }) })) }), jsxRuntime.jsx(reactRouterDom.Route, { path: "driver", element: (jsxRuntime.jsx(AppRouteWrapper, { insuranceType: insuranceType, children: jsxRuntime.jsx(RouteWrapperPublic, { children: jsxRuntime.jsx(PageDriver, {}) }) })) }), jsxRuntime.jsx(reactRouterDom.Route, { path: "discount", element: (jsxRuntime.jsx(AppRouteWrapper, { insuranceType: insuranceType, children: jsxRuntime.jsx(RouteWrapperPublic, { children: jsxRuntime.jsx(PageCarDiscount, {}) }) })) }), jsxRuntime.jsx(reactRouterDom.Route, { path: "quotes", element: (jsxRuntime.jsx(AppRouteWrapper, { insuranceType: insuranceType, children: jsxRuntime.jsx(RouteWrapperPublic, { children: jsxRuntime.jsx(PageCarQuote, {}) }) })) }), jsxRuntime.jsx(reactRouterDom.Route, { path: "offer", element: (jsxRuntime.jsx(AppRouteWrapper, { insuranceType: insuranceType, children: jsxRuntime.jsx(RouteWrapperPublic, { children: jsxRuntime.jsx(PageCarQuote, {}) }) })) })] })), jsxRuntime.jsxs(reactRouterDom.Route, { path: "home", children: [jsxRuntime.jsx(reactRouterDom.Route, { index: true, element: (jsxRuntime.jsx(AppRouteWrapper, { insuranceType: mychoiceSdkComponents.InsuranceTypes.Home, children: jsxRuntime.jsx(RouteWrapperPublic, { children: jsxRuntime.jsx(PageAddress, {}) }) })) }), jsxRuntime.jsx(reactRouterDom.Route, { path: "applicant", element: (jsxRuntime.jsx(AppRouteWrapper, { insuranceType: mychoiceSdkComponents.InsuranceTypes.Home, children: jsxRuntime.jsx(RouteWrapperPublic, { children: jsxRuntime.jsx(PageApplicant, {}) }) })) }), jsxRuntime.jsx(reactRouterDom.Route, { path: "property", element: (jsxRuntime.jsx(AppRouteWrapper, { insuranceType: mychoiceSdkComponents.InsuranceTypes.Home, children: jsxRuntime.jsx(RouteWrapperPublic, { children: jsxRuntime.jsx(PageProperty, {}) }) })) }), jsxRuntime.jsx(reactRouterDom.Route, { path: "discount", element: (jsxRuntime.jsx(AppRouteWrapper, { insuranceType: mychoiceSdkComponents.InsuranceTypes.Home, children: jsxRuntime.jsx(RouteWrapperPublic, { children: jsxRuntime.jsx(PageHomeDiscount, {}) }) })) }), jsxRuntime.jsx(reactRouterDom.Route, { path: "quotes", element: (jsxRuntime.jsx(AppRouteWrapper, { insuranceType: mychoiceSdkComponents.InsuranceTypes.Home, children: jsxRuntime.jsx(RouteWrapperPublic, { children: jsxRuntime.jsx(PageHomeQuote, {}) }) })) })] }), jsxRuntime.jsxs(reactRouterDom.Route, { path: "condo", children: [jsxRuntime.jsx(reactRouterDom.Route, { index: true, element: (jsxRuntime.jsx(AppRouteWrapper, { insuranceType: mychoiceSdkComponents.InsuranceTypes.Condo, children: jsxRuntime.jsx(RouteWrapperPublic, { children: jsxRuntime.jsx(PageAddress, {}) }) })) }), jsxRuntime.jsx(reactRouterDom.Route, { path: "applicant", element: (jsxRuntime.jsx(AppRouteWrapper, { insuranceType: mychoiceSdkComponents.InsuranceTypes.Condo, children: jsxRuntime.jsx(RouteWrapperPublic, { children: jsxRuntime.jsx(PageApplicant, {}) }) })) }), jsxRuntime.jsx(reactRouterDom.Route, { path: "property", element: (jsxRuntime.jsx(AppRouteWrapper, { insuranceType: mychoiceSdkComponents.InsuranceTypes.Condo, children: jsxRuntime.jsx(RouteWrapperPublic, { children: jsxRuntime.jsx(PageProperty, {}) }) })) }), jsxRuntime.jsx(reactRouterDom.Route, { path: "discount", element: (jsxRuntime.jsx(AppRouteWrapper, { insuranceType: mychoiceSdkComponents.InsuranceTypes.Condo, children: jsxRuntime.jsx(RouteWrapperPublic, { children: jsxRuntime.jsx(PageHomeDiscount, {}) }) })) }), jsxRuntime.jsx(reactRouterDom.Route, { path: "quotes", element: (jsxRuntime.jsx(AppRouteWrapper, { insuranceType: mychoiceSdkComponents.InsuranceTypes.Condo, children: jsxRuntime.jsx(RouteWrapperPublic, { children: jsxRuntime.jsx(PageHomeQuote, {}) }) })) })] }), jsxRuntime.jsxs(reactRouterDom.Route, { path: "tenant", children: [jsxRuntime.jsx(reactRouterDom.Route, { index: true, element: (jsxRuntime.jsx(AppRouteWrapper, { insuranceType: mychoiceSdkComponents.InsuranceTypes.Tenant, children: jsxRuntime.jsx(RouteWrapperPublic, { children: jsxRuntime.jsx(PageAddress, {}) }) })) }), jsxRuntime.jsx(reactRouterDom.Route, { path: "applicant", element: (jsxRuntime.jsx(AppRouteWrapper, { insuranceType: mychoiceSdkComponents.InsuranceTypes.Tenant, children: jsxRuntime.jsx(RouteWrapperPublic, { children: jsxRuntime.jsx(PageApplicant, {}) }) })) }), jsxRuntime.jsx(reactRouterDom.Route, { path: "property", element: (jsxRuntime.jsx(AppRouteWrapper, { insuranceType: mychoiceSdkComponents.InsuranceTypes.Tenant, children: jsxRuntime.jsx(RouteWrapperPublic, { children: jsxRuntime.jsx(PageProperty, {}) }) })) }), jsxRuntime.jsx(reactRouterDom.Route, { path: "discount", element: (jsxRuntime.jsx(AppRouteWrapper, { insuranceType: mychoiceSdkComponents.InsuranceTypes.Tenant, children: jsxRuntime.jsx(RouteWrapperPublic, { children: jsxRuntime.jsx(PageHomeDiscount, {}) }) })) }), jsxRuntime.jsx(reactRouterDom.Route, { path: "quotes", element: (jsxRuntime.jsx(AppRouteWrapper, { insuranceType: mychoiceSdkComponents.InsuranceTypes.Tenant, children: jsxRuntime.jsx(RouteWrapperPublic, { children: jsxRuntime.jsx(PageHomeQuote, {}) }) })) })] }), jsxRuntime.jsxs(reactRouterDom.Route, { path: "life", children: [jsxRuntime.jsx(reactRouterDom.Route, { index: true, element: (jsxRuntime.jsx(AppRouteWrapper, { insuranceType: mychoiceSdkComponents.InsuranceTypes.Life, children: jsxRuntime.jsx(RouteWrapperPublic, { children: jsxRuntime.jsx(PageCoverage, {}) }) })) }), jsxRuntime.jsx(reactRouterDom.Route, { path: "applicant", element: (jsxRuntime.jsx(AppRouteWrapper, { insuranceType: mychoiceSdkComponents.InsuranceTypes.Life, children: jsxRuntime.jsx(RouteWrapperPublic, { children: jsxRuntime.jsx(PageLifeApplicant, {}) }) })) }), jsxRuntime.jsx(reactRouterDom.Route, { path: "quotes", element: (jsxRuntime.jsx(AppRouteWrapper, { insuranceType: mychoiceSdkComponents.InsuranceTypes.Life, children: jsxRuntime.jsx(RouteWrapperPublic, { children: jsxRuntime.jsx(PageLifeQuote, {}) }) })) })] })] }) })) }));
4107
+ return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: appConfigState.drawWrapper && (jsxRuntime.jsx(jsxRuntime.Fragment, { children: jsxRuntime.jsxs(reactRouterDom.Routes, { children: [jsxRuntime.jsx(reactRouterDom.Route, { path: "*", element: jsxRuntime.jsx(reactRouterDom.Navigate, { to: {
4108
+ pathname: `/${appConfigState.localIndex || mychoiceSdkComponents.defaultLocalIndex}/${insuranceType}`,
4109
+ } }) }), insuranceType === mychoiceSdkComponents.InsuranceTypes.Car && (jsxRuntime.jsxs(reactRouterDom.Route, { path: "car", children: [jsxRuntime.jsx(reactRouterDom.Route, { index: true, element: jsxRuntime.jsx(AppRouteWrapper, { insuranceType: insuranceType, children: jsxRuntime.jsx(RouteWrapperPublic, { children: jsxRuntime.jsx(PageVehicle, {}) }) }) }), jsxRuntime.jsx(reactRouterDom.Route, { path: "driver", element: jsxRuntime.jsx(AppRouteWrapper, { insuranceType: insuranceType, children: jsxRuntime.jsx(RouteWrapperPublic, { children: jsxRuntime.jsx(PageDriver, {}) }) }) }), jsxRuntime.jsx(reactRouterDom.Route, { path: "discount", element: jsxRuntime.jsx(AppRouteWrapper, { insuranceType: insuranceType, children: jsxRuntime.jsx(RouteWrapperPublic, { children: jsxRuntime.jsx(PageCarDiscount, {}) }) }) }), jsxRuntime.jsx(reactRouterDom.Route, { path: "quotes", element: jsxRuntime.jsx(AppRouteWrapper, { insuranceType: insuranceType, children: jsxRuntime.jsx(RouteWrapperPublic, { children: jsxRuntime.jsx(PageCarQuote, {}) }) }) }), jsxRuntime.jsx(reactRouterDom.Route, { path: "offer", element: jsxRuntime.jsx(AppRouteWrapper, { insuranceType: insuranceType, children: jsxRuntime.jsx(RouteWrapperPublic, { children: jsxRuntime.jsx(PageCarQuote, {}) }) }) })] })), jsxRuntime.jsxs(reactRouterDom.Route, { path: "home", children: [jsxRuntime.jsx(reactRouterDom.Route, { index: true, element: jsxRuntime.jsx(AppRouteWrapper, { insuranceType: mychoiceSdkComponents.InsuranceTypes.Home, children: jsxRuntime.jsx(RouteWrapperPublic, { children: jsxRuntime.jsx(PageAddress, {}) }) }) }), jsxRuntime.jsx(reactRouterDom.Route, { path: "applicant", element: jsxRuntime.jsx(AppRouteWrapper, { insuranceType: mychoiceSdkComponents.InsuranceTypes.Home, children: jsxRuntime.jsx(RouteWrapperPublic, { children: jsxRuntime.jsx(PageApplicant, {}) }) }) }), jsxRuntime.jsx(reactRouterDom.Route, { path: "property", element: jsxRuntime.jsx(AppRouteWrapper, { insuranceType: mychoiceSdkComponents.InsuranceTypes.Home, children: jsxRuntime.jsx(RouteWrapperPublic, { children: jsxRuntime.jsx(PageProperty, {}) }) }) }), jsxRuntime.jsx(reactRouterDom.Route, { path: "discount", element: jsxRuntime.jsx(AppRouteWrapper, { insuranceType: mychoiceSdkComponents.InsuranceTypes.Home, children: jsxRuntime.jsx(RouteWrapperPublic, { children: jsxRuntime.jsx(PageHomeDiscount, {}) }) }) }), jsxRuntime.jsx(reactRouterDom.Route, { path: "quotes", element: jsxRuntime.jsx(AppRouteWrapper, { insuranceType: mychoiceSdkComponents.InsuranceTypes.Home, children: jsxRuntime.jsx(RouteWrapperPublic, { children: jsxRuntime.jsx(PageHomeQuote, {}) }) }) })] }), jsxRuntime.jsxs(reactRouterDom.Route, { path: "condo", children: [jsxRuntime.jsx(reactRouterDom.Route, { index: true, element: jsxRuntime.jsx(AppRouteWrapper, { insuranceType: mychoiceSdkComponents.InsuranceTypes.Condo, children: jsxRuntime.jsx(RouteWrapperPublic, { children: jsxRuntime.jsx(PageAddress, {}) }) }) }), jsxRuntime.jsx(reactRouterDom.Route, { path: "applicant", element: jsxRuntime.jsx(AppRouteWrapper, { insuranceType: mychoiceSdkComponents.InsuranceTypes.Condo, children: jsxRuntime.jsx(RouteWrapperPublic, { children: jsxRuntime.jsx(PageApplicant, {}) }) }) }), jsxRuntime.jsx(reactRouterDom.Route, { path: "property", element: jsxRuntime.jsx(AppRouteWrapper, { insuranceType: mychoiceSdkComponents.InsuranceTypes.Condo, children: jsxRuntime.jsx(RouteWrapperPublic, { children: jsxRuntime.jsx(PageProperty, {}) }) }) }), jsxRuntime.jsx(reactRouterDom.Route, { path: "discount", element: jsxRuntime.jsx(AppRouteWrapper, { insuranceType: mychoiceSdkComponents.InsuranceTypes.Condo, children: jsxRuntime.jsx(RouteWrapperPublic, { children: jsxRuntime.jsx(PageHomeDiscount, {}) }) }) }), jsxRuntime.jsx(reactRouterDom.Route, { path: "quotes", element: jsxRuntime.jsx(AppRouteWrapper, { insuranceType: mychoiceSdkComponents.InsuranceTypes.Condo, children: jsxRuntime.jsx(RouteWrapperPublic, { children: jsxRuntime.jsx(PageHomeQuote, {}) }) }) })] }), jsxRuntime.jsxs(reactRouterDom.Route, { path: "tenant", children: [jsxRuntime.jsx(reactRouterDom.Route, { index: true, element: jsxRuntime.jsx(AppRouteWrapper, { insuranceType: mychoiceSdkComponents.InsuranceTypes.Tenant, children: jsxRuntime.jsx(RouteWrapperPublic, { children: jsxRuntime.jsx(PageAddress, {}) }) }) }), jsxRuntime.jsx(reactRouterDom.Route, { path: "applicant", element: jsxRuntime.jsx(AppRouteWrapper, { insuranceType: mychoiceSdkComponents.InsuranceTypes.Tenant, children: jsxRuntime.jsx(RouteWrapperPublic, { children: jsxRuntime.jsx(PageApplicant, {}) }) }) }), jsxRuntime.jsx(reactRouterDom.Route, { path: "property", element: jsxRuntime.jsx(AppRouteWrapper, { insuranceType: mychoiceSdkComponents.InsuranceTypes.Tenant, children: jsxRuntime.jsx(RouteWrapperPublic, { children: jsxRuntime.jsx(PageProperty, {}) }) }) }), jsxRuntime.jsx(reactRouterDom.Route, { path: "discount", element: jsxRuntime.jsx(AppRouteWrapper, { insuranceType: mychoiceSdkComponents.InsuranceTypes.Tenant, children: jsxRuntime.jsx(RouteWrapperPublic, { children: jsxRuntime.jsx(PageHomeDiscount, {}) }) }) }), jsxRuntime.jsx(reactRouterDom.Route, { path: "quotes", element: jsxRuntime.jsx(AppRouteWrapper, { insuranceType: mychoiceSdkComponents.InsuranceTypes.Tenant, children: jsxRuntime.jsx(RouteWrapperPublic, { children: jsxRuntime.jsx(PageHomeQuote, {}) }) }) })] }), jsxRuntime.jsxs(reactRouterDom.Route, { path: "life", children: [jsxRuntime.jsx(reactRouterDom.Route, { index: true, element: jsxRuntime.jsx(AppRouteWrapper, { insuranceType: mychoiceSdkComponents.InsuranceTypes.Life, children: jsxRuntime.jsx(RouteWrapperPublic, { children: jsxRuntime.jsx(PageCoverage, {}) }) }) }), jsxRuntime.jsx(reactRouterDom.Route, { path: "applicant", element: jsxRuntime.jsx(AppRouteWrapper, { insuranceType: mychoiceSdkComponents.InsuranceTypes.Life, children: jsxRuntime.jsx(RouteWrapperPublic, { children: jsxRuntime.jsx(PageLifeApplicant, {}) }) }) }), jsxRuntime.jsx(reactRouterDom.Route, { path: "quotes", element: jsxRuntime.jsx(AppRouteWrapper, { insuranceType: mychoiceSdkComponents.InsuranceTypes.Life, children: jsxRuntime.jsx(RouteWrapperPublic, { children: jsxRuntime.jsx(PageLifeQuote, {}) }) }) })] })] }) })) }));
4044
4110
  };
4045
- const RedirectWithSearchParams = ({ to, path }) => {
4111
+ const RedirectWithSearchParams = ({ to, path, }) => {
4046
4112
  const insuranceType = mychoiceSdkComponents.getInsuranceType();
4047
4113
  mychoiceSdkStore.useStoreAppConfig();
4048
4114
  const [isRender, setIsRender] = React.useState(false);
@@ -4054,10 +4120,12 @@ const RedirectWithSearchParams = ({ to, path }) => {
4054
4120
  const toBasePath = to?.split('/')?.slice(-1)?.[0];
4055
4121
  mychoiceSdkComponents.useEffectOnce(() => {
4056
4122
  if (queryRoot.length > 1) {
4057
- const query = JSON.parse(`{"${decodeURI(queryRoot[1]).replace(/"/g, '\\"').replace(/&/g, '","').replace(/=/g, '":"')}"}`);
4058
- console.log(query, 'hm');
4123
+ const query = JSON.parse(`{"${decodeURI(queryRoot[1])
4124
+ .replace(/"/g, '\\"')
4125
+ .replace(/&/g, '","')
4126
+ .replace(/=/g, '":"')}"}`);
4059
4127
  if (!isRender) {
4060
- if (query.postal_code && (insuranceType !== mychoiceSdkComponents.InsuranceTypes.Life)) {
4128
+ if (query.postal_code && insuranceType !== mychoiceSdkComponents.InsuranceTypes.Life) {
4061
4129
  const formattedPostalCode = query.postal_code.replace(' ', '');
4062
4130
  getPostal(formattedPostalCode).then(() => {
4063
4131
  setIsRender(true);
@@ -4086,7 +4154,9 @@ const RedirectWithSearchParams = ({ to, path }) => {
4086
4154
  });
4087
4155
  }
4088
4156
  }
4089
- if (insuranceType === mychoiceSdkComponents.InsuranceTypes.Home || insuranceType === mychoiceSdkComponents.InsuranceTypes.Condo || insuranceType === mychoiceSdkComponents.InsuranceTypes.Tenant) {
4157
+ if (insuranceType === mychoiceSdkComponents.InsuranceTypes.Home ||
4158
+ insuranceType === mychoiceSdkComponents.InsuranceTypes.Condo ||
4159
+ insuranceType === mychoiceSdkComponents.InsuranceTypes.Tenant) {
4090
4160
  if (query.utm_source) {
4091
4161
  dispatchHomeDiscountState({
4092
4162
  type: mychoiceSdkStore.StoreFormHomeDiscountActionTypes.FormHomeUtmSourceSet,
@@ -4099,7 +4169,8 @@ const RedirectWithSearchParams = ({ to, path }) => {
4099
4169
  payload: { utmCampaign: query.utm_campaign },
4100
4170
  });
4101
4171
  }
4102
- if (path === 'broker' || ['home', 'condo', 'tenant'].includes(toBasePath)) {
4172
+ if (path === 'broker' ||
4173
+ ['home', 'condo', 'tenant'].includes(toBasePath)) {
4103
4174
  dispatchHomeDiscountState({
4104
4175
  type: mychoiceSdkStore.StoreFormHomeDiscountActionTypes.FormHomeQuoterBrokerInfoSet,
4105
4176
  payload: query,
@@ -4131,10 +4202,8 @@ const RedirectWithSearchParams = ({ to, path }) => {
4131
4202
  const AppRoutes = (props) => {
4132
4203
  const { appType } = props;
4133
4204
  const defaultInsuranceType = mychoiceSdkComponents.getInsuranceType();
4134
- const { appConfigState: { localIndex, insuranceType } } = mychoiceSdkStore.useStoreAppConfig();
4135
- return (jsxRuntime.jsxs(reactRouterDom.BrowserRouter, { children: [jsxRuntime.jsx(AppTitle, { appType: appType, insuranceType: insuranceType }), jsxRuntime.jsx(AppRouterListener, {}), jsxRuntime.jsxs(reactRouterDom.Routes, { children: [jsxRuntime.jsx(reactRouterDom.Route, { path: "/", element: (jsxRuntime.jsx(RedirectWithSearchParams, { to: `/${localIndex}/${defaultInsuranceType}` })) }), jsxRuntime.jsx(reactRouterDom.Route, { path: `/${localIndex}`, element: (jsxRuntime.jsx(RedirectWithSearchParams, { to: `/${localIndex}/${defaultInsuranceType}` })) }), jsxRuntime.jsx(reactRouterDom.Route, { path: "*", element: (jsxRuntime.jsx(RedirectWithSearchParams, { to: `/${localIndex}/${defaultInsuranceType}` })) }), jsxRuntime.jsx(reactRouterDom.Route, { path: "/broker", element: (jsxRuntime.jsx(RedirectWithSearchParams, { to: `/${localIndex}/${defaultInsuranceType}`, path: "broker" })
4136
- // <BrokerKeys redirectURL={`/${localIndex}/${defaultInsuranceType}`} />
4137
- ) }), jsxRuntime.jsx(reactRouterDom.Route, { path: `/${localIndex}`, element: (jsxRuntime.jsx(NestedRoutes, { appType: appType })) }), jsxRuntime.jsx(reactRouterDom.Route, { path: `/${localIndex}/*`, element: (jsxRuntime.jsx(NestedRoutes, { appType: appType })) }), jsxRuntime.jsx(reactRouterDom.Route, { path: "/postal/*", element: (jsxRuntime.jsx(RedirectWithSearchParams, { to: `/${localIndex}/${defaultInsuranceType}` })) }), jsxRuntime.jsx(reactRouterDom.Route, { path: "/auto/postal/*", element: (jsxRuntime.jsx(RedirectWithSearchParams, { to: `/${localIndex}/${defaultInsuranceType}` })) })] })] }));
4205
+ const { appConfigState: { localIndex, insuranceType }, } = mychoiceSdkStore.useStoreAppConfig();
4206
+ return (jsxRuntime.jsxs(reactRouterDom.BrowserRouter, { children: [jsxRuntime.jsx(AppTitle, { appType: appType, insuranceType: insuranceType }), jsxRuntime.jsx(AppRouterListener, {}), jsxRuntime.jsxs(reactRouterDom.Routes, { children: [jsxRuntime.jsx(reactRouterDom.Route, { path: "/", element: jsxRuntime.jsx(RedirectWithSearchParams, { to: `/${localIndex}/${defaultInsuranceType}` }) }), jsxRuntime.jsx(reactRouterDom.Route, { path: `/${localIndex}`, element: jsxRuntime.jsx(RedirectWithSearchParams, { to: `/${localIndex}/${defaultInsuranceType}` }) }), jsxRuntime.jsx(reactRouterDom.Route, { path: "*", element: jsxRuntime.jsx(RedirectWithSearchParams, { to: `/${localIndex}/${defaultInsuranceType}` }) }), jsxRuntime.jsx(reactRouterDom.Route, { path: "/broker", element: jsxRuntime.jsx(RedirectWithSearchParams, { to: `/${localIndex}/${defaultInsuranceType}`, path: "broker" }) }), jsxRuntime.jsx(reactRouterDom.Route, { path: `/${localIndex}`, element: jsxRuntime.jsx(NestedRoutes, { appType: appType }) }), jsxRuntime.jsx(reactRouterDom.Route, { path: `/${localIndex}/*`, element: jsxRuntime.jsx(NestedRoutes, { appType: appType }) }), jsxRuntime.jsx(reactRouterDom.Route, { path: "/postal/*", element: jsxRuntime.jsx(RedirectWithSearchParams, { to: `/${localIndex}/${defaultInsuranceType}` }) }), jsxRuntime.jsx(reactRouterDom.Route, { path: "/auto/postal/*", element: jsxRuntime.jsx(RedirectWithSearchParams, { to: `/${localIndex}/${defaultInsuranceType}` }) })] })] }));
4138
4207
  };
4139
4208
 
4140
4209
  const AppLoader = () => {