@oxyhq/services 5.3.11 → 5.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (213) hide show
  1. package/README.md +21 -0
  2. package/lib/commonjs/assets/assets/icons/OxyServices.tsx +67 -0
  3. package/lib/commonjs/assets/assets/icons/logo_OxyServices.svg +1 -0
  4. package/lib/commonjs/assets/icons/OxyServices.js +53 -0
  5. package/lib/commonjs/assets/icons/OxyServices.js.map +1 -0
  6. package/lib/commonjs/assets/icons/logo_OxyServices.svg +1 -0
  7. package/lib/commonjs/core/index.js +119 -23
  8. package/lib/commonjs/core/index.js.map +1 -1
  9. package/lib/commonjs/index.js +2 -0
  10. package/lib/commonjs/index.js.map +1 -1
  11. package/lib/commonjs/lib/sonner.js +15 -11
  12. package/lib/commonjs/lib/sonner.js.map +1 -1
  13. package/lib/commonjs/node/index.js +2 -0
  14. package/lib/commonjs/node/index.js.map +1 -1
  15. package/lib/commonjs/ui/components/GroupedItem.js +109 -0
  16. package/lib/commonjs/ui/components/GroupedItem.js.map +1 -0
  17. package/lib/commonjs/ui/components/GroupedSection.js +33 -0
  18. package/lib/commonjs/ui/components/GroupedSection.js.map +1 -0
  19. package/lib/commonjs/ui/components/OxyProvider.js +95 -112
  20. package/lib/commonjs/ui/components/OxyProvider.js.map +1 -1
  21. package/lib/commonjs/ui/components/ProfileCard.js +124 -0
  22. package/lib/commonjs/ui/components/ProfileCard.js.map +1 -0
  23. package/lib/commonjs/ui/components/QuickActions.js +87 -0
  24. package/lib/commonjs/ui/components/QuickActions.js.map +1 -0
  25. package/lib/commonjs/ui/components/Section.js +36 -0
  26. package/lib/commonjs/ui/components/Section.js.map +1 -0
  27. package/lib/commonjs/ui/components/SectionTitle.js +35 -0
  28. package/lib/commonjs/ui/components/SectionTitle.js.map +1 -0
  29. package/lib/commonjs/ui/components/bottomSheet/index.js +6 -6
  30. package/lib/commonjs/ui/components/index.js +97 -0
  31. package/lib/commonjs/ui/components/index.js.map +1 -0
  32. package/lib/commonjs/ui/navigation/OxyRouter.js +20 -3
  33. package/lib/commonjs/ui/navigation/OxyRouter.js.map +1 -1
  34. package/lib/commonjs/ui/screens/AccountCenterScreen.js +190 -207
  35. package/lib/commonjs/ui/screens/AccountCenterScreen.js.map +1 -1
  36. package/lib/commonjs/ui/screens/AccountManagementDemo.js +299 -0
  37. package/lib/commonjs/ui/screens/AccountManagementDemo.js.map +1 -0
  38. package/lib/commonjs/ui/screens/AccountOverviewScreen.js +669 -401
  39. package/lib/commonjs/ui/screens/AccountOverviewScreen.js.map +1 -1
  40. package/lib/commonjs/ui/screens/AccountSettingsScreen.js +695 -498
  41. package/lib/commonjs/ui/screens/AccountSettingsScreen.js.map +1 -1
  42. package/lib/commonjs/ui/screens/AccountSwitcherScreen.js +451 -488
  43. package/lib/commonjs/ui/screens/AccountSwitcherScreen.js.map +1 -1
  44. package/lib/commonjs/ui/screens/AppInfoScreen.js +498 -185
  45. package/lib/commonjs/ui/screens/AppInfoScreen.js.map +1 -1
  46. package/lib/commonjs/ui/screens/BillingManagementScreen.js +636 -0
  47. package/lib/commonjs/ui/screens/BillingManagementScreen.js.map +1 -0
  48. package/lib/commonjs/ui/screens/FileManagementScreen.js +2497 -0
  49. package/lib/commonjs/ui/screens/FileManagementScreen.js.map +1 -0
  50. package/lib/commonjs/ui/screens/PremiumSubscriptionScreen.js +1620 -0
  51. package/lib/commonjs/ui/screens/PremiumSubscriptionScreen.js.map +1 -0
  52. package/lib/commonjs/ui/screens/ProfileScreen.js +117 -13
  53. package/lib/commonjs/ui/screens/ProfileScreen.js.map +1 -1
  54. package/lib/commonjs/ui/screens/SessionManagementScreen.js.map +1 -1
  55. package/lib/commonjs/ui/screens/SignInScreen.js +1 -1
  56. package/lib/commonjs/ui/screens/SignUpScreen.js +1 -1
  57. package/lib/commonjs/utils/polyfills.js +42 -0
  58. package/lib/commonjs/utils/polyfills.js.map +1 -0
  59. package/lib/module/assets/assets/icons/OxyServices.tsx +67 -0
  60. package/lib/module/assets/assets/icons/logo_OxyServices.svg +1 -0
  61. package/lib/module/assets/icons/OxyServices.js +46 -0
  62. package/lib/module/assets/icons/OxyServices.js.map +1 -0
  63. package/lib/module/assets/icons/logo_OxyServices.svg +1 -0
  64. package/lib/module/core/index.js +119 -23
  65. package/lib/module/core/index.js.map +1 -1
  66. package/lib/module/index.js +3 -0
  67. package/lib/module/index.js.map +1 -1
  68. package/lib/module/lib/sonner.js +13 -1
  69. package/lib/module/lib/sonner.js.map +1 -1
  70. package/lib/module/node/index.js +3 -0
  71. package/lib/module/node/index.js.map +1 -1
  72. package/lib/module/ui/components/GroupedItem.js +104 -0
  73. package/lib/module/ui/components/GroupedItem.js.map +1 -0
  74. package/lib/module/ui/components/GroupedSection.js +28 -0
  75. package/lib/module/ui/components/GroupedSection.js.map +1 -0
  76. package/lib/module/ui/components/OxyProvider.js +97 -114
  77. package/lib/module/ui/components/OxyProvider.js.map +1 -1
  78. package/lib/module/ui/components/ProfileCard.js +119 -0
  79. package/lib/module/ui/components/ProfileCard.js.map +1 -0
  80. package/lib/module/ui/components/QuickActions.js +82 -0
  81. package/lib/module/ui/components/QuickActions.js.map +1 -0
  82. package/lib/module/ui/components/Section.js +31 -0
  83. package/lib/module/ui/components/Section.js.map +1 -0
  84. package/lib/module/ui/components/SectionTitle.js +30 -0
  85. package/lib/module/ui/components/SectionTitle.js.map +1 -0
  86. package/lib/module/ui/components/bottomSheet/index.js +2 -5
  87. package/lib/module/ui/components/bottomSheet/index.js.map +1 -1
  88. package/lib/module/ui/components/index.js +18 -0
  89. package/lib/module/ui/components/index.js.map +1 -0
  90. package/lib/module/ui/navigation/OxyRouter.js +20 -3
  91. package/lib/module/ui/navigation/OxyRouter.js.map +1 -1
  92. package/lib/module/ui/screens/AccountCenterScreen.js +191 -208
  93. package/lib/module/ui/screens/AccountCenterScreen.js.map +1 -1
  94. package/lib/module/ui/screens/AccountManagementDemo.js +296 -0
  95. package/lib/module/ui/screens/AccountManagementDemo.js.map +1 -0
  96. package/lib/module/ui/screens/AccountOverviewScreen.js +671 -403
  97. package/lib/module/ui/screens/AccountOverviewScreen.js.map +1 -1
  98. package/lib/module/ui/screens/AccountSettingsScreen.js +698 -501
  99. package/lib/module/ui/screens/AccountSettingsScreen.js.map +1 -1
  100. package/lib/module/ui/screens/AccountSwitcherScreen.js +450 -488
  101. package/lib/module/ui/screens/AccountSwitcherScreen.js.map +1 -1
  102. package/lib/module/ui/screens/AppInfoScreen.js +498 -186
  103. package/lib/module/ui/screens/AppInfoScreen.js.map +1 -1
  104. package/lib/module/ui/screens/BillingManagementScreen.js +631 -0
  105. package/lib/module/ui/screens/BillingManagementScreen.js.map +1 -0
  106. package/lib/module/ui/screens/FileManagementScreen.js +2492 -0
  107. package/lib/module/ui/screens/FileManagementScreen.js.map +1 -0
  108. package/lib/module/ui/screens/PremiumSubscriptionScreen.js +1615 -0
  109. package/lib/module/ui/screens/PremiumSubscriptionScreen.js.map +1 -0
  110. package/lib/module/ui/screens/ProfileScreen.js +118 -14
  111. package/lib/module/ui/screens/ProfileScreen.js.map +1 -1
  112. package/lib/module/ui/screens/SessionManagementScreen.js.map +1 -1
  113. package/lib/module/ui/screens/SignInScreen.js +1 -1
  114. package/lib/module/ui/screens/SignInScreen.js.map +1 -1
  115. package/lib/module/ui/screens/SignUpScreen.js +1 -1
  116. package/lib/module/ui/screens/SignUpScreen.js.map +1 -1
  117. package/lib/module/utils/polyfills.js +36 -0
  118. package/lib/module/utils/polyfills.js.map +1 -0
  119. package/lib/typescript/assets/icons/OxyServices.d.ts +29 -0
  120. package/lib/typescript/assets/icons/OxyServices.d.ts.map +1 -0
  121. package/lib/typescript/core/index.d.ts +26 -1
  122. package/lib/typescript/core/index.d.ts.map +1 -1
  123. package/lib/typescript/index.d.ts +1 -0
  124. package/lib/typescript/index.d.ts.map +1 -1
  125. package/lib/typescript/lib/sonner.d.ts +5 -1
  126. package/lib/typescript/lib/sonner.d.ts.map +1 -1
  127. package/lib/typescript/models/interfaces.d.ts +1 -2
  128. package/lib/typescript/models/interfaces.d.ts.map +1 -1
  129. package/lib/typescript/node/index.d.ts +1 -0
  130. package/lib/typescript/node/index.d.ts.map +1 -1
  131. package/lib/typescript/ui/components/GroupedItem.d.ts +17 -0
  132. package/lib/typescript/ui/components/GroupedItem.d.ts.map +1 -0
  133. package/lib/typescript/ui/components/GroupedSection.d.ts +19 -0
  134. package/lib/typescript/ui/components/GroupedSection.d.ts.map +1 -0
  135. package/lib/typescript/ui/components/OxyProvider.d.ts.map +1 -1
  136. package/lib/typescript/ui/components/ProfileCard.d.ts +20 -0
  137. package/lib/typescript/ui/components/ProfileCard.d.ts.map +1 -0
  138. package/lib/typescript/ui/components/QuickActions.d.ts +15 -0
  139. package/lib/typescript/ui/components/QuickActions.d.ts.map +1 -0
  140. package/lib/typescript/ui/components/Section.d.ts +11 -0
  141. package/lib/typescript/ui/components/Section.d.ts.map +1 -0
  142. package/lib/typescript/ui/components/SectionTitle.d.ts +9 -0
  143. package/lib/typescript/ui/components/SectionTitle.d.ts.map +1 -0
  144. package/lib/typescript/ui/components/bottomSheet/index.d.ts +3 -2
  145. package/lib/typescript/ui/components/bottomSheet/index.d.ts.map +1 -1
  146. package/lib/typescript/ui/components/index.d.ts +13 -0
  147. package/lib/typescript/ui/components/index.d.ts.map +1 -0
  148. package/lib/typescript/ui/navigation/OxyRouter.d.ts.map +1 -1
  149. package/lib/typescript/ui/navigation/types.d.ts +8 -0
  150. package/lib/typescript/ui/navigation/types.d.ts.map +1 -1
  151. package/lib/typescript/ui/screens/AccountCenterScreen.d.ts.map +1 -1
  152. package/lib/typescript/ui/screens/AccountManagementDemo.d.ts +8 -0
  153. package/lib/typescript/ui/screens/AccountManagementDemo.d.ts.map +1 -0
  154. package/lib/typescript/ui/screens/AccountOverviewScreen.d.ts.map +1 -1
  155. package/lib/typescript/ui/screens/AccountSettingsScreen.d.ts +1 -4
  156. package/lib/typescript/ui/screens/AccountSettingsScreen.d.ts.map +1 -1
  157. package/lib/typescript/ui/screens/AccountSwitcherScreen.d.ts.map +1 -1
  158. package/lib/typescript/ui/screens/AppInfoScreen.d.ts.map +1 -1
  159. package/lib/typescript/ui/screens/BillingManagementScreen.d.ts +5 -0
  160. package/lib/typescript/ui/screens/BillingManagementScreen.d.ts.map +1 -0
  161. package/lib/typescript/ui/screens/FileManagementScreen.d.ts +8 -0
  162. package/lib/typescript/ui/screens/FileManagementScreen.d.ts.map +1 -0
  163. package/lib/typescript/ui/screens/PremiumSubscriptionScreen.d.ts +5 -0
  164. package/lib/typescript/ui/screens/PremiumSubscriptionScreen.d.ts.map +1 -0
  165. package/lib/typescript/ui/screens/ProfileScreen.d.ts.map +1 -1
  166. package/lib/typescript/ui/screens/SessionManagementScreen.d.ts.map +1 -1
  167. package/lib/typescript/utils/polyfills.d.ts +6 -0
  168. package/lib/typescript/utils/polyfills.d.ts.map +1 -0
  169. package/package.json +11 -3
  170. package/src/__tests__/polyfills.test.ts +30 -0
  171. package/src/__tests__/setup.ts +43 -0
  172. package/src/__tests__/ui/screens/AccountSettingsScreen.test.tsx +8 -8
  173. package/src/assets/icons/OxyServices.tsx +67 -0
  174. package/src/assets/icons/logo_OxyServices.svg +1 -0
  175. package/src/core/index.ts +127 -19
  176. package/src/index.ts +3 -0
  177. package/src/lib/sonner.ts +10 -1
  178. package/src/models/interfaces.ts +1 -2
  179. package/src/node/index.ts +3 -0
  180. package/src/ui/components/GroupedItem.tsx +118 -0
  181. package/src/ui/components/GroupedSection.tsx +45 -0
  182. package/src/ui/components/OxyProvider.tsx +95 -120
  183. package/src/ui/components/ProfileCard.tsx +129 -0
  184. package/src/ui/components/QuickActions.tsx +90 -0
  185. package/src/ui/components/Section.tsx +37 -0
  186. package/src/ui/components/SectionTitle.tsx +31 -0
  187. package/src/ui/components/bottomSheet/index.tsx +13 -11
  188. package/src/ui/components/index.ts +15 -0
  189. package/src/ui/navigation/OxyRouter.tsx +20 -3
  190. package/src/ui/navigation/types.ts +10 -1
  191. package/src/ui/screens/AccountCenterScreen.tsx +188 -159
  192. package/src/ui/screens/AccountManagementDemo.tsx +297 -0
  193. package/src/ui/screens/AccountOverviewScreen.tsx +474 -310
  194. package/src/ui/screens/AccountSettingsScreen.tsx +648 -463
  195. package/src/ui/screens/AccountSwitcherScreen.tsx +385 -449
  196. package/src/ui/screens/AppInfoScreen.tsx +571 -140
  197. package/src/ui/screens/BillingManagementScreen.tsx +589 -0
  198. package/src/ui/screens/FileManagementScreen.tsx +2513 -0
  199. package/src/ui/screens/PremiumSubscriptionScreen.tsx +1628 -0
  200. package/src/ui/screens/ProfileScreen.tsx +101 -7
  201. package/src/ui/screens/SessionManagementScreen.tsx +1 -0
  202. package/src/ui/screens/SignInScreen.tsx +1 -1
  203. package/src/ui/screens/SignUpScreen.tsx +1 -1
  204. package/src/utils/polyfills.ts +34 -0
  205. package/lib/commonjs/lib/sonner.web.js +0 -17
  206. package/lib/commonjs/lib/sonner.web.js.map +0 -1
  207. package/lib/module/lib/sonner.web.js +0 -4
  208. package/lib/module/lib/sonner.web.js.map +0 -1
  209. package/lib/typescript/__tests__/ui/screens/AccountSettingsScreen.test.d.ts +0 -2
  210. package/lib/typescript/__tests__/ui/screens/AccountSettingsScreen.test.d.ts.map +0 -1
  211. package/lib/typescript/lib/sonner.web.d.ts +0 -2
  212. package/lib/typescript/lib/sonner.web.d.ts.map +0 -1
  213. package/src/lib/sonner.web.ts +0 -1
