@mychoice/mychoice-sdk-modules 2.2.25 → 2.2.27

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
@@ -928,6 +928,7 @@ const VehicleSectionMain = () => {
928
928
  const AccidentBenefitsModal = ({ selectedCoverages, onApply, onCancel, selectAllByDefault = false, }) => {
929
929
  const { appConfigState: { appType } } = mychoiceSdkStore.useStoreAppConfig();
930
930
  const isMyChoice = mychoiceSdkComponents.isMyChoiceLike(appType);
931
+ const isMyChoiceOnly = appType === mychoiceSdkComponents.AppTypes.MyChoice;
931
932
  const allValues = mychoiceSdkComponents.accidentBenefitsOptionalOptions.map((o) => o.value);
932
933
  const [localSelected, setLocalSelected] = React.useState(selectedCoverages.length > 0
933
934
  ? [...selectedCoverages]
@@ -946,7 +947,7 @@ const AccidentBenefitsModal = ({ selectedCoverages, onApply, onCancel, selectAll
946
947
  };
947
948
  return (jsxRuntime.jsx("div", { className: "ab-modal-overlay", onClick: onCancel, children: jsxRuntime.jsxs("div", { className: "ab-modal", onClick: (e) => e.stopPropagation(), children: [jsxRuntime.jsxs("div", { className: "ab-modal-header", children: [jsxRuntime.jsx("h3", { children: "Accident Benefits" }), jsxRuntime.jsx("p", { className: "ab-modal-subtitle", children: isMyChoice ? 'Standard Coverage + Optional Enhancements' : 'Standard Coverage + Self-Selected Optional Enhancements' }), jsxRuntime.jsx("p", { className: "ab-modal-body-text", children: isMyChoice
948
949
  ? 'Maximum coverage with flexibility to remove additional benefits.'
949
- : 'Base coverage with flexibility to select additional benefits' })] }), jsxRuntime.jsxs("div", { className: "ab-modal-content", children: [jsxRuntime.jsxs("div", { className: "ab-modal-standard-block ab-modal-standard-block--included", children: [jsxRuntime.jsxs("div", { className: "ab-modal-standard-included-header", children: [jsxRuntime.jsx("input", { type: "checkbox", checked: true, disabled: true, readOnly: true, className: "ab-modal-standard-locked-checkbox" }), jsxRuntime.jsx("h4", { children: isMyChoice ? 'All Coverages Included by Default' : 'Standard Benefits — Included' })] }), !isMyChoice && (jsxRuntime.jsx("p", { className: "ab-modal-standard-subtitle", children: "Medical, Rehabilitation, and Attendant Care" })), jsxRuntime.jsx("p", { className: "ab-modal-standard-description", children: isMyChoice ? (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: ["Our standard quote automatically includes all optional accident benefits at their minimum coverage limits. We strongly recommend keeping all coverages selected to ensure the most complete protection \u2014 opting out could leave you without critical support when you need it most. For example, deselecting Income Replacement means no weekly payments if an injury prevents you from working, and removing Caregiver Replacement leaves no financial support for dependents in your care.", jsxRuntime.jsx("br", {}), jsxRuntime.jsx("br", {}), "Please speak with a broker partner to discuss higher limits or learn more about how each benefit protects you."] })) : ('Covers medical expenses, therapy and personal care for injuries from an accident, including doctor visits and physiotherapy.') })] }), jsxRuntime.jsxs("div", { className: "ab-modal-optional-block", children: [jsxRuntime.jsxs("label", { className: "ab-modal-select-all", children: [jsxRuntime.jsx("input", { type: "checkbox", checked: allSelected, onChange: handleSelectAll }), jsxRuntime.jsx("span", { children: "Select All Additional Benefits" })] }), jsxRuntime.jsx("div", { className: "ab-modal-options", children: mychoiceSdkComponents.accidentBenefitsOptionalOptions.map((option) => (jsxRuntime.jsxs("label", { className: "ab-modal-option", children: [jsxRuntime.jsx("input", { type: "checkbox", checked: localSelected.includes(option.value), onChange: () => handleToggle(option.value) }), jsxRuntime.jsxs("div", { className: "ab-modal-option-text", children: [jsxRuntime.jsx("strong", { children: option.name }), jsxRuntime.jsx("span", { children: option.description })] })] }, option.value))) }), jsxRuntime.jsxs("div", { className: "ab-modal-minimum-notice", children: [jsxRuntime.jsx("strong", { children: "Minimum Limits Apply" }), jsxRuntime.jsx("p", { children: "All optional benefits selected below will be quoted at their minimum coverage limits. Please speak with your broker if you wish to discuss higher limits." })] })] })] }), jsxRuntime.jsxs("div", { className: "ab-modal-actions", children: [jsxRuntime.jsx("button", { type: "button", className: "ab-modal-btn ab-modal-btn-cancel", onClick: onCancel, children: "Cancel" }), jsxRuntime.jsx("button", { type: "button", className: "ab-modal-btn ab-modal-btn-apply", onClick: () => onApply(localSelected), children: "Apply" })] })] }) }));
950
+ : 'Base coverage with flexibility to select additional benefits' })] }), jsxRuntime.jsxs("div", { className: "ab-modal-content", children: [jsxRuntime.jsxs("div", { className: "ab-modal-standard-block ab-modal-standard-block--included", children: [jsxRuntime.jsxs("div", { className: "ab-modal-standard-included-header", children: [jsxRuntime.jsx("input", { type: "checkbox", checked: true, disabled: true, readOnly: true, className: "ab-modal-standard-locked-checkbox" }), jsxRuntime.jsx("h4", { children: isMyChoice ? 'All Coverages Included by Default' : 'Standard Benefits — Included' })] }), !isMyChoice && (jsxRuntime.jsx("p", { className: "ab-modal-standard-subtitle", children: "Medical, Rehabilitation, and Attendant Care" })), jsxRuntime.jsx("p", { className: "ab-modal-standard-description", children: isMyChoice ? (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: ["Our standard quote automatically includes all optional accident benefits at their minimum coverage limits. We strongly recommend keeping all coverages selected to ensure the most complete protection \u2014 opting out could leave you without critical support when you need it most. For example, deselecting Income Replacement means no weekly payments if an injury prevents you from working, and removing Caregiver Replacement leaves no financial support for dependents in your care.", jsxRuntime.jsx("br", {}), jsxRuntime.jsx("br", {}), "Please speak with a broker partner to discuss higher limits or learn more about how each benefit protects you."] })) : ('Covers medical expenses, therapy and personal care for injuries from an accident, including doctor visits and physiotherapy.') })] }), jsxRuntime.jsxs("div", { className: "ab-modal-optional-block", children: [jsxRuntime.jsxs("label", { className: "ab-modal-select-all", children: [jsxRuntime.jsx("input", { type: "checkbox", checked: allSelected, onChange: handleSelectAll }), jsxRuntime.jsx("span", { children: "Select All Additional Benefits" })] }), jsxRuntime.jsx("div", { className: "ab-modal-options", children: mychoiceSdkComponents.accidentBenefitsOptionalOptions.map((option) => (jsxRuntime.jsxs("label", { className: "ab-modal-option", children: [jsxRuntime.jsx("input", { type: "checkbox", checked: localSelected.includes(option.value), onChange: () => handleToggle(option.value) }), jsxRuntime.jsxs("div", { className: "ab-modal-option-text", children: [jsxRuntime.jsx("strong", { children: option.name }), jsxRuntime.jsx("span", { children: option.description })] })] }, option.value))) }), jsxRuntime.jsxs("div", { className: "ab-modal-minimum-notice", children: [jsxRuntime.jsx("strong", { children: "Minimum Limits Apply" }), jsxRuntime.jsx("p", { children: "All optional benefits selected below will be quoted at their minimum coverage limits. Please speak with your broker if you wish to discuss higher limits." })] })] })] }), jsxRuntime.jsxs("div", { className: "ab-modal-actions", children: [jsxRuntime.jsx("button", { type: "button", className: "ab-modal-btn ab-modal-btn-cancel", onClick: onCancel, children: "Cancel" }), jsxRuntime.jsx("button", { type: "button", className: "ab-modal-btn ab-modal-btn-apply", onClick: () => onApply(localSelected), children: isMyChoiceOnly ? 'Next' : 'Apply' })] })] }) }));
950
951
  };
