@zezosoft/zezo-ott-react-native-ui-kit 1.3.1 → 1.3.3

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.
@@ -1,442 +1,193 @@
1
1
  "use strict";
2
2
 
3
- /**
4
- * @author Naresh Dhamu
5
- * @lastModified Mon 21 Jul 2025 at 04:55 PM
6
- */
7
-
8
- import React, { memo, useCallback, useMemo, useState } from 'react';
9
- import { View, StyleSheet, TouchableOpacity, ActivityIndicator, ScrollView, Dimensions } from 'react-native';
3
+ import { memo, useCallback } from 'react';
4
+ import { View, StyleSheet, TouchableOpacity, ActivityIndicator, Dimensions, ScrollView } from 'react-native';
10
5
  import Carousel from 'react-native-reanimated-carousel';
11
- import { scale, verticalScale, moderateScale } from 'react-native-size-matters';
12
- import LinearGradient from 'react-native-linear-gradient';
13
- import SkeletonPlaceholder from 'react-native-skeleton-placeholder';
14
- import Animated, { FadeIn, FadeOut } from 'react-native-reanimated';
15
- import Modal from 'react-native-modal';
16
- import { X } from 'lucide-react-native';
6
+ import { scale, verticalScale } from 'react-native-size-matters';
17
7
  import { Text } from "../Text/index.js";
18
8
  import AppHeader from "../Headers/AppHeader.js";
19
9
  import { useInternalTheme } from "../../theme/hook/useInternalTheme.js";
20
- import Display from "../../utils/Display.js";
21
10
  import { RFValue } from 'react-native-responsive-fontsize';