@@ -0,0 +1,1620 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _react = _interopRequireWildcard(require("react"));
8
+ var _reactNative = require("react-native");
9
+ var _OxyContext = require("../context/OxyContext");
10
+ var _fonts = require("../styles/fonts");
11
+ var _sonner = require("../../lib/sonner");
12
+ var _vectorIcons = require("@expo/vector-icons");
13
+ var _jsxRuntime = require("react/jsx-runtime");
14
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
15
+ const PremiumSubscriptionScreen = ({
16
+ onClose,
17
+ theme,
18
+ navigate,
19
+ goBack
20
+ }) => {
21
+ const {
22
+ user,
23
+ oxyServices
24
+ } = (0, _OxyContext.useOxy)();
25
+ const [loading, setLoading] = (0, _react.useState)(true);
26
+ const [subscription, setSubscription] = (0, _react.useState)(null);
27
+ const [plans, setPlans] = (0, _react.useState)([]);
28
+ const [individualFeatures, setIndividualFeatures] = (0, _react.useState)([]);
29
+ const [selectedPlan, setSelectedPlan] = (0, _react.useState)(null);
30
+ const [processingPayment, setProcessingPayment] = (0, _react.useState)(false);
31
+ const [billingInterval, setBillingInterval] = (0, _react.useState)('month');
32
+ const [activeTab, setActiveTab] = (0, _react.useState)('plans');
33
+ const [currentAppPackage, setCurrentAppPackage] = (0, _react.useState)('mention'); // Default to mention for demo
34
+
35
+ const isDarkTheme = theme === 'dark';
36
+ const textColor = isDarkTheme ? '#FFFFFF' : '#000000';
37
+ const backgroundColor = isDarkTheme ? '#121212' : '#FFFFFF';
38
+ const secondaryBackgroundColor = isDarkTheme ? '#222222' : '#F5F5F5';
39
+ const borderColor = isDarkTheme ? '#444444' : '#E0E0E0';
40
+ const primaryColor = '#007AFF';
41
+ const successColor = '#30D158';
42
+ const warningColor = '#FF9500';
43
+ const dangerColor = '#FF3B30';
44
+
45
+ // Oxy+ subscription plans
46
+ const mockPlans = [{
47
+ id: 'mention-plus',
48
+ name: 'Mention+',
49
+ description: 'Enhanced features for better social experience',
50
+ price: 4.99,
51
+ currency: 'USD',
52
+ interval: 'month',
53
+ appScope: 'specific',
54
+ applicableApps: ['mention'],
55
+ // Only available in mention app
56
+ features: ['Undo posts option', 'Improved reading mode', 'Organize bookmarks into folders', 'Early access to select features', 'Edit posts capability', 'Enhanced customization options'],
57
+ includedFeatures: ['reading-mode-plus', 'custom-themes']
58
+ }, {
59
+ id: 'oxy-insider',
60
+ name: 'Oxy+ Insider',
61
+ description: 'Exclusive access to behind-the-scenes content',
62
+ price: 9.99,
63
+ currency: 'USD',
64
+ interval: 'month',
65
+ appScope: 'ecosystem',
66
+ applicableApps: ['mention', 'oxy-social', 'oxy-workspace', 'oxy-creator'],
67
+ features: ['Everything in Mention+', 'Behind-the-scenes updates from creators', 'Early access to new features', 'Dedicated support team', 'Exclusive content access', 'Beta feature testing'],
68
+ includedFeatures: ['reading-mode-plus', 'custom-themes', 'analytics-basic'],
69
+ isPopular: true
70
+ }, {
71
+ id: 'oxy-connect',
72
+ name: 'Oxy+ Connect',
73
+ description: 'Advanced networking and community features',
74
+ price: 14.99,
75
+ currency: 'USD',
76
+ interval: 'month',
77
+ appScope: 'ecosystem',
78
+ applicableApps: ['mention', 'oxy-social', 'oxy-workspace', 'oxy-creator'],
79
+ features: ['Everything in Oxy+ Insider', 'Create and join private groups', 'Advanced search and filtering tools', 'Customizable profile highlighting', 'Enhanced connection features', 'Priority in community events'],
80
+ includedFeatures: ['reading-mode-plus', 'custom-themes', 'analytics-basic', 'group-management']
81
+ }, {
82
+ id: 'oxy-premium',
83
+ name: 'Oxy+ Premium',
84
+ description: 'Complete premium experience with all perks',
85
+ price: 24.99,
86
+ currency: 'USD',
87
+ interval: 'month',
88
+ appScope: 'ecosystem',
89
+ applicableApps: ['mention', 'oxy-social', 'oxy-workspace', 'oxy-creator', 'oxy-analytics'],
90
+ features: ['Everything in Oxy+ Connect', 'Priority customer support', 'Access to premium content and events', 'Advanced analytics dashboard', 'VIP community status', 'Exclusive premium events'],
91
+ includedFeatures: ['reading-mode-plus', 'custom-themes', 'analytics-basic', 'analytics-advanced', 'group-management']
92
+ }, {
93
+ id: 'oxy-creator',
94
+ name: 'Oxy+ Creator',
95
+ description: 'Professional tools for content creators',
96
+ price: 39.99,
97
+ currency: 'USD',
98
+ interval: 'month',
99
+ appScope: 'ecosystem',
100
+ applicableApps: ['mention', 'oxy-social', 'oxy-workspace', 'oxy-creator', 'oxy-analytics', 'oxy-studio'],
101
+ features: ['Everything in Oxy+ Premium', 'Advanced analytics and insights', 'Promotional tools and resources', 'Content monetization features', 'Creator support program', 'Revenue sharing opportunities'],
102
+ includedFeatures: ['reading-mode-plus', 'custom-themes', 'analytics-basic', 'analytics-advanced', 'group-management', 'creator-tools', 'monetization-features']
103
+ }];
104
+
105
+ // Individual feature subscriptions
106
+ const mockIndividualFeatures = [{
107
+ id: 'analytics-basic',
108
+ name: 'Basic Analytics',
109
+ description: 'View post performance and engagement metrics',
110
+ price: 2.99,
111
+ currency: 'USD',
112
+ interval: 'month',
113
+ category: 'analytics',
114
+ appScope: 'ecosystem',
115
+ applicableApps: ['mention', 'oxy-social', 'oxy-workspace'],
116
+ canBePurchasedSeparately: true,
117
+ includedInPlans: ['oxy-insider', 'oxy-connect', 'oxy-premium', 'oxy-creator']
118
+ }, {
119
+ id: 'analytics-advanced',
120
+ name: 'Advanced Analytics',
121
+ description: 'Detailed insights, trends, and audience demographics',
122
+ price: 7.99,
123
+ currency: 'USD',
124
+ interval: 'month',
125
+ category: 'analytics',
126
+ appScope: 'ecosystem',
127
+ applicableApps: ['mention', 'oxy-social', 'oxy-workspace', 'oxy-creator', 'oxy-analytics'],
128
+ canBePurchasedSeparately: true,
129
+ includedInPlans: ['oxy-premium', 'oxy-creator']
130
+ }, {
131
+ id: 'custom-themes',
132
+ name: 'Custom Themes',
133
+ description: 'Personalize your app with custom colors and layouts',
134
+ price: 1.99,
135
+ currency: 'USD',
136
+ interval: 'month',
137
+ category: 'customization',
138
+ appScope: 'ecosystem',
139
+ applicableApps: ['mention', 'oxy-social', 'oxy-workspace', 'oxy-creator'],
140
+ canBePurchasedSeparately: false,
141
+ // Included in all plans
142
+ includedInPlans: ['mention-plus', 'oxy-insider', 'oxy-connect', 'oxy-premium', 'oxy-creator']
143
+ }, {
144
+ id: 'reading-mode-plus',
145
+ name: 'Reading Mode Plus',
146
+ description: 'Enhanced reading experience with focus modes',
147
+ price: 1.99,
148
+ currency: 'USD',
149
+ interval: 'month',
150
+ category: 'content',
151
+ appScope: 'specific',
152
+ applicableApps: ['mention', 'oxy-social'],
153
+ canBePurchasedSeparately: false,
154
+ // Included in all plans
155
+ includedInPlans: ['mention-plus', 'oxy-insider', 'oxy-connect', 'oxy-premium', 'oxy-creator']
156
+ }, {
157
+ id: 'group-management',
158
+ name: 'Group Management',
159
+ description: 'Create and manage private groups and communities',
160
+ price: 4.99,
161
+ currency: 'USD',
162
+ interval: 'month',
163
+ category: 'networking',
164
+ appScope: 'ecosystem',
165
+ applicableApps: ['mention', 'oxy-social', 'oxy-workspace'],
166
+ canBePurchasedSeparately: true,
167
+ includedInPlans: ['oxy-connect', 'oxy-premium', 'oxy-creator']
168
+ }, {
169
+ id: 'creator-tools',
170
+ name: 'Creator Tools Suite',
171
+ description: 'Professional content creation and editing tools',
172
+ price: 9.99,
173
+ currency: 'USD',
174
+ interval: 'month',
175
+ category: 'productivity',
176
+ appScope: 'specific',
177
+ applicableApps: ['oxy-creator', 'oxy-studio'],
178
+ canBePurchasedSeparately: true,
179
+ includedInPlans: ['oxy-creator']
180
+ }, {
181
+ id: 'monetization-features',
182
+ name: 'Monetization Features',
183
+ description: 'Revenue sharing, sponsorship tools, and creator fund access',
184
+ price: 12.99,
185
+ currency: 'USD',
186
+ interval: 'month',
187
+ category: 'productivity',
188
+ appScope: 'specific',
189
+ applicableApps: ['oxy-creator'],
190
+ canBePurchasedSeparately: true,
191
+ includedInPlans: ['oxy-creator']
192
+ }, {
193
+ id: 'workspace-collaboration',
194
+ name: 'Workspace Collaboration',
195
+ description: 'Advanced team features and project management tools',
196
+ price: 6.99,
197
+ currency: 'USD',
198
+ interval: 'month',
199
+ category: 'productivity',
200
+ appScope: 'specific',
201
+ applicableApps: ['oxy-workspace'],
202
+ canBePurchasedSeparately: true,
203
+ includedInPlans: ['oxy-premium', 'oxy-creator']
204
+ }];
205
+ (0, _react.useEffect)(() => {
206
+ detectCurrentApp();
207
+ }, []);
208
+ (0, _react.useEffect)(() => {
209
+ if (currentAppPackage) {
210
+ loadSubscriptionData();
211
+ }
212
+ }, [currentAppPackage, user?.isPremium]);
213
+ const detectCurrentApp = () => {
214
+ // In a real implementation, this would detect the actual app package name
215
+ // For now, we'll use a mock detection based on available methods
216
+
217
+ // Real app detection methods you could use:
218
+ // 1. Check bundle identifier in React Native:
219
+ // import DeviceInfo from 'react-native-device-info';
220
+ // const bundleId = DeviceInfo.getBundleId();
221
+ // Example: com.oxy.mention -> 'mention'
222
+
223
+ // 2. Environment variables or build configuration
224
+ // const appPackage = __DEV__ ? process.env.APP_PACKAGE : 'mention';
225
+
226
+ // 3. Check specific app capabilities or modules
227
+ // if (typeof MentionModule !== 'undefined') return 'mention';
228
+ // if (typeof OxyWorkspaceModule !== 'undefined') return 'oxy-workspace';
229
+
230
+ // 4. Use build-time configuration with Metro or similar
231
+ // const appPackage = require('../config/app.json').packageName;
232
+
233
+ // For demo purposes, we'll simulate different apps
234
+ // You would replace this with actual app detection logic
235
+
236
+ // IMPORTANT: This ensures subscription restrictions work properly:
237
+ // - Mention+ plan can only be subscribed to when app package == 'mention'
238
+ // - Other app-specific plans follow the same pattern
239
+ // - Ecosystem plans work across all apps
240
+
241
+ const detectedApp = 'mention'; // This would be dynamic in real implementation
242
+
243
+ setCurrentAppPackage(detectedApp);
244
+
245
+ // Log for debugging
246
+ console.log('Detected app package:', detectedApp);
247
+ console.log('Available plans for this app will be filtered accordingly');
248
+ };
249
+ const loadSubscriptionData = async () => {
250
+ try {
251
+ setLoading(true);
252
+
253
+ // Filter plans available for current app
254
+ const availablePlans = mockPlans.filter(plan => plan.applicableApps.includes(currentAppPackage));
255
+ setPlans(availablePlans);
256
+
257
+ // Mock current subscription
258
+ let currentSubscription = null;
259
+ if (user?.isPremium) {
260
+ currentSubscription = {
261
+ id: 'sub_12345',
262
+ planId: 'oxy-insider',
263
+ status: 'active',
264
+ currentPeriodStart: new Date().toISOString(),
265
+ currentPeriodEnd: new Date(Date.now() + 30 * 24 * 60 * 60 * 1000).toISOString(),
266
+ cancelAtPeriodEnd: false
267
+ };
268
+ setSubscription(currentSubscription);
269
+ }
270
+
271
+ // Filter features available for current app and update based on current subscription
272
+ const availableFeatures = mockIndividualFeatures.filter(feature => feature.applicableApps.includes(currentAppPackage));
273
+ const updatedFeatures = availableFeatures.map(feature => {
274
+ const isIncludedInCurrentPlan = !!(currentSubscription && feature.includedInPlans.includes(currentSubscription.planId));
275
+ return {
276
+ ...feature,
277
+ isIncludedInCurrentPlan,
278
+ isSubscribed: isIncludedInCurrentPlan ? true : false // Mock some individual subscriptions
279
+ };
280
+ });
281
+ setIndividualFeatures(updatedFeatures);
282
+ } catch (error) {
283
+ console.error('Failed to load subscription data:', error);
284
+ _sonner.toast.error('Failed to load subscription information');
285
+ } finally {
286
+ setLoading(false);
287
+ }
288
+ };
289
+ const handlePlanSelection = planId => {
290
+ setSelectedPlan(planId);
291
+ };
292
+ const handleSubscribe = async planId => {
293
+ try {
294
+ // Check if plan is available for current app
295
+ const selectedPlan = mockPlans.find(plan => plan.id === planId);
296
+ if (!selectedPlan?.applicableApps.includes(currentAppPackage)) {
297
+ console.log(`❌ Subscription blocked: Plan "${selectedPlan?.name}" not available for app "${currentAppPackage}"`);
298
+ _sonner.toast.error(`This plan is not available for the current app (${currentAppPackage})`);
299
+ return;
300
+ }
301
+
302
+ // Special restriction for Mention+ plan - only available in mention app
303
+ if (planId === 'mention-plus' && currentAppPackage !== 'mention') {
304
+ console.log(`❌ Subscription blocked: Mention+ plan requires app to be "mention", current app is "${currentAppPackage}"`);
305
+ _sonner.toast.error('Mention+ is only available in the Mention app');
306
+ return;
307
+ }
308
+ console.log(`✅ Subscription allowed: Plan "${selectedPlan.name}" is available for app "${currentAppPackage}"`);
309
+ setProcessingPayment(true);
310
+
311
+ // Mock payment processing
312
+ await new Promise(resolve => setTimeout(resolve, 2000));
313
+ _sonner.toast.success('Subscription activated successfully!');
314
+
315
+ // Mock subscription update
316
+ setSubscription({
317
+ id: 'sub_' + Date.now(),
318
+ planId,
319
+ status: 'active',
320
+ currentPeriodStart: new Date().toISOString(),
321
+ currentPeriodEnd: new Date(Date.now() + 30 * 24 * 60 * 60 * 1000).toISOString(),
322
+ cancelAtPeriodEnd: false
323
+ });
324
+
325
+ // Reload data to update feature states
326
+ loadSubscriptionData();
327
+ } catch (error) {
328
+ console.error('Payment failed:', error);
329
+ _sonner.toast.error('Payment failed. Please try again.');
330
+ } finally {
331
+ setProcessingPayment(false);
332
+ }
333
+ };
334
+ const handleCancelSubscription = () => {
335
+ _reactNative.Alert.alert('Cancel Subscription', 'Are you sure you want to cancel your subscription? You will lose access to premium features at the end of your current billing period.', [{
336
+ text: 'Keep Subscription',
337
+ style: 'cancel'
338
+ }, {
339
+ text: 'Cancel Subscription',
340
+ style: 'destructive',
341
+ onPress: async () => {
342
+ try {
343
+ // Mock cancellation
344
+ setSubscription(prev => prev ? {
345
+ ...prev,
346
+ cancelAtPeriodEnd: true
347
+ } : null);
348
+ _sonner.toast.success('Subscription will be canceled at the end of the billing period');
349
+ } catch (error) {
350
+ _sonner.toast.error('Failed to cancel subscription');
351
+ }
352
+ }
353
+ }]);
354
+ };
355
+ const handleReactivateSubscription = async () => {
356
+ try {
357
+ setSubscription(prev => prev ? {
358
+ ...prev,
359
+ cancelAtPeriodEnd: false
360
+ } : null);
361
+ _sonner.toast.success('Subscription reactivated successfully');
362
+ } catch (error) {
363
+ _sonner.toast.error('Failed to reactivate subscription');
364
+ }
365
+ };
366
+ const formatPrice = (price, currency, interval) => {
367
+ const yearlyPrice = interval === 'year' ? price : price * 12 * 0.8; // 20% discount for yearly
368
+ const displayPrice = billingInterval === 'year' ? yearlyPrice : price;
369
+ return {
370
+ price: displayPrice,
371
+ formatted: `$${displayPrice.toFixed(2)}`,
372
+ interval: billingInterval === 'year' ? 'year' : 'month'
373
+ };
374
+ };
375
+ const getCurrentPlan = () => {
376
+ if (!subscription) return null;
377
+ return plans.find(plan => plan.id === subscription.planId);
378
+ };
379
+ const handleFeatureSubscribe = async featureId => {
380
+ try {
381
+ // Check if feature is available for current app
382
+ const selectedFeature = mockIndividualFeatures.find(feature => feature.id === featureId);
383
+ if (!selectedFeature?.applicableApps.includes(currentAppPackage)) {
384
+ _sonner.toast.error(`This feature is not available for the current app (${currentAppPackage})`);
385
+ return;
386
+ }
387
+
388
+ // Special restrictions for app-specific features
389
+ if (selectedFeature.appScope === 'specific') {
390
+ // For features that are only available in specific apps, enforce strict matching
391
+ const hasExactMatch = selectedFeature.applicableApps.length === 1 && selectedFeature.applicableApps[0] === currentAppPackage;
392
+ if (!hasExactMatch && selectedFeature.applicableApps.length === 1) {
393
+ const requiredApp = selectedFeature.applicableApps[0];
394
+ _sonner.toast.error(`${selectedFeature.name} is only available in the ${requiredApp} app`);
395
+ return;
396
+ }
397
+ }
398
+ setProcessingPayment(true);
399
+
400
+ // Mock feature subscription
401
+ await new Promise(resolve => setTimeout(resolve, 1500));
402
+ setIndividualFeatures(prev => prev.map(feature => feature.id === featureId ? {
403
+ ...feature,
404
+ isSubscribed: true
405
+ } : feature));
406
+ const feature = individualFeatures.find(f => f.id === featureId);
407
+ _sonner.toast.success(`Subscribed to ${feature?.name} successfully!`);
408
+ } catch (error) {
409
+ console.error('Feature subscription failed:', error);
410
+ _sonner.toast.error('Feature subscription failed. Please try again.');
411
+ } finally {
412
+ setProcessingPayment(false);
413
+ }
414
+ };
415
+ const handleFeatureUnsubscribe = async featureId => {
416
+ const feature = individualFeatures.find(f => f.id === featureId);
417
+ _reactNative.Alert.alert('Unsubscribe Feature', `Are you sure you want to unsubscribe from ${feature?.name}?`, [{
418
+ text: 'Keep Feature',
419
+ style: 'cancel'
420
+ }, {
421
+ text: 'Unsubscribe',
422
+ style: 'destructive',
423
+ onPress: async () => {
424
+ try {
425
+ setIndividualFeatures(prev => prev.map(f => f.id === featureId ? {
426
+ ...f,
427
+ isSubscribed: false
428
+ } : f));
429
+ _sonner.toast.success(`Unsubscribed from ${feature?.name}`);
430
+ } catch (error) {
431
+ _sonner.toast.error('Failed to unsubscribe from feature');
432
+ }
433
+ }
434
+ }]);
435
+ };
436
+ const renderHeader = () => {
437
+ const getAppDisplayName = packageName => {
438
+ const appNames = {
439
+ 'mention': 'Mention',
440
+ 'oxy-social': 'Oxy Social',
441
+ 'oxy-workspace': 'Oxy Workspace',
442
+ 'oxy-creator': 'Oxy Creator',
443
+ 'oxy-analytics': 'Oxy Analytics',
444
+ 'oxy-studio': 'Oxy Studio'
445
+ };
446
+ return appNames[packageName] || packageName;
447
+ };
448
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
449
+ style: [styles.header, {
450
+ borderBottomColor: borderColor
451
+ }],
452
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
453
+ style: styles.backButton,
454
+ onPress: goBack,
455
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_vectorIcons.Ionicons, {
456
+ name: "arrow-back",
457
+ size: 24,
458
+ color: textColor
459
+ })
460
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
461
+ style: styles.headerTitleContainer,
462
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
463
+ style: [styles.headerTitle, {
464
+ color: textColor
465
+ }],
466
+ children: "Oxy+ Subscriptions"
467
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
468
+ style: [styles.currentAppText, {
469
+ color: isDarkTheme ? '#BBBBBB' : '#666666'
470
+ }],
471
+ children: ["for ", getAppDisplayName(currentAppPackage)]
472
+ })]
473
+ }), onClose && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
474
+ style: styles.closeButton,
475
+ onPress: onClose,
476
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_vectorIcons.Ionicons, {
477
+ name: "close",
478
+ size: 24,
479
+ color: textColor
480
+ })
481
+ })]
482
+ });
483
+ };
484
+ const renderCurrentSubscription = () => {
485
+ if (!subscription) return null;
486
+ const currentPlan = getCurrentPlan();
487
+ if (!currentPlan) return null;
488
+ const statusColor = subscription.status === 'active' ? successColor : subscription.status === 'trialing' ? warningColor : dangerColor;
489
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
490
+ style: styles.section,
491
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
492
+ style: [styles.sectionTitle, {
493
+ color: textColor
494
+ }],
495
+ children: "Current Subscription"
496
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
497
+ style: [styles.currentSubscriptionCard, {
498
+ backgroundColor: secondaryBackgroundColor,
499
+ borderColor
500
+ }],
501
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
502
+ style: styles.subscriptionHeader,
503
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
504
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
505
+ style: [styles.planName, {
506
+ color: textColor
507
+ }],
508
+ children: currentPlan.name
509
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
510
+ style: [styles.planPrice, {
511
+ color: primaryColor
512
+ }],
513
+ children: ["$", currentPlan.price, "/month"]
514
+ })]
515
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
516
+ style: [styles.statusBadge, {
517
+ backgroundColor: statusColor
518
+ }],
519
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
520
+ style: styles.statusText,
521
+ children: subscription.status.toUpperCase()
522
+ })
523
+ })]
524
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
525
+ style: [styles.subscriptionDetail, {
526
+ color: isDarkTheme ? '#BBBBBB' : '#666666'
527
+ }],
528
+ children: ["Renews on ", new Date(subscription.currentPeriodEnd).toLocaleDateString()]
529
+ }), subscription.cancelAtPeriodEnd && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
530
+ style: styles.cancelNotice,
531
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_vectorIcons.Ionicons, {
532
+ name: "warning",
533
+ size: 16,
534
+ color: warningColor
535
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
536
+ style: [styles.cancelText, {
537
+ color: warningColor
538
+ }],
539
+ children: ["Subscription will cancel on ", new Date(subscription.currentPeriodEnd).toLocaleDateString()]
540
+ })]
541
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
542
+ style: styles.subscriptionActions,
543
+ children: [subscription.cancelAtPeriodEnd ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
544
+ style: [styles.actionButton, {
545
+ backgroundColor: successColor
546
+ }],
547
+ onPress: handleReactivateSubscription,
548
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
549
+ style: styles.actionButtonText,
550
+ children: "Reactivate"
551
+ })
552
+ }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
553
+ style: [styles.actionButton, {
554
+ backgroundColor: dangerColor
555
+ }],
556
+ onPress: handleCancelSubscription,
557
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
558
+ style: styles.actionButtonText,
559
+ children: "Cancel Subscription"
560
+ })
561
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
562
+ style: [styles.actionButton, styles.secondaryButton, {
563
+ borderColor
564
+ }],
565
+ onPress: () => navigate && navigate('BillingManagement'),
566
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
567
+ style: [styles.actionButtonText, {
568
+ color: textColor
569
+ }],
570
+ children: "Manage Billing"
571
+ })
572
+ })]
573
+ })]
574
+ })]
575
+ });
576
+ };
577
+ const renderBillingToggle = () => /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
578
+ style: styles.section,
579
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
580
+ style: styles.billingToggle,
581
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
582
+ style: [styles.billingOption, billingInterval === 'month' && {
583
+ backgroundColor: primaryColor
584
+ }],
585
+ onPress: () => setBillingInterval('month'),
586
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
587
+ style: [styles.billingOptionText, {
588
+ color: billingInterval === 'month' ? '#FFFFFF' : textColor
589
+ }],
590
+ children: "Monthly"
591
+ })
592
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
593
+ style: [styles.billingOption, billingInterval === 'year' && {
594
+ backgroundColor: primaryColor
595
+ }],
596
+ onPress: () => setBillingInterval('year'),
597
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
598
+ style: [styles.billingOptionText, {
599
+ color: billingInterval === 'year' ? '#FFFFFF' : textColor
600
+ }],
601
+ children: "Yearly"
602
+ })
603
+ })]
604
+ }), billingInterval === 'year' && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
605
+ style: [styles.savingsText, {
606
+ color: successColor
607
+ }],
608
+ children: "\uD83D\uDCB0 Save 20% with yearly billing"
609
+ })]
610
+ });
611
+ const renderPlanCard = plan => {
612
+ const pricing = formatPrice(plan.price, plan.currency, plan.interval);
613
+ const isSelected = selectedPlan === plan.id;
614
+ const isCurrentPlan = subscription?.planId === plan.id;
615
+ const isAppSpecific = plan.appScope === 'specific' && plan.applicableApps.length === 1;
616
+ const isAvailableForCurrentApp = plan.applicableApps.includes(currentAppPackage);
617
+ const getAppScopeText = () => {
618
+ if (plan.appScope === 'ecosystem') {
619
+ return 'Works across all Oxy apps';
620
+ } else if (isAppSpecific) {
621
+ const appName = plan.applicableApps[0];
622
+ return `Exclusive to ${appName} app`;
623
+ } else {
624
+ return `Available in: ${plan.applicableApps.join(', ')}`;
625
+ }
626
+ };
627
+ const getAvailabilityStatus = () => {
628
+ if (isAppSpecific && !isAvailableForCurrentApp) {
629
+ const requiredApp = plan.applicableApps[0];
630
+ return {
631
+ available: false,
632
+ reason: `Only available in ${requiredApp} app`
633
+ };
634
+ }
635
+ return {
636
+ available: true,
637
+ reason: null
638
+ };
639
+ };
640
+ const availability = getAvailabilityStatus();
641
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
642
+ style: [styles.planCard, {
643
+ backgroundColor: secondaryBackgroundColor,
644
+ borderColor
645
+ }, isSelected && {
646
+ borderColor: primaryColor,
647
+ borderWidth: 2
648
+ }, plan.isPopular && styles.popularPlan, !availability.available && {
649
+ opacity: 0.6
650
+ }],
651
+ children: [plan.isPopular && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
652
+ style: [styles.popularBadge, {
653
+ backgroundColor: primaryColor
654
+ }],
655
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
656
+ style: styles.popularText,
657
+ children: "MOST POPULAR"
658
+ })
659
+ }), isAppSpecific && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
660
+ style: [styles.appSpecificBadge, {
661
+ backgroundColor: isAvailableForCurrentApp ? successColor : warningColor
662
+ }],
663
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
664
+ style: styles.appSpecificText,
665
+ children: isAvailableForCurrentApp ? 'App Exclusive' : 'Not Available'
666
+ })
667
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
668
+ style: styles.planHeader,
669
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
670
+ style: [styles.planName, {
671
+ color: textColor
672
+ }],
673
+ children: plan.name
674
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
675
+ style: [styles.planDescription, {
676
+ color: isDarkTheme ? '#BBBBBB' : '#666666'
677
+ }],
678
+ children: plan.description
679
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
680
+ style: [styles.planAppScope, {
681
+ color: isDarkTheme ? '#888888' : '#999999'
682
+ }],
683
+ children: getAppScopeText()
684
+ }), !availability.available && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
685
+ style: [styles.planRestrictionText, {
686
+ color: dangerColor
687
+ }],
688
+ children: availability.reason
689
+ })]
690
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
691
+ style: styles.planPricing,
692
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
693
+ style: [styles.planPrice, {
694
+ color: textColor
695
+ }],
696
+ children: pricing.formatted
697
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
698
+ style: [styles.planInterval, {
699
+ color: isDarkTheme ? '#BBBBBB' : '#666666'
700
+ }],
701
+ children: ["per ", pricing.interval]
702
+ })]
703
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
704
+ style: styles.planFeatures,
705
+ children: plan.features.map((feature, index) => /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
706
+ style: styles.featureItem,
707
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_vectorIcons.Ionicons, {
708
+ name: "checkmark",
709
+ size: 16,
710
+ color: successColor
711
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
712
+ style: [styles.featureText, {
713
+ color: textColor
714
+ }],
715
+ children: feature
716
+ })]
717
+ }, index))
718
+ }), isCurrentPlan ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
719
+ style: [styles.currentPlanButton, {
720
+ backgroundColor: successColor
721
+ }],
722
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
723
+ style: styles.currentPlanText,
724
+ children: "Current Plan"
725
+ })
726
+ }) : !availability.available ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
727
+ style: [styles.unavailablePlanButton, {
728
+ backgroundColor: isDarkTheme ? '#444444' : '#E0E0E0'
729
+ }],
730
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
731
+ style: [styles.unavailablePlanText, {
732
+ color: isDarkTheme ? '#888888' : '#999999'
733
+ }],
734
+ children: "Not Available in Current App"
735
+ })
736
+ }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
737
+ style: [styles.selectPlanButton, {
738
+ backgroundColor: plan.isPopular ? primaryColor : borderColor
739
+ }],
740
+ onPress: () => handleSubscribe(plan.id),
741
+ disabled: processingPayment,
742
+ children: processingPayment ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.ActivityIndicator, {
743
+ color: "#FFFFFF",
744
+ size: "small"
745
+ }) : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
746
+ style: [styles.selectPlanText, {
747
+ color: plan.isPopular ? '#FFFFFF' : textColor
748
+ }],
749
+ children: ["Subscribe to ", plan.name]
750
+ })
751
+ })]
752
+ }, plan.id);
753
+ };
754
+ const renderTabNavigation = () => /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
755
+ style: styles.section,
756
+ children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
757
+ style: [styles.tabContainer, {
758
+ borderBottomColor: borderColor
759
+ }],
760
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
761
+ style: [styles.tab, activeTab === 'plans' && {
762
+ borderBottomColor: primaryColor,
763
+ borderBottomWidth: 2
764
+ }],
765
+ onPress: () => setActiveTab('plans'),
766
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
767
+ style: [styles.tabText, {
768
+ color: activeTab === 'plans' ? primaryColor : textColor
769
+ }],
770
+ children: "Full Plans"
771
+ })
772
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
773
+ style: [styles.tab, activeTab === 'features' && {
774
+ borderBottomColor: primaryColor,
775
+ borderBottomWidth: 2
776
+ }],
777
+ onPress: () => setActiveTab('features'),
778
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
779
+ style: [styles.tabText, {
780
+ color: activeTab === 'features' ? primaryColor : textColor
781
+ }],
782
+ children: "Individual Features"
783
+ })
784
+ })]
785
+ })
786
+ });
787
+ const renderFeatureCard = feature => {
788
+ const pricing = formatPrice(feature.price, feature.currency, feature.interval);
789
+ const isSubscribed = feature.isSubscribed;
790
+ const isIncludedInCurrentPlan = feature.isIncludedInCurrentPlan;
791
+ const canPurchase = feature.canBePurchasedSeparately && !isIncludedInCurrentPlan;
792
+ const getCategoryColor = category => {
793
+ switch (category) {
794
+ case 'analytics':
795
+ return '#FF9500';
796
+ case 'customization':
797
+ return '#5856D6';
798
+ case 'content':
799
+ return '#30D158';
800
+ case 'networking':
801
+ return '#007AFF';
802
+ case 'productivity':
803
+ return '#FF3B30';
804
+ default:
805
+ return primaryColor;
806
+ }
807
+ };
808
+ const getCategoryIcon = category => {
809
+ switch (category) {
810
+ case 'analytics':
811
+ return 'analytics';
812
+ case 'customization':
813
+ return 'color-palette';
814
+ case 'content':
815
+ return 'document-text';
816
+ case 'networking':
817
+ return 'people';
818
+ case 'productivity':
819
+ return 'briefcase';
820
+ default:
821
+ return 'star';
822
+ }
823
+ };
824
+ const getAppScopeText = () => {
825
+ if (feature.appScope === 'ecosystem') {
826
+ return 'Available across all Oxy apps';
827
+ } else {
828
+ return `Available in: ${feature.applicableApps.join(', ')}`;
829
+ }
830
+ };
831
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
832
+ style: [styles.featureCard, {
833
+ backgroundColor: secondaryBackgroundColor,
834
+ borderColor
835
+ }, isSubscribed && {
836
+ borderColor: successColor,
837
+ borderWidth: 2
838
+ }, isIncludedInCurrentPlan && {
839
+ borderColor: primaryColor,
840
+ borderWidth: 2
841
+ }],
842
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
843
+ style: styles.featureHeader,
844
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
845
+ style: styles.featureIconContainer,
846
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_vectorIcons.Ionicons, {
847
+ name: getCategoryIcon(feature.category),
848
+ size: 24,
849
+ color: getCategoryColor(feature.category)
850
+ })
851
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
852
+ style: styles.featureInfo,
853
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
854
+ style: styles.featureNameRow,
855
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
856
+ style: [styles.featureName, {
857
+ color: textColor
858
+ }],
859
+ children: feature.name
860
+ }), isIncludedInCurrentPlan && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
861
+ style: [styles.includedBadge, {
862
+ backgroundColor: primaryColor
863
+ }],
864
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
865
+ style: styles.includedBadgeText,
866
+ children: "Included"
867
+ })
868
+ })]
869
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
870
+ style: [styles.featureDescription, {
871
+ color: isDarkTheme ? '#BBBBBB' : '#666666'
872
+ }],
873
+ children: feature.description
874
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
875
+ style: [styles.appScopeText, {
876
+ color: isDarkTheme ? '#888888' : '#999999'
877
+ }],
878
+ children: getAppScopeText()
879
+ })]
880
+ })]
881
+ }), !isIncludedInCurrentPlan && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
882
+ style: styles.featurePricing,
883
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
884
+ style: [styles.featurePrice, {
885
+ color: textColor
886
+ }],
887
+ children: pricing.formatted
888
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
889
+ style: [styles.featureInterval, {
890
+ color: isDarkTheme ? '#BBBBBB' : '#666666'
891
+ }],
892
+ children: ["per ", pricing.interval]
893
+ })]
894
+ }), isIncludedInCurrentPlan ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
895
+ style: [styles.includedInPlanButton, {
896
+ backgroundColor: primaryColor
897
+ }],
898
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_vectorIcons.Ionicons, {
899
+ name: "checkmark-circle",
900
+ size: 16,
901
+ color: "#FFFFFF"
902
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
903
+ style: styles.includedInPlanText,
904
+ children: "Included in your plan"
905
+ })]
906
+ }) : isSubscribed ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
907
+ style: styles.featureActions,
908
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
909
+ style: [styles.subscribedButton, {
910
+ backgroundColor: successColor
911
+ }],
912
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_vectorIcons.Ionicons, {
913
+ name: "checkmark",
914
+ size: 16,
915
+ color: "#FFFFFF"
916
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
917
+ style: styles.subscribedText,
918
+ children: "Subscribed"
919
+ })]
920
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
921
+ style: [styles.unsubscribeButton, {
922
+ borderColor: dangerColor
923
+ }],
924
+ onPress: () => handleFeatureUnsubscribe(feature.id),
925
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
926
+ style: [styles.unsubscribeText, {
927
+ color: dangerColor
928
+ }],
929
+ children: "Unsubscribe"
930
+ })
931
+ })]
932
+ }) : canPurchase ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
933
+ style: [styles.subscribeFeatureButton, {
934
+ backgroundColor: primaryColor
935
+ }],
936
+ onPress: () => handleFeatureSubscribe(feature.id),
937
+ disabled: processingPayment,
938
+ children: processingPayment ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.ActivityIndicator, {
939
+ color: "#FFFFFF",
940
+ size: "small"
941
+ }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
942
+ style: styles.subscribeFeatureText,
943
+ children: "Subscribe"
944
+ })
945
+ }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
946
+ style: [styles.unavailableButton, {
947
+ backgroundColor: isDarkTheme ? '#444444' : '#E0E0E0'
948
+ }],
949
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
950
+ style: [styles.unavailableText, {
951
+ color: isDarkTheme ? '#888888' : '#999999'
952
+ }],
953
+ children: "Only available in subscription plans"
954
+ })
955
+ })]
956
+ }, feature.id);
957
+ };
958
+ const renderIndividualFeatures = () => {
959
+ const categories = ['analytics', 'customization', 'content', 'networking', 'productivity'];
960
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
961
+ style: styles.section,
962
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
963
+ style: [styles.sectionTitle, {
964
+ color: textColor
965
+ }],
966
+ children: "Individual Features"
967
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
968
+ style: [styles.sectionSubtitle, {
969
+ color: isDarkTheme ? '#BBBBBB' : '#666666'
970
+ }],
971
+ children: "Subscribe to specific features you need. Some features are included in subscription plans."
972
+ }), categories.map(category => {
973
+ const categoryFeatures = individualFeatures.filter(f => f.category === category);
974
+ if (categoryFeatures.length === 0) return null;
975
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
976
+ style: styles.categorySection,
977
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
978
+ style: [styles.categoryTitle, {
979
+ color: textColor
980
+ }],
981
+ children: category.charAt(0).toUpperCase() + category.slice(1)
982
+ }), categoryFeatures.map(renderFeatureCard)]
983
+ }, category);
984
+ })]
985
+ });
986
+ };
987
+
988
+ // Add this for testing different app contexts (remove in production)
989
+ const [showAppSwitcher, setShowAppSwitcher] = (0, _react.useState)(__DEV__); // Only show in development
990
+
991
+ const renderAppSwitcher = () => {
992
+ if (!showAppSwitcher) return null;
993
+ const testApps = ['mention', 'oxy-social', 'oxy-workspace', 'oxy-creator'];
994
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
995
+ style: [styles.appSwitcher, {
996
+ backgroundColor: isDarkTheme ? '#333333' : '#F0F0F0',
997
+ borderColor
998
+ }],
999
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
1000
+ style: [styles.appSwitcherTitle, {
1001
+ color: textColor
1002
+ }],
1003
+ children: "\uD83E\uDDEA Test App Context (Dev Only)"
1004
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.ScrollView, {
1005
+ horizontal: true,
1006
+ showsHorizontalScrollIndicator: false,
1007
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
1008
+ style: styles.appSwitcherButtons,
1009
+ children: testApps.map(app => /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
1010
+ style: [styles.appSwitcherButton, {
1011
+ backgroundColor: currentAppPackage === app ? primaryColor : 'transparent',
1012
+ borderColor: primaryColor
1013
+ }],
1014
+ onPress: () => {
1015
+ setCurrentAppPackage(app);
1016
+ console.log('Switched to app context:', app);
1017
+ },
1018
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
1019
+ style: [styles.appSwitcherButtonText, {
1020
+ color: currentAppPackage === app ? '#FFFFFF' : textColor
1021
+ }],
1022
+ children: app
1023
+ })
1024
+ }, app))
1025
+ })
1026
+ })]
1027
+ });
1028
+ };
1029
+ if (loading) {
1030
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
1031
+ style: [styles.container, {
1032
+ backgroundColor,
1033
+ justifyContent: 'center'
1034
+ }],
1035
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.ActivityIndicator, {
1036
+ size: "large",
1037
+ color: primaryColor
1038
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
1039
+ style: [styles.loadingText, {
1040
+ color: textColor
1041
+ }],
1042
+ children: "Loading subscription plans..."
1043
+ })]
1044
+ });
1045
+ }
1046
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
1047
+ style: [styles.container, {
1048
+ backgroundColor
1049
+ }],
1050
+ children: [renderHeader(), renderAppSwitcher(), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.ScrollView, {
1051
+ style: styles.content,
1052
+ showsVerticalScrollIndicator: false,
1053
+ children: [subscription && renderCurrentSubscription(), !subscription && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
1054
+ style: styles.section,
1055
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
1056
+ style: [styles.sectionTitle, {
1057
+ color: textColor
1058
+ }],
1059
+ children: "Choose Your Plan"
1060
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
1061
+ style: [styles.sectionSubtitle, {
1062
+ color: isDarkTheme ? '#BBBBBB' : '#666666'
1063
+ }],
1064
+ children: "Unlock premium features and take your experience to the next level"
1065
+ })]
1066
+ }), !subscription && renderTabNavigation(), !subscription && activeTab === 'plans' && renderBillingToggle(), activeTab === 'plans' ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
1067
+ style: styles.section,
1068
+ children: [!subscription && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
1069
+ style: [styles.sectionTitle, {
1070
+ color: textColor
1071
+ }],
1072
+ children: "Available Plans"
1073
+ }), plans.map(renderPlanCard)]
1074
+ }) : renderIndividualFeatures(), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
1075
+ style: styles.section,
1076
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
1077
+ style: [styles.sectionTitle, {
1078
+ color: textColor
1079
+ }],
1080
+ children: "Why Go Premium?"
1081
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
1082
+ style: [styles.benefitsCard, {
1083
+ backgroundColor: secondaryBackgroundColor,
1084
+ borderColor
1085
+ }],
1086
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
1087
+ style: styles.benefitItem,
1088
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_vectorIcons.Ionicons, {
1089
+ name: "flash",
1090
+ size: 24,
1091
+ color: primaryColor
1092
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
1093
+ style: styles.benefitContent,
1094
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
1095
+ style: [styles.benefitTitle, {
1096
+ color: textColor
1097
+ }],
1098
+ children: "Enhanced Performance"
1099
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
1100
+ style: [styles.benefitDescription, {
1101
+ color: isDarkTheme ? '#BBBBBB' : '#666666'
1102
+ }],
1103
+ children: "Faster processing and priority access to our servers"
1104
+ })]
1105
+ })]
1106
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
1107
+ style: styles.benefitItem,
1108
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_vectorIcons.Ionicons, {
1109
+ name: "shield-checkmark",
1110
+ size: 24,
1111
+ color: successColor
1112
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
1113
+ style: styles.benefitContent,
1114
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
1115
+ style: [styles.benefitTitle, {
1116
+ color: textColor
1117
+ }],
1118
+ children: "Advanced Security"
1119
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
1120
+ style: [styles.benefitDescription, {
1121
+ color: isDarkTheme ? '#BBBBBB' : '#666666'
1122
+ }],
1123
+ children: "Enhanced encryption and security features"
1124
+ })]
1125
+ })]
1126
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
1127
+ style: styles.benefitItem,
1128
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_vectorIcons.Ionicons, {
1129
+ name: "headset",
1130
+ size: 24,
1131
+ color: warningColor
1132
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
1133
+ style: styles.benefitContent,
1134
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
1135
+ style: [styles.benefitTitle, {
1136
+ color: textColor
1137
+ }],
1138
+ children: "Priority Support"
1139
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
1140
+ style: [styles.benefitDescription, {
1141
+ color: isDarkTheme ? '#BBBBBB' : '#666666'
1142
+ }],
1143
+ children: "Get help faster with our premium support team"
1144
+ })]
1145
+ })]
1146
+ })]
1147
+ })]
1148
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
1149
+ style: styles.bottomSpacing
1150
+ })]
1151
+ })]
1152
+ });
1153
+ };
1154
+ const styles = _reactNative.StyleSheet.create({
1155
+ container: {
1156
+ flex: 1
1157
+ },
1158
+ header: {
1159
+ flexDirection: 'row',
1160
+ alignItems: 'center',
1161
+ justifyContent: 'space-between',
1162
+ paddingHorizontal: 20,
1163
+ paddingTop: 20,
1164
+ paddingBottom: 16,
1165
+ borderBottomWidth: 1
1166
+ },
1167
+ backButton: {
1168
+ padding: 8
1169
+ },
1170
+ headerTitle: {
1171
+ fontSize: 20,
1172
+ fontWeight: '600',
1173
+ fontFamily: _fonts.fontFamilies.phuduSemiBold
1174
+ },
1175
+ headerTitleContainer: {
1176
+ flex: 1,
1177
+ alignItems: 'center'
1178
+ },
1179
+ currentAppText: {
1180
+ fontSize: 14,
1181
+ marginTop: 2,
1182
+ fontStyle: 'italic'
1183
+ },
1184
+ closeButton: {
1185
+ padding: 8
1186
+ },
1187
+ content: {
1188
+ flex: 1
1189
+ },
1190
+ section: {
1191
+ padding: 20
1192
+ },
1193
+ sectionTitle: {
1194
+ fontSize: 24,
1195
+ fontWeight: 'bold',
1196
+ fontFamily: _fonts.fontFamilies.phuduBold,
1197
+ marginBottom: 8
1198
+ },
1199
+ sectionSubtitle: {
1200
+ fontSize: 16,
1201
+ lineHeight: 22,
1202
+ marginBottom: 20
1203
+ },
1204
+ loadingText: {
1205
+ fontSize: 16,
1206
+ textAlign: 'center',
1207
+ marginTop: 16
1208
+ },
1209
+ currentSubscriptionCard: {
1210
+ borderRadius: 16,
1211
+ padding: 20,
1212
+ borderWidth: 1
1213
+ },
1214
+ subscriptionHeader: {
1215
+ flexDirection: 'row',
1216
+ justifyContent: 'space-between',
1217
+ alignItems: 'flex-start',
1218
+ marginBottom: 12
1219
+ },
1220
+ planName: {
1221
+ fontSize: 20,
1222
+ fontWeight: 'bold',
1223
+ marginBottom: 4
1224
+ },
1225
+ planPrice: {
1226
+ fontSize: 16,
1227
+ fontWeight: '600'
1228
+ },
1229
+ statusBadge: {
1230
+ paddingHorizontal: 12,
1231
+ paddingVertical: 4,
1232
+ borderRadius: 12
1233
+ },
1234
+ statusText: {
1235
+ color: '#FFFFFF',
1236
+ fontSize: 12,
1237
+ fontWeight: '600'
1238
+ },
1239
+ subscriptionDetail: {
1240
+ fontSize: 14,
1241
+ marginBottom: 16
1242
+ },
1243
+ cancelNotice: {
1244
+ flexDirection: 'row',
1245
+ alignItems: 'center',
1246
+ padding: 12,
1247
+ backgroundColor: 'rgba(255, 149, 0, 0.1)',
1248
+ borderRadius: 8,
1249
+ marginBottom: 16
1250
+ },
1251
+ cancelText: {
1252
+ fontSize: 14,
1253
+ marginLeft: 8,
1254
+ flex: 1
1255
+ },
1256
+ subscriptionActions: {
1257
+ flexDirection: 'row',
1258
+ gap: 12
1259
+ },
1260
+ actionButton: {
1261
+ flex: 1,
1262
+ paddingVertical: 12,
1263
+ paddingHorizontal: 16,
1264
+ borderRadius: 8,
1265
+ alignItems: 'center'
1266
+ },
1267
+ secondaryButton: {
1268
+ backgroundColor: 'transparent',
1269
+ borderWidth: 1
1270
+ },
1271
+ actionButtonText: {
1272
+ color: '#FFFFFF',
1273
+ fontSize: 14,
1274
+ fontWeight: '600'
1275
+ },
1276
+ billingToggle: {
1277
+ flexDirection: 'row',
1278
+ backgroundColor: 'rgba(0, 0, 0, 0.05)',
1279
+ borderRadius: 8,
1280
+ padding: 4,
1281
+ marginBottom: 12
1282
+ },
1283
+ billingOption: {
1284
+ flex: 1,
1285
+ paddingVertical: 12,
1286
+ borderRadius: 6,
1287
+ alignItems: 'center'
1288
+ },
1289
+ billingOptionText: {
1290
+ fontSize: 16,
1291
+ fontWeight: '600'
1292
+ },
1293
+ savingsText: {
1294
+ fontSize: 14,
1295
+ textAlign: 'center',
1296
+ fontWeight: '600'
1297
+ },
1298
+ planCard: {
1299
+ borderRadius: 16,
1300
+ padding: 20,
1301
+ marginBottom: 16,
1302
+ borderWidth: 1,
1303
+ position: 'relative'
1304
+ },
1305
+ popularPlan: {
1306
+ borderWidth: 2
1307
+ },
1308
+ popularBadge: {
1309
+ position: 'absolute',
1310
+ top: -1,
1311
+ left: 20,
1312
+ right: 20,
1313
+ paddingVertical: 8,
1314
+ borderTopLeftRadius: 16,
1315
+ borderTopRightRadius: 16,
1316
+ alignItems: 'center'
1317
+ },
1318
+ popularText: {
1319
+ color: '#FFFFFF',
1320
+ fontSize: 12,
1321
+ fontWeight: 'bold'
1322
+ },
1323
+ planHeader: {
1324
+ marginBottom: 16,
1325
+ marginTop: 16
1326
+ },
1327
+ planDescription: {
1328
+ fontSize: 14,
1329
+ lineHeight: 20
1330
+ },
1331
+ planAppScope: {
1332
+ fontSize: 12,
1333
+ fontStyle: 'italic',
1334
+ marginTop: 4
1335
+ },
1336
+ planPricing: {
1337
+ flexDirection: 'row',
1338
+ alignItems: 'baseline',
1339
+ marginBottom: 20
1340
+ },
1341
+ planInterval: {
1342
+ fontSize: 14,
1343
+ marginLeft: 4
1344
+ },
1345
+ planFeatures: {
1346
+ marginBottom: 24
1347
+ },
1348
+ featureItem: {
1349
+ flexDirection: 'row',
1350
+ alignItems: 'center',
1351
+ marginBottom: 8
1352
+ },
1353
+ featureText: {
1354
+ fontSize: 14,
1355
+ marginLeft: 8,
1356
+ flex: 1
1357
+ },
1358
+ selectPlanButton: {
1359
+ paddingVertical: 16,
1360
+ borderRadius: 12,
1361
+ alignItems: 'center'
1362
+ },
1363
+ selectPlanText: {
1364
+ fontSize: 16,
1365
+ fontWeight: '600'
1366
+ },
1367
+ currentPlanButton: {
1368
+ paddingVertical: 16,
1369
+ borderRadius: 12,
1370
+ alignItems: 'center'
1371
+ },
1372
+ currentPlanText: {
1373
+ color: '#FFFFFF',
1374
+ fontSize: 16,
1375
+ fontWeight: '600'
1376
+ },
1377
+ benefitsCard: {
1378
+ borderRadius: 16,
1379
+ padding: 20,
1380
+ borderWidth: 1
1381
+ },
1382
+ benefitItem: {
1383
+ flexDirection: 'row',
1384
+ alignItems: 'flex-start',
1385
+ marginBottom: 20
1386
+ },
1387
+ benefitContent: {
1388
+ marginLeft: 16,
1389
+ flex: 1
1390
+ },
1391
+ benefitTitle: {
1392
+ fontSize: 16,
1393
+ fontWeight: '600',
1394
+ marginBottom: 4
1395
+ },
1396
+ benefitDescription: {
1397
+ fontSize: 14,
1398
+ lineHeight: 20
1399
+ },
1400
+ bottomSpacing: {
1401
+ height: 40
1402
+ },
1403
+ // Tab Navigation Styles
1404
+ tabContainer: {
1405
+ flexDirection: 'row',
1406
+ borderBottomWidth: 1,
1407
+ marginBottom: 20
1408
+ },
1409
+ tab: {
1410
+ flex: 1,
1411
+ paddingVertical: 12,
1412
+ paddingHorizontal: 16,
1413
+ alignItems: 'center'
1414
+ },
1415
+ tabText: {
1416
+ fontSize: 16,
1417
+ fontWeight: '600'
1418
+ },
1419
+ // Individual Feature Styles
1420
+ featureCard: {
1421
+ borderRadius: 12,
1422
+ borderWidth: 1,
1423
+ padding: 16,
1424
+ marginBottom: 12
1425
+ },
1426
+ featureHeader: {
1427
+ flexDirection: 'row',
1428
+ alignItems: 'flex-start',
1429
+ marginBottom: 12
1430
+ },
1431
+ featureIconContainer: {
1432
+ width: 40,
1433
+ height: 40,
1434
+ borderRadius: 20,
1435
+ backgroundColor: 'rgba(0, 122, 255, 0.1)',
1436
+ justifyContent: 'center',
1437
+ alignItems: 'center',
1438
+ marginRight: 12
1439
+ },
1440
+ featureInfo: {
1441
+ flex: 1
1442
+ },
1443
+ featureName: {
1444
+ fontSize: 16,
1445
+ fontWeight: '600',
1446
+ marginBottom: 4
1447
+ },
1448
+ featureDescription: {
1449
+ fontSize: 14,
1450
+ lineHeight: 20
1451
+ },
1452
+ featurePricing: {
1453
+ alignItems: 'center',
1454
+ marginBottom: 16
1455
+ },
1456
+ featurePrice: {
1457
+ fontSize: 20,
1458
+ fontWeight: 'bold'
1459
+ },
1460
+ featureInterval: {
1461
+ fontSize: 14,
1462
+ marginTop: 2
1463
+ },
1464
+ featureActions: {
1465
+ flexDirection: 'row',
1466
+ gap: 8
1467
+ },
1468
+ subscribedButton: {
1469
+ flex: 1,
1470
+ flexDirection: 'row',
1471
+ justifyContent: 'center',
1472
+ alignItems: 'center',
1473
+ paddingVertical: 12,
1474
+ borderRadius: 8,
1475
+ gap: 6
1476
+ },
1477
+ subscribedText: {
1478
+ color: '#FFFFFF',
1479
+ fontSize: 16,
1480
+ fontWeight: '600'
1481
+ },
1482
+ unsubscribeButton: {
1483
+ flex: 1,
1484
+ justifyContent: 'center',
1485
+ alignItems: 'center',
1486
+ paddingVertical: 12,
1487
+ borderRadius: 8,
1488
+ borderWidth: 1
1489
+ },
1490
+ unsubscribeText: {
1491
+ fontSize: 16,
1492
+ fontWeight: '600'
1493
+ },
1494
+ subscribeFeatureButton: {
1495
+ justifyContent: 'center',
1496
+ alignItems: 'center',
1497
+ paddingVertical: 12,
1498
+ borderRadius: 8
1499
+ },
1500
+ subscribeFeatureText: {
1501
+ color: '#FFFFFF',
1502
+ fontSize: 16,
1503
+ fontWeight: '600'
1504
+ },
1505
+ categorySection: {
1506
+ marginBottom: 24
1507
+ },
1508
+ categoryTitle: {
1509
+ fontSize: 18,
1510
+ fontWeight: '600',
1511
+ marginBottom: 12
1512
+ },
1513
+ // New styles for enhanced feature cards
1514
+ featureNameRow: {
1515
+ flexDirection: 'row',
1516
+ alignItems: 'center',
1517
+ justifyContent: 'space-between',
1518
+ marginBottom: 4
1519
+ },
1520
+ includedBadge: {
1521
+ paddingHorizontal: 8,
1522
+ paddingVertical: 2,
1523
+ borderRadius: 12,
1524
+ marginLeft: 8
1525
+ },
1526
+ includedBadgeText: {
1527
+ color: '#FFFFFF',
1528
+ fontSize: 10,
1529
+ fontWeight: '600',
1530
+ textTransform: 'uppercase'
1531
+ },
1532
+ appScopeText: {
1533
+ fontSize: 12,
1534
+ marginTop: 4,
1535
+ fontStyle: 'italic'
1536
+ },
1537
+ includedInPlanButton: {
1538
+ flexDirection: 'row',
1539
+ justifyContent: 'center',
1540
+ alignItems: 'center',
1541
+ paddingVertical: 12,
1542
+ borderRadius: 8,
1543
+ gap: 6
1544
+ },
1545
+ includedInPlanText: {
1546
+ color: '#FFFFFF',
1547
+ fontSize: 14,
1548
+ fontWeight: '600'
1549
+ },
1550
+ unavailableButton: {
1551
+ justifyContent: 'center',
1552
+ alignItems: 'center',
1553
+ paddingVertical: 12,
1554
+ borderRadius: 8
1555
+ },
1556
+ unavailableText: {
1557
+ fontSize: 14,
1558
+ fontWeight: '500',
1559
+ textAlign: 'center'
1560
+ },
1561
+ // App-specific plan styles
1562
+ appSpecificBadge: {
1563
+ position: 'absolute',
1564
+ top: 16,
1565
+ right: 16,
1566
+ paddingHorizontal: 8,
1567
+ paddingVertical: 4,
1568
+ borderRadius: 12,
1569
+ zIndex: 1
1570
+ },
1571
+ appSpecificText: {
1572
+ color: '#FFFFFF',
1573
+ fontSize: 12,
1574
+ fontWeight: '600'
1575
+ },
1576
+ planRestrictionText: {
1577
+ fontSize: 12,
1578
+ fontWeight: '500',
1579
+ marginTop: 4,
1580
+ fontStyle: 'italic'
1581
+ },
1582
+ unavailablePlanButton: {
1583
+ paddingVertical: 16,
1584
+ borderRadius: 12,
1585
+ alignItems: 'center'
1586
+ },
1587
+ unavailablePlanText: {
1588
+ fontSize: 16,
1589
+ fontWeight: '600'
1590
+ },
1591
+ // App switcher styles (for development/testing)
1592
+ appSwitcher: {
1593
+ padding: 16,
1594
+ borderBottomWidth: 1,
1595
+ margin: 16,
1596
+ borderRadius: 12,
1597
+ borderWidth: 1
1598
+ },
1599
+ appSwitcherTitle: {
1600
+ fontSize: 14,
1601
+ fontWeight: '600',
1602
+ marginBottom: 12
1603
+ },
1604
+ appSwitcherButtons: {
1605
+ flexDirection: 'row',
1606
+ gap: 8
1607
+ },
1608
+ appSwitcherButton: {
1609
+ paddingHorizontal: 12,
1610
+ paddingVertical: 6,
1611
+ borderRadius: 8,
1612
+ borderWidth: 1
1613
+ },
1614
+ appSwitcherButtonText: {
1615
+ fontSize: 12,
1616
+ fontWeight: '500'
1617
+ }
1618
+ });
1619
+ var _default = exports.default = PremiumSubscriptionScreen;
1620
+ //# sourceMappingURL=PremiumSubscriptionScreen.js.map