@multiplayer-app/session-recorder-react-native 1.0.1-beta.1 → 1.0.1-beta.11
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/LICENSE +1 -2
- package/README.md +296 -156
- package/SessionRecorderNative.podspec +35 -14
- package/android/build.gradle +50 -54
- package/android/src/main/AndroidManifest.xml +2 -0
- package/android/src/main/java/com/sessionrecordernative/SessionRecorderNativeConfig.kt +52 -0
- package/android/src/main/java/com/sessionrecordernative/SessionRecorderNativeModule.kt +861 -0
- package/android/src/main/java/com/sessionrecordernative/SessionRecorderNativePackage.kt +33 -0
- package/android/src/main/java/com/sessionrecordernative/SessionRecorderNativeSpec.kt +79 -0
- package/android/src/main/java/com/sessionrecordernative/model/TargetInfo.kt +9 -0
- package/android/src/main/java/com/sessionrecordernative/util/ViewUtils.kt +72 -0
- package/ios/GestureTargetFinder.swift +50 -0
- package/ios/SessionRecorderNative-Bridging-Header.h +2 -0
- package/ios/{GestureRecorderNative.m → SessionRecorderNative.mm} +17 -6
- package/ios/SessionRecorderNative.swift +256 -4
- package/lib/module/SessionRecorderNativeSpec.js +5 -0
- package/lib/module/SessionRecorderNativeSpec.js.map +1 -0
- package/lib/module/components/ScreenRecorderView/ScreenRecorderView.js +23 -0
- package/lib/module/components/ScreenRecorderView/ScreenRecorderView.js.map +1 -0
- package/lib/module/components/ScreenRecorderView/index.js +4 -0
- package/lib/module/components/ScreenRecorderView/index.js.map +1 -0
- package/lib/module/components/SessionRecorderWidget/ErrorBanner.js +64 -0
- package/lib/module/components/SessionRecorderWidget/ErrorBanner.js.map +1 -0
- package/lib/module/components/SessionRecorderWidget/FinalPopover.js +74 -0
- package/lib/module/components/SessionRecorderWidget/FinalPopover.js.map +1 -0
- package/lib/module/components/SessionRecorderWidget/FloatingButton.js +191 -0
- package/lib/module/components/SessionRecorderWidget/FloatingButton.js.map +1 -0
- package/lib/module/components/SessionRecorderWidget/InitialPopover.js +138 -0
- package/lib/module/components/SessionRecorderWidget/InitialPopover.js.map +1 -0
- package/lib/module/components/SessionRecorderWidget/ModalContainer.js +177 -0
- package/lib/module/components/SessionRecorderWidget/ModalContainer.js.map +1 -0
- package/lib/module/components/SessionRecorderWidget/ModalHeader.js +27 -0
- package/lib/module/components/SessionRecorderWidget/ModalHeader.js.map +1 -0
- package/lib/module/components/SessionRecorderWidget/SessionRecorderWidget.js +133 -0
- package/lib/module/components/SessionRecorderWidget/SessionRecorderWidget.js.map +1 -0
- package/lib/module/components/SessionRecorderWidget/icons.js +93 -0
- package/lib/module/components/SessionRecorderWidget/icons.js.map +1 -0
- package/lib/module/components/SessionRecorderWidget/index.js +5 -0
- package/lib/module/components/SessionRecorderWidget/index.js.map +1 -0
- package/lib/module/components/SessionRecorderWidget/styles.js +173 -0
- package/lib/module/components/SessionRecorderWidget/styles.js.map +1 -0
- package/lib/module/components/index.js +5 -0
- package/lib/module/components/index.js.map +1 -0
- package/lib/module/config/constants.js +42 -0
- package/lib/module/config/constants.js.map +1 -0
- package/lib/module/config/defaults.js +81 -0
- package/lib/module/config/defaults.js.map +1 -0
- package/lib/module/config/index.js +9 -0
- package/lib/module/config/index.js.map +1 -0
- package/lib/module/config/masking.js +35 -0
- package/lib/module/config/masking.js.map +1 -0
- package/lib/module/config/session-recorder.js +44 -0
- package/lib/module/config/session-recorder.js.map +1 -0
- package/lib/module/config/validators.js +28 -0
- package/lib/module/config/validators.js.map +1 -0
- package/lib/module/config/widget.js +35 -0
- package/lib/module/config/widget.js.map +1 -0
- package/lib/module/context/SessionRecorderContext.js +93 -0
- package/lib/module/context/SessionRecorderContext.js.map +1 -0
- package/lib/module/context/SessionRecorderStore.js +12 -0
- package/lib/module/context/SessionRecorderStore.js.map +1 -0
- package/lib/module/context/useSessionRecorderStore.js +20 -0
- package/lib/module/context/useSessionRecorderStore.js.map +1 -0
- package/lib/module/context/useStoreSelector.js +27 -0
- package/lib/module/context/useStoreSelector.js.map +1 -0
- package/lib/module/index.js +16 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/native/SessionRecorderNative.js +79 -0
- package/lib/module/native/SessionRecorderNative.js.map +1 -0
- package/lib/module/native/index.js +4 -0
- package/lib/module/native/index.js.map +1 -0
- package/lib/module/otel/helpers.js +218 -0
- package/lib/module/otel/helpers.js.map +1 -0
- package/lib/module/otel/index.js +95 -0
- package/lib/module/otel/index.js.map +1 -0
- package/lib/module/otel/instrumentations/index.js +102 -0
- package/lib/module/otel/instrumentations/index.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/module/patch/index.js +4 -0
- package/lib/module/patch/index.js.map +1 -0
- package/lib/module/patch/xhr.js +116 -0
- package/lib/module/patch/xhr.js.map +1 -0
- package/lib/module/recorder/eventExporter.js +130 -0
- package/lib/module/recorder/eventExporter.js.map +1 -0
- package/lib/module/recorder/gestureRecorder.js +641 -0
- package/lib/module/recorder/gestureRecorder.js.map +1 -0
- package/lib/module/recorder/index.js +168 -0
- package/lib/module/recorder/index.js.map +1 -0
- package/lib/module/recorder/navigationTracker.js +228 -0
- package/lib/module/recorder/navigationTracker.js.map +1 -0
- package/lib/module/recorder/screenRecorder.js +495 -0
- package/lib/module/recorder/screenRecorder.js.map +1 -0
- package/lib/module/services/api.service.js +149 -0
- package/lib/module/services/api.service.js.map +1 -0
- package/lib/module/services/network.service.js +178 -0
- package/lib/module/services/network.service.js.map +1 -0
- package/lib/module/services/screenMaskingService.js +107 -0
- package/lib/module/services/screenMaskingService.js.map +1 -0
- package/lib/module/services/storage.service.js +179 -0
- package/lib/module/services/storage.service.js.map +1 -0
- package/lib/module/session-recorder.js +541 -0
- package/lib/module/session-recorder.js.map +1 -0
- package/lib/module/types/configs.js +4 -0
- package/lib/module/types/configs.js.map +1 -0
- package/lib/module/types/expo-constants.d.js +2 -0
- package/lib/module/types/expo-constants.d.js.map +1 -0
- package/lib/module/types/index.js +11 -0
- package/lib/module/types/index.js.map +1 -0
- package/lib/module/types/session-recorder.js +68 -0
- package/lib/module/types/session-recorder.js.map +1 -0
- package/lib/module/types/session.js +9 -0
- package/lib/module/types/session.js.map +1 -0
- package/lib/module/utils/app-metadata.js +28 -0
- package/lib/module/utils/app-metadata.js.map +1 -0
- package/lib/module/utils/constants.optional.expo.js +6 -0
- package/lib/module/utils/constants.optional.expo.js.map +1 -0
- package/lib/module/utils/constants.optional.js +8 -0
- package/lib/module/utils/constants.optional.js.map +1 -0
- package/lib/module/utils/createStore.js +27 -0
- package/lib/module/utils/createStore.js.map +1 -0
- package/lib/module/utils/index.js +11 -0
- package/lib/module/utils/index.js.map +1 -0
- package/lib/module/utils/logger.js +185 -0
- package/lib/module/utils/logger.js.map +1 -0
- package/lib/module/utils/platform.js +340 -0
- package/lib/module/utils/platform.js.map +1 -0
- package/lib/module/utils/request-utils.js +58 -0
- package/lib/module/utils/request-utils.js.map +1 -0
- package/lib/module/utils/rrweb-events.js +276 -0
- package/lib/module/utils/rrweb-events.js.map +1 -0
- package/lib/module/utils/session.js +21 -0
- package/lib/module/utils/session.js.map +1 -0
- package/lib/module/utils/shallowEqual.js +17 -0
- package/lib/module/utils/shallowEqual.js.map +1 -0
- package/lib/module/utils/time.js +17 -0
- package/lib/module/utils/time.js.map +1 -0
- package/lib/module/utils/type-utils.js +69 -0
- package/lib/module/utils/type-utils.js.map +1 -0
- package/lib/module/version.js +4 -0
- package/lib/module/version.js.map +1 -0
- package/lib/typescript/package.json +1 -0
- package/{dist/native/SessionRecorderNativeTurboSpec.d.ts → lib/typescript/src/SessionRecorderNativeSpec.d.ts} +14 -6
- package/lib/typescript/src/SessionRecorderNativeSpec.d.ts.map +1 -0
- package/lib/typescript/src/components/ScreenRecorderView/ScreenRecorderView.d.ts +6 -0
- package/lib/typescript/src/components/ScreenRecorderView/ScreenRecorderView.d.ts.map +1 -0
- package/lib/typescript/src/components/ScreenRecorderView/index.d.ts +2 -0
- package/lib/typescript/src/components/ScreenRecorderView/index.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/components/SessionRecorderWidget/ErrorBanner.d.ts +1 -0
- package/lib/typescript/src/components/SessionRecorderWidget/ErrorBanner.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/components/SessionRecorderWidget/FinalPopover.d.ts +2 -1
- package/lib/typescript/src/components/SessionRecorderWidget/FinalPopover.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/components/SessionRecorderWidget/FloatingButton.d.ts +1 -0
- package/lib/typescript/src/components/SessionRecorderWidget/FloatingButton.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/components/SessionRecorderWidget/InitialPopover.d.ts +2 -1
- package/lib/typescript/src/components/SessionRecorderWidget/InitialPopover.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/components/SessionRecorderWidget/ModalContainer.d.ts +1 -0
- package/lib/typescript/src/components/SessionRecorderWidget/ModalContainer.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/components/SessionRecorderWidget/ModalHeader.d.ts +1 -0
- package/lib/typescript/src/components/SessionRecorderWidget/ModalHeader.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/components/SessionRecorderWidget/SessionRecorderWidget.d.ts +1 -0
- package/lib/typescript/src/components/SessionRecorderWidget/SessionRecorderWidget.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/components/SessionRecorderWidget/icons.d.ts +1 -0
- package/lib/typescript/src/components/SessionRecorderWidget/icons.d.ts.map +1 -0
- package/lib/typescript/src/components/SessionRecorderWidget/index.d.ts +3 -0
- package/lib/typescript/src/components/SessionRecorderWidget/index.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/components/SessionRecorderWidget/styles.d.ts +4 -3
- package/lib/typescript/src/components/SessionRecorderWidget/styles.d.ts.map +1 -0
- package/lib/typescript/src/components/index.d.ts +3 -0
- package/lib/typescript/src/components/index.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/config/constants.d.ts +1 -0
- package/lib/typescript/src/config/constants.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/config/defaults.d.ts +2 -1
- package/lib/typescript/src/config/defaults.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/config/index.d.ts +1 -0
- package/lib/typescript/src/config/index.d.ts.map +1 -0
- package/lib/typescript/src/config/masking.d.ts +3 -0
- package/lib/typescript/src/config/masking.d.ts.map +1 -0
- package/lib/typescript/src/config/session-recorder.d.ts +3 -0
- package/lib/typescript/src/config/session-recorder.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/config/validators.d.ts +1 -0
- package/lib/typescript/src/config/validators.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/config/widget.d.ts +2 -1
- package/lib/typescript/src/config/widget.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/context/SessionRecorderContext.d.ts +3 -2
- package/lib/typescript/src/context/SessionRecorderContext.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/context/SessionRecorderStore.d.ts +2 -1
- package/lib/typescript/src/context/SessionRecorderStore.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/context/useSessionRecorderStore.d.ts +4 -3
- package/lib/typescript/src/context/useSessionRecorderStore.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/context/useStoreSelector.d.ts +2 -1
- package/lib/typescript/src/context/useStoreSelector.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/index.d.ts +2 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/lib/typescript/src/native/SessionRecorderNative.d.ts +27 -0
- package/lib/typescript/src/native/SessionRecorderNative.d.ts.map +1 -0
- package/lib/typescript/src/native/index.d.ts +2 -0
- package/lib/typescript/src/native/index.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/otel/helpers.d.ts +3 -2
- package/lib/typescript/src/otel/helpers.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/otel/index.d.ts +2 -2
- package/lib/typescript/src/otel/index.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/otel/instrumentations/index.d.ts +2 -1
- package/lib/typescript/src/otel/instrumentations/index.d.ts.map +1 -0
- package/lib/typescript/src/patch/index.d.ts +2 -0
- package/lib/typescript/src/patch/index.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/patch/xhr.d.ts +1 -0
- package/lib/typescript/src/patch/xhr.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/recorder/eventExporter.d.ts +2 -1
- package/lib/typescript/src/recorder/eventExporter.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/recorder/gestureRecorder.d.ts +3 -2
- package/lib/typescript/src/recorder/gestureRecorder.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/recorder/index.d.ts +3 -2
- package/lib/typescript/src/recorder/index.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/recorder/navigationTracker.d.ts +2 -1
- package/lib/typescript/src/recorder/navigationTracker.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/recorder/screenRecorder.d.ts +4 -4
- package/lib/typescript/src/recorder/screenRecorder.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/services/api.service.d.ts +2 -1
- package/lib/typescript/src/services/api.service.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/services/network.service.d.ts +1 -0
- package/lib/typescript/src/services/network.service.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/services/screenMaskingService.d.ts +2 -1
- package/lib/typescript/src/services/screenMaskingService.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/services/storage.service.d.ts +2 -1
- package/lib/typescript/src/services/storage.service.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/session-recorder.d.ts +3 -2
- package/lib/typescript/src/session-recorder.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/types/configs.d.ts +3 -2
- package/lib/typescript/src/types/configs.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/types/index.d.ts +1 -0
- package/lib/typescript/src/types/index.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/types/session-recorder.d.ts +7 -6
- package/lib/typescript/src/types/session-recorder.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/types/session.d.ts +1 -0
- package/lib/typescript/src/types/session.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/utils/app-metadata.d.ts +1 -0
- package/lib/typescript/src/utils/app-metadata.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/utils/constants.optional.d.ts +1 -0
- package/lib/typescript/src/utils/constants.optional.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/utils/constants.optional.expo.d.ts +1 -0
- package/lib/typescript/src/utils/constants.optional.expo.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/utils/createStore.d.ts +1 -0
- package/lib/typescript/src/utils/createStore.d.ts.map +1 -0
- package/lib/typescript/src/utils/index.d.ts +8 -0
- package/lib/typescript/src/utils/index.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/utils/logger.d.ts +2 -1
- package/lib/typescript/src/utils/logger.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/utils/platform.d.ts +2 -1
- package/lib/typescript/src/utils/platform.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/utils/request-utils.d.ts +1 -0
- package/lib/typescript/src/utils/request-utils.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/utils/rrweb-events.d.ts +2 -1
- package/lib/typescript/src/utils/rrweb-events.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/utils/session.d.ts +1 -0
- package/lib/typescript/src/utils/session.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/utils/shallowEqual.d.ts +1 -0
- package/lib/typescript/src/utils/shallowEqual.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/utils/time.d.ts +1 -0
- package/lib/typescript/src/utils/time.d.ts.map +1 -0
- package/{dist → lib/typescript/src}/utils/type-utils.d.ts +1 -0
- package/lib/typescript/src/utils/type-utils.d.ts.map +1 -0
- package/lib/typescript/src/version.d.ts +2 -0
- package/lib/typescript/src/version.d.ts.map +1 -0
- package/package.json +154 -37
- package/react-native.config.js +14 -0
- package/src/SessionRecorderNativeSpec.ts +33 -0
- package/src/components/ScreenRecorderView/ScreenRecorderView.tsx +20 -0
- package/src/components/ScreenRecorderView/index.ts +1 -0
- package/src/components/SessionRecorderWidget/ErrorBanner.tsx +58 -0
- package/src/components/SessionRecorderWidget/FinalPopover.tsx +96 -0
- package/src/components/SessionRecorderWidget/FloatingButton.tsx +176 -0
- package/src/components/SessionRecorderWidget/InitialPopover.tsx +167 -0
- package/src/components/SessionRecorderWidget/ModalContainer.tsx +189 -0
- package/src/components/SessionRecorderWidget/ModalHeader.tsx +26 -0
- package/src/components/SessionRecorderWidget/SessionRecorderWidget.tsx +150 -0
- package/src/components/SessionRecorderWidget/icons.tsx +80 -0
- package/src/components/SessionRecorderWidget/index.ts +3 -0
- package/src/components/SessionRecorderWidget/styles.ts +168 -0
- package/src/config/constants.ts +67 -0
- package/src/config/defaults.ts +105 -0
- package/src/config/index.ts +6 -0
- package/src/config/masking.ts +60 -0
- package/src/config/session-recorder.ts +87 -0
- package/src/config/validators.ts +54 -0
- package/src/config/widget.ts +47 -0
- package/src/context/SessionRecorderContext.tsx +138 -0
- package/src/context/SessionRecorderStore.ts +22 -0
- package/src/context/useSessionRecorderStore.ts +34 -0
- package/src/context/useStoreSelector.ts +36 -0
- package/src/index.ts +13 -0
- package/src/native/SessionRecorderNative.ts +120 -0
- package/src/native/index.ts +5 -0
- package/src/otel/helpers.ts +290 -0
- package/src/otel/index.ts +132 -0
- package/src/otel/instrumentations/index.ts +118 -0
- package/src/patch/xhr.ts +148 -0
- package/src/recorder/eventExporter.ts +150 -0
- package/src/recorder/gestureRecorder.ts +828 -0
- package/src/recorder/index.ts +203 -0
- package/src/recorder/navigationTracker.ts +268 -0
- package/src/recorder/screenRecorder.ts +600 -0
- package/src/services/api.service.ts +216 -0
- package/src/services/network.service.ts +191 -0
- package/src/services/screenMaskingService.ts +153 -0
- package/src/services/storage.service.ts +248 -0
- package/src/session-recorder.ts +647 -0
- package/src/types/configs.ts +118 -0
- package/src/types/expo-constants.d.ts +7 -0
- package/src/types/index.ts +27 -0
- package/src/types/session-recorder.ts +381 -0
- package/src/types/session.ts +65 -0
- package/src/utils/app-metadata.ts +31 -0
- package/src/utils/constants.optional.expo.ts +5 -0
- package/src/utils/constants.optional.ts +18 -0
- package/src/utils/createStore.ts +32 -0
- package/{dist/utils/index.d.ts → src/utils/index.ts} +1 -0
- package/src/utils/logger.ts +245 -0
- package/src/utils/platform.ts +401 -0
- package/src/utils/request-utils.ts +61 -0
- package/src/utils/rrweb-events.ts +329 -0
- package/src/utils/session.ts +22 -0
- package/src/utils/shallowEqual.ts +20 -0
- package/src/utils/time.ts +20 -0
- package/src/utils/type-utils.ts +75 -0
- package/src/version.ts +1 -0
- package/copy-react-native-dist.sh +0 -56
- package/dist/components/ScreenRecorderView/ScreenRecorderView.d.ts +0 -5
- package/dist/components/ScreenRecorderView/ScreenRecorderView.js +0 -1
- package/dist/components/ScreenRecorderView/ScreenRecorderView.js.map +0 -1
- package/dist/components/ScreenRecorderView/index.d.ts +0 -1
- package/dist/components/ScreenRecorderView/index.js +0 -1
- package/dist/components/ScreenRecorderView/index.js.map +0 -1
- package/dist/components/SessionRecorderWidget/ErrorBanner.js +0 -1
- package/dist/components/SessionRecorderWidget/ErrorBanner.js.map +0 -1
- package/dist/components/SessionRecorderWidget/FinalPopover.js +0 -1
- package/dist/components/SessionRecorderWidget/FinalPopover.js.map +0 -1
- package/dist/components/SessionRecorderWidget/FloatingButton.js +0 -1
- package/dist/components/SessionRecorderWidget/FloatingButton.js.map +0 -1
- package/dist/components/SessionRecorderWidget/InitialPopover.js +0 -1
- package/dist/components/SessionRecorderWidget/InitialPopover.js.map +0 -1
- package/dist/components/SessionRecorderWidget/ModalContainer.js +0 -1
- package/dist/components/SessionRecorderWidget/ModalContainer.js.map +0 -1
- package/dist/components/SessionRecorderWidget/ModalHeader.js +0 -1
- package/dist/components/SessionRecorderWidget/ModalHeader.js.map +0 -1
- package/dist/components/SessionRecorderWidget/SessionRecorderWidget.js +0 -1
- package/dist/components/SessionRecorderWidget/SessionRecorderWidget.js.map +0 -1
- package/dist/components/SessionRecorderWidget/icons.js +0 -1
- package/dist/components/SessionRecorderWidget/icons.js.map +0 -1
- package/dist/components/SessionRecorderWidget/index.d.ts +0 -2
- package/dist/components/SessionRecorderWidget/index.js +0 -1
- package/dist/components/SessionRecorderWidget/index.js.map +0 -1
- package/dist/components/SessionRecorderWidget/styles.js +0 -1
- package/dist/components/SessionRecorderWidget/styles.js.map +0 -1
- package/dist/components/index.js +0 -1
- package/dist/components/index.js.map +0 -1
- package/dist/config/constants.js +0 -1
- package/dist/config/constants.js.map +0 -1
- package/dist/config/defaults.js +0 -1
- package/dist/config/defaults.js.map +0 -1
- package/dist/config/index.js +0 -1
- package/dist/config/index.js.map +0 -1
- package/dist/config/masking.d.ts +0 -2
- package/dist/config/masking.js +0 -1
- package/dist/config/masking.js.map +0 -1
- package/dist/config/session-recorder.d.ts +0 -2
- package/dist/config/session-recorder.js +0 -1
- package/dist/config/session-recorder.js.map +0 -1
- package/dist/config/validators.js +0 -1
- package/dist/config/validators.js.map +0 -1
- package/dist/config/widget.js +0 -1
- package/dist/config/widget.js.map +0 -1
- package/dist/context/SessionRecorderContext.js +0 -1
- package/dist/context/SessionRecorderContext.js.map +0 -1
- package/dist/context/SessionRecorderStore.js +0 -1
- package/dist/context/SessionRecorderStore.js.map +0 -1
- package/dist/context/useSessionRecorderStore.js +0 -1
- package/dist/context/useSessionRecorderStore.js.map +0 -1
- package/dist/context/useStoreSelector.js +0 -1
- package/dist/context/useStoreSelector.js.map +0 -1
- package/dist/index.js +0 -1
- package/dist/index.js.map +0 -1
- package/dist/native/GestureRecorderNative.d.ts +0 -57
- package/dist/native/GestureRecorderNative.js +0 -1
- package/dist/native/GestureRecorderNative.js.map +0 -1
- package/dist/native/GestureRecorderNativeTurboSpec.d.ts +0 -31
- package/dist/native/GestureRecorderNativeTurboSpec.js +0 -1
- package/dist/native/GestureRecorderNativeTurboSpec.js.map +0 -1
- package/dist/native/SessionRecorderNative.d.ts +0 -33
- package/dist/native/SessionRecorderNative.js +0 -1
- package/dist/native/SessionRecorderNative.js.map +0 -1
- package/dist/native/SessionRecorderNativeTurboSpec.js +0 -1
- package/dist/native/SessionRecorderNativeTurboSpec.js.map +0 -1
- package/dist/native/index.d.ts +0 -2
- package/dist/native/index.js +0 -1
- package/dist/native/index.js.map +0 -1
- package/dist/otel/helpers.js +0 -1
- package/dist/otel/helpers.js.map +0 -1
- package/dist/otel/index.js +0 -1
- package/dist/otel/index.js.map +0 -1
- package/dist/otel/instrumentations/index.js +0 -1
- package/dist/otel/instrumentations/index.js.map +0 -1
- package/dist/patch/index.js +0 -1
- package/dist/patch/index.js.map +0 -1
- package/dist/patch/xhr.js +0 -1
- package/dist/patch/xhr.js.map +0 -1
- package/dist/recorder/eventExporter.js +0 -1
- package/dist/recorder/eventExporter.js.map +0 -1
- package/dist/recorder/gestureRecorder.js +0 -1
- package/dist/recorder/gestureRecorder.js.map +0 -1
- package/dist/recorder/index.js +0 -1
- package/dist/recorder/index.js.map +0 -1
- package/dist/recorder/navigationTracker.js +0 -1
- package/dist/recorder/navigationTracker.js.map +0 -1
- package/dist/recorder/screenRecorder.js +0 -1
- package/dist/recorder/screenRecorder.js.map +0 -1
- package/dist/services/api.service.js +0 -1
- package/dist/services/api.service.js.map +0 -1
- package/dist/services/network.service.js +0 -1
- package/dist/services/network.service.js.map +0 -1
- package/dist/services/screenMaskingService.js +0 -1
- package/dist/services/screenMaskingService.js.map +0 -1
- package/dist/services/storage.service.js +0 -1
- package/dist/services/storage.service.js.map +0 -1
- package/dist/session-recorder.js +0 -1
- package/dist/session-recorder.js.map +0 -1
- package/dist/types/configs.js +0 -1
- package/dist/types/configs.js.map +0 -1
- package/dist/types/index.js +0 -1
- package/dist/types/index.js.map +0 -1
- package/dist/types/session-recorder.js +0 -1
- package/dist/types/session-recorder.js.map +0 -1
- package/dist/types/session.js +0 -1
- package/dist/types/session.js.map +0 -1
- package/dist/utils/app-metadata.js +0 -1
- package/dist/utils/app-metadata.js.map +0 -1
- package/dist/utils/constants.optional.expo.js +0 -1
- package/dist/utils/constants.optional.expo.js.map +0 -1
- package/dist/utils/constants.optional.js +0 -1
- package/dist/utils/constants.optional.js.map +0 -1
- package/dist/utils/createStore.js +0 -1
- package/dist/utils/createStore.js.map +0 -1
- package/dist/utils/index.js +0 -1
- package/dist/utils/index.js.map +0 -1
- package/dist/utils/logger.js +0 -1
- package/dist/utils/logger.js.map +0 -1
- package/dist/utils/platform.js +0 -1
- package/dist/utils/platform.js.map +0 -1
- package/dist/utils/request-utils.js +0 -1
- package/dist/utils/request-utils.js.map +0 -1
- package/dist/utils/rrweb-events.js +0 -1
- package/dist/utils/rrweb-events.js.map +0 -1
- package/dist/utils/session.js +0 -1
- package/dist/utils/session.js.map +0 -1
- package/dist/utils/shallowEqual.js +0 -1
- package/dist/utils/shallowEqual.js.map +0 -1
- package/dist/utils/time.js +0 -1
- package/dist/utils/time.js.map +0 -1
- package/dist/utils/type-utils.js +0 -1
- package/dist/utils/type-utils.js.map +0 -1
- package/dist/version.d.ts +0 -1
- package/dist/version.js +0 -1
- package/dist/version.js.map +0 -1
- package/docs/AUTO_METADATA_DETECTION.md +0 -108
- package/ios/GestureRecorderNative.swift +0 -316
- package/ios/SessionRecorderNative.m +0 -17
- package/ios/SessionRecorderNative.podspec +0 -26
- package/turbo.json +0 -41
- /package/{dist/components/index.d.ts → src/components/index.ts} +0 -0
- /package/{dist/patch/index.d.ts → src/patch/index.ts} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["DebugSessionDataType"],"sourceRoot":"../../../src","sources":["types/session.ts"],"mappings":";;AA4DA,WAAYA,oBAAoB,0BAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAAA,OAApBA,oBAAoB;AAAA","ignoreList":[]}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Auto-generated app metadata
|
|
5
|
+
* This file is generated at build time to provide app metadata without developer intervention
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
// This file is automatically generated by the build process
|
|
9
|
+
// It extracts metadata from app.json, app.config.js, or package.json
|
|
10
|
+
|
|
11
|
+
// Auto-detected values from project configuration files
|
|
12
|
+
export const APP_METADATA = {
|
|
13
|
+
name: '@multiplayer-app/session-recorder-react-native',
|
|
14
|
+
version: '0.0.1',
|
|
15
|
+
bundleId: undefined,
|
|
16
|
+
buildNumber: undefined,
|
|
17
|
+
displayName: undefined
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Get auto-detected app metadata
|
|
22
|
+
*/
|
|
23
|
+
export function getAutoDetectedAppMetadata() {
|
|
24
|
+
return {
|
|
25
|
+
...APP_METADATA
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=app-metadata.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["APP_METADATA","name","version","bundleId","undefined","buildNumber","displayName","getAutoDetectedAppMetadata"],"sourceRoot":"../../../src","sources":["utils/app-metadata.ts"],"mappings":";;AAAA;AACA;AACA;AACA;;AAEA;AACA;;AAUA;AACA,OAAO,MAAMA,YAAyB,GAAG;EACvCC,IAAI,EAAE,gDAAgD;EACtDC,OAAO,EAAE,OAAO;EAChBC,QAAQ,EAAEC,SAAS;EACnBC,WAAW,EAAED,SAAS;EACtBE,WAAW,EAAEF;AACf,CAAC;;AAED;AACA;AACA;AACA,OAAO,SAASG,0BAA0BA,CAAA,EAAgB;EACxD,OAAO;IAAE,GAAGP;EAAa,CAAC;AAC5B","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Constants"],"sourceRoot":"../../../src","sources":["utils/constants.optional.expo.ts"],"mappings":";;AAAA;AACA,OAAOA,SAAS,MAAM,gBAAgB;AAGtC,eAAeA,SAAS","ignoreList":[]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
// Non-Expo fallback: export undefined to avoid bundling expo-constants in non-Expo apps
|
|
4
|
+
// Define a lightweight type that includes only the members we read.
|
|
5
|
+
|
|
6
|
+
const OptionalConstants = undefined;
|
|
7
|
+
export default OptionalConstants;
|
|
8
|
+
//# sourceMappingURL=constants.optional.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["OptionalConstants","undefined"],"sourceRoot":"../../../src","sources":["utils/constants.optional.ts"],"mappings":";;AAAA;AACA;;AAcA,MAAMA,iBAAwC,GAAGC,SAAS;AAE1D,eAAeD,iBAAiB","ignoreList":[]}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
export function createStore(initialState) {
|
|
4
|
+
let state = initialState;
|
|
5
|
+
const listeners = new Set();
|
|
6
|
+
const getState = () => state;
|
|
7
|
+
const setState = partial => {
|
|
8
|
+
const prevState = state;
|
|
9
|
+
const nextState = typeof partial === 'function' ? partial(prevState) : {
|
|
10
|
+
...prevState,
|
|
11
|
+
...partial
|
|
12
|
+
};
|
|
13
|
+
if (Object.is(nextState, prevState)) return;
|
|
14
|
+
state = nextState;
|
|
15
|
+
listeners.forEach(l => l(state, prevState));
|
|
16
|
+
};
|
|
17
|
+
const subscribe = listener => {
|
|
18
|
+
listeners.add(listener);
|
|
19
|
+
return () => listeners.delete(listener);
|
|
20
|
+
};
|
|
21
|
+
return {
|
|
22
|
+
getState,
|
|
23
|
+
setState,
|
|
24
|
+
subscribe
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=createStore.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["createStore","initialState","state","listeners","Set","getState","setState","partial","prevState","nextState","Object","is","forEach","l","subscribe","listener","add","delete"],"sourceRoot":"../../../src","sources":["utils/createStore.ts"],"mappings":";;AAQA,OAAO,SAASA,WAAWA,CAAmBC,YAAe,EAAY;EACvE,IAAIC,KAAQ,GAAGD,YAAY;EAC3B,MAAME,SAAS,GAAG,IAAIC,GAAG,CAAc,CAAC;EAExC,MAAMC,QAAQ,GAAGA,CAAA,KAAMH,KAAK;EAE5B,MAAMI,QAA8B,GAAIC,OAAO,IAAK;IAClD,MAAMC,SAAS,GAAGN,KAAK;IACvB,MAAMO,SAAS,GACb,OAAOF,OAAO,KAAK,UAAU,GACxBA,OAAO,CAAoBC,SAAS,CAAC,GACrC;MAAE,GAAGA,SAAS;MAAE,GAAGD;IAAQ,CAAO;IACzC,IAAIG,MAAM,CAACC,EAAE,CAACF,SAAS,EAAED,SAAS,CAAC,EAAE;IACrCN,KAAK,GAAGO,SAAS;IACjBN,SAAS,CAACS,OAAO,CAAEC,CAAC,IAAKA,CAAC,CAACX,KAAK,EAAEM,SAAS,CAAC,CAAC;EAC/C,CAAC;EAED,MAAMM,SAAgC,GAAIC,QAAQ,IAAK;IACrDZ,SAAS,CAACa,GAAG,CAACD,QAAQ,CAAC;IACvB,OAAO,MAAMZ,SAAS,CAACc,MAAM,CAACF,QAAQ,CAAC;EACzC,CAAC;EAED,OAAO;IAAEV,QAAQ;IAAEC,QAAQ;IAAEQ;EAAU,CAAC;AAC1C","ignoreList":[]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
// Export all utility functions
|
|
4
|
+
export * from "./platform.js";
|
|
5
|
+
export * from "./session.js";
|
|
6
|
+
export * from "./time.js";
|
|
7
|
+
export * from "./type-utils.js";
|
|
8
|
+
export * from "./request-utils.js";
|
|
9
|
+
export * from "./rrweb-events.js";
|
|
10
|
+
export * from "./logger.js";
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["utils/index.ts"],"mappings":";;AAAA;AACA,cAAc,eAAY;AAC1B,cAAc,cAAW;AACzB,cAAc,WAAQ;AACtB,cAAc,iBAAc;AAC5B,cAAc,oBAAiB;AAC/B,cAAc,mBAAgB;AAC9B,cAAc,aAAU","ignoreList":[]}
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Centralized logger utility for the session recorder
|
|
5
|
+
* Provides consistent logging across all components
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import { LogLevel } from "../types/index.js";
|
|
9
|
+
class Logger {
|
|
10
|
+
config = {
|
|
11
|
+
level: LogLevel.INFO,
|
|
12
|
+
enabled: true,
|
|
13
|
+
enablePrefix: true,
|
|
14
|
+
prefix: '[SessionRecorder]'
|
|
15
|
+
};
|
|
16
|
+
componentPrefixes = new Map([['ScreenRecorder', '📸'], ['NativeGestureRecorder', '👆'], ['SessionRecorderContext', '🎯'], ['EventExporter', '📤'], ['NavigationTracker', '📸'], ['RecorderReactNativeSDK', '📤'], ['DEBUGGER_LIB', '🔍']]);
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Configure the logger
|
|
20
|
+
* @param config - Logger configuration
|
|
21
|
+
*/
|
|
22
|
+
configure(config) {
|
|
23
|
+
this.config = {
|
|
24
|
+
...this.config,
|
|
25
|
+
...config
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Set the log level
|
|
31
|
+
* @param level - Log level to set
|
|
32
|
+
*/
|
|
33
|
+
setLevel(level) {
|
|
34
|
+
this.config.level = level;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Enable or disable console output
|
|
39
|
+
* @param enabled - Whether to enable console output
|
|
40
|
+
*/
|
|
41
|
+
setConsoleEnabled(enabled) {
|
|
42
|
+
this.config.enabled = enabled;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Add or update a component prefix
|
|
47
|
+
* @param component - Component name
|
|
48
|
+
* @param emoji - Emoji prefix for the component
|
|
49
|
+
*/
|
|
50
|
+
setComponentPrefix(component, emoji) {
|
|
51
|
+
this.componentPrefixes.set(component, emoji);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Get the formatted prefix for a component
|
|
56
|
+
* @param component - Component name
|
|
57
|
+
* @returns Formatted prefix string
|
|
58
|
+
*/
|
|
59
|
+
getPrefix(component) {
|
|
60
|
+
if (!this.config.enablePrefix) return '';
|
|
61
|
+
const emoji = this.componentPrefixes.get(component) || '📝';
|
|
62
|
+
return `${this.config.prefix} ${emoji} [${component}]`;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Check if a log level should be output
|
|
67
|
+
* @param level - Log level to check
|
|
68
|
+
* @returns True if should output
|
|
69
|
+
*/
|
|
70
|
+
shouldLog(level) {
|
|
71
|
+
return level >= this.config.level && this.config.enabled;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Format the log message
|
|
76
|
+
* @param component - Component name
|
|
77
|
+
* @param level - Log level
|
|
78
|
+
* @param message - Log message
|
|
79
|
+
* @param data - Additional data to log
|
|
80
|
+
* @returns Formatted log message
|
|
81
|
+
*/
|
|
82
|
+
formatMessage(component, level, message, data) {
|
|
83
|
+
const prefix = this.getPrefix(component);
|
|
84
|
+
const levelName = LogLevel[level];
|
|
85
|
+
let formattedMessage = `${prefix} ${levelName} ${message}`;
|
|
86
|
+
if (data !== undefined) {
|
|
87
|
+
formattedMessage += ` ${JSON.stringify(data)}`;
|
|
88
|
+
}
|
|
89
|
+
return formattedMessage;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Log a debug message
|
|
94
|
+
* @param component - Component name
|
|
95
|
+
* @param message - Log message
|
|
96
|
+
* @param data - Additional data to log
|
|
97
|
+
*/
|
|
98
|
+
debug(component, message, data) {
|
|
99
|
+
if (!this.shouldLog(LogLevel.DEBUG)) return;
|
|
100
|
+
const formattedMessage = this.formatMessage(component, LogLevel.DEBUG, message, data);
|
|
101
|
+
console.log(formattedMessage);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Log an info message
|
|
106
|
+
* @param component - Component name
|
|
107
|
+
* @param message - Log message
|
|
108
|
+
* @param data - Additional data to log
|
|
109
|
+
*/
|
|
110
|
+
info(component, message, data) {
|
|
111
|
+
if (!this.shouldLog(LogLevel.INFO)) return;
|
|
112
|
+
const formattedMessage = this.formatMessage(component, LogLevel.INFO, message, data);
|
|
113
|
+
console.log(formattedMessage);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Log a warning message
|
|
118
|
+
* @param component - Component name
|
|
119
|
+
* @param message - Log message
|
|
120
|
+
* @param data - Additional data to log
|
|
121
|
+
*/
|
|
122
|
+
warn(component, message, data) {
|
|
123
|
+
if (!this.shouldLog(LogLevel.WARN)) return;
|
|
124
|
+
const formattedMessage = this.formatMessage(component, LogLevel.WARN, message, data);
|
|
125
|
+
console.warn(formattedMessage);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* Log an error message
|
|
130
|
+
* @param component - Component name
|
|
131
|
+
* @param message - Log message
|
|
132
|
+
* @param data - Additional data to log
|
|
133
|
+
*/
|
|
134
|
+
error(component, message, data) {
|
|
135
|
+
if (!this.shouldLog(LogLevel.ERROR)) return;
|
|
136
|
+
const formattedMessage = this.formatMessage(component, LogLevel.ERROR, message, data);
|
|
137
|
+
console.error(formattedMessage);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* Log a success message (info level with success emoji)
|
|
142
|
+
* @param component - Component name
|
|
143
|
+
* @param message - Log message
|
|
144
|
+
* @param data - Additional data to log
|
|
145
|
+
*/
|
|
146
|
+
success(component, message, data) {
|
|
147
|
+
if (!this.shouldLog(LogLevel.INFO)) return;
|
|
148
|
+
const prefix = this.getPrefix(component);
|
|
149
|
+
const formattedMessage = `${prefix} ✅ ${message}`;
|
|
150
|
+
let fullMessage = formattedMessage;
|
|
151
|
+
if (data !== undefined) {
|
|
152
|
+
fullMessage += ` ${JSON.stringify(data)}`;
|
|
153
|
+
}
|
|
154
|
+
console.log(fullMessage);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* Log a failure message (error level with failure emoji)
|
|
159
|
+
* @param component - Component name
|
|
160
|
+
* @param message - Log message
|
|
161
|
+
* @param data - Additional data to log
|
|
162
|
+
*/
|
|
163
|
+
failure(component, message, data) {
|
|
164
|
+
if (!this.shouldLog(LogLevel.ERROR)) return;
|
|
165
|
+
const prefix = this.getPrefix(component);
|
|
166
|
+
const formattedMessage = `${prefix} ❌ ${message}`;
|
|
167
|
+
let fullMessage = formattedMessage;
|
|
168
|
+
if (data !== undefined) {
|
|
169
|
+
fullMessage += ` ${JSON.stringify(data)}`;
|
|
170
|
+
}
|
|
171
|
+
console.error(fullMessage);
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
// Export a singleton instance
|
|
176
|
+
export const logger = new Logger();
|
|
177
|
+
|
|
178
|
+
// Export convenience functions for common use cases
|
|
179
|
+
export const logDebug = (component, message, data) => logger.debug(component, message, data);
|
|
180
|
+
export const logInfo = (component, message, data) => logger.info(component, message, data);
|
|
181
|
+
export const logWarn = (component, message, data) => logger.warn(component, message, data);
|
|
182
|
+
export const logError = (component, message, data) => logger.error(component, message, data);
|
|
183
|
+
export const logSuccess = (component, message, data) => logger.success(component, message, data);
|
|
184
|
+
export const logFailure = (component, message, data) => logger.failure(component, message, data);
|
|
185
|
+
//# sourceMappingURL=logger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["LogLevel","Logger","config","level","INFO","enabled","enablePrefix","prefix","componentPrefixes","Map","configure","setLevel","setConsoleEnabled","setComponentPrefix","component","emoji","set","getPrefix","get","shouldLog","formatMessage","message","data","levelName","formattedMessage","undefined","JSON","stringify","debug","DEBUG","console","log","info","warn","WARN","error","ERROR","success","fullMessage","failure","logger","logDebug","logInfo","logWarn","logError","logSuccess","logFailure"],"sourceRoot":"../../../src","sources":["utils/logger.ts"],"mappings":";;AAAA;AACA;AACA;AACA;;AAEA,SAASA,QAAQ,QAAQ,mBAAU;AASnC,MAAMC,MAAM,CAAC;EACHC,MAAM,GAAiB;IAC7BC,KAAK,EAAEH,QAAQ,CAACI,IAAI;IACpBC,OAAO,EAAE,IAAI;IACbC,YAAY,EAAE,IAAI;IAClBC,MAAM,EAAE;EACV,CAAC;EAEOC,iBAAiB,GAAwB,IAAIC,GAAG,CAAC,CACvD,CAAC,gBAAgB,EAAE,IAAI,CAAC,EACxB,CAAC,uBAAuB,EAAE,IAAI,CAAC,EAC/B,CAAC,wBAAwB,EAAE,IAAI,CAAC,EAChC,CAAC,eAAe,EAAE,IAAI,CAAC,EACvB,CAAC,mBAAmB,EAAE,IAAI,CAAC,EAC3B,CAAC,wBAAwB,EAAE,IAAI,CAAC,EAChC,CAAC,cAAc,EAAE,IAAI,CAAC,CACvB,CAAC;;EAEF;AACF;AACA;AACA;EACEC,SAASA,CAACR,MAA6B,EAAQ;IAC7C,IAAI,CAACA,MAAM,GAAG;MAAE,GAAG,IAAI,CAACA,MAAM;MAAE,GAAGA;IAAO,CAAC;EAC7C;;EAEA;AACF;AACA;AACA;EACES,QAAQA,CAACR,KAAe,EAAQ;IAC9B,IAAI,CAACD,MAAM,CAACC,KAAK,GAAGA,KAAK;EAC3B;;EAEA;AACF;AACA;AACA;EACES,iBAAiBA,CAACP,OAAgB,EAAQ;IACxC,IAAI,CAACH,MAAM,CAACG,OAAO,GAAGA,OAAO;EAC/B;;EAEA;AACF;AACA;AACA;AACA;EACEQ,kBAAkBA,CAACC,SAAiB,EAAEC,KAAa,EAAQ;IACzD,IAAI,CAACP,iBAAiB,CAACQ,GAAG,CAACF,SAAS,EAAEC,KAAK,CAAC;EAC9C;;EAEA;AACF;AACA;AACA;AACA;EACUE,SAASA,CAACH,SAAiB,EAAU;IAC3C,IAAI,CAAC,IAAI,CAACZ,MAAM,C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AAMsB,QAAQ,GAAGA,CAAC9B,SAAiB,EAAEO,OAAe,EAAEC,IAAU,KACrEkB,MAAM,CAACL,KAAK,CAACrB,SAAS,EAAEO,OAAO,EAAEC,IAAI,CAAC;AACxC,OAAO,MAAMuB,UAAU,GAAGA,CAAC/B,SAAiB,EAAEO,OAAe,EAAEC,IAAU,KACvEkB,MAAM,CAACH,OAAO,CAACvB,SAAS,EAAEO,OAAO,EAAEC,IAAI,CAAC;AAC1C,OAAO,MAAMwB,UAAU,GAAGA,CAAChC,SAAiB,EAAEO,OAAe,EAAEC,IAAU,KACvEkB,MAAM,CAACD,OAAO,CAACzB,SAAS,EAAEO,OAAO,EAAEC,IAAI,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,340 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import OptionalConstants from "./constants.optional.js";
|
|
4
|
+
import { Platform, Dimensions, PixelRatio } from 'react-native';
|
|
5
|
+
import { version } from "../version.js";
|
|
6
|
+
import { getAutoDetectedAppMetadata } from "./app-metadata.js";
|
|
7
|
+
|
|
8
|
+
// Global app metadata configuration for non-Expo apps
|
|
9
|
+
let globalAppMetadata = {};
|
|
10
|
+
|
|
11
|
+
// Cache for auto-detected metadata to avoid repeated file reads
|
|
12
|
+
let autoDetectedMetadata = null;
|
|
13
|
+
export function detectPlatform() {
|
|
14
|
+
try {
|
|
15
|
+
// Check if we're in an Expo environment
|
|
16
|
+
const isExpo = !!OptionalConstants?.expoVersion;
|
|
17
|
+
if (isExpo) {
|
|
18
|
+
const expoVersion = OptionalConstants?.expoVersion;
|
|
19
|
+
const platform = OptionalConstants?.platform;
|
|
20
|
+
return {
|
|
21
|
+
isExpo: true,
|
|
22
|
+
isReactNative: true,
|
|
23
|
+
platform: platform?.ios ? 'ios' : platform?.android ? 'android' : 'unknown',
|
|
24
|
+
expoVersion,
|
|
25
|
+
deviceType: 'expo'
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
// Fallback to React Native detection
|
|
30
|
+
return {
|
|
31
|
+
isExpo: false,
|
|
32
|
+
isReactNative: true,
|
|
33
|
+
platform: Platform.OS,
|
|
34
|
+
platformVersion: Platform.Version?.toString(),
|
|
35
|
+
deviceType: Platform.OS
|
|
36
|
+
};
|
|
37
|
+
} catch (error) {
|
|
38
|
+
// Fallback for web or other environments
|
|
39
|
+
return {
|
|
40
|
+
isExpo: false,
|
|
41
|
+
isReactNative: false,
|
|
42
|
+
platform: 'unknown',
|
|
43
|
+
deviceType: 'unknown'
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
export function getPlatformAttributes() {
|
|
48
|
+
const platformInfo = detectPlatform();
|
|
49
|
+
const attributes = {
|
|
50
|
+
'platform': platformInfo.isExpo ? 'expo' : 'react-native',
|
|
51
|
+
'device.type': platformInfo.deviceType
|
|
52
|
+
};
|
|
53
|
+
if (platformInfo.platformVersion) {
|
|
54
|
+
attributes['platform.version'] = platformInfo.platformVersion;
|
|
55
|
+
}
|
|
56
|
+
if (platformInfo.expoVersion) {
|
|
57
|
+
attributes['expo.version'] = platformInfo.expoVersion;
|
|
58
|
+
}
|
|
59
|
+
return attributes;
|
|
60
|
+
}
|
|
61
|
+
export function isExpoEnvironment() {
|
|
62
|
+
return detectPlatform().isExpo;
|
|
63
|
+
}
|
|
64
|
+
export function isReactNativeEnvironment() {
|
|
65
|
+
return detectPlatform().isReactNative;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Configure app metadata for non-Expo React Native apps
|
|
70
|
+
* Call this function in your app initialization to provide app information
|
|
71
|
+
*
|
|
72
|
+
* @example
|
|
73
|
+
* ```typescript
|
|
74
|
+
* import { configureAppMetadata } from '@multiplayer-app/session-recorder-react-native'
|
|
75
|
+
*
|
|
76
|
+
* // In your App.tsx or index.js
|
|
77
|
+
* configureAppMetadata({
|
|
78
|
+
* name: 'My Awesome App',
|
|
79
|
+
* version: '1.2.3',
|
|
80
|
+
* bundleId: 'com.mycompany.myapp',
|
|
81
|
+
* buildNumber: '123',
|
|
82
|
+
* displayName: 'My App',
|
|
83
|
+
* })
|
|
84
|
+
* ```
|
|
85
|
+
*/
|
|
86
|
+
export function configureAppMetadata(metadata) {
|
|
87
|
+
globalAppMetadata = {
|
|
88
|
+
...globalAppMetadata,
|
|
89
|
+
...metadata
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Get configured app metadata
|
|
95
|
+
*/
|
|
96
|
+
export function getConfiguredAppMetadata() {
|
|
97
|
+
return {
|
|
98
|
+
...globalAppMetadata
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Automatically detect app metadata from common configuration files
|
|
104
|
+
* This runs without developer intervention
|
|
105
|
+
*/
|
|
106
|
+
function autoDetectAppMetadata() {
|
|
107
|
+
if (autoDetectedMetadata) {
|
|
108
|
+
return autoDetectedMetadata;
|
|
109
|
+
}
|
|
110
|
+
try {
|
|
111
|
+
// Get auto-detected metadata from build-time generated file
|
|
112
|
+
const autoMetadata = getAutoDetectedAppMetadata();
|
|
113
|
+
|
|
114
|
+
// Filter out undefined values
|
|
115
|
+
const metadata = {};
|
|
116
|
+
if (autoMetadata.name) metadata.name = autoMetadata.name;
|
|
117
|
+
if (autoMetadata.version) metadata.version = autoMetadata.version;
|
|
118
|
+
if (autoMetadata.bundleId) metadata.bundleId = autoMetadata.bundleId;
|
|
119
|
+
autoDetectedMetadata = metadata;
|
|
120
|
+
return metadata;
|
|
121
|
+
} catch (error) {
|
|
122
|
+
// Silently fail - this is optional auto-detection
|
|
123
|
+
autoDetectedMetadata = {};
|
|
124
|
+
return {};
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* Enhanced app metadata detection with automatic fallbacks
|
|
130
|
+
*/
|
|
131
|
+
export function getAppMetadata() {
|
|
132
|
+
// Priority order:
|
|
133
|
+
// 1. Expo config (if available)
|
|
134
|
+
// 2. Manually configured metadata
|
|
135
|
+
// 3. Auto-detected metadata
|
|
136
|
+
// 4. Fallbacks
|
|
137
|
+
|
|
138
|
+
const expoMetadata = getExpoMetadata();
|
|
139
|
+
const configuredMetadata = getConfiguredAppMetadata();
|
|
140
|
+
const autoMetadata = autoDetectAppMetadata();
|
|
141
|
+
return {
|
|
142
|
+
name: expoMetadata.name || configuredMetadata.name || autoMetadata.name,
|
|
143
|
+
version: expoMetadata.version || configuredMetadata.version || autoMetadata.version,
|
|
144
|
+
bundleId: expoMetadata.bundleId || configuredMetadata.bundleId || autoMetadata.bundleId
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* Get metadata from Expo config
|
|
150
|
+
*/
|
|
151
|
+
function getExpoMetadata() {
|
|
152
|
+
const expoConfig = OptionalConstants?.expoConfig;
|
|
153
|
+
if (!expoConfig) return {};
|
|
154
|
+
return {
|
|
155
|
+
name: expoConfig.name,
|
|
156
|
+
version: expoConfig.version,
|
|
157
|
+
bundleId: expoConfig.ios?.bundleIdentifier || expoConfig.android?.package
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
export const getNavigatorInfo = () => {
|
|
161
|
+
const platformInfo = detectPlatform();
|
|
162
|
+
const screenData = Dimensions.get('window');
|
|
163
|
+
const screenDataScreen = Dimensions.get('screen');
|
|
164
|
+
const pixelRatio = PixelRatio.get();
|
|
165
|
+
|
|
166
|
+
// Get device type based on screen dimensions
|
|
167
|
+
const getDeviceType = () => {
|
|
168
|
+
const {
|
|
169
|
+
width,
|
|
170
|
+
height
|
|
171
|
+
} = screenData;
|
|
172
|
+
const minDimension = Math.min(width, height);
|
|
173
|
+
const maxDimension = Math.max(width, height);
|
|
174
|
+
|
|
175
|
+
// Rough device type detection based on screen size
|
|
176
|
+
if (maxDimension >= 1024) {
|
|
177
|
+
return 'Tablet';
|
|
178
|
+
} else if (minDimension >= 600) {
|
|
179
|
+
return 'Large Phone';
|
|
180
|
+
} else {
|
|
181
|
+
return 'Phone';
|
|
182
|
+
}
|
|
183
|
+
};
|
|
184
|
+
|
|
185
|
+
// Get orientation
|
|
186
|
+
const getOrientation = () => {
|
|
187
|
+
const {
|
|
188
|
+
width,
|
|
189
|
+
height
|
|
190
|
+
} = screenData;
|
|
191
|
+
return width > height ? 'Landscape' : 'Portrait';
|
|
192
|
+
};
|
|
193
|
+
|
|
194
|
+
// Get OS version details
|
|
195
|
+
const getOSInfo = () => {
|
|
196
|
+
if (platformInfo.isExpo) {
|
|
197
|
+
const platform = OptionalConstants?.platform;
|
|
198
|
+
if (platform?.ios) {
|
|
199
|
+
return `iOS ${Platform.Version}`;
|
|
200
|
+
} else if (platform?.android) {
|
|
201
|
+
return `Android ${Platform.Version}`;
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
if (Platform.OS === 'ios') {
|
|
205
|
+
return `iOS ${Platform.Version}`;
|
|
206
|
+
} else if (Platform.OS === 'android') {
|
|
207
|
+
return `Android ${Platform.Version}`;
|
|
208
|
+
}
|
|
209
|
+
return `${Platform.OS} ${Platform.Version || 'Unknown'}`;
|
|
210
|
+
};
|
|
211
|
+
|
|
212
|
+
// Get device info string
|
|
213
|
+
const getDeviceInfo = () => {
|
|
214
|
+
const deviceType = getDeviceType();
|
|
215
|
+
const osInfo = getOSInfo();
|
|
216
|
+
return `${deviceType} - ${osInfo}`;
|
|
217
|
+
};
|
|
218
|
+
|
|
219
|
+
// Get browser/runtime info
|
|
220
|
+
const getBrowserInfo = () => {
|
|
221
|
+
if (platformInfo.isExpo) {
|
|
222
|
+
return `Expo ${platformInfo.expoVersion || 'Unknown'} - React Native`;
|
|
223
|
+
}
|
|
224
|
+
return 'React Native';
|
|
225
|
+
};
|
|
226
|
+
|
|
227
|
+
// Get screen size string
|
|
228
|
+
const getScreenSize = () => {
|
|
229
|
+
return `${Math.round(screenData.width)}x${Math.round(screenData.height)}`;
|
|
230
|
+
};
|
|
231
|
+
const metadata = getAppMetadata();
|
|
232
|
+
// Get app info with fallbacks for non-Expo apps
|
|
233
|
+
const getAppInfo = () => {
|
|
234
|
+
const appName = getAppName();
|
|
235
|
+
const appVersion = getAppVersion();
|
|
236
|
+
return `${appName} v${appVersion}`;
|
|
237
|
+
};
|
|
238
|
+
|
|
239
|
+
// Get app name with automatic detection
|
|
240
|
+
const getAppName = () => {
|
|
241
|
+
if (metadata.name) return metadata.name;
|
|
242
|
+
|
|
243
|
+
// Try configured display name as fallback
|
|
244
|
+
const configuredMetadata = getConfiguredAppMetadata();
|
|
245
|
+
if (configuredMetadata.displayName) return configuredMetadata.displayName;
|
|
246
|
+
|
|
247
|
+
// Final fallback
|
|
248
|
+
return 'React Native App';
|
|
249
|
+
};
|
|
250
|
+
|
|
251
|
+
// Get app version with automatic detection
|
|
252
|
+
const getAppVersion = () => {
|
|
253
|
+
if (metadata.version) return metadata.version;
|
|
254
|
+
|
|
255
|
+
// Final fallback
|
|
256
|
+
return 'Unknown';
|
|
257
|
+
};
|
|
258
|
+
|
|
259
|
+
// Get bundle ID with automatic detection
|
|
260
|
+
const getBundleId = () => {
|
|
261
|
+
if (metadata.bundleId) return metadata.bundleId;
|
|
262
|
+
|
|
263
|
+
// Fallback
|
|
264
|
+
return 'com.reactnative.app';
|
|
265
|
+
};
|
|
266
|
+
|
|
267
|
+
// Get build number with multiple fallback strategies
|
|
268
|
+
const getBuildNumber = () => {
|
|
269
|
+
// Try Expo config first
|
|
270
|
+
const expoBuildNumber = OptionalConstants?.expoConfig?.ios?.buildNumber || OptionalConstants?.expoConfig?.android?.versionCode;
|
|
271
|
+
if (expoBuildNumber) return expoBuildNumber.toString();
|
|
272
|
+
|
|
273
|
+
// Try configured metadata for non-Expo apps
|
|
274
|
+
const configuredMetadata = getConfiguredAppMetadata();
|
|
275
|
+
if (configuredMetadata.buildNumber) return configuredMetadata.buildNumber;
|
|
276
|
+
|
|
277
|
+
// Fallback
|
|
278
|
+
return '1';
|
|
279
|
+
};
|
|
280
|
+
|
|
281
|
+
// Get hardware info
|
|
282
|
+
const getHardwareInfo = () => {
|
|
283
|
+
const pixelRatioInfo = `Pixel Ratio: ${pixelRatio}`;
|
|
284
|
+
const screenDensity = PixelRatio.getFontScale();
|
|
285
|
+
return `${pixelRatioInfo}, Font Scale: ${screenDensity}`;
|
|
286
|
+
};
|
|
287
|
+
return {
|
|
288
|
+
// Core platform info
|
|
289
|
+
platform: platformInfo.isExpo ? 'expo' : 'react-native',
|
|
290
|
+
userAgent: getBrowserInfo(),
|
|
291
|
+
timestamp: new Date().toISOString(),
|
|
292
|
+
// Device and OS information
|
|
293
|
+
deviceInfo: getDeviceInfo(),
|
|
294
|
+
osInfo: getOSInfo(),
|
|
295
|
+
browserInfo: getBrowserInfo(),
|
|
296
|
+
// Screen information
|
|
297
|
+
screenSize: getScreenSize(),
|
|
298
|
+
pixelRatio: pixelRatio,
|
|
299
|
+
orientation: getOrientation(),
|
|
300
|
+
screenWidth: Math.round(screenData.width),
|
|
301
|
+
screenHeight: Math.round(screenData.height),
|
|
302
|
+
screenScale: pixelRatio,
|
|
303
|
+
// Device capabilities
|
|
304
|
+
hardwareConcurrency: 1,
|
|
305
|
+
// React Native doesn't expose CPU cores directly
|
|
306
|
+
cookiesEnabled: 'N/A',
|
|
307
|
+
// Not applicable in React Native
|
|
308
|
+
|
|
309
|
+
// App information
|
|
310
|
+
packageVersion: version,
|
|
311
|
+
appInfo: getAppInfo(),
|
|
312
|
+
appName: getAppName(),
|
|
313
|
+
appVersion: getAppVersion(),
|
|
314
|
+
bundleId: getBundleId(),
|
|
315
|
+
buildNumber: getBuildNumber(),
|
|
316
|
+
// Platform specific
|
|
317
|
+
platformType: platformInfo.platform,
|
|
318
|
+
platformVersion: platformInfo.platformVersion,
|
|
319
|
+
expoVersion: platformInfo.expoVersion,
|
|
320
|
+
deviceType: getDeviceType(),
|
|
321
|
+
// Performance and hardware
|
|
322
|
+
hardwareInfo: getHardwareInfo(),
|
|
323
|
+
// Screen details
|
|
324
|
+
screenDensity: PixelRatio.getFontScale(),
|
|
325
|
+
screenScaleFactor: pixelRatio,
|
|
326
|
+
windowWidth: Math.round(screenData.width),
|
|
327
|
+
windowHeight: Math.round(screenData.height),
|
|
328
|
+
fullScreenWidth: Math.round(screenDataScreen.width),
|
|
329
|
+
fullScreenHeight: Math.round(screenDataScreen.height),
|
|
330
|
+
// Environment info
|
|
331
|
+
isExpo: platformInfo.isExpo,
|
|
332
|
+
isReactNative: platformInfo.isReactNative,
|
|
333
|
+
environment: platformInfo.isExpo ? 'expo' : 'react-native',
|
|
334
|
+
// System type identifier (previously in system tags)
|
|
335
|
+
systemType: 'mobile'
|
|
336
|
+
// Additional platform attributes
|
|
337
|
+
// ...getPlatformAttributes(),
|
|
338
|
+
};
|
|
339
|
+
};
|
|
340
|
+
//# sourceMappingURL=platform.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["OptionalConstants","Platform","Dimensions","PixelRatio","version","getAutoDetectedAppMetadata","globalAppMetadata","autoDetectedMetadata","detectPlatform","isExpo","expoVersion","platform","isReactNative","ios","android","deviceType","OS","platformVersion","Version","toString","error","getPlatformAttributes","platformInfo","attributes","isExpoEnvironment","isReactNativeEnvironment","configureAppMetadata","metadata","getConfiguredAppMetadata","autoDetectAppMetadata","autoMetadata","name","bundleId","getAppMetadata","expoMetadata","getExpoMetadata","configuredMetadata","expoConfig","bundleIdentifier","package","getNavigatorInfo","screenData","get","screenDataScreen","pixelRatio","getDeviceType","width","height","minDimension","Math","min","maxDimension","max","getOrientation","getOSInfo","getDeviceInfo","osInfo","getBrowserInfo","getScreenSize","round","getAppInfo","appName","getAppName","appVersion","getAppVersion","displayName","getBundleId","getBuildNumber","expoBuildNumber","buildNumber","versionCode","getHardwareInfo","pixelRatioInfo","screenDensity","getFontScale","userAgent","timestamp","Date","toISOString","deviceInfo","browserInfo","screenSize","orientation","screenWidth","screenHeight","screenScale","hardwareConcurrency","cookiesEnabled","packageVersion","appInfo","platformType","hardwareInfo","screenScaleFactor","windowWidth","windowHeight","fullScreenWidth","fullScreenHeight","environment","systemType"],"sourceRoot":"../../../src","sources":["utils/platform.ts"],"mappings":";;AACA,OAAOA,iBAAiB,MAAM,yBAAsB;AACpD,SAASC,QAAQ,EAAEC,UAAU,EAAEC,UAAU,QAAQ,cAAc;AAC/D,SAASC,OAAO,QAAQ,eAAY;AACpC,SAASC,0BAA0B,QAAQ,mBAAgB;;AAE3D;AACA,IAAIC,iBAAyE,GAC3E,CAAC,CAAC;;AAEJ;AACA,IAAIC,oBAII,GAAG,IAAI;AAWf,OAAO,SAASC,cAAcA,CAAA,EAAiB;EAC7C,IAAI;IACF;IACA,MAAMC,MAAM,GAAG,CAAC,CAACT,iBAAiB,EAAEU,WAAW;IAE/C,IAAID,MAAM,EAAE;MACV,MAAMC,WAAW,GAAGV,iBAAiB,EAAEU,WAAW;MAClD,MAAMC,QAAQ,GAAGX,iBAAiB,EAAEW,QAAQ;MAE5C,OAAO;QACLF,MAAM,EAAE,IAAI;QACZG,aAAa,EAAE,IAAI;QACnBD,QAAQ,EAAEA,QAAQ,EAAEE,GAAG,GACnB,KAAK,GACLF,QAAQ,EAAEG,OAAO,GACf,SAAS,GACT,SAAS;QACfJ,WAAW;QACXK,UAAU,EAAE;MACd,CAAC;IACH;;IAEA;IACA,OAAO;MACLN,MAAM,EAAE,KAAK;MACbG,aAAa,EAAE,IAAI;MACnBD,QAAQ,EAAEV,QAAQ,CAACe,EAA2C;MAC9DC,eAAe,EAAEhB,QAAQ,CAACiB,OAAO,EAAEC,QAAQ,CAAC,CAAC;MAC7CJ,UAAU,EAAEd,QAAQ,CAACe;IACvB,CAAC;EACH,CAAC,CAAC,OAAOI,KAAK,EAAE;IACd;IACA,OAAO;MACLX,MAAM,EAAE,KAAK;MACbG,aAAa,EAAE,KAAK;MACpBD,QAAQ,EAAE,SAAS;MACnBI,UAAU,EAAE;IACd,CAAC;EACH;AACF;AAEA,OA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