@oxyhq/services 22.12.5 → 22.13.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 (464) hide show
  1. package/README.md +16 -46
  2. package/lib/commonjs/index.js +90 -10
  3. package/lib/commonjs/index.js.map +1 -1
  4. package/lib/commonjs/notifications/deviceNotifications.js +424 -0
  5. package/lib/commonjs/notifications/deviceNotifications.js.map +1 -0
  6. package/lib/commonjs/ui/boot/runProviderColdBoot.js +51 -9
  7. package/lib/commonjs/ui/boot/runProviderColdBoot.js.map +1 -1
  8. package/lib/commonjs/ui/client.js +0 -13
  9. package/lib/commonjs/ui/client.js.map +1 -1
  10. package/lib/commonjs/ui/components/OxyAccountDialogScreen.js +27 -4
  11. package/lib/commonjs/ui/components/OxyAccountDialogScreen.js.map +1 -1
  12. package/lib/commonjs/ui/components/OxyAuthChooser.js +74 -1124
  13. package/lib/commonjs/ui/components/OxyAuthChooser.js.map +1 -1
  14. package/lib/commonjs/ui/components/OxyConsentScreen.js +50 -12
  15. package/lib/commonjs/ui/components/OxyConsentScreen.js.map +1 -1
  16. package/lib/commonjs/ui/components/OxyProvider.js +4 -4
  17. package/lib/commonjs/ui/components/OxyProvider.js.map +1 -1
  18. package/lib/commonjs/ui/components/OxySignInButton.js +74 -40
  19. package/lib/commonjs/ui/components/OxySignInButton.js.map +1 -1
  20. package/lib/commonjs/ui/components/OxySignInRequestSurface.js +147 -0
  21. package/lib/commonjs/ui/components/OxySignInRequestSurface.js.map +1 -0
  22. package/lib/commonjs/ui/components/authChooser/AccountsMenuView.js +527 -0
  23. package/lib/commonjs/ui/components/authChooser/AccountsMenuView.js.map +1 -0
  24. package/lib/commonjs/ui/components/authChooser/SignInEntryView.js +90 -0
  25. package/lib/commonjs/ui/components/authChooser/SignInEntryView.js.map +1 -0
  26. package/lib/commonjs/ui/components/authChooser/SignInRequestView.js +106 -0
  27. package/lib/commonjs/ui/components/authChooser/SignInRequestView.js.map +1 -0
  28. package/lib/commonjs/ui/components/authChooser/SignUpView.js +188 -0
  29. package/lib/commonjs/ui/components/authChooser/SignUpView.js.map +1 -0
  30. package/lib/commonjs/ui/components/authChooser/TroubleDisclosure.js +61 -0
  31. package/lib/commonjs/ui/components/authChooser/TroubleDisclosure.js.map +1 -0
  32. package/lib/commonjs/ui/components/authChooser/primitives.js +169 -0
  33. package/lib/commonjs/ui/components/authChooser/primitives.js.map +1 -0
  34. package/lib/commonjs/ui/components/authChooser/requestSurfaces.js +153 -0
  35. package/lib/commonjs/ui/components/authChooser/requestSurfaces.js.map +1 -0
  36. package/lib/commonjs/ui/components/authChooser/signInProgress.js +54 -0
  37. package/lib/commonjs/ui/components/authChooser/signInProgress.js.map +1 -0
  38. package/lib/commonjs/ui/components/{oxyAuthChooserStyles.js → authChooser/styles.js} +19 -1
  39. package/lib/commonjs/ui/components/authChooser/styles.js.map +1 -0
  40. package/lib/commonjs/ui/components/authChooser/types.js +70 -0
  41. package/lib/commonjs/ui/components/authChooser/types.js.map +1 -0
  42. package/lib/commonjs/ui/components/authChooser/useUsernameAvailability.js +50 -0
  43. package/lib/commonjs/ui/components/authChooser/useUsernameAvailability.js.map +1 -0
  44. package/lib/commonjs/ui/context/OxyContext.js +205 -30
  45. package/lib/commonjs/ui/context/OxyContext.js.map +1 -1
  46. package/lib/commonjs/ui/context/commitSessionFlow.js +46 -0
  47. package/lib/commonjs/ui/context/commitSessionFlow.js.map +1 -1
  48. package/lib/commonjs/ui/context/hooks/useAuthOperations.js +15 -2
  49. package/lib/commonjs/ui/context/hooks/useAuthOperations.js.map +1 -1
  50. package/lib/commonjs/ui/context/useOxyAccountGraph.js +13 -5
  51. package/lib/commonjs/ui/context/useOxyAccountGraph.js.map +1 -1
  52. package/lib/commonjs/ui/hooks/useSwitchableAccounts.js +6 -1
  53. package/lib/commonjs/ui/hooks/useSwitchableAccounts.js.map +1 -1
  54. package/lib/commonjs/ui/index.js +0 -13
  55. package/lib/commonjs/ui/index.js.map +1 -1
  56. package/lib/commonjs/ui/oauth/browserAuthTransport.js +170 -0
  57. package/lib/commonjs/ui/oauth/browserAuthTransport.js.map +1 -0
  58. package/lib/commonjs/ui/oauth/completeOAuthCode.js +78 -0
  59. package/lib/commonjs/ui/oauth/completeOAuthCode.js.map +1 -0
  60. package/lib/commonjs/ui/oauth/legacyRedirectLanes.js +48 -0
  61. package/lib/commonjs/ui/oauth/legacyRedirectLanes.js.map +1 -0
  62. package/lib/commonjs/ui/oauth/oauthHandshake.js +53 -0
  63. package/lib/commonjs/ui/oauth/oauthHandshake.js.map +1 -0
  64. package/lib/commonjs/ui/oauth/oauthPopup.js +276 -0
  65. package/lib/commonjs/ui/oauth/oauthPopup.js.map +1 -0
  66. package/lib/commonjs/ui/oauth/oauthPopupMessages.js +141 -0
  67. package/lib/commonjs/ui/oauth/oauthPopupMessages.js.map +1 -0
  68. package/lib/commonjs/ui/oauth/types.js +2 -0
  69. package/lib/commonjs/ui/oauth/types.js.map +1 -0
  70. package/lib/commonjs/ui/server.js +2 -5
  71. package/lib/commonjs/ui/server.js.map +1 -1
  72. package/lib/commonjs/ui/session/authStore.js +6 -75
  73. package/lib/commonjs/ui/session/authStore.js.map +1 -1
  74. package/lib/commonjs/ui/session/createSessionClient.js +11 -3
  75. package/lib/commonjs/ui/session/createSessionClient.js.map +1 -1
  76. package/lib/commonjs/ui/session/identityBinding.js +95 -0
  77. package/lib/commonjs/ui/session/identityBinding.js.map +1 -0
  78. package/lib/commonjs/ui/session/index.js +13 -0
  79. package/lib/commonjs/ui/session/index.js.map +1 -1
  80. package/lib/commonjs/ui/session/nativeSecureStorage.js +90 -0
  81. package/lib/commonjs/ui/session/nativeSecureStorage.js.map +1 -0
  82. package/lib/commonjs/ui/session/tokenTransport.js +11 -1
  83. package/lib/commonjs/ui/session/tokenTransport.js.map +1 -1
  84. package/lib/commonjs/ui/utils/crossOriginRestore.js +3 -2
  85. package/lib/commonjs/ui/utils/crossOriginRestore.js.map +1 -1
  86. package/lib/commonjs/ui/utils/deliveryPlatform.js +58 -0
  87. package/lib/commonjs/ui/utils/deliveryPlatform.js.map +1 -0
  88. package/lib/commonjs/ui/utils/oauthReturn.js +33 -49
  89. package/lib/commonjs/ui/utils/oauthReturn.js.map +1 -1
  90. package/lib/module/index.js +27 -4
  91. package/lib/module/index.js.map +1 -1
  92. package/lib/module/notifications/deviceNotifications.js +414 -0
  93. package/lib/module/notifications/deviceNotifications.js.map +1 -0
  94. package/lib/module/ui/boot/runProviderColdBoot.js +51 -9
  95. package/lib/module/ui/boot/runProviderColdBoot.js.map +1 -1
  96. package/lib/module/ui/client.js +0 -1
  97. package/lib/module/ui/client.js.map +1 -1
  98. package/lib/module/ui/components/OxyAccountDialogScreen.js +27 -4
  99. package/lib/module/ui/components/OxyAccountDialogScreen.js.map +1 -1
  100. package/lib/module/ui/components/OxyAuthChooser.js +78 -1129
  101. package/lib/module/ui/components/OxyAuthChooser.js.map +1 -1
  102. package/lib/module/ui/components/OxyConsentScreen.js +50 -12
  103. package/lib/module/ui/components/OxyConsentScreen.js.map +1 -1
  104. package/lib/module/ui/components/OxyProvider.js +4 -4
  105. package/lib/module/ui/components/OxyProvider.js.map +1 -1
  106. package/lib/module/ui/components/OxySignInButton.js +76 -42
  107. package/lib/module/ui/components/OxySignInButton.js.map +1 -1
  108. package/lib/module/ui/components/OxySignInRequestSurface.js +141 -0
  109. package/lib/module/ui/components/OxySignInRequestSurface.js.map +1 -0
  110. package/lib/module/ui/components/authChooser/AccountsMenuView.js +523 -0
  111. package/lib/module/ui/components/authChooser/AccountsMenuView.js.map +1 -0
  112. package/lib/module/ui/components/authChooser/SignInEntryView.js +85 -0
  113. package/lib/module/ui/components/authChooser/SignInEntryView.js.map +1 -0
  114. package/lib/module/ui/components/authChooser/SignInRequestView.js +101 -0
  115. package/lib/module/ui/components/authChooser/SignInRequestView.js.map +1 -0
  116. package/lib/module/ui/components/authChooser/SignUpView.js +184 -0
  117. package/lib/module/ui/components/authChooser/SignUpView.js.map +1 -0
  118. package/lib/module/ui/components/authChooser/TroubleDisclosure.js +57 -0
  119. package/lib/module/ui/components/authChooser/TroubleDisclosure.js.map +1 -0
  120. package/lib/module/ui/components/authChooser/primitives.js +163 -0
  121. package/lib/module/ui/components/authChooser/primitives.js.map +1 -0
  122. package/lib/module/ui/components/authChooser/requestSurfaces.js +143 -0
  123. package/lib/module/ui/components/authChooser/requestSurfaces.js.map +1 -0
  124. package/lib/module/ui/components/authChooser/signInProgress.js +50 -0
  125. package/lib/module/ui/components/authChooser/signInProgress.js.map +1 -0
  126. package/lib/module/ui/components/{oxyAuthChooserStyles.js → authChooser/styles.js} +19 -1
  127. package/lib/module/ui/components/authChooser/styles.js.map +1 -0
  128. package/lib/module/ui/components/authChooser/types.js +66 -0
  129. package/lib/module/ui/components/authChooser/types.js.map +1 -0
  130. package/lib/module/ui/components/authChooser/useUsernameAvailability.js +46 -0
  131. package/lib/module/ui/components/authChooser/useUsernameAvailability.js.map +1 -0
  132. package/lib/module/ui/context/OxyContext.js +208 -33
  133. package/lib/module/ui/context/OxyContext.js.map +1 -1
  134. package/lib/module/ui/context/commitSessionFlow.js +45 -0
  135. package/lib/module/ui/context/commitSessionFlow.js.map +1 -1
  136. package/lib/module/ui/context/hooks/useAuthOperations.js +15 -2
  137. package/lib/module/ui/context/hooks/useAuthOperations.js.map +1 -1
  138. package/lib/module/ui/context/useOxyAccountGraph.js +13 -5
  139. package/lib/module/ui/context/useOxyAccountGraph.js.map +1 -1
  140. package/lib/module/ui/hooks/useSwitchableAccounts.js +6 -1
  141. package/lib/module/ui/hooks/useSwitchableAccounts.js.map +1 -1
  142. package/lib/module/ui/index.js +0 -1
  143. package/lib/module/ui/index.js.map +1 -1
  144. package/lib/module/ui/oauth/browserAuthTransport.js +167 -0
  145. package/lib/module/ui/oauth/browserAuthTransport.js.map +1 -0
  146. package/lib/module/ui/oauth/completeOAuthCode.js +75 -0
  147. package/lib/module/ui/oauth/completeOAuthCode.js.map +1 -0
  148. package/lib/module/ui/oauth/legacyRedirectLanes.js +44 -0
  149. package/lib/module/ui/oauth/legacyRedirectLanes.js.map +1 -0
  150. package/lib/module/ui/oauth/oauthHandshake.js +50 -0
  151. package/lib/module/ui/oauth/oauthHandshake.js.map +1 -0
  152. package/lib/module/ui/oauth/oauthPopup.js +268 -0
  153. package/lib/module/ui/oauth/oauthPopup.js.map +1 -0
  154. package/lib/module/ui/oauth/oauthPopupMessages.js +135 -0
  155. package/lib/module/ui/oauth/oauthPopupMessages.js.map +1 -0
  156. package/lib/module/ui/oauth/types.js +2 -0
  157. package/lib/module/ui/oauth/types.js.map +1 -0
  158. package/lib/module/ui/server.js +0 -2
  159. package/lib/module/ui/server.js.map +1 -1
  160. package/lib/module/ui/session/authStore.js +5 -75
  161. package/lib/module/ui/session/authStore.js.map +1 -1
  162. package/lib/module/ui/session/createSessionClient.js +11 -3
  163. package/lib/module/ui/session/createSessionClient.js.map +1 -1
  164. package/lib/module/ui/session/identityBinding.js +89 -0
  165. package/lib/module/ui/session/identityBinding.js.map +1 -0
  166. package/lib/module/ui/session/index.js +5 -2
  167. package/lib/module/ui/session/index.js.map +1 -1
  168. package/lib/module/ui/session/nativeSecureStorage.js +88 -0
  169. package/lib/module/ui/session/nativeSecureStorage.js.map +1 -0
  170. package/lib/module/ui/session/tokenTransport.js +11 -1
  171. package/lib/module/ui/session/tokenTransport.js.map +1 -1
  172. package/lib/module/ui/utils/crossOriginRestore.js +4 -3
  173. package/lib/module/ui/utils/crossOriginRestore.js.map +1 -1
  174. package/lib/module/ui/utils/deliveryPlatform.js +55 -0
  175. package/lib/module/ui/utils/deliveryPlatform.js.map +1 -0
  176. package/lib/module/ui/utils/oauthReturn.js +35 -50
  177. package/lib/module/ui/utils/oauthReturn.js.map +1 -1
  178. package/lib/typescript/commonjs/index.d.ts +9 -1
  179. package/lib/typescript/commonjs/index.d.ts.map +1 -1
  180. package/lib/typescript/commonjs/notifications/deviceNotifications.d.ts +173 -0
  181. package/lib/typescript/commonjs/notifications/deviceNotifications.d.ts.map +1 -0
  182. package/lib/typescript/commonjs/ui/boot/runProviderColdBoot.d.ts +34 -2
  183. package/lib/typescript/commonjs/ui/boot/runProviderColdBoot.d.ts.map +1 -1
  184. package/lib/typescript/commonjs/ui/client.d.ts +0 -1
  185. package/lib/typescript/commonjs/ui/client.d.ts.map +1 -1
  186. package/lib/typescript/commonjs/ui/components/OxyAccountDialogScreen.d.ts.map +1 -1
  187. package/lib/typescript/commonjs/ui/components/OxyAuthChooser.d.ts +23 -29
  188. package/lib/typescript/commonjs/ui/components/OxyAuthChooser.d.ts.map +1 -1
  189. package/lib/typescript/commonjs/ui/components/OxyConsentScreen.d.ts.map +1 -1
  190. package/lib/typescript/commonjs/ui/components/OxyProvider.d.ts.map +1 -1
  191. package/lib/typescript/commonjs/ui/components/OxySignInButton.d.ts +17 -12
  192. package/lib/typescript/commonjs/ui/components/OxySignInButton.d.ts.map +1 -1
  193. package/lib/typescript/commonjs/ui/components/OxySignInRequestSurface.d.ts +108 -0
  194. package/lib/typescript/commonjs/ui/components/OxySignInRequestSurface.d.ts.map +1 -0
  195. package/lib/typescript/commonjs/ui/components/authChooser/AccountsMenuView.d.ts +38 -0
  196. package/lib/typescript/commonjs/ui/components/authChooser/AccountsMenuView.d.ts.map +1 -0
  197. package/lib/typescript/commonjs/ui/components/authChooser/SignInEntryView.d.ts +32 -0
  198. package/lib/typescript/commonjs/ui/components/authChooser/SignInEntryView.d.ts.map +1 -0
  199. package/lib/typescript/commonjs/ui/components/authChooser/SignInRequestView.d.ts +34 -0
  200. package/lib/typescript/commonjs/ui/components/authChooser/SignInRequestView.d.ts.map +1 -0
  201. package/lib/typescript/commonjs/ui/components/authChooser/SignUpView.d.ts +34 -0
  202. package/lib/typescript/commonjs/ui/components/authChooser/SignUpView.d.ts.map +1 -0
  203. package/lib/typescript/commonjs/ui/components/authChooser/TroubleDisclosure.d.ts +36 -0
  204. package/lib/typescript/commonjs/ui/components/authChooser/TroubleDisclosure.d.ts.map +1 -0
  205. package/lib/typescript/commonjs/ui/components/authChooser/primitives.d.ts +55 -0
  206. package/lib/typescript/commonjs/ui/components/authChooser/primitives.d.ts.map +1 -0
  207. package/lib/typescript/commonjs/ui/components/authChooser/requestSurfaces.d.ts +58 -0
  208. package/lib/typescript/commonjs/ui/components/authChooser/requestSurfaces.d.ts.map +1 -0
  209. package/lib/typescript/commonjs/ui/components/authChooser/signInProgress.d.ts +26 -0
  210. package/lib/typescript/commonjs/ui/components/authChooser/signInProgress.d.ts.map +1 -0
  211. package/lib/typescript/{module/ui/components/oxyAuthChooserStyles.d.ts → commonjs/ui/components/authChooser/styles.d.ts} +19 -1
  212. package/lib/typescript/commonjs/ui/components/authChooser/styles.d.ts.map +1 -0
  213. package/lib/typescript/commonjs/ui/components/authChooser/types.d.ts +103 -0
  214. package/lib/typescript/commonjs/ui/components/authChooser/types.d.ts.map +1 -0
  215. package/lib/typescript/commonjs/ui/components/authChooser/useUsernameAvailability.d.ts +16 -0
  216. package/lib/typescript/commonjs/ui/components/authChooser/useUsernameAvailability.d.ts.map +1 -0
  217. package/lib/typescript/commonjs/ui/context/OxyContext.d.ts.map +1 -1
  218. package/lib/typescript/commonjs/ui/context/commitSessionFlow.d.ts +40 -0
  219. package/lib/typescript/commonjs/ui/context/commitSessionFlow.d.ts.map +1 -1
  220. package/lib/typescript/commonjs/ui/context/hooks/useAuthOperations.d.ts +11 -2
  221. package/lib/typescript/commonjs/ui/context/hooks/useAuthOperations.d.ts.map +1 -1
  222. package/lib/typescript/commonjs/ui/context/oxyContextTypes.d.ts +44 -1
  223. package/lib/typescript/commonjs/ui/context/oxyContextTypes.d.ts.map +1 -1
  224. package/lib/typescript/commonjs/ui/context/useOxyAccountGraph.d.ts +7 -1
  225. package/lib/typescript/commonjs/ui/context/useOxyAccountGraph.d.ts.map +1 -1
  226. package/lib/typescript/commonjs/ui/hooks/useSwitchableAccounts.d.ts.map +1 -1
  227. package/lib/typescript/commonjs/ui/index.d.ts +0 -1
  228. package/lib/typescript/commonjs/ui/index.d.ts.map +1 -1
  229. package/lib/typescript/commonjs/ui/oauth/browserAuthTransport.d.ts +56 -0
  230. package/lib/typescript/commonjs/ui/oauth/browserAuthTransport.d.ts.map +1 -0
  231. package/lib/typescript/commonjs/ui/oauth/completeOAuthCode.d.ts +49 -0
  232. package/lib/typescript/commonjs/ui/oauth/completeOAuthCode.d.ts.map +1 -0
  233. package/lib/typescript/commonjs/ui/oauth/legacyRedirectLanes.d.ts +40 -0
  234. package/lib/typescript/commonjs/ui/oauth/legacyRedirectLanes.d.ts.map +1 -0
  235. package/lib/typescript/commonjs/ui/oauth/oauthHandshake.d.ts +50 -0
  236. package/lib/typescript/commonjs/ui/oauth/oauthHandshake.d.ts.map +1 -0
  237. package/lib/typescript/commonjs/ui/oauth/oauthPopup.d.ts +83 -0
  238. package/lib/typescript/commonjs/ui/oauth/oauthPopup.d.ts.map +1 -0
  239. package/lib/typescript/commonjs/ui/oauth/oauthPopupMessages.d.ts +67 -0
  240. package/lib/typescript/commonjs/ui/oauth/oauthPopupMessages.d.ts.map +1 -0
  241. package/lib/typescript/commonjs/ui/oauth/types.d.ts +176 -0
  242. package/lib/typescript/commonjs/ui/oauth/types.d.ts.map +1 -0
  243. package/lib/typescript/commonjs/ui/server.d.ts +0 -2
  244. package/lib/typescript/commonjs/ui/server.d.ts.map +1 -1
  245. package/lib/typescript/commonjs/ui/session/authStore.d.ts +3 -7
  246. package/lib/typescript/commonjs/ui/session/authStore.d.ts.map +1 -1
  247. package/lib/typescript/commonjs/ui/session/createSessionClient.d.ts +8 -1
  248. package/lib/typescript/commonjs/ui/session/createSessionClient.d.ts.map +1 -1
  249. package/lib/typescript/commonjs/ui/session/identityBinding.d.ts +66 -0
  250. package/lib/typescript/commonjs/ui/session/identityBinding.d.ts.map +1 -0
  251. package/lib/typescript/commonjs/ui/session/index.d.ts +6 -2
  252. package/lib/typescript/commonjs/ui/session/index.d.ts.map +1 -1
  253. package/lib/typescript/commonjs/ui/session/nativeSecureStorage.d.ts +25 -0
  254. package/lib/typescript/commonjs/ui/session/nativeSecureStorage.d.ts.map +1 -0
  255. package/lib/typescript/commonjs/ui/session/tokenTransport.d.ts +8 -1
  256. package/lib/typescript/commonjs/ui/session/tokenTransport.d.ts.map +1 -1
  257. package/lib/typescript/commonjs/ui/types/navigation.d.ts +44 -0
  258. package/lib/typescript/commonjs/ui/types/navigation.d.ts.map +1 -1
  259. package/lib/typescript/commonjs/ui/utils/crossOriginRestore.d.ts.map +1 -1
  260. package/lib/typescript/commonjs/ui/utils/deliveryPlatform.d.ts +33 -0
  261. package/lib/typescript/commonjs/ui/utils/deliveryPlatform.d.ts.map +1 -0
  262. package/lib/typescript/commonjs/ui/utils/oauthReturn.d.ts +11 -16
  263. package/lib/typescript/commonjs/ui/utils/oauthReturn.d.ts.map +1 -1
  264. package/lib/typescript/module/index.d.ts +9 -1
  265. package/lib/typescript/module/index.d.ts.map +1 -1
  266. package/lib/typescript/module/notifications/deviceNotifications.d.ts +173 -0
  267. package/lib/typescript/module/notifications/deviceNotifications.d.ts.map +1 -0
  268. package/lib/typescript/module/ui/boot/runProviderColdBoot.d.ts +34 -2
  269. package/lib/typescript/module/ui/boot/runProviderColdBoot.d.ts.map +1 -1
  270. package/lib/typescript/module/ui/client.d.ts +0 -1
  271. package/lib/typescript/module/ui/client.d.ts.map +1 -1
  272. package/lib/typescript/module/ui/components/OxyAccountDialogScreen.d.ts.map +1 -1
  273. package/lib/typescript/module/ui/components/OxyAuthChooser.d.ts +23 -29
  274. package/lib/typescript/module/ui/components/OxyAuthChooser.d.ts.map +1 -1
  275. package/lib/typescript/module/ui/components/OxyConsentScreen.d.ts.map +1 -1
  276. package/lib/typescript/module/ui/components/OxyProvider.d.ts.map +1 -1
  277. package/lib/typescript/module/ui/components/OxySignInButton.d.ts +17 -12
  278. package/lib/typescript/module/ui/components/OxySignInButton.d.ts.map +1 -1
  279. package/lib/typescript/module/ui/components/OxySignInRequestSurface.d.ts +108 -0
  280. package/lib/typescript/module/ui/components/OxySignInRequestSurface.d.ts.map +1 -0
  281. package/lib/typescript/module/ui/components/authChooser/AccountsMenuView.d.ts +38 -0
  282. package/lib/typescript/module/ui/components/authChooser/AccountsMenuView.d.ts.map +1 -0
  283. package/lib/typescript/module/ui/components/authChooser/SignInEntryView.d.ts +32 -0
  284. package/lib/typescript/module/ui/components/authChooser/SignInEntryView.d.ts.map +1 -0
  285. package/lib/typescript/module/ui/components/authChooser/SignInRequestView.d.ts +34 -0
  286. package/lib/typescript/module/ui/components/authChooser/SignInRequestView.d.ts.map +1 -0
  287. package/lib/typescript/module/ui/components/authChooser/SignUpView.d.ts +34 -0
  288. package/lib/typescript/module/ui/components/authChooser/SignUpView.d.ts.map +1 -0
  289. package/lib/typescript/module/ui/components/authChooser/TroubleDisclosure.d.ts +36 -0
  290. package/lib/typescript/module/ui/components/authChooser/TroubleDisclosure.d.ts.map +1 -0
  291. package/lib/typescript/module/ui/components/authChooser/primitives.d.ts +55 -0
  292. package/lib/typescript/module/ui/components/authChooser/primitives.d.ts.map +1 -0
  293. package/lib/typescript/module/ui/components/authChooser/requestSurfaces.d.ts +58 -0
  294. package/lib/typescript/module/ui/components/authChooser/requestSurfaces.d.ts.map +1 -0
  295. package/lib/typescript/module/ui/components/authChooser/signInProgress.d.ts +26 -0
  296. package/lib/typescript/module/ui/components/authChooser/signInProgress.d.ts.map +1 -0
  297. package/lib/typescript/{commonjs/ui/components/oxyAuthChooserStyles.d.ts → module/ui/components/authChooser/styles.d.ts} +19 -1
  298. package/lib/typescript/module/ui/components/authChooser/styles.d.ts.map +1 -0
  299. package/lib/typescript/module/ui/components/authChooser/types.d.ts +103 -0
  300. package/lib/typescript/module/ui/components/authChooser/types.d.ts.map +1 -0
  301. package/lib/typescript/module/ui/components/authChooser/useUsernameAvailability.d.ts +16 -0
  302. package/lib/typescript/module/ui/components/authChooser/useUsernameAvailability.d.ts.map +1 -0
  303. package/lib/typescript/module/ui/context/OxyContext.d.ts.map +1 -1
  304. package/lib/typescript/module/ui/context/commitSessionFlow.d.ts +40 -0
  305. package/lib/typescript/module/ui/context/commitSessionFlow.d.ts.map +1 -1
  306. package/lib/typescript/module/ui/context/hooks/useAuthOperations.d.ts +11 -2
  307. package/lib/typescript/module/ui/context/hooks/useAuthOperations.d.ts.map +1 -1
  308. package/lib/typescript/module/ui/context/oxyContextTypes.d.ts +44 -1
  309. package/lib/typescript/module/ui/context/oxyContextTypes.d.ts.map +1 -1
  310. package/lib/typescript/module/ui/context/useOxyAccountGraph.d.ts +7 -1
  311. package/lib/typescript/module/ui/context/useOxyAccountGraph.d.ts.map +1 -1
  312. package/lib/typescript/module/ui/hooks/useSwitchableAccounts.d.ts.map +1 -1
  313. package/lib/typescript/module/ui/index.d.ts +0 -1
  314. package/lib/typescript/module/ui/index.d.ts.map +1 -1
  315. package/lib/typescript/module/ui/oauth/browserAuthTransport.d.ts +56 -0
  316. package/lib/typescript/module/ui/oauth/browserAuthTransport.d.ts.map +1 -0
  317. package/lib/typescript/module/ui/oauth/completeOAuthCode.d.ts +49 -0
  318. package/lib/typescript/module/ui/oauth/completeOAuthCode.d.ts.map +1 -0
  319. package/lib/typescript/module/ui/oauth/legacyRedirectLanes.d.ts +40 -0
  320. package/lib/typescript/module/ui/oauth/legacyRedirectLanes.d.ts.map +1 -0
  321. package/lib/typescript/module/ui/oauth/oauthHandshake.d.ts +50 -0
  322. package/lib/typescript/module/ui/oauth/oauthHandshake.d.ts.map +1 -0
  323. package/lib/typescript/module/ui/oauth/oauthPopup.d.ts +83 -0
  324. package/lib/typescript/module/ui/oauth/oauthPopup.d.ts.map +1 -0
  325. package/lib/typescript/module/ui/oauth/oauthPopupMessages.d.ts +67 -0
  326. package/lib/typescript/module/ui/oauth/oauthPopupMessages.d.ts.map +1 -0
  327. package/lib/typescript/module/ui/oauth/types.d.ts +176 -0
  328. package/lib/typescript/module/ui/oauth/types.d.ts.map +1 -0
  329. package/lib/typescript/module/ui/server.d.ts +0 -2
  330. package/lib/typescript/module/ui/server.d.ts.map +1 -1
  331. package/lib/typescript/module/ui/session/authStore.d.ts +3 -7
  332. package/lib/typescript/module/ui/session/authStore.d.ts.map +1 -1
  333. package/lib/typescript/module/ui/session/createSessionClient.d.ts +8 -1
  334. package/lib/typescript/module/ui/session/createSessionClient.d.ts.map +1 -1
  335. package/lib/typescript/module/ui/session/identityBinding.d.ts +66 -0
  336. package/lib/typescript/module/ui/session/identityBinding.d.ts.map +1 -0
  337. package/lib/typescript/module/ui/session/index.d.ts +6 -2
  338. package/lib/typescript/module/ui/session/index.d.ts.map +1 -1
  339. package/lib/typescript/module/ui/session/nativeSecureStorage.d.ts +25 -0
  340. package/lib/typescript/module/ui/session/nativeSecureStorage.d.ts.map +1 -0
  341. package/lib/typescript/module/ui/session/tokenTransport.d.ts +8 -1
  342. package/lib/typescript/module/ui/session/tokenTransport.d.ts.map +1 -1
  343. package/lib/typescript/module/ui/types/navigation.d.ts +44 -0
  344. package/lib/typescript/module/ui/types/navigation.d.ts.map +1 -1
  345. package/lib/typescript/module/ui/utils/crossOriginRestore.d.ts.map +1 -1
  346. package/lib/typescript/module/ui/utils/deliveryPlatform.d.ts +33 -0
  347. package/lib/typescript/module/ui/utils/deliveryPlatform.d.ts.map +1 -0
  348. package/lib/typescript/module/ui/utils/oauthReturn.d.ts +11 -16
  349. package/lib/typescript/module/ui/utils/oauthReturn.d.ts.map +1 -1
  350. package/package.json +18 -10
  351. package/src/index.ts +51 -5
  352. package/src/notifications/deviceNotifications.ts +458 -0
  353. package/src/ui/boot/__tests__/coldBootWebAuthMode.test.ts +281 -0
  354. package/src/ui/boot/runProviderColdBoot.ts +83 -13
  355. package/src/ui/client.ts +0 -1
  356. package/src/ui/components/OxyAccountDialogScreen.tsx +33 -4
  357. package/src/ui/components/OxyAuthChooser.tsx +102 -1231
  358. package/src/ui/components/OxyConsentScreen.tsx +56 -13
  359. package/src/ui/components/OxyProvider.tsx +4 -4
  360. package/src/ui/components/OxySignInButton.tsx +119 -78
  361. package/src/ui/components/OxySignInRequestSurface.tsx +202 -0
  362. package/src/ui/components/__tests__/OxyConsentScreen.test.tsx +27 -0
  363. package/src/ui/components/authChooser/AccountsMenuView.tsx +569 -0
  364. package/src/ui/components/authChooser/SignInEntryView.tsx +121 -0
  365. package/src/ui/components/authChooser/SignInRequestView.tsx +130 -0
  366. package/src/ui/components/authChooser/SignUpView.tsx +174 -0
  367. package/src/ui/components/authChooser/TroubleDisclosure.tsx +73 -0
  368. package/src/ui/components/authChooser/primitives.tsx +144 -0
  369. package/src/ui/components/authChooser/requestSurfaces.tsx +120 -0
  370. package/src/ui/components/authChooser/signInProgress.ts +54 -0
  371. package/src/ui/components/{oxyAuthChooserStyles.ts → authChooser/styles.ts} +18 -0
  372. package/src/ui/components/authChooser/types.ts +120 -0
  373. package/src/ui/components/authChooser/useUsernameAvailability.ts +60 -0
  374. package/src/ui/context/OxyContext.tsx +226 -24
  375. package/src/ui/context/__tests__/commitSessionFlow.test.ts +102 -0
  376. package/src/ui/context/commitSessionFlow.ts +64 -0
  377. package/src/ui/context/hooks/useAuthOperations.ts +26 -1
  378. package/src/ui/context/oxyContextTypes.ts +45 -1
  379. package/src/ui/context/useOxyAccountGraph.ts +19 -5
  380. package/src/ui/hooks/useSwitchableAccounts.ts +12 -1
  381. package/src/ui/index.ts +0 -1
  382. package/src/ui/oauth/__tests__/browserAuthTransport.test.ts +335 -0
  383. package/src/ui/oauth/__tests__/completeOAuthCode.test.ts +142 -0
  384. package/src/ui/oauth/__tests__/oauthPopup.test.ts +352 -0
  385. package/src/ui/oauth/__tests__/oauthPopupMessages.test.ts +189 -0
  386. package/src/ui/oauth/__tests__/sharedCompletionPath.test.ts +174 -0
  387. package/src/ui/oauth/browserAuthTransport.ts +193 -0
  388. package/src/ui/oauth/completeOAuthCode.ts +93 -0
  389. package/src/ui/oauth/legacyRedirectLanes.ts +43 -0
  390. package/src/ui/oauth/oauthHandshake.ts +74 -0
  391. package/src/ui/oauth/oauthPopup.ts +277 -0
  392. package/src/ui/oauth/oauthPopupMessages.ts +136 -0
  393. package/src/ui/oauth/types.ts +150 -0
  394. package/src/ui/server.ts +0 -2
  395. package/src/ui/session/__tests__/createSessionClient.test.ts +26 -0
  396. package/src/ui/session/__tests__/tokenTransport.test.ts +34 -0
  397. package/src/ui/session/authStore.ts +5 -89
  398. package/src/ui/session/createSessionClient.ts +15 -2
  399. package/src/ui/session/identityBinding.ts +116 -0
  400. package/src/ui/session/index.ts +6 -2
  401. package/src/ui/session/nativeSecureStorage.ts +98 -0
  402. package/src/ui/session/tokenTransport.ts +14 -1
  403. package/src/ui/types/navigation.ts +44 -1
  404. package/src/ui/utils/__tests__/crossOriginRestore.test.ts +17 -0
  405. package/src/ui/utils/crossOriginRestore.ts +7 -6
  406. package/src/ui/utils/deliveryPlatform.ts +65 -0
  407. package/src/ui/utils/oauthReturn.ts +38 -62
  408. package/lib/commonjs/assets/assets/fonts/Inter/Inter_18pt-Black.ttf +0 -0
  409. package/lib/commonjs/assets/assets/fonts/Inter/Inter_18pt-Bold.ttf +0 -0
  410. package/lib/commonjs/assets/assets/fonts/Inter/Inter_18pt-ExtraBold.ttf +0 -0
  411. package/lib/commonjs/assets/assets/fonts/Inter/Inter_18pt-Light.ttf +0 -0
  412. package/lib/commonjs/assets/assets/fonts/Inter/Inter_18pt-Medium.ttf +0 -0
  413. package/lib/commonjs/assets/assets/fonts/Inter/Inter_18pt-Regular.ttf +0 -0
  414. package/lib/commonjs/assets/assets/fonts/Inter/Inter_18pt-SemiBold.ttf +0 -0
  415. package/lib/commonjs/assets/fonts/Inter/Inter_18pt-Black.ttf +0 -0
  416. package/lib/commonjs/assets/fonts/Inter/Inter_18pt-Bold.ttf +0 -0
  417. package/lib/commonjs/assets/fonts/Inter/Inter_18pt-ExtraBold.ttf +0 -0
  418. package/lib/commonjs/assets/fonts/Inter/Inter_18pt-Light.ttf +0 -0
  419. package/lib/commonjs/assets/fonts/Inter/Inter_18pt-Medium.ttf +0 -0
  420. package/lib/commonjs/assets/fonts/Inter/Inter_18pt-Regular.ttf +0 -0
  421. package/lib/commonjs/assets/fonts/Inter/Inter_18pt-SemiBold.ttf +0 -0
  422. package/lib/commonjs/ui/components/FontLoader.js +0 -35
  423. package/lib/commonjs/ui/components/FontLoader.js.map +0 -1
  424. package/lib/commonjs/ui/components/FontLoader.native.js +0 -88
  425. package/lib/commonjs/ui/components/FontLoader.native.js.map +0 -1
  426. package/lib/commonjs/ui/components/oxyAuthChooserStyles.js.map +0 -1
  427. package/lib/module/assets/assets/fonts/Inter/Inter_18pt-Black.ttf +0 -0
  428. package/lib/module/assets/assets/fonts/Inter/Inter_18pt-Bold.ttf +0 -0
  429. package/lib/module/assets/assets/fonts/Inter/Inter_18pt-ExtraBold.ttf +0 -0
  430. package/lib/module/assets/assets/fonts/Inter/Inter_18pt-Light.ttf +0 -0
  431. package/lib/module/assets/assets/fonts/Inter/Inter_18pt-Medium.ttf +0 -0
  432. package/lib/module/assets/assets/fonts/Inter/Inter_18pt-Regular.ttf +0 -0
  433. package/lib/module/assets/assets/fonts/Inter/Inter_18pt-SemiBold.ttf +0 -0
  434. package/lib/module/assets/fonts/Inter/Inter_18pt-Black.ttf +0 -0
  435. package/lib/module/assets/fonts/Inter/Inter_18pt-Bold.ttf +0 -0
  436. package/lib/module/assets/fonts/Inter/Inter_18pt-ExtraBold.ttf +0 -0
  437. package/lib/module/assets/fonts/Inter/Inter_18pt-Light.ttf +0 -0
  438. package/lib/module/assets/fonts/Inter/Inter_18pt-Medium.ttf +0 -0
  439. package/lib/module/assets/fonts/Inter/Inter_18pt-Regular.ttf +0 -0
  440. package/lib/module/assets/fonts/Inter/Inter_18pt-SemiBold.ttf +0 -0
  441. package/lib/module/ui/components/FontLoader.js +0 -29
  442. package/lib/module/ui/components/FontLoader.js.map +0 -1
  443. package/lib/module/ui/components/FontLoader.native.js +0 -83
  444. package/lib/module/ui/components/FontLoader.native.js.map +0 -1
  445. package/lib/module/ui/components/oxyAuthChooserStyles.js.map +0 -1
  446. package/lib/typescript/commonjs/ui/components/FontLoader.d.ts +0 -24
  447. package/lib/typescript/commonjs/ui/components/FontLoader.d.ts.map +0 -1
  448. package/lib/typescript/commonjs/ui/components/FontLoader.native.d.ts +0 -13
  449. package/lib/typescript/commonjs/ui/components/FontLoader.native.d.ts.map +0 -1
  450. package/lib/typescript/commonjs/ui/components/oxyAuthChooserStyles.d.ts.map +0 -1
  451. package/lib/typescript/module/ui/components/FontLoader.d.ts +0 -24
  452. package/lib/typescript/module/ui/components/FontLoader.d.ts.map +0 -1
  453. package/lib/typescript/module/ui/components/FontLoader.native.d.ts +0 -13
  454. package/lib/typescript/module/ui/components/FontLoader.native.d.ts.map +0 -1
  455. package/lib/typescript/module/ui/components/oxyAuthChooserStyles.d.ts.map +0 -1
  456. package/src/assets/fonts/Inter/Inter_18pt-Black.ttf +0 -0
  457. package/src/assets/fonts/Inter/Inter_18pt-Bold.ttf +0 -0
  458. package/src/assets/fonts/Inter/Inter_18pt-ExtraBold.ttf +0 -0
  459. package/src/assets/fonts/Inter/Inter_18pt-Light.ttf +0 -0
  460. package/src/assets/fonts/Inter/Inter_18pt-Medium.ttf +0 -0
  461. package/src/assets/fonts/Inter/Inter_18pt-Regular.ttf +0 -0
  462. package/src/assets/fonts/Inter/Inter_18pt-SemiBold.ttf +0 -0
  463. package/src/ui/components/FontLoader.native.tsx +0 -88
  464. package/src/ui/components/FontLoader.tsx +0 -27
