@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
@@ -7,9 +7,10 @@ exports.default = void 0;
7
7
  var _react = _interopRequireWildcard(require("react"));
8
8
  var _reactNative = require("react-native");
9
9
  var _OxyContext = require("../context/OxyContext");
10
- var _fonts = require("../styles/fonts");
11
10
  var _sonner = require("../../lib/sonner");
11
+ var _OxyIcon = _interopRequireDefault(require("../components/icon/OxyIcon"));
12
12
  var _jsxRuntime = require("react/jsx-runtime");
13
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
13
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); }
14
15
  const ModernAccountSwitcherScreen = ({
15
16
  onClose,
@@ -168,44 +169,6 @@ const ModernAccountSwitcherScreen = ({
168
169
  const errorMessage = error instanceof Error ? error.message : 'Unknown error occurred';
169
170
  _sonner.toast.error(`There was a problem signing out: ${errorMessage}`);
170
171
  }
171
-
172
- /* ORIGINAL CODE WITH CONFIRMATION - TEMPORARILY DISABLED
173
- Alert.alert(
174
- 'Sign Out All',
175
- 'Are you sure you want to sign out of all accounts on this device?',
176
- [
177
- {
178
- text: 'Cancel',
179
- style: 'cancel',
180
- onPress: () => {
181
- console.log('🔴 User cancelled logout');
182
- }
183
- },
184
- {
185
- text: 'Sign Out All',
186
- style: 'destructive',
187
- onPress: async () => {
188
- console.log('🔴 CONFIRMATION: User confirmed logout all - proceeding...');
189
- try {
190
- console.log('🔴 CONFIRMATION: About to call logoutAll()');
191
- await logoutAll();
192
- console.log('🔴 CONFIRMATION: logoutAll() completed successfully');
193
- toast.success('All accounts signed out successfully!');
194
- if (onClose) {
195
- console.log('🔴 CONFIRMATION: Calling onClose');
196
- onClose();
197
- }
198
- } catch (error) {
199
- console.error('🔴 CONFIRMATION: Logout all failed:', error);
200
- const errorMessage = error instanceof Error ? error.message : 'Unknown error occurred';
201
- toast.error(`There was a problem signing out: ${errorMessage}`);
202
- }
203
- },
204
- },
205
- ],
206
- { cancelable: true }
207
- );
208
- */
209
172
  };
210
173
 
211
174
  // Device session management functions
@@ -278,353 +241,344 @@ const ModernAccountSwitcherScreen = ({
278
241
  cancelable: true
279
242
  });
280
243
  };
281
- const renderDeviceSessionItem = deviceSession => {
282
- const isLoggingOut = remotingLogoutSessionId === deviceSession.sessionId;
283
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
284
- style: [styles.sessionCard, {
285
- backgroundColor: deviceSession.isCurrent ? colors.activeCard : colors.card,
286
- borderColor: deviceSession.isCurrent ? colors.accent : colors.border,
287
- borderWidth: deviceSession.isCurrent ? 2 : 1
288
- }],
289
- children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
290
- style: styles.sessionHeader,
291
- children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
292
- style: styles.userInfo,
293
- children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
294
- style: [styles.displayName, {
295
- color: colors.text
296
- }],
297
- numberOfLines: 1,
298
- children: [deviceSession.deviceName, deviceSession.isCurrent && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
299
- style: [styles.username, {
300
- color: colors.accent
301
- }],
302
- children: ' (This Device)'
303
- })]
304
- }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
305
- style: [styles.username, {
306
- color: colors.secondaryText
307
- }],
308
- numberOfLines: 1,
309
- children: ["ID: ...", deviceSession.deviceId.slice(-8)]
310
- }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
311
- style: [styles.lastActive, {
312
- color: colors.secondaryText
313
- }],
314
- numberOfLines: 1,
315
- children: ["Last active: ", new Date(deviceSession.lastActive).toLocaleDateString()]
316
- })]
317
- }), !deviceSession.isCurrent && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
318
- style: [styles.removeButton, {
319
- borderColor: colors.destructive,
320
- backgroundColor: colors.background
321
- }],
322
- onPress: () => handleRemoteSessionLogout(deviceSession.sessionId, deviceSession.deviceName),
323
- disabled: isLoggingOut,
324
- children: isLoggingOut ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.ActivityIndicator, {
325
- color: colors.destructive,
326
- size: "small"
327
- }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
328
- style: [styles.removeButtonText, {
329
- color: colors.destructive
330
- }],
331
- children: "Sign Out"
332
- })
333
- })]
334
- })
335
- }, deviceSession.sessionId);
336
- };
337
-
338
- // Load device sessions when device management is shown
339
- (0, _react.useEffect)(() => {
340
- if (showDeviceManagement && deviceSessions.length === 0) {
341
- loadAllDeviceSessions();
342
- }
343
- }, [showDeviceManagement]);
344
- const renderSessionItem = sessionWithUser => {
345
- const isActive = sessionWithUser.sessionId === activeSessionId;
346
- const isSwitching = switchingToUserId === sessionWithUser.sessionId;
347
- const isRemoving = removingUserId === sessionWithUser.sessionId;
348
- const {
349
- userProfile,
350
- isLoadingProfile
351
- } = sessionWithUser;
352
- const displayName = typeof userProfile?.name === 'object' ? userProfile.name.full || userProfile.name.first || userProfile.username : userProfile?.name || userProfile?.username || 'Unknown User';
353
- const username = userProfile?.username || 'unknown';
354
- const avatarUrl = userProfile?.avatar?.url;
355
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
356
- style: [styles.sessionCard, {
357
- backgroundColor: isActive ? colors.activeCard : colors.card,
358
- borderColor: isActive ? colors.accent : colors.border,
359
- borderWidth: isActive ? 2 : 1,
360
- shadowColor: colors.shadow
361
- }],
362
- children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
363
- style: styles.sessionHeader,
364
- children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
365
- style: styles.avatarContainer,
366
- children: [isLoadingProfile ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
367
- style: [styles.avatarPlaceholder, {
368
- backgroundColor: colors.surface
369
- }],
370
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.ActivityIndicator, {
371
- size: "small",
372
- color: colors.accent
373
- })
374
- }) : avatarUrl ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Image, {
375
- source: {
376
- uri: avatarUrl
377
- },
378
- style: styles.avatar
379
- }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
380
- style: [styles.avatarPlaceholder, {
381
- backgroundColor: colors.surface
382
- }],
383
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
384
- style: [styles.avatarText, {
385
- color: colors.accent
386
- }],
387
- children: displayName.charAt(0).toUpperCase()
388
- })
389
- }), isActive && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
390
- style: [styles.activeBadge, {
391
- backgroundColor: colors.success
392
- }],
393
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
394
- style: styles.activeBadgeText,
395
- children: "\u2713"
396
- })
397
- })]
398
- }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
399
- style: styles.userInfo,
400
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
401
- style: [styles.displayName, {
402
- color: colors.text
403
- }],
404
- numberOfLines: 1,
405
- children: displayName
406
- }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
407
- style: [styles.username, {
408
- color: colors.secondaryText
409
- }],
410
- numberOfLines: 1,
411
- children: ["@", username]
412
- }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
413
- style: [styles.lastActive, {
414
- color: colors.secondaryText
415
- }],
416
- numberOfLines: 1,
417
- children: ["Last active: ", new Date(sessionWithUser.lastActive).toLocaleDateString()]
418
- })]
419
- })]
420
- }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
421
- style: styles.sessionActions,
422
- children: [!isActive && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
423
- style: [styles.switchButton, {
424
- borderColor: colors.accent,
425
- backgroundColor: colors.background
426
- }],
427
- onPress: () => handleSwitchSession(sessionWithUser.sessionId),
428
- disabled: isSwitching || isRemoving,
429
- children: isSwitching ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.ActivityIndicator, {
430
- color: colors.accent,
431
- size: "small"
432
- }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
433
- style: [styles.switchButtonText, {
434
- color: colors.accent
435
- }],
436
- children: "Switch"
437
- })
438
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
439
- style: [styles.removeButton, {
440
- borderColor: colors.destructive,
441
- backgroundColor: colors.background
442
- }],
443
- onPress: () => handleRemoveSession(sessionWithUser.sessionId),
444
- disabled: isSwitching || isRemoving,
445
- children: isRemoving ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.ActivityIndicator, {
446
- color: colors.destructive,
447
- size: "small"
448
- }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
449
- style: [styles.removeButtonText, {
450
- color: colors.destructive
451
- }],
452
- children: "Remove"
453
- })
454
- })]
455
- })]
456
- }, sessionWithUser.sessionId);
457
- };
458
244
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
459
245
  style: [styles.container, {
460
- backgroundColor: colors.background
246
+ backgroundColor: '#f2f2f2'
461
247
  }],
