@vincentt-xr/sdk 2.0.0-alpha.2 → 2.0.0-alpha.21
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 +6798 -84
- package/README.md +86 -52
- package/components.json +223 -0
- package/dist/CanonicalHeadFrame-CQe2YX9a.js +1506 -0
- package/dist/CanonicalHeadFrame-CZFvPzN_.cjs +1 -0
- package/dist/DebuggerUI-CKYrYmod.js +275 -0
- package/dist/DebuggerUI-Db-1VtQJ.cjs +1 -0
- package/dist/FaceRetouch-DHhn1nSV.cjs +134 -0
- package/dist/FaceRetouch-l7y4oZBu.js +1071 -0
- package/dist/FaceSurface-CHAMEeG1.cjs +1 -0
- package/dist/FaceSurface-DmP9AEeC.js +27 -0
- package/dist/Scenes--qAbN6iP.cjs +1 -0
- package/dist/Scenes-icIQpHtV.js +58 -0
- package/dist/SkeletonUtils-C2r90MtN.js +21 -0
- package/dist/SkeletonUtils-CddIup1F.cjs +1 -0
- package/dist/TextLabel-C-AibH5A.cjs +2 -0
- package/dist/TextLabel-fEF1o3wE.js +963 -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/AudioPlayer.d.ts +4 -1
- 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-BOdSJUEM.js +207 -0
- package/dist/bodyMaskMaterial-Q6rYywwW.cjs +68 -0
- package/dist/cache-DFqZYsHC.cjs +1 -0
- package/dist/cache-Mu-VO_6E.js +212 -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/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/Button/index.d.ts +27 -0
- package/dist/components/Button/safeLink.d.ts +6 -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 +11 -3
- package/dist/components/FaceMesh/canonical/CanonicalFaceMeshRenderer.d.ts +51 -3
- package/dist/components/FaceMesh/canonical/geometryGroups.d.ts +22 -1
- package/dist/components/FaceMesh/canonical/parseCanonicalFaceModel.d.ts +22 -0
- package/dist/components/FaceMesh/canonical/shaders.d.ts +1 -1
- package/dist/components/FaceMesh/index.d.ts +3 -3
- package/dist/components/FaceRetouch/Background.d.ts +3 -1
- package/dist/components/FaceRetouch/FaceRetouch.d.ts +5 -0
- package/dist/components/FaceRetouch/renderState.d.ts +19 -0
- 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/FaceWarp3D/FaceWarp3D.d.ts +50 -0
- package/dist/components/FaceWarp3D/index.d.ts +2 -3
- 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/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 +10 -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/HtmlRegion/index.d.ts +8 -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/Light/index.d.ts +26 -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/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 +8 -1
- package/dist/components/Model/index.d.ts +16 -0
- package/dist/components/Necklace/Necklace.d.ts +44 -0
- package/dist/components/Necklace/index.d.ts +1 -0
- package/dist/components/Object3D/index.d.ts +13 -0
- package/dist/components/PaintedFace/index.d.ts +24 -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/SceneObjectRenderer/index.d.ts +9 -2
- package/dist/components/ScreenImage/ScreenImage.d.ts +4 -1
- package/dist/components/ScreenImage/components/ImageLoadFallback.d.ts +24 -0
- package/dist/components/ScreenImage/components/ScreenImageBody.d.ts +2 -1
- package/dist/components/ScreenImage/index.d.ts +3 -1
- package/dist/components/ScreenImage/liveEditable.d.ts +12 -0
- package/dist/components/ScreenImage/materials/ScreenImageBlendMaterial.d.ts +1 -1
- package/dist/components/ScreenImage/materials/ScreenImageMaskMaterial.d.ts +11 -0
- package/dist/components/ScreenImage/source.d.ts +9 -0
- package/dist/components/ScreenImage/types.d.ts +48 -3
- package/dist/components/ScreenShape/index.d.ts +4 -1
- package/dist/components/ScreenShape/types.d.ts +13 -0
- package/dist/components/ScreenSpaceUI/index.d.ts +1 -0
- package/dist/components/ScreenText/index.d.ts +4 -1
- package/dist/components/ScreenText/liveEditable.d.ts +6 -0
- package/dist/components/ScreenText/types.d.ts +2 -1
- 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/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 +1 -1
- package/dist/components/TextLabel/types.d.ts +150 -37
- package/dist/components/ThemeProvider/index.d.ts +24 -0
- package/dist/components/XRMediaSurface/index.d.ts +2 -1
- package/dist/components/XRProvider/index.d.ts +16 -2
- package/dist/components/XRScene/renderOutputTarget.d.ts +12 -0
- package/dist/components/XRViewport/hooks/useViewportExternalFaces.d.ts +1 -1
- package/dist/components/XRViewport/hooks/useViewportMediaSource.d.ts +1 -1
- package/dist/components/XRViewport/hooks/useViewportPipeline.d.ts +1 -1
- package/dist/components/index.d.ts +18 -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-CSz9stBV.cjs +1 -0
- package/dist/contexts-Cl-4dUOI.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 +32 -0
- package/dist/coordinates/world.d.ts +15 -0
- package/dist/debug-ui/default-setting.cjs +2 -2
- 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/hierarchy-panel/index.d.ts +3 -2
- package/dist/debug-ui/holistic-tracker-settings/index.d.ts +16 -0
- package/dist/debug-ui/index.d.ts +19 -4
- package/dist/debug-ui/iris-effect-settings/index.d.ts +12 -0
- package/dist/debug-ui/lip-effect-settings/index.d.ts +15 -0
- package/dist/debug-ui/media-source/index.d.ts +3 -3
- package/dist/debug-ui/media-source/media-preset.d.ts +12 -0
- package/dist/debug-ui/media-source/session.d.ts +30 -2
- package/dist/debug-ui/media-source.cjs +1 -1
- package/dist/debug-ui/media-source.js +7 -5
- package/dist/debug-ui/object-inspector-panel/index.d.ts +3 -2
- package/dist/debug-ui/product-hotspots/index.d.ts +25 -0
- package/dist/debug-ui/scene-editor/hierarchy-panel.d.ts +3 -1
- package/dist/debug-ui/scene-editor/inspector-panel.d.ts +3 -1
- package/dist/debug-ui/screen-image-settings/index.d.ts +3 -1
- package/dist/debug-ui/screen-text-settings/ScreenTextSettingsPanel.d.ts +1 -1
- package/dist/debug-ui/screen-text-settings/types.d.ts +2 -0
- package/dist/debug-ui/segmentation-overlay-settings/index.d.ts +12 -0
- package/dist/debug-ui/settings-panel/index.d.ts +6 -1
- package/dist/debug-ui/shared/debugWindow.d.ts +51 -0
- package/dist/debug-ui/xr-diagnostics/index.d.ts +26 -0
- package/dist/debug-ui.cjs +3 -3
- package/dist/debug-ui.js +2721 -2531
- package/dist/detector-K8aej4MB.js +59 -0
- package/dist/detector-ijypGtse.cjs +1 -0
- package/dist/drawNormalizedCrop-D606u5-F.js +135 -0
- package/dist/drawNormalizedCrop-DaGT5mZ5.cjs +1 -0
- package/dist/editor-defs/definitions.d.ts +2 -0
- package/dist/editor-defs/index.d.ts +3 -0
- package/dist/editor-defs/types.d.ts +57 -0
- package/dist/editor-sample/sample.d.ts +15 -0
- package/dist/editor-scenes.cjs +1 -0
- package/dist/editor-scenes.js +59 -0
- package/dist/entries/all.d.ts +3 -1
- package/dist/entries/core.d.ts +38 -4
- package/dist/entries/editor-scenes.d.ts +8 -0
- package/dist/entries/face-effects.d.ts +125 -7
- package/dist/entries/instructions.d.ts +48 -0
- package/dist/entries/internal.d.ts +4 -1
- package/dist/entries/low-level.d.ts +83 -2
- package/dist/entries/particles.d.ts +15 -0
- package/dist/entries/product.d.ts +11 -0
- package/dist/entries/tracking.d.ts +87 -2
- 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-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 +2324 -1
- package/dist/face-effects.js +14244 -2170
- package/dist/face-expression/index.d.ts +182 -0
- package/dist/face-info/landmarks.d.ts +17 -3
- package/dist/face-info/types.d.ts +20 -3
- package/dist/footage-input/index.d.ts +46 -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-BbcKq8PJ.cjs +1 -0
- package/dist/getFaceInfo-Mt44zlej.js +62 -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/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/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/selectors.d.ts +77 -4
- package/dist/hooks/useBodies.d.ts +39 -0
- package/dist/hooks/useCalibrationFaceTracker.d.ts +1 -1
- package/dist/hooks/useFaceInfo.d.ts +13 -1
- package/dist/hooks/useFaceInfos.d.ts +1 -1
- package/dist/hooks/useFaceModelAcquisition.d.ts +38 -0
- package/dist/hooks/useGesture.d.ts +39 -0
- package/dist/hooks/useIrisTracking.d.ts +45 -0
- package/dist/hooks/useTrackerContext.d.ts +12 -0
- package/dist/hooks/useXRDiagnostics.d.ts +81 -0
- package/dist/hooks/useXRModel.d.ts +12 -0
- package/dist/hooks/useXRSession/facade.d.ts +44 -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 +14 -0
- package/dist/hooks/useXRSession/store.d.ts +64 -7
- package/dist/index-B0EYdofX.js +442 -0
- package/dist/index-BDxJWWyy.js +3814 -0
- package/dist/index-BkjRuUdW.cjs +21 -0
- package/dist/index-Bn72laBn.js +188 -0
- package/dist/index-CM3jkleV.js +1204 -0
- package/dist/index-CbBCl2ZU.js +190 -0
- package/dist/index-CelqbDSR.cjs +1 -0
- package/dist/index-CicO_Tnw.js +240 -0
- package/dist/index-D5NbXaCn.js +1438 -0
- package/dist/index-DIYaENN3.cjs +1 -0
- package/dist/index-DzdKBXGE.cjs +1 -0
- package/dist/index-J3Qy6hi3.cjs +1 -0
- package/dist/index-LC2Xs08E.cjs +1 -0
- package/dist/index-fDwL47CM.cjs +46 -0
- package/dist/instructions.cjs +30 -0
- package/dist/instructions.js +1528 -0
- package/dist/{internal-DuMPpcbp.js → internal-BoFDq5hC.js} +138 -119
- package/dist/internal-DS8Pdlsm.cjs +1 -0
- 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-BP6RbRHN.cjs +1 -0
- package/dist/landmarks-C3LvDhMt.js +76 -0
- package/dist/low-level.cjs +1 -1
- package/dist/low-level.js +1295 -757
- package/dist/main.cjs +1 -1
- package/dist/main.js +1479 -499
- 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 +4 -12
- package/dist/models/Face/rotation.d.ts +18 -3
- package/dist/models/Hand/GestureTracking.d.ts +1 -1
- package/dist/models/Hand/HandTracking.d.ts +17 -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-BRSbw214.cjs +62 -0
- package/dist/providers-Bxt_MfPK.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/renderPasses.d.ts +8 -0
- package/dist/render/sceneBeforeRender.d.ts +12 -0
- package/dist/{renderGroups-Dvm1J4lW.cjs → renderGroups-B0N58SIA.cjs} +1 -1
- package/dist/{renderGroups-C9QJrAXu.js → renderGroups-uYPzUa66.js} +1 -1
- package/dist/renderPasses-Bt8k0dkm.cjs +158 -0
- package/dist/renderPasses-C0wu5Cwg.js +1290 -0
- package/dist/renderState-CJNmj5jz.js +39 -0
- package/dist/renderState-apSfg4eR.cjs +1 -0
- package/dist/scene-object.cjs +1 -1
- package/dist/scene-object.js +2 -2
- package/dist/scenes/Scenes.d.ts +47 -0
- package/dist/scenes/edit.d.ts +37 -0
- package/dist/scenes/navigate.d.ts +5 -0
- package/dist/screen2d/coordinates.d.ts +57 -0
- package/dist/screen2d/screenTransform.d.ts +13 -0
- package/dist/segmentation-Cz7oeNcS.cjs +1 -0
- package/dist/segmentation-DccvYBBO.js +1911 -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-Bq6tSgOY.cjs +1 -0
- package/dist/selectors-J06V0eDb.js +196 -0
- package/dist/session-3aCMNb8W.cjs +31 -0
- package/dist/session-CYiWfcvz.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 +2 -0
- package/dist/texture/gifReader.d.ts +17 -0
- package/dist/texture/gifTextureSource.d.ts +16 -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 +1439 -486
- package/dist/trigger-CQviD4xp.js +3726 -0
- package/dist/trigger-UjeJY5uh.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 +20 -1
- package/dist/types/gesture-tracking.d.ts +2 -2
- package/dist/types/hand-tracking.d.ts +12 -3
- package/dist/types/holistic.d.ts +121 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/model.d.ts +22 -2
- package/dist/types/nodes.d.ts +79 -5
- package/dist/types/segmentation.d.ts +26 -0
- package/dist/types/session.d.ts +48 -4
- package/dist/useBodies-CXomEo0i.cjs +1 -0
- package/dist/useBodies-DOuwRuew.js +75 -0
- package/dist/useEditOverrides-BBkK8cN2.js +41 -0
- package/dist/useEditOverrides-CgapHJzA.cjs +1 -0
- package/dist/useFaceInfo-BEMMiZxw.cjs +1 -0
- package/dist/useFaceInfo-XUGYTdfN.js +75 -0
- package/dist/useFaceResultReader-D8wXbF1L.js +61 -0
- package/dist/useFaceResultReader-D9qibKmm.cjs +1 -0
- package/dist/useInstructionHold-DOu-RpCM.js +53 -0
- package/dist/useInstructionHold-DwJY1Alr.cjs +1 -0
- package/dist/useIrisTracking-B0uLWgNE.js +6190 -0
- package/dist/useIrisTracking-DExhnhlt.cjs +35 -0
- package/dist/useLandmarkPoseFit-Bg-h9BPb.cjs +1 -0
- package/dist/useLandmarkPoseFit-Bmb3h6Mw.js +87 -0
- package/dist/useXRCapabilities-D-EhcDzM.cjs +1 -0
- package/dist/useXRCapabilities-DPUOvpdf.js +30 -0
- package/dist/utils/canonicalRigidLandmarks.d.ts +8 -0
- package/dist/utils/fns.d.ts +6 -3
- package/dist/utils/headOccluderFit.d.ts +42 -0
- package/dist/utils/integrity.d.ts +21 -1
- 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/useEditOverrides.d.ts +34 -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-BgQAX8rs.js → uv-DJU_XfmN.js} +15 -244
- package/docs/SDK_DOCUMENTATION.md +4 -2
- package/docs/api/adaptive-quality.mdx +104 -0
- package/docs/api/asset-lifecycle.mdx +78 -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 +9 -1
- package/docs/api/coordinate-spaces.mdx +168 -0
- package/docs/api/cross-camera.mdx +89 -0
- package/docs/api/debug-ui-scene-editor.mdx +23 -2
- package/docs/api/diagnostics-calibration.mdx +97 -0
- package/docs/api/external-face-mesh.mdx +231 -0
- package/docs/api/face-actions.mdx +20 -16
- package/docs/api/face-attribute-expression.mdx +1 -1
- package/docs/api/face-binding-anchors.mdx +4 -2
- package/docs/api/face-character.mdx +157 -0
- package/docs/api/face-effects.mdx +9 -0
- package/docs/api/face-expression-controller.mdx +153 -0
- package/docs/api/face-info.mdx +18 -12
- 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 +39 -7
- package/docs/api/face-morph.mdx +117 -0
- package/docs/api/face-painting.mdx +7 -0
- package/docs/api/face-reprojection.mdx +154 -0
- package/docs/api/face-retouching.mdx +18 -10
- 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/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 +5 -0
- package/docs/api/screen-image.mdx +29 -3
- package/docs/api/screen-space-coordinates.mdx +43 -1
- package/docs/api/segmentation-overlay.mdx +301 -0
- package/docs/api/session-lifecycle.mdx +165 -0
- package/docs/api/texture-sources.mdx +25 -6
- package/docs/api/trackers.mdx +20 -1
- package/docs/api/tracking-config.mdx +108 -0
- package/docs/docs.json +52 -1
- package/docs/examples/lip-shaders.mdx +273 -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 +4 -4
- 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/introduction.mdx +1 -2
- package/docs/texture-api-consumer.md +26 -0
- package/package.json +44 -5
- package/settings.json +2152 -0
- package/dist/DebuggerUI-B45_Gb9d.cjs +0 -1
- package/dist/DebuggerUI-Cq28c18s.js +0 -269
- package/dist/FaceMeshRenderer-6t8OsQhK.js +0 -1195
- package/dist/FaceMeshRenderer-lQLhYIW-.cjs +0 -155
- package/dist/FaceRetouch-CDrL0pXg.js +0 -551
- package/dist/FaceRetouch-DtNl8-4e.cjs +0 -134
- package/dist/components/FaceWarp3D/FaceWarp3DHead.d.ts +0 -15
- package/dist/components/FaceWarp3D/defaults.d.ts +0 -37
- package/dist/components/FaceWarp3D/warp.d.ts +0 -13
- package/dist/contexts-BKvTIayr.cjs +0 -1
- package/dist/contexts-Bk5zz_VR.js +0 -214
- package/dist/debug-ui/face-warp-3d/index.d.ts +0 -6
- package/dist/drawNormalizedCrop-B-7zU-Xw.cjs +0 -1
- package/dist/drawNormalizedCrop-CRdIDyl1.js +0 -44
- package/dist/getFaceInfo-CyPAKh3h.cjs +0 -1
- package/dist/getFaceInfo-hUKMLFcr.js +0 -118
- package/dist/index-82aENaRq.cjs +0 -1
- package/dist/index-CEc1CAmB.cjs +0 -1
- package/dist/index-CTHeBQOs.js +0 -178
- package/dist/index-D4bLzBr6.cjs +0 -1
- package/dist/index-DSpzjuqd.cjs +0 -1
- package/dist/index-Di70KWuY.js +0 -2049
- package/dist/index-DzEzkBIH.cjs +0 -17
- package/dist/index-JygePOwo.js +0 -1398
- package/dist/index-UC0Ux38E.js +0 -111
- package/dist/internal-i2JkM85N.cjs +0 -1
- package/dist/renderLayers-lDtL0_43.cjs +0 -1
- package/dist/renderLayers-zrK2pv5O.js +0 -13
- package/dist/renderPasses-CT5iBwtg.cjs +0 -21
- package/dist/renderPasses-CjgG_6kQ.js +0 -1500
- package/dist/selectors-2QvO5RYY.cjs +0 -1
- package/dist/selectors-Dw3C-gSk.js +0 -59
- package/dist/session-BChR4TgK.cjs +0 -31
- package/dist/session-C1StwN0f.js +0 -363
- package/dist/useFaceInfo-C-WfMlYp.cjs +0 -1
- package/dist/useFaceInfo-CwsHZedC.js +0 -62
- package/dist/useFaceResults-CkFc1egZ.js +0 -19
- package/dist/useFaceResults-VcFdOUFV.cjs +0 -1
package/dist/main.js
CHANGED
|
@@ -1,204 +1,257 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import {
|
|
5
|
-
import { c as
|
|
6
|
-
import { S as
|
|
7
|
-
import { X as
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
1
|
+
var Be = Object.defineProperty;
|
|
2
|
+
var $e = (e, t, r) => t in e ? Be(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
|
|
3
|
+
var D = (e, t, r) => $e(e, typeof t != "symbol" ? t + "" : t, r);
|
|
4
|
+
import { j as _, J as Xe, u as He, as as Ke, at as je, au as Ve, av as Ze, aw as Ye, ax as Je } from "./index-BDxJWWyy.js";
|
|
5
|
+
import { b8 as bs, az as As, b9 as Rs, M as Fs, P as xs, L as Cs, w as _s, ay as ks, ba as vs, b5 as ws, b6 as Ds, aA as Us, c as Ns, z as Ps, y as Ls, d as Is, k as Os, aR as Gs, aS as zs, aT as qs, aU as Ws, n as Bs, aV as $s, i as Xs, aB as Hs, O as Ks, aW as js, aC as Vs, aD as Zs, aX as Ys, aY as Js, b3 as Qs, p as ea, A as ta, b7 as ra, r as sa, K as aa, a3 as na, aI as oa, aZ as ia, aJ as ca, aK as la, aL as ua, aH as da, aM as ma, aN as fa, aE as pa, aO as ha, a_ as ga, b4 as ya, aP as Sa, a$ as Ta, t as Ma, aF as Ea, aG as ba, b0 as Aa, b1 as Ra, aQ as Fa, b2 as xa } from "./index-BDxJWWyy.js";
|
|
6
|
+
import { S as Qe } from "./contexts-Cl-4dUOI.js";
|
|
7
|
+
import { X as _a } from "./contexts-Cl-4dUOI.js";
|
|
8
|
+
import { S as va, T as wa } from "./TextLabel-fEF1o3wE.js";
|
|
9
|
+
import { jsxs as z, jsx as y, Fragment as ne } from "react/jsx-runtime";
|
|
10
|
+
import { useRef as R, useMemo as W, useEffect as x, useState as k, Suspense as et, useCallback as F, forwardRef as tt, useImperativeHandle as rt, useContext as st, createContext as at, useId as nt, useSyncExternalStore as ot } from "react";
|
|
11
|
+
import * as de from "three";
|
|
12
|
+
import { MathUtils as it, Vector2 as ct, Vector3 as lt, DoubleSide as se, RepeatWrapping as Ee, LinearFilter as be } from "three";
|
|
13
|
+
import { D as Ua, H as Na, G as Pa, E as La, J as Ia, K as Oa, P as Ga, S as za, C as qa, I as Wa, L as Ba, M as $a, F as Xa, B as Ha } from "./index-D5NbXaCn.js";
|
|
14
|
+
import { useThree as ut, useFrame as Ue } from "@react-three/fiber";
|
|
15
|
+
import { R as dt } from "./uv-DJU_XfmN.js";
|
|
16
|
+
import { c as Ne, b as mt } from "./selectors-J06V0eDb.js";
|
|
17
|
+
import { u as ft, a as pt, s as ht, F as gt } from "./drawNormalizedCrop-D606u5-F.js";
|
|
18
|
+
import { d as ja, b as Va, r as Za } from "./drawNormalizedCrop-D606u5-F.js";
|
|
19
|
+
import { S as yt, c as St, D as O, L as Tt } from "./index-CM3jkleV.js";
|
|
20
|
+
import { d as Ja, R as Qa, a as en, e as tn, b as rn, f as sn } from "./index-CM3jkleV.js";
|
|
21
|
+
import { g as Mt } from "./Scenes-icIQpHtV.js";
|
|
22
|
+
import { a as nn, b as on, u as cn } from "./Scenes-icIQpHtV.js";
|
|
23
|
+
import { useTexture as Et } from "@react-three/drei";
|
|
24
|
+
import { a as bt } from "./context-DTxSQvp4.js";
|
|
25
|
+
import { j as V, T as At } from "./renderPasses-C0wu5Cwg.js";
|
|
26
|
+
import { k as un, D as dn, E as mn, M as fn, h as pn, S as hn, l as gn, g as yn, n as Sn, r as Tn } from "./renderPasses-C0wu5Cwg.js";
|
|
27
|
+
import { D as Ae, M as Rt } from "./index-Bn72laBn.js";
|
|
28
|
+
import { c as En, n as bn } from "./index-Bn72laBn.js";
|
|
29
|
+
import { M as Rn } from "./index-CbBCl2ZU.js";
|
|
30
|
+
import { u as xn } from "./useXRCapabilities-DPUOvpdf.js";
|
|
31
|
+
import { g as Pe } from "./cache-Mu-VO_6E.js";
|
|
32
|
+
import { D as _n, X as kn, c as vn, u as wn } from "./cache-Mu-VO_6E.js";
|
|
33
|
+
import { a as Ft } from "./segmentation-DccvYBBO.js";
|
|
34
|
+
import { d as Un, b as Nn, e as Pn, f as Ln, g as In, h as On, i as Gn } from "./segmentation-DccvYBBO.js";
|
|
35
|
+
const ee = (e, t, r, s) => it.damp(e, t, Math.max(0, r), Math.max(0, s)), Or = (e, t, r, s, a = new ct()) => a.set(
|
|
36
|
+
ee(e.x, t.x, r, s),
|
|
37
|
+
ee(e.y, t.y, r, s)
|
|
38
|
+
), Gr = (e, t, r, s, a = new lt()) => a.set(
|
|
39
|
+
ee(e.x, t.x, r, s),
|
|
40
|
+
ee(e.y, t.y, r, s),
|
|
41
|
+
ee(e.z, t.z, r, s)
|
|
42
|
+
), xt = "rgba(20,40,110,0.88)", Ct = 24, _t = 512;
|
|
43
|
+
function zr({
|
|
44
|
+
color: e = xt,
|
|
45
|
+
borderColor: t,
|
|
46
|
+
borderWidth: r = 0,
|
|
47
|
+
borderRadius: s = Ct,
|
|
48
|
+
resolution: a = _t,
|
|
49
|
+
aspect: n = 1,
|
|
50
|
+
opacity: i = 1,
|
|
40
51
|
name: c,
|
|
41
|
-
overlay:
|
|
42
|
-
position:
|
|
43
|
-
rotation:
|
|
44
|
-
scale:
|
|
45
|
-
visible:
|
|
52
|
+
overlay: o = !0,
|
|
53
|
+
position: l,
|
|
54
|
+
rotation: p,
|
|
55
|
+
scale: m,
|
|
56
|
+
visible: f
|
|
46
57
|
}) {
|
|
47
|
-
const
|
|
48
|
-
width: Math.round(a * Math.max(
|
|
58
|
+
const u = R(null), d = R(null), g = W(() => kt({
|
|
59
|
+
width: Math.round(a * Math.max(n, 0.05)),
|
|
49
60
|
height: Math.round(a),
|
|
50
|
-
color:
|
|
51
|
-
borderColor:
|
|
52
|
-
borderWidth:
|
|
53
|
-
borderRadius:
|
|
54
|
-
}), [t,
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
}, [
|
|
58
|
-
const
|
|
59
|
-
return
|
|
60
|
-
const
|
|
61
|
-
if (
|
|
62
|
-
return
|
|
63
|
-
|
|
61
|
+
color: e,
|
|
62
|
+
borderColor: t,
|
|
63
|
+
borderWidth: r,
|
|
64
|
+
borderRadius: s
|
|
65
|
+
}), [e, t, r, s, a, n]);
|
|
66
|
+
x(() => () => {
|
|
67
|
+
g.dispose();
|
|
68
|
+
}, [g]);
|
|
69
|
+
const M = R(null), h = R(i);
|
|
70
|
+
return h.current !== i && (h.current = i, M.current = null, d.current && (d.current.opacity = i)), x(() => {
|
|
71
|
+
const S = u.current;
|
|
72
|
+
if (S)
|
|
73
|
+
return S.userData.setOpacity = (b) => {
|
|
74
|
+
M.current = b, d.current && (d.current.opacity = b);
|
|
64
75
|
}, () => {
|
|
65
|
-
delete
|
|
76
|
+
delete S.userData.setOpacity;
|
|
66
77
|
};
|
|
67
|
-
}, []), /* @__PURE__ */
|
|
78
|
+
}, []), /* @__PURE__ */ z(
|
|
68
79
|
"mesh",
|
|
69
80
|
{
|
|
70
|
-
ref:
|
|
81
|
+
ref: u,
|
|
71
82
|
name: c,
|
|
72
|
-
position:
|
|
73
|
-
rotation:
|
|
74
|
-
scale:
|
|
75
|
-
visible:
|
|
83
|
+
position: l,
|
|
84
|
+
rotation: p,
|
|
85
|
+
scale: m,
|
|
86
|
+
visible: f,
|
|
76
87
|
children: [
|
|
77
|
-
/* @__PURE__ */
|
|
78
|
-
/* @__PURE__ */
|
|
88
|
+
/* @__PURE__ */ y("planeGeometry", { args: [1, 1] }),
|
|
89
|
+
/* @__PURE__ */ y(
|
|
79
90
|
"meshBasicMaterial",
|
|
80
91
|
{
|
|
81
|
-
ref:
|
|
82
|
-
map:
|
|
92
|
+
ref: d,
|
|
93
|
+
map: g,
|
|
83
94
|
transparent: !0,
|
|
84
|
-
opacity:
|
|
85
|
-
depthTest: !
|
|
86
|
-
depthWrite: !
|
|
95
|
+
opacity: i,
|
|
96
|
+
depthTest: !o,
|
|
97
|
+
depthWrite: !o
|
|
87
98
|
}
|
|
88
99
|
)
|
|
89
100
|
]
|
|
90
101
|
}
|
|
91
102
|
);
|
|
92
103
|
}
|
|
93
|
-
function
|
|
94
|
-
const { width:
|
|
95
|
-
const
|
|
96
|
-
return
|
|
97
|
-
})(),
|
|
98
|
-
|
|
99
|
-
const
|
|
100
|
-
|
|
101
|
-
const
|
|
102
|
-
return
|
|
104
|
+
function kt(e) {
|
|
105
|
+
const { width: t, height: r, color: s, borderColor: a, borderWidth: n, borderRadius: i } = e, c = typeof OffscreenCanvas < "u" ? new OffscreenCanvas(t, r) : (() => {
|
|
106
|
+
const m = document.createElement("canvas");
|
|
107
|
+
return m.width = t, m.height = r, m;
|
|
108
|
+
})(), o = c.getContext("2d");
|
|
109
|
+
o.clearRect(0, 0, t, r);
|
|
110
|
+
const l = Math.min(i, Math.min(t, r) / 2);
|
|
111
|
+
o.beginPath(), o.moveTo(l, 0), o.lineTo(t - l, 0), o.quadraticCurveTo(t, 0, t, l), o.lineTo(t, r - l), o.quadraticCurveTo(t, r, t - l, r), o.lineTo(l, r), o.quadraticCurveTo(0, r, 0, r - l), o.lineTo(0, l), o.quadraticCurveTo(0, 0, l, 0), o.closePath(), o.fillStyle = s, o.fill(), a && n > 0 && (o.lineWidth = n, o.strokeStyle = a, o.stroke());
|
|
112
|
+
const p = new de.CanvasTexture(c);
|
|
113
|
+
return p.needsUpdate = !0, p;
|
|
103
114
|
}
|
|
104
|
-
const
|
|
105
|
-
segmentationMask:
|
|
106
|
-
segmentation:
|
|
107
|
-
invert:
|
|
108
|
-
customBackground:
|
|
109
|
-
renderOrder: a =
|
|
115
|
+
const qr = ({
|
|
116
|
+
segmentationMask: e,
|
|
117
|
+
segmentation: t,
|
|
118
|
+
invert: r = !1,
|
|
119
|
+
customBackground: s,
|
|
120
|
+
renderOrder: a = dt.BACKGROUND
|
|
110
121
|
}) => {
|
|
111
|
-
const { camera:
|
|
112
|
-
|
|
113
|
-
if (!
|
|
114
|
-
|
|
122
|
+
const { camera: n, size: i } = ut(), c = Ne(), o = mt(_.BACKGROUND_SEGMENTATION), l = t ? o == null ? void 0 : o.backgroundSegmentationMask : void 0, p = R(!1);
|
|
123
|
+
x(() => {
|
|
124
|
+
if (!t) {
|
|
125
|
+
p.current = !1;
|
|
115
126
|
return;
|
|
116
127
|
}
|
|
117
|
-
|
|
118
|
-
`[VideoBackground] segmentation="${
|
|
119
|
-
),
|
|
120
|
-
}, [
|
|
121
|
-
const
|
|
122
|
-
if (!
|
|
128
|
+
o === null && !p.current && (console.warn(
|
|
129
|
+
`[VideoBackground] segmentation="${t}" set but no matching <Segmentation> component is mounted; rendering unmasked.`
|
|
130
|
+
), p.current = !0);
|
|
131
|
+
}, [t, o]);
|
|
132
|
+
const m = t ? l : e, f = W(() => {
|
|
133
|
+
if (!n.isPerspectiveCamera)
|
|
123
134
|
return [10, 10];
|
|
124
|
-
const
|
|
125
|
-
return [
|
|
126
|
-
}, [
|
|
127
|
-
return c ? /* @__PURE__ */
|
|
128
|
-
/* @__PURE__ */
|
|
129
|
-
/* @__PURE__ */
|
|
130
|
-
/* @__PURE__ */
|
|
135
|
+
const u = n, M = (u.position.z || 5) - -1, h = u.fov * Math.PI / 180, S = 2 * Math.tan(h / 2) * M;
|
|
136
|
+
return [S * (i.width / i.height), S];
|
|
137
|
+
}, [n, i]);
|
|
138
|
+
return c ? /* @__PURE__ */ y("group", { position: [0, 0, -1], children: r ? /* @__PURE__ */ z(ne, { children: [
|
|
139
|
+
/* @__PURE__ */ z("mesh", { position: [0, 0, -0.01], renderOrder: a - 1, children: [
|
|
140
|
+
/* @__PURE__ */ y("planeGeometry", { args: f }),
|
|
141
|
+
/* @__PURE__ */ y(
|
|
131
142
|
"meshBasicMaterial",
|
|
132
143
|
{
|
|
133
144
|
map: c,
|
|
134
145
|
depthTest: !1,
|
|
135
146
|
depthWrite: !1,
|
|
136
147
|
toneMapped: !1,
|
|
137
|
-
side:
|
|
148
|
+
side: se
|
|
138
149
|
}
|
|
139
150
|
)
|
|
140
151
|
] }),
|
|
141
|
-
|
|
142
|
-
/* @__PURE__ */
|
|
143
|
-
/* @__PURE__ */
|
|
152
|
+
s && m && /* @__PURE__ */ z("mesh", { position: [0, 0, 0], renderOrder: a, children: [
|
|
153
|
+
/* @__PURE__ */ y("planeGeometry", { args: f }),
|
|
154
|
+
/* @__PURE__ */ y(
|
|
144
155
|
"meshBasicMaterial",
|
|
145
156
|
{
|
|
146
|
-
map: typeof
|
|
147
|
-
color: typeof
|
|
148
|
-
alphaMap:
|
|
157
|
+
map: typeof s == "string" ? void 0 : s,
|
|
158
|
+
color: typeof s == "string" ? s : void 0,
|
|
159
|
+
alphaMap: m,
|
|
149
160
|
transparent: !1,
|
|
150
161
|
alphaTest: 0.5,
|
|
151
162
|
depthTest: !1,
|
|
152
163
|
depthWrite: !1,
|
|
153
164
|
toneMapped: !1,
|
|
154
|
-
side:
|
|
165
|
+
side: se
|
|
155
166
|
},
|
|
156
167
|
"inverted-mask"
|
|
157
168
|
)
|
|
158
169
|
] })
|
|
159
|
-
] }) : /* @__PURE__ */
|
|
160
|
-
|
|
161
|
-
/* @__PURE__ */
|
|
162
|
-
/* @__PURE__ */
|
|
170
|
+
] }) : /* @__PURE__ */ z(ne, { children: [
|
|
171
|
+
s && m && /* @__PURE__ */ z("mesh", { position: [0, 0, -0.01], renderOrder: a - 1, children: [
|
|
172
|
+
/* @__PURE__ */ y("planeGeometry", { args: f }),
|
|
173
|
+
/* @__PURE__ */ y(
|
|
163
174
|
"meshBasicMaterial",
|
|
164
175
|
{
|
|
165
|
-
map: typeof
|
|
166
|
-
color: typeof
|
|
176
|
+
map: typeof s == "string" ? void 0 : s,
|
|
177
|
+
color: typeof s == "string" ? s : void 0,
|
|
167
178
|
depthTest: !1,
|
|
168
179
|
depthWrite: !1,
|
|
169
180
|
toneMapped: !1,
|
|
170
|
-
side:
|
|
181
|
+
side: se
|
|
171
182
|
}
|
|
172
183
|
)
|
|
173
184
|
] }),
|
|
174
|
-
/* @__PURE__ */
|
|
175
|
-
/* @__PURE__ */
|
|
176
|
-
/* @__PURE__ */
|
|
185
|
+
/* @__PURE__ */ z("mesh", { position: [0, 0, 0], renderOrder: a, children: [
|
|
186
|
+
/* @__PURE__ */ y("planeGeometry", { args: f }),
|
|
187
|
+
/* @__PURE__ */ y(
|
|
177
188
|
"meshBasicMaterial",
|
|
178
189
|
{
|
|
179
190
|
map: c,
|
|
180
|
-
alphaMap:
|
|
191
|
+
alphaMap: m,
|
|
181
192
|
transparent: !1,
|
|
182
|
-
alphaTest:
|
|
193
|
+
alphaTest: m ? 0.5 : void 0,
|
|
183
194
|
depthTest: !1,
|
|
184
195
|
depthWrite: !1,
|
|
185
196
|
toneMapped: !1,
|
|
186
|
-
side:
|
|
197
|
+
side: se
|
|
187
198
|
},
|
|
188
|
-
|
|
199
|
+
m ? "with-mask" : "no-mask"
|
|
189
200
|
)
|
|
190
201
|
] })
|
|
191
202
|
] }) }) : null;
|
|
192
|
-
},
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
203
|
+
}, Le = ({
|
|
204
|
+
mask: e,
|
|
205
|
+
status: t,
|
|
206
|
+
error: r,
|
|
207
|
+
invert: s = !1,
|
|
208
|
+
fallback: a = "camera",
|
|
209
|
+
onStatusChange: n,
|
|
210
|
+
fit: i = "cover",
|
|
211
|
+
anchors: c = gt,
|
|
212
|
+
renderOrder: o = 100,
|
|
213
|
+
visible: l = !0,
|
|
214
|
+
maskFeather: p = 4,
|
|
215
|
+
maskErode: m = 0.7,
|
|
216
|
+
...f
|
|
217
|
+
}) => {
|
|
218
|
+
const u = Ne();
|
|
219
|
+
if (x(() => {
|
|
220
|
+
n == null || n(t, r);
|
|
221
|
+
}, [t, r, n]), !u) return null;
|
|
222
|
+
const d = t === "ready" && e;
|
|
223
|
+
return !d && !ht(t, a) ? null : /* @__PURE__ */ y(
|
|
224
|
+
yt,
|
|
225
|
+
{
|
|
226
|
+
...f,
|
|
227
|
+
source: { kind: "texture", texture: u },
|
|
228
|
+
fit: i,
|
|
229
|
+
anchors: c,
|
|
230
|
+
renderOrder: o,
|
|
231
|
+
visible: l,
|
|
232
|
+
maskTexture: d ? e : null,
|
|
233
|
+
maskChannel: "green",
|
|
234
|
+
maskInvert: s,
|
|
235
|
+
maskFeather: p,
|
|
236
|
+
maskErode: m
|
|
237
|
+
}
|
|
238
|
+
);
|
|
239
|
+
}, vt = ({ active: e = !0, ...t }) => {
|
|
240
|
+
const { texture: r, status: s, error: a } = pt(e);
|
|
241
|
+
return /* @__PURE__ */ y(Le, { ...t, mask: r, status: s, error: a });
|
|
242
|
+
}, wt = ({ bodyId: e, subject: t, numBodies: r, active: s = !0, ...a }) => {
|
|
243
|
+
const { texture: n, status: i, error: c } = ft({ bodyId: e, subject: t, numBodies: r, active: s });
|
|
244
|
+
return /* @__PURE__ */ y(Le, { ...a, mask: n, status: i, error: c });
|
|
245
|
+
}, Wr = ({ bodyId: e, subject: t, numBodies: r, ...s }) => e !== void 0 || t ? /* @__PURE__ */ y(wt, { ...s, bodyId: e, subject: t, numBodies: r }) : /* @__PURE__ */ y(vt, { ...s }), ce = 9, le = 16, Br = ({ children: e }) => {
|
|
246
|
+
const [t, r] = k({ width: 0, height: 0 });
|
|
247
|
+
return x(() => {
|
|
248
|
+
const s = () => {
|
|
249
|
+
const a = document.documentElement.clientWidth, n = document.documentElement.clientHeight, i = a / n, c = ce / le;
|
|
250
|
+
let o, l;
|
|
251
|
+
i > c ? (l = n, o = l * ce / le) : (o = a, l = o * le / ce), r({ width: o, height: l });
|
|
199
252
|
};
|
|
200
|
-
return
|
|
201
|
-
}, []), /* @__PURE__ */
|
|
253
|
+
return s(), window.addEventListener("resize", s), () => window.removeEventListener("resize", s);
|
|
254
|
+
}, []), /* @__PURE__ */ y(
|
|
202
255
|
"div",
|
|
203
256
|
{
|
|
204
257
|
style: {
|
|
@@ -209,38 +262,263 @@ const tt = ({
|
|
|
209
262
|
justifyContent: "center",
|
|
210
263
|
backgroundColor: "#0d0d0d"
|
|
211
264
|
},
|
|
212
|
-
children: /* @__PURE__ */
|
|
265
|
+
children: /* @__PURE__ */ y("div", { style: { width: t.width, height: t.height, position: "relative" }, children: e })
|
|
213
266
|
}
|
|
214
267
|
);
|
|
215
|
-
},
|
|
216
|
-
const
|
|
217
|
-
return { x:
|
|
218
|
-
},
|
|
219
|
-
sheet:
|
|
220
|
-
contentAspect:
|
|
221
|
-
renderOrder:
|
|
222
|
-
name:
|
|
268
|
+
}, $r = ({ size: e = 0.25, ...t }) => /* @__PURE__ */ y("axesHelper", { args: [e], ...t }), Dt = { left: -1, right: 1, top: 1, bottom: -1 }, Ut = (e, t, r) => {
|
|
269
|
+
const s = e % t, a = Math.floor(e / t);
|
|
270
|
+
return { x: s / t, y: (r - 1 - a) / r };
|
|
271
|
+
}, Nt = ({
|
|
272
|
+
sheet: e,
|
|
273
|
+
contentAspect: t,
|
|
274
|
+
renderOrder: r,
|
|
275
|
+
name: s
|
|
223
276
|
}) => {
|
|
224
|
-
const a =
|
|
225
|
-
return
|
|
226
|
-
a.wrapS =
|
|
227
|
-
const
|
|
228
|
-
if (
|
|
229
|
-
|
|
230
|
-
const { x:
|
|
231
|
-
a.offset.set(
|
|
232
|
-
}), /* @__PURE__ */
|
|
233
|
-
/* @__PURE__ */
|
|
234
|
-
/* @__PURE__ */
|
|
277
|
+
const a = Et(e.url), n = R(0), i = R(-1), c = bt(), [o, l] = t != null ? St(c, t) : [1, 1];
|
|
278
|
+
return Ue((p, m) => {
|
|
279
|
+
a.wrapS = Ee, a.wrapT = Ee, a.magFilter = be, a.minFilter = be, a.generateMipmaps = !1, a.repeat.set(1 / e.cols, 1 / e.rows), n.current += m;
|
|
280
|
+
const f = Math.floor(n.current * e.fps) % e.frames;
|
|
281
|
+
if (f === i.current) return;
|
|
282
|
+
i.current = f;
|
|
283
|
+
const { x: u, y: d } = Ut(f, e.cols, e.rows);
|
|
284
|
+
a.offset.set(u, d);
|
|
285
|
+
}), /* @__PURE__ */ z("mesh", { name: s, renderOrder: r, scale: [o, l, 1], children: [
|
|
286
|
+
/* @__PURE__ */ y("planeGeometry", { args: [1, 1] }),
|
|
287
|
+
/* @__PURE__ */ y("meshBasicMaterial", { map: a, transparent: !0, toneMapped: !1, depthWrite: !1 })
|
|
235
288
|
] });
|
|
236
|
-
},
|
|
237
|
-
sheet:
|
|
238
|
-
anchors:
|
|
239
|
-
contentAspect:
|
|
240
|
-
renderOrder:
|
|
289
|
+
}, Xr = ({
|
|
290
|
+
sheet: e,
|
|
291
|
+
anchors: t = Dt,
|
|
292
|
+
contentAspect: r,
|
|
293
|
+
renderOrder: s = 10,
|
|
241
294
|
name: a = "spriteAnimation"
|
|
242
|
-
}) => /* @__PURE__ */
|
|
243
|
-
|
|
295
|
+
}) => /* @__PURE__ */ y(et, { fallback: null, children: /* @__PURE__ */ y(Qe, { anchors: t, children: /* @__PURE__ */ y(Nt, { sheet: e, contentAspect: r, renderOrder: s, name: a }) }) }), Pt = 64, Lt = 3, It = /^[A-Za-z][A-Za-z0-9]{0,39}$/, Ot = /^#(?:[0-9a-fA-F]{3,4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/, Gt = /^(?:rgb|rgba|hsl|hsla)\([0-9a-z.,%\s/+-]{1,60}\)$/i, zt = /^-?[0-9]{1,4}(?:\.[0-9]{1,4})?(?:px|em|rem|%)?$/, qt = /^[A-Za-z0-9 ,'"_-]{1,120}$/;
|
|
296
|
+
function Wt(e) {
|
|
297
|
+
return Ot.test(e) || Gt.test(e) || zt.test(e) || qt.test(e);
|
|
298
|
+
}
|
|
299
|
+
const Re = (e) => e.map((t) => t.replace(/[A-Z]/g, (r) => `-${r.toLowerCase()}`)).join("-");
|
|
300
|
+
function Bt(e) {
|
|
301
|
+
const t = {};
|
|
302
|
+
let r = 0;
|
|
303
|
+
const s = (a, n) => {
|
|
304
|
+
for (const i of Object.keys(a)) {
|
|
305
|
+
if (r >= Pt) return;
|
|
306
|
+
if (!It.test(i)) continue;
|
|
307
|
+
const c = a[i], o = [...n, i];
|
|
308
|
+
typeof c == "number" ? Number.isFinite(c) && (t[`--vincentt-${Re(o)}`] = String(c), r++) : typeof c == "string" ? Wt(c) && (t[`--vincentt-${Re(o)}`] = c, r++) : c && typeof c == "object" && !Array.isArray(c) && o.length < Lt && s(c, o);
|
|
309
|
+
}
|
|
310
|
+
};
|
|
311
|
+
return e && typeof e == "object" && s(e, []), t;
|
|
312
|
+
}
|
|
313
|
+
function Hr({ theme: e, className: t, children: r }) {
|
|
314
|
+
const s = { display: "contents", ...Bt(e) };
|
|
315
|
+
return /* @__PURE__ */ y("div", { className: t, style: s, children: r });
|
|
316
|
+
}
|
|
317
|
+
const ue = (e, t) => ({
|
|
318
|
+
x: (t == null ? void 0 : t.x) ?? e.x,
|
|
319
|
+
y: (t == null ? void 0 : t.y) ?? e.y,
|
|
320
|
+
z: (t == null ? void 0 : t.z) ?? e.z
|
|
321
|
+
});
|
|
322
|
+
function Kr({
|
|
323
|
+
src: e,
|
|
324
|
+
position: t,
|
|
325
|
+
rotation: r,
|
|
326
|
+
scale: s,
|
|
327
|
+
visible: a = !0,
|
|
328
|
+
material: n,
|
|
329
|
+
// `name` and `locked` are editor metadata; neither changes rendering.
|
|
330
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
331
|
+
name: i,
|
|
332
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
333
|
+
locked: c
|
|
334
|
+
}) {
|
|
335
|
+
const [o, l, p] = [t == null ? void 0 : t.x, t == null ? void 0 : t.y, t == null ? void 0 : t.z], [m, f, u] = [r == null ? void 0 : r.x, r == null ? void 0 : r.y, r == null ? void 0 : r.z], [d, g, M] = [s == null ? void 0 : s.x, s == null ? void 0 : s.y, s == null ? void 0 : s.z], h = W(
|
|
336
|
+
() => ({
|
|
337
|
+
...V,
|
|
338
|
+
position: ue(V.position, { x: o, y: l, z: p }),
|
|
339
|
+
rotation: ue(V.rotation, { x: m, y: f, z: u }),
|
|
340
|
+
scale: ue(V.scale, { x: d, y: g, z: M }),
|
|
341
|
+
visible: a
|
|
342
|
+
}),
|
|
343
|
+
[o, l, p, m, f, u, d, g, M, a]
|
|
344
|
+
), S = W(
|
|
345
|
+
() => ({
|
|
346
|
+
...Ae,
|
|
347
|
+
assetUrl: e,
|
|
348
|
+
material: { ...Ae.material, ...n }
|
|
349
|
+
}),
|
|
350
|
+
[e, n]
|
|
351
|
+
);
|
|
352
|
+
return /* @__PURE__ */ y(At, { value: h, children: /* @__PURE__ */ y(Rt, { value: S }) });
|
|
353
|
+
}
|
|
354
|
+
const $t = (e) => Array.isArray(e) ? e : [e], Xt = (e) => {
|
|
355
|
+
const [t, r] = k(null);
|
|
356
|
+
return x(() => {
|
|
357
|
+
if (!e) return;
|
|
358
|
+
let s = !0, a = null;
|
|
359
|
+
return new de.TextureLoader().load(
|
|
360
|
+
e,
|
|
361
|
+
(n) => {
|
|
362
|
+
if (a = n, !s) {
|
|
363
|
+
n.dispose();
|
|
364
|
+
return;
|
|
365
|
+
}
|
|
366
|
+
n.colorSpace = de.SRGBColorSpace, n.flipY = !1, r({ url: e, texture: n });
|
|
367
|
+
},
|
|
368
|
+
void 0,
|
|
369
|
+
() => console.warn(`${Xe.loggerPrefix} Object3D could not load ${e}`)
|
|
370
|
+
), () => {
|
|
371
|
+
s = !1, a == null || a.dispose();
|
|
372
|
+
};
|
|
373
|
+
}, [e]), e && (t == null ? void 0 : t.url) === e ? t.texture : null;
|
|
374
|
+
};
|
|
375
|
+
function jr({
|
|
376
|
+
colour: e,
|
|
377
|
+
texture: t,
|
|
378
|
+
size: r = 1,
|
|
379
|
+
visible: s = !0,
|
|
380
|
+
children: a,
|
|
381
|
+
// `name` and `locked` are editor metadata; neither changes rendering.
|
|
382
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
383
|
+
name: n,
|
|
384
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
385
|
+
locked: i
|
|
386
|
+
}) {
|
|
387
|
+
const c = R(null), o = R(/* @__PURE__ */ new Map()), l = Xt(t), p = e !== void 0 || l !== null, m = () => {
|
|
388
|
+
for (const [f, { original: u, own: d }] of o.current)
|
|
389
|
+
f.material = u, d.forEach((g) => g.dispose());
|
|
390
|
+
o.current.clear();
|
|
391
|
+
};
|
|
392
|
+
return Ue(() => {
|
|
393
|
+
!p || !c.current || c.current.traverse((f) => {
|
|
394
|
+
const u = f;
|
|
395
|
+
if (!u.isMesh || o.current.has(u)) return;
|
|
396
|
+
const d = u.material, g = $t(d).map((M) => {
|
|
397
|
+
var S;
|
|
398
|
+
const h = M.clone();
|
|
399
|
+
return e !== void 0 && ((S = h.color) == null || S.set(e)), l && (h.map = l, h.needsUpdate = !0), h;
|
|
400
|
+
});
|
|
401
|
+
u.material = Array.isArray(d) ? g : g[0], o.current.set(u, { original: d, own: g });
|
|
402
|
+
});
|
|
403
|
+
}), x(() => (m(), m), [e, l]), /* @__PURE__ */ y("group", { ref: c, visible: s, scale: r, children: a });
|
|
404
|
+
}
|
|
405
|
+
function Vr({
|
|
406
|
+
className: e,
|
|
407
|
+
children: t,
|
|
408
|
+
// `name` and `locked` are editor metadata; neither changes rendering.
|
|
409
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
410
|
+
name: r,
|
|
411
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
412
|
+
locked: s
|
|
413
|
+
}) {
|
|
414
|
+
return /* @__PURE__ */ y("div", { className: e, children: t });
|
|
415
|
+
}
|
|
416
|
+
const Ht = 2048;
|
|
417
|
+
function Kt(e) {
|
|
418
|
+
return e <= 32 || e >= 127 && e <= 160 || e === 173 || e === 92 || e === 1564 || e === 6158 || e >= 8192 && e <= 8207 || e >= 8232 && e <= 8238 || e >= 8288 && e <= 8303 || e === 12288 || e === 65279 || e >= 917504 && e <= 917631;
|
|
419
|
+
}
|
|
420
|
+
function jt(e) {
|
|
421
|
+
if (typeof e != "string" || e.length === 0 || e.length > Ht) return;
|
|
422
|
+
for (const s of e)
|
|
423
|
+
if (Kt(s.codePointAt(0) ?? 0)) return;
|
|
424
|
+
const t = e.toLowerCase();
|
|
425
|
+
return t.startsWith("https://") || t.startsWith("http://") || t.startsWith("mailto:") || t.startsWith("#") || t.startsWith("/") && !t.startsWith("//") ? e : void 0;
|
|
426
|
+
}
|
|
427
|
+
const Fe = {
|
|
428
|
+
display: "inline-block",
|
|
429
|
+
padding: "0.6em 1.2em",
|
|
430
|
+
border: "none",
|
|
431
|
+
borderRadius: "var(--vincentt-radius, 0.5em)",
|
|
432
|
+
background: "var(--vincentt-button, #111827)",
|
|
433
|
+
color: "var(--vincentt-button-text, #ffffff)",
|
|
434
|
+
font: "inherit",
|
|
435
|
+
textDecoration: "none",
|
|
436
|
+
cursor: "pointer"
|
|
437
|
+
};
|
|
438
|
+
function Zr({
|
|
439
|
+
label: e,
|
|
440
|
+
action: t,
|
|
441
|
+
target: r,
|
|
442
|
+
link: s,
|
|
443
|
+
onTap: a,
|
|
444
|
+
color: n,
|
|
445
|
+
visible: i = !0,
|
|
446
|
+
className: c,
|
|
447
|
+
children: o,
|
|
448
|
+
// `name` and `locked` are editor metadata; neither changes rendering.
|
|
449
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
450
|
+
name: l,
|
|
451
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
452
|
+
locked: p
|
|
453
|
+
}) {
|
|
454
|
+
if (!i) return null;
|
|
455
|
+
const m = n ? { ...Fe, background: n } : Fe, f = t === "scene" && !a && typeof r == "string" && r ? r : void 0, u = t === "scene" ? void 0 : jt(s), d = f ? () => Mt(f) : a, g = o ?? e;
|
|
456
|
+
if (u) {
|
|
457
|
+
const M = /^https?:/i.test(u);
|
|
458
|
+
return /* @__PURE__ */ y(
|
|
459
|
+
"a",
|
|
460
|
+
{
|
|
461
|
+
href: u,
|
|
462
|
+
className: c,
|
|
463
|
+
style: m,
|
|
464
|
+
onClick: d,
|
|
465
|
+
...M ? { target: "_blank", rel: "noopener noreferrer" } : {},
|
|
466
|
+
children: g
|
|
467
|
+
}
|
|
468
|
+
);
|
|
469
|
+
}
|
|
470
|
+
return /* @__PURE__ */ y("button", { type: "button", className: c, style: m, onClick: d, children: g });
|
|
471
|
+
}
|
|
472
|
+
const xe = (e, t) => ({
|
|
473
|
+
x: (t == null ? void 0 : t.x) ?? e.x,
|
|
474
|
+
y: (t == null ? void 0 : t.y) ?? e.y,
|
|
475
|
+
z: (t == null ? void 0 : t.z) ?? e.z
|
|
476
|
+
});
|
|
477
|
+
function Yr({
|
|
478
|
+
type: e = O.type,
|
|
479
|
+
color: t = O.color,
|
|
480
|
+
intensity: r = O.intensity,
|
|
481
|
+
enabled: s = O.enabled,
|
|
482
|
+
castShadow: a = !1,
|
|
483
|
+
distance: n = O.distance,
|
|
484
|
+
decay: i = O.decay,
|
|
485
|
+
angle: c = O.angle,
|
|
486
|
+
penumbra: o = O.penumbra,
|
|
487
|
+
position: l,
|
|
488
|
+
rotation: p,
|
|
489
|
+
showHelper: m = O.showHelper,
|
|
490
|
+
// `name` and `locked` are editor metadata; neither changes rendering.
|
|
491
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
492
|
+
name: f,
|
|
493
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
494
|
+
locked: u
|
|
495
|
+
}) {
|
|
496
|
+
const [d, g, M] = [l == null ? void 0 : l.x, l == null ? void 0 : l.y, l == null ? void 0 : l.z], [h, S, b] = [p == null ? void 0 : p.x, p == null ? void 0 : p.y, p == null ? void 0 : p.z], I = W(
|
|
497
|
+
() => ({
|
|
498
|
+
...V,
|
|
499
|
+
position: xe(V.position, { x: d, y: g, z: M }),
|
|
500
|
+
rotation: xe(V.rotation, { x: h, y: S, z: b })
|
|
501
|
+
}),
|
|
502
|
+
[d, g, M, h, S, b]
|
|
503
|
+
), T = W(
|
|
504
|
+
() => ({
|
|
505
|
+
enabled: s,
|
|
506
|
+
type: e,
|
|
507
|
+
color: t,
|
|
508
|
+
intensity: r,
|
|
509
|
+
castShadow: a,
|
|
510
|
+
distance: n,
|
|
511
|
+
angle: c,
|
|
512
|
+
penumbra: o,
|
|
513
|
+
decay: i,
|
|
514
|
+
showHelper: m
|
|
515
|
+
}),
|
|
516
|
+
[s, e, t, r, a, n, c, o, i, m]
|
|
517
|
+
);
|
|
518
|
+
return /* @__PURE__ */ y(Tt, { settings: T, transform: I });
|
|
519
|
+
}
|
|
520
|
+
const X = (e) => {
|
|
521
|
+
switch (e) {
|
|
244
522
|
case "start":
|
|
245
523
|
return "starting";
|
|
246
524
|
case "started":
|
|
@@ -257,207 +535,207 @@ const tt = ({
|
|
|
257
535
|
case "clear":
|
|
258
536
|
return "idle";
|
|
259
537
|
}
|
|
260
|
-
},
|
|
538
|
+
}, Vt = [
|
|
261
539
|
"video/mp4",
|
|
262
540
|
"video/webm;codecs=vp9",
|
|
263
541
|
"video/webm;codecs=vp8",
|
|
264
542
|
"video/webm"
|
|
265
543
|
];
|
|
266
|
-
function
|
|
544
|
+
function Jr(e = {}) {
|
|
267
545
|
const {
|
|
268
|
-
audio:
|
|
269
|
-
mimeType:
|
|
270
|
-
bitsPerSecond:
|
|
546
|
+
audio: t = !1,
|
|
547
|
+
mimeType: r,
|
|
548
|
+
bitsPerSecond: s,
|
|
271
549
|
onData: a,
|
|
272
|
-
onStop:
|
|
273
|
-
onRecordingStart:
|
|
550
|
+
onStop: n,
|
|
551
|
+
onRecordingStart: i,
|
|
274
552
|
onRecordingPause: c,
|
|
275
|
-
onRecordingResume:
|
|
276
|
-
onRecordingStop:
|
|
277
|
-
onRecordingComplete:
|
|
278
|
-
onError:
|
|
279
|
-
passThroughStream:
|
|
280
|
-
} =
|
|
281
|
-
var
|
|
282
|
-
const
|
|
283
|
-
for (const
|
|
284
|
-
if ((
|
|
285
|
-
}, [
|
|
286
|
-
async (
|
|
287
|
-
const
|
|
288
|
-
if (
|
|
289
|
-
let
|
|
290
|
-
if (
|
|
291
|
-
|
|
553
|
+
onRecordingResume: o,
|
|
554
|
+
onRecordingStop: l,
|
|
555
|
+
onRecordingComplete: p,
|
|
556
|
+
onError: m,
|
|
557
|
+
passThroughStream: f
|
|
558
|
+
} = e, u = R(null), d = R(null), g = R([]), [M, h] = k("idle"), [S, b] = k(null), [I, T] = k(null), w = F(() => {
|
|
559
|
+
var C;
|
|
560
|
+
const E = [r, ...Vt].filter(Boolean);
|
|
561
|
+
for (const A of E)
|
|
562
|
+
if ((C = MediaRecorder.isTypeSupported) != null && C.call(MediaRecorder, A)) return A;
|
|
563
|
+
}, [r]), N = F(
|
|
564
|
+
async (E) => {
|
|
565
|
+
const C = new MediaStream();
|
|
566
|
+
if (E.getTracks().forEach((A) => C.addTrack(A)), t) {
|
|
567
|
+
let A;
|
|
568
|
+
if (t instanceof MediaStream)
|
|
569
|
+
A = t;
|
|
292
570
|
else {
|
|
293
|
-
const v = typeof
|
|
294
|
-
|
|
571
|
+
const v = typeof t == "object" ? { audio: t } : { audio: !0, video: !1 };
|
|
572
|
+
A = await navigator.mediaDevices.getUserMedia(v);
|
|
295
573
|
}
|
|
296
|
-
|
|
574
|
+
A.getAudioTracks().forEach((v) => C.addTrack(v));
|
|
297
575
|
}
|
|
298
|
-
if (!
|
|
576
|
+
if (!C.getTracks().length)
|
|
299
577
|
throw new Error("No tracks available in combined stream.");
|
|
300
|
-
return
|
|
578
|
+
return d.current = C, C;
|
|
301
579
|
},
|
|
302
|
-
[
|
|
303
|
-
),
|
|
304
|
-
async (
|
|
305
|
-
|
|
580
|
+
[t]
|
|
581
|
+
), B = F(
|
|
582
|
+
async (E, C) => {
|
|
583
|
+
h(X("start")), T(null), b(null);
|
|
306
584
|
try {
|
|
307
|
-
let
|
|
308
|
-
if (
|
|
309
|
-
|
|
585
|
+
let A;
|
|
586
|
+
if (f)
|
|
587
|
+
A = f, d.current = A;
|
|
310
588
|
else {
|
|
311
|
-
if (!
|
|
312
|
-
|
|
589
|
+
if (!E) throw new Error("start(stream) requires a MediaStream.");
|
|
590
|
+
A = await N(E);
|
|
313
591
|
}
|
|
314
|
-
const v =
|
|
315
|
-
v && (
|
|
316
|
-
const
|
|
317
|
-
|
|
318
|
-
var
|
|
319
|
-
((
|
|
320
|
-
},
|
|
321
|
-
const
|
|
592
|
+
const v = w(), Z = {};
|
|
593
|
+
v && (Z.mimeType = v), s && (Z.bitsPerSecond = s);
|
|
594
|
+
const j = new MediaRecorder(A, Z);
|
|
595
|
+
j.ondataavailable = (L) => {
|
|
596
|
+
var J;
|
|
597
|
+
((J = L.data) == null ? void 0 : J.size) > 0 && (g.current.push(L.data), a == null || a(L.data));
|
|
598
|
+
}, j.onstop = () => {
|
|
599
|
+
const L = new Blob(g.current, {
|
|
322
600
|
type: v ?? "video/webm"
|
|
323
601
|
});
|
|
324
|
-
|
|
325
|
-
},
|
|
326
|
-
} catch (
|
|
327
|
-
const v =
|
|
328
|
-
console.error("start(stream) failed", v),
|
|
602
|
+
b(L), n == null || n(L), p == null || p(L), g.current = [], h(X("complete"));
|
|
603
|
+
}, u.current = j, j.start(C), h(X("started")), i == null || i();
|
|
604
|
+
} catch (A) {
|
|
605
|
+
const v = A instanceof Error ? A : new Error(String(A));
|
|
606
|
+
console.error("start(stream) failed", v), T(v), h(X("fail")), m == null || m(v);
|
|
329
607
|
}
|
|
330
608
|
},
|
|
331
609
|
[
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
610
|
+
N,
|
|
611
|
+
w,
|
|
612
|
+
s,
|
|
335
613
|
a,
|
|
614
|
+
n,
|
|
615
|
+
p,
|
|
336
616
|
i,
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
d,
|
|
340
|
-
m
|
|
617
|
+
m,
|
|
618
|
+
f
|
|
341
619
|
]
|
|
342
|
-
),
|
|
343
|
-
const
|
|
344
|
-
!
|
|
345
|
-
}, [
|
|
346
|
-
const
|
|
347
|
-
(
|
|
348
|
-
}, [c]),
|
|
349
|
-
const
|
|
350
|
-
(
|
|
351
|
-
}, [
|
|
352
|
-
var
|
|
620
|
+
), $ = F(() => {
|
|
621
|
+
const E = u.current;
|
|
622
|
+
!E || E.state === "inactive" || (h(X("stop")), E.stop(), l == null || l());
|
|
623
|
+
}, [l]), te = F(() => {
|
|
624
|
+
const E = u.current;
|
|
625
|
+
(E == null ? void 0 : E.state) === "recording" && (E.pause(), h(X("pause")), c == null || c());
|
|
626
|
+
}, [c]), re = F(() => {
|
|
627
|
+
const E = u.current;
|
|
628
|
+
(E == null ? void 0 : E.state) === "paused" && (E.resume(), h(X("resume")), o == null || o());
|
|
629
|
+
}, [o]), Y = F(() => {
|
|
630
|
+
var E;
|
|
353
631
|
try {
|
|
354
|
-
|
|
355
|
-
} catch (
|
|
356
|
-
console.error("clear failed",
|
|
632
|
+
u.current && (u.current.onstop = null, u.current.state !== "inactive" && u.current.stop()), u.current = null, (E = d.current) == null || E.getTracks().forEach((C) => C.stop()), d.current = null, b(null), h(X("clear")), g.current = [], T(null);
|
|
633
|
+
} catch (C) {
|
|
634
|
+
console.error("clear failed", C);
|
|
357
635
|
}
|
|
358
636
|
}, []);
|
|
359
|
-
return
|
|
360
|
-
status:
|
|
361
|
-
start:
|
|
362
|
-
stop:
|
|
637
|
+
return x(() => () => Y(), []), {
|
|
638
|
+
status: M,
|
|
639
|
+
start: B,
|
|
640
|
+
stop: $,
|
|
363
641
|
pause: te,
|
|
364
|
-
resume:
|
|
365
|
-
clear:
|
|
366
|
-
isRecording:
|
|
367
|
-
isPaused:
|
|
368
|
-
recordedBlob:
|
|
369
|
-
error:
|
|
370
|
-
getActiveStream: () =>
|
|
642
|
+
resume: re,
|
|
643
|
+
clear: Y,
|
|
644
|
+
isRecording: M === "recording" || M === "paused",
|
|
645
|
+
isPaused: M === "paused",
|
|
646
|
+
recordedBlob: S,
|
|
647
|
+
error: I,
|
|
648
|
+
getActiveStream: () => d.current
|
|
371
649
|
};
|
|
372
650
|
}
|
|
373
|
-
const
|
|
374
|
-
var
|
|
375
|
-
(
|
|
651
|
+
const Zt = async (e, t = {}) => {
|
|
652
|
+
var r, s, a;
|
|
653
|
+
(r = t.onCaptureStart) == null || r.call(t), await Promise.resolve();
|
|
376
654
|
try {
|
|
377
|
-
const
|
|
378
|
-
return (
|
|
379
|
-
} catch (
|
|
380
|
-
const
|
|
381
|
-
throw (a =
|
|
655
|
+
const n = e();
|
|
656
|
+
return (s = t.onCaptureComplete) == null || s.call(t, n), n;
|
|
657
|
+
} catch (n) {
|
|
658
|
+
const i = n instanceof Error ? n : new Error(String(n));
|
|
659
|
+
throw (a = t.onError) == null || a.call(t, i), i;
|
|
382
660
|
}
|
|
383
|
-
},
|
|
384
|
-
const { session:
|
|
385
|
-
captureFrame:
|
|
386
|
-
onCaptureStart:
|
|
661
|
+
}, Qr = (e = {}) => {
|
|
662
|
+
const { session: t } = He(), {
|
|
663
|
+
captureFrame: r = t.captureFrame,
|
|
664
|
+
onCaptureStart: s,
|
|
387
665
|
onCaptureComplete: a,
|
|
388
|
-
onError:
|
|
389
|
-
} =
|
|
390
|
-
c("capturing"),
|
|
666
|
+
onError: n
|
|
667
|
+
} = e, [i, c] = k("idle"), [o, l] = k(null), [p, m] = k(null), f = F(async () => {
|
|
668
|
+
c("capturing"), l(null), m(null);
|
|
391
669
|
try {
|
|
392
|
-
const
|
|
393
|
-
onCaptureStart:
|
|
670
|
+
const d = await Zt(r, {
|
|
671
|
+
onCaptureStart: s,
|
|
394
672
|
onCaptureComplete: a,
|
|
395
|
-
onError:
|
|
673
|
+
onError: n
|
|
396
674
|
});
|
|
397
|
-
return
|
|
398
|
-
} catch (
|
|
399
|
-
const
|
|
400
|
-
return
|
|
675
|
+
return l(d), c("completed"), d;
|
|
676
|
+
} catch (d) {
|
|
677
|
+
const g = d instanceof Error ? d : new Error(String(d));
|
|
678
|
+
return m(g), c("error"), null;
|
|
401
679
|
}
|
|
402
|
-
}, [
|
|
403
|
-
c("idle"),
|
|
680
|
+
}, [r, s, a, n]), u = F(() => {
|
|
681
|
+
c("idle"), l(null), m(null);
|
|
404
682
|
}, []);
|
|
405
|
-
return { status:
|
|
406
|
-
},
|
|
407
|
-
const
|
|
408
|
-
let
|
|
409
|
-
const c = new Uint8Array(
|
|
410
|
-
for (;
|
|
411
|
-
c[
|
|
412
|
-
return new File([c],
|
|
413
|
-
},
|
|
414
|
-
if (
|
|
415
|
-
|
|
683
|
+
return { status: i, capturePhoto: f, clear: u, dataUrl: o, error: p };
|
|
684
|
+
}, es = (e, t) => {
|
|
685
|
+
const r = e.split(","), s = r[0].match(/:(.*?);/), a = s ? s[1] : "application/octet-stream", n = atob(r[r.length - 1]);
|
|
686
|
+
let i = n.length;
|
|
687
|
+
const c = new Uint8Array(i);
|
|
688
|
+
for (; i--; )
|
|
689
|
+
c[i] = n.charCodeAt(i);
|
|
690
|
+
return new File([c], t, { type: a });
|
|
691
|
+
}, Yt = 4, Jt = 50, Qt = 5e3, ae = (e) => Math.min(1, Math.max(0, e)), Ce = (e) => new Promise((t) => {
|
|
692
|
+
if (e.readyState >= 4) {
|
|
693
|
+
t();
|
|
416
694
|
return;
|
|
417
695
|
}
|
|
418
|
-
let
|
|
419
|
-
const
|
|
420
|
-
|
|
696
|
+
let r = !1;
|
|
697
|
+
const s = () => {
|
|
698
|
+
r || (r = !0, t());
|
|
421
699
|
};
|
|
422
|
-
|
|
423
|
-
}),
|
|
424
|
-
const
|
|
425
|
-
return
|
|
426
|
-
},
|
|
427
|
-
|
|
428
|
-
|
|
700
|
+
e.addEventListener("canplaythrough", s, { once: !0 }), e.addEventListener("error", s, { once: !0 }), setTimeout(s, Qt);
|
|
701
|
+
}), _e = (e, t) => {
|
|
702
|
+
const r = document.createElement("audio");
|
|
703
|
+
return r.src = e, r.loop = t, r.preload = "auto", r.setAttribute("playsinline", ""), r.setAttribute("webkit-playsinline", ""), r.load(), r;
|
|
704
|
+
}, er = (e) => {
|
|
705
|
+
e.muted = !0, e.play().then(() => {
|
|
706
|
+
e.pause(), e.currentTime = 0, e.muted = !1;
|
|
429
707
|
}).catch(() => {
|
|
430
|
-
|
|
708
|
+
e.muted = !1;
|
|
431
709
|
});
|
|
432
710
|
};
|
|
433
|
-
class
|
|
434
|
-
constructor(
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
711
|
+
class tr {
|
|
712
|
+
constructor(t = {}) {
|
|
713
|
+
D(this, "sfxPoolSize");
|
|
714
|
+
D(this, "coalesceMs");
|
|
715
|
+
D(this, "muted", !0);
|
|
716
|
+
D(this, "listeners", /* @__PURE__ */ new Set());
|
|
717
|
+
D(this, "music", null);
|
|
718
|
+
D(this, "musicUrl", null);
|
|
719
|
+
D(this, "musicReady", null);
|
|
720
|
+
D(this, "musicWanted", null);
|
|
721
|
+
D(this, "pools", /* @__PURE__ */ new Map());
|
|
444
722
|
/** Last play time per SFX URL, for the coalesce window. */
|
|
445
|
-
|
|
723
|
+
D(this, "lastPlayed", /* @__PURE__ */ new Map());
|
|
446
724
|
/** Readiness promises so a loading gate can await decode/buffer. */
|
|
447
|
-
|
|
448
|
-
this.sfxPoolSize =
|
|
725
|
+
D(this, "ready", /* @__PURE__ */ new Map());
|
|
726
|
+
this.sfxPoolSize = t.sfxPoolSize ?? Yt, this.coalesceMs = t.coalesceMs ?? Jt;
|
|
449
727
|
}
|
|
450
728
|
/**
|
|
451
729
|
* Create + buffer the looping music element. Await in the loading gate so the
|
|
452
730
|
* unmute tap is instant. Idempotent per URL (re-requesting the same track is
|
|
453
731
|
* a no-op that returns the in-flight promise).
|
|
454
732
|
*/
|
|
455
|
-
prefetchMusic(
|
|
456
|
-
const
|
|
457
|
-
if (this.musicWanted = { url:
|
|
458
|
-
return this.music && (this.music.volume =
|
|
459
|
-
this.music && (this.music.pause(), this.music.currentTime = 0, this.music.removeAttribute("src"), this.music.load()), this.music =
|
|
460
|
-
const a =
|
|
733
|
+
prefetchMusic(t, r = 0.4) {
|
|
734
|
+
const s = ae(r);
|
|
735
|
+
if (this.musicWanted = { url: t, volume: s }, this.musicUrl === t && this.musicReady)
|
|
736
|
+
return this.music && (this.music.volume = s), this.musicReady;
|
|
737
|
+
this.music && (this.music.pause(), this.music.currentTime = 0, this.music.removeAttribute("src"), this.music.load()), this.music = _e(t, !0), this.musicUrl = t, this.music.volume = s;
|
|
738
|
+
const a = Ce(this.music);
|
|
461
739
|
return this.musicReady = a, a;
|
|
462
740
|
}
|
|
463
741
|
/**
|
|
@@ -465,24 +743,24 @@ class Oe {
|
|
|
465
743
|
* cut each other off). Returns a promise that resolves when the first element
|
|
466
744
|
* buffers. Idempotent per URL.
|
|
467
745
|
*/
|
|
468
|
-
registerSound(
|
|
469
|
-
const
|
|
470
|
-
if (
|
|
471
|
-
const a =
|
|
746
|
+
registerSound(t, r = 1) {
|
|
747
|
+
const s = this.ready.get(t);
|
|
748
|
+
if (s) return s;
|
|
749
|
+
const a = ae(r), n = [];
|
|
472
750
|
for (let c = 0; c < this.sfxPoolSize; c += 1) {
|
|
473
|
-
const
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
}),
|
|
751
|
+
const o = _e(t, !1);
|
|
752
|
+
o.volume = a, o.addEventListener("ended", () => {
|
|
753
|
+
o.currentTime = 0;
|
|
754
|
+
}), n.push(o);
|
|
477
755
|
}
|
|
478
|
-
this.pools.set(
|
|
479
|
-
const
|
|
480
|
-
return this.ready.set(
|
|
756
|
+
this.pools.set(t, { els: n, next: 0, volume: a });
|
|
757
|
+
const i = Ce(n[0]);
|
|
758
|
+
return this.ready.set(t, i), i;
|
|
481
759
|
}
|
|
482
760
|
/** Subscribe to mute-state changes (for a toggle UI). Fires immediately with
|
|
483
761
|
* the current state. Returns an unsubscribe. */
|
|
484
|
-
onMuteChange(
|
|
485
|
-
return this.listeners.add(
|
|
762
|
+
onMuteChange(t) {
|
|
763
|
+
return this.listeners.add(t), t(this.muted), () => this.listeners.delete(t);
|
|
486
764
|
}
|
|
487
765
|
isMuted() {
|
|
488
766
|
return this.muted;
|
|
@@ -493,8 +771,8 @@ class Oe {
|
|
|
493
771
|
* element with a muted play/pause so later `playOneShot` calls are allowed,
|
|
494
772
|
* then start the music. All elements are already buffered, so this is instant.
|
|
495
773
|
*/
|
|
496
|
-
setMuted(
|
|
497
|
-
|
|
774
|
+
setMuted(t) {
|
|
775
|
+
t !== this.muted && (this.muted = t, this.muted || this.pools.forEach((r) => r.els.forEach(er)), this.applyMusic(), this.listeners.forEach((r) => r(this.muted)));
|
|
498
776
|
}
|
|
499
777
|
toggleMuted() {
|
|
500
778
|
this.setMuted(!this.muted);
|
|
@@ -505,30 +783,30 @@ class Oe {
|
|
|
505
783
|
* same sound into one play, and does NO synchronous `currentTime` seek on a
|
|
506
784
|
* ready element (the pool rewinds on `ended`, off the hot path).
|
|
507
785
|
*/
|
|
508
|
-
playOneShot(
|
|
786
|
+
playOneShot(t, r) {
|
|
509
787
|
if (this.muted) return;
|
|
510
|
-
const
|
|
511
|
-
if (!
|
|
788
|
+
const s = this.pools.get(t);
|
|
789
|
+
if (!s) return;
|
|
512
790
|
const a = performance.now();
|
|
513
|
-
if (a - (this.lastPlayed.get(
|
|
514
|
-
this.lastPlayed.set(
|
|
515
|
-
const
|
|
516
|
-
let
|
|
517
|
-
for (let c = 0; c <
|
|
518
|
-
const
|
|
519
|
-
if (
|
|
520
|
-
|
|
791
|
+
if (a - (this.lastPlayed.get(t) ?? -1 / 0) < this.coalesceMs) return;
|
|
792
|
+
this.lastPlayed.set(t, a);
|
|
793
|
+
const n = s.els.length;
|
|
794
|
+
let i;
|
|
795
|
+
for (let c = 0; c < n; c += 1) {
|
|
796
|
+
const o = s.els[(s.next + c) % n];
|
|
797
|
+
if (o.paused) {
|
|
798
|
+
i = o, s.next = (s.next + c + 1) % n;
|
|
521
799
|
break;
|
|
522
800
|
}
|
|
523
801
|
}
|
|
524
|
-
|
|
802
|
+
i || (i = s.els[s.next], s.next = (s.next + 1) % n), i.muted = !1, i.volume = ae(r ?? s.volume), i.currentTime !== 0 && (i.currentTime = 0), i.play().catch(() => {
|
|
525
803
|
});
|
|
526
804
|
}
|
|
527
805
|
/** Request the looping background track (buffer it with prefetchMusic, which
|
|
528
806
|
* a loading gate awaits). Remembered while muted; starts on unmute. */
|
|
529
|
-
startMusic(
|
|
530
|
-
const
|
|
531
|
-
this.musicUrl !==
|
|
807
|
+
startMusic(t, r = 0.4) {
|
|
808
|
+
const s = ae(r);
|
|
809
|
+
this.musicUrl !== t && this.prefetchMusic(t, s), this.musicWanted = { url: t, volume: s }, this.applyMusic();
|
|
532
810
|
}
|
|
533
811
|
stopMusic() {
|
|
534
812
|
this.musicWanted = null, this.music && (this.music.pause(), this.music.currentTime = 0);
|
|
@@ -538,176 +816,878 @@ class Oe {
|
|
|
538
816
|
}), this.muted && !this.music.paused && this.music.pause());
|
|
539
817
|
}
|
|
540
818
|
}
|
|
541
|
-
const
|
|
542
|
-
src:
|
|
543
|
-
playMode:
|
|
544
|
-
loopCount:
|
|
819
|
+
const rr = (e, t, r) => e === "infinite" || e === "loop" && t < Math.max(1, Math.floor(r)) ? "replay" : "ended", sr = (e, t, r) => e && t !== r, ar = (e) => Math.min(100, Math.max(0, e)) / 100, ts = tt(function({
|
|
820
|
+
src: t,
|
|
821
|
+
playMode: r = "once",
|
|
822
|
+
loopCount: s = 1,
|
|
545
823
|
autoplay: a = !1,
|
|
546
|
-
muted:
|
|
547
|
-
volume:
|
|
824
|
+
muted: n = !1,
|
|
825
|
+
volume: i = 100,
|
|
548
826
|
preload: c = "auto",
|
|
549
|
-
onReady:
|
|
550
|
-
onPlay:
|
|
551
|
-
onPause:
|
|
552
|
-
onEnded:
|
|
553
|
-
onError:
|
|
554
|
-
},
|
|
555
|
-
const
|
|
556
|
-
|
|
557
|
-
|
|
827
|
+
onReady: o,
|
|
828
|
+
onPlay: l,
|
|
829
|
+
onPause: p,
|
|
830
|
+
onEnded: m,
|
|
831
|
+
onError: f
|
|
832
|
+
}, u) {
|
|
833
|
+
const d = R(null);
|
|
834
|
+
d.current === null && typeof Audio < "u" && (d.current = new Audio());
|
|
835
|
+
const g = R(0), M = R(null), h = F(async () => {
|
|
836
|
+
const T = d.current;
|
|
837
|
+
if (T)
|
|
558
838
|
try {
|
|
559
|
-
await
|
|
560
|
-
} catch (
|
|
561
|
-
const
|
|
562
|
-
throw
|
|
839
|
+
await T.play();
|
|
840
|
+
} catch (w) {
|
|
841
|
+
const N = w instanceof Error ? w : new Error(String(w));
|
|
842
|
+
throw f == null || f(N), N;
|
|
563
843
|
}
|
|
564
|
-
}, [
|
|
565
|
-
var
|
|
566
|
-
return (
|
|
567
|
-
}, []),
|
|
568
|
-
const
|
|
569
|
-
|
|
844
|
+
}, [f]), S = F(() => {
|
|
845
|
+
var T;
|
|
846
|
+
return (T = d.current) == null ? void 0 : T.pause();
|
|
847
|
+
}, []), b = F(() => {
|
|
848
|
+
const T = d.current;
|
|
849
|
+
T && (T.pause(), T.currentTime = 0, g.current = 0);
|
|
570
850
|
}, []);
|
|
571
|
-
|
|
572
|
-
|
|
851
|
+
rt(
|
|
852
|
+
u,
|
|
573
853
|
() => ({
|
|
574
|
-
play:
|
|
575
|
-
pause:
|
|
576
|
-
stop:
|
|
854
|
+
play: h,
|
|
855
|
+
pause: S,
|
|
856
|
+
stop: b,
|
|
577
857
|
get current() {
|
|
578
|
-
return
|
|
858
|
+
return d.current;
|
|
579
859
|
}
|
|
580
860
|
}),
|
|
581
|
-
[
|
|
582
|
-
),
|
|
583
|
-
|
|
584
|
-
}, [
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
861
|
+
[S, h, b]
|
|
862
|
+
), x(() => {
|
|
863
|
+
g.current = 0, M.current = null;
|
|
864
|
+
}, [t]), x(() => {
|
|
865
|
+
const T = d.current;
|
|
866
|
+
T && (T.preload = c, T.muted = n, T.loop = !1, T.getAttribute("src") !== t && (T.src = t));
|
|
867
|
+
}, [t, c, n]), x(() => {
|
|
868
|
+
const T = d.current;
|
|
869
|
+
return () => {
|
|
870
|
+
T && (T.pause(), T.removeAttribute("src"), T.load());
|
|
871
|
+
};
|
|
872
|
+
}, []), x(() => {
|
|
873
|
+
d.current && (d.current.volume = ar(i));
|
|
874
|
+
}, [i]), x(() => {
|
|
875
|
+
sr(a, M.current, t) && (M.current = t, h().catch(() => {
|
|
588
876
|
}));
|
|
589
|
-
}, [a,
|
|
590
|
-
const
|
|
591
|
-
|
|
592
|
-
const
|
|
593
|
-
if (
|
|
594
|
-
const
|
|
595
|
-
|
|
877
|
+
}, [a, t]);
|
|
878
|
+
const I = F(() => {
|
|
879
|
+
g.current += 1;
|
|
880
|
+
const T = Math.max(1, Math.floor(s));
|
|
881
|
+
if (rr(r, g.current, T) === "replay") {
|
|
882
|
+
const w = d.current;
|
|
883
|
+
w && (w.currentTime = 0, h().catch(() => {
|
|
596
884
|
}));
|
|
597
885
|
return;
|
|
598
886
|
}
|
|
599
|
-
|
|
600
|
-
}, [
|
|
601
|
-
return
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
887
|
+
g.current = 0, m == null || m();
|
|
888
|
+
}, [s, m, h, r]);
|
|
889
|
+
return x(() => {
|
|
890
|
+
const T = d.current;
|
|
891
|
+
if (!T) return;
|
|
892
|
+
const N = [
|
|
893
|
+
["canplaythrough", () => o == null ? void 0 : o()],
|
|
894
|
+
["play", () => l == null ? void 0 : l()],
|
|
895
|
+
["pause", () => p == null ? void 0 : p()],
|
|
896
|
+
["ended", I],
|
|
897
|
+
["error", () => f == null ? void 0 : f(new Error(`Unable to load audio: ${t}`))]
|
|
898
|
+
];
|
|
899
|
+
for (const [B, $] of N) T.addEventListener(B, $);
|
|
900
|
+
return () => {
|
|
901
|
+
for (const [B, $] of N) T.removeEventListener(B, $);
|
|
902
|
+
};
|
|
903
|
+
}, [t, o, l, p, f, I]), null;
|
|
904
|
+
}), P = new tr(), rs = (e, t) => P.prefetchMusic(e, t), ss = (e, t) => P.registerSound(e, t), as = (e, t) => P.startMusic(e, t), ns = () => P.stopMusic(), os = (e, t) => P.playOneShot(e, t), is = (e) => P.setMuted(e), cs = () => P.toggleMuted(), ls = () => P.isMuted(), us = (e) => P.onMuteChange(e), ds = () => {
|
|
905
|
+
const [e, t] = k(P.isMuted());
|
|
906
|
+
return x(() => P.onMuteChange(t), []), e;
|
|
907
|
+
}, nr = (e = {}) => {
|
|
908
|
+
const { auto: t = !1 } = e, r = R(e.env ?? Ke()), s = R(e.constraints);
|
|
909
|
+
s.current = e.constraints;
|
|
910
|
+
const [a, n] = k("unknown"), [i, c] = k(null), o = R(0), l = F(async () => {
|
|
911
|
+
const m = ++o.current, f = await je(r.current);
|
|
912
|
+
if (m !== o.current) return a;
|
|
913
|
+
const u = f.state === "unknown" ? "unknown" : f.state;
|
|
914
|
+
return n((d) => d === "requesting" ? d : u), u !== "blocked" && c(null), u;
|
|
915
|
+
}, []), p = F(
|
|
916
|
+
async (m) => {
|
|
917
|
+
const f = ++o.current;
|
|
918
|
+
n("requesting"), c(null);
|
|
919
|
+
const u = await Ve(
|
|
920
|
+
{ constraints: (m == null ? void 0 : m.constraints) ?? s.current, keepStream: !1 },
|
|
921
|
+
r.current
|
|
922
|
+
);
|
|
923
|
+
return f !== o.current || (n(u.state), c(u.reason)), u.state;
|
|
924
|
+
},
|
|
925
|
+
[]
|
|
926
|
+
);
|
|
927
|
+
return x(() => {
|
|
928
|
+
let m = () => {
|
|
929
|
+
}, f = !0;
|
|
930
|
+
return t ? p() : l(), Ze((u) => {
|
|
931
|
+
f && (n((d) => d === "requesting" ? d : u.state === "unknown" ? "unknown" : u.state), u.state !== "blocked" && c(null));
|
|
932
|
+
}, r.current).then((u) => {
|
|
933
|
+
f ? m = u : u();
|
|
934
|
+
}), () => {
|
|
935
|
+
f = !1, o.current += 1, m();
|
|
936
|
+
};
|
|
937
|
+
}, [t, l, p]), W(
|
|
938
|
+
() => ({
|
|
939
|
+
state: a,
|
|
940
|
+
reason: i,
|
|
941
|
+
canPrompt: Ye(a),
|
|
942
|
+
usable: a === "granted",
|
|
943
|
+
request: p,
|
|
944
|
+
refresh: l
|
|
945
|
+
}),
|
|
946
|
+
[a, i, p, l]
|
|
947
|
+
);
|
|
948
|
+
}, or = {
|
|
949
|
+
display: "flex",
|
|
950
|
+
flexDirection: "column",
|
|
951
|
+
alignItems: "center",
|
|
952
|
+
justifyContent: "center",
|
|
953
|
+
gap: 12,
|
|
954
|
+
height: "100%",
|
|
955
|
+
minHeight: 160,
|
|
956
|
+
padding: 24,
|
|
957
|
+
textAlign: "center",
|
|
958
|
+
background: "#111827",
|
|
959
|
+
color: "#f9fafb",
|
|
960
|
+
fontFamily: "system-ui, sans-serif"
|
|
961
|
+
}, ir = {
|
|
962
|
+
font: "inherit",
|
|
963
|
+
padding: "10px 18px",
|
|
964
|
+
borderRadius: 8,
|
|
965
|
+
border: "1px solid rgba(255,255,255,0.3)",
|
|
966
|
+
background: "#2563eb",
|
|
967
|
+
color: "#fff",
|
|
968
|
+
cursor: "pointer"
|
|
969
|
+
}, ms = ({
|
|
970
|
+
children: e,
|
|
971
|
+
fallback: t,
|
|
972
|
+
auto: r = !1,
|
|
973
|
+
constraints: s,
|
|
974
|
+
requestLabel: a = "Allow camera"
|
|
975
|
+
}) => {
|
|
976
|
+
const n = nr({ auto: r, constraints: s });
|
|
977
|
+
if (n.usable) return /* @__PURE__ */ y(ne, { children: e });
|
|
978
|
+
if (t) return /* @__PURE__ */ y(ne, { children: t(n) });
|
|
979
|
+
const { state: i, reason: c, canPrompt: o, request: l } = n;
|
|
980
|
+
return /* @__PURE__ */ z("div", { style: or, role: "region", "aria-label": "Camera access", children: [
|
|
981
|
+
/* @__PURE__ */ y("p", { "aria-live": "polite", style: { margin: 0 }, children: (c == null ? void 0 : c.message) ?? Je[i] }),
|
|
982
|
+
/* @__PURE__ */ y(
|
|
983
|
+
"button",
|
|
984
|
+
{
|
|
985
|
+
type: "button",
|
|
986
|
+
onClick: () => void l(),
|
|
987
|
+
disabled: !o || i === "requesting",
|
|
988
|
+
"aria-disabled": !o || i === "requesting",
|
|
989
|
+
style: { ...ir, opacity: o && i !== "requesting" ? 1 : 0.5 },
|
|
990
|
+
children: i === "requesting" ? "Waiting…" : i === "denied" ? "Try again" : a
|
|
991
|
+
}
|
|
992
|
+
)
|
|
993
|
+
] });
|
|
994
|
+
}, cr = () => {
|
|
995
|
+
var e;
|
|
996
|
+
return {
|
|
997
|
+
enumerateDevices: typeof navigator < "u" && ((e = navigator.mediaDevices) != null && e.enumerateDevices) ? () => navigator.mediaDevices.enumerateDevices() : void 0
|
|
998
|
+
};
|
|
999
|
+
}, lr = /\b(back|rear|environment|world)\b/i, ur = /\b(front|user|facetime|selfie)\b/i, dr = (e) => lr.test(e) ? "environment" : ur.test(e) ? "user" : null, fs = async (e = cr()) => {
|
|
1000
|
+
if (!e.enumerateDevices) return [];
|
|
1001
|
+
try {
|
|
1002
|
+
return (await e.enumerateDevices()).filter((r) => r.kind === "videoinput").map((r) => ({
|
|
1003
|
+
deviceId: r.deviceId,
|
|
1004
|
+
label: r.label,
|
|
1005
|
+
facing: dr(r.label)
|
|
1006
|
+
}));
|
|
1007
|
+
} catch {
|
|
1008
|
+
return [];
|
|
1009
|
+
}
|
|
1010
|
+
}, ps = (e, t) => e.find((r) => r.facing === t) ?? null, Ie = at(null), hs = ({
|
|
1011
|
+
cache: e,
|
|
1012
|
+
disposeUnreferencedOnUnmount: t = !0,
|
|
1013
|
+
children: r
|
|
1014
|
+
}) => {
|
|
1015
|
+
const s = e ?? Pe();
|
|
1016
|
+
return x(() => () => {
|
|
1017
|
+
t && s.disposeUnreferenced();
|
|
1018
|
+
}, [s, t]), /* @__PURE__ */ y(Ie.Provider, { value: s, children: r });
|
|
1019
|
+
}, Oe = () => st(Ie) ?? Pe(), gs = (e, t = {}) => {
|
|
1020
|
+
const { enabled: r = !0 } = t, s = Oe(), a = nt(), n = (e == null ? void 0 : e.key) ?? null, [i, c] = k({
|
|
1021
|
+
value: null,
|
|
1022
|
+
status: "idle",
|
|
1023
|
+
error: null
|
|
1024
|
+
});
|
|
1025
|
+
return x(() => {
|
|
1026
|
+
if (!e || !r) {
|
|
1027
|
+
c({ value: null, status: "idle", error: null });
|
|
1028
|
+
return;
|
|
617
1029
|
}
|
|
1030
|
+
let o = !0;
|
|
1031
|
+
const l = s.get(e.key);
|
|
1032
|
+
return c({ value: l ?? null, status: l ? "ready" : "loading", error: null }), s.acquire(e, a).then((p) => {
|
|
1033
|
+
o && c({ value: p, status: "ready", error: null });
|
|
1034
|
+
}).catch((p) => {
|
|
1035
|
+
o && c({ value: null, status: "error", error: p });
|
|
1036
|
+
}), () => {
|
|
1037
|
+
o = !1, s.release(e.key, a);
|
|
1038
|
+
};
|
|
1039
|
+
}, [s, n, r, a]), i;
|
|
1040
|
+
}, ys = (e) => {
|
|
1041
|
+
const t = Oe(), r = e ?? t;
|
|
1042
|
+
return ot(
|
|
1043
|
+
(s) => r.subscribe(s),
|
|
1044
|
+
() => r.getStats(),
|
|
1045
|
+
() => r.getStats()
|
|
1046
|
+
);
|
|
1047
|
+
}, oe = 1, Ge = Object.freeze({
|
|
1048
|
+
version: oe,
|
|
1049
|
+
trackers: {
|
|
1050
|
+
face: { enabled: !0, numFaces: 1, targetFps: null, holdMs: 250, predictMs: 0, smoothing: 0 },
|
|
1051
|
+
hand: { enabled: !1, targetFps: null },
|
|
1052
|
+
gesture: { enabled: !1, targetFps: null },
|
|
1053
|
+
body: { enabled: !1, targetFps: null },
|
|
1054
|
+
holistic: {
|
|
1055
|
+
enabled: !1,
|
|
1056
|
+
targetFps: null,
|
|
1057
|
+
hands: "both",
|
|
1058
|
+
holdMs: 250,
|
|
1059
|
+
predictMs: 0,
|
|
1060
|
+
analysisMaxDimension: 768,
|
|
1061
|
+
outputFaceBlendshapes: !0,
|
|
1062
|
+
confidence: 0.5,
|
|
1063
|
+
delegate: "auto"
|
|
1064
|
+
},
|
|
1065
|
+
segmentation: { enabled: !1, quality: "low" },
|
|
1066
|
+
semanticSegmentation: { enabled: !1, preset: "multiclass", quality: "medium" }
|
|
1067
|
+
},
|
|
1068
|
+
perf: { targetFps: 24, camRes: 720, cameraZoom: 1.2, analysisScale: 1 },
|
|
1069
|
+
lifecycle: { pauseWhenHidden: !1 },
|
|
1070
|
+
quality: {},
|
|
1071
|
+
camera: { facingMode: "user", deviceId: null, mirrored: "auto" },
|
|
1072
|
+
fallbacks: { onUnsupported: "degrade", delegate: "auto" },
|
|
1073
|
+
assets: { holisticModelUrl: null, semanticSegmentationModelUrl: null },
|
|
1074
|
+
updatedAt: 0
|
|
1075
|
+
}), U = (e, t, r, s, a, n) => {
|
|
1076
|
+
if (e === void 0) return t;
|
|
1077
|
+
if (typeof e != "number" || !Number.isFinite(e))
|
|
1078
|
+
return n(`${a}: not a number, kept ${t}`), t;
|
|
1079
|
+
const i = Math.min(s, Math.max(r, e));
|
|
1080
|
+
return i !== e && n(`${a}: ${e} clamped to ${i}`), i;
|
|
1081
|
+
}, Q = (e, t, r, s) => e === void 0 ? t : e === null ? null : typeof e != "number" || !Number.isFinite(e) || e <= 0 ? (s(`${r}: invalid fps, kept ${t}`), t) : (e > 120 && s(`${r}: ${e} clamped to 120`), Math.min(120, e)), mr = [
|
|
1082
|
+
"tiers",
|
|
1083
|
+
"budget",
|
|
1084
|
+
"initialTier",
|
|
1085
|
+
"minTier",
|
|
1086
|
+
"maxTier",
|
|
1087
|
+
"adaptive",
|
|
1088
|
+
"historySize"
|
|
1089
|
+
], ke = (e) => {
|
|
1090
|
+
const t = {};
|
|
1091
|
+
for (const r of mr) e[r] !== void 0 && (t[r] = e[r]);
|
|
1092
|
+
return t;
|
|
1093
|
+
}, G = (e, t, r, s) => e === void 0 ? t : typeof e != "boolean" ? (s(`${r}: not a boolean, kept ${t}`), t) : e, H = (e, t, r, s, a) => e === void 0 ? r : t.includes(e) ? e : (a(`${s}: "${String(e)}" is not one of ${t.join(" | ")}, kept ${r}`), r), ve = (e, t, r, s) => e === void 0 ? t : e === null ? null : typeof e != "string" || !/^https?:\/\//.test(e) ? (s(`${r}: not an http(s) URL, kept ${t === null ? "the SDK default" : t}`), t) : e, K = (e = {}, t = Ge, r = []) => {
|
|
1094
|
+
var c, o, l, p, m, f, u, d, g, M, h, S, b, I, T, w, N, B, $, te, re, Y, E, C, A, v, Z, j, L, J, fe, pe, he, ge, ye, Se, Te, Me;
|
|
1095
|
+
const s = (We) => r.push(We), a = e.trackers ?? {}, n = t.trackers, i = e.quality === void 0 ? t.quality === !1 ? !1 : ke(t.quality) : e.quality === !1 ? !1 : typeof e.quality == "object" && e.quality !== null ? ke(e.quality) : (s("quality: must be an object or false, kept base"), t.quality);
|
|
1096
|
+
return {
|
|
1097
|
+
version: oe,
|
|
1098
|
+
trackers: {
|
|
1099
|
+
face: {
|
|
1100
|
+
enabled: G((c = a.face) == null ? void 0 : c.enabled, n.face.enabled, "trackers.face.enabled", s),
|
|
1101
|
+
numFaces: Math.round(
|
|
1102
|
+
U((o = a.face) == null ? void 0 : o.numFaces, n.face.numFaces, 1, 10, "trackers.face.numFaces", s)
|
|
1103
|
+
),
|
|
1104
|
+
targetFps: Q((l = a.face) == null ? void 0 : l.targetFps, n.face.targetFps, "trackers.face.targetFps", s),
|
|
1105
|
+
holdMs: U((p = a.face) == null ? void 0 : p.holdMs, n.face.holdMs, 0, 5e3, "trackers.face.holdMs", s),
|
|
1106
|
+
predictMs: U(
|
|
1107
|
+
(m = a.face) == null ? void 0 : m.predictMs,
|
|
1108
|
+
n.face.predictMs,
|
|
1109
|
+
0,
|
|
1110
|
+
1e3,
|
|
1111
|
+
"trackers.face.predictMs",
|
|
1112
|
+
s
|
|
1113
|
+
),
|
|
1114
|
+
smoothing: U(
|
|
1115
|
+
(f = a.face) == null ? void 0 : f.smoothing,
|
|
1116
|
+
n.face.smoothing,
|
|
1117
|
+
0,
|
|
1118
|
+
100,
|
|
1119
|
+
"trackers.face.smoothing",
|
|
1120
|
+
s
|
|
1121
|
+
)
|
|
1122
|
+
},
|
|
1123
|
+
hand: {
|
|
1124
|
+
enabled: G((u = a.hand) == null ? void 0 : u.enabled, n.hand.enabled, "trackers.hand.enabled", s),
|
|
1125
|
+
targetFps: Q((d = a.hand) == null ? void 0 : d.targetFps, n.hand.targetFps, "trackers.hand.targetFps", s)
|
|
1126
|
+
},
|
|
1127
|
+
gesture: {
|
|
1128
|
+
enabled: G((g = a.gesture) == null ? void 0 : g.enabled, n.gesture.enabled, "trackers.gesture.enabled", s),
|
|
1129
|
+
targetFps: Q(
|
|
1130
|
+
(M = a.gesture) == null ? void 0 : M.targetFps,
|
|
1131
|
+
n.gesture.targetFps,
|
|
1132
|
+
"trackers.gesture.targetFps",
|
|
1133
|
+
s
|
|
1134
|
+
)
|
|
1135
|
+
},
|
|
1136
|
+
body: {
|
|
1137
|
+
enabled: G((h = a.body) == null ? void 0 : h.enabled, n.body.enabled, "trackers.body.enabled", s),
|
|
1138
|
+
targetFps: Q((S = a.body) == null ? void 0 : S.targetFps, n.body.targetFps, "trackers.body.targetFps", s)
|
|
1139
|
+
},
|
|
1140
|
+
holistic: {
|
|
1141
|
+
enabled: G((b = a.holistic) == null ? void 0 : b.enabled, n.holistic.enabled, "trackers.holistic.enabled", s),
|
|
1142
|
+
targetFps: Q(
|
|
1143
|
+
(I = a.holistic) == null ? void 0 : I.targetFps,
|
|
1144
|
+
n.holistic.targetFps,
|
|
1145
|
+
"trackers.holistic.targetFps",
|
|
1146
|
+
s
|
|
1147
|
+
),
|
|
1148
|
+
hands: H(
|
|
1149
|
+
(T = a.holistic) == null ? void 0 : T.hands,
|
|
1150
|
+
["both", "left", "right", "none"],
|
|
1151
|
+
n.holistic.hands,
|
|
1152
|
+
"trackers.holistic.hands",
|
|
1153
|
+
s
|
|
1154
|
+
),
|
|
1155
|
+
holdMs: U(
|
|
1156
|
+
(w = a.holistic) == null ? void 0 : w.holdMs,
|
|
1157
|
+
n.holistic.holdMs,
|
|
1158
|
+
0,
|
|
1159
|
+
5e3,
|
|
1160
|
+
"trackers.holistic.holdMs",
|
|
1161
|
+
s
|
|
1162
|
+
),
|
|
1163
|
+
predictMs: U(
|
|
1164
|
+
(N = a.holistic) == null ? void 0 : N.predictMs,
|
|
1165
|
+
n.holistic.predictMs,
|
|
1166
|
+
0,
|
|
1167
|
+
1e3,
|
|
1168
|
+
"trackers.holistic.predictMs",
|
|
1169
|
+
s
|
|
1170
|
+
),
|
|
1171
|
+
analysisMaxDimension: Math.round(
|
|
1172
|
+
U(
|
|
1173
|
+
(B = a.holistic) == null ? void 0 : B.analysisMaxDimension,
|
|
1174
|
+
n.holistic.analysisMaxDimension,
|
|
1175
|
+
128,
|
|
1176
|
+
2048,
|
|
1177
|
+
"trackers.holistic.analysisMaxDimension",
|
|
1178
|
+
s
|
|
1179
|
+
)
|
|
1180
|
+
),
|
|
1181
|
+
outputFaceBlendshapes: G(
|
|
1182
|
+
($ = a.holistic) == null ? void 0 : $.outputFaceBlendshapes,
|
|
1183
|
+
n.holistic.outputFaceBlendshapes,
|
|
1184
|
+
"trackers.holistic.outputFaceBlendshapes",
|
|
1185
|
+
s
|
|
1186
|
+
),
|
|
1187
|
+
confidence: U(
|
|
1188
|
+
(te = a.holistic) == null ? void 0 : te.confidence,
|
|
1189
|
+
n.holistic.confidence,
|
|
1190
|
+
0,
|
|
1191
|
+
1,
|
|
1192
|
+
"trackers.holistic.confidence",
|
|
1193
|
+
s
|
|
1194
|
+
),
|
|
1195
|
+
delegate: H(
|
|
1196
|
+
(re = a.holistic) == null ? void 0 : re.delegate,
|
|
1197
|
+
["auto", "GPU", "CPU"],
|
|
1198
|
+
n.holistic.delegate,
|
|
1199
|
+
"trackers.holistic.delegate",
|
|
1200
|
+
s
|
|
1201
|
+
)
|
|
1202
|
+
},
|
|
1203
|
+
segmentation: {
|
|
1204
|
+
enabled: G(
|
|
1205
|
+
(Y = a.segmentation) == null ? void 0 : Y.enabled,
|
|
1206
|
+
n.segmentation.enabled,
|
|
1207
|
+
"trackers.segmentation.enabled",
|
|
1208
|
+
s
|
|
1209
|
+
),
|
|
1210
|
+
quality: H(
|
|
1211
|
+
(E = a.segmentation) == null ? void 0 : E.quality,
|
|
1212
|
+
["low", "medium", "high"],
|
|
1213
|
+
n.segmentation.quality,
|
|
1214
|
+
"trackers.segmentation.quality",
|
|
1215
|
+
s
|
|
1216
|
+
)
|
|
1217
|
+
},
|
|
1218
|
+
semanticSegmentation: {
|
|
1219
|
+
enabled: G(
|
|
1220
|
+
(C = a.semanticSegmentation) == null ? void 0 : C.enabled,
|
|
1221
|
+
n.semanticSegmentation.enabled,
|
|
1222
|
+
"trackers.semanticSegmentation.enabled",
|
|
1223
|
+
s
|
|
1224
|
+
),
|
|
1225
|
+
preset: H(
|
|
1226
|
+
(A = a.semanticSegmentation) == null ? void 0 : A.preset,
|
|
1227
|
+
Ft,
|
|
1228
|
+
n.semanticSegmentation.preset,
|
|
1229
|
+
"trackers.semanticSegmentation.preset",
|
|
1230
|
+
s
|
|
1231
|
+
),
|
|
1232
|
+
quality: H(
|
|
1233
|
+
(v = a.semanticSegmentation) == null ? void 0 : v.quality,
|
|
1234
|
+
["low", "medium", "high"],
|
|
1235
|
+
n.semanticSegmentation.quality,
|
|
1236
|
+
"trackers.semanticSegmentation.quality",
|
|
1237
|
+
s
|
|
1238
|
+
)
|
|
1239
|
+
}
|
|
1240
|
+
},
|
|
1241
|
+
perf: {
|
|
1242
|
+
targetFps: U((Z = e.perf) == null ? void 0 : Z.targetFps, t.perf.targetFps, 0, 120, "perf.targetFps", s),
|
|
1243
|
+
camRes: Math.round(U((j = e.perf) == null ? void 0 : j.camRes, t.perf.camRes, 160, 3840, "perf.camRes", s)),
|
|
1244
|
+
cameraZoom: U((L = e.perf) == null ? void 0 : L.cameraZoom, t.perf.cameraZoom, 1, 3, "perf.cameraZoom", s),
|
|
1245
|
+
analysisScale: U(
|
|
1246
|
+
(J = e.perf) == null ? void 0 : J.analysisScale,
|
|
1247
|
+
t.perf.analysisScale,
|
|
1248
|
+
0.25,
|
|
1249
|
+
1,
|
|
1250
|
+
"perf.analysisScale",
|
|
1251
|
+
s
|
|
1252
|
+
)
|
|
1253
|
+
},
|
|
1254
|
+
lifecycle: {
|
|
1255
|
+
pauseWhenHidden: G(
|
|
1256
|
+
(fe = e.lifecycle) == null ? void 0 : fe.pauseWhenHidden,
|
|
1257
|
+
t.lifecycle.pauseWhenHidden,
|
|
1258
|
+
"lifecycle.pauseWhenHidden",
|
|
1259
|
+
s
|
|
1260
|
+
)
|
|
1261
|
+
},
|
|
1262
|
+
quality: i,
|
|
1263
|
+
camera: {
|
|
1264
|
+
facingMode: H(
|
|
1265
|
+
(pe = e.camera) == null ? void 0 : pe.facingMode,
|
|
1266
|
+
["user", "environment"],
|
|
1267
|
+
t.camera.facingMode,
|
|
1268
|
+
"camera.facingMode",
|
|
1269
|
+
s
|
|
1270
|
+
),
|
|
1271
|
+
deviceId: ((he = e.camera) == null ? void 0 : he.deviceId) === void 0 ? t.camera.deviceId : typeof e.camera.deviceId == "string" || e.camera.deviceId === null ? e.camera.deviceId : (s("camera.deviceId: not a string, kept base"), t.camera.deviceId),
|
|
1272
|
+
mirrored: ((ge = e.camera) == null ? void 0 : ge.mirrored) === void 0 ? t.camera.mirrored : e.camera.mirrored === "auto" || typeof e.camera.mirrored == "boolean" ? e.camera.mirrored : (s('camera.mirrored: must be boolean or "auto", kept base'), t.camera.mirrored)
|
|
1273
|
+
},
|
|
1274
|
+
fallbacks: {
|
|
1275
|
+
onUnsupported: H(
|
|
1276
|
+
(ye = e.fallbacks) == null ? void 0 : ye.onUnsupported,
|
|
1277
|
+
["block", "degrade"],
|
|
1278
|
+
t.fallbacks.onUnsupported,
|
|
1279
|
+
"fallbacks.onUnsupported",
|
|
1280
|
+
s
|
|
1281
|
+
),
|
|
1282
|
+
delegate: H(
|
|
1283
|
+
(Se = e.fallbacks) == null ? void 0 : Se.delegate,
|
|
1284
|
+
["auto", "GPU", "CPU"],
|
|
1285
|
+
t.fallbacks.delegate,
|
|
1286
|
+
"fallbacks.delegate",
|
|
1287
|
+
s
|
|
1288
|
+
)
|
|
1289
|
+
},
|
|
1290
|
+
assets: {
|
|
1291
|
+
holisticModelUrl: ve(
|
|
1292
|
+
(Te = e.assets) == null ? void 0 : Te.holisticModelUrl,
|
|
1293
|
+
t.assets.holisticModelUrl,
|
|
1294
|
+
"assets.holisticModelUrl",
|
|
1295
|
+
s
|
|
1296
|
+
),
|
|
1297
|
+
semanticSegmentationModelUrl: ve(
|
|
1298
|
+
(Me = e.assets) == null ? void 0 : Me.semanticSegmentationModelUrl,
|
|
1299
|
+
t.assets.semanticSegmentationModelUrl,
|
|
1300
|
+
"assets.semanticSegmentationModelUrl",
|
|
1301
|
+
s
|
|
1302
|
+
)
|
|
1303
|
+
},
|
|
1304
|
+
updatedAt: typeof e.updatedAt == "number" && Number.isFinite(e.updatedAt) ? e.updatedAt : t.updatedAt
|
|
1305
|
+
};
|
|
1306
|
+
}, we = (e, t, r = Date.now()) => K({ ...t, updatedAt: r }, e), ze = (e) => JSON.stringify(K({}, e)), qe = (e) => {
|
|
1307
|
+
const t = [];
|
|
1308
|
+
let r = e;
|
|
1309
|
+
if (typeof e == "string")
|
|
1310
|
+
try {
|
|
1311
|
+
r = JSON.parse(e);
|
|
1312
|
+
} catch {
|
|
1313
|
+
return {
|
|
1314
|
+
config: K(),
|
|
1315
|
+
migrated: !0,
|
|
1316
|
+
warnings: ["not valid JSON; defaults used"]
|
|
1317
|
+
};
|
|
1318
|
+
}
|
|
1319
|
+
if (!r || typeof r != "object")
|
|
1320
|
+
return {
|
|
1321
|
+
config: K(),
|
|
1322
|
+
migrated: !0,
|
|
1323
|
+
warnings: ["not an object; defaults used"]
|
|
1324
|
+
};
|
|
1325
|
+
const s = r, a = s.version !== oe;
|
|
1326
|
+
return a && t.push(
|
|
1327
|
+
`migrated from version ${String(s.version ?? "none")} to ${oe}`
|
|
1328
|
+
), { config: K(s, Ge, t), migrated: a, warnings: t };
|
|
1329
|
+
}, Ss = [
|
|
1330
|
+
"face",
|
|
1331
|
+
"hand",
|
|
1332
|
+
"gesture",
|
|
1333
|
+
"body",
|
|
1334
|
+
"holistic",
|
|
1335
|
+
"segmentation",
|
|
1336
|
+
"semanticSegmentation"
|
|
1337
|
+
], fr = (e) => ({
|
|
1338
|
+
perf: {
|
|
1339
|
+
targetFps: e.perf.targetFps > 0 ? e.perf.targetFps : void 0,
|
|
1340
|
+
camRes: e.perf.camRes,
|
|
1341
|
+
cameraZoom: e.perf.cameraZoom,
|
|
1342
|
+
analysisScale: e.perf.analysisScale
|
|
1343
|
+
},
|
|
1344
|
+
lifecycle: { pauseWhenHidden: e.lifecycle.pauseWhenHidden },
|
|
1345
|
+
quality: e.quality
|
|
1346
|
+
}), pr = (e) => ({
|
|
1347
|
+
facingMode: e.camera.facingMode,
|
|
1348
|
+
...e.camera.deviceId ? { deviceId: e.camera.deviceId } : {},
|
|
1349
|
+
...e.camera.mirrored === "auto" ? {} : { mirrored: e.camera.mirrored }
|
|
1350
|
+
}), q = (e) => e === null ? {} : { targetFps: e }, hr = (e, t) => {
|
|
1351
|
+
const r = e.trackers;
|
|
1352
|
+
return {
|
|
1353
|
+
face: {
|
|
1354
|
+
numFaces: r.face.numFaces,
|
|
1355
|
+
...q(r.face.targetFps),
|
|
1356
|
+
holdMs: r.face.holdMs,
|
|
1357
|
+
predictMs: r.face.predictMs,
|
|
1358
|
+
active: r.face.enabled
|
|
1359
|
+
},
|
|
1360
|
+
hand: { ...q(r.hand.targetFps), active: r.hand.enabled },
|
|
1361
|
+
gesture: { ...q(r.gesture.targetFps), active: r.gesture.enabled },
|
|
1362
|
+
body: { active: r.body.enabled },
|
|
1363
|
+
holistic: {
|
|
1364
|
+
...q(r.holistic.targetFps),
|
|
1365
|
+
hands: r.holistic.hands,
|
|
1366
|
+
holdMs: r.holistic.holdMs,
|
|
1367
|
+
predictMs: r.holistic.predictMs,
|
|
1368
|
+
analysisMaxDimension: r.holistic.analysisMaxDimension,
|
|
1369
|
+
outputFaceBlendshapes: r.holistic.outputFaceBlendshapes,
|
|
1370
|
+
delegate: r.holistic.delegate === "auto" ? e.fallbacks.delegate : r.holistic.delegate,
|
|
1371
|
+
...e.assets.holisticModelUrl ? { modelUrl: e.assets.holisticModelUrl } : {},
|
|
1372
|
+
active: r.holistic.enabled
|
|
1373
|
+
},
|
|
1374
|
+
segmentation: { quality: r.segmentation.quality, active: r.segmentation.enabled },
|
|
1375
|
+
semanticSegmentation: {
|
|
1376
|
+
preset: r.semanticSegmentation.preset,
|
|
1377
|
+
quality: r.semanticSegmentation.quality,
|
|
1378
|
+
...e.assets.semanticSegmentationModelUrl ? { modelUrl: e.assets.semanticSegmentationModelUrl } : {},
|
|
1379
|
+
active: r.semanticSegmentation.enabled
|
|
1380
|
+
}
|
|
1381
|
+
}[t];
|
|
1382
|
+
}, gr = (e, t) => {
|
|
1383
|
+
const r = e.trackers;
|
|
1384
|
+
switch (t) {
|
|
1385
|
+
case _.FACE_TRACKER:
|
|
1386
|
+
return { numFaces: r.face.numFaces, ...q(r.face.targetFps) };
|
|
1387
|
+
case _.HAND_TRACKER:
|
|
1388
|
+
return { ...q(r.hand.targetFps) };
|
|
1389
|
+
case _.GESTURE_TRACKER:
|
|
1390
|
+
return { ...q(r.gesture.targetFps) };
|
|
1391
|
+
case _.BODY_TRACKER:
|
|
1392
|
+
return { ...q(r.body.targetFps) };
|
|
1393
|
+
case _.HOLISTIC_TRACKER: {
|
|
1394
|
+
const s = r.holistic;
|
|
1395
|
+
return {
|
|
1396
|
+
...q(s.targetFps),
|
|
1397
|
+
hands: s.hands,
|
|
1398
|
+
holdMs: s.holdMs,
|
|
1399
|
+
predictMs: s.predictMs,
|
|
1400
|
+
analysisMaxDimension: s.analysisMaxDimension,
|
|
1401
|
+
outputFaceBlendshapes: s.outputFaceBlendshapes,
|
|
1402
|
+
minFaceDetectionConfidence: s.confidence,
|
|
1403
|
+
minFacePresenceConfidence: s.confidence,
|
|
1404
|
+
minPoseDetectionConfidence: s.confidence,
|
|
1405
|
+
minPosePresenceConfidence: s.confidence,
|
|
1406
|
+
minHandLandmarksConfidence: s.confidence,
|
|
1407
|
+
delegate: s.delegate === "auto" ? e.fallbacks.delegate : s.delegate,
|
|
1408
|
+
...e.assets.holisticModelUrl ? { modelUrl: e.assets.holisticModelUrl } : {}
|
|
1409
|
+
};
|
|
1410
|
+
}
|
|
1411
|
+
case _.BACKGROUND_SEGMENTATION:
|
|
1412
|
+
return { quality: r.segmentation.quality };
|
|
1413
|
+
case _.SEMANTIC_SEGMENTATION:
|
|
1414
|
+
return {
|
|
1415
|
+
preset: r.semanticSegmentation.preset,
|
|
1416
|
+
quality: r.semanticSegmentation.quality,
|
|
1417
|
+
...e.assets.semanticSegmentationModelUrl ? { modelUrl: e.assets.semanticSegmentationModelUrl } : {}
|
|
1418
|
+
};
|
|
1419
|
+
default:
|
|
1420
|
+
return {};
|
|
1421
|
+
}
|
|
1422
|
+
}, yr = (e) => {
|
|
1423
|
+
const t = e.trackers, r = [];
|
|
1424
|
+
return t.face.enabled && r.push(_.FACE_TRACKER), t.hand.enabled && r.push(_.HAND_TRACKER), t.gesture.enabled && r.push(_.GESTURE_TRACKER), t.body.enabled && r.push(_.BODY_TRACKER), t.holistic.enabled && r.push(_.HOLISTIC_TRACKER), t.segmentation.enabled && r.push(_.BACKGROUND_SEGMENTATION), t.semanticSegmentation.enabled && r.push(_.SEMANTIC_SEGMENTATION), r;
|
|
1425
|
+
}, ie = "vincentt.xr.tracking-config", me = () => {
|
|
1426
|
+
try {
|
|
1427
|
+
return typeof localStorage < "u" ? localStorage : null;
|
|
1428
|
+
} catch {
|
|
1429
|
+
return null;
|
|
1430
|
+
}
|
|
1431
|
+
}, Sr = (e = ie, t = me()) => {
|
|
1432
|
+
if (!t) return null;
|
|
1433
|
+
try {
|
|
1434
|
+
const r = t.getItem(e);
|
|
1435
|
+
return r ? qe(r) : null;
|
|
1436
|
+
} catch {
|
|
1437
|
+
return null;
|
|
1438
|
+
}
|
|
1439
|
+
}, De = (e, t = ie, r = me()) => {
|
|
1440
|
+
if (!r) return !1;
|
|
1441
|
+
try {
|
|
1442
|
+
return r.setItem(t, ze(e)), !0;
|
|
1443
|
+
} catch {
|
|
1444
|
+
return !1;
|
|
1445
|
+
}
|
|
1446
|
+
}, Tr = (e = ie, t = me()) => {
|
|
1447
|
+
if (t)
|
|
1448
|
+
try {
|
|
1449
|
+
t.removeItem(e);
|
|
1450
|
+
} catch {
|
|
1451
|
+
}
|
|
1452
|
+
}, Ts = (e = {}) => {
|
|
1453
|
+
const { storageKey: t = ie, persist: r = !0 } = e, s = e.storage, a = R(e.initial), n = W(() => K(a.current ?? {}), []), [i, c] = k(n), [o, l] = k([]), [p, m] = k(!r), f = R(i);
|
|
1454
|
+
f.current = i, x(() => {
|
|
1455
|
+
if (!r) {
|
|
1456
|
+
m(!0);
|
|
1457
|
+
return;
|
|
1458
|
+
}
|
|
1459
|
+
const h = Sr(t, s);
|
|
1460
|
+
if (h) {
|
|
1461
|
+
const S = K(h.config, n);
|
|
1462
|
+
f.current = S, c(S), l(h.warnings), h.migrated && De(S, t, s);
|
|
1463
|
+
}
|
|
1464
|
+
m(!0);
|
|
1465
|
+
}, [r, t, s, n]);
|
|
1466
|
+
const u = F(
|
|
1467
|
+
(h, S) => (f.current = h, c(h), l(S), r && De(h, t, s), h),
|
|
1468
|
+
[r, t, s]
|
|
1469
|
+
), d = F(
|
|
1470
|
+
(h) => {
|
|
1471
|
+
const S = [], b = K({ ...h, updatedAt: Date.now() }, f.current, S);
|
|
1472
|
+
return u(b, S);
|
|
1473
|
+
},
|
|
1474
|
+
[u]
|
|
1475
|
+
), g = F(() => {
|
|
1476
|
+
const h = we(n, {}, 0);
|
|
1477
|
+
return f.current = h, c(h), l([]), r && Tr(t, s), h;
|
|
1478
|
+
}, [n, r, t, s]), M = F(
|
|
1479
|
+
(h) => {
|
|
1480
|
+
const S = qe(h);
|
|
1481
|
+
return S.warnings.some((b) => b.startsWith("not valid JSON") || b.startsWith("not an object")) ? (l([`import: ${S.warnings[0]}; config unchanged`]), f.current) : u(we(S.config, {}, Date.now()), S.warnings);
|
|
1482
|
+
},
|
|
1483
|
+
[u]
|
|
1484
|
+
);
|
|
1485
|
+
return W(
|
|
1486
|
+
() => ({
|
|
1487
|
+
config: i,
|
|
1488
|
+
hydrated: p,
|
|
1489
|
+
warnings: o,
|
|
1490
|
+
update: d,
|
|
1491
|
+
reset: g,
|
|
1492
|
+
importJson: M,
|
|
1493
|
+
json: ze(i),
|
|
1494
|
+
providerProps: fr(i),
|
|
1495
|
+
cameraRequest: pr(i),
|
|
1496
|
+
trackerProps: (h) => hr(i, h),
|
|
1497
|
+
modelOptions: (h) => gr(i, h),
|
|
1498
|
+
enabledModels: yr(i)
|
|
1499
|
+
}),
|
|
1500
|
+
[i, p, o, d, g, M]
|
|
618
1501
|
);
|
|
619
|
-
}), C = new Oe(), ut = (t, e) => C.prefetchMusic(t, e), lt = (t, e) => C.registerSound(t, e), dt = (t, e) => C.startMusic(t, e), mt = () => C.stopMusic(), pt = (t, e) => C.playOneShot(t, e), ht = (t) => C.setMuted(t), ft = () => C.toggleMuted(), Et = () => C.isMuted(), St = (t) => C.onMuteChange(t), Tt = () => {
|
|
620
|
-
const [t, e] = b(C.isMuted());
|
|
621
|
-
return U(() => C.onMuteChange(e), []), t;
|
|
622
1502
|
};
|
|
623
1503
|
export {
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
1504
|
+
Br as AspectRatioContainer,
|
|
1505
|
+
tr as AudioEngine,
|
|
1506
|
+
ts as AudioPlayer,
|
|
1507
|
+
$r as Axes,
|
|
1508
|
+
Zr as Button,
|
|
1509
|
+
Je as CAMERA_PERMISSION_MESSAGES,
|
|
1510
|
+
ms as CameraPermissionGate,
|
|
1511
|
+
_n as DEFAULT_ASSET_BUDGET_BYTES,
|
|
1512
|
+
un as DEFAULT_MATERIAL_FILL,
|
|
1513
|
+
Ae as DEFAULT_MESH_RENDERER,
|
|
1514
|
+
En as DEFAULT_MESH_RENDERER_RENDER_STATE,
|
|
1515
|
+
bs as DEFAULT_PERFORMANCE_BUDGET,
|
|
1516
|
+
As as DEFAULT_PIXEL_SNAP_INCREMENT,
|
|
1517
|
+
Rs as DEFAULT_QUALITY_TIERS,
|
|
1518
|
+
Fs as DEFAULT_REFERENCE_PIXELS_PER_UNIT,
|
|
1519
|
+
Ua as DEFAULT_SCREEN_GLASS,
|
|
1520
|
+
dn as DEFAULT_SCREEN_GRADIENT,
|
|
1521
|
+
Na as DEFAULT_SCREEN_IMAGE_SCENE_SETTINGS,
|
|
1522
|
+
Pa as DEFAULT_SCREEN_IMAGE_SETTINGS,
|
|
1523
|
+
La as DEFAULT_SCREEN_SHAPE_SETTINGS,
|
|
1524
|
+
Ia as DEFAULT_SCREEN_TEXT_SCENE_SETTINGS,
|
|
1525
|
+
Oa as DEFAULT_SCREEN_TEXT_SHADOW_LAYER,
|
|
1526
|
+
xs as DEFAULT_SCREEN_TRANSFORM_2D,
|
|
1527
|
+
Cs as DEFAULT_SCREEN_TRANSFORM_ROOT,
|
|
1528
|
+
Ge as DEFAULT_TRACKING_CONFIG,
|
|
1529
|
+
V as DEFAULT_TRANSFORM_3D,
|
|
1530
|
+
mn as EXTERNAL_BACKGROUND_RENDER_LAYER,
|
|
1531
|
+
gt as FULL_SCREEN_ANCHORS,
|
|
1532
|
+
Vr as HtmlRegion,
|
|
1533
|
+
Yr as Light,
|
|
1534
|
+
Tt as LightObject,
|
|
1535
|
+
Ja as LookAt,
|
|
1536
|
+
fn as MAX_RENDER_GROUP_PASSES,
|
|
1537
|
+
pn as MaterialFill,
|
|
1538
|
+
Rn as MeshMaterial,
|
|
1539
|
+
Rt as MeshRenderer,
|
|
1540
|
+
Kr as Model,
|
|
1541
|
+
jr as Object3D,
|
|
1542
|
+
zr as Panel,
|
|
1543
|
+
Wr as PersonCutout,
|
|
1544
|
+
Ga as PinToMesh,
|
|
1545
|
+
Qa as RenderGroupLayer,
|
|
1546
|
+
en as SCREEN_IMAGE_MASK_CHANNELS,
|
|
1547
|
+
nn as Scene,
|
|
1548
|
+
tn as SceneObjectRenderer,
|
|
1549
|
+
on as Scenes,
|
|
1550
|
+
za as ScreenGlassMaterial,
|
|
1551
|
+
hn as ScreenGradientMaterial,
|
|
1552
|
+
yt as ScreenImage,
|
|
1553
|
+
qa as ScreenShape,
|
|
1554
|
+
va as ScreenSpaceUI,
|
|
1555
|
+
rn as ScreenText,
|
|
1556
|
+
Qe as ScreenTransform,
|
|
1557
|
+
sn as SequentialRenderPasses,
|
|
1558
|
+
Xr as SpriteAnimation,
|
|
1559
|
+
Ss as TRACKER_KINDS,
|
|
1560
|
+
ie as TRACKING_CONFIG_STORAGE_KEY,
|
|
1561
|
+
oe as TRACKING_CONFIG_VERSION,
|
|
1562
|
+
wa as TextLabel,
|
|
1563
|
+
Hr as ThemeProvider,
|
|
1564
|
+
At as Transform3D,
|
|
1565
|
+
qr as VideoBackground,
|
|
1566
|
+
kn as XRAssetCache,
|
|
1567
|
+
hs as XRAssetCacheProvider,
|
|
1568
|
+
_s as XRMediaSource,
|
|
1569
|
+
_ as XRModel,
|
|
1570
|
+
ks as XRProvider,
|
|
1571
|
+
vs as XRQualityController,
|
|
1572
|
+
_a as XRScene,
|
|
1573
|
+
ws as XR_FALLBACK_MESSAGES,
|
|
1574
|
+
Ds as XR_MODEL_ASSET_URLS,
|
|
1575
|
+
P as audio,
|
|
1576
|
+
Ye as canPromptForCamera,
|
|
1577
|
+
Tr as clearTrackingConfig,
|
|
1578
|
+
Us as clientToScreenPixels,
|
|
1579
|
+
St as computeContainScale,
|
|
1580
|
+
Ns as computeFeedCrop,
|
|
1581
|
+
Ps as computeFitLayout,
|
|
1582
|
+
vn as createAssetCache,
|
|
1583
|
+
Ls as createFallbackReason,
|
|
1584
|
+
gn as createTwoStopGradient,
|
|
1585
|
+
es as dataURLtoFile,
|
|
1586
|
+
Un as defineGltfAsset,
|
|
1587
|
+
Nn as defineTextureAsset,
|
|
1588
|
+
Pn as defineVideoAsset,
|
|
1589
|
+
Is as detectXRCapabilities,
|
|
1590
|
+
Ln as disposeObject3D,
|
|
1591
|
+
ja as drawNormalizedCrop,
|
|
1592
|
+
yr as enabledModels,
|
|
1593
|
+
In as estimateGeometryBytes,
|
|
1594
|
+
On as estimateObjectBytes,
|
|
1595
|
+
Gn as estimateTextureBytes,
|
|
1596
|
+
Os as feedSidedName,
|
|
1597
|
+
Gs as feedToScreenPixels,
|
|
1598
|
+
zs as feedToSource,
|
|
1599
|
+
qs as feedToTracker,
|
|
1600
|
+
Ws as feedToViewport,
|
|
1601
|
+
Bs as feedToWorld,
|
|
1602
|
+
ps as findCameraByFacing,
|
|
1603
|
+
Pe as getDefaultAssetCache,
|
|
1604
|
+
yn as getRenderGroupLayer,
|
|
1605
|
+
Mt as goToScene,
|
|
1606
|
+
$s as isFeedPointInSource,
|
|
1607
|
+
Xs as isMirroredSourceKind,
|
|
1608
|
+
ls as isMuted,
|
|
1609
|
+
fs as listCameras,
|
|
1610
|
+
Sr as loadTrackingConfig,
|
|
1611
|
+
Wa as mapScreenImageSettingsToProps,
|
|
1612
|
+
Ba as mapScreenTextInnerShadowToProps,
|
|
1613
|
+
$a as mapScreenTextSettingsToProps,
|
|
1614
|
+
Hs as mediaToScreenPixels,
|
|
1615
|
+
Xa as mergeScreenShapeSettings,
|
|
1616
|
+
Ks as mergeScreenTransform2D,
|
|
1617
|
+
we as mergeTrackingConfig,
|
|
1618
|
+
js as mirrorFeedX,
|
|
1619
|
+
bn as normalizeMeshRendererRenderState,
|
|
1620
|
+
Ha as normalizeScreenGlass,
|
|
1621
|
+
Sn as normalizeScreenGradient,
|
|
1622
|
+
Vs as normalizedToScreenPixels,
|
|
1623
|
+
Zs as normalizedToTransform2DPixels,
|
|
1624
|
+
us as onMuteChange,
|
|
1625
|
+
Ys as orientSourcePoint,
|
|
1626
|
+
Js as orientedSize,
|
|
1627
|
+
Qs as otherSide,
|
|
1628
|
+
qe as parseTrackingConfig,
|
|
1629
|
+
ea as personLeftSign,
|
|
1630
|
+
ta as personSide,
|
|
1631
|
+
os as playOneShot,
|
|
1632
|
+
rs as prefetchMusic,
|
|
1633
|
+
je as queryCameraPermission,
|
|
1634
|
+
ss as registerSound,
|
|
1635
|
+
Tn as renderSequentialPasses,
|
|
1636
|
+
Ve as requestCameraAccess,
|
|
1637
|
+
ra as resolveModelAssetUrl,
|
|
1638
|
+
Va as resolveNormalizedCrop,
|
|
1639
|
+
Za as resolvePersonCutoutStatus,
|
|
1640
|
+
sa as resolveQualityConfig,
|
|
1641
|
+
aa as resolveScreenTransform2D,
|
|
1642
|
+
na as resolveTrackerSupport,
|
|
1643
|
+
K as resolveTrackingConfig,
|
|
1644
|
+
De as saveTrackingConfig,
|
|
1645
|
+
oa as screenPixelsToClient,
|
|
1646
|
+
ia as screenPixelsToFeed,
|
|
1647
|
+
ca as screenPixelsToMedia,
|
|
1648
|
+
la as screenPixelsToNormalized,
|
|
1649
|
+
ua as screenPixelsToScreenSpace,
|
|
1650
|
+
da as screenPixelsToUnits,
|
|
1651
|
+
ma as screenPointToRay,
|
|
1652
|
+
fa as screenSpaceToScreenPixels,
|
|
1653
|
+
pa as screenTransform2DScale,
|
|
1654
|
+
ha as screenUnitsToPixels,
|
|
1655
|
+
ze as serializeTrackingConfig,
|
|
1656
|
+
is as setMuted,
|
|
1657
|
+
ht as shouldDrawFallback,
|
|
1658
|
+
ee as smoothNumber,
|
|
1659
|
+
Or as smoothVector2,
|
|
1660
|
+
Gr as smoothVector3,
|
|
1661
|
+
ga as sourceToFeed,
|
|
1662
|
+
as as startMusic,
|
|
1663
|
+
ns as stopMusic,
|
|
1664
|
+
Ze as subscribeCameraPermission,
|
|
1665
|
+
ya as swapSidedName,
|
|
1666
|
+
pr as toCameraRequest,
|
|
1667
|
+
gr as toModelOptions,
|
|
1668
|
+
fr as toProviderProps,
|
|
1669
|
+
hr as toTrackerProps,
|
|
1670
|
+
cs as toggleMuted,
|
|
1671
|
+
Sa as trackerPointToScreenPixels,
|
|
1672
|
+
Ta as trackerToFeed,
|
|
1673
|
+
Ma as trackerToWorld,
|
|
1674
|
+
Ea as transform2DPixelsToNormalized,
|
|
1675
|
+
nr as useCameraPermission,
|
|
1676
|
+
Qr as useFrameCapture,
|
|
1677
|
+
Jr as useMediaRecorder,
|
|
1678
|
+
ds as useMuted,
|
|
1679
|
+
pt as usePersonMaskTexture,
|
|
1680
|
+
cn as useSceneSample,
|
|
1681
|
+
bt as useScreenRectAspect,
|
|
1682
|
+
gs as useXRAsset,
|
|
1683
|
+
Oe as useXRAssetCache,
|
|
1684
|
+
ys as useXRAssetStats,
|
|
1685
|
+
xn as useXRCapabilities,
|
|
1686
|
+
wn as useXRQuality,
|
|
1687
|
+
Ts as useXRTrackingConfig,
|
|
1688
|
+
ba as viewportSizeToTransform2DPixels,
|
|
1689
|
+
Aa as viewportToFeed,
|
|
1690
|
+
Ra as worldToFeed,
|
|
1691
|
+
Fa as worldToScreenPixels,
|
|
1692
|
+
xa as worldToTracker
|
|
713
1693
|
};
|