@vincentt-xr/sdk 2.0.0-alpha.0 → 2.0.0-alpha.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (879) hide show
  1. package/GROUNDING.md +8193 -111
  2. package/README.md +86 -52
  3. package/dist/CanonicalHeadFrame-D_0OzdB9.cjs +1 -0
  4. package/dist/CanonicalHeadFrame-DdUqF6Fv.js +1506 -0
  5. package/dist/DebuggerUI-CVuV-VJ5.cjs +1 -0
  6. package/dist/DebuggerUI-D-rcPa54.js +275 -0
  7. package/dist/FaceRetouch-C1AxBNex.js +1071 -0
  8. package/dist/FaceRetouch-D7kryDE6.cjs +134 -0
  9. package/dist/FaceSurface-CHAMEeG1.cjs +1 -0
  10. package/dist/FaceSurface-DmP9AEeC.js +27 -0
  11. package/dist/SkeletonUtils-C2r90MtN.js +21 -0
  12. package/dist/SkeletonUtils-CddIup1F.cjs +1 -0
  13. package/dist/TextLabel-XE0rQSDn.cjs +2 -0
  14. package/dist/TextLabel-c9BCucOI.js +961 -0
  15. package/dist/assets/cache.d.ts +99 -0
  16. package/dist/assets/estimate.d.ts +11 -0
  17. package/dist/assets/gltfLoader.d.ts +16 -0
  18. package/dist/assets/index.d.ts +7 -0
  19. package/dist/assets/loaders.d.ts +43 -0
  20. package/dist/assets/react.d.ts +33 -0
  21. package/dist/assets/sdkModels.d.ts +22 -0
  22. package/dist/audio/AudioEngine.d.ts +3 -1
  23. package/dist/audio/AudioPlayer.d.ts +29 -0
  24. package/dist/audio/AudioPlayerLogic.d.ts +4 -0
  25. package/dist/audio/index.d.ts +2 -0
  26. package/dist/body/__fixtures__/syntheticRig.d.ts +21 -0
  27. package/dist/body/bodyFlipGuard.d.ts +39 -0
  28. package/dist/body/bodyIdentity.d.ts +72 -0
  29. package/dist/body/bodyMask.d.ts +79 -0
  30. package/dist/body/bodyMaskMaterial.d.ts +15 -0
  31. package/dist/body/bodyPose.d.ts +58 -0
  32. package/dist/body/bodyRigFit.d.ts +148 -0
  33. package/dist/body/bodyRigSolver.d.ts +114 -0
  34. package/dist/body/bodySubject.d.ts +46 -0
  35. package/dist/body-pose/index.d.ts +521 -0
  36. package/dist/body-trigger/__fixtures__/syntheticBody.d.ts +83 -0
  37. package/dist/body-trigger/frame.d.ts +88 -0
  38. package/dist/body-trigger/index.d.ts +6 -0
  39. package/dist/body-trigger/moves.d.ts +235 -0
  40. package/dist/body-trigger/trigger.d.ts +75 -0
  41. package/dist/bodyMaskMaterial-CBWub5t_.cjs +68 -0
  42. package/dist/bodyMaskMaterial-Cs2awskk.js +207 -0
  43. package/dist/cache-2x3CUJuY.js +212 -0
  44. package/dist/cache-DL1Dbz6k.cjs +1 -0
  45. package/dist/calibration/calibration.d.ts +75 -0
  46. package/dist/calibration/index.d.ts +6 -0
  47. package/dist/calibration/storage.d.ts +13 -0
  48. package/dist/calibration/types.d.ts +53 -0
  49. package/dist/calibration/useXRCalibration.d.ts +46 -0
  50. package/dist/camera/CameraPermissionGate.d.ts +26 -0
  51. package/dist/camera/devices.d.ts +26 -0
  52. package/dist/camera/index.d.ts +8 -0
  53. package/dist/camera/permission.d.ts +86 -0
  54. package/dist/camera/useCameraPermission.d.ts +35 -0
  55. package/dist/canonicalFace-BHwyCx1c.js +9 -0
  56. package/dist/canonicalFace-C83I225R.cjs +1 -0
  57. package/dist/capabilities/detect.d.ts +45 -0
  58. package/dist/capabilities/index.d.ts +5 -0
  59. package/dist/capabilities/types.d.ts +120 -0
  60. package/dist/capabilities/useXRCapabilities.d.ts +18 -0
  61. package/dist/compat/environment.d.ts +5 -0
  62. package/dist/compat/index.d.ts +4 -0
  63. package/dist/compat/run.d.ts +18 -0
  64. package/dist/compat/scenarios.d.ts +10 -0
  65. package/dist/compat/types.d.ts +101 -0
  66. package/dist/components/Axes/index.d.ts +6 -0
  67. package/dist/components/BodyInstruction/BodyPoseHint.d.ts +63 -0
  68. package/dist/components/BodyInstruction/index.d.ts +76 -0
  69. package/dist/components/BodyInstruction/useBodyPose.d.ts +30 -0
  70. package/dist/components/BodyRig/BodyAttachment.d.ts +28 -0
  71. package/dist/components/BodyRig/BodyOccluder.d.ts +27 -0
  72. package/dist/components/BodyRig/bodyDepth.d.ts +57 -0
  73. package/dist/components/BodyRig/index.d.ts +129 -0
  74. package/dist/components/BodyRig/useBodyDepthTexture.d.ts +40 -0
  75. package/dist/components/BodyTracker/index.d.ts +26 -1
  76. package/dist/components/BodyTrigger/index.d.ts +56 -0
  77. package/dist/components/Debugger/DebuggerProvider.d.ts +14 -1
  78. package/dist/components/Debugger/DebuggerUI.d.ts +3 -1
  79. package/dist/components/FaceAtlas/FaceAtlasLayer.d.ts +114 -0
  80. package/dist/components/FaceAtlas/MadeUpCamera.d.ts +80 -0
  81. package/dist/components/FaceAtlas/constants.d.ts +8 -0
  82. package/dist/components/FaceAtlas/index.d.ts +7 -0
  83. package/dist/components/FaceAtlas/useFaceAtlasSurface.d.ts +84 -0
  84. package/dist/components/FaceAtlas/useFaceSkin.d.ts +84 -0
  85. package/dist/components/FaceCharacter/ExternalFaceMesh.d.ts +109 -0
  86. package/dist/components/FaceCharacter/FaceExpressionController.d.ts +53 -0
  87. package/dist/components/FaceCharacter/FaceMorph.d.ts +71 -0
  88. package/dist/components/FaceCharacter/FacePiercing.d.ts +65 -0
  89. package/dist/components/FaceCharacter/FaceReprojection.d.ts +85 -0
  90. package/dist/components/FaceCharacter/FaceRig.d.ts +38 -0
  91. package/dist/components/FaceCharacter/FaceSurface.d.ts +49 -0
  92. package/dist/components/FaceCharacter/FaceSurfaceOccluder.d.ts +39 -0
  93. package/dist/components/FaceCharacter/PinToFaceMesh.d.ts +68 -0
  94. package/dist/components/FaceCharacter/index.d.ts +18 -0
  95. package/dist/components/FaceCharacter/useFaceReprojector.d.ts +10 -0
  96. package/dist/components/FaceInset/FaceInset.d.ts +68 -0
  97. package/dist/components/FaceInset/frame.d.ts +94 -0
  98. package/dist/components/FaceInset/index.d.ts +6 -0
  99. package/dist/components/FaceInset/material.d.ts +40 -0
  100. package/dist/components/FaceInset/useFaceInsetTexture.d.ts +37 -0
  101. package/dist/components/FaceInstruction/FaceExpressionHint.d.ts +43 -0
  102. package/dist/components/FaceInstruction/index.d.ts +56 -0
  103. package/dist/components/FaceInstruction/useFaceExpression.d.ts +20 -0
  104. package/dist/components/FaceLiquify/FaceLiquify.d.ts +49 -0
  105. package/dist/components/FaceLiquify/debug.d.ts +37 -0
  106. package/dist/components/FaceLiquify/frame.d.ts +55 -0
  107. package/dist/components/FaceLiquify/index.d.ts +10 -0
  108. package/dist/components/FaceLiquify/material.d.ts +39 -0
  109. package/dist/components/FaceLiquify/pass.d.ts +49 -0
  110. package/dist/components/FaceLiquify/presence.d.ts +25 -0
  111. package/dist/components/FaceLiquify/presets.d.ts +82 -0
  112. package/dist/components/FaceLiquify/selfTest.d.ts +66 -0
  113. package/dist/components/FaceLiquify/target.d.ts +85 -0
  114. package/dist/components/FaceLiquify/warp.d.ts +72 -0
  115. package/dist/components/FaceMesh/FaceMeshRenderer.d.ts +25 -0
  116. package/dist/components/FaceMesh/canonical/CanonicalFaceMeshRenderer.d.ts +70 -1
  117. package/dist/components/FaceMesh/canonical/FaceMeshMaterial.d.ts +25 -0
  118. package/dist/components/FaceMesh/canonical/assets.d.ts +3 -0
  119. package/dist/components/FaceMesh/canonical/geometryGroups.d.ts +30 -0
  120. package/dist/components/FaceMesh/canonical/parseCanonicalFaceModel.d.ts +24 -0
  121. package/dist/components/FaceMesh/canonical/shaders.d.ts +2 -0
  122. package/dist/components/FaceMesh/deform.d.ts +3 -0
  123. package/dist/components/FaceMesh/index.d.ts +6 -1
  124. package/dist/components/FaceMesh/material/defaults.d.ts +74 -0
  125. package/dist/components/FaceMesh/material/index.d.ts +1 -0
  126. package/dist/components/FaceMesh/material/options.d.ts +5 -1
  127. package/dist/components/FaceMesh/material/support.d.ts +7 -2
  128. package/dist/components/FaceMesh/material/textures.d.ts +4 -0
  129. package/dist/components/FaceMesh/material/types.d.ts +4 -2
  130. package/dist/components/FaceRetouch/Background.d.ts +11 -5
  131. package/dist/components/FaceRetouch/FaceRetouch.d.ts +52 -0
  132. package/dist/components/FaceRetouch/index.d.ts +2 -6
  133. package/dist/components/FaceRetouch/landmarkMask.d.ts +4 -6
  134. package/dist/components/FaceRetouch/renderState.d.ts +19 -0
  135. package/dist/components/FaceRetouch/useFaceRetouchMask.d.ts +4 -7
  136. package/dist/components/FaceSwap/FaceMirror.d.ts +46 -0
  137. package/dist/components/FaceSwap/FaceSwap.d.ts +58 -0
  138. package/dist/components/FaceSwap/FaceTextureLayer.d.ts +72 -0
  139. package/dist/components/FaceSwap/faceSwapPlan.d.ts +91 -0
  140. package/dist/components/FaceSwap/index.d.ts +13 -0
  141. package/dist/components/FaceSwap/settings.d.ts +300 -0
  142. package/dist/components/FaceSwap/useFaceTexture.d.ts +35 -0
  143. package/dist/components/FaceSwap/useLiveFace.d.ts +38 -0
  144. package/dist/components/FaceSwap/useLiveFaceTexture.d.ts +31 -0
  145. package/dist/components/FaceTracker/index.d.ts +5 -3
  146. package/dist/components/FaceWarp3D/FaceWarp3D.d.ts +50 -0
  147. package/dist/components/FaceWarp3D/index.d.ts +2 -0
  148. package/dist/components/Faceless/Faceless.d.ts +51 -0
  149. package/dist/components/Faceless/index.d.ts +2 -0
  150. package/dist/components/GestureListener/index.d.ts +11 -0
  151. package/dist/components/HairLock/HairLock.d.ts +39 -0
  152. package/dist/components/HairLock/index.d.ts +2 -0
  153. package/dist/components/HairLock/lockGeometry.d.ts +15 -0
  154. package/dist/components/HandCutout/index.d.ts +35 -0
  155. package/dist/components/HandEffect/index.d.ts +36 -0
  156. package/dist/components/HandInstruction/HandGestureHint.d.ts +70 -0
  157. package/dist/components/HandInstruction/index.d.ts +74 -0
  158. package/dist/components/HandInstruction/useHandGesture.d.ts +22 -0
  159. package/dist/components/HandJoints2D/index.d.ts +6 -0
  160. package/dist/components/HandRig/ForearmOccluder.d.ts +29 -0
  161. package/dist/components/HandRig/HandAttachment.d.ts +34 -0
  162. package/dist/components/HandRig/HandNails.d.ts +61 -0
  163. package/dist/components/HandRig/HandOccluder.d.ts +45 -0
  164. package/dist/components/HandRig/HandTattoo.d.ts +61 -0
  165. package/dist/components/HandRig/WristAttachment.d.ts +34 -0
  166. package/dist/components/HandRig/index.d.ts +127 -0
  167. package/dist/components/HandRig/useArmMask.d.ts +29 -0
  168. package/dist/components/HandRig/wristSolve.d.ts +96 -0
  169. package/dist/components/HandTouch/HandTouch.d.ts +62 -0
  170. package/dist/components/HandTouch/Touchable.d.ts +36 -0
  171. package/dist/components/HandTouch/index.d.ts +2 -0
  172. package/dist/components/HandTracker/index.d.ts +12 -2
  173. package/dist/components/HandTracking2D/HandVisual.d.ts +12 -0
  174. package/dist/components/HandTracking2D/index.d.ts +5 -0
  175. package/dist/components/HandTracking2DController/index.d.ts +5 -0
  176. package/dist/components/HandTracking3D/index.d.ts +6 -0
  177. package/dist/components/HeadBinding/index.d.ts +14 -0
  178. package/dist/components/HeadOccluder/CanonicalHeadFrame.d.ts +22 -0
  179. package/dist/components/HeadOccluder/Earrings.d.ts +55 -0
  180. package/dist/components/HeadOccluder/HeadAttachment.d.ts +38 -0
  181. package/dist/components/HeadOccluder/NeckOccluder.d.ts +67 -0
  182. package/dist/components/HeadOccluder/earringPlacement.d.ts +31 -0
  183. package/dist/components/HeadOccluder/headAttachmentPoints.d.ts +69 -0
  184. package/dist/components/HeadOccluder/index.d.ts +57 -3
  185. package/dist/components/HeadOccluder/useCanonicalHeadFit.d.ts +36 -0
  186. package/dist/components/HeadOccluder/useLandmarkPoseFit.d.ts +80 -0
  187. package/dist/components/HolisticTracker/index.d.ts +69 -0
  188. package/dist/components/HolisticTracker/settings.d.ts +58 -0
  189. package/dist/components/HolisticTracker/signals.d.ts +49 -0
  190. package/dist/components/Instruction/HintStage.d.ts +29 -0
  191. package/dist/components/Instruction/InstructionCue.d.ts +126 -0
  192. package/dist/components/Instruction/gestureHold.d.ts +20 -0
  193. package/dist/components/Instruction/ghost.d.ts +129 -0
  194. package/dist/components/Instruction/hintBlend.d.ts +19 -0
  195. package/dist/components/Instruction/hintLook.d.ts +81 -0
  196. package/dist/components/Instruction/hintLoop.d.ts +36 -0
  197. package/dist/components/Instruction/index.d.ts +41 -0
  198. package/dist/components/Instruction/useGhostModel.d.ts +33 -0
  199. package/dist/components/Instruction/useInstructionHold.d.ts +72 -0
  200. package/dist/components/IrisEffect/IrisMaterial.d.ts +73 -0
  201. package/dist/components/IrisEffect/index.d.ts +51 -0
  202. package/dist/components/IrisEffect/settings.d.ts +117 -0
  203. package/dist/components/LightObject/index.d.ts +20 -0
  204. package/dist/components/LipEffect/LipEffect.d.ts +28 -0
  205. package/dist/components/LipEffect/LipEffectMaterial.d.ts +98 -0
  206. package/dist/components/LipEffect/LipEffects.d.ts +12 -0
  207. package/dist/components/LipEffect/defaults.d.ts +51 -0
  208. package/dist/components/LipEffect/index.d.ts +12 -0
  209. package/dist/components/LipEffect/lipShading.d.ts +73 -0
  210. package/dist/components/LipEffect/settings.d.ts +375 -0
  211. package/dist/components/LipEffect/shader.d.ts +39 -0
  212. package/dist/components/LipEffect/types.d.ts +141 -0
  213. package/dist/components/LipEffect/useLipDesignTextures.d.ts +17 -0
  214. package/dist/components/LipEffect/uvGuide.d.ts +74 -0
  215. package/dist/components/LookAt/index.d.ts +23 -0
  216. package/dist/components/Makeup/Blush.d.ts +18 -0
  217. package/dist/components/Makeup/Brows.d.ts +20 -0
  218. package/dist/components/Makeup/Contour.d.ts +17 -0
  219. package/dist/components/Makeup/Eyeliner.d.ts +20 -0
  220. package/dist/components/Makeup/Eyeshadow.d.ts +20 -0
  221. package/dist/components/Makeup/Highlighter.d.ts +18 -0
  222. package/dist/components/Makeup/MakeupDesign.d.ts +37 -0
  223. package/dist/components/Makeup/MakeupRegion.d.ts +132 -0
  224. package/dist/components/Makeup/constants.d.ts +44 -0
  225. package/dist/components/Makeup/design.d.ts +106 -0
  226. package/dist/components/Makeup/designSamples.d.ts +42 -0
  227. package/dist/components/Makeup/eyes.d.ts +114 -0
  228. package/dist/components/Makeup/fields.d.ts +10 -0
  229. package/dist/components/Makeup/geometry.d.ts +106 -0
  230. package/dist/components/Makeup/index.d.ts +26 -0
  231. package/dist/components/Makeup/looks.d.ts +28 -0
  232. package/dist/components/Makeup/material.d.ts +239 -0
  233. package/dist/components/Makeup/settings.d.ts +54 -0
  234. package/dist/components/Makeup/shades.d.ts +143 -0
  235. package/dist/components/Makeup/shapes.d.ts +27 -0
  236. package/dist/components/Makeup/skinTone.d.ts +135 -0
  237. package/dist/components/Makeup/types.d.ts +110 -0
  238. package/dist/components/Makeup/useMakeupSkinTone.d.ts +40 -0
  239. package/dist/components/MeshRenderer/index.d.ts +59 -0
  240. package/dist/components/Necklace/Necklace.d.ts +44 -0
  241. package/dist/components/Necklace/index.d.ts +1 -0
  242. package/dist/components/ParticleEmitter/ParticleEmitter.d.ts +69 -0
  243. package/dist/components/ParticleEmitter/index.d.ts +1 -0
  244. package/dist/components/PersonCutout/index.d.ts +46 -0
  245. package/dist/components/PersonCutout/personCutout.d.ts +16 -0
  246. package/dist/components/PersonCutout/personMask.d.ts +19 -0
  247. package/dist/components/PersonCutout/useBodyMaskTexture.d.ts +35 -0
  248. package/dist/components/PerspectiveCamera/index.d.ts +2 -8
  249. package/dist/components/PinToMesh/index.d.ts +47 -0
  250. package/dist/components/RenderGroupLayer/index.d.ts +6 -0
  251. package/dist/components/SceneObjectRenderer/index.d.ts +23 -0
  252. package/dist/components/Screen2D/ScreenTransformFrame.d.ts +11 -0
  253. package/dist/components/Screen2D/ScreenTransformHelpers.d.ts +19 -0
  254. package/dist/components/Screen2D/ScreenTransformInteraction.d.ts +18 -0
  255. package/dist/components/Screen2D/index.d.ts +5 -0
  256. package/dist/components/ScreenGlass/defaults.d.ts +3 -0
  257. package/dist/components/ScreenGlass/index.d.ts +5 -0
  258. package/dist/components/ScreenGlass/shaders.d.ts +2 -0
  259. package/dist/components/ScreenGlass/types.d.ts +10 -0
  260. package/dist/components/ScreenGradient/defaults.d.ts +5 -0
  261. package/dist/components/ScreenGradient/index.d.ts +5 -0
  262. package/dist/components/ScreenGradient/shaders.d.ts +2 -0
  263. package/dist/components/ScreenGradient/types.d.ts +19 -0
  264. package/dist/components/ScreenImage/ScreenImage.d.ts +4 -0
  265. package/dist/components/ScreenImage/components/DynamicTextureSync.d.ts +9 -0
  266. package/dist/components/ScreenImage/components/ScreenImageBody.d.ts +9 -0
  267. package/dist/components/ScreenImage/components/ScreenImageFrame.d.ts +9 -0
  268. package/dist/components/ScreenImage/components/ScreenImageTransformFrame.d.ts +9 -0
  269. package/dist/components/ScreenImage/fit.d.ts +52 -0
  270. package/dist/components/ScreenImage/index.d.ts +10 -0
  271. package/dist/components/ScreenImage/materials/ScreenImageBlendMaterial.d.ts +9 -0
  272. package/dist/components/ScreenImage/materials/ScreenImageMaskMaterial.d.ts +11 -0
  273. package/dist/components/ScreenImage/materials/ScreenImageMatcap.d.ts +3 -0
  274. package/dist/components/ScreenImage/source.d.ts +25 -0
  275. package/dist/components/ScreenImage/types.d.ts +64 -0
  276. package/dist/components/ScreenImage/utils/ScreenImageConstants.d.ts +9 -0
  277. package/dist/components/ScreenImage/utils/ScreenImageHelpers.d.ts +4 -0
  278. package/dist/components/ScreenShape/geometry.d.ts +5 -0
  279. package/dist/components/ScreenShape/index.d.ts +5 -0
  280. package/dist/components/ScreenShape/types.d.ts +54 -0
  281. package/dist/components/ScreenSpaceUI/ScreenTransformGuide.d.ts +15 -0
  282. package/dist/components/ScreenSpaceUI/ScreenTransformOverlayGuide.d.ts +9 -0
  283. package/dist/components/ScreenSpaceUI/index.d.ts +3 -0
  284. package/dist/components/ScreenText/components/ScreenTextBody.d.ts +2 -0
  285. package/dist/components/ScreenText/components/ScreenTextTransformFrame.d.ts +9 -0
  286. package/dist/components/ScreenText/constants.d.ts +5 -0
  287. package/dist/components/ScreenText/index.d.ts +6 -0
  288. package/dist/components/ScreenText/types.d.ts +31 -0
  289. package/dist/components/ScreenText/utils/ScreenTextHelpers.d.ts +14 -0
  290. package/dist/components/ScreenText/utils/ScreenTextMappings.d.ts +17 -0
  291. package/dist/components/SegmentationOverlay/SegmentationOverlay.d.ts +37 -0
  292. package/dist/components/SegmentationOverlay/SegmentationOverlayMaterial.d.ts +31 -0
  293. package/dist/components/SegmentationOverlay/index.d.ts +9 -0
  294. package/dist/components/SegmentationOverlay/maskTexture.d.ts +23 -0
  295. package/dist/components/SegmentationOverlay/providers.d.ts +72 -0
  296. package/dist/components/SegmentationOverlay/settings.d.ts +65 -0
  297. package/dist/components/SequentialRenderPasses/index.d.ts +6 -0
  298. package/dist/components/ShoulderOccluder/index.d.ts +46 -0
  299. package/dist/components/ShoulderOccluder/useCanonicalTorsoFit.d.ts +27 -0
  300. package/dist/components/SpringSwing/SpringSwing.d.ts +22 -0
  301. package/dist/components/SpringSwing/index.d.ts +1 -0
  302. package/dist/components/TextLabel/TextLabel.d.ts +5 -0
  303. package/dist/components/TextLabel/alignment.d.ts +4 -0
  304. package/dist/components/TextLabel/bend.d.ts +9 -0
  305. package/dist/components/TextLabel/canvas/buildTextLabelTexture.d.ts +4 -0
  306. package/dist/components/TextLabel/canvas/canvasTypography.d.ts +13 -0
  307. package/dist/components/TextLabel/canvas/drawBackground.d.ts +21 -0
  308. package/dist/components/TextLabel/canvas/drawEffects.d.ts +34 -0
  309. package/dist/components/TextLabel/canvas/drawText.d.ts +19 -0
  310. package/dist/components/TextLabel/components/TextLabelMesh.d.ts +13 -0
  311. package/dist/components/TextLabel/constants.d.ts +2 -0
  312. package/dist/components/TextLabel/hooks/useTextLabelTexture.d.ts +7 -0
  313. package/dist/components/TextLabel/index.d.ts +2 -62
  314. package/dist/components/TextLabel/layout/measurement.d.ts +8 -0
  315. package/dist/components/TextLabel/layout/resolveTextLayout.d.ts +25 -0
  316. package/dist/components/TextLabel/layout/wrapText.d.ts +6 -0
  317. package/dist/components/TextLabel/types.d.ts +337 -0
  318. package/dist/components/TrackingAnchor/index.d.ts +18 -2
  319. package/dist/components/Transform3D/index.d.ts +30 -0
  320. package/dist/components/XRMediaSurface/index.d.ts +8 -7
  321. package/dist/components/XRProvider/index.d.ts +16 -2
  322. package/dist/components/XRScene/index.d.ts +14 -3
  323. package/dist/components/XRScene/renderOutputTarget.d.ts +12 -0
  324. package/dist/components/XRViewport/XRViewport.d.ts +11 -0
  325. package/dist/components/XRViewport/components/HiddenMedia.d.ts +7 -0
  326. package/dist/components/XRViewport/components/MediaAssetPicker.d.ts +8 -0
  327. package/dist/components/XRViewport/components/MediaControlStack.d.ts +13 -0
  328. package/dist/components/XRViewport/components/XRViewportLayers.d.ts +30 -0
  329. package/dist/components/XRViewport/constants.d.ts +24 -0
  330. package/dist/components/XRViewport/contexts.d.ts +6 -0
  331. package/dist/components/XRViewport/hooks/useViewportExternalFaces.d.ts +13 -0
  332. package/dist/components/XRViewport/hooks/useViewportMediaSource.d.ts +16 -0
  333. package/dist/components/XRViewport/hooks/useViewportMediaTexture.d.ts +10 -0
  334. package/dist/components/XRViewport/hooks/useViewportPipeline.d.ts +41 -0
  335. package/dist/components/XRViewport/hooks/useViewportRenderState.d.ts +47 -0
  336. package/dist/components/XRViewport/index.d.ts +3 -101
  337. package/dist/components/XRViewport/layout.d.ts +16 -0
  338. package/dist/components/XRViewport/slots.d.ts +16 -0
  339. package/dist/components/XRViewport/types.d.ts +89 -0
  340. package/dist/components/XRViewport/useViewportSize.d.ts +3 -0
  341. package/dist/components/index.d.ts +31 -0
  342. package/dist/components/occluder/skinnedOccluder.d.ts +39 -0
  343. package/dist/config/index.d.ts +1 -1
  344. package/dist/constants/index.d.ts +4 -1
  345. package/dist/context-DTxSQvp4.js +13 -0
  346. package/dist/context-hA0Rb2Xa.cjs +1 -0
  347. package/dist/contexts-DQc7zyqT.cjs +1 -0
  348. package/dist/contexts-Y_FhdnIv.js +667 -0
  349. package/dist/coordinates/feed.d.ts +52 -0
  350. package/dist/coordinates/index.d.ts +7 -0
  351. package/dist/coordinates/side.d.ts +40 -0
  352. package/dist/coordinates/spaces.d.ts +49 -0
  353. package/dist/coordinates/viewport.d.ts +22 -0
  354. package/dist/coordinates/world.d.ts +15 -0
  355. package/dist/debug-ui/component-editor/index.d.ts +19 -0
  356. package/dist/debug-ui/default-setting/index.d.ts +37 -0
  357. package/dist/debug-ui/default-setting.cjs +21 -0
  358. package/dist/debug-ui/default-setting.js +777 -0
  359. package/dist/debug-ui/face-mesh-renderer-settings/index.d.ts +8 -0
  360. package/dist/debug-ui/face-retouch/index.d.ts +11 -0
  361. package/dist/debug-ui/face-swap-settings/index.d.ts +22 -0
  362. package/dist/debug-ui/gesture-settings/index.d.ts +14 -0
  363. package/dist/debug-ui/hand-joints-2d/index.d.ts +6 -0
  364. package/dist/debug-ui/hand-tracking-2d/index.d.ts +6 -0
  365. package/dist/debug-ui/hand-tracking-2d-controller/index.d.ts +6 -0
  366. package/dist/debug-ui/hand-tracking-3d/index.d.ts +6 -0
  367. package/dist/debug-ui/hierarchy-panel/index.d.ts +30 -0
  368. package/dist/debug-ui/holistic-tracker-settings/index.d.ts +16 -0
  369. package/dist/debug-ui/index.d.ts +61 -0
  370. package/dist/debug-ui/iris-effect-settings/index.d.ts +12 -0
  371. package/dist/debug-ui/layer-panel/index.d.ts +18 -0
  372. package/dist/debug-ui/lip-effect-settings/index.d.ts +15 -0
  373. package/dist/debug-ui/media-source/MediaSourceSwitcher.d.ts +10 -0
  374. package/dist/debug-ui/media-source/index.d.ts +6 -0
  375. package/dist/debug-ui/media-source/media-preset.d.ts +21 -0
  376. package/dist/debug-ui/media-source/session.d.ts +40 -0
  377. package/dist/debug-ui/media-source.cjs +1 -0
  378. package/dist/debug-ui/media-source.js +11 -0
  379. package/dist/debug-ui/mesh-renderer-settings/index.d.ts +6 -0
  380. package/dist/debug-ui/object-inspector-panel/index.d.ts +26 -0
  381. package/dist/debug-ui/pin-to-mesh-settings/index.d.ts +10 -0
  382. package/dist/debug-ui/product-hotspots/index.d.ts +25 -0
  383. package/dist/debug-ui/scene-editor/context.d.ts +38 -0
  384. package/dist/debug-ui/scene-editor/hierarchy-panel.d.ts +11 -0
  385. package/dist/debug-ui/scene-editor/index.d.ts +11 -0
  386. package/dist/debug-ui/scene-editor/inspector-panel.d.ts +9 -0
  387. package/dist/debug-ui/scene-editor/store-utils.d.ts +2 -0
  388. package/dist/debug-ui/scene-editor/viewport-toolbar.d.ts +4 -0
  389. package/dist/debug-ui/scene-editor/viewport.d.ts +21 -0
  390. package/dist/debug-ui/screen-glass-settings/index.d.ts +6 -0
  391. package/dist/debug-ui/screen-gradient-settings/GradientStopsEditor.d.ts +5 -0
  392. package/dist/debug-ui/screen-gradient-settings/index.d.ts +6 -0
  393. package/dist/debug-ui/screen-gradient-settings/styles.d.ts +3 -0
  394. package/dist/debug-ui/screen-image-settings/index.d.ts +11 -0
  395. package/dist/debug-ui/screen-shape-settings/index.d.ts +6 -0
  396. package/dist/debug-ui/screen-text-settings/NumberField.d.ts +9 -0
  397. package/dist/debug-ui/screen-text-settings/ScreenTextSettingsPanel.d.ts +3 -0
  398. package/dist/debug-ui/screen-text-settings/controls/NestedSection.d.ts +7 -0
  399. package/dist/debug-ui/screen-text-settings/controls/Section.d.ts +8 -0
  400. package/dist/debug-ui/screen-text-settings/controls/icons.d.ts +4 -0
  401. package/dist/debug-ui/screen-text-settings/index.d.ts +2 -0
  402. package/dist/debug-ui/screen-text-settings/sections/BackgroundSection.d.ts +8 -0
  403. package/dist/debug-ui/screen-text-settings/sections/ContentSection.d.ts +5 -0
  404. package/dist/debug-ui/screen-text-settings/sections/EffectsSection.d.ts +25 -0
  405. package/dist/debug-ui/screen-text-settings/sections/StyleSection.d.ts +5 -0
  406. package/dist/debug-ui/screen-text-settings/sections/TransformSection.d.ts +5 -0
  407. package/dist/debug-ui/screen-text-settings/sections/background/BackgroundFillControls.d.ts +2 -0
  408. package/dist/debug-ui/screen-text-settings/sections/background/BackgroundSizeControls.d.ts +2 -0
  409. package/dist/debug-ui/screen-text-settings/sections/background/BackgroundStrokeControls.d.ts +2 -0
  410. package/dist/debug-ui/screen-text-settings/sections/background/types.d.ts +7 -0
  411. package/dist/debug-ui/screen-text-settings/sections/effects/BendEffectSection.d.ts +4 -0
  412. package/dist/debug-ui/screen-text-settings/sections/effects/EffectChrome.d.ts +21 -0
  413. package/dist/debug-ui/screen-text-settings/sections/effects/GlowEffectSection.d.ts +4 -0
  414. package/dist/debug-ui/screen-text-settings/sections/effects/InnerShadowEffectSection.d.ts +4 -0
  415. package/dist/debug-ui/screen-text-settings/sections/effects/OutlineEffectSection.d.ts +4 -0
  416. package/dist/debug-ui/screen-text-settings/sections/effects/ShadowEffectSection.d.ts +4 -0
  417. package/dist/debug-ui/screen-text-settings/sections/effects/types.d.ts +14 -0
  418. package/dist/debug-ui/screen-text-settings/settings.d.ts +90 -0
  419. package/dist/debug-ui/screen-text-settings/styles.d.ts +26 -0
  420. package/dist/debug-ui/screen-text-settings/transform.d.ts +6 -0
  421. package/dist/debug-ui/screen-text-settings/types.d.ts +11 -0
  422. package/dist/debug-ui/segmentation-overlay-settings/index.d.ts +12 -0
  423. package/dist/debug-ui/settings-panel/index.d.ts +43 -0
  424. package/dist/debug-ui/shared/MaterialSection.d.ts +13 -0
  425. package/dist/debug-ui/shared/ScreenTransformSection.d.ts +32 -0
  426. package/dist/debug-ui/shared/debugWindow.d.ts +51 -0
  427. package/dist/debug-ui/transform-3d-settings/index.d.ts +11 -0
  428. package/dist/debug-ui/xr-diagnostics/index.d.ts +26 -0
  429. package/dist/debug-ui.cjs +10 -0
  430. package/dist/debug-ui.js +9051 -0
  431. package/dist/detector-K8aej4MB.js +59 -0
  432. package/dist/detector-ijypGtse.cjs +1 -0
  433. package/dist/drawNormalizedCrop-C4KFaRne.cjs +1 -0
  434. package/dist/drawNormalizedCrop-DG3gtJxf.js +135 -0
  435. package/dist/entries/all.d.ts +4 -1
  436. package/dist/entries/core.d.ts +76 -6
  437. package/dist/entries/face-effects.d.ts +130 -10
  438. package/dist/entries/instructions.d.ts +48 -0
  439. package/dist/entries/internal.d.ts +5 -2
  440. package/dist/entries/low-level.d.ts +104 -6
  441. package/dist/entries/particles.d.ts +15 -0
  442. package/dist/entries/product.d.ts +11 -0
  443. package/dist/entries/scene-object.d.ts +10 -0
  444. package/dist/entries/tracking.d.ts +110 -2
  445. package/dist/face-action/index.d.ts +34 -0
  446. package/dist/face-atlas/attributes.d.ts +30 -0
  447. package/dist/face-atlas/eyes.d.ts +272 -0
  448. package/dist/face-atlas/faceAtlas.generated.d.ts +46 -0
  449. package/dist/face-atlas/glsl/atlasVertex.d.ts +46 -0
  450. package/dist/face-atlas/glsl/common.d.ts +55 -0
  451. package/dist/face-atlas/glsl/design.d.ts +49 -0
  452. package/dist/face-atlas/glsl/eyes.d.ts +73 -0
  453. package/dist/face-atlas/glsl/finish.d.ts +24 -0
  454. package/dist/face-atlas/glsl/format.d.ts +4 -0
  455. package/dist/face-atlas/glsl/index.d.ts +59 -0
  456. package/dist/face-atlas/glsl/shading.d.ts +15 -0
  457. package/dist/face-atlas/glsl/shapes.d.ts +66 -0
  458. package/dist/face-atlas/glsl/sparkle.d.ts +19 -0
  459. package/dist/face-atlas/glsl/uniforms.d.ts +106 -0
  460. package/dist/face-atlas/guide.d.ts +51 -0
  461. package/dist/face-atlas/index.d.ts +25 -0
  462. package/dist/face-atlas/lead.d.ts +117 -0
  463. package/dist/face-atlas/madeUpCamera.d.ts +125 -0
  464. package/dist/face-atlas/masks.d.ts +53 -0
  465. package/dist/face-atlas/obj.d.ts +69 -0
  466. package/dist/face-atlas/polylines.d.ts +63 -0
  467. package/dist/face-atlas/probe/FaceSkinProbe.d.ts +208 -0
  468. package/dist/face-atlas/probe/__fixtures__/emulate.d.ts +9 -0
  469. package/dist/face-atlas/probe/__fixtures__/face.d.ts +24 -0
  470. package/dist/face-atlas/probe/constants.d.ts +137 -0
  471. package/dist/face-atlas/probe/glsl.d.ts +43 -0
  472. package/dist/face-atlas/probe/lightFit.d.ts +108 -0
  473. package/dist/face-atlas/probe/schedule.d.ts +44 -0
  474. package/dist/face-atlas/probe/selfTest.d.ts +87 -0
  475. package/dist/face-atlas/probe/stats.d.ts +143 -0
  476. package/dist/face-atlas/probe/targets.d.ts +70 -0
  477. package/dist/face-atlas/probe/unwrap.d.ts +76 -0
  478. package/dist/face-atlas/quality.d.ts +28 -0
  479. package/dist/face-atlas/regions.d.ts +31 -0
  480. package/dist/face-atlas/registry.d.ts +252 -0
  481. package/dist/face-atlas/renderState.d.ts +86 -0
  482. package/dist/face-atlas/selfOcclusion.d.ts +62 -0
  483. package/dist/face-atlas/shading.d.ts +406 -0
  484. package/dist/face-atlas/shapes.d.ts +86 -0
  485. package/dist/face-atlas/sides.d.ts +41 -0
  486. package/dist/face-atlas/skinMask.d.ts +35 -0
  487. package/dist/face-atlas/surface.d.ts +155 -0
  488. package/dist/face-atlas/topology.d.ts +44 -0
  489. package/dist/face-attribute-expression/index.d.ts +10 -0
  490. package/dist/face-character/__fixtures__/faceImageDetections.d.ts +25 -0
  491. package/dist/face-character/__fixtures__/faceNode.d.ts +22 -0
  492. package/dist/face-character/bindFaceModel.d.ts +106 -0
  493. package/dist/face-character/canonicalFace.d.ts +17 -0
  494. package/dist/face-character/canonicalFaceGeometry.d.ts +11 -0
  495. package/dist/face-character/canonicalFacePositions.d.ts +7 -0
  496. package/dist/face-character/driveFaceModel.d.ts +57 -0
  497. package/dist/face-character/expressionOutputs.d.ts +45 -0
  498. package/dist/face-character/faceExpressions.d.ts +104 -0
  499. package/dist/face-character/faceImageLandmarker.d.ts +93 -0
  500. package/dist/face-character/faceMeshBinding.d.ts +62 -0
  501. package/dist/face-character/faceMorph.d.ts +77 -0
  502. package/dist/face-character/faceMorphs.d.ts +46 -0
  503. package/dist/face-character/facePhoto.d.ts +138 -0
  504. package/dist/face-character/facePiercings.d.ts +116 -0
  505. package/dist/face-character/facePin.d.ts +131 -0
  506. package/dist/face-character/faceReprojection.d.ts +273 -0
  507. package/dist/face-character/faceReprojector.d.ts +171 -0
  508. package/dist/face-character/faceRig.d.ts +176 -0
  509. package/dist/face-character/faceSwapPresence.d.ts +85 -0
  510. package/dist/face-character/faceTexture.d.ts +169 -0
  511. package/dist/face-character/faceTextureBaker.d.ts +86 -0
  512. package/dist/face-character/faceTextureGuide.d.ts +106 -0
  513. package/dist/face-character/faceTextureStats.d.ts +298 -0
  514. package/dist/face-character/faceTransfer.d.ts +396 -0
  515. package/dist/face-character/faceTransferGeometry.d.ts +109 -0
  516. package/dist/face-character/faceTransferSelfTest.d.ts +94 -0
  517. package/dist/face-character/faceWarp3D.d.ts +101 -0
  518. package/dist/face-character/faceless.d.ts +79 -0
  519. package/dist/face-character/featureWarp.d.ts +28 -0
  520. package/dist/face-character/liveFaceRegistry.d.ts +370 -0
  521. package/dist/face-character/liveValue.d.ts +12 -0
  522. package/dist/face-character/memo.d.ts +15 -0
  523. package/dist/face-effects.cjs +2267 -195
  524. package/dist/face-effects.js +14191 -3346
  525. package/dist/face-expression/index.d.ts +182 -0
  526. package/dist/face-info/blendshapes.d.ts +3 -0
  527. package/dist/face-info/derive.d.ts +8 -0
  528. package/dist/face-info/drawFaceCrop.d.ts +10 -0
  529. package/dist/face-info/getFaceInfo.d.ts +8 -0
  530. package/dist/face-info/index.d.ts +8 -0
  531. package/dist/face-info/landmarks.d.ts +35 -0
  532. package/dist/face-info/types.d.ts +69 -0
  533. package/dist/gestures/definitions.d.ts +98 -0
  534. package/dist/gestures/detector.d.ts +87 -0
  535. package/dist/gestures/index.d.ts +8 -0
  536. package/dist/gestures/measures.d.ts +114 -0
  537. package/dist/gestures/settings.d.ts +49 -0
  538. package/dist/getFaceInfo-BafgGT27.js +62 -0
  539. package/dist/getFaceInfo-BzlwHMjX.cjs +1 -0
  540. package/dist/hand/armFit.d.ts +46 -0
  541. package/dist/hand/armMask.d.ts +190 -0
  542. package/dist/hand/forearm.d.ts +114 -0
  543. package/dist/hand/handCutout.d.ts +23 -0
  544. package/dist/hand/handCutoutRegistry.d.ts +7 -0
  545. package/dist/hand/handEffect.d.ts +38 -0
  546. package/dist/hand/handGestures.d.ts +524 -0
  547. package/dist/hand/handJoints2d.d.ts +49 -0
  548. package/dist/hand/handNail.d.ts +73 -0
  549. package/dist/hand/handPose.d.ts +98 -0
  550. package/dist/hand/handRigSolver.d.ts +159 -0
  551. package/dist/hand/handTattoo.d.ts +81 -0
  552. package/dist/hand/handTouch.d.ts +240 -0
  553. package/dist/hand/handTracking2d.d.ts +33 -0
  554. package/dist/hand/handTracking2dController.d.ts +65 -0
  555. package/dist/hand/handTracking3d.d.ts +52 -0
  556. package/dist/hand/nailImageMask.d.ts +40 -0
  557. package/dist/hand/nailMaskFingers.d.ts +23 -0
  558. package/dist/hand/nailTipRefine.d.ts +37 -0
  559. package/dist/hand/wrist.d.ts +44 -0
  560. package/dist/hand/wristFilter.d.ts +44 -0
  561. package/dist/hooks/faceResults.d.ts +1 -1
  562. package/dist/hooks/selectors.d.ts +77 -4
  563. package/dist/hooks/useBodies.d.ts +39 -0
  564. package/dist/hooks/useCalibrationFaceTracker.d.ts +1 -1
  565. package/dist/hooks/useFaceAction.d.ts +3 -0
  566. package/dist/hooks/useFaceAttributeExpression.d.ts +16 -0
  567. package/dist/hooks/useFaceDetection.d.ts +18 -0
  568. package/dist/hooks/useFaceInfo.d.ts +19 -0
  569. package/dist/hooks/useFaceInfos.d.ts +15 -0
  570. package/dist/hooks/useFaceModelAcquisition.d.ts +38 -0
  571. package/dist/hooks/useFaceResultReader.d.ts +10 -0
  572. package/dist/hooks/useFrameCapture.d.ts +18 -0
  573. package/dist/hooks/useGesture.d.ts +39 -0
  574. package/dist/hooks/useIrisTracking.d.ts +45 -0
  575. package/dist/hooks/useMediaRecorder.d.ts +14 -2
  576. package/dist/hooks/useOwnedTexture.d.ts +6 -0
  577. package/dist/hooks/useTrackerContext.d.ts +14 -2
  578. package/dist/hooks/useXRDiagnostics.d.ts +81 -0
  579. package/dist/hooks/useXRModel.d.ts +12 -0
  580. package/dist/hooks/useXRSession/facade.d.ts +47 -2
  581. package/dist/hooks/useXRSession/index.d.ts +2 -2
  582. package/dist/hooks/useXRSession/reason.d.ts +21 -0
  583. package/dist/hooks/useXRSession/registry.d.ts +23 -0
  584. package/dist/hooks/useXRSession/store.d.ts +64 -7
  585. package/dist/index-BZoBxyLn.js +1103 -0
  586. package/dist/index-By_LCo2V.cjs +1 -0
  587. package/dist/index-C-Mryx_u.cjs +21 -0
  588. package/dist/index-CKRN-xJp.js +3740 -0
  589. package/dist/index-CUldCMRl.js +188 -0
  590. package/dist/index-Cyk_VIZE.js +1432 -0
  591. package/dist/index-D-4w34GO.cjs +1 -0
  592. package/dist/index-DiIoHK_4.js +442 -0
  593. package/dist/index-Dv3WnY9n.cjs +46 -0
  594. package/dist/index-ItufYyHH.cjs +1 -0
  595. package/dist/index-S3gqudT6.cjs +1 -0
  596. package/dist/index-Sho4F4it.cjs +1 -0
  597. package/dist/index-iIQ9jBDb.js +240 -0
  598. package/dist/index-vr2ichWQ.js +190 -0
  599. package/dist/instructions.cjs +30 -0
  600. package/dist/instructions.js +1528 -0
  601. package/dist/internal-Bb9ZXbpr.cjs +1 -0
  602. package/dist/{internal-KOKJDxCG.js → internal-Gt1wn6Z3.js} +152 -127
  603. package/dist/internal.cjs +1 -1
  604. package/dist/internal.js +16 -9
  605. package/dist/iris/compute.d.ts +27 -0
  606. package/dist/iris/index.d.ts +4 -0
  607. package/dist/iris/lead.d.ts +19 -0
  608. package/dist/iris/types.d.ts +89 -0
  609. package/dist/landmarkMask-CvN-L5NT.cjs +1 -0
  610. package/dist/landmarkMask-DHivVjJm.js +225 -0
  611. package/dist/landmarks-BEjJXcnE.cjs +1 -0
  612. package/dist/landmarks-DtCAFV_m.js +76 -0
  613. package/dist/low-level.cjs +1 -1
  614. package/dist/low-level.js +1494 -629
  615. package/dist/main.cjs +1 -1
  616. package/dist/main.js +1306 -475
  617. package/dist/material/MaterialFill.d.ts +20 -0
  618. package/dist/material/MeshMaterial.d.ts +14 -0
  619. package/dist/material/index.d.ts +2 -0
  620. package/dist/models/Base/index.d.ts +49 -0
  621. package/dist/models/Body/index.d.ts +30 -1
  622. package/dist/models/Face/constants.d.ts +8 -0
  623. package/dist/models/Face/index.d.ts +5 -12
  624. package/dist/models/Face/rotation.d.ts +18 -0
  625. package/dist/models/Hand/GestureTracking.d.ts +1 -1
  626. package/dist/models/Hand/HandTracking.d.ts +19 -1
  627. package/dist/models/Holistic/index.d.ts +49 -0
  628. package/dist/models/Holistic/result.d.ts +68 -0
  629. package/dist/models/Segmentation/index.d.ts +6 -3
  630. package/dist/models/SemanticSegmentation/index.d.ts +31 -0
  631. package/dist/models/SemanticSegmentation/presets.d.ts +28 -0
  632. package/dist/models/index.d.ts +2 -0
  633. package/dist/models/nodeSource.d.ts +9 -0
  634. package/dist/particles/emission.d.ts +24 -0
  635. package/dist/particles/eyes.d.ts +24 -0
  636. package/dist/particles/glsl.d.ts +14 -0
  637. package/dist/particles/index.d.ts +10 -0
  638. package/dist/particles/motion.d.ts +42 -0
  639. package/dist/particles/presets.d.ts +12 -0
  640. package/dist/particles/ring.d.ts +58 -0
  641. package/dist/particles/selfTest.d.ts +53 -0
  642. package/dist/particles/settings.d.ts +127 -0
  643. package/dist/particles/shapes.d.ts +29 -0
  644. package/dist/particles/spawner.d.ts +71 -0
  645. package/dist/particles/system.d.ts +66 -0
  646. package/dist/particles.cjs +122 -0
  647. package/dist/particles.js +999 -0
  648. package/dist/product/ProductDimensions.d.ts +16 -0
  649. package/dist/product/ProductHotspot.d.ts +16 -0
  650. package/dist/product/ProductViewer.d.ts +9 -0
  651. package/dist/product/details.d.ts +53 -0
  652. package/dist/product/index.d.ts +14 -0
  653. package/dist/product/loadModelViewer.d.ts +4 -0
  654. package/dist/product/types.d.ts +71 -0
  655. package/dist/product/useProductAr.d.ts +37 -0
  656. package/dist/product/useProductDetails.d.ts +60 -0
  657. package/dist/product.cjs +1 -0
  658. package/dist/product.js +414 -0
  659. package/dist/providers-CEZQgz2s.cjs +62 -0
  660. package/dist/providers-CRuaD8bi.js +424 -0
  661. package/dist/quality/XRQualityController.d.ts +25 -0
  662. package/dist/quality/controller.d.ts +33 -0
  663. package/dist/quality/index.d.ts +6 -0
  664. package/dist/quality/types.d.ts +100 -0
  665. package/dist/quality/useXRQuality.d.ts +28 -0
  666. package/dist/render/layerStack.d.ts +29 -0
  667. package/dist/render/renderGroups.d.ts +47 -0
  668. package/dist/render/renderPasses.d.ts +26 -0
  669. package/dist/render/sceneBeforeRender.d.ts +12 -0
  670. package/dist/renderGroups-BADrepA1.cjs +1 -0
  671. package/dist/renderGroups-CNB99dZ2.js +152 -0
  672. package/dist/renderPasses-DgxUKn9b.cjs +158 -0
  673. package/dist/renderPasses-DuapJA6V.js +1290 -0
  674. package/dist/renderState-CJNmj5jz.js +39 -0
  675. package/dist/renderState-apSfg4eR.cjs +1 -0
  676. package/dist/scene-object/index.d.ts +146 -0
  677. package/dist/scene-object/runtimeRegistry.d.ts +14 -0
  678. package/dist/scene-object.cjs +1 -0
  679. package/dist/scene-object.js +40 -0
  680. package/dist/screen-image/screenImagePresets.d.ts +13 -0
  681. package/dist/screen-image/screenImageSettings.d.ts +57 -0
  682. package/dist/screen-text/screenTextPresets.d.ts +6 -0
  683. package/dist/screen-text/screenTextSettings.d.ts +147 -0
  684. package/dist/screen2d/coordinates.d.ts +107 -0
  685. package/dist/screen2d/index.d.ts +7 -0
  686. package/dist/screen2d/material-runtime.d.ts +32 -0
  687. package/dist/screen2d/screenTransform.d.ts +60 -0
  688. package/dist/screen2d/smoothing.d.ts +5 -0
  689. package/dist/screen2d/texture.d.ts +10 -0
  690. package/dist/screen2d/transform.d.ts +25 -0
  691. package/dist/screen2d/types.d.ts +90 -0
  692. package/dist/segmentation-BOZJdWFC.js +1911 -0
  693. package/dist/segmentation-J8GoNBvP.cjs +1 -0
  694. package/dist/segmentation2d/faceMemory.d.ts +28 -0
  695. package/dist/segmentation2d/faceRegions.d.ts +24 -0
  696. package/dist/segmentation2d/index.d.ts +9 -0
  697. package/dist/segmentation2d/maskUv.d.ts +23 -0
  698. package/dist/segmentation2d/rasterize.d.ts +14 -0
  699. package/dist/segmentation2d/types.d.ts +52 -0
  700. package/dist/selectors-BvJepq6H.js +196 -0
  701. package/dist/selectors-QB2qsaxy.cjs +1 -0
  702. package/dist/services/MetricsCollector/index.d.ts +7 -1
  703. package/dist/services/MetricsCollector/utils.d.ts +1 -1
  704. package/dist/session-BVX859as.cjs +31 -0
  705. package/dist/session-Cz8aie4K.js +493 -0
  706. package/dist/settings-BJ7FMBsO.js +111 -0
  707. package/dist/settings-C63FMBlF.cjs +1 -0
  708. package/dist/similarityFit-BFqHND2e.cjs +1 -0
  709. package/dist/similarityFit-Bbz-R8AY.js +91 -0
  710. package/dist/spring/index.d.ts +2 -0
  711. package/dist/spring/spring.d.ts +69 -0
  712. package/dist/spring/swing.d.ts +54 -0
  713. package/dist/subjects/index.d.ts +2 -0
  714. package/dist/subjects/select.d.ts +70 -0
  715. package/dist/subjects/types.d.ts +59 -0
  716. package/dist/texture/animatedTexture.d.ts +63 -0
  717. package/dist/texture/animationMath.d.ts +8 -0
  718. package/dist/texture/gifReader.d.ts +17 -0
  719. package/dist/texture/gifTextureSource.d.ts +16 -0
  720. package/dist/texture/sourceResolver.d.ts +30 -0
  721. package/dist/textures-BVwo9Z7z.js +38 -0
  722. package/dist/textures-DAfc61zz.cjs +1 -0
  723. package/dist/tracking/coordinates.d.ts +5 -0
  724. package/dist/tracking-config/apply.d.ts +57 -0
  725. package/dist/tracking-config/index.d.ts +7 -0
  726. package/dist/tracking-config/resolve.d.ts +25 -0
  727. package/dist/tracking-config/storage.d.ts +8 -0
  728. package/dist/tracking-config/types.d.ts +106 -0
  729. package/dist/tracking-config/useXRTrackingConfig.d.ts +38 -0
  730. package/dist/tracking.cjs +10 -1
  731. package/dist/tracking.js +1531 -294
  732. package/dist/trigger-D9L4GPmQ.js +3726 -0
  733. package/dist/trigger-DZ9vU7jo.cjs +147 -0
  734. package/dist/types/common.d.ts +11 -1
  735. package/dist/types/compositor.d.ts +21 -0
  736. package/dist/types/face.d.ts +21 -14
  737. package/dist/types/gesture-tracking.d.ts +2 -2
  738. package/dist/types/hand-tracking.d.ts +19 -2
  739. package/dist/types/holistic.d.ts +121 -0
  740. package/dist/types/index.d.ts +1 -1
  741. package/dist/types/model.d.ts +22 -2
  742. package/dist/types/nodes.d.ts +83 -6
  743. package/dist/types/segmentation.d.ts +26 -0
  744. package/dist/types/session.d.ts +50 -4
  745. package/dist/types/tracking.d.ts +8 -2
  746. package/dist/types/util-types.d.ts +1 -1
  747. package/dist/useBodies-BYzJpQ4L.js +75 -0
  748. package/dist/useBodies-Cxpmx6Bb.cjs +1 -0
  749. package/dist/useFaceInfo-BzEUj2OI.js +75 -0
  750. package/dist/useFaceInfo-DlLRAVNw.cjs +1 -0
  751. package/dist/useFaceResultReader-Cc4Qrutf.js +61 -0
  752. package/dist/useFaceResultReader-D3jOQNKz.cjs +1 -0
  753. package/dist/useInstructionHold-DOu-RpCM.js +53 -0
  754. package/dist/useInstructionHold-DwJY1Alr.cjs +1 -0
  755. package/dist/useIrisTracking-Bz4uLDa7.js +6190 -0
  756. package/dist/useIrisTracking-DRGWgoNy.cjs +35 -0
  757. package/dist/useLandmarkPoseFit-Bg-h9BPb.cjs +1 -0
  758. package/dist/useLandmarkPoseFit-Bmb3h6Mw.js +87 -0
  759. package/dist/useXRCapabilities-B1KLckqw.js +30 -0
  760. package/dist/useXRCapabilities-CZlPUBjF.cjs +1 -0
  761. package/dist/utils/canonicalRigidLandmarks.d.ts +8 -0
  762. package/dist/utils/drawNormalizedCrop.d.ts +22 -0
  763. package/dist/utils/fns.d.ts +6 -3
  764. package/dist/utils/headOccluderFit.d.ts +42 -0
  765. package/dist/utils/integrity.d.ts +25 -26
  766. package/dist/utils/landmarkBounds.d.ts +1 -1
  767. package/dist/utils/logger.d.ts +2 -2
  768. package/dist/utils/resolveNumFaces.d.ts +13 -0
  769. package/dist/utils/shoulderOccluderFit.d.ts +38 -0
  770. package/dist/utils/similarityFit.d.ts +23 -0
  771. package/dist/utils/updateThrottle.d.ts +2 -0
  772. package/dist/utils/useStableUniforms.d.ts +18 -0
  773. package/dist/utils/visionWasm.d.ts +18 -0
  774. package/dist/uv-BMFt19bg.cjs +1 -0
  775. package/dist/{index-BD-JWMjE.js → uv-DJU_XfmN.js} +15 -180
  776. package/dist/x-Co8jPhP0.js +127 -0
  777. package/dist/x-KC8E4Gaj.cjs +41 -0
  778. package/docs/MIGRATION_GUIDE.md +589 -0
  779. package/docs/SDK_DOCUMENTATION.md +1157 -0
  780. package/docs/api/adaptive-quality.mdx +104 -0
  781. package/docs/api/asset-lifecycle.mdx +78 -0
  782. package/docs/api/audio.mdx +36 -0
  783. package/docs/api/behavior-components.mdx +164 -0
  784. package/docs/api/body-instructions.mdx +287 -0
  785. package/docs/api/body-rig.mdx +384 -0
  786. package/docs/api/body-triggers.mdx +235 -0
  787. package/docs/api/camera-permission.mdx +142 -0
  788. package/docs/api/capture-recording.mdx +111 -0
  789. package/docs/api/coordinate-spaces.mdx +168 -0
  790. package/docs/api/cross-camera.mdx +89 -0
  791. package/docs/api/debug-ui-scene-editor.mdx +270 -0
  792. package/docs/api/diagnostics-calibration.mdx +97 -0
  793. package/docs/api/external-face-mesh.mdx +231 -0
  794. package/docs/api/face-actions.mdx +108 -0
  795. package/docs/api/face-attribute-expression.mdx +87 -0
  796. package/docs/api/face-binding-anchors.mdx +55 -0
  797. package/docs/api/face-character.mdx +157 -0
  798. package/docs/api/face-effects.mdx +28 -0
  799. package/docs/api/face-expression-controller.mdx +153 -0
  800. package/docs/api/face-info.mdx +118 -0
  801. package/docs/api/face-inset.mdx +204 -0
  802. package/docs/api/face-instructions.mdx +183 -0
  803. package/docs/api/face-liquify.mdx +196 -0
  804. package/docs/api/face-mesh.mdx +130 -0
  805. package/docs/api/face-morph.mdx +117 -0
  806. package/docs/api/face-painting.mdx +40 -0
  807. package/docs/api/face-reprojection.mdx +154 -0
  808. package/docs/api/face-retouching.mdx +81 -0
  809. package/docs/api/face-swap.mdx +350 -0
  810. package/docs/api/face-warp-3d.mdx +166 -0
  811. package/docs/api/faceless.mdx +143 -0
  812. package/docs/api/gestures.mdx +210 -0
  813. package/docs/api/hair.mdx +97 -0
  814. package/docs/api/hand-instructions.mdx +222 -0
  815. package/docs/api/hand-rig.mdx +661 -0
  816. package/docs/api/hand-touch.mdx +162 -0
  817. package/docs/api/head-occluder.mdx +563 -0
  818. package/docs/api/holistic-tracker.mdx +164 -0
  819. package/docs/api/instructions.mdx +323 -0
  820. package/docs/api/iris-tracking.mdx +247 -0
  821. package/docs/api/made-up-camera.mdx +131 -0
  822. package/docs/api/makeup-skin-tone.mdx +135 -0
  823. package/docs/api/makeup.mdx +353 -0
  824. package/docs/api/material-render-state.mdx +132 -0
  825. package/docs/api/multi-subject.mdx +185 -0
  826. package/docs/api/particles.mdx +183 -0
  827. package/docs/api/person-cutout.mdx +171 -0
  828. package/docs/api/pin-to-face-mesh.mdx +274 -0
  829. package/docs/api/product-ar.mdx +114 -0
  830. package/docs/api/product-details.mdx +78 -0
  831. package/docs/api/runtime-3d.mdx +316 -0
  832. package/docs/api/scene-object-store.mdx +213 -0
  833. package/docs/api/screen-image.mdx +67 -0
  834. package/docs/api/screen-shape.mdx +64 -0
  835. package/docs/api/screen-space-coordinates.mdx +75 -0
  836. package/docs/api/screen-text.mdx +39 -0
  837. package/docs/api/segmentation-overlay.mdx +301 -0
  838. package/docs/api/session-lifecycle.mdx +136 -0
  839. package/docs/api/texture-sources.mdx +74 -0
  840. package/docs/api/trackers.mdx +65 -0
  841. package/docs/api/tracking-config.mdx +108 -0
  842. package/docs/docs.json +121 -0
  843. package/docs/examples/lip-shaders.mdx +273 -0
  844. package/docs/examples/scene-object-recipes.mdx +194 -0
  845. package/docs/guides/face-atlas-template.svg +1 -0
  846. package/docs/guides/face-atlas-textures.mdx +186 -0
  847. package/docs/guides/face-texture-template.svg +1 -0
  848. package/docs/guides/harness-debug-ui.mdx +139 -0
  849. package/docs/guides/lip-effect-textures.mdx +368 -0
  850. package/docs/guides/lip-uv-template.png +0 -0
  851. package/docs/guides/lip-uv-template.svg +1 -0
  852. package/docs/guides/makeup-design-textures.mdx +109 -0
  853. package/docs/inspector/hierarchy-panel.mdx +51 -0
  854. package/docs/inspector/object-inspector-panel.mdx +51 -0
  855. package/docs/introduction.mdx +120 -0
  856. package/docs/scene-objects/overview.mdx +127 -0
  857. package/docs/scene-objects/render-groups.mdx +77 -0
  858. package/docs/scene-objects/runtime-rendering.mdx +75 -0
  859. package/docs/texture-api-consumer.md +84 -0
  860. package/package.json +86 -8
  861. package/settings.json +1998 -0
  862. package/dist/DebuggerUI-CEfdddkZ.cjs +0 -1
  863. package/dist/DebuggerUI-Dgop6Q6o.js +0 -269
  864. package/dist/components/FaceRetouch/retouchRegions.d.ts +0 -23
  865. package/dist/components/FaceRetouch/useFaceRetouchRegions.d.ts +0 -12
  866. package/dist/index-B5J4gzn2.cjs +0 -1
  867. package/dist/index-BVBVg96G.cjs +0 -1
  868. package/dist/index-CYMj26Ej.js +0 -1331
  869. package/dist/index-DtwHElmG.js +0 -157
  870. package/dist/index-PtFmD6B8.cjs +0 -1
  871. package/dist/internal-DH5d1Xnq.cjs +0 -1
  872. package/dist/modules/XRClient/index.d.ts +0 -9
  873. package/dist/modules/index.d.ts +0 -1
  874. package/dist/selectors-BHO6TnoC.js +0 -59
  875. package/dist/selectors-Bub0o3qy.cjs +0 -1
  876. package/dist/services/ApiService.d.ts +0 -12
  877. package/dist/types/client.d.ts +0 -3
  878. package/dist/useFaceResults-cpsSmKKc.js +0 -81
  879. package/dist/useFaceResults-hVUJYSEY.cjs +0 -1
