@oxyhq/services 6.9.43 → 6.9.45

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 (205) hide show
  1. package/lib/commonjs/index.js +9 -0
  2. package/lib/commonjs/index.js.map +1 -1
  3. package/lib/commonjs/ui/components/ActingAsBanner.js +143 -0
  4. package/lib/commonjs/ui/components/ActingAsBanner.js.map +1 -0
  5. package/lib/commonjs/ui/components/OxyPayButton.js +4 -2
  6. package/lib/commonjs/ui/components/OxyPayButton.js.map +1 -1
  7. package/lib/commonjs/ui/components/OxySignInButton.js +83 -82
  8. package/lib/commonjs/ui/components/OxySignInButton.js.map +1 -1
  9. package/lib/commonjs/ui/components/SettingRow.js +11 -5
  10. package/lib/commonjs/ui/components/SettingRow.js.map +1 -1
  11. package/lib/commonjs/ui/components/fileManagement/FileDetailsModal.js +76 -121
  12. package/lib/commonjs/ui/components/fileManagement/FileDetailsModal.js.map +1 -1
  13. package/lib/commonjs/ui/components/fileManagement/UploadPreview.js +32 -18
  14. package/lib/commonjs/ui/components/fileManagement/UploadPreview.js.map +1 -1
  15. package/lib/commonjs/ui/components/icon/OxyIcon.js +5 -4
  16. package/lib/commonjs/ui/components/icon/OxyIcon.js.map +1 -1
  17. package/lib/commonjs/ui/components/internal/GroupedPillButtons.js +11 -9
  18. package/lib/commonjs/ui/components/internal/GroupedPillButtons.js.map +1 -1
  19. package/lib/commonjs/ui/components/internal/PinInput.js +3 -2
  20. package/lib/commonjs/ui/components/internal/PinInput.js.map +1 -1
  21. package/lib/commonjs/ui/components/modals/DeleteAccountModal.js +83 -219
  22. package/lib/commonjs/ui/components/modals/DeleteAccountModal.js.map +1 -1
  23. package/lib/commonjs/ui/constants/theme.js +2 -2
  24. package/lib/commonjs/ui/constants/theme.js.map +1 -1
  25. package/lib/commonjs/ui/context/OxyContext.js +78 -3
  26. package/lib/commonjs/ui/context/OxyContext.js.map +1 -1
  27. package/lib/commonjs/ui/navigation/routes.js +3 -2
  28. package/lib/commonjs/ui/navigation/routes.js.map +1 -1
  29. package/lib/commonjs/ui/screens/AccountCenterScreen.js +33 -11
  30. package/lib/commonjs/ui/screens/AccountCenterScreen.js.map +1 -1
  31. package/lib/commonjs/ui/screens/AccountOverviewScreen.js +70 -79
  32. package/lib/commonjs/ui/screens/AccountOverviewScreen.js.map +1 -1
  33. package/lib/commonjs/ui/screens/AccountSettingsScreen.js +22 -10
  34. package/lib/commonjs/ui/screens/AccountSettingsScreen.js.map +1 -1
  35. package/lib/commonjs/ui/screens/AccountSwitcherScreen.js +376 -82
  36. package/lib/commonjs/ui/screens/AccountSwitcherScreen.js.map +1 -1
  37. package/lib/commonjs/ui/screens/AccountVerificationScreen.js +21 -9
  38. package/lib/commonjs/ui/screens/AccountVerificationScreen.js.map +1 -1
  39. package/lib/commonjs/ui/screens/CreateManagedAccountScreen.js +346 -0
  40. package/lib/commonjs/ui/screens/CreateManagedAccountScreen.js.map +1 -0
  41. package/lib/commonjs/ui/screens/FileManagementScreen.js +83 -50
  42. package/lib/commonjs/ui/screens/FileManagementScreen.js.map +1 -1
  43. package/lib/commonjs/ui/screens/HistoryViewScreen.js +80 -101
  44. package/lib/commonjs/ui/screens/HistoryViewScreen.js.map +1 -1
  45. package/lib/commonjs/ui/screens/PremiumSubscriptionScreen.js +66 -93
  46. package/lib/commonjs/ui/screens/PremiumSubscriptionScreen.js.map +1 -1
  47. package/lib/commonjs/ui/screens/SessionManagementScreen.js +101 -66
  48. package/lib/commonjs/ui/screens/SessionManagementScreen.js.map +1 -1
  49. package/lib/commonjs/ui/utils/fileManagement.js +0 -21
  50. package/lib/commonjs/ui/utils/fileManagement.js.map +1 -1
  51. package/lib/module/index.js +3 -0
  52. package/lib/module/index.js.map +1 -1
  53. package/lib/module/ui/components/ActingAsBanner.js +140 -0
  54. package/lib/module/ui/components/ActingAsBanner.js.map +1 -0
  55. package/lib/module/ui/components/OxyPayButton.js +4 -2
  56. package/lib/module/ui/components/OxyPayButton.js.map +1 -1
  57. package/lib/module/ui/components/OxySignInButton.js +84 -83
  58. package/lib/module/ui/components/OxySignInButton.js.map +1 -1
  59. package/lib/module/ui/components/SettingRow.js +11 -5
  60. package/lib/module/ui/components/SettingRow.js.map +1 -1
  61. package/lib/module/ui/components/fileManagement/FileDetailsModal.js +76 -122
  62. package/lib/module/ui/components/fileManagement/FileDetailsModal.js.map +1 -1
  63. package/lib/module/ui/components/fileManagement/UploadPreview.js +32 -19
  64. package/lib/module/ui/components/fileManagement/UploadPreview.js.map +1 -1
  65. package/lib/module/ui/components/icon/OxyIcon.js +5 -4
  66. package/lib/module/ui/components/icon/OxyIcon.js.map +1 -1
  67. package/lib/module/ui/components/internal/GroupedPillButtons.js +11 -9
  68. package/lib/module/ui/components/internal/GroupedPillButtons.js.map +1 -1
  69. package/lib/module/ui/components/internal/PinInput.js +3 -2
  70. package/lib/module/ui/components/internal/PinInput.js.map +1 -1
  71. package/lib/module/ui/components/modals/DeleteAccountModal.js +83 -220
  72. package/lib/module/ui/components/modals/DeleteAccountModal.js.map +1 -1
  73. package/lib/module/ui/constants/theme.js +2 -2
  74. package/lib/module/ui/constants/theme.js.map +1 -1
  75. package/lib/module/ui/context/OxyContext.js +78 -3
  76. package/lib/module/ui/context/OxyContext.js.map +1 -1
  77. package/lib/module/ui/navigation/routes.js +3 -2
  78. package/lib/module/ui/navigation/routes.js.map +1 -1
  79. package/lib/module/ui/screens/AccountCenterScreen.js +32 -11
  80. package/lib/module/ui/screens/AccountCenterScreen.js.map +1 -1
  81. package/lib/module/ui/screens/AccountOverviewScreen.js +71 -80
  82. package/lib/module/ui/screens/AccountOverviewScreen.js.map +1 -1
  83. package/lib/module/ui/screens/AccountSettingsScreen.js +22 -10
  84. package/lib/module/ui/screens/AccountSettingsScreen.js.map +1 -1
  85. package/lib/module/ui/screens/AccountSwitcherScreen.js +375 -82
  86. package/lib/module/ui/screens/AccountSwitcherScreen.js.map +1 -1
  87. package/lib/module/ui/screens/AccountVerificationScreen.js +22 -10
  88. package/lib/module/ui/screens/AccountVerificationScreen.js.map +1 -1
  89. package/lib/module/ui/screens/CreateManagedAccountScreen.js +342 -0
  90. package/lib/module/ui/screens/CreateManagedAccountScreen.js.map +1 -0
  91. package/lib/module/ui/screens/FileManagementScreen.js +85 -52
  92. package/lib/module/ui/screens/FileManagementScreen.js.map +1 -1
  93. package/lib/module/ui/screens/HistoryViewScreen.js +80 -101
  94. package/lib/module/ui/screens/HistoryViewScreen.js.map +1 -1
  95. package/lib/module/ui/screens/PremiumSubscriptionScreen.js +66 -94
  96. package/lib/module/ui/screens/PremiumSubscriptionScreen.js.map +1 -1
  97. package/lib/module/ui/screens/SessionManagementScreen.js +101 -67
  98. package/lib/module/ui/screens/SessionManagementScreen.js.map +1 -1
  99. package/lib/module/ui/utils/fileManagement.js +0 -20
  100. package/lib/module/ui/utils/fileManagement.js.map +1 -1
  101. package/lib/typescript/commonjs/index.d.ts +1 -0
  102. package/lib/typescript/commonjs/index.d.ts.map +1 -1
  103. package/lib/typescript/commonjs/ui/components/ActingAsBanner.d.ts +4 -0
  104. package/lib/typescript/commonjs/ui/components/ActingAsBanner.d.ts.map +1 -0
  105. package/lib/typescript/commonjs/ui/components/OxyPayButton.d.ts.map +1 -1
  106. package/lib/typescript/commonjs/ui/components/OxySignInButton.d.ts +0 -1
  107. package/lib/typescript/commonjs/ui/components/OxySignInButton.d.ts.map +1 -1
  108. package/lib/typescript/commonjs/ui/components/SettingRow.d.ts +2 -2
  109. package/lib/typescript/commonjs/ui/components/SettingRow.d.ts.map +1 -1
  110. package/lib/typescript/commonjs/ui/components/fileManagement/FileDetailsModal.d.ts +3 -4
  111. package/lib/typescript/commonjs/ui/components/fileManagement/FileDetailsModal.d.ts.map +1 -1
  112. package/lib/typescript/commonjs/ui/components/fileManagement/UploadPreview.d.ts +2 -3
  113. package/lib/typescript/commonjs/ui/components/fileManagement/UploadPreview.d.ts.map +1 -1
  114. package/lib/typescript/commonjs/ui/components/icon/OxyIcon.d.ts.map +1 -1
  115. package/lib/typescript/commonjs/ui/components/internal/GroupedPillButtons.d.ts.map +1 -1
  116. package/lib/typescript/commonjs/ui/components/internal/PinInput.d.ts.map +1 -1
  117. package/lib/typescript/commonjs/ui/components/modals/DeleteAccountModal.d.ts +2 -2
  118. package/lib/typescript/commonjs/ui/components/modals/DeleteAccountModal.d.ts.map +1 -1
  119. package/lib/typescript/commonjs/ui/context/OxyContext.d.ts +6 -0
  120. package/lib/typescript/commonjs/ui/context/OxyContext.d.ts.map +1 -1
  121. package/lib/typescript/commonjs/ui/navigation/routes.d.ts +1 -1
  122. package/lib/typescript/commonjs/ui/navigation/routes.d.ts.map +1 -1
  123. package/lib/typescript/commonjs/ui/screens/AccountCenterScreen.d.ts.map +1 -1
  124. package/lib/typescript/commonjs/ui/screens/AccountOverviewScreen.d.ts.map +1 -1
  125. package/lib/typescript/commonjs/ui/screens/AccountSettingsScreen.d.ts.map +1 -1
  126. package/lib/typescript/commonjs/ui/screens/AccountSwitcherScreen.d.ts.map +1 -1
  127. package/lib/typescript/commonjs/ui/screens/AccountVerificationScreen.d.ts.map +1 -1
  128. package/lib/typescript/commonjs/ui/screens/CreateManagedAccountScreen.d.ts +5 -0
  129. package/lib/typescript/commonjs/ui/screens/CreateManagedAccountScreen.d.ts.map +1 -0
  130. package/lib/typescript/commonjs/ui/screens/FileManagementScreen.d.ts.map +1 -1
  131. package/lib/typescript/commonjs/ui/screens/HistoryViewScreen.d.ts.map +1 -1
  132. package/lib/typescript/commonjs/ui/screens/PremiumSubscriptionScreen.d.ts.map +1 -1
  133. package/lib/typescript/commonjs/ui/screens/SessionManagementScreen.d.ts.map +1 -1
  134. package/lib/typescript/commonjs/ui/utils/fileManagement.d.ts +0 -4
  135. package/lib/typescript/commonjs/ui/utils/fileManagement.d.ts.map +1 -1
  136. package/lib/typescript/module/index.d.ts +1 -0
  137. package/lib/typescript/module/index.d.ts.map +1 -1
  138. package/lib/typescript/module/ui/components/ActingAsBanner.d.ts +4 -0
  139. package/lib/typescript/module/ui/components/ActingAsBanner.d.ts.map +1 -0
  140. package/lib/typescript/module/ui/components/OxyPayButton.d.ts.map +1 -1
  141. package/lib/typescript/module/ui/components/OxySignInButton.d.ts +0 -1
  142. package/lib/typescript/module/ui/components/OxySignInButton.d.ts.map +1 -1
  143. package/lib/typescript/module/ui/components/SettingRow.d.ts +2 -2
  144. package/lib/typescript/module/ui/components/SettingRow.d.ts.map +1 -1
  145. package/lib/typescript/module/ui/components/fileManagement/FileDetailsModal.d.ts +3 -4
  146. package/lib/typescript/module/ui/components/fileManagement/FileDetailsModal.d.ts.map +1 -1
  147. package/lib/typescript/module/ui/components/fileManagement/UploadPreview.d.ts +2 -3
  148. package/lib/typescript/module/ui/components/fileManagement/UploadPreview.d.ts.map +1 -1
  149. package/lib/typescript/module/ui/components/icon/OxyIcon.d.ts.map +1 -1
  150. package/lib/typescript/module/ui/components/internal/GroupedPillButtons.d.ts.map +1 -1
  151. package/lib/typescript/module/ui/components/internal/PinInput.d.ts.map +1 -1
  152. package/lib/typescript/module/ui/components/modals/DeleteAccountModal.d.ts +2 -2
  153. package/lib/typescript/module/ui/components/modals/DeleteAccountModal.d.ts.map +1 -1
  154. package/lib/typescript/module/ui/context/OxyContext.d.ts +6 -0
  155. package/lib/typescript/module/ui/context/OxyContext.d.ts.map +1 -1
  156. package/lib/typescript/module/ui/navigation/routes.d.ts +1 -1
  157. package/lib/typescript/module/ui/navigation/routes.d.ts.map +1 -1
  158. package/lib/typescript/module/ui/screens/AccountCenterScreen.d.ts.map +1 -1
  159. package/lib/typescript/module/ui/screens/AccountOverviewScreen.d.ts.map +1 -1
  160. package/lib/typescript/module/ui/screens/AccountSettingsScreen.d.ts.map +1 -1
  161. package/lib/typescript/module/ui/screens/AccountSwitcherScreen.d.ts.map +1 -1
  162. package/lib/typescript/module/ui/screens/AccountVerificationScreen.d.ts.map +1 -1
  163. package/lib/typescript/module/ui/screens/CreateManagedAccountScreen.d.ts +5 -0
  164. package/lib/typescript/module/ui/screens/CreateManagedAccountScreen.d.ts.map +1 -0
  165. package/lib/typescript/module/ui/screens/FileManagementScreen.d.ts.map +1 -1
  166. package/lib/typescript/module/ui/screens/HistoryViewScreen.d.ts.map +1 -1
  167. package/lib/typescript/module/ui/screens/PremiumSubscriptionScreen.d.ts.map +1 -1
  168. package/lib/typescript/module/ui/screens/SessionManagementScreen.d.ts.map +1 -1
  169. package/lib/typescript/module/ui/utils/fileManagement.d.ts +0 -4
  170. package/lib/typescript/module/ui/utils/fileManagement.d.ts.map +1 -1
  171. package/package.json +2 -2
  172. package/src/index.ts +3 -0
  173. package/src/ui/components/ActingAsBanner.tsx +135 -0
  174. package/src/ui/components/OxyPayButton.tsx +5 -3
  175. package/src/ui/components/OxySignInButton.tsx +82 -81
  176. package/src/ui/components/SettingRow.tsx +14 -7
  177. package/src/ui/components/fileManagement/FileDetailsModal.tsx +69 -99
  178. package/src/ui/components/fileManagement/UploadPreview.tsx +58 -46
  179. package/src/ui/components/icon/OxyIcon.tsx +5 -4
  180. package/src/ui/components/internal/GroupedPillButtons.tsx +15 -12
  181. package/src/ui/components/internal/PinInput.tsx +4 -3
  182. package/src/ui/components/modals/DeleteAccountModal.tsx +79 -221
  183. package/src/ui/constants/theme.ts +2 -2
  184. package/src/ui/context/OxyContext.tsx +85 -0
  185. package/src/ui/navigation/routes.ts +3 -1
  186. package/src/ui/screens/AccountCenterScreen.tsx +40 -122
  187. package/src/ui/screens/AccountOverviewScreen.tsx +63 -98
  188. package/src/ui/screens/AccountSettingsScreen.tsx +21 -7
  189. package/src/ui/screens/AccountSwitcherScreen.tsx +344 -87
  190. package/src/ui/screens/AccountVerificationScreen.tsx +24 -16
  191. package/src/ui/screens/CreateManagedAccountScreen.tsx +338 -0
  192. package/src/ui/screens/FileManagementScreen.tsx +62 -54
  193. package/src/ui/screens/HistoryViewScreen.tsx +57 -204
  194. package/src/ui/screens/PremiumSubscriptionScreen.tsx +73 -93
  195. package/src/ui/screens/SessionManagementScreen.tsx +101 -73
  196. package/src/ui/utils/fileManagement.ts +0 -30
  197. package/lib/commonjs/ui/utils/confirmAction.js +0 -28
  198. package/lib/commonjs/ui/utils/confirmAction.js.map +0 -1
  199. package/lib/module/ui/utils/confirmAction.js +0 -25
  200. package/lib/module/ui/utils/confirmAction.js.map +0 -1
  201. package/lib/typescript/commonjs/ui/utils/confirmAction.d.ts +0 -7
  202. package/lib/typescript/commonjs/ui/utils/confirmAction.d.ts.map +0 -1
  203. package/lib/typescript/module/ui/utils/confirmAction.d.ts +0 -7
  204. package/lib/typescript/module/ui/utils/confirmAction.d.ts.map +0 -1
  205. package/src/ui/utils/confirmAction.ts +0 -23
