@mychoice/mychoice-sdk-modules 2.1.59 → 2.1.61

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
@@ -182,12 +182,17 @@ var logo = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAA80AAAEGCAYAAABfBnerAA
182
182
  const TITLE = {
183
183
  car: 'Hello Canadian Drivers, Welcome to MyChoice!',
184
184
  home: 'Hello Canadian Residents, Welcome to MyChoice!',
185
+ life: 'Hello Canadian Residents, Welcome to MyChoice!',
185
186
  };
186
187
  const TEXT = {
187
188
  car: 'Our apologies but unfortunately, we are unable to provide you with an auto insurance rate in your home province at this current time however we are actively working on adding partners to our platform who will be able to provide you with a rate in the near future! Please check back with us at a later date, in the meantime, drive safely!',
188
189
  home: 'Our apologies but unfortunately, we are unable to provide you with an property insurance rate in your home province at this current time however we are actively working on adding partners to our platform who will be able to provide you with a rate in the near future! Please check back with us at a later date, in the meantime, stay safe!',
190
+ life: 'Our apologies but unfortunately, we are unable to provide you with an life insurance rate in your home province at this current time however we are actively working on adding more partners to our platform who will be able to provide you with a rate in the near future! Please check back with us at a later date, in the meantime, stay safe!',
189
191
  };
190
192
  const NoQuotesMessage = ({ type }) => {
193
+ const { appConfigState: { appType }, } = mychoiceSdkStore.useStoreAppConfig();
194
+ if (appType === mychoiceSdkComponents.AppTypes.TheBig)
195
+ return null;
191
196
  return (jsxRuntime.jsxs("div", { className: "offer-section mychoice", children: [jsxRuntime.jsx("div", { style: { width: '100%' }, children: jsxRuntime.jsx("img", { src: logo, alt: "My Choice", style: { width: '120px' } }) }), jsxRuntime.jsx("p", { children: jsxRuntime.jsx("h3", { style: { whiteSpace: 'normal' }, children: TITLE[type] }) }), jsxRuntime.jsx("p", { style: { lineHeight: '1.25rem' }, children: TEXT[type] })] }));
192
197
  };
193
198
 
@@ -1527,7 +1532,7 @@ const PageDriver = () => {
1527
1532
  React.useEffect(() => {
1528
1533
  setIsRender(true);
1529
1534
  }, [isRender]);
1530
- return (jsxRuntime.jsxs("div", { className: "form-container", children: [jsxRuntime.jsx(TabDriver, { createItem: createDriver }), jsxRuntime.jsxs("div", { className: "form-section-container", children: [isRender && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(SectionDriverInfo, {}), jsxRuntime.jsx(SectionDriverLicence, {}), jsxRuntime.jsx(SectionDriverInsurancePolicy, {}), jsxRuntime.jsx(SectionDriverCancellation, {}), jsxRuntime.jsx(SectionDriverHistory, {}), jsxRuntime.jsx(HonestyMessage, {})] })), appType === mychoiceSdkComponents.AppTypes.TheBig ? (jsxRuntime.jsx(NavigationBottomTheBig, { createItem: createDriver, formSteps: formSteps[mychoiceSdkComponents.InsuranceTypes.Car], itemCount: items.length, validateForm: validateForm, formIsValid: driverFormIsValid })) : (jsxRuntime.jsx(NavigationBottom, { className: "mychoice", createItem: createDriver, formSteps: formSteps[mychoiceSdkComponents.InsuranceTypes.Car], itemCount: items.length, validateForm: validateForm, formIsValid: driverFormIsValid }))] }), localIndex !== mychoiceSdkComponents.defaultLocalIndex && (jsxRuntime.jsx("img", { className: "logo-for-partner", src: myChoicePartnerLogo, alt: "partner logo" }))] }));
1535
+ return (jsxRuntime.jsxs("div", { className: "form-container", children: [jsxRuntime.jsx(TabDriver, { createItem: createDriver }), jsxRuntime.jsxs("div", { className: "form-section-container", children: [isRender && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(SectionDriverInfo, {}), jsxRuntime.jsx(SectionDriverLicence, {}), jsxRuntime.jsx(SectionDriverInsurancePolicy, {}), jsxRuntime.jsx(SectionDriverCancellation, {}), jsxRuntime.jsx(SectionDriverHistory, {}), appType === mychoiceSdkComponents.AppTypes.MyChoice && jsxRuntime.jsx(HonestyMessage, {})] })), appType === mychoiceSdkComponents.AppTypes.TheBig ? (jsxRuntime.jsx(NavigationBottomTheBig, { createItem: createDriver, formSteps: formSteps[mychoiceSdkComponents.InsuranceTypes.Car], itemCount: items.length, validateForm: validateForm, formIsValid: driverFormIsValid })) : (jsxRuntime.jsx(NavigationBottom, { className: "mychoice", createItem: createDriver, formSteps: formSteps[mychoiceSdkComponents.InsuranceTypes.Car], itemCount: items.length, validateForm: validateForm, formIsValid: driverFormIsValid }))] }), localIndex !== mychoiceSdkComponents.defaultLocalIndex && (jsxRuntime.jsx("img", { className: "logo-for-partner", src: myChoicePartnerLogo, alt: "partner logo" }))] }));
1531
1536
  };
