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CAAC;AAC/D,CAAC","sourcesContent":["import { Constants } from 'expo-constants';\nimport * as React from 'react';\nimport {\n Dimensions,\n NativeEventEmitter,\n NativeModules,\n Platform,\n EmitterSubscription,\n findNodeHandle,\n} from 'react-native';\n\nconst ExponentAR = NativeModules.ExponentAR || {};\n\nconst emitter = new NativeEventEmitter(ExponentAR);\n\n/**\n * Tracking Configuration\n * Options for how ARKit constructs a scene coordinate system based on real-world device motion.\n * https://developer.apple.com/documentation/arkit/arconfiguration\n */\nexport enum TrackingConfiguration {\n /**\n * Provides high-quality AR experiences that use the rear-facing camera precisely track a device's\n * position and orientation and allow plane detection and hit testing.\n */\n World = 'ARWorldTrackingConfiguration',\n /**\n * Provides basic AR experiences that use the rear-facing camera and track only a device's\n * orientation.\n */\n Orientation = 'AROrientationTrackingConfiguration',\n /**\n * Provides AR experiences that use the front-facing camera and track the movement and expressions\n * of the user's face.\n */\n Face = 'ARFaceTrackingConfiguration',\n}\n\nexport enum DepthDataQuality {\n Low = 'AVDepthDataQualityLow',\n High = 'AVDepthDataQualityHigh',\n}\n\nexport enum DepthDataAccuracy {\n Absolute = 'AVDepthDataAccuracyAbsolute',\n Relative = 'AVDepthDataAccuracyRelative',\n}\n\nexport type Size = {\n width: number;\n height: number;\n};\n\nexport type Vector3 = {\n x: number;\n y: number;\n z: number;\n};\n\nexport type Vector2 = {\n x: number;\n y: number;\n};\n\nexport type TextureCoordinate = {\n u: number;\n v: number;\n};\n\nexport type Matrix = number[];\n\nexport type FaceGeometry = {\n vertexCount: number;\n textureCoordinateCount: number;\n triangleCount: number;\n vertices: Vector3[];\n textureCoordinates: TextureCoordinate[];\n triangleIndices: number[];\n};\n\nexport type Anchor = {\n type: AnchorType;\n transform: Matrix;\n id: string;\n center?: Vector3;\n extent?: { width: number; length: number };\n image?: {\n name: string | null;\n size: Size;\n };\n geometry?: FaceGeometry;\n blendShapes?: { [shape in BlendShape]?: number };\n};\n\nexport type HitTest = {\n type: number;\n distance: number;\n localTransform: number[];\n worldTransform: number[];\n anchor: Anchor;\n};\n\nexport type HitTestResults = {\n hitTest: HitTest;\n};\n\nexport type DetectionImage = {\n uri: string;\n width: number;\n name?: string;\n};\n\nexport type ARFrameAnchorRequest = {\n ARFaceTrackingConfiguration?: {\n geometry?: boolean;\n blendShapes?: boolean | BlendShape[];\n };\n};\n\nexport type ARFrameRequest = {\n anchors?: ARFrameAnchorRequest;\n rawFeaturePoints?: boolean;\n lightEstimation?: boolean;\n capturedDepthData?: boolean;\n};\n\nexport type LightEstimation = {\n ambientIntensity: number;\n ambientColorTemperature: number;\n primaryLightDirection?: Vector3;\n primaryLightIntensity?: number;\n};\n\nexport type RawFeaturePoint = { x: number; y: number; z: number; id: string };\n\nexport type CameraCalibrationData = {\n intrinsicMatrix: Matrix;\n intrinsicMatrixReferenceDimensions: Size;\n extrinsicMatrix: Matrix;\n pixelSize: number;\n lensDistortionLookupTable: any;\n inverseLensDistortionLookupTable: any;\n lensDistortionCenter: Vector3;\n};\n\nexport type CapturedDepthData = {\n timestamp: number;\n depthDataQuality: DepthDataQuality;\n depthDataAccuracy: DepthDataAccuracy;\n depthDataFiltered: boolean;\n cameraCalibrationData: CameraCalibrationData;\n};\n\nexport type ARFrame = {\n timestamp: number;\n anchors?: Anchor[] | null;\n rawFeaturePoints?: RawFeaturePoint[] | null;\n lightEstimation?: LightEstimation | null;\n capturedDepthData?: CapturedDepthData | null;\n};\n\nexport type ARMatrices = {\n transform: Matrix;\n viewMatrix: Matrix;\n projectionMatrix: Matrix;\n};\n\ntype ARStartResult = {\n capturedImageTexture: number;\n};\n\ntype ReactNativeNodeHandle = number;\n\nexport type ImageResolution = {\n width: number;\n height: number;\n};\n\nexport type VideoFormat = {\n type: string;\n imageResolution: ImageResolution;\n framesPerSecond: number;\n};\n\nexport enum BlendShape {\n BrowDownL = 'browDown_L',\n BrowDownR = 'browDown_R',\n BrowInnerUp = 'browInnerUp',\n BrowOuterUpL = 'browOuterUp_L',\n BrowOuterUpR = 'browOuterUp_R',\n CheekPuff = 'cheekPuff',\n CheekSquintL = 'cheekSquint_L',\n CheekSquintR = 'cheekSquint_R',\n EyeBlinkL = 'eyeBlink_L',\n EyeBlinkR = 'eyeBlink_R',\n EyeLookDownL = 'eyeLookDown_L',\n EyeLookDownR = 'eyeLookDown_R',\n EyeLookInL = 'eyeLookIn_L',\n EyeLookInR = 'eyeLookIn_R',\n EyeLookOutL = 'eyeLookOut_L',\n EyeLookOutR = 'eyeLookOut_R',\n EyeLookUpL = 'eyeLookUp_L',\n EyeLookUpR = 'eyeLookUp_R',\n EyeSquintL = 'eyeSquint_L',\n EyeSquintR = 'eyeSquint_R',\n EyeWideL = 'eyeWide_L',\n EyeWideR = 'eyeWide_R',\n JawForward = 'jawForward',\n JawLeft = 'jawLeft',\n JawOpen = 'jawOpen',\n JawRight = 'jawRight',\n MouthClose = 'mouthClose',\n MouthDimpleL = 'mouthDimple_L',\n MouthDimpleR = 'mouthDimple_R',\n MouthFrownL = 'mouthFrown_L',\n MouthFrownR = 'mouthFrown_R',\n MouthFunnel = 'mouthFunnel',\n MouthLeft = 'mouthLeft',\n MouthLowerDownL = 'mouthLowerDown_L',\n MouthLowerDownR = 'mouthLowerDown_R',\n MouthPressL = 'mouthPress_L',\n MouthPressR = 'mouthPress_R',\n MouthPucker = 'mouthPucker',\n MouthRight = 'mouthRight',\n MouthRollLower = 'mouthRollLower',\n MouthRollUpper = 'mouthRollUpper',\n MouthShrugLower = 'mouthShrugLower',\n MouthShrugUpper = 'mouthShrugUpper',\n MouthSmileL = 'mouthSmile_L',\n MouthSmileR = 'mouthSmile_R',\n MouthStretchL = 'mouthStretch_L',\n MouthStretchR = 'mouthStretch_R',\n MouthUpperUpL = 'mouthUpperUp_L',\n MouthUpperUpR = 'mouthUpperUp_R',\n NoseSneerL = 'noseSneer_L',\n NoseSneerR = 'noseSneer_R',\n}\n\nexport enum FaceAnchorProp {\n Geometry = 'geometry',\n BlendShapes = 'blendShapes',\n}\n\n/**\n * Plane Detection\n * Options for whether and how ARKit detects flat surfaces in captured images.\n * https://developer.apple.com/documentation/arkit/arplanedetection\n */\nexport enum PlaneDetection {\n /**\n * No plane detection is run\n */\n None = 'none',\n /**\n * Plane detection determines horizontal planes in the scene\n */\n Horizontal = 'horizontal',\n /**\n * Plane detection determines horizontal planes in the scene\n */\n Vertical = 'vertical',\n}\n\n/**\n * Hit-Test Result Types\n * Possible types for specifying a hit-test search, or for the result of a hit-test search.\n * https://developer.apple.com/documentation/arkit/arhittestresulttype\n */\nexport enum HitTestResultTypes {\n /**\n * Result type from intersecting the nearest feature point.\n */\n FeaturePoint = 'featurePoint',\n /**\n * Result type from intersecting a horizontal plane estimate, determined for the current frame.\n */\n HorizontalPlane = 'horizontalPlane',\n /**\n * Result type from intersecting a vertical plane estimate, determined for the current frame.\n */\n VerticalPlane = 'verticalPlane',\n /**\n * Result type from intersecting with an existing plane anchor.\n */\n ExistingPlane = 'existingPlane',\n /**\n * Result type from intersecting with an existing plane anchor, taking into account the plane’s\n * extent.\n */\n ExistingPlaneUsingExtent = 'existingPlaneUsingExtent',\n /**\n * Result type from intersecting with an existing plane anchor, taking into account the plane’s\n * geometry.\n */\n ExistingPlaneUsingGeometry = 'existingPlaneUsingGeometry',\n}\n\n/**\n * World Alignment\n * Options for how ARKit constructs a scene coordinate system based on real-world device motion.\n * https://developer.apple.com/documentation/arkit/arworldalignment\n */\nexport enum WorldAlignment {\n /**\n * Aligns the world with gravity that is defined by vector (0, -1, 0).\n */\n Gravity = 'gravity',\n /**\n * Aligns the world with gravity that is defined by the vector (0, -1, 0) and heading (w.r.t. true\n * north) that is given by the vector (0, 0, -1).\n */\n GravityAndHeading = 'gravityAndHeading',\n /**\n * Aligns the world with the camera’s orientation.\n */\n AlignmentCamera = 'alignmentCamera',\n}\n\nexport enum EventType {\n FrameDidUpdate = ExponentAR.frameDidUpdate,\n DidFailWithError = ExponentAR.didFailWithError,\n AnchorsDidUpdate = ExponentAR.anchorsDidUpdate,\n CameraDidChangeTrackingState = ExponentAR.cameraDidChangeTrackingState,\n SessionWasInterrupted = ExponentAR.sessionWasInterrupted,\n SessionInterruptionEnded = ExponentAR.sessionInterruptionEnded,\n}\n\nexport enum AnchorType {\n Face = 'ARFaceAnchor',\n Image = 'ARImageAnchor',\n Plane = 'ARPlaneAnchor',\n Anchor = 'ARAnchor',\n}\n\nexport enum AnchorEventType {\n Add = 'add',\n Update = 'update',\n Remove = 'remove',\n}\n\nexport enum FrameAttribute {\n Anchors = 'anchors',\n RawFeaturePoints = 'rawFeaturePoints',\n LightEstimation = 'lightEstimation',\n CapturedDepthData = 'capturedDepthData',\n}\n\nexport enum TrackingState {\n /** Tracking is not available. */\n NotAvailable = 'ARTrackingStateNotAvailable',\n /** Tracking is limited. See tracking reason for details. */\n Limited = 'ARTrackingStateLimited',\n /** Tracking is Normal. */\n Normal = 'ARTrackingStateNormal',\n}\n\nexport enum TrackingStateReason {\n /** Tracking is not limited. */\n None = 'ARTrackingStateReasonNone',\n\n /** Tracking is limited due to initialization in progress. */\n Initializing = 'ARTrackingStateReasonInitializing',\n\n /** Tracking is limited due to a excessive motion of the camera. */\n ExcessiveMotion = 'ARTrackingStateReasonExcessiveMotion',\n\n /** Tracking is limited due to a lack of features visible to the camera. */\n InsufficientFeatures = 'ARTrackingStateReasonInsufficientFeatures',\n\n /** Tracking is limited due to a relocalization in progress. */\n Relocalizing = 'ARTrackingStateReasonRelocalizing',\n}\n\ntype FrameDidUpdateEvent = {};\n\ntype DidFailWithErrorEvent = { error: Error };\n\ntype AnchorsDidUpdateEvent = {\n eventType: AnchorEventType;\n anchors: Anchor[];\n};\n\ntype CameraDidChangeTrackingStateEvent = {\n trackingState: TrackingState;\n trackingStateReason: TrackingStateReason;\n};\n\ntype SessionWasInterruptedEvent = {};\n\ntype SessionInterruptionEndedEvent = {};\n\nexport function getVersion(): string {\n return ExponentAR.ARKitVersion;\n}\n\nconst AvailabilityErrorMessages = {\n Simulator: `Cannot run EXGL in a simulator`,\n ANineChip: `ARKit can only run on iOS devices with A9 (2015) or greater chips! This is a`,\n ARKitOnlyOnIOS: `ARKit can only run on an iOS device! This is a`,\n};\n\nexport function isAvailable(): boolean {\n if (\n !Constants.isDevice || // Prevent Simulators\n // @ts-ignore\n Platform.isTVOS ||\n Platform.OS !== 'ios' || // Device is iOS\n Constants.deviceYearClass < 2015 || // Device has A9 chip\n !ExponentAR.isSupported || // ARKit is included in the build\n !ExponentAR.startAsync // Older SDK versions (27 and lower) that are fully compatible\n ) {\n return false;\n }\n\n return true;\n}\n\nexport function getUnavailabilityReason(): string {\n if (!Constants.isDevice) {\n return AvailabilityErrorMessages.Simulator;\n } else if (Platform.OS !== 'ios') {\n return `${AvailabilityErrorMessages.ARKitOnlyOnIOS} ${Platform.OS} device`;\n } else if (Constants.deviceYearClass < 2015) {\n return `${AvailabilityErrorMessages.ANineChip} ${Constants.deviceYearClass} device`;\n }\n return 'Unknown Reason';\n}\n\nexport function onFrameDidUpdate(\n listener: (event: FrameDidUpdateEvent) => void\n): EmitterSubscription {\n return _addListener(EventType.FrameDidUpdate, listener);\n}\n\nexport function onDidFailWithError(\n listener: (event: DidFailWithErrorEvent) => void\n): EmitterSubscription {\n return _addListener(EventType.DidFailWithError, listener);\n}\n\nexport function onAnchorsDidUpdate(\n listener: (event: AnchorsDidUpdateEvent) => void\n): EmitterSubscription {\n return _addListener(EventType.AnchorsDidUpdate, listener);\n}\n\nexport function onCameraDidChangeTrackingState(\n listener: (event: CameraDidChangeTrackingStateEvent) => void\n): EmitterSubscription {\n return _addListener(EventType.CameraDidChangeTrackingState, listener);\n}\n\nexport function onSessionWasInterrupted(\n listener: (event: SessionWasInterruptedEvent) => void\n): EmitterSubscription {\n return _addListener(EventType.SessionWasInterrupted, listener);\n}\n\nexport function onSessionInterruptionEnded(\n listener: (event: SessionInterruptionEndedEvent) => void\n): EmitterSubscription {\n return _addListener(EventType.SessionInterruptionEnded, listener);\n}\n\nfunction _addListener(eventType: EventType, event: (...args: any[]) => void): EmitterSubscription {\n return emitter.addListener(eventType as any, event);\n}\n\nexport function removeAllListeners(eventType?: EventType): void {\n emitter.removeAllListeners(eventType as any);\n}\n\n// TODO: support multiple types (take an array or bit flags)\nexport function performHitTest(point: Vector2, types: HitTestResultTypes): HitTestResults {\n if (ExponentAR.performHitTest) {\n return ExponentAR.performHitTest(point, types);\n }\n throw new Error(`AR hit testing is not supported on this device`);\n}\n\nexport async function setDetectionImagesAsync(images: {\n [name: string]: DetectionImage;\n}): Promise<void> {\n if (ExponentAR.setDetectionImagesAsync) {\n await ExponentAR.setDetectionImagesAsync(images);\n }\n}\n\nexport function getCurrentFrame(attributes?: ARFrameRequest): ARFrame {\n if (ExponentAR.getCurrentFrame) {\n return ExponentAR.getCurrentFrame(attributes);\n }\n throw new Error(`AR is not supported on this device`);\n}\n\nexport function getARMatrices(near: number, far: number): ARMatrices {\n if (ExponentAR.getARMatrices) {\n return ExponentAR.getARMatrices(near, far);\n }\n throw new Error(`AR is not supported on this device`);\n}\n\nexport async function stopAsync(): Promise<void> {\n if (ExponentAR.stopAsync) {\n await ExponentAR.stopAsync();\n }\n}\n\nexport async function startAsync(\n node: ReactNativeNodeHandle | React.Component,\n configuration: TrackingConfiguration\n): Promise<ARStartResult> {\n let handle = typeof node === 'number' ? node : _getNodeHandle(node);\n if (ExponentAR.startAsync) {\n return await ExponentAR.startAsync(handle, configuration);\n }\n throw new Error(`AR is not supported on this device`);\n}\n\nfunction _getNodeHandle(component: React.Component): ReactNativeNodeHandle {\n let handle = findNodeHandle(component);\n if (handle === null) {\n throw new Error(`Could not find the React node handle for the AR component: ${component}`);\n }\n return handle;\n}\n\nexport function reset() {\n if (ExponentAR.reset) {\n ExponentAR.reset();\n }\n}\n\nexport function resume() {\n if (ExponentAR.resume) {\n ExponentAR.resume();\n }\n}\n\nexport function pause() {\n if (ExponentAR.pause) {\n ExponentAR.pause();\n }\n}\n\nexport async function setConfigurationAsync(configuration: TrackingConfiguration): Promise<void> {\n if (ExponentAR.setConfigurationAsync) {\n await ExponentAR.setConfigurationAsync(configuration);\n }\n}\n\nexport function getProvidesAudioData(): boolean {\n if (ExponentAR.getProvidesAudioData) {\n return ExponentAR.getProvidesAudioData();\n }\n return false;\n}\n\nexport function setProvidesAudioData(providesAudioData: boolean): void {\n if (ExponentAR.setProvidesAudioData) {\n ExponentAR.setProvidesAudioData(providesAudioData);\n }\n}\n\nexport function setPlaneDetection(planeDetection: PlaneDetection): void {\n if (ExponentAR.setPlaneDetection) {\n ExponentAR.setPlaneDetection(planeDetection);\n }\n}\n\nexport function getPlaneDetection(): PlaneDetection {\n if (ExponentAR.getPlaneDetection) {\n return ExponentAR.getPlaneDetection();\n }\n throw new Error(`AR plane detection is not supported on this device`);\n}\n\nexport function getCameraTexture(): number {\n if (ExponentAR.getCameraTexture) {\n return ExponentAR.getCameraTexture();\n }\n throw new Error(`AR camera textures are not supported on this device`);\n}\n\nexport async function setWorldOriginAsync(matrix_float4x4: Matrix): Promise<void> {\n if (ExponentAR.setWorldOriginAsync) {\n await ExponentAR.setWorldOriginAsync(matrix_float4x4);\n }\n}\n\nexport function setLightEstimationEnabled(isLightEstimationEnabled: boolean) {\n if (ExponentAR.setLightEstimationEnabled) {\n ExponentAR.setLightEstimationEnabled(isLightEstimationEnabled);\n }\n}\n\nexport function getLightEstimationEnabled(): boolean {\n if (ExponentAR.getLightEstimationEnabled) {\n return ExponentAR.getLightEstimationEnabled();\n }\n return false;\n}\n\nexport function setAutoFocusEnabled(isAutoFocusEnabled: boolean): void {\n if (ExponentAR.setAutoFocusEnabled) {\n ExponentAR.setAutoFocusEnabled(isAutoFocusEnabled);\n }\n}\n\nexport function getAutoFocusEnabled(): boolean {\n if (ExponentAR.getAutoFocusEnabled) {\n return ExponentAR.getAutoFocusEnabled();\n }\n return false;\n}\n\nexport function setWorldAlignment(worldAlignment: WorldAlignment): void {\n if (ExponentAR.setWorldAlignment) {\n ExponentAR.setWorldAlignment(worldAlignment);\n }\n}\n\nexport function getWorldAlignment(): WorldAlignment {\n if (ExponentAR.getWorldAlignment) {\n return ExponentAR.getWorldAlignment();\n }\n throw new Error(`AR world alignment is not supported on this device`);\n}\n\nexport function isConfigurationAvailable(configuration: TrackingConfiguration): boolean {\n const { width, height } = Dimensions.get('window');\n // @ts-ignore: re-evaluate this for the new iPhones (2018)\n const isX = (width === 812 || height === 812) && !Platform.isTVOS && !Platform.isPad;\n if (configuration === TrackingConfiguration.Face && isX && isAvailable()) {\n return true;\n }\n return !!ExponentAR[configuration];\n}\n\nexport function getSupportedVideoFormats(configuration: TrackingConfiguration): VideoFormat[] {\n const videoFormats = {\n [TrackingConfiguration.World]: 'WorldTrackingVideoFormats',\n [TrackingConfiguration.Orientation]: 'OrientationTrackingVideoFormats',\n [TrackingConfiguration.Face]: 'FaceTrackingVideoFormats',\n };\n const videoFormat = videoFormats[configuration];\n return ExponentAR[videoFormat] || [];\n}\n\nexport function isFrontCameraAvailable(): boolean {\n return isConfigurationAvailable(TrackingConfiguration.Face);\n}\n\nexport function isRearCameraAvailable(): boolean {\n return isConfigurationAvailable(TrackingConfiguration.World);\n}\n"]}
\No newline at end of file