@@ -7,7 +7,6 @@ exports.default = void 0;
7
7
  var _react = _interopRequireWildcard(require("react"));
8
8
  var _reactNative = require("react-native");
9
9
  var _sonner = require("../../lib/sonner");
10
- var _confirmAction = require("../utils/confirmAction.js");
11
10
  var _index = require("../components/index.js");
12
11
  var _useI18n = require("../hooks/useI18n.js");
13
12
  var _theme = require("@oxyhq/bloom/theme");
@@ -15,6 +14,8 @@ var _useColorScheme = require("../hooks/useColorScheme.js");
15
14
  var _theme2 = require("../constants/theme.js");
16
15
  var _themeUtils = require("../utils/themeUtils.js");
17
16
  var _OxyContext = require("../context/OxyContext.js");
17
+ var _prompt = _interopRequireWildcard(require("@oxyhq/bloom/prompt"));
18
+ var Prompt = _prompt;
18
19
  var _jsxRuntime = require("react/jsx-runtime");
19
20
  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); }
20
21
  const HistoryViewScreen = ({
@@ -22,7 +23,6 @@ const HistoryViewScreen = ({
22
23
  theme,
23
24
  goBack
24
25
  }) => {
25
- // Use useOxy() hook for OxyContext values
26
26
  const {
27
27
  user
28
28
  } = (0, _OxyContext.useOxy)();
@@ -36,128 +36,93 @@ const HistoryViewScreen = ({
36
36
  const [history, setHistory] = (0, _react.useState)([]);
37
37
  const [isLoading, setIsLoading] = (0, _react.useState)(true);
38
38
  const [isDeleting, setIsDeleting] = (0, _react.useState)(false);
39
-
40
- // Helper to get storage
39
+ const deleteLast15Prompt = (0, _prompt.usePromptControl)();
40
+ const clearAllPrompt = (0, _prompt.usePromptControl)();
41
41
  const getStorage = async () => {
42
- const isReactNative = typeof navigator !== 'undefined' && navigator.product === 'ReactNative';
43
- if (isReactNative) {
42
+ const isRN = typeof navigator !== 'undefined' && navigator.product === 'ReactNative';
43
+ if (isRN) {
44
44
  try {
45
- const asyncStorageModule = await Promise.resolve().then(() => _interopRequireWildcard(require('@react-native-async-storage/async-storage')));
46
- const storage = asyncStorageModule.default;
45
+ const mod = await Promise.resolve().then(() => _interopRequireWildcard(require('@react-native-async-storage/async-storage')));
46
+ const s = mod.default;
47
47
  return {
48
- getItem: storage.getItem.bind(storage),
49
- setItem: storage.setItem.bind(storage),
50
- removeItem: storage.removeItem.bind(storage)
48
+ getItem: s.getItem.bind(s),
49
+ setItem: s.setItem.bind(s),
50
+ removeItem: s.removeItem.bind(s)
51
51
  };
52
- } catch (error) {
53
- if (__DEV__) {
54
- console.error('AsyncStorage not available:', error);
55
- }
56
- throw new Error('AsyncStorage is required in React Native environment');
52
+ } catch (e) {
53
+ if (__DEV__) console.error('AsyncStorage not available:', e);
54
+ throw new Error('AsyncStorage required');
57
55
  }
58
- } else {
59
- // Use localStorage for web
60
- return {
61
- getItem: async key => {
62
- if (typeof window !== 'undefined' && window.localStorage) {
63
- return window.localStorage.getItem(key);
64
- }
65
- return null;
66
- },
67
- setItem: async (key, value) => {
68
- if (typeof window !== 'undefined' && window.localStorage) {
69
- window.localStorage.setItem(key, value);
70
- }
71
- },
72
- removeItem: async key => {
73
- if (typeof window !== 'undefined' && window.localStorage) {
74
- window.localStorage.removeItem(key);
75
- }
76
- }
77
- };
78
56
  }
57
+ return {
58
+ getItem: async k => typeof window !== 'undefined' && window.localStorage ? window.localStorage.getItem(k) : null,
59
+ setItem: async (k, v) => {
60
+ if (typeof window !== 'undefined' && window.localStorage) window.localStorage.setItem(k, v);
61
+ },
62
+ removeItem: async k => {
63
+ if (typeof window !== 'undefined' && window.localStorage) window.localStorage.removeItem(k);
64
+ }
65
+ };
79
66
  };
80
-
81
- // TODO: Integrate with backend API for history storage
82
- // Currently uses local storage only. Should fetch from backend API and sync across devices.
83
- // Load history from storage
84
67
  _react.default.useEffect(() => {
85
- const loadHistory = async () => {
68
+ const load = async () => {
86
69
  try {
87
70
  setIsLoading(true);
88
71
  const storage = await getStorage();
89
- const historyKey = `history_${user?.id || 'guest'}`;
90
- const stored = await storage.getItem(historyKey);
72
+ const stored = await storage.getItem(`history_${user?.id || 'guest'}`);
91
73
  if (stored) {
92
74
  const parsed = JSON.parse(stored);
93
- setHistory(parsed.map(item => ({
94
- ...item,
95
- timestamp: new Date(item.timestamp)
75
+ setHistory(parsed.map(i => ({
76
+ ...i,
77
+ timestamp: new Date(i.timestamp)
96
78
  })));
97
- } else {
98
- setHistory([]);
99
- }
100
- } catch (error) {
79
+ } else setHistory([]);
80
+ } catch {
101
81
  setHistory([]);
102
82
  } finally {
103
83
  setIsLoading(false);
104
84
  }
105
85
  };
106
- loadHistory();
86
+ load();
107
87
  }, [user?.id]);
108
88
  const handleDeleteLast15Minutes = (0, _react.useCallback)(async () => {
109
- (0, _confirmAction.confirmAction)(t('history.deleteLast15Minutes.confirm') || 'Delete last 15 minutes of history?', async () => {
110
- try {
111
- setIsDeleting(true);
112
- const fifteenMinutesAgo = new Date(Date.now() - 15 * 60 * 1000);
113
- const filtered = history.filter(item => item.timestamp < fifteenMinutesAgo);
114
- setHistory(filtered);
115
-
116
- // Save to storage
117
- const storage = await getStorage();
118
- const historyKey = `history_${user?.id || 'guest'}`;
119
- await storage.setItem(historyKey, JSON.stringify(filtered));
120
- _sonner.toast.success(t('history.deleteLast15Minutes.success') || 'Last 15 minutes deleted');
121
- } catch (error) {
122
- if (__DEV__) {
123
- console.error('Failed to delete history:', error);
124
- }
125
- _sonner.toast.error(t('history.deleteLast15Minutes.error') || 'Failed to delete history');
126
- } finally {
127
- setIsDeleting(false);
128
- }
129
- });
89
+ try {
90
+ setIsDeleting(true);
91
+ const cutoff = new Date(Date.now() - 15 * 60 * 1000);
92
+ const filtered = history.filter(item => item.timestamp < cutoff);
93
+ setHistory(filtered);
94
+ const storage = await getStorage();
95
+ await storage.setItem(`history_${user?.id || 'guest'}`, JSON.stringify(filtered));
96
+ _sonner.toast.success(t('history.deleteLast15Minutes.success') || 'Last 15 minutes deleted');
97
+ } catch (e) {
98
+ if (__DEV__) console.error('Failed to delete history:', e);
99
+ _sonner.toast.error(t('history.deleteLast15Minutes.error') || 'Failed to delete history');
100
+ } finally {
101
+ setIsDeleting(false);
102
+ }
130
103
  }, [history, user?.id, t]);
131
104
  const handleClearAll = (0, _react.useCallback)(async () => {
132
- (0, _confirmAction.confirmAction)(t('history.clearAll.confirm') || 'Clear all history? This cannot be undone.', async () => {
133
- try {
134
- setIsDeleting(true);
135
- setHistory([]);
136
-
137
- // Clear from storage
138
- const storage = await getStorage();
139
- const historyKey = `history_${user?.id || 'guest'}`;
140
- await storage.removeItem(historyKey);
141
- _sonner.toast.success(t('history.clearAll.success') || 'History cleared');
142
- } catch (error) {
143
- if (__DEV__) {
144
- console.error('Failed to clear history:', error);
145
- }
146
- _sonner.toast.error(t('history.clearAll.error') || 'Failed to clear history');
147
- } finally {
148
- setIsDeleting(false);
149
- }
150
- });
105
+ try {
106
+ setIsDeleting(true);
107
+ setHistory([]);
108
+ const storage = await getStorage();
109
+ await storage.removeItem(`history_${user?.id || 'guest'}`);
110
+ _sonner.toast.success(t('history.clearAll.success') || 'History cleared');
111
+ } catch (e) {
112
+ if (__DEV__) console.error('Failed to clear history:', e);
113
+ _sonner.toast.error(t('history.clearAll.error') || 'Failed to clear history');
114
+ } finally {
115
+ setIsDeleting(false);
116
+ }
151
117
  }, [user?.id, t]);
152
118
  const formatTime = date => {
153
- const now = new Date();
154
- const diff = now.getTime() - date.getTime();
155
- const minutes = Math.floor(diff / 60000);
156
- const hours = Math.floor(minutes / 60);
157
- const days = Math.floor(hours / 24);
158
- if (minutes < 1) return t('history.justNow') || 'Just now';
159
- if (minutes < 60) return `${minutes} ${t('history.minutesAgo') || 'minutes ago'}`;
160
- if (hours < 24) return `${hours} ${t('history.hoursAgo') || 'hours ago'}`;
119
+ const diff = new Date().getTime() - date.getTime();
120
+ const min = Math.floor(diff / 60000);
121
+ const hrs = Math.floor(min / 60);
122
+ const days = Math.floor(hrs / 24);
123
+ if (min < 1) return t('history.justNow') || 'Just now';
124
+ if (min < 60) return `${min} ${t('history.minutesAgo') || 'minutes ago'}`;
125
+ if (hrs < 24) return `${hrs} ${t('history.hoursAgo') || 'hours ago'}`;
161
126
  if (days < 7) return `${days} ${t('history.daysAgo') || 'days ago'}`;
162
127
  return date.toLocaleDateString();
163
128
  };
@@ -182,7 +147,7 @@ const HistoryViewScreen = ({
182
147
  iconColor: themeColors.iconStorage,
183
148
  title: t('history.deleteLast15Minutes.title') || 'Delete Last 15 Minutes',
184
149
  subtitle: t('history.deleteLast15Minutes.subtitle') || 'Remove recent history entries',
185
- onPress: handleDeleteLast15Minutes,
150
+ onPress: () => deleteLast15Prompt.open(),
186
151
  disabled: isDeleting || history.length === 0
187
152
  }, {
188
153
  id: 'clear-all',
@@ -190,7 +155,7 @@ const HistoryViewScreen = ({
190
155
  iconColor: themeColors.iconSharing,
191
156
  title: t('history.clearAll.title') || 'Clear All History',
192
157
  subtitle: t('history.clearAll.subtitle') || 'Remove all history entries',
193
- onPress: handleClearAll,
158
+ onPress: () => clearAllPrompt.open(),
194
159
  disabled: isDeleting || history.length === 0
195
160
  }]
196
161
  })
@@ -212,6 +177,20 @@ const HistoryViewScreen = ({
212
177
  }))
213
178
  })
214
179
  })]
180
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(Prompt.Basic, {
181
+ control: deleteLast15Prompt,
182
+ title: t('history.deleteLast15Minutes.title') || 'Delete Last 15 Minutes',
183
+ description: t('history.deleteLast15Minutes.confirm') || 'Delete last 15 minutes of history?',
184
+ onConfirm: handleDeleteLast15Minutes,
185
+ confirmButtonCta: t('common.actions.delete') || 'Delete',
186
+ confirmButtonColor: "negative"
187
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(Prompt.Basic, {
188
+ control: clearAllPrompt,
189
+ title: t('history.clearAll.title') || 'Clear All History',
190
+ description: t('history.clearAll.confirm') || 'Clear all history? This cannot be undone.',
191
+ onConfirm: handleClearAll,
192
+ confirmButtonCta: t('history.clearAll.title') || 'Clear All',
193
+ confirmButtonColor: "negative"
215
194
  })]
216
195
  });
217
196
  };
@@ -1 +1 @@
1
- {"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_sonner","_confirmAction","_index","_useI18n","_theme","_useColorScheme","_theme2","_themeUtils","_OxyContext","_jsxRuntime","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","HistoryViewScreen","onClose","theme","goBack","user","useOxy","useI18n","bloomTheme","useTheme","colorScheme","useColorScheme","normalizedColorScheme","normalizeColorScheme","themeColors","Colors","history","setHistory","useState","isLoading","setIsLoading","isDeleting","setIsDeleting","getStorage","isReactNative","navigator","product","asyncStorageModule","Promise","resolve","then","storage","getItem","bind","setItem","removeItem","error","__DEV__","console","Error","key","window","localStorage","value","React","useEffect","loadHistory","historyKey","id","stored","parsed","JSON","parse","map","item","timestamp","Date","handleDeleteLast15Minutes","useCallback","confirmAction","fifteenMinutesAgo","now","filtered","filter","stringify","toast","success","handleClearAll","formatTime","date","diff","getTime","minutes","Math","floor","hours","days","toLocaleDateString","jsxs","View","style","styles","container","backgroundColor","colors","background","children","jsx","Header","title","onBack","variant","elevation","ScrollView","content","Section","isFirst","GroupedSection","items","icon","iconColor","iconStorage","subtitle","onPress","disabled","length","iconSharing","LoadingState","message","color","text","EmptyState","textColor","type","iconSecurity","iconPersonalInfo","query","StyleSheet","create","flex","padding","_default","exports","memo"],"sourceRoot":"../../../../src","sources":["ui/screens/HistoryViewScreen.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAMA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,cAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AACA,IAAAM,MAAA,GAAAN,OAAA;AACA,IAAAO,eAAA,GAAAP,OAAA;AACA,IAAAQ,OAAA,GAAAR,OAAA;AACA,IAAAS,WAAA,GAAAT,OAAA;AACA,IAAAU,WAAA,GAAAV,OAAA;AAA+C,IAAAW,WAAA,GAAAX,OAAA;AAAA,SAAAD,wBAAAa,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAf,uBAAA,YAAAA,CAAAa,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GA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,gBAAgB;YAC3F1B,KAAK,EAAEnC,IAAI,CAAC8D,KAAK;YACjBd,QAAQ,EAAElC,UAAU,CAACd,IAAI,CAACC,SAAS;UACvC,CAAC,CAAC;QAAE,CACP;MACJ,CACI,CAAC;IAAA,CACF,CAAC;EAAA,CACX,CAAC;AAEf,CAAC;AAED,MAAM0B,MAAM,GAAGoC,uBAAU,CAACC,MAAM,CAAC;EAC7BpC,SAAS,EAAE;IACPqC,IAAI,EAAE;EACV,CAAC;EACDzB,OAAO,EAAE;IACLyB,IAAI,EAAE,CAAC;IACPC,OAAO,EAAE;EACb;AACJ,CAAC,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAlI,OAAA,gBAEYoD,cAAK,CAAC+E,IAAI,CAAC1H,iBAAiB,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_sonner","_index","_useI18n","_theme","_useColorScheme","_theme2","_themeUtils","_OxyContext","_prompt","Prompt","_jsxRuntime","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","HistoryViewScreen","onClose","theme","goBack","user","useOxy","useI18n","bloomTheme","useTheme","colorScheme","useColorScheme","normalizedColorScheme","normalizeColorScheme","themeColors","Colors","history","setHistory","useState","isLoading","setIsLoading","isDeleting","setIsDeleting","deleteLast15Prompt","usePromptControl","clearAllPrompt","getStorage","isRN","navigator","product","mod","Promise","resolve","then","s","getItem","bind","setItem","removeItem","__DEV__","console","error","Error","k","window","localStorage","v","React","useEffect","load","storage","stored","id","parsed","JSON","parse","map","timestamp","Date","handleDeleteLast15Minutes","useCallback","cutoff","now","filtered","filter","item","stringify","toast","success","handleClearAll","formatTime","date","diff","getTime","min","Math","floor","hrs","days","toLocaleDateString","jsxs","View","style","styles","container","backgroundColor","colors","background","children","jsx","Header","title","onBack","variant","elevation","ScrollView","content","Section","isFirst","GroupedSection","items","icon","iconColor","iconStorage","subtitle","onPress","open","disabled","length","iconSharing","LoadingState","message","color","text","EmptyState","textColor","type","iconSecurity","iconPersonalInfo","query","Basic","control","description","onConfirm","confirmButtonCta","confirmButtonColor","StyleSheet","create","flex","padding","_default","exports","memo"],"sourceRoot":"../../../../src","sources":["ui/screens/HistoryViewScreen.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAEA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,eAAA,GAAAN,OAAA;AACA,IAAAO,OAAA,GAAAP,OAAA;AACA,IAAAQ,WAAA,GAAAR,OAAA;AACA,IAAAS,WAAA,GAAAT,OAAA;AACA,IAAAU,OAAA,GAAAX,uBAAA,CAAAC,OAAA;AAA8C,IAAAW,MAAA,GAAAD,OAAA;AAAA,IAAAE,WAAA,GAAAZ,OAAA;AAAA,SAAAD,wBAAAc,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAhB,uBAAA,YAAAA,CAAAc,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,gBAAAP,CAAA,IAAAD,CAAA,gBAAA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I,SAAS,EAAEhE,yBAA0B;MAACiE,gBAAgB,EAAE7I,CAAC,CAAC,uBAAuB,CAAC,IAAI,QAAS;MAAC8I,kBAAkB,EAAC;IAAU,CAAE,CAAC,eACrV,IAAAhJ,WAAA,CAAA4G,GAAA,EAAC7G,MAAM,CAAC4I,KAAK;MAACC,OAAO,EAAEhG,cAAe;MAACkE,KAAK,EAAE5G,CAAC,CAAC,wBAAwB,CAAC,IAAI,mBAAoB;MAAC2I,WAAW,EAAE3I,CAAC,CAAC,0BAA0B,CAAC,IAAI,2CAA4C;MAAC4I,SAAS,EAAEtD,cAAe;MAACuD,gBAAgB,EAAE7I,CAAC,CAAC,wBAAwB,CAAC,IAAI,WAAY;MAAC8I,kBAAkB,EAAC;IAAU,CAAE,CAAC;EAAA,CACpT,CAAC;AAEf,CAAC;AAED,MAAM1C,MAAM,GAAG2C,uBAAU,CAACC,MAAM,CAAC;EAAE3C,SAAS,EAAE;IAAE4C,IAAI,EAAE;EAAE,CAAC;EAAEhC,OAAO,EAAE;IAAEgC,IAAI,EAAE,CAAC;IAAEC,OAAO,EAAE;EAAG;AAAE,CAAC,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAA3I,OAAA,gBAEjFuD,cAAK,CAACqF,IAAI,CAACnI,iBAAiB,CAAC","ignoreList":[]}
@@ -8,12 +8,14 @@ var _react = require("react");
8
8
  var _reactNative = require("react-native");
9
9
  var _fonts = require("../styles/fonts.js");
10
10
  var _sonner = require("../../lib/sonner");
11
- var _confirmAction = require("../utils/confirmAction.js");
11
+ var _prompt = _interopRequireWildcard(require("@oxyhq/bloom/prompt"));
12
+ var Prompt = _prompt;
12
13
  var _vectorIcons = require("@expo/vector-icons");
13
14
  var _useI18n = require("../hooks/useI18n.js");
14
15
  var _theme = require("@oxyhq/bloom/theme");
15
16
  var _OxyContext = require("../context/OxyContext.js");
16
17
  var _jsxRuntime = require("react/jsx-runtime");
18
+ 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); }
17
19
  const PremiumSubscriptionScreen = ({
18
20
  onClose,
19
21
  theme,
@@ -34,11 +36,16 @@ const PremiumSubscriptionScreen = ({
34
36
  const [billingInterval, setBillingInterval] = (0, _react.useState)('month');
35
37
  const [activeTab, setActiveTab] = (0, _react.useState)('plans');
36
38
  const [currentAppPackage, setCurrentAppPackage] = (0, _react.useState)('mention'); // Default to mention for demo
37
-
39
+ const [pendingUnsubscribeFeatureId, setPendingUnsubscribeFeatureId] = (0, _react.useState)(null);
38
40
  const {
39
41
  t
40
42
  } = (0, _useI18n.useI18n)();
41
43
  const bloomTheme = (0, _theme.useTheme)();
44
+
45
+ // Prompt controls
46
+ const cancelSubscriptionPrompt = (0, _prompt.usePromptControl)();
47
+ const unsubscribeFeaturePrompt = (0, _prompt.usePromptControl)();
48
+
42
49
  // Extract commonly used colors for readability
43
50
  const textColor = bloomTheme.colors.text;
44
51
  const backgroundColor = bloomTheme.colors.background;
@@ -221,46 +228,14 @@ const PremiumSubscriptionScreen = ({
221
228
  }
222
229
  }, [currentAppPackage, user?.isPremium]);
223
230
  const detectCurrentApp = () => {
224
- // In a real implementation, this would detect the actual app package name
225
- // For now, we'll use a mock detection based on available methods
226
-
227
- // Real app detection methods you could use:
228
- // 1. Check bundle identifier in React Native:
229
- // import DeviceInfo from 'react-native-device-info';
230
- // const bundleId = DeviceInfo.getBundleId();
231
- // Example: com.oxy.mention -> 'mention'
232
-
233
- // 2. Environment variables or build configuration
234
- // const appPackage = __DEV__ ? process.env.APP_PACKAGE : 'mention';
235
-
236
- // 3. Check specific app capabilities or modules
237
- // if (typeof MentionModule !== 'undefined') return 'mention';
238
- // if (typeof OxyWorkspaceModule !== 'undefined') return 'oxy-workspace';
239
-
240
- // 4. Use build-time configuration with Metro or similar
241
- // const appPackage = require('../config/app.json').packageName;
242
-
243
- // For demo purposes, we'll simulate different apps
244
- // You would replace this with actual app detection logic
245
-
246
- // IMPORTANT: This ensures subscription restrictions work properly:
247
- // - Mention+ plan can only be subscribed to when app package == 'mention'
248
- // - Other app-specific plans follow the same pattern
249
- // - Ecosystem plans work across all apps
250
-
251
- const detectedApp = 'mention'; // This would be dynamic in real implementation
252
-
231
+ const detectedApp = 'mention';
253
232
  setCurrentAppPackage(detectedApp);
254
233
  };
255
234
  const loadSubscriptionData = async () => {
256
235
  try {
257
236
  setLoading(true);
258
-
259
- // Filter plans available for current app
260
237
  const availablePlans = mockPlans.filter(plan => plan.applicableApps.includes(currentAppPackage));
261
238
  setPlans(availablePlans);
262
-
263
- // Mock current subscription
264
239
  let currentSubscription = null;
265
240
  if (user?.isPremium) {
266
241
  currentSubscription = {
@@ -273,15 +248,13 @@ const PremiumSubscriptionScreen = ({
273
248
  };
274
249
  setSubscription(currentSubscription);
275
250
  }
276
-
277
- // Filter features available for current app and update based on current subscription
278
251
  const availableFeatures = mockIndividualFeatures.filter(feature => feature.applicableApps.includes(currentAppPackage));
279
252
  const updatedFeatures = availableFeatures.map(feature => {
280
253
  const isIncludedInCurrentPlan = !!(currentSubscription && feature.includedInPlans.includes(currentSubscription.planId));
281
254
  return {
282
255
  ...feature,
283
256
  isIncludedInCurrentPlan,
284
- isSubscribed: !!isIncludedInCurrentPlan // Mock some individual subscriptions
257
+ isSubscribed: !!isIncludedInCurrentPlan
285
258
  };
286
259
  });
287
260
  setIndividualFeatures(updatedFeatures);
@@ -299,7 +272,6 @@ const PremiumSubscriptionScreen = ({
299
272
  };
300
273
  const handleSubscribe = async planId => {
301
274
  try {
302
- // Check if plan is available for current app
303
275
  const selectedPlan = mockPlans.find(plan => plan.id === planId);
304
276
  if (!selectedPlan?.applicableApps.includes(currentAppPackage)) {
305
277
  _sonner.toast.error(t('premium.toasts.planUnavailable', {
@@ -307,19 +279,13 @@ const PremiumSubscriptionScreen = ({
307
279
  }) || `This plan is not available for the current app (${currentAppPackage})`);
308
280
  return;
309
281
  }
310
-
311
- // Special restriction for Mention+ plan - only available in mention app
312
282
  if (planId === 'mention-plus' && currentAppPackage !== 'mention') {
313
283
  _sonner.toast.error(t('premium.toasts.mentionOnly') || 'Mention+ is only available in the Mention app');
314
284
  return;
315
285
  }
316
286
  setProcessingPayment(true);
317
-
318
- // Mock payment processing
319
287
  await new Promise(resolve => setTimeout(resolve, 2000));
320
288
  _sonner.toast.success(t('premium.toasts.activated') || 'Subscription activated successfully!');
321
-
322
- // Mock subscription update
323
289
  setSubscription({
324
290
  id: `sub_${Date.now()}`,
325
291
  planId,
@@ -328,8 +294,6 @@ const PremiumSubscriptionScreen = ({
328
294
  currentPeriodEnd: new Date(Date.now() + 30 * 24 * 60 * 60 * 1000).toISOString(),
329
295
  cancelAtPeriodEnd: false
330
296
  });
331
-
332
- // Reload data to update feature states
333
297
  loadSubscriptionData();
334
298
  } catch (error) {
335
299
  if (__DEV__) {
@@ -340,20 +304,20 @@ const PremiumSubscriptionScreen = ({
340
304
  setProcessingPayment(false);
341
305
  }
342
306
  };
343
- const handleCancelSubscription = () => {
344
- (0, _confirmAction.confirmAction)(t('premium.confirms.cancelSub') || 'Are you sure you want to cancel your subscription? You will lose access to premium features at the end of your current billing period.', async () => {
345
- try {
346
- // Mock cancellation
347
- setSubscription(prev => prev ? {
348
- ...prev,
349
- cancelAtPeriodEnd: true
350
- } : null);
351
- _sonner.toast.success(t('premium.toasts.willCancel') || 'Subscription will be canceled at the end of the billing period');
352
- } catch (error) {
353
- _sonner.toast.error(t('premium.toasts.cancelFailed') || 'Failed to cancel subscription');
354
- }
355
- });
356
- };
307
+ const confirmCancelSubscription = (0, _react.useCallback)(() => {
308
+ cancelSubscriptionPrompt.open();
309
+ }, [cancelSubscriptionPrompt]);
310
+ const handleCancelSubscription = (0, _react.useCallback)(async () => {
311
+ try {
312
+ setSubscription(prev => prev ? {
313
+ ...prev,
314
+ cancelAtPeriodEnd: true
315
+ } : null);
316
+ _sonner.toast.success(t('premium.toasts.willCancel') || 'Subscription will be canceled at the end of the billing period');
317
+ } catch (error) {
318
+ _sonner.toast.error(t('premium.toasts.cancelFailed') || 'Failed to cancel subscription');
319
+ }
320
+ }, [t]);
357
321
  const handleReactivateSubscription = async () => {
358
322
  try {
359
323
  setSubscription(prev => prev ? {
@@ -366,7 +330,7 @@ const PremiumSubscriptionScreen = ({
366
330
  }
367
331
  };
368
332
  const formatPrice = (price, currency, interval) => {
369
- const yearlyPrice = interval === 'year' ? price : price * 12 * 0.8; // 20% discount for yearly
333
+ const yearlyPrice = interval === 'year' ? price : price * 12 * 0.8;
370
334
  const displayPrice = billingInterval === 'year' ? yearlyPrice : price;
371
335
  return {
372
336
  price: displayPrice,
@@ -380,16 +344,12 @@ const PremiumSubscriptionScreen = ({
380
344
  };
381
345
  const handleFeatureSubscribe = async featureId => {
382
346
  try {
383
- // Check if feature is available for current app
384
347
  const selectedFeature = mockIndividualFeatures.find(feature => feature.id === featureId);
385
348
  if (!selectedFeature?.applicableApps.includes(currentAppPackage)) {
386
349
  _sonner.toast.error(`This feature is not available for the current app (${currentAppPackage})`);
387
350
  return;
388
351
  }
389
-
390
- // Special restrictions for app-specific features
391
352
  if (selectedFeature.appScope === 'specific') {
392
- // For features that are only available in specific apps, enforce strict matching
393
353
  const hasExactMatch = selectedFeature.applicableApps.length === 1 && selectedFeature.applicableApps[0] === currentAppPackage;
394
354
  if (!hasExactMatch && selectedFeature.applicableApps.length === 1) {
395
355
  const requiredApp = selectedFeature.applicableApps[0];
@@ -398,8 +358,6 @@ const PremiumSubscriptionScreen = ({
398
358
  }
399
359
  }
400
360
  setProcessingPayment(true);
401
-
402
- // Mock feature subscription
403
361
  await new Promise(resolve => setTimeout(resolve, 1500));
404
362
  setIndividualFeatures(prev => prev.map(feature => feature.id === featureId ? {
405
363
  ...feature,
@@ -418,24 +376,28 @@ const PremiumSubscriptionScreen = ({
418
376
  setProcessingPayment(false);
419
377
  }
420
378
  };
421
- const handleFeatureUnsubscribe = async featureId => {
422
- const feature = individualFeatures.find(f => f.id === featureId);
423
- (0, _confirmAction.confirmAction)(t('premium.confirms.unsubscribeFeature', {
424
- name: feature?.name ?? ''
425
- }) ?? `Are you sure you want to unsubscribe from ${feature?.name}?`, async () => {
426
- try {
427
- setIndividualFeatures(prev => prev.map(f => f.id === featureId ? {
428
- ...f,
429
- isSubscribed: false
430
- } : f));
431
- _sonner.toast.success(t('premium.toasts.featureUnsubscribed', {
432
- name: feature?.name ?? ''
433
- }) ?? `Unsubscribed from ${feature?.name}`);
434
- } catch (error) {
435
- _sonner.toast.error(t('premium.toasts.featureUnsubscribeFailed') || 'Failed to unsubscribe from feature');
436
- }
437
- });
438
- };
379
+ const confirmFeatureUnsubscribe = (0, _react.useCallback)(featureId => {
380
+ setPendingUnsubscribeFeatureId(featureId);
381
+ unsubscribeFeaturePrompt.open();
382
+ }, [unsubscribeFeaturePrompt]);
383
+ const handleFeatureUnsubscribe = (0, _react.useCallback)(async () => {
384
+ if (!pendingUnsubscribeFeatureId) return;
385
+ const feature = individualFeatures.find(f => f.id === pendingUnsubscribeFeatureId);
386
+ try {
387
+ setIndividualFeatures(prev => prev.map(f => f.id === pendingUnsubscribeFeatureId ? {
388
+ ...f,
389
+ isSubscribed: false
390
+ } : f));
391
+ _sonner.toast.success(t('premium.toasts.featureUnsubscribed', {
392
+ name: feature?.name ?? ''
393
+ }) ?? `Unsubscribed from ${feature?.name}`);
394
+ } catch (error) {
395
+ _sonner.toast.error(t('premium.toasts.featureUnsubscribeFailed') || 'Failed to unsubscribe from feature');
396
+ } finally {
397
+ setPendingUnsubscribeFeatureId(null);
398
+ }
399
+ }, [pendingUnsubscribeFeatureId, individualFeatures, t]);
400
+ const pendingUnsubscribeFeature = (0, _react.useMemo)(() => individualFeatures.find(f => f.id === pendingUnsubscribeFeatureId), [individualFeatures, pendingUnsubscribeFeatureId]);
439
401
  const renderHeader = () => {
440
402
  const getAppDisplayName = packageName => {
441
403
  const appNames = {
@@ -562,7 +524,7 @@ const PremiumSubscriptionScreen = ({
562
524
  style: [styles.actionButton, {
563
525
  backgroundColor: dangerColor
564
526
  }],
565
- onPress: handleCancelSubscription,
527
+ onPress: confirmCancelSubscription,
566
528
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
567
529
  style: styles.actionButtonText,
568
530
  children: t('premium.actions.cancelSubBtn') || 'Cancel Subscription'
@@ -942,7 +904,7 @@ const PremiumSubscriptionScreen = ({
942
904
  style: [styles.unsubscribeButton, {
943
905
  borderColor: dangerColor
944
906
  }],
945
- onPress: () => handleFeatureUnsubscribe(feature.id),
907
+ onPress: () => confirmFeatureUnsubscribe(feature.id),
946
908
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
947
909
  style: [styles.unsubscribeText, {
948
910
  color: dangerColor
@@ -1168,6 +1130,22 @@ const PremiumSubscriptionScreen = ({
1168
1130
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
1169
1131
  style: styles.bottomSpacing
1170
1132
  })]
1133
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(Prompt.Basic, {
1134
+ control: cancelSubscriptionPrompt,
1135
+ title: t('premium.confirms.cancelSubTitle') || 'Cancel Subscription',
1136
+ description: t('premium.confirms.cancelSub') || 'Are you sure you want to cancel your subscription? You will lose access to premium features at the end of your current billing period.',
1137
+ onConfirm: handleCancelSubscription,
1138
+ confirmButtonCta: t('premium.actions.cancelSubBtn') || 'Cancel Subscription',
1139
+ confirmButtonColor: "negative"
1140
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(Prompt.Basic, {
1141
+ control: unsubscribeFeaturePrompt,
1142
+ title: t('premium.confirms.unsubscribeFeatureTitle') || 'Unsubscribe from Feature',
1143
+ description: pendingUnsubscribeFeature ? t('premium.confirms.unsubscribeFeature', {
1144
+ name: pendingUnsubscribeFeature.name
1145
+ }) ?? `Are you sure you want to unsubscribe from ${pendingUnsubscribeFeature.name}?` : '',
1146
+ onConfirm: handleFeatureUnsubscribe,
1147
+ confirmButtonCta: t('premium.actions.unsubscribe') || 'Unsubscribe',
1148
+ confirmButtonColor: "negative"
1171
1149
  })]
1172
1150
  });
1173
1151
  };
@@ -1419,7 +1397,6 @@ const styles = _reactNative.StyleSheet.create({
1419
1397
  bottomSpacing: {
1420
1398
  height: 40
1421
1399
  },
1422
- // Tab Navigation Styles
1423
1400
  tabContainer: {
1424
1401
  flexDirection: 'row',
1425
1402
  borderBottomWidth: 1,
@@ -1435,7 +1412,6 @@ const styles = _reactNative.StyleSheet.create({
1435
1412
  fontSize: 16,
1436
1413
  fontWeight: '600'
1437
1414
  },
1438
- // Individual Feature Styles
1439
1415
  featureCard: {
1440
1416
  borderRadius: 12,
1441
1417
  borderWidth: 1,
@@ -1529,7 +1505,6 @@ const styles = _reactNative.StyleSheet.create({
1529
1505
  fontWeight: '600',
1530
1506
  marginBottom: 12
1531
1507
  },
1532
- // New styles for enhanced feature cards
1533
1508
  featureNameRow: {
1534
1509
  flexDirection: 'row',
1535
1510
  alignItems: 'center',
@@ -1577,7 +1552,6 @@ const styles = _reactNative.StyleSheet.create({
1577
1552
  fontWeight: '500',
1578
1553
  textAlign: 'center'
1579
1554
  },
1580
- // App-specific plan styles
1581
1555
  appSpecificBadge: {
1582
1556
  position: 'absolute',
1583
1557
  top: 16,
@@ -1607,7 +1581,6 @@ const styles = _reactNative.StyleSheet.create({
1607
1581
  fontSize: 16,
1608
1582
  fontWeight: '600'
1609
1583
  },
1610
- // App switcher styles (for development/testing)
1611
1584
  appSwitcher: {
1612
1585
  padding: 16,
1613
1586
  borderBottomWidth: 1,