@mentra/engine 0.1.0-dev.1 → 3.1.0-beta.103

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 (267) hide show
  1. package/README.md +43 -29
  2. package/build/bluetooth-sdk/debug.d.ts +2 -0
  3. package/build/bluetooth-sdk/debug.d.ts.map +1 -0
  4. package/build/bluetooth-sdk/debug.js +2 -0
  5. package/build/bluetooth-sdk/debug.js.map +1 -0
  6. package/build/bluetooth-sdk/index.d.ts +3 -0
  7. package/build/bluetooth-sdk/index.d.ts.map +1 -0
  8. package/build/bluetooth-sdk/index.js +3 -0
  9. package/build/bluetooth-sdk/index.js.map +1 -0
  10. package/build/bluetooth-sdk/ota-transport.d.ts +2 -0
  11. package/build/bluetooth-sdk/ota-transport.d.ts.map +1 -0
  12. package/build/bluetooth-sdk/ota-transport.js +2 -0
  13. package/build/bluetooth-sdk/ota-transport.js.map +1 -0
  14. package/build/bluetooth-sdk/photo-receiver.d.ts +3 -0
  15. package/build/bluetooth-sdk/photo-receiver.d.ts.map +1 -0
  16. package/build/bluetooth-sdk/photo-receiver.js +3 -0
  17. package/build/bluetooth-sdk/photo-receiver.js.map +1 -0
  18. package/build/bluetooth-sdk/react.d.ts +2 -0
  19. package/build/bluetooth-sdk/react.d.ts.map +1 -0
  20. package/build/bluetooth-sdk/react.js +2 -0
  21. package/build/bluetooth-sdk/react.js.map +1 -0
  22. package/build/bluetooth-sdk/types.d.ts +2 -0
  23. package/build/bluetooth-sdk/types.d.ts.map +1 -0
  24. package/build/bluetooth-sdk/types.js +2 -0
  25. package/build/bluetooth-sdk/types.js.map +1 -0
  26. package/build/engine.d.ts +18 -15
  27. package/build/engine.d.ts.map +1 -1
  28. package/build/engine.js +2 -2
  29. package/build/engine.js.map +1 -1
  30. package/build/facades/display.d.ts +1 -1
  31. package/build/facades/display.d.ts.map +1 -1
  32. package/build/facades/display.js +1 -1
  33. package/build/facades/display.js.map +1 -1
  34. package/build/facades/glasses.d.ts +3 -13
  35. package/build/facades/glasses.d.ts.map +1 -1
  36. package/build/facades/glasses.js +3 -3
  37. package/build/facades/glasses.js.map +1 -1
  38. package/build/facades/ota.d.ts +16 -22
  39. package/build/facades/ota.d.ts.map +1 -1
  40. package/build/facades/ota.js +13 -9
  41. package/build/facades/ota.js.map +1 -1
  42. package/build/facades/pairing.d.ts +8 -5
  43. package/build/facades/pairing.d.ts.map +1 -1
  44. package/build/facades/pairing.js +83 -9
  45. package/build/facades/pairing.js.map +1 -1
  46. package/build/facades/speech.d.ts +7 -6
  47. package/build/facades/speech.d.ts.map +1 -1
  48. package/build/facades/speech.js +1 -1
  49. package/build/facades/speech.js.map +1 -1
  50. package/build/generated/releaseMetadata.d.ts +12 -0
  51. package/build/generated/releaseMetadata.d.ts.map +1 -0
  52. package/build/generated/releaseMetadata.js +10 -0
  53. package/build/generated/releaseMetadata.js.map +1 -0
  54. package/build/index.d.ts +7 -8
  55. package/build/index.d.ts.map +1 -1
  56. package/build/index.js +4 -5
  57. package/build/index.js.map +1 -1
  58. package/build/react/MentraLiveOtaFlow.d.ts +8 -2
  59. package/build/react/MentraLiveOtaFlow.d.ts.map +1 -1
  60. package/build/react/MentraLiveOtaFlow.js +256 -354
  61. package/build/react/MentraLiveOtaFlow.js.map +1 -1
  62. package/build/react/index.d.ts +1 -0
  63. package/build/react/index.d.ts.map +1 -1
  64. package/build/react/index.js +1 -0
  65. package/build/react/index.js.map +1 -1
  66. package/build/react/useMentraLiveOta.d.ts +84 -0
  67. package/build/react/useMentraLiveOta.d.ts.map +1 -0
  68. package/build/react/useMentraLiveOta.js +627 -0
  69. package/build/react/useMentraLiveOta.js.map +1 -0
  70. package/build/services/AppRegistry.d.ts +8 -0
  71. package/build/services/AppRegistry.d.ts.map +1 -1
  72. package/build/services/AppRegistry.js +15 -0
  73. package/build/services/AppRegistry.js.map +1 -1
  74. package/build/services/BlobStore.d.ts +2 -0
  75. package/build/services/BlobStore.d.ts.map +1 -1
  76. package/build/services/BlobStore.js +63 -10
  77. package/build/services/BlobStore.js.map +1 -1
  78. package/build/services/DisplayProcessor.d.ts +3 -3
  79. package/build/services/DisplayProcessor.js +3 -3
  80. package/build/services/DisplayProcessor.js.map +1 -1
  81. package/build/services/GlassesStatusProjection.d.ts +15 -2
  82. package/build/services/GlassesStatusProjection.d.ts.map +1 -1
  83. package/build/services/GlassesStatusProjection.js +3 -3
  84. package/build/services/GlassesStatusProjection.js.map +1 -1
  85. package/build/services/HotspotOtaTransport.d.ts.map +1 -1
  86. package/build/services/HotspotOtaTransport.js +8 -7
  87. package/build/services/HotspotOtaTransport.js.map +1 -1
  88. package/build/services/LocalDisplayManager.d.ts +2 -3
  89. package/build/services/LocalDisplayManager.d.ts.map +1 -1
  90. package/build/services/LocalDisplayManager.js +2 -3
  91. package/build/services/LocalDisplayManager.js.map +1 -1
  92. package/build/services/OtaAutoChain.d.ts +9 -2
  93. package/build/services/OtaAutoChain.d.ts.map +1 -1
  94. package/build/services/OtaAutoChain.js +10 -2
  95. package/build/services/OtaAutoChain.js.map +1 -1
  96. package/build/services/OtaInstallCoordinator.d.ts +26 -3
  97. package/build/services/OtaInstallCoordinator.d.ts.map +1 -1
  98. package/build/services/OtaInstallCoordinator.js +38 -13
  99. package/build/services/OtaInstallCoordinator.js.map +1 -1
  100. package/build/services/OtaService.d.ts.map +1 -1
  101. package/build/services/OtaService.js +1 -1
  102. package/build/services/OtaService.js.map +1 -1
  103. package/build/services/OtaUpdateCheckService.d.ts +4 -1
  104. package/build/services/OtaUpdateCheckService.d.ts.map +1 -1
  105. package/build/services/OtaUpdateCheckService.js +33 -21
  106. package/build/services/OtaUpdateCheckService.js.map +1 -1
  107. package/build/services/PhonePhotoCoordinator.js +1 -1
  108. package/build/services/PhonePhotoCoordinator.js.map +1 -1
  109. package/build/services/PhoneStreamCoordinator.d.ts.map +1 -1
  110. package/build/services/PhoneStreamCoordinator.js +9 -6
  111. package/build/services/PhoneStreamCoordinator.js.map +1 -1
  112. package/build/services/StreamLifecycleController.d.ts +3 -3
  113. package/build/services/StreamLifecycleController.js +3 -3
  114. package/build/services/StreamLifecycleController.js.map +1 -1
  115. package/build/services/asg/localNetworkTransport.d.ts.map +1 -1
  116. package/build/services/asg/localNetworkTransport.js +13 -12
  117. package/build/services/asg/localNetworkTransport.js.map +1 -1
  118. package/build/services/glassesClockSync.d.ts.map +1 -1
  119. package/build/services/glassesClockSync.js +5 -1
  120. package/build/services/glassesClockSync.js.map +1 -1
  121. package/build/services/otaDisplayState.d.ts +1 -1
  122. package/build/services/otaDisplayState.d.ts.map +1 -1
  123. package/build/services/otaDisplayState.js.map +1 -1
  124. package/build/services/otaInstallPolicy.d.ts +5 -1
  125. package/build/services/otaInstallPolicy.d.ts.map +1 -1
  126. package/build/services/otaInstallPolicy.js +4 -0
  127. package/build/services/otaInstallPolicy.js.map +1 -1
  128. package/build/services/otaLegacyMapping.d.ts +1 -1
  129. package/build/services/otaLegacyMapping.d.ts.map +1 -1
  130. package/build/services/otaLegacyMapping.js.map +1 -1
  131. package/build/services/otaManifestPolicy.d.ts +14 -0
  132. package/build/services/otaManifestPolicy.d.ts.map +1 -0
  133. package/build/services/otaManifestPolicy.js +19 -0
  134. package/build/services/otaManifestPolicy.js.map +1 -0
  135. package/build/services/otaManifestUrl.d.ts +2 -1
  136. package/build/services/otaManifestUrl.d.ts.map +1 -1
  137. package/build/services/otaManifestUrl.js +24 -32
  138. package/build/services/otaManifestUrl.js.map +1 -1
  139. package/build/services/otaReleaseVersion.d.ts +10 -0
  140. package/build/services/otaReleaseVersion.d.ts.map +1 -0
  141. package/build/services/otaReleaseVersion.js +14 -0
  142. package/build/services/otaReleaseVersion.js.map +1 -0
  143. package/build/stores/appVisibility.d.ts +3 -0
  144. package/build/stores/appVisibility.d.ts.map +1 -0
  145. package/build/stores/appVisibility.js +3 -0
  146. package/build/stores/appVisibility.js.map +1 -0
  147. package/build/stores/apps.d.ts.map +1 -1
  148. package/build/stores/apps.js +7 -1
  149. package/build/stores/apps.js.map +1 -1
  150. package/build/stores/core.d.ts +3 -3
  151. package/build/stores/core.d.ts.map +1 -1
  152. package/build/stores/core.js.map +1 -1
  153. package/build/stores/glasses.d.ts +10 -4
  154. package/build/stores/glasses.d.ts.map +1 -1
  155. package/build/stores/glasses.js.map +1 -1
  156. package/build/stores/settings.js +3 -3
  157. package/build/stores/settings.js.map +1 -1
  158. package/build/types/applet.d.ts +1 -1
  159. package/build/types/applet.js +1 -1
  160. package/build/types/applet.js.map +1 -1
  161. package/build/types/capabilities/even-realities-g1.d.ts.map +1 -1
  162. package/build/types/capabilities/even-realities-g1.js +2 -0
  163. package/build/types/capabilities/even-realities-g1.js.map +1 -1
  164. package/build/types/capabilities/even-realities-g2.d.ts.map +1 -1
  165. package/build/types/capabilities/even-realities-g2.js +2 -0
  166. package/build/types/capabilities/even-realities-g2.js.map +1 -1
  167. package/build/types/capabilities/mentra-display.d.ts.map +1 -1
  168. package/build/types/capabilities/mentra-display.js +2 -0
  169. package/build/types/capabilities/mentra-display.js.map +1 -1
  170. package/build/types/capabilities/mentra-live.d.ts.map +1 -1
  171. package/build/types/capabilities/mentra-live.js +2 -0
  172. package/build/types/capabilities/mentra-live.js.map +1 -1
  173. package/build/types/capabilities/nimo.d.ts +9 -0
  174. package/build/types/capabilities/nimo.d.ts.map +1 -0
  175. package/build/types/capabilities/nimo.js +57 -0
  176. package/build/types/capabilities/nimo.js.map +1 -0
  177. package/build/types/capabilities/none.d.ts.map +1 -1
  178. package/build/types/capabilities/none.js +2 -0
  179. package/build/types/capabilities/none.js.map +1 -1
  180. package/build/types/capabilities/simulated-glasses.d.ts.map +1 -1
  181. package/build/types/capabilities/simulated-glasses.js +2 -0
  182. package/build/types/capabilities/simulated-glasses.js.map +1 -1
  183. package/build/types/capabilities/vuzix-z100.d.ts.map +1 -1
  184. package/build/types/capabilities/vuzix-z100.js +2 -0
  185. package/build/types/capabilities/vuzix-z100.js.map +1 -1
  186. package/build/types/enums.d.ts +3 -26
  187. package/build/types/enums.d.ts.map +1 -1
  188. package/build/types/enums.js +2 -27
  189. package/build/types/enums.js.map +1 -1
  190. package/build/types/hardware.d.ts +6 -15
  191. package/build/types/hardware.d.ts.map +1 -1
  192. package/build/types/hardware.js +4 -4
  193. package/build/types/hardware.js.map +1 -1
  194. package/build/types/index.d.ts +3 -7
  195. package/build/types/index.d.ts.map +1 -1
  196. package/build/types/index.js +3 -7
  197. package/build/types/index.js.map +1 -1
  198. package/build/utils/display/composer/ColumnComposer.d.ts +1 -1
  199. package/build/utils/display/composer/ColumnComposer.js +1 -1
  200. package/build/utils/display/composer/ColumnComposer.js.map +1 -1
  201. package/package.json +47 -22
  202. package/src/bluetooth-sdk/debug.ts +1 -0
  203. package/src/bluetooth-sdk/index.ts +2 -0
  204. package/src/bluetooth-sdk/ota-transport.ts +1 -0
  205. package/src/bluetooth-sdk/photo-receiver.ts +2 -0
  206. package/src/bluetooth-sdk/react.ts +1 -0
  207. package/src/bluetooth-sdk/types.ts +1 -0
  208. package/src/engine.ts +2 -2
  209. package/src/facades/display.ts +1 -1
  210. package/src/facades/glasses.ts +4 -4
  211. package/src/facades/ota.ts +23 -10
  212. package/src/facades/pairing.ts +92 -16
  213. package/src/facades/speech.ts +21 -7
  214. package/src/generated/releaseMetadata.ts +20 -0
  215. package/src/index.ts +16 -11
  216. package/src/react/MentraLiveOtaFlow.tsx +378 -480
  217. package/src/react/index.ts +14 -0
  218. package/src/react/useMentraLiveOta.ts +793 -0
  219. package/src/services/AppRegistry.ts +16 -0
  220. package/src/services/BlobStore.ts +57 -10
  221. package/src/services/DisplayProcessor.ts +3 -3
  222. package/src/services/GlassesStatusProjection.ts +7 -6
  223. package/src/services/HotspotOtaTransport.ts +8 -7
  224. package/src/services/LocalDisplayManager.ts +2 -3
  225. package/src/services/OtaAutoChain.ts +26 -2
  226. package/src/services/OtaInstallCoordinator.ts +40 -13
  227. package/src/services/OtaService.ts +1 -2
  228. package/src/services/OtaUpdateCheckService.ts +45 -27
  229. package/src/services/PhonePhotoCoordinator.ts +1 -1
  230. package/src/services/PhoneStreamCoordinator.ts +10 -6
  231. package/src/services/StreamLifecycleController.ts +3 -3
  232. package/src/services/asg/localNetworkTransport.ts +20 -19
  233. package/src/services/glassesClockSync.ts +5 -1
  234. package/src/services/otaDisplayState.ts +1 -1
  235. package/src/services/otaInstallPolicy.ts +5 -1
  236. package/src/services/otaLegacyMapping.ts +1 -1
  237. package/src/services/otaManifestPolicy.ts +42 -0
  238. package/src/services/otaManifestUrl.ts +27 -36
  239. package/src/services/otaReleaseVersion.ts +22 -0
  240. package/src/stores/appVisibility.ts +3 -0
  241. package/src/stores/apps.ts +7 -1
  242. package/src/stores/core.ts +4 -4
  243. package/src/stores/glasses.ts +13 -6
  244. package/src/stores/settings.ts +3 -3
  245. package/src/types/applet.ts +1 -1
  246. package/src/types/capabilities/even-realities-g1.ts +3 -0
  247. package/src/types/capabilities/even-realities-g2.ts +3 -0
  248. package/src/types/capabilities/mentra-display.ts +3 -0
  249. package/src/types/capabilities/mentra-live.ts +3 -0
  250. package/src/types/capabilities/nimo.ts +59 -0
  251. package/src/types/capabilities/none.ts +3 -0
  252. package/src/types/capabilities/simulated-glasses.ts +3 -0
  253. package/src/types/capabilities/vuzix-z100.ts +3 -0
  254. package/src/types/enums.ts +2 -27
  255. package/src/types/hardware.ts +7 -15
  256. package/src/types/index.ts +3 -6
  257. package/src/utils/display/composer/ColumnComposer.ts +1 -1
  258. package/build/devtools.d.ts +0 -11
  259. package/build/devtools.d.ts.map +0 -1
  260. package/build/devtools.js +0 -13
  261. package/build/devtools.js.map +0 -1
  262. package/build/internal.d.ts +0 -67
  263. package/build/internal.d.ts.map +0 -1
  264. package/build/internal.js +0 -90
  265. package/build/internal.js.map +0 -1
  266. package/src/devtools.ts +0 -13
  267. package/src/internal.ts +0 -160
