@vincentt-xr/sdk 2.0.0-alpha.0 → 2.0.0-alpha.10
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/GROUNDING.md +8193 -111
- package/README.md +86 -52
- package/dist/CanonicalHeadFrame-D_0OzdB9.cjs +1 -0
- package/dist/CanonicalHeadFrame-DdUqF6Fv.js +1506 -0
- package/dist/DebuggerUI-CVuV-VJ5.cjs +1 -0
- package/dist/DebuggerUI-D-rcPa54.js +275 -0
- package/dist/FaceRetouch-C1AxBNex.js +1071 -0
- package/dist/FaceRetouch-D7kryDE6.cjs +134 -0
- package/dist/FaceSurface-CHAMEeG1.cjs +1 -0
- package/dist/FaceSurface-DmP9AEeC.js +27 -0
- package/dist/SkeletonUtils-C2r90MtN.js +21 -0
- package/dist/SkeletonUtils-CddIup1F.cjs +1 -0
- package/dist/TextLabel-XE0rQSDn.cjs +2 -0
- package/dist/TextLabel-c9BCucOI.js +961 -0
- package/dist/assets/cache.d.ts +99 -0
- package/dist/assets/estimate.d.ts +11 -0
- package/dist/assets/gltfLoader.d.ts +16 -0
- package/dist/assets/index.d.ts +7 -0
- package/dist/assets/loaders.d.ts +43 -0
- package/dist/assets/react.d.ts +33 -0
- package/dist/assets/sdkModels.d.ts +22 -0
- package/dist/audio/AudioEngine.d.ts +3 -1
- package/dist/audio/AudioPlayer.d.ts +29 -0
- package/dist/audio/AudioPlayerLogic.d.ts +4 -0
- package/dist/audio/index.d.ts +2 -0
- package/dist/body/__fixtures__/syntheticRig.d.ts +21 -0
- package/dist/body/bodyFlipGuard.d.ts +39 -0
- package/dist/body/bodyIdentity.d.ts +72 -0
- package/dist/body/bodyMask.d.ts +79 -0
- package/dist/body/bodyMaskMaterial.d.ts +15 -0
- package/dist/body/bodyPose.d.ts +58 -0
- package/dist/body/bodyRigFit.d.ts +148 -0
- package/dist/body/bodyRigSolver.d.ts +114 -0
- package/dist/body/bodySubject.d.ts +46 -0
- package/dist/body-pose/index.d.ts +521 -0
- package/dist/body-trigger/__fixtures__/syntheticBody.d.ts +83 -0
- package/dist/body-trigger/frame.d.ts +88 -0
- package/dist/body-trigger/index.d.ts +6 -0
- package/dist/body-trigger/moves.d.ts +235 -0
- package/dist/body-trigger/trigger.d.ts +75 -0
- package/dist/bodyMaskMaterial-CBWub5t_.cjs +68 -0
- package/dist/bodyMaskMaterial-Cs2awskk.js +207 -0
- package/dist/cache-2x3CUJuY.js +212 -0
- package/dist/cache-DL1Dbz6k.cjs +1 -0
- package/dist/calibration/calibration.d.ts +75 -0
- package/dist/calibration/index.d.ts +6 -0
- package/dist/calibration/storage.d.ts +13 -0
- package/dist/calibration/types.d.ts +53 -0
- package/dist/calibration/useXRCalibration.d.ts +46 -0
- package/dist/camera/CameraPermissionGate.d.ts +26 -0
- package/dist/camera/devices.d.ts +26 -0
- package/dist/camera/index.d.ts +8 -0
- package/dist/camera/permission.d.ts +86 -0
- package/dist/camera/useCameraPermission.d.ts +35 -0
- package/dist/canonicalFace-BHwyCx1c.js +9 -0
- package/dist/canonicalFace-C83I225R.cjs +1 -0
- package/dist/capabilities/detect.d.ts +45 -0
- package/dist/capabilities/index.d.ts +5 -0
- package/dist/capabilities/types.d.ts +120 -0
- package/dist/capabilities/useXRCapabilities.d.ts +18 -0
- package/dist/compat/environment.d.ts +5 -0
- package/dist/compat/index.d.ts +4 -0
- package/dist/compat/run.d.ts +18 -0
- package/dist/compat/scenarios.d.ts +10 -0
- package/dist/compat/types.d.ts +101 -0
- package/dist/components/Axes/index.d.ts +6 -0
- package/dist/components/BodyInstruction/BodyPoseHint.d.ts +63 -0
- package/dist/components/BodyInstruction/index.d.ts +76 -0
- package/dist/components/BodyInstruction/useBodyPose.d.ts +30 -0
- package/dist/components/BodyRig/BodyAttachment.d.ts +28 -0
- package/dist/components/BodyRig/BodyOccluder.d.ts +27 -0
- package/dist/components/BodyRig/bodyDepth.d.ts +57 -0
- package/dist/components/BodyRig/index.d.ts +129 -0
- package/dist/components/BodyRig/useBodyDepthTexture.d.ts +40 -0
- package/dist/components/BodyTracker/index.d.ts +26 -1
- package/dist/components/BodyTrigger/index.d.ts +56 -0
- package/dist/components/Debugger/DebuggerProvider.d.ts +14 -1
- package/dist/components/Debugger/DebuggerUI.d.ts +3 -1
- package/dist/components/FaceAtlas/FaceAtlasLayer.d.ts +114 -0
- package/dist/components/FaceAtlas/MadeUpCamera.d.ts +80 -0
- package/dist/components/FaceAtlas/constants.d.ts +8 -0
- package/dist/components/FaceAtlas/index.d.ts +7 -0
- package/dist/components/FaceAtlas/useFaceAtlasSurface.d.ts +84 -0
- package/dist/components/FaceAtlas/useFaceSkin.d.ts +84 -0
- package/dist/components/FaceCharacter/ExternalFaceMesh.d.ts +109 -0
- package/dist/components/FaceCharacter/FaceExpressionController.d.ts +53 -0
- package/dist/components/FaceCharacter/FaceMorph.d.ts +71 -0
- package/dist/components/FaceCharacter/FacePiercing.d.ts +65 -0
- package/dist/components/FaceCharacter/FaceReprojection.d.ts +85 -0
- package/dist/components/FaceCharacter/FaceRig.d.ts +38 -0
- package/dist/components/FaceCharacter/FaceSurface.d.ts +49 -0
- package/dist/components/FaceCharacter/FaceSurfaceOccluder.d.ts +39 -0
- package/dist/components/FaceCharacter/PinToFaceMesh.d.ts +68 -0
- package/dist/components/FaceCharacter/index.d.ts +18 -0
- package/dist/components/FaceCharacter/useFaceReprojector.d.ts +10 -0
- package/dist/components/FaceInset/FaceInset.d.ts +68 -0
- package/dist/components/FaceInset/frame.d.ts +94 -0
- package/dist/components/FaceInset/index.d.ts +6 -0
- package/dist/components/FaceInset/material.d.ts +40 -0
- package/dist/components/FaceInset/useFaceInsetTexture.d.ts +37 -0
- package/dist/components/FaceInstruction/FaceExpressionHint.d.ts +43 -0
- package/dist/components/FaceInstruction/index.d.ts +56 -0
- package/dist/components/FaceInstruction/useFaceExpression.d.ts +20 -0
- package/dist/components/FaceLiquify/FaceLiquify.d.ts +49 -0
- package/dist/components/FaceLiquify/debug.d.ts +37 -0
- package/dist/components/FaceLiquify/frame.d.ts +55 -0
- package/dist/components/FaceLiquify/index.d.ts +10 -0
- package/dist/components/FaceLiquify/material.d.ts +39 -0
- package/dist/components/FaceLiquify/pass.d.ts +49 -0
- package/dist/components/FaceLiquify/presence.d.ts +25 -0
- package/dist/components/FaceLiquify/presets.d.ts +82 -0
- package/dist/components/FaceLiquify/selfTest.d.ts +66 -0
- package/dist/components/FaceLiquify/target.d.ts +85 -0
- package/dist/components/FaceLiquify/warp.d.ts +72 -0
- package/dist/components/FaceMesh/FaceMeshRenderer.d.ts +25 -0
- package/dist/components/FaceMesh/canonical/CanonicalFaceMeshRenderer.d.ts +70 -1
- package/dist/components/FaceMesh/canonical/FaceMeshMaterial.d.ts +25 -0
- package/dist/components/FaceMesh/canonical/assets.d.ts +3 -0
- package/dist/components/FaceMesh/canonical/geometryGroups.d.ts +30 -0
- package/dist/components/FaceMesh/canonical/parseCanonicalFaceModel.d.ts +24 -0
- package/dist/components/FaceMesh/canonical/shaders.d.ts +2 -0
- package/dist/components/FaceMesh/deform.d.ts +3 -0
- package/dist/components/FaceMesh/index.d.ts +6 -1
- package/dist/components/FaceMesh/material/defaults.d.ts +74 -0
- package/dist/components/FaceMesh/material/index.d.ts +1 -0
- package/dist/components/FaceMesh/material/options.d.ts +5 -1
- package/dist/components/FaceMesh/material/support.d.ts +7 -2
- package/dist/components/FaceMesh/material/textures.d.ts +4 -0
- package/dist/components/FaceMesh/material/types.d.ts +4 -2
- package/dist/components/FaceRetouch/Background.d.ts +11 -5
- package/dist/components/FaceRetouch/FaceRetouch.d.ts +52 -0
- package/dist/components/FaceRetouch/index.d.ts +2 -6
- package/dist/components/FaceRetouch/landmarkMask.d.ts +4 -6
- package/dist/components/FaceRetouch/renderState.d.ts +19 -0
- package/dist/components/FaceRetouch/useFaceRetouchMask.d.ts +4 -7
- package/dist/components/FaceSwap/FaceMirror.d.ts +46 -0
- package/dist/components/FaceSwap/FaceSwap.d.ts +58 -0
- package/dist/components/FaceSwap/FaceTextureLayer.d.ts +72 -0
- package/dist/components/FaceSwap/faceSwapPlan.d.ts +91 -0
- package/dist/components/FaceSwap/index.d.ts +13 -0
- package/dist/components/FaceSwap/settings.d.ts +300 -0
- package/dist/components/FaceSwap/useFaceTexture.d.ts +35 -0
- package/dist/components/FaceSwap/useLiveFace.d.ts +38 -0
- package/dist/components/FaceSwap/useLiveFaceTexture.d.ts +31 -0
- package/dist/components/FaceTracker/index.d.ts +5 -3
- package/dist/components/FaceWarp3D/FaceWarp3D.d.ts +50 -0
- package/dist/components/FaceWarp3D/index.d.ts +2 -0
- package/dist/components/Faceless/Faceless.d.ts +51 -0
- package/dist/components/Faceless/index.d.ts +2 -0
- package/dist/components/GestureListener/index.d.ts +11 -0
- package/dist/components/HairLock/HairLock.d.ts +39 -0
- package/dist/components/HairLock/index.d.ts +2 -0
- package/dist/components/HairLock/lockGeometry.d.ts +15 -0
- package/dist/components/HandCutout/index.d.ts +35 -0
- package/dist/components/HandEffect/index.d.ts +36 -0
- package/dist/components/HandInstruction/HandGestureHint.d.ts +70 -0
- package/dist/components/HandInstruction/index.d.ts +74 -0
- package/dist/components/HandInstruction/useHandGesture.d.ts +22 -0
- package/dist/components/HandJoints2D/index.d.ts +6 -0
- package/dist/components/HandRig/ForearmOccluder.d.ts +29 -0
- package/dist/components/HandRig/HandAttachment.d.ts +34 -0
- package/dist/components/HandRig/HandNails.d.ts +61 -0
- package/dist/components/HandRig/HandOccluder.d.ts +45 -0
- package/dist/components/HandRig/HandTattoo.d.ts +61 -0
- package/dist/components/HandRig/WristAttachment.d.ts +34 -0
- package/dist/components/HandRig/index.d.ts +127 -0
- package/dist/components/HandRig/useArmMask.d.ts +29 -0
- package/dist/components/HandRig/wristSolve.d.ts +96 -0
- package/dist/components/HandTouch/HandTouch.d.ts +62 -0
- package/dist/components/HandTouch/Touchable.d.ts +36 -0
- package/dist/components/HandTouch/index.d.ts +2 -0
- package/dist/components/HandTracker/index.d.ts +12 -2
- package/dist/components/HandTracking2D/HandVisual.d.ts +12 -0
- package/dist/components/HandTracking2D/index.d.ts +5 -0
- package/dist/components/HandTracking2DController/index.d.ts +5 -0
- package/dist/components/HandTracking3D/index.d.ts +6 -0
- package/dist/components/HeadBinding/index.d.ts +14 -0
- package/dist/components/HeadOccluder/CanonicalHeadFrame.d.ts +22 -0
- package/dist/components/HeadOccluder/Earrings.d.ts +55 -0
- package/dist/components/HeadOccluder/HeadAttachment.d.ts +38 -0
- package/dist/components/HeadOccluder/NeckOccluder.d.ts +67 -0
- package/dist/components/HeadOccluder/earringPlacement.d.ts +31 -0
- package/dist/components/HeadOccluder/headAttachmentPoints.d.ts +69 -0
- package/dist/components/HeadOccluder/index.d.ts +57 -3
- package/dist/components/HeadOccluder/useCanonicalHeadFit.d.ts +36 -0
- package/dist/components/HeadOccluder/useLandmarkPoseFit.d.ts +80 -0
- package/dist/components/HolisticTracker/index.d.ts +69 -0
- package/dist/components/HolisticTracker/settings.d.ts +58 -0
- package/dist/components/HolisticTracker/signals.d.ts +49 -0
- package/dist/components/Instruction/HintStage.d.ts +29 -0
- package/dist/components/Instruction/InstructionCue.d.ts +126 -0
- package/dist/components/Instruction/gestureHold.d.ts +20 -0
- package/dist/components/Instruction/ghost.d.ts +129 -0
- package/dist/components/Instruction/hintBlend.d.ts +19 -0
- package/dist/components/Instruction/hintLook.d.ts +81 -0
- package/dist/components/Instruction/hintLoop.d.ts +36 -0
- package/dist/components/Instruction/index.d.ts +41 -0
- package/dist/components/Instruction/useGhostModel.d.ts +33 -0
- package/dist/components/Instruction/useInstructionHold.d.ts +72 -0
- package/dist/components/IrisEffect/IrisMaterial.d.ts +73 -0
- package/dist/components/IrisEffect/index.d.ts +51 -0
- package/dist/components/IrisEffect/settings.d.ts +117 -0
- package/dist/components/LightObject/index.d.ts +20 -0
- package/dist/components/LipEffect/LipEffect.d.ts +28 -0
- package/dist/components/LipEffect/LipEffectMaterial.d.ts +98 -0
- package/dist/components/LipEffect/LipEffects.d.ts +12 -0
- package/dist/components/LipEffect/defaults.d.ts +51 -0
- package/dist/components/LipEffect/index.d.ts +12 -0
- package/dist/components/LipEffect/lipShading.d.ts +73 -0
- package/dist/components/LipEffect/settings.d.ts +375 -0
- package/dist/components/LipEffect/shader.d.ts +39 -0
- package/dist/components/LipEffect/types.d.ts +141 -0
- package/dist/components/LipEffect/useLipDesignTextures.d.ts +17 -0
- package/dist/components/LipEffect/uvGuide.d.ts +74 -0
- package/dist/components/LookAt/index.d.ts +23 -0
- package/dist/components/Makeup/Blush.d.ts +18 -0
- package/dist/components/Makeup/Brows.d.ts +20 -0
- package/dist/components/Makeup/Contour.d.ts +17 -0
- package/dist/components/Makeup/Eyeliner.d.ts +20 -0
- package/dist/components/Makeup/Eyeshadow.d.ts +20 -0
- package/dist/components/Makeup/Highlighter.d.ts +18 -0
- package/dist/components/Makeup/MakeupDesign.d.ts +37 -0
- package/dist/components/Makeup/MakeupRegion.d.ts +132 -0
- package/dist/components/Makeup/constants.d.ts +44 -0
- package/dist/components/Makeup/design.d.ts +106 -0
- package/dist/components/Makeup/designSamples.d.ts +42 -0
- package/dist/components/Makeup/eyes.d.ts +114 -0
- package/dist/components/Makeup/fields.d.ts +10 -0
- package/dist/components/Makeup/geometry.d.ts +106 -0
- package/dist/components/Makeup/index.d.ts +26 -0
- package/dist/components/Makeup/looks.d.ts +28 -0
- package/dist/components/Makeup/material.d.ts +239 -0
- package/dist/components/Makeup/settings.d.ts +54 -0
- package/dist/components/Makeup/shades.d.ts +143 -0
- package/dist/components/Makeup/shapes.d.ts +27 -0
- package/dist/components/Makeup/skinTone.d.ts +135 -0
- package/dist/components/Makeup/types.d.ts +110 -0
- package/dist/components/Makeup/useMakeupSkinTone.d.ts +40 -0
- package/dist/components/MeshRenderer/index.d.ts +59 -0
- package/dist/components/Necklace/Necklace.d.ts +44 -0
- package/dist/components/Necklace/index.d.ts +1 -0
- package/dist/components/ParticleEmitter/ParticleEmitter.d.ts +69 -0
- package/dist/components/ParticleEmitter/index.d.ts +1 -0
- package/dist/components/PersonCutout/index.d.ts +46 -0
- package/dist/components/PersonCutout/personCutout.d.ts +16 -0
- package/dist/components/PersonCutout/personMask.d.ts +19 -0
- package/dist/components/PersonCutout/useBodyMaskTexture.d.ts +35 -0
- package/dist/components/PerspectiveCamera/index.d.ts +2 -8
- package/dist/components/PinToMesh/index.d.ts +47 -0
- package/dist/components/RenderGroupLayer/index.d.ts +6 -0
- package/dist/components/SceneObjectRenderer/index.d.ts +23 -0
- package/dist/components/Screen2D/ScreenTransformFrame.d.ts +11 -0
- package/dist/components/Screen2D/ScreenTransformHelpers.d.ts +19 -0
- package/dist/components/Screen2D/ScreenTransformInteraction.d.ts +18 -0
- package/dist/components/Screen2D/index.d.ts +5 -0
- package/dist/components/ScreenGlass/defaults.d.ts +3 -0
- package/dist/components/ScreenGlass/index.d.ts +5 -0
- package/dist/components/ScreenGlass/shaders.d.ts +2 -0
- package/dist/components/ScreenGlass/types.d.ts +10 -0
- package/dist/components/ScreenGradient/defaults.d.ts +5 -0
- package/dist/components/ScreenGradient/index.d.ts +5 -0
- package/dist/components/ScreenGradient/shaders.d.ts +2 -0
- package/dist/components/ScreenGradient/types.d.ts +19 -0
- package/dist/components/ScreenImage/ScreenImage.d.ts +4 -0
- package/dist/components/ScreenImage/components/DynamicTextureSync.d.ts +9 -0
- package/dist/components/ScreenImage/components/ScreenImageBody.d.ts +9 -0
- package/dist/components/ScreenImage/components/ScreenImageFrame.d.ts +9 -0
- package/dist/components/ScreenImage/components/ScreenImageTransformFrame.d.ts +9 -0
- package/dist/components/ScreenImage/fit.d.ts +52 -0
- package/dist/components/ScreenImage/index.d.ts +10 -0
- package/dist/components/ScreenImage/materials/ScreenImageBlendMaterial.d.ts +9 -0
- package/dist/components/ScreenImage/materials/ScreenImageMaskMaterial.d.ts +11 -0
- package/dist/components/ScreenImage/materials/ScreenImageMatcap.d.ts +3 -0
- package/dist/components/ScreenImage/source.d.ts +25 -0
- package/dist/components/ScreenImage/types.d.ts +64 -0
- package/dist/components/ScreenImage/utils/ScreenImageConstants.d.ts +9 -0
- package/dist/components/ScreenImage/utils/ScreenImageHelpers.d.ts +4 -0
- package/dist/components/ScreenShape/geometry.d.ts +5 -0
- package/dist/components/ScreenShape/index.d.ts +5 -0
- package/dist/components/ScreenShape/types.d.ts +54 -0
- package/dist/components/ScreenSpaceUI/ScreenTransformGuide.d.ts +15 -0
- package/dist/components/ScreenSpaceUI/ScreenTransformOverlayGuide.d.ts +9 -0
- package/dist/components/ScreenSpaceUI/index.d.ts +3 -0
- package/dist/components/ScreenText/components/ScreenTextBody.d.ts +2 -0
- package/dist/components/ScreenText/components/ScreenTextTransformFrame.d.ts +9 -0
- package/dist/components/ScreenText/constants.d.ts +5 -0
- package/dist/components/ScreenText/index.d.ts +6 -0
- package/dist/components/ScreenText/types.d.ts +31 -0
- package/dist/components/ScreenText/utils/ScreenTextHelpers.d.ts +14 -0
- package/dist/components/ScreenText/utils/ScreenTextMappings.d.ts +17 -0
- package/dist/components/SegmentationOverlay/SegmentationOverlay.d.ts +37 -0
- package/dist/components/SegmentationOverlay/SegmentationOverlayMaterial.d.ts +31 -0
- package/dist/components/SegmentationOverlay/index.d.ts +9 -0
- package/dist/components/SegmentationOverlay/maskTexture.d.ts +23 -0
- package/dist/components/SegmentationOverlay/providers.d.ts +72 -0
- package/dist/components/SegmentationOverlay/settings.d.ts +65 -0
- package/dist/components/SequentialRenderPasses/index.d.ts +6 -0
- package/dist/components/ShoulderOccluder/index.d.ts +46 -0
- package/dist/components/ShoulderOccluder/useCanonicalTorsoFit.d.ts +27 -0
- package/dist/components/SpringSwing/SpringSwing.d.ts +22 -0
- package/dist/components/SpringSwing/index.d.ts +1 -0
- package/dist/components/TextLabel/TextLabel.d.ts +5 -0
- package/dist/components/TextLabel/alignment.d.ts +4 -0
- package/dist/components/TextLabel/bend.d.ts +9 -0
- package/dist/components/TextLabel/canvas/buildTextLabelTexture.d.ts +4 -0
- package/dist/components/TextLabel/canvas/canvasTypography.d.ts +13 -0
- package/dist/components/TextLabel/canvas/drawBackground.d.ts +21 -0
- package/dist/components/TextLabel/canvas/drawEffects.d.ts +34 -0
- package/dist/components/TextLabel/canvas/drawText.d.ts +19 -0
- package/dist/components/TextLabel/components/TextLabelMesh.d.ts +13 -0
- package/dist/components/TextLabel/constants.d.ts +2 -0
- package/dist/components/TextLabel/hooks/useTextLabelTexture.d.ts +7 -0
- package/dist/components/TextLabel/index.d.ts +2 -62
- package/dist/components/TextLabel/layout/measurement.d.ts +8 -0
- package/dist/components/TextLabel/layout/resolveTextLayout.d.ts +25 -0
- package/dist/components/TextLabel/layout/wrapText.d.ts +6 -0
- package/dist/components/TextLabel/types.d.ts +337 -0
- package/dist/components/TrackingAnchor/index.d.ts +18 -2
- package/dist/components/Transform3D/index.d.ts +30 -0
- package/dist/components/XRMediaSurface/index.d.ts +8 -7
- package/dist/components/XRProvider/index.d.ts +16 -2
- package/dist/components/XRScene/index.d.ts +14 -3
- package/dist/components/XRScene/renderOutputTarget.d.ts +12 -0
- package/dist/components/XRViewport/XRViewport.d.ts +11 -0
- package/dist/components/XRViewport/components/HiddenMedia.d.ts +7 -0
- package/dist/components/XRViewport/components/MediaAssetPicker.d.ts +8 -0
- package/dist/components/XRViewport/components/MediaControlStack.d.ts +13 -0
- package/dist/components/XRViewport/components/XRViewportLayers.d.ts +30 -0
- package/dist/components/XRViewport/constants.d.ts +24 -0
- package/dist/components/XRViewport/contexts.d.ts +6 -0
- package/dist/components/XRViewport/hooks/useViewportExternalFaces.d.ts +13 -0
- package/dist/components/XRViewport/hooks/useViewportMediaSource.d.ts +16 -0
- package/dist/components/XRViewport/hooks/useViewportMediaTexture.d.ts +10 -0
- package/dist/components/XRViewport/hooks/useViewportPipeline.d.ts +41 -0
- package/dist/components/XRViewport/hooks/useViewportRenderState.d.ts +47 -0
- package/dist/components/XRViewport/index.d.ts +3 -101
- package/dist/components/XRViewport/layout.d.ts +16 -0
- package/dist/components/XRViewport/slots.d.ts +16 -0
- package/dist/components/XRViewport/types.d.ts +89 -0
- package/dist/components/XRViewport/useViewportSize.d.ts +3 -0
- package/dist/components/index.d.ts +31 -0
- package/dist/components/occluder/skinnedOccluder.d.ts +39 -0
- package/dist/config/index.d.ts +1 -1
- package/dist/constants/index.d.ts +4 -1
- package/dist/context-DTxSQvp4.js +13 -0
- package/dist/context-hA0Rb2Xa.cjs +1 -0
- package/dist/contexts-DQc7zyqT.cjs +1 -0
- package/dist/contexts-Y_FhdnIv.js +667 -0
- package/dist/coordinates/feed.d.ts +52 -0
- package/dist/coordinates/index.d.ts +7 -0
- package/dist/coordinates/side.d.ts +40 -0
- package/dist/coordinates/spaces.d.ts +49 -0
- package/dist/coordinates/viewport.d.ts +22 -0
- package/dist/coordinates/world.d.ts +15 -0
- package/dist/debug-ui/component-editor/index.d.ts +19 -0
- package/dist/debug-ui/default-setting/index.d.ts +37 -0
- package/dist/debug-ui/default-setting.cjs +21 -0
- package/dist/debug-ui/default-setting.js +777 -0
- package/dist/debug-ui/face-mesh-renderer-settings/index.d.ts +8 -0
- package/dist/debug-ui/face-retouch/index.d.ts +11 -0
- package/dist/debug-ui/face-swap-settings/index.d.ts +22 -0
- package/dist/debug-ui/gesture-settings/index.d.ts +14 -0
- package/dist/debug-ui/hand-joints-2d/index.d.ts +6 -0
- package/dist/debug-ui/hand-tracking-2d/index.d.ts +6 -0
- package/dist/debug-ui/hand-tracking-2d-controller/index.d.ts +6 -0
- package/dist/debug-ui/hand-tracking-3d/index.d.ts +6 -0
- package/dist/debug-ui/hierarchy-panel/index.d.ts +30 -0
- package/dist/debug-ui/holistic-tracker-settings/index.d.ts +16 -0
- package/dist/debug-ui/index.d.ts +61 -0
- package/dist/debug-ui/iris-effect-settings/index.d.ts +12 -0
- package/dist/debug-ui/layer-panel/index.d.ts +18 -0
- package/dist/debug-ui/lip-effect-settings/index.d.ts +15 -0
- package/dist/debug-ui/media-source/MediaSourceSwitcher.d.ts +10 -0
- package/dist/debug-ui/media-source/index.d.ts +6 -0
- package/dist/debug-ui/media-source/media-preset.d.ts +21 -0
- package/dist/debug-ui/media-source/session.d.ts +40 -0
- package/dist/debug-ui/media-source.cjs +1 -0
- package/dist/debug-ui/media-source.js +11 -0
- package/dist/debug-ui/mesh-renderer-settings/index.d.ts +6 -0
- package/dist/debug-ui/object-inspector-panel/index.d.ts +26 -0
- package/dist/debug-ui/pin-to-mesh-settings/index.d.ts +10 -0
- package/dist/debug-ui/product-hotspots/index.d.ts +25 -0
- package/dist/debug-ui/scene-editor/context.d.ts +38 -0
- package/dist/debug-ui/scene-editor/hierarchy-panel.d.ts +11 -0
- package/dist/debug-ui/scene-editor/index.d.ts +11 -0
- package/dist/debug-ui/scene-editor/inspector-panel.d.ts +9 -0
- package/dist/debug-ui/scene-editor/store-utils.d.ts +2 -0
- package/dist/debug-ui/scene-editor/viewport-toolbar.d.ts +4 -0
- package/dist/debug-ui/scene-editor/viewport.d.ts +21 -0
- package/dist/debug-ui/screen-glass-settings/index.d.ts +6 -0
- package/dist/debug-ui/screen-gradient-settings/GradientStopsEditor.d.ts +5 -0
- package/dist/debug-ui/screen-gradient-settings/index.d.ts +6 -0
- package/dist/debug-ui/screen-gradient-settings/styles.d.ts +3 -0
- package/dist/debug-ui/screen-image-settings/index.d.ts +11 -0
- package/dist/debug-ui/screen-shape-settings/index.d.ts +6 -0
- package/dist/debug-ui/screen-text-settings/NumberField.d.ts +9 -0
- package/dist/debug-ui/screen-text-settings/ScreenTextSettingsPanel.d.ts +3 -0
- package/dist/debug-ui/screen-text-settings/controls/NestedSection.d.ts +7 -0
- package/dist/debug-ui/screen-text-settings/controls/Section.d.ts +8 -0
- package/dist/debug-ui/screen-text-settings/controls/icons.d.ts +4 -0
- package/dist/debug-ui/screen-text-settings/index.d.ts +2 -0
- package/dist/debug-ui/screen-text-settings/sections/BackgroundSection.d.ts +8 -0
- package/dist/debug-ui/screen-text-settings/sections/ContentSection.d.ts +5 -0
- package/dist/debug-ui/screen-text-settings/sections/EffectsSection.d.ts +25 -0
- package/dist/debug-ui/screen-text-settings/sections/StyleSection.d.ts +5 -0
- package/dist/debug-ui/screen-text-settings/sections/TransformSection.d.ts +5 -0
- package/dist/debug-ui/screen-text-settings/sections/background/BackgroundFillControls.d.ts +2 -0
- package/dist/debug-ui/screen-text-settings/sections/background/BackgroundSizeControls.d.ts +2 -0
- package/dist/debug-ui/screen-text-settings/sections/background/BackgroundStrokeControls.d.ts +2 -0
- package/dist/debug-ui/screen-text-settings/sections/background/types.d.ts +7 -0
- package/dist/debug-ui/screen-text-settings/sections/effects/BendEffectSection.d.ts +4 -0
- package/dist/debug-ui/screen-text-settings/sections/effects/EffectChrome.d.ts +21 -0
- package/dist/debug-ui/screen-text-settings/sections/effects/GlowEffectSection.d.ts +4 -0
- package/dist/debug-ui/screen-text-settings/sections/effects/InnerShadowEffectSection.d.ts +4 -0
- package/dist/debug-ui/screen-text-settings/sections/effects/OutlineEffectSection.d.ts +4 -0
- package/dist/debug-ui/screen-text-settings/sections/effects/ShadowEffectSection.d.ts +4 -0
- package/dist/debug-ui/screen-text-settings/sections/effects/types.d.ts +14 -0
- package/dist/debug-ui/screen-text-settings/settings.d.ts +90 -0
- package/dist/debug-ui/screen-text-settings/styles.d.ts +26 -0
- package/dist/debug-ui/screen-text-settings/transform.d.ts +6 -0
- package/dist/debug-ui/screen-text-settings/types.d.ts +11 -0
- package/dist/debug-ui/segmentation-overlay-settings/index.d.ts +12 -0
- package/dist/debug-ui/settings-panel/index.d.ts +43 -0
- package/dist/debug-ui/shared/MaterialSection.d.ts +13 -0
- package/dist/debug-ui/shared/ScreenTransformSection.d.ts +32 -0
- package/dist/debug-ui/shared/debugWindow.d.ts +51 -0
- package/dist/debug-ui/transform-3d-settings/index.d.ts +11 -0
- package/dist/debug-ui/xr-diagnostics/index.d.ts +26 -0
- package/dist/debug-ui.cjs +10 -0
- package/dist/debug-ui.js +9051 -0
- package/dist/detector-K8aej4MB.js +59 -0
- package/dist/detector-ijypGtse.cjs +1 -0
- package/dist/drawNormalizedCrop-C4KFaRne.cjs +1 -0
- package/dist/drawNormalizedCrop-DG3gtJxf.js +135 -0
- package/dist/entries/all.d.ts +4 -1
- package/dist/entries/core.d.ts +76 -6
- package/dist/entries/face-effects.d.ts +130 -10
- package/dist/entries/instructions.d.ts +48 -0
- package/dist/entries/internal.d.ts +5 -2
- package/dist/entries/low-level.d.ts +104 -6
- package/dist/entries/particles.d.ts +15 -0
- package/dist/entries/product.d.ts +11 -0
- package/dist/entries/scene-object.d.ts +10 -0
- package/dist/entries/tracking.d.ts +110 -2
- package/dist/face-action/index.d.ts +34 -0
- package/dist/face-atlas/attributes.d.ts +30 -0
- package/dist/face-atlas/eyes.d.ts +272 -0
- package/dist/face-atlas/faceAtlas.generated.d.ts +46 -0
- package/dist/face-atlas/glsl/atlasVertex.d.ts +46 -0
- package/dist/face-atlas/glsl/common.d.ts +55 -0
- package/dist/face-atlas/glsl/design.d.ts +49 -0
- package/dist/face-atlas/glsl/eyes.d.ts +73 -0
- package/dist/face-atlas/glsl/finish.d.ts +24 -0
- package/dist/face-atlas/glsl/format.d.ts +4 -0
- package/dist/face-atlas/glsl/index.d.ts +59 -0
- package/dist/face-atlas/glsl/shading.d.ts +15 -0
- package/dist/face-atlas/glsl/shapes.d.ts +66 -0
- package/dist/face-atlas/glsl/sparkle.d.ts +19 -0
- package/dist/face-atlas/glsl/uniforms.d.ts +106 -0
- package/dist/face-atlas/guide.d.ts +51 -0
- package/dist/face-atlas/index.d.ts +25 -0
- package/dist/face-atlas/lead.d.ts +117 -0
- package/dist/face-atlas/madeUpCamera.d.ts +125 -0
- package/dist/face-atlas/masks.d.ts +53 -0
- package/dist/face-atlas/obj.d.ts +69 -0
- package/dist/face-atlas/polylines.d.ts +63 -0
- package/dist/face-atlas/probe/FaceSkinProbe.d.ts +208 -0
- package/dist/face-atlas/probe/__fixtures__/emulate.d.ts +9 -0
- package/dist/face-atlas/probe/__fixtures__/face.d.ts +24 -0
- package/dist/face-atlas/probe/constants.d.ts +137 -0
- package/dist/face-atlas/probe/glsl.d.ts +43 -0
- package/dist/face-atlas/probe/lightFit.d.ts +108 -0
- package/dist/face-atlas/probe/schedule.d.ts +44 -0
- package/dist/face-atlas/probe/selfTest.d.ts +87 -0
- package/dist/face-atlas/probe/stats.d.ts +143 -0
- package/dist/face-atlas/probe/targets.d.ts +70 -0
- package/dist/face-atlas/probe/unwrap.d.ts +76 -0
- package/dist/face-atlas/quality.d.ts +28 -0
- package/dist/face-atlas/regions.d.ts +31 -0
- package/dist/face-atlas/registry.d.ts +252 -0
- package/dist/face-atlas/renderState.d.ts +86 -0
- package/dist/face-atlas/selfOcclusion.d.ts +62 -0
- package/dist/face-atlas/shading.d.ts +406 -0
- package/dist/face-atlas/shapes.d.ts +86 -0
- package/dist/face-atlas/sides.d.ts +41 -0
- package/dist/face-atlas/skinMask.d.ts +35 -0
- package/dist/face-atlas/surface.d.ts +155 -0
- package/dist/face-atlas/topology.d.ts +44 -0
- package/dist/face-attribute-expression/index.d.ts +10 -0
- package/dist/face-character/__fixtures__/faceImageDetections.d.ts +25 -0
- package/dist/face-character/__fixtures__/faceNode.d.ts +22 -0
- package/dist/face-character/bindFaceModel.d.ts +106 -0
- package/dist/face-character/canonicalFace.d.ts +17 -0
- package/dist/face-character/canonicalFaceGeometry.d.ts +11 -0
- package/dist/face-character/canonicalFacePositions.d.ts +7 -0
- package/dist/face-character/driveFaceModel.d.ts +57 -0
- package/dist/face-character/expressionOutputs.d.ts +45 -0
- package/dist/face-character/faceExpressions.d.ts +104 -0
- package/dist/face-character/faceImageLandmarker.d.ts +93 -0
- package/dist/face-character/faceMeshBinding.d.ts +62 -0
- package/dist/face-character/faceMorph.d.ts +77 -0
- package/dist/face-character/faceMorphs.d.ts +46 -0
- package/dist/face-character/facePhoto.d.ts +138 -0
- package/dist/face-character/facePiercings.d.ts +116 -0
- package/dist/face-character/facePin.d.ts +131 -0
- package/dist/face-character/faceReprojection.d.ts +273 -0
- package/dist/face-character/faceReprojector.d.ts +171 -0
- package/dist/face-character/faceRig.d.ts +176 -0
- package/dist/face-character/faceSwapPresence.d.ts +85 -0
- package/dist/face-character/faceTexture.d.ts +169 -0
- package/dist/face-character/faceTextureBaker.d.ts +86 -0
- package/dist/face-character/faceTextureGuide.d.ts +106 -0
- package/dist/face-character/faceTextureStats.d.ts +298 -0
- package/dist/face-character/faceTransfer.d.ts +396 -0
- package/dist/face-character/faceTransferGeometry.d.ts +109 -0
- package/dist/face-character/faceTransferSelfTest.d.ts +94 -0
- package/dist/face-character/faceWarp3D.d.ts +101 -0
- package/dist/face-character/faceless.d.ts +79 -0
- package/dist/face-character/featureWarp.d.ts +28 -0
- package/dist/face-character/liveFaceRegistry.d.ts +370 -0
- package/dist/face-character/liveValue.d.ts +12 -0
- package/dist/face-character/memo.d.ts +15 -0
- package/dist/face-effects.cjs +2267 -195
- package/dist/face-effects.js +14191 -3346
- package/dist/face-expression/index.d.ts +182 -0
- package/dist/face-info/blendshapes.d.ts +3 -0
- package/dist/face-info/derive.d.ts +8 -0
- package/dist/face-info/drawFaceCrop.d.ts +10 -0
- package/dist/face-info/getFaceInfo.d.ts +8 -0
- package/dist/face-info/index.d.ts +8 -0
- package/dist/face-info/landmarks.d.ts +35 -0
- package/dist/face-info/types.d.ts +69 -0
- package/dist/gestures/definitions.d.ts +98 -0
- package/dist/gestures/detector.d.ts +87 -0
- package/dist/gestures/index.d.ts +8 -0
- package/dist/gestures/measures.d.ts +114 -0
- package/dist/gestures/settings.d.ts +49 -0
- package/dist/getFaceInfo-BafgGT27.js +62 -0
- package/dist/getFaceInfo-BzlwHMjX.cjs +1 -0
- package/dist/hand/armFit.d.ts +46 -0
- package/dist/hand/armMask.d.ts +190 -0
- package/dist/hand/forearm.d.ts +114 -0
- package/dist/hand/handCutout.d.ts +23 -0
- package/dist/hand/handCutoutRegistry.d.ts +7 -0
- package/dist/hand/handEffect.d.ts +38 -0
- package/dist/hand/handGestures.d.ts +524 -0
- package/dist/hand/handJoints2d.d.ts +49 -0
- package/dist/hand/handNail.d.ts +73 -0
- package/dist/hand/handPose.d.ts +98 -0
- package/dist/hand/handRigSolver.d.ts +159 -0
- package/dist/hand/handTattoo.d.ts +81 -0
- package/dist/hand/handTouch.d.ts +240 -0
- package/dist/hand/handTracking2d.d.ts +33 -0
- package/dist/hand/handTracking2dController.d.ts +65 -0
- package/dist/hand/handTracking3d.d.ts +52 -0
- package/dist/hand/nailImageMask.d.ts +40 -0
- package/dist/hand/nailMaskFingers.d.ts +23 -0
- package/dist/hand/nailTipRefine.d.ts +37 -0
- package/dist/hand/wrist.d.ts +44 -0
- package/dist/hand/wristFilter.d.ts +44 -0
- package/dist/hooks/faceResults.d.ts +1 -1
- package/dist/hooks/selectors.d.ts +77 -4
- package/dist/hooks/useBodies.d.ts +39 -0
- package/dist/hooks/useCalibrationFaceTracker.d.ts +1 -1
- package/dist/hooks/useFaceAction.d.ts +3 -0
- package/dist/hooks/useFaceAttributeExpression.d.ts +16 -0
- package/dist/hooks/useFaceDetection.d.ts +18 -0
- package/dist/hooks/useFaceInfo.d.ts +19 -0
- package/dist/hooks/useFaceInfos.d.ts +15 -0
- package/dist/hooks/useFaceModelAcquisition.d.ts +38 -0
- package/dist/hooks/useFaceResultReader.d.ts +10 -0
- package/dist/hooks/useFrameCapture.d.ts +18 -0
- package/dist/hooks/useGesture.d.ts +39 -0
- package/dist/hooks/useIrisTracking.d.ts +45 -0
- package/dist/hooks/useMediaRecorder.d.ts +14 -2
- package/dist/hooks/useOwnedTexture.d.ts +6 -0
- package/dist/hooks/useTrackerContext.d.ts +14 -2
- package/dist/hooks/useXRDiagnostics.d.ts +81 -0
- package/dist/hooks/useXRModel.d.ts +12 -0
- package/dist/hooks/useXRSession/facade.d.ts +47 -2
- package/dist/hooks/useXRSession/index.d.ts +2 -2
- package/dist/hooks/useXRSession/reason.d.ts +21 -0
- package/dist/hooks/useXRSession/registry.d.ts +23 -0
- package/dist/hooks/useXRSession/store.d.ts +64 -7
- package/dist/index-BZoBxyLn.js +1103 -0
- package/dist/index-By_LCo2V.cjs +1 -0
- package/dist/index-C-Mryx_u.cjs +21 -0
- package/dist/index-CKRN-xJp.js +3740 -0
- package/dist/index-CUldCMRl.js +188 -0
- package/dist/index-Cyk_VIZE.js +1432 -0
- package/dist/index-D-4w34GO.cjs +1 -0
- package/dist/index-DiIoHK_4.js +442 -0
- package/dist/index-Dv3WnY9n.cjs +46 -0
- package/dist/index-ItufYyHH.cjs +1 -0
- package/dist/index-S3gqudT6.cjs +1 -0
- package/dist/index-Sho4F4it.cjs +1 -0
- package/dist/index-iIQ9jBDb.js +240 -0
- package/dist/index-vr2ichWQ.js +190 -0
- package/dist/instructions.cjs +30 -0
- package/dist/instructions.js +1528 -0
- package/dist/internal-Bb9ZXbpr.cjs +1 -0
- package/dist/{internal-KOKJDxCG.js → internal-Gt1wn6Z3.js} +152 -127
- package/dist/internal.cjs +1 -1
- package/dist/internal.js +16 -9
- package/dist/iris/compute.d.ts +27 -0
- package/dist/iris/index.d.ts +4 -0
- package/dist/iris/lead.d.ts +19 -0
- package/dist/iris/types.d.ts +89 -0
- package/dist/landmarkMask-CvN-L5NT.cjs +1 -0
- package/dist/landmarkMask-DHivVjJm.js +225 -0
- package/dist/landmarks-BEjJXcnE.cjs +1 -0
- package/dist/landmarks-DtCAFV_m.js +76 -0
- package/dist/low-level.cjs +1 -1
- package/dist/low-level.js +1494 -629
- package/dist/main.cjs +1 -1
- package/dist/main.js +1306 -475
- package/dist/material/MaterialFill.d.ts +20 -0
- package/dist/material/MeshMaterial.d.ts +14 -0
- package/dist/material/index.d.ts +2 -0
- package/dist/models/Base/index.d.ts +49 -0
- package/dist/models/Body/index.d.ts +30 -1
- package/dist/models/Face/constants.d.ts +8 -0
- package/dist/models/Face/index.d.ts +5 -12
- package/dist/models/Face/rotation.d.ts +18 -0
- package/dist/models/Hand/GestureTracking.d.ts +1 -1
- package/dist/models/Hand/HandTracking.d.ts +19 -1
- package/dist/models/Holistic/index.d.ts +49 -0
- package/dist/models/Holistic/result.d.ts +68 -0
- package/dist/models/Segmentation/index.d.ts +6 -3
- package/dist/models/SemanticSegmentation/index.d.ts +31 -0
- package/dist/models/SemanticSegmentation/presets.d.ts +28 -0
- package/dist/models/index.d.ts +2 -0
- package/dist/models/nodeSource.d.ts +9 -0
- package/dist/particles/emission.d.ts +24 -0
- package/dist/particles/eyes.d.ts +24 -0
- package/dist/particles/glsl.d.ts +14 -0
- package/dist/particles/index.d.ts +10 -0
- package/dist/particles/motion.d.ts +42 -0
- package/dist/particles/presets.d.ts +12 -0
- package/dist/particles/ring.d.ts +58 -0
- package/dist/particles/selfTest.d.ts +53 -0
- package/dist/particles/settings.d.ts +127 -0
- package/dist/particles/shapes.d.ts +29 -0
- package/dist/particles/spawner.d.ts +71 -0
- package/dist/particles/system.d.ts +66 -0
- package/dist/particles.cjs +122 -0
- package/dist/particles.js +999 -0
- package/dist/product/ProductDimensions.d.ts +16 -0
- package/dist/product/ProductHotspot.d.ts +16 -0
- package/dist/product/ProductViewer.d.ts +9 -0
- package/dist/product/details.d.ts +53 -0
- package/dist/product/index.d.ts +14 -0
- package/dist/product/loadModelViewer.d.ts +4 -0
- package/dist/product/types.d.ts +71 -0
- package/dist/product/useProductAr.d.ts +37 -0
- package/dist/product/useProductDetails.d.ts +60 -0
- package/dist/product.cjs +1 -0
- package/dist/product.js +414 -0
- package/dist/providers-CEZQgz2s.cjs +62 -0
- package/dist/providers-CRuaD8bi.js +424 -0
- package/dist/quality/XRQualityController.d.ts +25 -0
- package/dist/quality/controller.d.ts +33 -0
- package/dist/quality/index.d.ts +6 -0
- package/dist/quality/types.d.ts +100 -0
- package/dist/quality/useXRQuality.d.ts +28 -0
- package/dist/render/layerStack.d.ts +29 -0
- package/dist/render/renderGroups.d.ts +47 -0
- package/dist/render/renderPasses.d.ts +26 -0
- package/dist/render/sceneBeforeRender.d.ts +12 -0
- package/dist/renderGroups-BADrepA1.cjs +1 -0
- package/dist/renderGroups-CNB99dZ2.js +152 -0
- package/dist/renderPasses-DgxUKn9b.cjs +158 -0
- package/dist/renderPasses-DuapJA6V.js +1290 -0
- package/dist/renderState-CJNmj5jz.js +39 -0
- package/dist/renderState-apSfg4eR.cjs +1 -0
- package/dist/scene-object/index.d.ts +146 -0
- package/dist/scene-object/runtimeRegistry.d.ts +14 -0
- package/dist/scene-object.cjs +1 -0
- package/dist/scene-object.js +40 -0
- package/dist/screen-image/screenImagePresets.d.ts +13 -0
- package/dist/screen-image/screenImageSettings.d.ts +57 -0
- package/dist/screen-text/screenTextPresets.d.ts +6 -0
- package/dist/screen-text/screenTextSettings.d.ts +147 -0
- package/dist/screen2d/coordinates.d.ts +107 -0
- package/dist/screen2d/index.d.ts +7 -0
- package/dist/screen2d/material-runtime.d.ts +32 -0
- package/dist/screen2d/screenTransform.d.ts +60 -0
- package/dist/screen2d/smoothing.d.ts +5 -0
- package/dist/screen2d/texture.d.ts +10 -0
- package/dist/screen2d/transform.d.ts +25 -0
- package/dist/screen2d/types.d.ts +90 -0
- package/dist/segmentation-BOZJdWFC.js +1911 -0
- package/dist/segmentation-J8GoNBvP.cjs +1 -0
- package/dist/segmentation2d/faceMemory.d.ts +28 -0
- package/dist/segmentation2d/faceRegions.d.ts +24 -0
- package/dist/segmentation2d/index.d.ts +9 -0
- package/dist/segmentation2d/maskUv.d.ts +23 -0
- package/dist/segmentation2d/rasterize.d.ts +14 -0
- package/dist/segmentation2d/types.d.ts +52 -0
- package/dist/selectors-BvJepq6H.js +196 -0
- package/dist/selectors-QB2qsaxy.cjs +1 -0
- package/dist/services/MetricsCollector/index.d.ts +7 -1
- package/dist/services/MetricsCollector/utils.d.ts +1 -1
- package/dist/session-BVX859as.cjs +31 -0
- package/dist/session-Cz8aie4K.js +493 -0
- package/dist/settings-BJ7FMBsO.js +111 -0
- package/dist/settings-C63FMBlF.cjs +1 -0
- package/dist/similarityFit-BFqHND2e.cjs +1 -0
- package/dist/similarityFit-Bbz-R8AY.js +91 -0
- package/dist/spring/index.d.ts +2 -0
- package/dist/spring/spring.d.ts +69 -0
- package/dist/spring/swing.d.ts +54 -0
- package/dist/subjects/index.d.ts +2 -0
- package/dist/subjects/select.d.ts +70 -0
- package/dist/subjects/types.d.ts +59 -0
- package/dist/texture/animatedTexture.d.ts +63 -0
- package/dist/texture/animationMath.d.ts +8 -0
- package/dist/texture/gifReader.d.ts +17 -0
- package/dist/texture/gifTextureSource.d.ts +16 -0
- package/dist/texture/sourceResolver.d.ts +30 -0
- package/dist/textures-BVwo9Z7z.js +38 -0
- package/dist/textures-DAfc61zz.cjs +1 -0
- package/dist/tracking/coordinates.d.ts +5 -0
- package/dist/tracking-config/apply.d.ts +57 -0
- package/dist/tracking-config/index.d.ts +7 -0
- package/dist/tracking-config/resolve.d.ts +25 -0
- package/dist/tracking-config/storage.d.ts +8 -0
- package/dist/tracking-config/types.d.ts +106 -0
- package/dist/tracking-config/useXRTrackingConfig.d.ts +38 -0
- package/dist/tracking.cjs +10 -1
- package/dist/tracking.js +1531 -294
- package/dist/trigger-D9L4GPmQ.js +3726 -0
- package/dist/trigger-DZ9vU7jo.cjs +147 -0
- package/dist/types/common.d.ts +11 -1
- package/dist/types/compositor.d.ts +21 -0
- package/dist/types/face.d.ts +21 -14
- package/dist/types/gesture-tracking.d.ts +2 -2
- package/dist/types/hand-tracking.d.ts +19 -2
- package/dist/types/holistic.d.ts +121 -0
- package/dist/types/index.d.ts +1 -1
- package/dist/types/model.d.ts +22 -2
- package/dist/types/nodes.d.ts +83 -6
- package/dist/types/segmentation.d.ts +26 -0
- package/dist/types/session.d.ts +50 -4
- package/dist/types/tracking.d.ts +8 -2
- package/dist/types/util-types.d.ts +1 -1
- package/dist/useBodies-BYzJpQ4L.js +75 -0
- package/dist/useBodies-Cxpmx6Bb.cjs +1 -0
- package/dist/useFaceInfo-BzEUj2OI.js +75 -0
- package/dist/useFaceInfo-DlLRAVNw.cjs +1 -0
- package/dist/useFaceResultReader-Cc4Qrutf.js +61 -0
- package/dist/useFaceResultReader-D3jOQNKz.cjs +1 -0
- package/dist/useInstructionHold-DOu-RpCM.js +53 -0
- package/dist/useInstructionHold-DwJY1Alr.cjs +1 -0
- package/dist/useIrisTracking-Bz4uLDa7.js +6190 -0
- package/dist/useIrisTracking-DRGWgoNy.cjs +35 -0
- package/dist/useLandmarkPoseFit-Bg-h9BPb.cjs +1 -0
- package/dist/useLandmarkPoseFit-Bmb3h6Mw.js +87 -0
- package/dist/useXRCapabilities-B1KLckqw.js +30 -0
- package/dist/useXRCapabilities-CZlPUBjF.cjs +1 -0
- package/dist/utils/canonicalRigidLandmarks.d.ts +8 -0
- package/dist/utils/drawNormalizedCrop.d.ts +22 -0
- package/dist/utils/fns.d.ts +6 -3
- package/dist/utils/headOccluderFit.d.ts +42 -0
- package/dist/utils/integrity.d.ts +25 -26
- package/dist/utils/landmarkBounds.d.ts +1 -1
- package/dist/utils/logger.d.ts +2 -2
- package/dist/utils/resolveNumFaces.d.ts +13 -0
- package/dist/utils/shoulderOccluderFit.d.ts +38 -0
- package/dist/utils/similarityFit.d.ts +23 -0
- package/dist/utils/updateThrottle.d.ts +2 -0
- package/dist/utils/useStableUniforms.d.ts +18 -0
- package/dist/utils/visionWasm.d.ts +18 -0
- package/dist/uv-BMFt19bg.cjs +1 -0
- package/dist/{index-BD-JWMjE.js → uv-DJU_XfmN.js} +15 -180
- package/dist/x-Co8jPhP0.js +127 -0
- package/dist/x-KC8E4Gaj.cjs +41 -0
- package/docs/MIGRATION_GUIDE.md +589 -0
- package/docs/SDK_DOCUMENTATION.md +1157 -0
- package/docs/api/adaptive-quality.mdx +104 -0
- package/docs/api/asset-lifecycle.mdx +78 -0
- package/docs/api/audio.mdx +36 -0
- package/docs/api/behavior-components.mdx +164 -0
- package/docs/api/body-instructions.mdx +287 -0
- package/docs/api/body-rig.mdx +384 -0
- package/docs/api/body-triggers.mdx +235 -0
- package/docs/api/camera-permission.mdx +142 -0
- package/docs/api/capture-recording.mdx +111 -0
- package/docs/api/coordinate-spaces.mdx +168 -0
- package/docs/api/cross-camera.mdx +89 -0
- package/docs/api/debug-ui-scene-editor.mdx +270 -0
- package/docs/api/diagnostics-calibration.mdx +97 -0
- package/docs/api/external-face-mesh.mdx +231 -0
- package/docs/api/face-actions.mdx +108 -0
- package/docs/api/face-attribute-expression.mdx +87 -0
- package/docs/api/face-binding-anchors.mdx +55 -0
- package/docs/api/face-character.mdx +157 -0
- package/docs/api/face-effects.mdx +28 -0
- package/docs/api/face-expression-controller.mdx +153 -0
- package/docs/api/face-info.mdx +118 -0
- package/docs/api/face-inset.mdx +204 -0
- package/docs/api/face-instructions.mdx +183 -0
- package/docs/api/face-liquify.mdx +196 -0
- package/docs/api/face-mesh.mdx +130 -0
- package/docs/api/face-morph.mdx +117 -0
- package/docs/api/face-painting.mdx +40 -0
- package/docs/api/face-reprojection.mdx +154 -0
- package/docs/api/face-retouching.mdx +81 -0
- package/docs/api/face-swap.mdx +350 -0
- package/docs/api/face-warp-3d.mdx +166 -0
- package/docs/api/faceless.mdx +143 -0
- package/docs/api/gestures.mdx +210 -0
- package/docs/api/hair.mdx +97 -0
- package/docs/api/hand-instructions.mdx +222 -0
- package/docs/api/hand-rig.mdx +661 -0
- package/docs/api/hand-touch.mdx +162 -0
- package/docs/api/head-occluder.mdx +563 -0
- package/docs/api/holistic-tracker.mdx +164 -0
- package/docs/api/instructions.mdx +323 -0
- package/docs/api/iris-tracking.mdx +247 -0
- package/docs/api/made-up-camera.mdx +131 -0
- package/docs/api/makeup-skin-tone.mdx +135 -0
- package/docs/api/makeup.mdx +353 -0
- package/docs/api/material-render-state.mdx +132 -0
- package/docs/api/multi-subject.mdx +185 -0
- package/docs/api/particles.mdx +183 -0
- package/docs/api/person-cutout.mdx +171 -0
- package/docs/api/pin-to-face-mesh.mdx +274 -0
- package/docs/api/product-ar.mdx +114 -0
- package/docs/api/product-details.mdx +78 -0
- package/docs/api/runtime-3d.mdx +316 -0
- package/docs/api/scene-object-store.mdx +213 -0
- package/docs/api/screen-image.mdx +67 -0
- package/docs/api/screen-shape.mdx +64 -0
- package/docs/api/screen-space-coordinates.mdx +75 -0
- package/docs/api/screen-text.mdx +39 -0
- package/docs/api/segmentation-overlay.mdx +301 -0
- package/docs/api/session-lifecycle.mdx +136 -0
- package/docs/api/texture-sources.mdx +74 -0
- package/docs/api/trackers.mdx +65 -0
- package/docs/api/tracking-config.mdx +108 -0
- package/docs/docs.json +121 -0
- package/docs/examples/lip-shaders.mdx +273 -0
- package/docs/examples/scene-object-recipes.mdx +194 -0
- package/docs/guides/face-atlas-template.svg +1 -0
- package/docs/guides/face-atlas-textures.mdx +186 -0
- package/docs/guides/face-texture-template.svg +1 -0
- package/docs/guides/harness-debug-ui.mdx +139 -0
- package/docs/guides/lip-effect-textures.mdx +368 -0
- package/docs/guides/lip-uv-template.png +0 -0
- package/docs/guides/lip-uv-template.svg +1 -0
- package/docs/guides/makeup-design-textures.mdx +109 -0
- package/docs/inspector/hierarchy-panel.mdx +51 -0
- package/docs/inspector/object-inspector-panel.mdx +51 -0
- package/docs/introduction.mdx +120 -0
- package/docs/scene-objects/overview.mdx +127 -0
- package/docs/scene-objects/render-groups.mdx +77 -0
- package/docs/scene-objects/runtime-rendering.mdx +75 -0
- package/docs/texture-api-consumer.md +84 -0
- package/package.json +86 -8
- package/settings.json +1998 -0
- package/dist/DebuggerUI-CEfdddkZ.cjs +0 -1
- package/dist/DebuggerUI-Dgop6Q6o.js +0 -269
- package/dist/components/FaceRetouch/retouchRegions.d.ts +0 -23
- package/dist/components/FaceRetouch/useFaceRetouchRegions.d.ts +0 -12
- package/dist/index-B5J4gzn2.cjs +0 -1
- package/dist/index-BVBVg96G.cjs +0 -1
- package/dist/index-CYMj26Ej.js +0 -1331
- package/dist/index-DtwHElmG.js +0 -157
- package/dist/index-PtFmD6B8.cjs +0 -1
- package/dist/internal-DH5d1Xnq.cjs +0 -1
- package/dist/modules/XRClient/index.d.ts +0 -9
- package/dist/modules/index.d.ts +0 -1
- package/dist/selectors-BHO6TnoC.js +0 -59
- package/dist/selectors-Bub0o3qy.cjs +0 -1
- package/dist/services/ApiService.d.ts +0 -12
- package/dist/types/client.d.ts +0 -3
- package/dist/useFaceResults-cpsSmKKc.js +0 -81
- package/dist/useFaceResults-hVUJYSEY.cjs +0 -1
package/dist/main.js
CHANGED
|
@@ -1,528 +1,537 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import * as
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
)
|
|
38
|
-
|
|
39
|
-
function
|
|
40
|
-
color:
|
|
41
|
-
borderColor:
|
|
42
|
-
borderWidth:
|
|
43
|
-
borderRadius:
|
|
44
|
-
resolution:
|
|
45
|
-
aspect:
|
|
46
|
-
opacity:
|
|
47
|
-
name:
|
|
48
|
-
overlay:
|
|
49
|
-
position:
|
|
50
|
-
rotation:
|
|
51
|
-
scale:
|
|
52
|
-
visible:
|
|
1
|
+
var De = Object.defineProperty;
|
|
2
|
+
var Ne = (e, t, s) => t in e ? De(e, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[t] = s;
|
|
3
|
+
var U = (e, t, s) => Ne(e, typeof t != "symbol" ? t + "" : t, s);
|
|
4
|
+
import { j as v, u as Ie, Q as Le, R as Oe, T as Ge, U as qe, V as Be, W as We } from "./index-CKRN-xJp.js";
|
|
5
|
+
import { av as Bs, Z as Ws, aw as Ks, M as Xs, P as Hs, L as zs, w as $s, Y as js, ax as Vs, ar as Zs, as as Ys, _ as Qs, c as Js, z as er, y as tr, d as sr, k as rr, ab as ar, ac as nr, ad as ir, ae as or, n as cr, af as lr, i as ur, $ as dr, O as mr, ag as pr, a0 as fr, ah as hr, ai as gr, ap as Sr, p as yr, A as Mr, at as Tr, r as Er, K as Rr, au as br, a2 as Ar, aj as Fr, a3 as Cr, a4 as vr, a5 as kr, a1 as _r, a6 as xr, a7 as wr, a8 as Ur, ak as Pr, aq as Dr, a9 as Nr, al as Ir, t as Lr, am as Or, an as Gr, aa as qr, ao as Br } from "./index-CKRN-xJp.js";
|
|
6
|
+
import { S as Ke } from "./contexts-Y_FhdnIv.js";
|
|
7
|
+
import { X as Kr } from "./contexts-Y_FhdnIv.js";
|
|
8
|
+
import { S as Hr, T as zr } from "./TextLabel-c9BCucOI.js";
|
|
9
|
+
import { jsxs as L, jsx as g, Fragment as re } from "react/jsx-runtime";
|
|
10
|
+
import { useRef as F, useMemo as Z, useEffect as _, useState as x, Suspense as Xe, useCallback as R, forwardRef as He, useImperativeHandle as ze, useContext as $e, createContext as je, useId as Ve, useSyncExternalStore as Ze } from "react";
|
|
11
|
+
import * as Ye from "three";
|
|
12
|
+
import { MathUtils as Qe, Vector2 as Je, Vector3 as et, DoubleSide as te, RepeatWrapping as Se, LinearFilter as ye } from "three";
|
|
13
|
+
import { D as jr, H as Vr, G as Zr, E as Yr, J as Qr, K as Jr, P as ea, S as ta, C as sa, I as ra, L as aa, M as na, F as ia, B as oa } from "./index-Cyk_VIZE.js";
|
|
14
|
+
import { useThree as tt, useFrame as st } from "@react-three/fiber";
|
|
15
|
+
import { R as rt } from "./uv-DJU_XfmN.js";
|
|
16
|
+
import { c as Fe, b as at } from "./selectors-BvJepq6H.js";
|
|
17
|
+
import { u as nt, a as it, s as ot, F as ct } from "./drawNormalizedCrop-DG3gtJxf.js";
|
|
18
|
+
import { d as la, b as ua, r as da } from "./drawNormalizedCrop-DG3gtJxf.js";
|
|
19
|
+
import { S as lt, c as ut } from "./index-BZoBxyLn.js";
|
|
20
|
+
import { L as pa, d as fa, R as ha, a as ga, e as Sa, b as ya, f as Ma } from "./index-BZoBxyLn.js";
|
|
21
|
+
import { useTexture as dt } from "@react-three/drei";
|
|
22
|
+
import { a as mt } from "./context-DTxSQvp4.js";
|
|
23
|
+
import { k as Ea, D as Ra, j as ba, E as Aa, M as Fa, h as Ca, S as va, T as ka, l as _a, g as xa, n as wa, r as Ua } from "./renderPasses-DuapJA6V.js";
|
|
24
|
+
import { D as Da, a as Na, M as Ia, n as La } from "./index-CUldCMRl.js";
|
|
25
|
+
import { M as Ga } from "./index-vr2ichWQ.js";
|
|
26
|
+
import { u as Ba } from "./useXRCapabilities-B1KLckqw.js";
|
|
27
|
+
import { g as Ce } from "./cache-2x3CUJuY.js";
|
|
28
|
+
import { D as Ka, X as Xa, c as Ha, u as za } from "./cache-2x3CUJuY.js";
|
|
29
|
+
import { S as pt } from "./segmentation-BOZJdWFC.js";
|
|
30
|
+
import { d as ja, a as Va, b as Za, e as Ya, f as Qa, g as Ja, h as en } from "./segmentation-BOZJdWFC.js";
|
|
31
|
+
const V = (e, t, s, r) => Qe.damp(e, t, Math.max(0, s), Math.max(0, r)), ls = (e, t, s, r, a = new Je()) => a.set(
|
|
32
|
+
V(e.x, t.x, s, r),
|
|
33
|
+
V(e.y, t.y, s, r)
|
|
34
|
+
), us = (e, t, s, r, a = new et()) => a.set(
|
|
35
|
+
V(e.x, t.x, s, r),
|
|
36
|
+
V(e.y, t.y, s, r),
|
|
37
|
+
V(e.z, t.z, s, r)
|
|
38
|
+
), ft = "rgba(20,40,110,0.88)", ht = 24, gt = 512;
|
|
39
|
+
function ds({
|
|
40
|
+
color: e = ft,
|
|
41
|
+
borderColor: t,
|
|
42
|
+
borderWidth: s = 0,
|
|
43
|
+
borderRadius: r = ht,
|
|
44
|
+
resolution: a = gt,
|
|
45
|
+
aspect: n = 1,
|
|
46
|
+
opacity: i = 1,
|
|
47
|
+
name: c,
|
|
48
|
+
overlay: o = !0,
|
|
49
|
+
position: l,
|
|
50
|
+
rotation: h,
|
|
51
|
+
scale: d,
|
|
52
|
+
visible: m
|
|
53
53
|
}) {
|
|
54
|
-
const
|
|
55
|
-
width: Math.round(
|
|
56
|
-
height: Math.round(
|
|
57
|
-
color:
|
|
58
|
-
borderColor:
|
|
59
|
-
borderWidth:
|
|
60
|
-
borderRadius:
|
|
61
|
-
}), [
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
}, [
|
|
65
|
-
const
|
|
66
|
-
return
|
|
67
|
-
const
|
|
68
|
-
if (
|
|
69
|
-
return
|
|
70
|
-
|
|
54
|
+
const u = F(null), p = F(null), M = Z(() => St({
|
|
55
|
+
width: Math.round(a * Math.max(n, 0.05)),
|
|
56
|
+
height: Math.round(a),
|
|
57
|
+
color: e,
|
|
58
|
+
borderColor: t,
|
|
59
|
+
borderWidth: s,
|
|
60
|
+
borderRadius: r
|
|
61
|
+
}), [e, t, s, r, a, n]);
|
|
62
|
+
_(() => () => {
|
|
63
|
+
M.dispose();
|
|
64
|
+
}, [M]);
|
|
65
|
+
const E = F(null), f = F(i);
|
|
66
|
+
return f.current !== i && (f.current = i, E.current = null, p.current && (p.current.opacity = i)), _(() => {
|
|
67
|
+
const S = u.current;
|
|
68
|
+
if (S)
|
|
69
|
+
return S.userData.setOpacity = (b) => {
|
|
70
|
+
E.current = b, p.current && (p.current.opacity = b);
|
|
71
71
|
}, () => {
|
|
72
|
-
delete
|
|
73
|
-
};
|
|
74
|
-
}, []), /* @__PURE__ */ P(
|
|
75
|
-
"mesh",
|
|
76
|
-
{
|
|
77
|
-
ref: M,
|
|
78
|
-
name: a,
|
|
79
|
-
position: u,
|
|
80
|
-
rotation: g,
|
|
81
|
-
scale: m,
|
|
82
|
-
visible: l,
|
|
83
|
-
children: [
|
|
84
|
-
/* @__PURE__ */ p("planeGeometry", { args: [1, 1] }),
|
|
85
|
-
/* @__PURE__ */ p(
|
|
86
|
-
"meshBasicMaterial",
|
|
87
|
-
{
|
|
88
|
-
ref: v,
|
|
89
|
-
map: w,
|
|
90
|
-
transparent: !0,
|
|
91
|
-
opacity: o,
|
|
92
|
-
depthTest: !s,
|
|
93
|
-
depthWrite: !s
|
|
94
|
-
}
|
|
95
|
-
)
|
|
96
|
-
]
|
|
97
|
-
}
|
|
98
|
-
);
|
|
99
|
-
}
|
|
100
|
-
function me(r) {
|
|
101
|
-
const { width: e, height: t, color: n, borderColor: i, borderWidth: c, borderRadius: o } = r, a = typeof OffscreenCanvas < "u" ? new OffscreenCanvas(e, t) : (() => {
|
|
102
|
-
const m = document.createElement("canvas");
|
|
103
|
-
return m.width = e, m.height = t, m;
|
|
104
|
-
})(), s = a.getContext("2d");
|
|
105
|
-
s.clearRect(0, 0, e, t);
|
|
106
|
-
const u = Math.min(o, Math.min(e, t) / 2);
|
|
107
|
-
s.beginPath(), s.moveTo(u, 0), s.lineTo(e - u, 0), s.quadraticCurveTo(e, 0, e, u), s.lineTo(e, t - u), s.quadraticCurveTo(e, t, e - u, t), s.lineTo(u, t), s.quadraticCurveTo(0, t, 0, t - u), s.lineTo(0, u), s.quadraticCurveTo(0, 0, u, 0), s.closePath(), s.fillStyle = n, s.fill(), i && c > 0 && (s.lineWidth = c, s.strokeStyle = i, s.stroke());
|
|
108
|
-
const g = new K.CanvasTexture(a);
|
|
109
|
-
return g.needsUpdate = !0, g;
|
|
110
|
-
}
|
|
111
|
-
const ze = ({ children: r, depth: e = 0 }) => {
|
|
112
|
-
const { camera: t, size: n } = Y(), i = I(() => {
|
|
113
|
-
if (!(t instanceof J))
|
|
114
|
-
return { width: 10, height: 10 };
|
|
115
|
-
const c = Math.abs(t.position.z - e), o = t.fov * Math.PI / 180, a = 2 * Math.tan(o / 2) * c;
|
|
116
|
-
return { width: a * (n.width / n.height), height: a };
|
|
117
|
-
}, [t, n, e]);
|
|
118
|
-
return /* @__PURE__ */ p(se.Provider, { value: i, children: /* @__PURE__ */ p("group", { position: [0, 0, e], children: r }) });
|
|
119
|
-
};
|
|
120
|
-
function pe(r, e) {
|
|
121
|
-
return !Number.isFinite(r) || !Number.isFinite(e) || r <= 0 || e <= 0 ? [1, 1, 1] : Math.abs(r - e) < 1e-6 ? [1, 1, 1] : r > e ? [e / r, 1, 1] : [1, r / e, 1];
|
|
122
|
-
}
|
|
123
|
-
const ge = { left: -1, right: 1, top: 1, bottom: -1 }, Me = (r, e, t) => {
|
|
124
|
-
const n = r % e, i = Math.floor(r / e);
|
|
125
|
-
return { x: n / e, y: (t - 1 - i) / t };
|
|
126
|
-
}, ve = ({
|
|
127
|
-
sheet: r,
|
|
128
|
-
contentAspect: e,
|
|
129
|
-
renderOrder: t,
|
|
130
|
-
name: n
|
|
131
|
-
}) => {
|
|
132
|
-
const i = ue(r.url), c = y(0), o = y(-1), a = oe(), [s, u] = e != null ? pe(a, e) : [1, 1];
|
|
133
|
-
return ae((g, m) => {
|
|
134
|
-
i.wrapS = q, i.wrapT = q, i.magFilter = H, i.minFilter = H, i.generateMipmaps = !1, i.repeat.set(1 / r.cols, 1 / r.rows), c.current += m;
|
|
135
|
-
const l = Math.floor(c.current * r.fps) % r.frames;
|
|
136
|
-
if (l === o.current) return;
|
|
137
|
-
o.current = l;
|
|
138
|
-
const { x: M, y: v } = Me(l, r.cols, r.rows);
|
|
139
|
-
i.offset.set(M, v);
|
|
140
|
-
}), /* @__PURE__ */ P("mesh", { name: n, renderOrder: t, scale: [s, u, 1], children: [
|
|
141
|
-
/* @__PURE__ */ p("planeGeometry", { args: [1, 1] }),
|
|
142
|
-
/* @__PURE__ */ p("meshBasicMaterial", { map: i, transparent: !0, toneMapped: !1, depthWrite: !1 })
|
|
143
|
-
] });
|
|
144
|
-
}, Be = ({
|
|
145
|
-
sheet: r,
|
|
146
|
-
anchors: e = ge,
|
|
147
|
-
contentAspect: t,
|
|
148
|
-
renderOrder: n = 10,
|
|
149
|
-
name: i = "spriteAnimation"
|
|
150
|
-
}) => /* @__PURE__ */ p(te, { fallback: null, children: /* @__PURE__ */ p(ie, { anchors: e, children: /* @__PURE__ */ p(ve, { sheet: r, contentAspect: t, renderOrder: n, name: i }) }) }), Te = {
|
|
151
|
-
color: "#ffffff",
|
|
152
|
-
fontWeight: "bold",
|
|
153
|
-
fontFamily: "Arial, sans-serif",
|
|
154
|
-
fontSize: 48,
|
|
155
|
-
bgColor: "rgba(20,40,110,0.88)",
|
|
156
|
-
borderWidth: 0,
|
|
157
|
-
borderRadius: 24,
|
|
158
|
-
padding: 32,
|
|
159
|
-
aspect: 2.5,
|
|
160
|
-
resolution: 512,
|
|
161
|
-
opacity: 1
|
|
162
|
-
};
|
|
163
|
-
function Ie(r) {
|
|
164
|
-
const e = { ...Te, ...r }, {
|
|
165
|
-
text: t,
|
|
166
|
-
color: n,
|
|
167
|
-
fontWeight: i,
|
|
168
|
-
fontFamily: c,
|
|
169
|
-
fontSize: o,
|
|
170
|
-
bgColor: a,
|
|
171
|
-
borderColor: s,
|
|
172
|
-
borderWidth: u,
|
|
173
|
-
borderRadius: g,
|
|
174
|
-
padding: m,
|
|
175
|
-
aspect: l,
|
|
176
|
-
resolution: M,
|
|
177
|
-
opacity: v,
|
|
178
|
-
name: w,
|
|
179
|
-
overlay: b = !0,
|
|
180
|
-
position: S,
|
|
181
|
-
rotation: d,
|
|
182
|
-
scale: L,
|
|
183
|
-
visible: N
|
|
184
|
-
} = e, [_, z] = W(null), [B, A] = W(null), h = y(t);
|
|
185
|
-
h.current !== t && (h.current = t, _ !== null && z(null));
|
|
186
|
-
const T = y(a);
|
|
187
|
-
T.current !== a && (T.current = a, B !== null && A(null));
|
|
188
|
-
const f = y(null), E = _ ?? t, D = B ?? a, O = I(
|
|
189
|
-
() => ye({
|
|
190
|
-
text: E,
|
|
191
|
-
color: n,
|
|
192
|
-
fontWeight: i,
|
|
193
|
-
fontFamily: c,
|
|
194
|
-
fontSize: o,
|
|
195
|
-
bgColor: D,
|
|
196
|
-
borderColor: s,
|
|
197
|
-
borderWidth: u,
|
|
198
|
-
borderRadius: g,
|
|
199
|
-
padding: m,
|
|
200
|
-
height: M,
|
|
201
|
-
width: Math.round(M * Math.max(l, 0.1))
|
|
202
|
-
}),
|
|
203
|
-
[
|
|
204
|
-
E,
|
|
205
|
-
n,
|
|
206
|
-
i,
|
|
207
|
-
c,
|
|
208
|
-
o,
|
|
209
|
-
D,
|
|
210
|
-
s,
|
|
211
|
-
u,
|
|
212
|
-
g,
|
|
213
|
-
m,
|
|
214
|
-
l,
|
|
215
|
-
M
|
|
216
|
-
]
|
|
217
|
-
);
|
|
218
|
-
return k(() => {
|
|
219
|
-
const x = f.current;
|
|
220
|
-
if (x)
|
|
221
|
-
return x.userData.setText = (U) => z(U), x.userData.setBgColor = (U) => A(U), () => {
|
|
222
|
-
delete x.userData.setText, delete x.userData.setBgColor;
|
|
72
|
+
delete S.userData.setOpacity;
|
|
223
73
|
};
|
|
224
|
-
}, []),
|
|
225
|
-
O.dispose();
|
|
226
|
-
}, [O]), /* @__PURE__ */ P(
|
|
74
|
+
}, []), /* @__PURE__ */ L(
|
|
227
75
|
"mesh",
|
|
228
76
|
{
|
|
229
|
-
ref:
|
|
230
|
-
name:
|
|
231
|
-
position:
|
|
232
|
-
rotation:
|
|
233
|
-
scale:
|
|
234
|
-
visible:
|
|
77
|
+
ref: u,
|
|
78
|
+
name: c,
|
|
79
|
+
position: l,
|
|
80
|
+
rotation: h,
|
|
81
|
+
scale: d,
|
|
82
|
+
visible: m,
|
|
235
83
|
children: [
|
|
236
|
-
/* @__PURE__ */
|
|
237
|
-
/* @__PURE__ */
|
|
84
|
+
/* @__PURE__ */ g("planeGeometry", { args: [1, 1] }),
|
|
85
|
+
/* @__PURE__ */ g(
|
|
238
86
|
"meshBasicMaterial",
|
|
239
87
|
{
|
|
240
|
-
|
|
88
|
+
ref: p,
|
|
89
|
+
map: M,
|
|
241
90
|
transparent: !0,
|
|
242
|
-
opacity:
|
|
243
|
-
depthTest: !
|
|
244
|
-
depthWrite: !
|
|
91
|
+
opacity: i,
|
|
92
|
+
depthTest: !o,
|
|
93
|
+
depthWrite: !o
|
|
245
94
|
}
|
|
246
95
|
)
|
|
247
96
|
]
|
|
248
97
|
}
|
|
249
98
|
);
|
|
250
99
|
}
|
|
251
|
-
function
|
|
252
|
-
const { width:
|
|
253
|
-
let { fontSize: s, bgColor: u } = r, g;
|
|
254
|
-
const m = typeof OffscreenCanvas < "u" ? new OffscreenCanvas(e, t) : (() => {
|
|
100
|
+
function St(e) {
|
|
101
|
+
const { width: t, height: s, color: r, borderColor: a, borderWidth: n, borderRadius: i } = e, c = typeof OffscreenCanvas < "u" ? new OffscreenCanvas(t, s) : (() => {
|
|
255
102
|
const d = document.createElement("canvas");
|
|
256
|
-
return d.width =
|
|
257
|
-
})(),
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
const M = e - a * 2;
|
|
264
|
-
let v = Z(l, n, M, o, s, c);
|
|
265
|
-
const w = Math.max(1, Math.floor((t - a * 2) / (s * 1.3)));
|
|
266
|
-
v.length > w && (s = Math.max(12, Math.round(s * 0.75)), v = Z(l, n, M, o, s, c)), l.font = `${o} ${s}px ${c}`;
|
|
267
|
-
const b = s * 1.3, S = t / 2 - (v.length - 1) * b / 2;
|
|
268
|
-
for (let d = 0; d < v.length; d++)
|
|
269
|
-
l.fillText(v[d], e / 2, S + d * b);
|
|
270
|
-
return g = new K.CanvasTexture(m), g.needsUpdate = !0, g;
|
|
271
|
-
}
|
|
272
|
-
function Z(r, e, t, n, i, c) {
|
|
273
|
-
r.font = `${n} ${i}px ${c}`;
|
|
274
|
-
const o = e.split(" "), a = [];
|
|
275
|
-
let s = "";
|
|
276
|
-
for (const u of o) {
|
|
277
|
-
const g = s ? `${s} ${u}` : u;
|
|
278
|
-
r.measureText(g).width > t && s ? (a.push(s), s = u) : s = g;
|
|
279
|
-
}
|
|
280
|
-
return s && a.push(s), a;
|
|
103
|
+
return d.width = t, d.height = s, d;
|
|
104
|
+
})(), o = c.getContext("2d");
|
|
105
|
+
o.clearRect(0, 0, t, s);
|
|
106
|
+
const l = Math.min(i, Math.min(t, s) / 2);
|
|
107
|
+
o.beginPath(), o.moveTo(l, 0), o.lineTo(t - l, 0), o.quadraticCurveTo(t, 0, t, l), o.lineTo(t, s - l), o.quadraticCurveTo(t, s, t - l, s), o.lineTo(l, s), o.quadraticCurveTo(0, s, 0, s - l), o.lineTo(0, l), o.quadraticCurveTo(0, 0, l, 0), o.closePath(), o.fillStyle = r, o.fill(), a && n > 0 && (o.lineWidth = n, o.strokeStyle = a, o.stroke());
|
|
108
|
+
const h = new Ye.CanvasTexture(c);
|
|
109
|
+
return h.needsUpdate = !0, h;
|
|
281
110
|
}
|
|
282
|
-
const
|
|
283
|
-
segmentationMask:
|
|
284
|
-
segmentation:
|
|
285
|
-
invert:
|
|
286
|
-
customBackground:
|
|
287
|
-
renderOrder:
|
|
111
|
+
const ms = ({
|
|
112
|
+
segmentationMask: e,
|
|
113
|
+
segmentation: t,
|
|
114
|
+
invert: s = !1,
|
|
115
|
+
customBackground: r,
|
|
116
|
+
renderOrder: a = rt.BACKGROUND
|
|
288
117
|
}) => {
|
|
289
|
-
const { camera:
|
|
290
|
-
|
|
291
|
-
if (!
|
|
292
|
-
|
|
118
|
+
const { camera: n, size: i } = tt(), c = Fe(), o = at(v.BACKGROUND_SEGMENTATION), l = t ? o == null ? void 0 : o.backgroundSegmentationMask : void 0, h = F(!1);
|
|
119
|
+
_(() => {
|
|
120
|
+
if (!t) {
|
|
121
|
+
h.current = !1;
|
|
293
122
|
return;
|
|
294
123
|
}
|
|
295
|
-
|
|
296
|
-
`[VideoBackground] segmentation="${
|
|
297
|
-
),
|
|
298
|
-
}, [
|
|
299
|
-
const
|
|
300
|
-
if (!
|
|
124
|
+
o === null && !h.current && (console.warn(
|
|
125
|
+
`[VideoBackground] segmentation="${t}" set but no matching <Segmentation> component is mounted; rendering unmasked.`
|
|
126
|
+
), h.current = !0);
|
|
127
|
+
}, [t, o]);
|
|
128
|
+
const d = t ? l : e, m = Z(() => {
|
|
129
|
+
if (!n.isPerspectiveCamera)
|
|
301
130
|
return [10, 10];
|
|
302
|
-
const
|
|
303
|
-
return [S * (
|
|
304
|
-
}, [
|
|
305
|
-
return
|
|
306
|
-
/* @__PURE__ */
|
|
307
|
-
/* @__PURE__ */
|
|
308
|
-
/* @__PURE__ */
|
|
131
|
+
const u = n, E = (u.position.z || 5) - -1, f = u.fov * Math.PI / 180, S = 2 * Math.tan(f / 2) * E;
|
|
132
|
+
return [S * (i.width / i.height), S];
|
|
133
|
+
}, [n, i]);
|
|
134
|
+
return c ? /* @__PURE__ */ g("group", { position: [0, 0, -1], children: s ? /* @__PURE__ */ L(re, { children: [
|
|
135
|
+
/* @__PURE__ */ L("mesh", { position: [0, 0, -0.01], renderOrder: a - 1, children: [
|
|
136
|
+
/* @__PURE__ */ g("planeGeometry", { args: m }),
|
|
137
|
+
/* @__PURE__ */ g(
|
|
309
138
|
"meshBasicMaterial",
|
|
310
139
|
{
|
|
311
|
-
map:
|
|
140
|
+
map: c,
|
|
312
141
|
depthTest: !1,
|
|
313
142
|
depthWrite: !1,
|
|
314
|
-
toneMapped: !1
|
|
143
|
+
toneMapped: !1,
|
|
144
|
+
side: te
|
|
315
145
|
}
|
|
316
146
|
)
|
|
317
147
|
] }),
|
|
318
|
-
|
|
319
|
-
/* @__PURE__ */
|
|
320
|
-
/* @__PURE__ */
|
|
148
|
+
r && d && /* @__PURE__ */ L("mesh", { position: [0, 0, 0], renderOrder: a, children: [
|
|
149
|
+
/* @__PURE__ */ g("planeGeometry", { args: m }),
|
|
150
|
+
/* @__PURE__ */ g(
|
|
321
151
|
"meshBasicMaterial",
|
|
322
152
|
{
|
|
323
|
-
map: typeof
|
|
324
|
-
color: typeof
|
|
325
|
-
alphaMap:
|
|
153
|
+
map: typeof r == "string" ? void 0 : r,
|
|
154
|
+
color: typeof r == "string" ? r : void 0,
|
|
155
|
+
alphaMap: d,
|
|
326
156
|
transparent: !1,
|
|
327
157
|
alphaTest: 0.5,
|
|
328
158
|
depthTest: !1,
|
|
329
159
|
depthWrite: !1,
|
|
330
|
-
toneMapped: !1
|
|
160
|
+
toneMapped: !1,
|
|
161
|
+
side: te
|
|
331
162
|
},
|
|
332
163
|
"inverted-mask"
|
|
333
164
|
)
|
|
334
165
|
] })
|
|
335
|
-
] }) : /* @__PURE__ */
|
|
336
|
-
|
|
337
|
-
/* @__PURE__ */
|
|
338
|
-
/* @__PURE__ */
|
|
166
|
+
] }) : /* @__PURE__ */ L(re, { children: [
|
|
167
|
+
r && d && /* @__PURE__ */ L("mesh", { position: [0, 0, -0.01], renderOrder: a - 1, children: [
|
|
168
|
+
/* @__PURE__ */ g("planeGeometry", { args: m }),
|
|
169
|
+
/* @__PURE__ */ g(
|
|
339
170
|
"meshBasicMaterial",
|
|
340
171
|
{
|
|
341
|
-
map: typeof
|
|
342
|
-
color: typeof
|
|
172
|
+
map: typeof r == "string" ? void 0 : r,
|
|
173
|
+
color: typeof r == "string" ? r : void 0,
|
|
343
174
|
depthTest: !1,
|
|
344
175
|
depthWrite: !1,
|
|
345
|
-
toneMapped: !1
|
|
176
|
+
toneMapped: !1,
|
|
177
|
+
side: te
|
|
346
178
|
}
|
|
347
179
|
)
|
|
348
180
|
] }),
|
|
349
|
-
/* @__PURE__ */
|
|
350
|
-
/* @__PURE__ */
|
|
351
|
-
/* @__PURE__ */
|
|
181
|
+
/* @__PURE__ */ L("mesh", { position: [0, 0, 0], renderOrder: a, children: [
|
|
182
|
+
/* @__PURE__ */ g("planeGeometry", { args: m }),
|
|
183
|
+
/* @__PURE__ */ g(
|
|
352
184
|
"meshBasicMaterial",
|
|
353
185
|
{
|
|
354
|
-
map:
|
|
355
|
-
alphaMap:
|
|
186
|
+
map: c,
|
|
187
|
+
alphaMap: d,
|
|
356
188
|
transparent: !1,
|
|
357
|
-
alphaTest:
|
|
189
|
+
alphaTest: d ? 0.5 : void 0,
|
|
358
190
|
depthTest: !1,
|
|
359
191
|
depthWrite: !1,
|
|
360
|
-
toneMapped: !1
|
|
192
|
+
toneMapped: !1,
|
|
193
|
+
side: te
|
|
361
194
|
},
|
|
362
|
-
|
|
195
|
+
d ? "with-mask" : "no-mask"
|
|
363
196
|
)
|
|
364
197
|
] })
|
|
365
198
|
] }) }) : null;
|
|
366
|
-
},
|
|
199
|
+
}, ve = ({
|
|
200
|
+
mask: e,
|
|
201
|
+
status: t,
|
|
202
|
+
error: s,
|
|
203
|
+
invert: r = !1,
|
|
204
|
+
fallback: a = "camera",
|
|
205
|
+
onStatusChange: n,
|
|
206
|
+
fit: i = "cover",
|
|
207
|
+
anchors: c = ct,
|
|
208
|
+
renderOrder: o = 100,
|
|
209
|
+
visible: l = !0,
|
|
210
|
+
maskFeather: h = 4,
|
|
211
|
+
maskErode: d = 0.7,
|
|
212
|
+
...m
|
|
213
|
+
}) => {
|
|
214
|
+
const u = Fe();
|
|
215
|
+
if (_(() => {
|
|
216
|
+
n == null || n(t, s);
|
|
217
|
+
}, [t, s, n]), !u) return null;
|
|
218
|
+
const p = t === "ready" && e;
|
|
219
|
+
return !p && !ot(t, a) ? null : /* @__PURE__ */ g(
|
|
220
|
+
lt,
|
|
221
|
+
{
|
|
222
|
+
...m,
|
|
223
|
+
source: { kind: "texture", texture: u },
|
|
224
|
+
fit: i,
|
|
225
|
+
anchors: c,
|
|
226
|
+
renderOrder: o,
|
|
227
|
+
visible: l,
|
|
228
|
+
maskTexture: p ? e : null,
|
|
229
|
+
maskChannel: "green",
|
|
230
|
+
maskInvert: r,
|
|
231
|
+
maskFeather: h,
|
|
232
|
+
maskErode: d
|
|
233
|
+
}
|
|
234
|
+
);
|
|
235
|
+
}, yt = ({ active: e = !0, ...t }) => {
|
|
236
|
+
const { texture: s, status: r, error: a } = it(e);
|
|
237
|
+
return /* @__PURE__ */ g(ve, { ...t, mask: s, status: r, error: a });
|
|
238
|
+
}, Mt = ({ bodyId: e, subject: t, numBodies: s, active: r = !0, ...a }) => {
|
|
239
|
+
const { texture: n, status: i, error: c } = nt({ bodyId: e, subject: t, numBodies: s, active: r });
|
|
240
|
+
return /* @__PURE__ */ g(ve, { ...a, mask: n, status: i, error: c });
|
|
241
|
+
}, ps = ({ bodyId: e, subject: t, numBodies: s, ...r }) => e !== void 0 || t ? /* @__PURE__ */ g(Mt, { ...r, bodyId: e, subject: t, numBodies: s }) : /* @__PURE__ */ g(yt, { ...r }), ie = 9, oe = 16, fs = ({ children: e }) => {
|
|
242
|
+
const [t, s] = x({ width: 0, height: 0 });
|
|
243
|
+
return _(() => {
|
|
244
|
+
const r = () => {
|
|
245
|
+
const a = document.documentElement.clientWidth, n = document.documentElement.clientHeight, i = a / n, c = ie / oe;
|
|
246
|
+
let o, l;
|
|
247
|
+
i > c ? (l = n, o = l * ie / oe) : (o = a, l = o * oe / ie), s({ width: o, height: l });
|
|
248
|
+
};
|
|
249
|
+
return r(), window.addEventListener("resize", r), () => window.removeEventListener("resize", r);
|
|
250
|
+
}, []), /* @__PURE__ */ g(
|
|
251
|
+
"div",
|
|
252
|
+
{
|
|
253
|
+
style: {
|
|
254
|
+
width: "100vw",
|
|
255
|
+
height: `${window.innerHeight}px`,
|
|
256
|
+
display: "flex",
|
|
257
|
+
alignItems: "center",
|
|
258
|
+
justifyContent: "center",
|
|
259
|
+
backgroundColor: "#0d0d0d"
|
|
260
|
+
},
|
|
261
|
+
children: /* @__PURE__ */ g("div", { style: { width: t.width, height: t.height, position: "relative" }, children: e })
|
|
262
|
+
}
|
|
263
|
+
);
|
|
264
|
+
}, hs = ({ size: e = 0.25, ...t }) => /* @__PURE__ */ g("axesHelper", { args: [e], ...t }), Tt = { left: -1, right: 1, top: 1, bottom: -1 }, Et = (e, t, s) => {
|
|
265
|
+
const r = e % t, a = Math.floor(e / t);
|
|
266
|
+
return { x: r / t, y: (s - 1 - a) / s };
|
|
267
|
+
}, Rt = ({
|
|
268
|
+
sheet: e,
|
|
269
|
+
contentAspect: t,
|
|
270
|
+
renderOrder: s,
|
|
271
|
+
name: r
|
|
272
|
+
}) => {
|
|
273
|
+
const a = dt(e.url), n = F(0), i = F(-1), c = mt(), [o, l] = t != null ? ut(c, t) : [1, 1];
|
|
274
|
+
return st((h, d) => {
|
|
275
|
+
a.wrapS = Se, a.wrapT = Se, a.magFilter = ye, a.minFilter = ye, a.generateMipmaps = !1, a.repeat.set(1 / e.cols, 1 / e.rows), n.current += d;
|
|
276
|
+
const m = Math.floor(n.current * e.fps) % e.frames;
|
|
277
|
+
if (m === i.current) return;
|
|
278
|
+
i.current = m;
|
|
279
|
+
const { x: u, y: p } = Et(m, e.cols, e.rows);
|
|
280
|
+
a.offset.set(u, p);
|
|
281
|
+
}), /* @__PURE__ */ L("mesh", { name: r, renderOrder: s, scale: [o, l, 1], children: [
|
|
282
|
+
/* @__PURE__ */ g("planeGeometry", { args: [1, 1] }),
|
|
283
|
+
/* @__PURE__ */ g("meshBasicMaterial", { map: a, transparent: !0, toneMapped: !1, depthWrite: !1 })
|
|
284
|
+
] });
|
|
285
|
+
}, gs = ({
|
|
286
|
+
sheet: e,
|
|
287
|
+
anchors: t = Tt,
|
|
288
|
+
contentAspect: s,
|
|
289
|
+
renderOrder: r = 10,
|
|
290
|
+
name: a = "spriteAnimation"
|
|
291
|
+
}) => /* @__PURE__ */ g(Xe, { fallback: null, children: /* @__PURE__ */ g(Ke, { anchors: t, children: /* @__PURE__ */ g(Rt, { sheet: e, contentAspect: s, renderOrder: r, name: a }) }) }), q = (e) => {
|
|
292
|
+
switch (e) {
|
|
293
|
+
case "start":
|
|
294
|
+
return "starting";
|
|
295
|
+
case "started":
|
|
296
|
+
case "resume":
|
|
297
|
+
return "recording";
|
|
298
|
+
case "pause":
|
|
299
|
+
return "paused";
|
|
300
|
+
case "stop":
|
|
301
|
+
return "stopping";
|
|
302
|
+
case "complete":
|
|
303
|
+
return "completed";
|
|
304
|
+
case "fail":
|
|
305
|
+
return "error";
|
|
306
|
+
case "clear":
|
|
307
|
+
return "idle";
|
|
308
|
+
}
|
|
309
|
+
}, bt = [
|
|
367
310
|
"video/mp4",
|
|
368
311
|
"video/webm;codecs=vp9",
|
|
369
312
|
"video/webm;codecs=vp8",
|
|
370
313
|
"video/webm"
|
|
371
314
|
];
|
|
372
|
-
function
|
|
373
|
-
const {
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
315
|
+
function Ss(e = {}) {
|
|
316
|
+
const {
|
|
317
|
+
audio: t = !1,
|
|
318
|
+
mimeType: s,
|
|
319
|
+
bitsPerSecond: r,
|
|
320
|
+
onData: a,
|
|
321
|
+
onStop: n,
|
|
322
|
+
onRecordingStart: i,
|
|
323
|
+
onRecordingPause: c,
|
|
324
|
+
onRecordingResume: o,
|
|
325
|
+
onRecordingStop: l,
|
|
326
|
+
onRecordingComplete: h,
|
|
327
|
+
onError: d,
|
|
328
|
+
passThroughStream: m
|
|
329
|
+
} = e, u = F(null), p = F(null), M = F([]), [E, f] = x("idle"), [S, b] = x(null), [X, A] = x(null), w = R(() => {
|
|
330
|
+
var C;
|
|
331
|
+
const y = [s, ...bt].filter(Boolean);
|
|
332
|
+
for (const T of y)
|
|
333
|
+
if ((C = MediaRecorder.isTypeSupported) != null && C.call(MediaRecorder, T)) return T;
|
|
334
|
+
}, [s]), G = R(
|
|
335
|
+
async (y) => {
|
|
336
|
+
const C = new MediaStream();
|
|
337
|
+
if (y.getTracks().forEach((T) => C.addTrack(T)), t) {
|
|
338
|
+
let T;
|
|
339
|
+
if (t instanceof MediaStream)
|
|
340
|
+
T = t;
|
|
385
341
|
else {
|
|
386
|
-
const
|
|
387
|
-
|
|
342
|
+
const k = typeof t == "object" ? { audio: t } : { audio: !0, video: !1 };
|
|
343
|
+
T = await navigator.mediaDevices.getUserMedia(k);
|
|
388
344
|
}
|
|
389
|
-
|
|
345
|
+
T.getAudioTracks().forEach((k) => C.addTrack(k));
|
|
390
346
|
}
|
|
391
|
-
if (!
|
|
347
|
+
if (!C.getTracks().length)
|
|
392
348
|
throw new Error("No tracks available in combined stream.");
|
|
393
|
-
return
|
|
349
|
+
return p.current = C, C;
|
|
394
350
|
},
|
|
395
|
-
[
|
|
396
|
-
),
|
|
397
|
-
async (
|
|
351
|
+
[t]
|
|
352
|
+
), Y = R(
|
|
353
|
+
async (y, C) => {
|
|
354
|
+
f(q("start")), A(null), b(null);
|
|
398
355
|
try {
|
|
399
|
-
let
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
356
|
+
let T;
|
|
357
|
+
if (m)
|
|
358
|
+
T = m, p.current = T;
|
|
359
|
+
else {
|
|
360
|
+
if (!y) throw new Error("start(stream) requires a MediaStream.");
|
|
361
|
+
T = await G(y);
|
|
362
|
+
}
|
|
363
|
+
const k = w(), H = {};
|
|
364
|
+
k && (H.mimeType = k), r && (H.bitsPerSecond = r);
|
|
365
|
+
const K = new MediaRecorder(T, H);
|
|
366
|
+
K.ondataavailable = (N) => {
|
|
367
|
+
var $;
|
|
368
|
+
(($ = N.data) == null ? void 0 : $.size) > 0 && (M.current.push(N.data), a == null || a(N.data));
|
|
369
|
+
}, K.onstop = () => {
|
|
370
|
+
const N = new Blob(M.current, {
|
|
371
|
+
type: k ?? "video/webm"
|
|
410
372
|
});
|
|
411
|
-
|
|
412
|
-
},
|
|
413
|
-
} catch (
|
|
414
|
-
|
|
373
|
+
b(N), n == null || n(N), h == null || h(N), M.current = [], f(q("complete"));
|
|
374
|
+
}, u.current = K, K.start(C), f(q("started")), i == null || i();
|
|
375
|
+
} catch (T) {
|
|
376
|
+
const k = T instanceof Error ? T : new Error(String(T));
|
|
377
|
+
console.error("start(stream) failed", k), A(k), f(q("fail")), d == null || d(k);
|
|
415
378
|
}
|
|
416
379
|
},
|
|
417
|
-
[
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
380
|
+
[
|
|
381
|
+
G,
|
|
382
|
+
w,
|
|
383
|
+
r,
|
|
384
|
+
a,
|
|
385
|
+
n,
|
|
386
|
+
h,
|
|
387
|
+
i,
|
|
388
|
+
d,
|
|
389
|
+
m
|
|
390
|
+
]
|
|
391
|
+
), Q = R(() => {
|
|
392
|
+
const y = u.current;
|
|
393
|
+
!y || y.state === "inactive" || (f(q("stop")), y.stop(), l == null || l());
|
|
394
|
+
}, [l]), J = R(() => {
|
|
395
|
+
const y = u.current;
|
|
396
|
+
(y == null ? void 0 : y.state) === "recording" && (y.pause(), f(q("pause")), c == null || c());
|
|
397
|
+
}, [c]), ee = R(() => {
|
|
398
|
+
const y = u.current;
|
|
399
|
+
(y == null ? void 0 : y.state) === "paused" && (y.resume(), f(q("resume")), o == null || o());
|
|
400
|
+
}, [o]), z = R(() => {
|
|
401
|
+
var y;
|
|
429
402
|
try {
|
|
430
|
-
(
|
|
431
|
-
} catch (
|
|
432
|
-
console.error("clear failed",
|
|
403
|
+
u.current && (u.current.onstop = null, u.current.state !== "inactive" && u.current.stop()), u.current = null, (y = p.current) == null || y.getTracks().forEach((C) => C.stop()), p.current = null, b(null), f(q("clear")), M.current = [], A(null);
|
|
404
|
+
} catch (C) {
|
|
405
|
+
console.error("clear failed", C);
|
|
433
406
|
}
|
|
434
407
|
}, []);
|
|
435
|
-
return
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
408
|
+
return _(() => () => z(), []), {
|
|
409
|
+
status: E,
|
|
410
|
+
start: Y,
|
|
411
|
+
stop: Q,
|
|
412
|
+
pause: J,
|
|
413
|
+
resume: ee,
|
|
414
|
+
clear: z,
|
|
415
|
+
isRecording: E === "recording" || E === "paused",
|
|
416
|
+
isPaused: E === "paused",
|
|
417
|
+
recordedBlob: S,
|
|
418
|
+
error: X,
|
|
419
|
+
getActiveStream: () => p.current
|
|
446
420
|
};
|
|
447
421
|
}
|
|
448
|
-
const
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
422
|
+
const At = async (e, t = {}) => {
|
|
423
|
+
var s, r, a;
|
|
424
|
+
(s = t.onCaptureStart) == null || s.call(t), await Promise.resolve();
|
|
425
|
+
try {
|
|
426
|
+
const n = e();
|
|
427
|
+
return (r = t.onCaptureComplete) == null || r.call(t, n), n;
|
|
428
|
+
} catch (n) {
|
|
429
|
+
const i = n instanceof Error ? n : new Error(String(n));
|
|
430
|
+
throw (a = t.onError) == null || a.call(t, i), i;
|
|
431
|
+
}
|
|
432
|
+
}, ys = (e = {}) => {
|
|
433
|
+
const { session: t } = Ie(), {
|
|
434
|
+
captureFrame: s = t.captureFrame,
|
|
435
|
+
onCaptureStart: r,
|
|
436
|
+
onCaptureComplete: a,
|
|
437
|
+
onError: n
|
|
438
|
+
} = e, [i, c] = x("idle"), [o, l] = x(null), [h, d] = x(null), m = R(async () => {
|
|
439
|
+
c("capturing"), l(null), d(null);
|
|
440
|
+
try {
|
|
441
|
+
const p = await At(s, {
|
|
442
|
+
onCaptureStart: r,
|
|
443
|
+
onCaptureComplete: a,
|
|
444
|
+
onError: n
|
|
445
|
+
});
|
|
446
|
+
return l(p), c("completed"), p;
|
|
447
|
+
} catch (p) {
|
|
448
|
+
const M = p instanceof Error ? p : new Error(String(p));
|
|
449
|
+
return d(M), c("error"), null;
|
|
450
|
+
}
|
|
451
|
+
}, [s, r, a, n]), u = R(() => {
|
|
452
|
+
c("idle"), l(null), d(null);
|
|
453
|
+
}, []);
|
|
454
|
+
return { status: i, capturePhoto: m, clear: u, dataUrl: o, error: h };
|
|
455
|
+
}, Ms = (e, t) => {
|
|
456
|
+
const s = e.split(","), r = s[0].match(/:(.*?);/), a = r ? r[1] : "application/octet-stream", n = atob(s[s.length - 1]);
|
|
457
|
+
let i = n.length;
|
|
458
|
+
const c = new Uint8Array(i);
|
|
459
|
+
for (; i--; )
|
|
460
|
+
c[i] = n.charCodeAt(i);
|
|
461
|
+
return new File([c], t, { type: a });
|
|
462
|
+
}, Ft = 4, Ct = 50, vt = 5e3, se = (e) => Math.min(1, Math.max(0, e)), Me = (e) => new Promise((t) => {
|
|
463
|
+
if (e.readyState >= 4) {
|
|
464
|
+
t();
|
|
458
465
|
return;
|
|
459
466
|
}
|
|
460
|
-
let
|
|
461
|
-
const
|
|
462
|
-
|
|
467
|
+
let s = !1;
|
|
468
|
+
const r = () => {
|
|
469
|
+
s || (s = !0, t());
|
|
463
470
|
};
|
|
464
|
-
|
|
465
|
-
}),
|
|
466
|
-
const
|
|
467
|
-
return
|
|
468
|
-
},
|
|
469
|
-
|
|
470
|
-
|
|
471
|
+
e.addEventListener("canplaythrough", r, { once: !0 }), e.addEventListener("error", r, { once: !0 }), setTimeout(r, vt);
|
|
472
|
+
}), Te = (e, t) => {
|
|
473
|
+
const s = document.createElement("audio");
|
|
474
|
+
return s.src = e, s.loop = t, s.preload = "auto", s.setAttribute("playsinline", ""), s.setAttribute("webkit-playsinline", ""), s.load(), s;
|
|
475
|
+
}, kt = (e) => {
|
|
476
|
+
e.muted = !0, e.play().then(() => {
|
|
477
|
+
e.pause(), e.currentTime = 0, e.muted = !1;
|
|
471
478
|
}).catch(() => {
|
|
472
|
-
|
|
479
|
+
e.muted = !1;
|
|
473
480
|
});
|
|
474
481
|
};
|
|
475
|
-
class
|
|
476
|
-
constructor(
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
482
|
+
class _t {
|
|
483
|
+
constructor(t = {}) {
|
|
484
|
+
U(this, "sfxPoolSize");
|
|
485
|
+
U(this, "coalesceMs");
|
|
486
|
+
U(this, "muted", !0);
|
|
487
|
+
U(this, "listeners", /* @__PURE__ */ new Set());
|
|
488
|
+
U(this, "music", null);
|
|
489
|
+
U(this, "musicUrl", null);
|
|
490
|
+
U(this, "musicReady", null);
|
|
491
|
+
U(this, "musicWanted", null);
|
|
492
|
+
U(this, "pools", /* @__PURE__ */ new Map());
|
|
484
493
|
/** Last play time per SFX URL, for the coalesce window. */
|
|
485
|
-
|
|
494
|
+
U(this, "lastPlayed", /* @__PURE__ */ new Map());
|
|
486
495
|
/** Readiness promises so a loading gate can await decode/buffer. */
|
|
487
|
-
|
|
488
|
-
this.sfxPoolSize =
|
|
496
|
+
U(this, "ready", /* @__PURE__ */ new Map());
|
|
497
|
+
this.sfxPoolSize = t.sfxPoolSize ?? Ft, this.coalesceMs = t.coalesceMs ?? Ct;
|
|
489
498
|
}
|
|
490
499
|
/**
|
|
491
500
|
* Create + buffer the looping music element. Await in the loading gate so the
|
|
492
501
|
* unmute tap is instant. Idempotent per URL (re-requesting the same track is
|
|
493
502
|
* a no-op that returns the in-flight promise).
|
|
494
503
|
*/
|
|
495
|
-
prefetchMusic(
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
this.music =
|
|
500
|
-
const
|
|
501
|
-
return this.
|
|
504
|
+
prefetchMusic(t, s = 0.4) {
|
|
505
|
+
const r = se(s);
|
|
506
|
+
if (this.musicWanted = { url: t, volume: r }, this.musicUrl === t && this.musicReady)
|
|
507
|
+
return this.music && (this.music.volume = r), this.musicReady;
|
|
508
|
+
this.music && (this.music.pause(), this.music.currentTime = 0, this.music.removeAttribute("src"), this.music.load()), this.music = Te(t, !0), this.musicUrl = t, this.music.volume = r;
|
|
509
|
+
const a = Me(this.music);
|
|
510
|
+
return this.musicReady = a, a;
|
|
502
511
|
}
|
|
503
512
|
/**
|
|
504
513
|
* Create + buffer an SFX voice pool (round-robin so overlapping plays don't
|
|
505
514
|
* cut each other off). Returns a promise that resolves when the first element
|
|
506
515
|
* buffers. Idempotent per URL.
|
|
507
516
|
*/
|
|
508
|
-
registerSound(
|
|
509
|
-
const
|
|
510
|
-
if (
|
|
511
|
-
const
|
|
512
|
-
for (let
|
|
513
|
-
const
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
}),
|
|
517
|
+
registerSound(t, s = 1) {
|
|
518
|
+
const r = this.ready.get(t);
|
|
519
|
+
if (r) return r;
|
|
520
|
+
const a = se(s), n = [];
|
|
521
|
+
for (let c = 0; c < this.sfxPoolSize; c += 1) {
|
|
522
|
+
const o = Te(t, !1);
|
|
523
|
+
o.volume = a, o.addEventListener("ended", () => {
|
|
524
|
+
o.currentTime = 0;
|
|
525
|
+
}), n.push(o);
|
|
517
526
|
}
|
|
518
|
-
this.pools.set(
|
|
519
|
-
const
|
|
520
|
-
return this.ready.set(
|
|
527
|
+
this.pools.set(t, { els: n, next: 0, volume: a });
|
|
528
|
+
const i = Me(n[0]);
|
|
529
|
+
return this.ready.set(t, i), i;
|
|
521
530
|
}
|
|
522
531
|
/** Subscribe to mute-state changes (for a toggle UI). Fires immediately with
|
|
523
532
|
* the current state. Returns an unsubscribe. */
|
|
524
|
-
onMuteChange(
|
|
525
|
-
return this.listeners.add(
|
|
533
|
+
onMuteChange(t) {
|
|
534
|
+
return this.listeners.add(t), t(this.muted), () => this.listeners.delete(t);
|
|
526
535
|
}
|
|
527
536
|
isMuted() {
|
|
528
537
|
return this.muted;
|
|
@@ -533,8 +542,8 @@ class Ee {
|
|
|
533
542
|
* element with a muted play/pause so later `playOneShot` calls are allowed,
|
|
534
543
|
* then start the music. All elements are already buffered, so this is instant.
|
|
535
544
|
*/
|
|
536
|
-
setMuted(
|
|
537
|
-
|
|
545
|
+
setMuted(t) {
|
|
546
|
+
t !== this.muted && (this.muted = t, this.muted || this.pools.forEach((s) => s.els.forEach(kt)), this.applyMusic(), this.listeners.forEach((s) => s(this.muted)));
|
|
538
547
|
}
|
|
539
548
|
toggleMuted() {
|
|
540
549
|
this.setMuted(!this.muted);
|
|
@@ -545,29 +554,30 @@ class Ee {
|
|
|
545
554
|
* same sound into one play, and does NO synchronous `currentTime` seek on a
|
|
546
555
|
* ready element (the pool rewinds on `ended`, off the hot path).
|
|
547
556
|
*/
|
|
548
|
-
playOneShot(
|
|
557
|
+
playOneShot(t, s) {
|
|
549
558
|
if (this.muted) return;
|
|
550
|
-
const
|
|
551
|
-
if (!
|
|
552
|
-
const
|
|
553
|
-
if (
|
|
554
|
-
this.lastPlayed.set(
|
|
555
|
-
const
|
|
556
|
-
let
|
|
557
|
-
for (let
|
|
558
|
-
const
|
|
559
|
-
if (
|
|
560
|
-
|
|
559
|
+
const r = this.pools.get(t);
|
|
560
|
+
if (!r) return;
|
|
561
|
+
const a = performance.now();
|
|
562
|
+
if (a - (this.lastPlayed.get(t) ?? -1 / 0) < this.coalesceMs) return;
|
|
563
|
+
this.lastPlayed.set(t, a);
|
|
564
|
+
const n = r.els.length;
|
|
565
|
+
let i;
|
|
566
|
+
for (let c = 0; c < n; c += 1) {
|
|
567
|
+
const o = r.els[(r.next + c) % n];
|
|
568
|
+
if (o.paused) {
|
|
569
|
+
i = o, r.next = (r.next + c + 1) % n;
|
|
561
570
|
break;
|
|
562
571
|
}
|
|
563
572
|
}
|
|
564
|
-
|
|
573
|
+
i || (i = r.els[r.next], r.next = (r.next + 1) % n), i.muted = !1, i.volume = se(s ?? r.volume), i.currentTime !== 0 && (i.currentTime = 0), i.play().catch(() => {
|
|
565
574
|
});
|
|
566
575
|
}
|
|
567
576
|
/** Request the looping background track (buffer it with prefetchMusic, which
|
|
568
577
|
* a loading gate awaits). Remembered while muted; starts on unmute. */
|
|
569
|
-
startMusic(
|
|
570
|
-
|
|
578
|
+
startMusic(t, s = 0.4) {
|
|
579
|
+
const r = se(s);
|
|
580
|
+
this.musicUrl !== t && this.prefetchMusic(t, r), this.musicWanted = { url: t, volume: r }, this.applyMusic();
|
|
571
581
|
}
|
|
572
582
|
stopMusic() {
|
|
573
583
|
this.musicWanted = null, this.music && (this.music.pause(), this.music.currentTime = 0);
|
|
@@ -577,36 +587,857 @@ class Ee {
|
|
|
577
587
|
}), this.muted && !this.music.paused && this.music.pause());
|
|
578
588
|
}
|
|
579
589
|
}
|
|
580
|
-
const
|
|
581
|
-
|
|
582
|
-
|
|
590
|
+
const xt = (e, t, s) => e === "infinite" || e === "loop" && t < Math.max(1, Math.floor(s)) ? "replay" : "ended", wt = (e, t, s) => e && t !== s, Ut = (e) => Math.min(100, Math.max(0, e)) / 100, Ts = He(function({
|
|
591
|
+
src: t,
|
|
592
|
+
playMode: s = "once",
|
|
593
|
+
loopCount: r = 1,
|
|
594
|
+
autoplay: a = !1,
|
|
595
|
+
muted: n = !1,
|
|
596
|
+
volume: i = 100,
|
|
597
|
+
preload: c = "auto",
|
|
598
|
+
onReady: o,
|
|
599
|
+
onPlay: l,
|
|
600
|
+
onPause: h,
|
|
601
|
+
onEnded: d,
|
|
602
|
+
onError: m
|
|
603
|
+
}, u) {
|
|
604
|
+
const p = F(null), M = F(0), E = F(null), f = R(async () => {
|
|
605
|
+
const A = p.current;
|
|
606
|
+
if (A)
|
|
607
|
+
try {
|
|
608
|
+
await A.play();
|
|
609
|
+
} catch (w) {
|
|
610
|
+
const G = w instanceof Error ? w : new Error(String(w));
|
|
611
|
+
throw m == null || m(G), G;
|
|
612
|
+
}
|
|
613
|
+
}, [m]), S = R(() => {
|
|
614
|
+
var A;
|
|
615
|
+
return (A = p.current) == null ? void 0 : A.pause();
|
|
616
|
+
}, []), b = R(() => {
|
|
617
|
+
const A = p.current;
|
|
618
|
+
A && (A.pause(), A.currentTime = 0, M.current = 0);
|
|
619
|
+
}, []);
|
|
620
|
+
ze(
|
|
621
|
+
u,
|
|
622
|
+
() => ({
|
|
623
|
+
play: f,
|
|
624
|
+
pause: S,
|
|
625
|
+
stop: b,
|
|
626
|
+
get current() {
|
|
627
|
+
return p.current;
|
|
628
|
+
}
|
|
629
|
+
}),
|
|
630
|
+
[S, f, b]
|
|
631
|
+
), _(() => {
|
|
632
|
+
M.current = 0, E.current = null;
|
|
633
|
+
}, [t]), _(() => {
|
|
634
|
+
p.current && (p.current.volume = Ut(i));
|
|
635
|
+
}, [i]), _(() => {
|
|
636
|
+
wt(a, E.current, t) && (E.current = t, f().catch(() => {
|
|
637
|
+
}));
|
|
638
|
+
}, [a, t]);
|
|
639
|
+
const X = R(() => {
|
|
640
|
+
M.current += 1;
|
|
641
|
+
const A = Math.max(1, Math.floor(r));
|
|
642
|
+
if (xt(s, M.current, A) === "replay") {
|
|
643
|
+
const w = p.current;
|
|
644
|
+
w && (w.currentTime = 0, f().catch(() => {
|
|
645
|
+
}));
|
|
646
|
+
return;
|
|
647
|
+
}
|
|
648
|
+
M.current = 0, d == null || d();
|
|
649
|
+
}, [r, d, f, s]);
|
|
650
|
+
return /* @__PURE__ */ g(
|
|
651
|
+
"audio",
|
|
652
|
+
{
|
|
653
|
+
ref: p,
|
|
654
|
+
src: t,
|
|
655
|
+
preload: c,
|
|
656
|
+
autoPlay: !1,
|
|
657
|
+
muted: n,
|
|
658
|
+
loop: !1,
|
|
659
|
+
playsInline: !0,
|
|
660
|
+
style: { display: "none" },
|
|
661
|
+
onCanPlayThrough: o,
|
|
662
|
+
onPlay: l,
|
|
663
|
+
onPause: h,
|
|
664
|
+
onEnded: X,
|
|
665
|
+
onError: () => m == null ? void 0 : m(new Error(`Unable to load audio: ${t}`))
|
|
666
|
+
}
|
|
667
|
+
);
|
|
668
|
+
}), D = new _t(), Es = (e, t) => D.prefetchMusic(e, t), Rs = (e, t) => D.registerSound(e, t), bs = (e, t) => D.startMusic(e, t), As = () => D.stopMusic(), Fs = (e, t) => D.playOneShot(e, t), Cs = (e) => D.setMuted(e), vs = () => D.toggleMuted(), ks = () => D.isMuted(), _s = (e) => D.onMuteChange(e), xs = () => {
|
|
669
|
+
const [e, t] = x(D.isMuted());
|
|
670
|
+
return _(() => D.onMuteChange(t), []), e;
|
|
671
|
+
}, Pt = (e = {}) => {
|
|
672
|
+
const { auto: t = !1 } = e, s = F(e.env ?? Le()), r = F(e.constraints);
|
|
673
|
+
r.current = e.constraints;
|
|
674
|
+
const [a, n] = x("unknown"), [i, c] = x(null), o = F(0), l = R(async () => {
|
|
675
|
+
const d = ++o.current, m = await Oe(s.current);
|
|
676
|
+
if (d !== o.current) return a;
|
|
677
|
+
const u = m.state === "unknown" ? "unknown" : m.state;
|
|
678
|
+
return n((p) => p === "requesting" ? p : u), u !== "blocked" && c(null), u;
|
|
679
|
+
}, []), h = R(
|
|
680
|
+
async (d) => {
|
|
681
|
+
const m = ++o.current;
|
|
682
|
+
n("requesting"), c(null);
|
|
683
|
+
const u = await Ge(
|
|
684
|
+
{ constraints: (d == null ? void 0 : d.constraints) ?? r.current, keepStream: !1 },
|
|
685
|
+
s.current
|
|
686
|
+
);
|
|
687
|
+
return m !== o.current || (n(u.state), c(u.reason)), u.state;
|
|
688
|
+
},
|
|
689
|
+
[]
|
|
690
|
+
);
|
|
691
|
+
return _(() => {
|
|
692
|
+
let d = () => {
|
|
693
|
+
}, m = !0;
|
|
694
|
+
return t ? h() : l(), qe((u) => {
|
|
695
|
+
m && (n((p) => p === "requesting" ? p : u.state === "unknown" ? "unknown" : u.state), u.state !== "blocked" && c(null));
|
|
696
|
+
}, s.current).then((u) => {
|
|
697
|
+
m ? d = u : u();
|
|
698
|
+
}), () => {
|
|
699
|
+
m = !1, o.current += 1, d();
|
|
700
|
+
};
|
|
701
|
+
}, [t, l, h]), Z(
|
|
702
|
+
() => ({
|
|
703
|
+
state: a,
|
|
704
|
+
reason: i,
|
|
705
|
+
canPrompt: Be(a),
|
|
706
|
+
usable: a === "granted",
|
|
707
|
+
request: h,
|
|
708
|
+
refresh: l
|
|
709
|
+
}),
|
|
710
|
+
[a, i, h, l]
|
|
711
|
+
);
|
|
712
|
+
}, Dt = {
|
|
713
|
+
display: "flex",
|
|
714
|
+
flexDirection: "column",
|
|
715
|
+
alignItems: "center",
|
|
716
|
+
justifyContent: "center",
|
|
717
|
+
gap: 12,
|
|
718
|
+
height: "100%",
|
|
719
|
+
minHeight: 160,
|
|
720
|
+
padding: 24,
|
|
721
|
+
textAlign: "center",
|
|
722
|
+
background: "#111827",
|
|
723
|
+
color: "#f9fafb",
|
|
724
|
+
fontFamily: "system-ui, sans-serif"
|
|
725
|
+
}, Nt = {
|
|
726
|
+
font: "inherit",
|
|
727
|
+
padding: "10px 18px",
|
|
728
|
+
borderRadius: 8,
|
|
729
|
+
border: "1px solid rgba(255,255,255,0.3)",
|
|
730
|
+
background: "#2563eb",
|
|
731
|
+
color: "#fff",
|
|
732
|
+
cursor: "pointer"
|
|
733
|
+
}, ws = ({
|
|
734
|
+
children: e,
|
|
735
|
+
fallback: t,
|
|
736
|
+
auto: s = !1,
|
|
737
|
+
constraints: r,
|
|
738
|
+
requestLabel: a = "Allow camera"
|
|
739
|
+
}) => {
|
|
740
|
+
const n = Pt({ auto: s, constraints: r });
|
|
741
|
+
if (n.usable) return /* @__PURE__ */ g(re, { children: e });
|
|
742
|
+
if (t) return /* @__PURE__ */ g(re, { children: t(n) });
|
|
743
|
+
const { state: i, reason: c, canPrompt: o, request: l } = n;
|
|
744
|
+
return /* @__PURE__ */ L("div", { style: Dt, role: "region", "aria-label": "Camera access", children: [
|
|
745
|
+
/* @__PURE__ */ g("p", { "aria-live": "polite", style: { margin: 0 }, children: (c == null ? void 0 : c.message) ?? We[i] }),
|
|
746
|
+
/* @__PURE__ */ g(
|
|
747
|
+
"button",
|
|
748
|
+
{
|
|
749
|
+
type: "button",
|
|
750
|
+
onClick: () => void l(),
|
|
751
|
+
disabled: !o || i === "requesting",
|
|
752
|
+
"aria-disabled": !o || i === "requesting",
|
|
753
|
+
style: { ...Nt, opacity: o && i !== "requesting" ? 1 : 0.5 },
|
|
754
|
+
children: i === "requesting" ? "Waiting…" : i === "denied" ? "Try again" : a
|
|
755
|
+
}
|
|
756
|
+
)
|
|
757
|
+
] });
|
|
758
|
+
}, It = () => {
|
|
759
|
+
var e;
|
|
760
|
+
return {
|
|
761
|
+
enumerateDevices: typeof navigator < "u" && ((e = navigator.mediaDevices) != null && e.enumerateDevices) ? () => navigator.mediaDevices.enumerateDevices() : void 0
|
|
762
|
+
};
|
|
763
|
+
}, Lt = /\b(back|rear|environment|world)\b/i, Ot = /\b(front|user|facetime|selfie)\b/i, Gt = (e) => Lt.test(e) ? "environment" : Ot.test(e) ? "user" : null, Us = async (e = It()) => {
|
|
764
|
+
if (!e.enumerateDevices) return [];
|
|
765
|
+
try {
|
|
766
|
+
return (await e.enumerateDevices()).filter((s) => s.kind === "videoinput").map((s) => ({
|
|
767
|
+
deviceId: s.deviceId,
|
|
768
|
+
label: s.label,
|
|
769
|
+
facing: Gt(s.label)
|
|
770
|
+
}));
|
|
771
|
+
} catch {
|
|
772
|
+
return [];
|
|
773
|
+
}
|
|
774
|
+
}, Ps = (e, t) => e.find((s) => s.facing === t) ?? null, ke = je(null), Ds = ({
|
|
775
|
+
cache: e,
|
|
776
|
+
disposeUnreferencedOnUnmount: t = !0,
|
|
777
|
+
children: s
|
|
778
|
+
}) => {
|
|
779
|
+
const r = e ?? Ce();
|
|
780
|
+
return _(() => () => {
|
|
781
|
+
t && r.disposeUnreferenced();
|
|
782
|
+
}, [r, t]), /* @__PURE__ */ g(ke.Provider, { value: r, children: s });
|
|
783
|
+
}, _e = () => $e(ke) ?? Ce(), Ns = (e, t = {}) => {
|
|
784
|
+
const { enabled: s = !0 } = t, r = _e(), a = Ve(), n = (e == null ? void 0 : e.key) ?? null, [i, c] = x({
|
|
785
|
+
value: null,
|
|
786
|
+
status: "idle",
|
|
787
|
+
error: null
|
|
788
|
+
});
|
|
789
|
+
return _(() => {
|
|
790
|
+
if (!e || !s) {
|
|
791
|
+
c({ value: null, status: "idle", error: null });
|
|
792
|
+
return;
|
|
793
|
+
}
|
|
794
|
+
let o = !0;
|
|
795
|
+
const l = r.get(e.key);
|
|
796
|
+
return c({ value: l ?? null, status: l ? "ready" : "loading", error: null }), r.acquire(e, a).then((h) => {
|
|
797
|
+
o && c({ value: h, status: "ready", error: null });
|
|
798
|
+
}).catch((h) => {
|
|
799
|
+
o && c({ value: null, status: "error", error: h });
|
|
800
|
+
}), () => {
|
|
801
|
+
o = !1, r.release(e.key, a);
|
|
802
|
+
};
|
|
803
|
+
}, [r, n, s, a]), i;
|
|
804
|
+
}, Is = (e) => {
|
|
805
|
+
const t = _e(), s = e ?? t;
|
|
806
|
+
return Ze(
|
|
807
|
+
(r) => s.subscribe(r),
|
|
808
|
+
() => s.getStats(),
|
|
809
|
+
() => s.getStats()
|
|
810
|
+
);
|
|
811
|
+
}, ae = 1, xe = Object.freeze({
|
|
812
|
+
version: ae,
|
|
813
|
+
trackers: {
|
|
814
|
+
face: { enabled: !0, numFaces: 1, targetFps: null, holdMs: 250, predictMs: 0, smoothing: 0 },
|
|
815
|
+
hand: { enabled: !1, targetFps: null },
|
|
816
|
+
gesture: { enabled: !1, targetFps: null },
|
|
817
|
+
body: { enabled: !1, targetFps: null },
|
|
818
|
+
holistic: {
|
|
819
|
+
enabled: !1,
|
|
820
|
+
targetFps: null,
|
|
821
|
+
hands: "both",
|
|
822
|
+
holdMs: 250,
|
|
823
|
+
predictMs: 0,
|
|
824
|
+
analysisMaxDimension: 768,
|
|
825
|
+
outputFaceBlendshapes: !0,
|
|
826
|
+
confidence: 0.5,
|
|
827
|
+
delegate: "auto"
|
|
828
|
+
},
|
|
829
|
+
segmentation: { enabled: !1, quality: "low" },
|
|
830
|
+
semanticSegmentation: { enabled: !1, preset: "multiclass", quality: "medium" }
|
|
831
|
+
},
|
|
832
|
+
perf: { targetFps: 24, camRes: 720, cameraZoom: 1.2, analysisScale: 1 },
|
|
833
|
+
lifecycle: { pauseWhenHidden: !1 },
|
|
834
|
+
quality: {},
|
|
835
|
+
camera: { facingMode: "user", deviceId: null, mirrored: "auto" },
|
|
836
|
+
fallbacks: { onUnsupported: "degrade", delegate: "auto" },
|
|
837
|
+
assets: { holisticModelUrl: null, semanticSegmentationModelUrl: null },
|
|
838
|
+
updatedAt: 0
|
|
839
|
+
}), P = (e, t, s, r, a, n) => {
|
|
840
|
+
if (e === void 0) return t;
|
|
841
|
+
if (typeof e != "number" || !Number.isFinite(e))
|
|
842
|
+
return n(`${a}: not a number, kept ${t}`), t;
|
|
843
|
+
const i = Math.min(r, Math.max(s, e));
|
|
844
|
+
return i !== e && n(`${a}: ${e} clamped to ${i}`), i;
|
|
845
|
+
}, j = (e, t, s, r) => e === void 0 ? t : e === null ? null : typeof e != "number" || !Number.isFinite(e) || e <= 0 ? (r(`${s}: invalid fps, kept ${t}`), t) : (e > 120 && r(`${s}: ${e} clamped to 120`), Math.min(120, e)), qt = [
|
|
846
|
+
"tiers",
|
|
847
|
+
"budget",
|
|
848
|
+
"initialTier",
|
|
849
|
+
"minTier",
|
|
850
|
+
"maxTier",
|
|
851
|
+
"adaptive",
|
|
852
|
+
"historySize"
|
|
853
|
+
], Ee = (e) => {
|
|
854
|
+
const t = {};
|
|
855
|
+
for (const s of qt) e[s] !== void 0 && (t[s] = e[s]);
|
|
856
|
+
return t;
|
|
857
|
+
}, I = (e, t, s, r) => e === void 0 ? t : typeof e != "boolean" ? (r(`${s}: not a boolean, kept ${t}`), t) : e, B = (e, t, s, r, a) => e === void 0 ? s : t.includes(e) ? e : (a(`${r}: "${String(e)}" is not one of ${t.join(" | ")}, kept ${s}`), s), Re = (e, t, s, r) => e === void 0 ? t : e === null ? null : typeof e != "string" || !/^https?:\/\//.test(e) ? (r(`${s}: not an http(s) URL, kept ${t === null ? "the SDK default" : t}`), t) : e, W = (e = {}, t = xe, s = []) => {
|
|
858
|
+
var c, o, l, h, d, m, u, p, M, E, f, S, b, X, A, w, G, Y, Q, J, ee, z, y, C, T, k, H, K, N, $, le, ue, de, me, pe, fe, he, ge;
|
|
859
|
+
const r = (Pe) => s.push(Pe), a = e.trackers ?? {}, n = t.trackers, i = e.quality === void 0 ? t.quality === !1 ? !1 : Ee(t.quality) : e.quality === !1 ? !1 : typeof e.quality == "object" && e.quality !== null ? Ee(e.quality) : (r("quality: must be an object or false, kept base"), t.quality);
|
|
860
|
+
return {
|
|
861
|
+
version: ae,
|
|
862
|
+
trackers: {
|
|
863
|
+
face: {
|
|
864
|
+
enabled: I((c = a.face) == null ? void 0 : c.enabled, n.face.enabled, "trackers.face.enabled", r),
|
|
865
|
+
numFaces: Math.round(
|
|
866
|
+
P((o = a.face) == null ? void 0 : o.numFaces, n.face.numFaces, 1, 10, "trackers.face.numFaces", r)
|
|
867
|
+
),
|
|
868
|
+
targetFps: j((l = a.face) == null ? void 0 : l.targetFps, n.face.targetFps, "trackers.face.targetFps", r),
|
|
869
|
+
holdMs: P((h = a.face) == null ? void 0 : h.holdMs, n.face.holdMs, 0, 5e3, "trackers.face.holdMs", r),
|
|
870
|
+
predictMs: P(
|
|
871
|
+
(d = a.face) == null ? void 0 : d.predictMs,
|
|
872
|
+
n.face.predictMs,
|
|
873
|
+
0,
|
|
874
|
+
1e3,
|
|
875
|
+
"trackers.face.predictMs",
|
|
876
|
+
r
|
|
877
|
+
),
|
|
878
|
+
smoothing: P(
|
|
879
|
+
(m = a.face) == null ? void 0 : m.smoothing,
|
|
880
|
+
n.face.smoothing,
|
|
881
|
+
0,
|
|
882
|
+
100,
|
|
883
|
+
"trackers.face.smoothing",
|
|
884
|
+
r
|
|
885
|
+
)
|
|
886
|
+
},
|
|
887
|
+
hand: {
|
|
888
|
+
enabled: I((u = a.hand) == null ? void 0 : u.enabled, n.hand.enabled, "trackers.hand.enabled", r),
|
|
889
|
+
targetFps: j((p = a.hand) == null ? void 0 : p.targetFps, n.hand.targetFps, "trackers.hand.targetFps", r)
|
|
890
|
+
},
|
|
891
|
+
gesture: {
|
|
892
|
+
enabled: I((M = a.gesture) == null ? void 0 : M.enabled, n.gesture.enabled, "trackers.gesture.enabled", r),
|
|
893
|
+
targetFps: j(
|
|
894
|
+
(E = a.gesture) == null ? void 0 : E.targetFps,
|
|
895
|
+
n.gesture.targetFps,
|
|
896
|
+
"trackers.gesture.targetFps",
|
|
897
|
+
r
|
|
898
|
+
)
|
|
899
|
+
},
|
|
900
|
+
body: {
|
|
901
|
+
enabled: I((f = a.body) == null ? void 0 : f.enabled, n.body.enabled, "trackers.body.enabled", r),
|
|
902
|
+
targetFps: j((S = a.body) == null ? void 0 : S.targetFps, n.body.targetFps, "trackers.body.targetFps", r)
|
|
903
|
+
},
|
|
904
|
+
holistic: {
|
|
905
|
+
enabled: I((b = a.holistic) == null ? void 0 : b.enabled, n.holistic.enabled, "trackers.holistic.enabled", r),
|
|
906
|
+
targetFps: j(
|
|
907
|
+
(X = a.holistic) == null ? void 0 : X.targetFps,
|
|
908
|
+
n.holistic.targetFps,
|
|
909
|
+
"trackers.holistic.targetFps",
|
|
910
|
+
r
|
|
911
|
+
),
|
|
912
|
+
hands: B(
|
|
913
|
+
(A = a.holistic) == null ? void 0 : A.hands,
|
|
914
|
+
["both", "left", "right", "none"],
|
|
915
|
+
n.holistic.hands,
|
|
916
|
+
"trackers.holistic.hands",
|
|
917
|
+
r
|
|
918
|
+
),
|
|
919
|
+
holdMs: P(
|
|
920
|
+
(w = a.holistic) == null ? void 0 : w.holdMs,
|
|
921
|
+
n.holistic.holdMs,
|
|
922
|
+
0,
|
|
923
|
+
5e3,
|
|
924
|
+
"trackers.holistic.holdMs",
|
|
925
|
+
r
|
|
926
|
+
),
|
|
927
|
+
predictMs: P(
|
|
928
|
+
(G = a.holistic) == null ? void 0 : G.predictMs,
|
|
929
|
+
n.holistic.predictMs,
|
|
930
|
+
0,
|
|
931
|
+
1e3,
|
|
932
|
+
"trackers.holistic.predictMs",
|
|
933
|
+
r
|
|
934
|
+
),
|
|
935
|
+
analysisMaxDimension: Math.round(
|
|
936
|
+
P(
|
|
937
|
+
(Y = a.holistic) == null ? void 0 : Y.analysisMaxDimension,
|
|
938
|
+
n.holistic.analysisMaxDimension,
|
|
939
|
+
128,
|
|
940
|
+
2048,
|
|
941
|
+
"trackers.holistic.analysisMaxDimension",
|
|
942
|
+
r
|
|
943
|
+
)
|
|
944
|
+
),
|
|
945
|
+
outputFaceBlendshapes: I(
|
|
946
|
+
(Q = a.holistic) == null ? void 0 : Q.outputFaceBlendshapes,
|
|
947
|
+
n.holistic.outputFaceBlendshapes,
|
|
948
|
+
"trackers.holistic.outputFaceBlendshapes",
|
|
949
|
+
r
|
|
950
|
+
),
|
|
951
|
+
confidence: P(
|
|
952
|
+
(J = a.holistic) == null ? void 0 : J.confidence,
|
|
953
|
+
n.holistic.confidence,
|
|
954
|
+
0,
|
|
955
|
+
1,
|
|
956
|
+
"trackers.holistic.confidence",
|
|
957
|
+
r
|
|
958
|
+
),
|
|
959
|
+
delegate: B(
|
|
960
|
+
(ee = a.holistic) == null ? void 0 : ee.delegate,
|
|
961
|
+
["auto", "GPU", "CPU"],
|
|
962
|
+
n.holistic.delegate,
|
|
963
|
+
"trackers.holistic.delegate",
|
|
964
|
+
r
|
|
965
|
+
)
|
|
966
|
+
},
|
|
967
|
+
segmentation: {
|
|
968
|
+
enabled: I(
|
|
969
|
+
(z = a.segmentation) == null ? void 0 : z.enabled,
|
|
970
|
+
n.segmentation.enabled,
|
|
971
|
+
"trackers.segmentation.enabled",
|
|
972
|
+
r
|
|
973
|
+
),
|
|
974
|
+
quality: B(
|
|
975
|
+
(y = a.segmentation) == null ? void 0 : y.quality,
|
|
976
|
+
["low", "medium", "high"],
|
|
977
|
+
n.segmentation.quality,
|
|
978
|
+
"trackers.segmentation.quality",
|
|
979
|
+
r
|
|
980
|
+
)
|
|
981
|
+
},
|
|
982
|
+
semanticSegmentation: {
|
|
983
|
+
enabled: I(
|
|
984
|
+
(C = a.semanticSegmentation) == null ? void 0 : C.enabled,
|
|
985
|
+
n.semanticSegmentation.enabled,
|
|
986
|
+
"trackers.semanticSegmentation.enabled",
|
|
987
|
+
r
|
|
988
|
+
),
|
|
989
|
+
preset: B(
|
|
990
|
+
(T = a.semanticSegmentation) == null ? void 0 : T.preset,
|
|
991
|
+
pt,
|
|
992
|
+
n.semanticSegmentation.preset,
|
|
993
|
+
"trackers.semanticSegmentation.preset",
|
|
994
|
+
r
|
|
995
|
+
),
|
|
996
|
+
quality: B(
|
|
997
|
+
(k = a.semanticSegmentation) == null ? void 0 : k.quality,
|
|
998
|
+
["low", "medium", "high"],
|
|
999
|
+
n.semanticSegmentation.quality,
|
|
1000
|
+
"trackers.semanticSegmentation.quality",
|
|
1001
|
+
r
|
|
1002
|
+
)
|
|
1003
|
+
}
|
|
1004
|
+
},
|
|
1005
|
+
perf: {
|
|
1006
|
+
targetFps: P((H = e.perf) == null ? void 0 : H.targetFps, t.perf.targetFps, 0, 120, "perf.targetFps", r),
|
|
1007
|
+
camRes: Math.round(P((K = e.perf) == null ? void 0 : K.camRes, t.perf.camRes, 160, 3840, "perf.camRes", r)),
|
|
1008
|
+
cameraZoom: P((N = e.perf) == null ? void 0 : N.cameraZoom, t.perf.cameraZoom, 1, 3, "perf.cameraZoom", r),
|
|
1009
|
+
analysisScale: P(
|
|
1010
|
+
($ = e.perf) == null ? void 0 : $.analysisScale,
|
|
1011
|
+
t.perf.analysisScale,
|
|
1012
|
+
0.25,
|
|
1013
|
+
1,
|
|
1014
|
+
"perf.analysisScale",
|
|
1015
|
+
r
|
|
1016
|
+
)
|
|
1017
|
+
},
|
|
1018
|
+
lifecycle: {
|
|
1019
|
+
pauseWhenHidden: I(
|
|
1020
|
+
(le = e.lifecycle) == null ? void 0 : le.pauseWhenHidden,
|
|
1021
|
+
t.lifecycle.pauseWhenHidden,
|
|
1022
|
+
"lifecycle.pauseWhenHidden",
|
|
1023
|
+
r
|
|
1024
|
+
)
|
|
1025
|
+
},
|
|
1026
|
+
quality: i,
|
|
1027
|
+
camera: {
|
|
1028
|
+
facingMode: B(
|
|
1029
|
+
(ue = e.camera) == null ? void 0 : ue.facingMode,
|
|
1030
|
+
["user", "environment"],
|
|
1031
|
+
t.camera.facingMode,
|
|
1032
|
+
"camera.facingMode",
|
|
1033
|
+
r
|
|
1034
|
+
),
|
|
1035
|
+
deviceId: ((de = e.camera) == null ? void 0 : de.deviceId) === void 0 ? t.camera.deviceId : typeof e.camera.deviceId == "string" || e.camera.deviceId === null ? e.camera.deviceId : (r("camera.deviceId: not a string, kept base"), t.camera.deviceId),
|
|
1036
|
+
mirrored: ((me = e.camera) == null ? void 0 : me.mirrored) === void 0 ? t.camera.mirrored : e.camera.mirrored === "auto" || typeof e.camera.mirrored == "boolean" ? e.camera.mirrored : (r('camera.mirrored: must be boolean or "auto", kept base'), t.camera.mirrored)
|
|
1037
|
+
},
|
|
1038
|
+
fallbacks: {
|
|
1039
|
+
onUnsupported: B(
|
|
1040
|
+
(pe = e.fallbacks) == null ? void 0 : pe.onUnsupported,
|
|
1041
|
+
["block", "degrade"],
|
|
1042
|
+
t.fallbacks.onUnsupported,
|
|
1043
|
+
"fallbacks.onUnsupported",
|
|
1044
|
+
r
|
|
1045
|
+
),
|
|
1046
|
+
delegate: B(
|
|
1047
|
+
(fe = e.fallbacks) == null ? void 0 : fe.delegate,
|
|
1048
|
+
["auto", "GPU", "CPU"],
|
|
1049
|
+
t.fallbacks.delegate,
|
|
1050
|
+
"fallbacks.delegate",
|
|
1051
|
+
r
|
|
1052
|
+
)
|
|
1053
|
+
},
|
|
1054
|
+
assets: {
|
|
1055
|
+
holisticModelUrl: Re(
|
|
1056
|
+
(he = e.assets) == null ? void 0 : he.holisticModelUrl,
|
|
1057
|
+
t.assets.holisticModelUrl,
|
|
1058
|
+
"assets.holisticModelUrl",
|
|
1059
|
+
r
|
|
1060
|
+
),
|
|
1061
|
+
semanticSegmentationModelUrl: Re(
|
|
1062
|
+
(ge = e.assets) == null ? void 0 : ge.semanticSegmentationModelUrl,
|
|
1063
|
+
t.assets.semanticSegmentationModelUrl,
|
|
1064
|
+
"assets.semanticSegmentationModelUrl",
|
|
1065
|
+
r
|
|
1066
|
+
)
|
|
1067
|
+
},
|
|
1068
|
+
updatedAt: typeof e.updatedAt == "number" && Number.isFinite(e.updatedAt) ? e.updatedAt : t.updatedAt
|
|
1069
|
+
};
|
|
1070
|
+
}, be = (e, t, s = Date.now()) => W({ ...t, updatedAt: s }, e), we = (e) => JSON.stringify(W({}, e)), Ue = (e) => {
|
|
1071
|
+
const t = [];
|
|
1072
|
+
let s = e;
|
|
1073
|
+
if (typeof e == "string")
|
|
1074
|
+
try {
|
|
1075
|
+
s = JSON.parse(e);
|
|
1076
|
+
} catch {
|
|
1077
|
+
return {
|
|
1078
|
+
config: W(),
|
|
1079
|
+
migrated: !0,
|
|
1080
|
+
warnings: ["not valid JSON; defaults used"]
|
|
1081
|
+
};
|
|
1082
|
+
}
|
|
1083
|
+
if (!s || typeof s != "object")
|
|
1084
|
+
return {
|
|
1085
|
+
config: W(),
|
|
1086
|
+
migrated: !0,
|
|
1087
|
+
warnings: ["not an object; defaults used"]
|
|
1088
|
+
};
|
|
1089
|
+
const r = s, a = r.version !== ae;
|
|
1090
|
+
return a && t.push(
|
|
1091
|
+
`migrated from version ${String(r.version ?? "none")} to ${ae}`
|
|
1092
|
+
), { config: W(r, xe, t), migrated: a, warnings: t };
|
|
1093
|
+
}, Ls = [
|
|
1094
|
+
"face",
|
|
1095
|
+
"hand",
|
|
1096
|
+
"gesture",
|
|
1097
|
+
"body",
|
|
1098
|
+
"holistic",
|
|
1099
|
+
"segmentation",
|
|
1100
|
+
"semanticSegmentation"
|
|
1101
|
+
], Bt = (e) => ({
|
|
1102
|
+
perf: {
|
|
1103
|
+
targetFps: e.perf.targetFps > 0 ? e.perf.targetFps : void 0,
|
|
1104
|
+
camRes: e.perf.camRes,
|
|
1105
|
+
cameraZoom: e.perf.cameraZoom,
|
|
1106
|
+
analysisScale: e.perf.analysisScale
|
|
1107
|
+
},
|
|
1108
|
+
lifecycle: { pauseWhenHidden: e.lifecycle.pauseWhenHidden },
|
|
1109
|
+
quality: e.quality
|
|
1110
|
+
}), Wt = (e) => ({
|
|
1111
|
+
facingMode: e.camera.facingMode,
|
|
1112
|
+
...e.camera.deviceId ? { deviceId: e.camera.deviceId } : {},
|
|
1113
|
+
...e.camera.mirrored === "auto" ? {} : { mirrored: e.camera.mirrored }
|
|
1114
|
+
}), O = (e) => e === null ? {} : { targetFps: e }, Kt = (e, t) => {
|
|
1115
|
+
const s = e.trackers;
|
|
1116
|
+
return {
|
|
1117
|
+
face: {
|
|
1118
|
+
numFaces: s.face.numFaces,
|
|
1119
|
+
...O(s.face.targetFps),
|
|
1120
|
+
holdMs: s.face.holdMs,
|
|
1121
|
+
predictMs: s.face.predictMs,
|
|
1122
|
+
active: s.face.enabled
|
|
1123
|
+
},
|
|
1124
|
+
hand: { ...O(s.hand.targetFps), active: s.hand.enabled },
|
|
1125
|
+
gesture: { ...O(s.gesture.targetFps), active: s.gesture.enabled },
|
|
1126
|
+
body: { active: s.body.enabled },
|
|
1127
|
+
holistic: {
|
|
1128
|
+
...O(s.holistic.targetFps),
|
|
1129
|
+
hands: s.holistic.hands,
|
|
1130
|
+
holdMs: s.holistic.holdMs,
|
|
1131
|
+
predictMs: s.holistic.predictMs,
|
|
1132
|
+
analysisMaxDimension: s.holistic.analysisMaxDimension,
|
|
1133
|
+
outputFaceBlendshapes: s.holistic.outputFaceBlendshapes,
|
|
1134
|
+
delegate: s.holistic.delegate === "auto" ? e.fallbacks.delegate : s.holistic.delegate,
|
|
1135
|
+
...e.assets.holisticModelUrl ? { modelUrl: e.assets.holisticModelUrl } : {},
|
|
1136
|
+
active: s.holistic.enabled
|
|
1137
|
+
},
|
|
1138
|
+
segmentation: { quality: s.segmentation.quality, active: s.segmentation.enabled },
|
|
1139
|
+
semanticSegmentation: {
|
|
1140
|
+
preset: s.semanticSegmentation.preset,
|
|
1141
|
+
quality: s.semanticSegmentation.quality,
|
|
1142
|
+
...e.assets.semanticSegmentationModelUrl ? { modelUrl: e.assets.semanticSegmentationModelUrl } : {},
|
|
1143
|
+
active: s.semanticSegmentation.enabled
|
|
1144
|
+
}
|
|
1145
|
+
}[t];
|
|
1146
|
+
}, Xt = (e, t) => {
|
|
1147
|
+
const s = e.trackers;
|
|
1148
|
+
switch (t) {
|
|
1149
|
+
case v.FACE_TRACKER:
|
|
1150
|
+
return { numFaces: s.face.numFaces, ...O(s.face.targetFps) };
|
|
1151
|
+
case v.HAND_TRACKER:
|
|
1152
|
+
return { ...O(s.hand.targetFps) };
|
|
1153
|
+
case v.GESTURE_TRACKER:
|
|
1154
|
+
return { ...O(s.gesture.targetFps) };
|
|
1155
|
+
case v.BODY_TRACKER:
|
|
1156
|
+
return { ...O(s.body.targetFps) };
|
|
1157
|
+
case v.HOLISTIC_TRACKER: {
|
|
1158
|
+
const r = s.holistic;
|
|
1159
|
+
return {
|
|
1160
|
+
...O(r.targetFps),
|
|
1161
|
+
hands: r.hands,
|
|
1162
|
+
holdMs: r.holdMs,
|
|
1163
|
+
predictMs: r.predictMs,
|
|
1164
|
+
analysisMaxDimension: r.analysisMaxDimension,
|
|
1165
|
+
outputFaceBlendshapes: r.outputFaceBlendshapes,
|
|
1166
|
+
minFaceDetectionConfidence: r.confidence,
|
|
1167
|
+
minFacePresenceConfidence: r.confidence,
|
|
1168
|
+
minPoseDetectionConfidence: r.confidence,
|
|
1169
|
+
minPosePresenceConfidence: r.confidence,
|
|
1170
|
+
minHandLandmarksConfidence: r.confidence,
|
|
1171
|
+
delegate: r.delegate === "auto" ? e.fallbacks.delegate : r.delegate,
|
|
1172
|
+
...e.assets.holisticModelUrl ? { modelUrl: e.assets.holisticModelUrl } : {}
|
|
1173
|
+
};
|
|
1174
|
+
}
|
|
1175
|
+
case v.BACKGROUND_SEGMENTATION:
|
|
1176
|
+
return { quality: s.segmentation.quality };
|
|
1177
|
+
case v.SEMANTIC_SEGMENTATION:
|
|
1178
|
+
return {
|
|
1179
|
+
preset: s.semanticSegmentation.preset,
|
|
1180
|
+
quality: s.semanticSegmentation.quality,
|
|
1181
|
+
...e.assets.semanticSegmentationModelUrl ? { modelUrl: e.assets.semanticSegmentationModelUrl } : {}
|
|
1182
|
+
};
|
|
1183
|
+
default:
|
|
1184
|
+
return {};
|
|
1185
|
+
}
|
|
1186
|
+
}, Ht = (e) => {
|
|
1187
|
+
const t = e.trackers, s = [];
|
|
1188
|
+
return t.face.enabled && s.push(v.FACE_TRACKER), t.hand.enabled && s.push(v.HAND_TRACKER), t.gesture.enabled && s.push(v.GESTURE_TRACKER), t.body.enabled && s.push(v.BODY_TRACKER), t.holistic.enabled && s.push(v.HOLISTIC_TRACKER), t.segmentation.enabled && s.push(v.BACKGROUND_SEGMENTATION), t.semanticSegmentation.enabled && s.push(v.SEMANTIC_SEGMENTATION), s;
|
|
1189
|
+
}, ne = "vincentt.xr.tracking-config", ce = () => {
|
|
1190
|
+
try {
|
|
1191
|
+
return typeof localStorage < "u" ? localStorage : null;
|
|
1192
|
+
} catch {
|
|
1193
|
+
return null;
|
|
1194
|
+
}
|
|
1195
|
+
}, zt = (e = ne, t = ce()) => {
|
|
1196
|
+
if (!t) return null;
|
|
1197
|
+
try {
|
|
1198
|
+
const s = t.getItem(e);
|
|
1199
|
+
return s ? Ue(s) : null;
|
|
1200
|
+
} catch {
|
|
1201
|
+
return null;
|
|
1202
|
+
}
|
|
1203
|
+
}, Ae = (e, t = ne, s = ce()) => {
|
|
1204
|
+
if (!s) return !1;
|
|
1205
|
+
try {
|
|
1206
|
+
return s.setItem(t, we(e)), !0;
|
|
1207
|
+
} catch {
|
|
1208
|
+
return !1;
|
|
1209
|
+
}
|
|
1210
|
+
}, $t = (e = ne, t = ce()) => {
|
|
1211
|
+
if (t)
|
|
1212
|
+
try {
|
|
1213
|
+
t.removeItem(e);
|
|
1214
|
+
} catch {
|
|
1215
|
+
}
|
|
1216
|
+
}, Os = (e = {}) => {
|
|
1217
|
+
const { storageKey: t = ne, persist: s = !0 } = e, r = e.storage, a = F(e.initial), n = Z(() => W(a.current ?? {}), []), [i, c] = x(n), [o, l] = x([]), [h, d] = x(!s), m = F(i);
|
|
1218
|
+
m.current = i, _(() => {
|
|
1219
|
+
if (!s) {
|
|
1220
|
+
d(!0);
|
|
1221
|
+
return;
|
|
1222
|
+
}
|
|
1223
|
+
const f = zt(t, r);
|
|
1224
|
+
if (f) {
|
|
1225
|
+
const S = W(f.config, n);
|
|
1226
|
+
m.current = S, c(S), l(f.warnings), f.migrated && Ae(S, t, r);
|
|
1227
|
+
}
|
|
1228
|
+
d(!0);
|
|
1229
|
+
}, [s, t, r, n]);
|
|
1230
|
+
const u = R(
|
|
1231
|
+
(f, S) => (m.current = f, c(f), l(S), s && Ae(f, t, r), f),
|
|
1232
|
+
[s, t, r]
|
|
1233
|
+
), p = R(
|
|
1234
|
+
(f) => {
|
|
1235
|
+
const S = [], b = W({ ...f, updatedAt: Date.now() }, m.current, S);
|
|
1236
|
+
return u(b, S);
|
|
1237
|
+
},
|
|
1238
|
+
[u]
|
|
1239
|
+
), M = R(() => {
|
|
1240
|
+
const f = be(n, {}, 0);
|
|
1241
|
+
return m.current = f, c(f), l([]), s && $t(t, r), f;
|
|
1242
|
+
}, [n, s, t, r]), E = R(
|
|
1243
|
+
(f) => {
|
|
1244
|
+
const S = Ue(f);
|
|
1245
|
+
return S.warnings.some((b) => b.startsWith("not valid JSON") || b.startsWith("not an object")) ? (l([`import: ${S.warnings[0]}; config unchanged`]), m.current) : u(be(S.config, {}, Date.now()), S.warnings);
|
|
1246
|
+
},
|
|
1247
|
+
[u]
|
|
1248
|
+
);
|
|
1249
|
+
return Z(
|
|
1250
|
+
() => ({
|
|
1251
|
+
config: i,
|
|
1252
|
+
hydrated: h,
|
|
1253
|
+
warnings: o,
|
|
1254
|
+
update: p,
|
|
1255
|
+
reset: M,
|
|
1256
|
+
importJson: E,
|
|
1257
|
+
json: we(i),
|
|
1258
|
+
providerProps: Bt(i),
|
|
1259
|
+
cameraRequest: Wt(i),
|
|
1260
|
+
trackerProps: (f) => Kt(i, f),
|
|
1261
|
+
modelOptions: (f) => Xt(i, f),
|
|
1262
|
+
enabledModels: Ht(i)
|
|
1263
|
+
}),
|
|
1264
|
+
[i, h, o, p, M, E]
|
|
1265
|
+
);
|
|
583
1266
|
};
|
|
584
1267
|
export {
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
1268
|
+
fs as AspectRatioContainer,
|
|
1269
|
+
_t as AudioEngine,
|
|
1270
|
+
Ts as AudioPlayer,
|
|
1271
|
+
hs as Axes,
|
|
1272
|
+
We as CAMERA_PERMISSION_MESSAGES,
|
|
1273
|
+
ws as CameraPermissionGate,
|
|
1274
|
+
Ka as DEFAULT_ASSET_BUDGET_BYTES,
|
|
1275
|
+
Ea as DEFAULT_MATERIAL_FILL,
|
|
1276
|
+
Da as DEFAULT_MESH_RENDERER,
|
|
1277
|
+
Na as DEFAULT_MESH_RENDERER_RENDER_STATE,
|
|
1278
|
+
Bs as DEFAULT_PERFORMANCE_BUDGET,
|
|
1279
|
+
Ws as DEFAULT_PIXEL_SNAP_INCREMENT,
|
|
1280
|
+
Ks as DEFAULT_QUALITY_TIERS,
|
|
1281
|
+
Xs as DEFAULT_REFERENCE_PIXELS_PER_UNIT,
|
|
1282
|
+
jr as DEFAULT_SCREEN_GLASS,
|
|
1283
|
+
Ra as DEFAULT_SCREEN_GRADIENT,
|
|
1284
|
+
Vr as DEFAULT_SCREEN_IMAGE_SCENE_SETTINGS,
|
|
1285
|
+
Zr as DEFAULT_SCREEN_IMAGE_SETTINGS,
|
|
1286
|
+
Yr as DEFAULT_SCREEN_SHAPE_SETTINGS,
|
|
1287
|
+
Qr as DEFAULT_SCREEN_TEXT_SCENE_SETTINGS,
|
|
1288
|
+
Jr as DEFAULT_SCREEN_TEXT_SHADOW_LAYER,
|
|
1289
|
+
Hs as DEFAULT_SCREEN_TRANSFORM_2D,
|
|
1290
|
+
zs as DEFAULT_SCREEN_TRANSFORM_ROOT,
|
|
1291
|
+
xe as DEFAULT_TRACKING_CONFIG,
|
|
1292
|
+
ba as DEFAULT_TRANSFORM_3D,
|
|
1293
|
+
Aa as EXTERNAL_BACKGROUND_RENDER_LAYER,
|
|
1294
|
+
ct as FULL_SCREEN_ANCHORS,
|
|
1295
|
+
pa as LightObject,
|
|
1296
|
+
fa as LookAt,
|
|
1297
|
+
Fa as MAX_RENDER_GROUP_PASSES,
|
|
1298
|
+
Ca as MaterialFill,
|
|
1299
|
+
Ga as MeshMaterial,
|
|
1300
|
+
Ia as MeshRenderer,
|
|
1301
|
+
ds as Panel,
|
|
1302
|
+
ps as PersonCutout,
|
|
1303
|
+
ea as PinToMesh,
|
|
1304
|
+
ha as RenderGroupLayer,
|
|
1305
|
+
ga as SCREEN_IMAGE_MASK_CHANNELS,
|
|
1306
|
+
Sa as SceneObjectRenderer,
|
|
1307
|
+
ta as ScreenGlassMaterial,
|
|
1308
|
+
va as ScreenGradientMaterial,
|
|
1309
|
+
lt as ScreenImage,
|
|
1310
|
+
sa as ScreenShape,
|
|
1311
|
+
Hr as ScreenSpaceUI,
|
|
1312
|
+
ya as ScreenText,
|
|
1313
|
+
Ke as ScreenTransform,
|
|
1314
|
+
Ma as SequentialRenderPasses,
|
|
1315
|
+
gs as SpriteAnimation,
|
|
1316
|
+
Ls as TRACKER_KINDS,
|
|
1317
|
+
ne as TRACKING_CONFIG_STORAGE_KEY,
|
|
1318
|
+
ae as TRACKING_CONFIG_VERSION,
|
|
1319
|
+
zr as TextLabel,
|
|
1320
|
+
ka as Transform3D,
|
|
1321
|
+
ms as VideoBackground,
|
|
1322
|
+
Xa as XRAssetCache,
|
|
1323
|
+
Ds as XRAssetCacheProvider,
|
|
1324
|
+
$s as XRMediaSource,
|
|
1325
|
+
v as XRModel,
|
|
1326
|
+
js as XRProvider,
|
|
1327
|
+
Vs as XRQualityController,
|
|
1328
|
+
Kr as XRScene,
|
|
1329
|
+
Zs as XR_FALLBACK_MESSAGES,
|
|
1330
|
+
Ys as XR_MODEL_ASSET_URLS,
|
|
1331
|
+
D as audio,
|
|
1332
|
+
Be as canPromptForCamera,
|
|
1333
|
+
$t as clearTrackingConfig,
|
|
1334
|
+
Qs as clientToScreenPixels,
|
|
1335
|
+
ut as computeContainScale,
|
|
1336
|
+
Js as computeFeedCrop,
|
|
1337
|
+
er as computeFitLayout,
|
|
1338
|
+
Ha as createAssetCache,
|
|
1339
|
+
tr as createFallbackReason,
|
|
1340
|
+
_a as createTwoStopGradient,
|
|
1341
|
+
Ms as dataURLtoFile,
|
|
1342
|
+
ja as defineGltfAsset,
|
|
1343
|
+
Va as defineTextureAsset,
|
|
1344
|
+
Za as defineVideoAsset,
|
|
1345
|
+
sr as detectXRCapabilities,
|
|
1346
|
+
Ya as disposeObject3D,
|
|
1347
|
+
la as drawNormalizedCrop,
|
|
1348
|
+
Ht as enabledModels,
|
|
1349
|
+
Qa as estimateGeometryBytes,
|
|
1350
|
+
Ja as estimateObjectBytes,
|
|
1351
|
+
en as estimateTextureBytes,
|
|
1352
|
+
rr as feedSidedName,
|
|
1353
|
+
ar as feedToScreenPixels,
|
|
1354
|
+
nr as feedToSource,
|
|
1355
|
+
ir as feedToTracker,
|
|
1356
|
+
or as feedToViewport,
|
|
1357
|
+
cr as feedToWorld,
|
|
1358
|
+
Ps as findCameraByFacing,
|
|
1359
|
+
Ce as getDefaultAssetCache,
|
|
1360
|
+
xa as getRenderGroupLayer,
|
|
1361
|
+
lr as isFeedPointInSource,
|
|
1362
|
+
ur as isMirroredSourceKind,
|
|
1363
|
+
ks as isMuted,
|
|
1364
|
+
Us as listCameras,
|
|
1365
|
+
zt as loadTrackingConfig,
|
|
1366
|
+
ra as mapScreenImageSettingsToProps,
|
|
1367
|
+
aa as mapScreenTextInnerShadowToProps,
|
|
1368
|
+
na as mapScreenTextSettingsToProps,
|
|
1369
|
+
dr as mediaToScreenPixels,
|
|
1370
|
+
ia as mergeScreenShapeSettings,
|
|
1371
|
+
mr as mergeScreenTransform2D,
|
|
1372
|
+
be as mergeTrackingConfig,
|
|
1373
|
+
pr as mirrorFeedX,
|
|
1374
|
+
La as normalizeMeshRendererRenderState,
|
|
1375
|
+
oa as normalizeScreenGlass,
|
|
1376
|
+
wa as normalizeScreenGradient,
|
|
1377
|
+
fr as normalizedToScreenPixels,
|
|
1378
|
+
_s as onMuteChange,
|
|
1379
|
+
hr as orientSourcePoint,
|
|
1380
|
+
gr as orientedSize,
|
|
1381
|
+
Sr as otherSide,
|
|
1382
|
+
Ue as parseTrackingConfig,
|
|
1383
|
+
yr as personLeftSign,
|
|
1384
|
+
Mr as personSide,
|
|
1385
|
+
Fs as playOneShot,
|
|
1386
|
+
Es as prefetchMusic,
|
|
1387
|
+
Oe as queryCameraPermission,
|
|
1388
|
+
Rs as registerSound,
|
|
1389
|
+
Ua as renderSequentialPasses,
|
|
1390
|
+
Ge as requestCameraAccess,
|
|
1391
|
+
Tr as resolveModelAssetUrl,
|
|
1392
|
+
ua as resolveNormalizedCrop,
|
|
1393
|
+
da as resolvePersonCutoutStatus,
|
|
1394
|
+
Er as resolveQualityConfig,
|
|
1395
|
+
Rr as resolveScreenTransform2D,
|
|
1396
|
+
br as resolveTrackerSupport,
|
|
1397
|
+
W as resolveTrackingConfig,
|
|
1398
|
+
Ae as saveTrackingConfig,
|
|
1399
|
+
Ar as screenPixelsToClient,
|
|
1400
|
+
Fr as screenPixelsToFeed,
|
|
1401
|
+
Cr as screenPixelsToMedia,
|
|
1402
|
+
vr as screenPixelsToNormalized,
|
|
1403
|
+
kr as screenPixelsToScreenSpace,
|
|
1404
|
+
_r as screenPixelsToUnits,
|
|
1405
|
+
xr as screenPointToRay,
|
|
1406
|
+
wr as screenSpaceToScreenPixels,
|
|
1407
|
+
Ur as screenUnitsToPixels,
|
|
1408
|
+
we as serializeTrackingConfig,
|
|
1409
|
+
Cs as setMuted,
|
|
1410
|
+
ot as shouldDrawFallback,
|
|
1411
|
+
V as smoothNumber,
|
|
1412
|
+
ls as smoothVector2,
|
|
1413
|
+
us as smoothVector3,
|
|
1414
|
+
Pr as sourceToFeed,
|
|
1415
|
+
bs as startMusic,
|
|
1416
|
+
As as stopMusic,
|
|
1417
|
+
qe as subscribeCameraPermission,
|
|
1418
|
+
Dr as swapSidedName,
|
|
1419
|
+
Wt as toCameraRequest,
|
|
1420
|
+
Xt as toModelOptions,
|
|
1421
|
+
Bt as toProviderProps,
|
|
1422
|
+
Kt as toTrackerProps,
|
|
1423
|
+
vs as toggleMuted,
|
|
1424
|
+
Nr as trackerPointToScreenPixels,
|
|
1425
|
+
Ir as trackerToFeed,
|
|
1426
|
+
Lr as trackerToWorld,
|
|
1427
|
+
Pt as useCameraPermission,
|
|
1428
|
+
ys as useFrameCapture,
|
|
1429
|
+
Ss as useMediaRecorder,
|
|
1430
|
+
xs as useMuted,
|
|
1431
|
+
it as usePersonMaskTexture,
|
|
1432
|
+
mt as useScreenRectAspect,
|
|
1433
|
+
Ns as useXRAsset,
|
|
1434
|
+
_e as useXRAssetCache,
|
|
1435
|
+
Is as useXRAssetStats,
|
|
1436
|
+
Ba as useXRCapabilities,
|
|
1437
|
+
za as useXRQuality,
|
|
1438
|
+
Os as useXRTrackingConfig,
|
|
1439
|
+
Or as viewportToFeed,
|
|
1440
|
+
Gr as worldToFeed,
|
|
1441
|
+
qr as worldToScreenPixels,
|
|
1442
|
+
Br as worldToTracker
|
|
612
1443
|
};
|