@wlloyalty/wll-react-sdk 1.0.42 → 1.0.44

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var React$1 = require('react');
3
+ var React = require('react');
4
4
  var Color = require('color');
5
5
  var LucideIcons = require('lucide-react');
6
6
 
@@ -21,7 +21,7 @@ function _interopNamespaceDefault(e) {
21
21
  return Object.freeze(n);
22
22
  }
23
23
 
24
- var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React$1);
24
+ var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
25
25
  var LucideIcons__namespace = /*#__PURE__*/_interopNamespaceDefault(LucideIcons);
26
26
 
27
27
  function _typeof$1(o) {
@@ -91,6 +91,125 @@ function _objectWithoutPropertiesLoose(r, e) {
91
91
  return t;
92
92
  }
93
93
 
94
+ /**
95
+ * Copyright (c) Nicolas Gallagher.
96
+ *
97
+ * This source code is licensed under the MIT license found in the
98
+ * LICENSE file in the root directory of this source tree.
99
+ *
100
+ *
101
+ */
102
+
103
+ var isDisabled = props => props.disabled || Array.isArray(props.accessibilityStates) && props.accessibilityStates.indexOf('disabled') > -1;
104
+ var isDisabled$1 = isDisabled;
105
+
106
+ /**
107
+ * Copyright (c) Nicolas Gallagher.
108
+ *
109
+ * This source code is licensed under the MIT license found in the
110
+ * LICENSE file in the root directory of this source tree.
111
+ *
112
+ *
113
+ */
114
+
115
+ var accessibilityRoleToWebRole = {
116
+ adjustable: 'slider',
117
+ button: 'button',
118
+ header: 'heading',
119
+ image: 'img',
120
+ imagebutton: null,
121
+ keyboardkey: null,
122
+ label: null,
123
+ link: 'link',
124
+ none: 'presentation',
125
+ search: 'search',
126
+ summary: 'region',
127
+ text: null
128
+ };
129
+ var propsToAriaRole = _ref => {
130
+ var accessibilityRole = _ref.accessibilityRole,
131
+ role = _ref.role;
132
+ var _role = role || accessibilityRole;
133
+ if (_role) {
134
+ var inferredRole = accessibilityRoleToWebRole[_role];
135
+ if (inferredRole !== null) {
136
+ // ignore roles that don't map to web
137
+ return inferredRole || _role;
138
+ }
139
+ }
140
+ };
141
+ var propsToAriaRole$1 = propsToAriaRole;
142
+
143
+ /**
144
+ * Copyright (c) Nicolas Gallagher.
145
+ *
146
+ * This source code is licensed under the MIT license found in the
147
+ * LICENSE file in the root directory of this source tree.
148
+ *
149
+ *
150
+ */
151
+
152
+ var roleComponents = {
153
+ article: 'article',
154
+ banner: 'header',
155
+ blockquote: 'blockquote',
156
+ button: 'button',
157
+ code: 'code',
158
+ complementary: 'aside',
159
+ contentinfo: 'footer',
160
+ deletion: 'del',
161
+ emphasis: 'em',
162
+ figure: 'figure',
163
+ insertion: 'ins',
164
+ form: 'form',
165
+ list: 'ul',
166
+ listitem: 'li',
167
+ main: 'main',
168
+ navigation: 'nav',
169
+ paragraph: 'p',
170
+ region: 'section',
171
+ strong: 'strong'
172
+ };
173
+ var emptyObject$9 = {};
174
+ var propsToAccessibilityComponent = function propsToAccessibilityComponent(props) {
175
+ if (props === void 0) {
176
+ props = emptyObject$9;
177
+ }
178
+ var roleProp = props.role || props.accessibilityRole;
179
+ // special-case for "label" role which doesn't map to an ARIA role
180
+ if (roleProp === 'label') {
181
+ return 'label';
182
+ }
183
+ var role = propsToAriaRole$1(props);
184
+ if (role) {
185
+ if (role === 'heading') {
186
+ var level = props.accessibilityLevel || props['aria-level'];
187
+ if (level != null) {
188
+ return "h" + level;
189
+ }
190
+ return 'h1';
191
+ }
192
+ return roleComponents[role];
193
+ }
194
+ };
195
+ var propsToAccessibilityComponent$1 = propsToAccessibilityComponent;
196
+
197
+ /**
198
+ * Copyright (c) Nicolas Gallagher.
199
+ *
200
+ * This source code is licensed under the MIT license found in the
201
+ * LICENSE file in the root directory of this source tree.
202
+ *
203
+ *
204
+ */
205
+
206
+ var AccessibilityUtil = {
207
+ isDisabled: isDisabled$1,
208
+ propsToAccessibilityComponent: propsToAccessibilityComponent$1,
209
+ propsToAriaRole: propsToAriaRole$1
210
+ };
211
+ var AccessibilityUtil$1 = AccessibilityUtil;
212
+
94
213
  /**
95
214
  * Copyright (c) Nicolas Gallagher.
96
215
  * Copyright (c) Meta Platforms, Inc. and affiliates.
@@ -785,7 +904,7 @@ var canUseDOM$1 = canUseDOM;
785
904
  * longfrom equivalents.
786
905
  */
787
906
 
788
- var emptyObject$9 = {};
907
+ var emptyObject$8 = {};
789
908
  var supportsCSS3TextDecoration = !canUseDOM$1 || window.CSS != null && window.CSS.supports != null && (window.CSS.supports('text-decoration-line', 'none') || window.CSS.supports('-webkit-text-decoration-line', 'none'));
790
909
  var MONOSPACE_FONT_STACK = 'monospace,monospace';
791
910
  var SYSTEM_FONT_STACK = '-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif';
@@ -844,7 +963,7 @@ var STYLE_SHORT_FORM_EXPANSIONS = {
844
963
 
845
964
  var createReactDOMStyle = (style, isInline) => {
846
965
  if (!style) {
847
- return emptyObject$9;
966
+ return emptyObject$8;
848
967
  }
849
968
  var resolvedStyle = {};
850
969
  var _loop = function _loop() {
@@ -1786,7 +1905,7 @@ var prefixStyles = prefixAll;
1786
1905
 
1787
1906
  var _excluded$f = ["animationKeyframes"];
1788
1907
  var cache$3 = new Map();
1789
- var emptyObject$8 = {};
1908
+ var emptyObject$7 = {};
1790
1909
  var classicGroup = 1;
1791
1910
  var atomicGroup = 3;
1792
1911
  var customGroup = {
@@ -2010,7 +2129,7 @@ function classic(style, name) {
2010
2129
  * No support for 'animationKeyframes', 'placeholderTextColor', 'scrollbarWidth', or 'pointerEvents'.
2011
2130
  */
2012
2131
  function inline(originalStyle, isRTL) {
2013
- var style = originalStyle || emptyObject$8;
2132
+ var style = originalStyle || emptyObject$7;
2014
2133
  var frozenProps = {};
2015
2134
  var nextStyle = {};
2016
2135
  var _loop = function _loop() {
@@ -2631,7 +2750,7 @@ function warnOnce(key, message) {
2631
2750
  *
2632
2751
  */
2633
2752
 
2634
- var emptyObject$7 = {};
2753
+ var emptyObject$6 = {};
2635
2754
 
2636
2755
  /**
2637
2756
  * Shadows
@@ -2726,7 +2845,7 @@ var preprocess = function preprocess(originalStyle, options) {
2726
2845
  if (options === void 0) {
2727
2846
  options = {};
2728
2847
  }
2729
- var style = originalStyle || emptyObject$7;
2848
+ var style = originalStyle || emptyObject$6;
2730
2849
  var nextStyle = {};
2731
2850
 
2732
2851
  // Convert shadow styles
@@ -3764,125 +3883,6 @@ if (canUseDOM$1 && window.__REACT_DEVTOOLS_GLOBAL_HOOK__) {
3764
3883
  var stylesheet = StyleSheet;
3765
3884
  var StyleSheet$1 = stylesheet;
3766
3885
 
3767
- /**
3768
- * Copyright (c) Nicolas Gallagher.
3769
- *
3770
- * This source code is licensed under the MIT license found in the
3771
- * LICENSE file in the root directory of this source tree.
3772
- *
3773
- *
3774
- */
3775
-
3776
- var isDisabled = props => props.disabled || Array.isArray(props.accessibilityStates) && props.accessibilityStates.indexOf('disabled') > -1;
3777
- var isDisabled$1 = isDisabled;
3778
-
3779
- /**
3780
- * Copyright (c) Nicolas Gallagher.
3781
- *
3782
- * This source code is licensed under the MIT license found in the
3783
- * LICENSE file in the root directory of this source tree.
3784
- *
3785
- *
3786
- */
3787
-
3788
- var accessibilityRoleToWebRole = {
3789
- adjustable: 'slider',
3790
- button: 'button',
3791
- header: 'heading',
3792
- image: 'img',
3793
- imagebutton: null,
3794
- keyboardkey: null,
3795
- label: null,
3796
- link: 'link',
3797
- none: 'presentation',
3798
- search: 'search',
3799
- summary: 'region',
3800
- text: null
3801
- };
3802
- var propsToAriaRole = _ref => {
3803
- var accessibilityRole = _ref.accessibilityRole,
3804
- role = _ref.role;
3805
- var _role = role || accessibilityRole;
3806
- if (_role) {
3807
- var inferredRole = accessibilityRoleToWebRole[_role];
3808
- if (inferredRole !== null) {
3809
- // ignore roles that don't map to web
3810
- return inferredRole || _role;
3811
- }
3812
- }
3813
- };
3814
- var propsToAriaRole$1 = propsToAriaRole;
3815
-
3816
- /**
3817
- * Copyright (c) Nicolas Gallagher.
3818
- *
3819
- * This source code is licensed under the MIT license found in the
3820
- * LICENSE file in the root directory of this source tree.
3821
- *
3822
- *
3823
- */
3824
-
3825
- var roleComponents = {
3826
- article: 'article',
3827
- banner: 'header',
3828
- blockquote: 'blockquote',
3829
- button: 'button',
3830
- code: 'code',
3831
- complementary: 'aside',
3832
- contentinfo: 'footer',
3833
- deletion: 'del',
3834
- emphasis: 'em',
3835
- figure: 'figure',
3836
- insertion: 'ins',
3837
- form: 'form',
3838
- list: 'ul',
3839
- listitem: 'li',
3840
- main: 'main',
3841
- navigation: 'nav',
3842
- paragraph: 'p',
3843
- region: 'section',
3844
- strong: 'strong'
3845
- };
3846
- var emptyObject$6 = {};
3847
- var propsToAccessibilityComponent = function propsToAccessibilityComponent(props) {
3848
- if (props === void 0) {
3849
- props = emptyObject$6;
3850
- }
3851
- var roleProp = props.role || props.accessibilityRole;
3852
- // special-case for "label" role which doesn't map to an ARIA role
3853
- if (roleProp === 'label') {
3854
- return 'label';
3855
- }
3856
- var role = propsToAriaRole$1(props);
3857
- if (role) {
3858
- if (role === 'heading') {
3859
- var level = props.accessibilityLevel || props['aria-level'];
3860
- if (level != null) {
3861
- return "h" + level;
3862
- }
3863
- return 'h1';
3864
- }
3865
- return roleComponents[role];
3866
- }
3867
- };
3868
- var propsToAccessibilityComponent$1 = propsToAccessibilityComponent;
3869
-
3870
- /**
3871
- * Copyright (c) Nicolas Gallagher.
3872
- *
3873
- * This source code is licensed under the MIT license found in the
3874
- * LICENSE file in the root directory of this source tree.
3875
- *
3876
- *
3877
- */
3878
-
3879
- var AccessibilityUtil = {
3880
- isDisabled: isDisabled$1,
3881
- propsToAccessibilityComponent: propsToAccessibilityComponent$1,
3882
- propsToAriaRole: propsToAriaRole$1
3883
- };
3884
- var AccessibilityUtil$1 = AccessibilityUtil;
3885
-
3886
3886
  var _excluded$d = ["aria-activedescendant", "accessibilityActiveDescendant", "aria-atomic", "accessibilityAtomic", "aria-autocomplete", "accessibilityAutoComplete", "aria-busy", "accessibilityBusy", "aria-checked", "accessibilityChecked", "aria-colcount", "accessibilityColumnCount", "aria-colindex", "accessibilityColumnIndex", "aria-colspan", "accessibilityColumnSpan", "aria-controls", "accessibilityControls", "aria-current", "accessibilityCurrent", "aria-describedby", "accessibilityDescribedBy", "aria-details", "accessibilityDetails", "aria-disabled", "accessibilityDisabled", "aria-errormessage", "accessibilityErrorMessage", "aria-expanded", "accessibilityExpanded", "aria-flowto", "accessibilityFlowTo", "aria-haspopup", "accessibilityHasPopup", "aria-hidden", "accessibilityHidden", "aria-invalid", "accessibilityInvalid", "aria-keyshortcuts", "accessibilityKeyShortcuts", "aria-label", "accessibilityLabel", "aria-labelledby", "accessibilityLabelledBy", "aria-level", "accessibilityLevel", "aria-live", "accessibilityLiveRegion", "aria-modal", "accessibilityModal", "aria-multiline", "accessibilityMultiline", "aria-multiselectable", "accessibilityMultiSelectable", "aria-orientation", "accessibilityOrientation", "aria-owns", "accessibilityOwns", "aria-placeholder", "accessibilityPlaceholder", "aria-posinset", "accessibilityPosInSet", "aria-pressed", "accessibilityPressed", "aria-readonly", "accessibilityReadOnly", "aria-required", "accessibilityRequired", "role", "accessibilityRole", "aria-roledescription", "accessibilityRoleDescription", "aria-rowcount", "accessibilityRowCount", "aria-rowindex", "accessibilityRowIndex", "aria-rowspan", "accessibilityRowSpan", "aria-selected", "accessibilitySelected", "aria-setsize", "accessibilitySetSize", "aria-sort", "accessibilitySort", "aria-valuemax", "accessibilityValueMax", "aria-valuemin", "accessibilityValueMin", "aria-valuenow", "accessibilityValueNow", "aria-valuetext", "accessibilityValueText", "dataSet", "focusable", "id", "nativeID", "pointerEvents", "style", "tabIndex", "testID"];
3887
3887
  var emptyObject$5 = {};
3888
3888
  var hasOwnProperty = Object.prototype.hasOwnProperty;
@@ -4527,7 +4527,7 @@ var defaultLocale = {
4527
4527
  direction: 'ltr',
4528
4528
  locale: 'en-US'
4529
4529
  };
4530
- var LocaleContext = /*#__PURE__*/React$1.createContext(defaultLocale);
4530
+ var LocaleContext = /*#__PURE__*/React.createContext(defaultLocale);
4531
4531
  function getLocaleDirection(locale) {
4532
4532
  return isLocaleRTL(locale) ? 'rtl' : 'ltr';
4533
4533
  }
@@ -4536,7 +4536,7 @@ function LocaleProvider(props) {
4536
4536
  locale = props.locale,
4537
4537
  children = props.children;
4538
4538
  var needsContext = direction || locale;
4539
- return needsContext ? /*#__PURE__*/React$1.createElement(LocaleContext.Provider, {
4539
+ return needsContext ? /*#__PURE__*/React.createElement(LocaleContext.Provider, {
4540
4540
  children: children,
4541
4541
  value: {
4542
4542
  direction: locale ? getLocaleDirection(locale) : direction,
@@ -4545,7 +4545,7 @@ function LocaleProvider(props) {
4545
4545
  }) : children;
4546
4546
  }
4547
4547
  function useLocaleContext() {
4548
- return React$1.useContext(LocaleContext);
4548
+ return React.useContext(LocaleContext);
4549
4549
  }
4550
4550
 
4551
4551
  /**
@@ -4565,10 +4565,10 @@ var createElement = (component, props, options) => {
4565
4565
  }
4566
4566
  var Component = accessibilityComponent || component;
4567
4567
  var domProps = createDOMProps$1(Component, props, options);
4568
- var element = /*#__PURE__*/React$1.createElement(Component, domProps);
4568
+ var element = /*#__PURE__*/React.createElement(Component, domProps);
4569
4569
 
4570
4570
  // Update locale context if element's writing direction prop changes
4571
- var elementWithLocaleProvider = domProps.dir ? /*#__PURE__*/React$1.createElement(LocaleProvider, {
4571
+ var elementWithLocaleProvider = domProps.dir ? /*#__PURE__*/React.createElement(LocaleProvider, {
4572
4572
  children: element,
4573
4573
  direction: domProps.dir,
4574
4574
  locale: domProps.lang
@@ -4775,7 +4775,7 @@ function pick(obj, list) {
4775
4775
  *
4776
4776
  */
4777
4777
 
4778
- var useLayoutEffectImpl = canUseDOM$1 ? React$1.useLayoutEffect : React$1.useEffect;
4778
+ var useLayoutEffectImpl = canUseDOM$1 ? React.useLayoutEffect : React.useEffect;
4779
4779
  var useLayoutEffect = useLayoutEffectImpl;
4780
4780
 
4781
4781
  /**
@@ -6312,7 +6312,7 @@ function useResponderEvents(hostRef, config) {
6312
6312
  *
6313
6313
  */
6314
6314
 
6315
- var TextAncestorContext = /*#__PURE__*/React$1.createContext(false);
6315
+ var TextAncestorContext = /*#__PURE__*/React.createContext(false);
6316
6316
  var TextAncestorContext$1 = TextAncestorContext;
6317
6317
 
6318
6318
  var _excluded$c = ["hrefAttrs", "numberOfLines", "onClick", "onLayout", "onPress", "onMoveShouldSetResponder", "onMoveShouldSetResponderCapture", "onResponderEnd", "onResponderGrant", "onResponderMove", "onResponderReject", "onResponderRelease", "onResponderStart", "onResponderTerminate", "onResponderTerminationRequest", "onScrollShouldSetResponder", "onScrollShouldSetResponderCapture", "onSelectionChangeShouldSetResponder", "onSelectionChangeShouldSetResponderCapture", "onStartShouldSetResponder", "onStartShouldSetResponderCapture", "selectable"];
@@ -6395,7 +6395,7 @@ var Text$2 = /*#__PURE__*/React__namespace.forwardRef((props, forwardedRef) => {
6395
6395
  }
6396
6396
  supportedProps.style = [numberOfLines != null && numberOfLines > 1 && {
6397
6397
  WebkitLineClamp: numberOfLines
6398
- }, hasTextAncestor === true ? styles$k.textHasAncestor$raw : styles$k.text$raw, numberOfLines === 1 && styles$k.textOneLine, numberOfLines != null && numberOfLines > 1 && styles$k.textMultiLine, props.style, selectable === true && styles$k.selectable, selectable === false && styles$k.notSelectable, onPress && styles$k.pressable];
6398
+ }, hasTextAncestor === true ? styles$j.textHasAncestor$raw : styles$j.text$raw, numberOfLines === 1 && styles$j.textOneLine, numberOfLines != null && numberOfLines > 1 && styles$j.textMultiLine, props.style, selectable === true && styles$j.selectable, selectable === false && styles$j.notSelectable, onPress && styles$j.pressable];
6399
6399
  if (props.href != null) {
6400
6400
  component = 'a';
6401
6401
  if (hrefAttrs != null) {
@@ -6440,7 +6440,7 @@ var textStyle = {
6440
6440
  whiteSpace: 'pre-wrap',
6441
6441
  wordWrap: 'break-word'
6442
6442
  };
6443
- var styles$k = StyleSheet$1.create({
6443
+ var styles$j = StyleSheet$1.create({
6444
6444
  text$raw: textStyle,
6445
6445
  textHasAncestor$raw: _objectSpread2(_objectSpread2({}, textStyle), {}, {
6446
6446
  color: 'inherit',
@@ -6988,25 +6988,25 @@ function getTouchFromResponderEvent(event) {
6988
6988
  */
6989
6989
 
6990
6990
  function usePressEvents(hostRef, config) {
6991
- var pressResponderRef = React$1.useRef(null);
6991
+ var pressResponderRef = React.useRef(null);
6992
6992
  if (pressResponderRef.current == null) {
6993
6993
  pressResponderRef.current = new PressResponder(config);
6994
6994
  }
6995
6995
  var pressResponder = pressResponderRef.current;
6996
6996
 
6997
6997
  // Re-configure to use the current node and configuration.
6998
- React$1.useEffect(() => {
6998
+ React.useEffect(() => {
6999
6999
  pressResponder.configure(config);
7000
7000
  }, [config, pressResponder]);
7001
7001
 
7002
7002
  // Reset the `pressResponder` when cleanup needs to occur. This is
7003
7003
  // a separate effect because we do not want to rest the responder when `config` changes.
7004
- React$1.useEffect(() => {
7004
+ React.useEffect(() => {
7005
7005
  return () => {
7006
7006
  pressResponder.reset();
7007
7007
  };
7008
7008
  }, [pressResponder]);
7009
- React$1.useDebugValue(config);
7009
+ React.useDebugValue(config);
7010
7010
  return pressResponder.getEventHandlers();
7011
7011
  }
7012
7012
 
@@ -7075,7 +7075,7 @@ var View$1 = /*#__PURE__*/React__namespace.forwardRef((props, forwardedRef) => {
7075
7075
  var writingDirection = componentDirection || contextDirection;
7076
7076
  var supportedProps = pickProps(rest);
7077
7077
  supportedProps.dir = componentDirection;
7078
- supportedProps.style = [styles$j.view$raw, hasTextAncestor && styles$j.inline, props.style];
7078
+ supportedProps.style = [styles$i.view$raw, hasTextAncestor && styles$i.inline, props.style];
7079
7079
  if (props.href != null) {
7080
7080
  component = 'a';
7081
7081
  if (hrefAttrs != null) {
@@ -7101,7 +7101,7 @@ var View$1 = /*#__PURE__*/React__namespace.forwardRef((props, forwardedRef) => {
7101
7101
  });
7102
7102
  });
7103
7103
  View$1.displayName = 'View';
7104
- var styles$j = StyleSheet$1.create({
7104
+ var styles$i = StyleSheet$1.create({
7105
7105
  view$raw: {
7106
7106
  alignItems: 'stretch',
7107
7107
  backgroundColor: 'transparent',
@@ -7156,25 +7156,25 @@ function TouchableOpacity(props, forwardedRef) {
7156
7156
  rejectResponderTermination = props.rejectResponderTermination,
7157
7157
  style = props.style,
7158
7158
  rest = _objectWithoutPropertiesLoose(props, _excluded$a);
7159
- var hostRef = React$1.useRef(null);
7159
+ var hostRef = React.useRef(null);
7160
7160
  var setRef = useMergeRefs$1(forwardedRef, hostRef);
7161
- var _useState = React$1.useState('0s'),
7161
+ var _useState = React.useState('0s'),
7162
7162
  duration = _useState[0],
7163
7163
  setDuration = _useState[1];
7164
- var _useState2 = React$1.useState(null),
7164
+ var _useState2 = React.useState(null),
7165
7165
  opacityOverride = _useState2[0],
7166
7166
  setOpacityOverride = _useState2[1];
7167
- var setOpacityTo = React$1.useCallback((value, duration) => {
7167
+ var setOpacityTo = React.useCallback((value, duration) => {
7168
7168
  setOpacityOverride(value);
7169
7169
  setDuration(duration ? duration / 1000 + "s" : '0s');
7170
7170
  }, [setOpacityOverride, setDuration]);
7171
- var setOpacityActive = React$1.useCallback(duration => {
7171
+ var setOpacityActive = React.useCallback(duration => {
7172
7172
  setOpacityTo(activeOpacity !== null && activeOpacity !== void 0 ? activeOpacity : 0.2, duration);
7173
7173
  }, [activeOpacity, setOpacityTo]);
7174
- var setOpacityInactive = React$1.useCallback(duration => {
7174
+ var setOpacityInactive = React.useCallback(duration => {
7175
7175
  setOpacityTo(null, duration);
7176
7176
  }, [setOpacityTo]);
7177
- var pressConfig = React$1.useMemo(() => ({
7177
+ var pressConfig = React.useMemo(() => ({
7178
7178
  cancelable: !rejectResponderTermination,
7179
7179
  disabled,
7180
7180
  delayLongPress,
@@ -7202,14 +7202,14 @@ function TouchableOpacity(props, forwardedRef) {
7202
7202
  focusable: !disabled && focusable !== false,
7203
7203
  pointerEvents: disabled ? 'box-none' : undefined,
7204
7204
  ref: setRef,
7205
- style: [styles$i.root, !disabled && styles$i.actionable, style, opacityOverride != null && {
7205
+ style: [styles$h.root, !disabled && styles$h.actionable, style, opacityOverride != null && {
7206
7206
  opacity: opacityOverride
7207
7207
  }, {
7208
7208
  transitionDuration: duration
7209
7209
  }]
7210
7210
  }));
7211
7211
  }
7212
- var styles$i = StyleSheet$1.create({
7212
+ var styles$h = StyleSheet$1.create({
7213
7213
  root: {
7214
7214
  transitionProperty: 'opacity',
7215
7215
  transitionDuration: '0.15s',
@@ -7339,7 +7339,7 @@ var parseNavigationLink = function (link) {
7339
7339
  };
7340
7340
 
7341
7341
  var useNavigation = function (config) {
7342
- var handleNavigation = React$1.useCallback(function (link, ctaTarget) {
7342
+ var handleNavigation = React.useCallback(function (link, ctaTarget) {
7343
7343
  var _a;
7344
7344
  var _b = parseNavigationLink(link),
7345
7345
  type = _b.type,
@@ -7357,7 +7357,7 @@ var useNavigation = function (config) {
7357
7357
 
7358
7358
  var baseUrl = 'https://api.staging.core.wlloyalty.net/v1';
7359
7359
  var useCreateRequestOptions = function (config) {
7360
- return React$1.useCallback(function (options) {
7360
+ return React.useCallback(function (options) {
7361
7361
  if (options === void 0) {
7362
7362
  options = {};
7363
7363
  }
@@ -7374,7 +7374,7 @@ var useCreateRequestOptions = function (config) {
7374
7374
  };
7375
7375
  var useMakeRequest = function (config) {
7376
7376
  var createRequestOptions = useCreateRequestOptions(config);
7377
- return React$1.useCallback(function (url) {
7377
+ return React.useCallback(function (url) {
7378
7378
  return __awaiter(void 0, void 0, void 0, function () {
7379
7379
  var response, json, error_1;
7380
7380
  return __generator(this, function (_a) {
@@ -7422,7 +7422,7 @@ var createResourceGetter = function (resource, includeHydrate) {
7422
7422
  }
7423
7423
  return function (config) {
7424
7424
  var makeRequest = useMakeRequest(config);
7425
- return React$1.useCallback(function (id) {
7425
+ return React.useCallback(function (id) {
7426
7426
  var params = new URLSearchParams();
7427
7427
  if (includeHydrate) {
7428
7428
  params.append('hydrate', 'true');
@@ -7476,51 +7476,6 @@ var defaultTheme = {
7476
7476
  negative: '#ff0000'
7477
7477
  };
7478
7478
 
7479
- var getDerivedColor = function (color) {
7480
- var backgroundColor = Color(color);
7481
- return backgroundColor.isDark() ? backgroundColor.lighten(0.2).string() : backgroundColor.darken(0.2).string();
7482
- };
7483
- // Same implimentation as Microsite
7484
- var getReadableTextColor = function (backgroundColor) {
7485
- var bgColor = Color(backgroundColor);
7486
- var white = Color('#fff');
7487
- var black = Color('#000');
7488
- // Calculate contrast ratio with white
7489
- var contrastWithWhite = bgColor.contrast(white);
7490
- // If contrast with white is at least 2:1, use white; otherwise, use black
7491
- return contrastWithWhite >= 2 ? white.hex() : black.hex();
7492
- };
7493
- var percentages = [5, 10, 20, 30, 40, 50, 60, 70, 80, 90, 95];
7494
- var generateDerivedColors = function (color, derivationFunction) {
7495
- var baseColor = Color(color);
7496
- var result = {};
7497
- percentages.forEach(function (percentage) {
7498
- var derivedColor = derivationFunction(baseColor, percentage);
7499
- result[percentage] = derivedColor.toString();
7500
- });
7501
- return result;
7502
- };
7503
- var getDerivedColorPercentages = function (color) {
7504
- var isDark = Color(color).isDark();
7505
- return generateDerivedColors(color, function (baseColor, percentage) {
7506
- return isDark ? baseColor.lightness(percentage) : baseColor.lightness(100 - percentage);
7507
- });
7508
- };
7509
- var getAlphaDerivedColors = function (color) {
7510
- return generateDerivedColors(color, function (baseColor, percentage) {
7511
- return baseColor.alpha(percentage / 100);
7512
- });
7513
- };
7514
- var shouldDesaturate = function (type, count) {
7515
- //TODO: Add conditions if neccecerry
7516
- return type === 'SPECIFIC' && count === 0;
7517
- };
7518
- var desaturateColor = function (color) {
7519
- return Color(color).desaturate(1).toString();
7520
- };
7521
- var getStateColor = function (baseColor, type, count) {
7522
- return shouldDesaturate(type, count) ? desaturateColor(baseColor) : baseColor;
7523
- };
7524
7479
  // Storybook Themes
7525
7480
  ({
7526
7481
  modern: __assign(__assign({}, defaultTheme), {
@@ -7561,6 +7516,52 @@ var getStateColor = function (baseColor, type, count) {
7561
7516
  })
7562
7517
  });
7563
7518
 
7519
+ var getDerivedColor = function (color) {
7520
+ var backgroundColor = Color(color);
7521
+ return backgroundColor.isDark() ? backgroundColor.lighten(0.2).string() : backgroundColor.darken(0.2).string();
7522
+ };
7523
+ // Same implementation as Microsite
7524
+ var getReadableTextColor = function (backgroundColor) {
7525
+ var bgColor = Color(backgroundColor);
7526
+ var white = Color('#fff');
7527
+ var black = Color('#000');
7528
+ // Calculate contrast ratio with white
7529
+ var contrastWithWhite = bgColor.contrast(white);
7530
+ // If contrast with white is at least 2:1, use white; otherwise, use black
7531
+ return contrastWithWhite >= 2 ? white.hex() : black.hex();
7532
+ };
7533
+ var percentages = [5, 10, 20, 30, 40, 50, 60, 70, 80, 90, 95];
7534
+ var generateDerivedColors = function (color, derivationFunction) {
7535
+ var baseColor = Color(color);
7536
+ var result = {};
7537
+ percentages.forEach(function (percentage) {
7538
+ var derivedColor = derivationFunction(baseColor, percentage);
7539
+ result[percentage] = derivedColor.toString();
7540
+ });
7541
+ return result;
7542
+ };
7543
+ var getDerivedColorPercentages = function (color) {
7544
+ var isDark = Color(color).isDark();
7545
+ return generateDerivedColors(color, function (baseColor, percentage) {
7546
+ return isDark ? baseColor.lightness(percentage) : baseColor.lightness(100 - percentage);
7547
+ });
7548
+ };
7549
+ var getAlphaDerivedColors = function (color) {
7550
+ return generateDerivedColors(color, function (baseColor, percentage) {
7551
+ return baseColor.alpha(percentage / 100);
7552
+ });
7553
+ };
7554
+ var shouldDesaturate = function (type, count) {
7555
+ //TODO: Add conditions if neccecerry
7556
+ return type === 'SPECIFIC' && count === 0;
7557
+ };
7558
+ var desaturateColor = function (color) {
7559
+ return Color(color).grayscale().lighten(2).toString();
7560
+ };
7561
+ var getStateColor = function (baseColor, type, count) {
7562
+ return shouldDesaturate(type, count) ? desaturateColor(baseColor) : baseColor;
7563
+ };
7564
+
7564
7565
  /**
7565
7566
  * Copyright (c) 2013-present, Facebook, Inc.
7566
7567
  *
@@ -7780,10 +7781,10 @@ function getDimensionMode(window) {
7780
7781
  }
7781
7782
  function useResponsive$1() {
7782
7783
  var deviceWindow = Dimensions.get('window');
7783
- var _a = React$1.useState(getDimensionMode(deviceWindow)),
7784
+ var _a = React.useState(getDimensionMode(deviceWindow)),
7784
7785
  dimensionMode = _a[0],
7785
7786
  setDimensionMode = _a[1];
7786
- React$1.useEffect(function () {
7787
+ React.useEffect(function () {
7787
7788
  if (!isWeb) return;
7788
7789
  var subscription = Dimensions.addEventListener('change', function (_a) {
7789
7790
  var window = _a.window;
@@ -7806,10 +7807,10 @@ function useResponsive$1() {
7806
7807
  };
7807
7808
  }
7808
7809
 
7809
- var ResponsiveContext = /*#__PURE__*/React$1.createContext(undefined);
7810
+ var ResponsiveContext = /*#__PURE__*/React.createContext(undefined);
7810
7811
  function ResponsiveProvider(_a) {
7811
7812
  var children = _a.children;
7812
- var _b = React$1.useState(function () {
7813
+ var _b = React.useState(function () {
7813
7814
  var window = Dimensions.get('window');
7814
7815
  var dimensionMode = getDimensionMode(window);
7815
7816
  return {
@@ -7821,7 +7822,7 @@ function ResponsiveProvider(_a) {
7821
7822
  }),
7822
7823
  state = _b[0],
7823
7824
  setState = _b[1];
7824
- React$1.useEffect(function () {
7825
+ React.useEffect(function () {
7825
7826
  var subscription = Dimensions.addEventListener('change', function (_a) {
7826
7827
  var window = _a.window;
7827
7828
  if (window) {
@@ -7840,12 +7841,12 @@ function ResponsiveProvider(_a) {
7840
7841
  }
7841
7842
  };
7842
7843
  }, []);
7843
- return /*#__PURE__*/React$1.createElement(ResponsiveContext.Provider, {
7844
+ return /*#__PURE__*/React.createElement(ResponsiveContext.Provider, {
7844
7845
  value: state
7845
7846
  }, children);
7846
7847
  }
7847
7848
  function useResponsive() {
7848
- var context = React$1.useContext(ResponsiveContext);
7849
+ var context = React.useContext(ResponsiveContext);
7849
7850
  if (context === undefined) {
7850
7851
  throw new Error('useResponsive must be used within a ResponsiveProvider');
7851
7852
  }
@@ -7878,22 +7879,22 @@ var createTheme = function (baseTheme) {
7878
7879
  alphaDerivedText: getAlphaDerivedColors(text)
7879
7880
  });
7880
7881
  };
7881
- var WllSdkContext = /*#__PURE__*/React$1.createContext(undefined);
7882
+ var WllSdkContext = /*#__PURE__*/React.createContext(undefined);
7882
7883
  var WllSdkProvider = function (_a) {
7883
7884
  var children = _a.children,
7884
7885
  providedTheme = _a.theme,
7885
7886
  config = _a.config,
7886
7887
  _b = _a.navigationConfig,
7887
7888
  navigationConfig = _b === void 0 ? {} : _b;
7888
- var _c = React$1.useState(function () {
7889
+ var _c = React.useState(function () {
7889
7890
  return createTheme(providedTheme || {});
7890
7891
  }),
7891
7892
  theme = _c[0],
7892
7893
  setThemeState = _c[1];
7893
- React$1.useEffect(function () {
7894
+ React.useEffect(function () {
7894
7895
  setThemeState(createTheme(providedTheme || {}));
7895
7896
  }, [providedTheme]);
7896
- var setTheme = React$1.useCallback(function (newTheme) {
7897
+ var setTheme = React.useCallback(function (newTheme) {
7897
7898
  setThemeState(function (prevTheme) {
7898
7899
  return createTheme(__assign(__assign({}, prevTheme), newTheme));
7899
7900
  });
@@ -7902,7 +7903,7 @@ var WllSdkProvider = function (_a) {
7902
7903
  var getSectionByID = useGetSectionByID(config);
7903
7904
  var getTileByID = useGetTileByID(config);
7904
7905
  var handleNavigation = useNavigation(navigationConfig);
7905
- var contextValue = React$1.useMemo(function () {
7906
+ var contextValue = React.useMemo(function () {
7906
7907
  return {
7907
7908
  theme: theme,
7908
7909
  setTheme: setTheme,
@@ -7912,18 +7913,25 @@ var WllSdkProvider = function (_a) {
7912
7913
  handleNavigation: handleNavigation
7913
7914
  };
7914
7915
  }, [theme, setTheme, getGroupByID, getSectionByID, getTileByID, handleNavigation]);
7915
- return /*#__PURE__*/React$1.createElement(WllSdkContext.Provider, {
7916
+ return /*#__PURE__*/React.createElement(WllSdkContext.Provider, {
7916
7917
  value: contextValue
7917
- }, /*#__PURE__*/React$1.createElement(ResponsiveProvider, null, children));
7918
+ }, /*#__PURE__*/React.createElement(ResponsiveProvider, null, children));
7918
7919
  };
7919
7920
  var useWllSdk = function () {
7920
- var context = React$1.useContext(WllSdkContext);
7921
+ var context = React.useContext(WllSdkContext);
7921
7922
  if (context === undefined) {
7922
7923
  throw new Error('useWllSdk must be used within a WllSdkProvider');
7923
7924
  }
7924
7925
  return context;
7925
7926
  };
7926
7927
 
7928
+ function createVariantSystem(baseStyle, variantStyles) {
7929
+ return function (theme, variant) {
7930
+ var styles = variantStyles(theme);
7931
+ return [baseStyle, styles[variant]];
7932
+ };
7933
+ }
7934
+
7927
7935
  var clamp$1 = function (value, min, max) {
7928
7936
  return Math.min(Math.max(value, min), max);
7929
7937
  };
@@ -7952,12 +7960,12 @@ var getResponsiveValue = function (desktopValue, mobileValue, isDesktop, isTable
7952
7960
  return mobileValue;
7953
7961
  };
7954
7962
  var useResponsiveValue = function (desktopValue, mobileValue, isDesktop, isTablet) {
7955
- var _a = React$1.useState(function () {
7963
+ var _a = React.useState(function () {
7956
7964
  return getResponsiveValue(desktopValue, mobileValue);
7957
7965
  }),
7958
7966
  value = _a[0],
7959
7967
  setValue = _a[1];
7960
- React$1.useEffect(function () {
7968
+ React.useEffect(function () {
7961
7969
  if (Platform$1.OS !== 'web') return;
7962
7970
  var handleResize = function () {
7963
7971
  setValue(getResponsiveValue(desktopValue, mobileValue));
@@ -7970,12 +7978,27 @@ var useResponsiveValue = function (desktopValue, mobileValue, isDesktop, isTable
7970
7978
  return value;
7971
7979
  };
7972
7980
 
7973
- function createVariantSystem(baseStyle, variantStyles) {
7974
- return function (theme, variant) {
7975
- var styles = variantStyles(theme);
7976
- return [baseStyle, styles[variant]];
7977
- };
7978
- }
7981
+ var useButtonDynamicStyles = function () {
7982
+ var _a = useResponsive$1(),
7983
+ isDesktop = _a.isDesktop,
7984
+ isTablet = _a.isTablet;
7985
+ var theme = useWllSdk().theme;
7986
+ return StyleSheet$1.create({
7987
+ button: {
7988
+ justifyContent: 'center',
7989
+ alignItems: 'center',
7990
+ paddingHorizontal: useResponsiveValue(theme.sizes.xxl, theme.sizes.sm, isDesktop, isTablet),
7991
+ paddingVertical: theme.sizes.sm,
7992
+ alignSelf: 'flex-start'
7993
+ },
7994
+ text: {
7995
+ textAlign: 'center',
7996
+ textTransform: 'uppercase',
7997
+ fontSize: useResponsiveValue(theme.sizes.xl, theme.sizes.sm, isDesktop, isTablet),
7998
+ fontWeight: '700'
7999
+ }
8000
+ });
8001
+ };
7979
8002
 
7980
8003
  var useButtonStyles = createVariantSystem({}, function (theme) {
7981
8004
  return {
@@ -8014,79 +8037,19 @@ var Button = function (_a) {
8014
8037
  onPress = _a.onPress,
8015
8038
  variant = _a.variant;
8016
8039
  var theme = useWllSdk().theme;
8017
- var _b = useResponsive$1(),
8018
- isDesktop = _b.isDesktop,
8019
- isTablet = _b.isTablet;
8020
8040
  var buttonStyle = useButtonStyles(theme, variant);
8021
8041
  var textStyle = useTextStyles(theme, variant);
8022
- var dynamicStyles = StyleSheet$1.create({
8023
- button: {
8024
- justifyContent: 'center',
8025
- alignItems: 'center',
8026
- paddingHorizontal: useResponsiveValue(theme.sizes.xxl, theme.sizes.sm, isDesktop, isTablet),
8027
- paddingVertical: theme.sizes.sm,
8028
- alignSelf: 'flex-start'
8029
- },
8030
- text: {
8031
- textAlign: 'center',
8032
- textTransform: 'uppercase',
8033
- fontSize: useResponsiveValue(theme.sizes.xl, theme.sizes.sm, isDesktop, isTablet),
8034
- fontWeight: '700'
8035
- }
8036
- });
8042
+ var styles = useButtonDynamicStyles();
8037
8043
  return /*#__PURE__*/React__namespace.createElement(TouchableOpacity$1, {
8038
- style: [dynamicStyles.button, buttonStyle, {
8044
+ style: [styles.button, buttonStyle, {
8039
8045
  borderRadius: theme.sizes.borderRadiusButton
8040
8046
  }],
8041
8047
  onPress: onPress
8042
8048
  }, /*#__PURE__*/React__namespace.createElement(Text$3, {
8043
- style: [dynamicStyles.text, textStyle]
8049
+ style: [styles.text, textStyle]
8044
8050
  }, title));
8045
8051
  };
8046
8052
 
8047
- var justifyMap$1 = {
8048
- start: 'flex-start',
8049
- end: 'flex-end',
8050
- center: 'center',
8051
- between: 'space-between',
8052
- around: 'space-around',
8053
- evenly: 'space-evenly'
8054
- };
8055
- var alignMap$1 = {
8056
- start: 'flex-start',
8057
- end: 'flex-end',
8058
- center: 'center',
8059
- stretch: 'stretch'
8060
- };
8061
- var Column$1 = function (_a) {
8062
- var children = _a.children,
8063
- _b = _a.justify,
8064
- justify = _b === void 0 ? 'start' : _b,
8065
- _c = _a.align,
8066
- align = _c === void 0 ? 'stretch' : _c,
8067
- _d = _a.direction,
8068
- direction = _d === void 0 ? 'column' : _d,
8069
- _e = _a.style,
8070
- style = _e === void 0 ? {} : _e;
8071
- var theme = useWllSdk().theme;
8072
- var _f = useResponsive$1(),
8073
- isDesktop = _f.isDesktop,
8074
- isTablet = _f.isTablet;
8075
- var dynamicStyles = StyleSheet$1.create({
8076
- column: {
8077
- flex: 1,
8078
- paddingHorizontal: useResponsiveValue(theme.sizes.sm, theme.sizes.xxs, isDesktop, isTablet),
8079
- paddingBottom: useResponsiveValue(theme.sizes.sm, theme.sizes.xxs, isDesktop, isTablet),
8080
- justifyContent: justifyMap$1[justify],
8081
- alignItems: alignMap$1[align],
8082
- flexDirection: direction
8083
- }
8084
- });
8085
- return /*#__PURE__*/React__namespace.createElement(View$2, {
8086
- style: [dynamicStyles.column, style]
8087
- }, children);
8088
- };
8089
-
8090
8053
  var Icon = function (_a) {
8091
8054
  var name = _a.name,
8092
8055
  _b = _a.color,
@@ -8145,17 +8108,17 @@ var ActivityIndicator = /*#__PURE__*/React__namespace.forwardRef((props, forward
8145
8108
  "aria-valuemin": 0,
8146
8109
  ref: forwardedRef,
8147
8110
  role: "progressbar",
8148
- style: [styles$h.container, style]
8111
+ style: [styles$g.container, style]
8149
8112
  }), /*#__PURE__*/React__namespace.createElement(View$2, {
8150
8113
  children: svg,
8151
8114
  style: [typeof size === 'number' ? {
8152
8115
  height: size,
8153
8116
  width: size
8154
- } : indicatorSizes[size], styles$h.animation, !animating && styles$h.animationPause, !animating && hidesWhenStopped && styles$h.hidesWhenStopped]
8117
+ } : indicatorSizes[size], styles$g.animation, !animating && styles$g.animationPause, !animating && hidesWhenStopped && styles$g.hidesWhenStopped]
8155
8118
  }));
8156
8119
  });
8157
8120
  ActivityIndicator.displayName = 'ActivityIndicator';
8158
- var styles$h = StyleSheet$1.create({
8121
+ var styles$g = StyleSheet$1.create({
8159
8122
  container: {
8160
8123
  alignItems: 'center',
8161
8124
  justifyContent: 'center'
@@ -8195,7 +8158,7 @@ var ActivityIndicator$1 = ActivityIndicator;
8195
8158
  var LoadingIndicator = function () {
8196
8159
  var theme = useWllSdk().theme;
8197
8160
  return /*#__PURE__*/React__namespace.createElement(View$2, {
8198
- style: [styles$g.container, {
8161
+ style: [styles$f.container, {
8199
8162
  borderRadius: theme.sizes.borderRadiusSm,
8200
8163
  padding: theme.sizes.md
8201
8164
  }]
@@ -8204,7 +8167,7 @@ var LoadingIndicator = function () {
8204
8167
  color: theme.primary
8205
8168
  }));
8206
8169
  };
8207
- var styles$g = StyleSheet$1.create({
8170
+ var styles$f = StyleSheet$1.create({
8208
8171
  container: {
8209
8172
  width: '100%',
8210
8173
  height: '100%',
@@ -8330,7 +8293,7 @@ function RefreshControl(props) {
8330
8293
  props.title;
8331
8294
  props.titleColor;
8332
8295
  var rest = _objectWithoutPropertiesLoose(props, _excluded$8);
8333
- return /*#__PURE__*/React$1.createElement(View$2, rest);
8296
+ return /*#__PURE__*/React.createElement(View$2, rest);
8334
8297
  }
8335
8298
 
8336
8299
  /**
@@ -8518,14 +8481,14 @@ var ScrollViewBase = /*#__PURE__*/React__namespace.forwardRef((props, forwardedR
8518
8481
  onTouchMove: createPreventableScrollHandler(onTouchMove),
8519
8482
  onWheel: createPreventableScrollHandler(onWheel),
8520
8483
  ref: useMergeRefs$1(scrollRef, forwardedRef),
8521
- style: [style, !scrollEnabled && styles$f.scrollDisabled, hideScrollbar && styles$f.hideScrollbar]
8484
+ style: [style, !scrollEnabled && styles$e.scrollDisabled, hideScrollbar && styles$e.hideScrollbar]
8522
8485
  }));
8523
8486
  });
8524
8487
 
8525
8488
  // Chrome doesn't support e.preventDefault in this case; touch-action must be
8526
8489
  // used to disable scrolling.
8527
8490
  // https://developers.google.com/web/updates/2017/01/scrolling-intervention
8528
- var styles$f = StyleSheet$1.create({
8491
+ var styles$e = StyleSheet$1.create({
8529
8492
  scrollDisabled: {
8530
8493
  overflowX: 'hidden',
8531
8494
  overflowY: 'hidden',
@@ -8633,7 +8596,7 @@ var warning$1 = /*@__PURE__*/getDefaultExportFromCjs(warning_1);
8633
8596
  var _excluded$6 = ["contentContainerStyle", "horizontal", "onContentSizeChange", "refreshControl", "stickyHeaderIndices", "pagingEnabled", "forwardedRef", "keyboardDismissMode", "onScroll", "centerContent"];
8634
8597
  var emptyObject$1 = {};
8635
8598
  var IS_ANIMATING_TOUCH_START_THRESHOLD_MS = 16;
8636
- let ScrollView$1 = class ScrollView extends React$1.Component {
8599
+ let ScrollView$1 = class ScrollView extends React.Component {
8637
8600
  constructor() {
8638
8601
  super(...arguments);
8639
8602
  this._scrollNodeRef = null;
@@ -9160,24 +9123,24 @@ let ScrollView$1 = class ScrollView extends React$1.Component {
9160
9123
  };
9161
9124
  }
9162
9125
  var hasStickyHeaderIndices = !horizontal && Array.isArray(stickyHeaderIndices);
9163
- var children = hasStickyHeaderIndices || pagingEnabled ? React$1.Children.map(this.props.children, (child, i) => {
9126
+ var children = hasStickyHeaderIndices || pagingEnabled ? React.Children.map(this.props.children, (child, i) => {
9164
9127
  var isSticky = hasStickyHeaderIndices && stickyHeaderIndices.indexOf(i) > -1;
9165
9128
  if (child != null && (isSticky || pagingEnabled)) {
9166
- return /*#__PURE__*/React$1.createElement(View$2, {
9167
- style: [isSticky && styles$e.stickyHeader, pagingEnabled && styles$e.pagingEnabledChild]
9129
+ return /*#__PURE__*/React.createElement(View$2, {
9130
+ style: [isSticky && styles$d.stickyHeader, pagingEnabled && styles$d.pagingEnabledChild]
9168
9131
  }, child);
9169
9132
  } else {
9170
9133
  return child;
9171
9134
  }
9172
9135
  }) : this.props.children;
9173
- var contentContainer = /*#__PURE__*/React$1.createElement(View$2, _extends$1({}, contentSizeChangeProps, {
9136
+ var contentContainer = /*#__PURE__*/React.createElement(View$2, _extends$1({}, contentSizeChangeProps, {
9174
9137
  children: children,
9175
9138
  collapsable: false,
9176
9139
  ref: this._setInnerViewRef,
9177
- style: [horizontal && styles$e.contentContainerHorizontal, centerContent && styles$e.contentContainerCenterContent, contentContainerStyle]
9140
+ style: [horizontal && styles$d.contentContainerHorizontal, centerContent && styles$d.contentContainerCenterContent, contentContainerStyle]
9178
9141
  }));
9179
- var baseStyle = horizontal ? styles$e.baseHorizontal : styles$e.baseVertical;
9180
- var pagingEnabledStyle = horizontal ? styles$e.pagingEnabledHorizontal : styles$e.pagingEnabledVertical;
9142
+ var baseStyle = horizontal ? styles$d.baseHorizontal : styles$d.baseVertical;
9143
+ var pagingEnabledStyle = horizontal ? styles$d.pagingEnabledHorizontal : styles$d.pagingEnabledVertical;
9181
9144
  var props = _objectSpread2(_objectSpread2({}, other), {}, {
9182
9145
  style: [baseStyle, pagingEnabled && pagingEnabledStyle, this.props.style],
9183
9146
  onTouchStart: this.scrollResponderHandleTouchStart,
@@ -9199,11 +9162,11 @@ let ScrollView$1 = class ScrollView extends React$1.Component {
9199
9162
  });
9200
9163
  var ScrollViewClass = ScrollViewBase$1;
9201
9164
  invariant$1(ScrollViewClass !== undefined, 'ScrollViewClass must not be undefined');
9202
- var scrollView = /*#__PURE__*/React$1.createElement(ScrollViewClass, _extends$1({}, props, {
9165
+ var scrollView = /*#__PURE__*/React.createElement(ScrollViewClass, _extends$1({}, props, {
9203
9166
  ref: this._setScrollNodeRef
9204
9167
  }), contentContainer);
9205
9168
  if (refreshControl) {
9206
- return /*#__PURE__*/React$1.cloneElement(refreshControl, {
9169
+ return /*#__PURE__*/React.cloneElement(refreshControl, {
9207
9170
  style: props.style
9208
9171
  }, scrollView);
9209
9172
  }
@@ -9220,7 +9183,7 @@ var commonStyle = {
9220
9183
  // iOS native scrolling
9221
9184
  WebkitOverflowScrolling: 'touch'
9222
9185
  };
9223
- var styles$e = StyleSheet$1.create({
9186
+ var styles$d = StyleSheet$1.create({
9224
9187
  baseVertical: _objectSpread2(_objectSpread2({}, commonStyle), {}, {
9225
9188
  flexDirection: 'column',
9226
9189
  overflowX: 'hidden',
@@ -9253,8 +9216,8 @@ var styles$e = StyleSheet$1.create({
9253
9216
  scrollSnapAlign: 'start'
9254
9217
  }
9255
9218
  });
9256
- var ForwardedScrollView = /*#__PURE__*/React$1.forwardRef((props, forwardedRef) => {
9257
- return /*#__PURE__*/React$1.createElement(ScrollView$1, _extends$1({}, props, {
9219
+ var ForwardedScrollView = /*#__PURE__*/React.forwardRef((props, forwardedRef) => {
9220
+ return /*#__PURE__*/React.createElement(ScrollView$1, _extends$1({}, props, {
9258
9221
  forwardedRef: forwardedRef
9259
9222
  }));
9260
9223
  });
@@ -10300,7 +10263,7 @@ function VirtualizedListContextProvider(_ref2) {
10300
10263
  var children = _ref2.children,
10301
10264
  value = _ref2.value;
10302
10265
  // Avoid setting a newly created context object if the values are identical.
10303
- var context = React$1.useMemo(() => ({
10266
+ var context = React.useMemo(() => ({
10304
10267
  cellKey: null,
10305
10268
  getScrollMetrics: value.getScrollMetrics,
10306
10269
  horizontal: value.horizontal,
@@ -10320,8 +10283,8 @@ function VirtualizedListCellContextProvider(_ref3) {
10320
10283
  var cellKey = _ref3.cellKey,
10321
10284
  children = _ref3.children;
10322
10285
  // Avoid setting a newly created context object if the values are identical.
10323
- var currContext = React$1.useContext(VirtualizedListContext);
10324
- var context = React$1.useMemo(() => currContext == null ? null : _objectSpread2(_objectSpread2({}, currContext), {}, {
10286
+ var currContext = React.useContext(VirtualizedListContext);
10287
+ var context = React.useMemo(() => currContext == null ? null : _objectSpread2(_objectSpread2({}, currContext), {}, {
10325
10288
  cellKey
10326
10289
  }), [currContext, cellKey]);
10327
10290
  return /*#__PURE__*/React__namespace.createElement(VirtualizedListContext.Provider, {
@@ -10433,7 +10396,7 @@ class CellRenderer extends React__namespace.Component {
10433
10396
  ItemSeparatorComponent :
10434
10397
  // $FlowFixMe[incompatible-type]
10435
10398
  ItemSeparatorComponent && /*#__PURE__*/React__namespace.createElement(ItemSeparatorComponent, this.state.separatorProps);
10436
- var cellStyle = inversionStyle ? horizontal ? [styles$d.rowReverse, inversionStyle] : [styles$d.columnReverse, inversionStyle] : horizontal ? [styles$d.row, inversionStyle] : inversionStyle;
10399
+ var cellStyle = inversionStyle ? horizontal ? [styles$c.rowReverse, inversionStyle] : [styles$c.columnReverse, inversionStyle] : horizontal ? [styles$c.row, inversionStyle] : inversionStyle;
10437
10400
  var result = !CellRendererComponent ? /*#__PURE__*/React__namespace.createElement(View$2, _extends$1({
10438
10401
  style: cellStyle,
10439
10402
  onFocusCapture: onCellFocusCapture
@@ -10453,7 +10416,7 @@ class CellRenderer extends React__namespace.Component {
10453
10416
  }, result);
10454
10417
  }
10455
10418
  }
10456
- var styles$d = StyleSheet$1.create({
10419
+ var styles$c = StyleSheet$1.create({
10457
10420
  row: {
10458
10421
  flexDirection: 'row'
10459
10422
  },
@@ -11633,7 +11596,7 @@ class VirtualizedList extends StateSafePureComponent {
11633
11596
  var _this$props6 = this.props,
11634
11597
  data = _this$props6.data,
11635
11598
  horizontal = _this$props6.horizontal;
11636
- var inversionStyle = this.props.inverted ? horizontalOrDefault(this.props.horizontal) ? styles$c.horizontallyInverted : styles$c.verticallyInverted : null;
11599
+ var inversionStyle = this.props.inverted ? horizontalOrDefault(this.props.horizontal) ? styles$b.horizontallyInverted : styles$b.verticallyInverted : null;
11637
11600
  var cells = [];
11638
11601
  var stickyIndicesFromProps = new Set(this.props.stickyHeaderIndices);
11639
11602
  var stickyHeaderIndices = [];
@@ -11797,7 +11760,7 @@ class VirtualizedList extends StateSafePureComponent {
11797
11760
  }*/
11798
11761
  if (this.props.debug) {
11799
11762
  return /*#__PURE__*/React__namespace.createElement(View$2, {
11800
- style: styles$c.debug
11763
+ style: styles$b.debug
11801
11764
  }, ret, this._renderDebugOverlay());
11802
11765
  } else {
11803
11766
  return ret;
@@ -11914,20 +11877,20 @@ class VirtualizedList extends StateSafePureComponent {
11914
11877
  var visTop = this._scrollMetrics.offset;
11915
11878
  var visLen = this._scrollMetrics.visibleLength;
11916
11879
  return /*#__PURE__*/React__namespace.createElement(View$2, {
11917
- style: [styles$c.debugOverlayBase, styles$c.debugOverlay]
11880
+ style: [styles$b.debugOverlayBase, styles$b.debugOverlay]
11918
11881
  }, framesInLayout.map((f, ii) => /*#__PURE__*/React__namespace.createElement(View$2, {
11919
11882
  key: 'f' + ii,
11920
- style: [styles$c.debugOverlayBase, styles$c.debugOverlayFrame, {
11883
+ style: [styles$b.debugOverlayBase, styles$b.debugOverlayFrame, {
11921
11884
  top: f.offset * normalize,
11922
11885
  height: f.length * normalize
11923
11886
  }]
11924
11887
  })), /*#__PURE__*/React__namespace.createElement(View$2, {
11925
- style: [styles$c.debugOverlayBase, styles$c.debugOverlayFrameLast, {
11888
+ style: [styles$b.debugOverlayBase, styles$b.debugOverlayFrameLast, {
11926
11889
  top: windowTop * normalize,
11927
11890
  height: windowLen * normalize
11928
11891
  }]
11929
11892
  }), /*#__PURE__*/React__namespace.createElement(View$2, {
11930
- style: [styles$c.debugOverlayBase, styles$c.debugOverlayFrameVis, {
11893
+ style: [styles$b.debugOverlayBase, styles$b.debugOverlayFrameVis, {
11931
11894
  top: visTop * normalize,
11932
11895
  height: visLen * normalize
11933
11896
  }]
@@ -12068,7 +12031,7 @@ class VirtualizedList extends StateSafePureComponent {
12068
12031
  }
12069
12032
  }
12070
12033
  VirtualizedList.contextType = VirtualizedListContext;
12071
- var styles$c = StyleSheet$1.create({
12034
+ var styles$b = StyleSheet$1.create({
12072
12035
  verticallyInverted: {
12073
12036
  transform: 'scaleY(-1)'
12074
12037
  },
@@ -12445,7 +12408,7 @@ let FlatList$1 = class FlatList extends React__namespace.PureComponent {
12445
12408
  _index = info.index;
12446
12409
  invariant$1(Array.isArray(_item2), 'Expected array of items with numColumns > 1');
12447
12410
  return /*#__PURE__*/React__namespace.createElement(View$2, {
12448
- style: [styles$b.row, columnWrapperStyle]
12411
+ style: [styles$a.row, columnWrapperStyle]
12449
12412
  }, _item2.map((it, kk) => {
12450
12413
  var element = render({
12451
12414
  // $FlowFixMe[incompatible-call]
@@ -12571,7 +12534,7 @@ let FlatList$1 = class FlatList extends React__namespace.PureComponent {
12571
12534
  );
12572
12535
  }
12573
12536
  };
12574
- var styles$b = StyleSheet$1.create({
12537
+ var styles$a = StyleSheet$1.create({
12575
12538
  row: {
12576
12539
  flexDirection: 'row'
12577
12540
  }
@@ -14366,8 +14329,8 @@ var AnimatedProps$1 = AnimatedProps;
14366
14329
  * WARNING: The `effect` callback should be stable (e.g. using `useCallback`).
14367
14330
  */
14368
14331
  function useRefEffect(effect) {
14369
- var cleanupRef = React$1.useRef(undefined);
14370
- return React$1.useCallback(instance => {
14332
+ var cleanupRef = React.useRef(undefined);
14333
+ return React.useCallback(instance => {
14371
14334
  if (cleanupRef.current) {
14372
14335
  cleanupRef.current();
14373
14336
  cleanupRef.current = undefined;
@@ -14389,15 +14352,15 @@ function useRefEffect(effect) {
14389
14352
  */
14390
14353
 
14391
14354
  function useAnimatedProps(props) {
14392
- var _useReducer = React$1.useReducer(count => count + 1, 0),
14355
+ var _useReducer = React.useReducer(count => count + 1, 0),
14393
14356
  scheduleUpdate = _useReducer[1];
14394
- var onUpdateRef = React$1.useRef(null);
14357
+ var onUpdateRef = React.useRef(null);
14395
14358
 
14396
14359
  // TODO: Only invalidate `node` if animated props or `style` change. In the
14397
14360
  // previous implementation, we permitted `style` to override props with the
14398
14361
  // same name property name as styles, so we can probably continue doing that.
14399
14362
  // The ordering of other props *should* not matter.
14400
- var node = React$1.useMemo(() => new AnimatedProps$1(props, () => onUpdateRef.current == null ? void 0 : onUpdateRef.current()), [props]);
14363
+ var node = React.useMemo(() => new AnimatedProps$1(props, () => onUpdateRef.current == null ? void 0 : onUpdateRef.current()), [props]);
14401
14364
  useAnimatedPropsLifecycle(node);
14402
14365
 
14403
14366
  // TODO: This "effect" does three things:
@@ -14413,7 +14376,7 @@ function useAnimatedProps(props) {
14413
14376
  //
14414
14377
  // But there is no way to transparently compose three separate callback refs,
14415
14378
  // so we just combine them all into one for now.
14416
- var refEffect = React$1.useCallback(instance => {
14379
+ var refEffect = React.useCallback(instance => {
14417
14380
  // NOTE: This may be called more often than necessary (e.g. when `props`
14418
14381
  // changes), but `setNativeView` already optimizes for that.
14419
14382
  node.setNativeView(instance);
@@ -14463,9 +14426,9 @@ function reduceAnimatedProps(node) {
14463
14426
  * unless we are unmounting.
14464
14427
  */
14465
14428
  function useAnimatedPropsLifecycle(node) {
14466
- var prevNodeRef = React$1.useRef(null);
14467
- var isUnmountingRef = React$1.useRef(false);
14468
- React$1.useEffect(() => {
14429
+ var prevNodeRef = React.useRef(null);
14430
+ var isUnmountingRef = React.useRef(false);
14431
+ React.useEffect(() => {
14469
14432
  // It is ok for multiple components to call `flushQueue` because it noops
14470
14433
  // if the queue is empty. When multiple animated components are mounted at
14471
14434
  // the same time. Only first component flushes the queue and the others will noop.
@@ -14525,7 +14488,7 @@ function useMergeRefs() {
14525
14488
  for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) {
14526
14489
  refs[_key] = arguments[_key];
14527
14490
  }
14528
- return React$1.useCallback(current => {
14491
+ return React.useCallback(current => {
14529
14492
  for (var _i = 0, _refs = refs; _i < _refs.length; _i++) {
14530
14493
  var ref = _refs[_i];
14531
14494
  if (ref != null) {
@@ -14958,7 +14921,7 @@ var Image$1 = /*#__PURE__*/React__namespace.forwardRef((props, ref) => {
14958
14921
  // Accessibility image allows users to trigger the browser's image context menu
14959
14922
  var hiddenImage = displayImageUri ? createElement$1('img', {
14960
14923
  alt: ariaLabel || '',
14961
- style: styles$a.accessibilityImage$raw,
14924
+ style: styles$9.accessibilityImage$raw,
14962
14925
  draggable: draggable || false,
14963
14926
  ref: hiddenImageRef,
14964
14927
  src: displayImageUri
@@ -15030,14 +14993,14 @@ var Image$1 = /*#__PURE__*/React__namespace.forwardRef((props, ref) => {
15030
14993
  onLayout: handleLayout,
15031
14994
  pointerEvents: pointerEvents,
15032
14995
  ref: ref,
15033
- style: [styles$a.root, hasTextAncestor && styles$a.inline, imageSizeStyle, style, styles$a.undo,
14996
+ style: [styles$9.root, hasTextAncestor && styles$9.inline, imageSizeStyle, style, styles$9.undo,
15034
14997
  // TEMP: avoid deprecated shadow props regression
15035
14998
  // until Image refactored to use createElement.
15036
14999
  {
15037
15000
  boxShadow: null
15038
15001
  }]
15039
15002
  }), /*#__PURE__*/React__namespace.createElement(View$2, {
15040
- style: [styles$a.image, resizeModeStyles[resizeMode], {
15003
+ style: [styles$9.image, resizeModeStyles[resizeMode], {
15041
15004
  backgroundImage,
15042
15005
  filter
15043
15006
  }, backgroundSize != null && {
@@ -15059,7 +15022,7 @@ ImageWithStatics.prefetch = function (uri) {
15059
15022
  ImageWithStatics.queryCache = function (uris) {
15060
15023
  return ImageLoader$1.queryCache(uris);
15061
15024
  };
15062
- var styles$a = StyleSheet$1.create({
15025
+ var styles$9 = StyleSheet$1.create({
15063
15026
  root: {
15064
15027
  flexBasis: 'auto',
15065
15028
  overflow: 'hidden',
@@ -18163,30 +18126,21 @@ function _extends() {
18163
18126
  }, _extends.apply(null, arguments);
18164
18127
  }
18165
18128
 
18166
- var styles$9 = StyleSheet$1.create({
18167
- imageOverlay: {
18168
- position: 'absolute',
18169
- left: 0,
18170
- right: 0,
18171
- bottom: 0,
18172
- top: 0
18173
- },
18174
- container: {
18175
- position: 'relative',
18176
- alignItems: 'center',
18177
- justifyContent: 'center',
18178
- backgroundColor: 'red',
18179
- width: '100%',
18180
- height: '100%'
18181
- }
18182
- });
18129
+ var IS_WEB = Platform$1.OS === "web";
18130
+ Platform$1.OS === "ios";
18131
+ Platform$1.OS === "android";
18132
+ var _a$1 = Dimensions.get("window"),
18133
+ width = _a$1.width;
18134
+ _a$1.height;
18135
+ var SCREEN_WIDTH = width;
18136
+
18183
18137
  var ProgressiveImage = function (_a) {
18184
18138
  var source = _a.source,
18185
18139
  style = _a.style,
18186
18140
  _b = _a.isDesaturated,
18187
18141
  isDesaturated = _b === void 0 ? false : _b,
18188
18142
  props = __rest(_a, ["source", "style", "isDesaturated"]);
18189
- var imageAnimated = React$1.useRef(new Animated$1.Value(0)).current;
18143
+ var imageAnimated = React.useRef(new Animated$1.Value(0)).current;
18190
18144
  var theme = useWllSdk().theme;
18191
18145
  var onImageLoad = function () {
18192
18146
  requestAnimationFrame(function () {
@@ -18200,28 +18154,49 @@ var ProgressiveImage = function (_a) {
18200
18154
  var baseColor = theme.alphaDerivedPrimary[20];
18201
18155
  var desaturatedColor = desaturateColor(baseColor);
18202
18156
  var backgroundColor = isDesaturated ? desaturatedColor : baseColor;
18203
- return /*#__PURE__*/React$1.createElement(View$2, {
18204
- style: [styles$9.container, style, {
18157
+ // Platform-specific logic for desaturation
18158
+ var desaturationStyle = IS_WEB ? {
18159
+ filter: isDesaturated ? 'grayscale(100%)' : undefined
18160
+ } : {
18161
+ tintColor: isDesaturated ? desaturatedColor : undefined
18162
+ };
18163
+ return /*#__PURE__*/React.createElement(View$2, {
18164
+ style: [styles$8.container, style, {
18205
18165
  backgroundColor: backgroundColor
18206
18166
  }]
18207
- }, /*#__PURE__*/React$1.createElement(Animated$1.View, {
18208
- style: [styles$9.imageOverlay, {
18167
+ }, /*#__PURE__*/React.createElement(Animated$1.View, {
18168
+ style: [styles$8.imageOverlay, {
18209
18169
  backgroundColor: backgroundColor,
18210
18170
  opacity: imageAnimated.interpolate({
18211
18171
  inputRange: [0, 1],
18212
18172
  outputRange: [1, 0]
18213
18173
  })
18214
18174
  }]
18215
- }), /*#__PURE__*/React$1.createElement(Animated$1.Image, _extends({}, props, {
18175
+ }), /*#__PURE__*/React.createElement(Animated$1.Image, _extends({}, props, {
18216
18176
  source: source,
18217
- style: [styles$9.imageOverlay, __assign({
18177
+ style: [styles$8.imageOverlay, __assign({
18218
18178
  opacity: imageAnimated
18219
- }, isDesaturated && {
18220
- filter: "saturate(".concat(0 * 100, "%)")
18221
- })],
18179
+ }, desaturationStyle)],
18222
18180
  onLoad: onImageLoad
18223
18181
  })));
18224
18182
  };
18183
+ var styles$8 = StyleSheet$1.create({
18184
+ imageOverlay: {
18185
+ position: 'absolute',
18186
+ left: 0,
18187
+ right: 0,
18188
+ bottom: 0,
18189
+ top: 0
18190
+ },
18191
+ container: {
18192
+ position: 'relative',
18193
+ alignItems: 'center',
18194
+ justifyContent: 'center',
18195
+ backgroundColor: 'red',
18196
+ width: '100%',
18197
+ height: '100%'
18198
+ }
18199
+ });
18225
18200
 
18226
18201
  var RowHeader = function (_a) {
18227
18202
  var children = _a.children,
@@ -18779,9 +18754,9 @@ function Pressable(props, forwardedRef) {
18779
18754
  var _useForceableState3 = useForceableState(testOnly_pressed === true),
18780
18755
  pressed = _useForceableState3[0],
18781
18756
  setPressed = _useForceableState3[1];
18782
- var hostRef = React$1.useRef(null);
18757
+ var hostRef = React.useRef(null);
18783
18758
  var setRef = useMergeRefs$1(forwardedRef, hostRef);
18784
- var pressConfig = React$1.useMemo(() => ({
18759
+ var pressConfig = React.useMemo(() => ({
18785
18760
  delayLongPress,
18786
18761
  delayPressStart: delayPressIn,
18787
18762
  delayPressEnd: delayPressOut,
@@ -18853,17 +18828,17 @@ function Pressable(props, forwardedRef) {
18853
18828
  onFocus: focusHandler,
18854
18829
  onKeyDown: keyDownHandler,
18855
18830
  ref: setRef,
18856
- style: [disabled ? styles$8.disabled : styles$8.active, typeof style === 'function' ? style(interactionState) : style],
18831
+ style: [disabled ? styles$7.disabled : styles$7.active, typeof style === 'function' ? style(interactionState) : style],
18857
18832
  tabIndex: _tabIndex
18858
18833
  }), typeof children === 'function' ? children(interactionState) : children);
18859
18834
  }
18860
18835
  function useForceableState(forced) {
18861
- var _useState = React$1.useState(false),
18836
+ var _useState = React.useState(false),
18862
18837
  bool = _useState[0],
18863
18838
  setBool = _useState[1];
18864
18839
  return [bool || forced, setBool];
18865
18840
  }
18866
- var styles$8 = StyleSheet$1.create({
18841
+ var styles$7 = StyleSheet$1.create({
18867
18842
  active: {
18868
18843
  cursor: 'pointer',
18869
18844
  touchAction: 'manipulation'
@@ -18872,7 +18847,7 @@ var styles$8 = StyleSheet$1.create({
18872
18847
  pointerEvents: 'box-none'
18873
18848
  }
18874
18849
  });
18875
- var MemoedPressable = /*#__PURE__*/React$1.memo( /*#__PURE__*/React$1.forwardRef(Pressable));
18850
+ var MemoedPressable = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(Pressable));
18876
18851
  MemoedPressable.displayName = 'Pressable';
18877
18852
  var Pressable$1 = MemoedPressable;
18878
18853
 
@@ -19014,7 +18989,7 @@ var TierTileConfig = /** @class */function () {
19014
18989
 
19015
18990
  var useHandleTilePress = function (tile, ctaLink, ctaLinkTarget) {
19016
18991
  var handleNavigation = useWllSdk().handleNavigation;
19017
- return React$1.useCallback(function () {
18992
+ return React.useCallback(function () {
19018
18993
  if ((tile === null || tile === void 0 ? void 0 : tile.type) === exports.TileType.Reward) {
19019
18994
  var config = tile.configuration;
19020
18995
  if (config === null || config === void 0 ? void 0 : config.rewardId) {
@@ -19036,9 +19011,9 @@ var useHandleTilePress = function (tile, ctaLink, ctaLinkTarget) {
19036
19011
  }, [tile, ctaLink, ctaLinkTarget, handleNavigation]);
19037
19012
  };
19038
19013
 
19039
- var BannerContext = /*#__PURE__*/React__namespace.createContext(null);
19014
+ var BannerContext = /*#__PURE__*/React.createContext(null);
19040
19015
  var useBannerContext = function () {
19041
- var context = React__namespace.useContext(BannerContext);
19016
+ var context = React.useContext(BannerContext);
19042
19017
  if (!context) {
19043
19018
  throw new Error('Tile components must be used within a BaseTile');
19044
19019
  }
@@ -19053,12 +19028,12 @@ var BaseBanner = function (_a) {
19053
19028
  ctaLinkTarget = _b.ctaLinkTarget,
19054
19029
  title = _b.title;
19055
19030
  var handlePress = useHandleTilePress(tile, ctaLink, ctaLinkTarget);
19056
- return /*#__PURE__*/React__namespace.createElement(BannerContext.Provider, {
19031
+ return /*#__PURE__*/React.createElement(BannerContext.Provider, {
19057
19032
  value: tile
19058
- }, /*#__PURE__*/React__namespace.createElement(Pressable$1, {
19033
+ }, /*#__PURE__*/React.createElement(Pressable$1, {
19059
19034
  style: function (_a) {
19060
19035
  var pressed = _a.pressed;
19061
- return [styles$7.container, {
19036
+ return [styles$6.container, {
19062
19037
  backgroundColor: theme.surface,
19063
19038
  borderRadius: theme.sizes.borderRadiusLg,
19064
19039
  opacity: pressed ? 0.7 : 1
@@ -19071,7 +19046,7 @@ var BaseBanner = function (_a) {
19071
19046
  accessibilityLabel: "".concat(title).concat(ctaLink ? ' - Click to open' : '')
19072
19047
  }, children));
19073
19048
  };
19074
- var styles$7 = StyleSheet$1.create({
19049
+ var styles$6 = StyleSheet$1.create({
19075
19050
  container: {
19076
19051
  width: '100%',
19077
19052
  maxWidth: MAX_WIDTH,
@@ -19083,7 +19058,7 @@ var styles$7 = StyleSheet$1.create({
19083
19058
  });
19084
19059
 
19085
19060
  var useTileSize = function (tile) {
19086
- return React$1.useMemo(function () {
19061
+ return React.useMemo(function () {
19087
19062
  return {
19088
19063
  isFullSize: tile.tileHeight === exports.TileHeight.Full,
19089
19064
  isHalfSize: tile.tileHeight === exports.TileHeight.Half
@@ -19091,63 +19066,83 @@ var useTileSize = function (tile) {
19091
19066
  }, [tile.tileHeight]);
19092
19067
  };
19093
19068
 
19094
- var TileContext = /*#__PURE__*/React$1.createContext(null);
19095
- var useTileContext = function () {
19096
- var context = React$1.useContext(TileContext);
19097
- if (!context) {
19098
- throw new Error('Tile components must be used within a BaseTile');
19099
- }
19100
- return context;
19101
- };
19102
- var BaseTileInner = function (_a) {
19103
- var tile = _a.tile,
19104
- children = _a.children;
19105
- return /*#__PURE__*/React$1.createElement(TileContext.Provider, {
19106
- value: tile
19107
- }, /*#__PURE__*/React$1.createElement(BaseTile.Root, null, children));
19108
- };
19109
- var BaseTileRoot = function (_a) {
19110
- var children = _a.children,
19111
- style = _a.style;
19069
+ var BaseTileBody = function (props) {
19112
19070
  var tile = useTileContext();
19113
- var theme = useWllSdk().theme;
19114
- var isHalfSize = useTileSize(tile).isHalfSize;
19071
+ var _a = useResponsive$1(),
19072
+ isDesktop = _a.isDesktop,
19073
+ isTablet = _a.isTablet;
19115
19074
  var _b = tile.configuration,
19116
- ctaLink = _b.ctaLink,
19117
- ctaLinkTarget = _b.ctaLinkTarget,
19118
- title = _b.title;
19119
- var handlePress = useHandleTilePress(tile, ctaLink, ctaLinkTarget);
19120
- var _c = useResponsive$1(),
19121
- isDesktop = _c.isDesktop,
19122
- isTablet = _c.isTablet;
19123
- var layout = {
19124
- flexDirection: 'column',
19125
- justifyContent: isHalfSize ? 'center' : 'flex-start',
19126
- alignItems: 'stretch'
19075
+ body = _b.body,
19076
+ artworkUrl = _b.artworkUrl;
19077
+ var isHalfSize = useTileSize(tile).isHalfSize;
19078
+ if (isHalfSize && artworkUrl || !body) return null;
19079
+ // Helper function to determine the number of lines
19080
+ var getNumberOfLines = function () {
19081
+ if (!isHalfSize && !artworkUrl) return undefined;
19082
+ return isDesktop ? 3 : isTablet ? 4 : 3;
19127
19083
  };
19128
- var dynamicStyles = StyleSheet$1.create({
19129
- container: {
19084
+ return /*#__PURE__*/React.createElement(Text, _extends({
19085
+ variant: "body"
19086
+ }, props, {
19087
+ accessibilityLabel: body,
19088
+ numberOfLines: getNumberOfLines()
19089
+ }), body);
19090
+ };
19091
+
19092
+ var baseStyles = StyleSheet$1.create({
19093
+ container: {
19094
+ width: '100%',
19095
+ height: '100%',
19096
+ overflow: 'hidden',
19097
+ position: 'relative'
19098
+ },
19099
+ content: {
19100
+ display: 'flex'
19101
+ },
19102
+ media: {
19103
+ width: '100%',
19104
+ objectFit: 'cover'
19105
+ }
19106
+ });
19107
+ // Dynamic styles hook
19108
+ var useBaseTileStyles = function () {
19109
+ var tile = useTileContext();
19110
+ var theme = useWllSdk().theme;
19111
+ var _a = useResponsive$1(),
19112
+ isDesktop = _a.isDesktop,
19113
+ isTablet = _a.isTablet;
19114
+ var isHalfSize = useTileSize(tile).isHalfSize;
19115
+ var _b = tile.configuration,
19116
+ artworkUrl = _b.artworkUrl,
19117
+ title = _b.title,
19118
+ body = _b.body;
19119
+ return StyleSheet$1.create({
19120
+ container: __assign(__assign({}, baseStyles.container), {
19121
+ backgroundColor: theme.surface,
19122
+ aspectRatio: isHalfSize ? 2 : 1,
19123
+ borderRadius: useResponsiveValue(theme.sizes.borderRadiusLg, theme.sizes.borderRadiusSm, isDesktop, isTablet),
19124
+ justifyContent: 'center',
19125
+ alignItems: 'center'
19126
+ }),
19127
+ content: __assign(__assign({}, baseStyles.content), {
19130
19128
  justifyContent: 'center',
19129
+ height: !artworkUrl ? '100%' : undefined
19130
+ }),
19131
+ header: {
19132
+ marginBottom: useResponsiveValue(theme.sizes.xxs, theme.sizes.xxxs, isDesktop, isTablet),
19133
+ marginTop: !isHalfSize && artworkUrl ? useResponsiveValue(theme.sizes.sm, theme.sizes.xxs, isDesktop, isTablet) : undefined,
19134
+ flexDirection: 'row',
19131
19135
  alignItems: 'center',
19132
- aspectRatio: isHalfSize ? 2 : 1,
19133
- borderRadius: useResponsiveValue(theme.sizes.borderRadiusLg, theme.sizes.borderRadiusSm, isDesktop, isTablet)
19134
- }
19135
- });
19136
- return /*#__PURE__*/React$1.createElement(Pressable$1, {
19137
- style: function (_a) {
19138
- var pressed = _a.pressed;
19139
- return [styles$6.container, {
19140
- backgroundColor: theme.surface,
19141
- opacity: pressed ? 0.7 : 1
19142
- }, dynamicStyles.container, layout, style];
19136
+ justifyContent: 'space-between',
19137
+ textAlign: isHalfSize ? 'center' : undefined
19143
19138
  },
19144
- onPress: handlePress,
19145
- disabled: tile.type !== 'REWARD' && tile.type !== 'REWARD_CATEGORY' && !ctaLink,
19146
- accessible: true,
19147
- accessibilityRole: "button",
19148
- accessibilityLabel: "".concat(title).concat(ctaLink ? ' - Click to open' : '')
19149
- }, children);
19139
+ media: __assign(__assign({}, baseStyles.media), {
19140
+ flexBasis: !isHalfSize && title && body ? '50%' : '100%',
19141
+ height: isHalfSize ? '100%' : undefined
19142
+ })
19143
+ });
19150
19144
  };
19145
+
19151
19146
  var BaseTileContent = function (_a) {
19152
19147
  var children = _a.children;
19153
19148
  var tile = useTileContext();
@@ -19155,34 +19150,23 @@ var BaseTileContent = function (_a) {
19155
19150
  var isHalfSize = useTileSize(tile).isHalfSize;
19156
19151
  // For half tiles with an image, don't show other content
19157
19152
  if (isHalfSize && artworkUrl) return null;
19158
- return /*#__PURE__*/React$1.createElement(View$2, {
19159
- style: [styles$6.content, {
19153
+ return /*#__PURE__*/React.createElement(View$2, {
19154
+ style: [baseStyles.content, {
19160
19155
  justifyContent: 'center',
19161
19156
  height: !artworkUrl ? '100%' : undefined
19162
19157
  }]
19163
19158
  }, children);
19164
19159
  };
19160
+
19165
19161
  var BaseTileHeader = function (_a) {
19166
19162
  var children = _a.children;
19167
19163
  var tile = useTileContext();
19168
- var theme = useWllSdk().theme;
19169
19164
  var artworkUrl = tile.configuration.artworkUrl;
19170
19165
  var isHalfSize = useTileSize(tile).isHalfSize;
19171
- var _b = useResponsive$1(),
19172
- isDesktop = _b.isDesktop,
19173
- isTablet = _b.isTablet;
19174
19166
  // For half tiles with an image, don't show header
19175
19167
  if (isHalfSize && artworkUrl) return null;
19176
- var dynamicStyles = StyleSheet$1.create({
19177
- header: {
19178
- marginBottom: useResponsiveValue(theme.sizes.xxs, theme.sizes.xxxs, isDesktop, isTablet),
19179
- marginTop: useResponsiveValue(theme.sizes.sm, theme.sizes.xxs, isDesktop, isTablet),
19180
- flexDirection: 'row',
19181
- alignItems: 'center',
19182
- justifyContent: 'space-between'
19183
- }
19184
- });
19185
- return /*#__PURE__*/React$1.createElement(View$2, {
19168
+ var dynamicStyles = useBaseTileStyles();
19169
+ return /*#__PURE__*/React.createElement(View$2, {
19186
19170
  style: [dynamicStyles.header, {
19187
19171
  marginTop: isHalfSize ? 0 : dynamicStyles.header.marginTop,
19188
19172
  // @ts-ignore
@@ -19192,26 +19176,24 @@ var BaseTileHeader = function (_a) {
19192
19176
  numberOfLines: 1
19193
19177
  }, children);
19194
19178
  };
19179
+
19195
19180
  var BaseTileMedia = function (props) {
19196
19181
  var tile = useTileContext();
19197
19182
  var _a = tile.configuration,
19198
- artworkUrl = _a.artworkUrl,
19199
- title = _a.title,
19200
- body = _a.body;
19201
- var isHalfSize = useTileSize(tile).isHalfSize;
19183
+ artworkUrl = _a.artworkUrl;
19184
+ _a.title;
19185
+ _a.body;
19186
+ useTileSize(tile).isHalfSize;
19187
+ var styles = useBaseTileStyles();
19202
19188
  if (!artworkUrl) return null;
19203
- var hasTitle = !!title;
19204
- var hasDescription = !!body;
19205
- return /*#__PURE__*/React$1.createElement(ProgressiveImage, _extends({}, props, {
19189
+ return /*#__PURE__*/React.createElement(ProgressiveImage, _extends({}, props, {
19206
19190
  source: {
19207
19191
  uri: artworkUrl
19208
19192
  },
19209
- style: [props.style, styles$6.media, {
19210
- flexBasis: !isHalfSize && hasTitle && hasDescription ? '50%' : '100%',
19211
- height: isHalfSize ? '100%' : undefined
19212
- }]
19193
+ style: [props.style, baseStyles.media, styles.media]
19213
19194
  }));
19214
19195
  };
19196
+
19215
19197
  var BaseTileTitle = function () {
19216
19198
  var tile = useTileContext();
19217
19199
  var theme = useWllSdk().theme;
@@ -19222,49 +19204,86 @@ var BaseTileTitle = function () {
19222
19204
  var isHalfSize = useTileSize(tile).isHalfSize;
19223
19205
  // Don't show title for half tiles with image
19224
19206
  if (isHalfSize && artworkUrl || !title) return null;
19225
- return /*#__PURE__*/React$1.createElement(React$1.Fragment, null, /*#__PURE__*/React$1.createElement(Text, {
19207
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Text, {
19226
19208
  variant: "title",
19227
19209
  accessibilityLabel: title,
19228
19210
  numberOfLines: 1
19229
- }, title), ctaLink && /*#__PURE__*/React$1.createElement(Icon, {
19211
+ }, title), ctaLink && /*#__PURE__*/React.createElement(Icon, {
19230
19212
  name: "ChevronRight",
19231
19213
  color: theme.derivedSurfaceText[20]
19232
19214
  }));
19233
19215
  };
19234
- var BaseTileBody = function (props) {
19216
+
19217
+ /**
19218
+ * Context to provide the current tile to child components.
19219
+ */
19220
+ var TileContext = /*#__PURE__*/React.createContext(null);
19221
+ /**
19222
+ * Custom hook to access the TileContext.
19223
+ */
19224
+ var useTileContext = function () {
19225
+ var context = React.useContext(TileContext);
19226
+ if (!context) {
19227
+ throw new Error('Tile components must be used within a BaseTile');
19228
+ }
19229
+ return context;
19230
+ };
19231
+ /**
19232
+ * BaseTileRoot component to handle layout and pressable behavior.
19233
+ */
19234
+ var BaseTileRoot = function (_a) {
19235
+ var children = _a.children,
19236
+ style = _a.style;
19235
19237
  var tile = useTileContext();
19236
- var _a = tile.configuration,
19237
- body = _a.body,
19238
- artworkUrl = _a.artworkUrl;
19238
+ var theme = useWllSdk().theme;
19239
19239
  var isHalfSize = useTileSize(tile).isHalfSize;
19240
- if (isHalfSize && artworkUrl || !body) return null;
19241
- return /*#__PURE__*/React$1.createElement(Text, _extends({
19242
- variant: "body"
19243
- }, props, {
19244
- accessibilityLabel: body
19245
- }), body);
19240
+ var _b = tile.configuration,
19241
+ ctaLink = _b.ctaLink,
19242
+ ctaLinkTarget = _b.ctaLinkTarget,
19243
+ title = _b.title;
19244
+ var handlePress = useHandleTilePress(tile, ctaLink, ctaLinkTarget);
19245
+ // Dynamic layout and styles
19246
+ var layout = {
19247
+ flexDirection: 'column',
19248
+ justifyContent: isHalfSize ? 'center' : 'flex-start',
19249
+ alignItems: 'stretch'
19250
+ };
19251
+ var dynamicStyles = useBaseTileStyles();
19252
+ return /*#__PURE__*/React.createElement(Pressable$1, {
19253
+ style: function (_a) {
19254
+ var pressed = _a.pressed;
19255
+ return [baseStyles.container, dynamicStyles.container, {
19256
+ backgroundColor: theme.surface,
19257
+ opacity: pressed ? 0.7 : 1
19258
+ }, layout, style];
19259
+ },
19260
+ onPress: handlePress,
19261
+ disabled: tile.type !== 'REWARD' && tile.type !== 'REWARD_CATEGORY' && !ctaLink,
19262
+ accessible: true,
19263
+ accessibilityRole: "button",
19264
+ accessibilityLabel: "".concat(title).concat(ctaLink ? ' - Click to open' : '')
19265
+ }, children);
19246
19266
  };
19247
- var BaseTile = BaseTileInner;
19248
- BaseTile.Root = BaseTileRoot;
19249
- BaseTile.Media = BaseTileMedia;
19250
- BaseTile.Content = BaseTileContent;
19251
- BaseTile.Header = BaseTileHeader;
19252
- BaseTile.Title = BaseTileTitle;
19253
- BaseTile.Body = BaseTileBody;
19254
- var styles$6 = StyleSheet$1.create({
19255
- container: {
19256
- width: '100%',
19257
- height: '100%',
19258
- overflow: 'hidden',
19259
- position: 'relative'
19260
- },
19261
- content: {
19262
- display: 'flex'
19263
- },
19264
- media: {
19265
- width: '100%',
19266
- objectFit: 'cover'
19267
- }
19267
+ /**
19268
+ * BaseTileInner component to provide context and render children.
19269
+ */
19270
+ var BaseTileInner = function (_a) {
19271
+ var tile = _a.tile,
19272
+ children = _a.children;
19273
+ return /*#__PURE__*/React.createElement(TileContext.Provider, {
19274
+ value: tile
19275
+ }, /*#__PURE__*/React.createElement(BaseTile.Root, null, children));
19276
+ };
19277
+ /**
19278
+ * BaseTile component with subcomponents attached.
19279
+ */
19280
+ var BaseTile = Object.assign(BaseTileInner, {
19281
+ Root: BaseTileRoot,
19282
+ Media: BaseTileMedia,
19283
+ Content: BaseTileContent,
19284
+ Header: BaseTileHeader,
19285
+ Title: BaseTileTitle,
19286
+ Body: BaseTileBody
19268
19287
  });
19269
19288
 
19270
19289
  var Indicator = function () {
@@ -19276,9 +19295,9 @@ var Indicator = function () {
19276
19295
  if (isTablet) return 'Tablet Layout';
19277
19296
  return 'Mobile Layout';
19278
19297
  };
19279
- return /*#__PURE__*/React$1.createElement(View$2, {
19298
+ return /*#__PURE__*/React.createElement(View$2, {
19280
19299
  style: styles$5.indicator
19281
- }, /*#__PURE__*/React$1.createElement(Text$3, {
19300
+ }, /*#__PURE__*/React.createElement(Text$3, {
19282
19301
  style: styles$5.indicatorText
19283
19302
  }, getCurrentLayout()));
19284
19303
  };
@@ -19426,16 +19445,16 @@ function withTileFetching(WrappedComponent) {
19426
19445
  var tile = props.tile,
19427
19446
  tileId = props.tileId;
19428
19447
  var getTileByID = useWllSdk().getTileByID;
19429
- var _a = React$1.useState(tile || null),
19448
+ var _a = React.useState(tile || null),
19430
19449
  tileData = _a[0],
19431
19450
  setTileData = _a[1];
19432
- var _b = React$1.useState(false),
19451
+ var _b = React.useState(false),
19433
19452
  isLoading = _b[0],
19434
19453
  setIsLoading = _b[1];
19435
- var _c = React$1.useState(null),
19454
+ var _c = React.useState(null),
19436
19455
  error = _c[0],
19437
19456
  setError = _c[1];
19438
- React$1.useEffect(function () {
19457
+ React.useEffect(function () {
19439
19458
  if (tile) {
19440
19459
  setTileData(tile);
19441
19460
  } else if (tileId) {
@@ -19475,18 +19494,18 @@ function withTileFetching(WrappedComponent) {
19475
19494
  }
19476
19495
  }, [tile, tileId, getTileByID]);
19477
19496
  if (isLoading) {
19478
- return /*#__PURE__*/React$1.createElement(SkeletonTile, {
19497
+ return /*#__PURE__*/React.createElement(SkeletonTile, {
19479
19498
  style: {
19480
19499
  width: '100%'
19481
19500
  }
19482
19501
  });
19483
19502
  }
19484
19503
  if (error || !tileData) {
19485
- return /*#__PURE__*/React$1.createElement(View$2, {
19504
+ return /*#__PURE__*/React.createElement(View$2, {
19486
19505
  style: commonStyles.emptyContainer
19487
- }, /*#__PURE__*/React$1.createElement(Text$3, null, "No tile data available"));
19506
+ }, /*#__PURE__*/React.createElement(Text$3, null, "No tile data available"));
19488
19507
  }
19489
- return /*#__PURE__*/React$1.createElement(WrappedComponent, _extends({}, props, {
19508
+ return /*#__PURE__*/React.createElement(WrappedComponent, _extends({}, props, {
19490
19509
  tile: tileData
19491
19510
  }));
19492
19511
  };
@@ -19554,21 +19573,28 @@ var BadgeTileDateEarned = function () {
19554
19573
  var containerStyle = [styles.dateEarnedContainer, {
19555
19574
  backgroundColor: backgroundColor
19556
19575
  }];
19576
+ var textColor = getReadableTextColor(backgroundColor);
19557
19577
  if (type === exports.BadgeTileType.Latest && count === 0) {
19558
19578
  return null;
19559
19579
  }
19560
19580
  if (count === 0) {
19561
- return /*#__PURE__*/React$1.createElement(View$2, {
19581
+ return /*#__PURE__*/React.createElement(View$2, {
19562
19582
  style: containerStyle
19563
- }, /*#__PURE__*/React$1.createElement(Text, {
19564
- variant: "label"
19583
+ }, /*#__PURE__*/React.createElement(Text, {
19584
+ variant: "label",
19585
+ style: {
19586
+ color: textColor
19587
+ }
19565
19588
  }, badgeNotEarnedMessage));
19566
19589
  }
19567
19590
  var formattedDate = new Date(createdAt).toLocaleDateString();
19568
- return /*#__PURE__*/React$1.createElement(View$2, {
19591
+ return /*#__PURE__*/React.createElement(View$2, {
19569
19592
  style: containerStyle
19570
- }, /*#__PURE__*/React$1.createElement(Text, {
19571
- variant: "label"
19593
+ }, /*#__PURE__*/React.createElement(Text, {
19594
+ variant: "label",
19595
+ style: {
19596
+ color: textColor
19597
+ }
19572
19598
  }, "".concat(awardedDatePrefix, " ").concat(formattedDate)));
19573
19599
  };
19574
19600
 
@@ -19578,7 +19604,7 @@ var BadgeTileDescription = function () {
19578
19604
  var count = configuration.count,
19579
19605
  description = configuration.description;
19580
19606
  if (count === 0 || !description) return null;
19581
- return /*#__PURE__*/React$1.createElement(Text, {
19607
+ return /*#__PURE__*/React.createElement(Text, {
19582
19608
  variant: "body",
19583
19609
  numberOfLines: 2,
19584
19610
  ellipsizeMode: "tail"
@@ -19597,9 +19623,9 @@ var BadgeTileMedia = function (_a) {
19597
19623
  emptyBadgeArtworkUrl = configuration.emptyBadgeArtworkUrl;
19598
19624
  var displayUrl = count === 0 ? emptyBadgeArtworkUrl : artworkUrl;
19599
19625
  if (!displayUrl) return null;
19600
- return /*#__PURE__*/React$1.createElement(View$2, {
19626
+ return /*#__PURE__*/React.createElement(View$2, {
19601
19627
  style: styles.header
19602
- }, /*#__PURE__*/React$1.createElement(ProgressiveImage, _extends({}, props, {
19628
+ }, /*#__PURE__*/React.createElement(ProgressiveImage, _extends({}, props, {
19603
19629
  source: {
19604
19630
  uri: displayUrl
19605
19631
  },
@@ -19618,12 +19644,12 @@ var BadgeTileStatus = function () {
19618
19644
  if (type !== exports.BadgeTileType.Specific || count === 1) {
19619
19645
  return null;
19620
19646
  }
19621
- return /*#__PURE__*/React$1.createElement(View$2, {
19647
+ return /*#__PURE__*/React.createElement(View$2, {
19622
19648
  style: styles.indicatorContainer
19623
- }, count === 0 ? /*#__PURE__*/React$1.createElement(LucideIcons.LockKeyholeIcon, {
19649
+ }, count === 0 ? /*#__PURE__*/React.createElement(LucideIcons.LockKeyholeIcon, {
19624
19650
  color: "#FFF",
19625
19651
  size: 20
19626
- }) : /*#__PURE__*/React$1.createElement(Text, {
19652
+ }) : /*#__PURE__*/React.createElement(Text, {
19627
19653
  style: styles.countText
19628
19654
  }, count, "x"));
19629
19655
  };
@@ -19637,7 +19663,7 @@ var BadgeTileTitle = function () {
19637
19663
  emptyBadgeMessage = configuration.emptyBadgeMessage;
19638
19664
  var displayText = count === 0 ? emptyBadgeMessage : name;
19639
19665
  if (!displayText) return null;
19640
- return /*#__PURE__*/React$1.createElement(View$2, null, /*#__PURE__*/React$1.createElement(Text, {
19666
+ return /*#__PURE__*/React.createElement(View$2, null, /*#__PURE__*/React.createElement(Text, {
19641
19667
  variant: "title",
19642
19668
  style: styles.titleText,
19643
19669
  numberOfLines: count === 0 ? 2 : 1,
@@ -19645,22 +19671,31 @@ var BadgeTileTitle = function () {
19645
19671
  }, displayText));
19646
19672
  };
19647
19673
 
19648
- var BadgeTileMain = function (_a) {
19674
+ /**
19675
+ * The main BadgeTile component.
19676
+ *
19677
+ * This component renders a badge tile with optional media, status, title, description, and date earned.
19678
+ */
19679
+ var BadgeTileRoot = function (_a) {
19649
19680
  var tile = _a.tile;
19650
19681
  if (!tile) return null;
19651
- return /*#__PURE__*/React$1.createElement(BaseTile, {
19682
+ return /*#__PURE__*/React.createElement(BaseTile, {
19652
19683
  tile: tile
19653
- }, /*#__PURE__*/React$1.createElement(BadgeTile.Media, null, /*#__PURE__*/React$1.createElement(BadgeTile.Status, null)), /*#__PURE__*/React$1.createElement(Column, {
19684
+ }, /*#__PURE__*/React.createElement(BadgeTile.Media, null, /*#__PURE__*/React.createElement(BadgeTile.Status, null)), /*#__PURE__*/React.createElement(Column, {
19654
19685
  justify: "between",
19655
19686
  align: "start"
19656
- }, /*#__PURE__*/React$1.createElement(View$2, null, /*#__PURE__*/React$1.createElement(BadgeTile.Title, null), /*#__PURE__*/React$1.createElement(BadgeTile.Description, null)), /*#__PURE__*/React$1.createElement(BadgeTile.DateEarned, null)));
19687
+ }, /*#__PURE__*/React.createElement(BadgeTile.Title, null), /*#__PURE__*/React.createElement(BadgeTile.Description, null), /*#__PURE__*/React.createElement(Spacer, null), /*#__PURE__*/React.createElement(BadgeTile.DateEarned, null)));
19657
19688
  };
19658
- var BadgeTile = BadgeTileMain;
19659
- BadgeTile.Media = BadgeTileMedia;
19660
- BadgeTile.Title = BadgeTileTitle;
19661
- BadgeTile.Description = BadgeTileDescription;
19662
- BadgeTile.DateEarned = BadgeTileDateEarned;
19663
- BadgeTile.Status = BadgeTileStatus;
19689
+ /**
19690
+ * The BadgeTile component with subcomponents attached.
19691
+ */
19692
+ var BadgeTile = Object.assign(BadgeTileRoot, {
19693
+ Media: BadgeTileMedia,
19694
+ Title: BadgeTileTitle,
19695
+ Description: BadgeTileDescription,
19696
+ DateEarned: BadgeTileDateEarned,
19697
+ Status: BadgeTileStatus
19698
+ });
19664
19699
  var BadgeTile$1 = withTileFetching(BadgeTile);
19665
19700
 
19666
19701
  var BannerTileCTA = function () {
@@ -19671,7 +19706,7 @@ var BannerTileCTA = function () {
19671
19706
  ctaLinkTarget = _a.ctaLinkTarget;
19672
19707
  var handlePress = useHandleTilePress(tile, ctaLink, ctaLinkTarget);
19673
19708
  if (!ctaText) return null;
19674
- return /*#__PURE__*/React$1.createElement(Button, {
19709
+ return /*#__PURE__*/React.createElement(Button, {
19675
19710
  title: ctaText,
19676
19711
  variant: "accent",
19677
19712
  onPress: handlePress
@@ -19720,7 +19755,7 @@ var BannerTileDescription = function () {
19720
19755
  var description = configuration.description;
19721
19756
  var theme = useWllSdk().theme;
19722
19757
  if (!description) return null;
19723
- return /*#__PURE__*/React$1.createElement(Text, {
19758
+ return /*#__PURE__*/React.createElement(Text, {
19724
19759
  style: [styles.description, {
19725
19760
  color: theme.derivedSurfaceText[20]
19726
19761
  }]
@@ -19739,9 +19774,9 @@ var BannerTileMedia = function (_a) {
19739
19774
  return (
19740
19775
  /*#__PURE__*/
19741
19776
  // @ts-ignore: We are using percentage values for width, which is valid in React Native but TypeScript expects a number.
19742
- React$1.createElement(View$2, {
19777
+ React.createElement(View$2, {
19743
19778
  style: [styles.mediaContainer, containerStyle]
19744
- }, /*#__PURE__*/React$1.createElement(ProgressiveImage, {
19779
+ }, /*#__PURE__*/React.createElement(ProgressiveImage, {
19745
19780
  source: {
19746
19781
  uri: artworkUrl
19747
19782
  },
@@ -19755,33 +19790,52 @@ var BannerTileTitle = function () {
19755
19790
  var configuration = useBannerContext().configuration;
19756
19791
  var title = configuration.title;
19757
19792
  if (!title) return null;
19758
- return /*#__PURE__*/React$1.createElement(Text, {
19793
+ return /*#__PURE__*/React.createElement(Text, {
19759
19794
  variant: "title",
19760
19795
  style: styles.title
19761
19796
  }, title);
19762
19797
  };
19763
19798
 
19764
- var BannerTile = function (_a) {
19799
+ /**
19800
+ * Helper function to determine if the tile is artwork-only.
19801
+ *
19802
+ * @param configuration - The configuration object of the tile.
19803
+ * @returns `true` if the tile has no title, description, or CTA text.
19804
+ */
19805
+ var isArtworkOnly$1 = function (configuration) {
19806
+ return !configuration.title && !configuration.description && !configuration.ctaText;
19807
+ };
19808
+ /**
19809
+ * The main BannerTile component.
19810
+ *
19811
+ * This component renders a banner tile with optional media, title, description, and CTA.
19812
+ */
19813
+ var BannerTileRoot = function (_a) {
19765
19814
  var tile = _a.tile;
19815
+ if (!tile) return null;
19766
19816
  var styles = useBannerTileStyles();
19767
19817
  var configuration = tile.configuration;
19768
- var isArtworkOnly = !configuration.title && !configuration.description && !configuration.ctaText;
19769
- return /*#__PURE__*/React__namespace.createElement(BaseBanner, {
19818
+ return /*#__PURE__*/React.createElement(BaseBanner, {
19770
19819
  tile: tile
19771
- }, /*#__PURE__*/React__namespace.createElement(BannerTile.Media, {
19772
- isArtworkOnly: isArtworkOnly
19773
- }), /*#__PURE__*/React__namespace.createElement(View$2, {
19820
+ }, /*#__PURE__*/React.createElement(BannerTile.Media, {
19821
+ isArtworkOnly: isArtworkOnly$1(configuration)
19822
+ }), /*#__PURE__*/React.createElement(View$2, {
19774
19823
  style: styles.slideContent
19775
- }, /*#__PURE__*/React__namespace.createElement(BannerTile.Title, null), /*#__PURE__*/React__namespace.createElement(BannerTile.Description, null), /*#__PURE__*/React__namespace.createElement(BannerTile.CTA, null)));
19824
+ }, /*#__PURE__*/React.createElement(BannerTile.Title, null), /*#__PURE__*/React.createElement(BannerTile.Description, null), /*#__PURE__*/React.createElement(BannerTile.CTA, null)));
19776
19825
  };
19777
- BannerTile.Media = BannerTileMedia;
19778
- BannerTile.Title = BannerTileTitle;
19779
- BannerTile.Description = BannerTileDescription;
19780
- BannerTile.CTA = BannerTileCTA;
19826
+ /**
19827
+ * The BannerTile component with subcomponents attached.
19828
+ */
19829
+ var BannerTile = Object.assign(BannerTileRoot, {
19830
+ Media: BannerTileMedia,
19831
+ Title: BannerTileTitle,
19832
+ Description: BannerTileDescription,
19833
+ CTA: BannerTileCTA
19834
+ });
19781
19835
  var BannerTile$1 = withTileFetching(BannerTile);
19782
19836
 
19783
19837
  var ContentTileBody = function () {
19784
- return /*#__PURE__*/React$1.createElement(BaseTile.Body, null);
19838
+ return /*#__PURE__*/React.createElement(BaseTile.Body, null);
19785
19839
  };
19786
19840
 
19787
19841
  var useContentTileStyles = function () {
@@ -19804,7 +19858,7 @@ var useContentTileStyles = function () {
19804
19858
  var ContentTileContent = function (_a) {
19805
19859
  var children = _a.children;
19806
19860
  var styles = useContentTileStyles();
19807
- return /*#__PURE__*/React$1.createElement(BaseTile.Content, null, /*#__PURE__*/React$1.createElement(View$2, {
19861
+ return /*#__PURE__*/React.createElement(BaseTile.Content, null, /*#__PURE__*/React.createElement(View$2, {
19808
19862
  style: styles.content
19809
19863
  }, children));
19810
19864
  };
@@ -19813,33 +19867,43 @@ var ContentTileHeader = function () {
19813
19867
  var tile = useTileContext();
19814
19868
  var title = tile.configuration.title;
19815
19869
  if (!title) return null;
19816
- return /*#__PURE__*/React$1.createElement(BaseTile.Header, null, /*#__PURE__*/React$1.createElement(BaseTile.Title, null));
19870
+ return /*#__PURE__*/React.createElement(BaseTile.Header, null, /*#__PURE__*/React.createElement(BaseTile.Title, null));
19817
19871
  };
19818
19872
 
19819
19873
  var ContentTileMedia = function () {
19820
19874
  var styles = useContentTileStyles();
19821
- return /*#__PURE__*/React$1.createElement(BaseTile.Media, {
19875
+ return /*#__PURE__*/React.createElement(BaseTile.Media, {
19822
19876
  style: styles.media
19823
19877
  });
19824
19878
  };
19825
19879
 
19826
19880
  var ContentTileRoot = function (_a) {
19827
19881
  var children = _a.children;
19828
- return /*#__PURE__*/React$1.createElement(BaseTile.Root, null, children);
19882
+ return /*#__PURE__*/React.createElement(BaseTile.Root, null, children);
19829
19883
  };
19830
19884
 
19885
+ /**
19886
+ * The ContentTile component renders a tile with a root, media, content, header, and body.
19887
+ *
19888
+ * @param tile - The tile data to render.
19889
+ */
19831
19890
  var ContentTileMain = function (_a) {
19832
19891
  var tile = _a.tile;
19833
- return /*#__PURE__*/React$1.createElement(BaseTile, {
19892
+ if (!tile) return null;
19893
+ return /*#__PURE__*/React.createElement(BaseTile, {
19834
19894
  tile: tile
19835
- }, /*#__PURE__*/React$1.createElement(ContentTile.Root, null, /*#__PURE__*/React$1.createElement(ContentTile.Media, null), /*#__PURE__*/React$1.createElement(ContentTile.Content, null, /*#__PURE__*/React$1.createElement(ContentTile.Header, null), /*#__PURE__*/React$1.createElement(ContentTile.Body, null))));
19895
+ }, /*#__PURE__*/React.createElement(ContentTile.Root, null, /*#__PURE__*/React.createElement(ContentTile.Media, null), /*#__PURE__*/React.createElement(ContentTile.Content, null, /*#__PURE__*/React.createElement(ContentTile.Header, null), /*#__PURE__*/React.createElement(ContentTile.Body, null))));
19836
19896
  };
19837
- var ContentTile = ContentTileMain;
19838
- ContentTile.Root = ContentTileRoot;
19839
- ContentTile.Media = ContentTileMedia;
19840
- ContentTile.Content = ContentTileContent;
19841
- ContentTile.Header = ContentTileHeader;
19842
- ContentTile.Body = ContentTileBody;
19897
+ /**
19898
+ * The ContentTile component with subcomponents attached.
19899
+ */
19900
+ var ContentTile = Object.assign(ContentTileMain, {
19901
+ Root: ContentTileRoot,
19902
+ Media: ContentTileMedia,
19903
+ Content: ContentTileContent,
19904
+ Header: ContentTileHeader,
19905
+ Body: ContentTileBody
19906
+ });
19843
19907
  var ContentTile$1 = withTileFetching(ContentTile);
19844
19908
 
19845
19909
  /**
@@ -19875,10 +19939,10 @@ exports.SectionType = void 0;
19875
19939
  */
19876
19940
 
19877
19941
  function useWindowDimensions() {
19878
- var _useState = React$1.useState(() => Dimensions.get('window')),
19942
+ var _useState = React.useState(() => Dimensions.get('window')),
19879
19943
  dims = _useState[0],
19880
19944
  setDims = _useState[1];
19881
- React$1.useEffect(() => {
19945
+ React.useEffect(() => {
19882
19946
  function handleChange(_ref) {
19883
19947
  var window = _ref.window;
19884
19948
  if (window != null) {
@@ -19927,14 +19991,14 @@ var SectionHeader = function (_a) {
19927
19991
  if (!title) {
19928
19992
  return null;
19929
19993
  }
19930
- return /*#__PURE__*/React$1.createElement(View$2, {
19994
+ return /*#__PURE__*/React.createElement(View$2, {
19931
19995
  style: styles.sectionHeader
19932
- }, title && /*#__PURE__*/React$1.createElement(Text, {
19996
+ }, title && /*#__PURE__*/React.createElement(Text, {
19933
19997
  style: [styles.sectionTitle, {
19934
19998
  fontWeight: '700',
19935
19999
  color: theme.text
19936
20000
  }]
19937
- }, title), description && /*#__PURE__*/React$1.createElement(Text, {
20001
+ }, title), description && /*#__PURE__*/React.createElement(Text, {
19938
20002
  style: [styles.sectionDescription, {
19939
20003
  color: theme.alphaDerivedText[80]
19940
20004
  }]
@@ -20020,52 +20084,85 @@ var useCarouselStyles = function (buttonSize) {
20020
20084
  });
20021
20085
  };
20022
20086
 
20087
+ var initialState = {
20088
+ currentIndex: 0,
20089
+ containerWidth: 0
20090
+ };
20091
+ var carouselReducer = function (state, action) {
20092
+ switch (action.type) {
20093
+ case 'SET_CONTAINER_WIDTH':
20094
+ return __assign(__assign({}, state), {
20095
+ containerWidth: action.payload
20096
+ });
20097
+ case 'SET_CURRENT_INDEX':
20098
+ return __assign(__assign({}, state), {
20099
+ currentIndex: action.payload
20100
+ });
20101
+ case 'PREV_SLIDE':
20102
+ return __assign(__assign({}, state), {
20103
+ currentIndex: Math.max(0, state.currentIndex - 1)
20104
+ });
20105
+ case 'NEXT_SLIDE':
20106
+ return __assign(__assign({}, state), {
20107
+ currentIndex: Math.min(action.maxIndex, state.currentIndex + 1)
20108
+ });
20109
+ default:
20110
+ return state;
20111
+ }
20112
+ };
20023
20113
  var Carousel = function (_a) {
20024
20114
  var section = _a.section;
20025
- var windowWidth = useWindowDimensions().width;
20026
- var containerRef = React$1.useRef(null);
20027
- var _b = React$1.useState(windowWidth),
20028
- containerWidth = _b[0],
20029
- setContainerWidth = _b[1];
20115
+ var WINDOW_WIDTH = useWindowDimensions().width;
20116
+ var containerRef = React.useRef(null);
20030
20117
  var styles = useCarouselStyles(BUTTON_SIZE);
20031
- var animatedIndex = React$1.useRef(new Animated$1.Value(0)).current;
20118
+ var animatedIndex = React.useRef(new Animated$1.Value(0)).current;
20032
20119
  var theme = useWllSdk().theme;
20033
- var _c = useResponsive(),
20034
- isDesktop = _c.isDesktop,
20035
- isTablet = _c.isTablet;
20036
- var scrollViewRef = React$1.useRef(null);
20037
- var _d = React$1.useState(0),
20038
- currentIndex = _d[0],
20039
- setCurrentIndex = _d[1];
20120
+ var _b = useResponsive(),
20121
+ isDesktop = _b.isDesktop,
20122
+ isTablet = _b.isTablet;
20123
+ var scrollViewRef = React.useRef(null);
20124
+ var _c = React.useReducer(carouselReducer, __assign(__assign({}, initialState), {
20125
+ containerWidth: WINDOW_WIDTH
20126
+ })),
20127
+ state = _c[0],
20128
+ dispatch = _c[1];
20129
+ var currentIndex = state.currentIndex,
20130
+ containerWidth = state.containerWidth;
20040
20131
  var bannerTiles = section.tiles.filter(function (tile) {
20041
20132
  return tile.type === exports.TileType.Banner;
20042
20133
  });
20043
20134
  var sortedTiles = sortByPriority(bannerTiles);
20044
- var handleScroll = React$1.useCallback(function (event) {
20135
+ var handleScroll = React.useCallback(function (event) {
20045
20136
  var contentOffsetX = event.nativeEvent.contentOffset.x;
20046
20137
  var newIndex = contentOffsetX / containerWidth;
20047
20138
  animatedIndex.setValue(newIndex);
20048
20139
  }, [containerWidth, animatedIndex]);
20049
- var handleScrollEnd = React$1.useCallback(function (event) {
20140
+ var handleScrollEnd = React.useCallback(function (event) {
20050
20141
  var contentOffsetX = event.nativeEvent.contentOffset.x;
20051
20142
  var newIndex = Math.round(contentOffsetX / containerWidth);
20052
- setCurrentIndex(newIndex);
20143
+ dispatch({
20144
+ type: 'SET_CURRENT_INDEX',
20145
+ payload: newIndex
20146
+ });
20053
20147
  }, [containerWidth]);
20054
20148
  var handlePrev = function () {
20055
20149
  var _a;
20056
- var newIndex = Math.max(0, currentIndex - 1);
20057
- setCurrentIndex(newIndex);
20150
+ dispatch({
20151
+ type: 'PREV_SLIDE'
20152
+ });
20058
20153
  (_a = scrollViewRef.current) === null || _a === void 0 ? void 0 : _a.scrollTo({
20059
- x: newIndex * containerWidth,
20154
+ x: (currentIndex - 1) * containerWidth,
20060
20155
  animated: true
20061
20156
  });
20062
20157
  };
20063
20158
  var handleNext = function () {
20064
20159
  var _a;
20065
- var newIndex = Math.min(sortedTiles.length - 1, currentIndex + 1);
20066
- setCurrentIndex(newIndex);
20160
+ dispatch({
20161
+ type: 'NEXT_SLIDE',
20162
+ maxIndex: sortedTiles.length - 1
20163
+ });
20067
20164
  (_a = scrollViewRef.current) === null || _a === void 0 ? void 0 : _a.scrollTo({
20068
- x: newIndex * containerWidth,
20165
+ x: (currentIndex + 1) * containerWidth,
20069
20166
  animated: true
20070
20167
  });
20071
20168
  };
@@ -20079,28 +20176,31 @@ var Carousel = function (_a) {
20079
20176
  marginTop: useResponsiveValue(theme.sizes.xxl, theme.sizes.sm, isDesktop, isTablet)
20080
20177
  }
20081
20178
  });
20082
- return /*#__PURE__*/React$1.createElement(React$1.Fragment, null, /*#__PURE__*/React$1.createElement(SectionHeader, {
20179
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(SectionHeader, {
20083
20180
  title: section.title,
20084
20181
  description: section.description
20085
- }), /*#__PURE__*/React$1.createElement(View$2, {
20182
+ }), /*#__PURE__*/React.createElement(View$2, {
20086
20183
  ref: containerRef,
20087
20184
  style: styles.container,
20088
20185
  onLayout: function (event) {
20089
20186
  var width = event.nativeEvent.layout.width;
20090
- setContainerWidth(width);
20187
+ dispatch({
20188
+ type: 'SET_CONTAINER_WIDTH',
20189
+ payload: width
20190
+ });
20091
20191
  }
20092
- }, /*#__PURE__*/React$1.createElement(View$2, {
20192
+ }, /*#__PURE__*/React.createElement(View$2, {
20093
20193
  style: styles.carouselContainer
20094
- }, showPrevButton && /*#__PURE__*/React$1.createElement(TouchableOpacity$1, {
20194
+ }, showPrevButton && /*#__PURE__*/React.createElement(TouchableOpacity$1, {
20095
20195
  style: [styles.navButton, styles.navButtonLeft, {
20096
20196
  backgroundColor: theme.background
20097
20197
  }],
20098
20198
  onPress: handlePrev
20099
- }, /*#__PURE__*/React$1.createElement(Icon, {
20199
+ }, /*#__PURE__*/React.createElement(Icon, {
20100
20200
  name: "ArrowLeft",
20101
20201
  size: 20,
20102
20202
  color: theme.primary
20103
- })), /*#__PURE__*/React$1.createElement(ScrollView$2, {
20203
+ })), /*#__PURE__*/React.createElement(ScrollView$2, {
20104
20204
  ref: scrollViewRef,
20105
20205
  horizontal: true,
20106
20206
  pagingEnabled: true,
@@ -20116,24 +20216,24 @@ var Carousel = function (_a) {
20116
20216
  snapToInterval: containerWidth,
20117
20217
  snapToAlignment: "start"
20118
20218
  }, sortedTiles.map(function (tile, index) {
20119
- return /*#__PURE__*/React$1.createElement(View$2, {
20219
+ return /*#__PURE__*/React.createElement(View$2, {
20120
20220
  key: index,
20121
20221
  style: [styles.slideContainer, {
20122
20222
  width: containerWidth
20123
20223
  }]
20124
- }, /*#__PURE__*/React$1.createElement(BannerTile$1, {
20224
+ }, /*#__PURE__*/React.createElement(BannerTile$1, {
20125
20225
  tile: tile
20126
20226
  }));
20127
- })), showNextButton && /*#__PURE__*/React$1.createElement(TouchableOpacity$1, {
20227
+ })), showNextButton && /*#__PURE__*/React.createElement(TouchableOpacity$1, {
20128
20228
  style: [styles.navButton, styles.navButtonRight, {
20129
20229
  backgroundColor: theme.surface
20130
20230
  }],
20131
20231
  onPress: handleNext
20132
- }, /*#__PURE__*/React$1.createElement(Icon, {
20232
+ }, /*#__PURE__*/React.createElement(Icon, {
20133
20233
  name: "ArrowRight",
20134
20234
  size: 20,
20135
20235
  color: theme.primary
20136
- }))), displayControls && /*#__PURE__*/React$1.createElement(View$2, {
20236
+ }))), displayControls && /*#__PURE__*/React.createElement(View$2, {
20137
20237
  style: dynamicStyles.indicators
20138
20238
  }, sortedTiles.map(function (_, index) {
20139
20239
  var width = animatedIndex.interpolate({
@@ -20141,7 +20241,7 @@ var Carousel = function (_a) {
20141
20241
  outputRange: [8, 30, 8],
20142
20242
  extrapolate: 'clamp'
20143
20243
  });
20144
- return /*#__PURE__*/React$1.createElement(Animated$1.View, {
20244
+ return /*#__PURE__*/React.createElement(Animated$1.View, {
20145
20245
  key: index,
20146
20246
  style: [styles.indicator, {
20147
20247
  backgroundColor: theme.derivedBackground,
@@ -20157,43 +20257,30 @@ var Grid = function (_a) {
20157
20257
  var section = _a.section;
20158
20258
  var isDesktop = useResponsive().isDesktop;
20159
20259
  var columnsPerRow = isDesktop ? 4 : 2;
20160
- var renderGrid = function () {
20161
- var tileContainers = [];
20162
- var currentTiles = [];
20163
- var gridTiles = section.tiles.filter(function (tile) {
20260
+ var gridTiles = React.useMemo(function () {
20261
+ return sortByPriority(section.tiles.filter(function (tile) {
20164
20262
  return tile.type !== exports.TileType.Banner;
20165
- }).sort(function (a, b) {
20166
- if (a.priority !== b.priority) {
20167
- return b.priority - a.priority;
20168
- }
20169
- return section.tiles.indexOf(a) - section.tiles.indexOf(b);
20170
- });
20171
- var allHalfTiles = gridTiles.every(function (tile) {
20172
- return tile.tileHeight === exports.TileHeight.Half;
20173
- });
20174
- var getTileWidth = function (columns) {
20263
+ }));
20264
+ }, [section.tiles]);
20265
+ var getTileWidth = React.useCallback(function (columns) {
20266
+ if (IS_WEB) {
20175
20267
  return {
20176
20268
  width: "calc(".concat(100 / columns, "% - ").concat((columns - 1) * GRID_GAP / columns, "px)"),
20177
20269
  marginBottom: GRID_GAP,
20178
20270
  height: 'auto'
20179
20271
  };
20180
- };
20181
- if (isDesktop && allHalfTiles) {
20182
- gridTiles.forEach(function (tile, index) {
20183
- var isLastInRow = (index + 1) % columnsPerRow === 0;
20184
- tileContainers.push( /*#__PURE__*/React__namespace.createElement(View$2, {
20185
- key: "container-".concat(index),
20186
- style: [
20187
- // @ts-ignore
20188
- getTileWidth(columnsPerRow), !isLastInRow && {
20189
- marginRight: GRID_GAP
20190
- }]
20191
- }, /*#__PURE__*/React__namespace.createElement(TileContainer, {
20192
- tiles: [tile]
20193
- })));
20194
- });
20195
- return tileContainers;
20272
+ } else {
20273
+ var tileWidth = (SCREEN_WIDTH - (columns - 1) * GRID_GAP) / columns;
20274
+ return {
20275
+ width: tileWidth,
20276
+ marginBottom: GRID_GAP,
20277
+ height: 'auto'
20278
+ };
20196
20279
  }
20280
+ }, []);
20281
+ var renderTileContainers = React.useCallback(function () {
20282
+ var tileContainers = [];
20283
+ var currentTiles = [];
20197
20284
  var sortedTiles = sortByPriority(gridTiles);
20198
20285
  sortedTiles.forEach(function (tile, index) {
20199
20286
  currentTiles.push(tile);
@@ -20213,27 +20300,27 @@ var Grid = function (_a) {
20213
20300
  };
20214
20301
  if (shouldStartNewContainer(currentTiles, tile, nextTile)) {
20215
20302
  var isLastInRow = (tileContainers.length + 1) % columnsPerRow === 0;
20216
- tileContainers.push( /*#__PURE__*/React__namespace.createElement(View$2, {
20303
+ tileContainers.push( /*#__PURE__*/React.createElement(View$2, {
20217
20304
  key: "container-".concat(index),
20218
20305
  style: [
20219
- // @ts-ignore
20306
+ // @ts-ignore Web uses CSS calc strings for responsive layouts, while ViewStyle expects numbers
20220
20307
  getTileWidth(columnsPerRow), !isLastInRow && {
20221
20308
  marginRight: GRID_GAP
20222
20309
  }]
20223
- }, /*#__PURE__*/React__namespace.createElement(TileContainer, {
20310
+ }, /*#__PURE__*/React.createElement(TileContainer, {
20224
20311
  tiles: currentTiles
20225
20312
  })));
20226
20313
  currentTiles = [];
20227
20314
  }
20228
20315
  });
20229
20316
  return tileContainers;
20230
- };
20231
- return /*#__PURE__*/React__namespace.createElement(View$2, null, /*#__PURE__*/React__namespace.createElement(SectionHeader, {
20317
+ }, [gridTiles, columnsPerRow, getTileWidth]);
20318
+ return /*#__PURE__*/React.createElement(View$2, null, /*#__PURE__*/React.createElement(SectionHeader, {
20232
20319
  title: section.title,
20233
20320
  description: section.description
20234
- }), /*#__PURE__*/React__namespace.createElement(View$2, {
20321
+ }), /*#__PURE__*/React.createElement(View$2, {
20235
20322
  style: styles$2.grid
20236
- }, renderGrid()));
20323
+ }, renderTileContainers()));
20237
20324
  };
20238
20325
  var styles$2 = StyleSheet$1.create({
20239
20326
  grid: {
@@ -20317,22 +20404,25 @@ var useSectionStyles = function () {
20317
20404
  });
20318
20405
  };
20319
20406
 
20320
- var SectionContext = /*#__PURE__*/React$1.createContext(undefined);
20321
- var Section = function (_a) {
20322
- var section = _a.section,
20323
- sectionId = _a.sectionId;
20324
- var styles = useSectionStyles();
20407
+ /**
20408
+ * SectionContext provides the current section data to child components.
20409
+ */
20410
+ var SectionContext = /*#__PURE__*/React.createContext(undefined);
20411
+ /**
20412
+ * Custom hook to fetch section data.
20413
+ */
20414
+ var useSectionData = function (section, sectionId) {
20325
20415
  var getSectionByID = useWllSdk().getSectionByID;
20326
- var _b = React$1.useState(section || null),
20327
- sectionData = _b[0],
20328
- setSectionData = _b[1];
20329
- var _c = React$1.useState(false),
20330
- isLoading = _c[0],
20331
- setIsLoading = _c[1];
20332
- var _d = React$1.useState(null),
20333
- error = _d[0],
20334
- setError = _d[1];
20335
- React$1.useEffect(function () {
20416
+ var _a = React.useState(section || null),
20417
+ sectionData = _a[0],
20418
+ setSectionData = _a[1];
20419
+ var _b = React.useState(false),
20420
+ isLoading = _b[0],
20421
+ setIsLoading = _b[1];
20422
+ var _c = React.useState(null),
20423
+ error = _c[0],
20424
+ setError = _c[1];
20425
+ React.useEffect(function () {
20336
20426
  if (section) {
20337
20427
  setSectionData(section);
20338
20428
  } else if (sectionId) {
@@ -20352,12 +20442,12 @@ var Section = function (_a) {
20352
20442
  if (response.status === 'success' && response.data) {
20353
20443
  setSectionData(response.data);
20354
20444
  } else {
20355
- setError(response.error || 'Failed to fetch section');
20445
+ setError(response.error || 'Failed to fetch section data.');
20356
20446
  }
20357
20447
  return [3 /*break*/, 5];
20358
20448
  case 3:
20359
20449
  err_1 = _a.sent();
20360
- setError(err_1 instanceof Error ? err_1.message : 'Failed to fetch section');
20450
+ setError(err_1 instanceof Error ? err_1.message : 'Failed to fetch section data.');
20361
20451
  return [3 /*break*/, 5];
20362
20452
  case 4:
20363
20453
  setIsLoading(false);
@@ -20371,95 +20461,151 @@ var Section = function (_a) {
20371
20461
  fetchSection();
20372
20462
  }
20373
20463
  }, [section, sectionId, getSectionByID]);
20464
+ return {
20465
+ sectionData: sectionData,
20466
+ isLoading: isLoading,
20467
+ error: error
20468
+ };
20469
+ };
20470
+ /**
20471
+ * Component to display an empty state with a message.
20472
+ */
20473
+ var EmptyState = function (_a) {
20474
+ var message = _a.message;
20475
+ return /*#__PURE__*/React.createElement(View$2, {
20476
+ style: commonStyles.emptyContainer
20477
+ }, /*#__PURE__*/React.createElement(Text$3, null, message));
20478
+ };
20479
+ /**
20480
+ * The Section component renders a section based on its type (e.g., Banner, Grid).
20481
+ */
20482
+ var Section = function (_a) {
20483
+ var section = _a.section,
20484
+ sectionId = _a.sectionId;
20485
+ var styles = useSectionStyles();
20486
+ var _b = useSectionData(section, sectionId),
20487
+ sectionData = _b.sectionData,
20488
+ isLoading = _b.isLoading,
20489
+ error = _b.error;
20490
+ if (!section && !sectionId) {
20491
+ console.warn('Section component requires either section or sectionId prop.');
20492
+ return null;
20493
+ }
20374
20494
  var renderSectionContent = function () {
20375
20495
  if (isLoading) {
20376
- return /*#__PURE__*/React$1.createElement(View$2, {
20496
+ return /*#__PURE__*/React.createElement(View$2, {
20377
20497
  style: commonStyles.emptyContainer
20378
- }, /*#__PURE__*/React$1.createElement(Skeleton, null));
20498
+ }, /*#__PURE__*/React.createElement(Skeleton, null));
20379
20499
  }
20380
20500
  if (error || !sectionData) {
20381
- return /*#__PURE__*/React$1.createElement(View$2, {
20382
- style: commonStyles.emptyContainer
20383
- }, /*#__PURE__*/React$1.createElement(Text$3, null, "No section data available"));
20501
+ return /*#__PURE__*/React.createElement(EmptyState, {
20502
+ message: error || 'No section data available.'
20503
+ });
20384
20504
  }
20385
20505
  switch (sectionData.type) {
20386
20506
  case exports.SectionType.Banner:
20387
- return /*#__PURE__*/React$1.createElement(Carousel, {
20507
+ return /*#__PURE__*/React.createElement(Carousel, {
20388
20508
  section: sectionData
20389
20509
  });
20390
20510
  case exports.SectionType.Grid:
20391
- return /*#__PURE__*/React$1.createElement(Grid, {
20511
+ return /*#__PURE__*/React.createElement(Grid, {
20392
20512
  section: sectionData
20393
20513
  });
20394
20514
  default:
20395
20515
  console.warn("Unknown section type: ".concat(sectionData.type));
20396
- return null;
20516
+ return /*#__PURE__*/React.createElement(EmptyState, {
20517
+ message: "Unknown section type."
20518
+ });
20397
20519
  }
20398
20520
  };
20399
- if (!section && !sectionId) {
20400
- console.warn('Section component requires either section or sectionId prop');
20401
- return null;
20402
- }
20403
- return sectionData ? /*#__PURE__*/React$1.createElement(SectionContext.Provider, {
20521
+ return sectionData ? /*#__PURE__*/React.createElement(SectionContext.Provider, {
20404
20522
  value: {
20405
20523
  sectionData: sectionData
20406
20524
  }
20407
- }, /*#__PURE__*/React$1.createElement(View$2, {
20525
+ }, /*#__PURE__*/React.createElement(View$2, {
20408
20526
  style: styles.section
20409
20527
  }, renderSectionContent())) : null;
20410
20528
  };
20411
20529
 
20530
+ /**
20531
+ * A page-level component that represents a Group view in the application.
20532
+ *
20533
+ * This component serves as a container page that manages the fetching and display
20534
+ * of a group's data and its associated sections. It handles various states including
20535
+ * loading, errors, and empty states, providing a complete page experience for
20536
+ * viewing group content.
20537
+ *
20538
+ * @param id - The unique identifier of the group to fetch and display.
20539
+ */
20412
20540
  var Group = function (_a) {
20413
20541
  var id = _a.id;
20542
+ if (!id) return null;
20414
20543
  var getGroupByID = useWllSdk().getGroupByID;
20415
- var _b = React$1.useState(null),
20544
+ var _b = React.useState(null),
20416
20545
  groupData = _b[0],
20417
20546
  setGroupData = _b[1];
20418
- var _c = React$1.useState(true),
20419
- loading = _c[0],
20420
- setLoading = _c[1];
20421
- React$1.useEffect(function () {
20422
- var fetchGroup = function () {
20423
- return __awaiter(void 0, void 0, void 0, function () {
20424
- var response;
20425
- return __generator(this, function (_a) {
20426
- switch (_a.label) {
20427
- case 0:
20428
- setLoading(true);
20429
- return [4 /*yield*/, getGroupByID(id)];
20430
- case 1:
20431
- response = _a.sent();
20432
- setGroupData(response.data);
20433
- setLoading(false);
20434
- return [2 /*return*/];
20435
- }
20436
- });
20547
+ var _c = React.useState(null),
20548
+ error = _c[0],
20549
+ setError = _c[1];
20550
+ var fetchGroup = React.useCallback(function () {
20551
+ return __awaiter(void 0, void 0, void 0, function () {
20552
+ var response;
20553
+ return __generator(this, function (_a) {
20554
+ switch (_a.label) {
20555
+ case 0:
20556
+ _a.trys.push([0, 2,, 3]);
20557
+ setError(null);
20558
+ return [4 /*yield*/, getGroupByID(id)];
20559
+ case 1:
20560
+ response = _a.sent();
20561
+ setGroupData(response.data);
20562
+ return [3 /*break*/, 3];
20563
+ case 2:
20564
+ _a.sent();
20565
+ setError('Failed to fetch group data. Please try again later.');
20566
+ return [3 /*break*/, 3];
20567
+ case 3:
20568
+ return [2 /*return*/];
20569
+ }
20437
20570
  });
20438
- };
20439
- fetchGroup();
20571
+ });
20440
20572
  }, [id, getGroupByID]);
20441
- if (loading) {
20442
- return /*#__PURE__*/React$1.createElement(View$2, {
20573
+ React.useEffect(function () {
20574
+ fetchGroup();
20575
+ }, [fetchGroup]);
20576
+ // Handle loading state
20577
+ if (!groupData && !error) {
20578
+ return /*#__PURE__*/React.createElement(View$2, {
20443
20579
  style: commonStyles.emptyContainer
20444
- }, /*#__PURE__*/React$1.createElement(Skeleton, null));
20580
+ }, /*#__PURE__*/React.createElement(Skeleton, null));
20445
20581
  }
20582
+ // Handle error state
20583
+ if (error) {
20584
+ return /*#__PURE__*/React.createElement(View$2, {
20585
+ style: commonStyles.emptyContainer
20586
+ }, /*#__PURE__*/React.createElement(Text, {
20587
+ variant: "body"
20588
+ }, error));
20589
+ }
20590
+ // Handle empty group data
20446
20591
  if (!groupData) {
20447
- return /*#__PURE__*/React$1.createElement(View$2, {
20592
+ return /*#__PURE__*/React.createElement(View$2, {
20448
20593
  style: commonStyles.emptyContainer
20449
- }, /*#__PURE__*/React$1.createElement(Text, {
20594
+ }, /*#__PURE__*/React.createElement(Text, {
20450
20595
  variant: "body"
20451
20596
  }, "No group data available"));
20452
20597
  }
20598
+ // Handle empty sections
20453
20599
  if (!groupData.sections || groupData.sections.length === 0) {
20454
- return /*#__PURE__*/React$1.createElement(View$2, {
20600
+ return /*#__PURE__*/React.createElement(View$2, {
20455
20601
  style: commonStyles.emptyContainer
20456
- }, /*#__PURE__*/React$1.createElement(Text, {
20602
+ }, /*#__PURE__*/React.createElement(Text, {
20457
20603
  variant: "body"
20458
20604
  }, "No sections available"));
20459
20605
  }
20460
20606
  var sortedSections = sortByPriority(groupData.sections);
20461
- return /*#__PURE__*/React$1.createElement(View$2, null, sortedSections.map(function (section) {
20462
- return /*#__PURE__*/React$1.createElement(Section, {
20607
+ return /*#__PURE__*/React.createElement(View$2, null, sortedSections.map(function (section) {
20608
+ return /*#__PURE__*/React.createElement(Section, {
20463
20609
  key: section.id,
20464
20610
  section: section
20465
20611
  });
@@ -20514,17 +20660,20 @@ var PointsTileFormattedPoints = function () {
20514
20660
  var styles = usePointsTileStyles();
20515
20661
  var configuration = useTileContext().configuration;
20516
20662
  var _a = configuration,
20517
- multiplier = _a.multiplier,
20518
- pointsPrefix = _a.pointsPrefix,
20519
- pointsSuffix = _a.pointsSuffix,
20663
+ _b = _a.multiplier,
20664
+ multiplier = _b === void 0 ? 1 : _b,
20665
+ _c = _a.pointsPrefix,
20666
+ pointsPrefix = _c === void 0 ? '' : _c,
20667
+ _d = _a.pointsSuffix,
20668
+ pointsSuffix = _d === void 0 ? 'pts' : _d,
20520
20669
  points = _a.points;
20521
- var calculatedPoints = points !== undefined ? points * (multiplier !== null && multiplier !== void 0 ? multiplier : 1) : null;
20522
- if (calculatedPoints === null) return null;
20523
- return /*#__PURE__*/React__namespace.createElement(Text, {
20670
+ if (points === undefined) return null;
20671
+ var calculatedPoints = points * multiplier;
20672
+ return /*#__PURE__*/React.createElement(Text, {
20524
20673
  variant: "caption"
20525
- }, pointsPrefix !== null && pointsPrefix !== void 0 ? pointsPrefix : '', /*#__PURE__*/React__namespace.createElement(Row, null, calculatedPoints, /*#__PURE__*/React__namespace.createElement(Text, {
20674
+ }, pointsPrefix, /*#__PURE__*/React.createElement(Row, null, calculatedPoints, /*#__PURE__*/React.createElement(Text, {
20526
20675
  style: styles.suffix
20527
- }, pointsSuffix !== null && pointsSuffix !== void 0 ? pointsSuffix : 'pts')));
20676
+ }, pointsSuffix)));
20528
20677
  };
20529
20678
 
20530
20679
  var PointsTileMedia = function (_a) {
@@ -20533,9 +20682,9 @@ var PointsTileMedia = function (_a) {
20533
20682
  var artworkUrl = configuration.artworkUrl;
20534
20683
  var styles = usePointsTileStyles(isFullSize);
20535
20684
  if (!artworkUrl) return null;
20536
- return /*#__PURE__*/React$1.createElement(View$2, {
20685
+ return /*#__PURE__*/React.createElement(View$2, {
20537
20686
  style: styles.imageContainer
20538
- }, /*#__PURE__*/React$1.createElement(Image$2, {
20687
+ }, /*#__PURE__*/React.createElement(Image$2, {
20539
20688
  source: {
20540
20689
  uri: artworkUrl
20541
20690
  },
@@ -20547,30 +20696,41 @@ var PointsTileMedia = function (_a) {
20547
20696
  var PointsTileTitle = function () {
20548
20697
  var configuration = useTileContext().configuration;
20549
20698
  var title = configuration.title;
20550
- return /*#__PURE__*/React$1.createElement(Text, {
20699
+ return title ? /*#__PURE__*/React.createElement(Text, {
20551
20700
  variant: "eyebrow"
20552
- }, title);
20701
+ }, title) : null;
20553
20702
  };
20554
20703
 
20555
- var PointsTile = function (_a) {
20704
+ /**
20705
+ * The PointsTile component renders a tile with media, title, and formatted points.
20706
+ *
20707
+ * @param tile - The tile data to render.
20708
+ */
20709
+ var PointsTileRoot = function (_a) {
20556
20710
  var tile = _a.tile;
20711
+ if (!tile) return null;
20557
20712
  var isFullSize = useTileSize(tile).isFullSize;
20558
20713
  var styles = usePointsTileStyles(isFullSize);
20559
- return /*#__PURE__*/React$1.createElement(BaseTile, {
20714
+ return /*#__PURE__*/React.createElement(BaseTile, {
20560
20715
  tile: tile
20561
- }, isFullSize && /*#__PURE__*/React$1.createElement(PointsTile.Media, {
20562
- isFullSize: isFullSize
20563
- }), /*#__PURE__*/React$1.createElement(View$2, {
20716
+ }, isFullSize && /*#__PURE__*/React.createElement(PointsTile.Media, {
20717
+ isFullSize: true
20718
+ }), /*#__PURE__*/React.createElement(View$2, {
20564
20719
  style: styles.container
20565
- }, !isFullSize && /*#__PURE__*/React$1.createElement(PointsTile.Media, {
20566
- isFullSize: isFullSize
20567
- }), /*#__PURE__*/React$1.createElement(View$2, {
20720
+ }, !isFullSize && /*#__PURE__*/React.createElement(PointsTile.Media, {
20721
+ isFullSize: false
20722
+ }), /*#__PURE__*/React.createElement(View$2, {
20568
20723
  style: styles.contentContainer
20569
- }, /*#__PURE__*/React$1.createElement(PointsTile.Title, null), /*#__PURE__*/React$1.createElement(PointsTile.Points, null))));
20724
+ }, /*#__PURE__*/React.createElement(PointsTile.Title, null), /*#__PURE__*/React.createElement(PointsTile.Points, null))));
20570
20725
  };
20571
- PointsTile.Title = PointsTileTitle;
20572
- PointsTile.Points = PointsTileFormattedPoints;
20573
- PointsTile.Media = PointsTileMedia;
20726
+ /**
20727
+ * The PointsTile component with subcomponents attached.
20728
+ */
20729
+ var PointsTile = Object.assign(PointsTileRoot, {
20730
+ Title: PointsTileTitle,
20731
+ Points: PointsTileFormattedPoints,
20732
+ Media: PointsTileMedia
20733
+ });
20574
20734
  var PointsTile$1 = withTileFetching(PointsTile);
20575
20735
 
20576
20736
  var useRewardCategoryTileStyles = function () {
@@ -20612,11 +20772,11 @@ var RewardCategoryHeader = function () {
20612
20772
  showName = _a.showName,
20613
20773
  name = _a.name;
20614
20774
  if (!showName || !name) return null;
20615
- return /*#__PURE__*/React$1.createElement(View$2, {
20775
+ return /*#__PURE__*/React.createElement(View$2, {
20616
20776
  style: [styles.header, {
20617
20777
  backgroundColor: theme.primary
20618
20778
  }]
20619
- }, /*#__PURE__*/React$1.createElement(Text, {
20779
+ }, /*#__PURE__*/React.createElement(Text, {
20620
20780
  style: [styles.headerText, {
20621
20781
  color: theme.primaryText
20622
20782
  }],
@@ -20630,7 +20790,7 @@ var RewardCategoryMedia = function () {
20630
20790
  var configuration = useTileContext().configuration;
20631
20791
  var artworkUrl = configuration.artworkUrl;
20632
20792
  if (!artworkUrl) return null;
20633
- return /*#__PURE__*/React$1.createElement(ProgressiveImage, {
20793
+ return /*#__PURE__*/React.createElement(ProgressiveImage, {
20634
20794
  source: {
20635
20795
  uri: artworkUrl
20636
20796
  },
@@ -20638,20 +20798,30 @@ var RewardCategoryMedia = function () {
20638
20798
  });
20639
20799
  };
20640
20800
 
20641
- var RewardCategoryTile = function (_a) {
20801
+ /**
20802
+ * The RewardCategoryTile component renders a tile with a header and media.
20803
+ *
20804
+ * @param tile - The tile data to render.
20805
+ */
20806
+ var RewardCategoryTileRoot = function (_a) {
20642
20807
  var tile = _a.tile;
20643
20808
  if (!tile) return null;
20644
- return /*#__PURE__*/React__namespace.createElement(BaseTile, {
20809
+ return /*#__PURE__*/React.createElement(BaseTile, {
20645
20810
  tile: tile
20646
- }, /*#__PURE__*/React__namespace.createElement(RewardCategoryTile.Header, null), /*#__PURE__*/React__namespace.createElement(RewardCategoryTile.Media, null));
20811
+ }, /*#__PURE__*/React.createElement(RewardCategoryTile.Header, null), /*#__PURE__*/React.createElement(RewardCategoryTile.Media, null));
20647
20812
  };
20648
- RewardCategoryTile.Header = RewardCategoryHeader;
20649
- RewardCategoryTile.Media = RewardCategoryMedia;
20813
+ /**
20814
+ * The RewardCategoryTile component with subcomponents attached.
20815
+ */
20816
+ var RewardCategoryTile = Object.assign(RewardCategoryTileRoot, {
20817
+ Header: RewardCategoryHeader,
20818
+ Media: RewardCategoryMedia
20819
+ });
20650
20820
  var RewardCategoryTile$1 = withTileFetching(RewardCategoryTile);
20651
20821
 
20652
20822
  var RewardTileChevron = function () {
20653
20823
  var theme = useWllSdk().theme;
20654
- return /*#__PURE__*/React$1.createElement(Icon, {
20824
+ return /*#__PURE__*/React.createElement(Icon, {
20655
20825
  name: "ChevronRight",
20656
20826
  color: theme.derivedSurfaceText[20]
20657
20827
  });
@@ -20692,6 +20862,9 @@ var useRewardTileStyles = function () {
20692
20862
  suffix: {
20693
20863
  color: theme.primary,
20694
20864
  fontSize: useResponsiveValue(theme.sizes.xl, theme.sizes.md, isDesktop, isTablet)
20865
+ },
20866
+ header: {
20867
+ marginBottom: useResponsiveValue(theme.sizes.xxs, theme.sizes.xxxs, isDesktop, isTablet)
20695
20868
  }
20696
20869
  });
20697
20870
  };
@@ -20711,9 +20884,9 @@ var RewardTileMedia = function (_a) {
20711
20884
  return (
20712
20885
  /*#__PURE__*/
20713
20886
  // @ts-ignore: We are using percentage values for flexBasis, which is valid in React Native but TypeScript expects a number.
20714
- React$1.createElement(View$2, {
20887
+ React.createElement(View$2, {
20715
20888
  style: [styles.imageContainer, containerStyle]
20716
- }, /*#__PURE__*/React$1.createElement(ProgressiveImage, {
20889
+ }, /*#__PURE__*/React.createElement(ProgressiveImage, {
20717
20890
  source: {
20718
20891
  uri: artworkUrl
20719
20892
  },
@@ -20728,17 +20901,22 @@ var RewardTilePoints = function () {
20728
20901
  var _a = configuration,
20729
20902
  showPrice = _a.showPrice,
20730
20903
  price = _a.price,
20731
- pointsMultiplier = _a.pointsMultiplier,
20732
- pointsPrefix = _a.pointsPrefix,
20733
- pointsSuffix = _a.pointsSuffix;
20734
- var calculatedPoints = price !== undefined ? price * (Number(pointsMultiplier) || 1) : null;
20735
- if (!showPrice || calculatedPoints === null) return null;
20736
- return /*#__PURE__*/React$1.createElement(Text, {
20904
+ _b = _a.pointsMultiplier,
20905
+ pointsMultiplier = _b === void 0 ? 1 : _b,
20906
+ _c = _a.pointsPrefix,
20907
+ pointsPrefix = _c === void 0 ? '' : _c,
20908
+ _d = _a.pointsSuffix,
20909
+ pointsSuffix = _d === void 0 ? 'pts' : _d;
20910
+ // Exit early if price is not shown or undefined
20911
+ if (!showPrice || price === undefined) return null;
20912
+ // Calculate points
20913
+ var calculatedPoints = price * Number(pointsMultiplier);
20914
+ return /*#__PURE__*/React.createElement(Text, {
20737
20915
  variant: "caption",
20738
20916
  style: styles.footer
20739
- }, pointsPrefix, /*#__PURE__*/React$1.createElement(View$2, {
20917
+ }, pointsPrefix, /*#__PURE__*/React.createElement(View$2, {
20740
20918
  style: styles.pointsContainer
20741
- }, calculatedPoints, /*#__PURE__*/React$1.createElement(Text, {
20919
+ }, calculatedPoints, /*#__PURE__*/React.createElement(Text, {
20742
20920
  style: styles.suffix
20743
20921
  }, pointsSuffix)));
20744
20922
  };
@@ -20747,7 +20925,7 @@ var RewardTileSummary = function () {
20747
20925
  var configuration = useTileContext().configuration;
20748
20926
  var summary = configuration.summary;
20749
20927
  if (!summary) return null;
20750
- return /*#__PURE__*/React$1.createElement(Text, {
20928
+ return /*#__PURE__*/React.createElement(Text, {
20751
20929
  variant: "body"
20752
20930
  }, summary);
20753
20931
  };
@@ -20756,33 +20934,217 @@ var RewardTileTitle = function () {
20756
20934
  var configuration = useTileContext().configuration;
20757
20935
  var name = configuration.name;
20758
20936
  if (!name) return null;
20759
- return /*#__PURE__*/React$1.createElement(Text, {
20937
+ return /*#__PURE__*/React.createElement(Text, {
20760
20938
  variant: "title",
20761
20939
  ellipsizeMode: "tail",
20762
20940
  numberOfLines: 1
20763
20941
  }, name);
20764
20942
  };
20765
20943
 
20766
- var RewardTile = function (_a) {
20944
+ /**
20945
+ * Helper function to determine if the tile should display artwork only.
20946
+ *
20947
+ * @param configuration - The configuration object of the tile.
20948
+ * @returns `true` if the tile should display artwork only.
20949
+ */
20950
+ var isArtworkOnly = function (configuration) {
20951
+ return !configuration.showDetails;
20952
+ };
20953
+ /**
20954
+ * The RewardTile component renders a tile with media, title, summary, points, and a chevron.
20955
+ *
20956
+ * @param tile - The tile data to render.
20957
+ */
20958
+ var RewardTileRoot = function (_a) {
20767
20959
  var tile = _a.tile;
20960
+ var styles = useRewardTileStyles();
20961
+ if (!tile) return null;
20768
20962
  var configuration = tile.configuration;
20769
- var showDetails = configuration.showDetails;
20770
- return /*#__PURE__*/React$1.createElement(BaseTile, {
20963
+ return /*#__PURE__*/React.createElement(BaseTile, {
20771
20964
  tile: tile
20772
- }, /*#__PURE__*/React$1.createElement(RewardTile.Media, {
20773
- isArtworkOnly: !showDetails
20774
- }), /*#__PURE__*/React$1.createElement(Column, null, /*#__PURE__*/React$1.createElement(Row, {
20965
+ }, /*#__PURE__*/React.createElement(RewardTile.Media, {
20966
+ isArtworkOnly: isArtworkOnly(configuration)
20967
+ }), /*#__PURE__*/React.createElement(Column, null, /*#__PURE__*/React.createElement(Row, {
20775
20968
  justify: "between",
20776
- align: "center"
20777
- }, /*#__PURE__*/React$1.createElement(RewardTile.Title, null), /*#__PURE__*/React$1.createElement(RewardTile.Chevron, null)), /*#__PURE__*/React$1.createElement(RewardTile.Summary, null), /*#__PURE__*/React$1.createElement(RewardTile.Points, null)));
20969
+ align: "center",
20970
+ style: styles.header
20971
+ }, /*#__PURE__*/React.createElement(RewardTile.Title, null), /*#__PURE__*/React.createElement(RewardTile.Chevron, null)), /*#__PURE__*/React.createElement(RewardTile.Summary, null), /*#__PURE__*/React.createElement(RewardTile.Points, null)));
20778
20972
  };
20779
- RewardTile.Media = RewardTileMedia;
20780
- RewardTile.Title = RewardTileTitle;
20781
- RewardTile.Summary = RewardTileSummary;
20782
- RewardTile.Points = RewardTilePoints;
20783
- RewardTile.Chevron = RewardTileChevron;
20973
+ /**
20974
+ * The RewardTile component with subcomponents attached.
20975
+ */
20976
+ var RewardTile = Object.assign(RewardTileRoot, {
20977
+ Media: RewardTileMedia,
20978
+ Title: RewardTileTitle,
20979
+ Summary: RewardTileSummary,
20980
+ Points: RewardTilePoints,
20981
+ Chevron: RewardTileChevron
20982
+ });
20784
20983
  var RewardTile$1 = withTileFetching(RewardTile);
20785
20984
 
20985
+ var justifyMap = {
20986
+ start: 'flex-start',
20987
+ end: 'flex-end',
20988
+ center: 'center',
20989
+ between: 'space-between',
20990
+ around: 'space-around',
20991
+ evenly: 'space-evenly'
20992
+ };
20993
+ var alignMap = {
20994
+ start: 'flex-start',
20995
+ end: 'flex-end',
20996
+ center: 'center',
20997
+ stretch: 'stretch',
20998
+ baseline: 'baseline'
20999
+ };
21000
+
21001
+ /**
21002
+ * A Column layout component that arranges its children in a vertical stack.
21003
+ *
21004
+ * @param children - The child components to render inside the column.
21005
+ * @param justify - Defines how children are aligned along the main axis.
21006
+ * @param align - Defines how children are aligned along the cross axis.
21007
+ * @param style - Additional styles to apply to the container.
21008
+ */
21009
+ var Column = /*#__PURE__*/React.memo(function (_a) {
21010
+ var _b, _c;
21011
+ var children = _a.children,
21012
+ _d = _a.justify,
21013
+ justify = _d === void 0 ? 'start' : _d,
21014
+ _e = _a.align,
21015
+ align = _e === void 0 ? 'stretch' : _e,
21016
+ style = _a.style;
21017
+ var _f = useResponsive$1(),
21018
+ isDesktop = _f.isDesktop,
21019
+ isTablet = _f.isTablet;
21020
+ var theme = useWllSdk().theme;
21021
+ var spacing = useResponsiveValue((_b = theme === null || theme === void 0 ? void 0 : theme.sizes) === null || _b === void 0 ? void 0 : _b.sm, (_c = theme === null || theme === void 0 ? void 0 : theme.sizes) === null || _c === void 0 ? void 0 : _c.xxxs, isDesktop, isTablet);
21022
+ return /*#__PURE__*/React.createElement(View$2, {
21023
+ style: [{
21024
+ flex: 1,
21025
+ flexDirection: 'column',
21026
+ justifyContent: justifyMap[justify],
21027
+ alignItems: alignMap[align],
21028
+ paddingHorizontal: spacing,
21029
+ paddingBottom: spacing
21030
+ }, style]
21031
+ }, children);
21032
+ });
21033
+
21034
+ /**
21035
+ * A FlexBox component that provides a flexible container with `flex: 1`.
21036
+ *
21037
+ * This component is commonly used to create a full-flex container that expands
21038
+ * to fill available space in a layout.
21039
+ */
21040
+ var FlexBox = function (_a) {
21041
+ var children = _a.children,
21042
+ style = _a.style;
21043
+ return /*#__PURE__*/React.createElement(View$2, {
21044
+ style: [{
21045
+ flex: 1
21046
+ }, style]
21047
+ }, children);
21048
+ };
21049
+
21050
+ var Layout = function (_a) {
21051
+ var children = _a.children,
21052
+ _b = _a.justify,
21053
+ justify = _b === void 0 ? 'start' : _b,
21054
+ _c = _a.align,
21055
+ align = _c === void 0 ? 'stretch' : _c,
21056
+ _d = _a.direction,
21057
+ direction = _d === void 0 ? 'column' : _d,
21058
+ _e = _a.style,
21059
+ style = _e === void 0 ? {} : _e;
21060
+ var theme = useWllSdk().theme;
21061
+ var _f = useResponsive$1(),
21062
+ isDesktop = _f.isDesktop,
21063
+ isTablet = _f.isTablet;
21064
+ var dynamicStyles = StyleSheet$1.create({
21065
+ column: {
21066
+ flex: 1,
21067
+ paddingHorizontal: useResponsiveValue(theme.sizes.sm, theme.sizes.xxs, isDesktop, isTablet),
21068
+ paddingBottom: useResponsiveValue(theme.sizes.sm, theme.sizes.xxs, isDesktop, isTablet),
21069
+ justifyContent: justifyMap[justify],
21070
+ alignItems: alignMap[align],
21071
+ flexDirection: direction
21072
+ }
21073
+ });
21074
+ return /*#__PURE__*/React__namespace.createElement(View$2, {
21075
+ style: [dynamicStyles.column, style]
21076
+ }, children);
21077
+ };
21078
+
21079
+ /**
21080
+ * A Row layout component that arranges its children in a horizontal stack.
21081
+ *
21082
+ * @param children - The child components to render inside the row.
21083
+ * @param justify - Defines how children are aligned along the main axis (horizontal).
21084
+ * @param align - Defines how children are aligned along the cross axis (vertical).
21085
+ * @param direction - The flex direction for the row (default is 'row').
21086
+ * @param style - Additional styles to apply to the container.
21087
+ */
21088
+ var Row = function (_a) {
21089
+ var children = _a.children,
21090
+ _b = _a.justify,
21091
+ justify = _b === void 0 ? 'start' : _b,
21092
+ _c = _a.align,
21093
+ align = _c === void 0 ? 'center' : _c,
21094
+ _d = _a.direction,
21095
+ direction = _d === void 0 ? 'row' : _d,
21096
+ style = _a.style;
21097
+ return /*#__PURE__*/React.createElement(View$2, {
21098
+ style: [{
21099
+ flexDirection: direction,
21100
+ justifyContent: justifyMap[justify],
21101
+ alignItems: alignMap[align]
21102
+ }, style]
21103
+ }, children);
21104
+ };
21105
+
21106
+ /**
21107
+ * A simple Spacer component that creates flexible space in layouts.
21108
+ *
21109
+ * The Spacer is commonly used in flexbox layouts to create adjustable empty space
21110
+ * between child elements, avoiding the need for explicit margins or padding.
21111
+ */
21112
+ var Spacer = function (_a) {
21113
+ var style = _a.style;
21114
+ return /*#__PURE__*/React.createElement(View$2, {
21115
+ style: [{
21116
+ flex: 1
21117
+ }, style]
21118
+ });
21119
+ };
21120
+
21121
+ /**
21122
+ * A Stack layout component that arranges its children in a flexible stack.
21123
+ *
21124
+ * @param children - The child components to render inside the stack.
21125
+ * @param justify - Defines how children are aligned along the main axis.
21126
+ * @param align - Defines how children are aligned along the cross axis.
21127
+ * @param direction - The flex direction for the stack (default is 'column').
21128
+ * @param style - Additional styles to apply to the container.
21129
+ */
21130
+ var Stack = function (_a) {
21131
+ var children = _a.children,
21132
+ _b = _a.justify,
21133
+ justify = _b === void 0 ? 'start' : _b,
21134
+ _c = _a.align,
21135
+ align = _c === void 0 ? 'stretch' : _c,
21136
+ _d = _a.direction,
21137
+ direction = _d === void 0 ? 'column' : _d,
21138
+ style = _a.style;
21139
+ return /*#__PURE__*/React.createElement(View$2, {
21140
+ style: [{
21141
+ flexDirection: direction,
21142
+ justifyContent: justifyMap[justify],
21143
+ alignItems: alignMap[align]
21144
+ }, style]
21145
+ }, children);
21146
+ };
21147
+
20786
21148
  var useTierTileStyles = function () {
20787
21149
  var _a = useResponsive$1(),
20788
21150
  isDesktop = _a.isDesktop,
@@ -20817,6 +21179,11 @@ var useTierTileStyles = function () {
20817
21179
  width: '100%',
20818
21180
  height: '100%',
20819
21181
  resizeMode: 'cover'
21182
+ },
21183
+ name: {
21184
+ marginBottom: 0,
21185
+ numberOfLines: 1,
21186
+ ellipsizeMode: 'tail'
20820
21187
  }
20821
21188
  });
20822
21189
  };
@@ -20858,7 +21225,7 @@ var TierTileFull = function (_a) {
20858
21225
  },
20859
21226
  style: styles.image,
20860
21227
  resizeMode: "center"
20861
- })), /*#__PURE__*/React__namespace.createElement(Column$1, {
21228
+ })), /*#__PURE__*/React__namespace.createElement(Layout, {
20862
21229
  align: "stretch",
20863
21230
  justify: artworkUrl ? 'start' : 'center',
20864
21231
  direction: "column"
@@ -20884,19 +21251,25 @@ var TierTileHalf = function (_a) {
20884
21251
  name = _c.name;
20885
21252
  return /*#__PURE__*/React__namespace.createElement(BaseTile, {
20886
21253
  tile: tile
20887
- }, /*#__PURE__*/React__namespace.createElement(Column$1, {
21254
+ }, /*#__PURE__*/React__namespace.createElement(Layout, {
20888
21255
  align: "center",
20889
21256
  justify: "between",
20890
21257
  direction: "row",
20891
21258
  style: {
20892
21259
  paddingTop: 16
20893
21260
  }
20894
- }, /*#__PURE__*/React__namespace.createElement(View$2, null, title && /*#__PURE__*/React__namespace.createElement(Text, {
21261
+ }, /*#__PURE__*/React__namespace.createElement(View$2, {
21262
+ style: {
21263
+ flex: 1,
21264
+ flexShrink: 1
21265
+ }
21266
+ }, title && /*#__PURE__*/React__namespace.createElement(Text, {
20895
21267
  variant: "eyebrow",
20896
21268
  style: styles.title
20897
21269
  }, title), name && /*#__PURE__*/React__namespace.createElement(Text, {
20898
21270
  variant: "title",
20899
- style: styles.title
21271
+ style: styles.name,
21272
+ numberOfLines: 2
20900
21273
  }, name)), artworkUrl && /*#__PURE__*/React__namespace.createElement(View$2, {
20901
21274
  style: styles.smallImageContainer
20902
21275
  }, /*#__PURE__*/React__namespace.createElement(Image$2, {
@@ -20919,14 +21292,14 @@ var TierTileEmpty = function (_a) {
20919
21292
  if (isHalfSize) {
20920
21293
  return /*#__PURE__*/React__namespace.createElement(BaseTile, {
20921
21294
  tile: tile
20922
- }, /*#__PURE__*/React__namespace.createElement(Column$1, {
21295
+ }, /*#__PURE__*/React__namespace.createElement(Layout, {
20923
21296
  align: "center",
20924
21297
  justify: "between",
20925
21298
  direction: "row",
20926
21299
  style: {
20927
21300
  paddingTop: 16
20928
21301
  }
20929
- }, /*#__PURE__*/React__namespace.createElement(View$2, {
21302
+ }, /*#__PURE__*/React__namespace.createElement(Column, {
20930
21303
  style: {
20931
21304
  flex: 1
20932
21305
  }
@@ -20935,7 +21308,7 @@ var TierTileEmpty = function (_a) {
20935
21308
  style: styles.title
20936
21309
  }, title), emptyDescription && /*#__PURE__*/React__namespace.createElement(Text, {
20937
21310
  variant: "body"
20938
- }, emptyDescription)), emptyArtworkUrl && /*#__PURE__*/React__namespace.createElement(View$2, {
21311
+ }, emptyDescription)), emptyArtworkUrl && /*#__PURE__*/React__namespace.createElement(Column, {
20939
21312
  style: styles.smallImageContainer
20940
21313
  }, /*#__PURE__*/React__namespace.createElement(Image$2, {
20941
21314
  source: {
@@ -20955,11 +21328,11 @@ var TierTileEmpty = function (_a) {
20955
21328
  },
20956
21329
  style: styles.image,
20957
21330
  resizeMode: "center"
20958
- })), /*#__PURE__*/React__namespace.createElement(Column$1, {
21331
+ })), /*#__PURE__*/React__namespace.createElement(Layout, {
20959
21332
  align: "stretch",
20960
21333
  justify: "center",
20961
21334
  direction: "column"
20962
- }, /*#__PURE__*/React__namespace.createElement(View$2, null, title && /*#__PURE__*/React__namespace.createElement(Text, {
21335
+ }, /*#__PURE__*/React__namespace.createElement(Column, null, title && /*#__PURE__*/React__namespace.createElement(Text, {
20963
21336
  variant: "title",
20964
21337
  style: styles.title
20965
21338
  }, title), emptyDescription && /*#__PURE__*/React__namespace.createElement(Text, {
@@ -20971,46 +21344,26 @@ TierTile.Full = TierTileFull;
20971
21344
  TierTile.Half = TierTileHalf;
20972
21345
  TierTile.Empty = TierTileEmpty;
20973
21346
 
21347
+ var _a;
21348
+ var TILE_COMPONENTS = (_a = {}, _a[exports.TileType.Content] = ContentTile$1, _a[exports.TileType.Badge] = BadgeTile$1, _a[exports.TileType.Tier] = TierTile, _a[exports.TileType.Points] = PointsTile$1, _a[exports.TileType.Reward] = RewardTile$1, _a[exports.TileType.RewardCategory] = RewardCategoryTile$1, _a[exports.TileType.Banner] = BannerTile$1, _a);
21349
+ /**
21350
+ * TileContainer component to render a list of tiles with proper layout and spacing.
21351
+ */
20974
21352
  var TileContainer = function (_a) {
20975
21353
  var tiles = _a.tiles;
20976
- var renderTile = function (tile) {
20977
- switch (tile.type) {
20978
- case exports.TileType.Content:
20979
- return /*#__PURE__*/React__namespace.createElement(ContentTile$1, {
20980
- tile: tile
20981
- });
20982
- case exports.TileType.Badge:
20983
- return /*#__PURE__*/React__namespace.createElement(BadgeTile$1, {
20984
- tile: tile
20985
- });
20986
- case exports.TileType.Tier:
20987
- return /*#__PURE__*/React__namespace.createElement(TierTile, {
20988
- tile: tile
20989
- });
20990
- case exports.TileType.Points:
20991
- return /*#__PURE__*/React__namespace.createElement(PointsTile$1, {
20992
- tile: tile
20993
- });
20994
- case exports.TileType.Reward:
20995
- return /*#__PURE__*/React__namespace.createElement(RewardTile$1, {
20996
- tile: tile
20997
- });
20998
- case exports.TileType.RewardCategory:
20999
- return /*#__PURE__*/React__namespace.createElement(RewardCategoryTile$1, {
21000
- tile: tile
21001
- });
21002
- }
21003
- };
21004
- return /*#__PURE__*/React__namespace.createElement(View$2, {
21354
+ return /*#__PURE__*/React.createElement(View$2, {
21005
21355
  style: styles.container
21006
21356
  }, tiles.map(function (tile, index) {
21007
- var isHalfTile = tile.tileHeight === exports.TileHeight.Half;
21008
- return /*#__PURE__*/React__namespace.createElement(View$2, {
21357
+ var TileComponent = TILE_COMPONENTS[tile.type];
21358
+ var isHalfSize = useTileSize(tile).isHalfSize;
21359
+ return /*#__PURE__*/React.createElement(View$2, {
21009
21360
  key: tile.id,
21010
- style: [styles.tileContainer, isHalfTile && styles.halfTileContainer, index > 0 && {
21361
+ style: [styles.tileContainer, isHalfSize && styles.halfTileContainer, index > 0 && {
21011
21362
  marginTop: GRID_GAP
21012
21363
  }]
21013
- }, renderTile(tile));
21364
+ }, TileComponent ? /*#__PURE__*/React.createElement(TileComponent, {
21365
+ tile: tile
21366
+ }) : null);
21014
21367
  }));
21015
21368
  };
21016
21369
  var styles = StyleSheet$1.create({
@@ -21029,90 +21382,6 @@ var styles = StyleSheet$1.create({
21029
21382
  }
21030
21383
  });
21031
21384
 
21032
- var Column = function (_a) {
21033
- var children = _a.children,
21034
- _b = _a.justify,
21035
- justify = _b === void 0 ? 'start' : _b,
21036
- _c = _a.align,
21037
- align = _c === void 0 ? 'stretch' : _c,
21038
- style = _a.style;
21039
- var _d = useResponsive$1(),
21040
- isDesktop = _d.isDesktop,
21041
- isTablet = _d.isTablet;
21042
- var theme = useWllSdk().theme;
21043
- return /*#__PURE__*/React$1.createElement(View$2, {
21044
- style: [{
21045
- flex: 1,
21046
- flexDirection: 'column',
21047
- justifyContent: justifyMap[justify],
21048
- alignItems: alignMap[align],
21049
- paddingHorizontal: useResponsiveValue(theme.sizes.sm, theme.sizes.xxs, isDesktop, isTablet),
21050
- paddingBottom: useResponsiveValue(theme.sizes.sm, theme.sizes.xxs, isDesktop, isTablet)
21051
- }, style]
21052
- }, children);
21053
- };
21054
-
21055
- var Row = function (_a) {
21056
- var children = _a.children,
21057
- _b = _a.justify,
21058
- justify = _b === void 0 ? 'start' : _b,
21059
- _c = _a.align,
21060
- align = _c === void 0 ? 'center' : _c,
21061
- _d = _a.direction,
21062
- direction = _d === void 0 ? 'row' : _d,
21063
- style = _a.style;
21064
- return /*#__PURE__*/React$1.createElement(View$2, {
21065
- style: [{
21066
- flexDirection: direction,
21067
- justifyContent: justifyMap[justify],
21068
- alignItems: alignMap[align]
21069
- }, style]
21070
- }, children);
21071
- };
21072
-
21073
- var FlexBox = function (_a) {
21074
- var children = _a.children;
21075
- return /*#__PURE__*/React$1.createElement(View$2, {
21076
- style: {
21077
- flex: 1
21078
- }
21079
- }, children);
21080
- };
21081
-
21082
- var Stack = function (_a) {
21083
- var children = _a.children,
21084
- _b = _a.justify,
21085
- justify = _b === void 0 ? 'start' : _b,
21086
- _c = _a.align,
21087
- align = _c === void 0 ? 'stretch' : _c,
21088
- _d = _a.direction,
21089
- direction = _d === void 0 ? 'column' : _d,
21090
- style = _a.style;
21091
- return /*#__PURE__*/React.createElement(View$2, {
21092
- style: [{
21093
- flexDirection: direction,
21094
- justifyContent: justifyMap[justify],
21095
- alignItems: alignMap[align]
21096
- }, style]
21097
- }, children);
21098
- };
21099
-
21100
- var justifyMap = {
21101
- start: 'flex-start',
21102
- end: 'flex-end',
21103
- center: 'center',
21104
- between: 'space-between',
21105
- around: 'space-around',
21106
- evenly: 'space-evenly'
21107
- };
21108
- var alignMap = {
21109
- start: 'flex-start',
21110
- end: 'flex-end',
21111
- center: 'center',
21112
- stretch: 'stretch',
21113
- baseline: 'baseline'
21114
- };
21115
-
21116
21385
  var Reward = /** @class */function () {
21117
21386
  function Reward() {}
21118
21387
  return Reward;
@@ -21127,7 +21396,6 @@ exports.BaseTile = BaseTile;
21127
21396
  exports.Button = Button;
21128
21397
  exports.Carousel = Carousel;
21129
21398
  exports.Column = Column;
21130
- exports.Content = Column$1;
21131
21399
  exports.ContentTile = ContentTile$1;
21132
21400
  exports.ContentTileConfig = ContentTileConfig;
21133
21401
  exports.FlexBox = FlexBox;
@@ -21151,11 +21419,14 @@ exports.RowHeader = RowHeader;
21151
21419
  exports.Section = Section;
21152
21420
  exports.SectionHeader = SectionHeader;
21153
21421
  exports.Skeleton = Skeleton;
21422
+ exports.Spacer = Spacer;
21154
21423
  exports.Stack = Stack;
21155
21424
  exports.Text = Text;
21156
21425
  exports.TierTileConfig = TierTileConfig;
21157
21426
  exports.TierTileUpdated = TierTile;
21158
21427
  exports.TileContainer = TileContainer;
21159
21428
  exports.WllSdkProvider = WllSdkProvider;
21429
+ exports.alignMap = alignMap;
21430
+ exports.justifyMap = justifyMap;
21160
21431
  exports.useWllSdk = useWllSdk;
21161
21432
  //# sourceMappingURL=index.js.map