22
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
23
- // Memoized Plan Details Modal Component
24
- const PlanDetailsModalContent = /*#__PURE__*/memo(({
25
- plan,
26
- colors,
27
- onClose
28
- }) => {
29
- const modalContentStyle = useMemo(() => [styles.modalContent, {
30
- backgroundColor: colors.surface
31
- }], [colors.surface]);
32
- const modalTitleStyle = useMemo(() => [styles.modalTitle, {
33
- color: colors.textPrimary
34
- }], [colors.textPrimary]);
35
- const modalCloseButtonStyle = useMemo(() => [styles.modalCloseButton, {
36
- backgroundColor: colors.background
37
- }], [colors.background]);
38
- const priceHighlightBoxStyle = useMemo(() => [styles.priceHighlightBox, {
39
- backgroundColor: colors.background
40
- }], [colors.background]);
41
- const platformBadgeStyle = useMemo(() => [styles.platformBadge, {
42
- backgroundColor: colors.surface,
43
- borderColor: colors.primary
44
- }], [colors.surface, colors.primary]);
45
- const modalPriceLabelStyle = useMemo(() => [styles.modalPriceLabel, {
46
- color: colors.textSecondary
47
- }], [colors.textSecondary]);
48
- const modalPriceValueStyle = useMemo(() => [styles.modalPriceValue, {
49
- color: colors.primary
50
- }], [colors.primary]);
51
- const modalPriceDurationStyle = useMemo(() => [styles.modalPriceDuration, {
52
- color: colors.textSecondary
53
- }], [colors.textSecondary]);
54
- const modalSectionTitleStyle = useMemo(() => [styles.modalSectionTitle, {
55
- color: colors.textPrimary
56
- }], [colors.textPrimary]);
57
- const platformBadgeTextStyle = useMemo(() => [styles.platformBadgeText, {
58
- color: colors.textPrimary
59
- }], [colors.textPrimary]);
60
- const benefitBulletStyle = useMemo(() => [styles.benefitBullet, {
61
- color: colors.primary
62
- }], [colors.primary]);
63
- const benefitTextStyle = useMemo(() => [styles.benefitText, {
64
- color: colors.textSecondary
65
- }], [colors.textSecondary]);
66
- const modalSectionValueStyle = useMemo(() => [styles.modalSectionValue, {
67
- color: colors.textSecondary
68
- }], [colors.textSecondary]);
69
- return /*#__PURE__*/_jsxs(View, {
70
- style: modalContentStyle,
71
- children: [/*#__PURE__*/_jsxs(View, {
72
- style: styles.modalHeader,
73
- children: [/*#__PURE__*/_jsx(Text, {
74
- style: modalTitleStyle,
75
- children: plan.title || 'Plan Details'
76
- }), /*#__PURE__*/_jsx(TouchableOpacity, {
77
- onPress: onClose,
78
- style: modalCloseButtonStyle,
79
- activeOpacity: 0.7,
80
- children: /*#__PURE__*/_jsx(X, {
81
- size: scale(20),
82
- color: colors.textPrimary
83
- })
84
- })]
85
- }), /*#__PURE__*/_jsxs(ScrollView, {
86
- style: styles.modalScrollView,
87
- contentContainerStyle: styles.modalScrollContent,
88
- showsVerticalScrollIndicator: false,
89
- bounces: false,
90
- scrollEventThrottle: 16,
91
- keyboardShouldPersistTaps: "handled",
92
- removeClippedSubviews: false,
93
- nestedScrollEnabled: true,
94
- children: [/*#__PURE__*/_jsx(View, {
95
- style: [styles.modalSection, styles.modalFirstSection],
96
- children: /*#__PURE__*/_jsxs(View, {
97
- style: priceHighlightBoxStyle,
98
- children: [/*#__PURE__*/_jsx(Text, {
99
- style: modalPriceLabelStyle,
100
- children: "PRICING"
101
- }), /*#__PURE__*/_jsx(Text, {
102
- style: modalPriceValueStyle,
103
- children: plan.price
104
- }), /*#__PURE__*/_jsxs(Text, {
105
- style: modalPriceDurationStyle,
106
- children: ["per ", plan.duration]
107
- })]
108
- })
109
- }), /*#__PURE__*/_jsxs(View, {
110
- style: styles.modalSection,
111
- children: [/*#__PURE__*/_jsx(Text, {
112
- style: modalSectionTitleStyle,
113
- children: "Available On"
114
- }), /*#__PURE__*/_jsx(View, {
115
- style: platformBadgeStyle,
116
- children: /*#__PURE__*/_jsx(Text, {
117
- style: platformBadgeTextStyle,
118
- children: plan.platforms
119
- })
120
- })]
121
- }), plan.benefits && plan.benefits.length > 0 && /*#__PURE__*/_jsxs(View, {
122
- style: styles.modalSection,
123
- children: [/*#__PURE__*/_jsx(Text, {
124
- style: modalSectionTitleStyle,
125
- children: "Benefits"
126
- }), plan.benefits.map((benefit, index) => /*#__PURE__*/_jsxs(View, {
127
- style: styles.benefitRow,
128
- children: [/*#__PURE__*/_jsx(Text, {
129
- style: benefitBulletStyle,
130
- children: "\u2022"
131
- }), /*#__PURE__*/_jsx(Text, {
132
- style: benefitTextStyle,
133
- children: benefit
134
- })]
135
- }, `benefit-${plan.id}-${index}`))]
136
- }), plan.extraDetails?.description && /*#__PURE__*/_jsxs(View, {
137
- style: styles.modalSection,
138
- children: [/*#__PURE__*/_jsx(Text, {
139
- style: modalSectionTitleStyle,
140
- children: "Description"
141
- }), /*#__PURE__*/_jsx(Text, {
142
- style: modalSectionValueStyle,
143
- children: plan.extraDetails.description
144
- })]
145
- }), plan.extraDetails?.features && plan.extraDetails.features.length > 0 && /*#__PURE__*/_jsxs(View, {
146
- style: styles.modalSection,
147
- children: [/*#__PURE__*/_jsx(Text, {
148
- style: modalSectionTitleStyle,
149
- children: "Features"
150
- }), plan.extraDetails.features.map((feature, index) => /*#__PURE__*/_jsxs(View, {
151
- style: styles.benefitRow,
152
- children: [/*#__PURE__*/_jsx(Text, {
153
- style: benefitBulletStyle,
154
- children: "\u2713"
155
- }), /*#__PURE__*/_jsx(Text, {
156
- style: benefitTextStyle,
157
- children: feature
158
- })]
159
- }, `feature-${plan.id}-${index}`))]
160
- }), plan.extraDetails?.terms && /*#__PURE__*/_jsxs(View, {
161
- style: styles.modalSection,
162
- children: [/*#__PURE__*/_jsx(Text, {
163
- style: modalSectionTitleStyle,
164
- children: "Terms & Conditions"
165
- }), /*#__PURE__*/_jsx(Text, {
166
- style: modalSectionValueStyle,
167
- children: plan.extraDetails.terms
168
- })]
169
- })]
170
- })]
171
- });
172
- });
173
- PlanDetailsModalContent.displayName = 'PlanDetailsModalContent';
174
- const CAROUSEL_WIDTH = Display.fullWidth;
175
- const CAROUSEL_HEIGHT = verticalScale(CAROUSEL_WIDTH / 1.4);
176
-
177
- // Move parsePrice outside component to avoid recreation on every render
11
+ import { SubscriptionCard } from "./components/SubscriptionCard.js";
12
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
13
+ const {
14
+ width: SCREEN_WIDTH,
15
+ height: SCREEN_HEIGHT
16
+ } = Dimensions.get('window');
17
+ const CAROUSEL_HEIGHT = SCREEN_HEIGHT * 0.42;
178
18
  const parsePrice = price => parseFloat(price.replace(/[^\d.]/g, '')) || 0;