@@ -0,0 +1,424 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.ensureNotificationChannel = ensureNotificationChannel;
7
+ exports.getExpoPushToken = getExpoPushToken;
8
+ exports.hasNotificationPermission = hasNotificationPermission;
9
+ exports.installForegroundNotificationHandler = installForegroundNotificationHandler;
10
+ exports.pushTokenPlatform = pushTokenPlatform;
11
+ exports.requestNotificationPermission = requestNotificationPermission;
12
+ exports.subscribeToNotificationResponses = subscribeToNotificationResponses;
13
+ exports.takeLaunchNotificationData = takeLaunchNotificationData;
14
+ var _core = require("@oxyhq/core");
15
+ var _reactNative = require("react-native");
16
+ 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
+ * The ONE place `@oxyhq/services` touches `expo-notifications`.
18
+ *
19
+ * Every Oxy app that receives push needs the identical adapter — native-only,
20
+ * dynamically imported, reading the OS permission and minting an EXPO push
21
+ * token — so it lives here instead of being copied into each app. The
22
+ * bearer-authenticated transport (`registerPushToken` / `unregisterPushToken`)
23
+ * already lives in `@oxyhq/core`; core may never import an `expo-*` module, and
24
+ * this adapter is the Expo-side half that closes that gap.
25
+ *
26
+ * ## Native-only by construction
27
+ *
28
+ * Every entry point resolves its null/no-op result from `Platform.OS` BEFORE the
29
+ * dynamic `import()`, so a web bundle never requests `expo-notifications` at all.
30
+ * `expo-notifications` and `expo-constants` are OPTIONAL peer dependencies: an
31
+ * app that does not use push never installs them, and a build without them
32
+ * degrades to "notifications unavailable" rather than throwing at
33
+ * module-evaluation time.
34
+ *
35
+ * ## The token is an EXPO push token — never a raw device token
36
+ *
37
+ * {@link getExpoPushToken} calls `getExpoPushTokenAsync()`, which returns the
38
+ * `ExponentPushToken[…]` handle Expo's push service delivers through — the only
39
+ * form it accepts. `getDevicePushTokenAsync()` — the raw APNs/FCM token — is
40
+ * deliberately NOT used anywhere: registering one of those looks entirely
41
+ * successful (the row is stored, the endpoint returns 200) and then every push
42
+ * silently fails at delivery time. `@oxyhq/core`'s `registerPushToken` rejects a
43
+ * raw device token before sending, and this module is the reason it never has to.
44
+ *
45
+ * ## The payload is untrusted
46
+ *
47
+ * Nothing here surfaces a notification's `title` / `body` / `subtitle`. The only
48
+ * payload that leaves this module is the raw `content.data` — the routing keys —
49
+ * typed `unknown`, so a caller has to validate it before acting on it and there
50
+ * is no exported shape that invites rendering push-delivered text. The
51
+ * foreground handler likewise answers with a visibility verdict and nothing else.
52
+ */
53
+ const log = (0, _core.createLogger)('deviceNotifications');
54
+ function isRecord(value) {
55
+ return typeof value === 'object' && value !== null;
56
+ }
57
+
58
+ /**
59
+ * Load `expo-notifications`, or `null` when it cannot serve this platform/build.
60
+ *
61
+ * The web guard runs before the `import()`, so a web bundle never reaches for the
62
+ * native module. The dynamic import is intentional: the module registry caches
63
+ * it, so repeated calls are cheap and no module-level mutable cache is
64
+ * introduced here.
65
+ */
66
+ async function loadNotifications() {
67
+ if (_reactNative.Platform.OS === 'web') {
68
+ return null;
69
+ }
70
+ try {
71
+ return await Promise.resolve().then(() => _interopRequireWildcard(require('expo-notifications')));
72
+ } catch (error) {
73
+ log.warn('expo-notifications is unavailable in this build — push is disabled', {
74
+ method: 'loadNotifications'
75
+ }, error);
76
+ return null;
77
+ }
78
+ }
79
+
80
+ /**
81
+ * The EAS project id an Expo push token is minted against, or `null` when the
82
+ * app config carries none.
83
+ *
84
+ * Resolved exactly the way `expo-notifications` resolves it internally
85
+ * (`easConfig.projectId`, then `expoConfig.extra.eas.projectId`) and then handed
86
+ * BACK to `getExpoPushTokenAsync` explicitly, so the two can never disagree.
87
+ * Reading it here is what turns "no project id" from an opaque
88
+ * `ERR_NOTIFICATIONS_NO_EXPERIENCE_ID` rejection into a named, actionable state
89
+ * instead of one more entry in the indistinguishable "permission denied /
90
+ * offline" bucket.
91
+ *
92
+ * A missing `expo-constants` lands on the same `null` outcome — the single
93
+ * actionable warning is emitted once by the caller, so this path only records
94
+ * the extra detail at debug level rather than warning twice for one condition.
95
+ */
96
+ async function easProjectId() {
97
+ let constants;
98
+ try {
99
+ constants = (await Promise.resolve().then(() => _interopRequireWildcard(require('expo-constants')))).default;
100
+ } catch (error) {
101
+ log.debug('expo-constants is unavailable in this build — no EAS project id can be resolved', {
102
+ method: 'easProjectId'
103
+ }, error);
104
+ return null;
105
+ }
106
+ const fromEasConfig = constants.easConfig?.projectId;
107
+ if (typeof fromEasConfig === 'string' && fromEasConfig.length > 0) {
108
+ return fromEasConfig;
109
+ }
110
+ const extra = constants.expoConfig?.extra;
111
+ const eas = isRecord(extra) ? extra.eas : undefined;
112
+ const projectId = isRecord(eas) ? eas.projectId : undefined;
113
+ return typeof projectId === 'string' && projectId.length > 0 ? projectId : null;
114
+ }
115
+
116
+ /**
117
+ * The platform tag the push-token registry stores this installation under, or
118
+ * `null` on a platform Oxy does not deliver push to.
119
+ *
120
+ * Synchronous and import-free — the answer is a property of the bundle, not of
121
+ * any native module.
122
+ *
123
+ * Web is `null` on purpose: the registry accepts a `web` platform, but browser
124
+ * push needs a VAPID key + service-worker subscription no Oxy app has wired, so
125
+ * there is no token to register and claiming otherwise would store a row nothing
126
+ * can ever deliver to.
127
+ */
128
+ function pushTokenPlatform() {
129
+ return _reactNative.Platform.OS === 'ios' || _reactNative.Platform.OS === 'android' ? _reactNative.Platform.OS : null;
130
+ }
131
+
132
+ /**
133
+ * Whether the OS notification permission is ALREADY granted.
134
+ *
135
+ * Never prompts, so an app can re-check on every cold boot without ever asking
136
+ * the user twice. Use {@link requestNotificationPermission} for the one place
137
+ * that is allowed to show the system dialog.
138
+ */
139
+ async function hasNotificationPermission() {
140
+ const notifications = await loadNotifications();
141
+ if (!notifications) {
142
+ return false;
143
+ }
144
+ try {
145
+ const permissions = await notifications.getPermissionsAsync();
146
+ return permissions.granted === true;
147
+ } catch (error) {
148
+ log.warn('could not read the notification permission', {
149
+ method: 'hasNotificationPermission'
150
+ }, error);
151
+ return false;
152
+ }
153
+ }
154
+
155
+ /**
156
+ * Ensure the OS notification permission, prompting at most once.
157
+ *
158
+ * An installation that already answered the system dialog is never asked again:
159
+ * an already-granted permission resolves `true` without a second dialog, and a
160
+ * denial with `canAskAgain: false` resolves `false` without issuing a request
161
+ * the OS would silently ignore.
162
+ *
163
+ * @returns Whether notifications are granted once this call is done.
164
+ */
165
+ async function requestNotificationPermission() {
166
+ const notifications = await loadNotifications();
167
+ if (!notifications) {
168
+ return false;
169
+ }
170
+ try {
171
+ const existing = await notifications.getPermissionsAsync();
172
+ if (existing.granted === true) {
173
+ return true;
174
+ }
175
+ if (existing.canAskAgain === false) {
176
+ return false;
177
+ }
178
+ const requested = await notifications.requestPermissionsAsync();
179
+ return requested.granted === true;
180
+ } catch (error) {
181
+ log.warn('the notification permission could not be resolved', {
182
+ method: 'requestNotificationPermission'
183
+ }, error);
184
+ return false;
185
+ }
186
+ }
187
+
188
+ /**
189
+ * This installation's Expo push token (`ExponentPushToken[…]`), or `null` when
190
+ * one cannot be minted.
191
+ *
192
+ * Deliberately `getExpoPushTokenAsync` — see the module header for why the raw
193
+ * device-token variant is never used.
194
+ *
195
+ * Every `null` is logged with the reason it happened. A missing EAS project id
196
+ * in particular is a BUILD MISCONFIGURATION, not a user state: no token can ever
197
+ * be minted, so push is off for every install of that build until the config is
198
+ * fixed. It is reported as such rather than blending into the
199
+ * indistinguishable "permission denied / offline" bucket.
200
+ */
201
+ async function getExpoPushToken() {
202
+ const notifications = await loadNotifications();
203
+ if (!notifications) {
204
+ return null;
205
+ }
206
+ const projectId = await easProjectId();
207
+ if (!projectId) {
208
+ log.warn('no EAS project id in the app config (expo.extra.eas.projectId) — an Expo push token cannot be minted, so push is disabled for this build', {
209
+ method: 'getExpoPushToken'
210
+ });
211
+ return null;
212
+ }
213
+ try {
214
+ const token = await notifications.getExpoPushTokenAsync({
215
+ projectId
216
+ });
217
+ if (token.data.length === 0) {
218
+ log.warn('the Expo push service returned an empty token', {
219
+ method: 'getExpoPushToken'
220
+ });
221
+ return null;
222
+ }
223
+ return token.data;
224
+ } catch (error) {
225
+ log.warn('could not mint an Expo push token', {
226
+ method: 'getExpoPushToken'
227
+ }, error);
228
+ return null;
229
+ }
230
+ }
231
+
232
+ /**
233
+ * Take the payload of the notification that COLD-LAUNCHED the app, if any.
234
+ *
235
+ * "Take" is literal: the response is cleared from `expo-notifications` once
236
+ * read, so a listener attached later in the same launch is not handed the same
237
+ * tap again. Clearing is best-effort across OS/module versions, so a caller that
238
+ * must not act twice still needs its own idempotency ledger.
239
+ *
240
+ * @returns The raw, untrusted `content.data` of the launching notification, or
241
+ * `null`. Parsing/validation is the caller's job.
242
+ */
243
+ async function takeLaunchNotificationData() {
244
+ const notifications = await loadNotifications();
245
+ if (!notifications) {
246
+ return null;
247
+ }
248
+ try {
249
+ const response = notifications.getLastNotificationResponse();
250
+ if (!response) {
251
+ return null;
252
+ }
253
+ const data = response.notification.request.content.data;
254
+ try {
255
+ notifications.clearLastNotificationResponse();
256
+ } catch (clearError) {
257
+ log.warn('could not clear the launching notification response', {
258
+ method: 'takeLaunchNotificationData'
259
+ }, clearError);
260
+ }
261
+ return data;
262
+ } catch (error) {
263
+ log.warn('could not read the launching notification', {
264
+ method: 'takeLaunchNotificationData'
265
+ }, error);
266
+ return null;
267
+ }
268
+ }
269
+
270
+ /**
271
+ * What the OS should do with a notification that arrives while the app is
272
+ * FOREGROUNDED.
273
+ *
274
+ * `'suppress'` is `expo-notifications`' own default for a foregrounded app, so a
275
+ * decision function that only ever returns `'show'` for the payloads it
276
+ * recognises leaves every other notification exactly as it behaves today.
277
+ */
278
+
279
+ /**
280
+ * Whether the process-wide foreground handler has already been ATTEMPTED.
281
+ *
282
+ * `setNotificationHandler` is global, last-writer-wins process state, so this is
283
+ * a one-shot install rather than something a mount/unmount cycle owns. A failed
284
+ * attempt is deliberately not retried: the only failure modes are permanent for
285
+ * the life of the process (web, a build without the native module, a native
286
+ * module that threw on registration).
287
+ *
288
+ * Module-scoped and only ever touched from an async install call — never read
289
+ * during render, so the React Compiler has no memoizable position to freeze it
290
+ * into.
291
+ */
292
+ let foregroundHandlerAttempted = false;
293
+
294
+ /** How prominently Android surfaces a channel's notifications. */
295
+
296
+ /** An Android notification channel this app delivers on. */
297
+
298
+ /**
299
+ * Create (or update) an Android notification channel.
300
+ *
301
+ * A no-op everywhere but Android: iOS has no channels, and web never loads the
302
+ * native module. Call it BEFORE registering a push token, so the very first
303
+ * notification the server sends already has a channel to land on.
304
+ *
305
+ * Failure is non-fatal and logged: a missing channel costs visibility, and
306
+ * refusing to register a token over it would cost the feature entirely.
307
+ *
308
+ * @returns Whether the channel was actually created (`false` off Android, or
309
+ * when the native module is unavailable, or when creation failed).
310
+ */
311
+ async function ensureNotificationChannel(spec) {
312
+ if (_reactNative.Platform.OS !== 'android') {
313
+ return false;
314
+ }
315
+ const notifications = await loadNotifications();
316
+ if (!notifications) {
317
+ return false;
318
+ }
319
+ try {
320
+ await notifications.setNotificationChannelAsync(spec.id, {
321
+ name: spec.name,
322
+ importance: spec.importance === 'high' ? notifications.AndroidImportance.HIGH : notifications.AndroidImportance.DEFAULT,
323
+ ...(spec.description ? {
324
+ description: spec.description
325
+ } : {})
326
+ });
327
+ return true;
328
+ } catch (error) {
329
+ log.warn('could not create the notification channel', {
330
+ method: 'ensureNotificationChannel',
331
+ channelId: spec.id
332
+ }, error);
333
+ return false;
334
+ }
335
+ }
336
+
337
+ /**
338
+ * Install the ONE process-wide handler that decides whether an incoming
339
+ * notification is shown while the app is in the FOREGROUND.
340
+ *
341
+ * Without a handler, `expo-notifications` shows nothing at all while the app is
342
+ * open — which is exactly when a time-critical notification (a "Sign in with
343
+ * Oxy" approval request, say) matters most, because the user is already holding
344
+ * the phone.
345
+ *
346
+ * The handler ONLY decides visibility. It never navigates, never acts on the
347
+ * notification, and never reads the payload for display — `decide` is handed the
348
+ * raw, untrusted `content.data` and may answer nothing but `'show'` /
349
+ * `'suppress'`. Acting on a notification stays with a TAP, routed by
350
+ * {@link subscribeToNotificationResponses}. No notification actions/categories
351
+ * are registered here, so the banner cannot carry an action button.
352
+ *
353
+ * The one-shot latch is set BEFORE the first `await`, so concurrent callers
354
+ * cannot both reach `setNotificationHandler`.
355
+ *
356
+ * @param decide - Maps the raw, untrusted payload to a presentation verdict.
357
+ * Must not throw; a throw is reported by the OS as a handling error and the
358
+ * notification is dropped.
359
+ * @returns Whether a handler was installed by THIS call (`false` on a repeat
360
+ * call, on web, or when the native module is unavailable).
361
+ */
362
+ async function installForegroundNotificationHandler(decide) {
363
+ if (foregroundHandlerAttempted) {
364
+ return false;
365
+ }
366
+ foregroundHandlerAttempted = true;
367
+ const notifications = await loadNotifications();
368
+ if (!notifications) {
369
+ return false;
370
+ }
371
+ try {
372
+ notifications.setNotificationHandler({
373
+ handleNotification: async notification => {
374
+ const data = notification.request.content.data;
375
+ const show = decide(data) === 'show';
376
+ return {
377
+ // Banner: the whole point — make the notification visible on screen.
378
+ shouldShowBanner: show,
379
+ // Notification centre: so the user can still review it after
380
+ // dismissing the banner.
381
+ shouldShowList: show,
382
+ // No sound: the app is foregrounded, so the user is already looking at
383
+ // the screen the banner appears on.
384
+ shouldPlaySound: false,
385
+ // Badging is an app-level unread concept this adapter has no view of.
386
+ shouldSetBadge: false
387
+ };
388
+ }
389
+ });
390
+ return true;
391
+ } catch (error) {
392
+ log.warn('could not install the foreground notification handler', {
393
+ method: 'installForegroundNotificationHandler'
394
+ }, error);
395
+ return false;
396
+ }
397
+ }
398
+
399
+ /**
400
+ * Subscribe to notification TAPS (responses) while the app is running.
401
+ *
402
+ * @param listener - Receives the raw, untrusted `content.data` of the tapped
403
+ * notification. Parsing/validation is the caller's job.
404
+ * @returns An unsubscribe function. Safe to call even if the subscription could
405
+ * not be established.
406
+ */
407
+ async function subscribeToNotificationResponses(listener) {
408
+ const notifications = await loadNotifications();
409
+ if (!notifications) {
410
+ return () => undefined;
411
+ }
412
+ try {
413
+ const subscription = notifications.addNotificationResponseReceivedListener(response => {
414
+ listener(response.notification.request.content.data);
415
+ });
416
+ return () => subscription.remove();
417
+ } catch (error) {
418
+ log.warn('could not subscribe to notification taps', {
419
+ method: 'subscribeToNotificationResponses'
420
+ }, error);
421
+ return () => undefined;
422
+ }
423
+ }
424
+ //# sourceMappingURL=deviceNotifications.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_core","require","_reactNative","_interopRequireWildcard","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","log","createLogger","isRecord","value","loadNotifications","Platform","OS","Promise","resolve","then","error","warn","method","easProjectId","constants","debug","fromEasConfig","easConfig","projectId","length","extra","expoConfig","eas","undefined","pushTokenPlatform","hasNotificationPermission","notifications","permissions","getPermissionsAsync","granted","requestNotificationPermission","existing","canAskAgain","requested","requestPermissionsAsync","getExpoPushToken","token","getExpoPushTokenAsync","data","takeLaunchNotificationData","response","getLastNotificationResponse","notification","request","content","clearLastNotificationResponse","clearError","foregroundHandlerAttempted","ensureNotificationChannel","spec","setNotificationChannelAsync","id","name","importance","AndroidImportance","HIGH","DEFAULT","description","channelId","installForegroundNotificationHandler","decide","setNotificationHandler","handleNotification","show","shouldShowBanner","shouldShowList","shouldPlaySound","shouldSetBadge","subscribeToNotificationResponses","listener","subscription","addNotificationResponseReceivedListener","remove"],"sourceRoot":"../../../src","sources":["notifications/deviceNotifications.ts"],"mappings":";;;;;;;;;;;;;AAsCA,IAAAA,KAAA,GAAAC,OAAA;AAEA,IAAAC,YAAA,GAAAD,OAAA;AAAwC,SAAAE,wBAAAC,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAH,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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MtB,iBAAiB,CAAC,CAAC;EAC/C,IAAI,CAACsB,aAAa,EAAE;IAClB,OAAO,MAAMH,SAAS;EACxB;EACA,IAAI;IACF,MAAM+C,YAAY,GAAG5C,aAAa,CAAC6C,uCAAuC,CAAE/B,QAAQ,IAAK;MACvF6B,QAAQ,CAAC7B,QAAQ,CAACE,YAAY,CAACC,OAAO,CAACC,OAAO,CAACN,IAAI,CAAC;IACtD,CAAC,CAAC;IACF,OAAO,MAAMgC,YAAY,CAACE,MAAM,CAAC,CAAC;EACpC,CAAC,CAAC,OAAO9D,KAAK,EAAE;IACdV,GAAG,CAACW,IAAI,CACN,0CAA0C,EAC1C;MAAEC,MAAM,EAAE;IAAmC,CAAC,EAC9CF,KACF,CAAC;IACD,OAAO,MAAMa,SAAS;EACxB;AACF","ignoreList":[]}
@@ -10,6 +10,7 @@ var _deviceCredential = require("../utils/deviceCredential.js");
10
10
  var _crossOriginRestore = require("../utils/crossOriginRestore.js");