462
248
  children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
463
249
  style: styles.header,
464
250
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
465
251
  style: styles.backButton,
466
252
  onPress: goBack,
467
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
468
- style: [styles.backButtonText, {
469
- color: colors.accent
470
- }],
471
- children: "\u2039 Back"
253
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_OxyIcon.default, {
254
+ name: "chevron-back",
255
+ size: 24,
256
+ color: "#007AFF"
472
257
  })
473
258
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
474
- style: [styles.title, {
475
- color: colors.text
476
- }],
477
- children: "Accounts"
478
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
479
- style: styles.headerSpacer
259
+ style: styles.headerTitle,
260
+ children: "Account Switcher"
261
+ }), onClose && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
262
+ style: styles.closeButton,
263
+ onPress: onClose,
264
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
265
+ style: styles.closeButtonText,
266
+ children: "\xD7"
267
+ })
480
268
  })]
481
269
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.ScrollView, {
482
270
  style: styles.content,
483
- showsVerticalScrollIndicator: false,
484
- contentContainerStyle: styles.scrollContent,
485
271
  children: isLoading ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
486
272
  style: styles.loadingContainer,
487
273
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.ActivityIndicator, {
488
274
  size: "large",
489
- color: colors.accent
275
+ color: "#007AFF"
490
276
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
491
- style: [styles.loadingText, {
492
- color: colors.secondaryText
493
- }],
277
+ style: styles.loadingText,
494
278
  children: "Loading accounts..."
495
279
  })]
