@mychoice/mychoice-sdk-modules 2.1.21 → 2.1.23

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
@@ -248,15 +248,21 @@ HeaderMyChoiceMobile.defaultProps = {
248
248
  className: '',
249
249
  };
250
250
 
251
- const LoaderVid = () => (
252
- // eslint-disable-next-line jsx-a11y/media-has-caption
253
- jsxRuntime.jsx("video", { src: "https://mychoice.ca/wp-content/uploads/2023/05/Pig-Video.mp4", autoPlay: true, loop: true, muted: true, preload: "auto", style: { maxHeight: '400px' } }));
251
+ const LoaderVid = () => {
252
+ const { appDeviceType } = mychoiceSdkStore.useStoreDeviceType();
253
+ const isMobile = appDeviceType === mychoiceSdkComponents.DeviceTypes.Mobile;
254
+ return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: isMobile ? jsxRuntime.jsx("video", { src: "https://mychoice.ca/wp-content/uploads/2023/05/Pig-Video.mp4", autoPlay: true, loop: true, muted: true, preload: "auto", style: { maxHeight: '300px' } })
255
+ : jsxRuntime.jsx("video", { src: "https://mychoice.ca/wp-content/uploads/2023/05/Pig-Video.mp4", autoPlay: true, loop: true, muted: true, preload: "auto", style: { maxHeight: '400px' } }) }));
256
+ };
254
257
 
255
258
  const LoaderPrimary = () => {
256
259
  const { appLoaderState } = mychoiceSdkStore.useStoreAppLoader();
257
260
  const { appConfigState } = mychoiceSdkStore.useStoreAppConfig();
258
261
  const isLastPage = window.location.pathname.includes('discount') || window.location.pathname.includes('/life/applicant');
259
- return (jsxRuntime.jsxs("div", { className: "loader-wrapper", children: [appConfigState.appType === mychoiceSdkComponents.AppTypes.TheBig || !isLastPage ? jsxRuntime.jsx(mychoiceSdkComponents.IconLoaderPrimary, {}) : jsxRuntime.jsx(LoaderVid, {}), !!appLoaderState.description && (jsxRuntime.jsx("h4", { children: appLoaderState.description.split('\n').map((line, index) => (jsxRuntime.jsxs("div", { children: [line, jsxRuntime.jsx("br", {})] }, index))) }))] }));
262
+ return (jsxRuntime.jsxs("div", { className: "loader-wrapper", children: [appConfigState.appType === mychoiceSdkComponents.AppTypes.TheBig || !isLastPage ? jsxRuntime.jsx(mychoiceSdkComponents.IconLoaderPrimary, {}) : jsxRuntime.jsx(LoaderVid, {}), !!appLoaderState.description && appLoaderState.description.includes('accurate')
263
+ ? (jsxRuntime.jsx("h4", { children: appLoaderState.description.split('\n').map((line, index) => (jsxRuntime.jsxs("div", { children: [line, jsxRuntime.jsx("br", {})] }, index))) }))
264
+ // eslint-disable-next-line react/no-unescaped-entities
265
+ : !appLoaderState.description && jsxRuntime.jsx("h4", { children: "'Hang tight, while we collect and process information about your property'" })] }));
260
266
  };
261
267
 
262
268
  const ModalConfirm = () => {
@@ -1780,8 +1786,10 @@ const SectionConfirm = () => {
1780
1786
  const { items: quotes } = quoteState;
1781
1787
  const { firstName, lastName, phone } = quoterInfo;
1782
1788
  const bestQuote = quotes.length ? quotes[0] : null;
1789
+ const { appConfigState: { localIndex, insuranceType } } = mychoiceSdkStore.useStoreAppConfig();
1783
1790
  const [comparedCountMax] = React.useState(lodash.random(1021, 1502));
1784
1791
  const [comparedCountMin, setComparedCountMin] = React.useState(1000);
1792
+ const navigate = reactRouterDom.useNavigate();
1785
1793
  React.useEffect(() => {
1786
1794
  if (comparedCountMin < comparedCountMax) {
1787
1795
  const intervalId = setInterval(() => {
@@ -1817,6 +1825,7 @@ const SectionConfirm = () => {
1817
1825
  top: 0,
1818
1826
  behavior: 'smooth',
1819
1827
  });
1828
+ navigate(`/${localIndex || mychoiceSdkComponents.defaultLocalIndex}/${insuranceType}/quotes`);
1820
1829
  };
1821
1830
  if (!bestQuote)
1822
1831
  return null;
@@ -1866,9 +1875,8 @@ const PageCarQuote = () => {
1866
1875
  top: 0,
1867
1876
  behavior: 'smooth',
1868
1877
  });
1869
- if (hasConfirmStep) {
1870
- const uniqueUrl = 'offer';
1871
- navigate(`/${localIndex || mychoiceSdkComponents.defaultLocalIndex}/${insuranceType}/quotes/${uniqueUrl}`);
1878
+ if (hasConfirmStep && !window.location.pathname.includes('/offer')) {
1879
+ navigate(`/${localIndex || mychoiceSdkComponents.defaultLocalIndex}/${insuranceType}/offer`);
1872
1880
  }
1873
1881
  });
1874
1882
  return (jsxRuntime.jsx("div", { className: `quote-page-content ${hasConfirmStep ? 'confirm-step' : ''}`, children: showContentWhileLoading && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [hasConfirmStep && jsxRuntime.jsx(BlockConfirmHeading, {}), jsxRuntime.jsxs("div", { className: "form-section-container", children: [appDeviceType === mychoiceSdkComponents.DeviceTypes.Mobile && !hasConfirmStep && (jsxRuntime.jsx(jsxRuntime.Fragment, { children: !!items?.length && (jsxRuntime.jsx(jsxRuntime.Fragment, { children: !quoteState.showCallMessage
@@ -4011,7 +4019,7 @@ const NestedRoutes = () => {
4011
4019
  });
4012
4020
  });
4013
4021
  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
4014
- && (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/:uniqueUrl", element: (jsxRuntime.jsx(AppRouteWrapper, { insuranceType: insuranceType, children: jsxRuntime.jsx(RouteWrapperPublic, { children: jsxRuntime.jsx(PageCarQuote, {}) }) })) }), jsxRuntime.jsx(reactRouterDom.Route, { path: "quotes", 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, {}) }) })) })] })] }) })) }));
4022
+ && (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, {}) }) })) })] })] }) })) }));
4015
4023
  };
4016
4024
  const RedirectWithSearchParams = ({ to, path }) => {
4017
4025
  const insuranceType = mychoiceSdkComponents.getInsuranceType();