179
19
  const SubscriptionSliderOne = ({
180
20
  theme,
181
21
  onSubscribe,
182
22
  subscribeButtonText = 'Subscribe',
183
23
  subscribeLoadingId,
184
- plans,
24
+ plans = [],
185
25
  errorMessage = 'Something went wrong',
186
26
  isLoading = false,
187
- onBackPress = () => {},
27
+ onBackPress,
28
+ onRestore,
29
+ restoreLoading = false,
30
+ restoreText = 'Restore Purchase',
31
+ restoreDescription = 'Already purchased? Restore your subscription here.',
188
32
  header,
189
33
  footer,
190
- extraContentText
34
+ onPressTerms,
35
+ onPressPrivacy,
36
+ termsText = 'Terms of Use',
37
+ privacyText = 'Privacy Policy'
191
38
  }) => {
192
39
  const {
193
40
  theme: appliedTheme
194
41
  } = useInternalTheme(theme);
195
- const colors = appliedTheme.colors;
196
- const [selectedPlan, setSelectedPlan] = useState(null);
197
- const [isModalVisible, setIsModalVisible] = useState(false);
198
- const sortedPlans = useMemo(() => {
199
- return [...plans].sort((a, b) => {
200
- const aPopular = a?.isPopular ? 1 : 0;
201
- const bPopular = b?.isPopular ? 1 : 0;
202
- if (aPopular !== bPopular) {
203
- return bPopular - aPopular;
204
- }
205
- if (aPopular === 1 && bPopular === 1) {
206
- return parsePrice(b.price) - parsePrice(a.price);
207
- }
208
- return 0;
209
- });
210
- }, [plans]);
211
- const placeholderData = useMemo(() => new Array(plans.length || 3).fill({}), [plans.length]);
212
- const shouldLoop = useMemo(() => sortedPlans.length > 1, [sortedPlans.length]);
213
- const carouselModeConfig = useMemo(() => ({
214
- parallaxScrollingOffset: Display.fullWidth * 0.21,
215
- parallaxAdjacentItemScale: 0.8
216
- }), []);
217
- const errorMessageStyle = useMemo(() => ({
218
- color: colors.error
219
- }), [colors.error]);
220
- const containerStyle = useMemo(() => [styles.container, {
221
- backgroundColor: colors.background
222
- }], [colors.background]);
223
- const headingStyle = useMemo(() => [styles.heading], []);
224
- const subTextStyle = useMemo(() => [styles.subText, {
225
- color: colors.onSurfaceVariant
226
- }], [colors.onSurfaceVariant]);
227
- const infoStyle = useMemo(() => [styles.info, {
228
- color: colors.onSurfaceVariant
229
- }], [colors.onSurfaceVariant]);
230
- const cancelTextStyle = useMemo(() => [styles.cancelText, {
231
- color: colors.onSurfaceVariant
232
- }], [colors.onSurfaceVariant]);
233
- const extraContentTextStyle = useMemo(() => [styles.extraContentTextText, {
234
- color: colors.onSurfaceVariant
235
- }], [colors.onSurfaceVariant]);
236
- const modalColors = useMemo(() => ({
237
- surface: colors.surface,
238
- background: colors.background,
239
- textPrimary: colors.textPrimary,
240
- textSecondary: colors.textSecondary,
241
- primary: colors.primary
242
- }), [colors.surface, colors.background, colors.textPrimary, colors.textSecondary, colors.primary]);
243
- const skeletonColors = useMemo(() => ({
244
- backgroundColor: colors.skeletonBaseColor,
245
- highlightColor: colors.skeletonHighlightColor
246
- }), [colors.skeletonBaseColor, colors.skeletonHighlightColor]);
247
- const renderSkeleton = useCallback(() => /*#__PURE__*/_jsx(Animated.View, {
248
- entering: FadeIn,
249
- exiting: FadeOut,
250
- style: styles.cardContainer,
251
- children: /*#__PURE__*/_jsx(SkeletonPlaceholder, {
252
- borderRadius: 20,
253
- backgroundColor: skeletonColors.backgroundColor,
254
- highlightColor: skeletonColors.highlightColor,
255
- children: /*#__PURE__*/_jsx(View, {
256
- style: styles.card
257
- })
258
- })
259
- }), [skeletonColors]);
260
- const openDetailsModal = useCallback(plan => {
261
- setSelectedPlan(plan);
262
- setIsModalVisible(true);
263
- }, []);
264
- const closeDetailsModal = useCallback(() => {
265
- setIsModalVisible(false);
266
- // Delay clearing selectedPlan to prevent flicker during close animation
267
- setTimeout(() => {
268
- setSelectedPlan(null);
269
- }, 300);
270
- }, []);
271
- const gradientConfig = useMemo(() => ({
272
- colors: colors.cardGradient,
273
- start: {
274
- x: 1,
275
- y: 0
276
- },
277
- end: {
278
- x: 0,
279
- y: 1.2
280
- },
281
- locations: [0, 0.7, 1]
282
- }), [colors.cardGradient]);
283
- const cardStyle = useMemo(() => [styles.card, {
284
- shadowColor: colors.primary
285
- }], [colors.primary]);
286
- const handleSubscribe = useCallback(item => {
287
- onSubscribe?.(item);
288
- }, [onSubscribe]);
289
- const renderPlan = useCallback(({
42
+ const {
43
+ colors
44
+ } = appliedTheme;
45
+ const sortedPlans = [...plans]?.sort?.((a, b) => {
46
+ const aPopular = a?.isPopular ? 1 : 0;
47
+ const bPopular = b?.isPopular ? 1 : 0;
48
+ if (aPopular !== bPopular) return bPopular - aPopular;
49
+ if (aPopular) return parsePrice(b.price) - parsePrice(a.price);
50
+ return 0;
51
+ });
52
+ const placeholderData = new Array(plans.length || 3).fill({});
53
+ const shouldLoop = sortedPlans?.length > 1 || placeholderData?.length > 1;
54
+ const handleSubscribe = useCallback(plan => onSubscribe?.(plan), [onSubscribe]);
55
+ const renderPlan = ({
290
56
  item
291
57
  }) => {
292
- const isPopular = item?.isPopular;
293
- const hasBenefits = !!item.benefits?.length;
294
- const benefitsCount = item.benefits?.length || 0;
295
- const showViewDetails = hasBenefits || !!item.extraDetails;
296
- const isSubscribing = subscribeLoadingId === item.id;
297
- const viewDetailsText = hasBenefits && benefitsCount > 4 ? 'View More Details' : 'View Details';
298
- return /*#__PURE__*/_jsx(View, {
299
- style: styles.cardContainer,
300
- children: /*#__PURE__*/_jsxs(LinearGradient, {
301
- colors: gradientConfig.colors,
302
- start: gradientConfig.start,
303
- end: gradientConfig.end,
304
- locations: gradientConfig.locations,
305
- style: cardStyle,
306
- children: [isPopular && /*#__PURE__*/_jsx(View, {
307
- style: [styles.popularBadge, {
308
- backgroundColor: colors.button
58
+ const isProcessing = subscribeLoadingId === item.id;
59
+ return /*#__PURE__*/_jsx(SubscriptionCard, {
60
+ plan: item,
61
+ colors: colors,
62
+ onSubscribe: handleSubscribe,
63
+ isLoading: isLoading,
64
+ isProcessing: isProcessing,
65
+ subscribeButtonText: isProcessing ? 'Subscribing...' : subscribeButtonText
66
+ });
67
+ };
68
+ return /*#__PURE__*/_jsxs(View, {
69
+ style: [styles.container, {
70
+ backgroundColor: colors.background
71
+ }],
72
+ children: [/*#__PURE__*/_jsx(AppHeader, {
73
+ title: header.topTitle,
74
+ onBackPress: onBackPress,
75
+ titleAlign: header.topTitleAlign,
76
+ theme: theme
77
+ }), /*#__PURE__*/_jsxs(ScrollView, {
78
+ contentContainerStyle: styles.scrollContent,
79
+ showsVerticalScrollIndicator: false,
80
+ children: [/*#__PURE__*/_jsxs(View, {
81
+ style: styles.headerContent,
82
+ children: [/*#__PURE__*/_jsx(Text, {
83
+ style: [styles.title, {
84
+ color: colors.textPrimary
309
85
  }],
310
- children: /*#__PURE__*/_jsx(Text, {
311
- style: [styles.popularText, {
312
- color: colors.buttonText
313
- }],
314
- children: "POPULAR"
315
- })
86
+ children: header.title
316
87
  }), /*#__PURE__*/_jsx(Text, {
317
- numberOfLines: 1,
318
- style: [styles.cardTitle, {
319
- color: colors.white
88
+ style: [styles.subtitle, {
89
+ color: colors.onSurfaceVariant
320
90
  }],
321
- children: item.title
322
- }), /*#__PURE__*/_jsx(Text, {
323
- style: [styles.price, {
324
- color: colors.white
91
+ children: header.subTitle
92
+ })]
93
+ }), /*#__PURE__*/_jsx(View, {
94
+ style: styles.carouselWrapper,
95
+ children: !plans.length && !isLoading ? /*#__PURE__*/_jsx(View, {
96
+ style: [styles.error, {
97
+ borderRadius: scale(12),
98
+ width: SCREEN_WIDTH,
99
+ height: CAROUSEL_HEIGHT
325
100
  }],
326
- children: item.price
327
- }), /*#__PURE__*/_jsx(Text, {
328
- style: [styles.per, {
329
- color: colors.white
101
+ children: /*#__PURE__*/_jsx(Text, {
102
+ style: {
103
+ color: colors.error
104
+ },
105
+ children: errorMessage
106
+ })
107
+ }) : /*#__PURE__*/_jsx(Carousel, {
108
+ width: SCREEN_WIDTH,
109
+ height: CAROUSEL_HEIGHT,
110
+ data: isLoading ? placeholderData : sortedPlans,
111
+ renderItem: renderPlan,
112
+ loop: shouldLoop,
113
+ autoPlay: false,
114
+ scrollAnimationDuration: 500,
115
+ mode: "parallax",
116
+ modeConfig: {
117
+ parallaxScrollingOffset: scale(60),
118
+ parallaxAdjacentItemScale: 0.8
119
+ }
120
+ })
121
+ }), /*#__PURE__*/_jsxs(View, {
122
+ style: styles.footerContainer,
123
+ children: [/*#__PURE__*/_jsx(Text, {
124
+ style: [styles.footerTitle, {
125
+ color: colors.textPrimary
330
126
  }],
331
- children: item.duration
127
+ children: footer.title
332
128
  }), /*#__PURE__*/_jsx(Text, {
333
- style: [styles.platforms, {
334
- color: colors.white
129
+ style: [styles.footerSub, {
130
+ color: colors.onSurfaceVariant
335
131
  }],
336
- children: item.platforms
337
- }), hasBenefits && item.benefits && /*#__PURE__*/_jsx(View, {
338
- style: styles.benefitsContainer,
339
- children: item.benefits.slice(0, 4).map((benefit, i) => /*#__PURE__*/_jsxs(Text, {
340
- numberOfLines: 1,
341
- style: [styles.benefit, {
342
- color: colors.white
132
+ children: footer.subTitle
133
+ })]
134
+ }), (onPressTerms || onPressPrivacy) && /*#__PURE__*/_jsxs(View, {
135
+ style: styles.legalContainer,
136
+ children: [onPressTerms && /*#__PURE__*/_jsx(TouchableOpacity, {
137
+ onPress: onPressTerms,
138
+ activeOpacity: 0.6,
139
+ children: /*#__PURE__*/_jsx(Text, {
140
+ style: [styles.legalText, {
141
+ color: colors.primary
343
142
  }],
344
- children: ["\u2022 ", benefit]
345
- }, `${item.id}-benefit-${i}`))
346
- }), showViewDetails && /*#__PURE__*/_jsx(TouchableOpacity, {
347
- style: styles.viewDetailsButton,
348
- onPress: () => openDetailsModal(item),
349
- activeOpacity: 0.7,
143
+ children: termsText
144
+ })
145
+ }), onPressTerms && onPressPrivacy && /*#__PURE__*/_jsx(Text, {
146
+ style: styles.dot,
147
+ children: " \u2022 "
148
+ }), onPressPrivacy && /*#__PURE__*/_jsx(TouchableOpacity, {
149
+ onPress: onPressPrivacy,
150
+ activeOpacity: 0.6,
350
151
  children: /*#__PURE__*/_jsx(Text, {
351
- style: [styles.viewDetailsText, {
352
- color: colors.white
152
+ style: [styles.legalText, {
153
+ color: colors.primary
353
154
  }],
354
- children: viewDetailsText
155
+ children: privacyText
355
156
  })
356
- }), /*#__PURE__*/_jsx(TouchableOpacity, {
357
- style: [styles.subscribeButton, {
358
- backgroundColor: colors.button
359
- }],
360
- onPress: () => handleSubscribe(item),
157
+ })]
158
+ }), onRestore && /*#__PURE__*/_jsxs(View, {
159
+ style: styles.restoreWrapper,
160
+ children: [/*#__PURE__*/_jsx(TouchableOpacity, {
161
+ onPress: onRestore,
361
162
  activeOpacity: 0.8,
362
- disabled: isSubscribing,
363
- children: isSubscribing ? /*#__PURE__*/_jsx(ActivityIndicator, {
364
- size: "small",
365
- color: colors.buttonText
163
+ disabled: restoreLoading,
164
+ style: [styles.restoreButton, {
165
+ backgroundColor: colors.primary,
166
+ opacity: restoreLoading ? 0.7 : 1
167
+ }],
168
+ children: restoreLoading ? /*#__PURE__*/_jsxs(_Fragment, {
169
+ children: [/*#__PURE__*/_jsx(ActivityIndicator, {
170
+ size: "small",
171
+ color: colors.onPrimary
172
+ }), /*#__PURE__*/_jsx(Text, {
173
+ style: [styles.restoreText, {
174
+ marginLeft: scale(8),
175
+ color: colors.onPrimary
176
+ }],
177
+ children: "Restoring..."
178
+ })]
366
179
  }) : /*#__PURE__*/_jsx(Text, {
367
- style: [styles.subscribeText, {
368
- color: colors.buttonText
180
+ style: [styles.restoreText, {
181
+ color: colors.onPrimary
369
182
  }],
370
- children: subscribeButtonText
183
+ children: restoreText
371
184
  })
185
+ }), restoreDescription && /*#__PURE__*/_jsx(Text, {
186
+ style: [styles.restoreDescription, {
187
+ color: colors.onSurfaceVariant
188
+ }],
189
+ children: restoreDescription
372
190
  })]
373
- })
374
- });
375
- }, [gradientConfig, cardStyle, colors.button, colors.buttonText, colors.white, subscribeButtonText, subscribeLoadingId, openDetailsModal, handleSubscribe]);
376
- return /*#__PURE__*/_jsxs(View, {
377
- style: containerStyle,
378
- children: [/*#__PURE__*/_jsx(AppHeader, {
379
- title: header.topTitle,
380
- onBackPress: onBackPress,
381
- titleAlign: header.topTitleAlign,
382
- theme: theme
383
- }), /*#__PURE__*/_jsxs(View, {
384
- style: styles.content,
385
- children: [/*#__PURE__*/_jsx(Text, {
386
- style: headingStyle,
387
- color: colors.textPrimary,
388
- children: header.title
389
- }), /*#__PURE__*/_jsx(Text, {
390
- style: subTextStyle,
391
- children: header.subTitle
392
- }), !plans || plans.length === 0 && !isLoading && errorMessage ? /*#__PURE__*/_jsx(View, {
393
- style: styles.errorMessage,
394
- children: /*#__PURE__*/_jsx(Text, {
395
- style: errorMessageStyle,
396
- children: errorMessage
397
- })
398
- }) : /*#__PURE__*/_jsx(Carousel, {
399
- width: CAROUSEL_WIDTH,
400
- height: CAROUSEL_HEIGHT,
401
- data: isLoading ? placeholderData : sortedPlans,
402
- renderItem: isLoading ? renderSkeleton : renderPlan,
403
- loop: shouldLoop,
404
- autoPlay: false,
405
- scrollAnimationDuration: 500,
406
- mode: "parallax",
407
- modeConfig: carouselModeConfig
408
- }), /*#__PURE__*/_jsx(Text, {
409
- style: infoStyle,
410
- children: footer.title
411
- }), /*#__PURE__*/_jsx(Text, {
412
- style: cancelTextStyle,
413
- children: footer.subTitle
414
- }), extraContentText && /*#__PURE__*/_jsx(View, {
415
- style: styles.extraContentTextWrapper,
416
- children: /*#__PURE__*/React.isValidElement(extraContentText) ? extraContentText : /*#__PURE__*/_jsx(Text, {
417
- style: extraContentTextStyle,
418
- children: extraContentText
419
- })
420
- }), /*#__PURE__*/_jsx(Modal, {
421
- isVisible: isModalVisible,
422
- onBackdropPress: closeDetailsModal,
423
- onBackButtonPress: closeDetailsModal,
424
- backdropOpacity: 0.35,
425
- useNativeDriver: true,
426
- useNativeDriverForBackdrop: true,
427
- onSwipeComplete: closeDetailsModal,
428
- propagateSwipe: true,
429
- style: styles.modal,
430
- hideModalContentWhileAnimating: true,
431
- animationIn: "slideInUp",
432
- animationOut: "slideOutDown",
433
- animationInTiming: 300,
434
- animationOutTiming: 300,
435
- children: selectedPlan && /*#__PURE__*/_jsx(PlanDetailsModalContent, {
436
- plan: selectedPlan,
437
- colors: modalColors,
438
- onClose: closeDetailsModal
439
- })
440
191
  })]
441
192
  })]
442
193
  });
@@ -446,281 +197,94 @@ const styles = StyleSheet.create({
446
197
  container: {
447
198
  flex: 1
448
199
  },
449
- content: {
450
- flex: 1,
451
- paddingTop: verticalScale(16)
452
- },
453
- heading: {
454
- fontSize: RFValue(21),
455
- fontWeight: '700',
456
- textAlign: 'center',
457
- marginBottom: verticalScale(12),
458
- marginHorizontal: scale(16)
459
- },
460
- subText: {
461
- textAlign: 'center',
462
- fontSize: RFValue(12),
463
- fontWeight: '400',
464
- marginBottom: verticalScale(12),
465
- marginHorizontal: scale(16)
466
- },
467
- errorMessage: {
468
- height: CAROUSEL_HEIGHT,
469
- fontSize: RFValue(13),
470
- fontWeight: '600',
471
- textAlign: 'center',
472
- textAlignVertical: 'center',
473
- justifyContent: 'center',
474
- alignItems: 'center',
475
- marginVertical: verticalScale(12)
476
- },
477
- cardContainer: {
478
- alignItems: 'center',
479
- justifyContent: 'center'
200
+ scrollContent: {
201
+ flexGrow: 1,
202
+ paddingBottom: verticalScale(20)
480
203
  },
481
- card: {
482
- position: 'relative',
483
- width: Display.fullWidth * 0.95,
484
- aspectRatio: 1,
485
- borderRadius: scale(20),
486
- justifyContent: 'center',
487
- alignItems: 'center',
488
- alignSelf: 'center',
489
- shadowOffset: {
490
- width: 0,
491
- height: 4
492
- },
493
- shadowOpacity: 0.2,
494
- shadowRadius: 8,
495
- elevation: 5
204
+ headerContent: {
205
+ paddingHorizontal: scale(20),
206
+ marginTop: verticalScale(10),
207
+ alignItems: 'center'
496
208
  },
497
- cardTitle: {
498
- fontSize: RFValue(17),
209
+ title: {
210
+ fontSize: RFValue(20),
499
211
  fontWeight: '700',
500
- maxWidth: '50%',
501
- marginHorizontal: 'auto',
502
- marginBottom: verticalScale(8),
503
212
  textAlign: 'center'
504
213
  },
505
- price: {
506
- fontSize: RFValue(43),
507
- fontWeight: 'bold',
508
- marginBottom: verticalScale(4)
509
- },
510
- per: {
214
+ subtitle: {
511
215
  fontSize: RFValue(13),
512
- textTransform: 'capitalize',
513
- marginBottom: verticalScale(6)
514
- },
515
- platforms: {
516
- fontSize: RFValue(13),
517
- textTransform: 'capitalize',
518
- textAlign: 'center',
519
- marginBottom: verticalScale(8)
520
- },
521
- benefitsContainer: {
522
- marginTop: verticalScale(8),
523
- alignItems: 'flex-start',
524
- justifyContent: 'center',
525
- width: '60%',
526
- marginHorizontal: 'auto'
527
- },
528
- benefit: {
529
- fontSize: RFValue(12)
530
- },
531
- subscribeButton: {
532
- paddingVertical: verticalScale(10),
533
- paddingHorizontal: scale(60),
534
- borderRadius: scale(30),
535
- alignItems: 'center',
536
- marginTop: verticalScale(5)
537
- },
538
- subscribeText: {
539
- fontSize: RFValue(14),
540
- fontWeight: '700'
541
- },
542
- info: {
543
- fontSize: RFValue(11),
544
216
  textAlign: 'center',
545
- fontWeight: '400',
546
- marginVertical: verticalScale(8),
547
- marginHorizontal: scale(16)
217
+ marginTop: verticalScale(6),
218
+ lineHeight: scale(18),
219
+ opacity: 0.85
548
220
  },
549
- cancelText: {
550
- fontSize: RFValue(11),
551
- textAlign: 'center',
552
- fontWeight: '400',
553
- marginBottom: verticalScale(16),
554
- marginHorizontal: scale(16)
221
+ carouselWrapper: {
222
+ marginTop: verticalScale(20),
223
+ alignItems: 'center'
555
224
  },
556
- extraContentTextWrapper: {
557
- marginTop: verticalScale(18),
558
- alignItems: 'center',
225
+ error: {
226
+ height: verticalScale(200),
559
227
  justifyContent: 'center',
560
- paddingHorizontal: scale(16)
561
- },
562
- extraContentTextText: {
563
- fontSize: RFValue(10),
564
- marginHorizontal: scale(16),
565
- fontWeight: '400',
566
- textAlign: 'center'
228
+ alignItems: 'center'
567
229
  },
568
- popularBadge: {
569
- position: 'absolute',
570
- top: verticalScale(10),
571
- right: scale(10),
572
- paddingHorizontal: scale(6),
573
- paddingVertical: verticalScale(3),
574
- borderRadius: scale(12),
575
- zIndex: 10
576
- },
577
- popularText: {
578
- fontSize: RFValue(9),
579
- textTransform: 'uppercase',
580
- fontWeight: '700'
581
- },
582
- viewDetailsButton: {
583
- paddingVertical: verticalScale(6),
230
+ footerContainer: {
231
+ marginTop: verticalScale(20),
584
232
  paddingHorizontal: scale(20),
585
- alignItems: 'center',
586
- justifyContent: 'center'
233
+ alignItems: 'center'
587
234
  },
588
- viewDetailsText: {
235
+ footerTitle: {
589
236
  fontSize: RFValue(12),
590
237
  fontWeight: '600',
591
- textDecorationLine: 'underline'
592
- },
593
- modal: {
594
- margin: 0,
595
- justifyContent: 'flex-end',
596
- zIndex: 1000
597
- },
598
- modalContent: {
599
- borderTopLeftRadius: moderateScale(24),
600
- borderTopRightRadius: moderateScale(24),
601
- maxHeight: Dimensions.get('window').height * 0.85,
602
- minHeight: Dimensions.get('window').height * 0.4,
603
- paddingBottom: verticalScale(20),
604
- shadowColor: '#000',
605
- shadowOffset: {
606
- width: 0,
607
- height: -4
608
- },
609
- shadowOpacity: 0.15,
610
- shadowRadius: 12,
611
- elevation: 8,
612
- overflow: 'hidden'
613
- },
614
- modalHeader: {
615
- flexDirection: 'row',
616
- justifyContent: 'space-between',
617
- alignItems: 'center',
618
- paddingHorizontal: scale(20),
619
- paddingTop: verticalScale(16),
620
- paddingBottom: verticalScale(5),
621
- borderBottomWidth: StyleSheet.hairlineWidth,
622
- borderBottomColor: 'rgba(0,0,0,0.08)'
623
- },
624
- modalTitle: {
625
- fontSize: RFValue(17),
626
- fontWeight: '700',
627
- flex: 1,
628
- letterSpacing: 0.2
629
- },
630
- modalCloseButton: {
631
- width: scale(30),
632
- height: scale(30),
633
- borderRadius: scale(20),
634
- justifyContent: 'center',
635
- alignItems: 'center',
636
- marginLeft: scale(12)
637
- },
638
- modalScrollView: {
639
- paddingHorizontal: scale(20),
640
- paddingTop: verticalScale(16)
641
- },
642
- modalScrollContent: {
643
- paddingBottom: verticalScale(24),
644
- flexGrow: 1
645
- },
646
- modalSection: {
647
- marginBottom: verticalScale(10),
648
- paddingBottom: verticalScale(16),
649
- borderBottomWidth: StyleSheet.hairlineWidth,
650
- borderBottomColor: 'rgba(0,0,0,0.06)'
651
- },
652
- modalFirstSection: {
653
- marginTop: 0
654
- },
655
- modalSectionTitle: {
656
- fontSize: RFValue(15),
657
- fontWeight: '700',
658
- marginBottom: verticalScale(10),
659
- letterSpacing: 0.3,
238
+ textAlign: 'center',
239
+ lineHeight: scale(16),
660
240
  opacity: 0.9
661
241
  },
662
- modalSectionValue: {
663
- fontSize: RFValue(15),
664
- lineHeight: RFValue(20),
665
- letterSpacing: 0.2,
666
- opacity: 0.85
242
+ footerSub: {
243
+ fontSize: RFValue(11),
244
+ textAlign: 'center',
245
+ marginTop: verticalScale(4),
246
+ lineHeight: scale(16),
247
+ opacity: 0.75
667
248
  },
668
- benefitRow: {
249
+ legalContainer: {
669
250
  flexDirection: 'row',
251
+ justifyContent: 'center',
670
252
  alignItems: 'center',
671
- marginBottom: verticalScale(10),
672
- paddingRight: scale(8),
673
- paddingLeft: scale(4)
253
+ marginTop: verticalScale(12)
674
254
  },
675
- benefitBullet: {
676
- fontSize: RFValue(16),
677
- marginRight: scale(10),
678
- fontWeight: '600'
255
+ legalText: {
256
+ fontSize: RFValue(11),
257
+ fontWeight: '500',
258
+ textDecorationLine: 'underline'
679
259
  },
680
- benefitText: {
681
- fontSize: RFValue(12),
682
- flex: 1,
683
- letterSpacing: 0.2,
684
- textTransform: 'capitalize',
685
- opacity: 0.85
260
+ dot: {
261
+ marginHorizontal: scale(6),
262
+ fontSize: RFValue(10),
263
+ opacity: 0.6
686
264
  },
687
- priceHighlightBox: {
688
- borderRadius: scale(16),
689
- padding: scale(20),
265
+ restoreWrapper: {
690
266
  alignItems: 'center',
691
- justifyContent: 'center'
267
+ flexDirection: 'column',
268
+ gap: verticalScale(8),
269
+ marginTop: verticalScale(20)
692
270
  },
693
- modalPriceLabel: {
694
- fontSize: RFValue(12),
695
- fontWeight: '700',
696
- letterSpacing: 1.2,
271
+ restoreDescription: {
272
+ fontSize: RFValue(11),
273
+ textAlign: 'center',
697
274
  marginBottom: verticalScale(8),
698
- opacity: 0.7
275
+ maxWidth: '70%',
276
+ opacity: 0.75
699
277
  },
700
- modalPriceValue: {
701
- fontSize: RFValue(36),
702
- fontWeight: '800',
703
- marginBottom: verticalScale(4),
704
- letterSpacing: -0.5
705
- },
706
- modalPriceDuration: {
707
- fontSize: RFValue(14),
708
- fontWeight: '500',
709
- opacity: 0.7
710
- },
711
- platformBadge: {
712
- alignSelf: 'flex-start',
713
- paddingHorizontal: scale(12),
714
- paddingVertical: verticalScale(8),
715
- borderRadius: scale(12),
716
- borderWidth: 1,
717
- borderColor: 'rgba(0,0,0,0.08)'
278
+ restoreButton: {
279
+ paddingVertical: verticalScale(10),
280
+ paddingHorizontal: scale(22),
281
+ borderRadius: scale(14),
282
+ flexDirection: 'row',
283
+ alignItems: 'center'
718
284
  },
719
- platformBadgeText: {
720
- fontSize: RFValue(12),
721
- fontWeight: '600',
722
- letterSpacing: 0.3,
723
- textTransform: 'capitalize'
285
+ restoreText: {
286
+ fontSize: RFValue(13),
287
+ fontWeight: '600'
724
288
  }
725
289
  });
726
290
  //# sourceMappingURL=SubOne.js.map