496
280
  }) : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
497
- children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
498
- style: [styles.sectionTitle, {
499
- color: colors.text
500
- }],
501
- children: ["Saved Accounts (", sessionsWithUsers.length, ")"]
502
- }), sessionsWithUsers.length === 0 ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
503
- style: styles.emptyState,
504
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
505
- style: [styles.emptyText, {
506
- color: colors.secondaryText
507
- }],
508
- children: "No saved accounts found"
509
- })
510
- }) : sessionsWithUsers.map(renderSessionItem), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
511
- style: styles.actionsSection,
512
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
513
- style: [styles.actionButton, {
514
- borderColor: colors.border,
515
- backgroundColor: colors.card
516
- }],
281
+ children: [user && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
282
+ style: styles.section,
283
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
284
+ style: styles.sectionTitle,
285
+ children: "Current Account"
286
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
287
+ style: [styles.settingItem, styles.firstSettingItem, styles.lastSettingItem, styles.currentAccountCard],
288
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
289
+ style: styles.userIcon,
290
+ children: [user.avatar?.url ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Image, {
291
+ source: {
292
+ uri: user.avatar.url
293
+ },
294
+ style: styles.accountAvatarImage
295
+ }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
296
+ style: styles.accountAvatarFallback,
297
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
298
+ style: styles.accountAvatarText,
299
+ children: (typeof user.name === 'string' ? user.name : user.name?.first || user.username)?.charAt(0).toUpperCase()
300
+ })
301
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
302
+ style: styles.activeBadge,
303
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_OxyIcon.default, {
304
+ name: "checkmark",
305
+ size: 12,
306
+ color: "#fff"
307
+ })
308
+ })]
309
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
310
+ style: styles.settingInfo,
311
+ children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
312
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
313
+ style: styles.settingLabel,
314
+ children: typeof user.name === 'string' ? user.name : user.name?.full || user.name?.first || user.username
315
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
316
+ style: styles.settingDescription,
317
+ children: user.email || user.username
318
+ })]
319
+ })
320
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
321
+ style: styles.currentBadge,
322
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
323
+ style: styles.currentBadgeText,
324
+ children: "Current"
325
+ })
326
+ })]
327
+ })]
328
+ }), sessionsWithUsers.filter(s => s.sessionId !== activeSessionId).length > 0 && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
329
+ style: styles.section,
330
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
331
+ style: styles.sectionTitle,
332
+ children: ["Other Accounts (", sessionsWithUsers.filter(s => s.sessionId !== activeSessionId).length, ")"]
333
+ }), sessionsWithUsers.filter(s => s.sessionId !== activeSessionId).map((sessionWithUser, index, filteredArray) => {
334
+ const isFirst = index === 0;
335
+ const isLast = index === filteredArray.length - 1;
336
+ const isSwitching = switchingToUserId === sessionWithUser.sessionId;
337
+ const isRemoving = removingUserId === sessionWithUser.sessionId;
338
+ const {
339
+ userProfile,
340
+ isLoadingProfile
341
+ } = sessionWithUser;
342
+ const displayName = typeof userProfile?.name === 'object' ? userProfile.name.full || userProfile.name.first || userProfile.username : userProfile?.name || userProfile?.username || 'Unknown User';
343
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
344
+ style: [styles.settingItem, isFirst && styles.firstSettingItem, isLast && styles.lastSettingItem],
345
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
346
+ style: styles.userIcon,
347
+ children: isLoadingProfile ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
348
+ style: styles.accountAvatarFallback,
349
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.ActivityIndicator, {
350
+ size: "small",
351
+ color: "#007AFF"
352
+ })
353
+ }) : userProfile?.avatar?.url ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Image, {
354
+ source: {
355
+ uri: userProfile.avatar.url
356
+ },
357
+ style: styles.accountAvatarImage
358
+ }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
359
+ style: styles.accountAvatarFallback,
360
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
361
+ style: styles.accountAvatarText,
362
+ children: displayName.charAt(0).toUpperCase()
363
+ })
364
+ })
365
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
366
+ style: styles.settingInfo,
367
+ children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
368
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
369
+ style: styles.settingLabel,
370
+ children: displayName
371
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
372
+ style: styles.settingDescription,
373
+ children: ["@", userProfile?.username || 'unknown']
374
+ })]
375
+ })
376
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
377
+ style: styles.accountActions,
378
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
379
+ style: styles.switchButton,
380
+ onPress: () => handleSwitchSession(sessionWithUser.sessionId),
381
+ disabled: isSwitching || isRemoving,
382
+ children: isSwitching ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.ActivityIndicator, {
383
+ size: "small",
384
+ color: "#007AFF"
385
+ }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
386
+ style: styles.switchButtonText,
387
+ children: "Switch"
388
+ })
389
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
390
+ style: styles.removeButton,
391
+ onPress: () => handleRemoveSession(sessionWithUser.sessionId),
392
+ disabled: isSwitching || isRemoving,
393
+ children: isRemoving ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.ActivityIndicator, {
394
+ size: "small",
395
+ color: "#FF3B30"
396
+ }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_OxyIcon.default, {
397
+ name: "trash",
398
+ size: 16,
399
+ color: "#FF3B30"
400
+ })
401
+ })]
402
+ })]
403
+ }, sessionWithUser.sessionId);
404
+ })]
405
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
406
+ style: styles.section,
407
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
408
+ style: styles.sectionTitle,
409
+ children: "Quick Actions"
410
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.TouchableOpacity, {
411
+ style: [styles.settingItem, styles.firstSettingItem],
517
412
  onPress: () => navigate?.('SignIn'),
518
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
519
- style: [styles.actionButtonText, {
520
- color: colors.text
521
- }],
522
- children: "+ Add Another Account"
523
- })
524
- }), sessionsWithUsers.length > 0 && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
525
- style: [styles.actionButton, styles.dangerButton, {
526
- borderColor: colors.destructive,
527
- backgroundColor: colors.background
528
- }],
413
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
414
+ style: styles.settingInfo,
415
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_OxyIcon.default, {
416
+ name: "person-add",
417
+ size: 20,
418
+ color: "#007AFF",
419
+ style: styles.settingIcon
420
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
421
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
422
+ style: styles.settingLabel,
423
+ children: "Add Another Account"
424
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
425
+ style: styles.settingDescription,
426
+ children: "Sign in with a different account"
427
+ })]
428
+ })]
429
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_OxyIcon.default, {
430
+ name: "chevron-forward",
431
+ size: 16,
432
+ color: "#ccc"
433
+ })]
434
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.TouchableOpacity, {
435
+ style: styles.settingItem,
436
+ onPress: () => setShowDeviceManagement(!showDeviceManagement),
437
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
438
+ style: styles.settingInfo,
439
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_OxyIcon.default, {
440
+ name: "devices",
441
+ size: 20,
442
+ color: "#5856D6",
443
+ style: styles.settingIcon
444
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
445
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
446
+ style: styles.settingLabel,
447
+ children: [showDeviceManagement ? 'Hide' : 'Manage', " Device Sessions"]
448
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
449
+ style: styles.settingDescription,
450
+ children: "View and manage sessions on other devices"
451
+ })]
452
+ })]
453
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_OxyIcon.default, {
454
+ name: "chevron-forward",
455
+ size: 16,
456
+ color: "#ccc"
457
+ })]
458
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.TouchableOpacity, {
459
+ style: [styles.settingItem, styles.lastSettingItem],
529
460
  onPress: handleLogoutAll,
530
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
531
- style: [styles.dangerButtonText, {
532
- color: colors.destructive
533
- }],
534
- children: "Sign Out All Accounts"
535
- })
461
+ disabled: sessionsWithUsers.length === 0,
462
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
463
+ style: styles.settingInfo,
464
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_OxyIcon.default, {
465
+ name: "log-out",
466
+ size: 20,
467
+ color: "#FF3B30",
468
+ style: styles.settingIcon
469
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
470
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
471
+ style: [styles.settingLabel, {
472
+ color: sessionsWithUsers.length === 0 ? '#ccc' : '#FF3B30'
473
+ }],
474
+ children: "Sign Out All Accounts"
475
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
476
+ style: styles.settingDescription,
477
+ children: "Remove all accounts from this device"
478
+ })]
479
+ })]
480
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_OxyIcon.default, {
481
+ name: "chevron-forward",
482
+ size: 16,
483
+ color: "#ccc"
484
+ })]
536
485
  })]