@@ -1 +1 @@
1
- {"version":3,"file":"MentraLiveOtaFlow.js","sourceRoot":"","sources":["../../src/react/MentraLiveOtaFlow.tsx"],"names":[],"mappings":"A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, useEffect, useMemo, useRef, useState} from \"react\"\nimport {ActivityIndicator, Pressable, StyleSheet, Text, View, type StyleProp, type ViewStyle} from \"react-native\"\nimport {SafeAreaView} from \"react-native-safe-area-context\"\nimport Svg, {Path, Rect} from \"react-native-svg\"\n\nimport {ota} from \"../facades/ota\"\nimport {\n beginOtaAutoChain,\n clearOtaAutoChainReconnectWait,\n isOtaAutoChainActive,\n otaAutoChainFingerprint,\n otaAutoChainReconnectWaitRemaining,\n stopOtaAutoChain,\n tryAdvanceOtaAutoChain,\n} from \"../services/OtaAutoChain\"\nimport {\n BES_INSTALL_RESTART_MESSAGE,\n getOtaErrorMessage,\n shouldRequireGlassesRebootForBesFailure,\n shouldShowChangeWifiForOtaDownloadFailure,\n} from \"../services/OtaErrorMapping\"\nimport {useEngineSnapshot} from \"./useEngineSnapshot\"\n\nexport type MentraLiveOtaFlowPage = \"check\" | \"progress\"\n\nexport type MentraLiveOtaFlowTheme = {\n background: string\n border: string\n error: string\n foreground: string\n primary: string\n primaryText: string\n textDim: string\n}\n\nexport type MentraLiveOtaFlowTranslate = (key: string, options?: Record<string, string>) => string\n\nexport type MentraLiveOtaFlowProps = {\n /** Display name used in update copy. */\n deviceName?: string\n /** Entry page. `progress` exists for recovery/deep-link compatibility. */\n initialPage?: MentraLiveOtaFlowPage\n /** Start the OTA-only projections. Full engine hosts should pass false. */\n initializeRuntime?: boolean\n /** Called after the final check or when the user leaves an optional update. */\n onFinished: () => void\n /** Host-owned Wi-Fi setup for glasses that do not support hotspot OTA. */\n onOpenWifiSetup: () => void\n /** Lets a host coordinate its global connection overlay with OTA progress and firmware restarts. */\n onFirmwareRestartingChange?: (restarting: boolean, progressActive: boolean) => void\n /** Enables the existing developer-only escape hatches. */\n allowDevSkip?: boolean\n /** Enables the existing super-mode interrupted-session escape hatch. */\n superMode?: boolean\n /** Optional host localization. Defaults to the Mentra App English OTA copy. */\n translate?: MentraLiveOtaFlowTranslate\n /** Optional host theme. Both hosts use the same layout and state machine. */\n theme?: Partial<MentraLiveOtaFlowTheme>\n style?: StyleProp<ViewStyle>\n}\n\ntype CheckState = \"checking\" | \"update_available\" | \"no_update\" | \"dev_build\" | \"error\"\n\nconst AUTO_CHAIN_NETWORK_RETRY_DELAY_MS = 5000\nconst AUTO_CHAIN_COMPLETE_DELAY_MS = 750\n\nconst DEFAULT_THEME: MentraLiveOtaFlowTheme = {\n background: \"#FFFFFF\",\n border: \"#D7DFDA\",\n error: \"#C43131\",\n foreground: \"#0E2C1A\",\n primary: \"#00B869\",\n primaryText: \"#FFFFFF\",\n textDim: \"#66736B\",\n}\n\nconst ENGLISH_COPY: Record<string, string> = {\n \"common:continue\": \"Continue\",\n \"ota:checkingForUpdates\": \"Checking for updates\",\n \"ota:checkingForUpdatesMessage\":\n \"Connected devices will perform automatic updates. Automatic updates can be disabled in Device Settings\",\n \"ota:updateAvailable\": \"{{deviceName}} Update Available\",\n \"ota:updateConnectWifi\": \"Connect your {{deviceName}} to WiFi to install the update.\",\n \"ota:updateDescription\":\n \"A new update is available for your glasses. We recommend updating now for the best experience.\",\n \"ota:downgradeAvailable\": \"{{deviceName}} Version Change Required\",\n \"ota:downgradeDescription\":\n \"This app requires an earlier glasses software version. Your photos and videos will be preserved, but glasses settings will be reset and restored automatically after the change.\",\n \"ota:updateNow\": \"Update Now\",\n \"ota:setupWifi\": \"Setup WiFi\",\n \"ota:updateLater\": \"Later\",\n \"ota:upToDate\": \"Up To Date\",\n \"ota:devBuild\": \"Development Build\",\n \"ota:devBuildNoOta\":\n \"This mobile app is a development build, so automatic glasses updates are disabled. Use the developer settings manifest override to update them manually.\",\n \"ota:noUpdatesAvailable\": \"Your glasses are running the latest version.\",\n \"ota:checkFailed\": \"Check Failed\",\n \"ota:checkFailedMessage\": \"Couldn't check for updates. Please check your connection and try again.\",\n \"ota:updateInfoUnavailable\": \"Update Info Unavailable\",\n \"ota:updateInfoUnavailableMessage\":\n \"Update information for this version of the app is unavailable. Please check the app store for a newer version of the Mentra App.\",\n \"ota:downgradeDuration\": \"Your glasses will restart twice — this may take up to 2 minutes.\",\n \"ota:versionChangeRestarting\": \"Installing a different version…\",\n \"ota:versionChangeVerifying\": \"Verifying your glasses…\",\n \"ota:versionChangeKeepNearby\": \"Keep your glasses nearby and connected. They will restart on their own.\",\n \"ota:versionChangeComplete\": \"Version Change Complete\",\n \"ota:versionChangeCompleteMessage\":\n \"Your glasses are now on the required version. Their settings were reset and are being restored automatically.\",\n \"ota:versionChangeFirmwarePassComplete\": \"Firmware updated\",\n \"ota:versionChangeFirmwarePassCompleteMessage\":\n \"Your glasses restarted with new firmware. One more step: they'll now continue to the required version.\",\n}\n\nfunction defaultTranslate(key: string, options?: Record<string, string>): string {\n let value = ENGLISH_COPY[key] ?? key\n for (const [name, replacement] of Object.entries(options ?? {})) {\n value = value.replaceAll(`{{${name}}}`, replacement)\n }\n return value\n}\n\nexport function MentraLiveOtaFlow({\n allowDevSkip = typeof __DEV__ !== \"undefined\" && __DEV__,\n deviceName = \"Mentra Live\",\n initialPage = \"check\",\n initializeRuntime = true,\n onFinished,\n onFirmwareRestartingChange,\n onOpenWifiSetup,\n style,\n superMode = false,\n theme,\n translate = defaultTranslate,\n}: MentraLiveOtaFlowProps) {\n const colors = useMemo(() => ({...DEFAULT_THEME, ...theme}), [theme])\n const [page, setPage] = useState<MentraLiveOtaFlowPage>(initialPage)\n const [checkGeneration, setCheckGeneration] = useState(0)\n const [runtimeReady, setRuntimeReady] = useState(!initializeRuntime)\n\n useEffect(() => {\n if (!initializeRuntime) {\n setRuntimeReady(true)\n return\n }\n let cancelled = false\n setRuntimeReady(false)\n void ota.initialize().finally(() => {\n if (!cancelled) setRuntimeReady(true)\n })\n return () => {\n cancelled = true\n }\n }, [initializeRuntime])\n\n const showCheck = useCallback(() => {\n setPage(\"check\")\n setCheckGeneration((generation) => generation + 1)\n }, [])\n\n return (\n <SafeAreaView style={[styles.safeArea, {backgroundColor: colors.background}, style]}>\n <View style={styles.header}>\n <View />\n <MentraMark color={colors.primary} />\n </View>\n {!runtimeReady ? (\n <FlowPage colors={colors} icon=\"download\" title={translate(\"ota:checkingForUpdates\")}>\n <ActivityIndicator size=\"large\" color={colors.foreground} />\n </FlowPage>\n ) : page === \"check\" ? (\n <OtaCheckPage\n allowDevSkip={allowDevSkip}\n colors={colors}\n deviceName={deviceName}\n generation={checkGeneration}\n onFinished={onFinished}\n onOpenWifiSetup={onOpenWifiSetup}\n onStartProgress={() => setPage(\"progress\")}\n translate={translate}\n />\n ) : (\n <OtaProgressPage\n colors={colors}\n onFirmwareRestartingChange={onFirmwareRestartingChange}\n onOpenWifiSetup={onOpenWifiSetup}\n onReturnToCheck={showCheck}\n superMode={superMode}\n translate={translate}\n />\n )}\n </SafeAreaView>\n )\n}\n\ntype CheckPageProps = {\n allowDevSkip: boolean\n colors: MentraLiveOtaFlowTheme\n deviceName: string\n generation: number\n onFinished: () => void\n onOpenWifiSetup: () => void\n onStartProgress: () => void\n translate: MentraLiveOtaFlowTranslate\n}\n\nfunction OtaCheckPage({\n allowDevSkip,\n colors,\n deviceName,\n generation,\n onFinished,\n onOpenWifiSetup,\n onStartProgress,\n translate,\n}: CheckPageProps) {\n const otaSnapshot = useEngineSnapshot(ota.snapshot, ota.onSnapshot)\n const [checkState, setCheckState] = useState<CheckState>(\"checking\")\n const [isUpdateRequired, setIsUpdateRequired] = useState(true)\n const [isDowngradeUpdate, setIsDowngradeUpdate] = useState(false)\n const [errorKind, setErrorKind] = useState<\"network\" | \"pin_unavailable\">(\"network\")\n const [updateFingerprint, setUpdateFingerprint] = useState<string | null>(null)\n const [retryGeneration, setRetryGeneration] = useState(0)\n const performCheckGenerationRef = useRef(0)\n const activeCheckKeyRef = useRef<string | null>(null)\n const checkStartedRef = useRef(false)\n const checkCompletedRef = useRef(false)\n const selectedCheckResultRef = useRef<Awaited<ReturnType<typeof ota.checkForUpdates>> | null>(null)\n const onFinishedRef = useRef(onFinished)\n const onStartProgressRef = useRef(onStartProgress)\n onFinishedRef.current = onFinished\n onStartProgressRef.current = onStartProgress\n\n const glassesWifiConnected = otaSnapshot.wifiConnected\n const glassesWifiStatusKnown = otaSnapshot.wifiStatusKnown\n const hotspotOtaSupported = otaSnapshot.hotspotOtaVersion === 1\n const canInstallUpdate = glassesWifiStatusKnown && (glassesWifiConnected || hotspotOtaSupported)\n const checkKey = `${generation}:${retryGeneration}`\n\n const navigateToProgress = useCallback(() => {\n ota.clearProgress()\n onStartProgressRef.current()\n }, [])\n\n useEffect(() => {\n const MIN_DISPLAY_TIME_MS = 1100\n const MAX_WAIT_FOR_VERSION_INFO_MS = 10_000\n if (activeCheckKeyRef.current !== checkKey) {\n activeCheckKeyRef.current = checkKey\n checkStartedRef.current = false\n checkCompletedRef.current = false\n setCheckState(\"checking\")\n }\n\n const myGeneration = ++performCheckGenerationRef.current\n let cancelled = false\n let reconnectTimeout: ReturnType<typeof setTimeout> | null = null\n\n const performCheck = async () => {\n if (checkCompletedRef.current) return\n if (!otaSnapshot.connected) {\n if (isOtaAutoChainActive()) {\n const remainingMs = otaAutoChainReconnectWaitRemaining()\n if (remainingMs === null) return\n reconnectTimeout = setTimeout(() => {\n if (cancelled || myGeneration !== performCheckGenerationRef.current || ota.snapshot().connected) return\n stopOtaAutoChain()\n checkCompletedRef.current = true\n setCheckState(\"error\")\n }, remainingMs)\n return\n }\n if (checkStartedRef.current) {\n stopOtaAutoChain()\n checkCompletedRef.current = true\n setCheckState(\"error\")\n return\n }\n checkCompletedRef.current = true\n onFinishedRef.current()\n return\n }\n\n clearOtaAutoChainReconnectWait()\n checkStartedRef.current = true\n const startTime = Date.now()\n try {\n let result = await ota.checkForUpdates({\n waitForBuildNumberMs: MAX_WAIT_FOR_VERSION_INFO_MS,\n waitForBesVersionMs: 5000,\n waitForMtkVersionMs: 2000,\n refreshVersionInfo: true,\n fixClockBeforeCheck: false,\n })\n if (cancelled || myGeneration !== performCheckGenerationRef.current) return\n if (!result.hasCheckCompleted && result.checkFailureReason === \"network\" && isOtaAutoChainActive()) {\n await new Promise((resolve) => setTimeout(resolve, AUTO_CHAIN_NETWORK_RETRY_DELAY_MS))\n if (cancelled || myGeneration !== performCheckGenerationRef.current) return\n result = await ota.checkForUpdates({\n waitForBuildNumberMs: MAX_WAIT_FOR_VERSION_INFO_MS,\n waitForBesVersionMs: 5000,\n waitForMtkVersionMs: 2000,\n refreshVersionInfo: true,\n fixClockBeforeCheck: false,\n })\n }\n if (cancelled || myGeneration !== performCheckGenerationRef.current) return\n selectedCheckResultRef.current = result\n await new Promise((resolve) => setTimeout(resolve, Math.max(0, MIN_DISPLAY_TIME_MS - (Date.now() - startTime))))\n if (cancelled || myGeneration !== performCheckGenerationRef.current) return\n\n if (result.skippedReason === \"disconnected\") {\n stopOtaAutoChain()\n checkCompletedRef.current = true\n setCheckState(\"error\")\n return\n }\n if (result.skippedReason === \"missing_build\") {\n checkCompletedRef.current = true\n if (isOtaAutoChainActive()) {\n stopOtaAutoChain()\n setCheckState(\"error\")\n } else {\n onFinishedRef.current()\n }\n return\n }\n if (result.skippedReason === \"dev_build\") {\n stopOtaAutoChain()\n checkCompletedRef.current = true\n ota.clearUpdateAvailable()\n setCheckState(\"dev_build\")\n return\n }\n if (!result.hasCheckCompleted) {\n stopOtaAutoChain()\n checkCompletedRef.current = true\n setErrorKind(result.checkFailureReason === \"pin_unavailable\" ? \"pin_unavailable\" : \"network\")\n setCheckState(\"error\")\n return\n }\n if (result.updateAvailable && result.updateInfo) {\n setIsUpdateRequired(result.isRequired)\n setIsDowngradeUpdate(result.updateInfo.isDowngrade === true)\n const fingerprint = otaAutoChainFingerprint(result)\n setUpdateFingerprint(fingerprint)\n if (isOtaAutoChainActive()) {\n const snapshot = ota.snapshot()\n if (!snapshot.wifiStatusKnown) return\n if (!snapshot.wifiConnected && snapshot.hotspotOtaVersion !== 1) {\n stopOtaAutoChain()\n } else {\n const admission = tryAdvanceOtaAutoChain(fingerprint, result.updateInfo.isDowngrade === true)\n if (admission.advance) {\n checkCompletedRef.current = true\n ota.installSession.prepare(result)\n navigateToProgress()\n return\n }\n }\n }\n checkCompletedRef.current = true\n setCheckState(\"update_available\")\n return\n }\n stopOtaAutoChain()\n checkCompletedRef.current = true\n ota.clearUpdateAvailable()\n setCheckState(\"no_update\")\n } catch (error) {\n console.error(\"OTA check failed:\", error)\n await new Promise((resolve) => setTimeout(resolve, Math.max(0, MIN_DISPLAY_TIME_MS - (Date.now() - startTime))))\n if (cancelled || myGeneration !== performCheckGenerationRef.current) return\n stopOtaAutoChain()\n checkCompletedRef.current = true\n setCheckState(\"error\")\n }\n }\n\n void performCheck()\n return () => {\n cancelled = true\n if (reconnectTimeout) clearTimeout(reconnectTimeout)\n }\n }, [\n checkKey,\n otaSnapshot.connected,\n otaSnapshot.wifiStatusKnown,\n navigateToProgress,\n ])\n\n const retry = () => {\n setCheckState(\"checking\")\n setRetryGeneration((value) => value + 1)\n }\n\n const updateNow = () => {\n const result = selectedCheckResultRef.current\n if (!result) {\n setCheckState(\"error\")\n return\n }\n const snapshot = ota.snapshot()\n if (!snapshot.wifiStatusKnown) {\n retry()\n return\n }\n if (!snapshot.wifiConnected && snapshot.hotspotOtaVersion !== 1) {\n onOpenWifiSetup()\n return\n }\n ota.installSession.prepare(result)\n if (updateFingerprint) beginOtaAutoChain(updateFingerprint, isDowngradeUpdate)\n navigateToProgress()\n }\n\n if (checkState === \"checking\") {\n return (\n <FlowPage colors={colors} icon=\"download\" title={translate(\"ota:checkingForUpdates\")}>\n <BodyText colors={colors}>{translate(\"ota:checkingForUpdatesMessage\")}</BodyText>\n <ActivityIndicator size=\"large\" color={colors.foreground} />\n </FlowPage>\n )\n }\n\n if (checkState === \"update_available\") {\n return (\n <FlowPage\n colors={colors}\n icon=\"download\"\n title={translate(isDowngradeUpdate ? \"ota:downgradeAvailable\" : \"ota:updateAvailable\", {deviceName})}\n actions={\n <>\n <FlowButton\n colors={colors}\n disabled={!glassesWifiStatusKnown}\n label={translate(!glassesWifiStatusKnown || canInstallUpdate ? \"ota:updateNow\" : \"ota:setupWifi\")}\n onPress={updateNow}\n />\n {!isUpdateRequired ? (\n <FlowButton colors={colors} label={translate(\"ota:updateLater\")} onPress={onFinished} secondary />\n ) : null}\n {allowDevSkip && isUpdateRequired ? (\n <FlowButton colors={colors} label=\"Skip (dev only)\" onPress={onFinished} secondary />\n ) : null}\n </>\n }>\n <BodyText colors={colors}>\n {canInstallUpdate\n ? translate(isDowngradeUpdate ? \"ota:downgradeDescription\" : \"ota:updateDescription\")\n : translate(\"ota:updateConnectWifi\", {deviceName})}\n </BodyText>\n </FlowPage>\n )\n }\n\n if (checkState === \"dev_build\") {\n return (\n <FlowPage\n actions={<FlowButton colors={colors} label={translate(\"common:continue\")} onPress={onFinished} />}\n colors={colors}\n icon=\"settings\"\n title={translate(\"ota:devBuild\")}>\n <BodyText colors={colors}>{translate(\"ota:devBuildNoOta\")}</BodyText>\n </FlowPage>\n )\n }\n\n if (checkState === \"no_update\") {\n return (\n <FlowPage\n actions={<FlowButton colors={colors} label={translate(\"common:continue\")} onPress={onFinished} />}\n colors={colors}\n icon=\"check\"\n title={translate(\"ota:upToDate\")}>\n <BodyText colors={colors}>{translate(\"ota:noUpdatesAvailable\")}</BodyText>\n </FlowPage>\n )\n }\n\n if (errorKind === \"pin_unavailable\") {\n return (\n <FlowPage\n actions={<FlowButton colors={colors} label={translate(\"common:continue\")} onPress={onFinished} />}\n colors={colors}\n icon=\"alert\"\n title={translate(\"ota:updateInfoUnavailable\")}>\n <BodyText colors={colors}>{translate(\"ota:updateInfoUnavailableMessage\")}</BodyText>\n </FlowPage>\n )\n }\n\n return (\n <FlowPage\n actions={\n <>\n <FlowButton colors={colors} label=\"Retry\" onPress={retry} />\n {allowDevSkip ? <FlowButton colors={colors} label=\"Skip (dev only)\" onPress={onFinished} secondary /> : null}\n </>\n }\n colors={colors}\n icon=\"alert\"\n title={translate(\"ota:checkFailed\")}>\n <BodyText colors={colors}>{translate(\"ota:checkFailedMessage\")}</BodyText>\n </FlowPage>\n )\n}\n\ntype ProgressPageProps = {\n colors: MentraLiveOtaFlowTheme\n onFirmwareRestartingChange?: (restarting: boolean, progressActive: boolean) => void\n onOpenWifiSetup: () => void\n onReturnToCheck: () => void\n superMode: boolean\n translate: MentraLiveOtaFlowTranslate\n}\n\nfunction OtaProgressPage({\n colors,\n onFirmwareRestartingChange,\n onOpenWifiSetup,\n onReturnToCheck,\n superMode,\n translate,\n}: ProgressPageProps) {\n const install = useEngineSnapshot(ota.installSession.snapshot, ota.installSession.onSnapshot)\n const autoChainAdvancedRef = useRef(false)\n const {\n connected,\n continueButtonDisabled,\n displayState,\n errorMsg,\n hotspotArtifactPercent,\n hotspotPhase,\n isVersionChange,\n mtkInstallStallSimulatedPercent,\n otaProgress,\n otaStatus,\n versionChangeConverged,\n versionChangePhase,\n } = install\n const firmwareRestarting = (!connected && displayState === \"restarting\") || versionChangePhase === \"restarting\"\n\n useEffect(() => {\n onFirmwareRestartingChange?.(firmwareRestarting, true)\n }, [firmwareRestarting, onFirmwareRestartingChange])\n\n useEffect(\n () => () => {\n onFirmwareRestartingChange?.(false, false)\n },\n [onFirmwareRestartingChange],\n )\n\n useEffect(() => {\n ota.installSession.attach()\n return () => ota.installSession.detach()\n }, [])\n\n useEffect(() => {\n if (displayState !== \"complete\" || !connected || !isOtaAutoChainActive() || autoChainAdvancedRef.current) return\n const timeout = setTimeout(() => {\n if (!isOtaAutoChainActive()) return\n autoChainAdvancedRef.current = true\n ota.installSession.finish()\n onReturnToCheck()\n }, AUTO_CHAIN_COMPLETE_DELAY_MS)\n return () => clearTimeout(timeout)\n }, [connected, displayState, onReturnToCheck])\n\n const finishAndCheck = () => {\n ota.installSession.finish()\n onReturnToCheck()\n }\n const stopAndCheck = () => {\n stopOtaAutoChain()\n finishAndCheck()\n }\n const retryInstall = () => {\n onFirmwareRestartingChange?.(false, true)\n ota.installSession.retry()\n }\n\n if (versionChangePhase === \"restarting\" || versionChangePhase === \"verifying\") {\n return (\n <FlowPage\n colors={colors}\n icon=\"download\"\n title={translate(\n versionChangePhase === \"verifying\" ? \"ota:versionChangeVerifying\" : \"ota:versionChangeRestarting\",\n )}>\n <ActivityIndicator size=\"large\" color={colors.foreground} />\n <BodyText colors={colors}>{translate(\"ota:versionChangeKeepNearby\")}</BodyText>\n <BodyText colors={colors}>{translate(\"ota:downgradeDuration\")}</BodyText>\n </FlowPage>\n )\n }\n\n if (displayState === \"starting\") {\n const hotspotTitle =\n hotspotPhase === \"downloading\"\n ? \"Downloading update to phone...\"\n : hotspotPhase === \"starting_hotspot\"\n ? \"Starting glasses hotspot...\"\n : hotspotPhase === \"joining_hotspot\"\n ? \"Connecting phone to glasses...\"\n : \"Starting update...\"\n return (\n <FlowPage colors={colors} icon=\"download\" title={hotspotTitle}>\n {hotspotPhase === \"downloading\" && hotspotArtifactPercent !== null ? (\n <PercentText colors={colors} percent={hotspotArtifactPercent} />\n ) : null}\n <ActivityIndicator size=\"large\" color={colors.foreground} />\n <BodyText colors={colors}>Do not disconnect your glasses</BodyText>\n </FlowPage>\n )\n }\n\n if (displayState === \"updating\") {\n const isDownload = otaStatus?.phase === \"download\"\n const totalSteps = otaStatus?.totalSteps ?? 1\n const isApkOnlyInstalling = otaStatus?.stepType === \"apk\" && otaStatus.phase === \"install\" && totalSteps === 1\n const rawPercent = isDownload\n ? otaStatus?.stepPercent ?? 0\n : totalSteps >= 2\n ? otaStatus?.overallPercent ?? 0\n : otaStatus?.stepPercent ?? 0\n const percent = Math.min(Math.max(rawPercent, mtkInstallStallSimulatedPercent ?? 0, 0), 100)\n return (\n <FlowPage colors={colors} icon=\"download\" title={isDownload ? \"Downloading...\" : \"Installing...\"}>\n {isApkOnlyInstalling ? (\n <ActivityIndicator size=\"large\" color={colors.foreground} />\n ) : (\n <>\n <PercentText colors={colors} percent={percent} />\n <View style={[styles.progressTrack, {backgroundColor: colors.border}]}>\n <View style={[styles.progressFill, {backgroundColor: colors.primary, width: `${percent}%`}]} />\n </View>\n </>\n )}\n <BodyText colors={colors}>Do not disconnect your glasses</BodyText>\n {isVersionChange && otaStatus?.phase === \"install\" ? (\n <BodyText colors={colors}>{translate(\"ota:downgradeDuration\")}</BodyText>\n ) : null}\n </FlowPage>\n )\n }\n\n if (displayState === \"restarting\") {\n return (\n <FlowPage\n actions={\n <FlowButton colors={colors} disabled={continueButtonDisabled} label=\"Continue\" onPress={stopAndCheck} />\n }\n colors={colors}\n icon=\"check\"\n title=\"Update Installed\"\n />\n )\n }\n\n if (displayState === \"complete\") {\n const title = versionChangeConverged\n ? translate(\"ota:versionChangeComplete\")\n : isVersionChange\n ? translate(\"ota:versionChangeFirmwarePassComplete\")\n : \"Update complete!\"\n const message = versionChangeConverged\n ? translate(\"ota:versionChangeCompleteMessage\")\n : isVersionChange\n ? translate(\"ota:versionChangeFirmwarePassCompleteMessage\")\n : \"Your glasses are up to date.\"\n return (\n <FlowPage\n actions={\n <FlowButton\n colors={colors}\n label={isVersionChange && !versionChangeConverged ? \"Continue\" : \"Done\"}\n onPress={finishAndCheck}\n />\n }\n colors={colors}\n icon=\"check\"\n title={title}>\n <BodyText colors={colors}>{message}</BodyText>\n </FlowPage>\n )\n }\n\n if (displayState === \"failed\") {\n const requiresGlassesReboot = shouldRequireGlassesRebootForBesFailure(otaStatus, otaProgress, errorMsg)\n const displayedError = requiresGlassesReboot\n ? BES_INSTALL_RESTART_MESSAGE\n : errorMsg || getOtaErrorMessage(otaStatus?.error)\n const showChangeWifi = shouldShowChangeWifiForOtaDownloadFailure(otaStatus, otaProgress, errorMsg)\n return (\n <FlowPage\n actions={\n <>\n <FlowButton\n colors={colors}\n label={requiresGlassesReboot ? \"Done\" : \"Retry\"}\n onPress={requiresGlassesReboot ? stopAndCheck : retryInstall}\n />\n {showChangeWifi ? (\n <FlowButton\n colors={colors}\n label=\"Change WiFi\"\n onPress={() => {\n stopOtaAutoChain()\n onOpenWifiSetup()\n }}\n secondary\n />\n ) : null}\n </>\n }\n colors={colors}\n icon=\"alert\"\n title=\"Update Failed\">\n <BodyText colors={colors}>{displayedError}</BodyText>\n </FlowPage>\n )\n }\n\n return (\n <FlowPage\n actions={\n superMode ? (\n <FlowButton\n colors={colors}\n label=\"Skip (super)\"\n onPress={() => {\n stopOtaAutoChain()\n ota.installSession.discard()\n onReturnToCheck()\n }}\n secondary\n />\n ) : undefined\n }\n colors={colors}\n icon=\"bluetooth\"\n title=\"Glasses disconnected\">\n <BodyText colors={colors}>Reconnecting...</BodyText>\n <ActivityIndicator size=\"large\" color={colors.foreground} />\n </FlowPage>\n )\n}\n\ntype FlowPageProps = {\n actions?: React.ReactNode\n children?: React.ReactNode\n colors: MentraLiveOtaFlowTheme\n icon: \"alert\" | \"bluetooth\" | \"check\" | \"download\" | \"settings\"\n title: string\n}\n\nfunction FlowPage({actions, children, colors, icon, title}: FlowPageProps) {\n return (\n <View style={styles.page} testID=\"mentra-live-ota-flow\">\n <View style={styles.centerContent}>\n <FlowIcon colors={colors} name={icon} />\n <Text style={[styles.title, {color: colors.foreground}]}>{title}</Text>\n {children}\n </View>\n {actions ? <View style={styles.actions}>{actions}</View> : <View style={styles.actionSpacer} />}\n </View>\n )\n}\n\nfunction BodyText({children, colors}: {children: React.ReactNode; colors: MentraLiveOtaFlowTheme}) {\n return <Text style={[styles.body, {color: colors.textDim}]}>{children}</Text>\n}\n\nfunction PercentText({colors, percent}: {colors: MentraLiveOtaFlowTheme; percent: number}) {\n return <Text style={[styles.percent, {color: colors.primary}]}>{Math.round(percent)}%</Text>\n}\n\nfunction FlowButton({\n colors,\n disabled = false,\n label,\n onPress,\n secondary = false,\n}: {\n colors: MentraLiveOtaFlowTheme\n disabled?: boolean\n label: string\n onPress: () => void\n secondary?: boolean\n}) {\n return (\n <Pressable\n accessibilityRole=\"button\"\n disabled={disabled}\n onPress={onPress}\n style={({pressed}) => [\n styles.button,\n {\n backgroundColor: secondary ? colors.background : colors.primary,\n borderColor: secondary ? colors.border : colors.primary,\n opacity: disabled ? 0.45 : pressed ? 0.75 : 1,\n },\n ]}\n testID={`button-${label}`}>\n <Text style={[styles.buttonText, {color: secondary ? colors.foreground : colors.primaryText}]}>{label}</Text>\n </Pressable>\n )\n}\n\nfunction MentraMark({color}: {color: string}) {\n return (\n <Svg width={33} height={18} viewBox=\"0 0 50 27\" fill=\"none\">\n <Rect y={14.8072} width={11.8457} height={11.8457} fill={color} />\n <Path d=\"M9.36639 0L30.7163 14.8072V26.6529L9.36639 11.8457V0Z\" fill={color} />\n <Path d=\"M28.6501 0L50 14.8072V26.6529L28.6501 11.8457V0Z\" fill={color} />\n </Svg>\n )\n}\n\nfunction FlowIcon({colors, name}: {colors: MentraLiveOtaFlowTheme; name: FlowPageProps[\"icon\"]}) {\n const color = name === \"alert\" || name === \"bluetooth\" ? colors.error : colors.primary\n const glyph =\n name === \"check\" ? \"✓\" : name === \"alert\" ? \"!\" : name === \"settings\" ? \"⚙\" : name === \"bluetooth\" ? \"⌁\" : \"↓\"\n return <Text style={[styles.icon, {color}]}>{glyph}</Text>\n}\n\nconst styles = StyleSheet.create({\n safeArea: {flex: 1},\n header: {\n alignItems: \"center\",\n flexDirection: \"row\",\n height: 48,\n justifyContent: \"space-between\",\n paddingHorizontal: 20,\n },\n page: {flex: 1, paddingBottom: 24, paddingHorizontal: 24},\n centerContent: {alignItems: \"center\", flex: 1, gap: 16, justifyContent: \"center\"},\n actionSpacer: {height: 48},\n actions: {gap: 12},\n icon: {fontSize: 64, fontWeight: \"500\", lineHeight: 72, textAlign: \"center\"},\n title: {fontSize: 20, fontWeight: \"600\", textAlign: \"center\"},\n body: {fontSize: 14, lineHeight: 20, maxWidth: 420, textAlign: \"center\"},\n percent: {fontSize: 30, fontVariant: [\"tabular-nums\"], fontWeight: \"700\"},\n progressTrack: {borderRadius: 4, height: 8, maxWidth: 420, overflow: \"hidden\", width: \"100%\"},\n progressFill: {borderRadius: 4, height: 8},\n button: {\n alignItems: \"center\",\n borderRadius: 10,\n borderWidth: 1,\n justifyContent: \"center\",\n minHeight: 48,\n paddingHorizontal: 20,\n },\n buttonText: {fontSize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AAK,EAAE,MAAM;KACd;IACD,cAAc,EAAE,EAAC,QAAQ,EAAE,EAAE,EAAE,UAAU,EAAE,KAAK,EAAC;IACjD,aAAa,EAAE,EAAC,UAAU,EAAE,CAAC,EAAE,SAAS,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAC;IAC7D,gBAAgB,EAAE,EAAC,GAAG,EAAE,EAAE,EAAE,aAAa,EAAE,CAAC,EAAC;IAC7C,cAAc,EAAE,EAAC,GAAG,EAAE,CAAC,EAAC;IACxB,qBAAqB,EAAE,EAAC,cAAc,EAAE,UAAU,CAAC,aAAa,EAAE,UAAU,EAAE,EAAE,EAAC;IACjF,gBAAgB,EAAE,EAAC,QAAQ,EAAE,EAAE,EAAE,UAAU,EAAE,KAAK,EAAC;IACnD,wBAAwB,EAAE,EAAC,GAAG,EAAE,EAAE,EAAC;IACnC,MAAM,EAAE;QACN,UAAU,EAAE,QAAQ;QACpB,YAAY,EAAE,EAAE;QAChB,WAAW,EAAE,CAAC;QACd,cAAc,EAAE,QAAQ;QACxB,SAAS,EAAE,EAAE;QACb,iBAAiB,EAAE,EAAE;KACtB;IACD,UAAU,EAAE,EAAC,QAAQ,EAAE,EAAE,EAAE,UAAU,EAAE,KAAK,EAAC;CAC9C,CAAC,CAAA","sourcesContent":["/* eslint-disable react-native/no-raw-text -- BodyText and PercentText are local Text wrappers. */\nimport React, {useMemo} from \"react\"\nimport {\n ActivityIndicator,\n Pressable,\n ScrollView,\n StyleSheet,\n Text,\n View,\n type StyleProp,\n type ViewStyle,\n} from \"react-native\"\nimport {useMarkdown, type MarkedStyles, type useMarkdownHookOptions} from \"react-native-marked\"\nimport {SafeAreaView} from \"react-native-safe-area-context\"\nimport Svg, {Path, Rect} from \"react-native-svg\"\n\nimport {\n MINIMUM_OTA_BATTERY_LEVEL,\n useMentraLiveOta,\n type MentraLiveOtaController,\n type MentraLiveOtaFlowPage,\n} from \"./useMentraLiveOta\"\n\nexport type {MentraLiveOtaFlowPage} from \"./useMentraLiveOta\"\n\nexport type MentraLiveOtaFlowTheme = {\n background: string\n border: string\n error: string\n foreground: string\n primary: string\n primaryText: string\n textDim: string\n}\n\nexport type MentraLiveOtaFlowTranslate = (key: string, options?: Record<string, string>) => string\n\nexport type MentraLiveOtaFlowProps = {\n /** Display name used in update copy. */\n deviceName?: string\n /** Entry page. `progress` exists for recovery/deep-link compatibility. */\n initialPage?: MentraLiveOtaFlowPage\n /** Start the OTA-only projections. Full Engine hosts should pass false. */\n initializeRuntime?: boolean\n /** Called after the final check or when the user leaves an optional update. */\n onFinished: () => void\n /** Host-owned Wi-Fi setup for glasses that do not support hotspot OTA. */\n onOpenWifiSetup: () => void\n /** Lets a host coordinate its global connection overlay with OTA progress and firmware restarts. */\n onFirmwareRestartingChange?: (restarting: boolean, progressActive: boolean) => void\n /** Enables the existing developer-only escape hatches. */\n allowDevSkip?: boolean\n /** Enables the existing super-mode interrupted-session escape hatch. */\n superMode?: boolean\n /** Optional host localization. Defaults to the Mentra App English OTA copy. */\n translate?: MentraLiveOtaFlowTranslate\n /** Optional host theme. Both hosts use the same layout and state machine. */\n theme?: Partial<MentraLiveOtaFlowTheme>\n style?: StyleProp<ViewStyle>\n}\n\nconst DEFAULT_THEME: MentraLiveOtaFlowTheme = {\n background: \"#FFFFFF\",\n border: \"#D7DFDA\",\n error: \"#C43131\",\n foreground: \"#0E2C1A\",\n primary: \"#00B869\",\n primaryText: \"#FFFFFF\",\n textDim: \"#66736B\",\n}\n\nconst ENGLISH_COPY: Record<string, string> = {\n \"common:continue\": \"Continue\",\n \"common:done\": \"Done\",\n \"ota:checkingForUpdates\": \"Checking for updates\",\n \"ota:checkingForUpdatesMessage\":\n \"Connected devices will perform automatic updates. Automatic updates can be disabled in Device Settings\",\n \"ota:finishingUpdate\": \"Finishing your update\",\n \"ota:checkingAdditionalUpdates\": \"Checking whether your glasses need any additional updates.\",\n \"ota:updateAvailable\": \"{{deviceName}} Update Available\",\n \"ota:batteryRequiredTitle\": \"Charge {{deviceName}} to Update\",\n \"ota:batteryRequiredMessage\":\n \"{{deviceName}} is currently at {{batteryLevel}}%. Charge it to at least {{minimumBatteryLevel}}% before updating.\",\n \"ota:batteryRequiredLiveUpdate\": \"This screen will update automatically as the battery charges.\",\n \"ota:updateConnectWifi\": \"Connect your {{deviceName}} to WiFi to install the update.\",\n \"ota:wifiRequiredTitle\": \"WiFi Needed for Update\",\n \"ota:updateDescription\":\n \"A new update is available for your glasses. We recommend updating now for the best experience.\",\n \"ota:updateSequenceMessage\":\n \"Your glasses may install more than one update and restart several times. Keep them nearby until finished.\",\n \"ota:releaseTransition\": \"{{fromVersion}} → {{toVersion}}\",\n \"ota:releaseTransitionUnknown\": \"Current version unknown → {{toVersion}}\",\n \"ota:updatedToVersion\": \"Updated to {{version}}\",\n \"ota:downgradeAvailable\": \"{{deviceName}} Version Change Required\",\n \"ota:downgradeDescription\":\n \"This app requires an earlier glasses software version. Your photos and videos will be preserved, but glasses settings will be reset and restored automatically after the change.\",\n \"ota:updateNow\": \"Update Now\",\n \"ota:setupWifi\": \"Setup WiFi\",\n \"ota:updateLater\": \"Later\",\n \"ota:updateComplete\": \"Update complete\",\n \"ota:whatsNew\": \"What's new\",\n \"ota:upToDate\": \"Up To Date\",\n \"ota:devBuild\": \"Development Build\",\n \"ota:devBuildNoOta\":\n \"This mobile app is a development build, so automatic glasses updates are disabled. Use the developer settings manifest override to update them manually.\",\n \"ota:noUpdatesAvailable\": \"Your glasses are running the latest version.\",\n \"ota:checkFailed\": \"Check Failed\",\n \"ota:checkFailedMessage\": \"Couldn't check for updates. Please check your connection and try again.\",\n \"ota:updateInfoUnavailable\": \"Update Info Unavailable\",\n \"ota:updateInfoUnavailableMessage\":\n \"Update information for this version of the app is unavailable. Please check the app store for a newer version of the Mentra App.\",\n \"ota:downgradeDuration\": \"Your glasses will restart twice — this may take up to 2 minutes.\",\n \"ota:versionChangeRestarting\": \"Installing a different version…\",\n \"ota:versionChangeVerifying\": \"Verifying your glasses…\",\n \"ota:versionChangeKeepNearby\": \"Keep your glasses nearby and connected. They will restart on their own.\",\n \"ota:restartingGlasses\": \"Restarting {{deviceName}}…\",\n \"ota:restartingGlassesMessage\":\n \"The update is installed. Keep your glasses nearby and leave this screen open while they finish starting.\",\n \"ota:restartingGlassesAutomatic\": \"We'll continue automatically when they're ready.\",\n \"ota:versionChangeComplete\": \"Version Change Complete\",\n \"ota:versionChangeCompleteMessage\":\n \"Your glasses are now on the required version. Their settings were reset and are being restored automatically.\",\n \"ota:versionChangeFirmwarePassComplete\": \"Firmware updated\",\n \"ota:versionChangeFirmwarePassCompleteMessage\":\n \"Your glasses restarted with new firmware. One more step: they'll now continue to the required version.\",\n}\n\nfunction defaultTranslate(key: string, options?: Record<string, string>): string {\n let value = ENGLISH_COPY[key] ?? key\n for (const [name, replacement] of Object.entries(options ?? {})) {\n value = value.replaceAll(`{{${name}}}`, replacement)\n }\n return value\n}\n\nexport function MentraLiveOtaFlow({\n allowDevSkip = typeof __DEV__ !== \"undefined\" && __DEV__,\n deviceName = \"Mentra Live\",\n initialPage = \"check\",\n initializeRuntime = true,\n onFinished,\n onFirmwareRestartingChange,\n onOpenWifiSetup,\n style,\n superMode = false,\n theme,\n translate = defaultTranslate,\n}: MentraLiveOtaFlowProps) {\n const colors = useMemo(() => ({...DEFAULT_THEME, ...theme}), [theme])\n const controller = useMentraLiveOta({\n initialPage,\n initializeRuntime,\n onFinished,\n onFirmwareRestartingChange,\n onOpenWifiSetup,\n })\n\n return (\n <SafeAreaView style={[styles.safeArea, {backgroundColor: colors.background}, style]}>\n <View style={styles.header}>\n <View />\n <MentraMark color={colors.primary} />\n </View>\n <OtaFlowContent\n allowDevSkip={allowDevSkip}\n colors={colors}\n controller={controller}\n deviceName={deviceName}\n superMode={superMode}\n translate={translate}\n />\n </SafeAreaView>\n )\n}\n\nfunction OtaFlowContent({\n allowDevSkip,\n colors,\n controller,\n deviceName,\n superMode,\n translate,\n}: {\n allowDevSkip: boolean\n colors: MentraLiveOtaFlowTheme\n controller: MentraLiveOtaController\n deviceName: string\n superMode: boolean\n translate: MentraLiveOtaFlowTranslate\n}) {\n const {state} = controller\n\n if (state.screen === \"initializing\") {\n return (\n <FlowPage colors={colors} icon=\"download\" title={translate(\"ota:checkingForUpdates\")}>\n <ActivityIndicator size=\"large\" color={colors.foreground} />\n </FlowPage>\n )\n }\n\n if (state.screen === \"checking\") {\n return (\n <FlowPage colors={colors} icon=\"download\" title={translate(\"ota:checkingForUpdates\")}>\n <BodyText colors={colors}>{translate(\"ota:checkingForUpdatesMessage\")}</BodyText>\n <ActivityIndicator size=\"large\" color={colors.foreground} />\n </FlowPage>\n )\n }\n\n if (state.screen === \"battery_required\") {\n return (\n <FlowPage\n actions={\n <>\n <FlowButton colors={colors} disabled label={translate(\"ota:updateNow\")} onPress={controller.install} />\n {state.canDismiss ? (\n <FlowButton colors={colors} label={translate(\"ota:updateLater\")} onPress={controller.finish} secondary />\n ) : null}\n </>\n }\n colors={colors}\n icon=\"alert\"\n title={translate(\"ota:batteryRequiredTitle\", {deviceName})}>\n <BodyText colors={colors}>\n {translate(\"ota:batteryRequiredMessage\", {\n batteryLevel: String(state.batteryLevel),\n deviceName,\n minimumBatteryLevel: String(MINIMUM_OTA_BATTERY_LEVEL),\n })}\n </BodyText>\n <BodyText colors={colors}>{translate(\"ota:batteryRequiredLiveUpdate\")}</BodyText>\n </FlowPage>\n )\n }\n\n if (state.screen === \"finishing\") {\n return (\n <FlowPage colors={colors} icon=\"download\" title={translate(\"ota:finishingUpdate\")}>\n <BodyText colors={colors}>{translate(\"ota:checkingAdditionalUpdates\")}</BodyText>\n <ActivityIndicator size=\"large\" color={colors.foreground} />\n </FlowPage>\n )\n }\n\n if (state.screen === \"update_available\" || state.screen === \"wifi_required\") {\n const titleKey =\n state.screen === \"wifi_required\"\n ? \"ota:wifiRequiredTitle\"\n : state.versionChange\n ? \"ota:downgradeAvailable\"\n : \"ota:updateAvailable\"\n return (\n <FlowPage\n colors={colors}\n icon=\"download\"\n title={translate(titleKey, {deviceName})}\n actions={\n <>\n <FlowButton\n colors={colors}\n disabled={!state.wifiStatusKnown}\n label={translate(state.screen === \"wifi_required\" ? \"ota:setupWifi\" : \"ota:updateNow\")}\n onPress={state.screen === \"wifi_required\" ? controller.openWifiSetup : controller.install}\n />\n {state.canDismiss ? (\n <FlowButton colors={colors} label={translate(\"ota:updateLater\")} onPress={controller.finish} secondary />\n ) : null}\n {allowDevSkip && state.updateRequired ? (\n <FlowButton colors={colors} label=\"Skip (dev only)\" onPress={controller.finish} secondary />\n ) : null}\n </>\n }>\n {state.releaseTransition ? (\n <BodyText colors={colors}>\n {state.releaseTransition.fromVersion\n ? translate(\"ota:releaseTransition\", {\n fromVersion: state.releaseTransition.fromVersion,\n toVersion: state.releaseTransition.toVersion,\n })\n : translate(\"ota:releaseTransitionUnknown\", {toVersion: state.releaseTransition.toVersion})}\n </BodyText>\n ) : null}\n <BodyText colors={colors}>\n {state.screen === \"wifi_required\"\n ? translate(\"ota:updateConnectWifi\", {deviceName})\n : translate(state.versionChange ? \"ota:downgradeDescription\" : \"ota:updateDescription\")}\n </BodyText>\n <BodyText colors={colors}>{translate(\"ota:updateSequenceMessage\")}</BodyText>\n </FlowPage>\n )\n }\n\n if (state.screen === \"dev_build\") {\n return (\n <FlowPage\n actions={<FlowButton colors={colors} label={translate(\"common:continue\")} onPress={controller.finish} />}\n colors={colors}\n icon=\"settings\"\n title={translate(\"ota:devBuild\")}>\n <BodyText colors={colors}>{translate(\"ota:devBuildNoOta\")}</BodyText>\n </FlowPage>\n )\n }\n\n if (state.screen === \"up_to_date\") {\n return (\n <FlowPage\n actions={\n <FlowButton\n colors={colors}\n label={translate(state.completedUpdate ? \"common:done\" : \"common:continue\")}\n onPress={controller.finish}\n />\n }\n colors={colors}\n contentAlignment={state.changelogs.length > 0 ? \"top\" : \"center\"}\n icon=\"check\"\n title={translate(state.completedUpdate ? \"ota:updateComplete\" : \"ota:upToDate\")}>\n <BodyText colors={colors}>{translate(\"ota:noUpdatesAvailable\")}</BodyText>\n {state.releaseTransition ? (\n <BodyText colors={colors}>\n {translate(\"ota:updatedToVersion\", {version: state.releaseTransition.toVersion})}\n </BodyText>\n ) : null}\n <ChangelogList changelogs={state.changelogs} colors={colors} title={translate(\"ota:whatsNew\")} />\n </FlowPage>\n )\n }\n\n if (state.screen === \"update_info_unavailable\") {\n return (\n <FlowPage\n actions={<FlowButton colors={colors} label={translate(\"common:continue\")} onPress={controller.finish} />}\n colors={colors}\n icon=\"alert\"\n title={translate(\"ota:updateInfoUnavailable\")}>\n <BodyText colors={colors}>{translate(\"ota:updateInfoUnavailableMessage\")}</BodyText>\n </FlowPage>\n )\n }\n\n if (state.screen === \"check_failed\") {\n return (\n <FlowPage\n actions={\n <>\n <FlowButton colors={colors} label=\"Retry\" onPress={controller.retryCheck} />\n {allowDevSkip ? (\n <FlowButton colors={colors} label=\"Skip (dev only)\" onPress={controller.finish} secondary />\n ) : null}\n </>\n }\n colors={colors}\n icon=\"alert\"\n title={translate(\"ota:checkFailed\")}>\n <BodyText colors={colors}>{translate(\"ota:checkFailedMessage\")}</BodyText>\n </FlowPage>\n )\n }\n\n if (state.versionChangePhase === \"restarting\" || state.versionChangePhase === \"verifying\") {\n return (\n <FlowPage\n colors={colors}\n icon=\"download\"\n title={translate(\n state.versionChangePhase === \"verifying\" ? \"ota:versionChangeVerifying\" : \"ota:versionChangeRestarting\",\n )}>\n <ActivityIndicator size=\"large\" color={colors.foreground} />\n <BodyText colors={colors}>{translate(\"ota:versionChangeKeepNearby\")}</BodyText>\n <BodyText colors={colors}>{translate(\"ota:downgradeDuration\")}</BodyText>\n </FlowPage>\n )\n }\n\n if (state.screen === \"starting\" || state.screen === \"preparing_hotspot\") {\n const title =\n state.hotspotPhase === \"downloading\"\n ? \"Downloading update to phone...\"\n : state.hotspotPhase === \"starting_hotspot\"\n ? \"Starting glasses hotspot...\"\n : state.hotspotPhase === \"joining_hotspot\"\n ? \"Connecting phone to glasses...\"\n : \"Starting update...\"\n return (\n <FlowPage colors={colors} icon=\"download\" title={title}>\n {state.hotspotPhase === \"downloading\" && state.hotspotArtifactPercent !== null ? (\n <PercentText colors={colors} percent={state.hotspotArtifactPercent} />\n ) : null}\n <ActivityIndicator size=\"large\" color={colors.foreground} />\n <BodyText colors={colors}>Do not disconnect your glasses</BodyText>\n </FlowPage>\n )\n }\n\n if (state.screen === \"updating\") {\n return (\n <FlowPage colors={colors} icon=\"download\" title={state.phase === \"download\" ? \"Downloading...\" : \"Installing...\"}>\n {state.installingApkOnly ? (\n <ActivityIndicator size=\"large\" color={colors.foreground} />\n ) : (\n <>\n <PercentText colors={colors} percent={state.progress ?? 0} />\n <View style={[styles.progressTrack, {backgroundColor: colors.border}]}>\n <View\n style={[styles.progressFill, {backgroundColor: colors.primary, width: `${state.progress ?? 0}%`}]}\n />\n </View>\n </>\n )}\n <BodyText colors={colors}>Do not disconnect your glasses</BodyText>\n {state.versionChange && state.phase === \"install\" ? (\n <BodyText colors={colors}>{translate(\"ota:downgradeDuration\")}</BodyText>\n ) : null}\n </FlowPage>\n )\n }\n\n if (state.screen === \"restarting\") {\n return (\n <FlowPage colors={colors} icon=\"download\" title={translate(\"ota:restartingGlasses\", {deviceName})}>\n <ActivityIndicator size=\"large\" color={colors.foreground} />\n <BodyText colors={colors}>{translate(\"ota:restartingGlassesMessage\")}</BodyText>\n <BodyText colors={colors}>{translate(\"ota:restartingGlassesAutomatic\")}</BodyText>\n </FlowPage>\n )\n }\n\n if (state.screen === \"complete\") {\n const title = state.versionChangeConverged\n ? translate(\"ota:versionChangeComplete\")\n : state.versionChange\n ? translate(\"ota:versionChangeFirmwarePassComplete\")\n : \"Update complete!\"\n const message = state.versionChangeConverged\n ? translate(\"ota:versionChangeCompleteMessage\")\n : state.versionChange\n ? translate(\"ota:versionChangeFirmwarePassCompleteMessage\")\n : \"Your glasses are up to date.\"\n return (\n <FlowPage\n actions={\n <FlowButton\n colors={colors}\n label={state.versionChange && !state.versionChangeConverged ? \"Continue\" : \"Done\"}\n onPress={controller.finish}\n />\n }\n colors={colors}\n contentAlignment={state.changelogs.length > 0 ? \"top\" : \"center\"}\n icon=\"check\"\n title={title}>\n <BodyText colors={colors}>{message}</BodyText>\n {state.releaseTransition ? (\n <BodyText colors={colors}>\n {translate(\"ota:updatedToVersion\", {version: state.releaseTransition.toVersion})}\n </BodyText>\n ) : null}\n <ChangelogList changelogs={state.changelogs} colors={colors} title={translate(\"ota:whatsNew\")} />\n </FlowPage>\n )\n }\n\n if (state.screen === \"failed\") {\n return (\n <FlowPage\n actions={\n <>\n <FlowButton\n colors={colors}\n label={state.canRetry ? \"Retry\" : \"Done\"}\n onPress={state.canRetry ? controller.retryInstall : controller.finish}\n />\n {state.canOpenWifiSetup ? (\n <FlowButton colors={colors} label=\"Change WiFi\" onPress={controller.openWifiSetup} secondary />\n ) : null}\n </>\n }\n colors={colors}\n icon=\"alert\"\n title=\"Update Failed\">\n <BodyText colors={colors}>{state.error?.message}</BodyText>\n </FlowPage>\n )\n }\n\n return (\n <FlowPage\n actions={\n superMode ? (\n <FlowButton colors={colors} label=\"Skip (super)\" onPress={controller.discard} secondary />\n ) : undefined\n }\n colors={colors}\n icon=\"bluetooth\"\n title=\"Glasses disconnected\">\n <BodyText colors={colors}>Reconnecting...</BodyText>\n <ActivityIndicator size=\"large\" color={colors.foreground} />\n </FlowPage>\n )\n}\n\ntype FlowPageProps = {\n actions?: React.ReactNode\n children?: React.ReactNode\n colors: MentraLiveOtaFlowTheme\n contentAlignment?: \"center\" | \"top\"\n icon: \"alert\" | \"bluetooth\" | \"check\" | \"download\" | \"settings\"\n title: string\n}\n\nfunction FlowPage({actions, children, colors, contentAlignment = \"center\", icon, title}: FlowPageProps) {\n return (\n <View style={styles.page} testID=\"mentra-live-ota-flow\">\n <View style={[styles.centerContent, contentAlignment === \"top\" && styles.topContent]}>\n <FlowIcon colors={colors} name={icon} />\n <Text style={[styles.title, {color: colors.foreground}]}>{title}</Text>\n {children}\n </View>\n {actions ? <View style={styles.actions}>{actions}</View> : <View style={styles.actionSpacer} />}\n </View>\n )\n}\n\nfunction BodyText({children, colors}: {children: React.ReactNode; colors: MentraLiveOtaFlowTheme}) {\n return <Text style={[styles.body, {color: colors.textDim}]}>{children}</Text>\n}\n\nfunction PercentText({colors, percent}: {colors: MentraLiveOtaFlowTheme; percent: number}) {\n return <Text style={[styles.percent, {color: colors.primary}]}>{Math.round(percent)}%</Text>\n}\n\nfunction ChangelogMarkdown({colors, markdown}: {colors: MentraLiveOtaFlowTheme; markdown: string}) {\n const markdownStyles = useMemo<MarkedStyles>(\n () => ({\n blockquote: {\n borderLeftColor: colors.primary,\n borderLeftWidth: 3,\n marginVertical: 2,\n opacity: 1,\n paddingLeft: 12,\n },\n code: {\n backgroundColor: colors.background,\n borderColor: colors.border,\n borderRadius: 8,\n borderWidth: 1,\n padding: 12,\n },\n codespan: {\n backgroundColor: colors.border,\n color: colors.foreground,\n fontFamily: \"monospace\",\n fontSize: 13,\n fontStyle: \"normal\",\n fontWeight: \"400\",\n },\n em: {color: colors.textDim, fontSize: 14, lineHeight: 20},\n h1: {\n borderBottomWidth: 0,\n color: colors.foreground,\n fontSize: 18,\n fontWeight: \"700\",\n lineHeight: 24,\n marginVertical: 0,\n paddingBottom: 0,\n },\n h2: {\n borderBottomWidth: 0,\n color: colors.foreground,\n fontSize: 17,\n fontWeight: \"700\",\n lineHeight: 23,\n marginVertical: 0,\n paddingBottom: 0,\n },\n h3: {color: colors.foreground, fontSize: 16, fontWeight: \"700\", lineHeight: 22, marginVertical: 0},\n h4: {color: colors.foreground, fontSize: 15, fontWeight: \"700\", lineHeight: 21, marginVertical: 0},\n h5: {color: colors.foreground, fontSize: 14, fontWeight: \"700\", lineHeight: 20, marginVertical: 0},\n h6: {color: colors.textDim, fontSize: 14, fontWeight: \"600\", lineHeight: 20, marginVertical: 0},\n hr: {borderBottomColor: colors.border, marginVertical: 2},\n image: {borderRadius: 8},\n li: {color: colors.textDim, fontSize: 14, lineHeight: 20},\n link: {\n color: colors.primary,\n fontSize: 14,\n fontStyle: \"normal\",\n lineHeight: 20,\n textDecorationLine: \"underline\",\n },\n paragraph: {paddingVertical: 0},\n strikethrough: {color: colors.textDim, fontSize: 14, lineHeight: 20},\n strong: {color: colors.foreground, fontSize: 14, fontWeight: \"700\", lineHeight: 20},\n table: {borderColor: colors.border, borderRadius: 8},\n tableCell: {padding: 8},\n text: {color: colors.textDim, fontSize: 14, lineHeight: 20},\n }),\n [colors],\n )\n const markdownTheme = useMemo<NonNullable<useMarkdownHookOptions[\"theme\"]>>(\n () => ({\n colors: {\n background: colors.background,\n border: colors.border,\n code: colors.border,\n link: colors.primary,\n text: colors.textDim,\n },\n }),\n [colors],\n )\n const elements = useMarkdown(markdown, {colorScheme: \"light\", styles: markdownStyles, theme: markdownTheme})\n\n return (\n <View style={styles.changelogMarkdownContent} testID=\"ota-changelog-markdown\">\n {elements}\n </View>\n )\n}\n\nexport function ChangelogList({\n changelogs,\n colors,\n title,\n}: {\n changelogs: MentraLiveOtaController[\"state\"][\"changelogs\"]\n colors: MentraLiveOtaFlowTheme\n title: string\n}) {\n if (changelogs.length === 0) return null\n return (\n <View style={[styles.changelogCard, {borderColor: colors.border}]} testID=\"ota-changelog-card\">\n <Text style={[styles.changelogTitle, {color: colors.foreground}]}>{title}</Text>\n <ScrollView\n contentContainerStyle={styles.changelogContent}\n nestedScrollEnabled\n showsVerticalScrollIndicator\n style={styles.changelogList}\n testID=\"ota-changelog-scroll\">\n {changelogs.map((entry, index) => (\n <View\n key={entry.version}\n style={[\n styles.changelogEntry,\n index > 0 && styles.changelogEntryDivider,\n index > 0 && {borderTopColor: colors.border},\n ]}>\n <Text selectable style={[styles.changelogVersion, {color: colors.foreground}]}>\n {entry.version}\n </Text>\n <ChangelogMarkdown colors={colors} markdown={entry.markdown} />\n </View>\n ))}\n </ScrollView>\n </View>\n )\n}\n\nfunction FlowButton({\n colors,\n disabled = false,\n label,\n onPress,\n secondary = false,\n}: {\n colors: MentraLiveOtaFlowTheme\n disabled?: boolean\n label: string\n onPress: () => void\n secondary?: boolean\n}) {\n return (\n <Pressable\n accessibilityRole=\"button\"\n disabled={disabled}\n onPress={onPress}\n style={({pressed}) => [\n styles.button,\n {\n backgroundColor: secondary ? colors.background : colors.foreground,\n borderColor: secondary ? colors.border : colors.foreground,\n opacity: disabled ? 0.45 : pressed ? 0.75 : 1,\n },\n ]}\n testID={`button-${label}`}>\n <Text style={[styles.buttonText, {color: secondary ? colors.foreground : colors.background}]}>{label}</Text>\n </Pressable>\n )\n}\n\nfunction MentraMark({color}: {color: string}) {\n return (\n <Svg width={33} height={18} viewBox=\"0 0 50 27\" fill=\"none\">\n <Rect y={14.8072} width={11.8457} height={11.8457} fill={color} />\n <Path d=\"M9.36639 0L30.7163 14.8072V26.6529L9.36639 11.8457V0Z\" fill={color} />\n <Path d=\"M28.6501 0L50 14.8072V26.6529L28.6501 11.8457V0Z\" fill={color} />\n </Svg>\n )\n}\n\nfunction FlowIcon({colors, name}: {colors: MentraLiveOtaFlowTheme; name: FlowPageProps[\"icon\"]}) {\n const color = name === \"alert\" || name === \"bluetooth\" ? colors.error : colors.primary\n const glyph =\n name === \"check\" ? \"✓\" : name === \"alert\" ? \"!\" : name === \"settings\" ? \"⚙\" : name === \"bluetooth\" ? \"⌁\" : \"↓\"\n return <Text style={[styles.icon, {color}]}>{glyph}</Text>\n}\n\nconst styles = StyleSheet.create({\n safeArea: {flex: 1},\n header: {\n alignItems: \"center\",\n flexDirection: \"row\",\n height: 48,\n justifyContent: \"space-between\",\n paddingHorizontal: 20,\n },\n page: {flex: 1, paddingBottom: 24, paddingHorizontal: 24},\n centerContent: {alignItems: \"center\", flex: 1, gap: 16, justifyContent: \"center\"},\n topContent: {justifyContent: \"flex-start\", paddingTop: 12},\n actionSpacer: {height: 48},\n actions: {gap: 12},\n icon: {fontSize: 64, fontWeight: \"500\", lineHeight: 72, textAlign: \"center\"},\n title: {fontSize: 20, fontWeight: \"600\", textAlign: \"center\"},\n body: {fontSize: 14, lineHeight: 20, maxWidth: 420, textAlign: \"center\"},\n percent: {fontSize: 30, fontVariant: [\"tabular-nums\"], fontWeight: \"700\"},\n progressTrack: {borderRadius: 4, height: 8, maxWidth: 420, overflow: \"hidden\", width: \"100%\"},\n progressFill: {borderRadius: 4, height: 8},\n changelogCard: {\n borderRadius: 16,\n borderWidth: 1,\n flexShrink: 1,\n gap: 12,\n maxHeight: 300,\n maxWidth: 420,\n padding: 16,\n width: \"100%\",\n },\n changelogTitle: {fontSize: 16, fontWeight: \"700\"},\n changelogList: {flexShrink: 1, maxHeight: 232, width: \"100%\"},\n changelogContent: {gap: 20, paddingBottom: 2},\n changelogEntry: {gap: 8},\n changelogEntryDivider: {borderTopWidth: StyleSheet.hairlineWidth, paddingTop: 20},\n changelogVersion: {fontSize: 14, fontWeight: \"600\"},\n changelogMarkdownContent: {gap: 10},\n button: {\n alignItems: \"center\",\n borderRadius: 50,\n borderWidth: 1,\n justifyContent: \"center\",\n minHeight: 44,\n paddingHorizontal: 20,\n },\n buttonText: {fontSize: 14, fontWeight: \"500\"},\n})\n"]}
@@ -1,2 +1,3 @@
1
1
  export { MentraLiveOtaFlow, type MentraLiveOtaFlowPage, type MentraLiveOtaFlowProps, type MentraLiveOtaFlowTheme, type MentraLiveOtaFlowTranslate, } from "./MentraLiveOtaFlow";