package/dist/low-level.js CHANGED
@@ -1,80 +1,32 @@
1
- import { u as he } from "./index-BD-JWMjE.js";
2
- import { H as lt, a as ct } from "./index-BD-JWMjE.js";
3
- import { a as me } from "./selectors-BHO6TnoC.js";
4
- import { u as ut, c as ht, e as mt, b as ft, d as gt } from "./selectors-BHO6TnoC.js";
5
- import { useEffect as M, useRef as k, useState as y, useCallback as fe, useContext as ge, useMemo as G, createContext as pe, useLayoutEffect as be, Children as we, isValidElement as ve } from "react";
6
- import { u as te, c as xe } from "./useFaceResults-cpsSmKKc.js";
7
- import { u as ye, X as re } from "./index-CYMj26Ej.js";
8
- import { h as bt } from "./hasFullUnitUVBounds-BGvcFsQM.js";
9
- import { X as Ce } from "./index-DtwHElmG.js";
10
- import { c as vt, d as xt, b as yt } from "./index-DtwHElmG.js";
11
- import { jsx as f, jsxs as z, Fragment as q } from "react/jsx-runtime";
12
- import { PerspectiveCamera as Re } from "@react-three/drei";
13
- const Ee = {
14
- position: "absolute",
15
- top: -28,
16
- left: 0,
17
- background: "rgba(34, 197, 94, 0.9)",
18
- color: "#04130a",
19
- fontFamily: "Menlo, Monaco, Consolas, monospace",
20
- fontSize: 12,
21
- fontWeight: 700,
22
- padding: "4px 8px",
23
- whiteSpace: "nowrap"
24
- }, Ze = ({
25
- boundingBox: e,
26
- label: t = "face bounding box",
27
- color: n = "#22c55e",
28
- style: a,
29
- labelStyle: r
30
- }) => /* @__PURE__ */ f(
31
- "div",
32
- {
33
- style: {
34
- position: "absolute",
35
- left: `${e.left * 100}%`,
36
- top: `${e.top * 100}%`,
37
- width: `${e.width * 100}%`,
38
- height: `${e.height * 100}%`,
39
- border: `3px solid ${n}`,
40
- boxSizing: "border-box",
41
- pointerEvents: "none",
42
- zIndex: 20,
43
- ...a
44
- },
45
- children: t !== null && /* @__PURE__ */ f("div", { style: { ...Ee, ...r }, children: t })
46
- }
47
- ), et = (e) => {
48
- const { makeDefault: t = !0, ...n } = e, a = {
49
- position: [0, 0, 40],
50
- fov: 30,
51
- near: 0.1,
52
- far: 1e3,
53
- makeDefault: t,
54
- ...n
55
- };
56
- return /* @__PURE__ */ f(Re, { ...a });
57
- }, tt = ({
58
- background: e = "#000",
59
- children: t,
60
- style: n
61
- }) => /* @__PURE__ */ f(
62
- "div",
63
- {
64
- style: {
65
- position: "fixed",
66
- inset: 0,
67
- overflow: "hidden",
68
- background: e,
69
- ...n
70
- },
71
- children: t
72
- }
73
- ), $ = ({
1
+ import { u as oe, j as N, z as he, aK as P, m as ge, d as be, au as ye, s as Se, w as ee } from "./index-CKRN-xJp.js";
2
+ import { a_ as Ft, b4 as Ot, a$ as Dt, E as kt, aO as Bt, b5 as Lt, b1 as Nt, b2 as Ht, b6 as Gt, aM as Pt, aQ as Xt, F as Wt, aY as zt, b3 as Yt, aR as Vt, l as $t, aL as Ut, aP as qt, aS as Kt, b as jt, aT as Jt, b0 as Qt, aU as Zt, aV as ea, aZ as ta, a as aa, aW as ra, aX as sa, aN as na } from "./index-CKRN-xJp.js";
3
+ import { H as ia, u as la } from "./index-vr2ichWQ.js";
4
+ import { u as Re } from "./landmarks-DtCAFV_m.js";
5
+ import { b as we } from "./selectors-BvJepq6H.js";
6
+ import { m as ca, l as ua, c as ma, e as pa, g as fa, p as ha, h as ga, f as ba, i as ya, n as Sa, q as Ra, a as wa, u as _a, d as Ea, o as va, k as Ia, j as Ta } from "./selectors-BvJepq6H.js";
7
+ import { useEffect as F, useState as T, useRef as D, useCallback as _e, useLayoutEffect as Ee, useMemo as $, Children as ve, isValidElement as Ie } from "react";
8
+ import { c as Te } from "./getFaceInfo-BafgGT27.js";
9
+ import { a as Aa, b as Ma } from "./getFaceInfo-BafgGT27.js";
10
+ import { jsx as S, jsxs as k, Fragment as W } from "react/jsx-runtime";
11
+ import { PerspectiveCamera as xe } from "@react-three/drei";
12
+ import { g as Fa, b as Oa, c as Da } from "./index-CUldCMRl.js";
13
+ import { ag as ie } from "./trigger-D9L4GPmQ.js";
14
+ import { bP as Ba, bL as La, bQ as Na, bc as Ha, bd as Ga, b5 as Pa, am as Xa, as as Wa, aF as za, aG as Ya, aH as Va, at as $a, au as Ua, aI as qa, aJ as Ka, av as ja, aK as Ja, aw as Qa, aL as Za, aM as er, aN as tr, aO as ar, aP as rr, ax as sr, ay as nr, az as or, aQ as ir, aR as lr, b6 as dr, bs as cr, by as ur, bz as mr, bA as pr, bB as fr, ah as hr, bm as gr, bn as br, bW as yr, ar as Sr, bf as Rr, H as wr, bX as _r, bY as Er, e as vr, O as Ir, ai as Tr, S as xr, an as Ar, c0 as Mr, b_ as Cr, bC as Fr, b$ as Or, aS as Dr, aT as kr, aA as Br, bM as Lr, bv as Nr, aB as Hr, bb as Gr, d as Pr, aU as Xr, aV as Wr, aW as zr, aY as Yr, aZ as Vr, a_ as $r, aX as Ur, a$ as qr, b0 as Kr, b1 as jr, b2 as Jr, t as Qr, bD as Zr, c as es, v as ts, n as as, bw as rs, b9 as ss, bk as ns, b7 as os, c1 as is, bK as ls, bR as ds, bZ as cs, aj as us, bS as ms, bE as ps, bF as fs, bG as hs, bT as gs, bg as bs, bH as ys, bo as Ss, bp as Rs, bq as ws, bh as _s, bi as Es, bj as vs, bI as Is, aC as Ts, bN as xs, f as As, h as Ms, k as Cs, i as Fs, j as Os, l as Ds, m as ks, g as Bs, bt as Ls, be as Ns, ba as Hs, b8 as Gs, b3 as Ps, b4 as Xs, br as Ws, r as zs, aD as Ys, ao as Vs, ap as $s, bU as Us, p as qs, bl as Ks, bu as js, aq as Js, s as Qs, aE as Zs, q as en, ak as tn, al as an, c2 as rn, c3 as sn, bO as nn, u as on, bV as ln, bJ as dn, bx as cn } from "./trigger-D9L4GPmQ.js";
15
+ import { h as mn } from "./hasFullUnitUVBounds-BGvcFsQM.js";
16
+ import { X as Ae, a as Me, b as Ce } from "./contexts-Y_FhdnIv.js";
17
+ import { B as fn, M as hn, h as gn, i as bn, T as yn, c as Sn, j as Rn, k as wn, g as _n, e as En, f as vn, r as In, t as Tn, d as xn, u as An } from "./contexts-Y_FhdnIv.js";
18
+ import { H as Cn, p as Fn, q as On, t as Dn, u as kn, v as Bn, w as Ln, b as Nn, l as Hn, x as Gn, y as Pn, s as Xn, z as Wn } from "./index-DiIoHK_4.js";
19
+ import { b as Yn, r as Vn } from "./useBodies-BYzJpQ4L.js";
20
+ import { B as Un, d as qn, e as Kn, f as jn, g as Jn, b as Qn, h as Zn, a as eo, c as to, p as ao, s as ro, i as so } from "./bodyMaskMaterial-Cs2awskk.js";
21
+ import { c as oo, g as io, s as lo, a as co } from "./detector-K8aej4MB.js";
22
+ import { F as mo, g as po, I as fo, M as ho, j as go, k as bo, h as yo, v as So, i as Ro, c as wo, l as _o, p as Eo, w as vo, r as Io, t as To, m as xo, u as Ao, n as Mo, q as Co, o as Fo, s as Oo } from "./providers-CRuaD8bi.js";
23
+ import { S as ko, u as Bo } from "./context-DTxSQvp4.js";
24
+ import * as L from "three";
25
+ const X = ({
74
26
  children: e,
75
27
  config: t,
76
- style: n
77
- }) => /* @__PURE__ */ f(
28
+ style: r
29
+ }) => /* @__PURE__ */ S(
78
30
  "div",
79
31
  {
80
32
  "data-render-target": t.name,
@@ -86,83 +38,88 @@ const Ee = {
86
38
  pointerEvents: t.pointerEvents ?? "none",
87
39
  zIndex: t.zIndex,
88
40
  opacity: t.hidden ? 0 : 1,
89
- ...n
41
+ ...r
90
42
  },
91
43
  children: e
92
44
  }
93
- ), j = ({
45
+ ), U = ({
94
46
  canvas: e,
95
47
  layout: t,
96
- media: n,
48
+ media: r,
97
49
  mirrored: a,
98
- filter: r
50
+ filter: s
99
51
  }) => {
100
- const i = Math.round(t.destination.width), s = Math.round(t.destination.height);
101
- e.width !== i && (e.width = i), e.height !== s && (e.height = s);
102
- const o = e.getContext("2d");
103
- o && (o.setTransform(1, 0, 0, 1, 0, 0), o.clearRect(0, 0, i, s), a && (o.translate(i, 0), o.scale(-1, 1)), r && (o.filter = r), o.drawImage(n, t.offsetX, t.offsetY, t.drawWidth, t.drawHeight), r && (o.filter = "none"), o.setTransform(1, 0, 0, 1, 0, 0));
104
- }, ne = ({
52
+ const d = Math.round(t.destination.width), u = Math.round(t.destination.height);
53
+ e.width !== d && (e.width = d), e.height !== u && (e.height = u);
54
+ const c = e.getContext("2d");
55
+ c && (c.setTransform(1, 0, 0, 1, 0, 0), c.clearRect(0, 0, d, u), a && (c.translate(d, 0), c.scale(-1, 1)), s && (c.filter = s), c.drawImage(r, t.offsetX, t.offsetY, t.drawWidth, t.drawHeight), s && (c.filter = "none"), c.setTransform(1, 0, 0, 1, 0, 0));
56
+ }, le = ({
105
57
  canvasRef: e,
106
58
  enabled: t = !0,
107
- fps: n = 30,
59
+ fps: r = 30,
108
60
  imageRef: a,
109
- layout: r,
110
- mirrored: i,
111
- sourceKind: s,
112
- videoRef: o
61
+ layout: s,
62
+ mirrored: d,
63
+ sourceKind: u,
64
+ videoRef: c
113
65
  }) => {
114
- M(() => {
66
+ F(() => {
115
67
  if (!t) {
116
- const p = e.current, c = p == null ? void 0 : p.getContext("2d");
117
- p && c && c.clearRect(0, 0, p.width, p.height);
68
+ const f = e.current, g = f == null ? void 0 : f.getContext("2d");
69
+ f && g && g.clearRect(0, 0, f.width, f.height);
118
70
  return;
119
71
  }
120
- let h = 0, m = 0;
121
- const d = n > 0 ? 1e3 / n : 0, g = (p) => {
122
- if (h = requestAnimationFrame(g), d > 0 && p - m < d) return;
123
- m = p;
124
- const c = e.current;
125
- if (!c || !r) return;
126
- if (s === "image") {
127
- const w = a.current;
128
- if (!w || !w.complete || w.naturalWidth <= 0 || w.naturalHeight <= 0)
72
+ let o = 0, p = 0;
73
+ const h = r > 0 ? 1e3 / r : 0, n = (f) => {
74
+ if (o = requestAnimationFrame(n), h > 0 && f - p < h) return;
75
+ p = f;
76
+ const g = e.current;
77
+ if (!g || !s) return;
78
+ if (u === "image") {
79
+ const l = a.current;
80
+ if (!l || !l.complete || l.naturalWidth <= 0 || l.naturalHeight <= 0)
129
81
  return;
130
- j({
131
- canvas: c,
132
- layout: r,
133
- media: w,
134
- mirrored: i
82
+ U({
83
+ canvas: g,
84
+ layout: s,
85
+ media: l,
86
+ mirrored: d
135
87
  });
136
88
  return;
137
89
  }
138
- const b = o.current;
139
- !b || b.readyState < 2 || b.videoWidth <= 0 || b.videoHeight <= 0 || j({
140
- canvas: c,
141
- layout: r,
142
- media: b,
143
- mirrored: i
90
+ const i = c.current;
91
+ !i || i.readyState < 2 || i.videoWidth <= 0 || i.videoHeight <= 0 || U({
92
+ canvas: g,
93
+ layout: s,
94
+ media: i,
95
+ mirrored: d
144
96
  });
145
97
  };
146
- return h = requestAnimationFrame(g), () => {
147
- cancelAnimationFrame(h);
98
+ return o = requestAnimationFrame(n), () => {
99
+ cancelAnimationFrame(o);
148
100
  };
149
- }, [e, t, n, a, r, i, s, o]);
150
- }, Se = ({
101
+ }, [e, t, r, a, s, d, u, c]);
102
+ }, Fe = ({
151
103
  canvasRef: e,
152
104
  imageRef: t,
153
- layer: n,
105
+ layer: r,
154
106
  layout: a,
155
- mirrored: r,
156
- sourceKind: i,
157
- videoRef: s
158
- }) => (ne({
107
+ mirrored: s,
108
+ onCaptureTarget: d,
109
+ sourceKind: u,
110
+ videoRef: c
111
+ }) => (le({
159
112
  canvasRef: e,
160
113
  imageRef: t,
161
114
  layout: a,
162
- mirrored: r,
163
- sourceKind: i,
164
- videoRef: s
165
- }), /* @__PURE__ */ f($, { config: n, children: /* @__PURE__ */ f(
115
+ mirrored: s,
116
+ sourceKind: u,
117
+ videoRef: c
118
+ }), F(() => {
119
+ const o = e.current;
120
+ if (o)
121
+ return d == null || d(o), () => d == null ? void 0 : d(void 0);
122
+ }, [e, d]), /* @__PURE__ */ S(X, { config: r, children: /* @__PURE__ */ S(
166
123
  "canvas",
167
124
  {
168
125
  ref: e,
@@ -175,339 +132,84 @@ const Ee = {
175
132
  background: "#000"
176
133
  }
177
134
  }
178
- ) })), rt = ({
135
+ ) })), Rt = ({
179
136
  canvasRef: e,
180
137
  controlInsetTop: t,
181
- debugVisible: n,
138
+ debugVisible: r,
182
139
  fps: a = 15,
183
- imageRef: r,
184
- layer: i,
185
- layout: s,
186
- mirrored: o,
187
- sourceKind: h,
188
- videoRef: m,
189
- viewportSize: d
140
+ imageRef: s,
141
+ layer: d,
142
+ layout: u,
143
+ mirrored: c,
144
+ sourceKind: o,
145
+ videoRef: p,
146
+ viewportSize: h
190
147
  }) => {
191
- ne({
148
+ le({
192
149
  canvasRef: e,
193
- enabled: n,
150
+ enabled: r,
194
151
  fps: a,
195
- imageRef: r,
196
- layout: s,
197
- mirrored: o,
198
- sourceKind: h,
199
- videoRef: m
152
+ imageRef: s,
153
+ layout: u,
154
+ mirrored: c,
155
+ sourceKind: o,
156
+ videoRef: p
200
157
  });
201
- const g = Math.min(220, Math.max(120, d.width * 0.22)), p = d.width > 0 && d.height > 0 ? d.width / d.height : 1, c = Math.min(d.height - 24, Math.max(t ?? 16, 16));
202
- return /* @__PURE__ */ f($, { config: i, children: /* @__PURE__ */ f(
158
+ const n = Math.min(220, Math.max(120, h.width * 0.22)), f = h.width > 0 && h.height > 0 ? h.width / h.height : 1, g = Math.min(h.height - 24, Math.max(t ?? 16, 16));
159
+ return /* @__PURE__ */ S(X, { config: d, children: /* @__PURE__ */ S(
203
160
  "canvas",
204
161
  {
205
162
  ref: e,
206
163
  style: {
207
164
  position: "absolute",
208
165
  left: 16,
209
- top: c,
210
- width: n ? g : 1,
211
- height: n ? "auto" : 1,
212
- aspectRatio: `${p}`,
213
- opacity: n ? 0.85 : 0,
166
+ top: g,
167
+ width: r ? n : 1,
168
+ height: r ? "auto" : 1,
169
+ aspectRatio: `${f}`,
170
+ opacity: r ? 0.85 : 0,
214
171
  borderRadius: 10,
215
- border: n ? "1px solid rgba(255,255,255,0.16)" : "none",
172
+ border: r ? "1px solid rgba(255,255,255,0.16)" : "none",
216
173
  pointerEvents: "none",
217
174
  objectFit: "contain",
218
175
  background: "#000"
219
176
  }
220
177
  }
221
178
  ) });
222
- }, Ie = 5, Fe = 1, Me = (e, t) => t, ke = "brightness(2.2) contrast(1.5) saturate(1.25)", ze = ({
223
- enabled: e,
224
- displayMirrored: t,
225
- imageRef: n,
226
- layout: a,
227
- mode: r,
228
- numFaces: i,
229
- selectedSource: s,
230
- sourceStream: o,
231
- videoRef: h
232
- }) => {
233
- const { session: m } = ye(), d = k(null), g = k(!1), p = k(document.createElement("canvas")), {
234
- ready: c,
235
- node: b,
236
- error: w
237
- } = he(re.FACE_TRACKER, {
238
- numFaces: i ?? (r === "head-binding" ? Fe : Ie)
239
- }), [S, v] = y("idle"), [A, I] = y(null), F = e && c && !!b, L = te({
240
- node: F ? b : null,
241
- enabled: F,
242
- selectedSource: s,
243
- onFrame: fe(() => {
244
- I(null), v("ready");
245
- }, [])
246
- });
247
- return M(() => {
248
- if (!e || !a) return;
249
- const u = () => {
250
- const x = s === "image" ? n.current : h.current;
251
- if (x) {
252
- if (x instanceof HTMLImageElement) {
253
- if (!x.complete || x.naturalWidth <= 0 || x.naturalHeight <= 0) return;
254
- } else if (x.readyState < 2 || x.videoWidth <= 0 || x.videoHeight <= 0)
255
- return;
256
- j({
257
- canvas: p.current,
258
- layout: a,
259
- media: x,
260
- mirrored: t,
261
- filter: s === "webcam" ? ke : void 0
262
- });
263
- }
264
- };
265
- if (s === "image") {
266
- u();
267
- return;
268
- }
269
- let l = 0;
270
- const C = () => {
271
- l = requestAnimationFrame(C), u();
272
- };
273
- return l = requestAnimationFrame(C), () => cancelAnimationFrame(l);
274
- }, [t, e, n, a, s, h]), M(() => {
275
- var T;
276
- if (!e) {
277
- v("idle"), I(null), g.current = !1, d.current = null;
278
- return;
279
- }
280
- if (!a) {
281
- v("initializing");
282
- return;
283
- }
284
- const u = (o == null ? void 0 : o.id) ?? (((T = h.current) == null ? void 0 : T.srcObject) instanceof MediaStream ? h.current.srcObject.id : "none"), C = s === "webcam" ? `webcam:${u}` : s;
285
- d.current !== C && (g.current = !1, d.current = C);
286
- let x = !1;
287
- return (async () => {
288
- try {
289
- if (v("initializing"), g.current || (await m.setFrameSource({
290
- canvas: p.current,
291
- sourceKind: s
292
- }), await m.start(), g.current = !0), x) return;
293
- I(null), v("initializing");
294
- } catch (E) {
295
- if (x) return;
296
- v("error"), I(E instanceof Error ? E.message : "Failed to initialize SDK face tracking");
297
- }
298
- })(), () => {
299
- x = !0;
300
- };
301
- }, [e, a, s, m, o, h]), M(() => {
302
- !F && e && !w && v("initializing");
303
- }, [F, e, w]), M(() => {
304
- w && (v("error"), I(w.message));
305
- }, [w]), M(() => () => {
306
- g.current = !1, m.stop();
307
- }, [m]), {
308
- activeDelegate: "GPU",
309
- faces: L,
310
- status: S,
311
- error: A
312
- };
313
- }, ie = pe(null), Te = {
179
+ }, Oe = {
314
180
  audio: !1,
315
181
  video: {
316
182
  facingMode: "user",
317
183
  frameRate: { ideal: 30, max: 60 }
318
184
  }
319
- }, Xe = {
185
+ }, De = {
320
186
  name: "viewport-live",
321
187
  clearColor: "#000000",
322
188
  pointerEvents: "none",
323
189
  zIndex: 0
324
- }, Ae = {
190
+ }, ke = {
325
191
  name: "viewport-ui",
326
192
  clearColor: "transparent",
327
193
  pointerEvents: "auto",
328
194
  zIndex: 5
329
- }, Le = {
195
+ }, Be = {
330
196
  name: "viewport-scene",
331
197
  clearColor: "transparent",
332
198
  pointerEvents: "auto",
333
199
  zIndex: 1
334
- }, X = {
200
+ }, B = {
335
201
  webcam: { icon: "◉", label: "Webcam" },
336
202
  image: { icon: "▣", label: "Images" },
337
203
  video: { icon: "▶", label: "Videos" }
338
- }, K = ({ children: e }) => /* @__PURE__ */ f(q, { children: e });
339
- K.displayName = "XRViewport.Scene";
340
- const O = ({ children: e }) => /* @__PURE__ */ f(q, { children: e });
341
- O.displayName = "XRViewport.Overlay";
342
- const We = (e) => {
343
- if (!e)
344
- return { width: 0, height: 0 };
345
- const t = e.getBoundingClientRect();
346
- return {
347
- width: t.width || e.clientWidth,
348
- height: t.height || e.clientHeight
349
- };
350
- }, Be = (e) => {
351
- const [t, n] = y({ width: 0, height: 0 });
352
- return be(() => {
353
- const a = e.current;
354
- if (!a) return;
355
- let r = 0;
356
- const i = () => {
357
- const m = We(a);
358
- n(
359
- (d) => d.width === m.width && d.height === m.height ? d : m
360
- );
361
- };
362
- i(), r = requestAnimationFrame(i);
363
- const s = new ResizeObserver(() => {
364
- i(), r && cancelAnimationFrame(r), r = requestAnimationFrame(i);
365
- });
366
- s.observe(a);
367
- const o = window.visualViewport, h = () => {
368
- i(), r && cancelAnimationFrame(r), r = requestAnimationFrame(i);
369
- };
370
- return window.addEventListener("resize", h), window.addEventListener("orientationchange", h), o == null || o.addEventListener("resize", h), o == null || o.addEventListener("scroll", h), () => {
371
- r && cancelAnimationFrame(r), s.disconnect(), window.removeEventListener("resize", h), window.removeEventListener("orientationchange", h), o == null || o.removeEventListener("resize", h), o == null || o.removeEventListener("scroll", h);
372
- };
373
- }, [e]), t;
374
- }, J = (e) => {
375
- e && (e.pause(), e.removeAttribute("src"), e.srcObject = null, e.load());
376
- }, Q = (e) => {
377
- e && e.removeAttribute("src");
378
- }, He = ({
379
- enabled: e,
380
- imageAsset: t,
381
- selectedSource: n,
382
- videoAsset: a
383
- }) => {
384
- const r = k(null), i = k(null), [s, o] = y(null), [h, m] = y({ width: 0, height: 0 }), [d, g] = y("idle"), [p, c] = y(null);
385
- return M(() => {
386
- if (!e) {
387
- J(r.current), Q(i.current), o(null), m({ width: 0, height: 0 }), g("idle"), c(null);
388
- return;
389
- }
390
- let b = !1, w = null;
391
- const S = (u, l) => {
392
- b || (m({ width: u, height: l }), g("ready"), c(null));
393
- }, v = () => {
394
- J(r.current), Q(i.current), w == null || w.getTracks().forEach((u) => u.stop()), w = null, o(null);
395
- }, A = async () => {
396
- g("requesting");
397
- const u = await navigator.mediaDevices.getUserMedia(Te);
398
- if (b) {
399
- u.getTracks().forEach((C) => C.stop());
400
- return;
401
- }
402
- w = u, o(u);
403
- const l = r.current;
404
- l && (l.srcObject = u, l.muted = !0, l.playsInline = !0, l.autoplay = !0, await l.play(), S(l.videoWidth, l.videoHeight));
405
- }, I = async (u) => {
406
- g("requesting"), o(null);
407
- const l = r.current;
408
- l && (l.src = u, l.muted = !0, l.loop = !0, l.playsInline = !0, l.autoplay = !0, l.crossOrigin = "anonymous", await l.play(), S(l.videoWidth, l.videoHeight));
409
- }, F = async (u) => {
410
- g("requesting"), o(null);
411
- const l = i.current;
412
- l && (await new Promise((C, x) => {
413
- l.onload = () => C(), l.onerror = () => x(new Error("Unable to load image")), l.src = u;
414
- }), S(l.naturalWidth, l.naturalHeight));
415
- };
416
- return v(), (async () => {
417
- try {
418
- if (n === "webcam") {
419
- await A();
420
- return;
421
- }
422
- if (n === "video") {
423
- if (!(a != null && a.src))
424
- throw new Error("Missing video source");
425
- await I(a.src);
426
- return;
427
- }
428
- if (!(t != null && t.src))
429
- throw new Error("Missing image source");
430
- await F(t.src);
431
- } catch (u) {
432
- if (b) return;
433
- g("error"), c(u instanceof Error ? u.message : `Unable to initialize ${n}`);
434
- }
435
- })(), () => {
436
- b = !0, v();
437
- };
438
- }, [e, t, n, a]), {
439
- videoRef: r,
440
- imageRef: i,
441
- stream: s,
442
- mediaSize: h,
443
- status: d,
444
- error: p
445
- };
446
- }, Ve = (e, t) => e === "auto" ? t === "webcam" ? "cover" : "contain" : e, De = ({
447
- imageOptions: e,
448
- initialImageId: t,
449
- initialSource: n,
450
- initialVideoId: a,
451
- source: r,
452
- videoOptions: i
453
- }) => {
454
- var d, g, p, c;
455
- const s = (r == null ? void 0 : r.kind) ?? n ?? "webcam", o = s === "image" && e.length === 0 || s === "video" && i.length === 0 ? "webcam" : s, h = (r == null ? void 0 : r.kind) === "image" ? r.assetId ?? ((d = e[0]) == null ? void 0 : d.id) ?? "" : t ?? ((g = e[0]) == null ? void 0 : g.id) ?? "", m = (r == null ? void 0 : r.kind) === "video" ? r.assetId ?? ((p = i[0]) == null ? void 0 : p.id) ?? "" : a ?? ((c = i[0]) == null ? void 0 : c.id) ?? "";
456
- return {
457
- selectedSource: o,
458
- selectedImageId: h,
459
- selectedVideoId: m
460
- };
461
- }, _e = (e, t, n) => {
462
- if (e.width <= 0 || e.height <= 0 || t.width <= 0 || t.height <= 0)
463
- return null;
464
- const a = n === "contain" ? Math.min(t.width / e.width, t.height / e.height) : Math.max(t.width / e.width, t.height / e.height), r = e.width * a, i = e.height * a, s = (t.width - r) * 0.5, o = (t.height - i) * 0.5;
465
- return {
466
- source: e,
467
- destination: t,
468
- drawWidth: r,
469
- drawHeight: i,
470
- offsetX: s,
471
- offsetY: o,
472
- scale: a
473
- };
474
- }, $e = (e, t) => {
475
- if (e === "dom")
476
- return {
477
- sceneContent: null,
478
- overlayContent: t
479
- };
480
- let n = null, a = null;
481
- const r = [];
482
- return we.forEach(t, (i) => {
483
- var o;
484
- if (!ve(i)) {
485
- i != null && r.push(i);
486
- return;
487
- }
488
- const s = (o = i.type) == null ? void 0 : o.displayName;
489
- if (s === K.displayName) {
490
- n = i.props.children;
491
- return;
492
- }
493
- if (s === O.displayName) {
494
- a = i.props.children;
495
- return;
496
- }
497
- r.push(i);
498
- }), !a && r.length > 0 && (a = r), {
499
- sceneContent: n,
500
- overlayContent: a
501
- };
502
- }, Z = (e, t) => typeof e == "function" ? e(t) : e, nt = () => ge(ie), qe = ({
204
+ }, Le = ({
503
205
  imageRef: e,
504
206
  selectedSource: t,
505
- videoRef: n
506
- }) => /* @__PURE__ */ z(q, { children: [
507
- /* @__PURE__ */ f(
207
+ videoRef: r
208
+ }) => /* @__PURE__ */ k(W, { children: [
209
+ /* @__PURE__ */ S(
508
210
  "video",
509
211
  {
510
- ref: n,
212
+ ref: r,
511
213
  style: {
512
214
  position: "absolute",
513
215
  width: 1,
@@ -517,7 +219,7 @@ const We = (e) => {
517
219
  }
518
220
  }
519
221
  ),
520
- /* @__PURE__ */ f(
222
+ /* @__PURE__ */ S(
521
223
  "img",
522
224
  {
523
225
  ref: e,
@@ -531,13 +233,13 @@ const We = (e) => {
531
233
  }
532
234
  }
533
235
  )
534
- ] }), ee = ({
236
+ ] }), te = ({
535
237
  dock: e,
536
238
  label: t,
537
- onChange: n,
239
+ onChange: r,
538
240
  options: a,
539
- value: r
540
- }) => /* @__PURE__ */ f(
241
+ value: s
242
+ }) => /* @__PURE__ */ S(
541
243
  "div",
542
244
  {
543
245
  style: {
@@ -554,7 +256,7 @@ const We = (e) => {
554
256
  boxShadow: "0 12px 30px rgba(0,0,0,0.18)",
555
257
  backdropFilter: "blur(10px)"
556
258
  },
557
- children: /* @__PURE__ */ z(
259
+ children: /* @__PURE__ */ k(
558
260
  "label",
559
261
  {
560
262
  style: {
@@ -565,12 +267,12 @@ const We = (e) => {
565
267
  fontWeight: 700
566
268
  },
567
269
  children: [
568
- /* @__PURE__ */ f("span", { children: t }),
569
- /* @__PURE__ */ f(
270
+ /* @__PURE__ */ S("span", { children: t }),
271
+ /* @__PURE__ */ S(
570
272
  "select",
571
273
  {
572
- value: r,
573
- onChange: (i) => n(i.target.value),
274
+ value: s,
275
+ onChange: (d) => r(d.target.value),
574
276
  style: {
575
277
  minWidth: 180,
576
278
  maxWidth: "calc(100vw - 52px)",
@@ -581,7 +283,7 @@ const We = (e) => {
581
283
  color: "#e5eefb",
582
284
  padding: "0 10px"
583
285
  },
584
- children: a.map((i) => /* @__PURE__ */ f("option", { value: i.id, style: { color: "#111827" }, children: i.label }, i.id))
286
+ children: a.map((d) => /* @__PURE__ */ S("option", { value: d.id, style: { color: "#111827" }, children: d.label }, d.id))
585
287
  }
586
288
  )
587
289
  ]
@@ -591,21 +293,21 @@ const We = (e) => {
591
293
  ), Ne = ({
592
294
  dock: e,
593
295
  imageOptions: t,
594
- selectedImageId: n,
296
+ selectedImageId: r,
595
297
  selectedSource: a,
596
- selectedVideoId: r,
597
- setSelectedImageId: i,
598
- setSelectedSource: s,
599
- setSelectedVideoId: o,
600
- showMediaControls: h,
601
- videoOptions: m
298
+ selectedVideoId: s,
299
+ setSelectedImageId: d,
300
+ setSelectedSource: u,
301
+ setSelectedVideoId: c,
302
+ showMediaControls: o,
303
+ videoOptions: p
602
304
  }) => {
603
- const [d, g] = y(!1), p = ["webcam", "image", "video"].filter((c) => c === "image" ? t.length > 0 : c === "video" ? m.length > 0 : !0);
604
- return h ? d ? /* @__PURE__ */ f(
305
+ const [h, n] = T(!1), f = ["webcam", "image", "video"].filter((g) => g === "image" ? t.length > 0 : g === "video" ? p.length > 0 : !0);
306
+ return o ? h ? /* @__PURE__ */ S(
605
307
  "button",
606
308
  {
607
309
  type: "button",
608
- onClick: () => g(!1),
310
+ onClick: () => n(!1),
609
311
  "aria-label": "Open media controls",
610
312
  title: "Open media controls",
611
313
  style: {
@@ -626,8 +328,8 @@ const We = (e) => {
626
328
  },
627
329
  children: "≡"
628
330
  }
629
- ) : /* @__PURE__ */ z(q, { children: [
630
- /* @__PURE__ */ z(
331
+ ) : /* @__PURE__ */ k(W, { children: [
332
+ /* @__PURE__ */ k(
631
333
  "div",
632
334
  {
633
335
  style: {
@@ -642,7 +344,7 @@ const We = (e) => {
642
344
  maxWidth: "calc(100vw - 32px)"
643
345
  },
644
346
  children: [
645
- /* @__PURE__ */ f(
347
+ /* @__PURE__ */ S(
646
348
  "div",
647
349
  {
648
350
  style: {
@@ -657,15 +359,15 @@ const We = (e) => {
657
359
  backdropFilter: "blur(10px)",
658
360
  overflowX: "auto"
659
361
  },
660
- children: p.map((c) => {
661
- const b = c === a;
662
- return /* @__PURE__ */ z(
362
+ children: f.map((g) => {
363
+ const i = g === a;
364
+ return /* @__PURE__ */ k(
663
365
  "button",
664
366
  {
665
367
  type: "button",
666
- onClick: () => s(c),
667
- "aria-pressed": b,
668
- title: X[c].label,
368
+ onClick: () => u(g),
369
+ "aria-pressed": i,
370
+ title: B[g].label,
669
371
  style: {
670
372
  border: "none",
671
373
  borderRadius: 999,
@@ -676,26 +378,26 @@ const We = (e) => {
676
378
  alignItems: "center",
677
379
  justifyContent: "center",
678
380
  gap: 8,
679
- background: b ? "rgba(56, 189, 248, 0.18)" : "rgba(255,255,255,0.04)",
680
- color: b ? "#e0f2fe" : "rgba(229,238,251,0.82)",
381
+ background: i ? "rgba(56, 189, 248, 0.18)" : "rgba(255,255,255,0.04)",
382
+ color: i ? "#e0f2fe" : "rgba(229,238,251,0.82)",
681
383
  cursor: "pointer",
682
384
  flex: "0 0 auto"
683
385
  },
684
386
  children: [
685
- /* @__PURE__ */ f("span", { style: { fontSize: 14, lineHeight: 1 }, children: X[c].icon }),
686
- /* @__PURE__ */ f("span", { style: { fontSize: 12, fontWeight: 700, letterSpacing: "0.01em" }, children: X[c].label })
387
+ /* @__PURE__ */ S("span", { style: { fontSize: 14, lineHeight: 1 }, children: B[g].icon }),
388
+ /* @__PURE__ */ S("span", { style: { fontSize: 12, fontWeight: 700, letterSpacing: "0.01em" }, children: B[g].label })
687
389
  ]
688
390
  },
689
- c
391
+ g
690
392
  );
691
393
  })
692
394
  }
693
395
  ),
694
- /* @__PURE__ */ f(
396
+ /* @__PURE__ */ S(
695
397
  "button",
696
398
  {
697
399
  type: "button",
698
- onClick: () => g(!0),
400
+ onClick: () => n(!0),
699
401
  "aria-label": "Close media controls",
700
402
  title: "Close media controls",
701
403
  style: {
@@ -716,226 +418,1389 @@ const We = (e) => {
716
418
  ]
717
419
  }
718
420
  ),
719
- a === "image" && t.length > 0 && /* @__PURE__ */ f(
720
- ee,
421
+ a === "image" && t.length > 0 && /* @__PURE__ */ S(
422
+ te,
721
423
  {
722
424
  dock: e,
723
425
  label: "Image Asset",
724
426
  options: t,
725
- value: n,
726
- onChange: i
427
+ value: r,
428
+ onChange: d
727
429
  }
728
430
  ),
729
- a === "video" && m.length > 0 && /* @__PURE__ */ f(
730
- ee,
431
+ a === "video" && p.length > 0 && /* @__PURE__ */ S(
432
+ te,
731
433
  {
732
434
  dock: e,
733
435
  label: "Video Asset",
734
- options: m,
735
- value: r,
736
- onChange: o
436
+ options: p,
437
+ value: s,
438
+ onChange: c
737
439
  }
738
440
  )
739
441
  ] }) : null;
740
- }, Pe = ({
741
- enabled: e,
742
- selectedSource: t
743
- }) => {
744
- const n = me(re.FACE_TRACKER);
745
- return {
746
- faces: te({ node: n, enabled: e, selectedSource: t }),
747
- trackerStatus: n ? "ready" : "idle"
748
- };
749
- }, oe = ({
750
- children: e,
751
- fitMode: t = "auto",
752
- imageOptions: n = [],
753
- initialImageId: a,
754
- initialMirrored: r = !0,
755
- initialSource: i = "webcam",
756
- initialVideoId: s,
757
- mediaStrategy: o = "internal",
758
- mediaDock: h = "bottom-left",
759
- mode: m = "dom",
760
- showMediaControlsByDefault: d = !0,
761
- source: g,
762
- style: p,
763
- videoOptions: c = []
442
+ }, He = ({
443
+ containerRef: e,
444
+ displayCanvasRef: t,
445
+ imageOptions: r,
446
+ imageRef: a,
447
+ layout: s,
448
+ managesOwnMedia: d,
449
+ mediaDock: u,
450
+ mode: c,
451
+ overlayContent: o,
452
+ renderOutputs: p,
453
+ sceneContent: h,
454
+ selectedImageId: n,
455
+ selectedSource: f,
456
+ selectedVideoId: g,
457
+ setSceneRenderOutputs: i,
458
+ setSelectedImageId: l,
459
+ setSelectedSource: m,
460
+ setSelectedVideoId: y,
461
+ showMediaControls: R,
462
+ style: E,
463
+ videoOptions: _,
464
+ videoRef: I,
465
+ viewportSize: w,
466
+ mirrored: b
764
467
  }) => {
765
- const b = k(null), w = k(null), S = Be(b), v = G(
766
- () => De({
767
- imageOptions: n,
768
- initialImageId: a,
769
- initialSource: i,
770
- initialVideoId: s,
771
- source: g,
772
- videoOptions: c
773
- }),
774
- [n, a, i, s, g, c]
775
- ), [A, I] = y(r), [F, L] = y(d), [u, l] = y(
776
- v.selectedSource
777
- ), [C, x] = y(v.selectedImageId), [W, T] = y(v.selectedVideoId), E = o === "internal";
778
- M(() => {
779
- g && (l(v.selectedSource), x(v.selectedImageId), T(v.selectedVideoId));
780
- }, [v, g]);
781
- const B = n.find((U) => U.id === C) ?? n[0], H = c.find((U) => U.id === W) ?? c[0], R = He({
782
- enabled: E,
783
- imageAsset: B,
784
- selectedSource: u,
785
- videoAsset: H
786
- }), N = Ve(t, u), V = G(
787
- () => _e(R.mediaSize, S, N),
788
- [R.mediaSize, N, S]
789
- ), P = Me(u, A), D = ze({
790
- displayMirrored: P,
791
- enabled: E && R.status === "ready" && V !== null,
792
- imageRef: R.imageRef,
793
- layout: V,
794
- selectedSource: u,
795
- sourceStream: R.stream,
796
- videoRef: R.videoRef
797
- }), Y = Pe({
798
- enabled: !E,
799
- selectedSource: u
800
- }), ae = u === "image" ? `${X.image.label}: ${(B == null ? void 0 : B.label) ?? ""}` : u === "video" ? `${X.video.label}: ${(H == null ? void 0 : H.label) ?? ""}` : X.webcam.label, _ = {
801
- activeDelegate: E ? D.activeDelegate : null,
802
- faces: E ? D.faces : Y.faces,
803
- imageOptions: n,
804
- layout: V,
805
- mediaError: R.error,
806
- mediaFitMode: N,
807
- mediaLabel: ae,
808
- mediaStatus: R.status,
809
- mirrored: P,
810
- selectedImageId: C,
811
- selectedSource: u,
812
- selectedVideoId: W,
813
- setMirrored: I,
814
- setSelectedImageId: x,
815
- setSelectedSource: l,
816
- setSelectedVideoId: T,
817
- setShowMediaControls: L,
818
- showMediaControls: F,
819
- trackerError: E ? D.error : null,
820
- trackerStatus: E ? D.status : Y.trackerStatus,
821
- videoOptions: c,
822
- viewportSize: S,
823
- mediaSize: R.mediaSize
824
- }, se = typeof e == "function" ? e(_) : e, { sceneContent: le, overlayContent: ce } = $e(m, se), de = Z(
825
- le,
826
- _
827
- ), ue = Z(
828
- ce,
829
- _
830
- );
831
- return /* @__PURE__ */ f(ie.Provider, { value: _, children: /* @__PURE__ */ z(
468
+ const { session: x } = oe();
469
+ return /* @__PURE__ */ k(
832
470
  "div",
833
471
  {
834
- ref: b,
472
+ ref: e,
835
473
  style: {
836
474
  position: "fixed",
837
475
  inset: 0,
838
476
  overflow: "hidden",
839
477
  background: "#000",
840
- ...p
478
+ ...E
841
479
  },
842
480
  children: [
843
- /* @__PURE__ */ f(
844
- qe,
481
+ /* @__PURE__ */ S(Le, { imageRef: a, selectedSource: f, videoRef: I }),
482
+ c === "dom" && d && /* @__PURE__ */ S(
483
+ Fe,
845
484
  {
846
- imageRef: R.imageRef,
847
- selectedSource: u,
848
- videoRef: R.videoRef
485
+ canvasRef: t,
486
+ imageRef: a,
487
+ videoRef: I,
488
+ layer: De,
489
+ layout: s,
490
+ mirrored: b,
491
+ onCaptureTarget: x._setCaptureTarget,
492
+ sourceKind: f === "image" ? "image" : "video"
849
493
  }
850
494
  ),
851
- m === "dom" && E && /* @__PURE__ */ f(
852
- Se,
495
+ (c === "r3f" || c === "hybrid") && /* @__PURE__ */ S(X, { config: Be, children: /* @__PURE__ */ S(
496
+ Ae,
853
497
  {
854
- canvasRef: w,
855
- imageRef: R.imageRef,
856
- videoRef: R.videoRef,
857
- layer: Xe,
858
- layout: V,
859
- mirrored: P,
860
- sourceKind: u === "image" ? "image" : "video"
498
+ onRenderOutputs: i,
499
+ renderOutputs: {
500
+ sceneColor: p.sceneColor || p.finalColor,
501
+ sceneDepth: p.sceneDepth
502
+ },
503
+ renderTargetSize: w,
504
+ style: { width: "100%", height: "100%" },
505
+ children: h
861
506
  }
862
- ),
863
- (m === "r3f" || m === "hybrid") && /* @__PURE__ */ f($, { config: Le, children: /* @__PURE__ */ f(Ce, { renderTargetSize: S, style: { width: "100%", height: "100%" }, children: de }) }),
864
- /* @__PURE__ */ z($, { config: Ae, children: [
865
- E && /* @__PURE__ */ f(
507
+ ) }),
508
+ /* @__PURE__ */ k(X, { config: ke, children: [
509
+ d && /* @__PURE__ */ S(
866
510
  Ne,
867
511
  {
868
- dock: h,
869
- imageOptions: n,
870
- selectedImageId: C,
871
- selectedSource: u,
872
- selectedVideoId: W,
873
- setSelectedImageId: x,
874
- setSelectedSource: l,
875
- setSelectedVideoId: T,
876
- showMediaControls: F,
877
- videoOptions: c
512
+ dock: u,
513
+ imageOptions: r,
514
+ selectedImageId: n,
515
+ selectedSource: f,
516
+ selectedVideoId: g,
517
+ setSelectedImageId: l,
518
+ setSelectedSource: m,
519
+ setSelectedVideoId: y,
520
+ showMediaControls: R,
521
+ videoOptions: _
878
522
  }
879
523
  ),
880
- ue
524
+ o
881
525
  ] })
882
526
  ]
883
527
  }
884
- ) });
885
- };
886
- oe.Scene = K;
887
- oe.Overlay = O;
888
- const it = (e) => {
889
- const [t, n] = y(null);
890
- return M(() => {
528
+ );
529
+ }, Ge = 5, Pe = 1, Xe = (e, t) => t, We = "brightness(2.2) contrast(1.5) saturate(1.25)", ze = ({
530
+ enabled: e,
531
+ displayMirrored: t,
532
+ imageRef: r,
533
+ layout: a,
534
+ mode: s,
535
+ numFaces: d,
536
+ selectedSource: u,
537
+ sourceStream: c,
538
+ videoRef: o
539
+ }) => {
540
+ const { session: p } = oe(), h = D(null), n = D(!1), f = D(document.createElement("canvas")), {
541
+ ready: g,
542
+ node: i,
543
+ error: l
544
+ } = Re(N.FACE_TRACKER, {
545
+ numFaces: d ?? (s === "head-binding" ? Pe : Ge)
546
+ }), [m, y] = T("idle"), [R, E] = T(null), _ = e && g && !!i, I = ie({
547
+ node: _ ? i : null,
548
+ enabled: _,
549
+ selectedSource: u,
550
+ onFrame: _e(() => {
551
+ E(null), y("ready");
552
+ }, [])
553
+ });
554
+ return F(() => {
555
+ if (!e || !a) return;
556
+ const w = () => {
557
+ const v = u === "image" ? r.current : o.current;
558
+ if (v) {
559
+ if (v instanceof HTMLImageElement) {
560
+ if (!v.complete || v.naturalWidth <= 0 || v.naturalHeight <= 0) return;
561
+ } else if (v.readyState < 2 || v.videoWidth <= 0 || v.videoHeight <= 0)
562
+ return;
563
+ U({
564
+ canvas: f.current,
565
+ layout: a,
566
+ media: v,
567
+ mirrored: t,
568
+ filter: u === "webcam" ? We : void 0
569
+ });
570
+ }
571
+ };
572
+ if (u === "image") {
573
+ w();
574
+ return;
575
+ }
576
+ let b = 0;
577
+ const x = () => {
578
+ b = requestAnimationFrame(x), w();
579
+ };
580
+ return b = requestAnimationFrame(x), () => cancelAnimationFrame(b);
581
+ }, [t, e, r, a, u, o]), F(() => {
582
+ var H;
583
+ if (!e) {
584
+ y("idle"), E(null), n.current = !1, h.current = null;
585
+ return;
586
+ }
587
+ if (!a) {
588
+ y("initializing");
589
+ return;
590
+ }
591
+ const w = (c == null ? void 0 : c.id) ?? (((H = o.current) == null ? void 0 : H.srcObject) instanceof MediaStream ? o.current.srcObject.id : "none"), x = u === "webcam" ? `webcam:${w}` : u;
592
+ h.current !== x && (n.current = !1, h.current = x);
593
+ let v = !1;
594
+ return (async () => {
595
+ try {
596
+ y("initializing");
597
+ const C = !n.current;
598
+ if (C && await p.setFrameSource({
599
+ canvas: f.current,
600
+ sourceKind: u
601
+ }), await p._setRenderSize(
602
+ Math.round(a.destination.width),
603
+ Math.round(a.destination.height)
604
+ ), C && (await p.start(), n.current = !0), v) return;
605
+ E(null), y("initializing");
606
+ } catch (C) {
607
+ if (v) return;
608
+ y("error"), E(C instanceof Error ? C.message : "Failed to initialize SDK face tracking");
609
+ }
610
+ })(), () => {
611
+ v = !0;
612
+ };
613
+ }, [e, a, u, p, c, o]), F(() => {
614
+ !_ && e && !l && y("initializing");
615
+ }, [_, e, l]), F(() => {
616
+ l && (y("error"), E(l.message));
617
+ }, [l]), F(() => () => {
618
+ n.current = !1, p.stop();
619
+ }, [p]), {
620
+ activeDelegate: "GPU",
621
+ faces: I,
622
+ status: m,
623
+ error: R
624
+ };
625
+ }, Ye = (e, t) => e === "auto" ? t === "webcam" ? "cover" : "contain" : e, Ve = ({
626
+ imageOptions: e,
627
+ initialImageId: t,
628
+ initialSource: r,
629
+ initialVideoId: a,
630
+ source: s,
631
+ videoOptions: d
632
+ }) => {
633
+ var o, p, h, n;
634
+ const u = (s == null ? void 0 : s.kind) ?? r ?? "webcam";
635
+ return {
636
+ selectedSource: u === "image" && e.length === 0 || u === "video" && d.length === 0 ? "webcam" : u,
637
+ selectedImageId: (s == null ? void 0 : s.kind) === "image" ? s.assetId ?? ((o = e[0]) == null ? void 0 : o.id) ?? "" : t ?? ((p = e[0]) == null ? void 0 : p.id) ?? "",
638
+ selectedVideoId: (s == null ? void 0 : s.kind) === "video" ? s.assetId ?? ((h = d[0]) == null ? void 0 : h.id) ?? "" : a ?? ((n = d[0]) == null ? void 0 : n.id) ?? ""
639
+ };
640
+ }, $e = (e, t, r) => {
641
+ if (e.width <= 0 || e.height <= 0 || t.width <= 0 || t.height <= 0)
642
+ return null;
643
+ const a = he(e, t, r);
644
+ return a ? { source: e, destination: t, ...a } : null;
645
+ }, Ue = (e) => {
646
+ if (!e) return { width: 0, height: 0 };
647
+ const t = e.getBoundingClientRect();
648
+ return {
649
+ width: t.width || e.clientWidth,
650
+ height: t.height || e.clientHeight
651
+ };
652
+ }, qe = (e) => {
653
+ const [t, r] = T({ width: 0, height: 0 });
654
+ return Ee(() => {
655
+ const a = e.current;
656
+ if (!a) return;
657
+ let s = 0;
658
+ const d = () => {
659
+ const p = Ue(a);
660
+ r(
661
+ (h) => h.width === p.width && h.height === p.height ? h : p
662
+ );
663
+ }, u = () => {
664
+ d(), s && cancelAnimationFrame(s), s = requestAnimationFrame(d);
665
+ };
666
+ u();
667
+ const c = new ResizeObserver(u);
668
+ c.observe(a);
669
+ const o = window.visualViewport;
670
+ return window.addEventListener("resize", u), window.addEventListener("orientationchange", u), o == null || o.addEventListener("resize", u), o == null || o.addEventListener("scroll", u), () => {
671
+ s && cancelAnimationFrame(s), c.disconnect(), window.removeEventListener("resize", u), window.removeEventListener("orientationchange", u), o == null || o.removeEventListener("resize", u), o == null || o.removeEventListener("scroll", u);
672
+ };
673
+ }, [e]), t;
674
+ }, Ke = ({
675
+ enabled: e,
676
+ selectedSource: t
677
+ }) => {
678
+ const r = we(N.FACE_TRACKER);
679
+ return {
680
+ faces: ie({ node: r, enabled: e, selectedSource: t }),
681
+ trackerStatus: r ? "ready" : "idle"
682
+ };
683
+ }, ae = (e) => {
684
+ e && (e.pause(), e.removeAttribute("src"), e.srcObject = null, e.load());
685
+ }, re = (e) => {
686
+ e && e.removeAttribute("src");
687
+ }, je = ({
688
+ enabled: e,
689
+ imageAsset: t,
690
+ selectedSource: r,
691
+ videoAsset: a
692
+ }) => {
693
+ const s = D(null), d = D(null), [u, c] = T(null), [o, p] = T({ width: 0, height: 0 }), [h, n] = T("idle"), [f, g] = T(null);
694
+ return F(() => {
695
+ if (!e) {
696
+ ae(s.current), re(d.current), c(null), p({ width: 0, height: 0 }), n("idle"), g(null);
697
+ return;
698
+ }
699
+ let i = !1, l = null;
700
+ const m = (w, b) => {
701
+ i || (p({ width: w, height: b }), n("ready"), g(null));
702
+ }, y = () => {
703
+ ae(s.current), re(d.current), l == null || l.getTracks().forEach((w) => w.stop()), l = null, c(null);
704
+ }, R = async () => {
705
+ n("requesting");
706
+ const w = await navigator.mediaDevices.getUserMedia(Oe);
707
+ if (i) {
708
+ w.getTracks().forEach((x) => x.stop());
709
+ return;
710
+ }
711
+ l = w, c(w);
712
+ const b = s.current;
713
+ b && (b.srcObject = w, b.muted = !0, b.playsInline = !0, b.autoplay = !0, await b.play(), m(b.videoWidth, b.videoHeight));
714
+ }, E = async (w) => {
715
+ n("requesting"), c(null);
716
+ const b = s.current;
717
+ b && (b.src = w, b.muted = !0, b.loop = !0, b.playsInline = !0, b.autoplay = !0, b.crossOrigin = "anonymous", await b.play(), m(b.videoWidth, b.videoHeight));
718
+ }, _ = async (w) => {
719
+ n("requesting"), c(null);
720
+ const b = d.current;
721
+ b && (await new Promise((x, v) => {
722
+ b.onload = () => x(), b.onerror = () => v(new Error("Unable to load image")), b.src = w;
723
+ }), m(b.naturalWidth, b.naturalHeight));
724
+ };
725
+ return y(), (async () => {
726
+ try {
727
+ if (r === "webcam") {
728
+ await R();
729
+ return;
730
+ }
731
+ if (r === "video") {
732
+ if (!(a != null && a.src)) throw new Error("Missing video source");
733
+ await E(a.src);
734
+ return;
735
+ }
736
+ if (!(t != null && t.src)) throw new Error("Missing image source");
737
+ await _(t.src);
738
+ } catch (w) {
739
+ if (i) return;
740
+ n("error"), g(w instanceof Error ? w.message : `Unable to initialize ${r}`);
741
+ }
742
+ })(), () => {
743
+ i = !0, y();
744
+ };
745
+ }, [e, t, r, a]), {
746
+ videoRef: s,
747
+ imageRef: d,
748
+ stream: u,
749
+ mediaSize: o,
750
+ status: h,
751
+ error: f
752
+ };
753
+ }, Je = ({
754
+ enabled: e,
755
+ imageRef: t,
756
+ selectedSource: r,
757
+ status: a,
758
+ videoRef: s
759
+ }) => {
760
+ const [d, u] = T(null);
761
+ return F(() => {
762
+ if (!e || a !== "ready") {
763
+ u((p) => (p == null || p.dispose(), null));
764
+ return;
765
+ }
766
+ const c = r === "image" ? t.current : s.current;
767
+ if (!c) return;
768
+ const o = r === "image" ? new L.Texture(c) : new L.VideoTexture(c);
769
+ return o.colorSpace = L.SRGBColorSpace, o.minFilter = L.LinearFilter, o.magFilter = L.LinearFilter, o.generateMipmaps = !1, o.needsUpdate = !0, u((p) => (p == null || p.dispose(), o)), () => {
770
+ o.dispose();
771
+ };
772
+ }, [e, t, r, a, s]), d;
773
+ }, Qe = ({
774
+ externalTracker: e,
775
+ imageOptions: t,
776
+ layout: r,
777
+ managesOwnMedia: a,
778
+ mediaError: s,
779
+ mediaFitMode: d,
780
+ mediaSize: u,
781
+ mediaStatus: c,
782
+ mirrored: o,
783
+ selectedImage: p,
784
+ selectedImageId: h,
785
+ selectedSource: n,
786
+ selectedVideo: f,
787
+ selectedVideoId: g,
788
+ setMirrored: i,
789
+ setSelectedImageId: l,
790
+ setSelectedSource: m,
791
+ setSelectedVideoId: y,
792
+ setShowMediaControls: R,
793
+ showMediaControls: E,
794
+ tracker: _,
795
+ videoOptions: I,
796
+ viewportSize: w
797
+ }) => {
798
+ const b = n === "image" ? `${B.image.label}: ${(p == null ? void 0 : p.label) ?? ""}` : n === "video" ? `${B.video.label}: ${(f == null ? void 0 : f.label) ?? ""}` : B.webcam.label;
799
+ return {
800
+ activeDelegate: a ? _.activeDelegate : null,
801
+ faces: a ? _.faces : e.faces,
802
+ imageOptions: t,
803
+ layout: r,
804
+ mediaError: s,
805
+ mediaFitMode: d,
806
+ mediaLabel: b,
807
+ mediaStatus: c,
808
+ mirrored: o,
809
+ selectedImageId: h,
810
+ selectedSource: n,
811
+ selectedVideoId: g,
812
+ setMirrored: i,
813
+ setSelectedImageId: l,
814
+ setSelectedSource: m,
815
+ setSelectedVideoId: y,
816
+ setShowMediaControls: R,
817
+ showMediaControls: E,
818
+ trackerError: a ? _.error : null,
819
+ trackerStatus: a ? _.status : e.trackerStatus,
820
+ videoOptions: I,
821
+ viewportSize: w,
822
+ mediaSize: u
823
+ };
824
+ }, Ze = ({
825
+ mediaTexture: e,
826
+ previewMode: t,
827
+ renderOutputs: r,
828
+ sceneRenderOutputs: a
829
+ }) => $(
830
+ () => ({
831
+ requested: r,
832
+ previewMode: t,
833
+ mediaColorTexture: e,
834
+ sceneColorTexture: a.sceneColorTexture,
835
+ finalColorTexture: r.finalColor ? a.sceneColorTexture : null,
836
+ sceneDepthTexture: a.sceneDepthTexture,
837
+ estimatedDepthTexture: null,
838
+ available: {
839
+ mediaColor: e !== null,
840
+ sceneColor: a.sceneColorTexture !== null,
841
+ finalColor: !!(r.finalColor && a.sceneColorTexture),
842
+ sceneDepth: a.sceneDepthTexture !== null,
843
+ estimatedDepth: !1
844
+ }
845
+ }),
846
+ [e, t, r, a]
847
+ ), et = ({
848
+ fitMode: e,
849
+ imageOptions: t,
850
+ initialImageId: r,
851
+ initialMirrored: a,
852
+ initialSource: s,
853
+ initialVideoId: d,
854
+ mediaStrategy: u,
855
+ previewMode: c,
856
+ renderOutputs: o,
857
+ showMediaControlsByDefault: p,
858
+ source: h,
859
+ videoOptions: n
860
+ }) => {
861
+ const f = D(null), g = D(null), i = qe(f), l = $(
862
+ () => Ve({
863
+ imageOptions: t,
864
+ initialImageId: r,
865
+ initialSource: s,
866
+ initialVideoId: d,
867
+ source: h,
868
+ videoOptions: n
869
+ }),
870
+ [t, r, s, d, h, n]
871
+ ), [m, y] = T(a), [R, E] = T(p), [_, I] = T(
872
+ l.selectedSource
873
+ ), [w, b] = T(l.selectedImageId), [x, v] = T(l.selectedVideoId), [J, H] = T({
874
+ sceneColorTexture: null,
875
+ sceneDepthTexture: null
876
+ }), C = u === "internal";
877
+ F(() => {
878
+ h && (I(l.selectedSource), b(l.selectedImageId), v(l.selectedVideoId));
879
+ }, [l, h]);
880
+ const Q = t.find((V) => V.id === w) ?? t[0], Z = n.find((V) => V.id === x) ?? n[0], A = je({
881
+ enabled: C,
882
+ imageAsset: Q,
883
+ selectedSource: _,
884
+ videoAsset: Z
885
+ }), z = Ye(e, _), G = $(
886
+ () => $e(A.mediaSize, i, z),
887
+ [A.mediaSize, z, i]
888
+ ), ce = Je({
889
+ enabled: !!(o.mediaColor || o.finalColor),
890
+ imageRef: A.imageRef,
891
+ selectedSource: _,
892
+ status: A.status,
893
+ videoRef: A.videoRef
894
+ }), Y = Xe(_, m), ue = ze({
895
+ displayMirrored: Y,
896
+ enabled: C && A.status === "ready" && G !== null,
897
+ imageRef: A.imageRef,
898
+ layout: G,
899
+ selectedSource: _,
900
+ sourceStream: A.stream,
901
+ videoRef: A.videoRef
902
+ }), me = Ke({
903
+ enabled: !C,
904
+ selectedSource: _
905
+ }), pe = Qe({
906
+ externalTracker: me,
907
+ imageOptions: t,
908
+ layout: G,
909
+ managesOwnMedia: C,
910
+ mediaError: A.error,
911
+ mediaFitMode: z,
912
+ mediaSize: A.mediaSize,
913
+ mediaStatus: A.status,
914
+ mirrored: Y,
915
+ selectedImage: Q,
916
+ selectedImageId: w,
917
+ selectedSource: _,
918
+ selectedVideo: Z,
919
+ selectedVideoId: x,
920
+ setMirrored: y,
921
+ setSelectedImageId: b,
922
+ setSelectedSource: I,
923
+ setSelectedVideoId: v,
924
+ setShowMediaControls: E,
925
+ showMediaControls: R,
926
+ tracker: ue,
927
+ videoOptions: n,
928
+ viewportSize: i
929
+ }), fe = Ze({
930
+ mediaTexture: ce,
931
+ previewMode: c,
932
+ renderOutputs: o,
933
+ sceneRenderOutputs: J
934
+ });
935
+ return {
936
+ containerRef: f,
937
+ displayCanvasRef: g,
938
+ displayMirrored: Y,
939
+ layout: G,
940
+ managesOwnMedia: C,
941
+ media: A,
942
+ renderOutputState: fe,
943
+ renderState: pe,
944
+ selectedImageId: w,
945
+ selectedSource: _,
946
+ selectedVideoId: x,
947
+ setSceneRenderOutputs: H,
948
+ setSelectedImageId: b,
949
+ setSelectedSource: I,
950
+ setSelectedVideoId: v,
951
+ showMediaControls: R,
952
+ viewportSize: i
953
+ };
954
+ }, K = ({ children: e }) => /* @__PURE__ */ S(W, { children: e });
955
+ K.displayName = "XRViewport.Scene";
956
+ const j = ({ children: e }) => /* @__PURE__ */ S(W, { children: e });
957
+ j.displayName = "XRViewport.Overlay";
958
+ const tt = (e, t) => {
959
+ if (e === "dom")
960
+ return {
961
+ sceneContent: null,
962
+ overlayContent: t
963
+ };
964
+ let r = null, a = null;
965
+ const s = [];
966
+ return ve.forEach(t, (d) => {
967
+ var c;
968
+ if (!Ie(d)) {
969
+ d != null && s.push(d);
970
+ return;
971
+ }
972
+ const u = (c = d.type) == null ? void 0 : c.displayName;
973
+ if (u === K.displayName) {
974
+ r = d.props.children;
975
+ return;
976
+ }
977
+ if (u === j.displayName) {
978
+ a = d.props.children;
979
+ return;
980
+ }
981
+ s.push(d);
982
+ }), !a && s.length > 0 && (a = s), {
983
+ sceneContent: r,
984
+ overlayContent: a
985
+ };
986
+ }, se = (e, t) => typeof e == "function" ? e(t) : e;
987
+ function at(e) {
988
+ return e.Scene = K, e.Overlay = j, e;
989
+ }
990
+ const wt = at(({
991
+ children: e,
992
+ fitMode: t = "auto",
993
+ imageOptions: r = [],
994
+ initialImageId: a,
995
+ initialMirrored: s = !0,
996
+ initialSource: d = "webcam",
997
+ initialVideoId: u,
998
+ mediaStrategy: c = "internal",
999
+ mediaDock: o = "bottom-left",
1000
+ mode: p = "dom",
1001
+ previewMode: h = "finalColor",
1002
+ renderOutputs: n = {},
1003
+ showMediaControlsByDefault: f = !0,
1004
+ source: g,
1005
+ style: i,
1006
+ videoOptions: l = []
1007
+ }) => {
1008
+ const m = et({
1009
+ fitMode: t,
1010
+ imageOptions: r,
1011
+ initialImageId: a,
1012
+ initialMirrored: s,
1013
+ initialSource: d,
1014
+ initialVideoId: u,
1015
+ mediaStrategy: c,
1016
+ previewMode: h,
1017
+ renderOutputs: n,
1018
+ showMediaControlsByDefault: f,
1019
+ source: g,
1020
+ videoOptions: l
1021
+ }), y = typeof e == "function" ? e(m.renderState) : e, { sceneContent: R, overlayContent: E } = tt(p, y), _ = se(
1022
+ R,
1023
+ m.renderState
1024
+ ), I = se(
1025
+ E,
1026
+ m.renderState
1027
+ );
1028
+ return /* @__PURE__ */ S(Me.Provider, { value: m.renderState, children: /* @__PURE__ */ S(Ce.Provider, { value: m.renderOutputState, children: /* @__PURE__ */ S(
1029
+ He,
1030
+ {
1031
+ containerRef: m.containerRef,
1032
+ displayCanvasRef: m.displayCanvasRef,
1033
+ imageOptions: r,
1034
+ imageRef: m.media.imageRef,
1035
+ layout: m.layout,
1036
+ managesOwnMedia: m.managesOwnMedia,
1037
+ mediaDock: o,
1038
+ mirrored: m.displayMirrored,
1039
+ mode: p,
1040
+ overlayContent: I,
1041
+ renderOutputs: n,
1042
+ sceneContent: _,
1043
+ selectedImageId: m.selectedImageId,
1044
+ selectedSource: m.selectedSource,
1045
+ selectedVideoId: m.selectedVideoId,
1046
+ setSceneRenderOutputs: m.setSceneRenderOutputs,
1047
+ setSelectedImageId: m.setSelectedImageId,
1048
+ setSelectedSource: m.setSelectedSource,
1049
+ setSelectedVideoId: m.setSelectedVideoId,
1050
+ showMediaControls: m.showMediaControls,
1051
+ style: i,
1052
+ videoOptions: l,
1053
+ videoRef: m.media.videoRef,
1054
+ viewportSize: m.viewportSize
1055
+ }
1056
+ ) }) });
1057
+ }), rt = {
1058
+ position: "absolute",
1059
+ top: -28,
1060
+ left: 0,
1061
+ background: "rgba(34, 197, 94, 0.9)",
1062
+ color: "#04130a",
1063
+ fontFamily: "Menlo, Monaco, Consolas, monospace",
1064
+ fontSize: 12,
1065
+ fontWeight: 700,
1066
+ padding: "4px 8px",
1067
+ whiteSpace: "nowrap"
1068
+ }, _t = ({
1069
+ boundingBox: e,
1070
+ label: t = "face bounding box",
1071
+ color: r = "#22c55e",
1072
+ style: a,
1073
+ labelStyle: s
1074
+ }) => /* @__PURE__ */ S(
1075
+ "div",
1076
+ {
1077
+ style: {
1078
+ position: "absolute",
1079
+ left: `${e.left * 100}%`,
1080
+ top: `${e.top * 100}%`,
1081
+ width: `${e.width * 100}%`,
1082
+ height: `${e.height * 100}%`,
1083
+ border: `3px solid ${r}`,
1084
+ boxSizing: "border-box",
1085
+ pointerEvents: "none",
1086
+ zIndex: 20,
1087
+ ...a
1088
+ },
1089
+ children: t !== null && /* @__PURE__ */ S("div", { style: { ...rt, ...s }, children: t })
1090
+ }
1091
+ ), q = [
1092
+ {
1093
+ id: "capabilities",
1094
+ title: "Capability report",
1095
+ steps: "Run detectXRCapabilities with model probes.",
1096
+ expect: "Rendering supported (WebGL, OffscreenCanvas, WebAssembly); camera not unsupported; model assets reachable.",
1097
+ mode: "automated",
1098
+ layer: "capability"
1099
+ },
1100
+ {
1101
+ id: "session-start",
1102
+ title: "Session binds and starts",
1103
+ steps: "setMediaSource (webcam or the supplied stream) and start().",
1104
+ expect: "Lifecycle reaches running within the timeout; feed frames advance.",
1105
+ mode: "automated",
1106
+ layer: "lifecycle"
1107
+ },
1108
+ {
1109
+ id: "model-ready",
1110
+ title: "Tracker models initialize",
1111
+ steps: "Acquire each requested model and wait for ready.",
1112
+ expect: "Every model reaches ready; none errors.",
1113
+ mode: "automated",
1114
+ layer: "model"
1115
+ },
1116
+ {
1117
+ id: "model-detects",
1118
+ title: "Trackers run inference",
1119
+ steps: "Sample diagnostics while running.",
1120
+ expect: "Each ready model reports inferences > 0 (detection itself needs a subject in frame).",
1121
+ mode: "automated",
1122
+ layer: "model"
1123
+ },
1124
+ {
1125
+ id: "pause-resume",
1126
+ title: "Pause and resume",
1127
+ steps: "session.pause(), then resume().",
1128
+ expect: "Lifecycle paused then running; feed resumes.",
1129
+ mode: "automated",
1130
+ layer: "lifecycle"
1131
+ },
1132
+ {
1133
+ id: "stop-start",
1134
+ title: "Stop and rebind",
1135
+ steps: "session.stop(), then setMediaSource + start() again.",
1136
+ expect: "Lifecycle stopped then running on the same source.",
1137
+ mode: "automated",
1138
+ layer: "lifecycle"
1139
+ },
1140
+ {
1141
+ id: "performance",
1142
+ title: "Performance sample",
1143
+ steps: "Measure frame rate and tracker inference over the window.",
1144
+ expect: "Frame rate ≥ 20 fps and total inference ≤ 50 ms while running.",
1145
+ mode: "automated",
1146
+ layer: "performance"
1147
+ }
1148
+ ], st = [
1149
+ {
1150
+ id: "permission-prompt",
1151
+ title: "First-visit permission prompt",
1152
+ steps: "Open the app in a fresh profile; tap Allow on the prompt.",
1153
+ expect: "Camera starts; no second prompt on reload.",
1154
+ mode: "manual",
1155
+ layer: "capability"
1156
+ },
1157
+ {
1158
+ id: "permission-blocked",
1159
+ title: "Blocked camera recovers",
1160
+ steps: "Block the camera in site settings, reload, then allow it from the address bar.",
1161
+ expect: "Gate shows blocked with instructions; allowing flips it without a reload.",
1162
+ mode: "manual",
1163
+ layer: "capability"
1164
+ },
1165
+ {
1166
+ id: "rear-camera",
1167
+ title: "Rear camera",
1168
+ steps: "Switch front → rear on /camera.",
1169
+ expect: "Rear feed is straight (text readable); tracking stays aligned.",
1170
+ mode: "manual",
1171
+ layer: "lifecycle"
1172
+ },
1173
+ {
1174
+ id: "orientation",
1175
+ title: "Rotate the device",
1176
+ steps: "Rotate portrait ↔ landscape while tracking a face.",
1177
+ expect: "Anchored content stays on the face; no stretched feed.",
1178
+ mode: "manual",
1179
+ layer: "lifecycle"
1180
+ },
1181
+ {
1182
+ id: "background-foreground",
1183
+ title: "Background and return",
1184
+ steps: "Switch apps / lock the screen for 10 s and come back.",
1185
+ expect: "Feed resumes by itself; no frozen frame; trackers continue.",
1186
+ mode: "manual",
1187
+ layer: "lifecycle"
1188
+ },
1189
+ {
1190
+ id: "camera-interrupted",
1191
+ title: "Camera taken by another app",
1192
+ steps: "Take a call or open the native camera, then return.",
1193
+ expect: "Session reports camera-lost and recovers on retry.",
1194
+ mode: "manual",
1195
+ layer: "lifecycle"
1196
+ },
1197
+ {
1198
+ id: "thermal",
1199
+ title: "Sustained use",
1200
+ steps: "Run face + body tracking for 5 minutes.",
1201
+ expect: "Adaptive quality steps down before the frame rate collapses; no crash.",
1202
+ mode: "manual",
1203
+ layer: "performance"
1204
+ },
1205
+ {
1206
+ id: "low-end",
1207
+ title: "Low-end device",
1208
+ steps: "Run the automated set on the slowest supported device.",
1209
+ expect: "All pass; performance may land on the low tier.",
1210
+ mode: "manual",
1211
+ layer: "performance"
1212
+ }
1213
+ ], Et = (e) => q.find((t) => t.id === e) ?? st.find((t) => t.id === e), M = (e, t) => {
1214
+ const r = e.match(t);
1215
+ return r ? r[1] : "";
1216
+ }, nt = (e) => {
1217
+ const t = /iPhone|iPad|iPod/.test(e) || /Macintosh/.test(e) && /Mobile/.test(e), r = /Android/.test(e);
1218
+ let a = { name: "unknown", version: "" };
1219
+ /Edg\//.test(e) ? a = { name: "Edge", version: M(e, /Edg\/(\d+)/) } : /OPR\//.test(e) ? a = { name: "Opera", version: M(e, /OPR\/(\d+)/) } : /SamsungBrowser\//.test(e) ? a = { name: "Samsung Internet", version: M(e, /SamsungBrowser\/(\d+)/) } : /CriOS\//.test(e) ? a = { name: "Chrome iOS", version: M(e, /CriOS\/(\d+)/) } : /FxiOS\//.test(e) ? a = { name: "Firefox iOS", version: M(e, /FxiOS\/(\d+)/) } : /Firefox\//.test(e) ? a = { name: "Firefox", version: M(e, /Firefox\/(\d+)/) } : /Chrome\//.test(e) ? a = { name: "Chrome", version: M(e, /Chrome\/(\d+)/) } : /Safari\//.test(e) && (a = { name: "Safari", version: M(e, /Version\/(\d+)/) });
1220
+ let s = { name: "unknown", version: "" };
1221
+ return t ? s = { name: "iOS", version: M(e, /OS (\d+[._]\d+)/).replace("_", ".") } : r ? s = { name: "Android", version: M(e, /Android (\d+(?:\.\d+)?)/) } : /Mac OS X/.test(e) ? s = { name: "macOS", version: M(e, /Mac OS X (\d+[._]\d+)/).replace("_", ".") } : /Windows NT/.test(e) ? s = { name: "Windows", version: M(e, /Windows NT (\d+\.\d+)/) } : /Linux/.test(e) && (s = { name: "Linux", version: "" }), { browser: a, os: s, mobile: t || r || /Mobile/.test(e) };
1222
+ }, ot = () => {
1223
+ var a, s;
1224
+ const e = typeof navigator < "u" ? navigator : void 0, t = (e == null ? void 0 : e.userAgent) ?? "", r = nt(t);
1225
+ return {
1226
+ userAgent: t,
1227
+ platform: (e == null ? void 0 : e.platform) ?? "",
1228
+ ...r,
1229
+ screen: typeof window < "u" ? {
1230
+ width: ((a = window.screen) == null ? void 0 : a.width) ?? 0,
1231
+ height: ((s = window.screen) == null ? void 0 : s.height) ?? 0,
1232
+ dpr: window.devicePixelRatio || 1
1233
+ } : { width: 0, height: 0, dpr: 1 },
1234
+ deviceMemoryGb: typeof (e == null ? void 0 : e.deviceMemory) == "number" ? e.deviceMemory : null,
1235
+ hardwareConcurrency: typeof (e == null ? void 0 : e.hardwareConcurrency) == "number" ? e.hardwareConcurrency : null,
1236
+ secureContext: typeof window < "u" ? !!window.isSecureContext : !1,
1237
+ videoCaptureStream: typeof HTMLVideoElement < "u" && ("captureStream" in HTMLVideoElement.prototype || "mozCaptureStream" in HTMLVideoElement.prototype),
1238
+ touch: typeof navigator < "u" && (navigator.maxTouchPoints ?? 0) > 0
1239
+ };
1240
+ }, it = [N.FACE_TRACKER, N.HAND_TRACKER, N.BODY_TRACKER], ne = "__xr_compat__", de = (e) => new Promise((t) => setTimeout(t, e)), O = async (e, t, r = 50) => {
1241
+ const a = Date.now() + t;
1242
+ for (; Date.now() < a; ) {
1243
+ if (e()) return !0;
1244
+ await de(r);
1245
+ }
1246
+ return e();
1247
+ }, lt = (e, t) => e ? /^(camera-|no-camera|webgl-|offscreen-canvas-|wasm-)/.test(e) ? "capability" : /^model-/.test(e) ? "model" : /^(lifecycle|timeout:lifecycle|feed-stalled|start-)/.test(e) ? "lifecycle" : /^(fps|inference|frame)/.test(e) ? "performance" : t : t, dt = (e) => {
1248
+ const t = {
1249
+ pass: 0,
1250
+ fail: 0,
1251
+ skip: 0,
1252
+ causes: { capability: 0, model: 0, lifecycle: 0, performance: 0, unknown: 0 }
1253
+ };
1254
+ for (const r of e)
1255
+ t[r.status] += 1, r.status === "fail" && (t.causes[r.cause ?? "unknown"] += 1);
1256
+ return t;
1257
+ }, ct = (e, t, r = {}) => ({
1258
+ version: 1,
1259
+ sdkVersion: r.sdkVersion ?? "dev",
1260
+ checkedAt: (/* @__PURE__ */ new Date()).toISOString(),
1261
+ label: r.label ?? "",
1262
+ environment: ot(),
1263
+ capabilities: t,
1264
+ results: e,
1265
+ summary: dt(e)
1266
+ }), vt = async (e, t = {}) => {
1267
+ var h;
1268
+ const r = t.timeoutMs ?? 2e4, a = t.models ?? it, s = new Set(
1269
+ t.scenarios ?? q.map((n) => n.id)
1270
+ ), d = [];
1271
+ let u = null, c = !1;
1272
+ const o = (n, f, g, i) => {
1273
+ var m;
1274
+ const l = {
1275
+ id: n,
1276
+ status: i.status,
1277
+ cause: i.status === "fail" ? lt(i.code ?? null, f) : null,
1278
+ // Codes describe failures; a pass carries none.
1279
+ code: i.status === "fail" ? i.code ?? null : null,
1280
+ detail: i.detail,
1281
+ durationMs: Math.round(performance.now() - g)
1282
+ };
1283
+ d.push(l), (m = t.onResult) == null || m.call(t, l);
1284
+ }, p = async () => {
1285
+ t.stream ? await e.setMediaSource({
1286
+ source: ee.STREAM,
1287
+ stream: t.stream,
1288
+ sourceKind: "video"
1289
+ }) : await e.setMediaSource({ source: ee.WEBCAM }), await e.start();
1290
+ };
1291
+ try {
1292
+ for (const n of q) {
1293
+ if (!s.has(n.id)) continue;
1294
+ const f = performance.now();
1295
+ try {
1296
+ const g = n.id;
1297
+ switch (g) {
1298
+ case "capabilities": {
1299
+ u = await be({
1300
+ models: a,
1301
+ timeoutMs: Math.min(r, 8e3)
1302
+ });
1303
+ const i = a.map((m) => ye(u, m)).filter((m) => !m.supported && m.reason).map((m) => m.reason.code), l = Array.from(new Set(i));
1304
+ o(n.id, n.layer, f, {
1305
+ status: l.length ? "fail" : "pass",
1306
+ code: l[0] ?? null,
1307
+ detail: l.length ? `blocked: ${l.join(", ")}` : `webgl${u.rendering.webglVersion}, camera ${u.camera.status}`
1308
+ });
1309
+ break;
1310
+ }
1311
+ case "session-start": {
1312
+ await p();
1313
+ const i = await O(
1314
+ () => e.store.getSnapshot().lifecycle === "running",
1315
+ r
1316
+ ), l = e.store.getSnapshot().feedFrames, m = i && await O(() => e.store.getSnapshot().feedFrames > l, r);
1317
+ c = i && m;
1318
+ const y = e.store.getSnapshot().error;
1319
+ o(n.id, n.layer, f, {
1320
+ status: c ? "pass" : "fail",
1321
+ code: y ? y.reason : i ? "feed-stalled" : "timeout:lifecycle",
1322
+ detail: c ? `running on ${e.store.getSnapshot().sourceKind}` : y ? y.message : i ? "running but no feed frames advanced" : `lifecycle ${e.store.getSnapshot().lifecycle}`
1323
+ });
1324
+ break;
1325
+ }
1326
+ case "model-ready": {
1327
+ if (!c) {
1328
+ o(n.id, n.layer, f, {
1329
+ status: "skip",
1330
+ detail: "session did not start"
1331
+ });
1332
+ break;
1333
+ }
1334
+ const i = [];
1335
+ await Promise.all(
1336
+ a.map(async (l) => {
1337
+ try {
1338
+ await e.registry.acquire(l, ne), await O(
1339
+ () => e.store.getSnapshot().pipeline.has(l),
1340
+ r
1341
+ ) || i.push(`${l}: timeout`);
1342
+ } catch (m) {
1343
+ i.push(`${l}: ${ge(m).code}`);
1344
+ }
1345
+ })
1346
+ ), o(n.id, n.layer, f, {
1347
+ status: i.length ? "fail" : "pass",
1348
+ code: i.length ? i[0].split(": ")[1] === "timeout" ? "model-init-failed" : i[0].split(": ")[1] : null,
1349
+ detail: i.length ? i.join("; ") : `${a.length} models ready`
1350
+ });
1351
+ break;
1352
+ }
1353
+ case "model-detects": {
1354
+ if (!c) {
1355
+ o(n.id, n.layer, f, {
1356
+ status: "skip",
1357
+ detail: "session did not start"
1358
+ });
1359
+ break;
1360
+ }
1361
+ const i = await O(
1362
+ () => P(e, a, null).models.every((E) => E.state !== "ready" || E.inferences > 0),
1363
+ Math.min(r, 8e3)
1364
+ ), l = P(e, a, null), m = l.models.filter((R) => R.state === "ready" && R.inferences === 0).map((R) => R.label), y = l.models.filter((R) => R.state === "error").map((R) => {
1365
+ var E;
1366
+ return `${R.label}: ${((E = R.error) == null ? void 0 : E.message) ?? "error"}`;
1367
+ });
1368
+ o(n.id, n.layer, f, {
1369
+ status: i && !y.length ? "pass" : "fail",
1370
+ code: y.length ? "model-init-failed" : m.length ? "model-idle" : null,
1371
+ detail: y.length ? y.join("; ") : m.length ? `no inference from ${m.join(", ")}` : l.models.map((R) => `${R.label} ${R.inferences} run · ${R.detections ?? "–"} det`).join(", ")
1372
+ });
1373
+ break;
1374
+ }
1375
+ case "pause-resume": {
1376
+ if (!c) {
1377
+ o(n.id, n.layer, f, {
1378
+ status: "skip",
1379
+ detail: "session did not start"
1380
+ });
1381
+ break;
1382
+ }
1383
+ e.pause();
1384
+ const i = e.store.getSnapshot().lifecycle === "paused";
1385
+ await e.resume();
1386
+ const l = await O(
1387
+ () => e.store.getSnapshot().lifecycle === "running",
1388
+ r
1389
+ ), m = e.store.getSnapshot().feedFrames, y = l && await O(() => e.store.getSnapshot().feedFrames > m, r);
1390
+ o(n.id, n.layer, f, {
1391
+ status: i && l && y ? "pass" : "fail",
1392
+ code: i ? l ? "feed-stalled" : "lifecycle:resume" : "lifecycle:pause",
1393
+ detail: i && l && y ? "paused → running, feed advanced" : `paused=${i} resumed=${l} advanced=${y}`
1394
+ });
1395
+ break;
1396
+ }
1397
+ case "stop-start": {
1398
+ if (!c) {
1399
+ o(n.id, n.layer, f, {
1400
+ status: "skip",
1401
+ detail: "session did not start"
1402
+ });
1403
+ break;
1404
+ }
1405
+ await e.stop();
1406
+ const i = e.store.getSnapshot().lifecycle === "stopped";
1407
+ await p();
1408
+ const l = await O(
1409
+ () => e.store.getSnapshot().lifecycle === "running",
1410
+ r
1411
+ );
1412
+ o(n.id, n.layer, f, {
1413
+ status: i && l ? "pass" : "fail",
1414
+ code: i ? "lifecycle:restart" : "lifecycle:stop",
1415
+ detail: i && l ? "stopped → running" : `stopped=${i} running=${l}`
1416
+ });
1417
+ break;
1418
+ }
1419
+ case "performance": {
1420
+ if (!c) {
1421
+ o(n.id, n.layer, f, {
1422
+ status: "skip",
1423
+ detail: "session did not start"
1424
+ });
1425
+ break;
1426
+ }
1427
+ const i = t.performanceWindowMs ?? 3e3;
1428
+ let l = 0, m = 0;
1429
+ const y = () => {
1430
+ l += 1, m = requestAnimationFrame(y);
1431
+ };
1432
+ m = requestAnimationFrame(y);
1433
+ const R = P(e, a, null);
1434
+ await de(i), cancelAnimationFrame(m);
1435
+ const E = P(e, a, {
1436
+ feedFrames: R.session.feedFrames,
1437
+ sampledAt: R.sampledAt
1438
+ }), _ = l * 1e3 / i, I = E.inferenceMsTotal, w = _ >= 20 && I <= 50;
1439
+ o(n.id, n.layer, f, {
1440
+ status: w ? "pass" : "fail",
1441
+ code: _ < 20 ? "fps-low" : I > 50 ? "inference-high" : null,
1442
+ detail: `${_.toFixed(0)} fps · feed ${E.session.feedFps.toFixed(0)} fps · inference ${I.toFixed(1)} ms`
1443
+ });
1444
+ break;
1445
+ }
1446
+ default:
1447
+ o(g, n.layer, f, { status: "skip", detail: "no runner" });
1448
+ }
1449
+ } catch (g) {
1450
+ const i = g instanceof Error ? g.message : String(g), l = (h = e.store.getSnapshot().error) == null ? void 0 : h.reason;
1451
+ o(n.id, n.layer, f, {
1452
+ status: "fail",
1453
+ code: l ? Se(l).code : null,
1454
+ detail: l ? `${i} (${l})` : i
1455
+ });
1456
+ }
1457
+ }
1458
+ } finally {
1459
+ for (const n of a) e.registry.release(n, ne);
1460
+ t.keepSessionRunning || await e.stop().catch(() => {
1461
+ });
1462
+ }
1463
+ return ct(d, u, t);
1464
+ }, It = (e) => {
1465
+ const [t, r] = T(null);
1466
+ return F(() => {
891
1467
  let a = 0;
892
- const r = () => {
893
- var h, m;
894
- a = requestAnimationFrame(r);
895
- const i = (m = (h = e == null ? void 0 : e.detectionResults) == null ? void 0 : h.faceLandmarks) == null ? void 0 : m[0];
896
- if (!i || i.length === 0) {
897
- n(null);
1468
+ const s = () => {
1469
+ var o, p;
1470
+ a = requestAnimationFrame(s);
1471
+ const d = (p = (o = e == null ? void 0 : e.detectionResults) == null ? void 0 : o.faceLandmarks) == null ? void 0 : p[0];
1472
+ if (!d || d.length === 0) {
1473
+ r(null);
898
1474
  return;
899
1475
  }
900
- const s = xe(i), o = {
901
- left: s.minX,
902
- top: s.minY,
903
- width: s.width,
904
- height: s.height
1476
+ const u = Te(d), c = {
1477
+ left: u.minX,
1478
+ top: u.minY,
1479
+ width: u.width,
1480
+ height: u.height
905
1481
  };
906
- n((d) => d && d.left === o.left && d.top === o.top && d.width === o.width && d.height === o.height ? d : o);
1482
+ r((h) => h && h.left === c.left && h.top === c.top && h.width === c.width && h.height === c.height ? h : c);
907
1483
  };
908
- return r(), () => {
1484
+ return s(), () => {
909
1485
  cancelAnimationFrame(a);
910
1486
  };
911
1487
  }, [e]), t;
912
- }, ot = ["fill", "contain"];
1488
+ }, Tt = ({
1489
+ background: e = "#000",
1490
+ children: t,
1491
+ style: r
1492
+ }) => /* @__PURE__ */ S(
1493
+ "div",
1494
+ {
1495
+ style: {
1496
+ position: "fixed",
1497
+ inset: 0,
1498
+ overflow: "hidden",
1499
+ background: e,
1500
+ ...r
1501
+ },
1502
+ children: t
1503
+ }
1504
+ ), xt = (e) => {
1505
+ const { makeDefault: t = !0, ...r } = e;
1506
+ return /* @__PURE__ */ S(
1507
+ xe,
1508
+ {
1509
+ position: [0, 0, 40],
1510
+ fov: 30,
1511
+ near: 0.1,
1512
+ far: 1e3,
1513
+ makeDefault: t,
1514
+ ...r
1515
+ }
1516
+ );
1517
+ }, At = ["fill", "contain"];
913
1518
  export {
914
- Ze as BoundingBoxOverlay,
915
- lt as HeadTracker,
916
- et as PerspectiveCamera,
917
- vt as ScreenRectAspectContext,
918
- ot as TEXTURE_FITS,
919
- tt as XRCompositor,
920
- $ as XRLayer,
921
- Se as XRMediaSurface,
922
- rt as XRTrackingOverlay,
923
- oe as XRViewport,
924
- xe as computeLandmarkBounds,
925
- xt as computeScreenTransform,
926
- bt as hasFullUnitUVBounds,
927
- Me as resolveCalibrationFaceDisplayMirrored,
1519
+ Ba as ARM_FIT_DEFAULTS,
1520
+ La as ARM_MASK_DEFAULTS,
1521
+ Na as ArmTracker,
1522
+ Ha as BODY_DEPTH_LAYER,
1523
+ Ga as BODY_DEPTH_RANGE_PAD,
1524
+ Pa as BODY_FLIP_GUARD_DEFAULTS,
1525
+ Ft as BODY_IDENTITY_DEFAULTS,
1526
+ Ot as BODY_JOINT_OTHER_SIDE,
1527
+ Un as BODY_MASK_BONES,
1528
+ qn as BODY_MASK_MAX_PEOPLE,
1529
+ Kn as BODY_MASK_MIN_VISIBILITY,
1530
+ jn as BODY_MASK_SPLIT_DEFAULTS,
1531
+ Xa as BODY_POSE_TRIGGER_DEFAULTS,
1532
+ Wa as BODY_RIG_BONE_REGION,
1533
+ za as BODY_RIG_CHEST_RANGE,
1534
+ Ya as BODY_RIG_CLAVICLE_RANGE,
1535
+ Va as BODY_RIG_EAR_TO_HEAD,
1536
+ $a as BODY_RIG_FOREARM_TWIST_SHARE,
1537
+ Ua as BODY_RIG_HAND_SEEN,
1538
+ qa as BODY_RIG_HEAD_ABOVE_EARS,
1539
+ Ka as BODY_RIG_HEAD_CENTER,
1540
+ ja as BODY_RIG_HEAD_LIMITS,
1541
+ Ja as BODY_RIG_HEAD_RANGE,
1542
+ Qa as BODY_RIG_HINGE_BEND,
1543
+ Za as BODY_RIG_LENGTH_RANGE,
1544
+ er as BODY_RIG_LIMBS,
1545
+ tr as BODY_RIG_LIMB_BONES,
1546
+ ar as BODY_RIG_LIMB_JOINTS,
1547
+ rr as BODY_RIG_NECK_RANGE,
1548
+ sr as BODY_RIG_NECK_SHARE,
1549
+ nr as BODY_RIG_REGIONS,
1550
+ or as BODY_RIG_REGION_JOINTS,
1551
+ ir as BODY_RIG_SEGMENTS,
1552
+ lr as BODY_RIG_SHOULDER_TO_TORSO,
1553
+ fn as BasicAnimatedTextureController,
1554
+ dr as BodyFlipGuard,
1555
+ Dt as BodyIdentity,
1556
+ _t as BoundingBoxOverlay,
1557
+ q as COMPAT_SCENARIOS,
1558
+ cr as DEFAULT_NAIL_FALLBACK,
1559
+ kt as EMPTY_QUALITY_SIGNALS,
1560
+ mo as FACE_REGION_POLYGONS,
1561
+ ur as FOREARM_BULGE_AT,
1562
+ mr as FOREARM_ELBOW_DEPTH_OF_WRIST,
1563
+ pr as FOREARM_ELBOW_WIDTH_OF_WRIST,
1564
+ fr as FOREARM_LENGTH_OF_HAND,
1565
+ hr as HAND_JOINTS,
1566
+ gr as HAND_NAIL_FACING_FADE,
1567
+ br as HAND_NAIL_FINISH_LIGHTING,
1568
+ Cn as HAND_RIG_BONES,
1569
+ yr as HAND_RIG_FOREARM,
1570
+ Fn as HAND_RIG_KNUCKLE_SHIFT,
1571
+ On as HAND_RIG_LENGTH_RANGE,
1572
+ Sr as HAND_RIG_MODEL_MESH,
1573
+ Dn as HAND_RIG_PALM_JOINTS,
1574
+ kn as HAND_RIG_SNAP_PALMS,
1575
+ Rr as HAND_TATTOO_FACING_FADE,
1576
+ wr as HandRigContext,
1577
+ _r as HandRigWrist,
1578
+ Er as HandRigWristContext,
1579
+ vr as HandTouchContext,
1580
+ ia as HeadTracker,
1581
+ po as IRIS_FULL_OPENNESS,
1582
+ fo as IrisLead,
1583
+ st as MANUAL_COMPAT_SCENARIOS,
1584
+ hn as MAX_GIF_BYTES,
1585
+ gn as MAX_GIF_FRAMES,
1586
+ bn as MAX_GIF_PIXELS,
1587
+ ho as MAX_OVERLAY_LABELS,
1588
+ Ir as OscillationTracker,
1589
+ Tr as POSE_JOINTS,
1590
+ xt as PerspectiveCamera,
1591
+ go as SEGMENTATION_OVERLAY_FRAGMENT_SHADER,
1592
+ bo as SEGMENTATION_OVERLAY_VERTEX_SHADER,
1593
+ xr as SKINNED_OCCLUDER_RENDER_ORDER,
1594
+ ko as ScreenRectAspectContext,
1595
+ At as TEXTURE_FITS,
1596
+ yn as TextureSourceLoadError,
1597
+ Ar as TimedSeries,
1598
+ Mr as TouchWorld,
1599
+ Cr as WRIST_FILTER_DEFAULTS,
1600
+ Fr as WRIST_JOINT_LIMITS,
1601
+ Or as WristRotationFilter,
1602
+ Tt as XRCompositor,
1603
+ X as XRLayer,
1604
+ Fe as XRMediaSurface,
1605
+ Rt as XRTrackingOverlay,
1606
+ wt as XRViewport,
1607
+ Bt as XR_MODEL_LABELS,
1608
+ Lt as anatomicalBodyPose,
1609
+ Nt as anatomicalHandedness,
1610
+ Dr as applyBodyRigHeadScale,
1611
+ kr as applyBodyRigLengths,
1612
+ Br as applyBodyRigSolution,
1613
+ Bn as applyHandRigLengths,
1614
+ Ln as applyHandRigSolution,
1615
+ Lr as armQueryOf,
1616
+ Ht as assignHandPoses,
1617
+ Nr as assignNailBlobs,
1618
+ Hr as bindBodyRig,
1619
+ Nn as bindHandRig,
1620
+ Gr as bodyAttachmentFrame,
1621
+ Pr as bodyDepthRange,
1622
+ Jn as bodyMaskDistance,
1623
+ Qn as bodyMaskPerson,
1624
+ Zn as bodyMaskWeights,
1625
+ Xr as bodyPoseToScene,
1626
+ Wr as bodyRigChestScale,
1627
+ zr as bodyRigClipPose,
1628
+ Yr as bodyRigHeadCenter,
1629
+ Vr as bodyRigHeadScale,
1630
+ $r as bodyRigHeadTarget,
1631
+ Ur as bodyRigJointPosition,
1632
+ qr as bodyRigLengthRatios,
1633
+ Kr as bodyRigModelHead,
1634
+ jr as bodyRigSceneScale,
1635
+ Jr as bodyRigShoulderScale,
1636
+ Yn as bodySubjectCount,
1637
+ Qr as bodyTriggerStatesEqual,
1638
+ Gt as bodyWorldLandmarkToJoint,
1639
+ Zr as clampWristBend,
1640
+ Pt as classifyCameraFailure,
1641
+ lt as classifyCompatCause,
1642
+ eo as closestBodies,
1643
+ yo as computeIrisEye,
1644
+ Te as computeLandmarkBounds,
1645
+ So as computeMaskUvTransform,
1646
+ Sn as computeScreenTransform,
1647
+ es as createBodyDepthMaterial,
1648
+ to as createBodyMaskSplitMaterial,
1649
+ ts as createBodyMoveFrame,
1650
+ as as createBodyTrigger,
1651
+ ct as createCompatReport,
1652
+ Aa as createFaceInfoTarget,
1653
+ oo as createGestureDetectorState,
1654
+ rs as createHandNailsMaterial,
1655
+ ss as createHandOccluderMaterial,
1656
+ ns as createHandTattooMaterial,
1657
+ Ro as createIrisEye,
1658
+ wo as createIrisResult,
1659
+ Xt as createQualityState,
1660
+ _o as createSegmentationOverlayMaterial,
1661
+ Eo as createSemanticMaskTexture,
1662
+ os as createSkinnedOccluderMaterial,
1663
+ Rn as createTextureSourceResolver,
1664
+ is as createTouchHand,
1665
+ ot as describeCompatEnvironment,
1666
+ wn as disposeResolvedTextureSource,
1667
+ ls as elbowUpOnScreen,
1668
+ ds as ellipseWidthOnScreen,
1669
+ cs as ensureForearmBone,
1670
+ Wt as fillLandmarkPolygon,
1671
+ zt as fillPolygon,
1672
+ Et as findCompatScenario,
1673
+ us as fingerExtensions,
1674
+ ms as fitWristFrame,
1675
+ ps as forearmDirectionOf,
1676
+ fs as forearmSectionAt,
1677
+ hs as forearmSegmentOf,
1678
+ gs as frameUpOnScreen,
1679
+ io as gestureStatesEqual,
1680
+ Ma as getFaceInfo,
1681
+ _n as getPlaybackFrame,
1682
+ En as getSequenceFrame,
1683
+ Fa as getThreeBlending,
1684
+ Oa as getThreeDepthFunction,
1685
+ Da as getThreeSide,
1686
+ vn as gifTextureSourceProvider,
1687
+ Hn as handAttachmentLocal,
1688
+ bs as handGeometryToRoot,
1689
+ ys as handLengthOf,
1690
+ Ss as handNailCoverage,
1691
+ Rs as handNailDistance,
1692
+ ws as handNailFrame,
1693
+ Gn as handRigRootMatrix,
1694
+ Pn as handRigSnapDistance,
1695
+ _s as handTattooFrame,
1696
+ Es as handTattooMatrix,
1697
+ vs as handTattooUv,
1698
+ Yt as handWorldLandmarkToJoint,
1699
+ mn as hasFullUnitUVBounds,
1700
+ Vt as judgeSample,
1701
+ Is as limitForearmDirection,
1702
+ Ts as limitHeadTurn,
1703
+ $t as lockQuality,
1704
+ Ut as mapDomExceptionToReason,
1705
+ ge as mapModelErrorToReason,
1706
+ xs as measureArm,
1707
+ As as measureArmRaise,
1708
+ Ms as measureFingerPattern,
1709
+ Cs as measureGrab,
1710
+ Fs as measureHandHeight,
1711
+ Os as measureOpenPalm,
1712
+ Ds as measurePinch,
1713
+ ks as measureTPose,
1714
+ Bs as measureThumb,
1715
+ ao as packBodyMaskUniforms,
1716
+ Ls as paintFallbackNail,
1717
+ nt as parseUserAgent,
1718
+ Ns as patchBodyDepthShaders,
1719
+ Hs as patchHandOccluderInflate,
1720
+ Gs as patchOccluderInflate,
1721
+ qt as permissionStateToStatus,
1722
+ vo as rasterizeFaceRegions,
1723
+ Ps as reachBodyRigHead,
1724
+ Xs as reachBodyRigLimb,
1725
+ Kt as readDeviceSignals,
1726
+ Ws as refineNailTip,
1727
+ zs as renderBodyDepth,
1728
+ Ys as resetBodyRig,
1729
+ jt as resetQuality,
1730
+ Io as resolveActiveOverlayLabelIndices,
1731
+ Vn as resolveBody,
1732
+ Vs as resolveBodyMoveLimits,
1733
+ $s as resolveBodyTriggerOptions,
1734
+ Xe as resolveCalibrationFaceDisplayMirrored,
1735
+ Jt as resolveInitialTierIndex,
1736
+ To as resolveMaskSize,
1737
+ Qt as resolveNumBodies,
1738
+ xo as resolveOverlayLabelIndices,
1739
+ Zt as resolvePerformanceBudget,
1740
+ ea as resolveQualityTier,
1741
+ In as resolveTextureSource,
1742
+ vt as runCompatChecks,
1743
+ P as sampleXRDiagnostics,
1744
+ Us as screenAngle,
1745
+ Xn as screenChirality,
1746
+ ta as semanticMaskLabelIndex,
1747
+ Se as sessionReasonToFallback,
1748
+ ro as setBodyMaskSplitUniforms,
1749
+ qs as setBodyTriggerOptions,
1750
+ Ks as setHandTattooBlend,
1751
+ aa as setQualityTier,
1752
+ js as settleNailMask,
1753
+ Js as sideJoint,
1754
+ Qs as snapshotBodyTriggerState,
1755
+ lo as snapshotGestureState,
1756
+ Zs as solveBodyRig,
1757
+ Wn as solveHandRig,
1758
+ so as splitBodyMask,
1759
+ en as stepBodyTrigger,
1760
+ co as stepGestureDetector,
1761
+ ra as stepQualityController,
1762
+ dt as summarizeCompatResults,
1763
+ Tn as throwIfAborted,
1764
+ tn as thumbDirection,
1765
+ an as thumbExtension,
1766
+ sa as tierToApply,
1767
+ Ao as updateIrisResult,
1768
+ rn as updatePointerHand,
1769
+ Mo as updateSegmentationOverlayMaterial,
1770
+ sn as updateTouchHand,
1771
+ Co as uploadSemanticMask,
1772
+ nn as useArmMask,
928
1773
  ze as useCalibrationFaceTracker,
929
- it as useFaceBoundingBox,
930
- yt as useScreenSpace,
931
- ct as useTrackerContext,
932
- ut as useXRCameraTexture,
933
- ye as useXRContext,
934
- ht as useXRError,
935
- he as useXRModel,
936
- me as useXRModelNode,
937
- mt as useXRPipelineSnapshot,
938
- ft as useXRReady,
939
- gt as useXRRenderSize,
940
- nt as useXRViewportState
1774
+ It as useFaceBoundingBox,
1775
+ Bo as useScreenSpace,
1776
+ Fo as useSegmentationOverlayMaterial,
1777
+ Oo as useSemanticMaskTexture,
1778
+ on as useSkinnedOccluder,
1779
+ la as useTrackerContext,
1780
+ ca as useXRCameraDeviceId,
1781
+ ua as useXRCameraFacing,
1782
+ ma as useXRCameraTexture,
1783
+ oe as useXRContext,
1784
+ na as useXRDiagnostics,
1785
+ pa as useXRError,
1786
+ fa as useXRFeedAspect,
1787
+ ha as useXRFeedCrop,
1788
+ ga as useXRLifecycle,
1789
+ ba as useXRMirrored,
1790
+ Re as useXRModel,
1791
+ ya as useXRModelErrors,
1792
+ we as useXRModelNode,
1793
+ Sa as useXROrientation,
1794
+ Ra as useXRPipelineSnapshot,
1795
+ wa as useXRQualityConfig,
1796
+ _a as useXRQualityState,
1797
+ Ea as useXRReady,
1798
+ va as useXRRenderSize,
1799
+ Ia as useXRSessionCameraPermission,
1800
+ Ta as useXRTrackerStatus,
1801
+ xn as useXRViewportRenderOutputs,
1802
+ An as useXRViewportState,
1803
+ ln as worldToFeedUnits,
1804
+ dn as wristBendOf,
1805
+ cn as wristFrameLocal
941
1806
  };