537
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
538
- style: styles.actionsSection,
539
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
540
- style: [styles.actionButton, {
541
- borderColor: colors.border,
542
- backgroundColor: colors.card
543
- }],
544
- onPress: () => setShowDeviceManagement(!showDeviceManagement),
545
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
546
- style: [styles.actionButtonText, {
547
- color: colors.text
548
- }],
549
- children: showDeviceManagement ? '− Hide Device Management' : '+ Manage Device Sessions'
550
- })
551
- })
552
486
  }), showDeviceManagement && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
553
- style: [styles.deviceManagementSection, {
554
- backgroundColor: colors.card,
555
- borderColor: colors.border
556
- }],
487
+ style: styles.section,
557
488
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
558
- style: [styles.sectionTitle, {
559
- color: colors.text
560
- }],
489
+ style: styles.sectionTitle,
561
490
  children: "Device Sessions"
562
- }), loadingDeviceSessions ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
563
- style: styles.loadingContainer,
564
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.ActivityIndicator, {
565
- size: "large",
566
- color: colors.accent
567
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
568
- style: [styles.loadingText, {
569
- color: colors.secondaryText
570
- }],
571
- children: "Loading device sessions..."
572
- })]
491
+ }), loadingDeviceSessions ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
492
+ style: [styles.settingItem, styles.firstSettingItem, styles.lastSettingItem],
493
+ children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
494
+ style: styles.loadingContainer,
495
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.ActivityIndicator, {
496
+ size: "small",
497
+ color: "#007AFF"
498
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
499
+ style: styles.loadingText,
500
+ children: "Loading device sessions..."
501
+ })]
502
+ })
573
503
  }) : deviceSessions.length === 0 ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