2
+ export { useMentraLiveOta, type MentraLiveOtaController, type MentraLiveOtaError, type MentraLiveOtaErrorCode, type MentraLiveOtaHotspotPhase, type MentraLiveOtaInstallPhase, type MentraLiveOtaReleaseTransition, type MentraLiveOtaScreen, type MentraLiveOtaState, type MentraLiveOtaStep, type MentraLiveOtaTransport, type UseMentraLiveOtaOptions, } from "./useMentraLiveOta";
2
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/react/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,KAAK,qBAAqB,EAC1B,KAAK,sBAAsB,EAC3B,KAAK,sBAAsB,EAC3B,KAAK,0BAA0B,GAChC,MAAM,qBAAqB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/react/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,KAAK,qBAAqB,EAC1B,KAAK,sBAAsB,EAC3B,KAAK,sBAAsB,EAC3B,KAAK,0BAA0B,GAChC,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EACL,gBAAgB,EAChB,KAAK,uBAAuB,EAC5B,KAAK,kBAAkB,EACvB,KAAK,sBAAsB,EAC3B,KAAK,yBAAyB,EAC9B,KAAK,yBAAyB,EAC9B,KAAK,8BAA8B,EACnC,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,KAAK,sBAAsB,EAC3B,KAAK,uBAAuB,GAC7B,MAAM,oBAAoB,CAAA"}
@@ -1,2 +1,3 @@
1
1
  export { MentraLiveOtaFlow, } from "./MentraLiveOtaFlow";