951
952
 
952
953
  const allAccidentBenefitsCoverageValues = mychoiceSdkComponents.accidentBenefitsOptionalOptions.map((option) => option.value);
@@ -2047,17 +2048,16 @@ const BlockDriverAccident = () => {
2047
2048
  };
2048
2049
 
2049
2050
  /**
2050
- * Filter out G1/G2 options (ALC, RB) from the "Criminal" section for trafficTicketsGroupOptions
2051
+ * Filter out G1/G2 options from "Serious" section for trafficTicketsGroupOptions
2051
2052
  */
2052
2053
  const getTrafficTicketsGroupOptionsWithoutG1G2 = () => {
2053
2054
  const excludeOptions = ['ALC', 'RB'];
2054
- return mychoiceSdkComponents.trafficTicketsGroupOptions.map((group) => {
2055
- if (group.label !== 'Criminal')
2056
- return group;
2057
- return {
2058
- ...group,
2059
- options: group.options.filter((option) => !excludeOptions.includes(option.value)),
2060
- };
2055
+ const seriousOptions = mychoiceSdkComponents.trafficTicketsGroupOptions.find((entry) => entry.label === 'Serious');
2056
+ const filteredSeriousOptions = seriousOptions.options.filter((option) => !excludeOptions.includes(option.value));
2057
+ return mychoiceSdkComponents.trafficTicketsGroupOptions.map((option) => {
2058
+ if (option.label === 'Serious')
2059
+ return { ...option, options: filteredSeriousOptions };
2060
+ return option;
2061
2061
  });
2062
2062
  };
2063
2063