574
- style: styles.emptyState,
575
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
576
- style: [styles.emptyText, {
577
- color: colors.secondaryText
578
- }],
579
- children: "No device sessions found"
504
+ style: [styles.settingItem, styles.firstSettingItem, styles.lastSettingItem],
505
+ children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
506
+ style: styles.settingInfo,
507
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_OxyIcon.default, {
508
+ name: "phone-portrait",
509
+ size: 20,
510
+ color: "#ccc",
511
+ style: styles.settingIcon
512
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
513
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
514
+ style: styles.settingLabel,
515
+ children: "No device sessions found"
516
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
517
+ style: styles.settingDescription,
518
+ children: "Device session management not available"
519
+ })]
520
+ })]
580
521
  })
581
- }) : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
582
- children: [deviceSessions.map(renderDeviceSessionItem), deviceSessions.filter(session => !session.isCurrent).length > 0 && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
583
- style: [styles.actionButton, styles.dangerButton, {
584
- borderColor: colors.destructive,
585
- backgroundColor: colors.background,
586
- marginTop: 20
587
- }],
588
- onPress: handleLogoutAllDevices,
589
- disabled: loggingOutAllDevices,
590
- children: loggingOutAllDevices ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.ActivityIndicator, {
591
- color: colors.destructive,
592
- size: "small"
593
- }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
594
- style: [styles.dangerButtonText, {
595
- color: colors.destructive
596
- }],
597
- children: "Sign Out All Other Devices"
598
- })
599
- })]
522
+ }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
523
+ children: deviceSessions.map((session, index) => /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
524
+ style: [styles.settingItem, index === 0 && styles.firstSettingItem, index === deviceSessions.length - 1 && styles.lastSettingItem],
525
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
526
+ style: styles.settingInfo,
527
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_OxyIcon.default, {
528
+ name: session.isCurrent ? "phone-portrait" : "phone-portrait-outline",
529
+ size: 20,
530
+ color: session.isCurrent ? "#34C759" : "#8E8E93",
531
+ style: styles.settingIcon
532
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
533
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
534
+ style: styles.settingLabel,
535
+ children: [session.deviceName, " ", session.isCurrent ? '(This device)' : '']
536
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
537
+ style: styles.settingDescription,
538
+ children: ["Last active: ", new Date(session.lastActive).toLocaleDateString()]
539
+ })]
540
+ })]
541
+ }), !session.isCurrent && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
542
+ style: styles.removeButton,
543
+ onPress: () => handleRemoteSessionLogout(session.sessionId, session.deviceName),
544
+ disabled: remotingLogoutSessionId === session.sessionId,
545
+ children: remotingLogoutSessionId === session.sessionId ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.ActivityIndicator, {
546
+ size: "small",
547
+ color: "#FF3B30"
548
+ }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_OxyIcon.default, {
549
+ name: "log-out",
550
+ size: 16,
551
+ color: "#FF3B30"
552
+ })
553
+ })]
554
+ }, session.sessionId))
600
555
  })]