11
11
  var _oauthReturn = require("../utils/oauthReturn.js");
12
12
  var _isWebBrowser = require("../utils/isWebBrowser.js");
13
+ var _legacyRedirectLanes = require("../oauth/legacyRedirectLanes.js");
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
  /** How long the cold boot waits for the post-boot SessionClient handoff (ms). */
15
16
  const SESSION_HANDOFF_DEADLINE_MS = exports.SESSION_HANDOFF_DEADLINE_MS = 6000;
@@ -68,8 +69,18 @@ async function detectOfflineHint() {
68
69
  *
69
70
  * Ordered pipeline:
70
71
  * 1. Complete OAuth authorization-code return (web)
71
- * 2. `runSessionColdBoot` — device-secret mint (+ native shared-key)
72
+ * 2. `runSessionColdBoot` — device-secret mint (+ native shared-key, or the
73
+ * primary-identity-key lane in `sessionMode: 'identity'`)
72
74
  * 3. Silent OAuth for all web apps when mint finds no session
75
+ *
76
+ * Steps 1 and 3 are ACCOUNT-MODE ONLY: both commit whichever account the IdP
77
+ * resolves, which for an identity-bound client is somebody else's account by
78
+ * construction. In `'identity'` mode the boot is exactly step 2.
79
+ *
80
+ * Step 3 is additionally REDIRECT-MODE ONLY: it navigates the top-level window
81
+ * with no user gesture behind it, which `webAuthMode: 'popup'` exists to
82
+ * eliminate. In popup mode the boot is steps 1 and 2, and a domain with no local
83
+ * credential simply resolves signed out. See `allowsAutomaticIdpRedirect`.
73
84
  */
74
85
  async function runProviderColdBoot(opts) {
75
86
  const {
@@ -78,17 +89,34 @@ async function runProviderColdBoot(opts) {
78
89
  clientId,
79
90
  authRedirectUri,
80
91
  authorizeBaseUrl,
92
+ sessionMode = 'account',
93
+ identity,
94
+ webAuthMode = 'redirect',
81
95
  sessionClient,
82
96
  syncDeviceCredentialToHost,
83
97
  commitSession,
84
98
  markAuthResolved,
85
99
  setTokenReady
86
100
  } = opts;
101
+ const identityBound = sessionMode === 'identity';
87
102
  setTokenReady(false);
88
103
  try {
104
+ // MODE-INDEPENDENT URL cleanup, deliberately so: both consume query params a
105
+ // PREVIOUS redirect-mode session left in the address bar (`?error=login_required`
106
+ // from a silent authorize, `?hub_sync=failed` from the hub) and restore the
107
+ // page the visit started on. Flipping an app to popup mode must not strand
108
+ // those params, so neither is gated on `webAuthMode`. Neither starts a
109
+ // navigation — they only rewrite the URL via `history.replaceState`.
89
110
  (0, _crossOriginRestore.consumeSilentOAuthError)();
90
111
  (0, _oauthReturn.consumeHubSyncFailure)();
91
- const oauthCompleted = await (0, _oauthReturn.tryCompleteOAuthReturn)({
112
+
113
+ // The redirect transport's RETURN leg — also NOT gated on `webAuthMode`. A
114
+ // popup-mode app legitimately lands here with `?code=` whenever the browser
115
+ // blocked the popup and `startWebOAuthSignIn` fell back to a full-page
116
+ // redirect (`popup-blocked` / `popup-navigation-failed`), and an app that
117
+ // switched modes mid-flight must not be stranded with a dead `?code=`
118
+ // either. It consumes a code already on the URL; it never starts one.
119
+ const oauthCompleted = identityBound ? false : await (0, _oauthReturn.tryCompleteOAuthReturn)({
92
120
  oxyServices,
93
121
  clientId,
94
122
  authRedirectUri,
@@ -115,6 +143,8 @@ async function runProviderColdBoot(opts) {
115
143
  isWeb: (0, _isWebBrowser.isWebBrowser)(),
116
144
  isNative: !(0, _isWebBrowser.isWebBrowser)()
117
145
  },
146
+ sessionMode,
147
+ identity,
118
148
  overallDeadlineMs: COLD_BOOT_OVERALL_DEADLINE_MS,
119
149
  isOffline: () => offline,
120
150
  onStepDeadline: stepId => {
@@ -169,14 +199,26 @@ async function runProviderColdBoot(opts) {
169
199
  }
170
200
  });
171
201
 
172
- // Silent cross-origin OAuth restore (web cross-app SSO). Gate it the SAME
173
- // way the hub-sync WRITE side (`syncHubAfterSignIn`) gates: official web
174
- // origins only, never the IdP hub itself, and — unlike the write side —
175
- // never a loopback / local-dev origin (which must not be bounced to a hosted
176
- // IdP on cold boot). The authorize endpoint is env-configurable so a
177
- // local/staging app targets its own IdP instead of production.
202
+ // Silent cross-origin OAuth restore (web cross-app SSO): a full-page
203
+ // `prompt=none` bounce to the IdP when the mint found no local session.
204
+ //
205
+ // TRANSPORT gate (`allowsAutomaticIdpRedirect`): `webAuthMode: 'popup'`
206
+ // FORBIDS this lane. It navigates the top-level window with no user gesture
207
+ // behind it, which is precisely what popup mode exists to eliminate — a
208
+ // popup-mode domain without a local credential resolves signed out right
209
+ // here and waits for the user's next explicit "Continue with Oxy" (issue
210
+ // #691, "Cold boot and cross-domain behavior"). `'redirect'` — still the
211
+ // default and the compatibility path — reaches this lane unchanged, and this
212
+ // whole block disappears with the transport in phase 7b.
213
+ //
214
+ // ORIGIN gate: same as the hub-sync WRITE side (`syncHubAfterSignIn`) —
215
+ // official web origins only, never the IdP hub itself, and — unlike the
216
+ // write side — never a loopback / local-dev origin (which must not be
217
+ // bounced to a hosted IdP on cold boot). The authorize endpoint is
218
+ // env-configurable so a local/staging app targets its own IdP instead of
219
+ // production.
178
220
  const webOrigin = (0, _isWebBrowser.isWebBrowser)() ? globalThis.location?.origin : undefined;
179
- if (clientId && outcome.kind !== 'session' && webOrigin && (0, _crossOriginRestore.isSilentRestoreEligibleOrigin)(webOrigin)) {
221
+ if (!identityBound && (0, _legacyRedirectLanes.allowsAutomaticIdpRedirect)(webAuthMode) && clientId && outcome.kind !== 'session' && webOrigin && (0, _crossOriginRestore.isSilentRestoreEligibleOrigin)(webOrigin)) {
180
222
  const redirected = await (0, _crossOriginRestore.maybeStartSilentOAuthRestore)({
181
223
  oxyServices,
182
224
  clientId,
@@ -1 +1 @@
1
- {"version":3,"names":["_core","require","_deviceCredential","_crossOriginRestore","_oauthReturn","_isWebBrowser","_interopRequireWildcard","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","SESSION_HANDOFF_DEADLINE_MS","exports","COLD_BOOT_OVERALL_DEADLINE_MS","OFFLINE_PROBE_TIMEOUT_MS","detectOfflineHint","isWebBrowser","online","globalThis","navigator","onLine","NetInfo","Promise","resolve","then","state","race","fetch","setTimeout","isConnected","runProviderColdBoot","opts","oxyServices","authStore","clientId","authRedirectUri","authorizeBaseUrl","sessionClient","syncDeviceCredentialToHost","commitSession","markAuthResolved","setTokenReady","consumeSilentOAuthError","consumeHubSyncFailure","oauthCompleted","tryCompleteOAuthReturn","input","activate","hubSync","offline","outcome","runSessionColdBoot","oxy","store","platform","isWeb","isNative","overallDeadlineMs","isOffline","onStepDeadline","stepId","loggerUtil","warn","component","method","onSession","session","handoff","sessionId","accessToken","userId","handoffDeadlineId","finally","undefined","clearTimeout","onSignedOut","cred","loadPersistedDeviceCredential","start","socketError","__DEV__","debug","onStepError","id","error","webOrigin","location","origin","kind","isSilentRestoreEligibleOrigin","redirected","maybeStartSilentOAuthRestore","redirectUri","Error","String"],"sourceRoot":"../../../../src","sources":["ui/boot/runProviderColdBoot.ts"],"mappings":";;;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AAOA,IAAAC,iBAAA,GAAAD,OAAA;AACA,IAAAE,mBAAA,GAAAF,OAAA;AAKA,IAAAG,YAAA,GAAAH,OAAA;AACA,IAAAI,aAAA,GAAAJ,OAAA;AAAqD,SAAAK,wBAAAC,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAH,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,gBAAAC,CAAA,OAAAa,cAAA,CAAAC,IAAA,CAAAf,CAAA,EAAAC,CAAA,OAAAM,CAAA,IAAAD,CAAA,GAAAU,MAAA,CAAAC,cAAA,KAAAD,MAAA,CAAAE,wBAAA,CAAAlB,CAAA,EAAAC,CAAA,OAAAM,CAAA,CAAAK,GAAA,IAAAL,CAAA,CAAAM,GAAA,IAAAP,CAAA,CAAAE,CAAA,EAAAP,CAAA,EAAAM,CAAA,IAAAC,CAAA,CAAAP,CAAA,I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AC3BE,UAAU,CAA6BoE,QAAQ,EAAEC,MAAM,GACxDd,SAAS;IACb,IACEvC,QAAQ,IACRgB,OAAO,CAACsC,IAAI,KAAK,SAAS,IAC1BH,SAAS,IACT,IAAAI,iDAA6B,EAACJ,SAAS,CAAC,EACxC;MACA,MAAMK,UAAU,GAAG,MAAM,IAAAC,gDAA4B,EAAC;QACpD3D,WAAW;QACXE,QAAQ;QACR0D,WAAW,EAAEzD,eAAe;QAC5BC;MACF,CAAC,CAAC;MACF,IAAIsD,UAAU,EAAE;QACd;MACF;IACF;EACF,CAAC,CAAC,OAAON,KAAK,EAAE;IACd,IAAIJ,OAAO,EAAE;MACXnB,YAAU,CAACuB,KAAK,CACd,iBAAiB,EACjBA,KAAK,YAAYS,KAAK,GAAGT,KAAK,GAAG,IAAIS,KAAK,CAACC,MAAM,CAACV,KAAK,CAAC,CAAC,EACzD;QAAErB,SAAS,EAAE;MAAsB,CACrC,CAAC;IACH;EACF,CAAC,SAAS;IACRvB,gBAAgB,CAAC,CAAC;EACpB;AACF","ignoreList":[]}
1
+ {"version":3,"names":["_core","require","_deviceCredential","_crossOriginRestore","_oauthReturn","_isWebBrowser","_legacyRedirectLanes","_interopRequireWildcard","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","SESSION_HANDOFF_DEADLINE_MS","exports","COLD_BOOT_OVERALL_DEADLINE_MS","OFFLINE_PROBE_TIMEOUT_MS","detectOfflineHint","isWebBrowser","online","globalThis","navigator","onLine","NetInfo","Promise","resolve","then","state","race","fetch","setTimeout","isConnected","runProviderColdBoot","opts","oxyServices","authStore","clientId","authRedirectUri","authorizeBaseUrl","sessionMode","identity","webAuthMode","sessionClient","syncDeviceCredentialToHost","commitSession","markAuthResolved","setTokenReady","identityBound","consumeSilentOAuthError","consumeHubSyncFailure","oauthCompleted","tryCompleteOAuthReturn","input","activate","hubSync","offline","outcome","runSessionColdBoot","oxy","store","platform","isWeb","isNative","overallDeadlineMs","isOffline","onStepDeadline","stepId","loggerUtil","warn","component","method","onSession","session","handoff","sessionId","accessToken","userId","handoffDeadlineId","finally","undefined","clearTimeout","onSignedOut","cred","loadPersistedDeviceCredential","start","socketError","__DEV__","debug","onStepError","id","error","webOrigin","location","origin","allowsAutomaticIdpRedirect","kind","isSilentRestoreEligibleOrigin","redirected","maybeStartSilentOAuthRestore","redirectUri","Error","String"],"sourceRoot":"../../../../src","sources":["ui/boot/runProviderColdBoot.ts"],"mappings":";;;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AASA,IAAAC,iBAAA,GAAAD,OAAA;AACA,IAAAE,mBAAA,GAAAF,OAAA;AAKA,IAAAG,YAAA,GAAAH,OAAA;AACA,IAAAI,aAAA,GAAAJ,OAAA;AACA,IAAAK,oBAAA,GAAAL,OAAA;AAA0E,SAAAM,wBAAAC,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAH,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,gBAAAC,CAAA,OAAAa,cAAA,CAAAC,IAAA,CAAAf,CAAA,EAAAC,CAAA,OAAAM,CAAA,IAAAD,CAAA,GAAAU,MAAA,CAAAC,cAAA,KAAAD,M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,12 +9,6 @@ Object.defineProperty(exports, "FollowButton", {
9
9
  return _FollowButton.default;
10
10
  }
11
11
  });
12
- Object.defineProperty(exports, "FontLoader", {
13
- enumerable: true,
14
- get: function () {
15
- return _FontLoader.FontLoader;
16
- }
17
- });
18
12
  Object.defineProperty(exports, "LogoIcon", {
19
13
  enumerable: true,
20
14
  get: function () {
@@ -87,12 +81,6 @@ Object.defineProperty(exports, "isTimeoutOrNetworkError", {
87
81
  return _errorHandlers.isTimeoutOrNetworkError;
88
82
  }
89
83
  });
90
- Object.defineProperty(exports, "setupFonts", {
91
- enumerable: true,
92
- get: function () {
93
- return _FontLoader.setupFonts;
94
- }
95
- });
96
84
  Object.defineProperty(exports, "useAccountStore", {
97
85
  enumerable: true,
98
86
  get: function () {
@@ -136,7 +124,6 @@ var _LogoIcon = require("./components/logo/LogoIcon.js");
136
124
  var _LogoText = require("./components/logo/LogoText.js");
137
125
  var _FollowButton = _interopRequireDefault(require("./components/FollowButton.js"));
138
126
  var _OxyPayButton = _interopRequireDefault(require("./components/OxyPayButton.js"));
139
- var _FontLoader = require("./components/FontLoader");
140
127
  var _OxyContext = require("./context/OxyContext.js");
141
128
  var _useAuth = require("./hooks/useAuth.js");
142
129
  var _useFollow = require("./hooks/useFollow.js");
@@ -1 +1 @@
1
- {"version":3,"names":["_OxyProvider","_interopRequireDefault","require","_OxySignInButton","_OxyAuthPrompt","_LogoIcon","_LogoText","_FollowButton","_OxyPayButton","_FontLoader","_OxyContext","_useAuth","_useFollow","_useStorage","_ProfileScreen","_ManageAccountScreen","_authStore","_accountStore","_errorHandlers","e","__esModule","default"],"sourceRoot":"../../../src","sources":["ui/client.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAWA,IAAAA,YAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,gBAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,cAAA,GAAAH,sBAAA,CAAAC,OAAA;AAEA,IAAAG,SAAA,GAAAH,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AACA,IAAAK,aAAA,GAAAN,sBAAA,CAAAC,OAAA;AACA,IAAAM,aAAA,GAAAP,sBAAA,CAAAC,OAAA;AACA,IAAAO,WAAA,GAAAP,OAAA;AAGA,IAAAQ,WAAA,GAAAR,OAAA;AAGA,IAAAS,QAAA,GAAAT,OAAA;AAEA,IAAAU,UAAA,GAAAV,OAAA;AACA,IAAAW,WAAA,GAAAX,OAAA;AAIA,IAAAY,cAAA,GAAAb,sBAAA,CAAAC,OAAA;AACA,IAAAa,oBAAA,GAAAd,sBAAA,CAAAC,OAAA;AAGA,IAAAc,UAAA,GAAAd,OAAA;AACA,IAAAe,aAAA,GAAAf,OAAA;AAGA,IAAAgB,cAAA,GAAAhB,OAAA;AAK+B,SAAAD,uBAAAkB,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA","ignoreList":[]}
1
+ {"version":3,"names":["_OxyProvider","_interopRequireDefault","require","_OxySignInButton","_OxyAuthPrompt","_LogoIcon","_LogoText","_FollowButton","_OxyPayButton","_OxyContext","_useAuth","_useFollow","_useStorage","_ProfileScreen","_ManageAccountScreen","_authStore","_accountStore","_errorHandlers","e","__esModule","default"],"sourceRoot":"../../../src","sources":["ui/client.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAWA,IAAAA,YAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,gBAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,cAAA,GAAAH,sBAAA,CAAAC,OAAA;AAEA,IAAAG,SAAA,GAAAH,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AACA,IAAAK,aAAA,GAAAN,sBAAA,CAAAC,OAAA;AACA,IAAAM,aAAA,GAAAP,sBAAA,CAAAC,OAAA;AAGA,IAAAO,WAAA,GAAAP,OAAA;AAGA,IAAAQ,QAAA,GAAAR,OAAA;AAEA,IAAAS,UAAA,GAAAT,OAAA;AACA,IAAAU,WAAA,GAAAV,OAAA;AAIA,IAAAW,cAAA,GAAAZ,sBAAA,CAAAC,OAAA;AACA,IAAAY,oBAAA,GAAAb,sBAAA,CAAAC,OAAA;AAGA,IAAAa,UAAA,GAAAb,OAAA;AACA,IAAAc,aAAA,GAAAd,OAAA;AAGA,IAAAe,cAAA,GAAAf,OAAA;AAK+B,SAAAD,uBAAAiB,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA","ignoreList":[]}