@ovok/native 1.17.0-dev.2215 → 1.17.0-dev.2219
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.
- package/lib/commonjs/modules/next/bluetooth/adapters/android-foreground-service.js +58 -5
- package/lib/commonjs/modules/next/bluetooth/adapters/android-foreground-service.js.map +1 -1
- package/lib/commonjs/modules/next/bluetooth/adapters/ecg-measurements.js +25 -0
- package/lib/commonjs/modules/next/bluetooth/adapters/ecg-measurements.js.map +1 -0
- package/lib/commonjs/modules/next/bluetooth/adapters/live-supersession.js +62 -0
- package/lib/commonjs/modules/next/bluetooth/adapters/live-supersession.js.map +1 -0
- package/lib/commonjs/modules/next/bluetooth/adapters/ovok-outbox-watch.js +42 -0
- package/lib/commonjs/modules/next/bluetooth/adapters/ovok-outbox-watch.js.map +1 -0
- package/lib/commonjs/modules/next/bluetooth/adapters/ovok-reading-sink.js +97 -96
- package/lib/commonjs/modules/next/bluetooth/adapters/ovok-reading-sink.js.map +1 -1
- package/lib/commonjs/modules/next/bluetooth/adapters/reading-source-id.js +33 -0
- package/lib/commonjs/modules/next/bluetooth/adapters/reading-source-id.js.map +1 -0
- package/lib/commonjs/modules/next/bluetooth/adapters/reading-values.js +38 -0
- package/lib/commonjs/modules/next/bluetooth/adapters/reading-values.js.map +1 -0
- package/lib/commonjs/modules/next/bluetooth/adapters/series-saving.js +101 -0
- package/lib/commonjs/modules/next/bluetooth/adapters/series-saving.js.map +1 -0
- package/lib/commonjs/modules/next/bluetooth/adapters/sqlite-database.js +24 -0
- package/lib/commonjs/modules/next/bluetooth/adapters/sqlite-database.js.map +1 -0
- package/lib/commonjs/modules/next/bluetooth/adapters/sqlite-outbox-rows.js +65 -0
- package/lib/commonjs/modules/next/bluetooth/adapters/sqlite-outbox-rows.js.map +1 -0
- package/lib/commonjs/modules/next/bluetooth/adapters/sqlite-outbox-schema.js +53 -0
- package/lib/commonjs/modules/next/bluetooth/adapters/sqlite-outbox-schema.js.map +1 -0
- package/lib/commonjs/modules/next/bluetooth/adapters/sqlite-outbox-store.js +82 -0
- package/lib/commonjs/modules/next/bluetooth/adapters/sqlite-outbox-store.js.map +1 -0
- package/lib/commonjs/modules/next/bluetooth/adapters/storage-paired-devices.js +1 -0
- package/lib/commonjs/modules/next/bluetooth/adapters/storage-paired-devices.js.map +1 -1
- package/lib/commonjs/modules/next/bluetooth/core/bluetooth.js +9 -3
- package/lib/commonjs/modules/next/bluetooth/core/bluetooth.js.map +1 -1
- package/lib/commonjs/modules/next/bluetooth/core/device-deps.js +6 -0
- package/lib/commonjs/modules/next/bluetooth/core/device-deps.js.map +1 -0
- package/lib/commonjs/modules/next/bluetooth/core/device-snapshot.js +3 -1
- package/lib/commonjs/modules/next/bluetooth/core/device-snapshot.js.map +1 -1
- package/lib/commonjs/modules/next/bluetooth/core/device.js +19 -6
- package/lib/commonjs/modules/next/bluetooth/core/device.js.map +1 -1
- package/lib/commonjs/modules/next/bluetooth/core/live-ledger.js +54 -0
- package/lib/commonjs/modules/next/bluetooth/core/live-ledger.js.map +1 -0
- package/lib/commonjs/modules/next/bluetooth/core/measuring-watch.js +45 -0
- package/lib/commonjs/modules/next/bluetooth/core/measuring-watch.js.map +1 -0
- package/lib/commonjs/modules/next/bluetooth/core/outbox-watch.js +17 -0
- package/lib/commonjs/modules/next/bluetooth/core/outbox-watch.js.map +1 -0
- package/lib/commonjs/modules/next/bluetooth/core/paired-device.js +1 -0
- package/lib/commonjs/modules/next/bluetooth/core/paired-device.js.map +1 -1
- package/lib/commonjs/modules/next/bluetooth/core/ports.js.map +1 -1
- package/lib/commonjs/modules/next/bluetooth/core/reading-log.js +89 -7
- package/lib/commonjs/modules/next/bluetooth/core/reading-log.js.map +1 -1
- package/lib/commonjs/modules/next/bluetooth/core/series-slots.js +94 -0
- package/lib/commonjs/modules/next/bluetooth/core/series-slots.js.map +1 -0
- package/lib/commonjs/modules/next/bluetooth/core/stream-recorder.js +219 -0
- package/lib/commonjs/modules/next/bluetooth/core/stream-recorder.js.map +1 -0
- package/lib/commonjs/modules/next/bluetooth/core/waveform-segments.js +110 -0
- package/lib/commonjs/modules/next/bluetooth/core/waveform-segments.js.map +1 -0
- package/lib/commonjs/modules/next/bluetooth/create-bluetooth.js +19 -11
- package/lib/commonjs/modules/next/bluetooth/create-bluetooth.js.map +1 -1
- package/lib/commonjs/modules/next/bluetooth/index.js +9 -1
- package/lib/commonjs/modules/next/bluetooth/index.js.map +1 -1
- package/lib/commonjs/modules/next/bluetooth/shared.js +14 -0
- package/lib/commonjs/modules/next/bluetooth/shared.js.map +1 -1
- package/lib/commonjs/modules/next/bluetooth/web/create-web-bluetooth.js +2 -0
- package/lib/commonjs/modules/next/bluetooth/web/create-web-bluetooth.js.map +1 -1
- package/lib/module/modules/next/bluetooth/adapters/android-foreground-service.js +59 -6
- package/lib/module/modules/next/bluetooth/adapters/android-foreground-service.js.map +1 -1
- package/lib/module/modules/next/bluetooth/adapters/ecg-measurements.js +22 -0
- package/lib/module/modules/next/bluetooth/adapters/ecg-measurements.js.map +1 -0
- package/lib/module/modules/next/bluetooth/adapters/live-supersession.js +59 -0
- package/lib/module/modules/next/bluetooth/adapters/live-supersession.js.map +1 -0
- package/lib/module/modules/next/bluetooth/adapters/ovok-outbox-watch.js +38 -0
- package/lib/module/modules/next/bluetooth/adapters/ovok-outbox-watch.js.map +1 -0
- package/lib/module/modules/next/bluetooth/adapters/ovok-reading-sink.js +76 -75
- package/lib/module/modules/next/bluetooth/adapters/ovok-reading-sink.js.map +1 -1
- package/lib/module/modules/next/bluetooth/adapters/reading-source-id.js +27 -0
- package/lib/module/modules/next/bluetooth/adapters/reading-source-id.js.map +1 -0
- package/lib/module/modules/next/bluetooth/adapters/reading-values.js +33 -0
- package/lib/module/modules/next/bluetooth/adapters/reading-values.js.map +1 -0
- package/lib/module/modules/next/bluetooth/adapters/series-saving.js +94 -0
- package/lib/module/modules/next/bluetooth/adapters/series-saving.js.map +1 -0
- package/lib/module/modules/next/bluetooth/adapters/sqlite-database.js +20 -0
- package/lib/module/modules/next/bluetooth/adapters/sqlite-database.js.map +1 -0
- package/lib/module/modules/next/bluetooth/adapters/sqlite-outbox-rows.js +59 -0
- package/lib/module/modules/next/bluetooth/adapters/sqlite-outbox-rows.js.map +1 -0
- package/lib/module/modules/next/bluetooth/adapters/sqlite-outbox-schema.js +49 -0
- package/lib/module/modules/next/bluetooth/adapters/sqlite-outbox-schema.js.map +1 -0
- package/lib/module/modules/next/bluetooth/adapters/sqlite-outbox-store.js +79 -0
- package/lib/module/modules/next/bluetooth/adapters/sqlite-outbox-store.js.map +1 -0
- package/lib/module/modules/next/bluetooth/adapters/storage-paired-devices.js +1 -0
- package/lib/module/modules/next/bluetooth/adapters/storage-paired-devices.js.map +1 -1
- package/lib/module/modules/next/bluetooth/core/bluetooth.js +9 -3
- package/lib/module/modules/next/bluetooth/core/bluetooth.js.map +1 -1
- package/lib/module/modules/next/bluetooth/core/device-deps.js +4 -0
- package/lib/module/modules/next/bluetooth/core/device-deps.js.map +1 -0
- package/lib/module/modules/next/bluetooth/core/device-snapshot.js +3 -1
- package/lib/module/modules/next/bluetooth/core/device-snapshot.js.map +1 -1
- package/lib/module/modules/next/bluetooth/core/device.js +19 -6
- package/lib/module/modules/next/bluetooth/core/device.js.map +1 -1
- package/lib/module/modules/next/bluetooth/core/live-ledger.js +50 -0
- package/lib/module/modules/next/bluetooth/core/live-ledger.js.map +1 -0
- package/lib/module/modules/next/bluetooth/core/measuring-watch.js +41 -0
- package/lib/module/modules/next/bluetooth/core/measuring-watch.js.map +1 -0
- package/lib/module/modules/next/bluetooth/core/outbox-watch.js +14 -0
- package/lib/module/modules/next/bluetooth/core/outbox-watch.js.map +1 -0
- package/lib/module/modules/next/bluetooth/core/paired-device.js +1 -0
- package/lib/module/modules/next/bluetooth/core/paired-device.js.map +1 -1
- package/lib/module/modules/next/bluetooth/core/ports.js.map +1 -1
- package/lib/module/modules/next/bluetooth/core/reading-log.js +89 -7
- package/lib/module/modules/next/bluetooth/core/reading-log.js.map +1 -1
- package/lib/module/modules/next/bluetooth/core/series-slots.js +90 -0
- package/lib/module/modules/next/bluetooth/core/series-slots.js.map +1 -0
- package/lib/module/modules/next/bluetooth/core/stream-recorder.js +215 -0
- package/lib/module/modules/next/bluetooth/core/stream-recorder.js.map +1 -0
- package/lib/module/modules/next/bluetooth/core/waveform-segments.js +106 -0
- package/lib/module/modules/next/bluetooth/core/waveform-segments.js.map +1 -0
- package/lib/module/modules/next/bluetooth/create-bluetooth.js +19 -11
- package/lib/module/modules/next/bluetooth/create-bluetooth.js.map +1 -1
- package/lib/module/modules/next/bluetooth/index.js +1 -0
- package/lib/module/modules/next/bluetooth/index.js.map +1 -1
- package/lib/module/modules/next/bluetooth/shared.js +2 -0
- package/lib/module/modules/next/bluetooth/shared.js.map +1 -1
- package/lib/module/modules/next/bluetooth/web/create-web-bluetooth.js +2 -0
- package/lib/module/modules/next/bluetooth/web/create-web-bluetooth.js.map +1 -1
- package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/android-foreground-service.d.ts +17 -4
- package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/android-foreground-service.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/ecg-measurements.d.ts +6 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/ecg-measurements.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/live-supersession.d.ts +9 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/live-supersession.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/ovok-outbox-watch.d.ts +8 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/ovok-outbox-watch.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/ovok-reading-sink.d.ts +9 -3
- package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/ovok-reading-sink.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/reading-source-id.d.ts +9 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/reading-source-id.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/reading-values.d.ts +9 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/reading-values.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/series-saving.d.ts +28 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/series-saving.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/sqlite-database.d.ts +23 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/sqlite-database.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/sqlite-outbox-rows.d.ts +29 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/sqlite-outbox-rows.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/sqlite-outbox-schema.d.ts +6 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/sqlite-outbox-schema.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/sqlite-outbox-store.d.ts +38 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/sqlite-outbox-store.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/storage-paired-devices.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/next/bluetooth/core/bluetooth-options.d.ts +3 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/core/bluetooth-options.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/next/bluetooth/core/bluetooth.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/next/bluetooth/core/device-deps.d.ts +16 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/core/device-deps.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/core/device-snapshot.d.ts +5 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/core/device-snapshot.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/next/bluetooth/core/device.d.ts +6 -13
- package/lib/typescript/commonjs/src/modules/next/bluetooth/core/device.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/next/bluetooth/core/live-ledger.d.ts +13 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/core/live-ledger.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/core/measuring-watch.d.ts +17 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/core/measuring-watch.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/core/outbox-watch.d.ts +27 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/core/outbox-watch.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/core/paired-device.d.ts +3 -1
- package/lib/typescript/commonjs/src/modules/next/bluetooth/core/paired-device.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/next/bluetooth/core/ports.d.ts +3 -2
- package/lib/typescript/commonjs/src/modules/next/bluetooth/core/ports.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/next/bluetooth/core/reading-log.d.ts +25 -6
- package/lib/typescript/commonjs/src/modules/next/bluetooth/core/reading-log.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/next/bluetooth/core/reading.d.ts +16 -1
- package/lib/typescript/commonjs/src/modules/next/bluetooth/core/reading.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/next/bluetooth/core/series-slots.d.ts +35 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/core/series-slots.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/core/stream-recorder.d.ts +58 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/core/stream-recorder.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/core/waveform-segments.d.ts +26 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/core/waveform-segments.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/create-bluetooth.d.ts +3 -2
- package/lib/typescript/commonjs/src/modules/next/bluetooth/create-bluetooth.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/next/bluetooth/index.d.ts +4 -1
- package/lib/typescript/commonjs/src/modules/next/bluetooth/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/next/bluetooth/shared.d.ts +5 -1
- package/lib/typescript/commonjs/src/modules/next/bluetooth/shared.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/next/bluetooth/web/create-web-bluetooth.d.ts +3 -2
- package/lib/typescript/commonjs/src/modules/next/bluetooth/web/create-web-bluetooth.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/next/bluetooth/adapters/android-foreground-service.d.ts +17 -4
- package/lib/typescript/module/src/modules/next/bluetooth/adapters/android-foreground-service.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/next/bluetooth/adapters/ecg-measurements.d.ts +6 -0
- package/lib/typescript/module/src/modules/next/bluetooth/adapters/ecg-measurements.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/next/bluetooth/adapters/live-supersession.d.ts +9 -0
- package/lib/typescript/module/src/modules/next/bluetooth/adapters/live-supersession.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/next/bluetooth/adapters/ovok-outbox-watch.d.ts +8 -0
- package/lib/typescript/module/src/modules/next/bluetooth/adapters/ovok-outbox-watch.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/next/bluetooth/adapters/ovok-reading-sink.d.ts +9 -3
- package/lib/typescript/module/src/modules/next/bluetooth/adapters/ovok-reading-sink.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/next/bluetooth/adapters/reading-source-id.d.ts +9 -0
- package/lib/typescript/module/src/modules/next/bluetooth/adapters/reading-source-id.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/next/bluetooth/adapters/reading-values.d.ts +9 -0
- package/lib/typescript/module/src/modules/next/bluetooth/adapters/reading-values.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/next/bluetooth/adapters/series-saving.d.ts +28 -0
- package/lib/typescript/module/src/modules/next/bluetooth/adapters/series-saving.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/next/bluetooth/adapters/sqlite-database.d.ts +23 -0
- package/lib/typescript/module/src/modules/next/bluetooth/adapters/sqlite-database.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/next/bluetooth/adapters/sqlite-outbox-rows.d.ts +29 -0
- package/lib/typescript/module/src/modules/next/bluetooth/adapters/sqlite-outbox-rows.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/next/bluetooth/adapters/sqlite-outbox-schema.d.ts +6 -0
- package/lib/typescript/module/src/modules/next/bluetooth/adapters/sqlite-outbox-schema.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/next/bluetooth/adapters/sqlite-outbox-store.d.ts +38 -0
- package/lib/typescript/module/src/modules/next/bluetooth/adapters/sqlite-outbox-store.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/next/bluetooth/adapters/storage-paired-devices.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/next/bluetooth/core/bluetooth-options.d.ts +3 -0
- package/lib/typescript/module/src/modules/next/bluetooth/core/bluetooth-options.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/next/bluetooth/core/bluetooth.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/next/bluetooth/core/device-deps.d.ts +16 -0
- package/lib/typescript/module/src/modules/next/bluetooth/core/device-deps.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/next/bluetooth/core/device-snapshot.d.ts +5 -0
- package/lib/typescript/module/src/modules/next/bluetooth/core/device-snapshot.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/next/bluetooth/core/device.d.ts +6 -13
- package/lib/typescript/module/src/modules/next/bluetooth/core/device.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/next/bluetooth/core/live-ledger.d.ts +13 -0
- package/lib/typescript/module/src/modules/next/bluetooth/core/live-ledger.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/next/bluetooth/core/measuring-watch.d.ts +17 -0
- package/lib/typescript/module/src/modules/next/bluetooth/core/measuring-watch.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/next/bluetooth/core/outbox-watch.d.ts +27 -0
- package/lib/typescript/module/src/modules/next/bluetooth/core/outbox-watch.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/next/bluetooth/core/paired-device.d.ts +3 -1
- package/lib/typescript/module/src/modules/next/bluetooth/core/paired-device.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/next/bluetooth/core/ports.d.ts +3 -2
- package/lib/typescript/module/src/modules/next/bluetooth/core/ports.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/next/bluetooth/core/reading-log.d.ts +25 -6
- package/lib/typescript/module/src/modules/next/bluetooth/core/reading-log.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/next/bluetooth/core/reading.d.ts +16 -1
- package/lib/typescript/module/src/modules/next/bluetooth/core/reading.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/next/bluetooth/core/series-slots.d.ts +35 -0
- package/lib/typescript/module/src/modules/next/bluetooth/core/series-slots.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/next/bluetooth/core/stream-recorder.d.ts +58 -0
- package/lib/typescript/module/src/modules/next/bluetooth/core/stream-recorder.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/next/bluetooth/core/waveform-segments.d.ts +26 -0
- package/lib/typescript/module/src/modules/next/bluetooth/core/waveform-segments.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/next/bluetooth/create-bluetooth.d.ts +3 -2
- package/lib/typescript/module/src/modules/next/bluetooth/create-bluetooth.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/next/bluetooth/index.d.ts +4 -1
- package/lib/typescript/module/src/modules/next/bluetooth/index.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/next/bluetooth/shared.d.ts +5 -1
- package/lib/typescript/module/src/modules/next/bluetooth/shared.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/next/bluetooth/web/create-web-bluetooth.d.ts +3 -2
- package/lib/typescript/module/src/modules/next/bluetooth/web/create-web-bluetooth.d.ts.map +1 -1
- package/package.json +7 -3
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { MeasurementTypeKey, SEGMENT_IDENTIFIER_SYSTEM } from "@ovok/core/next";
|
|
4
|
+
import { liveSourceId } from "./reading-source-id.js";
|
|
5
|
+
import { seriesFieldOf, seriesObservationsOf, signedInPatientId } from "./series-saving.js";
|
|
6
|
+
|
|
7
|
+
/** What queues the deletions: the outbox, with the measurements API and the session that name what to delete. */
|
|
8
|
+
|
|
9
|
+
const LIVE_SLOT_MS = 1_000;
|
|
10
|
+
|
|
11
|
+
/** The observations a live recording was saved as, rebuilt from its span alone; a single stand-in value gives each its identifiers. */
|
|
12
|
+
const observationsOfSpan = async (client, address, span) => {
|
|
13
|
+
const patientId = await signedInPatientId(client);
|
|
14
|
+
const sourceId = liveSourceId(address, span);
|
|
15
|
+
if (span.channel === null) {
|
|
16
|
+
const field = seriesFieldOf(span.metric);
|
|
17
|
+
return field ? seriesObservationsOf(field, {
|
|
18
|
+
start: span.from,
|
|
19
|
+
intervalMs: LIVE_SLOT_MS,
|
|
20
|
+
values: [0]
|
|
21
|
+
}, {
|
|
22
|
+
patientId,
|
|
23
|
+
sourceId
|
|
24
|
+
}) : [];
|
|
25
|
+
}
|
|
26
|
+
const measurement = {
|
|
27
|
+
measurementTypeKey: MeasurementTypeKey.ecg,
|
|
28
|
+
diagramPoints: [0],
|
|
29
|
+
duration: 1,
|
|
30
|
+
recordedAt: span.from
|
|
31
|
+
};
|
|
32
|
+
return client.measurements.build({
|
|
33
|
+
measurement,
|
|
34
|
+
sourceId,
|
|
35
|
+
patientId
|
|
36
|
+
});
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
/** The identifiers that name an observation for good; a segment's own depends on its sample count, which a span does not carry. */
|
|
40
|
+
const deleteTargetsOf = observations => observations.flatMap(({
|
|
41
|
+
identifier = []
|
|
42
|
+
}) => identifier.flatMap(({
|
|
43
|
+
system,
|
|
44
|
+
value
|
|
45
|
+
}) => system && value && system !== SEGMENT_IDENTIFIER_SYSTEM ? [{
|
|
46
|
+
system,
|
|
47
|
+
value
|
|
48
|
+
}] : []));
|
|
49
|
+
|
|
50
|
+
/** Queues the deletion of the live recordings a stored record replaces, so the outbox holds them before it holds the record. */
|
|
51
|
+
const replaceLiveRecordings = async (client, reading) => {
|
|
52
|
+
for (const span of reading.supersedes ?? []) {
|
|
53
|
+
for (const target of deleteTargetsOf(await observationsOfSpan(client, reading.source.address, span))) {
|
|
54
|
+
await client.outbox.enqueueDelete(target);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
export { replaceLiveRecordings };
|
|
59
|
+
//# sourceMappingURL=live-supersession.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["MeasurementTypeKey","SEGMENT_IDENTIFIER_SYSTEM","liveSourceId","seriesFieldOf","seriesObservationsOf","signedInPatientId","LIVE_SLOT_MS","observationsOfSpan","client","address","span","patientId","sourceId","channel","field","metric","start","from","intervalMs","values","measurement","measurementTypeKey","ecg","diagramPoints","duration","recordedAt","measurements","build","deleteTargetsOf","observations","flatMap","identifier","system","value","replaceLiveRecordings","reading","supersedes","target","source","outbox","enqueueDelete"],"sourceRoot":"../../../../../../src","sources":["modules/next/bluetooth/adapters/live-supersession.ts"],"mappings":";;AAAA,SAAyBA,kBAAkB,EAAQC,yBAAyB,QAAQ,iBAAiB;AAMrG,SAASC,YAAY,QAAQ,wBAAqB;AAClD,SAASC,aAAa,EAAEC,oBAAoB,EAAEC,iBAAiB,QAAQ,oBAAiB;;AAExF;;AAGA,MAAMC,YAAY,GAAG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gB,KAAoB;EACnG,KAAK,MAAMzB,IAAI,IAAIyB,OAAO,CAACC,UAAU,IAAI,EAAE,EAAE;IAC3C,KAAK,MAAMC,MAAM,IAAIT,eAAe,CAAC,MAAMrB,kBAAkB,CAACC,MAAM,EAAE2B,OAAO,CAACG,MAAM,CAAC7B,OAAO,EAAEC,IAAI,CAAC,CAAC,EAAE;MACpG,MAAMF,MAAM,CAAC+B,MAAM,CAACC,aAAa,CAACH,MAAM,CAAC;IAC3C;EACF;AACF,CAAC;AAED,SAASH,qBAAqB","ignoreList":[]}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { silentLogger } from "../core/ports.js";
|
|
4
|
+
const idsOf = items => new Set(items.map(({
|
|
5
|
+
id
|
|
6
|
+
}) => id));
|
|
7
|
+
const itemsIn = (items, state) => idsOf(items.filter(item => item.state === state));
|
|
8
|
+
const viewOf = (items, sent) => ({
|
|
9
|
+
waiting: itemsIn(items, "pending"),
|
|
10
|
+
rejected: itemsIn(items, "rejected"),
|
|
11
|
+
sent: idsOf(sent)
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
/** Watches the signed-in account's Ovok outbox, so the reading log and the notification follow what it sends. */
|
|
15
|
+
const ovokOutboxWatch = (outbox, logger = silentLogger) => ({
|
|
16
|
+
subscribe: listener => {
|
|
17
|
+
let requests = 0;
|
|
18
|
+
let watching = true;
|
|
19
|
+
|
|
20
|
+
// The outbox's snapshot only says something changed; the items say what.
|
|
21
|
+
const stop = outbox.subscribe(() => {
|
|
22
|
+
const request = ++requests;
|
|
23
|
+
void outbox.items().then(items => {
|
|
24
|
+
if (watching && request === requests) {
|
|
25
|
+
listener(viewOf(items, outbox.recentlySent()));
|
|
26
|
+
}
|
|
27
|
+
}, error => logger.error("bluetooth.outbox-watch.failed", {
|
|
28
|
+
error: error.name
|
|
29
|
+
}));
|
|
30
|
+
});
|
|
31
|
+
return () => {
|
|
32
|
+
watching = false;
|
|
33
|
+
stop();
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
export { ovokOutboxWatch };
|
|
38
|
+
//# sourceMappingURL=ovok-outbox-watch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["silentLogger","idsOf","items","Set","map","id","itemsIn","state","filter","item","viewOf","sent","waiting","rejected","ovokOutboxWatch","outbox","logger","subscribe","listener","requests","watching","stop","request","then","recentlySent","error","name"],"sourceRoot":"../../../../../../src","sources":["modules/next/bluetooth/adapters/ovok-outbox-watch.ts"],"mappings":";;AAGA,SAAiBA,YAAY,QAAQ,kBAAe;AAIpD,MAAMC,KAAK,GAAIC,KAAoC,IAAkB,IAAIC,GAAG,CAACD,KAAK,CAACE,GAAG,CAAC,CAAC;EAAEC;AAAG,CAAC,KAAKA,EAAE,CAAC,CAAC;AAEvG,MAAMC,OAAO,GAAGA,CAACJ,KAA0B,EAAEK,KAAkB,KAC7DN,KAAK,CAACC,KAAK,CAACM,MAAM,CAAEC,IAAI,IAAKA,IAAI,CAACF,KAAK,KAAKA,KAAK,CAAC,CAAC;AAErD,MAAMG,MAAM,GAAGA,CAACR,KAA0B,EAAES,IAAsB,MAAkB;EAClFC,OAAO,EAAEN,OAAO,CAACJ,KAAK,EAAE,SAAS,CAAC;EAClCW,QAAQ,EAAEP,OAAO,CAACJ,KAAK,EAAE,UAAU,CAAC;EACpCS,IAAI,EAAEV,KAAK,CAACU,IAAI;AAClB,CAAC,CAAC;;AAEF;AACA,MAAMG,eAAe,GAAGA,CAACC,MAAqB,EAAEC,MAAc,GAAGhB,YAAY,MAAmB;EAC9FiB,SAAS,EAAGC,QAAQ,IAAK;IACvB,IAAIC,QAAQ,GAAG,CAAC;IAChB,IAAIC,QAAQ,GAAG,IAAI;;IAEnB;IACA,MAAMC,IAAI,GAAGN,MAAM,CAACE,SAAS,CAAC,MAAM;MAClC,MAAMK,OAAO,GAAG,EAAEH,QAAQ;MAE1B,KAAKJ,MAAM,CAACb,KAAK,CAAC,CAAC,CAACqB,IAAI,CACrBrB,KAAK,IAAK;QACT,IAAIkB,QAAQ,IAAIE,OAAO,KAAKH,QAAQ,EAAE;UACpCD,QAAQ,CAACR,MAAM,CAACR,KAAK,EAAEa,MAAM,CAACS,YAAY,CAAC,CAAC,CAAC,CAAC;QAChD;MACF,CAAC,EACAC,KAAc,IAAKT,MAAM,CAACS,KAAK,CAAC,+BAA+B,EAAE;QAAEA,KAAK,EAAGA,KAAK,CAAWC;MAAK,CAAC,CACpG,CAAC;IACH,CAAC,CAAC;IAEF,OAAO,MAAM;MACXN,QAAQ,GAAG,KAAK;MAChBC,IAAI,CAAC,CAAC;IACR,CAAC;EACH;AACF,CAAC,CAAC;AAEF,SAASP,eAAe","ignoreList":[]}
|
|
@@ -2,34 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
import { MeasurementTypeKey } from "@ovok/core/next";
|
|
4
4
|
import { DeviceError } from "../core/errors.js";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
/** A device's UCUM unit to the unit Ovok stores the value in: mg/dL, kg, °C, mmHg, L, L/s or %. */
|
|
12
|
-
const TO_OVOK_UNIT = {
|
|
13
|
-
"mg/dL": value => value,
|
|
14
|
-
"mmol/L": value => value * MG_PER_DL_PER_MMOL_PER_L,
|
|
15
|
-
kg: value => value,
|
|
16
|
-
"[lb_av]": value => value * KG_PER_POUND,
|
|
17
|
-
"[stone_av]": value => value * KG_PER_STONE,
|
|
18
|
-
Cel: value => value,
|
|
19
|
-
"[degF]": value => (value - FAHRENHEIT_ZERO_IN_CELSIUS_STEPS) * 5 / 9,
|
|
20
|
-
"mm[Hg]": value => value,
|
|
21
|
-
kPa: value => value * MMHG_PER_KPA,
|
|
22
|
-
L: value => value,
|
|
23
|
-
"L/s": value => value,
|
|
24
|
-
"%": value => value
|
|
25
|
-
};
|
|
26
|
-
const valueOf = (reading, metric) => reading.values[metric]?.value;
|
|
27
|
-
|
|
28
|
-
/** The value in Ovok's unit; `undefined` when the reading lacks it or uses a unit Ovok has no conversion for. */
|
|
29
|
-
const ovokValueOf = (reading, metric) => {
|
|
30
|
-
const quantity = reading.values[metric];
|
|
31
|
-
return quantity && TO_OVOK_UNIT[quantity.unit]?.(quantity.value);
|
|
32
|
-
};
|
|
5
|
+
import { ecgMeasurements } from "./ecg-measurements.js";
|
|
6
|
+
import { replaceLiveRecordings } from "./live-supersession.js";
|
|
7
|
+
import { partSourceId, sourceIdOf } from "./reading-source-id.js";
|
|
8
|
+
import { ovokValueOf, valueOf } from "./reading-values.js";
|
|
9
|
+
import { isSeriesReading, saveSeries } from "./series-saving.js";
|
|
33
10
|
const flagSet = (reading, code) => reading.deviceFlags.some(flag => flag.code === code && flag.raw !== 0) ? true : undefined;
|
|
34
11
|
const bloodPressure = reading => ({
|
|
35
12
|
measurementTypeKey: MeasurementTypeKey.bloodPressure,
|
|
@@ -73,32 +50,16 @@ const pulseOximetry = reading => ({
|
|
|
73
50
|
perfusionIndex: valueOf(reading, "perfusion_index"),
|
|
74
51
|
recordedAt: reading.takenAt ?? undefined
|
|
75
52
|
});
|
|
76
|
-
|
|
77
|
-
/** Ovok stores ECG points in millivolts; a trace in any other unit is left out rather than mislabelled. */
|
|
78
|
-
const ECG_POINT_UNIT = "mV";
|
|
79
|
-
const ecg = reading => {
|
|
80
|
-
const waveform = reading.waveform?.unit === ECG_POINT_UNIT ? reading.waveform : undefined;
|
|
81
|
-
const samples = waveform?.samples[0] ?? new Int16Array(0);
|
|
82
|
-
return {
|
|
83
|
-
measurementTypeKey: MeasurementTypeKey.ecg,
|
|
84
|
-
heartRate: valueOf(reading, "heart_rate"),
|
|
85
|
-
diagramPoints: Array.from(samples, sample => sample * (waveform?.scale ?? 1)),
|
|
86
|
-
duration: waveform ? samples.length / waveform.sampleRateHz : undefined,
|
|
87
|
-
recordedAt: reading.takenAt ?? undefined
|
|
88
|
-
};
|
|
89
|
-
};
|
|
90
|
-
|
|
91
|
-
/** A per-second series, such as an ER1 trend, has no single-value measurement; it waits for series saving in core. */
|
|
92
|
-
const heartRate = reading => reading.series ? undefined : {
|
|
53
|
+
const heartRate = reading => ({
|
|
93
54
|
measurementTypeKey: MeasurementTypeKey.heartRate,
|
|
94
55
|
heartRate: valueOf(reading, "heart_rate"),
|
|
95
56
|
recordedAt: reading.takenAt ?? undefined
|
|
96
|
-
};
|
|
97
|
-
const respiratoryRate = reading =>
|
|
57
|
+
});
|
|
58
|
+
const respiratoryRate = reading => ({
|
|
98
59
|
measurementTypeKey: MeasurementTypeKey.respiratoryRate,
|
|
99
60
|
respiratoryRate: valueOf(reading, "respiration_rate"),
|
|
100
61
|
recordedAt: reading.takenAt ?? undefined
|
|
101
|
-
};
|
|
62
|
+
});
|
|
102
63
|
const LIPID_METRICS = ["blood_cholesterol", "hdl_cholesterol", "ldl_cholesterol", "triglycerides"];
|
|
103
64
|
const LIPID_UNITS = ["mg/dL", "mmol/L"];
|
|
104
65
|
const isLipidUnit = unit => LIPID_UNITS.some(lipidUnit => lipidUnit === unit);
|
|
@@ -133,20 +94,24 @@ const spirometry = reading => {
|
|
|
133
94
|
recordedAt: reading.takenAt ?? undefined
|
|
134
95
|
} : undefined;
|
|
135
96
|
};
|
|
97
|
+
const single = measure => reading => {
|
|
98
|
+
const measurement = measure(reading);
|
|
99
|
+
return measurement ? [measurement] : [];
|
|
100
|
+
};
|
|
136
101
|
|
|
137
|
-
/** How each reading type becomes an
|
|
102
|
+
/** How each reading type becomes Ovok measurements, one for most and one per channel for an ECG; a type missing here cannot be saved yet. */
|
|
138
103
|
const MEASUREMENTS = {
|
|
139
|
-
blood_pressure: bloodPressure,
|
|
140
|
-
blood_glucose: bloodGlucose,
|
|
141
|
-
blood_cholesterol: lipidPanel,
|
|
142
|
-
ecg,
|
|
143
|
-
heart_rate: heartRate,
|
|
144
|
-
oxygen_saturation: pulseOximetry,
|
|
145
|
-
respiration_rate: respiratoryRate,
|
|
146
|
-
spirometry,
|
|
147
|
-
temperature: bodyTemperature,
|
|
148
|
-
triglycerides: lipidPanel,
|
|
149
|
-
weight: bodyWeight
|
|
104
|
+
blood_pressure: single(bloodPressure),
|
|
105
|
+
blood_glucose: single(bloodGlucose),
|
|
106
|
+
blood_cholesterol: single(lipidPanel),
|
|
107
|
+
ecg: ecgMeasurements,
|
|
108
|
+
heart_rate: single(heartRate),
|
|
109
|
+
oxygen_saturation: single(pulseOximetry),
|
|
110
|
+
respiration_rate: single(respiratoryRate),
|
|
111
|
+
spirometry: single(spirometry),
|
|
112
|
+
temperature: single(bodyTemperature),
|
|
113
|
+
triglycerides: single(lipidPanel),
|
|
114
|
+
weight: single(bodyWeight)
|
|
150
115
|
};
|
|
151
116
|
const deviceOf = (reading, device) => ({
|
|
152
117
|
id: reading.source.address,
|
|
@@ -163,24 +128,60 @@ const deviceOf = (reading, device) => ({
|
|
|
163
128
|
batteryPercentage: device.battery?.percent
|
|
164
129
|
});
|
|
165
130
|
|
|
166
|
-
/**
|
|
131
|
+
/** What the sink saves with: the measurements API, the outbox that deletes, and the session that names the patient. */
|
|
132
|
+
|
|
133
|
+
const unsupported = what => new DeviceError("unsupported", `Ovok cannot save ${what} yet`);
|
|
134
|
+
|
|
135
|
+
/** Live numbers are saved as series and a live ECG as a recording; any other live trace has no place in Ovok yet. */
|
|
136
|
+
const isUnsavableLive = reading => reading.live !== undefined && reading.series === undefined && reading.type !== "ecg";
|
|
137
|
+
const hasValues = reading => Object.keys(reading.values).length > 0;
|
|
138
|
+
const saveMeasurements = async (client, reading, device) => {
|
|
139
|
+
const measurements = MEASUREMENTS[reading.type]?.(reading) ?? [];
|
|
140
|
+
if (measurements.length === 0) {
|
|
141
|
+
throw unsupported(`a ${reading.type} reading of this shape`);
|
|
142
|
+
}
|
|
143
|
+
const results = [];
|
|
144
|
+
for (const [index, measurement] of measurements.entries()) {
|
|
145
|
+
results.push(await client.measurements.save({
|
|
146
|
+
measurement,
|
|
147
|
+
sourceId: partSourceId(sourceIdOf(reading), index),
|
|
148
|
+
effectiveDateTime: reading.takenAt ?? undefined,
|
|
149
|
+
device
|
|
150
|
+
}));
|
|
151
|
+
}
|
|
152
|
+
return results;
|
|
153
|
+
};
|
|
154
|
+
|
|
155
|
+
/** Queued when any part of the reading is, with the outbox item of each queued part. */
|
|
156
|
+
const receiptOf = results => {
|
|
157
|
+
const queueIds = results.flatMap(result => result.status === "queued" ? [result.queueId] : []);
|
|
158
|
+
return queueIds.length > 0 ? {
|
|
159
|
+
status: "queued",
|
|
160
|
+
queueIds
|
|
161
|
+
} : {
|
|
162
|
+
status: "saved"
|
|
163
|
+
};
|
|
164
|
+
};
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* Saves readings for the signed-in account through the Ovok measurements API, queueing them offline. A reading with a
|
|
168
|
+
* series also saves it; a stored record then removes the live recordings it replaces, once it is saved.
|
|
169
|
+
*/
|
|
167
170
|
const ovokReadingSink = client => ({
|
|
168
171
|
save: async (reading, device) => {
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
throw new DeviceError("unsupported", `Ovok cannot save a ${reading.type} reading of this shape yet`);
|
|
172
|
+
if (isUnsavableLive(reading)) {
|
|
173
|
+
throw unsupported(`a live ${reading.live?.metric} recording`);
|
|
172
174
|
}
|
|
173
|
-
const
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
return result.status;
|
|
175
|
+
const target = deviceOf(reading, device);
|
|
176
|
+
const results = [];
|
|
177
|
+
if (isSeriesReading(reading)) {
|
|
178
|
+
results.push(await saveSeries(client, reading, target));
|
|
179
|
+
}
|
|
180
|
+
if (!isSeriesReading(reading) || hasValues(reading)) {
|
|
181
|
+
results.push(...(await saveMeasurements(client, reading, target)));
|
|
182
|
+
}
|
|
183
|
+
await replaceLiveRecordings(client, reading);
|
|
184
|
+
return receiptOf(results);
|
|
184
185
|
}
|
|
185
186
|
});
|
|
186
187
|
export { ovokReadingSink };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["MeasurementTypeKey","DeviceError","
|
|
1
|
+
{"version":3,"names":["MeasurementTypeKey","DeviceError","ecgMeasurements","replaceLiveRecordings","partSourceId","sourceIdOf","ovokValueOf","valueOf","isSeriesReading","saveSeries","flagSet","reading","code","deviceFlags","some","flag","raw","undefined","bloodPressure","measurementTypeKey","systolic","diastolic","meanArterialPressure","heartRate","irregularHeartbeat","recordedAt","takenAt","bloodGlucose","bloodGlucoseValue","bodyWeight","weight","bodyTemperature","temperature","bodyTemp","pulseOximetry","bloodOxygenPulseRate","bloodOxygen","pulseRate","perfusionIndex","respiratoryRate","LIPID_METRICS","LIPID_UNITS","isLipidUnit","unit","lipidUnit","lipidPanel","units","Set","flatMap","metric","values","size","totalCholesterol","hdlCholesterol","ldlCholesterol","triglycerides","spirometry","fvc","fev1","pef","fef2575","Object","value","spirometryPanel","single","measure","measurement","MEASUREMENTS","blood_pressure","blood_glucose","blood_cholesterol","ecg","heart_rate","oxygen_saturation","respiration_rate","deviceOf","device","id","source","address","name","model","localName","manufacturerData","manufacturerName","identity","manufacturer","sn","serial","variant","vendor","batteryPercentage","battery","percent","unsupported","what","isUnsavableLive","live","series","type","hasValues","keys","length","saveMeasurements","client","measurements","results","index","entries","push","save","sourceId","effectiveDateTime","receiptOf","queueIds","result","status","queueId","ovokReadingSink","target"],"sourceRoot":"../../../../../../src","sources":["modules/next/bluetooth/adapters/ovok-reading-sink.ts"],"mappings":";;AAAA,SAQEA,kBAAkB,QAKb,iBAAiB;AAGxB,SAASC,WAAW,QAAQ,mBAAgB;AAM5C,SAASC,eAAe,QAAQ,uBAAoB;AACpD,SAASC,qBAAqB,QAA4B,wBAAqB;AAC/E,SAASC,YAAY,EAAEC,UAAU,QAAQ,wBAAqB;AAC9D,SAASC,WAAW,EAAEC,OAAO,QAAQ,qBAAkB;AACvD,SAASC,eAAe,EAA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C,IAAIyF,SAAS,CAACzF,OAAO,CAAC,EAAE;MACnD+F,OAAO,CAACG,IAAI,CAAC,IAAI,MAAMN,gBAAgB,CAACC,MAAM,EAAE7F,OAAO,EAAE4G,MAAM,CAAC,CAAC,CAAC;IACpE;IAEA,MAAMpH,qBAAqB,CAACqG,MAAM,EAAE7F,OAAO,CAAC;IAE5C,OAAOsG,SAAS,CAACP,OAAO,CAAC;EAC3B;AACF,CAAC,CAAC;AAEF,SAASY,eAAe","ignoreList":[]}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/** The name a live recording is saved under: the device, what it holds, and when it began. */
|
|
4
|
+
const liveSourceId = (address, {
|
|
5
|
+
metric,
|
|
6
|
+
channel,
|
|
7
|
+
from
|
|
8
|
+
}) => ["bluetooth", address, "live", metric, ...(channel === null ? [] : [channel]), from.getTime()].join(":");
|
|
9
|
+
|
|
10
|
+
/** The stable name a reading is saved under, so saving it again writes the same data; `undefined` for a measurement the device does not store. */
|
|
11
|
+
const sourceIdOf = ({
|
|
12
|
+
live,
|
|
13
|
+
source: {
|
|
14
|
+
address,
|
|
15
|
+
recordId
|
|
16
|
+
}
|
|
17
|
+
}) => {
|
|
18
|
+
if (live) {
|
|
19
|
+
return liveSourceId(address, live);
|
|
20
|
+
}
|
|
21
|
+
return recordId === null ? undefined : `bluetooth:${address}:${recordId}`;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
/** The name of the `index`th recording of a reading with several, such as the channels of an ECG; the first keeps the reading's own. */
|
|
25
|
+
const partSourceId = (sourceId, index) => sourceId !== undefined && index > 0 ? `${sourceId}:${index}` : sourceId;
|
|
26
|
+
export { liveSourceId, partSourceId, sourceIdOf };
|
|
27
|
+
//# sourceMappingURL=reading-source-id.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["liveSourceId","address","metric","channel","from","getTime","join","sourceIdOf","live","source","recordId","undefined","partSourceId","sourceId","index"],"sourceRoot":"../../../../../../src","sources":["modules/next/bluetooth/adapters/reading-source-id.ts"],"mappings":";;AAEA;AACA,MAAMA,YAAY,GAAGA,CAACC,OAAe,EAAE;EAAEC,MAAM;EAAEC,OAAO;EAAEC;AAAe,CAAC,KACxE,CAAC,WAAW,EAAEH,OAAO,EAAE,MAAM,EAAEC,MAAM,EAAE,IAAIC,OAAO,KAAK,IAAI,GAAG,EAAE,GAAG,CAACA,OAAO,CAAC,CAAC,EAAEC,IAAI,CAACC,OAAO,CAAC,CAAC,CAAC,CAACC,IAAI,CAAC,GAAG,CAAC;;AAE1G;AACA,MAAMC,UAAU,GAAGA,CAAC;EAAEC,IAAI;EAAEC,MAAM,EAAE;IAAER,OAAO;IAAES;EAAS;AAAW,CAAC,KAAyB;EAC3F,IAAIF,IAAI,EAAE;IACR,OAAOR,YAAY,CAACC,OAAO,EAAEO,IAAI,CAAC;EACpC;EAEA,OAAOE,QAAQ,KAAK,IAAI,GAAGC,SAAS,GAAG,aAAaV,OAAO,IAAIS,QAAQ,EAAE;AAC3E,CAAC;;AAED;AACA,MAAME,YAAY,GAAGA,CAACC,QAA4B,EAAEC,KAAa,KAC/DD,QAAQ,KAAKF,SAAS,IAAIG,KAAK,GAAG,CAAC,GAAG,GAAGD,QAAQ,IAAIC,KAAK,EAAE,GAAGD,QAAQ;AAEzE,SAASb,YAAY,EAAEY,YAAY,EAAEL,UAAU","ignoreList":[]}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
const MG_PER_DL_PER_MMOL_PER_L = 18.0182;
|
|
4
|
+
const KG_PER_POUND = 0.45359237;
|
|
5
|
+
const KG_PER_STONE = 6.35029318;
|
|
6
|
+
const MMHG_PER_KPA = 7.50062;
|
|
7
|
+
const FAHRENHEIT_ZERO_IN_CELSIUS_STEPS = 32;
|
|
8
|
+
|
|
9
|
+
/** A device's UCUM unit to the unit Ovok stores the value in: mg/dL, kg, °C, mmHg, L, L/s, % or per minute. */
|
|
10
|
+
const TO_OVOK_UNIT = {
|
|
11
|
+
"mg/dL": value => value,
|
|
12
|
+
"mmol/L": value => value * MG_PER_DL_PER_MMOL_PER_L,
|
|
13
|
+
kg: value => value,
|
|
14
|
+
"[lb_av]": value => value * KG_PER_POUND,
|
|
15
|
+
"[stone_av]": value => value * KG_PER_STONE,
|
|
16
|
+
Cel: value => value,
|
|
17
|
+
"[degF]": value => (value - FAHRENHEIT_ZERO_IN_CELSIUS_STEPS) * 5 / 9,
|
|
18
|
+
"mm[Hg]": value => value,
|
|
19
|
+
kPa: value => value * MMHG_PER_KPA,
|
|
20
|
+
L: value => value,
|
|
21
|
+
"L/s": value => value,
|
|
22
|
+
"%": value => value,
|
|
23
|
+
"/min": value => value
|
|
24
|
+
};
|
|
25
|
+
const valueOf = (reading, metric) => reading.values[metric]?.value;
|
|
26
|
+
|
|
27
|
+
/** The value in Ovok's unit; `undefined` when the reading lacks it or uses a unit Ovok has no conversion for. */
|
|
28
|
+
const ovokValueOf = (reading, metric) => {
|
|
29
|
+
const quantity = reading.values[metric];
|
|
30
|
+
return quantity && TO_OVOK_UNIT[quantity.unit]?.(quantity.value);
|
|
31
|
+
};
|
|
32
|
+
export { ovokValueOf, TO_OVOK_UNIT, valueOf };
|
|
33
|
+
//# sourceMappingURL=reading-values.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["MG_PER_DL_PER_MMOL_PER_L","KG_PER_POUND","KG_PER_STONE","MMHG_PER_KPA","FAHRENHEIT_ZERO_IN_CELSIUS_STEPS","TO_OVOK_UNIT","value","kg","Cel","kPa","L","valueOf","reading","metric","values","ovokValueOf","quantity","unit"],"sourceRoot":"../../../../../../src","sources":["modules/next/bluetooth/adapters/reading-values.ts"],"mappings":";;AAGA,MAAMA,wBAAwB,GAAG,OAAO;AACxC,MAAMC,YAAY,GAAG,UAAU;AAC/B,MAAMC,YAAY,GAAG,UAAU;AAC/B,MAAMC,YAAY,GAAG,OAAO;A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../core/errors.js";
|
|
5
|
+
import { sourceIdOf } from "./reading-source-id.js";
|
|
6
|
+
import { TO_OVOK_UNIT } from "./reading-values.js";
|
|
7
|
+
|
|
8
|
+
/** What saves and signs a series: the measurements API and the session. */
|
|
9
|
+
|
|
10
|
+
/** A reading that holds a series. */
|
|
11
|
+
|
|
12
|
+
/** Where Ovok keeps one metric's series: the measurement type and the property on it. */
|
|
13
|
+
|
|
14
|
+
const SERIES_FIELDS = {
|
|
15
|
+
heart_rate: {
|
|
16
|
+
type: MeasurementTypeKey.heartRate,
|
|
17
|
+
property: "heartRate"
|
|
18
|
+
},
|
|
19
|
+
pulse_rate: {
|
|
20
|
+
type: MeasurementTypeKey.bloodOxygenPulseRate,
|
|
21
|
+
property: "pulseRate"
|
|
22
|
+
},
|
|
23
|
+
spo2: {
|
|
24
|
+
type: MeasurementTypeKey.bloodOxygenPulseRate,
|
|
25
|
+
property: "bloodOxygen"
|
|
26
|
+
},
|
|
27
|
+
respiration_rate: {
|
|
28
|
+
type: MeasurementTypeKey.respiratoryRate,
|
|
29
|
+
property: "respiratoryRate"
|
|
30
|
+
},
|
|
31
|
+
body_temperature: {
|
|
32
|
+
type: MeasurementTypeKey.temperature,
|
|
33
|
+
property: "bodyTemp"
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
const unsupported = what => new DeviceError("unsupported", `Ovok cannot save ${what} as a series`);
|
|
37
|
+
const isSeriesReading = reading => reading.series !== undefined;
|
|
38
|
+
|
|
39
|
+
/** The field Ovok keeps a metric's series in; `undefined` for a metric it keeps none for. */
|
|
40
|
+
const seriesFieldOf = metric => SERIES_FIELDS[metric];
|
|
41
|
+
|
|
42
|
+
/** The id of the signed-in patient, which a series is saved for. */
|
|
43
|
+
const signedInPatientId = async ({
|
|
44
|
+
session
|
|
45
|
+
}) => {
|
|
46
|
+
const current = await session.current();
|
|
47
|
+
if (!current) {
|
|
48
|
+
throw new DeviceError("save-failed", "Sign in to save a series");
|
|
49
|
+
}
|
|
50
|
+
const {
|
|
51
|
+
reference
|
|
52
|
+
} = current.profile;
|
|
53
|
+
return reference.slice(reference.indexOf("/") + 1);
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
/** The observations that hold one metric's values, one per second or at the interval given. */
|
|
57
|
+
const seriesObservationsOf = (field, {
|
|
58
|
+
start,
|
|
59
|
+
intervalMs,
|
|
60
|
+
values
|
|
61
|
+
}, rest) => seriesObservations({
|
|
62
|
+
series: {
|
|
63
|
+
measurementTypeKey: field.type,
|
|
64
|
+
start,
|
|
65
|
+
periodMs: intervalMs,
|
|
66
|
+
values: {
|
|
67
|
+
[field.property]: values
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
...rest
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
/** Saves a series, in Ovok's unit, under a stable id; saving a longer version of it writes over the earlier one. */
|
|
74
|
+
const saveSeries = async (client, reading, device) => {
|
|
75
|
+
const {
|
|
76
|
+
series
|
|
77
|
+
} = reading;
|
|
78
|
+
const field = seriesFieldOf(series.metric);
|
|
79
|
+
const toOvokUnit = TO_OVOK_UNIT[series.unit];
|
|
80
|
+
if (!field || !toOvokUnit) {
|
|
81
|
+
throw unsupported(`${series.metric} in ${series.unit}`);
|
|
82
|
+
}
|
|
83
|
+
const observations = seriesObservationsOf(field, {
|
|
84
|
+
...series,
|
|
85
|
+
values: series.values.map(value => value === null ? null : toOvokUnit(value))
|
|
86
|
+
}, {
|
|
87
|
+
patientId: await signedInPatientId(client),
|
|
88
|
+
sourceId: sourceIdOf(reading),
|
|
89
|
+
device
|
|
90
|
+
});
|
|
91
|
+
return client.measurements.saveObservations(observations);
|
|
92
|
+
};
|
|
93
|
+
export { isSeriesReading, saveSeries, seriesFieldOf, seriesObservationsOf, signedInPatientId };
|
|
94
|
+
//# sourceMappingURL=series-saving.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["MeasurementTypeKey","seriesObservations","DeviceError","sourceIdOf","TO_OVOK_UNIT","SERIES_FIELDS","heart_rate","type","heartRate","property","pulse_rate","bloodOxygenPulseRate","spo2","respiration_rate","respiratoryRate","body_temperature","temperature","unsupported","what","isSeriesReading","reading","series","undefined","seriesFieldOf","metric","signedInPatientId","session","current","reference","profile","slice","indexOf","seriesObservationsOf","field","start","intervalMs","values","rest","measurementTypeKey","periodMs","saveSeries","client","device","toOvokUnit","unit","observations","map","value","patientId","sourceId","measurements","saveObservations"],"sourceRoot":"../../../../../../src","sources":["modules/next/bluetooth/adapters/series-saving.ts"],"mappings":";;AAAA,SAAkCA,kBAAkB,EAAgCC,kBAAkB,QAAiC,iBAAiB;AAExJ,SAASC,WAAW,QAAQ,mBAAgB;AAI5C,SAASC,UAAU,QAAQ,wBAAqB;AAChD,SAASC,YAAY,QAAQ,qBAAkB;;AAI/C;;AAGA;;AAGA;;AAGA,MAAMC,aAAuD,GAAG;EAC9DC,UAAU,EAAE;IAAEC,IAAI,EAAEP,kBAAkB,CAACQ,SAAS;IAAEC,QAAQ,EAAE;EAAY,CAAC;EACzEC,UAAU,EAAE;IAAEH,IAAI,EAAEP,kBAAkB,CAACW,oBAAoB;IAAEF,QAAQ,EAAE;EAAY,CAAC;EACpFG,IAAI,EAAE;IAAEL,IAAI,EAAEP,kBAAkB,CAACW,oBAAoB;IAAEF,QAAQ,EAAE;EAAc,CAAC;EAChFI,gBAAgB,EAAE;IAAEN,IAAI,EAAEP,kBAAkB,CAACc,eAAe;IAAEL,QAAQ,EAAE;EAAkB,CAAC;EAC3FM,gBAAgB,EAAE;IAAER,IAAI,EAAEP,kBAAkB,CAACgB,WAAW;IAAEP,QAAQ,EAAE;EAAW;AACjF,CAAC;AAED,MAAMQ,WAAW,GAAIC,IAAY,IAAkB,IAAIhB,WAAW,CAAC,aAAa,EAAE,oBAAoBgB,IAAI,cAAc,CAAC;AAEzH,MAAMC,eAAe,GAAIC,OAAgB,IAA+BA,OAAO,CAACC,MAAM,KAAKC,SAAS;;AAEpG;AACA,MAAMC,aAAa,GAA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,GAAGb,oBAAoB,CACvCC,KAAK,EACL;IAAE,GAAGZ,MAAM;IAAEe,MAAM,EAAEf,MAAM,CAACe,MAAM,CAACU,GAAG,CAAEC,KAAK,IAAMA,KAAK,KAAK,IAAI,GAAG,IAAI,GAAGJ,UAAU,CAACI,KAAK,CAAE;EAAE,CAAC,EAChG;IAAEC,SAAS,EAAE,MAAMvB,iBAAiB,CAACgB,MAAM,CAAC;IAAEQ,QAAQ,EAAE9C,UAAU,CAACiB,OAAO,CAAC;IAAEsB;EAAO,CACtF,CAAC;EAED,OAAOD,MAAM,CAACS,YAAY,CAACC,gBAAgB,CAACN,YAAY,CAAC;AAC3D,CAAC;AAED,SAAS1B,eAAe,EAAEqB,UAAU,EAAEjB,aAAa,EAAES,oBAAoB,EAAEP,iBAAiB","ignoreList":[]}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/** A value SQLite binds to a `?` placeholder. */
|
|
4
|
+
|
|
5
|
+
/** The part of an `expo-sqlite` transaction the outbox store uses. */
|
|
6
|
+
|
|
7
|
+
/** The part of an `expo-sqlite` database the outbox store uses. */
|
|
8
|
+
|
|
9
|
+
const loadExpoSqlite = () => {
|
|
10
|
+
try {
|
|
11
|
+
return require("expo-sqlite");
|
|
12
|
+
} catch {
|
|
13
|
+
throw new Error("SqliteOutboxStore requires the optional expo-sqlite peer dependency");
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
/** Opens the named database with `expo-sqlite`, which an app without the package never loads. */
|
|
18
|
+
const openExpoSqlite = name => loadExpoSqlite().openDatabaseAsync(name);
|
|
19
|
+
export { openExpoSqlite };
|
|
20
|
+
//# sourceMappingURL=sqlite-database.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["loadExpoSqlite","require","Error","openExpoSqlite","name","openDatabaseAsync"],"sourceRoot":"../../../../../../src","sources":["modules/next/bluetooth/adapters/sqlite-database.ts"],"mappings":";;AAAA;;AAGA;;AAaA;;AAYA,MAAMA,cAAc,GAAGA,CAAA,KAAkB;EACvC,IAAI;IACF,OAAOC,OAAO,CAAC,aAAa,CAAC;EAC/B,CAAC,CAAC,MAAM;IACN,MAAM,IAAIC,KAAK,CAAC,qEAAqE,CAAC;EACxF;AACF,CAAC;;AAED;AACA,MAAMC,cAAc,GAAIC,IAAY,IAA8BJ,cAAc,CAAC,CAAC,CAACK,iBAAiB,CAACD,IAAI,CAAC;AAE1G,SAASD,cAAc","ignoreList":[]}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/** One row of `outbox_items`: a column per item field, the failure and the entries as JSON text. */
|
|
4
|
+
|
|
5
|
+
/** The columns of a row, in the order `bindValuesOf` binds them. */
|
|
6
|
+
const ITEM_COLUMNS = ["id", "owner_key", "kind", "group_id", "seq", "state", "attempts", "next_attempt_at", "created_at", "recorded_at", "last_failure", "entries"];
|
|
7
|
+
|
|
8
|
+
/** Everything but the entries, which a listing or a count never reads. */
|
|
9
|
+
const SUMMARY_COLUMNS = ITEM_COLUMNS.filter(column => column !== "entries");
|
|
10
|
+
const ITEM_COLUMN_LIST = ITEM_COLUMNS.join(", ");
|
|
11
|
+
const ITEM_PLACEHOLDERS = ITEM_COLUMNS.map(() => "?").join(", ");
|
|
12
|
+
const SUMMARY_COLUMN_LIST = SUMMARY_COLUMNS.join(", ");
|
|
13
|
+
const rowOf = item => ({
|
|
14
|
+
id: item.id,
|
|
15
|
+
owner_key: item.ownerKey,
|
|
16
|
+
kind: item.kind,
|
|
17
|
+
group_id: item.group ?? null,
|
|
18
|
+
seq: item.seq ?? null,
|
|
19
|
+
state: item.state,
|
|
20
|
+
attempts: item.attempts,
|
|
21
|
+
next_attempt_at: item.nextAttemptAt,
|
|
22
|
+
created_at: item.createdAt,
|
|
23
|
+
recorded_at: item.recordedAt,
|
|
24
|
+
last_failure: item.lastFailure ? JSON.stringify(item.lastFailure) : null,
|
|
25
|
+
entries: JSON.stringify(item.entries)
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
/** The values of `item`, in the order of `ITEM_COLUMNS`. */
|
|
29
|
+
const bindValuesOf = item => {
|
|
30
|
+
const row = rowOf(item);
|
|
31
|
+
return ITEM_COLUMNS.map(column => row[column]);
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
/** A field that is `null` in the table is absent on the item. */
|
|
35
|
+
const summaryOf = row => ({
|
|
36
|
+
id: row.id,
|
|
37
|
+
ownerKey: row.owner_key,
|
|
38
|
+
kind: row.kind,
|
|
39
|
+
...(row.group_id !== null && {
|
|
40
|
+
group: row.group_id
|
|
41
|
+
}),
|
|
42
|
+
...(row.seq !== null && {
|
|
43
|
+
seq: row.seq
|
|
44
|
+
}),
|
|
45
|
+
state: row.state,
|
|
46
|
+
attempts: row.attempts,
|
|
47
|
+
nextAttemptAt: row.next_attempt_at,
|
|
48
|
+
createdAt: row.created_at,
|
|
49
|
+
recordedAt: row.recorded_at,
|
|
50
|
+
...(row.last_failure !== null && {
|
|
51
|
+
lastFailure: JSON.parse(row.last_failure)
|
|
52
|
+
})
|
|
53
|
+
});
|
|
54
|
+
const itemOf = row => ({
|
|
55
|
+
...summaryOf(row),
|
|
56
|
+
entries: JSON.parse(row.entries)
|
|
57
|
+
});
|
|
58
|
+
export { bindValuesOf, ITEM_COLUMN_LIST, ITEM_PLACEHOLDERS, itemOf, SUMMARY_COLUMN_LIST, summaryOf };
|
|
59
|
+
//# sourceMappingURL=sqlite-outbox-rows.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["ITEM_COLUMNS","SUMMARY_COLUMNS","filter","column","ITEM_COLUMN_LIST","join","ITEM_PLACEHOLDERS","map","SUMMARY_COLUMN_LIST","rowOf","item","id","owner_key","ownerKey","kind","group_id","group","seq","state","attempts","next_attempt_at","nextAttemptAt","created_at","createdAt","recorded_at","recordedAt","last_failure","lastFailure","JSON","stringify","entries","bindValuesOf","row","summaryOf","parse","itemOf"],"sourceRoot":"../../../../../../src","sources":["modules/next/bluetooth/adapters/sqlite-outbox-rows.ts"],"mappings":";;AAIA;;AAkBA;AACA,MAAMA,YAAY,GAAG,CACnB,IAAI,EACJ,WAAW,EACX,MAAM,EACN,UAAU,EACV,KAAK,EACL,OAAO,EACP,UAAU,EACV,iBAAiB,EACjB,YAAY,EACZ,aAAa,EACb,cAAc,EACd,SAAS,CACwC;;AAEnD;AACA,MAAMC,eAAe,GAAGD,YAAY,CAACE,MAAM,CAAEC,MAAM,IAAKA,MAAM,KAAK,SAAS,CAAC;AAE7E,MAAMC,gBAAgB,GAAGJ,YAAY,CAACK,IAAI,CAAC,IAAI,CAAC;AAChD,MAAMC,iBAAiB,GAAGN,YAAY,CAACO,GAAG,CAAC,MAAM,GAAG,CAAC,CAACF,IAAI,CAAC,IAAI,CAAC;AAChE,MAAMG,mBAAmB,GAAGP,eAAe,CAACI,IAAI,CAAC,IAAI,CAAC;AAEtD,MAAMI,KAAK,GAAIC,IAAgB,KAAiB;EAC9CC,EAAE,EAAED,IAAI,CAACC,EAAE;EACXC,SAAS,EAAEF,IAAI,CAACG,QAAQ;EACxBC,IAAI,EAAEJ,IAAI,CAACI,IAAI;EACfC,QAAQ,EAAEL,IAAI,CAACM,KAAK,IAAI,IAAI;EAC5BC,GAAG,EAAEP,IAAI,CAACO,GAAG,IAAI,IAAI;EACrBC,KAAK,EAAER,IAAI,CAACQ,KAAK;EACjBC,QAAQ,EAAET,IAAI,CAACS,QAAQ;EACvBC,eAAe,EAAEV,IAAI,CAACW,aAAa;EACnCC,UAAU,EAAEZ,IAAI,CAACa,SAAS;EAC1BC,WAAW,EAAEd,IAAI,CAACe,UAAU;EAC5BC,YAAY,EAAEhB,IAAI,CAACiB,WAAW,GAAGC,IAAI,CAACC,SAAS,CAACnB,IAAI,CAACiB,WAAW,CAAC,GAAG,IAAI;EACxEG,OAAO,EAAEF,IAAI,CAACC,SAAS,CAACnB,IAAI,CAACoB,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