igloo-d2c-components 1.0.11 → 1.0.13

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.
Files changed (105) hide show
  1. package/README.md +0 -18
  2. package/dist/cjs/index.js +41 -2551
  3. package/dist/cjs/index.js.map +1 -1
  4. package/dist/esm/index.js +41 -2501
  5. package/dist/esm/index.js.map +1 -1
  6. package/dist/types/{storybook-components → components/Banner}/Banner.stories.d.ts +1 -1
  7. package/dist/types/{storybook-components → components/Button}/Button.stories.d.ts +1 -1
  8. package/dist/types/{storybook-components → components/Card}/Card.stories.d.ts +1 -1
  9. package/dist/types/context/TenantThemeContext.d.ts +2 -3
  10. package/dist/types/index.d.ts +4 -48
  11. package/dist/types/themes/index.d.ts +1 -1
  12. package/dist/types/types/tenant.d.ts +2 -23
  13. package/dist/types/utils/theme.d.ts +2 -3
  14. package/package.json +2 -4
  15. package/dist/assets/icons/alert.svg +0 -5
  16. package/dist/assets/icons/arrow-down.svg +0 -3
  17. package/dist/assets/icons/arrow.svg +0 -9
  18. package/dist/assets/icons/close.svg +0 -4
  19. package/dist/assets/icons/facebook.svg +0 -3
  20. package/dist/assets/icons/index.ts +0 -26
  21. package/dist/assets/icons/instagram.svg +0 -11
  22. package/dist/assets/icons/youtube.svg +0 -11
  23. package/dist/assets/index.ts +0 -13
  24. package/dist/assets/tenants/ammetlife/logo.svg +0 -10
  25. package/dist/assets/tenants/cimb/logo-white.png +0 -0
  26. package/dist/assets/tenants/cimb/logo.svg +0 -62
  27. package/dist/assets/tenants/igloo/logo.svg +0 -22
  28. package/dist/types/assets/icons/index.d.ts +0 -21
  29. package/dist/types/assets/index.d.ts +0 -9
  30. package/dist/types/components/BillingToggle/BillingToggle.d.ts +0 -34
  31. package/dist/types/components/BillingToggle/index.d.ts +0 -3
  32. package/dist/types/components/BillingToggle/styled.d.ts +0 -12
  33. package/dist/types/components/CheckoutFormButton/CheckoutFormButton.d.ts +0 -39
  34. package/dist/types/components/CheckoutFormButton/index.d.ts +0 -2
  35. package/dist/types/components/CheckoutFormButton/styled.d.ts +0 -9
  36. package/dist/types/components/CheckoutHeader/CheckoutHeader.d.ts +0 -41
  37. package/dist/types/components/CheckoutHeader/index.d.ts +0 -2
  38. package/dist/types/components/CheckoutHeader/styled.d.ts +0 -15
  39. package/dist/types/components/CheckoutProgress/CheckoutProgress.d.ts +0 -35
  40. package/dist/types/components/CheckoutProgress/index.d.ts +0 -2
  41. package/dist/types/components/CheckoutProgress/styled.d.ts +0 -16
  42. package/dist/types/components/ChildInformationForm/ChildInformationForm.d.ts +0 -52
  43. package/dist/types/components/ChildInformationForm/index.d.ts +0 -2
  44. package/dist/types/components/ChildInformationForm/styled.d.ts +0 -4
  45. package/dist/types/components/ContactDetailsForm/ContactDetailsForm.d.ts +0 -63
  46. package/dist/types/components/ContactDetailsForm/index.d.ts +0 -2
  47. package/dist/types/components/ContactDetailsForm/styled.d.ts +0 -10
  48. package/dist/types/components/CoverageAmountSlider/CoverageAmountSlider.d.ts +0 -57
  49. package/dist/types/components/CoverageAmountSlider/index.d.ts +0 -3
  50. package/dist/types/components/CoverageAmountSlider/styled.d.ts +0 -50
  51. package/dist/types/components/Footer/Footer.d.ts +0 -94
  52. package/dist/types/components/Footer/index.d.ts +0 -3
  53. package/dist/types/components/Footer/styled.d.ts +0 -38
  54. package/dist/types/components/Header/Header.d.ts +0 -159
  55. package/dist/types/components/Header/index.d.ts +0 -3
  56. package/dist/types/components/Header/styled.d.ts +0 -80
  57. package/dist/types/components/HealthInformationForm/HealthInformationForm.d.ts +0 -81
  58. package/dist/types/components/HealthInformationForm/index.d.ts +0 -2
  59. package/dist/types/components/HealthInformationForm/styled.d.ts +0 -4
  60. package/dist/types/components/HealthQuestionGroup/HealthQuestionGroup.d.ts +0 -40
  61. package/dist/types/components/HealthQuestionGroup/index.d.ts +0 -2
  62. package/dist/types/components/HealthQuestionGroup/styled.d.ts +0 -20
  63. package/dist/types/components/InfoCallout/InfoCallout.d.ts +0 -34
  64. package/dist/types/components/InfoCallout/index.d.ts +0 -3
  65. package/dist/types/components/InfoCallout/styled.d.ts +0 -16
  66. package/dist/types/components/NewHeader/NewHeader.d.ts +0 -60
  67. package/dist/types/components/NewHeader/index.d.ts +0 -3
  68. package/dist/types/components/NewHeader/styled.d.ts +0 -26
  69. package/dist/types/components/OptionButton/OptionButton.d.ts +0 -59
  70. package/dist/types/components/OptionButton/index.d.ts +0 -3
  71. package/dist/types/components/OptionButton/styled.d.ts +0 -18
  72. package/dist/types/components/PersonalInformationForm/PersonalInformationForm.d.ts +0 -75
  73. package/dist/types/components/PersonalInformationForm/index.d.ts +0 -2
  74. package/dist/types/components/PersonalInformationForm/styled.d.ts +0 -10
  75. package/dist/types/components/ProductCard/ProductCard.d.ts +0 -43
  76. package/dist/types/components/ProductCard/index.d.ts +0 -2
  77. package/dist/types/components/ProductCard/styled.d.ts +0 -27
  78. package/dist/types/components/ProductSelectionDrawer/ProductSelectionDrawer.d.ts +0 -54
  79. package/dist/types/components/ProductSelectionDrawer/index.d.ts +0 -3
  80. package/dist/types/components/ProductSelectionDrawer/styled.d.ts +0 -44
  81. package/dist/types/components/QuestionSection/QuestionSection.d.ts +0 -71
  82. package/dist/types/components/QuestionSection/index.d.ts +0 -3
  83. package/dist/types/components/QuestionSection/styled.d.ts +0 -16
  84. package/dist/types/components/RecommendationsDrawer/RecommendationsDrawer.d.ts +0 -92
  85. package/dist/types/components/RecommendationsDrawer/index.d.ts +0 -3
  86. package/dist/types/components/RecommendationsDrawer/styled.d.ts +0 -35
  87. package/dist/types/components/ToggleGroup/ToggleGroup.d.ts +0 -45
  88. package/dist/types/components/ToggleGroup/index.d.ts +0 -3
  89. package/dist/types/components/ToggleGroup/styled.d.ts +0 -17
  90. package/dist/types/storybook-components/BillingToggle.stories.d.ts +0 -10
  91. package/dist/types/storybook-components/CheckoutProgress.stories.d.ts +0 -9
  92. package/dist/types/storybook-components/CoverageAmountSlider.stories.d.ts +0 -14
  93. package/dist/types/storybook-components/Footer.stories.d.ts +0 -10
  94. package/dist/types/storybook-components/Header.stories.d.ts +0 -9
  95. package/dist/types/storybook-components/HealthQuestionGroup.stories.d.ts +0 -9
  96. package/dist/types/storybook-components/InfoCallout.stories.d.ts +0 -11
  97. package/dist/types/storybook-components/NewHeader.stories.d.ts +0 -82
  98. package/dist/types/storybook-components/OptionButton.stories.d.ts +0 -12
  99. package/dist/types/storybook-components/ProductCard.stories.d.ts +0 -9
  100. package/dist/types/storybook-components/ProductSelectionDrawer.stories.d.ts +0 -24
  101. package/dist/types/storybook-components/QuestionSection.stories.d.ts +0 -11
  102. package/dist/types/storybook-components/RecommendationsDrawer.stories.d.ts +0 -36
  103. package/dist/types/storybook-components/ToggleGroup.stories.d.ts +0 -10
  104. package/dist/types/themes/typography.d.ts +0 -69
  105. package/dist/types/utils/assets.d.ts +0 -54
package/dist/esm/index.js CHANGED
@@ -1,18 +1,7 @@
1
1
  "use client"
2
- import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
3
- import * as React from 'react';
4
- import { createContext, useMemo, useContext, useState, useEffect } from 'react';
5
- import { Button as Button$1, Card as Card$1, CardHeader, CardContent, CardActions, Box, Typography, Avatar, Menu, MenuItem, Drawer, IconButton, FormControlLabel, useTheme, useMediaQuery, Toolbar, Icon, RadioGroup, Radio, AppBar as AppBar$1, Divider, List, ListItem, ListItemButton, ListItemText, styled as styled$1, ButtonBase, Slider, Checkbox } from '@mui/material';
6
- import CloseIcon from '@mui/icons-material/Close';
7
- import ArrowDropDownIcon from '@mui/icons-material/ArrowDropDown';
8
- import MenuIcon from '@mui/icons-material/Menu';
9
- import AppBar from '@mui/material/AppBar';
10
- import Container from '@mui/material/Container';
11
- import { styled } from '@mui/material/styles';
12
- import ArrowBackIcon from '@mui/icons-material/ArrowBack';
13
- import InfoIcon from '@mui/icons-material/Info';
14
- import AddIcon from '@mui/icons-material/Add';
15
- import RemoveIcon from '@mui/icons-material/Remove';
2
+ import { jsx, jsxs } from 'react/jsx-runtime';
3
+ import { createContext, useMemo, useContext } from 'react';
4
+ import { Button as Button$1, Card as Card$1, CardHeader, CardContent, CardActions, Box, Typography } from '@mui/material';
16
5
 
17
6
  const TenantThemeContext = createContext(undefined);
18
7
  /**
@@ -38,20 +27,11 @@ function TenantThemeProvider({ children, tenantId, theme, }) {
38
27
  }
39
28
  /**
40
29
  * Hook to access tenant theme configuration
41
- * Returns undefined during SSR if context is not available
42
- * @returns TenantContextValue or undefined during SSR
30
+ * @throws Error if used outside TenantThemeProvider
43
31
  */
