@ovok/native 1.5.6 → 1.6.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 (722) hide show
  1. package/README.md +35 -19
  2. package/android/src/main/AndroidManifest.xml +1 -20
  3. package/app.plugin.js +181 -0
  4. package/lib/commonjs/index.js +5 -104
  5. package/lib/commonjs/index.js.map +1 -1
  6. package/lib/commonjs/modules/auth/delete-account-button/components/delete-account-button.js +2 -0
  7. package/lib/commonjs/modules/auth/delete-account-button/components/delete-account-button.js.map +1 -1
  8. package/lib/commonjs/modules/auth/hooks/use-rate-limit-cooldown.js +23 -0
  9. package/lib/commonjs/modules/auth/hooks/use-rate-limit-cooldown.js.map +1 -0
  10. package/lib/commonjs/modules/auth/hooks/use-session.js +105 -0
  11. package/lib/commonjs/modules/auth/hooks/use-session.js.map +1 -0
  12. package/lib/commonjs/modules/auth/index.js +44 -0
  13. package/lib/commonjs/modules/auth/index.js.map +1 -1
  14. package/lib/commonjs/modules/auth/logout-button/components/logout-button.js +5 -2
  15. package/lib/commonjs/modules/auth/logout-button/components/logout-button.js.map +1 -1
  16. package/lib/commonjs/modules/auth/register/components/form/inputs.js +50 -1
  17. package/lib/commonjs/modules/auth/register/components/form/inputs.js.map +1 -1
  18. package/lib/commonjs/modules/auth/register/components/form/register-button.js +4 -0
  19. package/lib/commonjs/modules/auth/register/components/form/register-button.js.map +1 -1
  20. package/lib/commonjs/modules/auth/register/components/form/register-form-provider.js +6 -0
  21. package/lib/commonjs/modules/auth/register/components/form/register-form-provider.js.map +1 -1
  22. package/lib/commonjs/modules/auth/reset-password/components/form/inputs.js +12 -0
  23. package/lib/commonjs/modules/auth/reset-password/components/form/inputs.js.map +1 -1
  24. package/lib/commonjs/modules/auth/reset-password/components/form/reset-password-button.js +4 -0
  25. package/lib/commonjs/modules/auth/reset-password/components/form/reset-password-button.js.map +1 -1
  26. package/lib/commonjs/modules/auth/reset-password/components/form/reset-password-form-provider.js +7 -1
  27. package/lib/commonjs/modules/auth/reset-password/components/form/reset-password-form-provider.js.map +1 -1
  28. package/lib/commonjs/modules/auth/session/components/session-list.js +82 -0
  29. package/lib/commonjs/modules/auth/session/components/session-list.js.map +1 -0
  30. package/lib/commonjs/modules/auth/session/events.js +19 -0
  31. package/lib/commonjs/modules/auth/session/events.js.map +1 -0
  32. package/lib/commonjs/modules/auth/session/index.js +13 -0
  33. package/lib/commonjs/modules/auth/session/index.js.map +1 -0
  34. package/lib/commonjs/modules/auth/session/types/session-list-props.js +6 -0
  35. package/lib/commonjs/modules/auth/session/types/session-list-props.js.map +1 -0
  36. package/lib/commonjs/modules/auth/sign-in/components/form/inputs.js +26 -0
  37. package/lib/commonjs/modules/auth/sign-in/components/form/inputs.js.map +1 -1
  38. package/lib/commonjs/modules/auth/sign-in/components/form/login-form-provider.js +48 -1
  39. package/lib/commonjs/modules/auth/sign-in/components/form/login-form-provider.js.map +1 -1
  40. package/lib/commonjs/modules/auth/sign-in/components/form/mfa-code-input.js +58 -0
  41. package/lib/commonjs/modules/auth/sign-in/components/form/mfa-code-input.js.map +1 -0
  42. package/lib/commonjs/modules/auth/sign-in/components/form/sign-in-with-email.js +2 -0
  43. package/lib/commonjs/modules/auth/sign-in/components/form/sign-in-with-email.js.map +1 -1
  44. package/lib/commonjs/modules/auth/sign-in/components/form/signin-button.js +13 -5
  45. package/lib/commonjs/modules/auth/sign-in/components/form/signin-button.js.map +1 -1
  46. package/lib/commonjs/modules/auth/types/session.js +2 -0
  47. package/lib/commonjs/modules/auth/types/session.js.map +1 -0
  48. package/lib/commonjs/modules/auth/utils/rate-limit.js +37 -0
  49. package/lib/commonjs/modules/auth/utils/rate-limit.js.map +1 -0
  50. package/lib/commonjs/modules/background-sync/android-bluetooth-foreground-service.js +3 -2
  51. package/lib/commonjs/modules/background-sync/android-bluetooth-foreground-service.js.map +1 -1
  52. package/lib/commonjs/modules/background-sync/background-safe-storage.js +76 -0
  53. package/lib/commonjs/modules/background-sync/background-safe-storage.js.map +1 -0
  54. package/lib/commonjs/modules/background-sync/index.js +11 -0
  55. package/lib/commonjs/modules/background-sync/index.js.map +1 -1
  56. package/lib/commonjs/modules/bt-device/index.js +0 -22
  57. package/lib/commonjs/modules/bt-device/index.js.map +1 -1
  58. package/lib/commonjs/modules/bt-device-instructions/index.js +39 -0
  59. package/lib/commonjs/modules/bt-device-instructions/index.js.map +1 -0
  60. package/lib/commonjs/modules/bt-management/components/android-bluetooth-foreground-service.js +64 -0
  61. package/lib/commonjs/modules/bt-management/components/android-bluetooth-foreground-service.js.map +1 -0
  62. package/lib/commonjs/modules/bt-management/components/bt-provider-child-wrapper.js +94 -26
  63. package/lib/commonjs/modules/bt-management/components/bt-provider-child-wrapper.js.map +1 -1
  64. package/lib/commonjs/modules/bt-management/constants/measurement-field-catalog.js +1 -0
  65. package/lib/commonjs/modules/bt-management/constants/measurement-field-catalog.js.map +1 -1
  66. package/lib/commonjs/modules/bt-management/hooks/runtime-context.js +95 -0
  67. package/lib/commonjs/modules/bt-management/hooks/runtime-context.js.map +1 -0
  68. package/lib/commonjs/modules/bt-management/hooks/use-background-sync.js +51 -0
  69. package/lib/commonjs/modules/bt-management/hooks/use-background-sync.js.map +1 -0
  70. package/lib/commonjs/modules/bt-management/hooks/use-bluetooth-state.js +51 -0
  71. package/lib/commonjs/modules/bt-management/hooks/use-bluetooth-state.js.map +1 -0
  72. package/lib/commonjs/modules/bt-management/hooks/use-device-connection.js +40 -0
  73. package/lib/commonjs/modules/bt-management/hooks/use-device-connection.js.map +1 -0
  74. package/lib/commonjs/modules/bt-management/hooks/use-health-import.js +82 -0
  75. package/lib/commonjs/modules/bt-management/hooks/use-health-import.js.map +1 -0
  76. package/lib/commonjs/modules/bt-management/hooks/use-measurements.js +79 -0
  77. package/lib/commonjs/modules/bt-management/hooks/use-measurements.js.map +1 -0
  78. package/lib/commonjs/modules/bt-management/hooks/use-nearby-devices.js +33 -0
  79. package/lib/commonjs/modules/bt-management/hooks/use-nearby-devices.js.map +1 -0
  80. package/lib/commonjs/modules/bt-management/hooks/use-paired-devices.js +58 -0
  81. package/lib/commonjs/modules/bt-management/hooks/use-paired-devices.js.map +1 -0
  82. package/lib/commonjs/modules/bt-management/hooks/use-scan-control.js +21 -0
  83. package/lib/commonjs/modules/bt-management/hooks/use-scan-control.js.map +1 -0
  84. package/lib/commonjs/modules/bt-management/index.js +154 -0
  85. package/lib/commonjs/modules/bt-management/index.js.map +1 -1
  86. package/lib/commonjs/modules/bt-management/services/background-sync/background-sync-coordinator.js +41 -5
  87. package/lib/commonjs/modules/bt-management/services/background-sync/background-sync-coordinator.js.map +1 -1
  88. package/lib/commonjs/modules/bt-management/services/bt-manager.js +91 -22
  89. package/lib/commonjs/modules/bt-management/services/bt-manager.js.map +1 -1
  90. package/lib/commonjs/modules/bt-management/services/devices/bt-connection-handler.js +59 -0
  91. package/lib/commonjs/modules/bt-management/services/devices/bt-connection-handler.js.map +1 -1
  92. package/lib/commonjs/modules/bt-management/services/devices/bt-managed-device.js +107 -4
  93. package/lib/commonjs/modules/bt-management/services/devices/bt-managed-device.js.map +1 -1
  94. package/lib/commonjs/modules/bt-management/services/devices/custom/custom.device.js +9 -1
  95. package/lib/commonjs/modules/bt-management/services/devices/custom/custom.device.js.map +1 -1
  96. package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.file-transfer.js +1 -0
  97. package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.file-transfer.js.map +1 -1
  98. package/lib/commonjs/modules/bt-management/services/devices/measurement-state-machine.js +5 -3
  99. package/lib/commonjs/modules/bt-management/services/devices/measurement-state-machine.js.map +1 -1
  100. package/lib/commonjs/modules/bt-management/services/devices/spo/spo2.main-services.js +12 -0
  101. package/lib/commonjs/modules/bt-management/services/devices/spo/spo2.main-services.js.map +1 -1
  102. package/lib/commonjs/modules/bt-management/services/push-notification.js +39 -0
  103. package/lib/commonjs/modules/bt-management/services/push-notification.js.map +1 -0
  104. package/lib/commonjs/modules/bt-management/testing/fake-ble-manager.js +132 -0
  105. package/lib/commonjs/modules/bt-management/testing/fake-ble-manager.js.map +1 -0
  106. package/lib/commonjs/modules/bt-management/testing/index.js +28 -0
  107. package/lib/commonjs/modules/bt-management/testing/index.js.map +1 -0
  108. package/lib/commonjs/modules/bt-management/testing/recorded-frames.js +23 -0
  109. package/lib/commonjs/modules/bt-management/testing/recorded-frames.js.map +1 -0
  110. package/lib/commonjs/modules/bt-management/types/bluetooth-error.js +82 -0
  111. package/lib/commonjs/modules/bt-management/types/bluetooth-error.js.map +1 -0
  112. package/lib/commonjs/modules/bt-management/types/device-connection-event.js +6 -0
  113. package/lib/commonjs/modules/bt-management/types/device-connection-event.js.map +1 -0
  114. package/lib/commonjs/modules/bt-management/types/result-policy.js +6 -0
  115. package/lib/commonjs/modules/bt-management/types/result-policy.js.map +1 -0
  116. package/lib/commonjs/modules/bt-management/utils/result-identity.js +63 -0
  117. package/lib/commonjs/modules/bt-management/utils/result-identity.js.map +1 -0
  118. package/lib/commonjs/modules/data-sync/components/android/android-health-connect-authorization-provider.js +20 -5
  119. package/lib/commonjs/modules/data-sync/components/android/android-health-connect-authorization-provider.js.map +1 -1
  120. package/lib/commonjs/modules/data-sync/services/base-health-sync-service.js +29 -4
  121. package/lib/commonjs/modules/data-sync/services/base-health-sync-service.js.map +1 -1
  122. package/lib/commonjs/modules/data-sync/services/managers/data-processor.js +2 -2
  123. package/lib/commonjs/modules/data-sync/services/managers/data-processor.js.map +1 -1
  124. package/lib/commonjs/modules/data-sync/services/managers/sync-progress-manager.js +1 -1
  125. package/lib/commonjs/modules/data-sync/services/managers/sync-progress-manager.js.map +1 -1
  126. package/lib/commonjs/modules/data-sync/utils/generate-observation-entry.js +29 -21
  127. package/lib/commonjs/modules/data-sync/utils/generate-observation-entry.js.map +1 -1
  128. package/lib/commonjs/modules/data-sync/utils/retry-save.js +99 -0
  129. package/lib/commonjs/modules/data-sync/utils/retry-save.js.map +1 -0
  130. package/lib/commonjs/modules/helpers/form-items/form-field.js +2 -0
  131. package/lib/commonjs/modules/helpers/form-items/form-field.js.map +1 -1
  132. package/lib/commonjs/modules/helpers/index.js +23 -4
  133. package/lib/commonjs/modules/helpers/index.js.map +1 -1
  134. package/lib/commonjs/modules/helpers/utils/s-log.js +4 -13
  135. package/lib/commonjs/modules/helpers/utils/s-log.js.map +1 -1
  136. package/lib/commonjs/modules/helpers/utils/sentry-logger.js +27 -17
  137. package/lib/commonjs/modules/helpers/utils/sentry-logger.js.map +1 -1
  138. package/lib/commonjs/modules/helpers/utils/telemetry.js +230 -0
  139. package/lib/commonjs/modules/helpers/utils/telemetry.js.map +1 -0
  140. package/lib/commonjs/modules/image/components/optimized-image.js +31 -6
  141. package/lib/commonjs/modules/image/components/optimized-image.js.map +1 -1
  142. package/lib/commonjs/modules/questionnaire-response-form/components/content/questionnaire-content-error.js +18 -9
  143. package/lib/commonjs/modules/questionnaire-response-form/components/content/questionnaire-content-error.js.map +1 -1
  144. package/lib/commonjs/modules/questionnaire-response-form/components/navigation/questionnaire-navigation-next-button.js +3 -2
  145. package/lib/commonjs/modules/questionnaire-response-form/components/navigation/questionnaire-navigation-next-button.js.map +1 -1
  146. package/lib/commonjs/modules/questionnaire-response-form/components/navigation/questionnaire-navigation-submit-button.js +4 -2
  147. package/lib/commonjs/modules/questionnaire-response-form/components/navigation/questionnaire-navigation-submit-button.js.map +1 -1
  148. package/lib/commonjs/modules/questionnaire-response-form/components/questionnaire-form-provider.js +44 -17
  149. package/lib/commonjs/modules/questionnaire-response-form/components/questionnaire-form-provider.js.map +1 -1
  150. package/lib/commonjs/modules/questionnaire-response-form/components/questionnaire-navigation-provider.js +2 -1
  151. package/lib/commonjs/modules/questionnaire-response-form/components/questionnaire-navigation-provider.js.map +1 -1
  152. package/lib/commonjs/modules/questionnaire-response-form/contexts/questionnaire-navigation-context.js.map +1 -1
  153. package/lib/commonjs/modules/tile/components/task-icon.js +2 -1
  154. package/lib/commonjs/modules/tile/components/task-icon.js.map +1 -1
  155. package/lib/commonjs/modules/tile/constants/measurement-icon-svg.js +4 -1
  156. package/lib/commonjs/modules/tile/constants/measurement-icon-svg.js.map +1 -1
  157. package/lib/commonjs/modules/ui/components/background-sync-setting.js +123 -0
  158. package/lib/commonjs/modules/ui/components/background-sync-setting.js.map +1 -0
  159. package/lib/commonjs/modules/ui/components/bluetooth-state-notice.js +119 -0
  160. package/lib/commonjs/modules/ui/components/bluetooth-state-notice.js.map +1 -0
  161. package/lib/commonjs/modules/ui/components/ecg-strip-viewer.js +175 -0
  162. package/lib/commonjs/modules/ui/components/ecg-strip-viewer.js.map +1 -0
  163. package/lib/commonjs/modules/ui/components/health-import-card.js +141 -0
  164. package/lib/commonjs/modules/ui/components/health-import-card.js.map +1 -0
  165. package/lib/commonjs/modules/ui/components/manual-entry-form.js +136 -0
  166. package/lib/commonjs/modules/ui/components/manual-entry-form.js.map +1 -0
  167. package/lib/commonjs/modules/ui/components/pairing-flow.js +247 -0
  168. package/lib/commonjs/modules/ui/components/pairing-flow.js.map +1 -0
  169. package/lib/commonjs/modules/ui/components/supported-devices-catalog-list.js +107 -0
  170. package/lib/commonjs/modules/ui/components/supported-devices-catalog-list.js.map +1 -0
  171. package/lib/commonjs/modules/ui/components/urine-test-result.js +99 -0
  172. package/lib/commonjs/modules/ui/components/urine-test-result.js.map +1 -0
  173. package/lib/commonjs/modules/ui/index.js +116 -0
  174. package/lib/commonjs/modules/ui/index.js.map +1 -0
  175. package/lib/commonjs/modules/ui/types.js +6 -0
  176. package/lib/commonjs/modules/ui/types.js.map +1 -0
  177. package/lib/commonjs/modules/ui/use-ovok-ui.js +51 -0
  178. package/lib/commonjs/modules/ui/use-ovok-ui.js.map +1 -0
  179. package/lib/module/index.js +3 -9
  180. package/lib/module/index.js.map +1 -1
  181. package/lib/module/modules/auth/delete-account-button/components/delete-account-button.js +2 -0
  182. package/lib/module/modules/auth/delete-account-button/components/delete-account-button.js.map +1 -1
  183. package/lib/module/modules/auth/hooks/use-rate-limit-cooldown.js +17 -0
  184. package/lib/module/modules/auth/hooks/use-rate-limit-cooldown.js.map +1 -0
  185. package/lib/module/modules/auth/hooks/use-session.js +99 -0
  186. package/lib/module/modules/auth/hooks/use-session.js.map +1 -0
  187. package/lib/module/modules/auth/index.js +4 -0
  188. package/lib/module/modules/auth/index.js.map +1 -1
  189. package/lib/module/modules/auth/logout-button/components/logout-button.js +5 -2
  190. package/lib/module/modules/auth/logout-button/components/logout-button.js.map +1 -1
  191. package/lib/module/modules/auth/register/components/form/inputs.js +50 -1
  192. package/lib/module/modules/auth/register/components/form/inputs.js.map +1 -1
  193. package/lib/module/modules/auth/register/components/form/register-button.js +4 -0
  194. package/lib/module/modules/auth/register/components/form/register-button.js.map +1 -1
  195. package/lib/module/modules/auth/register/components/form/register-form-provider.js +6 -0
  196. package/lib/module/modules/auth/register/components/form/register-form-provider.js.map +1 -1
  197. package/lib/module/modules/auth/reset-password/components/form/inputs.js +12 -0
  198. package/lib/module/modules/auth/reset-password/components/form/inputs.js.map +1 -1
  199. package/lib/module/modules/auth/reset-password/components/form/reset-password-button.js +4 -0
  200. package/lib/module/modules/auth/reset-password/components/form/reset-password-button.js.map +1 -1
  201. package/lib/module/modules/auth/reset-password/components/form/reset-password-form-provider.js +7 -1
  202. package/lib/module/modules/auth/reset-password/components/form/reset-password-form-provider.js.map +1 -1
  203. package/lib/module/modules/auth/session/components/session-list.js +76 -0
  204. package/lib/module/modules/auth/session/components/session-list.js.map +1 -0
  205. package/lib/module/modules/auth/session/events.js +13 -0
  206. package/lib/module/modules/auth/session/events.js.map +1 -0
  207. package/lib/module/modules/auth/session/index.js +4 -0
  208. package/lib/module/modules/auth/session/index.js.map +1 -0
  209. package/lib/module/modules/auth/session/types/session-list-props.js +4 -0
  210. package/lib/module/modules/auth/session/types/session-list-props.js.map +1 -0
  211. package/lib/module/modules/auth/sign-in/components/form/inputs.js +26 -0
  212. package/lib/module/modules/auth/sign-in/components/form/inputs.js.map +1 -1
  213. package/lib/module/modules/auth/sign-in/components/form/login-form-provider.js +48 -1
  214. package/lib/module/modules/auth/sign-in/components/form/login-form-provider.js.map +1 -1
  215. package/lib/module/modules/auth/sign-in/components/form/mfa-code-input.js +52 -0
  216. package/lib/module/modules/auth/sign-in/components/form/mfa-code-input.js.map +1 -0
  217. package/lib/module/modules/auth/sign-in/components/form/sign-in-with-email.js +2 -0
  218. package/lib/module/modules/auth/sign-in/components/form/sign-in-with-email.js.map +1 -1
  219. package/lib/module/modules/auth/sign-in/components/form/signin-button.js +13 -5
  220. package/lib/module/modules/auth/sign-in/components/form/signin-button.js.map +1 -1
  221. package/lib/module/modules/auth/types/session.js +2 -0
  222. package/lib/module/modules/auth/types/session.js.map +1 -0
  223. package/lib/module/modules/auth/utils/rate-limit.js +31 -0
  224. package/lib/module/modules/auth/utils/rate-limit.js.map +1 -0
  225. package/lib/module/modules/background-sync/android-bluetooth-foreground-service.js +3 -2
  226. package/lib/module/modules/background-sync/android-bluetooth-foreground-service.js.map +1 -1
  227. package/lib/module/modules/background-sync/background-safe-storage.js +71 -0
  228. package/lib/module/modules/background-sync/background-safe-storage.js.map +1 -0
  229. package/lib/module/modules/background-sync/index.js +1 -0
  230. package/lib/module/modules/background-sync/index.js.map +1 -1
  231. package/lib/module/modules/bt-device/index.js +0 -2
  232. package/lib/module/modules/bt-device/index.js.map +1 -1
  233. package/lib/module/modules/bt-device-instructions/index.js +6 -0
  234. package/lib/module/modules/bt-device-instructions/index.js.map +1 -0
  235. package/lib/module/modules/bt-management/components/android-bluetooth-foreground-service.js +58 -0
  236. package/lib/module/modules/bt-management/components/android-bluetooth-foreground-service.js.map +1 -0
  237. package/lib/module/modules/bt-management/components/bt-provider-child-wrapper.js +94 -26
  238. package/lib/module/modules/bt-management/components/bt-provider-child-wrapper.js.map +1 -1
  239. package/lib/module/modules/bt-management/constants/measurement-field-catalog.js +1 -0
  240. package/lib/module/modules/bt-management/constants/measurement-field-catalog.js.map +1 -1
  241. package/lib/module/modules/bt-management/hooks/runtime-context.js +86 -0
  242. package/lib/module/modules/bt-management/hooks/runtime-context.js.map +1 -0
  243. package/lib/module/modules/bt-management/hooks/use-background-sync.js +45 -0
  244. package/lib/module/modules/bt-management/hooks/use-background-sync.js.map +1 -0
  245. package/lib/module/modules/bt-management/hooks/use-bluetooth-state.js +45 -0
  246. package/lib/module/modules/bt-management/hooks/use-bluetooth-state.js.map +1 -0
  247. package/lib/module/modules/bt-management/hooks/use-device-connection.js +34 -0
  248. package/lib/module/modules/bt-management/hooks/use-device-connection.js.map +1 -0
  249. package/lib/module/modules/bt-management/hooks/use-health-import.js +76 -0
  250. package/lib/module/modules/bt-management/hooks/use-health-import.js.map +1 -0
  251. package/lib/module/modules/bt-management/hooks/use-measurements.js +73 -0
  252. package/lib/module/modules/bt-management/hooks/use-measurements.js.map +1 -0
  253. package/lib/module/modules/bt-management/hooks/use-nearby-devices.js +27 -0
  254. package/lib/module/modules/bt-management/hooks/use-nearby-devices.js.map +1 -0
  255. package/lib/module/modules/bt-management/hooks/use-paired-devices.js +52 -0
  256. package/lib/module/modules/bt-management/hooks/use-paired-devices.js.map +1 -0
  257. package/lib/module/modules/bt-management/hooks/use-scan-control.js +16 -0
  258. package/lib/module/modules/bt-management/hooks/use-scan-control.js.map +1 -0
  259. package/lib/module/modules/bt-management/index.js +14 -0
  260. package/lib/module/modules/bt-management/index.js.map +1 -1
  261. package/lib/module/modules/bt-management/services/background-sync/background-sync-coordinator.js +41 -5
  262. package/lib/module/modules/bt-management/services/background-sync/background-sync-coordinator.js.map +1 -1
  263. package/lib/module/modules/bt-management/services/bt-manager.js +91 -22
  264. package/lib/module/modules/bt-management/services/bt-manager.js.map +1 -1
  265. package/lib/module/modules/bt-management/services/devices/bt-connection-handler.js +59 -0
  266. package/lib/module/modules/bt-management/services/devices/bt-connection-handler.js.map +1 -1
  267. package/lib/module/modules/bt-management/services/devices/bt-managed-device.js +107 -4
  268. package/lib/module/modules/bt-management/services/devices/bt-managed-device.js.map +1 -1
  269. package/lib/module/modules/bt-management/services/devices/custom/custom.device.js +9 -1
  270. package/lib/module/modules/bt-management/services/devices/custom/custom.device.js.map +1 -1
  271. package/lib/module/modules/bt-management/services/devices/lepu/lepu.file-transfer.js +1 -0
  272. package/lib/module/modules/bt-management/services/devices/lepu/lepu.file-transfer.js.map +1 -1
  273. package/lib/module/modules/bt-management/services/devices/measurement-state-machine.js +5 -3
  274. package/lib/module/modules/bt-management/services/devices/measurement-state-machine.js.map +1 -1
  275. package/lib/module/modules/bt-management/services/devices/spo/spo2.main-services.js +12 -0
  276. package/lib/module/modules/bt-management/services/devices/spo/spo2.main-services.js.map +1 -1
  277. package/lib/module/modules/bt-management/services/push-notification.js +34 -0
  278. package/lib/module/modules/bt-management/services/push-notification.js.map +1 -0
  279. package/lib/module/modules/bt-management/testing/fake-ble-manager.js +127 -0
  280. package/lib/module/modules/bt-management/testing/fake-ble-manager.js.map +1 -0
  281. package/lib/module/modules/bt-management/testing/index.js +5 -0
  282. package/lib/module/modules/bt-management/testing/index.js.map +1 -0
  283. package/lib/module/modules/bt-management/testing/recorded-frames.js +17 -0
  284. package/lib/module/modules/bt-management/testing/recorded-frames.js.map +1 -0
  285. package/lib/module/modules/bt-management/types/bluetooth-error.js +76 -0
  286. package/lib/module/modules/bt-management/types/bluetooth-error.js.map +1 -0
  287. package/lib/module/modules/bt-management/types/device-connection-event.js +4 -0
  288. package/lib/module/modules/bt-management/types/device-connection-event.js.map +1 -0
  289. package/lib/module/modules/bt-management/types/result-policy.js +4 -0
  290. package/lib/module/modules/bt-management/types/result-policy.js.map +1 -0
  291. package/lib/module/modules/bt-management/utils/result-identity.js +57 -0
  292. package/lib/module/modules/bt-management/utils/result-identity.js.map +1 -0
  293. package/lib/module/modules/data-sync/components/android/android-health-connect-authorization-provider.js +20 -5
  294. package/lib/module/modules/data-sync/components/android/android-health-connect-authorization-provider.js.map +1 -1
  295. package/lib/module/modules/data-sync/services/base-health-sync-service.js +29 -4
  296. package/lib/module/modules/data-sync/services/base-health-sync-service.js.map +1 -1
  297. package/lib/module/modules/data-sync/services/managers/data-processor.js +2 -2
  298. package/lib/module/modules/data-sync/services/managers/data-processor.js.map +1 -1
  299. package/lib/module/modules/data-sync/services/managers/sync-progress-manager.js +1 -1
  300. package/lib/module/modules/data-sync/services/managers/sync-progress-manager.js.map +1 -1
  301. package/lib/module/modules/data-sync/utils/generate-observation-entry.js +29 -21
  302. package/lib/module/modules/data-sync/utils/generate-observation-entry.js.map +1 -1
  303. package/lib/module/modules/data-sync/utils/retry-save.js +92 -0
  304. package/lib/module/modules/data-sync/utils/retry-save.js.map +1 -0
  305. package/lib/module/modules/helpers/form-items/form-field.js +2 -0
  306. package/lib/module/modules/helpers/form-items/form-field.js.map +1 -1
  307. package/lib/module/modules/helpers/index.js +2 -1
  308. package/lib/module/modules/helpers/index.js.map +1 -1
  309. package/lib/module/modules/helpers/utils/s-log.js +4 -12
  310. package/lib/module/modules/helpers/utils/s-log.js.map +1 -1
  311. package/lib/module/modules/helpers/utils/sentry-logger.js +25 -14
  312. package/lib/module/modules/helpers/utils/sentry-logger.js.map +1 -1
  313. package/lib/module/modules/helpers/utils/telemetry.js +218 -0
  314. package/lib/module/modules/helpers/utils/telemetry.js.map +1 -0
  315. package/lib/module/modules/image/components/optimized-image.js +32 -7
  316. package/lib/module/modules/image/components/optimized-image.js.map +1 -1
  317. package/lib/module/modules/questionnaire-response-form/components/content/questionnaire-content-error.js +20 -11
  318. package/lib/module/modules/questionnaire-response-form/components/content/questionnaire-content-error.js.map +1 -1
  319. package/lib/module/modules/questionnaire-response-form/components/navigation/questionnaire-navigation-next-button.js +3 -2
  320. package/lib/module/modules/questionnaire-response-form/components/navigation/questionnaire-navigation-next-button.js.map +1 -1
  321. package/lib/module/modules/questionnaire-response-form/components/navigation/questionnaire-navigation-submit-button.js +4 -2
  322. package/lib/module/modules/questionnaire-response-form/components/navigation/questionnaire-navigation-submit-button.js.map +1 -1
  323. package/lib/module/modules/questionnaire-response-form/components/questionnaire-form-provider.js +44 -17
  324. package/lib/module/modules/questionnaire-response-form/components/questionnaire-form-provider.js.map +1 -1
  325. package/lib/module/modules/questionnaire-response-form/components/questionnaire-navigation-provider.js +2 -1
  326. package/lib/module/modules/questionnaire-response-form/components/questionnaire-navigation-provider.js.map +1 -1
  327. package/lib/module/modules/questionnaire-response-form/contexts/questionnaire-navigation-context.js.map +1 -1
  328. package/lib/module/modules/tile/components/task-icon.js +2 -1
  329. package/lib/module/modules/tile/components/task-icon.js.map +1 -1
  330. package/lib/module/modules/tile/constants/measurement-icon-svg.js +4 -1
  331. package/lib/module/modules/tile/constants/measurement-icon-svg.js.map +1 -1
  332. package/lib/module/modules/ui/components/background-sync-setting.js +117 -0
  333. package/lib/module/modules/ui/components/background-sync-setting.js.map +1 -0
  334. package/lib/module/modules/ui/components/bluetooth-state-notice.js +113 -0
  335. package/lib/module/modules/ui/components/bluetooth-state-notice.js.map +1 -0
  336. package/lib/module/modules/ui/components/ecg-strip-viewer.js +169 -0
  337. package/lib/module/modules/ui/components/ecg-strip-viewer.js.map +1 -0
  338. package/lib/module/modules/ui/components/health-import-card.js +135 -0
  339. package/lib/module/modules/ui/components/health-import-card.js.map +1 -0
  340. package/lib/module/modules/ui/components/manual-entry-form.js +130 -0
  341. package/lib/module/modules/ui/components/manual-entry-form.js.map +1 -0
  342. package/lib/module/modules/ui/components/pairing-flow.js +241 -0
  343. package/lib/module/modules/ui/components/pairing-flow.js.map +1 -0
  344. package/lib/module/modules/ui/components/supported-devices-catalog-list.js +101 -0
  345. package/lib/module/modules/ui/components/supported-devices-catalog-list.js.map +1 -0
  346. package/lib/module/modules/ui/components/urine-test-result.js +94 -0
  347. package/lib/module/modules/ui/components/urine-test-result.js.map +1 -0
  348. package/lib/module/modules/ui/index.js +13 -0
  349. package/lib/module/modules/ui/index.js.map +1 -0
  350. package/lib/module/modules/ui/types.js +4 -0
  351. package/lib/module/modules/ui/types.js.map +1 -0
  352. package/lib/module/modules/ui/use-ovok-ui.js +45 -0
  353. package/lib/module/modules/ui/use-ovok-ui.js.map +1 -0
  354. package/lib/typescript/commonjs/src/index.d.ts +0 -9
  355. package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
  356. package/lib/typescript/commonjs/src/modules/auth/delete-account-button/components/delete-account-button.d.ts.map +1 -1
  357. package/lib/typescript/commonjs/src/modules/auth/hooks/use-rate-limit-cooldown.d.ts +2 -0
  358. package/lib/typescript/commonjs/src/modules/auth/hooks/use-rate-limit-cooldown.d.ts.map +1 -0
  359. package/lib/typescript/commonjs/src/modules/auth/hooks/use-session.d.ts +16 -0
  360. package/lib/typescript/commonjs/src/modules/auth/hooks/use-session.d.ts.map +1 -0
  361. package/lib/typescript/commonjs/src/modules/auth/index.d.ts +4 -0
  362. package/lib/typescript/commonjs/src/modules/auth/index.d.ts.map +1 -1
  363. package/lib/typescript/commonjs/src/modules/auth/logout-button/components/logout-button.d.ts.map +1 -1
  364. package/lib/typescript/commonjs/src/modules/auth/register/components/form/inputs.d.ts.map +1 -1
  365. package/lib/typescript/commonjs/src/modules/auth/register/components/form/register-button.d.ts.map +1 -1
  366. package/lib/typescript/commonjs/src/modules/auth/register/components/form/register-form-provider.d.ts.map +1 -1
  367. package/lib/typescript/commonjs/src/modules/auth/reset-password/components/form/inputs.d.ts.map +1 -1
  368. package/lib/typescript/commonjs/src/modules/auth/reset-password/components/form/reset-password-button.d.ts.map +1 -1
  369. package/lib/typescript/commonjs/src/modules/auth/reset-password/components/form/reset-password-form-provider.d.ts.map +1 -1
  370. package/lib/typescript/commonjs/src/modules/auth/session/components/session-list.d.ts +4 -0
  371. package/lib/typescript/commonjs/src/modules/auth/session/components/session-list.d.ts.map +1 -0
  372. package/lib/typescript/commonjs/src/modules/auth/session/events.d.ts +5 -0
  373. package/lib/typescript/commonjs/src/modules/auth/session/events.d.ts.map +1 -0
  374. package/lib/typescript/commonjs/src/modules/auth/session/index.d.ts +3 -0
  375. package/lib/typescript/commonjs/src/modules/auth/session/index.d.ts.map +1 -0
  376. package/lib/typescript/commonjs/src/modules/auth/session/types/session-list-props.d.ts +5 -0
  377. package/lib/typescript/commonjs/src/modules/auth/session/types/session-list-props.d.ts.map +1 -0
  378. package/lib/typescript/commonjs/src/modules/auth/sign-in/components/form/inputs.d.ts.map +1 -1
  379. package/lib/typescript/commonjs/src/modules/auth/sign-in/components/form/login-form-provider.d.ts.map +1 -1
  380. package/lib/typescript/commonjs/src/modules/auth/sign-in/components/form/mfa-code-input.d.ts +9 -0
  381. package/lib/typescript/commonjs/src/modules/auth/sign-in/components/form/mfa-code-input.d.ts.map +1 -0
  382. package/lib/typescript/commonjs/src/modules/auth/sign-in/components/form/sign-in-with-email.d.ts +4 -0
  383. package/lib/typescript/commonjs/src/modules/auth/sign-in/components/form/sign-in-with-email.d.ts.map +1 -1
  384. package/lib/typescript/commonjs/src/modules/auth/sign-in/components/form/signin-button.d.ts.map +1 -1
  385. package/lib/typescript/commonjs/src/modules/auth/sign-in/components/sign-in.d.ts +4 -0
  386. package/lib/typescript/commonjs/src/modules/auth/sign-in/components/sign-in.d.ts.map +1 -1
  387. package/lib/typescript/commonjs/src/modules/auth/sign-in/contexts/login-form-context.d.ts +2 -46
  388. package/lib/typescript/commonjs/src/modules/auth/sign-in/contexts/login-form-context.d.ts.map +1 -1
  389. package/lib/typescript/commonjs/src/modules/auth/sign-in/hooks/use-login-form.d.ts +1 -47
  390. package/lib/typescript/commonjs/src/modules/auth/sign-in/hooks/use-login-form.d.ts.map +1 -1
  391. package/lib/typescript/commonjs/src/modules/auth/sign-in/types/login-form-context-type.d.ts +11 -1
  392. package/lib/typescript/commonjs/src/modules/auth/sign-in/types/login-form-context-type.d.ts.map +1 -1
  393. package/lib/typescript/commonjs/src/modules/auth/types/session.d.ts +10 -0
  394. package/lib/typescript/commonjs/src/modules/auth/types/session.d.ts.map +1 -0
  395. package/lib/typescript/commonjs/src/modules/auth/utils/rate-limit.d.ts +11 -0
  396. package/lib/typescript/commonjs/src/modules/auth/utils/rate-limit.d.ts.map +1 -0
  397. package/lib/typescript/commonjs/src/modules/background-sync/android-bluetooth-foreground-service.d.ts.map +1 -1
  398. package/lib/typescript/commonjs/src/modules/background-sync/background-safe-storage.d.ts +31 -0
  399. package/lib/typescript/commonjs/src/modules/background-sync/background-safe-storage.d.ts.map +1 -0
  400. package/lib/typescript/commonjs/src/modules/background-sync/index.d.ts +1 -0
  401. package/lib/typescript/commonjs/src/modules/background-sync/index.d.ts.map +1 -1
  402. package/lib/typescript/commonjs/src/modules/bt-device/index.d.ts +0 -2
  403. package/lib/typescript/commonjs/src/modules/bt-device/index.d.ts.map +1 -1
  404. package/lib/typescript/commonjs/src/modules/bt-device-instructions/index.d.ts +4 -0
  405. package/lib/typescript/commonjs/src/modules/bt-device-instructions/index.d.ts.map +1 -0
  406. package/lib/typescript/commonjs/src/modules/bt-management/components/android-bluetooth-foreground-service.d.ts +14 -0
  407. package/lib/typescript/commonjs/src/modules/bt-management/components/android-bluetooth-foreground-service.d.ts.map +1 -0
  408. package/lib/typescript/commonjs/src/modules/bt-management/components/bt-provider-child-wrapper.d.ts.map +1 -1
  409. package/lib/typescript/commonjs/src/modules/bt-management/constants/measurement-field-catalog.d.ts.map +1 -1
  410. package/lib/typescript/commonjs/src/modules/bt-management/hooks/runtime-context.d.ts +48 -0
  411. package/lib/typescript/commonjs/src/modules/bt-management/hooks/runtime-context.d.ts.map +1 -0
  412. package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-background-sync.d.ts +14 -0
  413. package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-background-sync.d.ts.map +1 -0
  414. package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-bluetooth-state.d.ts +11 -0
  415. package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-bluetooth-state.d.ts.map +1 -0
  416. package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-device-connection.d.ts +7 -0
  417. package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-device-connection.d.ts.map +1 -0
  418. package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-health-import.d.ts +16 -0
  419. package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-health-import.d.ts.map +1 -0
  420. package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-measurements.d.ts +11 -0
  421. package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-measurements.d.ts.map +1 -0
  422. package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-nearby-devices.d.ts +8 -0
  423. package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-nearby-devices.d.ts.map +1 -0
  424. package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-paired-devices.d.ts +16 -0
  425. package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-paired-devices.d.ts.map +1 -0
  426. package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-scan-control.d.ts +7 -0
  427. package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-scan-control.d.ts.map +1 -0
  428. package/lib/typescript/commonjs/src/modules/bt-management/index.d.ts +14 -0
  429. package/lib/typescript/commonjs/src/modules/bt-management/index.d.ts.map +1 -1
  430. package/lib/typescript/commonjs/src/modules/bt-management/services/background-sync/background-sync-coordinator.d.ts.map +1 -1
  431. package/lib/typescript/commonjs/src/modules/bt-management/services/bt-manager.d.ts +22 -0
  432. package/lib/typescript/commonjs/src/modules/bt-management/services/bt-manager.d.ts.map +1 -1
  433. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-connection-handler.d.ts +4 -0
  434. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-connection-handler.d.ts.map +1 -1
  435. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-managed-device.d.ts +10 -1
  436. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-managed-device.d.ts.map +1 -1
  437. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/custom/custom.device.d.ts.map +1 -1
  438. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.file-transfer.d.ts +1 -0
  439. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.file-transfer.d.ts.map +1 -1
  440. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/measurement-state-machine.d.ts +3 -2
  441. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/measurement-state-machine.d.ts.map +1 -1
  442. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/spo/spo2.main-services.d.ts.map +1 -1
  443. package/lib/typescript/commonjs/src/modules/bt-management/services/push-notification.d.ts +8 -0
  444. package/lib/typescript/commonjs/src/modules/bt-management/services/push-notification.d.ts.map +1 -0
  445. package/lib/typescript/commonjs/src/modules/bt-management/testing/fake-ble-manager.d.ts +33 -0
  446. package/lib/typescript/commonjs/src/modules/bt-management/testing/fake-ble-manager.d.ts.map +1 -0
  447. package/lib/typescript/commonjs/src/modules/bt-management/testing/index.d.ts +3 -0
  448. package/lib/typescript/commonjs/src/modules/bt-management/testing/index.d.ts.map +1 -0
  449. package/lib/typescript/commonjs/src/modules/bt-management/testing/recorded-frames.d.ts +12 -0
  450. package/lib/typescript/commonjs/src/modules/bt-management/testing/recorded-frames.d.ts.map +1 -0
  451. package/lib/typescript/commonjs/src/modules/bt-management/types/background-sync.d.ts +3 -1
  452. package/lib/typescript/commonjs/src/modules/bt-management/types/background-sync.d.ts.map +1 -1
  453. package/lib/typescript/commonjs/src/modules/bt-management/types/bluetooth-error.d.ts +23 -0
  454. package/lib/typescript/commonjs/src/modules/bt-management/types/bluetooth-error.d.ts.map +1 -0
  455. package/lib/typescript/commonjs/src/modules/bt-management/types/btprovider-children-props.d.ts +4 -0
  456. package/lib/typescript/commonjs/src/modules/bt-management/types/btprovider-children-props.d.ts.map +1 -1
  457. package/lib/typescript/commonjs/src/modules/bt-management/types/command-sequencer.d.ts +2 -0
  458. package/lib/typescript/commonjs/src/modules/bt-management/types/command-sequencer.d.ts.map +1 -1
  459. package/lib/typescript/commonjs/src/modules/bt-management/types/create-device-params.d.ts +4 -0
  460. package/lib/typescript/commonjs/src/modules/bt-management/types/create-device-params.d.ts.map +1 -1
  461. package/lib/typescript/commonjs/src/modules/bt-management/types/device-connection-event.d.ts +16 -0
  462. package/lib/typescript/commonjs/src/modules/bt-management/types/device-connection-event.d.ts.map +1 -0
  463. package/lib/typescript/commonjs/src/modules/bt-management/types/error-callback.d.ts +5 -2
  464. package/lib/typescript/commonjs/src/modules/bt-management/types/error-callback.d.ts.map +1 -1
  465. package/lib/typescript/commonjs/src/modules/bt-management/types/i-bt-managed-device.d.ts +1 -0
  466. package/lib/typescript/commonjs/src/modules/bt-management/types/i-bt-managed-device.d.ts.map +1 -1
  467. package/lib/typescript/commonjs/src/modules/bt-management/types/result-callback.d.ts +2 -0
  468. package/lib/typescript/commonjs/src/modules/bt-management/types/result-callback.d.ts.map +1 -1
  469. package/lib/typescript/commonjs/src/modules/bt-management/types/result-policy.d.ts +8 -0
  470. package/lib/typescript/commonjs/src/modules/bt-management/types/result-policy.d.ts.map +1 -0
  471. package/lib/typescript/commonjs/src/modules/bt-management/utils/result-identity.d.ts +10 -0
  472. package/lib/typescript/commonjs/src/modules/bt-management/utils/result-identity.d.ts.map +1 -0
  473. package/lib/typescript/commonjs/src/modules/data-sync/components/android/android-health-connect-authorization-provider.d.ts.map +1 -1
  474. package/lib/typescript/commonjs/src/modules/data-sync/services/base-health-sync-service.d.ts.map +1 -1
  475. package/lib/typescript/commonjs/src/modules/data-sync/services/managers/data-processor.d.ts +4 -0
  476. package/lib/typescript/commonjs/src/modules/data-sync/services/managers/data-processor.d.ts.map +1 -1
  477. package/lib/typescript/commonjs/src/modules/data-sync/services/managers/sync-progress-manager.d.ts +1 -1
  478. package/lib/typescript/commonjs/src/modules/data-sync/types/health-authorization-status.d.ts +2 -0
  479. package/lib/typescript/commonjs/src/modules/data-sync/types/health-authorization-status.d.ts.map +1 -1
  480. package/lib/typescript/commonjs/src/modules/data-sync/types/sync-progress.d.ts +1 -1
  481. package/lib/typescript/commonjs/src/modules/data-sync/types/sync-progress.d.ts.map +1 -1
  482. package/lib/typescript/commonjs/src/modules/data-sync/utils/generate-observation-entry.d.ts.map +1 -1
  483. package/lib/typescript/commonjs/src/modules/data-sync/utils/retry-save.d.ts +6 -0
  484. package/lib/typescript/commonjs/src/modules/data-sync/utils/retry-save.d.ts.map +1 -0
  485. package/lib/typescript/commonjs/src/modules/helpers/form-items/form-field.d.ts +4 -1
  486. package/lib/typescript/commonjs/src/modules/helpers/form-items/form-field.d.ts.map +1 -1
  487. package/lib/typescript/commonjs/src/modules/helpers/index.d.ts +2 -1
  488. package/lib/typescript/commonjs/src/modules/helpers/index.d.ts.map +1 -1
  489. package/lib/typescript/commonjs/src/modules/helpers/utils/s-log.d.ts.map +1 -1
  490. package/lib/typescript/commonjs/src/modules/helpers/utils/sentry-logger.d.ts +7 -1
  491. package/lib/typescript/commonjs/src/modules/helpers/utils/sentry-logger.d.ts.map +1 -1
  492. package/lib/typescript/commonjs/src/modules/helpers/utils/telemetry.d.ts +69 -0
  493. package/lib/typescript/commonjs/src/modules/helpers/utils/telemetry.d.ts.map +1 -0
  494. package/lib/typescript/commonjs/src/modules/image/components/optimized-image.d.ts +1 -1
  495. package/lib/typescript/commonjs/src/modules/image/components/optimized-image.d.ts.map +1 -1
  496. package/lib/typescript/commonjs/src/modules/image/types/optimized-image-props.d.ts +4 -0
  497. package/lib/typescript/commonjs/src/modules/image/types/optimized-image-props.d.ts.map +1 -1
  498. package/lib/typescript/commonjs/src/modules/questionnaire-response-form/components/content/questionnaire-content-error.d.ts.map +1 -1
  499. package/lib/typescript/commonjs/src/modules/questionnaire-response-form/components/navigation/questionnaire-navigation-next-button.d.ts.map +1 -1
  500. package/lib/typescript/commonjs/src/modules/questionnaire-response-form/components/navigation/questionnaire-navigation-submit-button.d.ts.map +1 -1
  501. package/lib/typescript/commonjs/src/modules/questionnaire-response-form/components/questionnaire-form-provider.d.ts.map +1 -1
  502. package/lib/typescript/commonjs/src/modules/questionnaire-response-form/components/questionnaire-navigation-provider.d.ts.map +1 -1
  503. package/lib/typescript/commonjs/src/modules/questionnaire-response-form/contexts/questionnaire-navigation-context.d.ts +1 -0
  504. package/lib/typescript/commonjs/src/modules/questionnaire-response-form/contexts/questionnaire-navigation-context.d.ts.map +1 -1
  505. package/lib/typescript/commonjs/src/modules/questionnaire-response-form/hooks/use-navigation-handlers.d.ts +1 -0
  506. package/lib/typescript/commonjs/src/modules/questionnaire-response-form/hooks/use-navigation-handlers.d.ts.map +1 -1
  507. package/lib/typescript/commonjs/src/modules/questionnaire-response-form/hooks/use-questionnaire-navigation.d.ts +1 -0
  508. package/lib/typescript/commonjs/src/modules/questionnaire-response-form/hooks/use-questionnaire-navigation.d.ts.map +1 -1
  509. package/lib/typescript/commonjs/src/modules/questionnaire-response-form/types/questionnaire-form-context-type.d.ts +2 -0
  510. package/lib/typescript/commonjs/src/modules/questionnaire-response-form/types/questionnaire-form-context-type.d.ts.map +1 -1
  511. package/lib/typescript/commonjs/src/modules/questionnaire-response-form/types/questionnaire-navigation-provider-props.d.ts +1 -0
  512. package/lib/typescript/commonjs/src/modules/questionnaire-response-form/types/questionnaire-navigation-provider-props.d.ts.map +1 -1
  513. package/lib/typescript/commonjs/src/modules/tile/components/task-icon.d.ts.map +1 -1
  514. package/lib/typescript/commonjs/src/modules/tile/constants/measurement-icon-svg.d.ts +1 -0
  515. package/lib/typescript/commonjs/src/modules/tile/constants/measurement-icon-svg.d.ts.map +1 -1
  516. package/lib/typescript/commonjs/src/modules/ui/components/background-sync-setting.d.ts +9 -0
  517. package/lib/typescript/commonjs/src/modules/ui/components/background-sync-setting.d.ts.map +1 -0
  518. package/lib/typescript/commonjs/src/modules/ui/components/bluetooth-state-notice.d.ts +12 -0
  519. package/lib/typescript/commonjs/src/modules/ui/components/bluetooth-state-notice.d.ts.map +1 -0
  520. package/lib/typescript/commonjs/src/modules/ui/components/ecg-strip-viewer.d.ts +17 -0
  521. package/lib/typescript/commonjs/src/modules/ui/components/ecg-strip-viewer.d.ts.map +1 -0
  522. package/lib/typescript/commonjs/src/modules/ui/components/health-import-card.d.ts +13 -0
  523. package/lib/typescript/commonjs/src/modules/ui/components/health-import-card.d.ts.map +1 -0
  524. package/lib/typescript/commonjs/src/modules/ui/components/manual-entry-form.d.ts +21 -0
  525. package/lib/typescript/commonjs/src/modules/ui/components/manual-entry-form.d.ts.map +1 -0
  526. package/lib/typescript/commonjs/src/modules/ui/components/pairing-flow.d.ts +15 -0
  527. package/lib/typescript/commonjs/src/modules/ui/components/pairing-flow.d.ts.map +1 -0
  528. package/lib/typescript/commonjs/src/modules/ui/components/supported-devices-catalog-list.d.ts +16 -0
  529. package/lib/typescript/commonjs/src/modules/ui/components/supported-devices-catalog-list.d.ts.map +1 -0
  530. package/lib/typescript/commonjs/src/modules/ui/components/urine-test-result.d.ts +10 -0
  531. package/lib/typescript/commonjs/src/modules/ui/components/urine-test-result.d.ts.map +1 -0
  532. package/lib/typescript/commonjs/src/modules/ui/index.d.ts +11 -0
  533. package/lib/typescript/commonjs/src/modules/ui/index.d.ts.map +1 -0
  534. package/lib/typescript/commonjs/src/modules/ui/types.d.ts +24 -0
  535. package/lib/typescript/commonjs/src/modules/ui/types.d.ts.map +1 -0
  536. package/lib/typescript/commonjs/src/modules/ui/use-ovok-ui.d.ts +7 -0
  537. package/lib/typescript/commonjs/src/modules/ui/use-ovok-ui.d.ts.map +1 -0
  538. package/lib/typescript/module/src/index.d.ts +0 -9
  539. package/lib/typescript/module/src/index.d.ts.map +1 -1
  540. package/lib/typescript/module/src/modules/auth/delete-account-button/components/delete-account-button.d.ts.map +1 -1
  541. package/lib/typescript/module/src/modules/auth/hooks/use-rate-limit-cooldown.d.ts +2 -0
  542. package/lib/typescript/module/src/modules/auth/hooks/use-rate-limit-cooldown.d.ts.map +1 -0
  543. package/lib/typescript/module/src/modules/auth/hooks/use-session.d.ts +16 -0
  544. package/lib/typescript/module/src/modules/auth/hooks/use-session.d.ts.map +1 -0
  545. package/lib/typescript/module/src/modules/auth/index.d.ts +4 -0
  546. package/lib/typescript/module/src/modules/auth/index.d.ts.map +1 -1
  547. package/lib/typescript/module/src/modules/auth/logout-button/components/logout-button.d.ts.map +1 -1
  548. package/lib/typescript/module/src/modules/auth/register/components/form/inputs.d.ts.map +1 -1
  549. package/lib/typescript/module/src/modules/auth/register/components/form/register-button.d.ts.map +1 -1
  550. package/lib/typescript/module/src/modules/auth/register/components/form/register-form-provider.d.ts.map +1 -1
  551. package/lib/typescript/module/src/modules/auth/reset-password/components/form/inputs.d.ts.map +1 -1
  552. package/lib/typescript/module/src/modules/auth/reset-password/components/form/reset-password-button.d.ts.map +1 -1
  553. package/lib/typescript/module/src/modules/auth/reset-password/components/form/reset-password-form-provider.d.ts.map +1 -1
  554. package/lib/typescript/module/src/modules/auth/session/components/session-list.d.ts +4 -0
  555. package/lib/typescript/module/src/modules/auth/session/components/session-list.d.ts.map +1 -0
  556. package/lib/typescript/module/src/modules/auth/session/events.d.ts +5 -0
  557. package/lib/typescript/module/src/modules/auth/session/events.d.ts.map +1 -0
  558. package/lib/typescript/module/src/modules/auth/session/index.d.ts +3 -0
  559. package/lib/typescript/module/src/modules/auth/session/index.d.ts.map +1 -0
  560. package/lib/typescript/module/src/modules/auth/session/types/session-list-props.d.ts +5 -0
  561. package/lib/typescript/module/src/modules/auth/session/types/session-list-props.d.ts.map +1 -0
  562. package/lib/typescript/module/src/modules/auth/sign-in/components/form/inputs.d.ts.map +1 -1
  563. package/lib/typescript/module/src/modules/auth/sign-in/components/form/login-form-provider.d.ts.map +1 -1
  564. package/lib/typescript/module/src/modules/auth/sign-in/components/form/mfa-code-input.d.ts +9 -0
  565. package/lib/typescript/module/src/modules/auth/sign-in/components/form/mfa-code-input.d.ts.map +1 -0
  566. package/lib/typescript/module/src/modules/auth/sign-in/components/form/sign-in-with-email.d.ts +4 -0
  567. package/lib/typescript/module/src/modules/auth/sign-in/components/form/sign-in-with-email.d.ts.map +1 -1
  568. package/lib/typescript/module/src/modules/auth/sign-in/components/form/signin-button.d.ts.map +1 -1
  569. package/lib/typescript/module/src/modules/auth/sign-in/components/sign-in.d.ts +4 -0
  570. package/lib/typescript/module/src/modules/auth/sign-in/components/sign-in.d.ts.map +1 -1
  571. package/lib/typescript/module/src/modules/auth/sign-in/contexts/login-form-context.d.ts +2 -46
  572. package/lib/typescript/module/src/modules/auth/sign-in/contexts/login-form-context.d.ts.map +1 -1
  573. package/lib/typescript/module/src/modules/auth/sign-in/hooks/use-login-form.d.ts +1 -47
  574. package/lib/typescript/module/src/modules/auth/sign-in/hooks/use-login-form.d.ts.map +1 -1
  575. package/lib/typescript/module/src/modules/auth/sign-in/types/login-form-context-type.d.ts +11 -1
  576. package/lib/typescript/module/src/modules/auth/sign-in/types/login-form-context-type.d.ts.map +1 -1
  577. package/lib/typescript/module/src/modules/auth/types/session.d.ts +10 -0
  578. package/lib/typescript/module/src/modules/auth/types/session.d.ts.map +1 -0
  579. package/lib/typescript/module/src/modules/auth/utils/rate-limit.d.ts +11 -0
  580. package/lib/typescript/module/src/modules/auth/utils/rate-limit.d.ts.map +1 -0
  581. package/lib/typescript/module/src/modules/background-sync/android-bluetooth-foreground-service.d.ts.map +1 -1
  582. package/lib/typescript/module/src/modules/background-sync/background-safe-storage.d.ts +31 -0
  583. package/lib/typescript/module/src/modules/background-sync/background-safe-storage.d.ts.map +1 -0
  584. package/lib/typescript/module/src/modules/background-sync/index.d.ts +1 -0
  585. package/lib/typescript/module/src/modules/background-sync/index.d.ts.map +1 -1
  586. package/lib/typescript/module/src/modules/bt-device/index.d.ts +0 -2
  587. package/lib/typescript/module/src/modules/bt-device/index.d.ts.map +1 -1
  588. package/lib/typescript/module/src/modules/bt-device-instructions/index.d.ts +4 -0
  589. package/lib/typescript/module/src/modules/bt-device-instructions/index.d.ts.map +1 -0
  590. package/lib/typescript/module/src/modules/bt-management/components/android-bluetooth-foreground-service.d.ts +14 -0
  591. package/lib/typescript/module/src/modules/bt-management/components/android-bluetooth-foreground-service.d.ts.map +1 -0
  592. package/lib/typescript/module/src/modules/bt-management/components/bt-provider-child-wrapper.d.ts.map +1 -1
  593. package/lib/typescript/module/src/modules/bt-management/constants/measurement-field-catalog.d.ts.map +1 -1
  594. package/lib/typescript/module/src/modules/bt-management/hooks/runtime-context.d.ts +48 -0
  595. package/lib/typescript/module/src/modules/bt-management/hooks/runtime-context.d.ts.map +1 -0
  596. package/lib/typescript/module/src/modules/bt-management/hooks/use-background-sync.d.ts +14 -0
  597. package/lib/typescript/module/src/modules/bt-management/hooks/use-background-sync.d.ts.map +1 -0
  598. package/lib/typescript/module/src/modules/bt-management/hooks/use-bluetooth-state.d.ts +11 -0
  599. package/lib/typescript/module/src/modules/bt-management/hooks/use-bluetooth-state.d.ts.map +1 -0
  600. package/lib/typescript/module/src/modules/bt-management/hooks/use-device-connection.d.ts +7 -0
  601. package/lib/typescript/module/src/modules/bt-management/hooks/use-device-connection.d.ts.map +1 -0
  602. package/lib/typescript/module/src/modules/bt-management/hooks/use-health-import.d.ts +16 -0
  603. package/lib/typescript/module/src/modules/bt-management/hooks/use-health-import.d.ts.map +1 -0
  604. package/lib/typescript/module/src/modules/bt-management/hooks/use-measurements.d.ts +11 -0
  605. package/lib/typescript/module/src/modules/bt-management/hooks/use-measurements.d.ts.map +1 -0
  606. package/lib/typescript/module/src/modules/bt-management/hooks/use-nearby-devices.d.ts +8 -0
  607. package/lib/typescript/module/src/modules/bt-management/hooks/use-nearby-devices.d.ts.map +1 -0
  608. package/lib/typescript/module/src/modules/bt-management/hooks/use-paired-devices.d.ts +16 -0
  609. package/lib/typescript/module/src/modules/bt-management/hooks/use-paired-devices.d.ts.map +1 -0
  610. package/lib/typescript/module/src/modules/bt-management/hooks/use-scan-control.d.ts +7 -0
  611. package/lib/typescript/module/src/modules/bt-management/hooks/use-scan-control.d.ts.map +1 -0
  612. package/lib/typescript/module/src/modules/bt-management/index.d.ts +14 -0
  613. package/lib/typescript/module/src/modules/bt-management/index.d.ts.map +1 -1
  614. package/lib/typescript/module/src/modules/bt-management/services/background-sync/background-sync-coordinator.d.ts.map +1 -1
  615. package/lib/typescript/module/src/modules/bt-management/services/bt-manager.d.ts +22 -0
  616. package/lib/typescript/module/src/modules/bt-management/services/bt-manager.d.ts.map +1 -1
  617. package/lib/typescript/module/src/modules/bt-management/services/devices/bt-connection-handler.d.ts +4 -0
  618. package/lib/typescript/module/src/modules/bt-management/services/devices/bt-connection-handler.d.ts.map +1 -1
  619. package/lib/typescript/module/src/modules/bt-management/services/devices/bt-managed-device.d.ts +10 -1
  620. package/lib/typescript/module/src/modules/bt-management/services/devices/bt-managed-device.d.ts.map +1 -1
  621. package/lib/typescript/module/src/modules/bt-management/services/devices/custom/custom.device.d.ts.map +1 -1
  622. package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.file-transfer.d.ts +1 -0
  623. package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.file-transfer.d.ts.map +1 -1
  624. package/lib/typescript/module/src/modules/bt-management/services/devices/measurement-state-machine.d.ts +3 -2
  625. package/lib/typescript/module/src/modules/bt-management/services/devices/measurement-state-machine.d.ts.map +1 -1
  626. package/lib/typescript/module/src/modules/bt-management/services/devices/spo/spo2.main-services.d.ts.map +1 -1
  627. package/lib/typescript/module/src/modules/bt-management/services/push-notification.d.ts +8 -0
  628. package/lib/typescript/module/src/modules/bt-management/services/push-notification.d.ts.map +1 -0
  629. package/lib/typescript/module/src/modules/bt-management/testing/fake-ble-manager.d.ts +33 -0
  630. package/lib/typescript/module/src/modules/bt-management/testing/fake-ble-manager.d.ts.map +1 -0
  631. package/lib/typescript/module/src/modules/bt-management/testing/index.d.ts +3 -0
  632. package/lib/typescript/module/src/modules/bt-management/testing/index.d.ts.map +1 -0
  633. package/lib/typescript/module/src/modules/bt-management/testing/recorded-frames.d.ts +12 -0
  634. package/lib/typescript/module/src/modules/bt-management/testing/recorded-frames.d.ts.map +1 -0
  635. package/lib/typescript/module/src/modules/bt-management/types/background-sync.d.ts +3 -1
  636. package/lib/typescript/module/src/modules/bt-management/types/background-sync.d.ts.map +1 -1
  637. package/lib/typescript/module/src/modules/bt-management/types/bluetooth-error.d.ts +23 -0
  638. package/lib/typescript/module/src/modules/bt-management/types/bluetooth-error.d.ts.map +1 -0
  639. package/lib/typescript/module/src/modules/bt-management/types/btprovider-children-props.d.ts +4 -0
  640. package/lib/typescript/module/src/modules/bt-management/types/btprovider-children-props.d.ts.map +1 -1
  641. package/lib/typescript/module/src/modules/bt-management/types/command-sequencer.d.ts +2 -0
  642. package/lib/typescript/module/src/modules/bt-management/types/command-sequencer.d.ts.map +1 -1
  643. package/lib/typescript/module/src/modules/bt-management/types/create-device-params.d.ts +4 -0
  644. package/lib/typescript/module/src/modules/bt-management/types/create-device-params.d.ts.map +1 -1
  645. package/lib/typescript/module/src/modules/bt-management/types/device-connection-event.d.ts +16 -0
  646. package/lib/typescript/module/src/modules/bt-management/types/device-connection-event.d.ts.map +1 -0
  647. package/lib/typescript/module/src/modules/bt-management/types/error-callback.d.ts +5 -2
  648. package/lib/typescript/module/src/modules/bt-management/types/error-callback.d.ts.map +1 -1
  649. package/lib/typescript/module/src/modules/bt-management/types/i-bt-managed-device.d.ts +1 -0
  650. package/lib/typescript/module/src/modules/bt-management/types/i-bt-managed-device.d.ts.map +1 -1
  651. package/lib/typescript/module/src/modules/bt-management/types/result-callback.d.ts +2 -0
  652. package/lib/typescript/module/src/modules/bt-management/types/result-callback.d.ts.map +1 -1
  653. package/lib/typescript/module/src/modules/bt-management/types/result-policy.d.ts +8 -0
  654. package/lib/typescript/module/src/modules/bt-management/types/result-policy.d.ts.map +1 -0
  655. package/lib/typescript/module/src/modules/bt-management/utils/result-identity.d.ts +10 -0
  656. package/lib/typescript/module/src/modules/bt-management/utils/result-identity.d.ts.map +1 -0
  657. package/lib/typescript/module/src/modules/data-sync/components/android/android-health-connect-authorization-provider.d.ts.map +1 -1
  658. package/lib/typescript/module/src/modules/data-sync/services/base-health-sync-service.d.ts.map +1 -1
  659. package/lib/typescript/module/src/modules/data-sync/services/managers/data-processor.d.ts +4 -0
  660. package/lib/typescript/module/src/modules/data-sync/services/managers/data-processor.d.ts.map +1 -1
  661. package/lib/typescript/module/src/modules/data-sync/services/managers/sync-progress-manager.d.ts +1 -1
  662. package/lib/typescript/module/src/modules/data-sync/types/health-authorization-status.d.ts +2 -0
  663. package/lib/typescript/module/src/modules/data-sync/types/health-authorization-status.d.ts.map +1 -1
  664. package/lib/typescript/module/src/modules/data-sync/types/sync-progress.d.ts +1 -1
  665. package/lib/typescript/module/src/modules/data-sync/types/sync-progress.d.ts.map +1 -1
  666. package/lib/typescript/module/src/modules/data-sync/utils/generate-observation-entry.d.ts.map +1 -1
  667. package/lib/typescript/module/src/modules/data-sync/utils/retry-save.d.ts +6 -0
  668. package/lib/typescript/module/src/modules/data-sync/utils/retry-save.d.ts.map +1 -0
  669. package/lib/typescript/module/src/modules/helpers/form-items/form-field.d.ts +4 -1
  670. package/lib/typescript/module/src/modules/helpers/form-items/form-field.d.ts.map +1 -1
  671. package/lib/typescript/module/src/modules/helpers/index.d.ts +2 -1
  672. package/lib/typescript/module/src/modules/helpers/index.d.ts.map +1 -1
  673. package/lib/typescript/module/src/modules/helpers/utils/s-log.d.ts.map +1 -1
  674. package/lib/typescript/module/src/modules/helpers/utils/sentry-logger.d.ts +7 -1
  675. package/lib/typescript/module/src/modules/helpers/utils/sentry-logger.d.ts.map +1 -1
  676. package/lib/typescript/module/src/modules/helpers/utils/telemetry.d.ts +69 -0
  677. package/lib/typescript/module/src/modules/helpers/utils/telemetry.d.ts.map +1 -0
  678. package/lib/typescript/module/src/modules/image/components/optimized-image.d.ts +1 -1
  679. package/lib/typescript/module/src/modules/image/components/optimized-image.d.ts.map +1 -1
  680. package/lib/typescript/module/src/modules/image/types/optimized-image-props.d.ts +4 -0
  681. package/lib/typescript/module/src/modules/image/types/optimized-image-props.d.ts.map +1 -1
  682. package/lib/typescript/module/src/modules/questionnaire-response-form/components/content/questionnaire-content-error.d.ts.map +1 -1
  683. package/lib/typescript/module/src/modules/questionnaire-response-form/components/navigation/questionnaire-navigation-next-button.d.ts.map +1 -1
  684. package/lib/typescript/module/src/modules/questionnaire-response-form/components/navigation/questionnaire-navigation-submit-button.d.ts.map +1 -1
  685. package/lib/typescript/module/src/modules/questionnaire-response-form/components/questionnaire-form-provider.d.ts.map +1 -1
  686. package/lib/typescript/module/src/modules/questionnaire-response-form/components/questionnaire-navigation-provider.d.ts.map +1 -1
  687. package/lib/typescript/module/src/modules/questionnaire-response-form/contexts/questionnaire-navigation-context.d.ts +1 -0
  688. package/lib/typescript/module/src/modules/questionnaire-response-form/contexts/questionnaire-navigation-context.d.ts.map +1 -1
  689. package/lib/typescript/module/src/modules/questionnaire-response-form/hooks/use-navigation-handlers.d.ts +1 -0
  690. package/lib/typescript/module/src/modules/questionnaire-response-form/hooks/use-navigation-handlers.d.ts.map +1 -1
  691. package/lib/typescript/module/src/modules/questionnaire-response-form/hooks/use-questionnaire-navigation.d.ts +1 -0
  692. package/lib/typescript/module/src/modules/questionnaire-response-form/hooks/use-questionnaire-navigation.d.ts.map +1 -1
  693. package/lib/typescript/module/src/modules/questionnaire-response-form/types/questionnaire-form-context-type.d.ts +2 -0
  694. package/lib/typescript/module/src/modules/questionnaire-response-form/types/questionnaire-form-context-type.d.ts.map +1 -1
  695. package/lib/typescript/module/src/modules/questionnaire-response-form/types/questionnaire-navigation-provider-props.d.ts +1 -0
  696. package/lib/typescript/module/src/modules/questionnaire-response-form/types/questionnaire-navigation-provider-props.d.ts.map +1 -1
  697. package/lib/typescript/module/src/modules/tile/components/task-icon.d.ts.map +1 -1
  698. package/lib/typescript/module/src/modules/tile/constants/measurement-icon-svg.d.ts +1 -0
  699. package/lib/typescript/module/src/modules/tile/constants/measurement-icon-svg.d.ts.map +1 -1
  700. package/lib/typescript/module/src/modules/ui/components/background-sync-setting.d.ts +9 -0
  701. package/lib/typescript/module/src/modules/ui/components/background-sync-setting.d.ts.map +1 -0
  702. package/lib/typescript/module/src/modules/ui/components/bluetooth-state-notice.d.ts +12 -0
  703. package/lib/typescript/module/src/modules/ui/components/bluetooth-state-notice.d.ts.map +1 -0
  704. package/lib/typescript/module/src/modules/ui/components/ecg-strip-viewer.d.ts +17 -0
  705. package/lib/typescript/module/src/modules/ui/components/ecg-strip-viewer.d.ts.map +1 -0
  706. package/lib/typescript/module/src/modules/ui/components/health-import-card.d.ts +13 -0
  707. package/lib/typescript/module/src/modules/ui/components/health-import-card.d.ts.map +1 -0
  708. package/lib/typescript/module/src/modules/ui/components/manual-entry-form.d.ts +21 -0
  709. package/lib/typescript/module/src/modules/ui/components/manual-entry-form.d.ts.map +1 -0
  710. package/lib/typescript/module/src/modules/ui/components/pairing-flow.d.ts +15 -0
  711. package/lib/typescript/module/src/modules/ui/components/pairing-flow.d.ts.map +1 -0
  712. package/lib/typescript/module/src/modules/ui/components/supported-devices-catalog-list.d.ts +16 -0
  713. package/lib/typescript/module/src/modules/ui/components/supported-devices-catalog-list.d.ts.map +1 -0
  714. package/lib/typescript/module/src/modules/ui/components/urine-test-result.d.ts +10 -0
  715. package/lib/typescript/module/src/modules/ui/components/urine-test-result.d.ts.map +1 -0
  716. package/lib/typescript/module/src/modules/ui/index.d.ts +11 -0
  717. package/lib/typescript/module/src/modules/ui/index.d.ts.map +1 -0
  718. package/lib/typescript/module/src/modules/ui/types.d.ts +24 -0
  719. package/lib/typescript/module/src/modules/ui/types.d.ts.map +1 -0
  720. package/lib/typescript/module/src/modules/ui/use-ovok-ui.d.ts +7 -0
  721. package/lib/typescript/module/src/modules/ui/use-ovok-ui.d.ts.map +1 -0
  722. package/package.json +146 -7
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.useBackgroundSync = void 0;
7
+ var React = _interopRequireWildcard(require("react"));
8
+ var _runtimeContext = require("./runtime-context.js");
9
+ 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); }
10
+ /* eslint-disable import/group-exports */
11
+
12
+ const useBackgroundSync = ({
13
+ enabled: initialEnabled = false,
14
+ canEnable,
15
+ onEnabledChange
16
+ } = {}) => {
17
+ const runtime = (0, _runtimeContext.useBluetoothRuntime)();
18
+ const [enabled, setEnabledState] = React.useState(initialEnabled);
19
+ const [error, setError] = React.useState();
20
+ const [status, setStatus] = React.useState(initialEnabled ? "on" : "off");
21
+ React.useSyncExternalStore(runtime.subscribeState, () => runtime.manager, () => undefined);
22
+ const setEnabled = React.useCallback(async next => {
23
+ setError(undefined);
24
+ try {
25
+ if (next && canEnable && !(await canEnable())) {
26
+ setStatus("restricted");
27
+ return;
28
+ }
29
+ if (next && !runtime.manager) {
30
+ throw new Error("Bluetooth background sync is not ready yet.");
31
+ }
32
+ runtime.manager?.setBackgroundScanEnabled(next);
33
+ await onEnabledChange?.(next);
34
+ setEnabledState(next);
35
+ setStatus(next ? "on" : "off");
36
+ } catch (cause) {
37
+ const nextError = cause instanceof Error ? cause : new Error(String(cause));
38
+ setError(nextError);
39
+ setStatus("blocked");
40
+ }
41
+ }, [canEnable, onEnabledChange, runtime]);
42
+ return {
43
+ enabled,
44
+ setEnabled,
45
+ status,
46
+ error,
47
+ reason: status === "restricted" ? "background access is restricted" : undefined
48
+ };
49
+ };
50
+ exports.useBackgroundSync = useBackgroundSync;
51
+ //# sourceMappingURL=use-background-sync.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","_interopRequireWildcard","require","_runtimeContext","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","useBackgroundSync","enabled","initialEnabled","canEnable","onEnabledChange","runtime","useBluetoothRuntime","setEnabledState","useState","error","setError","status","setStatus","useSyncExternalStore","subscribeState","manager","undefined","setEnabled","useCallback","next","Error","setBackgroundScanEnabled","cause","nextError","String","reason","exports"],"sourceRoot":"../../../../../src","sources":["modules/bt-management/hooks/use-background-sync.ts"],"mappings":";;;;;;AAEA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AAEA,IAAAC,eAAA,GAAAD,OAAA;AAAwD,SAAAD,wBAAAG,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAL,uBAAA,YAAAA,CAAAG,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,IAAAD,CAAA,CAAAC,CAAA,WAA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,GAAGD,KAAK,YAAYF,KAAK,GAAGE,KAAK,GAAG,IAAIF,KAAK,CAACI,MAAM,CAACF,KAAK,CAAC,CAAC;MAE3EZ,QAAQ,CAACa,SAAS,CAAC;MACnBX,SAAS,CAAC,SAAS,CAAC;IACtB;EACF,CAAC,EAAE,CAACT,SAAS,EAAEC,eAAe,EAAEC,OAAO,CAAC,CAAC;EAEzC,OAAO;IAAEJ,OAAO;IAAEgB,UAAU;IAAEN,MAAM;IAAEF,KAAK;IAAEgB,MAAM,EAAEd,MAAM,KAAK,YAAY,GAAG,iCAAiC,GAAGK;EAAU,CAAC;AAChI,CAAC;AAACU,OAAA,CAAA1B,iBAAA,GAAAA,iBAAA","ignoreList":[]}
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.useBluetoothState = void 0;
7
+ var React = _interopRequireWildcard(require("react"));
8
+ var _reactNative = require("react-native");
9
+ var _reactNativeBlePlx = require("react-native-ble-plx");
10
+ var _reactNativePermissions = require("react-native-permissions");
11
+ 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); }
12
+ /* eslint-disable import/group-exports */
13
+
14
+ const requestBluetoothPermission = async () => {
15
+ const permissions = _reactNative.Platform.select({
16
+ android: [_reactNativePermissions.PERMISSIONS.ANDROID.BLUETOOTH_SCAN, _reactNativePermissions.PERMISSIONS.ANDROID.BLUETOOTH_CONNECT],
17
+ ios: [_reactNativePermissions.PERMISSIONS.IOS.BLUETOOTH],
18
+ default: []
19
+ });
20
+ const result = await (0, _reactNativePermissions.requestMultiple)(permissions);
21
+ return Object.values(result).every(value => value === "granted");
22
+ };
23
+ const useBluetoothState = ({
24
+ bleManager,
25
+ requestPermission = requestBluetoothPermission
26
+ } = {}) => {
27
+ const [state, setState] = React.useState(bleManager ? "off" : "unsupported");
28
+ React.useEffect(() => {
29
+ if (!bleManager) {
30
+ setState("unsupported");
31
+ return;
32
+ }
33
+ const subscription = bleManager.onStateChange(nextState => {
34
+ setState(nextState === _reactNativeBlePlx.State.PoweredOn ? "on" : nextState === _reactNativeBlePlx.State.Unsupported ? "unsupported" : nextState === _reactNativeBlePlx.State.Unauthorized ? "unauthorized" : "off");
35
+ }, true);
36
+ return () => subscription.remove();
37
+ }, [bleManager]);
38
+ const request = React.useCallback(async () => {
39
+ const granted = await requestPermission();
40
+ if (!granted) {
41
+ setState("unauthorized");
42
+ }
43
+ return granted;
44
+ }, [requestPermission]);
45
+ return {
46
+ state,
47
+ requestPermission: request
48
+ };
49
+ };
50
+ exports.useBluetoothState = useBluetoothState;
51
+ //# sourceMappingURL=use-bluetooth-state.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","_interopRequireWildcard","require","_reactNative","_reactNativeBlePlx","_reactNativePermissions","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","requestBluetoothPermission","permissions","Platform","select","android","PERMISSIONS","ANDROID","BLUETOOTH_SCAN","BLUETOOTH_CONNECT","ios","IOS","BLUETOOTH","result","requestMultiple","values","every","value","useBluetoothState","bleManager","requestPermission","state","setState","useState","useEffect","subscription","onStateChange","nextState","State","PoweredOn","Unsupported","Unauthorized","remove","request","useCallback","granted","exports"],"sourceRoot":"../../../../../src","sources":["modules/bt-management/hooks/use-bluetooth-state.ts"],"mappings":";;;;;;AAEA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IA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AAE,CAACf,iBAAiB,CAAC,CAAC;EAEvB,OAAO;IAAEC,KAAK;IAAED,iBAAiB,EAAEa;EAAQ,CAAC;AAC9C,CAAC;AAACG,OAAA,CAAAlB,iBAAA,GAAAA,iBAAA","ignoreList":[]}
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.useDeviceConnection = void 0;
7
+ var React = _interopRequireWildcard(require("react"));
8
+ var _runtimeContext = require("./runtime-context.js");
9
+ 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); }
10
+ const useDeviceConnection = id => {
11
+ const runtime = (0, _runtimeContext.useBluetoothRuntime)();
12
+ const [status, setStatus] = React.useState(() => runtime.devices.find(device => device.id === id)?.status);
13
+ const [events, setEvents] = React.useState([]);
14
+ React.useEffect(() => {
15
+ setStatus(runtime.devices.find(device => device.id === id)?.status);
16
+ setEvents([]);
17
+ }, [id, runtime]);
18
+ React.useEffect(() => {
19
+ const unsubStatus = runtime.subscribe("status", value => {
20
+ if (value.deviceData.id === id) {
21
+ setStatus(value.status);
22
+ }
23
+ });
24
+ const unsubEvent = runtime.subscribe("connection", event => {
25
+ if (event.deviceData.id === id) {
26
+ setEvents(current => [...current, event].slice(-100));
27
+ }
28
+ });
29
+ return () => {
30
+ unsubStatus();
31
+ unsubEvent();
32
+ };
33
+ }, [id, runtime]);
34
+ return {
35
+ status,
36
+ events
37
+ };
38
+ };
39
+ exports.useDeviceConnection = useDeviceConnection;
40
+ //# sourceMappingURL=use-device-connection.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","_interopRequireWildcard","require","_runtimeContext","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","useDeviceConnection","id","runtime","useBluetoothRuntime","status","setStatus","useState","devices","find","device","events","setEvents","useEffect","unsubStatus","subscribe","value","deviceData","unsubEvent","event","current","slice","exports"],"sourceRoot":"../../../../../src","sources":["modules/bt-management/hooks/use-device-connection.ts"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AAKA,IAAAC,eAAA,GAAAD,OAAA;AAAwD,SAAAD,wBAAAG,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAL,uBAAA,YAAAA,CAAAG,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,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A,OAAO,EAAED,KAAK,CAAC,CAACE,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC;MACzD;IACF,CAAC,CAAC;IAEF,OAAO,MAAM;MACXP,WAAW,CAAC,CAAC;MACbI,UAAU,CAAC,CAAC;IACd,CAAC;EACH,CAAC,EAAE,CAAChB,EAAE,EAAEC,OAAO,CAAC,CAAC;EAEjB,OAAO;IAAEE,MAAM;IAAEM;EAAO,CAAC;AAC3B,CAAC;AAACW,OAAA,CAAArB,mBAAA,GAAAA,mBAAA","ignoreList":[]}
@@ -0,0 +1,82 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.useHealthImport = void 0;
7
+ var React = _interopRequireWildcard(require("react"));
8
+ 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); }
9
+ const useHealthImport = ({
10
+ types,
11
+ background = false,
12
+ adapter
13
+ }) => {
14
+ const [enabled, setEnabled] = React.useState(false);
15
+ const [statusByType, setStatusByType] = React.useState({});
16
+ const [error, setError] = React.useState();
17
+ const typesKey = React.useMemo(() => types.join("\u0000"), [types]);
18
+ const configRef = React.useRef({
19
+ adapter,
20
+ types,
21
+ background
22
+ });
23
+ configRef.current = {
24
+ adapter,
25
+ types,
26
+ background
27
+ };
28
+ const refresh = React.useCallback(async () => {
29
+ void typesKey;
30
+ const {
31
+ adapter: currentAdapter,
32
+ types: currentTypes
33
+ } = configRef.current;
34
+ const entries = await Promise.allSettled(currentTypes.map(async type => [type, await currentAdapter.getStatus(type)]));
35
+ const rejected = entries.find(entry => entry.status === "rejected");
36
+ setStatusByType(current => {
37
+ const next = {
38
+ ...current
39
+ };
40
+ entries.forEach(entry => {
41
+ if (entry.status === "fulfilled") {
42
+ next[entry.value[0]] = entry.value[1];
43
+ }
44
+ });
45
+ return next;
46
+ });
47
+ setEnabled(currentTypes.length > 0 && entries.every(entry => entry.status === "fulfilled" && entry.value[1] === "authorized"));
48
+ setError(rejected ? rejected.reason instanceof Error ? rejected.reason : new Error(String(rejected.reason)) : undefined);
49
+ }, [typesKey]);
50
+ React.useEffect(() => {
51
+ void refresh();
52
+ }, [refresh]);
53
+ const setEnabledForTypes = React.useCallback(async next => {
54
+ const {
55
+ adapter: currentAdapter,
56
+ types: currentTypes,
57
+ background: currentBackground
58
+ } = configRef.current;
59
+ setError(undefined);
60
+ try {
61
+ if (next) {
62
+ await currentAdapter.request(currentTypes, currentBackground);
63
+ await refresh();
64
+ }
65
+ setEnabled(next);
66
+ } catch (cause) {
67
+ const nextError = cause instanceof Error ? cause : new Error(String(cause));
68
+ setError(nextError);
69
+ throw nextError;
70
+ }
71
+ }, [refresh]);
72
+ const notShared = types.filter(type => statusByType[type] === "refused");
73
+ return {
74
+ enabled,
75
+ setEnabled: setEnabledForTypes,
76
+ statusByType: statusByType,
77
+ notShared,
78
+ error
79
+ };
80
+ };
81
+ exports.useHealthImport = useHealthImport;
82
+ //# sourceMappingURL=use-health-import.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","_interopRequireWildcard","require","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","useHealthImport","types","background","adapter","enabled","setEnabled","useState","statusByType","setStatusByType","error","setError","typesKey","useMemo","join","configRef","useRef","current","refresh","useCallback","currentAdapter","currentTypes","entries","Promise","allSettled","map","type","getStatus","rejected","find","entry","status","next","forEach","value","length","every","reason","Error","String","undefined","useEffect","setEnabledForTypes","currentBackground","request","cause","nextError","notShared","filter","exports"],"sourceRoot":"../../../../../src","sources":["modules/bt-management/hooks/use-health-import.ts"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AAA+B,SAAAD,wBAAAE,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAJ,uBAAA,YAAAA,CAAAE,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,IAAAD,CAAA,CAAAC,CAAA,WAAAO,CAAA,KAAAR,CAAA,EAAAC,CAAA;AAOxB,MAAMkB,eAAe,GAAGA,CAAuB;EACpDC,KAAK;EACLC,UAAU,GAAG,KAAK;EAClBC;AAKF,CAAC,KAMI;EACH,MAAM,CAACC,OAAO,EAAEC,UAAU,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,CAAC;MAE3ElC,QAAQ,CAACmC,SAAS,CAAC;MACnB,MAAMA,SAAS;IACjB;EACF,CAAC,EAAE,CAAC5B,OAAO,CAAC,CAAC;EAEb,MAAM6B,SAAS,GAAG7C,KAAK,CAAC8C,MAAM,CAAEtB,IAAI,IAAKlB,YAAY,CAACkB,IAAI,CAAC,KAAK,SAAS,CAAC;EAE1E,OAAO;IAAErB,OAAO;IAAEC,UAAU,EAAEoC,kBAAkB;IAAElC,YAAY,EAAEA,YAAqB;IAAEuC,SAAS;IAAErC;EAAM,CAAC;AAC3G,CAAC;AAACuC,OAAA,CAAAhD,eAAA,GAAAA,eAAA","ignoreList":[]}
@@ -0,0 +1,79 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.useMeasurements = void 0;
7
+ var React = _interopRequireWildcard(require("react"));
8
+ var _runtimeContext = require("./runtime-context.js");
9
+ 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); }
10
+ const useMeasurements = (onResult, {
11
+ policy = "all",
12
+ maxResults = 100
13
+ } = {}) => {
14
+ const runtime = (0, _runtimeContext.useBluetoothRuntime)();
15
+ const [measurements, setMeasurements] = React.useState([]);
16
+ const seen = React.useRef(new Set());
17
+ const seenMeasurementKinds = React.useRef(new Set());
18
+ const seenDailyTotals = React.useRef(new Set());
19
+ const onResultRef = React.useRef(onResult);
20
+ onResultRef.current = onResult;
21
+ const acceptsResult = React.useCallback(result => {
22
+ const measurementTypeKey = String(result.data.measurementTypeKey);
23
+ if (policy === "first-reading-per-kind-per-connection") {
24
+ if (seenMeasurementKinds.current.has(measurementTypeKey)) {
25
+ return false;
26
+ }
27
+ seenMeasurementKinds.current.add(measurementTypeKey);
28
+ }
29
+ if (policy === "daily-totals-only") {
30
+ const temporal = result.data;
31
+ const end = temporal.end instanceof Date ? temporal.end : undefined;
32
+ if (end && end.getTime() > Date.now()) {
33
+ return false;
34
+ }
35
+ const day = temporal.end ?? temporal.start ?? temporal.recordedAt;
36
+ if (day instanceof Date) {
37
+ const key = `${measurementTypeKey}:${day.toISOString().slice(0, 10)}`;
38
+ if (seenDailyTotals.current.has(key)) {
39
+ return false;
40
+ }
41
+ seenDailyTotals.current.add(key);
42
+ }
43
+ }
44
+ return true;
45
+ }, [policy]);
46
+ React.useEffect(() => {
47
+ return runtime.subscribe("result", result => {
48
+ if (!acceptsResult(result)) {
49
+ return;
50
+ }
51
+ if (seen.current.has(result.id)) {
52
+ return;
53
+ }
54
+ seen.current.add(result.id);
55
+ setMeasurements(current => [...current, result].slice(-maxResults));
56
+ onResultRef.current?.(result);
57
+ });
58
+ }, [acceptsResult, maxResults, runtime]);
59
+ React.useEffect(() => {
60
+ const unsubscribe = runtime.subscribe("connection", event => {
61
+ if (event.kind === "bonded") {
62
+ seenMeasurementKinds.current.clear();
63
+ seenDailyTotals.current.clear();
64
+ }
65
+ });
66
+ return unsubscribe;
67
+ }, [runtime]);
68
+ return {
69
+ measurements,
70
+ clear: () => {
71
+ seen.current.clear();
72
+ seenMeasurementKinds.current.clear();
73
+ seenDailyTotals.current.clear();
74
+ setMeasurements([]);
75
+ }
76
+ };
77
+ };
78
+ exports.useMeasurements = useMeasurements;
79
+ //# sourceMappingURL=use-measurements.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","_interopRequireWildcard","require","_runtimeContext","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","useMeasurements","onResult","policy","maxResults","runtime","useBluetoothRuntime","measurements","setMeasurements","useState","seen","useRef","Set","seenMeasurementKinds","seenDailyTotals","onResultRef","current","acceptsResult","useCallback","result","measurementTypeKey","String","data","add","temporal","end","Date","undefined","getTime","now","day","start","recordedAt","key","toISOString","slice","useEffect","subscribe","id","unsubscribe","event","kind","clear","exports"],"sourceRoot":"../../../../../src","sources":["modules/bt-management/hooks/use-measurements.ts"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AAIA,IAAAC,eAAA,GAAAD,OAAA;AAI2B,SAAAD,wBAAAG,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAL,uBAAA,YAAAA,CAAAG,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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AAC,CAAC;EAExC3B,KAAK,CAAC0D,SAAS,CAAC,MAAM;IACpB,MAAMG,WAAW,GAAGlC,OAAO,CAACgC,SAAS,CAAyB,YAAY,EAAGG,KAAK,IAAK;MACrF,IAAIA,KAAK,CAACC,IAAI,KAAK,QAAQ,EAAE;QAC3B5B,oBAAoB,CAACG,OAAO,CAAC0B,KAAK,CAAC,CAAC;QACpC5B,eAAe,CAACE,OAAO,CAAC0B,KAAK,CAAC,CAAC;MACjC;IACF,CAAC,CAAC;IAEF,OAAOH,WAAW;EACpB,CAAC,EAAE,CAAClC,OAAO,CAAC,CAAC;EAEb,OAAO;IACLE,YAAY;IACZmC,KAAK,EAAEA,CAAA,KAAM;MACXhC,IAAI,CAACM,OAAO,CAAC0B,KAAK,CAAC,CAAC;MACpB7B,oBAAoB,CAACG,OAAO,CAAC0B,KAAK,CAAC,CAAC;MACpC5B,eAAe,CAACE,OAAO,CAAC0B,KAAK,CAAC,CAAC;MAC/BlC,eAAe,CAAC,EAAE,CAAC;IACrB;EACF,CAAC;AACH,CAAC;AAACmC,OAAA,CAAA1C,eAAA,GAAAA,eAAA","ignoreList":[]}
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.useNearbyDevices = void 0;
7
+ var React = _interopRequireWildcard(require("react"));
8
+ var _runtimeContext = require("./runtime-context.js");
9
+ 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); }
10
+ const useNearbyDevices = () => {
11
+ const runtime = (0, _runtimeContext.useBluetoothRuntime)();
12
+ const [, redraw] = React.useReducer(value => value + 1, 0);
13
+ React.useEffect(() => {
14
+ const unsubscribeFound = runtime.subscribe("deviceFound", redraw);
15
+ const unsubscribeStatus = runtime.subscribe("status", redraw);
16
+ return () => {
17
+ unsubscribeFound();
18
+ unsubscribeStatus();
19
+ };
20
+ }, [runtime]);
21
+ return {
22
+ devices: runtime.devices,
23
+ pair: async id => {
24
+ const device = runtime.devices.find(item => item.id === id);
25
+ if (device) {
26
+ await device.device.connect();
27
+ }
28
+ return device;
29
+ }
30
+ };
31
+ };
32
+ exports.useNearbyDevices = useNearbyDevices;
33
+ //# sourceMappingURL=use-nearby-devices.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","_interopRequireWildcard","require","_runtimeContext","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","useNearbyDevices","runtime","useBluetoothRuntime","redraw","useReducer","value","useEffect","unsubscribeFound","subscribe","unsubscribeStatus","devices","pair","id","device","find","item","connect","exports"],"sourceRoot":"../../../../../src","sources":["modules/bt-management/hooks/use-nearby-devices.ts"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AAIA,IAAAC,eAAA,GAAAD,OAAA;AAAuE,SAAAD,wBAAAG,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAL,uBAAA,YAAAA,CAAAG,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,GAA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CAACS,OAAO,CAACI,IAAI,CAAEC,IAAI,IAAKA,IAAI,CAACH,EAAE,KAAKA,EAAE,CAAC;MAE7D,IAAIC,MAAM,EAAE;QAAC,MAAMA,MAAM,CAACA,MAAM,CAACG,OAAO,CAAC,CAAC;MAAC;MAE3C,OAAOH,MAAM;IACf;EACF,CAAC;AACH,CAAC;AAACI,OAAA,CAAAjB,gBAAA,GAAAA,gBAAA","ignoreList":[]}
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.usePairedDevices = void 0;
7
+ var React = _interopRequireWildcard(require("react"));
8
+ var _runtimeContext = require("./runtime-context.js");
9
+ 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); }
10
+ /* eslint-disable import/group-exports */
11
+
12
+ const usePairedDevices = ({
13
+ storage,
14
+ storageKey = "@ovok/native/paired-devices",
15
+ autoPair = false
16
+ }) => {
17
+ const runtime = (0, _runtimeContext.useBluetoothRuntime)();
18
+ const [paired, setPaired] = React.useState([]);
19
+ const pairedRef = React.useRef([]);
20
+ const [, redraw] = React.useReducer(value => value + 1, 0);
21
+ const save = React.useCallback(async next => {
22
+ pairedRef.current = next;
23
+ setPaired(next);
24
+ await storage.setItem(storageKey, JSON.stringify(next));
25
+ }, [storage, storageKey]);
26
+ React.useEffect(() => runtime.subscribe("deviceFound", redraw), [runtime]);
27
+ React.useEffect(() => {
28
+ void storage.getItem(storageKey).then(value => {
29
+ try {
30
+ const parsed = value ? JSON.parse(value) : [];
31
+ const next = Array.isArray(parsed) ? parsed.filter(id => typeof id === "string") : [];
32
+ pairedRef.current = next;
33
+ setPaired(next);
34
+ } catch {
35
+ setPaired([]);
36
+ }
37
+ });
38
+ }, [storage, storageKey]);
39
+ React.useEffect(() => {
40
+ if (!autoPair) {
41
+ return;
42
+ }
43
+ runtime.devices.filter(device => paired.includes(device.id)).forEach(device => void device.device.connect());
44
+ }, [autoPair, paired, runtime, runtime.devices]);
45
+ return {
46
+ paired,
47
+ pair: device => save([...new Set([...pairedRef.current, device.id])]),
48
+ forget: async id => {
49
+ if (!runtime.manager) {
50
+ throw new Error("Bluetooth manager is not ready; try forgetting the device again.");
51
+ }
52
+ await runtime.manager.forget(id);
53
+ await save(pairedRef.current.filter(candidate => candidate !== id));
54
+ }
55
+ };
56
+ };
57
+ exports.usePairedDevices = usePairedDevices;
58
+ //# sourceMappingURL=use-paired-devices.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","_interopRequireWildcard","require","_runtimeContext","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","usePairedDevices","storage","storageKey","autoPair","runtime","useBluetoothRuntime","paired","setPaired","useState","pairedRef","useRef","redraw","useReducer","value","save","useCallback","next","current","setItem","JSON","stringify","useEffect","subscribe","getItem","then","parsed","parse","Array","isArray","filter","id","devices","device","includes","forEach","connect","pair","Set","forget","manager","Error","candidate","exports"],"sourceRoot":"../../../../../src","sources":["modules/bt-management/hooks/use-paired-devices.ts"],"mappings":";;;;;;AAEA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AAEA,IAAAC,eAAA,GAAAD,OAAA;AAAuE,SAAAD,wBAAAG,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAL,uBAAA,YAAAA,CAAAG,CAAA,EAAAC,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,CAC9CI,OAAO,CAAEF,MAAM,IAAK,KAAKA,MAAM,CAACA,MAAM,CAACG,OAAO,CAAC,CAAC,CAAC;EACtD,CAAC,EAAE,CAAChC,QAAQ,EAAEG,MAAM,EAAEF,OAAO,EAAEA,OAAO,CAAC2B,OAAO,CAAC,CAAC;EAEhD,OAAO;IACLzB,MAAM;IACN8B,IAAI,EAAGJ,MAAM,IAAKlB,IAAI,CAAC,CAAC,GAAG,IAAIuB,GAAG,CAAC,CAAC,GAAG5B,SAAS,CAACQ,OAAO,EAAEe,MAAM,CAACF,EAAE,CAAC,CAAC,CAAC,CAAC;IACvEQ,MAAM,EAAE,MAAOR,EAAE,IAAK;MACpB,IAAI,CAAC1B,OAAO,CAACmC,OAAO,EAAE;QACpB,MAAM,IAAIC,KAAK,CAAC,kEAAkE,CAAC;MACrF;MAEA,MAAMpC,OAAO,CAACmC,OAAO,CAACD,MAAM,CAACR,EAAE,CAAC;MAChC,MAAMhB,IAAI,CAACL,SAAS,CAACQ,OAAO,CAACY,MAAM,CAAEY,SAAS,IAAKA,SAAS,KAAKX,EAAE,CAAC,CAAC;IACvE;EACF,CAAC;AACH,CAAC;AAACY,OAAA,CAAA1C,gBAAA,GAAAA,gBAAA","ignoreList":[]}
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.useScanControl = void 0;
7
+ var React = _interopRequireWildcard(require("react"));
8
+ var _runtimeContext = require("./runtime-context.js");
9
+ 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); }
10
+ /** Exposes scan pause/resume to apps using BTProvider. */
11
+ const useScanControl = () => {
12
+ const runtime = (0, _runtimeContext.useBluetoothRuntime)();
13
+ React.useSyncExternalStore(runtime.subscribeState, () => runtime.manager, () => undefined);
14
+ return {
15
+ canControl: Boolean(runtime.manager),
16
+ pauseScan: () => runtime.manager?.pauseScan(),
17
+ resumeScan: () => runtime.manager?.resumeScan()
18
+ };
19
+ };
20
+ exports.useScanControl = useScanControl;
21
+ //# sourceMappingURL=use-scan-control.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","_interopRequireWildcard","require","_runtimeContext","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","useScanControl","runtime","useBluetoothRuntime","useSyncExternalStore","subscribeState","manager","undefined","canControl","Boolean","pauseScan","resumeScan","exports"],"sourceRoot":"../../../../../src","sources":["modules/bt-management/hooks/use-scan-control.ts"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AAEA,IAAAC,eAAA,GAAAD,OAAA;AAAwD,SAAAD,wBAAAG,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAL,uBAAA,YAAAA,CAAAG,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,CA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