2
+ export { useMentraLiveOta, } from "./useMentraLiveOta";
2
3
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/react/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,GAKlB,MAAM,qBAAqB,CAAA","sourcesContent":["export {\n MentraLiveOtaFlow,\n type MentraLiveOtaFlowPage,\n type MentraLiveOtaFlowProps,\n type MentraLiveOtaFlowTheme,\n type MentraLiveOtaFlowTranslate,\n} from \"./MentraLiveOtaFlow\"\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/react/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,GAKlB,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EACL,gBAAgB,GAYjB,MAAM,oBAAoB,CAAA","sourcesContent":["export {\n MentraLiveOtaFlow,\n type MentraLiveOtaFlowPage,\n type MentraLiveOtaFlowProps,\n type MentraLiveOtaFlowTheme,\n type MentraLiveOtaFlowTranslate,\n} from \"./MentraLiveOtaFlow\"\nexport {\n useMentraLiveOta,\n type MentraLiveOtaController,\n type MentraLiveOtaError,\n type MentraLiveOtaErrorCode,\n type MentraLiveOtaHotspotPhase,\n type MentraLiveOtaInstallPhase,\n type MentraLiveOtaReleaseTransition,\n type MentraLiveOtaScreen,\n type MentraLiveOtaState,\n type MentraLiveOtaStep,\n type MentraLiveOtaTransport,\n type UseMentraLiveOtaOptions,\n} from \"./useMentraLiveOta\"\n"]}
@@ -0,0 +1,84 @@
1
+ import type { ReleaseChangelog } from "../facades/ota";
2
+ export type MentraLiveOtaFlowPage = "check" | "progress";
3
+ export type MentraLiveOtaScreen = "initializing" | "checking" | "finishing" | "update_available" | "battery_required" | "wifi_required" | "up_to_date" | "dev_build" | "check_failed" | "update_info_unavailable" | "starting" | "preparing_hotspot" | "updating" | "restarting" | "verifying" | "complete" | "failed" | "disconnected";
4
+ export type MentraLiveOtaErrorCode = "check_failed" | "update_info_unavailable" | "install_failed" | "bes_restart_required";
5
+ export type MentraLiveOtaError = {
6
+ code: MentraLiveOtaErrorCode;
7
+ message: string;
8
+ };
9
+ export type MentraLiveOtaTransport = "wifi" | "hotspot";
10
+ export type MentraLiveOtaHotspotPhase = "idle" | "downloading" | "starting_hotspot" | "joining_hotspot" | "serving";
11
+ export type MentraLiveOtaInstallPhase = "download" | "install";
12
+ export type MentraLiveOtaStep = "apk" | "mtk" | "bes";
13
+ export type MentraLiveOtaReleaseTransition = {
14
+ /** Current glasses software label. Temporarily backed by the reported ASG app version. */
15
+ fromVersion: string | null;
16
+ /** Exact coordinated release identity for the selected OTA pin. */
17
+ toVersion: string;
18
+ };
19
+ export type MentraLiveOtaState = {
20
+ screen: MentraLiveOtaScreen;
21
+ connected: boolean;
22
+ batteryLevel: number | null;
23
+ transport: MentraLiveOtaTransport | null;
24
+ updateRequired: boolean;
25
+ versionChange: boolean;
26
+ versionChangeConverged: boolean;
27
+ versionChangePhase: "installing" | "restarting" | "verifying" | null;
28
+ wifiConnected: boolean;
29
+ wifiStatusKnown: boolean;
30
+ hotspotSupported: boolean;
31
+ hotspotPhase: MentraLiveOtaHotspotPhase;
32
+ hotspotArtifactPercent: number | null;
33
+ phase: MentraLiveOtaInstallPhase | null;
34
+ step: MentraLiveOtaStep | null;
35
+ currentStep: number | null;
36
+ totalSteps: number | null;
37
+ progress: number | null;
38
+ installingApkOnly: boolean;
39
+ firmwareRestarting: boolean;
40
+ error: MentraLiveOtaError | null;
41
+ canInstall: boolean;
42
+ canRetry: boolean;
43
+ canFinish: boolean;
44
+ canDismiss: boolean;
45
+ canDiscard: boolean;
46
+ canOpenWifiSetup: boolean;
47
+ continueDisabled: boolean;
48
+ /** True only after an approved update session reaches a final no-update check. */
49
+ completedUpdate: boolean;
50
+ /** Release labels for the offered or just-completed coordinated update. */
51
+ releaseTransition: MentraLiveOtaReleaseTransition | null;
52
+ /** Release notes crossed by this update, newest first. Populated on completion. */
53
+ changelogs: ReleaseChangelog[];
54
+ };
55
+ export type UseMentraLiveOtaOptions = {
56
+ /** Entry page. `progress` exists for interrupted-session recovery. */
57
+ initialPage?: MentraLiveOtaFlowPage;
58
+ /** Start Engine's OTA-only projections. Full Engine hosts should pass false. */
59
+ initializeRuntime?: boolean;
60
+ /** Called after the final check or when an optional update is dismissed. */
61
+ onFinished?: () => void;
62
+ /** Host-owned Wi-Fi setup for glasses without hotspot OTA support. */
63
+ onOpenWifiSetup?: () => void;
64
+ /** Lets a host coordinate its connection overlay with OTA firmware restarts. */
65
+ onFirmwareRestartingChange?: (restarting: boolean, progressActive: boolean) => void;
66
+ };
67
+ export type MentraLiveOtaController = {
68
+ state: MentraLiveOtaState;
69
+ check: () => void;
70
+ retryCheck: () => void;
71
+ install: () => void;
72
+ retryInstall: () => void;
73
+ finish: () => void;
74
+ discard: () => void;
75
+ openWifiSetup: () => void;
76
+ };
77
+ export declare const MINIMUM_OTA_BATTERY_LEVEL = 25;
78
+ /**
79
+ * Headless Mentra Live OTA flow. Engine owns checking, hotspot staging,
80
+ * APK/MTK/BES sequencing, restart recovery, retries, and verification; the host
81
+ * renders semantic state and invokes these idempotent actions.
82
+ */
83
+ export declare function useMentraLiveOta(options?: UseMentraLiveOtaOptions): MentraLiveOtaController;
84
+ //# sourceMappingURL=useMentraLiveOta.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useMentraLiveOta.d.ts","sourceRoot":"","sources":["../../src/react/useMentraLiveOta.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,gBAAgB,CAAA;AAGpD,MAAM,MAAM,qBAAqB,GAAG,OAAO,GAAG,UAAU,CAAA;AAExD,MAAM,MAAM,mBAAmB,GAC3B,cAAc,GACd,UAAU,GACV,WAAW,GACX,kBAAkB,GAClB,kBAAkB,GAClB,eAAe,GACf,YAAY,GACZ,WAAW,GACX,cAAc,GACd,yBAAyB,GACzB,UAAU,GACV,mBAAmB,GACnB,UAAU,GACV,YAAY,GACZ,WAAW,GACX,UAAU,GACV,QAAQ,GACR,cAAc,CAAA;AAElB,MAAM,MAAM,sBAAsB,GAC9B,cAAc,GACd,yBAAyB,GACzB,gBAAgB,GAChB,sBAAsB,CAAA;AAE1B,MAAM,MAAM,kBAAkB,GAAG;IAC/B,IAAI,EAAE,sBAAsB,CAAA;IAC5B,OAAO,EAAE,MAAM,CAAA;CAChB,CAAA;AAED,MAAM,MAAM,sBAAsB,GAAG,MAAM,GAAG,SAAS,CAAA;AACvD,MAAM,MAAM,yBAAyB,GAAG,MAAM,GAAG,aAAa,GAAG,kBAAkB,GAAG,iBAAiB,GAAG,SAAS,CAAA;AACnH,MAAM,MAAM,yBAAyB,GAAG,UAAU,GAAG,SAAS,CAAA;AAC9D,MAAM,MAAM,iBAAiB,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,CAAA;AAErD,MAAM,MAAM,8BAA8B,GAAG;IAC3C,0FAA0F;IAC1F,W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