601
- }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
602
- style: styles.actionsSection,
603
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
604
- style: [styles.actionButton, {
605
- borderColor: colors.border,
606
- backgroundColor: colors.card
607
- }],
608
- onPress: () => navigate?.('SignIn'),
609
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
610
- style: [styles.actionButtonText, {
611
- color: colors.text
612
- }],
613
- children: "+ Add Another Account"
614
- })
615
- }), sessionsWithUsers.length > 0 && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
616
- style: [styles.actionButton, styles.dangerButton, {
617
- borderColor: colors.destructive,
618
- backgroundColor: colors.background
619
- }],
620
- onPress: handleLogoutAll,
621
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
622
- style: [styles.dangerButtonText, {
623
- color: colors.destructive
624
- }],
625
- children: "Sign Out All Accounts"
556
+ }), sessionsWithUsers.length === 0 && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
557
+ style: styles.section,
558
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
559
+ style: [styles.settingItem, styles.firstSettingItem, styles.lastSettingItem],
560
+ children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
561
+ style: styles.emptyStateContainer,
562
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_OxyIcon.default, {
563
+ name: "person-outline",
564
+ size: 48,
565
+ color: "#ccc"
566
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
567
+ style: styles.emptyStateTitle,
568
+ children: "No saved accounts"
569
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
570
+ style: styles.emptyStateDescription,
571
+ children: "Add another account to switch between them quickly"
572
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
573
+ style: styles.addAccountButton,
574
+ onPress: () => navigate?.('SignIn'),
575
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
576
+ style: styles.addAccountButtonText,
577
+ children: "Add Account"
578
+ })
579
+ })]
626
580
  })
627
- })]
581
+ })
628
582
  })]
629
583
  })
630
584
  })]