44
32
  function useTenantTheme() {
45
33
  const context = useContext(TenantThemeContext);
46
- // During SSR, context might be undefined - return undefined instead of throwing
47
- // This allows components to handle SSR gracefully with fallback values
48
34
  if (context === undefined) {
49
- // Check if we're in a browser environment
50
- if (typeof window === 'undefined') {
51
- // SSR - return undefined to allow fallback handling
52
- return undefined;
53
- }
54
- // Client-side but no provider - throw error for development
55
35
  throw new Error('useTenantTheme must be used within a TenantThemeProvider');
56
36
  }
57
37
  return context;
@@ -60,160 +40,15 @@ function useTenantTheme() {
60
40
  * Hook to get tenant ID
61
41
  */
62
42
  function useTenantId() {
63
- const tenantTheme = useTenantTheme();
64
- return (tenantTheme === null || tenantTheme === void 0 ? void 0 : tenantTheme.tenantId) || '';
43
+ const { tenantId } = useTenantTheme();
44
+ return tenantId;
65
45
  }
66
46
  /**
67
47
  * Hook to check if current tenant matches given tenant ID
68
48
  */
69
49
  function useIsTenant(checkTenantId) {
70
- const tenantTheme = useTenantTheme();
71
- return (tenantTheme === null || tenantTheme === void 0 ? void 0 : tenantTheme.tenantId) === checkTenantId;
72
- }
73
-
74
- /**
75
- * Tenant Typography Configurations
76
- * Centralized typography definitions for all tenants
77
- * Based on b2c-web-demo typography structure
78
- */
79
- /**
80
- * Igloo Typography Configuration
81
- */
82
- const iglooTypography = {
83
- fontFamily: 'Montserrat',
84
- fontWeightRegular: 400,
85
- fontWeightMedium: 500,
86
- fontWeightSemiBold: 600,
87
- fontWeightBold: 700,
88
- fontWeightExtraBold: 800,
89
- fontWeightExtraBlack: 900,
90
- h1: {
91
- fontSize: '42px',
92
- fontStyle: 'normal',
93
- fontWeight: 700,
94
- lineHeight: '48px',
95
- '@media (max-width:600px)': {
96
- fontSize: '24px',
97
- fontStyle: 'normal',
98
- fontWeight: 700,
99
- lineHeight: '30px',
100
- },
101
- },
102
- h2: {
103
- fontSize: '22px',
104
- fontStyle: 'normal',
105
- fontWeight: 700,
106
- lineHeight: '26px',
107
- '@media (max-width:600px)': {
108
- fontSize: '14px',
109
- fontStyle: 'normal',
110
- fontWeight: 700,
111
- lineHeight: '22px',
112
- },
113
- },
114
- h3: {
115
- fontSize: '18px',
116
- fontStyle: 'normal',
117
- fontWeight: 600,
118
- lineHeight: '24px',
119
- '@media (max-width:600px)': {
120
- fontSize: '14px',
121
- fontStyle: 'normal',
122
- fontWeight: 600,
123
- lineHeight: '20px',
124
- },
125
- },
126
- h4: {
127
- fontSize: '18px',
128
- fontStyle: 'normal',
129
- fontWeight: 600,
130
- lineHeight: '24px',
131
- '@media (max-width:600px)': {
132
- fontSize: '14px',
133
- fontStyle: 'normal',
134
- fontWeight: 500,
135
- lineHeight: '18px',
136
- },
137
- },
138
- bodyStrongLarge: {
139
- fontSize: '16px',
140
- fontStyle: 'normal',
141
- fontWeight: 500,
142
- lineHeight: '20px',
143
- '@media (max-width:600px)': {
144
- fontSize: '14px',
145
- fontStyle: 'normal',
146
- fontWeight: 400,
147
- lineHeight: '18px',
148
- },
149
- },
150
- bodyStrongMedium: {
151
- fontSize: '14px',
152
- fontStyle: 'normal',
153
- fontWeight: 500,
154
- lineHeight: '18px',
155
- },
156
- bodyStrongSmall: {
157
- fontSize: '12px',
158
- fontStyle: 'normal',
159
- fontWeight: 500,
160
- lineHeight: '16px',
161
- },
162
- bodyLarge: {
163
- fontSize: '16px',
164
- fontStyle: 'normal',
165
- fontWeight: 400,
166
- lineHeight: '20px',
167
- '@media (max-width:600px)': {
168
- fontSize: '14px',
169
- fontStyle: 'normal',
170
- fontWeight: 400,
171
- lineHeight: '18px',
172
- },
173
- },
174
- bodyMedium: {
175
- fontSize: '14px',
176
- fontStyle: 'normal',
177
- fontWeight: 400,
178
- lineHeight: '20px',
179
- },
180
- bodySmall: {
181
- fontSize: '12px',
182
- fontStyle: 'normal',
183
- fontWeight: 400,
184
- lineHeight: '16px',
185
- },
186
- smallText: {
187
- fontSize: '8px',
188
- fontStyle: 'normal',
189
- fontWeight: 500,
190
- lineHeight: '16px',
191
- },
192
- };
193
- /**
194
- * CIMB Typography Configuration
195
- */
196
- const cimbTypography = Object.assign(Object.assign({}, iglooTypography), { fontFamily: 'CIMB Sans' });
197
- /**
198
- * AmmetLife Typography Configuration
199
- */
200
- const ammetlifeTypography = Object.assign(Object.assign({}, iglooTypography), { fontFamily: 'Montserrat' });
201
- /**
202
- * Typography Registry
203
- * Map of tenant IDs to their typography configurations
204
- */
205
- const tenantTypography = {
206
- igloo: iglooTypography,
207
- cimb: cimbTypography,
208
- ammetlife: ammetlifeTypography,
209
- };
210
- /**
211
- * Get typography configuration by tenant ID
212
- * @param tenantId - The tenant identifier
213
- * @returns Typography configuration for the specified tenant
214
- */
215
- function getTenantTypography(tenantId) {
216
- return tenantTypography[tenantId] || iglooTypography;
50
+ const { tenantId } = useTenantTheme();
51
+ return tenantId === checkTenantId;
217
52
  }
218
53
 
219
54
  /**
@@ -257,19 +92,6 @@ const iglooTheme = {
257
92
  bright: '#fff',
258
93
  granite: '#666',
259
94
  },
260
- // UI Component Colors
261
- ui: {
262
- sliderActive: '#5656F6',
263
- sliderInactive: '#c8c5ca',
264
- sliderBackground: '#f9f9f9',
265
- toggleActive: '#5656F6',
266
- toggleActiveText: '#ffffff',
267
- toggleInactiveText: '#5f5e62',
268
- calloutBackground: '#f9f9f9',
269
- calloutBorder: '#ffffff',
270
- inputBackground: '#ffffff',
271
- inputBorder: '#eeeeee',
272
- },
273
95
  motor: {
274
96
  main: '#00CCFF',
275
97
  light: 'rgba(0, 208, 255, 0.10)',
@@ -295,10 +117,11 @@ const iglooTheme = {
295
117
  main: '#F3A100',
296
118
  },
297
119
  },
298
- typography: Object.assign(Object.assign({}, iglooTypography), { fontFamily: '"Manrope", "Roboto", "Helvetica", "Arial", sans-serif' }),
299
- logo: '/assets/tenants/igloo/logo.svg',
120
+ typography: {
121
+ fontFamily: '"Manrope", "Roboto", "Helvetica", "Arial", sans-serif',
122
+ },
123
+ logo: '/assets/igloo_nobeta.svg',
300
124
  favicon: 'https://static.iglooinsure.com/icons/favicon.ico',
301
- assetBaseUrl: '/assets/tenants/igloo',
302
125
  };
303
126
  /**
304
127
  * CIMB Theme Configuration
@@ -343,19 +166,6 @@ const cimbTheme = {
343
166
  bright: '#fff',
344
167
  granite: '#666',
345
168
  },
346
- // UI Component Colors
347
- ui: {
348
- sliderActive: '#C3214B',
349
- sliderInactive: '#c8c5ca',
350
- sliderBackground: '#f9f9f9',
351
- toggleActive: '#EE0500',
352
- toggleActiveText: '#fefbff',
353
- toggleInactiveText: '#5f5e62',
354
- calloutBackground: '#f9f9f9',
355
- calloutBorder: '#ffffff',
356
- inputBackground: '#ffffff',
357
- inputBorder: '#eeeeee',
358
- },
359
169
  motor: {
360
170
  main: '#C3214B',
361
171
  light: 'rgba(195, 33, 75, 0.10)',
@@ -382,11 +192,11 @@ const cimbTheme = {
382
192
  main: '#F3A100',
383
193
  },
384
194
  },
385
- typography: Object.assign(Object.assign({}, cimbTypography), { fontFamily: '"CIMB Sans", "Roboto", "Helvetica", "Arial", sans-serif' }),
386
- logo: '/assets/tenants/cimb/logo.svg',
387
- logoWhite: '/assets/tenants/cimb/logo-white.png',
195
+ typography: {
196
+ fontFamily: '"CIMB Sans", "Roboto", "Helvetica", "Arial", sans-serif',
197
+ },
198
+ logo: '/assets/cimb/cimb-logo.svg',
388
199
  favicon: 'https://static.iglooinsure.com/icons/favicon.ico',
389
- assetBaseUrl: '/assets/tenants/cimb',
390
200
  };
391
201
  /**
392
202
  * Ammetlife Theme Configuration
@@ -394,12 +204,12 @@ const cimbTheme = {
394
204
  const ammetlifeTheme = {
395
205
  palette: {
396
206
  primary: {
397
- dark: '#2869a8',
398
- main: '#317abc',
207
+ dark: '#0D47A1',
208
+ main: '#1976D2',
399
209
  light: '#42A5F5',
400
210
  bright: '#90CAF9',
401
211
  plain: '#E3F2FD',
402
- border: '#317abc',
212
+ border: '#1976D2',
403
213
  },
404
214
  secondary: {
405
215
  dim: '#E65100',
@@ -425,19 +235,6 @@ const ammetlifeTheme = {
425
235
  bright: '#fff',
426
236
  granite: '#666',
427
237
  },
428
- // UI Component Colors
429
- ui: {
430
- sliderActive: '#317abc',
431
- sliderInactive: '#c8c5ca',
432
- sliderBackground: '#f9f9f9',
433
- toggleActive: '#a4ce4e',
434
- toggleActiveText: '#fefbff',
435
- toggleInactiveText: '#5f5e62',
436
- calloutBackground: '#f9f9f9',
437
- calloutBorder: '#ffffff',
438
- inputBackground: '#ffffff',
439
- inputBorder: '#eeeeee',
440
- },
441
238
  motor: {
442
239
  main: '#1976D2',
443
240
  light: 'rgba(25, 118, 210, 0.10)',
@@ -464,10 +261,11 @@ const ammetlifeTheme = {
464
261
  main: '#FF9800',
465
262
  },
466
263
  },
467
- typography: Object.assign(Object.assign({}, ammetlifeTypography), { fontFamily: '"Montserrat", "Roboto", "Helvetica", "Arial", sans-serif' }),
468
- logo: '/assets/tenants/ammetlife/logo.svg',
264
+ typography: {
265
+ fontFamily: '"Open Sans", "Roboto", "Helvetica", "Arial", sans-serif',
266
+ },
267
+ logo: '/assets/ammetlife/logo-AmMetLife.svg',
469
268
  favicon: 'https://static.iglooinsure.com/icons/favicon.ico',
470
- assetBaseUrl: '/assets/tenants/ammetlife',
471
269
  };
472
270
  /**
473
271
  * Theme Registry
@@ -554,13 +352,12 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
554
352
  * ```
555
353
  */
556
354
  function Button(_a) {
557
- var _b, _c, _d, _e, _f, _g;
355
+ var _b, _c, _d;
558
356
  var { tenantColored = false, variant = 'contained', sx, color } = _a, props = __rest(_a, ["tenantColored", "variant", "sx", "color"]);
559
- const tenantTheme = useTenantTheme();
560
- const theme = tenantTheme === null || tenantTheme === void 0 ? void 0 : tenantTheme.theme;
561
- const buttonSx = tenantColored && theme
562
- ? Object.assign({ backgroundColor: (_c = (_b = theme.palette) === null || _b === void 0 ? void 0 : _b.primary) === null || _c === void 0 ? void 0 : _c.main, color: '#fff', '&:hover': {
563
- backgroundColor: ((_e = (_d = theme.palette) === null || _d === void 0 ? void 0 : _d.primary) === null || _e === void 0 ? void 0 : _e.dark) || ((_g = (_f = theme.palette) === null || _f === void 0 ? void 0 : _f.primary) === null || _g === void 0 ? void 0 : _g.main),
357
+ const { theme } = useTenantTheme();
358
+ const buttonSx = tenantColored
359
+ ? Object.assign({ backgroundColor: (_b = theme.palette.primary) === null || _b === void 0 ? void 0 : _b.main, color: '#fff', '&:hover': {
360
+ backgroundColor: ((_c = theme.palette.primary) === null || _c === void 0 ? void 0 : _c.dark) || ((_d = theme.palette.primary) === null || _d === void 0 ? void 0 : _d.main),
564
361
  } }, sx) : sx;
565
362
  return (jsx(Button$1, Object.assign({ variant: variant, color: tenantColored ? undefined : color, sx: buttonSx }, props)));
566
363
  }
@@ -579,12 +376,11 @@ function Button(_a) {
579
376
  * ```
580
377
  */
581
378
  function Card(_a) {
582
- var _b, _c;
379
+ var _b;
583
380
  var { title, headerAction, content, actions, tenantAccent = false, sx, children } = _a, props = __rest(_a, ["title", "headerAction", "content", "actions", "tenantAccent", "sx", "children"]);
584
- const tenantTheme = useTenantTheme();
585
- const theme = tenantTheme === null || tenantTheme === void 0 ? void 0 : tenantTheme.theme;
586
- const cardSx = tenantAccent && theme
587
- ? Object.assign({ borderTop: `4px solid ${((_c = (_b = theme.palette) === null || _b === void 0 ? void 0 : _b.primary) === null || _c === void 0 ? void 0 : _c.main) || '#000000'}` }, sx) : sx;
381
+ const { theme } = useTenantTheme();
382
+ const cardSx = tenantAccent
383
+ ? Object.assign({ borderTop: `4px solid ${(_b = theme.palette.primary) === null || _b === void 0 ? void 0 : _b.main}` }, sx) : sx;
588
384
  return (jsxs(Card$1, Object.assign({ sx: cardSx }, props, { children: [title && jsx(CardHeader, { title: title, action: headerAction }), (content || children) && (jsx(CardContent, { children: content || children })), actions && jsx(CardActions, { children: actions })] })));
589
385
  }
590
386
 
@@ -604,1348 +400,25 @@ function Card(_a) {
604
400
  function Banner(_a) {
605
401
  var _b, _c, _d, _e;
606
402
  var { title, description, action, gradient = true, sx } = _a, props = __rest(_a, ["title", "description", "action", "gradient", "sx"]);
607
- const tenantTheme = useTenantTheme();
608
- const theme = tenantTheme === null || tenantTheme === void 0 ? void 0 : tenantTheme.theme;
609
- const primaryColor = ((_c = (_b = theme === null || theme === void 0 ? void 0 : theme.palette) === null || _b === void 0 ? void 0 : _b.primary) === null || _c === void 0 ? void 0 : _c.main) || '#000000';
610
- const lightColor = ((_e = (_d = theme === null || theme === void 0 ? void 0 : theme.palette) === null || _d === void 0 ? void 0 : _d.primary) === null || _e === void 0 ? void 0 : _e.light) || primaryColor;
403
+ const { theme } = useTenantTheme();
611
404
  const background = gradient
612
- ? `linear-gradient(135deg, ${primaryColor} 0%, ${lightColor} 100%)`
613
- : primaryColor;
405
+ ? `linear-gradient(135deg, ${(_b = theme.palette.primary) === null || _b === void 0 ? void 0 : _b.main} 0%, ${((_c = theme.palette.primary) === null || _c === void 0 ? void 0 : _c.light) || ((_d = theme.palette.primary) === null || _d === void 0 ? void 0 : _d.main)} 100%)`
406
+ : (_e = theme.palette.primary) === null || _e === void 0 ? void 0 : _e.main;
614
407
  return (jsxs(Box, Object.assign({ sx: Object.assign({ background, color: 'white', padding: '32px', borderRadius: '12px', textAlign: 'center' }, sx) }, props, { children: [jsx(Typography, Object.assign({ variant: "h4", component: "h2", gutterBottom: true, fontWeight: "bold" }, { children: title })), description && (jsx(Typography, Object.assign({ variant: "body1", sx: { opacity: 0.95, mb: action ? 2 : 0 } }, { children: description }))), action && jsx(Box, Object.assign({ sx: { mt: 2 } }, { children: action }))] })));
615
408
  }
616
409
 
617
- const StyledAppBar$1 = styled(AppBar)(({ theme, ispartnershippagemobileview, scrolled }) => {
618
- var _a, _b;
619
- return ({
620
- zIndex: '1000 !important',
621
- backgroundColor: ispartnershippagemobileview && !scrolled
622
- ? 'transparent !important'
623
- : `${((_a = theme.palette.background) === null || _a === void 0 ? void 0 : _a.paper) || '#fff'} !important`,
624
- boxShadow: 'none !important',
625
- '& .MuiToolbar-root': {
626
- minHeight: '80px',
627
- [(_b = theme === null || theme === void 0 ? void 0 : theme.breakpoints) === null || _b === void 0 ? void 0 : _b.down('md')]: {
628
- minHeight: '64px',
629
- },
630
- },
631
- [theme.breakpoints.up(1025)]: {
632
- boxShadow: scrolled && '0px 2px 20px 4px rgba(0, 0, 0, 0.14) !important',
633
- },
634
- });
635
- });
636
- const ResponsiveB2CLayout = styled('div')(({ theme }) => ({
637
- [theme.breakpoints.up(1025)]: {
638
- minWidth: '1128px',
639
- maxWidth: '1128px',
640
- margin: '0 auto',
641
- },
642
- }));
643
- const StyledContainer = styled(Container)(({ theme, ispartnershippagemobileview, scrolled }) => {
644
- var _a;
645
- return ({
646
- boxShadow: 'none',
647
- [(_a = theme === null || theme === void 0 ? void 0 : theme.breakpoints) === null || _a === void 0 ? void 0 : _a.down('md')]: {
648
- boxShadow: !scrolled ? 'none' : '0px 2px 20px 4px rgba(0, 0, 0, 0.14)',
649
- },
650
- });
651
- });
652
- const TypographyLogo = styled(Typography)(({ theme }) => {
653
- var _a, _b;
654
- return ({
655
- margin: 'auto 40 auto 0',
656
- display: '-webkit-box',
657
- alignItems: 'anchor-center',
658
- [(_a = theme === null || theme === void 0 ? void 0 : theme.breakpoints) === null || _a === void 0 ? void 0 : _a.up('md')]: {
659
- width: 95,
660
- height: 57,
661
- },
662
- [(_b = theme === null || theme === void 0 ? void 0 : theme.breakpoints) === null || _b === void 0 ? void 0 : _b.down('md')]: {
663
- width: 73.3,
664
- display: 'flex',
665
- },
666
- });
667
- });
668
- const ButtonDesktopMenu = styled(Button$1)(({ theme }) => {
669
- var _a;
670
- return ({
671
- color: ((_a = theme.palette.text) === null || _a === void 0 ? void 0 : _a.primary) || '#000',
672
- display: 'flex',
673
- padding: '0px 10px',
674
- alignItems: 'center',
675
- gap: 8,
676
- alignSelf: 'stretch',
677
- });
678
- });
679
- const AnchorLinks = styled('a')(({ theme }) => ({
680
- color: 'inherit',
681
- '&:hover': {
682
- color: 'inherit',
683
- },
684
- }));
685
- const StyledAvatar = styled(Avatar)(({ theme }) => {
686
- var _a;
687
- return ({
688
- margin: '15px 0',
689
- cursor: 'pointer',
690
- backgroundColor: `${theme.palette.primary.main} !important`,
691
- [(_a = theme === null || theme === void 0 ? void 0 : theme.breakpoints) === null || _a === void 0 ? void 0 : _a.down('md')]: {
692
- margin: '0',
693
- },
694
- });
695
- });
696
- const DivButtonWrapper = styled('div')(({ theme }) => {
697
- var _a;
698
- return ({
699
- justifyContent: 'end',
700
- display: 'flex',
701
- marginTop: 0,
702
- padding: `16px 0`,
703
- gap: 12,
704
- [(_a = theme === null || theme === void 0 ? void 0 : theme.breakpoints) === null || _a === void 0 ? void 0 : _a.down('md')]: {
705
- marginTop: 24,
706
- padding: 0,
707
- },
708
- });
709
- });
710
- const ButtonAuth = styled(Button$1)(({ theme }) => ({
711
- justifyContent: 'center',
712
- alignItems: 'center',
713
- borderRadius: '100px !important',
714
- borderColor: theme.palette.primary.main,
715
- borderStyle: 'solid',
716
- borderWidth: 1,
717
- flex: 1,
718
- height: 40,
719
- minWidth: 'max-content !important',
720
- }));
721
- const TypographyAuth = styled(Typography)(({ theme }) => ({
722
- textTransform: 'none',
723
- }));
724
- const StyledMenu = styled(Menu)(({ theme }) => {
725
- var _a;
726
- return ({
727
- '& .MuiMenu-paper': {
728
- left: 'auto',
729
- width: 'fit-content',
730
- maxWidth: 'unset',
731
- boxShadow: 'inset',
732
- borderRadius: 16,
733
- [(_a = theme === null || theme === void 0 ? void 0 : theme.breakpoints) === null || _a === void 0 ? void 0 : _a.down('md')]: {
734
- left: `0 !important`,
735
- width: '100%',
736
- boxShadow: 'none !important',
737
- borderRadius: 'none',
738
- },
739
- },
740
- });
741
- });
742
- const DivProductListing = styled('div')(({ theme }) => {
743
- var _a;
744
- return ({
745
- padding: '0 16px',
746
- display: 'flex',
747
- flexDirection: 'column',
748
- alignSelf: 'stretch',
749
- [(_a = theme === null || theme === void 0 ? void 0 : theme.breakpoints) === null || _a === void 0 ? void 0 : _a.down('md')]: {
750
- padding: 16,
751
- },
752
- });
753
- });
754
- const StyledMenuItem = styled(MenuItem)(({ theme }) => {
755
- var _a;
756
- return ({
757
- display: 'flex',
758
- borderBottom: 'none',
759
- alignItems: 'flex-start',
760
- gap: 6,
761
- padding: '16px 0 !important',
762
- '&:last-child': {
763
- borderBottom: 'none !important',
764
- },
765
- width: '100%',
766
- [(_a = theme === null || theme === void 0 ? void 0 : theme.breakpoints) === null || _a === void 0 ? void 0 : _a.down('md')]: {
767
- borderBottom: `1px solid ${theme.palette.divider} !important`,
768
- },
769
- });
770
- });
771
- const SpanImageWrapper = styled('span')(({ theme }) => ({
772
- alignItems: 'center',
773
- display: 'flex',
774
- justifyContent: 'center',
775
- margin: 'auto 0',
776
- }));
777
- const ImageProductIcon = styled('img')(({ theme }) => ({
778
- aspectRatio: 1,
779
- objectPosition: 'center',
780
- width: 18,
781
- height: 18,
782
- }));
783
- const StyledMenuItemDesktop = styled(MenuItem)(({ theme }) => {
784
- var _a, _b;
785
- return ({
786
- color: `${((_a = theme.palette.secondary) === null || _a === void 0 ? void 0 : _a.main) || '#f00'} !important`,
787
- display: 'flex',
788
- borderBottom: 'none',
789
- alignItems: 'flex-start',
790
- gap: 6,
791
- padding: '16px 0 !important',
792
- '&:last-child': {
793
- borderBottom: 'none !important',
794
- },
795
- width: '100%',
796
- [(_b = theme === null || theme === void 0 ? void 0 : theme.breakpoints) === null || _b === void 0 ? void 0 : _b.down('md')]: {
797
- borderBottom: `1px solid ${theme.palette.divider} !important`,
798
- },
799
- });
800
- });
801
- const StyledCloseIcon = styled(CloseIcon)(({ theme }) => {
802
- var _a;
803
- return ({
804
- color: `${((_a = theme.palette.text) === null || _a === void 0 ? void 0 : _a.primary) || '#000'}`,
805
- });
806
- });
807
- const StyledAvatarUserIcon = styled(Avatar)(({ theme }) => {
808
- var _a, _b;
809
- return ({
810
- margin: '15px 0',
811
- cursor: 'pointer',
812
- backgroundColor: `${((_a = theme.palette.text) === null || _a === void 0 ? void 0 : _a.primary) || '#000'} !important`,
813
- [(_b = theme === null || theme === void 0 ? void 0 : theme.breakpoints) === null || _b === void 0 ? void 0 : _b.down('md')]: {
814
- margin: '0',
815
- },
816
- });
817
- });
818
- const StyledMenuIcon = styled(MenuIcon)(({ theme, ispartnershippagemobileview, scrolled }) => {
819
- var _a, _b;
820
- return ({
821
- color: ispartnershippagemobileview && !scrolled
822
- ? ((_a = theme.palette.common) === null || _a === void 0 ? void 0 : _a.white) || '#fff'
823
- : `${((_b = theme.palette.text) === null || _b === void 0 ? void 0 : _b.primary) || '#000'}`,
824
- });
825
- });
826
- const StyledDrawer$3 = styled(Drawer)(({ theme }) => {
827
- var _a;
828
- return ({
829
- '& .MuiMenu-paper': {
830
- left: 'auto',
831
- width: 'fit-content',
832
- maxWidth: 'unset',
833
- boxShadow: 'inset',
834
- borderRadius: 16,
835
- [(_a = theme === null || theme === void 0 ? void 0 : theme.breakpoints) === null || _a === void 0 ? void 0 : _a.down('md')]: {
836
- left: `0 !important`,
837
- width: '100%',
838
- boxShadow: 'none !important',
839
- borderRadius: 'none',
840
- },
841
- },
842
- });
843
- });
844
- const DivLogoWrapper = styled('div')(({ theme }) => ({
845
- justifyContent: 'space-between',
846
- alignSelf: 'stretch',
847
- backgroundColor: '',
848
- display: 'flex',
849
- gap: '20px',
850
- padding: '12px 16px',
851
- marginBottom: 16,
852
- }));
853
- const DivLogo = styled('div')(({ theme }) => {
854
- var _a, _b;
855
- return ({
856
- margin: 'auto 40 auto 0',
857
- display: '-webkit-box',
858
- [(_a = theme === null || theme === void 0 ? void 0 : theme.breakpoints) === null || _a === void 0 ? void 0 : _a.up('md')]: {
859
- width: 95,
860
- height: 57,
861
- },
862
- [(_b = theme === null || theme === void 0 ? void 0 : theme.breakpoints) === null || _b === void 0 ? void 0 : _b.down('md')]: {
863
- width: 60,
864
- height: 36,
865
- display: 'flex',
866
- },
867
- });
868
- });
869
- const DivCrossIconWrapper = styled('div')(({ theme }) => ({
870
- display: 'flex',
871
- alignItems: 'center',
872
- justifyContent: 'center',
873
- padding: 6,
874
- }));
875
- const StyledCloseIconBtn = styled(IconButton)(({ theme }) => {
876
- var _a;
877
- return ({
878
- color: `${((_a = theme.palette.text) === null || _a === void 0 ? void 0 : _a.primary) || '#000'} !important`,
879
- padding: '0 !important',
880
- });
881
- });
882
- const DivLoginActionContainer = styled('div')(({ theme }) => ({
883
- justifyContent: 'center',
884
- alignSelf: 'stretch',
885
- display: 'flex',
886
- flexDirection: 'column',
887
- padding: ' 0 16px',
888
- }));
889
- const DivCommonMenus = styled('div')(({ theme }) => ({
890
- padding: 16,
891
- display: 'flex',
892
- flexDirection: 'column',
893
- alignSelf: 'stretch',
894
- alignItems: 'flex-start',
895
- }));
896
- const MenuItemOtherLinks = styled(MenuItem)(({ theme }) => ({
897
- display: 'flex',
898
- borderBottom: `1px solid ${theme.palette.divider} !important`,
899
- alignItems: 'flex-start',
900
- padding: '16px 0 !important',
901
- '&:last-child': {
902
- borderBottom: 'none !important',
903
- gap: '30px',
904
- justifyContent: 'space-between',
905
- },
906
- width: '100%',
907
- gap: '50%',
908
- }));
909
- const StyledFormControlLabel = styled(FormControlLabel)(({ theme }) => ({
910
- '& .MuiRadio-root': {
911
- padding: '0 9px',
912
- },
913
- }));
914
- const ButtonLogout = styled(Button$1)(({ theme }) => {
915
- var _a, _b;
916
- return ({
917
- display: 'flex',
918
- padding: 16,
919
- alignItems: 'center',
920
- gap: 78,
921
- alignSelf: 'stretch',
922
- width: '100%',
923
- flex: '1 0 0',
924
- justifyContent: 'center',
925
- flexDirection: 'column',
926
- borderRadius: '100px !important',
927
- border: `1px solid ${((_a = theme.palette.secondary) === null || _a === void 0 ? void 0 : _a.main) || '#f00'} !important`,
928
- color: `${((_b = theme.palette.secondary) === null || _b === void 0 ? void 0 : _b.main) || '#f00'} !important`,
929
- });
930
- });
931
- const DivLogoutBtnWrapper = styled('div')(({ theme }) => ({
932
- margin: 16,
933
- }));
934
- const AnchorLink$1 = styled('a')(({ theme }) => ({
935
- color: 'inherit',
936
- '&:hover': {
937
- color: 'inherit',
938
- },
939
- }));
940
- const StyledButton$1 = styled(Button$1)(({ theme }) => {
941
- var _a, _b, _c, _d;
942
- return ({
943
- alignSelf: 'start',
944
- backgroundColor: (_b = (_a = theme === null || theme === void 0 ? void 0 : theme.palette) === null || _a === void 0 ? void 0 : _a.primary) === null || _b === void 0 ? void 0 : _b.main,
945
- color: ((_d = (_c = theme === null || theme === void 0 ? void 0 : theme.palette) === null || _c === void 0 ? void 0 : _c.common) === null || _d === void 0 ? void 0 : _d.white) || '#fff',
946
- height: '40px',
947
- borderRadius: '100px',
948
- padding: '10px 24px',
949
- });
950
- });
951
- const StyledButtonBanner = styled(Button$1)(({ theme }) => ({
952
- alignSelf: 'start',
953
- height: '40px',
954
- borderRadius: '100px',
955
- padding: '10px 24px',
956
- }));
957
- const TypographyBtnText = styled(Typography)(({ theme }) => {
958
- var _a, _b;
959
- return ({
960
- color: ((_b = (_a = theme === null || theme === void 0 ? void 0 : theme.palette) === null || _a === void 0 ? void 0 : _a.common) === null || _b === void 0 ? void 0 : _b.white) || '#fff',
961
- textTransform: 'none',
962
- });
963
- });
964
-
965
- /**
966
- * Header component with tenant theme support and responsive navigation
967
- *
968
- * @example
969
- * ```tsx
970
- * <Header
971
- * logo={logoSrc}
972
- * navigationLinks={navLinks}
973
- * languages={languageOptions}
974
- * currentLocale="en"
975
- * onLogoClick={() => history.push('/')}
976
- * onLoginClick={() => setShowLoginModal(true)}
977
- * />
978
- * ```
979
- */
980
- function Header$1({ logo, alternateLogo, showAlternateLogo = false, navigationLinks, languages, currentLocale, currentLang, userToken, userFirstName, isMobile: propIsMobile, scrolled = false, isPartnershipPageMobileView = false, isPartnershipPagePCView = false, isSeoPageView = false, showGetQuoteButton = false, bannerData, ctaData, host = '', welcomeMessage, formatMessage = (descriptor) => descriptor.id, menuItems, userProfileComponent, onLogoClick, onProductMenuClick, onLanguageChange, onLoginClick, onSignupClick, onLogoutClick, onPartnershipClick, onAboutUsClick, onBlogClick, onMyProfileClick, onGetQuoteClick, onPartnershipCTAClick, }) {
981
- var _a, _b;
982
- const tenantTheme = useTenantTheme();
983
- tenantTheme === null || tenantTheme === void 0 ? void 0 : tenantTheme.theme;
984
- const muiTheme = useTheme();
985
- const themeBreakpoint = useMediaQuery((_a = muiTheme === null || muiTheme === void 0 ? void 0 : muiTheme.breakpoints) === null || _a === void 0 ? void 0 : _a.down('md'));
986
- const isMobile = propIsMobile !== undefined ? propIsMobile : themeBreakpoint;
987
- const [anchorElNav, setAnchorElNav] = React.useState(null);
988
- const [anchorElLanguage, setAnchorElLanguage] = React.useState(null);
989
- const [anchorElUserMenu, setAnchorElUserMenu] = React.useState(null);
990
- const shouldShowContent = (!isPartnershipPagePCView || (isPartnershipPagePCView && !scrolled)) &&
991
- (!isSeoPageView || (isSeoPageView && !scrolled));
992
- const firstName1stLetter = ((_b = userFirstName === null || userFirstName === void 0 ? void 0 : userFirstName.trim()) === null || _b === void 0 ? void 0 : _b.slice(0, 1)) || '';
993
- const handleOpenNavMenu = (event) => {
994
- setAnchorElNav(event.currentTarget);
995
- };
996
- const handleOpenLanguageMenu = (event) => {
997
- setAnchorElLanguage(event.currentTarget);
998
- };
999
- const handleCloseNavMenu = () => {
1000
- setAnchorElNav(null);
1001
- };
1002
- const handleCloseLanguageMenu = () => {
1003
- setAnchorElLanguage(null);
1004
- };
1005
- const handleOpenUserMenu = (event) => {
1006
- setAnchorElUserMenu(event.currentTarget);
1007
- };
1008
- const handleCloseUserMenu = () => {
1009
- setAnchorElUserMenu(null);
1010
- };
1011
- const displayLogo = showAlternateLogo && alternateLogo ? alternateLogo : logo;
1012
- return (jsx(StyledAppBar$1, Object.assign({ ispartnershippagemobileview: isPartnershipPageMobileView, scrolled: scrolled }, { children: jsx(ResponsiveB2CLayout, { children: jsx(StyledContainer, Object.assign({ ispartnershippagemobileview: isPartnershipPageMobileView, scrolled: scrolled, maxWidth: "xl" }, { children: jsxs(Toolbar, Object.assign({ disableGutters: true }, { children: [jsx("a", Object.assign({ href: host || '#', onClick: (e) => {
1013
- e === null || e === void 0 ? void 0 : e.preventDefault();
1014
- onLogoClick === null || onLogoClick === void 0 ? void 0 : onLogoClick();
1015
- }, style: Object.assign({ marginRight: isMobile ? 2 : 5, display: 'flex', flexGrow: isMobile ? 1 : 0, fontFamily: 'monospace', fontWeight: 700, letterSpacing: '.3rem', color: 'inherit' }, (isMobile && { height: '44px', width: '73.3px' })) }, { children: jsx(TypographyLogo, Object.assign({ variant: "h6", noWrap: true, sx: {
1016
- mr: isMobile ? 2 : 5,
1017
- display: { xs: 'flex', md: 'flex' },
1018
- flexGrow: isMobile ? 1 : 0,
1019
- fontFamily: 'monospace',
1020
- fontWeight: 700,
1021
- letterSpacing: '.3rem',
1022
- color: 'inherit',
1023
- textDecoration: 'none',
1024
- } }, { children: jsx("img", { src: displayLogo, alt: "Logo", style: Object.assign({}, (isMobile && { height: '32px', width: '119px' })), height: isMobile ? '32px' : '57px', width: isMobile ? '119px' : '93.36px' }) })) })), !isMobile && (jsxs(Fragment, { children: [shouldShowContent && (jsxs(Box, Object.assign({ sx: {
1025
- flexGrow: 1,
1026
- display: { xs: 'none', md: 'flex', gap: 40 },
1027
- } }, { children: [jsxs(ButtonDesktopMenu, Object.assign({ onClick: handleOpenNavMenu, sx: { my: 2, textTransform: 'capitalize' }, "data-testid": "productNavigationMenu" }, { children: [jsx(Typography, Object.assign({ variant: "h6" }, { children: formatMessage({ id: 'Products' }) })), jsx(Icon, { component: ArrowDropDownIcon })] }), "product"), (menuItems === null || menuItems === void 0 ? void 0 : menuItems.partnership) && (jsx(ButtonDesktopMenu, Object.assign({ onClick: onPartnershipClick, sx: { my: 2, textTransform: 'capitalize' } }, { children: jsx(Typography, Object.assign({ variant: "h6" }, { children: jsx(AnchorLink$1, Object.assign({ href: `${host}${menuItems.partnership.route}`, onClick: (e) => e === null || e === void 0 ? void 0 : e.preventDefault() }, { children: menuItems.partnership.label })) })) }), "partnership")), (menuItems === null || menuItems === void 0 ? void 0 : menuItems.aboutUs) && (jsx(ButtonDesktopMenu, Object.assign({ onClick: onAboutUsClick, sx: { my: 2, textTransform: 'capitalize' } }, { children: jsx(Typography, Object.assign({ variant: "h6" }, { children: jsx(AnchorLinks, Object.assign({ href: `${host}${menuItems.aboutUs.route}`, onClick: (e) => e === null || e === void 0 ? void 0 : e.preventDefault() }, { children: menuItems.aboutUs.label })) })) }), "aboutus")), (menuItems === null || menuItems === void 0 ? void 0 : menuItems.blog) && (jsx(ButtonDesktopMenu, Object.assign({ onClick: onBlogClick, sx: { my: 2, textTransform: 'capitalize' } }, { children: jsx(Typography, Object.assign({ variant: "h6" }, { children: jsx(AnchorLink$1, Object.assign({ href: menuItems.blog.url, onClick: (e) => e === null || e === void 0 ? void 0 : e.preventDefault() }, { children: menuItems.blog.label })) })) }), "blog"))] }))), jsxs(Box, Object.assign({ sx: {
1028
- flexGrow: 1,
1029
- display: {
1030
- xs: 'none',
1031
- md: 'flex',
1032
- gap: 40,
1033
- justifyContent: 'flex-end',
1034
- },
1035
- } }, { children: [shouldShowContent && (jsxs(ButtonDesktopMenu, Object.assign({ onClick: handleOpenLanguageMenu, sx: { my: 2, textTransform: 'capitalize' }, "data-testid": "selectedLocale" }, { children: [jsx(Typography, Object.assign({ variant: "h6" }, { children: formatMessage({
1036
- id: `${currentLocale === null || currentLocale === void 0 ? void 0 : currentLocale.toLocaleUpperCase()}`,
1037
- }) })), jsx(Icon, { component: ArrowDropDownIcon })] }), "language")), isPartnershipPagePCView && scrolled ? (jsx(StyledButton$1, Object.assign({ variant: "contained", onClick: onPartnershipCTAClick }, { children: jsx(TypographyBtnText, Object.assign({ variant: "body1" }, { children: formatMessage({ id: 'Be Our Partner' }) })) }))) : isSeoPageView && scrolled && bannerData ? (jsx(StyledButtonBanner, Object.assign({ style: { background: bannerData === null || bannerData === void 0 ? void 0 : bannerData.ctaBGColor }, variant: "contained", onClick: onGetQuoteClick }, { children: jsx(Typography, Object.assign({ style: {
1038
- color: bannerData === null || bannerData === void 0 ? void 0 : bannerData.ctaTextColor,
1039
- textTransform: 'none',
1040
- }, variant: "body1" }, { children: bannerData === null || bannerData === void 0 ? void 0 : bannerData.ctaText })) }))) : userToken ? (jsx(StyledAvatar, Object.assign({ onClick: handleOpenUserMenu, "data-testid": "user-profile-avatar" }, { children: firstName1stLetter }))) : (jsxs(DivButtonWrapper, { children: [jsx(ButtonAuth, Object.assign({ color: "primary", variant: "outlined", sx: { textTransform: 'capitalize' }, onClick: onLoginClick, "data-testid": "headerLogin" }, { children: jsx(TypographyAuth, Object.assign({ variant: "body1" }, { children: formatMessage({ id: 'Log in' }) })) })), jsx(ButtonAuth, Object.assign({ color: "primary", variant: "contained", sx: { textTransform: 'capitalize' }, onClick: onSignupClick }, { children: jsx(TypographyAuth, Object.assign({ variant: "body1" }, { children: formatMessage({ id: 'Sign up' }) })) }))] }))] })), jsx(StyledMenu, Object.assign({ id: "menu-appbar", anchorEl: anchorElNav, anchorOrigin: {
1041
- vertical: 'bottom',
1042
- horizontal: 'left',
1043
- }, keepMounted: true, transformOrigin: {
1044
- vertical: 'top',
1045
- horizontal: 'left',
1046
- }, open: Boolean(anchorElNav), onClose: handleCloseNavMenu, sx: {
1047
- display: { xs: 'none', md: 'block' },
1048
- } }, { children: jsx(DivProductListing, { children: navigationLinks.map(({ key, name, icon }) => (jsxs(StyledMenuItem, Object.assign({ onClick: () => {
1049
- onProductMenuClick === null || onProductMenuClick === void 0 ? void 0 : onProductMenuClick(key);
1050
- handleCloseNavMenu();
1051
- }, "data-testid": `product-navigation-${key}` }, { children: [jsx(SpanImageWrapper, { children: jsx(ImageProductIcon, { src: icon, width: 18, height: 18, alt: name }) }), jsx(Typography, Object.assign({ variant: "body1", textAlign: "center" }, { children: jsx(AnchorLinks, Object.assign({ href: `#${key}`, onClick: (e) => e === null || e === void 0 ? void 0 : e.preventDefault() }, { children: formatMessage({ id: `${name}` }) })) }))] }), key))) }) })), jsx(StyledMenu, Object.assign({ id: "language-menu", anchorEl: anchorElLanguage, anchorOrigin: {
1052
- vertical: 'bottom',
1053
- horizontal: 'left',
1054
- }, keepMounted: true, transformOrigin: {
1055
- vertical: 'top',
1056
- horizontal: 'left',
1057
- }, open: Boolean(anchorElLanguage), onClose: handleCloseLanguageMenu, sx: {
1058
- display: { xs: 'none', md: 'block' },
1059
- } }, { children: jsx(DivProductListing, { children: languages.map(({ value, locale, label }) => (jsx(StyledMenuItem, Object.assign({ onClick: () => {
1060
- onLanguageChange === null || onLanguageChange === void 0 ? void 0 : onLanguageChange(locale, value);
1061
- handleCloseLanguageMenu();
1062
- }, "data-testid": `lang-${locale}` }, { children: jsx(Typography, Object.assign({ variant: "body1", textAlign: "center" }, { children: label })) }), value))) }) })), jsx(StyledMenu, Object.assign({ id: "user-menu", anchorEl: anchorElUserMenu, anchorOrigin: {
1063
- vertical: 'bottom',
1064
- horizontal: 'left',
1065
- }, keepMounted: true, transformOrigin: {
1066
- vertical: 'top',
1067
- horizontal: 'left',
1068
- }, open: Boolean(anchorElUserMenu), onClose: handleCloseUserMenu, sx: {
1069
- display: { xs: 'none', md: 'block' },
1070
- } }, { children: jsxs(DivProductListing, { children: [jsx(StyledMenuItem, Object.assign({ onClick: () => {
1071
- onMyProfileClick === null || onMyProfileClick === void 0 ? void 0 : onMyProfileClick();
1072
- handleCloseUserMenu();
1073
- } }, { children: jsx(Typography, Object.assign({ variant: "body1", textAlign: "center" }, { children: formatMessage({ id: `My profile` }) })) }), "myProfile"), jsx(StyledMenuItemDesktop, Object.assign({ onClick: () => {
1074
- onLogoutClick === null || onLogoutClick === void 0 ? void 0 : onLogoutClick();
1075
- handleCloseUserMenu();
1076
- } }, { children: jsx(Typography, Object.assign({ variant: "body1", textAlign: "center" }, { children: formatMessage({ id: `Logout` }) })) }), "logout")] }) }))] })), isMobile && (jsxs(Box, Object.assign({ sx: { flexGrow: 0, display: { xs: 'flex', md: 'none' } } }, { children: [jsx(IconButton, Object.assign({ size: "large", "aria-label": "account of current user", "aria-controls": "menu-appbar", "aria-haspopup": "true", "aria-labelledby": "menu icon", onClick: (e) => {
1077
- if (isPartnershipPageMobileView && scrolled) {
1078
- onPartnershipCTAClick === null || onPartnershipCTAClick === void 0 ? void 0 : onPartnershipCTAClick();
1079
- }
1080
- else if (isSeoPageView && scrolled) {
1081
- onGetQuoteClick === null || onGetQuoteClick === void 0 ? void 0 : onGetQuoteClick();
1082
- }
1083
- else {
1084
- handleOpenNavMenu(e);
1085
- }
1086
- }, color: "inherit", sx: Object.assign({}, (isPartnershipPageMobileView &&
1087
- scrolled && { padding: '0px !important' })) }, { children: Boolean(anchorElNav) ? (jsx(StyledCloseIcon, {})) : isPartnershipPageMobileView && scrolled ? (jsx(StyledButton$1, Object.assign({ variant: "contained", onClick: onPartnershipCTAClick }, { children: jsx(TypographyBtnText, Object.assign({ variant: "body1" }, { children: formatMessage({ id: 'Be Our Partner' }) })) }))) : isSeoPageView && scrolled && bannerData ? (jsx(StyledButtonBanner, Object.assign({ style: {
1088
- background: bannerData === null || bannerData === void 0 ? void 0 : bannerData.ctaBGColor,
1089
- }, variant: "contained", onClick: onGetQuoteClick }, { children: jsx(Typography, Object.assign({ style: {
1090
- color: bannerData === null || bannerData === void 0 ? void 0 : bannerData.ctaTextColor,
1091
- textTransform: 'none',
1092
- }, variant: "body1" }, { children: bannerData === null || bannerData === void 0 ? void 0 : bannerData.ctaText })) }))) : userToken ? (jsx(StyledAvatarUserIcon, Object.assign({ "data-testid": "user-profile-avatar" }, { children: firstName1stLetter }))) : (jsx(StyledMenuIcon, { ispartnershippagemobileview: isPartnershipPageMobileView, scrolled: scrolled })) })), jsxs(StyledDrawer$3, Object.assign({ id: "menu-appbar", anchor: "top", keepMounted: true, open: Boolean(anchorElNav), onClose: handleCloseNavMenu, sx: {
1093
- display: { xs: 'block', md: 'none' },
1094
- width: '100%',
1095
- left: 0,
1096
- } }, { children: [jsxs(DivLogoWrapper, { children: [jsx(DivLogo, { children: jsx("img", { src: logo, alt: "logo", width: "100%", height: "100%" }) }), jsx(DivCrossIconWrapper, { children: jsx(StyledCloseIconBtn, Object.assign({ size: "large", "aria-label": "close menu", "aria-controls": "menu-appbar", "aria-haspopup": "true", onClick: handleCloseNavMenu, color: "inherit" }, { children: jsx(CloseIcon, {}) })) })] }), userToken ? (userProfileComponent) : (jsxs(DivLoginActionContainer, { children: [jsx(Typography, Object.assign({ variant: "h6" }, { children: welcomeMessage || formatMessage({ id: 'Welcome' }) })), jsxs(DivButtonWrapper, { children: [jsx(ButtonAuth, Object.assign({ color: "primary", variant: "outlined", onClick: () => {
1097
- onLoginClick === null || onLoginClick === void 0 ? void 0 : onLoginClick();
1098
- handleCloseNavMenu();
1099
- }, "data-testid": "headerLogin" }, { children: jsx(TypographyAuth, Object.assign({ variant: "body1" }, { children: formatMessage({ id: 'Log in' }) })) })), jsx(ButtonAuth, Object.assign({ color: "primary", variant: "contained", onClick: () => {
1100
- onSignupClick === null || onSignupClick === void 0 ? void 0 : onSignupClick();
1101
- handleCloseNavMenu();
1102
- } }, { children: jsx(TypographyAuth, Object.assign({ variant: "body1" }, { children: formatMessage({ id: 'Sign up' }) })) }))] })] })), jsx(DivProductListing, { children: navigationLinks.map(({ key, name, icon }) => (jsxs(StyledMenuItem, Object.assign({ onClick: () => {
1103
- onProductMenuClick === null || onProductMenuClick === void 0 ? void 0 : onProductMenuClick(key);
1104
- handleCloseNavMenu();
1105
- }, "data-testid": `product-navigation-${key}` }, { children: [jsx(SpanImageWrapper, { children: jsx(ImageProductIcon, { src: icon, width: 18, height: 18, alt: name }) }), jsx(Typography, Object.assign({ variant: "body1", textAlign: "center" }, { children: formatMessage({ id: `${name}` }) }))] }), key))) }), jsxs(DivCommonMenus, { children: [userToken && (jsx(MenuItemOtherLinks, Object.assign({ onClick: () => {
1106
- handleCloseNavMenu();
1107
- onMyProfileClick === null || onMyProfileClick === void 0 ? void 0 : onMyProfileClick();
1108
- } }, { children: jsx(Typography, Object.assign({ variant: "body1", textAlign: "center" }, { children: formatMessage({ id: 'My Policy' }) })) }))), (menuItems === null || menuItems === void 0 ? void 0 : menuItems.blog) && (jsx(MenuItemOtherLinks, Object.assign({ onClick: onBlogClick }, { children: jsx(Typography, Object.assign({ variant: "body1", textAlign: "center" }, { children: jsx(AnchorLink$1, Object.assign({ href: menuItems.blog.url, onClick: (e) => e === null || e === void 0 ? void 0 : e.preventDefault() }, { children: menuItems.blog.label })) })) }))), (menuItems === null || menuItems === void 0 ? void 0 : menuItems.partnership) && (jsx(MenuItemOtherLinks, Object.assign({ onClick: () => {
1109
- handleCloseNavMenu();
1110
- onPartnershipClick === null || onPartnershipClick === void 0 ? void 0 : onPartnershipClick();
1111
- } }, { children: jsx(Typography, Object.assign({ variant: "body1", textAlign: "center" }, { children: menuItems.partnership.label })) }))), (menuItems === null || menuItems === void 0 ? void 0 : menuItems.aboutUs) && (jsx(MenuItemOtherLinks, Object.assign({ onClick: () => {
1112
- handleCloseNavMenu();
1113
- onAboutUsClick === null || onAboutUsClick === void 0 ? void 0 : onAboutUsClick();
1114
- } }, { children: jsx(Typography, Object.assign({ variant: "body1", textAlign: "center" }, { children: menuItems.aboutUs.label })) }))), jsxs(MenuItemOtherLinks, { children: [jsx(Typography, Object.assign({ variant: "body1", textAlign: "center" }, { children: formatMessage({ id: 'Language' }) })), jsx(RadioGroup, Object.assign({ row: true, "aria-labelledby": "language-selector", name: "language-selector", onChange: (e) => {
1115
- const value = e.target.value;
1116
- const selectedLang = languages.find((lang) => lang.locale === value);
1117
- if (selectedLang) {
1118
- onLanguageChange === null || onLanguageChange === void 0 ? void 0 : onLanguageChange(selectedLang.locale, selectedLang.value);
1119
- }
1120
- }, defaultValue: currentLocale, value: currentLocale }, { children: languages.map((lang) => (jsx(StyledFormControlLabel, { value: lang.locale, control: jsx(Radio, {}), label: lang.label, "data-testid": `lang-${lang.locale}` }, lang.locale))) }))] })] }), isMobile && userToken && (jsx(DivLogoutBtnWrapper, { children: jsx(ButtonLogout, Object.assign({ onClick: onLogoutClick }, { children: formatMessage({ id: 'Logout' }) })) }))] }))] })))] })) })) }) })));
1121
- }
1122
-
1123
- const StyledAppBar = styled(AppBar$1)(({ theme }) => ({
1124
- backgroundColor: '#FFFFFF',
1125
- boxShadow: '0px 2px 20px 4px rgba(0, 0, 0, 0.14)',
1126
- zIndex: theme.zIndex.drawer + 1,
1127
- }));
1128
- const StyledToolbar = styled(Toolbar)(({ theme }) => ({
1129
- display: 'flex',
1130
- alignItems: 'center',
1131
- justifyContent: 'space-between',
1132
- padding: '12px 16px',
1133
- minHeight: '64px !important',
1134
- [theme.breakpoints.down('md')]: {
1135
- minHeight: '56px !important',
1136
- padding: '12px 16px',
1137
- },
1138
- }));
1139
- const LogoContainer$1 = styled('div')(({ theme }) => ({
1140
- display: 'flex',
1141
- alignItems: 'center',
1142
- cursor: 'pointer',
1143
- height: '32px',
1144
- }));
1145
- const LogoImage = styled('img')(({ theme }) => ({
1146
- height: '32px',
1147
- width: 'auto',
1148
- objectFit: 'contain',
1149
- }));
1150
- const MenuIconButton = styled(IconButton)(({ theme }) => ({
1151
- padding: '6px',
1152
- borderRadius: '25px',
1153
- width: '40px',
1154
- height: '40px',
1155
- '& .MuiSvgIcon-root': {
1156
- color: '#000000',
1157
- fontSize: '24px',
1158
- },
1159
- }));
1160
- const StyledDrawer$2 = styled(Drawer)(({ theme }) => ({
1161
- '& .MuiDrawer-paper': {
1162
- backgroundColor: '#FFFFFF',
1163
- boxSizing: 'border-box',
1164
- },
1165
- }));
1166
- const DrawerHeader$2 = styled(Box)(({ theme }) => ({
1167
- display: 'flex',
1168
- alignItems: 'center',
1169
- justifyContent: 'space-between',
1170
- padding: '12px 16px',
1171
- minHeight: '64px',
1172
- }));
1173
- const DrawerLogoContainer = styled('div')(({ theme }) => ({
1174
- display: 'flex',
1175
- alignItems: 'center',
1176
- cursor: 'pointer',
1177
- height: '32px',
1178
- }));
1179
- const CloseIconButton = styled(IconButton)(({ theme }) => ({
1180
- padding: '6px',
1181
- '& .MuiSvgIcon-root': {
1182
- color: '#000000',
1183
- fontSize: '24px',
1184
- },
1185
- }));
1186
- const DrawerContent$2 = styled(Box)(({ theme }) => ({
1187
- flex: 1,
1188
- overflowY: 'auto',
1189
- paddingBottom: theme.spacing(2),
1190
- }));
1191
- styled(Box)(({ theme }) => ({
1192
- padding: theme.spacing(2),
1193
- borderTop: `1px solid ${theme.palette.divider}`,
1194
- }));
1195
-
1196
- /**
1197
- * NewHeader component - simplified design based on Figma
1198
- *
1199
- * @example
1200
- * ```tsx
1201
- * <NewHeader
1202
- * logo={logoSrc}
1203
- * navigationLinks={navLinks}
1204
- * onLogoClick={() => history.push('/')}
1205
- * />
1206
- * ```
1207
- */
1208
- function NewHeader({ logo: propLogo, navigationLinks = [], additionalMenuSections = [], isMobile: propIsMobile, onLogoClick, onMenuOpen, onMenuClose, customDrawerContent, formatMessage = (descriptor) => descriptor.id, }) {
1209
- var _a;
1210
- const tenantTheme = useTenantTheme();
1211
- const theme = tenantTheme === null || tenantTheme === void 0 ? void 0 : tenantTheme.theme;
1212
- const muiTheme = useTheme();
1213
- const themeBreakpoint = useMediaQuery((_a = muiTheme === null || muiTheme === void 0 ? void 0 : muiTheme.breakpoints) === null || _a === void 0 ? void 0 : _a.down('md'));
1214
- const isMobile = propIsMobile !== undefined ? propIsMobile : themeBreakpoint;
1215
- // Use prop logo if provided, otherwise try to get from theme
1216
- // Fallback to empty string to avoid SSR errors
1217
- const logo = propLogo || (theme === null || theme === void 0 ? void 0 : theme.logo) || '';
1218
- const [drawerOpen, setDrawerOpen] = React.useState(false);
1219
- const handleDrawerOpen = () => {
1220
- setDrawerOpen(true);
1221
- onMenuOpen === null || onMenuOpen === void 0 ? void 0 : onMenuOpen();
1222
- };
1223
- const handleDrawerClose = () => {
1224
- setDrawerOpen(false);
1225
- onMenuClose === null || onMenuClose === void 0 ? void 0 : onMenuClose();
1226
- };
1227
- const handleLogoClick = (e) => {
1228
- e.preventDefault();
1229
- onLogoClick === null || onLogoClick === void 0 ? void 0 : onLogoClick();
1230
- };
1231
- const handleMenuItemClick = (item) => {
1232
- var _a;
1233
- (_a = item.onClick) === null || _a === void 0 ? void 0 : _a.call(item);
1234
- handleDrawerClose();
1235
- };
1236
- return (jsxs(Fragment, { children: [jsx(StyledAppBar, Object.assign({ position: "fixed" }, { children: jsxs(StyledToolbar, Object.assign({ disableGutters: true }, { children: [jsx(LogoContainer$1, Object.assign({ onClick: handleLogoClick }, { children: jsx(LogoImage, { src: logo, alt: "Logo" }) })), jsx(MenuIconButton, Object.assign({ size: "large", edge: "end", "aria-label": "menu", onClick: handleDrawerOpen }, { children: jsx(MenuIcon, {}) }))] })) })), jsx(StyledDrawer$2, Object.assign({ anchor: "right", open: drawerOpen, onClose: handleDrawerClose }, { children: customDrawerContent ? (jsx(Box, Object.assign({ sx: { width: isMobile ? '100vw' : 350 } }, { children: customDrawerContent }))) : (jsxs(Box, Object.assign({ sx: { width: isMobile ? '100vw' : 350 } }, { children: [jsxs(DrawerHeader$2, { children: [jsx(DrawerLogoContainer, Object.assign({ onClick: handleLogoClick }, { children: jsx(LogoImage, { src: logo, alt: "Logo" }) })), jsx(CloseIconButton, Object.assign({ onClick: handleDrawerClose, "aria-label": "close" }, { children: jsx(CloseIcon, {}) }))] }), jsx(Divider, {}), jsxs(DrawerContent$2, { children: [navigationLinks.length > 0 && (jsx(List, { children: navigationLinks.map((item) => (jsx(ListItem, Object.assign({ disablePadding: true }, { children: jsx(ListItemButton, Object.assign({ onClick: () => handleMenuItemClick(item) }, { children: jsx(ListItemText, { primary: formatMessage({ id: item.label }) }) })) }), item.key))) })), additionalMenuSections.map((section, index) => (jsxs(React.Fragment, { children: [section.title && (jsxs(Fragment, { children: [jsx(Divider, {}), jsx(Box, Object.assign({ sx: { px: 2, py: 1 } }, { children: jsx(ListItemText, { primary: formatMessage({ id: section.title }), primaryTypographyProps: {
1237
- variant: 'caption',
1238
- color: 'text.secondary',
1239
- } }) }))] })), jsx(List, { children: section.items.map((item) => (jsx(ListItem, Object.assign({ disablePadding: true }, { children: jsx(ListItemButton, Object.assign({ onClick: () => handleMenuItemClick(item) }, { children: jsx(ListItemText, { primary: formatMessage({ id: item.label }) }) })) }), item.key))) })] }, index)))] })] }))) }))] }));
1240
- }
1241
-
1242
- const DivFooter = styled('div')(({ theme }) => ({
1243
- backgroundColor: '#424242',
1244
- padding: '20px 16px',
1245
- '@media (min-width: 769px)': {
1246
- padding: '70px 0px',
1247
- },
1248
- anchorLinks: {
1249
- color: 'inherit',
1250
- '&:hover': {
1251
- color: 'inherit',
1252
- },
1253
- },
1254
- }));
1255
- const DivFooterConterResponsiveLayout = styled('div')(({ theme }) => ({
1256
- color: '#fff',
1257
- [theme.breakpoints.up(1025)]: {
1258
- minWidth: '1128px',
1259
- maxWidth: '1128px',
1260
- margin: '0 auto',
1261
- },
1262
- }));
1263
- const FooterHiddenContent = styled('div')(({ theme, simplifiedLayout }) => simplifiedLayout ? { display: 'none' } : { display: 'flex' });
1264
- const DivIglooIntro = styled('div')(({ theme }) => {
1265
- var _a;
1266
- return ({
1267
- display: 'flex',
1268
- flexDirection: 'column',
1269
- gap: '24px',
1270
- color: ((_a = theme === null || theme === void 0 ? void 0 : theme.palette.common) === null || _a === void 0 ? void 0 : _a.white) || '#fff',
1271
- '@media (min-width: 769px)': {
1272
- width: 320,
1273
- marginRight: 194,
1274
- },
1275
- });
1276
- });
1277
- const DivSocial = styled('div')(({ theme }) => ({
1278
- display: 'flex',
1279
- alignItems: 'center',
1280
- margin: '0 auto',
1281
- columnGap: '32px',
1282
- flexDirection: 'row',
1283
- '@media (min-width: 769px)': {
1284
- margin: 'initial',
1285
- },
1286
- }));
1287
- const ButtonIcon = styled(Button$1)(({ theme }) => {
1288
- var _a;
1289
- return ({
1290
- color: ((_a = theme.palette.common) === null || _a === void 0 ? void 0 : _a.white) || '#fff',
1291
- padding: '0 !important',
1292
- minWidth: 'auto !important',
1293
- });
1294
- });
1295
- const TypographyIntro = styled(Typography)(({ theme }) => ({
1296
- textAlign: 'center',
1297
- color: `#fff !important`,
1298
- '@media (min-width: 769px)': {
1299
- textAlign: 'left',
1300
- },
1301
- }));
1302
- const TypographyAddressFooter = styled(Typography)(({ theme }) => ({
1303
- marginTop: 16,
1304
- textAlign: 'center',
1305
- color: '#fff',
1306
- '@media (min-width: 769px)': {
1307
- textAlign: 'left',
1308
- },
1309
- }));
1310
- const DivLogos = styled('div')(({ theme }) => ({
1311
- display: 'flex',
1312
- flexDirection: 'column',
1313
- gap: 16,
1314
- alignItems: 'center',
1315
- marginTop: 16,
1316
- '@media (min-width: 769px)': {
1317
- width: '100%',
1318
- marginTop: 0,
1319
- gap: 'initial',
1320
- alignItems: 'baseline',
1321
- },
1322
- }));
1323
- const DivFirstRow = styled('div')(({ theme }) => ({
1324
- display: 'flex',
1325
- flexDirection: 'row',
1326
- gap: 16,
1327
- }));
1328
- const ButtonOjkLink = styled(Button$1)(({ theme }) => ({
1329
- display: 'flex',
1330
- justifyContent: 'flex-start',
1331
- '@media (min-width: 769px)': {
1332
- display: 'flex !important',
1333
- justifyContent: 'flex-start !important ',
1334
- },
1335
- }));
1336
- const ImageOjkLicense = styled('img')(({ theme }) => ({
1337
- alignSelf: 'flex-start',
1338
- height: 36,
1339
- }));
1340
- const ButtonSolisoustamaLink = styled(Button$1)(({ theme }) => ({
1341
- display: 'flex',
1342
- justifyContent: 'flex-start',
1343
- }));
1344
- const ImageSolisoustama = styled('img')(({ theme }) => ({
1345
- height: 'auto',
1346
- }));
1347
- const DivLinks = styled('div')(({ theme }) => ({
1348
- display: 'flex',
1349
- flex: 1,
1350
- alignItems: 'center',
1351
- gap: 16,
1352
- justifyContent: 'center',
1353
- '@media (min-width: 769px)': {
1354
- flex: '1 1',
1355
- alignItems: 'normal',
1356
- },
1357
- }));
1358
- const DivSection = styled('div')(({ theme }) => ({
1359
- display: 'flex',
1360
- flexDirection: 'column',
1361
- gap: 16,
1362
- flex: 1,
1363
- alignItems: 'flex-start',
1364
- '@media (min-width: 769px)': {
1365
- gap: 24,
1366
- '&:not(:first-of-type)': {
1367
- marginLeft: 194,
1368
- },
1369
- },
1370
- }));
1371
- const ButtonBottomLink = styled(Button$1)(({ theme }) => ({
1372
- color: '#fff !important',
1373
- textTransform: 'capitalize',
1374
- '@media (min-width: 769px)': {
1375
- padding: '0 !important',
1376
- textAlign: 'left !important',
1377
- minWidth: 'auto !important',
1378
- },
1379
- }));
1380
- const StyledDivider = styled(Divider)(({ theme }) => ({
1381
- margin: '24px 0 16px !important',
1382
- borderColor: '#5F5E62 !important',
1383
- }));
1384
- const DivBottom = styled('div')(({ theme }) => ({
1385
- display: 'flex',
1386
- justifyContent: 'space-between',
1387
- alignItems: 'center',
1388
- }));
1389
- const DivSep = styled('div')(({ theme }) => ({
1390
- width: '1px',
1391
- height: 10,
1392
- borderRadius: '1px',
1393
- backgroundColor: '#fff',
1394
- }));
1395
- const AnchorLink = styled('a')(({ theme }) => ({
1396
- color: 'inherit',
1397
- '&:hover': {
1398
- color: 'inherit',
1399
- },
1400
- }));
1401
-
1402
- /**
1403
- * Footer component with tenant theme support
1404
- *
1405
- * @example
1406
- * ```tsx
1407
- * <Footer
1408
- * introText="Company introduction..."
1409
- * socialLinks={socialMediaLinks}
1410
- * licenseImages={licenses}
1411
- * navigationLinks={footerNavLinks}
1412
- * currentLocale="en"
1413
- * />
1414
- * ```
1415
- */
1416
- function Footer({ simplifiedLayout = false, introText, addressText, socialLinks, licenseImages, poweredByImage, navigationLinks = [], currentLocale, host = '', isMobile: propIsMobile, onLinkClick, onSocialClick, onPrivacyPolicyClick, onTermsOfServiceClick, formatMessage = (descriptor) => descriptor.id, }) {
1417
- var _a;
1418
- const tenantTheme = useTenantTheme();
1419
- tenantTheme === null || tenantTheme === void 0 ? void 0 : tenantTheme.theme;
1420
- const muiTheme = useTheme();
1421
- const themeBreakpoint = useMediaQuery((_a = muiTheme === null || muiTheme === void 0 ? void 0 : muiTheme.breakpoints) === null || _a === void 0 ? void 0 : _a.down('md'));
1422
- const isMobile = propIsMobile !== undefined ? propIsMobile : themeBreakpoint;
1423
- return (jsx(DivFooter, { children: jsxs(DivFooterConterResponsiveLayout, { children: [jsxs(FooterHiddenContent, Object.assign({ simplifiedLayout: simplifiedLayout }, { children: [jsxs(DivIglooIntro, { children: [isMobile && (jsx(DivSocial, { children: socialLinks.map((social) => (jsx(ButtonIcon, Object.assign({ onClick: () => onSocialClick === null || onSocialClick === void 0 ? void 0 : onSocialClick(social.platform, social.url), "aria-label": social.ariaLabel || social.platform }, { children: jsx("img", { src: social.icon, alt: social.platform, loading: "lazy", height: "24px", width: "24px" }) }), social.platform))) })), jsx(TypographyIntro, Object.assign({ variant: "body2" }, { children: formatMessage({ id: introText }) })), addressText && (jsx(TypographyAddressFooter, Object.assign({ variant: "body2" }, { children: addressText }))), jsxs(DivLogos, { children: [jsx(DivFirstRow, { children: licenseImages.map((license, index) => (jsx(ButtonOjkLink, Object.assign({ onClick: () => license.url && window.open(license.url), "aria-label": license.ariaLabel || license.alt }, { children: jsx(ImageOjkLicense, { src: license.src, alt: license.alt, width: license.width, height: license.height, loading: "lazy" }) }), index))) }), poweredByImage && (jsx(ButtonSolisoustamaLink, Object.assign({ "aria-label": poweredByImage.ariaLabel || 'Powered by' }, { children: jsx(ImageSolisoustama, { src: poweredByImage.src, alt: poweredByImage.alt, width: poweredByImage.width, height: poweredByImage.height, loading: "lazy" }) })))] })] }), !isMobile && (jsx(DivLinks, { children: navigationLinks === null || navigationLinks === void 0 ? void 0 : navigationLinks.map((items, index) => (jsxs(DivSection, { children: [items === null || items === void 0 ? void 0 : items.map((link, _index) => {
1424
- var _a, _b, _c;
1425
- const isExternalURL = (_c = (_b = (_a = link.outerHref) === null || _a === void 0 ? void 0 : _a.split(':')) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.includes('http');
1426
- const anchorLinkOuterRef = isExternalURL
1427
- ? link.outerHref || ''
1428
- : `${host}${link.outerHref}`;
1429
- const anchorLinkInnerRef = `${host}${link.innerHref}`;
1430
- return (jsx(ButtonBottomLink, Object.assign({ onClick: () => {
1431
- onLinkClick === null || onLinkClick === void 0 ? void 0 : onLinkClick(link);
1432
- } }, { children: jsx(Typography, Object.assign({ variant: "body1" }, { children: jsx(AnchorLink, Object.assign({ href: link.innerHref ? anchorLinkInnerRef : anchorLinkOuterRef || '', onClick: (e) => e === null || e === void 0 ? void 0 : e.preventDefault() }, { children: formatMessage({ id: `${link.label}` }) })) })) }), _index));
1433
- }), index === navigationLinks.length - 1 && (jsxs(Fragment, { children: [jsx(ButtonBottomLink, Object.assign({ onClick: onPrivacyPolicyClick }, { children: jsx(Typography, Object.assign({ variant: "body1" }, { children: jsx(AnchorLink, Object.assign({ href: `${host}/${currentLocale}/terms/privacypolicy`, onClick: (e) => e === null || e === void 0 ? void 0 : e.preventDefault() }, { children: formatMessage({ id: 'Privacy Policy' }) })) })) })), jsx(ButtonBottomLink, Object.assign({ onClick: onTermsOfServiceClick }, { children: jsx(Typography, Object.assign({ variant: "body1" }, { children: jsx(AnchorLink, Object.assign({ href: `${host}/${currentLocale}/terms/termsofservice`, onClick: (e) => e === null || e === void 0 ? void 0 : e.preventDefault() }, { children: formatMessage({ id: 'Terms of Service' }) })) })) })), jsx(DivSocial, { children: socialLinks.map((social) => (jsx(ButtonIcon, Object.assign({ onClick: () => onSocialClick === null || onSocialClick === void 0 ? void 0 : onSocialClick(social.platform, social.url), "aria-label": social.ariaLabel || social.platform }, { children: jsx(AnchorLink, Object.assign({ href: social.url, onClick: (e) => e === null || e === void 0 ? void 0 : e.preventDefault() }, { children: jsx("img", { src: social.icon, alt: social.platform, height: isMobile ? '24' : '28', width: isMobile ? '24' : '28', loading: "lazy" }) })) }), social.platform))) })] }))] }, index))) }))] })), isMobile && jsx(StyledDivider, {}), isMobile && (jsx(DivBottom, { children: jsxs(DivLinks, { children: [jsx("div", Object.assign({ onClick: onPrivacyPolicyClick, style: { cursor: 'pointer' } }, { children: jsx(Typography, Object.assign({ variant: "body2" }, { children: jsx(AnchorLink, Object.assign({ href: `${host}/${currentLocale}/terms/privacypolicy`, onClick: (e) => e === null || e === void 0 ? void 0 : e.preventDefault() }, { children: formatMessage({ id: 'Privacy Policy' }) })) })) })), jsx(DivSep, {}), jsx("div", Object.assign({ onClick: onTermsOfServiceClick, style: { cursor: 'pointer' } }, { children: jsx(Typography, Object.assign({ variant: "body2" }, { children: jsx(AnchorLink, Object.assign({ href: `${host}/${currentLocale}/terms/termsofservice`, onClick: (e) => e === null || e === void 0 ? void 0 : e.preventDefault() }, { children: formatMessage({ id: 'Terms of Service' }) })) })) }))] }) }))] }) }));
1434
- }
1435
-
1436
- const StyledDrawer$1 = styled(Drawer)(({ theme }) => ({
1437
- zIndex: '1300 !important',
1438
- '& .MuiDrawer-root': {
1439
- zIndex: 1300,
1440
- },
1441
- '& .MuiDrawer-paper': {
1442
- backgroundColor: '#FFFFFF',
1443
- boxSizing: 'border-box',
1444
- overflow: 'hidden',
1445
- zIndex: 1300,
1446
- },
1447
- '& .MuiBackdrop-root': {
1448
- zIndex: 1299,
1449
- },
1450
- }));
1451
- const DrawerHeader$1 = styled(Box)(({ theme }) => ({
1452
- display: 'flex',
1453
- alignItems: 'center',
1454
- justifyContent: 'flex-start',
1455
- padding: '16px',
1456
- minHeight: '56px',
1457
- }));
1458
- const DrawerContent$1 = styled(Box)(({ theme }) => ({
1459
- flex: 1,
1460
- overflowY: 'auto',
1461
- paddingBottom: theme.spacing(2),
1462
- }));
1463
- const DrawerFooter = styled(Box)(({ theme }) => ({
1464
- padding: '16px',
1465
- backgroundColor: '#FFFFFF',
1466
- borderTop: 'none',
1467
- boxShadow: '0px -2px 8px rgba(0, 0, 0, 0.08)',
1468
- }));
1469
- styled(Button$1)(({ theme }) => ({
1470
- minWidth: 'auto',
1471
- padding: 0,
1472
- }));
1473
- const HeaderSection = styled(Box)(({ theme }) => ({
1474
- backgroundColor: '#FFFFFF',
1475
- padding: '16px',
1476
- display: 'flex',
1477
- flexDirection: 'column',
1478
- gap: '12px',
1479
- }));
1480
- const CategoryIcon = styled(Box)(({ theme }) => ({
1481
- width: '32px',
1482
- height: '32px',
1483
- display: 'flex',
1484
- alignItems: 'center',
1485
- justifyContent: 'center',
1486
- }));
1487
- const TitleText = styled(Typography)(({ theme }) => ({
1488
- fontFamily: '"Montserrat", sans-serif',
1489
- fontWeight: 700,
1490
- fontSize: '20px',
1491
- lineHeight: '28px',
1492
- color: '#13131B',
1493
- }));
1494
- const SubtitleText = styled(Typography)(({ theme }) => ({
1495
- fontFamily: '"Montserrat", sans-serif',
1496
- fontWeight: 400,
1497
- fontSize: '14px',
1498
- lineHeight: '18px',
1499
- color: '#5F5E62',
1500
- }));
1501
- const FooterButtons = styled(Box)(({ theme }) => ({
1502
- display: 'flex',
1503
- flexDirection: 'column',
1504
- gap: '16px',
1505
- width: '100%',
1506
- }));
1507
- // Base button styles - colors will be injected via sx prop from component
1508
- const PrimaryButton = styled(Button$1)(({ theme }) => ({
1509
- color: '#FFFFFF',
1510
- borderRadius: '8px',
1511
- height: '48px',
1512
- textTransform: 'none',
1513
- fontFamily: '"Montserrat", sans-serif',
1514
- fontWeight: 500,
1515
- fontSize: '14px',
1516
- lineHeight: '18px',
1517
- '&:disabled': {
1518
- backgroundColor: '#C8C5CA',
1519
- color: '#FFFFFF',
1520
- },
1521
- }));
1522
- const SecondaryButton = styled(Button$1)(({ theme }) => ({
1523
- borderRadius: '8px',
1524
- height: '40px',
1525
- textTransform: 'none',
1526
- fontFamily: '"Montserrat", sans-serif',
1527
- fontWeight: 500,
1528
- fontSize: '14px',
1529
- lineHeight: '18px',
1530
- }));
1531
-
1532
- /**
1533
- * RecommendationsDrawer - Mobile drawer for recommendations and forms
1534
- *
1535
- * @example
1536
- * ```tsx
1537
- * <RecommendationsDrawer
1538
- * open={isOpen}
1539
- * onClose={handleClose}
1540
- * title="Personalize Your Plan"
1541
- * subtitle="Answer a few questions"
1542
- * primaryButtonText="Next"
1543
- * onPrimaryAction={handleNext}
1544
- * >
1545
- * <QuestionSection question="What is your budget?" />
1546
- * </RecommendationsDrawer>
1547
- * ```
1548
- */
1549
- function RecommendationsDrawer({ open, onClose, children, headerIcon, title, subtitle, showBackButton = false, onBack, primaryButtonText, onPrimaryAction, primaryButtonDisabled = false, secondaryButtonText, onSecondaryAction, showFooter = true, customFooter, formatMessage = (descriptor) => descriptor.id, }) {
1550
- var _a, _b, _c, _d, _e, _f, _g;
1551
- const muiTheme = useTheme();
1552
- useMediaQuery((_a = muiTheme === null || muiTheme === void 0 ? void 0 : muiTheme.breakpoints) === null || _a === void 0 ? void 0 : _a.down('md'));
1553
- const tenantTheme = useTenantTheme();
1554
- // Get primary color from tenant theme, fallback to default
1555
- const primaryColor = ((_d = (_c = (_b = tenantTheme === null || tenantTheme === void 0 ? void 0 : tenantTheme.theme) === null || _b === void 0 ? void 0 : _b.palette) === null || _c === void 0 ? void 0 : _c.primary) === null || _d === void 0 ? void 0 : _d.main) || '#317abc';
1556
- const primaryDark = ((_g = (_f = (_e = tenantTheme === null || tenantTheme === void 0 ? void 0 : tenantTheme.theme) === null || _e === void 0 ? void 0 : _e.palette) === null || _f === void 0 ? void 0 : _f.primary) === null || _g === void 0 ? void 0 : _g.dark) || '#2869a8';
1557
- // Helper to convert hex to rgba
1558
- const hexToRgba = (hex, alpha) => {
1559
- const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
1560
- if (result) {
1561
- const r = parseInt(result[1], 16);
1562
- const g = parseInt(result[2], 16);
1563
- const b = parseInt(result[3], 16);
1564
- return `rgba(${r}, ${g}, ${b}, ${alpha})`;
1565
- }
1566
- return `rgba(49, 122, 188, ${alpha})`;
1567
- };
1568
- const handleClose = () => {
1569
- onClose();
1570
- };
1571
- const handleBackOrClose = () => {
1572
- if (showBackButton && onBack) {
1573
- onBack();
1574
- }
1575
- else {
1576
- onClose();
1577
- }
1578
- };
1579
- return (jsx(StyledDrawer$1, Object.assign({ anchor: "bottom", open: open, onClose: handleClose, PaperProps: {
1580
- sx: {
1581
- height: '95vh',
1582
- borderTopLeftRadius: '16px',
1583
- borderTopRightRadius: '16px',
1584
- maxHeight: '95vh',
1585
- },
1586
- }, sx: {
1587
- zIndex: 1300,
1588
- } }, { children: jsxs(Box, Object.assign({ sx: { display: 'flex', flexDirection: 'column', height: '100%' } }, { children: [jsx(DrawerHeader$1, { children: jsx(IconButton, Object.assign({ onClick: handleBackOrClose, sx: { padding: 0 }, "aria-label": showBackButton ? 'back' : 'close' }, { children: showBackButton ? jsx(ArrowBackIcon, {}) : jsx(CloseIcon, {}) })) }), (title || subtitle || headerIcon) && (jsxs(HeaderSection, { children: [headerIcon && (jsx(CategoryIcon, { children: jsx("img", { src: headerIcon, alt: "Category icon", width: 32, height: 32 }) })), title && (jsx(TitleText, Object.assign({ variant: "h5" }, { children: formatMessage({ id: title }) }))), subtitle && (jsx(SubtitleText, Object.assign({ variant: "body2" }, { children: formatMessage({ id: subtitle }) })))] })), jsx(DrawerContent$1, { children: children }), showFooter && (jsx(DrawerFooter, { children: customFooter ? (customFooter) : (jsxs(FooterButtons, { children: [primaryButtonText && (jsx(PrimaryButton, Object.assign({ variant: "contained", fullWidth: true, onClick: onPrimaryAction, disabled: primaryButtonDisabled, sx: {
1589
- backgroundColor: primaryColor,
1590
- '&:hover': {
1591
- backgroundColor: primaryDark,
1592
- },
1593
- } }, { children: formatMessage({ id: primaryButtonText }) }))), secondaryButtonText && (jsx(SecondaryButton, Object.assign({ variant: "text", fullWidth: true, onClick: onSecondaryAction, sx: {
1594
- color: primaryColor,
1595
- '&:hover': {
1596
- backgroundColor: hexToRgba(primaryColor, 0.08),
1597
- },
1598
- } }, { children: formatMessage({ id: secondaryButtonText }) })))] })) }))] })) })));
1599
- }
1600
-
1601
- const StyledDrawer = styled$1(Drawer)(({ theme }) => ({
1602
- zIndex: 1300,
1603
- '& .MuiDrawer-paper': {
1604
- borderTopLeftRadius: '8px',
1605
- borderTopRightRadius: '8px',
1606
- maxHeight: '90vh',
1607
- },
1608
- }));
1609
- const DrawerContent = styled$1(Box)({
1610
- display: 'flex',
1611
- flexDirection: 'column',
1612
- width: '100%',
1613
- backgroundColor: '#ffffff',
1614
- });
1615
- const DrawerHeader = styled$1(Box)({
1616
- display: 'flex',
1617
- justifyContent: 'flex-end',
1618
- alignItems: 'center',
1619
- padding: '16px 16px 0',
1620
- backgroundColor: '#ffffff',
1621
- });
1622
- const CloseButtonContainer = styled$1(Box)({
1623
- width: '24px',
1624
- height: '24px',
1625
- });
1626
- const Header = styled$1(Box)({
1627
- display: 'flex',
1628
- flexDirection: 'column',
1629
- gap: '6px',
1630
- padding: '16px',
1631
- backgroundColor: '#ffffff',
1632
- });
1633
- const HeaderTitle = styled$1(Typography)({
1634
- fontFamily: 'Montserrat, sans-serif',
1635
- fontSize: '20px',
1636
- fontWeight: 700,
1637
- lineHeight: '28px',
1638
- color: '#13131b',
1639
- });
1640
- const HeaderSubtitle = styled$1(Typography)({
1641
- fontFamily: 'Montserrat, sans-serif',
1642
- fontSize: '14px',
1643
- fontWeight: 400,
1644
- lineHeight: '18px',
1645
- color: 'rgba(0, 0, 0, 0.6)',
1646
- });
1647
- const ProductsContainer = styled$1(Box)({
1648
- padding: '16px',
1649
- backgroundColor: '#ffffff',
1650
- });
1651
- const ProductsGrid = styled$1(Box)({
1652
- display: 'grid',
1653
- gridTemplateColumns: 'repeat(2, 1fr)',
1654
- gap: '12px',
1655
- });
1656
- const ProductCard$1 = styled$1(Box)({
1657
- display: 'flex',
1658
- flexDirection: 'column',
1659
- gap: '16px',
1660
- backgroundColor: '#ffffff',
1661
- borderRadius: '12px',
1662
- boxShadow: '0px 2px 10px 0px rgba(0, 0, 0, 0.12)',
1663
- padding: '16px 12px 12px',
1664
- height: '168px',
1665
- });
1666
- const ProductInfo$1 = styled$1(Box)({
1667
- display: 'flex',
1668
- flexDirection: 'column',
1669
- gap: '6px',
1670
- alignItems: 'center',
1671
- justifyContent: 'center',
1672
- flex: 1,
1673
- });
1674
- const ProductLogo = styled$1(Box)({
1675
- display: 'flex',
1676
- alignItems: 'center',
1677
- justifyContent: 'center',
1678
- padding: '4px',
1679
- });
1680
- const ProductName$1 = styled$1(Typography)({
1681
- fontFamily: 'Montserrat, sans-serif',
1682
- fontSize: '14px',
1683
- fontWeight: 700,
1684
- lineHeight: '22px',
1685
- color: '#13131b',
1686
- textAlign: 'center',
1687
- });
1688
- const ProductType = styled$1(Typography)({
1689
- fontFamily: 'Montserrat, sans-serif',
1690
- fontSize: '12px',
1691
- fontWeight: 400,
1692
- lineHeight: '16px',
1693
- color: '#13131b',
1694
- textAlign: 'center',
1695
- });
1696
- // Base button styles - colors will be injected via sx prop from component
1697
- const ViewPlansButton = styled$1(Button$1)({
1698
- color: '#ffffff',
1699
- borderRadius: '8px',
1700
- height: '36px',
1701
- textTransform: 'none',
1702
- fontFamily: 'Montserrat, sans-serif',
1703
- fontSize: '14px',
1704
- fontWeight: 500,
1705
- lineHeight: '18px',
1706
- });
1707
-
1708
- function ProductSelectionDrawer({ open, onClose, products, onProductSelect, title = 'Select your product', subtitle = 'Pick the product that suits your protection goals to view available plans', viewPlansButtonText = 'View plans', }) {
1709
- var _a, _b, _c, _d, _e, _f;
1710
- const tenantTheme = useTenantTheme();
1711
- // Get primary color from tenant theme, fallback to default
1712
- const primaryColor = ((_c = (_b = (_a = tenantTheme === null || tenantTheme === void 0 ? void 0 : tenantTheme.theme) === null || _a === void 0 ? void 0 : _a.palette) === null || _b === void 0 ? void 0 : _b.primary) === null || _c === void 0 ? void 0 : _c.main) || '#317abc';
1713
- const primaryDark = ((_f = (_e = (_d = tenantTheme === null || tenantTheme === void 0 ? void 0 : tenantTheme.theme) === null || _d === void 0 ? void 0 : _d.palette) === null || _e === void 0 ? void 0 : _e.primary) === null || _f === void 0 ? void 0 : _f.dark) || '#2869a8';
1714
- const primaryDarker = '#1f5489'; // Active state
1715
- return (jsx(StyledDrawer, Object.assign({ anchor: "bottom", open: open, onClose: onClose }, { children: jsxs(DrawerContent, { children: [jsx(DrawerHeader, { children: jsx(CloseButtonContainer, { children: jsx(IconButton, Object.assign({ onClick: onClose, sx: { padding: 0 } }, { children: jsx(CloseIcon, { sx: { fontSize: 24, color: '#13131b' } }) })) }) }), jsxs(Header, { children: [jsx(HeaderTitle, { children: title }), jsx(HeaderSubtitle, { children: subtitle })] }), jsx(ProductsContainer, { children: jsx(ProductsGrid, { children: products.map((product) => (jsxs(ProductCard$1, { children: [jsxs(ProductInfo$1, { children: [jsx(ProductLogo, { children: jsx("img", { src: product.logo, alt: product.name, style: {
1716
- width: '88px',
1717
- height: '32px',
1718
- objectFit: 'cover',
1719
- } }) }), jsxs(Box, Object.assign({ sx: { textAlign: 'center', width: '100%' } }, { children: [jsx(ProductName$1, { children: product.name }), jsx(ProductType, { children: product.type })] }))] }), jsx(ViewPlansButton, Object.assign({ variant: "contained", fullWidth: true, onClick: () => onProductSelect(product.id), sx: {
1720
- backgroundColor: primaryColor,
1721
- '&:hover': {
1722
- backgroundColor: primaryDark,
1723
- },
1724
- '&:active': {
1725
- backgroundColor: primaryDarker,
1726
- },
1727
- } }, { children: viewPlansButtonText }))] }, product.id))) }) })] }) })));
1728
- }
1729
-
1730
- const QuestionContainer$1 = styled(Box)(({ theme }) => ({
1731
- backgroundColor: '#FFFFFF',
1732
- padding: '12px 16px',
1733
- display: 'flex',
1734
- flexDirection: 'column',
1735
- gap: '16px',
1736
- width: '100%',
1737
- }));
1738
- const QuestionHeader = styled(Box)(({ theme }) => ({
1739
- display: 'flex',
1740
- flexDirection: 'column',
1741
- gap: '6px',
1742
- width: '100%',
1743
- }));
1744
- const QuestionTitle = styled(Typography)(({ theme }) => ({
1745
- fontFamily: '"Montserrat", sans-serif',
1746
- fontWeight: 600,
1747
- fontSize: '14px',
1748
- lineHeight: '20px',
1749
- color: '#13131B',
1750
- }));
1751
- const QuestionSubtext = styled(Typography)(({ theme }) => ({
1752
- fontFamily: '"Montserrat", sans-serif',
1753
- fontWeight: 400,
1754
- fontSize: '12px',
1755
- lineHeight: '16px',
1756
- color: '#5F5E62',
1757
- }));
1758
- const OptionsContainer$1 = styled(Box)(({ theme }) => ({
1759
- display: 'flex',
1760
- flexDirection: 'column',
1761
- gap: '8px',
1762
- width: '100%',
1763
- }));
1764
-
1765
- /**
1766
- * QuestionSection - Displays a question with selectable options
1767
- *
1768
- * @example
1769
- * ```tsx
1770
- * <QuestionSection
1771
- * questionNumber="1"
1772
- * question="Which plan feels right for you?"
1773
- * helperText="Select one option"
1774
- * options={planOptions}
1775
- * selectedValue={selectedPlan}
1776
- * onSelect={setSelectedPlan}
1777
- * />
1778
- * ```
1779
- */
1780
- function QuestionSection({ questionNumber, question, helperText, options, selectedValue, onSelect, multiple = false, selectedValues = [], renderOption, formatMessage = (descriptor) => descriptor.id, }) {
1781
- const isSelected = (optionValue) => {
1782
- if (multiple) {
1783
- return selectedValues.includes(optionValue);
1784
- }
1785
- return selectedValue === optionValue;
1786
- };
1787
- return (jsxs(QuestionContainer$1, { children: [jsxs(QuestionHeader, { children: [jsxs(QuestionTitle, Object.assign({ variant: "subtitle1" }, { children: [questionNumber && `${questionNumber}. `, formatMessage({ id: question })] })), helperText && (jsx(QuestionSubtext, Object.assign({ variant: "caption" }, { children: formatMessage({ id: helperText }) })))] }), jsx(OptionsContainer$1, { children: options.map((option) => {
1788
- const selected = isSelected(option.value);
1789
- if (renderOption) {
1790
- return renderOption(option, selected);
1791
- }
1792
- // Default rendering handled by parent or OptionButton component
1793
- return null;
1794
- }) })] }));
1795
- }
1796
-
1797
- const StyledOptionButton = styled(ButtonBase)(({ theme, selected, size = 'medium', fullWidth }) => {
1798
- const heights = {
1799
- small: '32px',
1800
- medium: '40px',
1801
- large: '48px',
1802
- };
1803
- return {
1804
- height: heights[size],
1805
- width: fullWidth ? '100%' : 'auto',
1806
- borderRadius: '8px',
1807
- border: selected
1808
- ? '2px solid #317ABC'
1809
- : '1px solid #C8C5CA',
1810
- backgroundColor: selected ? 'rgba(49, 122, 188, 0.1)' : '#FFFFFF',
1811
- padding: '10px 24px',
1812
- display: 'flex',
1813
- alignItems: 'center',
1814
- justifyContent: 'center',
1815
- cursor: 'pointer',
1816
- transition: 'all 0.2s ease',
1817
- '&:hover': {
1818
- backgroundColor: selected ? 'rgba(49, 122, 188, 0.15)' : 'rgba(0, 0, 0, 0.04)',
1819
- },
1820
- '&:disabled': {
1821
- backgroundColor: '#F5F5F5',
1822
- border: '1px solid #EEEEEE',
1823
- cursor: 'not-allowed',
1824
- opacity: 0.6,
1825
- },
1826
- };
1827
- });
1828
- const OptionContent = styled(Box)(({ theme }) => ({
1829
- display: 'flex',
1830
- alignItems: 'center',
1831
- justifyContent: 'center',
1832
- gap: '8px',
1833
- width: '100%',
1834
- }));
1835
- const OptionIcon = styled('span')(({ theme }) => ({
1836
- fontSize: '18px',
1837
- lineHeight: 1,
1838
- flexShrink: 0,
1839
- }));
1840
- const OptionLabel = styled(Typography)(({ theme, selected, disabled }) => ({
1841
- fontFamily: '"Montserrat", sans-serif',
1842
- fontWeight: selected ? 600 : 500,
1843
- fontSize: '14px',
1844
- lineHeight: '20px',
1845
- color: disabled ? 'rgba(0, 0, 0, 0.4)' : '#13131B',
1846
- textAlign: 'center',
1847
- }));
1848
-
1849
- /**
1850
- * OptionButton - Selectable button for questionnaire options
1851
- *
1852
- * @example
1853
- * ```tsx
1854
- * <OptionButton
1855
- * value="option1"
1856
- * label="Option 1"
1857
- * icon="🎯"
1858
- * selected={selectedValue === 'option1'}
1859
- * onClick={(value) => setSelectedValue(value)}
1860
- * />
1861
- * ```
1862
- */
1863
- function OptionButton$1({ value, label, icon, selected = false, disabled = false, onClick, size = 'medium', fullWidth = true, formatMessage = (descriptor) => descriptor.id, }) {
1864
- const handleClick = () => {
1865
- if (!disabled && onClick) {
1866
- onClick(value);
1867
- }
1868
- };
1869
- return (jsx(StyledOptionButton, Object.assign({ selected: selected, disabled: disabled, onClick: handleClick, size: size, fullWidth: fullWidth }, { children: jsxs(OptionContent, { children: [icon && jsx(OptionIcon, { children: icon }), jsx(OptionLabel, Object.assign({ selected: selected, disabled: disabled, variant: "body2" }, { children: formatMessage({ id: label }) }))] }) })));
1870
- }
1871
-
1872
- const ToggleContainer$1 = styled(Box)(({ theme }) => ({
1873
- backgroundColor: '#F9F9F9',
1874
- borderRadius: '40px',
1875
- display: 'flex',
1876
- gap: '6px',
1877
- height: '48px',
1878
- padding: '0',
1879
- width: '100%',
1880
- }));
1881
- const ToggleButton$1 = styled(ButtonBase)(({ theme, selected }) => ({
1882
- flex: 1,
1883
- display: 'flex',
1884
- alignItems: 'center',
1885
- justifyContent: 'center',
1886
- gap: '4px',
1887
- padding: '8px',
1888
- borderRadius: selected ? '40px' : '104px',
1889
- backgroundColor: selected ? '#00E08B' : 'transparent',
1890
- transition: 'all 0.3s ease',
1891
- '&:hover': {
1892
- backgroundColor: selected ? '#00D080' : 'rgba(0, 0, 0, 0.04)',
1893
- },
1894
- }));
1895
- const ToggleIcon = styled(Box)(({ theme }) => ({
1896
- backgroundColor: '#FFFFFF',
1897
- borderRadius: '50px',
1898
- width: '32px',
1899
- height: '32px',
1900
- display: 'flex',
1901
- alignItems: 'center',
1902
- justifyContent: 'center',
1903
- padding: '6px',
1904
- }));
1905
- const ToggleLabel = styled(Typography)(({ theme, selected }) => ({
1906
- fontFamily: '"Montserrat", sans-serif',
1907
- fontWeight: 600,
1908
- fontSize: '14px',
1909
- lineHeight: '20px',
1910
- color: selected ? '#FEFBFF' : '#5F5E62',
1911
- whiteSpace: 'nowrap',
1912
- }));
1913
-
1914
- /**
1915
- * ToggleGroup - Segmented control for switching between options
1916
- *
1917
- * @example
1918
- * ```tsx
1919
- * <ToggleGroup
1920
- * options={[
1921
- * { value: 'domestic', label: 'Domestic', icon: '🏠' },
1922
- * { value: 'international', label: 'International', icon: '✈️' }
1923
- * ]}
1924
- * value={selectedType}
1925
- * onChange={setSelectedType}
1926
- * />
1927
- * ```
1928
- */
1929
- function ToggleGroup({ options, value, onChange, formatMessage = (descriptor) => descriptor.id, }) {
1930
- return (jsx(ToggleContainer$1, { children: options.map((option) => (jsxs(ToggleButton$1, Object.assign({ selected: value === option.value, onClick: () => onChange(option.value) }, { children: [option.icon && (jsx(ToggleIcon, { children: jsx("img", { src: option.icon, alt: option.label, width: 19.2, height: 19.2 }) })), jsx(ToggleLabel, Object.assign({ selected: value === option.value }, { children: formatMessage({ id: option.label }) }))] }), option.value))) }));
1931
- }
1932
-
1933
410
  /**
1934
411
  * Theme Utility Functions
1935
412
  * Helper functions for working with tenant themes
1936
413
  */
1937
414
  /**
1938
415
  * Get color value from theme palette path
1939
- * @param theme - Tenant theme configuration (can be undefined/null for SSR)
416
+ * @param theme - Tenant theme configuration
1940
417
  * @param path - Dot-notation path to color (e.g., 'primary.main')
1941
418
  * @param defaultColor - Fallback color if path not found
1942
419
  * @returns Color string
1943
420
  */
1944
421
  function getThemeColor(theme, path, defaultColor = '#000000') {
1945
- // Handle SSR case where theme might be undefined
1946
- if (!theme || !theme.palette) {
1947
- return defaultColor;
1948
- }
1949
422
  const keys = path.split('.');
1950
423
  let value = theme.palette;
1951
424
  for (const key of keys) {
@@ -1960,22 +433,15 @@ function getThemeColor(theme, path, defaultColor = '#000000') {
1960
433
  }
1961
434
  /**
1962
435
  * Merge tenant theme with base MUI theme
1963
- * This makes tenant theme accessible in styled components via theme parameter
1964
436
  * @param baseTheme - Base MUI theme
1965
437
  * @param tenantTheme - Tenant-specific theme configuration
1966
438
  * @returns Merged theme
1967
439
  */
1968
440
  function mergeTenantTheme(baseTheme, tenantTheme) {
1969
- // Merge tenant palette and typography into MUI theme
1970
- const mergedPalette = Object.assign(Object.assign(Object.assign({}, baseTheme.palette), tenantTheme.palette), {
1971
- // Make tenant colors accessible via theme.palette
1972
- tenant: tenantTheme.palette });
1973
- const mergedTypography = Object.assign(Object.assign(Object.assign({}, baseTheme.typography), tenantTheme.typography), {
1974
- // Make tenant typography accessible via theme.typography
1975
- tenant: tenantTheme.typography });
1976
- return Object.assign(Object.assign({}, baseTheme), { palette: mergedPalette, typography: mergedTypography,
1977
- // Also add tenant theme at root level for easy access
1978
- tenantTheme });
441
+ var _a, _b;
442
+ return Object.assign(Object.assign({}, baseTheme), { palette: Object.assign(Object.assign(Object.assign({}, baseTheme.palette), tenantTheme.palette), {
443
+ // Deep merge for nested objects
444
+ primary: Object.assign(Object.assign({}, (((_a = baseTheme.palette) === null || _a === void 0 ? void 0 : _a.primary) || {})), (tenantTheme.palette.primary || {})), secondary: Object.assign(Object.assign({}, (((_b = baseTheme.palette) === null || _b === void 0 ? void 0 : _b.secondary) || {})), (tenantTheme.palette.secondary || {})) }), typography: Object.assign(Object.assign({}, baseTheme.typography), tenantTheme.typography) });
1979
445
  }
1980
446
  /**
1981
447
  * Create CSS variables from tenant theme
@@ -2010,931 +476,5 @@ function createThemeCSSVariables(theme, prefix = '--tenant') {
2010
476
  return variables;
2011
477
  }
2012
478
 
2013
- const ToggleContainer = styled(Box)(({ theme }) => {
2014
- var _a, _b;
2015
- return ({
2016
- display: 'flex',
2017
- gap: '6px',
2018
- height: '48px',
2019
- backgroundColor: ((_b = (_a = theme === null || theme === void 0 ? void 0 : theme.palette) === null || _a === void 0 ? void 0 : _a.ui) === null || _b === void 0 ? void 0 : _b.sliderBackground) || '#f9f9f9',
2020
- borderRadius: '40px',
2021
- width: '100%',
2022
- padding: '0',
2023
- position: 'relative',
2024
- });
2025
- });
2026
- const ToggleButton = styled(Box)(({ theme, active }) => {
2027
- var _a, _b, _c, _d, _e, _f;
2028
- return ({
2029
- flex: 1,
2030
- display: 'flex',
2031
- gap: '4px',
2032
- alignItems: 'center',
2033
- justifyContent: 'center',
2034
- padding: '8px',
2035
- height: '100%',
2036
- borderRadius: '40px',
2037
- cursor: 'pointer',
2038
- backgroundColor: active
2039
- ? ((_b = (_a = theme === null || theme === void 0 ? void 0 : theme.palette) === null || _a === void 0 ? void 0 : _a.ui) === null || _b === void 0 ? void 0 : _b.toggleActive) || '#a4ce4e'
2040
- : 'transparent',
2041
- color: active
2042
- ? ((_d = (_c = theme === null || theme === void 0 ? void 0 : theme.palette) === null || _c === void 0 ? void 0 : _c.ui) === null || _d === void 0 ? void 0 : _d.toggleActiveText) || '#fefbff'
2043
- : ((_f = (_e = theme === null || theme === void 0 ? void 0 : theme.palette) === null || _e === void 0 ? void 0 : _e.ui) === null || _f === void 0 ? void 0 : _f.toggleInactiveText) || '#5f5e62',
2044
- transition: 'all 0.2s ease',
2045
- '&:hover': {
2046
- opacity: 0.9,
2047
- },
2048
- });
2049
- });
2050
- const ToggleText = styled(Typography)(({ theme }) => {
2051
- var _a, _b, _c, _d, _e, _f;
2052
- return ({
2053
- fontFamily: ((_a = theme === null || theme === void 0 ? void 0 : theme.typography) === null || _a === void 0 ? void 0 : _a.fontFamily) ||
2054
- "'Montserrat', sans-serif",
2055
- fontSize: ((_c = (_b = theme === null || theme === void 0 ? void 0 : theme.typography) === null || _b === void 0 ? void 0 : _b.bodyMedium) === null || _c === void 0 ? void 0 : _c.fontSize) || '14px',
2056
- fontWeight: ((_d = theme === null || theme === void 0 ? void 0 : theme.typography) === null || _d === void 0 ? void 0 : _d.fontWeightSemiBold) || 600,
2057
- lineHeight: ((_f = (_e = theme === null || theme === void 0 ? void 0 : theme.typography) === null || _e === void 0 ? void 0 : _e.bodyMedium) === null || _f === void 0 ? void 0 : _f.lineHeight) || '20px',
2058
- whiteSpace: 'nowrap',
2059
- });
2060
- });
2061
-
2062
- /**
2063
- * BillingToggle - Toggle between monthly and annual billing
2064
- *
2065
- * @example
2066
- * ```tsx
2067
- * <BillingToggle
2068
- * value={billingType}
2069
- * onChange={setBillingType}
2070
- * />
2071
- * ```
2072
- */
2073
- function BillingToggle({ value, onChange, formatMessage = (descriptor) => descriptor.defaultMessage || descriptor.id, }) {
2074
- // Safely get theme, handle SSR case where it might be undefined
2075
- const tenantTheme = useTenantTheme();
2076
- const theme = tenantTheme === null || tenantTheme === void 0 ? void 0 : tenantTheme.theme;
2077
- // Get theme colors with SSR-safe fallbacks
2078
- const toggleActiveColor = getThemeColor(theme, 'ui.toggleActive', '#a4ce4e');
2079
- const toggleActiveTextColor = getThemeColor(theme, 'ui.toggleActiveText', '#fefbff');
2080
- const toggleInactiveTextColor = getThemeColor(theme, 'ui.toggleInactiveText', '#5f5e62');
2081
- const toggleBgColor = getThemeColor(theme, 'ui.sliderBackground', '#f9f9f9');
2082
- return (jsxs(ToggleContainer, Object.assign({ sx: {
2083
- backgroundColor: toggleBgColor,
2084
- } }, { children: [jsx(ToggleButton, Object.assign({ active: value === 'monthly', onClick: () => onChange('monthly'), sx: {
2085
- backgroundColor: value === 'monthly' ? toggleActiveColor : 'transparent',
2086
- color: value === 'monthly'
2087
- ? toggleActiveTextColor
2088
- : toggleInactiveTextColor,
2089
- } }, { children: jsx(ToggleText, { children: formatMessage({
2090
- id: 'Billed monthly',
2091
- defaultMessage: 'Billed monthly',
2092
- }) }) })), jsx(ToggleButton, Object.assign({ active: value === 'annually', onClick: () => onChange('annually'), sx: {
2093
- backgroundColor: value === 'annually' ? toggleActiveColor : 'transparent',
2094
- color: value === 'annually'
2095
- ? toggleActiveTextColor
2096
- : toggleInactiveTextColor,
2097
- } }, { children: jsx(ToggleText, { children: formatMessage({
2098
- id: 'Billed annually',
2099
- defaultMessage: 'Billed annually',
2100
- }) }) }))] })));
2101
- }
2102
-
2103
- const CalloutContainer = styled(Box)(({ theme }) => {
2104
- var _a, _b, _c, _d;
2105
- return ({
2106
- display: 'flex',
2107
- flexDirection: 'column',
2108
- gap: '8px',
2109
- padding: '12px',
2110
- backgroundColor: ((_b = (_a = theme === null || theme === void 0 ? void 0 : theme.palette) === null || _a === void 0 ? void 0 : _a.ui) === null || _b === void 0 ? void 0 : _b.calloutBackground) || '#f9f9f9',
2111
- border: `1px solid ${((_d = (_c = theme === null || theme === void 0 ? void 0 : theme.palette) === null || _c === void 0 ? void 0 : _c.ui) === null || _d === void 0 ? void 0 : _d.calloutBorder) || '#ffffff'}`,
2112
- borderRadius: '8px',
2113
- width: '100%',
2114
- });
2115
- });
2116
- const CalloutHeader = styled(Box)(({ theme }) => ({
2117
- display: 'flex',
2118
- gap: '4px',
2119
- alignItems: 'center',
2120
- }));
2121
- const CalloutIcon = styled(InfoIcon)(({ theme }) => {
2122
- var _a, _b;
2123
- return ({
2124
- width: '20px',
2125
- height: '20px',
2126
- color: ((_b = (_a = theme === null || theme === void 0 ? void 0 : theme.palette) === null || _a === void 0 ? void 0 : _a.natural) === null || _b === void 0 ? void 0 : _b.dim) || '#13131b',
2127
- });
2128
- });
2129
- const CalloutTitle = styled(Typography)(({ theme }) => {
2130
- var _a, _b, _c, _d, _e, _f, _g, _h;
2131
- return ({
2132
- fontFamily: ((_a = theme === null || theme === void 0 ? void 0 : theme.typography) === null || _a === void 0 ? void 0 : _a.fontFamily) ||
2133
- "'Montserrat', sans-serif",
2134
- fontSize: ((_c = (_b = theme === null || theme === void 0 ? void 0 : theme.typography) === null || _b === void 0 ? void 0 : _b.bodyMedium) === null || _c === void 0 ? void 0 : _c.fontSize) || '14px',
2135
- fontWeight: ((_d = theme === null || theme === void 0 ? void 0 : theme.typography) === null || _d === void 0 ? void 0 : _d.fontWeightSemiBold) || 600,
2136
- lineHeight: ((_f = (_e = theme === null || theme === void 0 ? void 0 : theme.typography) === null || _e === void 0 ? void 0 : _e.bodyMedium) === null || _f === void 0 ? void 0 : _f.lineHeight) || '20px',
2137
- color: ((_h = (_g = theme === null || theme === void 0 ? void 0 : theme.palette) === null || _g === void 0 ? void 0 : _g.natural) === null || _h === void 0 ? void 0 : _h.dim) || '#13131b',
2138
- });
2139
- });
2140
- const CalloutText = styled(Typography)(({ theme }) => {
2141
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
2142
- return ({
2143
- fontFamily: ((_a = theme === null || theme === void 0 ? void 0 : theme.typography) === null || _a === void 0 ? void 0 : _a.fontFamily) ||
2144
- "'Montserrat', sans-serif",
2145
- fontSize: ((_c = (_b = theme === null || theme === void 0 ? void 0 : theme.typography) === null || _b === void 0 ? void 0 : _b.bodySmall) === null || _c === void 0 ? void 0 : _c.fontSize) || '12px',
2146
- fontWeight: ((_e = (_d = theme === null || theme === void 0 ? void 0 : theme.typography) === null || _d === void 0 ? void 0 : _d.bodySmall) === null || _e === void 0 ? void 0 : _e.fontWeight) || 400,
2147
- lineHeight: ((_g = (_f = theme === null || theme === void 0 ? void 0 : theme.typography) === null || _f === void 0 ? void 0 : _f.bodySmall) === null || _g === void 0 ? void 0 : _g.lineHeight) || '16px',
2148
- color: ((_j = (_h = theme === null || theme === void 0 ? void 0 : theme.palette) === null || _h === void 0 ? void 0 : _h.natural) === null || _j === void 0 ? void 0 : _j.dark) || '#5f5e62',
2149
- });
2150
- });
2151
-
2152
- /**
2153
- * InfoCallout - Displays helpful information or tips
2154
- *
2155
- * @example
2156
- * ```tsx
2157
- * <InfoCallout title="Helpful tip">
2158
- * Many Malaysians aim for life protection that's at least 10–12 times their annual income
2159
- * </InfoCallout>
2160
- * ```
2161
- */
2162
- function InfoCallout({ title = 'Helpful tip', children, formatMessage = (descriptor) => descriptor.defaultMessage || descriptor.id, }) {
2163
- // Safely get theme, handle SSR case where it might be undefined
2164
- const tenantTheme = useTenantTheme();
2165
- const theme = tenantTheme === null || tenantTheme === void 0 ? void 0 : tenantTheme.theme;
2166
- // Get theme colors with SSR-safe fallbacks
2167
- const calloutBgColor = getThemeColor(theme, 'ui.calloutBackground', '#f9f9f9');
2168
- const calloutBorderColor = getThemeColor(theme, 'ui.calloutBorder', '#ffffff');
2169
- const textColor = getThemeColor(theme, 'natural.dim', '#13131b');
2170
- const subtitleColor = getThemeColor(theme, 'natural.dark', '#5f5e62');
2171
- return (jsxs(CalloutContainer, Object.assign({ sx: {
2172
- backgroundColor: calloutBgColor,
2173
- border: `1px solid ${calloutBorderColor}`,
2174
- } }, { children: [jsxs(CalloutHeader, { children: [jsx(CalloutIcon, { sx: { color: textColor } }), jsx(CalloutTitle, Object.assign({ sx: { color: textColor } }, { children: formatMessage({
2175
- id: title,
2176
- defaultMessage: title,
2177
- }) }))] }), jsx(CalloutText, Object.assign({ sx: { color: subtitleColor } }, { children: children }))] })));
2178
- }
2179
-
2180
- const SliderContainer = styled(Box)(({ theme }) => {
2181
- var _a, _b;
2182
- return ({
2183
- display: 'flex',
2184
- flexDirection: 'column',
2185
- gap: '16px',
2186
- padding: '12px',
2187
- backgroundColor: ((_b = (_a = theme === null || theme === void 0 ? void 0 : theme.palette) === null || _a === void 0 ? void 0 : _a.ui) === null || _b === void 0 ? void 0 : _b.sliderBackground) || '#f9f9f9',
2188
- borderRadius: '8px',
2189
- width: '100%',
2190
- });
2191
- });
2192
- const InputSection = styled(Box)(({ theme }) => ({
2193
- display: 'flex',
2194
- flexDirection: 'column',
2195
- gap: '8px',
2196
- width: '100%',
2197
- }));
2198
- const InputLabel = styled(Typography)(({ theme }) => {
2199
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
2200
- return ({
2201
- fontFamily: ((_a = theme === null || theme === void 0 ? void 0 : theme.typography) === null || _a === void 0 ? void 0 : _a.fontFamily) ||
2202
- "'Montserrat', sans-serif",
2203
- fontSize: ((_c = (_b = theme === null || theme === void 0 ? void 0 : theme.typography) === null || _b === void 0 ? void 0 : _b.bodySmall) === null || _c === void 0 ? void 0 : _c.fontSize) || '12px',
2204
- fontWeight: ((_e = (_d = theme === null || theme === void 0 ? void 0 : theme.typography) === null || _d === void 0 ? void 0 : _d.bodySmall) === null || _e === void 0 ? void 0 : _e.fontWeight) || 400,
2205
- lineHeight: ((_g = (_f = theme === null || theme === void 0 ? void 0 : theme.typography) === null || _f === void 0 ? void 0 : _f.bodySmall) === null || _g === void 0 ? void 0 : _g.lineHeight) || '16px',
2206
- color: ((_j = (_h = theme === null || theme === void 0 ? void 0 : theme.palette) === null || _h === void 0 ? void 0 : _h.natural) === null || _j === void 0 ? void 0 : _j.dim) || '#13131b',
2207
- });
2208
- });
2209
- const InputContainer = styled(Box)(({ theme }) => {
2210
- var _a, _b, _c, _d;
2211
- return ({
2212
- display: 'flex',
2213
- gap: '24px',
2214
- alignItems: 'center',
2215
- justifyContent: 'center',
2216
- padding: '8px 16px',
2217
- height: '44px',
2218
- backgroundColor: ((_b = (_a = theme === null || theme === void 0 ? void 0 : theme.palette) === null || _a === void 0 ? void 0 : _a.ui) === null || _b === void 0 ? void 0 : _b.inputBackground) || '#ffffff',
2219
- border: `1px solid ${((_d = (_c = theme === null || theme === void 0 ? void 0 : theme.palette) === null || _c === void 0 ? void 0 : _c.ui) === null || _d === void 0 ? void 0 : _d.inputBorder) || '#eeeeee'}`,
2220
- borderRadius: '8px',
2221
- width: '100%',
2222
- maxWidth: 'initial', // Match slider track width
2223
- });
2224
- });
2225
- const InputValue = styled(Typography)(({ theme }) => {
2226
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
2227
- return ({
2228
- fontFamily: ((_a = theme === null || theme === void 0 ? void 0 : theme.typography) === null || _a === void 0 ? void 0 : _a.fontFamily) ||
2229
- "'Montserrat', sans-serif",
2230
- fontSize: ((_c = (_b = theme === null || theme === void 0 ? void 0 : theme.typography) === null || _b === void 0 ? void 0 : _b.bodyMedium) === null || _c === void 0 ? void 0 : _c.fontSize) || '14px',
2231
- fontWeight: ((_e = (_d = theme === null || theme === void 0 ? void 0 : theme.typography) === null || _d === void 0 ? void 0 : _d.bodyMedium) === null || _e === void 0 ? void 0 : _e.fontWeight) || 400,
2232
- lineHeight: ((_g = (_f = theme === null || theme === void 0 ? void 0 : theme.typography) === null || _f === void 0 ? void 0 : _f.bodyMedium) === null || _g === void 0 ? void 0 : _g.lineHeight) || '18px',
2233
- color: ((_j = (_h = theme === null || theme === void 0 ? void 0 : theme.palette) === null || _h === void 0 ? void 0 : _h.natural) === null || _j === void 0 ? void 0 : _j.dim) || '#13131b',
2234
- textAlign: 'center',
2235
- flex: 1,
2236
- });
2237
- });
2238
- styled(Box)(({ theme }) => ({
2239
- display: 'flex',
2240
- alignItems: 'center',
2241
- position: 'relative',
2242
- width: '100%',
2243
- maxWidth: 'initial',
2244
- height: '4px',
2245
- }));
2246
- styled(Box)(({ theme, active }) => {
2247
- var _a, _b, _c, _d;
2248
- return ({
2249
- height: '4px',
2250
- backgroundColor: active
2251
- ? ((_b = (_a = theme === null || theme === void 0 ? void 0 : theme.palette) === null || _a === void 0 ? void 0 : _a.ui) === null || _b === void 0 ? void 0 : _b.sliderActive) || '#317abc'
2252
- : ((_d = (_c = theme === null || theme === void 0 ? void 0 : theme.palette) === null || _c === void 0 ? void 0 : _c.ui) === null || _d === void 0 ? void 0 : _d.sliderInactive) || '#c8c5ca',
2253
- borderRadius: '8px',
2254
- width: '22px',
2255
- marginRight: '-1px',
2256
- });
2257
- });
2258
- styled(Box)(({ theme, active }) => {
2259
- var _a, _b, _c, _d;
2260
- return ({
2261
- width: '10px',
2262
- height: '10px',
2263
- borderRadius: '8px',
2264
- backgroundColor: active
2265
- ? ((_b = (_a = theme === null || theme === void 0 ? void 0 : theme.palette) === null || _a === void 0 ? void 0 : _a.ui) === null || _b === void 0 ? void 0 : _b.sliderActive) || '#317abc'
2266
- : ((_d = (_c = theme === null || theme === void 0 ? void 0 : theme.palette) === null || _c === void 0 ? void 0 : _c.ui) === null || _d === void 0 ? void 0 : _d.sliderInactive) || '#c8c5ca',
2267
- boxShadow: active ? '0px 2px 20px 4px rgba(0, 0, 0, 0.14)' : 'none',
2268
- marginRight: '-1px',
2269
- cursor: 'pointer',
2270
- position: 'relative',
2271
- zIndex: 2,
2272
- '&:hover': {
2273
- transform: 'scale(1.2)',
2274
- transition: 'transform 0.2s ease',
2275
- },
2276
- });
2277
- });
2278
- styled(Box)(({ theme }) => ({
2279
- position: 'absolute',
2280
- width: '18px',
2281
- height: '18px',
2282
- borderRadius: '34px',
2283
- backgroundColor: '#ffffff',
2284
- boxShadow: '0px 2px 20px 4px rgba(0, 0, 0, 0.14)',
2285
- display: 'flex',
2286
- alignItems: 'center',
2287
- justifyContent: 'center',
2288
- top: '-21px',
2289
- left: '0px',
2290
- cursor: 'grab',
2291
- zIndex: 10,
2292
- '&:active': {
2293
- cursor: 'grabbing',
2294
- },
2295
- }));
2296
- styled(Box)(({ theme }) => {
2297
- var _a, _b;
2298
- return ({
2299
- width: '13px',
2300
- height: '10px',
2301
- display: 'flex',
2302
- alignItems: 'center',
2303
- justifyContent: 'center',
2304
- color: ((_b = (_a = theme === null || theme === void 0 ? void 0 : theme.palette) === null || _a === void 0 ? void 0 : _a.ui) === null || _b === void 0 ? void 0 : _b.sliderActive) || '#317abc',
2305
- });
2306
- });
2307
- styled(Box)(({ theme }) => ({
2308
- display: 'flex',
2309
- justifyContent: 'space-between',
2310
- width: '100%',
2311
- maxWidth: 'initial', // Match slider track width
2312
- }));
2313
- const RangeLabel = styled(Typography)(({ theme }) => {
2314
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
2315
- return ({
2316
- fontFamily: ((_a = theme === null || theme === void 0 ? void 0 : theme.typography) === null || _a === void 0 ? void 0 : _a.fontFamily) ||
2317
- "'Montserrat', sans-serif",
2318
- fontSize: ((_c = (_b = theme === null || theme === void 0 ? void 0 : theme.typography) === null || _b === void 0 ? void 0 : _b.smallText) === null || _c === void 0 ? void 0 : _c.fontSize) || '8px',
2319
- fontWeight: ((_e = (_d = theme === null || theme === void 0 ? void 0 : theme.typography) === null || _d === void 0 ? void 0 : _d.smallText) === null || _e === void 0 ? void 0 : _e.fontWeight) || 500,
2320
- lineHeight: ((_g = (_f = theme === null || theme === void 0 ? void 0 : theme.typography) === null || _f === void 0 ? void 0 : _f.smallText) === null || _g === void 0 ? void 0 : _g.lineHeight) || '16px',
2321
- color: ((_j = (_h = theme === null || theme === void 0 ? void 0 : theme.palette) === null || _h === void 0 ? void 0 : _h.natural) === null || _j === void 0 ? void 0 : _j.main) || '#929094',
2322
- });
2323
- });
2324
- const StyledMuiSlider = styled(Slider)(({ theme, sliderActiveColor, sliderInactiveColor }) => {
2325
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
2326
- return ({
2327
- width: '100%',
2328
- marginBottom: '0px !important',
2329
- padding: '7px 0px !important',
2330
- '& .MuiSlider-markLabel': {
2331
- display: 'none',
2332
- },
2333
- '& .MuiSlider-mark': {
2334
- width: 10,
2335
- height: 10,
2336
- borderRadius: '50%',
2337
- backgroundColor: sliderInactiveColor || ((_b = (_a = theme === null || theme === void 0 ? void 0 : theme.palette) === null || _a === void 0 ? void 0 : _a.ui) === null || _b === void 0 ? void 0 : _b.sliderInactive) || '#c8c5ca',
2338
- },
2339
- '& .MuiSlider-track': {
2340
- height: 4,
2341
- backgroundColor: sliderActiveColor || ((_d = (_c = theme === null || theme === void 0 ? void 0 : theme.palette) === null || _c === void 0 ? void 0 : _c.ui) === null || _d === void 0 ? void 0 : _d.sliderActive) || '#317abc',
2342
- },
2343
- '& .MuiSlider-rail': {
2344
- height: 4,
2345
- backgroundColor: sliderInactiveColor || ((_f = (_e = theme === null || theme === void 0 ? void 0 : theme.palette) === null || _e === void 0 ? void 0 : _e.ui) === null || _f === void 0 ? void 0 : _f.sliderInactive) || '#c8c5ca',
2346
- },
2347
- '& .MuiSlider-markActive': {
2348
- backgroundColor: sliderActiveColor || ((_h = (_g = theme === null || theme === void 0 ? void 0 : theme.palette) === null || _g === void 0 ? void 0 : _g.ui) === null || _h === void 0 ? void 0 : _h.sliderActive) || '#317abc',
2349
- },
2350
- '& .MuiSlider-thumb': {
2351
- display: 'flex',
2352
- justifyContent: 'center',
2353
- alignItems: 'center',
2354
- height: 18,
2355
- width: 18,
2356
- backgroundColor: '#ffffff',
2357
- border: 'none',
2358
- cursor: 'pointer',
2359
- borderRadius: '50%',
2360
- boxShadow: '0px 2px 20px 4px rgba(0, 0, 0, 0.14)',
2361
- color: `${sliderActiveColor || ((_k = (_j = theme === null || theme === void 0 ? void 0 : theme.palette) === null || _j === void 0 ? void 0 : _j.ui) === null || _k === void 0 ? void 0 : _k.sliderActive) || '#317abc'} !important`,
2362
- transform: 'translate(-50%, -50%) !important',
2363
- '&::before': {
2364
- content: '""',
2365
- width: '13px',
2366
- height: '10px',
2367
- backgroundImage: `url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='${encodeURIComponent(sliderActiveColor || '#317abc')}'%3E%3Cpath d='M4 18h16v-2H4v2zm0-5h16v-2H4v2zm0-7v2h16V6H4z'/%3E%3C/svg%3E")`,
2368
- backgroundRepeat: 'no-repeat',
2369
- backgroundPosition: 'center',
2370
- backgroundSize: 'contain',
2371
- },
2372
- '&:hover': {
2373
- boxShadow: '0px 2px 20px 4px rgba(0, 0, 0, 0.2)',
2374
- },
2375
- '&.Mui-focusVisible': {
2376
- boxShadow: '0px 2px 20px 4px rgba(0, 0, 0, 0.2)',
2377
- },
2378
- '&.Mui-active': {
2379
- boxShadow: '0px 2px 20px 4px rgba(0, 0, 0, 0.2)',
2380
- },
2381
- },
2382
- });
2383
- });
2384
- const SliderLabelsContainer = styled(Box)(({ theme }) => ({
2385
- display: 'flex',
2386
- justifyContent: 'space-between',
2387
- width: '100%',
2388
- marginTop: '6px',
2389
- }));
2390
-
2391
- /**
2392
- * CoverageAmountSlider - Interactive slider for selecting coverage amounts
2393
- *
2394
- * @example
2395
- * ```tsx
2396
- * <CoverageAmountSlider
2397
- * min={100000}
2398
- * max={550000}
2399
- * value={coverageAmount}
2400
- * onChange={setCoverageAmount}
2401
- * />
2402
- * ```
2403
- */
2404
- function CoverageAmountSlider({ min, max, value, onChange, label = 'Choose your coverage amount', steps = 5, currency = 'RM', formatCurrency: customFormatCurrency, disabled = false, }) {
2405
- // Safely get theme, handle SSR case where it might be undefined
2406
- const tenantTheme = useTenantTheme();
2407
- const theme = tenantTheme === null || tenantTheme === void 0 ? void 0 : tenantTheme.theme;
2408
- const [localValue, setLocalValue] = useState(value);
2409
- const [sliderIndex, setSliderIndex] = useState(0);
2410
- // Get theme colors with SSR-safe fallbacks
2411
- const sliderActiveColor = getThemeColor(theme, 'ui.sliderActive', '#317abc');
2412
- const sliderInactiveColor = getThemeColor(theme, 'ui.sliderInactive', '#c8c5ca');
2413
- const sliderBgColor = getThemeColor(theme, 'ui.sliderBackground', '#f9f9f9');
2414
- const inputBgColor = getThemeColor(theme, 'ui.inputBackground', '#ffffff');
2415
- const inputBorderColor = getThemeColor(theme, 'ui.inputBorder', '#eeeeee');
2416
- const textColor = getThemeColor(theme, 'natural.dim', '#13131b');
2417
- const labelColor = getThemeColor(theme, 'natural.main', '#929094');
2418
- // Generate slider marks/options based on min, max, and steps
2419
- const { sliderMarks, stepSize, maxSliderValue, defaultSliderValue } = useMemo(() => {
2420
- const stepAmount = (max - min) / (steps - 1);
2421
- const marks = [];
2422
- for (let i = 0; i < steps; i++) {
2423
- const coverageValue = min + stepAmount * i;
2424
- marks.push({
2425
- value: i * 10,
2426
- label: `${(coverageValue / 1000).toFixed(0)}k`,
2427
- coverageVal: coverageValue,
2428
- });
2429
- }
2430
- // Find the default slider position based on the initial value
2431
- const defaultIdx = marks.findIndex((m) => m.coverageVal >= value) || 0;
2432
- return {
2433
- sliderMarks: marks,
2434
- stepSize: 10,
2435
- maxSliderValue: (steps - 1) * 10,
2436
- defaultSliderValue: defaultIdx * 10,
2437
- };
2438
- }, [min, max, steps, value]);
2439
- useEffect(() => {
2440
- setLocalValue(value);
2441
- // Update slider index when value changes externally
2442
- const idx = sliderMarks.findIndex((m) => m.coverageVal >= value);
2443
- setSliderIndex(idx >= 0 ? idx * 10 : 0);
2444
- }, [value, sliderMarks]);
2445
- const defaultFormatCurrency = (amount) => {
2446
- return `${currency} ${amount.toLocaleString('en-US', {
2447
- minimumFractionDigits: 0,
2448
- maximumFractionDigits: 0,
2449
- })}`;
2450
- };
2451
- const formatCurrency = customFormatCurrency || defaultFormatCurrency;
2452
- const handleDecrease = () => {
2453
- if (disabled)
2454
- return;
2455
- const currentIdx = sliderMarks.findIndex((m) => m.coverageVal === localValue);
2456
- if (currentIdx > 0) {
2457
- const newValue = sliderMarks[currentIdx - 1].coverageVal;
2458
- setLocalValue(newValue);
2459
- setSliderIndex((currentIdx - 1) * 10);
2460
- onChange(newValue);
2461
- }
2462
- };
2463
- const handleIncrease = () => {
2464
- if (disabled)
2465
- return;
2466
- const currentIdx = sliderMarks.findIndex((m) => m.coverageVal === localValue);
2467
- if (currentIdx < sliderMarks.length - 1) {
2468
- const newValue = sliderMarks[currentIdx + 1].coverageVal;
2469
- setLocalValue(newValue);
2470
- setSliderIndex((currentIdx + 1) * 10);
2471
- onChange(newValue);
2472
- }
2473
- };
2474
- const handleSliderChange = (_event, newValue) => {
2475
- if (disabled)
2476
- return;
2477
- const sliderVal = newValue;
2478
- const currentMark = sliderMarks.find((opt) => opt.value === sliderVal);
2479
- if (currentMark) {
2480
- setSliderIndex(sliderVal);
2481
- setLocalValue(currentMark.coverageVal);
2482
- onChange(currentMark.coverageVal);
2483
- }
2484
- };
2485
- return (jsxs(SliderContainer, Object.assign({ sx: {
2486
- backgroundColor: sliderBgColor,
2487
- } }, { children: [jsxs(InputSection, { children: [jsx(InputLabel, Object.assign({ sx: { color: textColor } }, { children: label })), jsxs(InputContainer, Object.assign({ sx: {
2488
- backgroundColor: inputBgColor,
2489
- border: `1px solid ${inputBorderColor}`,
2490
- opacity: disabled ? 0.5 : 1,
2491
- } }, { children: [jsx(IconButton, Object.assign({ onClick: handleDecrease, disabled: disabled, sx: {
2492
- padding: 0,
2493
- width: '24px',
2494
- height: '24px',
2495
- color: textColor,
2496
- } }, { children: jsx(RemoveIcon, { sx: { fontSize: 24 } }) })), jsx(InputValue, Object.assign({ sx: { color: textColor } }, { children: formatCurrency(localValue) })), jsx(IconButton, Object.assign({ onClick: handleIncrease, disabled: disabled, sx: {
2497
- padding: 0,
2498
- width: '24px',
2499
- height: '24px',
2500
- color: textColor,
2501
- } }, { children: jsx(AddIcon, { sx: { fontSize: 24 } }) }))] }))] }), jsxs(Box, Object.assign({ sx: { display: 'flex', flexDirection: 'column', width: '100%' } }, { children: [jsx(StyledMuiSlider, { value: sliderIndex, defaultValue: defaultSliderValue, step: stepSize, min: 0, max: maxSliderValue, marks: sliderMarks, valueLabelDisplay: "off", onChange: handleSliderChange, disabled: disabled, sliderActiveColor: sliderActiveColor, sliderInactiveColor: sliderInactiveColor }), jsx(SliderLabelsContainer, { children: sliderMarks.map((mark, index) => (jsx(RangeLabel, Object.assign({ sx: {
2502
- color: sliderIndex === mark.value
2503
- ? sliderActiveColor
2504
- : labelColor,
2505
- textAlign: index === 0 ? 'left' : index === sliderMarks.length - 1 ? 'right' : 'center',
2506
- flex: index === 0 || index === sliderMarks.length - 1 ? 'none' : 1,
2507
- } }, { children: mark.label }), index))) })] }))] })));
2508
- }
2509
-
2510
- const ProgressBarContainer = styled(Box)({
2511
- display: 'flex',
2512
- alignItems: 'center',
2513
- gap: '8px',
2514
- padding: '16px',
2515
- });
2516
- const ProgressBar = styled(Box)({
2517
- display: 'flex',
2518
- alignItems: 'center',
2519
- flex: 1,
2520
- height: '4px',
2521
- backgroundColor: 'rgba(0, 0, 0, 0.1)',
2522
- borderRadius: '2px',
2523
- overflow: 'hidden',
2524
- });
2525
- const ProgressFill = styled(Box)(({ width, progressBarTheme }) => ({
2526
- height: '100%',
2527
- width: `${width}%`,
2528
- background: progressBarTheme || 'linear-gradient(90deg, #0090DA 0.06%, #A4CE4E 99.94%)',
2529
- transition: 'width 0.3s ease',
2530
- }));
2531
- const ProgressText = styled(Typography)({
2532
- fontFamily: 'Montserrat',
2533
- fontSize: '12px',
2534
- color: '#5F5E62',
2535
- fontWeight: 400,
2536
- lineHeight: '16px',
2537
- });
2538
-
2539
- const CheckoutProgress = ({ currentStep, totalSteps, onBack, showBackButton = true, progressBarTheme, sx, }) => {
2540
- const progressPercentage = ((currentStep + 1) / totalSteps) * 100;
2541
- return (jsxs(ProgressBarContainer, Object.assign({ sx: sx }, { children: [showBackButton && onBack && (jsx(IconButton, Object.assign({ onClick: onBack, sx: { p: 0, width: '24px', height: '24px' }, "aria-label": "Go back" }, { children: jsx(ArrowBackIcon, { sx: { fontSize: '20px', color: '#13131B' } }) }))), jsx(ProgressBar, { children: jsx(ProgressFill, { width: progressPercentage, progressBarTheme: progressBarTheme }) }), jsxs(ProgressText, { children: [currentStep + 1, "/", totalSteps] })] })));
2542
- };
2543
-
2544
- const ProductCardContainer = styled(Box)(({ theme, showIndicator }) => {
2545
- var _a, _b;
2546
- return (Object.assign({ backgroundColor: '#fff', boxShadow: '0px 2px 10px 0px rgba(0, 0, 0, 0.12)', borderRadius: '8px', padding: '12px 20px 12px 12px', display: 'flex', gap: '4px', alignItems: 'center', position: 'relative' }, (showIndicator && {
2547
- '&::before': {
2548
- content: '""',
2549
- position: 'absolute',
2550
- left: 0,
2551
- top: 0,
2552
- width: '8px',
2553
- height: '64px',
2554
- borderRadius: '0 0 8px 8px',
2555
- backgroundColor: ((_b = (_a = theme.palette) === null || _a === void 0 ? void 0 : _a.primary) === null || _b === void 0 ? void 0 : _b.main) || '#13131B',
2556
- },
2557
- })));
2558
- });
2559
- const LogoContainer = styled(Box)({
2560
- width: '45px',
2561
- height: '40px',
2562
- border: '1.25px solid rgba(0, 0, 0, 0.1)',
2563
- borderRadius: '10px',
2564
- display: 'flex',
2565
- alignItems: 'center',
2566
- justifyContent: 'center',
2567
- flexShrink: 0,
2568
- marginLeft: '8px',
2569
- });
2570
- const ProductInfo = styled(Box)({
2571
- flex: 1,
2572
- marginLeft: '4px',
2573
- });
2574
- const ProductName = styled(Typography)({
2575
- fontFamily: 'Montserrat',
2576
- fontSize: '14px',
2577
- fontWeight: 600,
2578
- color: '#13131B',
2579
- lineHeight: '20px',
2580
- });
2581
- const PlanName = styled(Typography)({
2582
- fontFamily: 'Montserrat',
2583
- fontSize: '12px',
2584
- fontWeight: 400,
2585
- color: '#13131B',
2586
- lineHeight: '16px',
2587
- });
2588
- const PriceContainer = styled(Box)({
2589
- display: 'flex',
2590
- alignItems: 'baseline',
2591
- gap: '2px',
2592
- });
2593
- const Price = styled(Typography)({
2594
- fontFamily: 'Montserrat',
2595
- fontSize: '14px',
2596
- fontWeight: 600,
2597
- color: '#13131B',
2598
- lineHeight: '20px',
2599
- });
2600
- const PricePeriod = styled(Typography)({
2601
- fontFamily: 'Montserrat',
2602
- fontSize: '12px',
2603
- fontWeight: 400,
2604
- color: '#13131B',
2605
- lineHeight: '16px',
2606
- });
2607
-
2608
- const ProductCard = ({ productName, planName, logoUrl, price, currency = 'RM', period = '/month', sx, showIndicator = true, }) => {
2609
- return (jsxs(ProductCardContainer, Object.assign({ sx: sx, showIndicator: showIndicator }, { children: [logoUrl && (jsx(LogoContainer, { children: jsx("img", { src: logoUrl, alt: productName, style: { maxWidth: '100%', maxHeight: '100%' } }) })), jsxs(ProductInfo, { children: [jsx(ProductName, { children: productName }), planName && jsx(PlanName, { children: planName })] }), jsxs(PriceContainer, { children: [jsxs(Price, { children: [currency, " ", price] }), jsx(PricePeriod, { children: period })] })] })));
2610
- };
2611
-
2612
- const HeaderContainer = styled(Box)(({ sticky }) => (Object.assign(Object.assign({}, (sticky && {
2613
- position: 'sticky',
2614
- top: 0,
2615
- zIndex: 1000,
2616
- })), { backgroundColor: '#fff', width: '100%' })));
2617
- const SectionHeader = styled(Box)({
2618
- padding: '0 16px 24px',
2619
- });
2620
- const SectionTitle = styled(Typography)({
2621
- fontFamily: 'Montserrat',
2622
- fontSize: '20px',
2623
- fontWeight: 700,
2624
- color: '#13131B',
2625
- lineHeight: '28px',
2626
- marginBottom: '8px',
2627
- });
2628
- const SectionDescription = styled(Typography)({
2629
- fontFamily: 'Montserrat',
2630
- fontSize: '14px',
2631
- fontWeight: 400,
2632
- color: '#5F5E62',
2633
- lineHeight: '18px',
2634
- });
2635
-
2636
- const CheckoutHeader = ({ progress, product, sectionTitle, sectionDescription, sticky = true, progressBarTheme, sx, }) => {
2637
- return (jsxs(HeaderContainer, Object.assign({ sticky: sticky, sx: sx }, { children: [jsx(CheckoutProgress, Object.assign({}, progress, { progressBarTheme: progressBarTheme })), product && (jsx(Box, Object.assign({ sx: { padding: '0 16px 24px' } }, { children: jsx(ProductCard, Object.assign({}, product)) }))), jsxs(SectionHeader, { children: [jsx(SectionTitle, { children: sectionTitle }), jsx(SectionDescription, { children: sectionDescription })] })] })));
2638
- };
2639
-
2640
- const ButtonContainer = styled(Box)(({ isFixed }) => ({
2641
- position: isFixed ? 'fixed' : 'relative',
2642
- bottom: 0,
2643
- left: 0,
2644
- right: 0,
2645
- backgroundColor: '#fff',
2646
- padding: '16px',
2647
- boxShadow: isFixed ? '0px 2px 10px 0px rgba(0, 0, 0, 0.12)' : 'none',
2648
- zIndex: 999,
2649
- }));
2650
- const StyledButton = styled('button')(({ theme, isDisabled }) => {
2651
- var _a, _b, _c, _d;
2652
- return ({
2653
- width: '100%',
2654
- height: '48px',
2655
- borderRadius: '8px',
2656
- border: 'none',
2657
- backgroundColor: isDisabled
2658
- ? '#E1E2EB'
2659
- : ((_b = (_a = theme === null || theme === void 0 ? void 0 : theme.palette) === null || _a === void 0 ? void 0 : _a.primary) === null || _b === void 0 ? void 0 : _b.main) || '#13131B',
2660
- color: isDisabled ? '#929094' : '#fff',
2661
- fontFamily: 'Montserrat',
2662
- fontSize: '14px',
2663
- fontWeight: 500,
2664
- lineHeight: '18px',
2665
- cursor: isDisabled ? 'not-allowed' : 'pointer',
2666
- transition: 'all 0.2s ease',
2667
- '&:hover': {
2668
- backgroundColor: isDisabled
2669
- ? '#E1E2EB'
2670
- : ((_d = (_c = theme === null || theme === void 0 ? void 0 : theme.palette) === null || _c === void 0 ? void 0 : _c.primary) === null || _d === void 0 ? void 0 : _d.dark) || '#2a2a33',
2671
- },
2672
- });
2673
- });
2674
-
2675
- const CheckoutFormButton = ({ text = 'Next', disabled = false, onClick, fixed = true, type = 'button', sx, loading = false, }) => {
2676
- return (jsx(ButtonContainer, Object.assign({ isFixed: fixed, sx: sx }, { children: jsx(StyledButton, Object.assign({ type: type, disabled: disabled || loading, isDisabled: disabled || loading, onClick: onClick }, { children: loading ? 'Processing...' : text })) })));
2677
- };
2678
-
2679
- const QuestionContainer = styled(Box)({
2680
- display: 'flex',
2681
- flexDirection: 'column',
2682
- gap: '8px',
2683
- marginBottom: '24px',
2684
- });
2685
- const QuestionText = styled(Typography)({
2686
- fontFamily: 'Montserrat',
2687
- fontSize: '14px',
2688
- fontWeight: 400,
2689
- color: '#13131B',
2690
- lineHeight: '20px',
2691
- });
2692
- const OptionsContainer = styled(Box)({
2693
- display: 'flex',
2694
- gap: '16px',
2695
- marginTop: '12px',
2696
- });
2697
- const OptionButton = styled(Box)(({ selected }) => ({
2698
- flex: 1,
2699
- height: '48px',
2700
- border: `1px solid ${selected ? '#13131B' : '#929094'}`,
2701
- borderRadius: '8px',
2702
- display: 'flex',
2703
- alignItems: 'center',
2704
- justifyContent: 'center',
2705
- cursor: 'pointer',
2706
- backgroundColor: selected ? '#F5F5F7' : '#fff',
2707
- transition: 'all 0.2s ease',
2708
- '&:hover': {
2709
- borderColor: '#13131B',
2710
- },
2711
- }));
2712
- const OptionText = styled(Typography)(({ selected }) => ({
2713
- fontFamily: 'Montserrat',
2714
- fontSize: '14px',
2715
- fontWeight: 600,
2716
- color: selected ? '#13131B' : '#5F5E62',
2717
- lineHeight: '20px',
2718
- }));
2719
-
2720
- const HealthQuestionGroup = ({ question, questionNumber, value, onChange, error, labels = { yes: 'Yes', no: 'No' }, sx, }) => {
2721
- return (jsxs(QuestionContainer, Object.assign({ sx: sx }, { children: [jsxs(QuestionText, { children: [questionNumber && `${questionNumber}. `, question] }), jsxs(OptionsContainer, { children: [jsx(OptionButton, Object.assign({ selected: value === 'yes', onClick: () => onChange('yes'), role: "button", "aria-pressed": value === 'yes' }, { children: jsx(OptionText, Object.assign({ selected: value === 'yes' }, { children: labels.yes || 'Yes' })) })), jsx(OptionButton, Object.assign({ selected: value === 'no', onClick: () => onChange('no'), role: "button", "aria-pressed": value === 'no' }, { children: jsx(OptionText, Object.assign({ selected: value === 'no' }, { children: labels.no || 'No' })) }))] }), error && (jsx(Typography, Object.assign({ sx: {
2722
- color: 'error.main',
2723
- fontSize: '12px',
2724
- mt: 0.5,
2725
- ml: 2,
2726
- } }, { children: error })))] })));
2727
- };
2728
-
2729
- const FormContainer$3 = styled(Box)({
2730
- padding: '0 16px 100px',
2731
- });
2732
- const CheckboxContainer$1 = styled(Box)({
2733
- marginTop: '12px',
2734
- '& .MuiFormControlLabel-root': {
2735
- alignItems: 'flex-start',
2736
- marginLeft: 0,
2737
- },
2738
- '& .MuiCheckbox-root': {
2739
- padding: '4px 8px 4px 0',
2740
- },
2741
- });
2742
- const CheckboxLabel$1 = styled(Typography)({
2743
- fontFamily: 'Montserrat',
2744
- fontSize: '14px',
2745
- fontWeight: 400,
2746
- color: '#5F5E62',
2747
- lineHeight: '18px',
2748
- });
2749
-
2750
- const PersonalInformationForm = ({ renderField, fields, consents, onSubmit, formRef, sx, }) => {
2751
- const defaultBankConfirmationLabel = 'I confirm this bank account is mine and consent to AmMetLife crediting payouts to it';
2752
- const defaultMarketingLabel = 'I/We consent to AmMetLife Insurance Berhad using my personal data for marketing and communication via digital platforms such as email, WhatsApp, and mobile';
2753
- return (jsx(FormContainer$3, Object.assign({ ref: formRef, component: "form", onSubmit: onSubmit, sx: sx }, { children: jsxs(Box, Object.assign({ sx: { display: 'flex', flexDirection: 'column', gap: '24px' } }, { children: [jsxs(Box, { children: [renderField(fields.full_name), fields.full_name.helperText && (jsx(Typography, Object.assign({ variant: "caption", sx: {
2754
- display: 'block',
2755
- mt: 0.5,
2756
- ml: 2,
2757
- color: '#5F5E62',
2758
- fontSize: '12px',
2759
- fontFamily: 'Montserrat',
2760
- } }, { children: fields.full_name.helperText })))] }), renderField(fields.nric), renderField(fields.date_of_birth), renderField(fields.gender), renderField(fields.salutation), renderField(fields.nationality), renderField(fields.occupation), renderField(fields.industry), renderField(fields.crediting_bank_name), renderField(fields.crediting_bank_account_number), jsxs(CheckboxContainer$1, { children: [jsx(FormControlLabel, { control: jsx(Checkbox, { checked: consents.bank_account_confirmation.checked, onChange: (e) => consents.bank_account_confirmation.onChange(e.target.checked), name: "bank_account_confirmation" }), label: jsx(CheckboxLabel$1, { children: consents.bank_account_confirmation.label ||
2761
- defaultBankConfirmationLabel }) }), consents.bank_account_confirmation.error && (jsx(Typography, Object.assign({ sx: {
2762
- color: 'error.main',
2763
- fontSize: '12px',
2764
- mt: 0.5,
2765
- ml: 4,
2766
- } }, { children: consents.bank_account_confirmation.error })))] }), jsx(CheckboxContainer$1, { children: jsx(FormControlLabel, { control: jsx(Checkbox, { checked: consents.marketing_consent.checked, onChange: (e) => consents.marketing_consent.onChange(e.target.checked), name: "marketing_consent" }), label: jsx(CheckboxLabel$1, { children: consents.marketing_consent.label || defaultMarketingLabel }) }) })] })) })));
2767
- };
2768
-
2769
- const FormContainer$2 = styled(Box)({
2770
- padding: '0 16px 100px',
2771
- });
2772
- const CheckboxContainer = styled(Box)({
2773
- marginTop: '12px',
2774
- '& .MuiFormControlLabel-root': {
2775
- alignItems: 'flex-start',
2776
- marginLeft: 0,
2777
- },
2778
- '& .MuiCheckbox-root': {
2779
- padding: '4px 8px 4px 0',
2780
- },
2781
- });
2782
- const CheckboxLabel = styled(Typography)({
2783
- fontFamily: 'Montserrat',
2784
- fontSize: '14px',
2785
- fontWeight: 400,
2786
- color: '#5F5E62',
2787
- lineHeight: '18px',
2788
- });
2789
-
2790
- const ContactDetailsForm = ({ renderField, fields, mailingAddressSame, onSubmit, formRef, sx, }) => {
2791
- const defaultMailingLabel = 'My mailing address is the same as residential';
2792
- return (jsx(FormContainer$2, Object.assign({ ref: formRef, component: "form", onSubmit: onSubmit, sx: sx }, { children: jsxs(Box, Object.assign({ sx: { display: 'flex', flexDirection: 'column', gap: '24px' } }, { children: [jsxs(Box, { children: [renderField(fields.phone_number), fields.phone_number.helperText && (jsx(Box, Object.assign({ component: "span", sx: {
2793
- display: 'block',
2794
- mt: 0.5,
2795
- ml: 2,
2796
- color: '#5F5E62',
2797
- fontSize: '12px',
2798
- fontFamily: 'Montserrat',
2799
- } }, { children: fields.phone_number.helperText })))] }), renderField(fields.email_address), renderField(fields.residential_address), renderField(fields.postal_code), renderField(fields.city), renderField(fields.state), mailingAddressSame && (jsx(CheckboxContainer, { children: jsx(FormControlLabel, { control: jsx(Checkbox, { checked: mailingAddressSame.checked, onChange: (e) => mailingAddressSame.onChange(e.target.checked), name: "mailing_same_as_residential" }), label: jsx(CheckboxLabel, { children: mailingAddressSame.label || defaultMailingLabel }) }) }))] })) })));
2800
- };
2801
-
2802
- const FormContainer$1 = styled(Box)({
2803
- padding: '0 16px 100px',
2804
- });
2805
-
2806
- const HealthInformationForm = ({ renderField, measurementFields, healthQuestions, onSubmit, formRef, sx, }) => {
2807
- return (jsx(FormContainer$1, Object.assign({ ref: formRef, component: "form", onSubmit: onSubmit, sx: sx }, { children: jsxs(Box, Object.assign({ sx: { display: 'flex', flexDirection: 'column', gap: '24px' } }, { children: [renderField(measurementFields.weight), renderField(measurementFields.height), healthQuestions.map((question, index) => (jsx(HealthQuestionGroup, { question: question.question, questionNumber: question.questionNumber, value: question.value, onChange: question.onChange, error: question.error, labels: question.labels }, question.name || index)))] })) })));
2808
- };
2809
-
2810
- const FormContainer = styled(Box)({
2811
- padding: '0 16px 100px',
2812
- });
2813
-
2814
- const ChildInformationForm = ({ renderField, fields, onSubmit, formRef, sx, }) => {
2815
- return (jsx(FormContainer, Object.assign({ ref: formRef, component: "form", onSubmit: onSubmit, sx: sx }, { children: jsxs(Box, Object.assign({ sx: { display: 'flex', flexDirection: 'column', gap: '24px' } }, { children: [jsxs(Box, { children: [renderField(fields.full_name), fields.full_name.helperText && (jsx(Box, Object.assign({ component: "span", sx: {
2816
- display: 'block',
2817
- mt: 0.5,
2818
- ml: 2,
2819
- color: '#5F5E62',
2820
- fontSize: '12px',
2821
- fontFamily: 'Montserrat',
2822
- } }, { children: fields.full_name.helperText })))] }), renderField(fields.nric), renderField(fields.date_of_birth), renderField(fields.gender), renderField(fields.nationality)] })) })));
2823
- };
2824
-
2825
- /**
2826
- * Asset Management Utilities
2827
- * Helper functions for managing tenant-specific assets
2828
- */
2829
- /**
2830
- * Hook to get tenant-specific asset URL
2831
- * @param assetPath - Relative path to asset within tenant folder
2832
- * @returns Full path to tenant-specific asset
2833
- *
2834
- * @example
2835
- * ```tsx
2836
- * const bannerImage = useTenantAsset('promotional-banner.jpg')
2837
- * <img src={bannerImage} alt="Promo" />
2838
- * ```
2839
- */
2840
- function useTenantAsset(assetPath) {
2841
- const tenantId = useTenantId();
2842
- // Return tenant-specific asset path that will be resolved at build time
2843
- return `/assets/tenants/${tenantId}/${assetPath}`;
2844
- }
2845
- /**
2846
- * Hook to get tenant logo URL
2847
- * @param variant - Logo variant ('default' | 'dark' | 'alt' | 'white')
2848
- * @returns Logo URL from theme configuration
2849
- *
2850
- * @example
2851
- * ```tsx
2852
- * const logo = useTenantLogo()
2853
- * const darkLogo = useTenantLogo('dark')
2854
- * <img src={logo} alt="Logo" />
2855
- * ```
2856
- */
2857
- function useTenantLogo(variant = 'default') {
2858
- const tenantTheme = useTenantTheme();
2859
- const theme = tenantTheme === null || tenantTheme === void 0 ? void 0 : tenantTheme.theme;
2860
- // Guard against undefined theme (SSR or initialization issues)
2861
- if (!theme || !theme.logo) {
2862
- console.warn('useTenantLogo: Theme or logo is undefined, returning empty string');
2863
- return '';
2864
- }
2865
- switch (variant) {
2866
- case 'dark':
2867
- return theme.logoDark || theme.logo;
2868
- case 'alt':
2869
- return theme.logoAlt || theme.logo;
2870
- case 'white':
2871
- return theme.logoWhite || theme.logo;
2872
- default:
2873
- return theme.logo;
2874
- }
2875
- }
2876
- /**
2877
- * Hook to get tenant favicon URL
2878
- * @returns Favicon URL from theme configuration
2879
- *
2880
- * @example
2881
- * ```tsx
2882
- * const favicon = useTenantFavicon()
2883
- * <link rel="icon" href={favicon} />
2884
- * ```
2885
- */
2886
- function useTenantFavicon() {
2887
- const tenantTheme = useTenantTheme();
2888
- const theme = tenantTheme === null || tenantTheme === void 0 ? void 0 : tenantTheme.theme;
2889
- // Guard against undefined theme
2890
- if (!theme || !theme.favicon) {
2891
- console.warn('useTenantFavicon: Theme or favicon is undefined');
2892
- return '';
2893
- }
2894
- return theme.favicon;
2895
- }
2896
- /**
2897
- * Get tenant asset path (non-hook version for use outside components)
2898
- * @param tenantId - Tenant identifier
2899
- * @param assetPath - Relative path to asset
2900
- * @returns Full asset path
2901
- */
2902
- function getTenantAssetPath(tenantId, assetPath) {
2903
- return `/assets/tenants/${tenantId}/${assetPath}`;
2904
- }
2905
- /**
2906
- * Get tenant logo path (non-hook version)
2907
- * @param tenantId - Tenant identifier
2908
- * @param variant - Logo variant
2909
- * @returns Logo path
2910
- */
2911
- function getTenantLogoPath(tenantId, variant = 'default') {
2912
- const variantSuffix = variant === 'default' ? '' : `-${variant}`;
2913
- return `/assets/tenants/${tenantId}/logo${variantSuffix}.svg`;
2914
- }
2915
-
2916
- /**
2917
- * Common UI Icons
2918
- * Path references to reusable icons
2919
- * Assets are copied to dist/assets folder during build
2920
- */
2921
- const ICON_PATHS = {
2922
- close: '/assets/icons/close.svg',
2923
- arrow: '/assets/icons/arrow.svg',
2924
- arrowDown: '/assets/icons/arrow-down.svg',
2925
- alert: '/assets/icons/alert.svg',
2926
- facebook: '/assets/icons/facebook.svg',
2927
- instagram: '/assets/icons/instagram.svg',
2928
- youtube: '/assets/icons/youtube.svg',
2929
- };
2930
- /**
2931
- * Get icon path by name
2932
- * @param iconName - Name of the icon
2933
- * @returns Path to icon asset
2934
- */
2935
- function getIconPath(iconName) {
2936
- return ICON_PATHS[iconName];
2937
- }
2938
-
2939
- export { Banner, BillingToggle, Button, Card, CheckoutFormButton, CheckoutHeader, CheckoutProgress, ChildInformationForm, ContactDetailsForm, CoverageAmountSlider, Footer, Header$1 as Header, HealthInformationForm, HealthQuestionGroup, ICON_PATHS, InfoCallout, NewHeader, OptionButton$1 as OptionButton, PersonalInformationForm, ProductCard, ProductSelectionDrawer, QuestionSection, RecommendationsDrawer, TenantThemeProvider, ToggleGroup, ammetlifeTheme, ammetlifeTypography, cimbTheme, cimbTypography, createThemeCSSVariables, getAvailableTenants, getIconPath, getTenantAssetPath, getTenantLogoPath, getTenantTheme, getTenantTypography, getThemeColor, iglooTheme, iglooTypography, isValidTenantId, mergeTenantTheme, tenantThemes, tenantTypography, useIsTenant, useTenantAsset, useTenantFavicon, useTenantId, useTenantLogo, useTenantTheme };
479
+ export { Banner, Button, Card, TenantThemeProvider, ammetlifeTheme, cimbTheme, createThemeCSSVariables, getAvailableTenants, getTenantTheme, getThemeColor, iglooTheme, isValidTenantId, mergeTenantTheme, tenantThemes, useIsTenant, useTenantId, useTenantTheme };
2940
480
  //# sourceMappingURL=index.js.map