1532
1537
 
1533
1538
  const BlockVehLinks = () => {
@@ -1953,7 +1958,7 @@ const SectionAddress = () => {
1953
1958
  const { getPostal } = mychoiceSdkStore.useHandlerPostal(insuranceType);
1954
1959
  const { postalState: { item, inValidation }, dispatchPostalState, } = mychoiceSdkStore.useStoreFormHomePostal();
1955
1960
  const { dispatchApplicantBaseState } = mychoiceSdkStore.useStoreFormHomeApplicantBase();
1956
- const { streetAddress = '', postalCode = '', addressObject, errorMessage, } = item;
1961
+ const { streetAddress = '', postalCode = '', addressObject, errorMessage } = item;
1957
1962
  const navigate = reactRouterDom.useNavigate();
1958
1963
  const asyncSelectRef = React.useRef(null);
1959
1964
  const isMychoice = appType === mychoiceSdkComponents.AppTypes.MyChoice;
@@ -2054,7 +2059,7 @@ const SectionAddress = () => {
2054
2059
  console.error(error);
2055
2060
  });
2056
2061
  };
2057
- const handleOwnerTypeChange = ({ value: typeValue, }) => {
2062
+ const handleOwnerTypeChange = ({ value: typeValue }) => {
2058
2063
  dispatchDwellingState({
2059
2064
  type: mychoiceSdkStore.StoreFormHomeDwellingActionTypes.FormHomeDwellingClear,
2060
2065
  payload: { type: typeValue },
@@ -2135,7 +2140,7 @@ const SectionAddress = () => {
2135
2140
  const placeholderText = 'Type in Your Street Address';
2136
2141
  return (jsxRuntime.jsxs("div", { className: `form-section ${mychoiceCls}`, children: [jsxRuntime.jsx("h2", { className: "section-title", children: " Where do you reside and thrive? " }), jsxRuntime.jsx(SelectFormBox, { options: mychoiceSdkComponents.homeOwnerTypeOptions, name: "ownerType", onChange: handleOwnerTypeChange, defaultValue: insuranceType, title: "Type of Insurance", placeholder: "Select Type of Insurance", error: !insuranceType && inValidation, errorMessage: getErrorMessage(insuranceType, inValidation) }), jsxRuntime.jsxs("div", { className: "input-form-box-container", children: [jsxRuntime.jsx(LabelFormBox, { name: "homeAddress", title: "Home Address", subTitle: "The address should contain Street Address (example: '123 Main St'), City, Province Code, Postal Code, Country", description: "For your convenience, suggestions for your address will be displayed as you start typing. Please select an option from the list to continue. If you can\u2019t find your address in the list, please click \u201CI can\u2019t find my address. Let me type it in.\u201D and you will be directed to a page which will let you enter your address manually." }), jsxRuntime.jsx(GooglePlacesAutocomplete__default["default"], { autocompletionRequest: {
2137
2142
  componentRestrictions: { country: 'ca' },
2138
- }, apiKey: "AIzaSyCzQKD3HwxCezMrPsS4q_xFQ3g3TS4u1nY", selectProps: {
2143
+ }, apiKey: process.env.REACT_APP_HOME_SEARCH_GOOGLE_API_KEY, selectProps: {
2139
2144
  value: addressObject,
2140
2145
  onChange: handleAddressChange,
2141
2146
  placeholder: placeholderText,
@@ -2143,17 +2148,14 @@ const SectionAddress = () => {
2143
2148
  styles: {
2144
2149
  control: (baseStyles, state) => ({
2145
2150
  ...baseStyles,
2146
- borderColor: getErrorMessage(streetAddress && postalCode, inValidation) ||
2147
- errorMessage
2151
+ borderColor: getErrorMessage(streetAddress && postalCode, inValidation) || errorMessage
2148
2152
  ? 'red'
2149
2153
  : getBorderColor(state.isFocused),
2150
2154
  borderRadius: isMychoice ? '0.625rem' : '0.25rem',
2151
2155
  boxShadow: 'none',
2152
2156
  height: '3.75rem',
2153
2157
  ':hover': {
2154
- borderColor: getErrorMessage(streetAddress && postalCode, inValidation) || errorMessage
2155
- ? 'red'
2156
- : '#8ED6DC',
2158
+ borderColor: getErrorMessage(streetAddress && postalCode, inValidation) || errorMessage ? 'red' : '#8ED6DC',
2157
2159
  borderWidth: '0.125rem',
2158
2160
  cursor: 'pointer',
2159
2161
  },
@@ -3248,25 +3250,22 @@ const PageLifeQuote = () => {
3248
3250
  behavior: 'smooth',
3249
3251
  });
3250
3252
  });
3251
- 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: {
3253
+ 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: {
3252
3254
  monthly: items[0]?.priceMonthly,
3253
3255
  yearly: items[0]?.priceYearly,
3254
3256
  }, operationHours: {
3255
3257
  saturdayHours: items[0]?.brokerProfile.hoursSaturday,
3256
3258
  sundayHours: items[0]?.brokerProfile.hoursSunday,
3257
3259
  weekdayHours: items[0]?.brokerProfile.hoursWorkdays,
3258
- }, phoneNumber: formatPhoneObject(items[0]?.brokerProfile.phone), redirectUrl: items[0]?.brokerProfile.redirectUrl || '' }) })) : (jsxRuntime.jsx(SplashScreen, {})) })) })), jsxRuntime.jsx(SectionQuoteEdit, {})] }), appDeviceType !== mychoiceSdkComponents.DeviceTypes.Mobile &&
3259
- quoteState.showCallMessage && jsxRuntime.jsx(SplashScreen, {}), !quoteState.showCallMessage && (jsxRuntime.jsx("div", { className: "offer-container", children: !!items?.length &&
3260
- items.map(({ company, brokerProfile, priceMonthly, priceYearly, }, index) => (jsxRuntime.jsx("div", { children: (appDeviceType !== mychoiceSdkComponents.DeviceTypes.Mobile ||
3261
- (appDeviceType === mychoiceSdkComponents.DeviceTypes.Mobile &&
3262
- index !== 0)) && (jsxRuntime.jsx(OfferSection, { isBestOffer: index === 0, offerCompany: company, brokerCompany: brokerProfile, offerPrice: {
3263
- monthly: priceMonthly,
3264
- yearly: priceYearly,
3265
- }, operationHours: {
3266
- saturdayHours: brokerProfile.hoursSaturday,
3267
- sundayHours: brokerProfile.hoursSunday,
3268
- weekdayHours: brokerProfile.hoursWorkdays,
3269
- }, phoneNumber: formatPhoneObject(brokerProfile.phone), redirectUrl: brokerProfile.redirectUrl || '' })) }, index))) }))] })) }));
3260
+ }, phoneNumber: formatPhoneObject(items[0]?.brokerProfile.phone), redirectUrl: items[0]?.brokerProfile.redirectUrl || '' }) })) : (jsxRuntime.jsx(SplashScreen, {})) })) : (jsxRuntime.jsx(NoQuotesMessage, { type: "life" })) })), jsxRuntime.jsx(SectionQuoteEdit, {})] }), appDeviceType !== mychoiceSdkComponents.DeviceTypes.Mobile && quoteState.showCallMessage && jsxRuntime.jsx(SplashScreen, {}), !quoteState.showCallMessage && (jsxRuntime.jsx("div", { className: "offer-container", children: !!items?.length ? (items.map(({ company, brokerProfile, priceMonthly, priceYearly }, index) => (jsxRuntime.jsx("div", { children: (appDeviceType !== mychoiceSdkComponents.DeviceTypes.Mobile ||
3261
+ (appDeviceType === mychoiceSdkComponents.DeviceTypes.Mobile && index !== 0)) && (jsxRuntime.jsx(OfferSection, { isBestOffer: index === 0, offerCompany: company, brokerCompany: brokerProfile, offerPrice: {
3262
+ monthly: priceMonthly,
3263
+ yearly: priceYearly,
3264
+ }, operationHours: {
3265
+ saturdayHours: brokerProfile.hoursSaturday,
3266
+ sundayHours: brokerProfile.hoursSunday,
3267
+ weekdayHours: brokerProfile.hoursWorkdays,
3268
+ }, phoneNumber: formatPhoneObject(brokerProfile.phone), redirectUrl: brokerProfile.redirectUrl || '' })) }, index)))) : (jsxRuntime.jsx(NoQuotesMessage, { type: "life" })) }))] })) }));
3270
3269
  };
3271
3270
 
3272
3271
  const getFormattedAddress = (unitNumber, streetAddress, city, provinceCode, postalCode, country) => {