@@ -632,193 +586,202 @@ const ModernAccountSwitcherScreen = ({
632
586
  };
633
587
  const styles = _reactNative.StyleSheet.create({
634
588
  container: {
635
- flex: 1
589
+ flex: 1,
590
+ backgroundColor: '#f2f2f2'
636
591
  },
637
592
  header: {
593
+ paddingHorizontal: 20,
594
+ paddingTop: 60,
595
+ paddingBottom: 16,
596
+ backgroundColor: '#fff',
597
+ borderBottomWidth: 1,
598
+ borderBottomColor: '#e0e0e0',
638
599
  flexDirection: 'row',
639
- alignItems: 'center',
640
600
  justifyContent: 'space-between',
641
- paddingHorizontal: 20,
642
- paddingTop: 20,
643
- paddingBottom: 10
601
+ alignItems: 'center'
602
+ },
603
+ headerTitle: {
604
+ fontSize: 24,
605
+ fontWeight: 'bold',
606
+ color: '#000'
644
607
  },
645
608
  backButton: {
646
609
  padding: 8
647
610
  },
648
- backButtonText: {
649
- fontSize: 18,
650
- fontFamily: _fonts.fontFamilies.phuduMedium
611
+ closeButton: {
612
+ padding: 8
651
613
  },
652
- title: {
614
+ closeButtonText: {
653
615
  fontSize: 24,
654
- fontFamily: _fonts.fontFamilies.phuduBold,
655
- textAlign: 'center'
656
- },
657
- headerSpacer: {
658
- width: 40
616
+ color: '#000',
617
+ fontWeight: '300'
659
618
  },
660
619
  content: {
661
620
  flex: 1,
662
- paddingHorizontal: 20
621
+ padding: 16
663
622
  },
664
- scrollContent: {
665
- paddingBottom: 40
666
- },
667
- loadingContainer: {
668
- flex: 1,
669
- justifyContent: 'center',
670
- alignItems: 'center',
671
- paddingTop: 60
672
- },
673
- loadingText: {
674
- marginTop: 16,
675
- fontSize: 16,
676
- fontFamily: _fonts.fontFamilies.phudu
623
+ section: {
624
+ marginBottom: 24
677
625
  },
678
626
  sectionTitle: {
679
- fontSize: 20,
680
- fontFamily: _fonts.fontFamilies.phuduSemiBold,
681
- marginBottom: 20,
682
- marginTop: 10
627
+ fontSize: 16,
628
+ fontWeight: '600',
629
+ color: '#333',
630
+ marginBottom: 12
683
631
  },
684
- emptyState: {
632
+ settingItem: {
633
+ backgroundColor: '#fff',
634
+ padding: 16,
635
+ flexDirection: 'row',
685
636
  alignItems: 'center',
686
- paddingVertical: 40
637
+ justifyContent: 'space-between',
638
+ marginBottom: 2
687
639
  },
688
- emptyText: {
689
- fontSize: 16,
690
- fontFamily: _fonts.fontFamilies.phudu,
691
- textAlign: 'center'
640
+ firstSettingItem: {
641
+ borderTopLeftRadius: 24,
642
+ borderTopRightRadius: 24
692
643
  },
693
- sessionCard: {
694
- borderRadius: 16,
695
- marginBottom: 16,
696
- padding: 20,
697
- shadowOffset: {
698
- width: 0,
699
- height: 2
700
- },
701
- shadowOpacity: 0.1,
702
- shadowRadius: 8,
703
- elevation: 3
704
- },
705
- sessionHeader: {
644
+ lastSettingItem: {
645
+ borderBottomLeftRadius: 24,
646
+ borderBottomRightRadius: 24,
647
+ marginBottom: 8
648
+ },
649
+ currentAccountCard: {
650
+ borderWidth: 2,
651
+ borderColor: '#007AFF',
652
+ backgroundColor: '#007AFF08'
653
+ },
654
+ settingInfo: {
706
655
  flexDirection: 'row',
707
656
  alignItems: 'center',
708
- marginBottom: 16
657
+ flex: 1
709
658
  },
710
- avatarContainer: {
711
- position: 'relative',
712
- marginRight: 16
659
+ settingIcon: {
660
+ marginRight: 12
713
661
  },
714
- avatar: {
715
- width: 60,
716
- height: 60,
717
- borderRadius: 30
662
+ settingLabel: {
663
+ fontSize: 16,
664
+ fontWeight: '500',
665
+ color: '#333',
666
+ marginBottom: 2
718
667
  },
719
- avatarPlaceholder: {
720
- width: 60,
721
- height: 60,
722
- borderRadius: 30,
723
- justifyContent: 'center',
724
- alignItems: 'center'
668
+ settingDescription: {
669
+ fontSize: 14,
670
+ color: '#666'
671
+ },
672
+ userIcon: {
673
+ marginRight: 12,
674
+ position: 'relative'
675
+ },
676
+ accountAvatarImage: {
677
+ width: 40,
678
+ height: 40,
679
+ borderRadius: 20
680
+ },
681
+ accountAvatarFallback: {
682
+ width: 40,
683
+ height: 40,
684
+ borderRadius: 20,
685
+ backgroundColor: '#d169e5',
686
+ alignItems: 'center',
687
+ justifyContent: 'center'
725
688
  },
726
- avatarText: {
727
- fontSize: 24,
728
- fontFamily: _fonts.fontFamilies.phuduBold
689
+ accountAvatarText: {
690
+ color: 'white',
691
+ fontSize: 18,
692
+ fontWeight: 'bold'
729
693
  },
730
694
  activeBadge: {
731
695
  position: 'absolute',
732
- bottom: -2,
696
+ top: -2,
733
697
  right: -2,
734
- width: 20,
735
- height: 20,
736
- borderRadius: 10,
698
+ width: 16,
699
+ height: 16,
700
+ borderRadius: 8,
701
+ backgroundColor: '#34C759',
702
+ alignItems: 'center',
737
703
  justifyContent: 'center',
738
- alignItems: 'center'
704
+ borderWidth: 2,
705
+ borderColor: '#fff'
739
706
  },
740
- activeBadgeText: {
741
- color: 'white',
742
- fontSize: 12,
743
- fontFamily: _fonts.fontFamilies.phuduBold
744
- },
745
- userInfo: {
746
- flex: 1,
747
- justifyContent: 'center'
748
- },
749
- displayName: {
750
- fontSize: 18,
751
- fontFamily: _fonts.fontFamilies.phuduSemiBold,
752
- marginBottom: 4
753
- },
754
- username: {
755
- fontSize: 14,
756
- fontFamily: _fonts.fontFamilies.phudu,
757
- marginBottom: 4
707
+ currentBadge: {
708
+ backgroundColor: '#007AFF',
709
+ paddingHorizontal: 8,
710
+ paddingVertical: 4,
711
+ borderRadius: 12
758
712
  },
759
- lastActive: {
713
+ currentBadgeText: {
714
+ color: '#fff',
760
715
  fontSize: 12,
761
- fontFamily: _fonts.fontFamilies.phudu
716
+ fontWeight: '600'
762
717
  },
763
- sessionActions: {
718
+ accountActions: {
764
719
  flexDirection: 'row',
765
- justifyContent: 'space-between',
766
- gap: 12
720
+ alignItems: 'center',
721
+ gap: 8
767
722
  },
768
723
  switchButton: {
769
- flex: 1,
770
- paddingVertical: 12,
771
- paddingHorizontal: 20,
772
- borderWidth: 1,
773
- borderRadius: 8,
774
- alignItems: 'center',
775
- justifyContent: 'center'
724
+ backgroundColor: '#007AFF',
725
+ paddingHorizontal: 16,
726
+ paddingVertical: 8,
727
+ borderRadius: 16,
728
+ minWidth: 60,
729
+ alignItems: 'center'
776
730
  },
777
731
  switchButtonText: {
732
+ color: '#fff',
778
733
  fontSize: 14,
779
- fontFamily: _fonts.fontFamilies.phuduSemiBold
734
+ fontWeight: '500'
780
735
  },
781
736
  removeButton: {
782
- flex: 1,
783
- paddingVertical: 12,
784
- paddingHorizontal: 20,
737
+ padding: 8,
738
+ borderRadius: 16,
739
+ backgroundColor: '#fff',
785
740
  borderWidth: 1,
786
- borderRadius: 8,
741
+ borderColor: '#FF3B30',
787
742
  alignItems: 'center',
788
743
  justifyContent: 'center'
789
744
  },
790
- removeButtonText: {
791
- fontSize: 14,
792
- fontFamily: _fonts.fontFamilies.phuduSemiBold
745
+ loadingContainer: {
746
+ flexDirection: 'row',
747
+ alignItems: 'center',
748
+ justifyContent: 'center',
749
+ paddingVertical: 20,
750
+ gap: 12
793
751
  },
794
- actionsSection: {
795
- marginTop: 40,
796
- gap: 16
752
+ loadingText: {
753
+ fontSize: 16,
754
+ color: '#666'
797
755
  },
798
- actionButton: {
799
- paddingVertical: 16,
800
- paddingHorizontal: 20,
801
- borderWidth: 1,
802
- borderRadius: 12,
756
+ emptyStateContainer: {
803
757
  alignItems: 'center',
804
- justifyContent: 'center'
758
+ paddingVertical: 32,
759
+ paddingHorizontal: 20
805
760
  },
806
- actionButtonText: {
807
- fontSize: 16,
808
- fontFamily: _fonts.fontFamilies.phuduSemiBold
761
+ emptyStateTitle: {
762
+ fontSize: 18,
763
+ fontWeight: '600',
764
+ color: '#333',
765
+ marginTop: 16,
766
+ marginBottom: 8
809
767
  },
810
- dangerButton: {
811
- // Additional styles for danger buttons if needed
768
+ emptyStateDescription: {
769
+ fontSize: 14,
770
+ color: '#666',
771
+ textAlign: 'center',
772
+ marginBottom: 24,
773
+ lineHeight: 20
774
+ },
775
+ addAccountButton: {
776
+ backgroundColor: '#007AFF',
777
+ paddingHorizontal: 24,
778
+ paddingVertical: 12,
779
+ borderRadius: 20
812
780
  },
813
- dangerButtonText: {
781
+ addAccountButtonText: {
782
+ color: '#fff',
814
783
  fontSize: 16,
815
- fontFamily: _fonts.fontFamilies.phuduSemiBold
816
- },
817
- deviceManagementSection: {
818
- marginTop: 20,
819
- padding: 16,
820
- borderRadius: 12,
821
- borderWidth: 1
784
+ fontWeight: '600'
822
785
  }
823
786
  });
824
787
  var _default = exports.default = ModernAccountSwitcherScreen;