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

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 (362) hide show
  1. package/GROUNDING.md +1813 -27
  2. package/dist/{DebuggerUI-CEfdddkZ.cjs → DebuggerUI-B45_Gb9d.cjs} +1 -1
  3. package/dist/{DebuggerUI-Dgop6Q6o.js → DebuggerUI-Cq28c18s.js} +1 -1
  4. package/dist/FaceMeshRenderer-6t8OsQhK.js +1195 -0
  5. package/dist/FaceMeshRenderer-lQLhYIW-.cjs +155 -0
  6. package/dist/FaceRetouch-CDrL0pXg.js +551 -0
  7. package/dist/FaceRetouch-DtNl8-4e.cjs +134 -0
  8. package/dist/audio/AudioEngine.d.ts +3 -1
  9. package/dist/audio/AudioPlayer.d.ts +29 -0
  10. package/dist/audio/AudioPlayerLogic.d.ts +4 -0
  11. package/dist/audio/index.d.ts +2 -0
  12. package/dist/components/Axes/index.d.ts +6 -0
  13. package/dist/components/FaceMesh/FaceMeshRenderer.d.ts +17 -0
  14. package/dist/components/FaceMesh/canonical/CanonicalFaceMeshRenderer.d.ts +22 -1
  15. package/dist/components/FaceMesh/canonical/FaceMeshMaterial.d.ts +25 -0
  16. package/dist/components/FaceMesh/canonical/assets.d.ts +3 -0
  17. package/dist/components/FaceMesh/canonical/geometryGroups.d.ts +9 -0
  18. package/dist/components/FaceMesh/canonical/parseCanonicalFaceModel.d.ts +2 -0
  19. package/dist/components/FaceMesh/canonical/shaders.d.ts +2 -0
  20. package/dist/components/FaceMesh/deform.d.ts +3 -0
  21. package/dist/components/FaceMesh/index.d.ts +5 -0
  22. package/dist/components/FaceMesh/material/defaults.d.ts +74 -0
  23. package/dist/components/FaceMesh/material/index.d.ts +1 -0
  24. package/dist/components/FaceMesh/material/options.d.ts +5 -1
  25. package/dist/components/FaceMesh/material/support.d.ts +7 -2
  26. package/dist/components/FaceMesh/material/textures.d.ts +4 -0
  27. package/dist/components/FaceMesh/material/types.d.ts +4 -2
  28. package/dist/components/FaceRetouch/Background.d.ts +9 -5
  29. package/dist/components/FaceRetouch/FaceRetouch.d.ts +47 -0
  30. package/dist/components/FaceRetouch/index.d.ts +2 -6
  31. package/dist/components/FaceRetouch/landmarkMask.d.ts +4 -6
  32. package/dist/components/FaceRetouch/useFaceRetouchMask.d.ts +4 -7
  33. package/dist/components/FaceTracker/index.d.ts +5 -3
  34. package/dist/components/FaceWarp3D/FaceWarp3DHead.d.ts +15 -0
  35. package/dist/components/FaceWarp3D/defaults.d.ts +37 -0
  36. package/dist/components/FaceWarp3D/index.d.ts +3 -0
  37. package/dist/components/FaceWarp3D/warp.d.ts +13 -0
  38. package/dist/components/HandJoints2D/index.d.ts +6 -0
  39. package/dist/components/HandTracker/index.d.ts +2 -2
  40. package/dist/components/HandTracking2D/HandVisual.d.ts +12 -0
  41. package/dist/components/HandTracking2D/index.d.ts +5 -0
  42. package/dist/components/HandTracking2DController/index.d.ts +5 -0
  43. package/dist/components/HandTracking3D/index.d.ts +6 -0
  44. package/dist/components/LightObject/index.d.ts +20 -0
  45. package/dist/components/LookAt/index.d.ts +23 -0
  46. package/dist/components/MeshRenderer/index.d.ts +58 -0
  47. package/dist/components/PerspectiveCamera/index.d.ts +2 -8
  48. package/dist/components/PinToMesh/index.d.ts +47 -0
  49. package/dist/components/RenderGroupLayer/index.d.ts +6 -0
  50. package/dist/components/SceneObjectRenderer/index.d.ts +16 -0
  51. package/dist/components/Screen2D/ScreenTransformFrame.d.ts +11 -0
  52. package/dist/components/Screen2D/ScreenTransformHelpers.d.ts +19 -0
  53. package/dist/components/Screen2D/ScreenTransformInteraction.d.ts +18 -0
  54. package/dist/components/Screen2D/index.d.ts +5 -0
  55. package/dist/components/ScreenGlass/defaults.d.ts +3 -0
  56. package/dist/components/ScreenGlass/index.d.ts +5 -0
  57. package/dist/components/ScreenGlass/shaders.d.ts +2 -0
  58. package/dist/components/ScreenGlass/types.d.ts +10 -0
  59. package/dist/components/ScreenGradient/defaults.d.ts +5 -0
  60. package/dist/components/ScreenGradient/index.d.ts +5 -0
  61. package/dist/components/ScreenGradient/shaders.d.ts +2 -0
  62. package/dist/components/ScreenGradient/types.d.ts +19 -0
  63. package/dist/components/ScreenImage/ScreenImage.d.ts +4 -0
  64. package/dist/components/ScreenImage/components/DynamicTextureSync.d.ts +9 -0
  65. package/dist/components/ScreenImage/components/ScreenImageBody.d.ts +9 -0
  66. package/dist/components/ScreenImage/components/ScreenImageFrame.d.ts +9 -0
  67. package/dist/components/ScreenImage/components/ScreenImageTransformFrame.d.ts +9 -0
  68. package/dist/components/ScreenImage/fit.d.ts +52 -0
  69. package/dist/components/ScreenImage/index.d.ts +8 -0
  70. package/dist/components/ScreenImage/materials/ScreenImageBlendMaterial.d.ts +9 -0
  71. package/dist/components/ScreenImage/materials/ScreenImageMatcap.d.ts +3 -0
  72. package/dist/components/ScreenImage/source.d.ts +16 -0
  73. package/dist/components/ScreenImage/types.d.ts +37 -0
  74. package/dist/components/ScreenImage/utils/ScreenImageConstants.d.ts +9 -0
  75. package/dist/components/ScreenImage/utils/ScreenImageHelpers.d.ts +4 -0
  76. package/dist/components/ScreenShape/geometry.d.ts +5 -0
  77. package/dist/components/ScreenShape/index.d.ts +5 -0
  78. package/dist/components/ScreenShape/types.d.ts +41 -0
  79. package/dist/components/ScreenSpaceUI/ScreenTransformGuide.d.ts +15 -0
  80. package/dist/components/ScreenSpaceUI/ScreenTransformOverlayGuide.d.ts +9 -0
  81. package/dist/components/ScreenSpaceUI/index.d.ts +2 -0
  82. package/dist/components/ScreenText/components/ScreenTextBody.d.ts +2 -0
  83. package/dist/components/ScreenText/components/ScreenTextTransformFrame.d.ts +9 -0
  84. package/dist/components/ScreenText/constants.d.ts +5 -0
  85. package/dist/components/ScreenText/index.d.ts +6 -0
  86. package/dist/components/ScreenText/types.d.ts +31 -0
  87. package/dist/components/ScreenText/utils/ScreenTextHelpers.d.ts +14 -0
  88. package/dist/components/ScreenText/utils/ScreenTextMappings.d.ts +17 -0
  89. package/dist/components/SequentialRenderPasses/index.d.ts +6 -0
  90. package/dist/components/TextLabel/TextLabel.d.ts +5 -0
  91. package/dist/components/TextLabel/alignment.d.ts +4 -0
  92. package/dist/components/TextLabel/bend.d.ts +9 -0
  93. package/dist/components/TextLabel/canvas/buildTextLabelTexture.d.ts +4 -0
  94. package/dist/components/TextLabel/canvas/canvasTypography.d.ts +13 -0
  95. package/dist/components/TextLabel/canvas/drawBackground.d.ts +21 -0
  96. package/dist/components/TextLabel/canvas/drawEffects.d.ts +34 -0
  97. package/dist/components/TextLabel/canvas/drawText.d.ts +19 -0
  98. package/dist/components/TextLabel/components/TextLabelMesh.d.ts +13 -0
  99. package/dist/components/TextLabel/constants.d.ts +2 -0
  100. package/dist/components/TextLabel/hooks/useTextLabelTexture.d.ts +7 -0
  101. package/dist/components/TextLabel/index.d.ts +2 -62
  102. package/dist/components/TextLabel/layout/measurement.d.ts +8 -0
  103. package/dist/components/TextLabel/layout/resolveTextLayout.d.ts +25 -0
  104. package/dist/components/TextLabel/layout/wrapText.d.ts +6 -0
  105. package/dist/components/TextLabel/types.d.ts +227 -0
  106. package/dist/components/TrackingAnchor/index.d.ts +18 -2
  107. package/dist/components/Transform3D/index.d.ts +30 -0
  108. package/dist/components/XRMediaSurface/index.d.ts +6 -6
  109. package/dist/components/XRScene/index.d.ts +14 -3
  110. package/dist/components/XRViewport/XRViewport.d.ts +11 -0
  111. package/dist/components/XRViewport/components/HiddenMedia.d.ts +7 -0
  112. package/dist/components/XRViewport/components/MediaAssetPicker.d.ts +8 -0
  113. package/dist/components/XRViewport/components/MediaControlStack.d.ts +13 -0
  114. package/dist/components/XRViewport/components/XRViewportLayers.d.ts +30 -0
  115. package/dist/components/XRViewport/constants.d.ts +24 -0
  116. package/dist/components/XRViewport/contexts.d.ts +6 -0
  117. package/dist/components/XRViewport/hooks/useViewportExternalFaces.d.ts +13 -0
  118. package/dist/components/XRViewport/hooks/useViewportMediaSource.d.ts +16 -0
  119. package/dist/components/XRViewport/hooks/useViewportMediaTexture.d.ts +10 -0
  120. package/dist/components/XRViewport/hooks/useViewportPipeline.d.ts +41 -0
  121. package/dist/components/XRViewport/hooks/useViewportRenderState.d.ts +47 -0
  122. package/dist/components/XRViewport/index.d.ts +3 -101
  123. package/dist/components/XRViewport/layout.d.ts +16 -0
  124. package/dist/components/XRViewport/slots.d.ts +16 -0
  125. package/dist/components/XRViewport/types.d.ts +89 -0
  126. package/dist/components/XRViewport/useViewportSize.d.ts +3 -0
  127. package/dist/components/index.d.ts +19 -0
  128. package/dist/contexts-BKvTIayr.cjs +1 -0
  129. package/dist/contexts-Bk5zz_VR.js +214 -0
  130. package/dist/debug-ui/component-editor/index.d.ts +19 -0
  131. package/dist/debug-ui/default-setting/index.d.ts +37 -0
  132. package/dist/debug-ui/default-setting.cjs +21 -0
  133. package/dist/debug-ui/default-setting.js +777 -0
  134. package/dist/debug-ui/face-mesh-renderer-settings/index.d.ts +8 -0
  135. package/dist/debug-ui/face-retouch/index.d.ts +11 -0
  136. package/dist/debug-ui/face-warp-3d/index.d.ts +6 -0
  137. package/dist/debug-ui/hand-joints-2d/index.d.ts +6 -0
  138. package/dist/debug-ui/hand-tracking-2d/index.d.ts +6 -0
  139. package/dist/debug-ui/hand-tracking-2d-controller/index.d.ts +6 -0
  140. package/dist/debug-ui/hand-tracking-3d/index.d.ts +6 -0
  141. package/dist/debug-ui/hierarchy-panel/index.d.ts +29 -0
  142. package/dist/debug-ui/index.d.ts +46 -0
  143. package/dist/debug-ui/layer-panel/index.d.ts +18 -0
  144. package/dist/debug-ui/media-source/MediaSourceSwitcher.d.ts +10 -0
  145. package/dist/debug-ui/media-source/index.d.ts +6 -0
  146. package/dist/debug-ui/media-source/media-preset.d.ts +9 -0
  147. package/dist/debug-ui/media-source/session.d.ts +12 -0
  148. package/dist/debug-ui/media-source.cjs +1 -0
  149. package/dist/debug-ui/media-source.js +9 -0
  150. package/dist/debug-ui/mesh-renderer-settings/index.d.ts +6 -0
  151. package/dist/debug-ui/object-inspector-panel/index.d.ts +25 -0
  152. package/dist/debug-ui/pin-to-mesh-settings/index.d.ts +10 -0
  153. package/dist/debug-ui/scene-editor/context.d.ts +38 -0
  154. package/dist/debug-ui/scene-editor/hierarchy-panel.d.ts +9 -0
  155. package/dist/debug-ui/scene-editor/index.d.ts +11 -0
  156. package/dist/debug-ui/scene-editor/inspector-panel.d.ts +7 -0
  157. package/dist/debug-ui/scene-editor/store-utils.d.ts +2 -0
  158. package/dist/debug-ui/scene-editor/viewport-toolbar.d.ts +4 -0
  159. package/dist/debug-ui/scene-editor/viewport.d.ts +21 -0
  160. package/dist/debug-ui/screen-glass-settings/index.d.ts +6 -0
  161. package/dist/debug-ui/screen-gradient-settings/GradientStopsEditor.d.ts +5 -0
  162. package/dist/debug-ui/screen-gradient-settings/index.d.ts +6 -0
  163. package/dist/debug-ui/screen-gradient-settings/styles.d.ts +3 -0
  164. package/dist/debug-ui/screen-image-settings/index.d.ts +9 -0
  165. package/dist/debug-ui/screen-shape-settings/index.d.ts +6 -0
  166. package/dist/debug-ui/screen-text-settings/NumberField.d.ts +9 -0
  167. package/dist/debug-ui/screen-text-settings/ScreenTextSettingsPanel.d.ts +3 -0
  168. package/dist/debug-ui/screen-text-settings/controls/NestedSection.d.ts +7 -0
  169. package/dist/debug-ui/screen-text-settings/controls/Section.d.ts +8 -0
  170. package/dist/debug-ui/screen-text-settings/controls/icons.d.ts +4 -0
  171. package/dist/debug-ui/screen-text-settings/index.d.ts +2 -0
  172. package/dist/debug-ui/screen-text-settings/sections/BackgroundSection.d.ts +8 -0
  173. package/dist/debug-ui/screen-text-settings/sections/ContentSection.d.ts +5 -0
  174. package/dist/debug-ui/screen-text-settings/sections/EffectsSection.d.ts +25 -0
  175. package/dist/debug-ui/screen-text-settings/sections/StyleSection.d.ts +5 -0
  176. package/dist/debug-ui/screen-text-settings/sections/TransformSection.d.ts +5 -0
  177. package/dist/debug-ui/screen-text-settings/sections/background/BackgroundFillControls.d.ts +2 -0
  178. package/dist/debug-ui/screen-text-settings/sections/background/BackgroundSizeControls.d.ts +2 -0
  179. package/dist/debug-ui/screen-text-settings/sections/background/BackgroundStrokeControls.d.ts +2 -0
  180. package/dist/debug-ui/screen-text-settings/sections/background/types.d.ts +7 -0
  181. package/dist/debug-ui/screen-text-settings/sections/effects/BendEffectSection.d.ts +4 -0
  182. package/dist/debug-ui/screen-text-settings/sections/effects/EffectChrome.d.ts +21 -0
  183. package/dist/debug-ui/screen-text-settings/sections/effects/GlowEffectSection.d.ts +4 -0
  184. package/dist/debug-ui/screen-text-settings/sections/effects/InnerShadowEffectSection.d.ts +4 -0
  185. package/dist/debug-ui/screen-text-settings/sections/effects/OutlineEffectSection.d.ts +4 -0
  186. package/dist/debug-ui/screen-text-settings/sections/effects/ShadowEffectSection.d.ts +4 -0
  187. package/dist/debug-ui/screen-text-settings/sections/effects/types.d.ts +14 -0
  188. package/dist/debug-ui/screen-text-settings/settings.d.ts +90 -0
  189. package/dist/debug-ui/screen-text-settings/styles.d.ts +26 -0
  190. package/dist/debug-ui/screen-text-settings/transform.d.ts +6 -0
  191. package/dist/debug-ui/screen-text-settings/types.d.ts +9 -0
  192. package/dist/debug-ui/settings-panel/index.d.ts +38 -0
  193. package/dist/debug-ui/shared/MaterialSection.d.ts +13 -0
  194. package/dist/debug-ui/shared/ScreenTransformSection.d.ts +32 -0
  195. package/dist/debug-ui/transform-3d-settings/index.d.ts +11 -0
  196. package/dist/debug-ui.cjs +10 -0
  197. package/dist/debug-ui.js +8861 -0
  198. package/dist/drawNormalizedCrop-B-7zU-Xw.cjs +1 -0
  199. package/dist/drawNormalizedCrop-CRdIDyl1.js +44 -0
  200. package/dist/entries/all.d.ts +1 -0
  201. package/dist/entries/core.d.ts +55 -4
  202. package/dist/entries/face-effects.d.ts +12 -8
  203. package/dist/entries/internal.d.ts +1 -1
  204. package/dist/entries/low-level.d.ts +21 -4
  205. package/dist/entries/scene-object.d.ts +10 -0
  206. package/dist/entries/tracking.d.ts +25 -2
  207. package/dist/face-action/index.d.ts +34 -0
  208. package/dist/face-attribute-expression/index.d.ts +10 -0
  209. package/dist/face-effects.cjs +1 -252
  210. package/dist/face-effects.js +1404 -2613
  211. package/dist/face-info/blendshapes.d.ts +3 -0
  212. package/dist/face-info/derive.d.ts +8 -0
  213. package/dist/face-info/drawFaceCrop.d.ts +10 -0
  214. package/dist/face-info/getFaceInfo.d.ts +8 -0
  215. package/dist/face-info/index.d.ts +8 -0
  216. package/dist/face-info/landmarks.d.ts +21 -0
  217. package/dist/face-info/types.d.ts +52 -0
  218. package/dist/getFaceInfo-CyPAKh3h.cjs +1 -0
  219. package/dist/getFaceInfo-hUKMLFcr.js +118 -0
  220. package/dist/hand/handJoints2d.d.ts +49 -0
  221. package/dist/hand/handTracking2d.d.ts +33 -0
  222. package/dist/hand/handTracking2dController.d.ts +65 -0
  223. package/dist/hand/handTracking3d.d.ts +52 -0
  224. package/dist/hooks/faceResults.d.ts +1 -1
  225. package/dist/hooks/useCalibrationFaceTracker.d.ts +1 -1
  226. package/dist/hooks/useFaceAction.d.ts +3 -0
  227. package/dist/hooks/useFaceAttributeExpression.d.ts +16 -0
  228. package/dist/hooks/useFaceDetection.d.ts +18 -0
  229. package/dist/hooks/useFaceInfo.d.ts +7 -0
  230. package/dist/hooks/useFaceInfos.d.ts +15 -0
  231. package/dist/hooks/useFaceResultReader.d.ts +10 -0
  232. package/dist/hooks/useFrameCapture.d.ts +18 -0
  233. package/dist/hooks/useMediaRecorder.d.ts +14 -2
  234. package/dist/hooks/useOwnedTexture.d.ts +6 -0
  235. package/dist/hooks/useTrackerContext.d.ts +2 -2
  236. package/dist/hooks/useXRSession/facade.d.ts +3 -0
  237. package/dist/hooks/useXRSession/registry.d.ts +9 -0
  238. package/dist/index-82aENaRq.cjs +1 -0
  239. package/dist/{index-BD-JWMjE.js → index-BgQAX8rs.js} +198 -134
  240. package/dist/index-CEc1CAmB.cjs +1 -0
  241. package/dist/index-CTHeBQOs.js +178 -0
  242. package/dist/index-D4bLzBr6.cjs +1 -0
  243. package/dist/index-DSpzjuqd.cjs +1 -0
  244. package/dist/index-Di70KWuY.js +2049 -0
  245. package/dist/index-DzEzkBIH.cjs +17 -0
  246. package/dist/{index-CYMj26Ej.js → index-JygePOwo.js} +565 -498
  247. package/dist/index-UC0Ux38E.js +111 -0
  248. package/dist/{internal-KOKJDxCG.js → internal-DuMPpcbp.js} +86 -80
  249. package/dist/internal-i2JkM85N.cjs +1 -0
  250. package/dist/internal.cjs +1 -1
  251. package/dist/internal.js +2 -2
  252. package/dist/low-level.cjs +1 -1
  253. package/dist/low-level.js +959 -632
  254. package/dist/main.cjs +1 -1
  255. package/dist/main.js +556 -455
  256. package/dist/material/MaterialFill.d.ts +20 -0
  257. package/dist/material/MeshMaterial.d.ts +14 -0
  258. package/dist/material/index.d.ts +2 -0
  259. package/dist/models/Body/index.d.ts +1 -1
  260. package/dist/models/Face/index.d.ts +1 -0
  261. package/dist/models/Face/rotation.d.ts +3 -0
  262. package/dist/models/Hand/HandTracking.d.ts +2 -0
  263. package/dist/render/layerStack.d.ts +29 -0
  264. package/dist/render/renderGroups.d.ts +47 -0
  265. package/dist/render/renderPasses.d.ts +18 -0
  266. package/dist/renderGroups-C9QJrAXu.js +152 -0
  267. package/dist/renderGroups-Dvm1J4lW.cjs +1 -0
  268. package/dist/renderLayers-lDtL0_43.cjs +1 -0
  269. package/dist/renderLayers-zrK2pv5O.js +13 -0
  270. package/dist/renderPasses-CT5iBwtg.cjs +21 -0
  271. package/dist/renderPasses-CjgG_6kQ.js +1500 -0
  272. package/dist/scene-object/index.d.ts +146 -0
  273. package/dist/scene-object/runtimeRegistry.d.ts +14 -0
  274. package/dist/scene-object.cjs +1 -0
  275. package/dist/scene-object.js +40 -0
  276. package/dist/screen-image/screenImagePresets.d.ts +13 -0
  277. package/dist/screen-image/screenImageSettings.d.ts +57 -0
  278. package/dist/screen-text/screenTextPresets.d.ts +6 -0
  279. package/dist/screen-text/screenTextSettings.d.ts +147 -0
  280. package/dist/screen2d/coordinates.d.ts +87 -0
  281. package/dist/screen2d/index.d.ts +7 -0
  282. package/dist/screen2d/material-runtime.d.ts +32 -0
  283. package/dist/screen2d/screenTransform.d.ts +47 -0
  284. package/dist/screen2d/smoothing.d.ts +5 -0
  285. package/dist/screen2d/texture.d.ts +10 -0
  286. package/dist/screen2d/transform.d.ts +25 -0
  287. package/dist/screen2d/types.d.ts +90 -0
  288. package/dist/{selectors-Bub0o3qy.cjs → selectors-2QvO5RYY.cjs} +1 -1
  289. package/dist/{selectors-BHO6TnoC.js → selectors-Dw3C-gSk.js} +5 -5
  290. package/dist/services/MetricsCollector/index.d.ts +7 -1
  291. package/dist/services/MetricsCollector/utils.d.ts +1 -1
  292. package/dist/session-BChR4TgK.cjs +31 -0
  293. package/dist/session-C1StwN0f.js +363 -0
  294. package/dist/texture/animatedTexture.d.ts +61 -0
  295. package/dist/texture/animationMath.d.ts +8 -0
  296. package/dist/texture/sourceResolver.d.ts +30 -0
  297. package/dist/tracking.cjs +1 -1
  298. package/dist/tracking.js +582 -298
  299. package/dist/types/face.d.ts +1 -13
  300. package/dist/types/hand-tracking.d.ts +8 -0
  301. package/dist/types/index.d.ts +0 -1
  302. package/dist/types/nodes.d.ts +4 -1
  303. package/dist/types/session.d.ts +2 -0
  304. package/dist/types/tracking.d.ts +8 -2
  305. package/dist/types/util-types.d.ts +1 -1
  306. package/dist/useFaceInfo-C-WfMlYp.cjs +1 -0
  307. package/dist/useFaceInfo-CwsHZedC.js +62 -0
  308. package/dist/useFaceResults-CkFc1egZ.js +19 -0
  309. package/dist/useFaceResults-VcFdOUFV.cjs +1 -0
  310. package/dist/utils/drawNormalizedCrop.d.ts +22 -0
  311. package/dist/utils/integrity.d.ts +4 -25
  312. package/dist/utils/landmarkBounds.d.ts +1 -1
  313. package/dist/utils/logger.d.ts +2 -2
  314. package/dist/x-Co8jPhP0.js +127 -0
  315. package/dist/x-KC8E4Gaj.cjs +41 -0
  316. package/docs/MIGRATION_GUIDE.md +589 -0
  317. package/docs/SDK_DOCUMENTATION.md +1155 -0
  318. package/docs/api/audio.mdx +36 -0
  319. package/docs/api/behavior-components.mdx +164 -0
  320. package/docs/api/capture-recording.mdx +103 -0
  321. package/docs/api/debug-ui-scene-editor.mdx +249 -0
  322. package/docs/api/face-actions.mdx +104 -0
  323. package/docs/api/face-attribute-expression.mdx +87 -0
  324. package/docs/api/face-binding-anchors.mdx +53 -0
  325. package/docs/api/face-effects.mdx +19 -0
  326. package/docs/api/face-info.mdx +112 -0
  327. package/docs/api/face-mesh.mdx +98 -0
  328. package/docs/api/face-painting.mdx +33 -0
  329. package/docs/api/face-retouching.mdx +73 -0
  330. package/docs/api/material-render-state.mdx +132 -0
  331. package/docs/api/runtime-3d.mdx +311 -0
  332. package/docs/api/scene-object-store.mdx +213 -0
  333. package/docs/api/screen-image.mdx +41 -0
  334. package/docs/api/screen-shape.mdx +64 -0
  335. package/docs/api/screen-space-coordinates.mdx +41 -0
  336. package/docs/api/screen-text.mdx +39 -0
  337. package/docs/api/texture-sources.mdx +55 -0
  338. package/docs/api/trackers.mdx +46 -0
  339. package/docs/docs.json +70 -0
  340. package/docs/examples/scene-object-recipes.mdx +194 -0
  341. package/docs/guides/harness-debug-ui.mdx +139 -0
  342. package/docs/inspector/hierarchy-panel.mdx +51 -0
  343. package/docs/inspector/object-inspector-panel.mdx +51 -0
  344. package/docs/introduction.mdx +121 -0
  345. package/docs/scene-objects/overview.mdx +127 -0
  346. package/docs/scene-objects/render-groups.mdx +77 -0
  347. package/docs/scene-objects/runtime-rendering.mdx +75 -0
  348. package/docs/texture-api-consumer.md +58 -0
  349. package/package.json +55 -7
  350. package/dist/components/FaceRetouch/retouchRegions.d.ts +0 -23
  351. package/dist/components/FaceRetouch/useFaceRetouchRegions.d.ts +0 -12
  352. package/dist/index-B5J4gzn2.cjs +0 -1
  353. package/dist/index-BVBVg96G.cjs +0 -1
  354. package/dist/index-DtwHElmG.js +0 -157
  355. package/dist/index-PtFmD6B8.cjs +0 -1
  356. package/dist/internal-DH5d1Xnq.cjs +0 -1
  357. package/dist/modules/XRClient/index.d.ts +0 -9
  358. package/dist/modules/index.d.ts +0 -1
  359. package/dist/services/ApiService.d.ts +0 -12
  360. package/dist/types/client.d.ts +0 -3
  361. package/dist/useFaceResults-cpsSmKKc.js +0 -81
  362. package/dist/useFaceResults-hVUJYSEY.cjs +0 -1
@@ -1,1415 +1,198 @@
1
- import * as R from "three";
2
- import { TrianglesDrawMode as $t, TriangleFanDrawMode as tt, TriangleStripDrawMode as _t, Loader as Jt, LoaderUtils as xe, FileLoader as Lt, MeshPhysicalMaterial as X, Vector2 as It, Color as se, LinearSRGBColorSpace as V, SRGBColorSpace as ve, SpotLight as en, PointLight as tn, DirectionalLight as nn, Matrix4 as Ne, Vector3 as te, Quaternion as Ct, InstancedMesh as sn, InstancedBufferAttribute as rn, Object3D as Nt, TextureLoader as on, ImageBitmapLoader as an, BufferAttribute as He, InterleavedBuffer as cn, InterleavedBufferAttribute as ln, LinearMipmapLinearFilter as Pt, NearestMipmapLinearFilter as un, LinearMipmapNearestFilter as hn, NearestMipmapNearestFilter as dn, LinearFilter as nt, NearestFilter as Ft, RepeatWrapping as st, MirroredRepeatWrapping as fn, ClampToEdgeWrapping as pn, PointsMaterial as mn, Material as je, LineBasicMaterial as gn, MeshStandardMaterial as Ot, DoubleSide as Ie, MeshBasicMaterial as Te, PropertyBinding as An, BufferGeometry as Tn, SkinnedMesh as xn, Mesh as vn, LineSegments as bn, Line as En, LineLoop as Rn, Points as Mn, Group as Xe, PerspectiveCamera as wn, MathUtils as Sn, OrthographicCamera as yn, Skeleton as _n, AnimationClip as Ln, Bone as In, InterpolateDiscrete as Cn, InterpolateLinear as Dt, Texture as ft, VectorKeyframeTrack as pt, NumberKeyframeTrack as mt, QuaternionKeyframeTrack as gt, ColorManagement as At, FrontSide as Nn, Interpolant as Pn, Box3 as Fn, Sphere as On, Euler as Dn } from "three";
3
- import { jsxs as w, Fragment as rt, jsx as T } from "react/jsx-runtime";
4
- import { useThree as kt, useLoader as Ke, useFrame as kn } from "@react-three/fiber";
5
- import { useState as at, useEffect as $, useMemo as j, useRef as N } from "react";
6
- import { l as Pe, f as Bt, X as Bn } from "./index-CYMj26Ej.js";
7
- import { a as Un, u as Ut } from "./selectors-BHO6TnoC.js";
8
- import { p as Gn, F as Hn, b as jn } from "./index-BD-JWMjE.js";
9
- import { Text as Ye } from "@react-three/drei";
10
- const Tt = {
11
- normal: 0,
12
- add: 1,
13
- subtract: 2,
14
- multiply: 3,
15
- screen: 4,
16
- overlay: 5,
17
- softLight: 6,
18
- hardLight: 7,
19
- lighten: 8,
20
- darken: 9,
21
- difference: 10,
22
- exclusion: 11
23
- }, Ve = /* @__PURE__ */ new Set([
24
- 61,
25
- 146,
26
- 91,
27
- 181,
28
- 84,
29
- 17,
30
- 314,
31
- 405,
32
- 321,
33
- 375,
34
- 291,
35
- 78,
36
- 95,
37
- 88,
38
- 178,
39
- 87,
40
- 14,
41
- 317,
42
- 402,
43
- 318,
44
- 324,
45
- 308,
46
- 191,
47
- 80,
48
- 81,
49
- 82,
50
- 13,
51
- 312,
52
- 311,
53
- 310,
54
- 415
55
- ]), We = /* @__PURE__ */ new Set([
56
- 33,
57
- 7,
58
- 163,
59
- 144,
60
- 145,
61
- 153,
62
- 154,
63
- 155,
64
- 133,
65
- 173,
66
- 157,
67
- 158,
68
- 159,
69
- 160,
70
- 161,
71
- 246
72
- ]), ze = /* @__PURE__ */ new Set([
73
- 362,
74
- 382,
75
- 381,
76
- 380,
77
- 374,
78
- 373,
79
- 390,
80
- 249,
81
- 263,
82
- 466,
83
- 388,
84
- 387,
85
- 386,
86
- 385,
87
- 384,
88
- 398
89
- ]), Xn = /* @__PURE__ */ new Set([814, 815, 816, 817, 818, 819, 830, 831, 832, 833]), Kn = (i, e, t) => {
90
- const s = Ve.has(i) && Ve.has(e) && Ve.has(t), n = We.has(i) && We.has(e) && We.has(t), r = ze.has(i) && ze.has(e) && ze.has(t);
91
- return s ? "mouth" : n || r ? "eye" : "base";
92
- }, Yn = (i) => {
93
- const e = [], t = [], s = [], n = [], r = [], o = [];
94
- let c = 0, a = 0;
95
- i.split(`
96
- `).forEach((u) => {
97
- const h = u.trim();
98
- if (!h) return;
99
- if (h.startsWith("v ")) {
100
- c += 1;
101
- return;
102
- }
103
- if (h.startsWith("vt ")) {
104
- const [, A, m] = h.split(/\s+/);
105
- r.push([Number(A), Number(m)]);
106
- return;
107
- }
108
- if (!h.startsWith("f ")) return;
109
- const d = a;
110
- a += 1;
111
- const [, ...p] = h.split(/\s+/), g = p.map((A) => {
112
- const [m, f] = A.split("/"), x = Number(m) - 1, v = Number(f) - 1;
113
- return v >= 0 && r[v] && !o[x] && (o[x] = r[v]), x;
114
- });
115
- if (!(g.length < 3))
116
- for (let A = 1; A < g.length - 1; A += 1) {
117
- const m = g[0], f = g[A], x = g[A + 1], v = Kn(m, f, x);
118
- Xn.has(d) ? n.push(m, f, x) : v === "mouth" ? t.push(m, f, x) : v === "eye" ? s.push(m, f, x) : e.push(m, f, x);
119
- }
120
- });
121
- const l = [];
122
- for (let u = 0; u < c; u += 1) {
123
- const [h, d] = o[u] ?? [0, 0];
124
- l.push(h, d);
125
- }
126
- return {
127
- baseIndices: new Uint16Array(e),
128
- mouthIndices: new Uint16Array(t),
129
- eyeIndices: new Uint16Array(s),
130
- noseIndices: new Uint16Array(n),
131
- uvs: new Float32Array(l),
132
- vertexCount: c
133
- };
134
- }, Vn = "canonical_face_model.obj", Wn = new TextDecoder("utf-8"), qe = /* @__PURE__ */ new Map(), zn = (i) => {
135
- const e = qe.get(i);
136
- if (e) return e;
137
- const t = Bt(i).then((s) => Yn(Wn.decode(s))).catch((s) => {
138
- throw qe.delete(i), s;
139
- });
140
- return qe.set(i, t), t;
141
- }, qn = (i) => {
142
- const { mesh: e, url: t } = i ?? {}, s = t ?? `${Pe.sdkAssetsBaseUrl}/${Vn}`, [n, r] = at(e ?? null);
143
- return $(() => {
144
- if (e) {
145
- r(e);
146
- return;
147
- }
148
- let o = !1;
149
- return zn(s).then((c) => {
150
- o || r(c);
151
- }).catch((c) => {
152
- o || console.error(`${Pe.loggerPrefix} canonical face mesh load failed`, c);
153
- }), () => {
154
- o = !0;
155
- };
156
- }, [e, s]), n;
157
- }, Zn = {
158
- front: R.FrontSide,
159
- back: R.BackSide,
160
- double: R.DoubleSide
161
- }, Qn = `
162
- attribute vec2 faceUv;
163
- varying vec2 vUv;
164
- varying vec2 vFaceUv;
165
- varying vec3 vNormal;
166
-
167
- void main() {
168
- vUv = uv;
169
- vFaceUv = faceUv;
170
- vNormal = normalize(normalMatrix * normal);
171
- gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
172
- }
173
- `, $n = `
174
- uniform sampler2D cameraTexture;
175
- uniform sampler2D canonicalTexture;
176
- uniform sampler2D alphaMask;
177
- uniform vec3 textureTint;
178
- uniform float opacity;
179
- uniform float blendMode;
180
- uniform float useCanonicalTexture;
181
- uniform float useAlphaMask;
182
- uniform float alphaOpacity;
183
- uniform float compositeShading;
184
- uniform vec3 lightDirection;
185
- uniform float ambientStrength;
186
- uniform float directionalStrength;
187
- varying vec2 vUv;
188
- varying vec2 vFaceUv;
189
- varying vec3 vNormal;
190
-
191
- vec3 linearToSrgb(vec3 value) {
192
- vec3 low = value * 12.92;
193
- vec3 high = 1.055 * pow(max(value, vec3(0.0)), vec3(1.0 / 2.4)) - 0.055;
194
- return mix(high, low, step(value, vec3(0.0031308)));
195
- }
196
-
197
- vec3 srgbToLinear(vec3 value) {
198
- vec3 low = value / 12.92;
199
- vec3 high = pow(max((value + 0.055) / 1.055, vec3(0.0)), vec3(2.4));
200
- return mix(high, low, step(value, vec3(0.04045)));
201
- }
202
-
203
- float overlayChannel(float base, float blend) {
204
- return base < 0.5 ? 2.0 * base * blend : 1.0 - 2.0 * (1.0 - base) * (1.0 - blend);
205
- }
206
-
207
- float hardLightChannel(float base, float blend) {
208
- return blend < 0.5 ? 2.0 * base * blend : 1.0 - 2.0 * (1.0 - base) * (1.0 - blend);
209
- }
210
-
211
- float softLightChannel(float base, float blend) {
212
- if (blend <= 0.5) {
213
- return base - (1.0 - 2.0 * blend) * base * (1.0 - base);
214
- }
215
-
216
- float d = base <= 0.25
217
- ? ((16.0 * base - 12.0) * base + 4.0) * base
218
- : sqrt(base);
219
-
220
- return base + (2.0 * blend - 1.0) * (d - base);
221
- }
222
-
223
- vec3 applyBlendMode(vec3 base, vec3 blend, float mode) {
224
- if (mode < 0.5) return blend;
225
- if (mode < 1.5) return min(base + blend, 1.0);
226
- if (mode < 2.5) return max(base - blend, 0.0);
227
- if (mode < 3.5) return base * blend;
228
- if (mode < 4.5) return 1.0 - (1.0 - base) * (1.0 - blend);
229
- if (mode < 5.5) {
230
- return vec3(
231
- overlayChannel(base.r, blend.r),
232
- overlayChannel(base.g, blend.g),
233
- overlayChannel(base.b, blend.b)
234
- );
235
- }
236
- if (mode < 6.5) {
237
- return vec3(
238
- softLightChannel(base.r, blend.r),
239
- softLightChannel(base.g, blend.g),
240
- softLightChannel(base.b, blend.b)
241
- );
242
- }
243
- if (mode < 7.5) {
244
- return vec3(
245
- hardLightChannel(base.r, blend.r),
246
- hardLightChannel(base.g, blend.g),
247
- hardLightChannel(base.b, blend.b)
248
- );
249
- }
250
- if (mode < 8.5) return max(base, blend);
251
- if (mode < 9.5) return min(base, blend);
252
- if (mode < 10.5) return abs(base - blend);
253
- return base + blend - 2.0 * base * blend;
254
- }
255
-
256
- void main() {
257
- vec3 base = linearToSrgb(texture2D(cameraTexture, vFaceUv).rgb);
258
- vec4 textureSample = texture2D(canonicalTexture, vUv);
259
- vec3 blend = linearToSrgb(textureSample.rgb) * textureTint;
260
- float light = ambientStrength + max(dot(normalize(vNormal), normalize(lightDirection)), 0.0) * directionalStrength;
261
- blend *= mix(1.0, clamp(light, 0.35, 1.35), compositeShading);
262
- float maskSample = texture2D(alphaMask, vUv).r;
263
- float mask = useAlphaMask > 0.5 ? mix(1.0, maskSample, alphaOpacity) : 1.0;
264
- float textureAlpha = useCanonicalTexture > 0.5 ? textureSample.a : 1.0;
265
- vec3 color = useCanonicalTexture > 0.5 ? applyBlendMode(base, blend, blendMode) : base;
266
- gl_FragColor = vec4(srgbToLinear(color), opacity * mask * textureAlpha);
267
- }
268
- `, Jn = `
269
- varying vec2 vUv;
270
- varying vec3 vNormal;
271
-
272
- void main() {
273
- vUv = uv;
274
- vNormal = normalize(normalMatrix * normal);
275
- gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
276
- }
277
- `, es = `
278
- uniform vec3 color;
279
- uniform float opacity;
280
- varying vec3 vNormal;
281
-
282
- void main() {
283
- vec3 normalTint = 0.5 + 0.5 * normalize(vNormal);
284
- vec3 base = color * mix(vec3(1.0), normalTint, 0.35);
285
-
286
- gl_FragColor = vec4(base, opacity);
287
- }
288
- `, ts = () => {
289
- const i = new Uint8Array([
290
- 32,
291
- 32,
292
- 32,
293
- 255,
294
- 96,
295
- 96,
296
- 96,
297
- 255,
298
- 176,
299
- 176,
300
- 176,
301
- 255,
302
- 255,
303
- 255,
304
- 255,
305
- 255
306
- ]), e = new R.DataTexture(i, 4, 1, R.RGBAFormat);
307
- return e.minFilter = R.NearestFilter, e.magFilter = R.NearestFilter, e.generateMipmaps = !1, e.needsUpdate = !0, e;
308
- }, ns = () => {
309
- const i = document.createElement("canvas");
310
- i.width = 256, i.height = 256;
311
- const e = i.getContext("2d");
312
- if (!e)
313
- return new R.CanvasTexture(i);
314
- const t = e.createRadialGradient(96, 80, 10, 128, 128, 128);
315
- t.addColorStop(0, "#ffffff"), t.addColorStop(0.18, "#f7d794"), t.addColorStop(0.45, "#d97706"), t.addColorStop(0.72, "#78350f"), t.addColorStop(1, "#120701"), e.fillStyle = t, e.fillRect(0, 0, i.width, i.height);
316
- const s = new R.CanvasTexture(i);
317
- return s.needsUpdate = !0, s;
318
- }, Cr = ({
319
- faceIndex: i = 0,
320
- color: e = "#38bdf8",
321
- opacity: t = 0.45,
322
- materialType: s = "basic",
323
- shaderPreset: n = "basicShader",
324
- textureMap: r = "none",
325
- alphaMap: o = "none",
326
- alphaOpacity: c = 0,
327
- side: a = "front",
328
- blendMode: l = "normal",
329
- showMouthMask: u = !0,
330
- showEyeMask: h = !0,
331
- showNoseMask: d = !0,
332
- maskTextureSource: p = "none",
333
- maskColor: g = "#111111",
334
- maskOpacity: A = 0,
335
- faceTextureUrl: m = "",
336
- faceTextureStyle2Url: f = "",
337
- faceAlphaMaskUrl: x = "",
338
- compositeShading: v = !1,
339
- mesh: b,
340
- meshUrl: y
341
- }) => {
342
- const L = Un(Bn.FACE_TRACKER), _ = Ut(), { camera: D } = kt(), M = qn({ mesh: b, url: y }), P = Ke(R.TextureLoader, m || "/placeholder.png"), re = Ke(
343
- R.TextureLoader,
344
- f || m || "/placeholder.png"
345
- ), I = Ke(R.TextureLoader, x || "/placeholder.png"), W = j(() => ts(), []), S = j(() => ns(), []), oe = N(null), z = N(null), q = N(null), ue = N(null), he = N(null), de = N(null), fe = N(null), ie = N(null), ae = N(null), pe = N(null), me = N(null), be = N(null), qt = N(new R.Vector3()), Ee = N(!1), J = Zn[a], ce = {
346
- side: J,
347
- transparent: !0,
348
- opacity: t,
349
- wireframe: !1
350
- }, Fe = r === "style2" ? re : P, ge = r !== "none", Re = j(
351
- () => ({
352
- color: { value: new R.Color(e) },
353
- opacity: { value: t }
354
- }),
355
- []
356
- ), F = j(
357
- () => ({
358
- cameraTexture: { value: null },
359
- canonicalTexture: { value: null },
360
- alphaMask: { value: null },
361
- textureTint: { value: new R.Color(e) },
362
- opacity: { value: t },
363
- blendMode: { value: Tt[l] },
364
- useCanonicalTexture: { value: ge ? 1 : 0 },
365
- useAlphaMask: { value: o === "canonical" ? 1 : 0 },
366
- alphaOpacity: { value: c },
367
- compositeShading: { value: v ? 1 : 0 },
368
- lightDirection: { value: new R.Vector3(0.3, 0.65, 0.7).normalize() },
369
- ambientStrength: { value: 0.78 },
370
- directionalStrength: { value: 0.38 }
371
- }),
372
- []
373
- );
374
- $(() => {
375
- Re.color.value.set(e), Re.opacity.value = t;
376
- }, [e, t, Re]), $(() => {
377
- F.cameraTexture.value = _ ?? P, F.canonicalTexture.value = Fe, F.alphaMask.value = I, F.textureTint.value.set(e), F.opacity.value = t, F.blendMode.value = Tt[l], F.useCanonicalTexture.value = ge ? 1 : 0, F.useAlphaMask.value = o === "canonical" ? 1 : 0, F.alphaOpacity.value = c, F.compositeShading.value = v ? 1 : 0;
378
- }, [
379
- o,
380
- I,
381
- c,
382
- l,
383
- _,
384
- e,
385
- v,
386
- F,
387
- P,
388
- ge,
389
- t,
390
- Fe,
391
- r
392
- ]);
393
- const Me = (C) => {
394
- if (C)
395
- return p === "canonical" ? /* @__PURE__ */ T(
396
- "meshBasicMaterial",
397
- {
398
- color: g,
399
- alphaMap: I,
400
- transparent: !0,
401
- opacity: A,
402
- side: J,
403
- depthWrite: !1,
404
- depthTest: !1,
405
- toneMapped: !1
406
- },
407
- "masked-canonical-material"
408
- ) : /* @__PURE__ */ T(
409
- "meshBasicMaterial",
410
- {
411
- color: g,
412
- transparent: !0,
413
- opacity: A,
414
- side: J,
415
- depthWrite: !1,
416
- depthTest: !1,
417
- toneMapped: !1
418
- },
419
- "masked-solid-material"
420
- );
421
- if (s === "wireframe")
422
- return /* @__PURE__ */ T(
423
- "meshBasicMaterial",
424
- {
425
- color: e,
426
- transparent: !0,
427
- opacity: t,
428
- side: J,
429
- depthWrite: !1,
430
- depthTest: !1,
431
- wireframe: !0,
432
- toneMapped: !1
433
- },
434
- "wireframe-material"
435
- );
436
- if (s === "shader" && _ && (n === "originalFace" || n === "composite" && r === "none"))
437
- return /* @__PURE__ */ T(
438
- "meshBasicMaterial",
439
- {
440
- map: _,
441
- alphaMap: I,
442
- transparent: !0,
443
- opacity: t,
444
- side: J,
445
- depthWrite: !1,
446
- depthTest: !0,
447
- toneMapped: !1
448
- },
449
- "use-original-face-material"
450
- );
451
- if (s === "shader" && n === "composite" && ge && _)
452
- return /* @__PURE__ */ T(
453
- "shaderMaterial",
454
- {
455
- uniforms: F,
456
- vertexShader: Qn,
457
- fragmentShader: $n,
458
- transparent: !0,
459
- side: J,
460
- depthWrite: !1,
461
- depthTest: !0,
462
- toneMapped: !1
463
- },
464
- "composite-material"
465
- );
466
- const k = ge ? Fe : null, B = o === "canonical" && c > 0 ? I : null, U = `${s}-${r}-${o}-${c > 0 ? "alpha-on" : "alpha-off"}`;
467
- return s === "standard" ? /* @__PURE__ */ T(
468
- "meshStandardMaterial",
469
- {
470
- ...ce,
471
- color: e,
472
- map: k ?? void 0,
473
- alphaMap: B ?? void 0,
474
- depthWrite: !0,
475
- depthTest: !0,
476
- metalness: 0.05,
477
- roughness: 0.72
478
- },
479
- U
480
- ) : s === "physical" ? /* @__PURE__ */ T(
481
- "meshPhysicalMaterial",
482
- {
483
- ...ce,
484
- color: e,
485
- map: k ?? void 0,
486
- alphaMap: B ?? void 0,
487
- depthWrite: !0,
488
- depthTest: !0,
489
- roughness: 0.58,
490
- metalness: 0.08,
491
- clearcoat: 0.35,
492
- clearcoatRoughness: 0.4
493
- },
494
- U
495
- ) : s === "toon" ? /* @__PURE__ */ T(
496
- "meshToonMaterial",
497
- {
498
- ...ce,
499
- color: e,
500
- map: k ?? void 0,
501
- alphaMap: B ?? void 0,
502
- gradientMap: W,
503
- depthWrite: !0,
504
- depthTest: !0
505
- },
506
- U
507
- ) : s === "normal" ? /* @__PURE__ */ T(
508
- "meshNormalMaterial",
509
- {
510
- ...ce,
511
- depthWrite: !0,
512
- depthTest: !0,
513
- flatShading: !1
514
- },
515
- "normal-material"
516
- ) : s === "matcap" ? /* @__PURE__ */ T(
517
- "meshMatcapMaterial",
518
- {
519
- ...ce,
520
- color: e,
521
- matcap: S,
522
- depthWrite: !0,
523
- depthTest: !0
524
- },
525
- "matcap-material"
526
- ) : s === "shader" ? /* @__PURE__ */ T(
527
- "shaderMaterial",
528
- {
529
- uniforms: Re,
530
- vertexShader: Jn,
531
- fragmentShader: es,
532
- transparent: !0,
533
- side: J,
534
- depthWrite: !1,
535
- depthTest: !0,
536
- toneMapped: !1
537
- },
538
- "generic-shader-material"
539
- ) : /* @__PURE__ */ T(
540
- "meshBasicMaterial",
541
- {
542
- ...ce,
543
- color: e,
544
- map: k ?? void 0,
545
- alphaMap: B ?? void 0,
546
- depthWrite: !1,
547
- depthTest: r !== "none" || o !== "none",
548
- toneMapped: !1
549
- },
550
- U
551
- );
552
- }, Zt = (C) => Gn(C, D, qt.current);
553
- return kn(() => {
554
- var ht, dt;
555
- const C = oe.current, k = z.current, B = q.current, U = ue.current, Oe = he.current, De = de.current, ke = fe.current, Be = ie.current, we = (dt = (ht = L == null ? void 0 : L.detectionResults) == null ? void 0 : ht.faceLandmarks) == null ? void 0 : dt[i];
556
- if (!M || !C || !k || !B || !U || !Oe || !De || !ke || !Be)
557
- return;
558
- if (!we || we.length < M.vertexCount) {
559
- Oe.visible = !1, De.visible = !1, ke.visible = !1, Be.visible = !1;
560
- return;
561
- }
562
- if (be.current !== M) {
563
- ae.current = new Float32Array(M.vertexCount * 3), pe.current = new Float32Array(M.uvs), me.current = new Float32Array(M.vertexCount * 2);
564
- const H = new R.BufferAttribute(ae.current, 3), G = new R.BufferAttribute(pe.current, 2), Z = new R.BufferAttribute(me.current, 2);
565
- C.setAttribute("position", H), C.setAttribute("uv", G), C.setAttribute("faceUv", Z), C.setIndex(new R.BufferAttribute(M.baseIndices, 1)), k.setAttribute("position", H), k.setAttribute("uv", G), k.setAttribute("faceUv", Z), k.setIndex(new R.BufferAttribute(M.mouthIndices, 1)), B.setAttribute("position", H), B.setAttribute("uv", G), B.setAttribute("faceUv", Z), B.setIndex(new R.BufferAttribute(M.eyeIndices, 1)), U.setAttribute("position", H), U.setAttribute("uv", G), U.setAttribute("faceUv", Z), U.setIndex(new R.BufferAttribute(M.noseIndices, 1)), G.needsUpdate = !0, be.current = M, Ee.current = !1;
566
- }
567
- const Se = ae.current, Ue = me.current, ye = pe.current;
568
- if (!Se || !Ue || !ye) return;
569
- const ut = s === "shader" && (n === "originalFace" || n === "composite" && r === "none"), Qt = Math.min(we.length, M.vertexCount);
570
- for (let H = 0; H < Qt; H++) {
571
- const G = we[H], Z = H * 3, _e = H * 2, Ge = Zt(G);
572
- Se[Z] = Ge.x, Se[Z + 1] = Ge.y, Se[Z + 2] = Ge.z, Ue[_e] = G.x, Ue[_e + 1] = 1 - G.y, ut && (ye[_e] = G.x, ye[_e + 1] = 1 - G.y);
573
- }
574
- ut ? (C.attributes.uv.needsUpdate = !0, Ee.current = !0) : Ee.current && (ye.set(M.uvs), C.attributes.uv.needsUpdate = !0, Ee.current = !1), Oe.visible = !0, De.visible = !0, ke.visible = !0, Be.visible = !0, C.attributes.position.needsUpdate = !0, C.attributes.faceUv.needsUpdate = !0, C.computeVertexNormals(), k.computeVertexNormals(), B.computeVertexNormals(), U.computeVertexNormals();
575
- }), /* @__PURE__ */ w(rt, { children: [
576
- /* @__PURE__ */ w("mesh", { ref: he, renderOrder: 10, frustumCulled: !1, children: [
577
- /* @__PURE__ */ T("bufferGeometry", { ref: oe }),
578
- Me(!1)
579
- ] }),
580
- /* @__PURE__ */ w("mesh", { ref: de, renderOrder: 12, frustumCulled: !1, children: [
581
- /* @__PURE__ */ T("bufferGeometry", { ref: z }),
582
- Me(u)
583
- ] }),
584
- /* @__PURE__ */ w("mesh", { ref: fe, renderOrder: 12, frustumCulled: !1, children: [
585
- /* @__PURE__ */ T("bufferGeometry", { ref: q }),
586
- Me(h)
587
- ] }),
588
- /* @__PURE__ */ w("mesh", { ref: ie, renderOrder: 12, frustumCulled: !1, children: [
589
- /* @__PURE__ */ T("bufferGeometry", { ref: ue }),
590
- Me(d)
591
- ] })
592
- ] });
593
- }, Nr = {
594
- materialType: "basic",
595
- shaderPreset: "basicShader",
596
- textureMap: "none",
597
- alphaMap: "none",
598
- alphaOpacity: 1,
599
- side: "front",
600
- blendMode: "normal",
601
- baseColor: "#38bdf8",
602
- opacity: 0.45
603
- }, Pr = {
604
- mouth: !0,
605
- eyes: !0,
606
- nose: !0
607
- }, Fr = [
608
- { label: "Wireframe", value: "wireframe" },
609
- { label: "Basic", value: "basic" },
610
- { label: "Standard", value: "standard" },
611
- { label: "Physical", value: "physical" },
612
- { label: "Toon", value: "toon" },
613
- { label: "Normal", value: "normal" },
614
- { label: "Matcap", value: "matcap" },
615
- { label: "Shader", value: "shader" }
616
- ], Or = [
617
- { label: "Basic Shader", value: "basicShader" },
618
- { label: "Original Face", value: "originalFace" },
619
- { label: "Composite", value: "composite" }
620
- ], Dr = [
621
- { label: "Front", value: "front" },
622
- { label: "Back", value: "back" },
623
- { label: "Double", value: "double" }
624
- ], kr = [
625
- { label: "None", value: "none" },
626
- { label: "UV Map 1", value: "canonical" },
627
- { label: "UV Map 2", value: "style2" }
628
- ], Br = [
629
- { label: "None", value: "none" },
630
- { label: "Default Mask", value: "canonical" }
631
- ], Ur = [
632
- { label: "Normal", value: "normal" },
633
- { label: "Add", value: "add" },
634
- { label: "Subtract", value: "subtract" },
635
- { label: "Multiply", value: "multiply" },
636
- { label: "Screen", value: "screen" },
637
- { label: "Overlay", value: "overlay" },
638
- { label: "Soft Light", value: "softLight" },
639
- { label: "Hard Light", value: "hardLight" },
640
- { label: "Lighten", value: "lighten" },
641
- { label: "Darken", value: "darken" },
642
- { label: "Difference", value: "difference" },
643
- { label: "Exclusion", value: "exclusion" }
644
- ], Gr = (i, e) => i === "basic" || i === "standard" || i === "physical" || i === "toon" || i === "shader" && e === "composite", Hr = (i, e) => i === "shader" && e === "composite", ss = `
645
- varying vec2 vUv;
646
-
647
- void main() {
648
- vUv = uv;
649
- gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
650
- }
651
- `, rs = `
652
- uniform sampler2D cameraTexture;
653
- uniform sampler2D retouchMaskTexture;
654
- uniform sampler2D mouthMaskTexture;
655
- uniform vec2 texelSize;
656
- uniform float retouchAmount;
657
- uniform float blurRadius;
658
- uniform float teethWhitening;
659
- uniform float previewMask;
660
- uniform float protectLandmarks;
661
- varying vec2 vUv;
662
-
663
- vec3 sampleCamera(vec2 uv) {
664
- return texture2D(cameraTexture, clamp(uv, vec2(0.0), vec2(1.0))).rgb;
665
- }
666
-
667
- vec3 readRetouchMask(vec2 uv) {
668
- vec4 mask = texture2D(retouchMaskTexture, uv);
669
- float faceRegion = clamp(mask.b, 0.0, 1.0);
670
- float softFaceRegion = min(mask.r, faceRegion);
671
- float protectedRegion = min(mask.g, faceRegion) * protectLandmarks;
672
- float hardProtectedRegion = step(0.08, protectedRegion);
673
- float softRetouchRegion = softFaceRegion * (1.0 - protectedRegion);
674
- float hardRetouchRegion = step(0.5, faceRegion) * (1.0 - hardProtectedRegion);
675
-
676
- return vec3(
677
- clamp(softRetouchRegion, 0.0, 1.0),
678
- clamp(protectedRegion, 0.0, 1.0),
679
- clamp(hardRetouchRegion, 0.0, 1.0)
680
- );
681
- }
682
-
683
- float readMouthMask(vec2 uv) {
684
- return clamp(texture2D(mouthMaskTexture, uv).r, 0.0, 1.0);
685
- }
686
-
687
- float retouchCoverage(vec2 uv) {
688
- return step(0.001, readRetouchMask(uv).x);
689
- }
690
-
691
- void addMaskedBlurSample(inout vec3 color, inout float weightSum, vec2 centerUv, vec2 sampleUv, float weight) {
692
- float coverage = retouchCoverage(sampleUv);
693
- vec3 sampleColor = mix(sampleCamera(centerUv), sampleCamera(sampleUv), coverage);
694
- color += sampleColor * weight;
695
- weightSum += weight;
696
- }
697
-
698
- vec3 maskedBlurCamera(vec2 uv, float radius) {
699
- vec2 r = texelSize * radius;
700
- vec3 color = sampleCamera(uv) * 0.2;
701
- float weightSum = 0.2;
702
-
703
- addMaskedBlurSample(color, weightSum, uv, uv + vec2(r.x, 0.0), 0.1);
704
- addMaskedBlurSample(color, weightSum, uv, uv - vec2(r.x, 0.0), 0.1);
705
- addMaskedBlurSample(color, weightSum, uv, uv + vec2(0.0, r.y), 0.1);
706
- addMaskedBlurSample(color, weightSum, uv, uv - vec2(0.0, r.y), 0.1);
707
- addMaskedBlurSample(color, weightSum, uv, uv + r, 0.075);
708
- addMaskedBlurSample(color, weightSum, uv, uv - r, 0.075);
709
- addMaskedBlurSample(color, weightSum, uv, uv + vec2(r.x, -r.y), 0.075);
710
- addMaskedBlurSample(color, weightSum, uv, uv + vec2(-r.x, r.y), 0.075);
711
- addMaskedBlurSample(color, weightSum, uv, uv + r * 2.0, 0.05);
712
- addMaskedBlurSample(color, weightSum, uv, uv - r * 2.0, 0.05);
713
-
714
- return color / max(weightSum, 0.001);
715
- }
716
-
717
- vec3 whitenTeeth(vec3 color, float amount, float mouthRegion) {
718
- float maxChannel = max(max(color.r, color.g), color.b);
719
- float minChannel = min(min(color.r, color.g), color.b);
720
- float saturation = maxChannel - minChannel;
721
- float brightness = dot(color, vec3(0.299, 0.587, 0.114));
722
- float redness = max(color.r - max(color.g, color.b), 0.0);
723
- float greenBlueBalance = 1.0 - smoothstep(0.08, 0.24, abs(color.g - color.b));
724
- float candidate =
725
- smoothstep(0.34, 0.62, brightness) *
726
- (1.0 - smoothstep(0.14, 0.32, redness)) *
727
- (1.0 - smoothstep(0.18, 0.42, saturation)) *
728
- greenBlueBalance;
729
- float whiteningMask = clamp(mouthRegion * candidate, 0.0, 1.0);
730
- vec3 desaturated = mix(color, vec3(brightness), 0.42);
731
- vec3 brightened = min(desaturated + vec3(0.16), vec3(1.0));
732
-
733
- return mix(color, brightened, clamp(amount * whiteningMask * 0.38, 0.0, 1.0));
734
- }
735
-
736
- void main() {
737
- vec3 original = sampleCamera(vUv);
738
- vec3 masks = readRetouchMask(vUv);
739
- float mouthMask = readMouthMask(vUv);
740
-
741
- if (previewMask > 0.5) {
742
- float sharpPreview = 1.0 - step(0.001, retouchAmount + blurRadius);
743
- float retouchPreview = mix(masks.x, masks.z, sharpPreview);
744
- float protectedPreview = mix(masks.y, step(0.08, masks.y), sharpPreview);
745
- float whiteningPreview = mouthMask * teethWhitening;
746
- vec3 facePreview = vec3(retouchPreview, 0.08, 0.08);
747
- vec3 featurePreview = vec3(0.05, protectedPreview, 0.1);
748
- vec3 whiteningMaskPreview = vec3(whiteningPreview, whiteningPreview, 0.05);
749
- vec3 maskPreview = max(max(facePreview, featurePreview), whiteningMaskPreview);
750
- vec3 debugColor = mix(original * 0.18, maskPreview, max(max(retouchPreview, protectedPreview), whiteningPreview));
751
- gl_FragColor = vec4(debugColor, 1.0);
752
- #include <colorspace_fragment>
753
- return;
754
- }
755
-
756
- float effectiveBlurRadius = min(blurRadius, 7.0);
757
- vec3 smallBlur = maskedBlurCamera(vUv, max(0.0, effectiveBlurRadius * 0.45));
758
- vec3 largeBlur = maskedBlurCamera(vUv, max(0.0, effectiveBlurRadius));
759
- vec3 detail = original - smallBlur;
760
- float detailAmount = mix(0.5, 0.9, masks.y);
761
- vec3 smoothed = clamp(largeBlur + detail * detailAmount, 0.0, 1.0);
762
- vec3 color = mix(original, smoothed, min(retouchAmount, 0.72) * masks.x);
763
- color = whitenTeeth(color, teethWhitening, mouthMask);
764
- gl_FragColor = vec4(color, 1.0);
765
- #include <colorspace_fragment>
766
- }
767
- `, jr = ({
768
- retouchMask: i,
769
- mouthMask: e,
770
- retouchAmount: t,
771
- blurRadius: s,
772
- teethWhitening: n,
773
- previewMask: r,
774
- protectLandmarks: o
775
- }) => {
776
- const { camera: c, size: a } = kt(), l = Ut(), u = j(
777
- () => ({
778
- cameraTexture: { value: null },
779
- retouchMaskTexture: { value: i },
780
- mouthMaskTexture: { value: e },
781
- texelSize: { value: new R.Vector2(1 / 1280, 1 / 720) },
782
- retouchAmount: { value: t },
783
- blurRadius: { value: s },
784
- teethWhitening: { value: n },
785
- previewMask: { value: 0 },
786
- protectLandmarks: { value: 1 }
787
- }),
788
- [e, i]
789
- ), h = j(() => {
790
- if (!(c instanceof R.PerspectiveCamera))
791
- return [10, 10];
792
- const g = (c.position.z || 5) - -1, A = R.MathUtils.degToRad(c.fov), m = 2 * Math.tan(A / 2) * g;
793
- return [m * (a.width / a.height), m];
794
- }, [c, a]);
795
- return $(() => {
796
- u.cameraTexture.value = l ?? null, u.retouchMaskTexture.value = i, u.mouthMaskTexture.value = e, u.texelSize.value.set(1 / Math.max(a.width, 1), 1 / Math.max(a.height, 1)), u.retouchAmount.value = t, u.blurRadius.value = s, u.teethWhitening.value = n, u.previewMask.value = r ? 1 : 0, u.protectLandmarks.value = o ? 1 : 0;
797
- }, [
798
- s,
799
- l,
800
- r,
801
- o,
802
- t,
803
- e,
804
- i,
805
- n,
806
- a.height,
807
- a.width,
808
- u
809
- ]), l ? /* @__PURE__ */ T("group", { position: [0, 0, -1], children: /* @__PURE__ */ w("mesh", { renderOrder: -1e3, children: [
810
- /* @__PURE__ */ T("planeGeometry", { args: h }),
811
- /* @__PURE__ */ T(
812
- "shaderMaterial",
813
- {
814
- uniforms: u,
815
- vertexShader: ss,
816
- fragmentShader: rs,
817
- depthTest: !1,
818
- depthWrite: !1,
819
- toneMapped: !1
820
- }
821
- )
822
- ] }) }) : null;
823
- }, ct = 512, Gt = [
824
- 10,
825
- 338,
826
- 297,
827
- 332,
828
- 284,
829
- 251,
830
- 389,
831
- 356,
832
- 454,
833
- 323,
834
- 361,
835
- 288,
836
- 397,
837
- 365,
838
- 379,
839
- 378,
840
- 400,
841
- 377,
842
- 152,
843
- 148,
844
- 176,
845
- 149,
846
- 150,
847
- 136,
848
- 172,
849
- 58,
850
- 132,
851
- 93,
852
- 234,
853
- 127,
854
- 162,
855
- 21,
856
- 54,
857
- 103,
858
- 67,
859
- 109
860
- ], os = [
861
- 33,
862
- 246,
863
- 161,
864
- 160,
865
- 159,
866
- 158,
867
- 157,
868
- 173,
869
- 133,
870
- 155,
871
- 154,
872
- 153,
873
- 145,
874
- 144,
875
- 163,
876
- 7
877
- ], is = [
878
- 362,
879
- 398,
880
- 384,
881
- 385,
882
- 386,
883
- 387,
884
- 388,
885
- 466,
886
- 263,
887
- 249,
888
- 390,
889
- 373,
890
- 374,
891
- 380,
892
- 381,
893
- 382
894
- ], as = [
895
- 61,
896
- 146,
897
- 91,
898
- 181,
899
- 84,
900
- 17,
901
- 314,
902
- 405,
903
- 321,
904
- 375,
905
- 291,
906
- 409,
907
- 270,
908
- 269,
909
- 267,
910
- 0,
911
- 37,
912
- 39,
913
- 40,
914
- 185
915
- ], Ht = [
916
- 78,
917
- 95,
918
- 88,
919
- 178,
920
- 87,
921
- 14,
922
- 317,
923
- 402,
924
- 318,
925
- 324,
926
- 308,
927
- 415,
928
- 310,
929
- 311,
930
- 312,
931
- 13,
932
- 82,
933
- 81,
934
- 80,
935
- 191
936
- ], cs = [70, 63, 105, 66, 107, 55, 65, 52, 53, 46], ls = [336, 296, 334, 293, 300, 276, 283, 282, 295, 285], us = [
937
- os,
938
- is,
939
- as,
940
- Ht,
941
- cs,
942
- ls
943
- ], xt = (i, e, t) => {
944
- lt(i, e, Gt, t);
945
- }, hs = (i, e, t) => {
946
- us.forEach((s) => lt(i, e, s, t));
947
- }, vt = (i, e, t) => {
948
- const s = i[e];
949
- return s ? {
950
- x: s.x * t,
951
- y: s.y * t
952
- } : null;
953
- }, lt = (i, e, t, s) => {
954
- const n = vt(e, t[0], s);
955
- if (n) {
956
- i.beginPath(), i.moveTo(n.x, n.y);
957
- for (let r = 1; r < t.length; r += 1) {
958
- const o = vt(e, t[r], s);
959
- o && i.lineTo(o.x, o.y);
960
- }
961
- i.closePath(), i.fill();
962
- }
963
- }, ds = (i, e, t = ct) => {
964
- i.clearRect(0, 0, t, t), e != null && e.length && (i.save(), i.globalCompositeOperation = "lighter", i.fillStyle = "rgb(0, 0, 255)", xt(i, e, t), i.restore(), i.save(), i.globalCompositeOperation = "lighter", i.filter = "blur(8px)", i.fillStyle = "rgb(255, 0, 0)", xt(i, e, t), i.restore(), i.save(), i.globalCompositeOperation = "lighter", i.filter = "blur(3px)", i.fillStyle = "rgb(0, 255, 0)", hs(i, e, t), i.restore());
965
- }, fs = (i, e, t = ct) => {
966
- i.clearRect(0, 0, t, t), e != null && e.length && (i.save(), i.filter = "blur(2px)", i.fillStyle = "rgb(255, 255, 255)", lt(i, e, Ht, t), i.restore());
967
- }, ps = 0.1, ms = 0.48, gs = 0.012, As = 1, Ts = 1.1, xs = 1.15, vs = 0.04, bs = [
968
- 61,
969
- 146,
970
- 91,
971
- 181,
972
- 84,
973
- 17,
974
- 314,
975
- 405,
976
- 321,
977
- 375,
978
- 291,
979
- 78,
980
- 95,
981
- 88,
982
- 178,
983
- 87,
984
- 14,
985
- 317,
986
- 402,
987
- 318,
988
- 324,
989
- 308,
990
- 191,
991
- 80,
992
- 81,
993
- 82,
994
- 13,
995
- 312,
996
- 311,
997
- 310,
998
- 415
999
- ], Es = [
1000
- 33,
1001
- 7,
1002
- 163,
1003
- 144,
1004
- 145,
1005
- 153,
1006
- 154,
1007
- 155,
1008
- 133,
1009
- 173,
1010
- 157,
1011
- 158,
1012
- 159,
1013
- 160,
1014
- 161,
1015
- 246
1016
- ], Rs = [
1017
- 362,
1018
- 382,
1019
- 381,
1020
- 380,
1021
- 374,
1022
- 373,
1023
- 390,
1024
- 249,
1025
- 263,
1026
- 466,
1027
- 388,
1028
- 387,
1029
- 386,
1030
- 385,
1031
- 384,
1032
- 398
1033
- ], Ms = [70, 63, 105, 66, 107, 55, 65, 52, 53, 46], ws = [336, 296, 334, 293, 300, 285, 295, 282, 283, 276], Ss = [
1034
- 1,
1035
- 2,
1036
- 4,
1037
- 5,
1038
- 6,
1039
- 19,
1040
- 94,
1041
- 97,
1042
- 98,
1043
- 99,
1044
- 102,
1045
- 129,
1046
- 168,
1047
- 195,
1048
- 197,
1049
- 240,
1050
- 279,
1051
- 326,
1052
- 327,
1053
- 328,
1054
- 331,
1055
- 344,
1056
- 358,
1057
- 440
1058
- ], ys = [
1059
- bs,
1060
- Es,
1061
- Rs,
1062
- Ms,
1063
- ws,
1064
- Ss
1065
- ], _s = [
1066
- 61,
1067
- 91,
1068
- 84,
1069
- 17,
1070
- 314,
1071
- 321,
1072
- 291,
1073
- 78,
1074
- 178,
1075
- 14,
1076
- 402,
1077
- 308,
1078
- 80,
1079
- 13,
1080
- 312,
1081
- 0,
1082
- 33,
1083
- 144,
1084
- 145,
1085
- 153,
1086
- 155,
1087
- 133,
1088
- 157,
1089
- 159,
1090
- 161,
1091
- 246,
1092
- 362,
1093
- 382,
1094
- 374,
1095
- 373,
1096
- 263,
1097
- 466,
1098
- 388,
1099
- 386,
1100
- 384,
1101
- 398,
1102
- 70,
1103
- 105,
1104
- 107,
1105
- 55,
1106
- 52,
1107
- 46,
1108
- 336,
1109
- 334,
1110
- 300,
1111
- 285,
1112
- 282,
1113
- 276,
1114
- 1,
1115
- 4,
1116
- 5,
1117
- 94,
1118
- 97,
1119
- 98,
1120
- 327,
1121
- 326,
1122
- 2,
1123
- 195
1124
- ], Le = (i) => Math.min(Math.max(i, 0), 1), bt = (i, e, t, s, n, r) => {
1125
- let o = 1, c = 1, a = 0, l = 0, u = 0;
1126
- if (e.forEach((v) => {
1127
- const b = i[v];
1128
- b && (o = Math.min(o, b.x), c = Math.min(c, b.y), a = Math.max(a, b.x), l = Math.max(l, b.y), u += 1);
1129
- }), u === 0) return null;
1130
- const h = a - o, d = l - c, p = Math.max(h * t, r), g = Math.max(d * t, r), A = Le(o - p), m = Le(c - g), f = Le(a + p), x = Le(l + g);
1131
- return {
1132
- centerX: (A + f) * 0.5,
1133
- centerY: (m + x) * 0.5,
1134
- radiusX: Math.max((f - A) * 0.5, r),
1135
- radiusY: Math.max((x - m) * 0.5, r),
1136
- strength: s,
1137
- kind: n
1138
- };
1139
- }, Ls = (i, e, t) => i ? {
1140
- centerX: i.x,
1141
- centerY: i.y,
1142
- radiusX: e,
1143
- radiusY: e,
1144
- strength: t,
1145
- kind: "feature"
1146
- } : null, Is = (i, e) => {
1147
- if (!(i != null && i.length)) return [];
1148
- const t = (e == null ? void 0 : e.faceOvalIndices) ?? Gt, s = (e == null ? void 0 : e.featureGroups) ?? ys, n = (e == null ? void 0 : e.featurePointIndices) ?? _s, r = (e == null ? void 0 : e.faceBoundsExpansion) ?? ps, o = (e == null ? void 0 : e.featureBoundsExpansion) ?? ms, c = (e == null ? void 0 : e.minRegionRadius) ?? gs, a = (e == null ? void 0 : e.faceRegionStrength) ?? As, l = (e == null ? void 0 : e.featureRegionStrength) ?? Ts, u = (e == null ? void 0 : e.featurePointRegionStrength) ?? xs, h = (e == null ? void 0 : e.featurePointRadiusRatio) ?? vs, d = [], p = bt(
1149
- i,
1150
- t,
1151
- r,
1152
- a,
1153
- "face",
1154
- c
1155
- );
1156
- p && d.push(p);
1157
- const g = Math.max(
1158
- Math.max((p == null ? void 0 : p.radiusX) ?? 0, (p == null ? void 0 : p.radiusY) ?? 0) * h,
1159
- c * 1.35
1160
- );
1161
- return s.forEach((A) => {
1162
- const m = bt(
1163
- i,
1164
- A,
1165
- o,
1166
- l,
1167
- "feature",
1168
- c
1169
- );
1170
- m && d.push(m);
1171
- }), n.forEach((A) => {
1172
- const m = Ls(
1173
- i[A],
1174
- g,
1175
- u
1176
- );
1177
- m && d.push(m);
1178
- }), d;
1179
- }, Et = (i) => {
1180
- const e = document.createElement("canvas");
1181
- e.width = i, e.height = i;
1182
- const t = e.getContext("2d", { willReadFrequently: !1 });
1183
- if (!t) throw new Error("Unable to create face retouch mask context");
1184
- const s = new R.CanvasTexture(e);
1185
- return s.colorSpace = R.NoColorSpace, s.minFilter = R.LinearFilter, s.magFilter = R.LinearFilter, s.generateMipmaps = !1, s.needsUpdate = !0, { canvas: e, context: t, texture: s };
1186
- }, Xr = (i, e = ct) => {
1187
- const { mask: t, mouthMask: s } = j(() => ({
1188
- mask: Et(e),
1189
- mouthMask: Et(e)
1190
- }), [e]);
1191
- return $(() => {
1192
- let n = 0;
1193
- const r = () => {
1194
- var c, a;
1195
- n = requestAnimationFrame(r);
1196
- const o = (a = (c = i == null ? void 0 : i.detectionResults) == null ? void 0 : c.faceLandmarks) == null ? void 0 : a[0];
1197
- ds(t.context, o, e), fs(s.context, o, e), t.texture.needsUpdate = !0, s.texture.needsUpdate = !0;
1198
- };
1199
- return r(), () => {
1200
- cancelAnimationFrame(n);
1201
- };
1202
- }, [i, t.context, t.texture, s.context, s.texture, e]), { canvas: t.canvas, texture: t.texture, mouthTexture: s.texture };
1203
- }, Cs = (i) => i.map(
1204
- (e) => [
1205
- e.centerX.toFixed(4),
1206
- e.centerY.toFixed(4),
1207
- e.radiusX.toFixed(4),
1208
- e.radiusY.toFixed(4),
1209
- e.strength.toFixed(2),
1210
- e.kind
1211
- ].join(",")
1212
- ).join("|"), Kr = (i, e) => {
1213
- const [t, s] = at([]);
1214
- return $(() => {
1215
- let n = 0, r = "";
1216
- const o = () => {
1217
- var u, h;
1218
- n = requestAnimationFrame(o);
1219
- const c = (h = (u = i == null ? void 0 : i.detectionResults) == null ? void 0 : u.faceLandmarks) == null ? void 0 : h[0], a = Is(c, e), l = Cs(a);
1220
- l !== r && (r = l, s(a));
1221
- };
1222
- return o(), () => {
1223
- cancelAnimationFrame(n);
1224
- };
1225
- }, [i]), t;
1226
- };
1227
- function Rt(i, e) {
1228
- if (e === $t)
1229
- return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."), i;
1230
- if (e === tt || e === _t) {
1231
- let t = i.getIndex();
1232
- if (t === null) {
1233
- const o = [], c = i.getAttribute("position");
1234
- if (c !== void 0) {
1235
- for (let a = 0; a < c.count; a++)
1236
- o.push(a);
1237
- i.setIndex(o), t = i.getIndex();
1
+ import { jsx as R, jsxs as S, Fragment as Me } from "react/jsx-runtime";
2
+ import { useState as tt, useEffect as we, useMemo as Ae } from "react";
3
+ import * as K from "three";
4
+ import { TrianglesDrawMode as nt, TriangleFanDrawMode as de, TriangleStripDrawMode as He, Loader as st, LoaderUtils as q, FileLoader as Be, MeshPhysicalMaterial as N, Vector2 as ke, Color as v, LinearSRGBColorSpace as D, SRGBColorSpace as Z, SpotLight as rt, PointLight as it, DirectionalLight as ot, Matrix4 as ee, Vector3 as G, Quaternion as Ge, InstancedMesh as at, InstancedBufferAttribute as ct, Object3D as Ue, TextureLoader as lt, ImageBitmapLoader as ut, BufferAttribute as se, InterleavedBuffer as ht, InterleavedBufferAttribute as dt, LinearMipmapLinearFilter as ve, NearestMipmapLinearFilter as ft, LinearMipmapNearestFilter as pt, NearestMipmapNearestFilter as mt, LinearFilter as fe, NearestFilter as je, RepeatWrapping as pe, MirroredRepeatWrapping as gt, ClampToEdgeWrapping as At, PointsMaterial as Tt, Material as re, LineBasicMaterial as Et, MeshStandardMaterial as Ke, DoubleSide as J, MeshBasicMaterial as W, PropertyBinding as xt, BufferGeometry as Rt, SkinnedMesh as _t, Mesh as Mt, LineSegments as wt, Line as St, LineLoop as yt, Points as Lt, Group as ie, PerspectiveCamera as bt, MathUtils as It, OrthographicCamera as Nt, Skeleton as Ct, AnimationClip as Pt, Bone as Ft, InterpolateDiscrete as Ot, InterpolateLinear as Xe, Texture as Se, VectorKeyframeTrack as ye, NumberKeyframeTrack as Le, QuaternionKeyframeTrack as be, ColorManagement as Ie, FrontSide as Dt, Interpolant as Ht, Box3 as Bt, Sphere as kt, Euler as Gt } from "three";
5
+ import { b as Ut, c as vt } from "./index-BgQAX8rs.js";
6
+ import { l as Ne, f as jt } from "./index-JygePOwo.js";
7
+ import { Text as oe } from "@react-three/drei";
8
+ import { q as Qn, C as Jn, D as $n, a as es, c as ts, d as ns, F as ss, e as rs, f as is, g as os, h as as, i as cs, j as ls, l as us, m as hs, b as ds, n as fs, o as ps, p as ms, r as gs, v as As, t as Ts, k as Es, s as xs, u as Rs } from "./FaceMeshRenderer-6t8OsQhK.js";
9
+ import { D as Ms, d as ws, e as Ss, F as ys, f as Ls, b as bs, c as Is, m as Ns, p as Cs, r as Ps, s as Fs, a as Os, t as Ds } from "./FaceRetouch-CDrL0pXg.js";
10
+ function Ce(l, t) {
11
+ if (t === nt)
12
+ return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."), l;
13
+ if (t === de || t === He) {
14
+ let e = l.getIndex();
15
+ if (e === null) {
16
+ const s = [], a = l.getAttribute("position");
17
+ if (a !== void 0) {
18
+ for (let o = 0; o < a.count; o++)
19
+ s.push(o);
20
+ l.setIndex(s), e = l.getIndex();
1238
21
  } else
1239
- return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."), i;
22
+ return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."), l;
1240
23
  }
1241
- const s = t.count - 2, n = [];
1242
- if (e === tt)
1243
- for (let o = 1; o <= s; o++)
1244
- n.push(t.getX(0)), n.push(t.getX(o)), n.push(t.getX(o + 1));
24
+ const r = e.count - 2, n = [];
25
+ if (t === de)
26
+ for (let s = 1; s <= r; s++)
27
+ n.push(e.getX(0)), n.push(e.getX(s)), n.push(e.getX(s + 1));
1245
28
  else
1246
- for (let o = 0; o < s; o++)
1247
- o % 2 === 0 ? (n.push(t.getX(o)), n.push(t.getX(o + 1)), n.push(t.getX(o + 2))) : (n.push(t.getX(o + 2)), n.push(t.getX(o + 1)), n.push(t.getX(o)));
1248
- n.length / 3 !== s && console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");
1249
- const r = i.clone();
1250
- return r.setIndex(n), r.clearGroups(), r;
29
+ for (let s = 0; s < r; s++)
30
+ s % 2 === 0 ? (n.push(e.getX(s)), n.push(e.getX(s + 1)), n.push(e.getX(s + 2))) : (n.push(e.getX(s + 2)), n.push(e.getX(s + 1)), n.push(e.getX(s)));
31
+ n.length / 3 !== r && console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");
32
+ const i = l.clone();
33
+ return i.setIndex(n), i.clearGroups(), i;
1251
34
  } else
1252
- return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:", e), i;
35
+ return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:", t), l;
1253
36
  }
1254
- class Ns extends Jt {
1255
- constructor(e) {
1256
- super(e), this.dracoLoader = null, this.ktx2Loader = null, this.meshoptDecoder = null, this.pluginCallbacks = [], this.register(function(t) {
1257
- return new ks(t);
1258
- }), this.register(function(t) {
1259
- return new Bs(t);
1260
- }), this.register(function(t) {
1261
- return new Ws(t);
1262
- }), this.register(function(t) {
1263
- return new zs(t);
1264
- }), this.register(function(t) {
1265
- return new qs(t);
1266
- }), this.register(function(t) {
1267
- return new Gs(t);
1268
- }), this.register(function(t) {
1269
- return new Hs(t);
1270
- }), this.register(function(t) {
1271
- return new js(t);
1272
- }), this.register(function(t) {
1273
- return new Xs(t);
1274
- }), this.register(function(t) {
1275
- return new Ds(t);
1276
- }), this.register(function(t) {
1277
- return new Ks(t);
1278
- }), this.register(function(t) {
1279
- return new Us(t);
1280
- }), this.register(function(t) {
1281
- return new Vs(t);
1282
- }), this.register(function(t) {
1283
- return new Ys(t);
1284
- }), this.register(function(t) {
1285
- return new Fs(t);
1286
- }), this.register(function(t) {
1287
- return new Zs(t);
1288
- }), this.register(function(t) {
1289
- return new Qs(t);
37
+ class Kt extends st {
38
+ constructor(t) {
39
+ super(t), this.dracoLoader = null, this.ktx2Loader = null, this.meshoptDecoder = null, this.pluginCallbacks = [], this.register(function(e) {
40
+ return new Wt(e);
41
+ }), this.register(function(e) {
42
+ return new qt(e);
43
+ }), this.register(function(e) {
44
+ return new rn(e);
45
+ }), this.register(function(e) {
46
+ return new on(e);
47
+ }), this.register(function(e) {
48
+ return new an(e);
49
+ }), this.register(function(e) {
50
+ return new Qt(e);
51
+ }), this.register(function(e) {
52
+ return new Jt(e);
53
+ }), this.register(function(e) {
54
+ return new $t(e);
55
+ }), this.register(function(e) {
56
+ return new en(e);
57
+ }), this.register(function(e) {
58
+ return new zt(e);
59
+ }), this.register(function(e) {
60
+ return new tn(e);
61
+ }), this.register(function(e) {
62
+ return new Zt(e);
63
+ }), this.register(function(e) {
64
+ return new sn(e);
65
+ }), this.register(function(e) {
66
+ return new nn(e);
67
+ }), this.register(function(e) {
68
+ return new Yt(e);
69
+ }), this.register(function(e) {
70
+ return new cn(e);
71
+ }), this.register(function(e) {
72
+ return new ln(e);
1290
73
  });
1291
74
  }
1292
- load(e, t, s, n) {
1293
- const r = this;
1294
- let o;
75
+ load(t, e, r, n) {
76
+ const i = this;
77
+ let s;
1295
78
  if (this.resourcePath !== "")
1296
- o = this.resourcePath;
79
+ s = this.resourcePath;
1297
80
  else if (this.path !== "") {
1298
- const l = xe.extractUrlBase(e);
1299
- o = xe.resolveURL(l, this.path);
81
+ const c = q.extractUrlBase(t);
82
+ s = q.resolveURL(c, this.path);
1300
83
  } else
1301
- o = xe.extractUrlBase(e);
1302
- this.manager.itemStart(e);
1303
- const c = function(l) {
1304
- n ? n(l) : console.error(l), r.manager.itemError(e), r.manager.itemEnd(e);
1305
- }, a = new Lt(this.manager);
1306
- a.setPath(this.path), a.setResponseType("arraybuffer"), a.setRequestHeader(this.requestHeader), a.setWithCredentials(this.withCredentials), a.load(e, function(l) {
84
+ s = q.extractUrlBase(t);
85
+ this.manager.itemStart(t);
86
+ const a = function(c) {
87
+ n ? n(c) : console.error(c), i.manager.itemError(t), i.manager.itemEnd(t);
88
+ }, o = new Be(this.manager);
89
+ o.setPath(this.path), o.setResponseType("arraybuffer"), o.setRequestHeader(this.requestHeader), o.setWithCredentials(this.withCredentials), o.load(t, function(c) {
1307
90
  try {
1308
- r.parse(l, o, function(u) {
1309
- t(u), r.manager.itemEnd(e);
1310
- }, c);
1311
- } catch (u) {
1312
- c(u);
91
+ i.parse(c, s, function(h) {
92
+ e(h), i.manager.itemEnd(t);
93
+ }, a);
94
+ } catch (h) {
95
+ a(h);
1313
96
  }
1314
- }, s, c);
97
+ }, r, a);
1315
98
  }
1316
- setDRACOLoader(e) {
1317
- return this.dracoLoader = e, this;
99
+ setDRACOLoader(t) {
100
+ return this.dracoLoader = t, this;
1318
101
  }
1319
- setKTX2Loader(e) {
1320
- return this.ktx2Loader = e, this;
102
+ setKTX2Loader(t) {
103
+ return this.ktx2Loader = t, this;
1321
104
  }
1322
- setMeshoptDecoder(e) {
1323
- return this.meshoptDecoder = e, this;
105
+ setMeshoptDecoder(t) {
106
+ return this.meshoptDecoder = t, this;
1324
107
  }
1325
- register(e) {
1326
- return this.pluginCallbacks.indexOf(e) === -1 && this.pluginCallbacks.push(e), this;
108
+ register(t) {
109
+ return this.pluginCallbacks.indexOf(t) === -1 && this.pluginCallbacks.push(t), this;
1327
110
  }
1328
- unregister(e) {
1329
- return this.pluginCallbacks.indexOf(e) !== -1 && this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e), 1), this;
111
+ unregister(t) {
112
+ return this.pluginCallbacks.indexOf(t) !== -1 && this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(t), 1), this;
1330
113
  }
1331
- parse(e, t, s, n) {
1332
- let r;
1333
- const o = {}, c = {}, a = new TextDecoder();
1334
- if (typeof e == "string")
1335
- r = JSON.parse(e);
1336
- else if (e instanceof ArrayBuffer)
1337
- if (a.decode(new Uint8Array(e, 0, 4)) === jt) {
114
+ parse(t, e, r, n) {
115
+ let i;
116
+ const s = {}, a = {}, o = new TextDecoder();
117
+ if (typeof t == "string")
118
+ i = JSON.parse(t);
119
+ else if (t instanceof ArrayBuffer)
120
+ if (o.decode(new Uint8Array(t, 0, 4)) === Ye) {
1338
121
  try {
1339
- o[E.KHR_BINARY_GLTF] = new $s(e);
1340
- } catch (h) {
1341
- n && n(h);
122
+ s[T.KHR_BINARY_GLTF] = new un(t);
123
+ } catch (u) {
124
+ n && n(u);
1342
125
  return;
1343
126
  }
1344
- r = JSON.parse(o[E.KHR_BINARY_GLTF].content);
127
+ i = JSON.parse(s[T.KHR_BINARY_GLTF].content);
1345
128
  } else
1346
- r = JSON.parse(a.decode(e));
129
+ i = JSON.parse(o.decode(t));
1347
130
  else
1348
- r = e;
1349
- if (r.asset === void 0 || r.asset.version[0] < 2) {
131
+ i = t;
132
+ if (i.asset === void 0 || i.asset.version[0] < 2) {
1350
133
  n && n(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));
1351
134
  return;
1352
135
  }
1353
- const l = new hr(r, {
1354
- path: t || this.resourcePath || "",
136
+ const c = new Mn(i, {
137
+ path: e || this.resourcePath || "",
1355
138
  crossOrigin: this.crossOrigin,
1356
139
  requestHeader: this.requestHeader,
1357
140
  manager: this.manager,
1358
141
  ktx2Loader: this.ktx2Loader,
1359
142
  meshoptDecoder: this.meshoptDecoder
1360
143
  });
1361
- l.fileLoader.setRequestHeader(this.requestHeader);
1362
- for (let u = 0; u < this.pluginCallbacks.length; u++) {
1363
- const h = this.pluginCallbacks[u](l);
1364
- h.name || console.error("THREE.GLTFLoader: Invalid plugin found: missing name"), c[h.name] = h, o[h.name] = !0;
144
+ c.fileLoader.setRequestHeader(this.requestHeader);
145
+ for (let h = 0; h < this.pluginCallbacks.length; h++) {
146
+ const u = this.pluginCallbacks[h](c);
147
+ u.name || console.error("THREE.GLTFLoader: Invalid plugin found: missing name"), a[u.name] = u, s[u.name] = !0;
1365
148
  }
1366
- if (r.extensionsUsed)
1367
- for (let u = 0; u < r.extensionsUsed.length; ++u) {
1368
- const h = r.extensionsUsed[u], d = r.extensionsRequired || [];
1369
- switch (h) {
1370
- case E.KHR_MATERIALS_UNLIT:
1371
- o[h] = new Os();
149
+ if (i.extensionsUsed)
150
+ for (let h = 0; h < i.extensionsUsed.length; ++h) {
151
+ const u = i.extensionsUsed[h], d = i.extensionsRequired || [];
152
+ switch (u) {
153
+ case T.KHR_MATERIALS_UNLIT:
154
+ s[u] = new Vt();
1372
155
  break;
1373
- case E.KHR_DRACO_MESH_COMPRESSION:
1374
- o[h] = new Js(r, this.dracoLoader);
156
+ case T.KHR_DRACO_MESH_COMPRESSION:
157
+ s[u] = new hn(i, this.dracoLoader);
1375
158
  break;
1376
- case E.KHR_TEXTURE_TRANSFORM:
1377
- o[h] = new er();
159
+ case T.KHR_TEXTURE_TRANSFORM:
160
+ s[u] = new dn();
1378
161
  break;
1379
- case E.KHR_MESH_QUANTIZATION:
1380
- o[h] = new tr();
162
+ case T.KHR_MESH_QUANTIZATION:
163
+ s[u] = new fn();
1381
164
  break;
1382
165
  default:
1383
- d.indexOf(h) >= 0 && c[h] === void 0 && console.warn('THREE.GLTFLoader: Unknown extension "' + h + '".');
166
+ d.indexOf(u) >= 0 && a[u] === void 0 && console.warn('THREE.GLTFLoader: Unknown extension "' + u + '".');
1384
167
  }
1385
168
  }
1386
- l.setExtensions(o), l.setPlugins(c), l.parse(s, n);
169
+ c.setExtensions(s), c.setPlugins(a), c.parse(r, n);
1387
170
  }
1388
- parseAsync(e, t) {
1389
- const s = this;
1390
- return new Promise(function(n, r) {
1391
- s.parse(e, t, n, r);
171
+ parseAsync(t, e) {
172
+ const r = this;
173
+ return new Promise(function(n, i) {
174
+ r.parse(t, e, n, i);
1392
175
  });
1393
176
  }
1394
177
  }
1395
- function Ps() {
1396
- let i = {};
178
+ function Xt() {
179
+ let l = {};
1397
180
  return {
1398
- get: function(e) {
1399
- return i[e];
181
+ get: function(t) {
182
+ return l[t];
1400
183
  },
1401
- add: function(e, t) {
1402
- i[e] = t;
184
+ add: function(t, e) {
185
+ l[t] = e;
1403
186
  },
1404
- remove: function(e) {
1405
- delete i[e];
187
+ remove: function(t) {
188
+ delete l[t];
1406
189
  },
1407
190
  removeAll: function() {
1408
- i = {};
191
+ l = {};
1409
192
  }
1410
193
  };
1411
194
  }
1412
- const E = {
195
+ const T = {
1413
196
  KHR_BINARY_GLTF: "KHR_binary_glTF",
1414
197
  KHR_DRACO_MESH_COMPRESSION: "KHR_draco_mesh_compression",
1415
198
  KHR_LIGHTS_PUNCTUAL: "KHR_lights_punctual",
@@ -1433,498 +216,498 @@ const E = {
1433
216
  EXT_MESHOPT_COMPRESSION: "EXT_meshopt_compression",
1434
217
  EXT_MESH_GPU_INSTANCING: "EXT_mesh_gpu_instancing"
1435
218
  };
1436
- class Fs {
1437
- constructor(e) {
1438
- this.parser = e, this.name = E.KHR_LIGHTS_PUNCTUAL, this.cache = { refs: {}, uses: {} };
219
+ class Yt {
220
+ constructor(t) {
221
+ this.parser = t, this.name = T.KHR_LIGHTS_PUNCTUAL, this.cache = { refs: {}, uses: {} };
1439
222
  }
1440
223
  _markDefs() {
1441
- const e = this.parser, t = this.parser.json.nodes || [];
1442
- for (let s = 0, n = t.length; s < n; s++) {
1443
- const r = t[s];
1444
- r.extensions && r.extensions[this.name] && r.extensions[this.name].light !== void 0 && e._addNodeRef(this.cache, r.extensions[this.name].light);
224
+ const t = this.parser, e = this.parser.json.nodes || [];
225
+ for (let r = 0, n = e.length; r < n; r++) {
226
+ const i = e[r];
227
+ i.extensions && i.extensions[this.name] && i.extensions[this.name].light !== void 0 && t._addNodeRef(this.cache, i.extensions[this.name].light);
1445
228
  }
1446
229
  }
1447
- _loadLight(e) {
1448
- const t = this.parser, s = "light:" + e;
1449
- let n = t.cache.get(s);
230
+ _loadLight(t) {
231
+ const e = this.parser, r = "light:" + t;
232
+ let n = e.cache.get(r);
1450
233
  if (n) return n;
1451
- const r = t.json, a = ((r.extensions && r.extensions[this.name] || {}).lights || [])[e];
1452
- let l;
1453
- const u = new se(16777215);
1454
- a.color !== void 0 && u.setRGB(a.color[0], a.color[1], a.color[2], V);
1455
- const h = a.range !== void 0 ? a.range : 0;
1456
- switch (a.type) {
234
+ const i = e.json, o = ((i.extensions && i.extensions[this.name] || {}).lights || [])[t];
235
+ let c;
236
+ const h = new v(16777215);
237
+ o.color !== void 0 && h.setRGB(o.color[0], o.color[1], o.color[2], D);
238
+ const u = o.range !== void 0 ? o.range : 0;
239
+ switch (o.type) {
1457
240
  case "directional":
1458
- l = new nn(u), l.target.position.set(0, 0, -1), l.add(l.target);
241
+ c = new ot(h), c.target.position.set(0, 0, -1), c.add(c.target);
1459
242
  break;
1460
243
  case "point":
1461
- l = new tn(u), l.distance = h;
244
+ c = new it(h), c.distance = u;
1462
245
  break;
1463
246
  case "spot":
1464
- l = new en(u), l.distance = h, a.spot = a.spot || {}, a.spot.innerConeAngle = a.spot.innerConeAngle !== void 0 ? a.spot.innerConeAngle : 0, a.spot.outerConeAngle = a.spot.outerConeAngle !== void 0 ? a.spot.outerConeAngle : Math.PI / 4, l.angle = a.spot.outerConeAngle, l.penumbra = 1 - a.spot.innerConeAngle / a.spot.outerConeAngle, l.target.position.set(0, 0, -1), l.add(l.target);
247
+ c = new rt(h), c.distance = u, o.spot = o.spot || {}, o.spot.innerConeAngle = o.spot.innerConeAngle !== void 0 ? o.spot.innerConeAngle : 0, o.spot.outerConeAngle = o.spot.outerConeAngle !== void 0 ? o.spot.outerConeAngle : Math.PI / 4, c.angle = o.spot.outerConeAngle, c.penumbra = 1 - o.spot.innerConeAngle / o.spot.outerConeAngle, c.target.position.set(0, 0, -1), c.add(c.target);
1465
248
  break;
1466
249
  default:
1467
- throw new Error("THREE.GLTFLoader: Unexpected light type: " + a.type);
250
+ throw new Error("THREE.GLTFLoader: Unexpected light type: " + o.type);
1468
251
  }
1469
- return l.position.set(0, 0, 0), K(l, a), a.intensity !== void 0 && (l.intensity = a.intensity), l.name = t.createUniqueName(a.name || "light_" + e), n = Promise.resolve(l), t.cache.add(s, n), n;
252
+ return c.position.set(0, 0, 0), F(c, o), o.intensity !== void 0 && (c.intensity = o.intensity), c.name = e.createUniqueName(o.name || "light_" + t), n = Promise.resolve(c), e.cache.add(r, n), n;
1470
253
  }
1471
- getDependency(e, t) {
1472
- if (e === "light")
1473
- return this._loadLight(t);
254
+ getDependency(t, e) {
255
+ if (t === "light")
256
+ return this._loadLight(e);
1474
257
  }
1475
- createNodeAttachment(e) {
1476
- const t = this, s = this.parser, r = s.json.nodes[e], c = (r.extensions && r.extensions[this.name] || {}).light;
1477
- return c === void 0 ? null : this._loadLight(c).then(function(a) {
1478
- return s._getNodeRef(t.cache, c, a);
258
+ createNodeAttachment(t) {
259
+ const e = this, r = this.parser, i = r.json.nodes[t], a = (i.extensions && i.extensions[this.name] || {}).light;
260
+ return a === void 0 ? null : this._loadLight(a).then(function(o) {
261
+ return r._getNodeRef(e.cache, a, o);
1479
262
  });
1480
263
  }
1481
264
  }
1482
- class Os {
265
+ class Vt {
1483
266
  constructor() {
1484
- this.name = E.KHR_MATERIALS_UNLIT;
267
+ this.name = T.KHR_MATERIALS_UNLIT;
1485
268
  }
1486
269
  getMaterialType() {
1487
- return Te;
270
+ return W;
1488
271
  }
1489
- extendParams(e, t, s) {
272
+ extendParams(t, e, r) {
1490
273
  const n = [];
1491
- e.color = new se(1, 1, 1), e.opacity = 1;
1492
- const r = t.pbrMetallicRoughness;
1493
- if (r) {
1494
- if (Array.isArray(r.baseColorFactor)) {
1495
- const o = r.baseColorFactor;
1496
- e.color.setRGB(o[0], o[1], o[2], V), e.opacity = o[3];
274
+ t.color = new v(1, 1, 1), t.opacity = 1;
275
+ const i = e.pbrMetallicRoughness;
276
+ if (i) {
277
+ if (Array.isArray(i.baseColorFactor)) {
278
+ const s = i.baseColorFactor;
279
+ t.color.setRGB(s[0], s[1], s[2], D), t.opacity = s[3];
1497
280
  }
1498
- r.baseColorTexture !== void 0 && n.push(s.assignTexture(e, "map", r.baseColorTexture, ve));
281
+ i.baseColorTexture !== void 0 && n.push(r.assignTexture(t, "map", i.baseColorTexture, Z));
1499
282
  }
1500
283
  return Promise.all(n);
1501
284
  }
1502
285
  }
1503
- class Ds {
1504
- constructor(e) {
1505
- this.parser = e, this.name = E.KHR_MATERIALS_EMISSIVE_STRENGTH;
286
+ class zt {
287
+ constructor(t) {
288
+ this.parser = t, this.name = T.KHR_MATERIALS_EMISSIVE_STRENGTH;
1506
289
  }
1507
- extendMaterialParams(e, t) {
1508
- const n = this.parser.json.materials[e];
290
+ extendMaterialParams(t, e) {
291
+ const n = this.parser.json.materials[t];
1509
292
  if (!n.extensions || !n.extensions[this.name])
1510
293
  return Promise.resolve();
1511
- const r = n.extensions[this.name].emissiveStrength;
1512
- return r !== void 0 && (t.emissiveIntensity = r), Promise.resolve();
294
+ const i = n.extensions[this.name].emissiveStrength;
295
+ return i !== void 0 && (e.emissiveIntensity = i), Promise.resolve();
1513
296
  }
1514
297
  }
1515
- class ks {
1516
- constructor(e) {
1517
- this.parser = e, this.name = E.KHR_MATERIALS_CLEARCOAT;
298
+ class Wt {
299
+ constructor(t) {
300
+ this.parser = t, this.name = T.KHR_MATERIALS_CLEARCOAT;
1518
301
  }
1519
- getMaterialType(e) {
1520
- const s = this.parser.json.materials[e];
1521
- return !s.extensions || !s.extensions[this.name] ? null : X;
302
+ getMaterialType(t) {
303
+ const r = this.parser.json.materials[t];
304
+ return !r.extensions || !r.extensions[this.name] ? null : N;
1522
305
  }
1523
- extendMaterialParams(e, t) {
1524
- const s = this.parser, n = s.json.materials[e];
306
+ extendMaterialParams(t, e) {
307
+ const r = this.parser, n = r.json.materials[t];
1525
308
  if (!n.extensions || !n.extensions[this.name])
1526
309
  return Promise.resolve();
1527
- const r = [], o = n.extensions[this.name];
1528
- if (o.clearcoatFactor !== void 0 && (t.clearcoat = o.clearcoatFactor), o.clearcoatTexture !== void 0 && r.push(s.assignTexture(t, "clearcoatMap", o.clearcoatTexture)), o.clearcoatRoughnessFactor !== void 0 && (t.clearcoatRoughness = o.clearcoatRoughnessFactor), o.clearcoatRoughnessTexture !== void 0 && r.push(s.assignTexture(t, "clearcoatRoughnessMap", o.clearcoatRoughnessTexture)), o.clearcoatNormalTexture !== void 0 && (r.push(s.assignTexture(t, "clearcoatNormalMap", o.clearcoatNormalTexture)), o.clearcoatNormalTexture.scale !== void 0)) {
1529
- const c = o.clearcoatNormalTexture.scale;
1530
- t.clearcoatNormalScale = new It(c, c);
310
+ const i = [], s = n.extensions[this.name];
311
+ if (s.clearcoatFactor !== void 0 && (e.clearcoat = s.clearcoatFactor), s.clearcoatTexture !== void 0 && i.push(r.assignTexture(e, "clearcoatMap", s.clearcoatTexture)), s.clearcoatRoughnessFactor !== void 0 && (e.clearcoatRoughness = s.clearcoatRoughnessFactor), s.clearcoatRoughnessTexture !== void 0 && i.push(r.assignTexture(e, "clearcoatRoughnessMap", s.clearcoatRoughnessTexture)), s.clearcoatNormalTexture !== void 0 && (i.push(r.assignTexture(e, "clearcoatNormalMap", s.clearcoatNormalTexture)), s.clearcoatNormalTexture.scale !== void 0)) {
312
+ const a = s.clearcoatNormalTexture.scale;
313
+ e.clearcoatNormalScale = new ke(a, a);
1531
314
  }
1532
- return Promise.all(r);
315
+ return Promise.all(i);
1533
316
  }
1534
317
  }
1535
- class Bs {
1536
- constructor(e) {
1537
- this.parser = e, this.name = E.KHR_MATERIALS_DISPERSION;
318
+ class qt {
319
+ constructor(t) {
320
+ this.parser = t, this.name = T.KHR_MATERIALS_DISPERSION;
1538
321
  }
1539
- getMaterialType(e) {
1540
- const s = this.parser.json.materials[e];
1541
- return !s.extensions || !s.extensions[this.name] ? null : X;
322
+ getMaterialType(t) {
323
+ const r = this.parser.json.materials[t];
324
+ return !r.extensions || !r.extensions[this.name] ? null : N;
1542
325
  }
1543
- extendMaterialParams(e, t) {
1544
- const n = this.parser.json.materials[e];
326
+ extendMaterialParams(t, e) {
327
+ const n = this.parser.json.materials[t];
1545
328
  if (!n.extensions || !n.extensions[this.name])
1546
329
  return Promise.resolve();
1547
- const r = n.extensions[this.name];
1548
- return t.dispersion = r.dispersion !== void 0 ? r.dispersion : 0, Promise.resolve();
330
+ const i = n.extensions[this.name];
331
+ return e.dispersion = i.dispersion !== void 0 ? i.dispersion : 0, Promise.resolve();
1549
332
  }
1550
333
  }
1551
- class Us {
1552
- constructor(e) {
1553
- this.parser = e, this.name = E.KHR_MATERIALS_IRIDESCENCE;
334
+ class Zt {
335
+ constructor(t) {
336
+ this.parser = t, this.name = T.KHR_MATERIALS_IRIDESCENCE;
1554
337
  }
1555
- getMaterialType(e) {
1556
- const s = this.parser.json.materials[e];
1557
- return !s.extensions || !s.extensions[this.name] ? null : X;
338
+ getMaterialType(t) {
339
+ const r = this.parser.json.materials[t];
340
+ return !r.extensions || !r.extensions[this.name] ? null : N;
1558
341
  }
1559
- extendMaterialParams(e, t) {
1560
- const s = this.parser, n = s.json.materials[e];
342
+ extendMaterialParams(t, e) {
343
+ const r = this.parser, n = r.json.materials[t];
1561
344
  if (!n.extensions || !n.extensions[this.name])
1562
345
  return Promise.resolve();
1563
- const r = [], o = n.extensions[this.name];
1564
- return o.iridescenceFactor !== void 0 && (t.iridescence = o.iridescenceFactor), o.iridescenceTexture !== void 0 && r.push(s.assignTexture(t, "iridescenceMap", o.iridescenceTexture)), o.iridescenceIor !== void 0 && (t.iridescenceIOR = o.iridescenceIor), t.iridescenceThicknessRange === void 0 && (t.iridescenceThicknessRange = [100, 400]), o.iridescenceThicknessMinimum !== void 0 && (t.iridescenceThicknessRange[0] = o.iridescenceThicknessMinimum), o.iridescenceThicknessMaximum !== void 0 && (t.iridescenceThicknessRange[1] = o.iridescenceThicknessMaximum), o.iridescenceThicknessTexture !== void 0 && r.push(s.assignTexture(t, "iridescenceThicknessMap", o.iridescenceThicknessTexture)), Promise.all(r);
346
+ const i = [], s = n.extensions[this.name];
347
+ return s.iridescenceFactor !== void 0 && (e.iridescence = s.iridescenceFactor), s.iridescenceTexture !== void 0 && i.push(r.assignTexture(e, "iridescenceMap", s.iridescenceTexture)), s.iridescenceIor !== void 0 && (e.iridescenceIOR = s.iridescenceIor), e.iridescenceThicknessRange === void 0 && (e.iridescenceThicknessRange = [100, 400]), s.iridescenceThicknessMinimum !== void 0 && (e.iridescenceThicknessRange[0] = s.iridescenceThicknessMinimum), s.iridescenceThicknessMaximum !== void 0 && (e.iridescenceThicknessRange[1] = s.iridescenceThicknessMaximum), s.iridescenceThicknessTexture !== void 0 && i.push(r.assignTexture(e, "iridescenceThicknessMap", s.iridescenceThicknessTexture)), Promise.all(i);
1565
348
  }
1566
349
  }
1567
- class Gs {
1568
- constructor(e) {
1569
- this.parser = e, this.name = E.KHR_MATERIALS_SHEEN;
350
+ class Qt {
351
+ constructor(t) {
352
+ this.parser = t, this.name = T.KHR_MATERIALS_SHEEN;
1570
353
  }
1571
- getMaterialType(e) {
1572
- const s = this.parser.json.materials[e];
1573
- return !s.extensions || !s.extensions[this.name] ? null : X;
354
+ getMaterialType(t) {
355
+ const r = this.parser.json.materials[t];
356
+ return !r.extensions || !r.extensions[this.name] ? null : N;
1574
357
  }
1575
- extendMaterialParams(e, t) {
1576
- const s = this.parser, n = s.json.materials[e];
358
+ extendMaterialParams(t, e) {
359
+ const r = this.parser, n = r.json.materials[t];
1577
360
  if (!n.extensions || !n.extensions[this.name])
1578
361
  return Promise.resolve();
1579
- const r = [];
1580
- t.sheenColor = new se(0, 0, 0), t.sheenRoughness = 0, t.sheen = 1;
1581
- const o = n.extensions[this.name];
1582
- if (o.sheenColorFactor !== void 0) {
1583
- const c = o.sheenColorFactor;
1584
- t.sheenColor.setRGB(c[0], c[1], c[2], V);
362
+ const i = [];
363
+ e.sheenColor = new v(0, 0, 0), e.sheenRoughness = 0, e.sheen = 1;
364
+ const s = n.extensions[this.name];
365
+ if (s.sheenColorFactor !== void 0) {
366
+ const a = s.sheenColorFactor;
367
+ e.sheenColor.setRGB(a[0], a[1], a[2], D);
1585
368
  }
1586
- return o.sheenRoughnessFactor !== void 0 && (t.sheenRoughness = o.sheenRoughnessFactor), o.sheenColorTexture !== void 0 && r.push(s.assignTexture(t, "sheenColorMap", o.sheenColorTexture, ve)), o.sheenRoughnessTexture !== void 0 && r.push(s.assignTexture(t, "sheenRoughnessMap", o.sheenRoughnessTexture)), Promise.all(r);
369
+ return s.sheenRoughnessFactor !== void 0 && (e.sheenRoughness = s.sheenRoughnessFactor), s.sheenColorTexture !== void 0 && i.push(r.assignTexture(e, "sheenColorMap", s.sheenColorTexture, Z)), s.sheenRoughnessTexture !== void 0 && i.push(r.assignTexture(e, "sheenRoughnessMap", s.sheenRoughnessTexture)), Promise.all(i);
1587
370
  }
1588
371
  }
1589
- class Hs {
1590
- constructor(e) {
1591
- this.parser = e, this.name = E.KHR_MATERIALS_TRANSMISSION;
372
+ class Jt {
373
+ constructor(t) {
374
+ this.parser = t, this.name = T.KHR_MATERIALS_TRANSMISSION;
1592
375
  }
1593
- getMaterialType(e) {
1594
- const s = this.parser.json.materials[e];
1595
- return !s.extensions || !s.extensions[this.name] ? null : X;
376
+ getMaterialType(t) {
377
+ const r = this.parser.json.materials[t];
378
+ return !r.extensions || !r.extensions[this.name] ? null : N;
1596
379
  }
1597
- extendMaterialParams(e, t) {
1598
- const s = this.parser, n = s.json.materials[e];
380
+ extendMaterialParams(t, e) {
381
+ const r = this.parser, n = r.json.materials[t];
1599
382
  if (!n.extensions || !n.extensions[this.name])
1600
383
  return Promise.resolve();
1601
- const r = [], o = n.extensions[this.name];
1602
- return o.transmissionFactor !== void 0 && (t.transmission = o.transmissionFactor), o.transmissionTexture !== void 0 && r.push(s.assignTexture(t, "transmissionMap", o.transmissionTexture)), Promise.all(r);
384
+ const i = [], s = n.extensions[this.name];
385
+ return s.transmissionFactor !== void 0 && (e.transmission = s.transmissionFactor), s.transmissionTexture !== void 0 && i.push(r.assignTexture(e, "transmissionMap", s.transmissionTexture)), Promise.all(i);
1603
386
  }
1604
387
  }
1605
- class js {
1606
- constructor(e) {
1607
- this.parser = e, this.name = E.KHR_MATERIALS_VOLUME;
388
+ class $t {
389
+ constructor(t) {
390
+ this.parser = t, this.name = T.KHR_MATERIALS_VOLUME;
1608
391
  }
1609
- getMaterialType(e) {
1610
- const s = this.parser.json.materials[e];
1611
- return !s.extensions || !s.extensions[this.name] ? null : X;
392
+ getMaterialType(t) {
393
+ const r = this.parser.json.materials[t];
394
+ return !r.extensions || !r.extensions[this.name] ? null : N;
1612
395
  }
1613
- extendMaterialParams(e, t) {
1614
- const s = this.parser, n = s.json.materials[e];
396
+ extendMaterialParams(t, e) {
397
+ const r = this.parser, n = r.json.materials[t];
1615
398
  if (!n.extensions || !n.extensions[this.name])
1616
399
  return Promise.resolve();
1617
- const r = [], o = n.extensions[this.name];
1618
- t.thickness = o.thicknessFactor !== void 0 ? o.thicknessFactor : 0, o.thicknessTexture !== void 0 && r.push(s.assignTexture(t, "thicknessMap", o.thicknessTexture)), t.attenuationDistance = o.attenuationDistance || 1 / 0;
1619
- const c = o.attenuationColor || [1, 1, 1];
1620
- return t.attenuationColor = new se().setRGB(c[0], c[1], c[2], V), Promise.all(r);
400
+ const i = [], s = n.extensions[this.name];
401
+ e.thickness = s.thicknessFactor !== void 0 ? s.thicknessFactor : 0, s.thicknessTexture !== void 0 && i.push(r.assignTexture(e, "thicknessMap", s.thicknessTexture)), e.attenuationDistance = s.attenuationDistance || 1 / 0;
402
+ const a = s.attenuationColor || [1, 1, 1];
403
+ return e.attenuationColor = new v().setRGB(a[0], a[1], a[2], D), Promise.all(i);
1621
404
  }
1622
405
  }
1623
- class Xs {
1624
- constructor(e) {
1625
- this.parser = e, this.name = E.KHR_MATERIALS_IOR;
406
+ class en {
407
+ constructor(t) {
408
+ this.parser = t, this.name = T.KHR_MATERIALS_IOR;
1626
409
  }
1627
- getMaterialType(e) {
1628
- const s = this.parser.json.materials[e];
1629
- return !s.extensions || !s.extensions[this.name] ? null : X;
410
+ getMaterialType(t) {
411
+ const r = this.parser.json.materials[t];
412
+ return !r.extensions || !r.extensions[this.name] ? null : N;
1630
413
  }
1631
- extendMaterialParams(e, t) {
1632
- const n = this.parser.json.materials[e];
414
+ extendMaterialParams(t, e) {
415
+ const n = this.parser.json.materials[t];
1633
416
  if (!n.extensions || !n.extensions[this.name])
1634
417
  return Promise.resolve();
1635
- const r = n.extensions[this.name];
1636
- return t.ior = r.ior !== void 0 ? r.ior : 1.5, Promise.resolve();
418
+ const i = n.extensions[this.name];
419
+ return e.ior = i.ior !== void 0 ? i.ior : 1.5, Promise.resolve();
1637
420
  }
1638
421
  }
1639
- class Ks {
1640
- constructor(e) {
1641
- this.parser = e, this.name = E.KHR_MATERIALS_SPECULAR;
422
+ class tn {
423
+ constructor(t) {
424
+ this.parser = t, this.name = T.KHR_MATERIALS_SPECULAR;
1642
425
  }
1643
- getMaterialType(e) {
1644
- const s = this.parser.json.materials[e];
1645
- return !s.extensions || !s.extensions[this.name] ? null : X;
426
+ getMaterialType(t) {
427
+ const r = this.parser.json.materials[t];
428
+ return !r.extensions || !r.extensions[this.name] ? null : N;
1646
429
  }
1647
- extendMaterialParams(e, t) {
1648
- const s = this.parser, n = s.json.materials[e];
430
+ extendMaterialParams(t, e) {
431
+ const r = this.parser, n = r.json.materials[t];
1649
432
  if (!n.extensions || !n.extensions[this.name])
1650
433
  return Promise.resolve();
1651
- const r = [], o = n.extensions[this.name];
1652
- t.specularIntensity = o.specularFactor !== void 0 ? o.specularFactor : 1, o.specularTexture !== void 0 && r.push(s.assignTexture(t, "specularIntensityMap", o.specularTexture));
1653
- const c = o.specularColorFactor || [1, 1, 1];
1654
- return t.specularColor = new se().setRGB(c[0], c[1], c[2], V), o.specularColorTexture !== void 0 && r.push(s.assignTexture(t, "specularColorMap", o.specularColorTexture, ve)), Promise.all(r);
434
+ const i = [], s = n.extensions[this.name];
435
+ e.specularIntensity = s.specularFactor !== void 0 ? s.specularFactor : 1, s.specularTexture !== void 0 && i.push(r.assignTexture(e, "specularIntensityMap", s.specularTexture));
436
+ const a = s.specularColorFactor || [1, 1, 1];
437
+ return e.specularColor = new v().setRGB(a[0], a[1], a[2], D), s.specularColorTexture !== void 0 && i.push(r.assignTexture(e, "specularColorMap", s.specularColorTexture, Z)), Promise.all(i);
1655
438
  }
1656
439
  }
1657
- class Ys {
1658
- constructor(e) {
1659
- this.parser = e, this.name = E.EXT_MATERIALS_BUMP;
440
+ class nn {
441
+ constructor(t) {
442
+ this.parser = t, this.name = T.EXT_MATERIALS_BUMP;
1660
443
  }
1661
- getMaterialType(e) {
1662
- const s = this.parser.json.materials[e];
1663
- return !s.extensions || !s.extensions[this.name] ? null : X;
444
+ getMaterialType(t) {
445
+ const r = this.parser.json.materials[t];
446
+ return !r.extensions || !r.extensions[this.name] ? null : N;
1664
447
  }
1665
- extendMaterialParams(e, t) {
1666
- const s = this.parser, n = s.json.materials[e];
448
+ extendMaterialParams(t, e) {
449
+ const r = this.parser, n = r.json.materials[t];
1667
450
  if (!n.extensions || !n.extensions[this.name])
1668
451
  return Promise.resolve();
1669
- const r = [], o = n.extensions[this.name];
1670
- return t.bumpScale = o.bumpFactor !== void 0 ? o.bumpFactor : 1, o.bumpTexture !== void 0 && r.push(s.assignTexture(t, "bumpMap", o.bumpTexture)), Promise.all(r);
452
+ const i = [], s = n.extensions[this.name];
453
+ return e.bumpScale = s.bumpFactor !== void 0 ? s.bumpFactor : 1, s.bumpTexture !== void 0 && i.push(r.assignTexture(e, "bumpMap", s.bumpTexture)), Promise.all(i);
1671
454
  }
1672
455
  }
1673
- class Vs {
1674
- constructor(e) {
1675
- this.parser = e, this.name = E.KHR_MATERIALS_ANISOTROPY;
456
+ class sn {
457
+ constructor(t) {
458
+ this.parser = t, this.name = T.KHR_MATERIALS_ANISOTROPY;
1676
459
  }
1677
- getMaterialType(e) {
1678
- const s = this.parser.json.materials[e];
1679
- return !s.extensions || !s.extensions[this.name] ? null : X;
460
+ getMaterialType(t) {
461
+ const r = this.parser.json.materials[t];
462
+ return !r.extensions || !r.extensions[this.name] ? null : N;
1680
463
  }
1681
- extendMaterialParams(e, t) {
1682
- const s = this.parser, n = s.json.materials[e];
464
+ extendMaterialParams(t, e) {
465
+ const r = this.parser, n = r.json.materials[t];
1683
466
  if (!n.extensions || !n.extensions[this.name])
1684
467
  return Promise.resolve();
1685
- const r = [], o = n.extensions[this.name];
1686
- return o.anisotropyStrength !== void 0 && (t.anisotropy = o.anisotropyStrength), o.anisotropyRotation !== void 0 && (t.anisotropyRotation = o.anisotropyRotation), o.anisotropyTexture !== void 0 && r.push(s.assignTexture(t, "anisotropyMap", o.anisotropyTexture)), Promise.all(r);
468
+ const i = [], s = n.extensions[this.name];
469
+ return s.anisotropyStrength !== void 0 && (e.anisotropy = s.anisotropyStrength), s.anisotropyRotation !== void 0 && (e.anisotropyRotation = s.anisotropyRotation), s.anisotropyTexture !== void 0 && i.push(r.assignTexture(e, "anisotropyMap", s.anisotropyTexture)), Promise.all(i);
1687
470
  }
1688
471
  }
1689
- class Ws {
1690
- constructor(e) {
1691
- this.parser = e, this.name = E.KHR_TEXTURE_BASISU;
472
+ class rn {
473
+ constructor(t) {
474
+ this.parser = t, this.name = T.KHR_TEXTURE_BASISU;
1692
475
  }
1693
- loadTexture(e) {
1694
- const t = this.parser, s = t.json, n = s.textures[e];
476
+ loadTexture(t) {
477
+ const e = this.parser, r = e.json, n = r.textures[t];
1695
478
  if (!n.extensions || !n.extensions[this.name])
1696
479
  return null;
1697
- const r = n.extensions[this.name], o = t.options.ktx2Loader;
1698
- if (!o) {
1699
- if (s.extensionsRequired && s.extensionsRequired.indexOf(this.name) >= 0)
480
+ const i = n.extensions[this.name], s = e.options.ktx2Loader;
481
+ if (!s) {
482
+ if (r.extensionsRequired && r.extensionsRequired.indexOf(this.name) >= 0)
1700
483
  throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");
1701
484
  return null;
1702
485
  }
1703
- return t.loadTextureImage(e, r.source, o);
486
+ return e.loadTextureImage(t, i.source, s);
1704
487
  }
1705
488
  }
1706
- class zs {
1707
- constructor(e) {
1708
- this.parser = e, this.name = E.EXT_TEXTURE_WEBP, this.isSupported = null;
489
+ class on {
490
+ constructor(t) {
491
+ this.parser = t, this.name = T.EXT_TEXTURE_WEBP, this.isSupported = null;
1709
492
  }
1710
- loadTexture(e) {
1711
- const t = this.name, s = this.parser, n = s.json, r = n.textures[e];
1712
- if (!r.extensions || !r.extensions[t])
493
+ loadTexture(t) {
494
+ const e = this.name, r = this.parser, n = r.json, i = n.textures[t];
495
+ if (!i.extensions || !i.extensions[e])
1713
496
  return null;
1714
- const o = r.extensions[t], c = n.images[o.source];
1715
- let a = s.textureLoader;
1716
- if (c.uri) {
1717
- const l = s.options.manager.getHandler(c.uri);
1718
- l !== null && (a = l);
497
+ const s = i.extensions[e], a = n.images[s.source];
498
+ let o = r.textureLoader;
499
+ if (a.uri) {
500
+ const c = r.options.manager.getHandler(a.uri);
501
+ c !== null && (o = c);
1719
502
  }
1720
- return this.detectSupport().then(function(l) {
1721
- if (l) return s.loadTextureImage(e, o.source, a);
1722
- if (n.extensionsRequired && n.extensionsRequired.indexOf(t) >= 0)
503
+ return this.detectSupport().then(function(c) {
504
+ if (c) return r.loadTextureImage(t, s.source, o);
505
+ if (n.extensionsRequired && n.extensionsRequired.indexOf(e) >= 0)
1723
506
  throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");
1724
- return s.loadTexture(e);
507
+ return r.loadTexture(t);
1725
508
  });
1726
509
  }
1727
510
  detectSupport() {
1728
- return this.isSupported || (this.isSupported = new Promise(function(e) {
1729
- const t = new Image();
1730
- t.src = "data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA", t.onload = t.onerror = function() {
1731
- e(t.height === 1);
511
+ return this.isSupported || (this.isSupported = new Promise(function(t) {
512
+ const e = new Image();
513
+ e.src = "data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA", e.onload = e.onerror = function() {
514
+ t(e.height === 1);
1732
515
  };
1733
516
  })), this.isSupported;
1734
517
  }
1735
518
  }
1736
- class qs {
1737
- constructor(e) {
1738
- this.parser = e, this.name = E.EXT_TEXTURE_AVIF, this.isSupported = null;
519
+ class an {
520
+ constructor(t) {
521
+ this.parser = t, this.name = T.EXT_TEXTURE_AVIF, this.isSupported = null;
1739
522
  }
1740
- loadTexture(e) {
1741
- const t = this.name, s = this.parser, n = s.json, r = n.textures[e];
1742
- if (!r.extensions || !r.extensions[t])
523
+ loadTexture(t) {
524
+ const e = this.name, r = this.parser, n = r.json, i = n.textures[t];
525
+ if (!i.extensions || !i.extensions[e])
1743
526
  return null;
1744
- const o = r.extensions[t], c = n.images[o.source];
1745
- let a = s.textureLoader;
1746
- if (c.uri) {
1747
- const l = s.options.manager.getHandler(c.uri);
1748
- l !== null && (a = l);
527
+ const s = i.extensions[e], a = n.images[s.source];
528
+ let o = r.textureLoader;
529
+ if (a.uri) {
530
+ const c = r.options.manager.getHandler(a.uri);
531
+ c !== null && (o = c);
1749
532
  }
1750
- return this.detectSupport().then(function(l) {
1751
- if (l) return s.loadTextureImage(e, o.source, a);
1752
- if (n.extensionsRequired && n.extensionsRequired.indexOf(t) >= 0)
533
+ return this.detectSupport().then(function(c) {
534
+ if (c) return r.loadTextureImage(t, s.source, o);
535
+ if (n.extensionsRequired && n.extensionsRequired.indexOf(e) >= 0)
1753
536
  throw new Error("THREE.GLTFLoader: AVIF required by asset but unsupported.");
1754
- return s.loadTexture(e);
537
+ return r.loadTexture(t);
1755
538
  });
1756
539
  }
1757
540
  detectSupport() {
1758
- return this.isSupported || (this.isSupported = new Promise(function(e) {
1759
- const t = new Image();
1760
- t.src = "data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAABcAAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAEAAAABAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQAMAAAAABNjb2xybmNseAACAAIABoAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAAB9tZGF0EgAKCBgABogQEDQgMgkQAAAAB8dSLfI=", t.onload = t.onerror = function() {
1761
- e(t.height === 1);
541
+ return this.isSupported || (this.isSupported = new Promise(function(t) {
542
+ const e = new Image();
543
+ e.src = "data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAABcAAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAEAAAABAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQAMAAAAABNjb2xybmNseAACAAIABoAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAAB9tZGF0EgAKCBgABogQEDQgMgkQAAAAB8dSLfI=", e.onload = e.onerror = function() {
544
+ t(e.height === 1);
1762
545
  };
1763
546
  })), this.isSupported;
1764
547
  }
1765
548
  }
1766
- class Zs {
1767
- constructor(e) {
1768
- this.name = E.EXT_MESHOPT_COMPRESSION, this.parser = e;
1769
- }
1770
- loadBufferView(e) {
1771
- const t = this.parser.json, s = t.bufferViews[e];
1772
- if (s.extensions && s.extensions[this.name]) {
1773
- const n = s.extensions[this.name], r = this.parser.getDependency("buffer", n.buffer), o = this.parser.options.meshoptDecoder;
1774
- if (!o || !o.supported) {
1775
- if (t.extensionsRequired && t.extensionsRequired.indexOf(this.name) >= 0)
549
+ class cn {
550
+ constructor(t) {
551
+ this.name = T.EXT_MESHOPT_COMPRESSION, this.parser = t;
552
+ }
553
+ loadBufferView(t) {
554
+ const e = this.parser.json, r = e.bufferViews[t];
555
+ if (r.extensions && r.extensions[this.name]) {
556
+ const n = r.extensions[this.name], i = this.parser.getDependency("buffer", n.buffer), s = this.parser.options.meshoptDecoder;
557
+ if (!s || !s.supported) {
558
+ if (e.extensionsRequired && e.extensionsRequired.indexOf(this.name) >= 0)
1776
559
  throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");
1777
560
  return null;
1778
561
  }
1779
- return r.then(function(c) {
1780
- const a = n.byteOffset || 0, l = n.byteLength || 0, u = n.count, h = n.byteStride, d = new Uint8Array(c, a, l);
1781
- return o.decodeGltfBufferAsync ? o.decodeGltfBufferAsync(u, h, d, n.mode, n.filter).then(function(p) {
562
+ return i.then(function(a) {
563
+ const o = n.byteOffset || 0, c = n.byteLength || 0, h = n.count, u = n.byteStride, d = new Uint8Array(a, o, c);
564
+ return s.decodeGltfBufferAsync ? s.decodeGltfBufferAsync(h, u, d, n.mode, n.filter).then(function(p) {
1782
565
  return p.buffer;
1783
- }) : o.ready.then(function() {
1784
- const p = new ArrayBuffer(u * h);
1785
- return o.decodeGltfBuffer(new Uint8Array(p), u, h, d, n.mode, n.filter), p;
566
+ }) : s.ready.then(function() {
567
+ const p = new ArrayBuffer(h * u);
568
+ return s.decodeGltfBuffer(new Uint8Array(p), h, u, d, n.mode, n.filter), p;
1786
569
  });
1787
570
  });
1788
571
  } else
1789
572
  return null;
1790
573
  }
1791
574
  }
1792
- class Qs {
1793
- constructor(e) {
1794
- this.name = E.EXT_MESH_GPU_INSTANCING, this.parser = e;
575
+ class ln {
576
+ constructor(t) {
577
+ this.name = T.EXT_MESH_GPU_INSTANCING, this.parser = t;
1795
578
  }
1796
- createNodeMesh(e) {
1797
- const t = this.parser.json, s = t.nodes[e];
1798
- if (!s.extensions || !s.extensions[this.name] || s.mesh === void 0)
579
+ createNodeMesh(t) {
580
+ const e = this.parser.json, r = e.nodes[t];
581
+ if (!r.extensions || !r.extensions[this.name] || r.mesh === void 0)
1799
582
  return null;
1800
- const n = t.meshes[s.mesh];
1801
- for (const l of n.primitives)
1802
- if (l.mode !== O.TRIANGLES && l.mode !== O.TRIANGLE_STRIP && l.mode !== O.TRIANGLE_FAN && l.mode !== void 0)
583
+ const n = e.meshes[r.mesh];
584
+ for (const c of n.primitives)
585
+ if (c.mode !== I.TRIANGLES && c.mode !== I.TRIANGLE_STRIP && c.mode !== I.TRIANGLE_FAN && c.mode !== void 0)
1803
586
  return null;
1804
- const o = s.extensions[this.name].attributes, c = [], a = {};
1805
- for (const l in o)
1806
- c.push(this.parser.getDependency("accessor", o[l]).then((u) => (a[l] = u, a[l])));
1807
- return c.length < 1 ? null : (c.push(this.parser.createNodeMesh(e)), Promise.all(c).then((l) => {
1808
- const u = l.pop(), h = u.isGroup ? u.children : [u], d = l[0].count, p = [];
1809
- for (const g of h) {
1810
- const A = new Ne(), m = new te(), f = new Ct(), x = new te(1, 1, 1), v = new sn(g.geometry, g.material, d);
1811
- for (let b = 0; b < d; b++)
1812
- a.TRANSLATION && m.fromBufferAttribute(a.TRANSLATION, b), a.ROTATION && f.fromBufferAttribute(a.ROTATION, b), a.SCALE && x.fromBufferAttribute(a.SCALE, b), v.setMatrixAt(b, A.compose(m, f, x));
1813
- for (const b in a)
1814
- if (b === "_COLOR_0") {
1815
- const y = a[b];
1816
- v.instanceColor = new rn(y.array, y.itemSize, y.normalized);
1817
- } else b !== "TRANSLATION" && b !== "ROTATION" && b !== "SCALE" && g.geometry.setAttribute(b, a[b]);
1818
- Nt.prototype.copy.call(v, g), this.parser.assignFinalMaterial(v), p.push(v);
587
+ const s = r.extensions[this.name].attributes, a = [], o = {};
588
+ for (const c in s)
589
+ a.push(this.parser.getDependency("accessor", s[c]).then((h) => (o[c] = h, o[c])));
590
+ return a.length < 1 ? null : (a.push(this.parser.createNodeMesh(t)), Promise.all(a).then((c) => {
591
+ const h = c.pop(), u = h.isGroup ? h.children : [h], d = c[0].count, p = [];
592
+ for (const g of u) {
593
+ const A = new ee(), m = new G(), f = new Ge(), E = new G(1, 1, 1), _ = new at(g.geometry, g.material, d);
594
+ for (let x = 0; x < d; x++)
595
+ o.TRANSLATION && m.fromBufferAttribute(o.TRANSLATION, x), o.ROTATION && f.fromBufferAttribute(o.ROTATION, x), o.SCALE && E.fromBufferAttribute(o.SCALE, x), _.setMatrixAt(x, A.compose(m, f, E));
596
+ for (const x in o)
597
+ if (x === "_COLOR_0") {
598
+ const w = o[x];
599
+ _.instanceColor = new ct(w.array, w.itemSize, w.normalized);
600
+ } else x !== "TRANSLATION" && x !== "ROTATION" && x !== "SCALE" && g.geometry.setAttribute(x, o[x]);
601
+ Ue.prototype.copy.call(_, g), this.parser.assignFinalMaterial(_), p.push(_);
1819
602
  }
1820
- return u.isGroup ? (u.clear(), u.add(...p), u) : p[0];
603
+ return h.isGroup ? (h.clear(), h.add(...p), h) : p[0];
1821
604
  }));
1822
605
  }
1823
606
  }
1824
- const jt = "glTF", Ae = 12, Mt = { JSON: 1313821514, BIN: 5130562 };
1825
- class $s {
1826
- constructor(e) {
1827
- this.name = E.KHR_BINARY_GLTF, this.content = null, this.body = null;
1828
- const t = new DataView(e, 0, Ae), s = new TextDecoder();
607
+ const Ye = "glTF", z = 12, Pe = { JSON: 1313821514, BIN: 5130562 };
608
+ class un {
609
+ constructor(t) {
610
+ this.name = T.KHR_BINARY_GLTF, this.content = null, this.body = null;
611
+ const e = new DataView(t, 0, z), r = new TextDecoder();
1829
612
  if (this.header = {
1830
- magic: s.decode(new Uint8Array(e.slice(0, 4))),
1831
- version: t.getUint32(4, !0),
1832
- length: t.getUint32(8, !0)
1833
- }, this.header.magic !== jt)
613
+ magic: r.decode(new Uint8Array(t.slice(0, 4))),
614
+ version: e.getUint32(4, !0),
615
+ length: e.getUint32(8, !0)
616
+ }, this.header.magic !== Ye)
1834
617
  throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");
1835
618
  if (this.header.version < 2)
1836
619
  throw new Error("THREE.GLTFLoader: Legacy binary file detected.");
1837
- const n = this.header.length - Ae, r = new DataView(e, Ae);
1838
- let o = 0;
1839
- for (; o < n; ) {
1840
- const c = r.getUint32(o, !0);
1841
- o += 4;
1842
- const a = r.getUint32(o, !0);
1843
- if (o += 4, a === Mt.JSON) {
1844
- const l = new Uint8Array(e, Ae + o, c);
1845
- this.content = s.decode(l);
1846
- } else if (a === Mt.BIN) {
1847
- const l = Ae + o;
1848
- this.body = e.slice(l, l + c);
620
+ const n = this.header.length - z, i = new DataView(t, z);
621
+ let s = 0;
622
+ for (; s < n; ) {
623
+ const a = i.getUint32(s, !0);
624
+ s += 4;
625
+ const o = i.getUint32(s, !0);
626
+ if (s += 4, o === Pe.JSON) {
627
+ const c = new Uint8Array(t, z + s, a);
628
+ this.content = r.decode(c);
629
+ } else if (o === Pe.BIN) {
630
+ const c = z + s;
631
+ this.body = t.slice(c, c + a);
1849
632
  }
1850
- o += c;
633
+ s += a;
1851
634
  }
1852
635
  if (this.content === null)
1853
636
  throw new Error("THREE.GLTFLoader: JSON content not found.");
1854
637
  }
1855
638
  }
1856
- class Js {
1857
- constructor(e, t) {
1858
- if (!t)
639
+ class hn {
640
+ constructor(t, e) {
641
+ if (!e)
1859
642
  throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");
1860
- this.name = E.KHR_DRACO_MESH_COMPRESSION, this.json = e, this.dracoLoader = t, this.dracoLoader.preload();
643
+ this.name = T.KHR_DRACO_MESH_COMPRESSION, this.json = t, this.dracoLoader = e, this.dracoLoader.preload();
1861
644
  }
1862
- decodePrimitive(e, t) {
1863
- const s = this.json, n = this.dracoLoader, r = e.extensions[this.name].bufferView, o = e.extensions[this.name].attributes, c = {}, a = {}, l = {};
1864
- for (const u in o) {
1865
- const h = ot[u] || u.toLowerCase();
1866
- c[h] = o[u];
645
+ decodePrimitive(t, e) {
646
+ const r = this.json, n = this.dracoLoader, i = t.extensions[this.name].bufferView, s = t.extensions[this.name].attributes, a = {}, o = {}, c = {};
647
+ for (const h in s) {
648
+ const u = me[h] || h.toLowerCase();
649
+ a[u] = s[h];
1867
650
  }
1868
- for (const u in e.attributes) {
1869
- const h = ot[u] || u.toLowerCase();
1870
- if (o[u] !== void 0) {
1871
- const d = s.accessors[e.attributes[u]], p = le[d.componentType];
1872
- l[h] = p.name, a[h] = d.normalized === !0;
651
+ for (const h in t.attributes) {
652
+ const u = me[h] || h.toLowerCase();
653
+ if (s[h] !== void 0) {
654
+ const d = r.accessors[t.attributes[h]], p = X[d.componentType];
655
+ c[u] = p.name, o[u] = d.normalized === !0;
1873
656
  }
1874
657
  }
1875
- return t.getDependency("bufferView", r).then(function(u) {
1876
- return new Promise(function(h, d) {
1877
- n.decodeDracoFile(u, function(p) {
658
+ return e.getDependency("bufferView", i).then(function(h) {
659
+ return new Promise(function(u, d) {
660
+ n.decodeDracoFile(h, function(p) {
1878
661
  for (const g in p.attributes) {
1879
- const A = p.attributes[g], m = a[g];
662
+ const A = p.attributes[g], m = o[g];
1880
663
  m !== void 0 && (A.normalized = m);
1881
664
  }
1882
- h(p);
1883
- }, c, l, V, d);
665
+ u(p);
666
+ }, a, c, D, d);
1884
667
  });
1885
668
  });
1886
669
  }
1887
670
  }
1888
- class er {
671
+ class dn {
1889
672
  constructor() {
1890
- this.name = E.KHR_TEXTURE_TRANSFORM;
673
+ this.name = T.KHR_TEXTURE_TRANSFORM;
1891
674
  }
1892
- extendTexture(e, t) {
1893
- return (t.texCoord === void 0 || t.texCoord === e.channel) && t.offset === void 0 && t.rotation === void 0 && t.scale === void 0 || (e = e.clone(), t.texCoord !== void 0 && (e.channel = t.texCoord), t.offset !== void 0 && e.offset.fromArray(t.offset), t.rotation !== void 0 && (e.rotation = t.rotation), t.scale !== void 0 && e.repeat.fromArray(t.scale), e.needsUpdate = !0), e;
675
+ extendTexture(t, e) {
676
+ return (e.texCoord === void 0 || e.texCoord === t.channel) && e.offset === void 0 && e.rotation === void 0 && e.scale === void 0 || (t = t.clone(), e.texCoord !== void 0 && (t.channel = e.texCoord), e.offset !== void 0 && t.offset.fromArray(e.offset), e.rotation !== void 0 && (t.rotation = e.rotation), e.scale !== void 0 && t.repeat.fromArray(e.scale), t.needsUpdate = !0), t;
1894
677
  }
1895
678
  }
1896
- class tr {
679
+ class fn {
1897
680
  constructor() {
1898
- this.name = E.KHR_MESH_QUANTIZATION;
681
+ this.name = T.KHR_MESH_QUANTIZATION;
1899
682
  }
1900
683
  }
1901
- class Xt extends Pn {
1902
- constructor(e, t, s, n) {
1903
- super(e, t, s, n);
1904
- }
1905
- copySampleValue_(e) {
1906
- const t = this.resultBuffer, s = this.sampleValues, n = this.valueSize, r = e * n * 3 + n;
1907
- for (let o = 0; o !== n; o++)
1908
- t[o] = s[r + o];
1909
- return t;
1910
- }
1911
- interpolate_(e, t, s, n) {
1912
- const r = this.resultBuffer, o = this.sampleValues, c = this.valueSize, a = c * 2, l = c * 3, u = n - t, h = (s - t) / u, d = h * h, p = d * h, g = e * l, A = g - l, m = -2 * p + 3 * d, f = p - d, x = 1 - m, v = f - d + h;
1913
- for (let b = 0; b !== c; b++) {
1914
- const y = o[A + b + c], L = o[A + b + a] * u, _ = o[g + b + c], D = o[g + b] * u;
1915
- r[b] = x * y + v * L + m * _ + f * D;
684
+ class Ve extends Ht {
685
+ constructor(t, e, r, n) {
686
+ super(t, e, r, n);
687
+ }
688
+ copySampleValue_(t) {
689
+ const e = this.resultBuffer, r = this.sampleValues, n = this.valueSize, i = t * n * 3 + n;
690
+ for (let s = 0; s !== n; s++)
691
+ e[s] = r[i + s];
692
+ return e;
693
+ }
694
+ interpolate_(t, e, r, n) {
695
+ const i = this.resultBuffer, s = this.sampleValues, a = this.valueSize, o = a * 2, c = a * 3, h = n - e, u = (r - e) / h, d = u * u, p = d * u, g = t * c, A = g - c, m = -2 * p + 3 * d, f = p - d, E = 1 - m, _ = f - d + u;
696
+ for (let x = 0; x !== a; x++) {
697
+ const w = s[A + x + a], b = s[A + x + o] * h, y = s[g + x + a], C = s[g + x] * h;
698
+ i[x] = E * w + _ * b + m * y + f * C;
1916
699
  }
1917
- return r;
700
+ return i;
1918
701
  }
1919
702
  }
1920
- const nr = new Ct();
1921
- class sr extends Xt {
1922
- interpolate_(e, t, s, n) {
1923
- const r = super.interpolate_(e, t, s, n);
1924
- return nr.fromArray(r).normalize().toArray(r), r;
703
+ const pn = new Ge();
704
+ class mn extends Ve {
705
+ interpolate_(t, e, r, n) {
706
+ const i = super.interpolate_(t, e, r, n);
707
+ return pn.fromArray(i).normalize().toArray(i), i;
1925
708
  }
1926
709
  }
1927
- const O = {
710
+ const I = {
1928
711
  POINTS: 0,
1929
712
  LINES: 1,
1930
713
  LINE_LOOP: 2,
@@ -1932,25 +715,25 @@ const O = {
1932
715
  TRIANGLES: 4,
1933
716
  TRIANGLE_STRIP: 5,
1934
717
  TRIANGLE_FAN: 6
1935
- }, le = {
718
+ }, X = {
1936
719
  5120: Int8Array,
1937
720
  5121: Uint8Array,
1938
721
  5122: Int16Array,
1939
722
  5123: Uint16Array,
1940
723
  5125: Uint32Array,
1941
724
  5126: Float32Array
1942
- }, wt = {
1943
- 9728: Ft,
1944
- 9729: nt,
1945
- 9984: dn,
1946
- 9985: hn,
1947
- 9986: un,
1948
- 9987: Pt
1949
- }, St = {
1950
- 33071: pn,
1951
- 33648: fn,
1952
- 10497: st
1953
- }, Ze = {
725
+ }, Fe = {
726
+ 9728: je,
727
+ 9729: fe,
728
+ 9984: mt,
729
+ 9985: pt,
730
+ 9986: ft,
731
+ 9987: ve
732
+ }, Oe = {
733
+ 33071: At,
734
+ 33648: gt,
735
+ 10497: pe
736
+ }, ae = {
1954
737
  SCALAR: 1,
1955
738
  VEC2: 2,
1956
739
  VEC3: 3,
@@ -1958,7 +741,7 @@ const O = {
1958
741
  MAT2: 4,
1959
742
  MAT3: 9,
1960
743
  MAT4: 16
1961
- }, ot = {
744
+ }, me = {
1962
745
  POSITION: "position",
1963
746
  NORMAL: "normal",
1964
747
  TANGENT: "tangent",
@@ -1969,103 +752,103 @@ const O = {
1969
752
  COLOR_0: "color",
1970
753
  WEIGHTS_0: "skinWeight",
1971
754
  JOINTS_0: "skinIndex"
1972
- }, Q = {
755
+ }, B = {
1973
756
  scale: "scale",
1974
757
  translation: "position",
1975
758
  rotation: "quaternion",
1976
759
  weights: "morphTargetInfluences"
1977
- }, rr = {
760
+ }, gn = {
1978
761
  CUBICSPLINE: void 0,
1979
762
  // We use a custom interpolant (GLTFCubicSplineInterpolation) for CUBICSPLINE tracks. Each
1980
763
  // keyframe track will be initialized with a default interpolation type, then modified.
1981
- LINEAR: Dt,
1982
- STEP: Cn
1983
- }, Qe = {
764
+ LINEAR: Xe,
765
+ STEP: Ot
766
+ }, ce = {
1984
767
  OPAQUE: "OPAQUE",
1985
768
  MASK: "MASK",
1986
769
  BLEND: "BLEND"
1987
770
  };
1988
- function or(i) {
1989
- return i.DefaultMaterial === void 0 && (i.DefaultMaterial = new Ot({
771
+ function An(l) {
772
+ return l.DefaultMaterial === void 0 && (l.DefaultMaterial = new Ke({
1990
773
  color: 16777215,
1991
774
  emissive: 0,
1992
775
  metalness: 1,
1993
776
  roughness: 1,
1994
777
  transparent: !1,
1995
778
  depthTest: !0,
1996
- side: Nn
1997
- })), i.DefaultMaterial;
779
+ side: Dt
780
+ })), l.DefaultMaterial;
1998
781
  }
1999
- function ee(i, e, t) {
2000
- for (const s in t.extensions)
2001
- i[s] === void 0 && (e.userData.gltfExtensions = e.userData.gltfExtensions || {}, e.userData.gltfExtensions[s] = t.extensions[s]);
782
+ function k(l, t, e) {
783
+ for (const r in e.extensions)
784
+ l[r] === void 0 && (t.userData.gltfExtensions = t.userData.gltfExtensions || {}, t.userData.gltfExtensions[r] = e.extensions[r]);
2002
785
  }
2003
- function K(i, e) {
2004
- e.extras !== void 0 && (typeof e.extras == "object" ? Object.assign(i.userData, e.extras) : console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, " + e.extras));
786
+ function F(l, t) {
787
+ t.extras !== void 0 && (typeof t.extras == "object" ? Object.assign(l.userData, t.extras) : console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, " + t.extras));
2005
788
  }
2006
- function ir(i, e, t) {
2007
- let s = !1, n = !1, r = !1;
2008
- for (let l = 0, u = e.length; l < u; l++) {
2009
- const h = e[l];
2010
- if (h.POSITION !== void 0 && (s = !0), h.NORMAL !== void 0 && (n = !0), h.COLOR_0 !== void 0 && (r = !0), s && n && r) break;
2011
- }
2012
- if (!s && !n && !r) return Promise.resolve(i);
2013
- const o = [], c = [], a = [];
2014
- for (let l = 0, u = e.length; l < u; l++) {
2015
- const h = e[l];
2016
- if (s) {
2017
- const d = h.POSITION !== void 0 ? t.getDependency("accessor", h.POSITION) : i.attributes.position;
2018
- o.push(d);
789
+ function Tn(l, t, e) {
790
+ let r = !1, n = !1, i = !1;
791
+ for (let c = 0, h = t.length; c < h; c++) {
792
+ const u = t[c];
793
+ if (u.POSITION !== void 0 && (r = !0), u.NORMAL !== void 0 && (n = !0), u.COLOR_0 !== void 0 && (i = !0), r && n && i) break;
794
+ }
795
+ if (!r && !n && !i) return Promise.resolve(l);
796
+ const s = [], a = [], o = [];
797
+ for (let c = 0, h = t.length; c < h; c++) {
798
+ const u = t[c];
799
+ if (r) {
800
+ const d = u.POSITION !== void 0 ? e.getDependency("accessor", u.POSITION) : l.attributes.position;
801
+ s.push(d);
2019
802
  }
2020
803
  if (n) {
2021
- const d = h.NORMAL !== void 0 ? t.getDependency("accessor", h.NORMAL) : i.attributes.normal;
2022
- c.push(d);
2023
- }
2024
- if (r) {
2025
- const d = h.COLOR_0 !== void 0 ? t.getDependency("accessor", h.COLOR_0) : i.attributes.color;
804
+ const d = u.NORMAL !== void 0 ? e.getDependency("accessor", u.NORMAL) : l.attributes.normal;
2026
805
  a.push(d);
2027
806
  }
807
+ if (i) {
808
+ const d = u.COLOR_0 !== void 0 ? e.getDependency("accessor", u.COLOR_0) : l.attributes.color;
809
+ o.push(d);
810
+ }
2028
811
  }
2029
812
  return Promise.all([
2030
- Promise.all(o),
2031
- Promise.all(c),
2032
- Promise.all(a)
2033
- ]).then(function(l) {
2034
- const u = l[0], h = l[1], d = l[2];
2035
- return s && (i.morphAttributes.position = u), n && (i.morphAttributes.normal = h), r && (i.morphAttributes.color = d), i.morphTargetsRelative = !0, i;
813
+ Promise.all(s),
814
+ Promise.all(a),
815
+ Promise.all(o)
816
+ ]).then(function(c) {
817
+ const h = c[0], u = c[1], d = c[2];
818
+ return r && (l.morphAttributes.position = h), n && (l.morphAttributes.normal = u), i && (l.morphAttributes.color = d), l.morphTargetsRelative = !0, l;
2036
819
  });
2037
820
  }
2038
- function ar(i, e) {
2039
- if (i.updateMorphTargets(), e.weights !== void 0)
2040
- for (let t = 0, s = e.weights.length; t < s; t++)
2041
- i.morphTargetInfluences[t] = e.weights[t];
2042
- if (e.extras && Array.isArray(e.extras.targetNames)) {
2043
- const t = e.extras.targetNames;
2044
- if (i.morphTargetInfluences.length === t.length) {
2045
- i.morphTargetDictionary = {};
2046
- for (let s = 0, n = t.length; s < n; s++)
2047
- i.morphTargetDictionary[t[s]] = s;
821
+ function En(l, t) {
822
+ if (l.updateMorphTargets(), t.weights !== void 0)
823
+ for (let e = 0, r = t.weights.length; e < r; e++)
824
+ l.morphTargetInfluences[e] = t.weights[e];
825
+ if (t.extras && Array.isArray(t.extras.targetNames)) {
826
+ const e = t.extras.targetNames;
827
+ if (l.morphTargetInfluences.length === e.length) {
828
+ l.morphTargetDictionary = {};
829
+ for (let r = 0, n = e.length; r < n; r++)
830
+ l.morphTargetDictionary[e[r]] = r;
2048
831
  } else
2049
832
  console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.");
2050
833
  }
2051
834
  }
2052
- function cr(i) {
2053
- let e;
2054
- const t = i.extensions && i.extensions[E.KHR_DRACO_MESH_COMPRESSION];
2055
- if (t ? e = "draco:" + t.bufferView + ":" + t.indices + ":" + $e(t.attributes) : e = i.indices + ":" + $e(i.attributes) + ":" + i.mode, i.targets !== void 0)
2056
- for (let s = 0, n = i.targets.length; s < n; s++)
2057
- e += ":" + $e(i.targets[s]);
2058
- return e;
835
+ function xn(l) {
836
+ let t;
837
+ const e = l.extensions && l.extensions[T.KHR_DRACO_MESH_COMPRESSION];
838
+ if (e ? t = "draco:" + e.bufferView + ":" + e.indices + ":" + le(e.attributes) : t = l.indices + ":" + le(l.attributes) + ":" + l.mode, l.targets !== void 0)
839
+ for (let r = 0, n = l.targets.length; r < n; r++)
840
+ t += ":" + le(l.targets[r]);
841
+ return t;
2059
842
  }
2060
- function $e(i) {
2061
- let e = "";
2062
- const t = Object.keys(i).sort();
2063
- for (let s = 0, n = t.length; s < n; s++)
2064
- e += t[s] + ":" + i[t[s]] + ";";
2065
- return e;
843
+ function le(l) {
844
+ let t = "";
845
+ const e = Object.keys(l).sort();
846
+ for (let r = 0, n = e.length; r < n; r++)
847
+ t += e[r] + ":" + l[e[r]] + ";";
848
+ return t;
2066
849
  }
2067
- function it(i) {
2068
- switch (i) {
850
+ function ge(l) {
851
+ switch (l) {
2069
852
  case Int8Array:
2070
853
  return 1 / 127;
2071
854
  case Uint8Array:
@@ -2078,72 +861,72 @@ function it(i) {
2078
861
  throw new Error("THREE.GLTFLoader: Unsupported normalized accessor component type.");
2079
862
  }
2080
863
  }
2081
- function lr(i) {
2082
- return i.search(/\.jpe?g($|\?)/i) > 0 || i.search(/^data\:image\/jpeg/) === 0 ? "image/jpeg" : i.search(/\.webp($|\?)/i) > 0 || i.search(/^data\:image\/webp/) === 0 ? "image/webp" : i.search(/\.ktx2($|\?)/i) > 0 || i.search(/^data\:image\/ktx2/) === 0 ? "image/ktx2" : "image/png";
864
+ function Rn(l) {
865
+ return l.search(/\.jpe?g($|\?)/i) > 0 || l.search(/^data\:image\/jpeg/) === 0 ? "image/jpeg" : l.search(/\.webp($|\?)/i) > 0 || l.search(/^data\:image\/webp/) === 0 ? "image/webp" : l.search(/\.ktx2($|\?)/i) > 0 || l.search(/^data\:image\/ktx2/) === 0 ? "image/ktx2" : "image/png";
2083
866
  }
2084
- const ur = new Ne();
2085
- class hr {
2086
- constructor(e = {}, t = {}) {
2087
- this.json = e, this.extensions = {}, this.plugins = {}, this.options = t, this.cache = new Ps(), this.associations = /* @__PURE__ */ new Map(), this.primitiveCache = {}, this.nodeCache = {}, this.meshCache = { refs: {}, uses: {} }, this.cameraCache = { refs: {}, uses: {} }, this.lightCache = { refs: {}, uses: {} }, this.sourceCache = {}, this.textureCache = {}, this.nodeNamesUsed = {};
2088
- let s = !1, n = -1, r = !1, o = -1;
867
+ const _n = new ee();
868
+ class Mn {
869
+ constructor(t = {}, e = {}) {
870
+ this.json = t, this.extensions = {}, this.plugins = {}, this.options = e, this.cache = new Xt(), this.associations = /* @__PURE__ */ new Map(), this.primitiveCache = {}, this.nodeCache = {}, this.meshCache = { refs: {}, uses: {} }, this.cameraCache = { refs: {}, uses: {} }, this.lightCache = { refs: {}, uses: {} }, this.sourceCache = {}, this.textureCache = {}, this.nodeNamesUsed = {};
871
+ let r = !1, n = -1, i = !1, s = -1;
2089
872
  if (typeof navigator < "u") {
2090
- const c = navigator.userAgent;
2091
- s = /^((?!chrome|android).)*safari/i.test(c) === !0;
2092
- const a = c.match(/Version\/(\d+)/);
2093
- n = s && a ? parseInt(a[1], 10) : -1, r = c.indexOf("Firefox") > -1, o = r ? c.match(/Firefox\/([0-9]+)\./)[1] : -1;
873
+ const a = navigator.userAgent;
874
+ r = /^((?!chrome|android).)*safari/i.test(a) === !0;
875
+ const o = a.match(/Version\/(\d+)/);
876
+ n = r && o ? parseInt(o[1], 10) : -1, i = a.indexOf("Firefox") > -1, s = i ? a.match(/Firefox\/([0-9]+)\./)[1] : -1;
2094
877
  }
2095
- typeof createImageBitmap > "u" || s && n < 17 || r && o < 98 ? this.textureLoader = new on(this.options.manager) : this.textureLoader = new an(this.options.manager), this.textureLoader.setCrossOrigin(this.options.crossOrigin), this.textureLoader.setRequestHeader(this.options.requestHeader), this.fileLoader = new Lt(this.options.manager), this.fileLoader.setResponseType("arraybuffer"), this.options.crossOrigin === "use-credentials" && this.fileLoader.setWithCredentials(!0);
878
+ typeof createImageBitmap > "u" || r && n < 17 || i && s < 98 ? this.textureLoader = new lt(this.options.manager) : this.textureLoader = new ut(this.options.manager), this.textureLoader.setCrossOrigin(this.options.crossOrigin), this.textureLoader.setRequestHeader(this.options.requestHeader), this.fileLoader = new Be(this.options.manager), this.fileLoader.setResponseType("arraybuffer"), this.options.crossOrigin === "use-credentials" && this.fileLoader.setWithCredentials(!0);
2096
879
  }
2097
- setExtensions(e) {
2098
- this.extensions = e;
880
+ setExtensions(t) {
881
+ this.extensions = t;
2099
882
  }
2100
- setPlugins(e) {
2101
- this.plugins = e;
883
+ setPlugins(t) {
884
+ this.plugins = t;
2102
885
  }
2103
- parse(e, t) {
2104
- const s = this, n = this.json, r = this.extensions;
2105
- this.cache.removeAll(), this.nodeCache = {}, this._invokeAll(function(o) {
2106
- return o._markDefs && o._markDefs();
2107
- }), Promise.all(this._invokeAll(function(o) {
2108
- return o.beforeRoot && o.beforeRoot();
886
+ parse(t, e) {
887
+ const r = this, n = this.json, i = this.extensions;
888
+ this.cache.removeAll(), this.nodeCache = {}, this._invokeAll(function(s) {
889
+ return s._markDefs && s._markDefs();
890
+ }), Promise.all(this._invokeAll(function(s) {
891
+ return s.beforeRoot && s.beforeRoot();
2109
892
  })).then(function() {
2110
893
  return Promise.all([
2111
- s.getDependencies("scene"),
2112
- s.getDependencies("animation"),
2113
- s.getDependencies("camera")
894
+ r.getDependencies("scene"),
895
+ r.getDependencies("animation"),
896
+ r.getDependencies("camera")
2114
897
  ]);
2115
- }).then(function(o) {
2116
- const c = {
2117
- scene: o[0][n.scene || 0],
2118
- scenes: o[0],
2119
- animations: o[1],
2120
- cameras: o[2],
898
+ }).then(function(s) {
899
+ const a = {
900
+ scene: s[0][n.scene || 0],
901
+ scenes: s[0],
902
+ animations: s[1],
903
+ cameras: s[2],
2121
904
  asset: n.asset,
2122
- parser: s,
905
+ parser: r,
2123
906
  userData: {}
2124
907
  };
2125
- return ee(r, c, n), K(c, n), Promise.all(s._invokeAll(function(a) {
2126
- return a.afterRoot && a.afterRoot(c);
908
+ return k(i, a, n), F(a, n), Promise.all(r._invokeAll(function(o) {
909
+ return o.afterRoot && o.afterRoot(a);
2127
910
  })).then(function() {
2128
- for (const a of c.scenes)
2129
- a.updateMatrixWorld();
2130
- e(c);
911
+ for (const o of a.scenes)
912
+ o.updateMatrixWorld();
913
+ t(a);
2131
914
  });
2132
- }).catch(t);
915
+ }).catch(e);
2133
916
  }
2134
917
  /**
2135
918
  * Marks the special nodes/meshes in json for efficient parse.
2136
919
  */
2137
920
  _markDefs() {
2138
- const e = this.json.nodes || [], t = this.json.skins || [], s = this.json.meshes || [];
2139
- for (let n = 0, r = t.length; n < r; n++) {
2140
- const o = t[n].joints;
2141
- for (let c = 0, a = o.length; c < a; c++)
2142
- e[o[c]].isBone = !0;
921
+ const t = this.json.nodes || [], e = this.json.skins || [], r = this.json.meshes || [];
922
+ for (let n = 0, i = e.length; n < i; n++) {
923
+ const s = e[n].joints;
924
+ for (let a = 0, o = s.length; a < o; a++)
925
+ t[s[a]].isBone = !0;
2143
926
  }
2144
- for (let n = 0, r = e.length; n < r; n++) {
2145
- const o = e[n];
2146
- o.mesh !== void 0 && (this._addNodeRef(this.meshCache, o.mesh), o.skin !== void 0 && (s[o.mesh].isSkinnedMesh = !0)), o.camera !== void 0 && this._addNodeRef(this.cameraCache, o.camera);
927
+ for (let n = 0, i = t.length; n < i; n++) {
928
+ const s = t[n];
929
+ s.mesh !== void 0 && (this._addNodeRef(this.meshCache, s.mesh), s.skin !== void 0 && (r[s.mesh].isSkinnedMesh = !0)), s.camera !== void 0 && this._addNodeRef(this.cameraCache, s.camera);
2147
930
  }
2148
931
  }
2149
932
  /**
@@ -2158,8 +941,8 @@ class hr {
2158
941
  * @param {Object} cache
2159
942
  * @param {Object3D} index
2160
943
  */
2161
- _addNodeRef(e, t) {
2162
- t !== void 0 && (e.refs[t] === void 0 && (e.refs[t] = e.uses[t] = 0), e.refs[t]++);
944
+ _addNodeRef(t, e) {
945
+ e !== void 0 && (t.refs[e] === void 0 && (t.refs[e] = t.uses[e] = 0), t.refs[e]++);
2163
946
  }
2164
947
  /**
2165
948
  * Returns a reference to a shared resource, cloning it if necessary.
@@ -2169,34 +952,34 @@ class hr {
2169
952
  * @param {Object} object
2170
953
  * @return {Object}
2171
954
  */
2172
- _getNodeRef(e, t, s) {
2173
- if (e.refs[t] <= 1) return s;
2174
- const n = s.clone(), r = (o, c) => {
2175
- const a = this.associations.get(o);
2176
- a != null && this.associations.set(c, a);
2177
- for (const [l, u] of o.children.entries())
2178
- r(u, c.children[l]);
955
+ _getNodeRef(t, e, r) {
956
+ if (t.refs[e] <= 1) return r;
957
+ const n = r.clone(), i = (s, a) => {
958
+ const o = this.associations.get(s);
959
+ o != null && this.associations.set(a, o);
960
+ for (const [c, h] of s.children.entries())
961
+ i(h, a.children[c]);
2179
962
  };
2180
- return r(s, n), n.name += "_instance_" + e.uses[t]++, n;
963
+ return i(r, n), n.name += "_instance_" + t.uses[e]++, n;
2181
964
  }
2182
- _invokeOne(e) {
2183
- const t = Object.values(this.plugins);
2184
- t.push(this);
2185
- for (let s = 0; s < t.length; s++) {
2186
- const n = e(t[s]);
965
+ _invokeOne(t) {
966
+ const e = Object.values(this.plugins);
967
+ e.push(this);
968
+ for (let r = 0; r < e.length; r++) {
969
+ const n = t(e[r]);
2187
970
  if (n) return n;
2188
971
  }
2189
972
  return null;
2190
973
  }
2191
- _invokeAll(e) {
2192
- const t = Object.values(this.plugins);
2193
- t.unshift(this);
2194
- const s = [];
2195
- for (let n = 0; n < t.length; n++) {
2196
- const r = e(t[n]);
2197
- r && s.push(r);
974
+ _invokeAll(t) {
975
+ const e = Object.values(this.plugins);
976
+ e.unshift(this);
977
+ const r = [];
978
+ for (let n = 0; n < e.length; n++) {
979
+ const i = t(e[n]);
980
+ i && r.push(i);
2198
981
  }
2199
- return s;
982
+ return r;
2200
983
  }
2201
984
  /**
2202
985
  * Requests the specified dependency asynchronously, with caching.
@@ -2204,64 +987,64 @@ class hr {
2204
987
  * @param {number} index
2205
988
  * @return {Promise<Object3D|Material|THREE.Texture|AnimationClip|ArrayBuffer|Object>}
2206
989
  */
2207
- getDependency(e, t) {
2208
- const s = e + ":" + t;
2209
- let n = this.cache.get(s);
990
+ getDependency(t, e) {
991
+ const r = t + ":" + e;
992
+ let n = this.cache.get(r);
2210
993
  if (!n) {
2211
- switch (e) {
994
+ switch (t) {
2212
995
  case "scene":
2213
- n = this.loadScene(t);
996
+ n = this.loadScene(e);
2214
997
  break;
2215
998
  case "node":
2216
- n = this._invokeOne(function(r) {
2217
- return r.loadNode && r.loadNode(t);
999
+ n = this._invokeOne(function(i) {
1000
+ return i.loadNode && i.loadNode(e);
2218
1001
  });
2219
1002
  break;
2220
1003
  case "mesh":
2221
- n = this._invokeOne(function(r) {
2222
- return r.loadMesh && r.loadMesh(t);
1004
+ n = this._invokeOne(function(i) {
1005
+ return i.loadMesh && i.loadMesh(e);
2223
1006
  });
2224
1007
  break;
2225
1008
  case "accessor":
2226
- n = this.loadAccessor(t);
1009
+ n = this.loadAccessor(e);
2227
1010
  break;
2228
1011
  case "bufferView":
2229
- n = this._invokeOne(function(r) {
2230
- return r.loadBufferView && r.loadBufferView(t);
1012
+ n = this._invokeOne(function(i) {
1013
+ return i.loadBufferView && i.loadBufferView(e);
2231
1014
  });
2232
1015
  break;
2233
1016
  case "buffer":
2234
- n = this.loadBuffer(t);
1017
+ n = this.loadBuffer(e);
2235
1018
  break;
2236
1019
  case "material":
2237
- n = this._invokeOne(function(r) {
2238
- return r.loadMaterial && r.loadMaterial(t);
1020
+ n = this._invokeOne(function(i) {
1021
+ return i.loadMaterial && i.loadMaterial(e);
2239
1022
  });
2240
1023
  break;
2241
1024
  case "texture":
2242
- n = this._invokeOne(function(r) {
2243
- return r.loadTexture && r.loadTexture(t);
1025
+ n = this._invokeOne(function(i) {
1026
+ return i.loadTexture && i.loadTexture(e);
2244
1027
  });
2245
1028
  break;
2246
1029
  case "skin":
2247
- n = this.loadSkin(t);
1030
+ n = this.loadSkin(e);
2248
1031
  break;
2249
1032
  case "animation":
2250
- n = this._invokeOne(function(r) {
2251
- return r.loadAnimation && r.loadAnimation(t);
1033
+ n = this._invokeOne(function(i) {
1034
+ return i.loadAnimation && i.loadAnimation(e);
2252
1035
  });
2253
1036
  break;
2254
1037
  case "camera":
2255
- n = this.loadCamera(t);
1038
+ n = this.loadCamera(e);
2256
1039
  break;
2257
1040
  default:
2258
- if (n = this._invokeOne(function(r) {
2259
- return r != this && r.getDependency && r.getDependency(e, t);
1041
+ if (n = this._invokeOne(function(i) {
1042
+ return i != this && i.getDependency && i.getDependency(t, e);
2260
1043
  }), !n)
2261
- throw new Error("Unknown type: " + e);
1044
+ throw new Error("Unknown type: " + t);
2262
1045
  break;
2263
1046
  }
2264
- this.cache.add(s, n);
1047
+ this.cache.add(r, n);
2265
1048
  }
2266
1049
  return n;
2267
1050
  }
@@ -2270,31 +1053,31 @@ class hr {
2270
1053
  * @param {string} type
2271
1054
  * @return {Promise<Array<Object>>}
2272
1055
  */
2273
- getDependencies(e) {
2274
- let t = this.cache.get(e);
2275
- if (!t) {
2276
- const s = this, n = this.json[e + (e === "mesh" ? "es" : "s")] || [];
2277
- t = Promise.all(n.map(function(r, o) {
2278
- return s.getDependency(e, o);
2279
- })), this.cache.add(e, t);
1056
+ getDependencies(t) {
1057
+ let e = this.cache.get(t);
1058
+ if (!e) {
1059
+ const r = this, n = this.json[t + (t === "mesh" ? "es" : "s")] || [];
1060
+ e = Promise.all(n.map(function(i, s) {
1061
+ return r.getDependency(t, s);
1062
+ })), this.cache.add(t, e);
2280
1063
  }
2281
- return t;
1064
+ return e;
2282
1065
  }
2283
1066
  /**
2284
1067
  * Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#buffers-and-buffer-views
2285
1068
  * @param {number} bufferIndex
2286
1069
  * @return {Promise<ArrayBuffer>}
2287
1070
  */
2288
- loadBuffer(e) {
2289
- const t = this.json.buffers[e], s = this.fileLoader;
2290
- if (t.type && t.type !== "arraybuffer")
2291
- throw new Error("THREE.GLTFLoader: " + t.type + " buffer type is not supported.");
2292
- if (t.uri === void 0 && e === 0)
2293
- return Promise.resolve(this.extensions[E.KHR_BINARY_GLTF].body);
1071
+ loadBuffer(t) {
1072
+ const e = this.json.buffers[t], r = this.fileLoader;
1073
+ if (e.type && e.type !== "arraybuffer")
1074
+ throw new Error("THREE.GLTFLoader: " + e.type + " buffer type is not supported.");
1075
+ if (e.uri === void 0 && t === 0)
1076
+ return Promise.resolve(this.extensions[T.KHR_BINARY_GLTF].body);
2294
1077
  const n = this.options;
2295
- return new Promise(function(r, o) {
2296
- s.load(xe.resolveURL(t.uri, n.path), r, void 0, function() {
2297
- o(new Error('THREE.GLTFLoader: Failed to load buffer "' + t.uri + '".'));
1078
+ return new Promise(function(i, s) {
1079
+ r.load(q.resolveURL(e.uri, n.path), i, void 0, function() {
1080
+ s(new Error('THREE.GLTFLoader: Failed to load buffer "' + e.uri + '".'));
2298
1081
  });
2299
1082
  });
2300
1083
  }
@@ -2303,11 +1086,11 @@ class hr {
2303
1086
  * @param {number} bufferViewIndex
2304
1087
  * @return {Promise<ArrayBuffer>}
2305
1088
  */
2306
- loadBufferView(e) {
2307
- const t = this.json.bufferViews[e];
2308
- return this.getDependency("buffer", t.buffer).then(function(s) {
2309
- const n = t.byteLength || 0, r = t.byteOffset || 0;
2310
- return s.slice(r, r + n);
1089
+ loadBufferView(t) {
1090
+ const e = this.json.bufferViews[t];
1091
+ return this.getDependency("buffer", e.buffer).then(function(r) {
1092
+ const n = e.byteLength || 0, i = e.byteOffset || 0;
1093
+ return r.slice(i, i + n);
2311
1094
  });
2312
1095
  }
2313
1096
  /**
@@ -2315,28 +1098,28 @@ class hr {
2315
1098
  * @param {number} accessorIndex
2316
1099
  * @return {Promise<BufferAttribute|InterleavedBufferAttribute>}
2317
1100
  */
2318
- loadAccessor(e) {
2319
- const t = this, s = this.json, n = this.json.accessors[e];
1101
+ loadAccessor(t) {
1102
+ const e = this, r = this.json, n = this.json.accessors[t];
2320
1103
  if (n.bufferView === void 0 && n.sparse === void 0) {
2321
- const o = Ze[n.type], c = le[n.componentType], a = n.normalized === !0, l = new c(n.count * o);
2322
- return Promise.resolve(new He(l, o, a));
1104
+ const s = ae[n.type], a = X[n.componentType], o = n.normalized === !0, c = new a(n.count * s);
1105
+ return Promise.resolve(new se(c, s, o));
2323
1106
  }
2324
- const r = [];
2325
- return n.bufferView !== void 0 ? r.push(this.getDependency("bufferView", n.bufferView)) : r.push(null), n.sparse !== void 0 && (r.push(this.getDependency("bufferView", n.sparse.indices.bufferView)), r.push(this.getDependency("bufferView", n.sparse.values.bufferView))), Promise.all(r).then(function(o) {
2326
- const c = o[0], a = Ze[n.type], l = le[n.componentType], u = l.BYTES_PER_ELEMENT, h = u * a, d = n.byteOffset || 0, p = n.bufferView !== void 0 ? s.bufferViews[n.bufferView].byteStride : void 0, g = n.normalized === !0;
1107
+ const i = [];
1108
+ return n.bufferView !== void 0 ? i.push(this.getDependency("bufferView", n.bufferView)) : i.push(null), n.sparse !== void 0 && (i.push(this.getDependency("bufferView", n.sparse.indices.bufferView)), i.push(this.getDependency("bufferView", n.sparse.values.bufferView))), Promise.all(i).then(function(s) {
1109
+ const a = s[0], o = ae[n.type], c = X[n.componentType], h = c.BYTES_PER_ELEMENT, u = h * o, d = n.byteOffset || 0, p = n.bufferView !== void 0 ? r.bufferViews[n.bufferView].byteStride : void 0, g = n.normalized === !0;
2327
1110
  let A, m;
2328
- if (p && p !== h) {
2329
- const f = Math.floor(d / p), x = "InterleavedBuffer:" + n.bufferView + ":" + n.componentType + ":" + f + ":" + n.count;
2330
- let v = t.cache.get(x);
2331
- v || (A = new l(c, f * p, n.count * p / u), v = new cn(A, p / u), t.cache.add(x, v)), m = new ln(v, a, d % p / u, g);
1111
+ if (p && p !== u) {
1112
+ const f = Math.floor(d / p), E = "InterleavedBuffer:" + n.bufferView + ":" + n.componentType + ":" + f + ":" + n.count;
1113
+ let _ = e.cache.get(E);
1114
+ _ || (A = new c(a, f * p, n.count * p / h), _ = new ht(A, p / h), e.cache.add(E, _)), m = new dt(_, o, d % p / h, g);
2332
1115
  } else
2333
- c === null ? A = new l(n.count * a) : A = new l(c, d, n.count * a), m = new He(A, a, g);
1116
+ a === null ? A = new c(n.count * o) : A = new c(a, d, n.count * o), m = new se(A, o, g);
2334
1117
  if (n.sparse !== void 0) {
2335
- const f = Ze.SCALAR, x = le[n.sparse.indices.componentType], v = n.sparse.indices.byteOffset || 0, b = n.sparse.values.byteOffset || 0, y = new x(o[1], v, n.sparse.count * f), L = new l(o[2], b, n.sparse.count * a);
2336
- c !== null && (m = new He(m.array.slice(), m.itemSize, m.normalized)), m.normalized = !1;
2337
- for (let _ = 0, D = y.length; _ < D; _++) {
2338
- const M = y[_];
2339
- if (m.setX(M, L[_ * a]), a >= 2 && m.setY(M, L[_ * a + 1]), a >= 3 && m.setZ(M, L[_ * a + 2]), a >= 4 && m.setW(M, L[_ * a + 3]), a >= 5) throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.");
1118
+ const f = ae.SCALAR, E = X[n.sparse.indices.componentType], _ = n.sparse.indices.byteOffset || 0, x = n.sparse.values.byteOffset || 0, w = new E(s[1], _, n.sparse.count * f), b = new c(s[2], x, n.sparse.count * o);
1119
+ a !== null && (m = new se(m.array.slice(), m.itemSize, m.normalized)), m.normalized = !1;
1120
+ for (let y = 0, C = w.length; y < C; y++) {
1121
+ const L = w[y];
1122
+ if (m.setX(L, b[y * o]), o >= 2 && m.setY(L, b[y * o + 1]), o >= 3 && m.setZ(L, b[y * o + 2]), o >= 4 && m.setW(L, b[y * o + 3]), o >= 5) throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.");
2340
1123
  }
2341
1124
  m.normalized = g;
2342
1125
  }
@@ -2348,56 +1131,56 @@ class hr {
2348
1131
  * @param {number} textureIndex
2349
1132
  * @return {Promise<THREE.Texture|null>}
2350
1133
  */
2351
- loadTexture(e) {
2352
- const t = this.json, s = this.options, r = t.textures[e].source, o = t.images[r];
2353
- let c = this.textureLoader;
2354
- if (o.uri) {
2355
- const a = s.manager.getHandler(o.uri);
2356
- a !== null && (c = a);
1134
+ loadTexture(t) {
1135
+ const e = this.json, r = this.options, i = e.textures[t].source, s = e.images[i];
1136
+ let a = this.textureLoader;
1137
+ if (s.uri) {
1138
+ const o = r.manager.getHandler(s.uri);
1139
+ o !== null && (a = o);
2357
1140
  }
2358
- return this.loadTextureImage(e, r, c);
2359
- }
2360
- loadTextureImage(e, t, s) {
2361
- const n = this, r = this.json, o = r.textures[e], c = r.images[t], a = (c.uri || c.bufferView) + ":" + o.sampler;
2362
- if (this.textureCache[a])
2363
- return this.textureCache[a];
2364
- const l = this.loadImageSource(t, s).then(function(u) {
2365
- u.flipY = !1, u.name = o.name || c.name || "", u.name === "" && typeof c.uri == "string" && c.uri.startsWith("data:image/") === !1 && (u.name = c.uri);
2366
- const d = (r.samplers || {})[o.sampler] || {};
2367
- return u.magFilter = wt[d.magFilter] || nt, u.minFilter = wt[d.minFilter] || Pt, u.wrapS = St[d.wrapS] || st, u.wrapT = St[d.wrapT] || st, u.generateMipmaps = !u.isCompressedTexture && u.minFilter !== Ft && u.minFilter !== nt, n.associations.set(u, { textures: e }), u;
1141
+ return this.loadTextureImage(t, i, a);
1142
+ }
1143
+ loadTextureImage(t, e, r) {
1144
+ const n = this, i = this.json, s = i.textures[t], a = i.images[e], o = (a.uri || a.bufferView) + ":" + s.sampler;
1145
+ if (this.textureCache[o])
1146
+ return this.textureCache[o];
1147
+ const c = this.loadImageSource(e, r).then(function(h) {
1148
+ h.flipY = !1, h.name = s.name || a.name || "", h.name === "" && typeof a.uri == "string" && a.uri.startsWith("data:image/") === !1 && (h.name = a.uri);
1149
+ const d = (i.samplers || {})[s.sampler] || {};
1150
+ return h.magFilter = Fe[d.magFilter] || fe, h.minFilter = Fe[d.minFilter] || ve, h.wrapS = Oe[d.wrapS] || pe, h.wrapT = Oe[d.wrapT] || pe, h.generateMipmaps = !h.isCompressedTexture && h.minFilter !== je && h.minFilter !== fe, n.associations.set(h, { textures: t }), h;
2368
1151
  }).catch(function() {
2369
1152
  return null;
2370
1153
  });
2371
- return this.textureCache[a] = l, l;
2372
- }
2373
- loadImageSource(e, t) {
2374
- const s = this, n = this.json, r = this.options;
2375
- if (this.sourceCache[e] !== void 0)
2376
- return this.sourceCache[e].then((h) => h.clone());
2377
- const o = n.images[e], c = self.URL || self.webkitURL;
2378
- let a = o.uri || "", l = !1;
2379
- if (o.bufferView !== void 0)
2380
- a = s.getDependency("bufferView", o.bufferView).then(function(h) {
2381
- l = !0;
2382
- const d = new Blob([h], { type: o.mimeType });
2383
- return a = c.createObjectURL(d), a;
1154
+ return this.textureCache[o] = c, c;
1155
+ }
1156
+ loadImageSource(t, e) {
1157
+ const r = this, n = this.json, i = this.options;
1158
+ if (this.sourceCache[t] !== void 0)
1159
+ return this.sourceCache[t].then((u) => u.clone());
1160
+ const s = n.images[t], a = self.URL || self.webkitURL;
1161
+ let o = s.uri || "", c = !1;
1162
+ if (s.bufferView !== void 0)
1163
+ o = r.getDependency("bufferView", s.bufferView).then(function(u) {
1164
+ c = !0;
1165
+ const d = new Blob([u], { type: s.mimeType });
1166
+ return o = a.createObjectURL(d), o;
2384
1167
  });
2385
- else if (o.uri === void 0)
2386
- throw new Error("THREE.GLTFLoader: Image " + e + " is missing URI and bufferView");
2387
- const u = Promise.resolve(a).then(function(h) {
1168
+ else if (s.uri === void 0)
1169
+ throw new Error("THREE.GLTFLoader: Image " + t + " is missing URI and bufferView");
1170
+ const h = Promise.resolve(o).then(function(u) {
2388
1171
  return new Promise(function(d, p) {
2389
1172
  let g = d;
2390
- t.isImageBitmapLoader === !0 && (g = function(A) {
2391
- const m = new ft(A);
1173
+ e.isImageBitmapLoader === !0 && (g = function(A) {
1174
+ const m = new Se(A);
2392
1175
  m.needsUpdate = !0, d(m);
2393
- }), t.load(xe.resolveURL(h, r.path), g, void 0, p);
1176
+ }), e.load(q.resolveURL(u, i.path), g, void 0, p);
2394
1177
  });
2395
- }).then(function(h) {
2396
- return l === !0 && c.revokeObjectURL(a), K(h, o), h.userData.mimeType = o.mimeType || lr(o.uri), h;
2397
- }).catch(function(h) {
2398
- throw console.error("THREE.GLTFLoader: Couldn't load texture", a), h;
1178
+ }).then(function(u) {
1179
+ return c === !0 && a.revokeObjectURL(o), F(u, s), u.userData.mimeType = s.mimeType || Rn(s.uri), u;
1180
+ }).catch(function(u) {
1181
+ throw console.error("THREE.GLTFLoader: Couldn't load texture", o), u;
2399
1182
  });
2400
- return this.sourceCache[e] = u, u;
1183
+ return this.sourceCache[t] = h, h;
2401
1184
  }
2402
1185
  /**
2403
1186
  * Asynchronously assigns a texture to the given material parameters.
@@ -2408,18 +1191,18 @@ class hr {
2408
1191
  * @param {string} colorSpace
2409
1192
  * @return {Promise<Texture>}
2410
1193
  */
2411
- assignTexture(e, t, s, n) {
2412
- const r = this;
2413
- return this.getDependency("texture", s.index).then(function(o) {
2414
- if (!o) return null;
2415
- if (s.texCoord !== void 0 && s.texCoord > 0 && (o = o.clone(), o.channel = s.texCoord), r.extensions[E.KHR_TEXTURE_TRANSFORM]) {
2416
- const c = s.extensions !== void 0 ? s.extensions[E.KHR_TEXTURE_TRANSFORM] : void 0;
2417
- if (c) {
2418
- const a = r.associations.get(o);
2419
- o = r.extensions[E.KHR_TEXTURE_TRANSFORM].extendTexture(o, c), r.associations.set(o, a);
1194
+ assignTexture(t, e, r, n) {
1195
+ const i = this;
1196
+ return this.getDependency("texture", r.index).then(function(s) {
1197
+ if (!s) return null;
1198
+ if (r.texCoord !== void 0 && r.texCoord > 0 && (s = s.clone(), s.channel = r.texCoord), i.extensions[T.KHR_TEXTURE_TRANSFORM]) {
1199
+ const a = r.extensions !== void 0 ? r.extensions[T.KHR_TEXTURE_TRANSFORM] : void 0;
1200
+ if (a) {
1201
+ const o = i.associations.get(s);
1202
+ s = i.extensions[T.KHR_TEXTURE_TRANSFORM].extendTexture(s, a), i.associations.set(s, o);
2420
1203
  }
2421
1204
  }
2422
- return n !== void 0 && (o.colorSpace = n), e[t] = o, o;
1205
+ return n !== void 0 && (s.colorSpace = n), t[e] = s, s;
2423
1206
  });
2424
1207
  }
2425
1208
  /**
@@ -2430,67 +1213,67 @@ class hr {
2430
1213
  * be created if necessary, and reused from a cache.
2431
1214
  * @param {Object3D} mesh Mesh, Line, or Points instance.
2432
1215
  */
2433
- assignFinalMaterial(e) {
2434
- const t = e.geometry;
2435
- let s = e.material;
2436
- const n = t.attributes.tangent === void 0, r = t.attributes.color !== void 0, o = t.attributes.normal === void 0;
2437
- if (e.isPoints) {
2438
- const c = "PointsMaterial:" + s.uuid;
2439
- let a = this.cache.get(c);
2440
- a || (a = new mn(), je.prototype.copy.call(a, s), a.color.copy(s.color), a.map = s.map, a.sizeAttenuation = !1, this.cache.add(c, a)), s = a;
2441
- } else if (e.isLine) {
2442
- const c = "LineBasicMaterial:" + s.uuid;
2443
- let a = this.cache.get(c);
2444
- a || (a = new gn(), je.prototype.copy.call(a, s), a.color.copy(s.color), a.map = s.map, this.cache.add(c, a)), s = a;
1216
+ assignFinalMaterial(t) {
1217
+ const e = t.geometry;
1218
+ let r = t.material;
1219
+ const n = e.attributes.tangent === void 0, i = e.attributes.color !== void 0, s = e.attributes.normal === void 0;
1220
+ if (t.isPoints) {
1221
+ const a = "PointsMaterial:" + r.uuid;
1222
+ let o = this.cache.get(a);
1223
+ o || (o = new Tt(), re.prototype.copy.call(o, r), o.color.copy(r.color), o.map = r.map, o.sizeAttenuation = !1, this.cache.add(a, o)), r = o;
1224
+ } else if (t.isLine) {
1225
+ const a = "LineBasicMaterial:" + r.uuid;
1226
+ let o = this.cache.get(a);
1227
+ o || (o = new Et(), re.prototype.copy.call(o, r), o.color.copy(r.color), o.map = r.map, this.cache.add(a, o)), r = o;
2445
1228
  }
2446
- if (n || r || o) {
2447
- let c = "ClonedMaterial:" + s.uuid + ":";
2448
- n && (c += "derivative-tangents:"), r && (c += "vertex-colors:"), o && (c += "flat-shading:");
2449
- let a = this.cache.get(c);
2450
- a || (a = s.clone(), r && (a.vertexColors = !0), o && (a.flatShading = !0), n && (a.normalScale && (a.normalScale.y *= -1), a.clearcoatNormalScale && (a.clearcoatNormalScale.y *= -1)), this.cache.add(c, a), this.associations.set(a, this.associations.get(s))), s = a;
1229
+ if (n || i || s) {
1230
+ let a = "ClonedMaterial:" + r.uuid + ":";
1231
+ n && (a += "derivative-tangents:"), i && (a += "vertex-colors:"), s && (a += "flat-shading:");
1232
+ let o = this.cache.get(a);
1233
+ o || (o = r.clone(), i && (o.vertexColors = !0), s && (o.flatShading = !0), n && (o.normalScale && (o.normalScale.y *= -1), o.clearcoatNormalScale && (o.clearcoatNormalScale.y *= -1)), this.cache.add(a, o), this.associations.set(o, this.associations.get(r))), r = o;
2451
1234
  }
2452
- e.material = s;
1235
+ t.material = r;
2453
1236
  }
2454
1237
  getMaterialType() {
2455
- return Ot;
1238
+ return Ke;
2456
1239
  }
2457
1240
  /**
2458
1241
  * Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#materials
2459
1242
  * @param {number} materialIndex
2460
1243
  * @return {Promise<Material>}
2461
1244
  */
2462
- loadMaterial(e) {
2463
- const t = this, s = this.json, n = this.extensions, r = s.materials[e];
2464
- let o;
2465
- const c = {}, a = r.extensions || {}, l = [];
2466
- if (a[E.KHR_MATERIALS_UNLIT]) {
2467
- const h = n[E.KHR_MATERIALS_UNLIT];
2468
- o = h.getMaterialType(), l.push(h.extendParams(c, r, t));
1245
+ loadMaterial(t) {
1246
+ const e = this, r = this.json, n = this.extensions, i = r.materials[t];
1247
+ let s;
1248
+ const a = {}, o = i.extensions || {}, c = [];
1249
+ if (o[T.KHR_MATERIALS_UNLIT]) {
1250
+ const u = n[T.KHR_MATERIALS_UNLIT];
1251
+ s = u.getMaterialType(), c.push(u.extendParams(a, i, e));
2469
1252
  } else {
2470
- const h = r.pbrMetallicRoughness || {};
2471
- if (c.color = new se(1, 1, 1), c.opacity = 1, Array.isArray(h.baseColorFactor)) {
2472
- const d = h.baseColorFactor;
2473
- c.color.setRGB(d[0], d[1], d[2], V), c.opacity = d[3];
1253
+ const u = i.pbrMetallicRoughness || {};
1254
+ if (a.color = new v(1, 1, 1), a.opacity = 1, Array.isArray(u.baseColorFactor)) {
1255
+ const d = u.baseColorFactor;
1256
+ a.color.setRGB(d[0], d[1], d[2], D), a.opacity = d[3];
2474
1257
  }
2475
- h.baseColorTexture !== void 0 && l.push(t.assignTexture(c, "map", h.baseColorTexture, ve)), c.metalness = h.metallicFactor !== void 0 ? h.metallicFactor : 1, c.roughness = h.roughnessFactor !== void 0 ? h.roughnessFactor : 1, h.metallicRoughnessTexture !== void 0 && (l.push(t.assignTexture(c, "metalnessMap", h.metallicRoughnessTexture)), l.push(t.assignTexture(c, "roughnessMap", h.metallicRoughnessTexture))), o = this._invokeOne(function(d) {
2476
- return d.getMaterialType && d.getMaterialType(e);
2477
- }), l.push(Promise.all(this._invokeAll(function(d) {
2478
- return d.extendMaterialParams && d.extendMaterialParams(e, c);
1258
+ u.baseColorTexture !== void 0 && c.push(e.assignTexture(a, "map", u.baseColorTexture, Z)), a.metalness = u.metallicFactor !== void 0 ? u.metallicFactor : 1, a.roughness = u.roughnessFactor !== void 0 ? u.roughnessFactor : 1, u.metallicRoughnessTexture !== void 0 && (c.push(e.assignTexture(a, "metalnessMap", u.metallicRoughnessTexture)), c.push(e.assignTexture(a, "roughnessMap", u.metallicRoughnessTexture))), s = this._invokeOne(function(d) {
1259
+ return d.getMaterialType && d.getMaterialType(t);
1260
+ }), c.push(Promise.all(this._invokeAll(function(d) {
1261
+ return d.extendMaterialParams && d.extendMaterialParams(t, a);
2479
1262
  })));
2480
1263
  }
2481
- r.doubleSided === !0 && (c.side = Ie);
2482
- const u = r.alphaMode || Qe.OPAQUE;
2483
- if (u === Qe.BLEND ? (c.transparent = !0, c.depthWrite = !1) : (c.transparent = !1, u === Qe.MASK && (c.alphaTest = r.alphaCutoff !== void 0 ? r.alphaCutoff : 0.5)), r.normalTexture !== void 0 && o !== Te && (l.push(t.assignTexture(c, "normalMap", r.normalTexture)), c.normalScale = new It(1, 1), r.normalTexture.scale !== void 0)) {
2484
- const h = r.normalTexture.scale;
2485
- c.normalScale.set(h, h);
1264
+ i.doubleSided === !0 && (a.side = J);
1265
+ const h = i.alphaMode || ce.OPAQUE;
1266
+ if (h === ce.BLEND ? (a.transparent = !0, a.depthWrite = !1) : (a.transparent = !1, h === ce.MASK && (a.alphaTest = i.alphaCutoff !== void 0 ? i.alphaCutoff : 0.5)), i.normalTexture !== void 0 && s !== W && (c.push(e.assignTexture(a, "normalMap", i.normalTexture)), a.normalScale = new ke(1, 1), i.normalTexture.scale !== void 0)) {
1267
+ const u = i.normalTexture.scale;
1268
+ a.normalScale.set(u, u);
2486
1269
  }
2487
- if (r.occlusionTexture !== void 0 && o !== Te && (l.push(t.assignTexture(c, "aoMap", r.occlusionTexture)), r.occlusionTexture.strength !== void 0 && (c.aoMapIntensity = r.occlusionTexture.strength)), r.emissiveFactor !== void 0 && o !== Te) {
2488
- const h = r.emissiveFactor;
2489
- c.emissive = new se().setRGB(h[0], h[1], h[2], V);
1270
+ if (i.occlusionTexture !== void 0 && s !== W && (c.push(e.assignTexture(a, "aoMap", i.occlusionTexture)), i.occlusionTexture.strength !== void 0 && (a.aoMapIntensity = i.occlusionTexture.strength)), i.emissiveFactor !== void 0 && s !== W) {
1271
+ const u = i.emissiveFactor;
1272
+ a.emissive = new v().setRGB(u[0], u[1], u[2], D);
2490
1273
  }
2491
- return r.emissiveTexture !== void 0 && o !== Te && l.push(t.assignTexture(c, "emissiveMap", r.emissiveTexture, ve)), Promise.all(l).then(function() {
2492
- const h = new o(c);
2493
- return r.name && (h.name = r.name), K(h, r), t.associations.set(h, { materials: e }), r.extensions && ee(n, h, r), h;
1274
+ return i.emissiveTexture !== void 0 && s !== W && c.push(e.assignTexture(a, "emissiveMap", i.emissiveTexture, Z)), Promise.all(c).then(function() {
1275
+ const u = new s(a);
1276
+ return i.name && (u.name = i.name), F(u, i), e.associations.set(u, { materials: t }), i.extensions && k(n, u, i), u;
2494
1277
  });
2495
1278
  }
2496
1279
  /**
@@ -2499,9 +1282,9 @@ class hr {
2499
1282
  * @param {String} originalName
2500
1283
  * @return {String}
2501
1284
  */
2502
- createUniqueName(e) {
2503
- const t = An.sanitizeNodeName(e || "");
2504
- return t in this.nodeNamesUsed ? t + "_" + ++this.nodeNamesUsed[t] : (this.nodeNamesUsed[t] = 0, t);
1285
+ createUniqueName(t) {
1286
+ const e = xt.sanitizeNodeName(t || "");
1287
+ return e in this.nodeNamesUsed ? e + "_" + ++this.nodeNamesUsed[e] : (this.nodeNamesUsed[e] = 0, e);
2505
1288
  }
2506
1289
  /**
2507
1290
  * Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#geometry
@@ -2511,67 +1294,67 @@ class hr {
2511
1294
  * @param {Array<GLTF.Primitive>} primitives
2512
1295
  * @return {Promise<Array<BufferGeometry>>}
2513
1296
  */
2514
- loadGeometries(e) {
2515
- const t = this, s = this.extensions, n = this.primitiveCache;
2516
- function r(c) {
2517
- return s[E.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(c, t).then(function(a) {
2518
- return yt(a, c, t);
1297
+ loadGeometries(t) {
1298
+ const e = this, r = this.extensions, n = this.primitiveCache;
1299
+ function i(a) {
1300
+ return r[T.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(a, e).then(function(o) {
1301
+ return De(o, a, e);
2519
1302
  });
2520
1303
  }
2521
- const o = [];
2522
- for (let c = 0, a = e.length; c < a; c++) {
2523
- const l = e[c], u = cr(l), h = n[u];
2524
- if (h)
2525
- o.push(h.promise);
1304
+ const s = [];
1305
+ for (let a = 0, o = t.length; a < o; a++) {
1306
+ const c = t[a], h = xn(c), u = n[h];
1307
+ if (u)
1308
+ s.push(u.promise);
2526
1309
  else {
2527
1310
  let d;
2528
- l.extensions && l.extensions[E.KHR_DRACO_MESH_COMPRESSION] ? d = r(l) : d = yt(new Tn(), l, t), n[u] = { primitive: l, promise: d }, o.push(d);
1311
+ c.extensions && c.extensions[T.KHR_DRACO_MESH_COMPRESSION] ? d = i(c) : d = De(new Rt(), c, e), n[h] = { primitive: c, promise: d }, s.push(d);
2529
1312
  }
2530
1313
  }
2531
- return Promise.all(o);
1314
+ return Promise.all(s);
2532
1315
  }
2533
1316
  /**
2534
1317
  * Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#meshes
2535
1318
  * @param {number} meshIndex
2536
1319
  * @return {Promise<Group|Mesh|SkinnedMesh>}
2537
1320
  */
2538
- loadMesh(e) {
2539
- const t = this, s = this.json, n = this.extensions, r = s.meshes[e], o = r.primitives, c = [];
2540
- for (let a = 0, l = o.length; a < l; a++) {
2541
- const u = o[a].material === void 0 ? or(this.cache) : this.getDependency("material", o[a].material);
2542
- c.push(u);
1321
+ loadMesh(t) {
1322
+ const e = this, r = this.json, n = this.extensions, i = r.meshes[t], s = i.primitives, a = [];
1323
+ for (let o = 0, c = s.length; o < c; o++) {
1324
+ const h = s[o].material === void 0 ? An(this.cache) : this.getDependency("material", s[o].material);
1325
+ a.push(h);
2543
1326
  }
2544
- return c.push(t.loadGeometries(o)), Promise.all(c).then(function(a) {
2545
- const l = a.slice(0, a.length - 1), u = a[a.length - 1], h = [];
2546
- for (let p = 0, g = u.length; p < g; p++) {
2547
- const A = u[p], m = o[p];
1327
+ return a.push(e.loadGeometries(s)), Promise.all(a).then(function(o) {
1328
+ const c = o.slice(0, o.length - 1), h = o[o.length - 1], u = [];
1329
+ for (let p = 0, g = h.length; p < g; p++) {
1330
+ const A = h[p], m = s[p];
2548
1331
  let f;
2549
- const x = l[p];
2550
- if (m.mode === O.TRIANGLES || m.mode === O.TRIANGLE_STRIP || m.mode === O.TRIANGLE_FAN || m.mode === void 0)
2551
- f = r.isSkinnedMesh === !0 ? new xn(A, x) : new vn(A, x), f.isSkinnedMesh === !0 && f.normalizeSkinWeights(), m.mode === O.TRIANGLE_STRIP ? f.geometry = Rt(f.geometry, _t) : m.mode === O.TRIANGLE_FAN && (f.geometry = Rt(f.geometry, tt));
2552
- else if (m.mode === O.LINES)
2553
- f = new bn(A, x);
2554
- else if (m.mode === O.LINE_STRIP)
2555
- f = new En(A, x);
2556
- else if (m.mode === O.LINE_LOOP)
2557
- f = new Rn(A, x);
2558
- else if (m.mode === O.POINTS)
2559
- f = new Mn(A, x);
1332
+ const E = c[p];
1333
+ if (m.mode === I.TRIANGLES || m.mode === I.TRIANGLE_STRIP || m.mode === I.TRIANGLE_FAN || m.mode === void 0)
1334
+ f = i.isSkinnedMesh === !0 ? new _t(A, E) : new Mt(A, E), f.isSkinnedMesh === !0 && f.normalizeSkinWeights(), m.mode === I.TRIANGLE_STRIP ? f.geometry = Ce(f.geometry, He) : m.mode === I.TRIANGLE_FAN && (f.geometry = Ce(f.geometry, de));
1335
+ else if (m.mode === I.LINES)
1336
+ f = new wt(A, E);
1337
+ else if (m.mode === I.LINE_STRIP)
1338
+ f = new St(A, E);
1339
+ else if (m.mode === I.LINE_LOOP)
1340
+ f = new yt(A, E);
1341
+ else if (m.mode === I.POINTS)
1342
+ f = new Lt(A, E);
2560
1343
  else
2561
1344
  throw new Error("THREE.GLTFLoader: Primitive mode unsupported: " + m.mode);
2562
- Object.keys(f.geometry.morphAttributes).length > 0 && ar(f, r), f.name = t.createUniqueName(r.name || "mesh_" + e), K(f, r), m.extensions && ee(n, f, m), t.assignFinalMaterial(f), h.push(f);
1345
+ Object.keys(f.geometry.morphAttributes).length > 0 && En(f, i), f.name = e.createUniqueName(i.name || "mesh_" + t), F(f, i), m.extensions && k(n, f, m), e.assignFinalMaterial(f), u.push(f);
2563
1346
  }
2564
- for (let p = 0, g = h.length; p < g; p++)
2565
- t.associations.set(h[p], {
2566
- meshes: e,
1347
+ for (let p = 0, g = u.length; p < g; p++)
1348
+ e.associations.set(u[p], {
1349
+ meshes: t,
2567
1350
  primitives: p
2568
1351
  });
2569
- if (h.length === 1)
2570
- return r.extensions && ee(n, h[0], r), h[0];
2571
- const d = new Xe();
2572
- r.extensions && ee(n, d, r), t.associations.set(d, { meshes: e });
2573
- for (let p = 0, g = h.length; p < g; p++)
2574
- d.add(h[p]);
1352
+ if (u.length === 1)
1353
+ return i.extensions && k(n, u[0], i), u[0];
1354
+ const d = new ie();
1355
+ i.extensions && k(n, d, i), e.associations.set(d, { meshes: t });
1356
+ for (let p = 0, g = u.length; p < g; p++)
1357
+ d.add(u[p]);
2575
1358
  return d;
2576
1359
  });
2577
1360
  }
@@ -2580,36 +1363,36 @@ class hr {
2580
1363
  * @param {number} cameraIndex
2581
1364
  * @return {Promise<THREE.Camera>}
2582
1365
  */
2583
- loadCamera(e) {
2584
- let t;
2585
- const s = this.json.cameras[e], n = s[s.type];
1366
+ loadCamera(t) {
1367
+ let e;
1368
+ const r = this.json.cameras[t], n = r[r.type];
2586
1369
  if (!n) {
2587
1370
  console.warn("THREE.GLTFLoader: Missing camera parameters.");
2588
1371
  return;
2589
1372
  }
2590
- return s.type === "perspective" ? t = new wn(Sn.radToDeg(n.yfov), n.aspectRatio || 1, n.znear || 1, n.zfar || 2e6) : s.type === "orthographic" && (t = new yn(-n.xmag, n.xmag, n.ymag, -n.ymag, n.znear, n.zfar)), s.name && (t.name = this.createUniqueName(s.name)), K(t, s), Promise.resolve(t);
1373
+ return r.type === "perspective" ? e = new bt(It.radToDeg(n.yfov), n.aspectRatio || 1, n.znear || 1, n.zfar || 2e6) : r.type === "orthographic" && (e = new Nt(-n.xmag, n.xmag, n.ymag, -n.ymag, n.znear, n.zfar)), r.name && (e.name = this.createUniqueName(r.name)), F(e, r), Promise.resolve(e);
2591
1374
  }
2592
1375
  /**
2593
1376
  * Specification: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#skins
2594
1377
  * @param {number} skinIndex
2595
1378
  * @return {Promise<Skeleton>}
2596
1379
  */
2597
- loadSkin(e) {
2598
- const t = this.json.skins[e], s = [];
2599
- for (let n = 0, r = t.joints.length; n < r; n++)
2600
- s.push(this._loadNodeShallow(t.joints[n]));
2601
- return t.inverseBindMatrices !== void 0 ? s.push(this.getDependency("accessor", t.inverseBindMatrices)) : s.push(null), Promise.all(s).then(function(n) {
2602
- const r = n.pop(), o = n, c = [], a = [];
2603
- for (let l = 0, u = o.length; l < u; l++) {
2604
- const h = o[l];
2605
- if (h) {
2606
- c.push(h);
2607
- const d = new Ne();
2608
- r !== null && d.fromArray(r.array, l * 16), a.push(d);
1380
+ loadSkin(t) {
1381
+ const e = this.json.skins[t], r = [];
1382
+ for (let n = 0, i = e.joints.length; n < i; n++)
1383
+ r.push(this._loadNodeShallow(e.joints[n]));
1384
+ return e.inverseBindMatrices !== void 0 ? r.push(this.getDependency("accessor", e.inverseBindMatrices)) : r.push(null), Promise.all(r).then(function(n) {
1385
+ const i = n.pop(), s = n, a = [], o = [];
1386
+ for (let c = 0, h = s.length; c < h; c++) {
1387
+ const u = s[c];
1388
+ if (u) {
1389
+ a.push(u);
1390
+ const d = new ee();
1391
+ i !== null && d.fromArray(i.array, c * 16), o.push(d);
2609
1392
  } else
2610
- console.warn('THREE.GLTFLoader: Joint "%s" could not be found.', t.joints[l]);
1393
+ console.warn('THREE.GLTFLoader: Joint "%s" could not be found.', e.joints[c]);
2611
1394
  }
2612
- return new _n(c, a);
1395
+ return new Ct(a, o);
2613
1396
  });
2614
1397
  }
2615
1398
  /**
@@ -2617,41 +1400,41 @@ class hr {
2617
1400
  * @param {number} animationIndex
2618
1401
  * @return {Promise<AnimationClip>}
2619
1402
  */
2620
- loadAnimation(e) {
2621
- const t = this.json, s = this, n = t.animations[e], r = n.name ? n.name : "animation_" + e, o = [], c = [], a = [], l = [], u = [];
2622
- for (let h = 0, d = n.channels.length; h < d; h++) {
2623
- const p = n.channels[h], g = n.samplers[p.sampler], A = p.target, m = A.node, f = n.parameters !== void 0 ? n.parameters[g.input] : g.input, x = n.parameters !== void 0 ? n.parameters[g.output] : g.output;
2624
- A.node !== void 0 && (o.push(this.getDependency("node", m)), c.push(this.getDependency("accessor", f)), a.push(this.getDependency("accessor", x)), l.push(g), u.push(A));
1403
+ loadAnimation(t) {
1404
+ const e = this.json, r = this, n = e.animations[t], i = n.name ? n.name : "animation_" + t, s = [], a = [], o = [], c = [], h = [];
1405
+ for (let u = 0, d = n.channels.length; u < d; u++) {
1406
+ const p = n.channels[u], g = n.samplers[p.sampler], A = p.target, m = A.node, f = n.parameters !== void 0 ? n.parameters[g.input] : g.input, E = n.parameters !== void 0 ? n.parameters[g.output] : g.output;
1407
+ A.node !== void 0 && (s.push(this.getDependency("node", m)), a.push(this.getDependency("accessor", f)), o.push(this.getDependency("accessor", E)), c.push(g), h.push(A));
2625
1408
  }
2626
1409
  return Promise.all([
1410
+ Promise.all(s),
1411
+ Promise.all(a),
2627
1412
  Promise.all(o),
2628
1413
  Promise.all(c),
2629
- Promise.all(a),
2630
- Promise.all(l),
2631
- Promise.all(u)
2632
- ]).then(function(h) {
2633
- const d = h[0], p = h[1], g = h[2], A = h[3], m = h[4], f = [];
2634
- for (let x = 0, v = d.length; x < v; x++) {
2635
- const b = d[x], y = p[x], L = g[x], _ = A[x], D = m[x];
2636
- if (b === void 0) continue;
2637
- b.updateMatrix && b.updateMatrix();
2638
- const M = s._createAnimationTracks(b, y, L, _, D);
2639
- if (M)
2640
- for (let P = 0; P < M.length; P++)
2641
- f.push(M[P]);
1414
+ Promise.all(h)
1415
+ ]).then(function(u) {
1416
+ const d = u[0], p = u[1], g = u[2], A = u[3], m = u[4], f = [];
1417
+ for (let E = 0, _ = d.length; E < _; E++) {
1418
+ const x = d[E], w = p[E], b = g[E], y = A[E], C = m[E];
1419
+ if (x === void 0) continue;
1420
+ x.updateMatrix && x.updateMatrix();
1421
+ const L = r._createAnimationTracks(x, w, b, y, C);
1422
+ if (L)
1423
+ for (let P = 0; P < L.length; P++)
1424
+ f.push(L[P]);
2642
1425
  }
2643
- return new Ln(r, void 0, f);
1426
+ return new Pt(i, void 0, f);
2644
1427
  });
2645
1428
  }
2646
- createNodeMesh(e) {
2647
- const t = this.json, s = this, n = t.nodes[e];
2648
- return n.mesh === void 0 ? null : s.getDependency("mesh", n.mesh).then(function(r) {
2649
- const o = s._getNodeRef(s.meshCache, n.mesh, r);
2650
- return n.weights !== void 0 && o.traverse(function(c) {
2651
- if (c.isMesh)
2652
- for (let a = 0, l = n.weights.length; a < l; a++)
2653
- c.morphTargetInfluences[a] = n.weights[a];
2654
- }), o;
1429
+ createNodeMesh(t) {
1430
+ const e = this.json, r = this, n = e.nodes[t];
1431
+ return n.mesh === void 0 ? null : r.getDependency("mesh", n.mesh).then(function(i) {
1432
+ const s = r._getNodeRef(r.meshCache, n.mesh, i);
1433
+ return n.weights !== void 0 && s.traverse(function(a) {
1434
+ if (a.isMesh)
1435
+ for (let o = 0, c = n.weights.length; o < c; o++)
1436
+ a.morphTargetInfluences[o] = n.weights[o];
1437
+ }), s;
2655
1438
  });
2656
1439
  }
2657
1440
  /**
@@ -2659,149 +1442,149 @@ class hr {
2659
1442
  * @param {number} nodeIndex
2660
1443
  * @return {Promise<Object3D>}
2661
1444
  */
2662
- loadNode(e) {
2663
- const t = this.json, s = this, n = t.nodes[e], r = s._loadNodeShallow(e), o = [], c = n.children || [];
2664
- for (let l = 0, u = c.length; l < u; l++)
2665
- o.push(s.getDependency("node", c[l]));
2666
- const a = n.skin === void 0 ? Promise.resolve(null) : s.getDependency("skin", n.skin);
1445
+ loadNode(t) {
1446
+ const e = this.json, r = this, n = e.nodes[t], i = r._loadNodeShallow(t), s = [], a = n.children || [];
1447
+ for (let c = 0, h = a.length; c < h; c++)
1448
+ s.push(r.getDependency("node", a[c]));
1449
+ const o = n.skin === void 0 ? Promise.resolve(null) : r.getDependency("skin", n.skin);
2667
1450
  return Promise.all([
2668
- r,
2669
- Promise.all(o),
2670
- a
2671
- ]).then(function(l) {
2672
- const u = l[0], h = l[1], d = l[2];
2673
- d !== null && u.traverse(function(p) {
2674
- p.isSkinnedMesh && p.bind(d, ur);
1451
+ i,
1452
+ Promise.all(s),
1453
+ o
1454
+ ]).then(function(c) {
1455
+ const h = c[0], u = c[1], d = c[2];
1456
+ d !== null && h.traverse(function(p) {
1457
+ p.isSkinnedMesh && p.bind(d, _n);
2675
1458
  });
2676
- for (let p = 0, g = h.length; p < g; p++)
2677
- u.add(h[p]);
2678
- return u;
1459
+ for (let p = 0, g = u.length; p < g; p++)
1460
+ h.add(u[p]);
1461
+ return h;
2679
1462
  });
2680
1463
  }
2681
1464
  // ._loadNodeShallow() parses a single node.
2682
1465
  // skin and child nodes are created and added in .loadNode() (no '_' prefix).
2683
- _loadNodeShallow(e) {
2684
- const t = this.json, s = this.extensions, n = this;
2685
- if (this.nodeCache[e] !== void 0)
2686
- return this.nodeCache[e];
2687
- const r = t.nodes[e], o = r.name ? n.createUniqueName(r.name) : "", c = [], a = n._invokeOne(function(l) {
2688
- return l.createNodeMesh && l.createNodeMesh(e);
1466
+ _loadNodeShallow(t) {
1467
+ const e = this.json, r = this.extensions, n = this;
1468
+ if (this.nodeCache[t] !== void 0)
1469
+ return this.nodeCache[t];
1470
+ const i = e.nodes[t], s = i.name ? n.createUniqueName(i.name) : "", a = [], o = n._invokeOne(function(c) {
1471
+ return c.createNodeMesh && c.createNodeMesh(t);
2689
1472
  });
2690
- return a && c.push(a), r.camera !== void 0 && c.push(n.getDependency("camera", r.camera).then(function(l) {
2691
- return n._getNodeRef(n.cameraCache, r.camera, l);
2692
- })), n._invokeAll(function(l) {
2693
- return l.createNodeAttachment && l.createNodeAttachment(e);
2694
- }).forEach(function(l) {
2695
- c.push(l);
2696
- }), this.nodeCache[e] = Promise.all(c).then(function(l) {
2697
- let u;
2698
- if (r.isBone === !0 ? u = new In() : l.length > 1 ? u = new Xe() : l.length === 1 ? u = l[0] : u = new Nt(), u !== l[0])
2699
- for (let h = 0, d = l.length; h < d; h++)
2700
- u.add(l[h]);
2701
- if (r.name && (u.userData.name = r.name, u.name = o), K(u, r), r.extensions && ee(s, u, r), r.matrix !== void 0) {
2702
- const h = new Ne();
2703
- h.fromArray(r.matrix), u.applyMatrix4(h);
1473
+ return o && a.push(o), i.camera !== void 0 && a.push(n.getDependency("camera", i.camera).then(function(c) {
1474
+ return n._getNodeRef(n.cameraCache, i.camera, c);
1475
+ })), n._invokeAll(function(c) {
1476
+ return c.createNodeAttachment && c.createNodeAttachment(t);
1477
+ }).forEach(function(c) {
1478
+ a.push(c);
1479
+ }), this.nodeCache[t] = Promise.all(a).then(function(c) {
1480
+ let h;
1481
+ if (i.isBone === !0 ? h = new Ft() : c.length > 1 ? h = new ie() : c.length === 1 ? h = c[0] : h = new Ue(), h !== c[0])
1482
+ for (let u = 0, d = c.length; u < d; u++)
1483
+ h.add(c[u]);
1484
+ if (i.name && (h.userData.name = i.name, h.name = s), F(h, i), i.extensions && k(r, h, i), i.matrix !== void 0) {
1485
+ const u = new ee();
1486
+ u.fromArray(i.matrix), h.applyMatrix4(u);
2704
1487
  } else
2705
- r.translation !== void 0 && u.position.fromArray(r.translation), r.rotation !== void 0 && u.quaternion.fromArray(r.rotation), r.scale !== void 0 && u.scale.fromArray(r.scale);
2706
- return n.associations.has(u) || n.associations.set(u, {}), n.associations.get(u).nodes = e, u;
2707
- }), this.nodeCache[e];
1488
+ i.translation !== void 0 && h.position.fromArray(i.translation), i.rotation !== void 0 && h.quaternion.fromArray(i.rotation), i.scale !== void 0 && h.scale.fromArray(i.scale);
1489
+ return n.associations.has(h) || n.associations.set(h, {}), n.associations.get(h).nodes = t, h;
1490
+ }), this.nodeCache[t];
2708
1491
  }
2709
1492
  /**
2710
1493
  * Specification: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#scenes
2711
1494
  * @param {number} sceneIndex
2712
1495
  * @return {Promise<Group>}
2713
1496
  */
2714
- loadScene(e) {
2715
- const t = this.extensions, s = this.json.scenes[e], n = this, r = new Xe();
2716
- s.name && (r.name = n.createUniqueName(s.name)), K(r, s), s.extensions && ee(t, r, s);
2717
- const o = s.nodes || [], c = [];
2718
- for (let a = 0, l = o.length; a < l; a++)
2719
- c.push(n.getDependency("node", o[a]));
2720
- return Promise.all(c).then(function(a) {
2721
- for (let u = 0, h = a.length; u < h; u++)
2722
- r.add(a[u]);
2723
- const l = (u) => {
2724
- const h = /* @__PURE__ */ new Map();
1497
+ loadScene(t) {
1498
+ const e = this.extensions, r = this.json.scenes[t], n = this, i = new ie();
1499
+ r.name && (i.name = n.createUniqueName(r.name)), F(i, r), r.extensions && k(e, i, r);
1500
+ const s = r.nodes || [], a = [];
1501
+ for (let o = 0, c = s.length; o < c; o++)
1502
+ a.push(n.getDependency("node", s[o]));
1503
+ return Promise.all(a).then(function(o) {
1504
+ for (let h = 0, u = o.length; h < u; h++)
1505
+ i.add(o[h]);
1506
+ const c = (h) => {
1507
+ const u = /* @__PURE__ */ new Map();
2725
1508
  for (const [d, p] of n.associations)
2726
- (d instanceof je || d instanceof ft) && h.set(d, p);
2727
- return u.traverse((d) => {
1509
+ (d instanceof re || d instanceof Se) && u.set(d, p);
1510
+ return h.traverse((d) => {
2728
1511
  const p = n.associations.get(d);
2729
- p != null && h.set(d, p);
2730
- }), h;
1512
+ p != null && u.set(d, p);
1513
+ }), u;
2731
1514
  };
2732
- return n.associations = l(r), r;
1515
+ return n.associations = c(i), i;
2733
1516
  });
2734
1517
  }
2735
- _createAnimationTracks(e, t, s, n, r) {
2736
- const o = [], c = e.name ? e.name : e.uuid, a = [];
2737
- Q[r.path] === Q.weights ? e.traverse(function(d) {
2738
- d.morphTargetInfluences && a.push(d.name ? d.name : d.uuid);
2739
- }) : a.push(c);
2740
- let l;
2741
- switch (Q[r.path]) {
2742
- case Q.weights:
2743
- l = mt;
1518
+ _createAnimationTracks(t, e, r, n, i) {
1519
+ const s = [], a = t.name ? t.name : t.uuid, o = [];
1520
+ B[i.path] === B.weights ? t.traverse(function(d) {
1521
+ d.morphTargetInfluences && o.push(d.name ? d.name : d.uuid);
1522
+ }) : o.push(a);
1523
+ let c;
1524
+ switch (B[i.path]) {
1525
+ case B.weights:
1526
+ c = Le;
2744
1527
  break;
2745
- case Q.rotation:
2746
- l = gt;
1528
+ case B.rotation:
1529
+ c = be;
2747
1530
  break;
2748
- case Q.position:
2749
- case Q.scale:
2750
- l = pt;
1531
+ case B.position:
1532
+ case B.scale:
1533
+ c = ye;
2751
1534
  break;
2752
1535
  default:
2753
- switch (s.itemSize) {
1536
+ switch (r.itemSize) {
2754
1537
  case 1:
2755
- l = mt;
1538
+ c = Le;
2756
1539
  break;
2757
1540
  case 2:
2758
1541
  case 3:
2759
1542
  default:
2760
- l = pt;
1543
+ c = ye;
2761
1544
  break;
2762
1545
  }
2763
1546
  break;
2764
1547
  }
2765
- const u = n.interpolation !== void 0 ? rr[n.interpolation] : Dt, h = this._getArrayFromAccessor(s);
2766
- for (let d = 0, p = a.length; d < p; d++) {
2767
- const g = new l(
2768
- a[d] + "." + Q[r.path],
2769
- t.array,
2770
- h,
2771
- u
1548
+ const h = n.interpolation !== void 0 ? gn[n.interpolation] : Xe, u = this._getArrayFromAccessor(r);
1549
+ for (let d = 0, p = o.length; d < p; d++) {
1550
+ const g = new c(
1551
+ o[d] + "." + B[i.path],
1552
+ e.array,
1553
+ u,
1554
+ h
2772
1555
  );
2773
- n.interpolation === "CUBICSPLINE" && this._createCubicSplineTrackInterpolant(g), o.push(g);
1556
+ n.interpolation === "CUBICSPLINE" && this._createCubicSplineTrackInterpolant(g), s.push(g);
2774
1557
  }
2775
- return o;
2776
- }
2777
- _getArrayFromAccessor(e) {
2778
- let t = e.array;
2779
- if (e.normalized) {
2780
- const s = it(t.constructor), n = new Float32Array(t.length);
2781
- for (let r = 0, o = t.length; r < o; r++)
2782
- n[r] = t[r] * s;
2783
- t = n;
1558
+ return s;
1559
+ }
1560
+ _getArrayFromAccessor(t) {
1561
+ let e = t.array;
1562
+ if (t.normalized) {
1563
+ const r = ge(e.constructor), n = new Float32Array(e.length);
1564
+ for (let i = 0, s = e.length; i < s; i++)
1565
+ n[i] = e[i] * r;
1566
+ e = n;
2784
1567
  }
2785
- return t;
1568
+ return e;
2786
1569
  }
2787
- _createCubicSplineTrackInterpolant(e) {
2788
- e.createInterpolant = function(s) {
2789
- const n = this instanceof gt ? sr : Xt;
2790
- return new n(this.times, this.values, this.getValueSize() / 3, s);
2791
- }, e.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline = !0;
1570
+ _createCubicSplineTrackInterpolant(t) {
1571
+ t.createInterpolant = function(r) {
1572
+ const n = this instanceof be ? mn : Ve;
1573
+ return new n(this.times, this.values, this.getValueSize() / 3, r);
1574
+ }, t.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline = !0;
2792
1575
  }
2793
1576
  }
2794
- function dr(i, e, t) {
2795
- const s = e.attributes, n = new Fn();
2796
- if (s.POSITION !== void 0) {
2797
- const c = t.json.accessors[s.POSITION], a = c.min, l = c.max;
2798
- if (a !== void 0 && l !== void 0) {
1577
+ function wn(l, t, e) {
1578
+ const r = t.attributes, n = new Bt();
1579
+ if (r.POSITION !== void 0) {
1580
+ const a = e.json.accessors[r.POSITION], o = a.min, c = a.max;
1581
+ if (o !== void 0 && c !== void 0) {
2799
1582
  if (n.set(
2800
- new te(a[0], a[1], a[2]),
2801
- new te(l[0], l[1], l[2])
2802
- ), c.normalized) {
2803
- const u = it(le[c.componentType]);
2804
- n.min.multiplyScalar(u), n.max.multiplyScalar(u);
1583
+ new G(o[0], o[1], o[2]),
1584
+ new G(c[0], c[1], c[2])
1585
+ ), a.normalized) {
1586
+ const h = ge(X[a.componentType]);
1587
+ n.min.multiplyScalar(h), n.max.multiplyScalar(h);
2805
1588
  }
2806
1589
  } else {
2807
1590
  console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");
@@ -2809,351 +1592,351 @@ function dr(i, e, t) {
2809
1592
  }
2810
1593
  } else
2811
1594
  return;
2812
- const r = e.targets;
2813
- if (r !== void 0) {
2814
- const c = new te(), a = new te();
2815
- for (let l = 0, u = r.length; l < u; l++) {
2816
- const h = r[l];
2817
- if (h.POSITION !== void 0) {
2818
- const d = t.json.accessors[h.POSITION], p = d.min, g = d.max;
1595
+ const i = t.targets;
1596
+ if (i !== void 0) {
1597
+ const a = new G(), o = new G();
1598
+ for (let c = 0, h = i.length; c < h; c++) {
1599
+ const u = i[c];
1600
+ if (u.POSITION !== void 0) {
1601
+ const d = e.json.accessors[u.POSITION], p = d.min, g = d.max;
2819
1602
  if (p !== void 0 && g !== void 0) {
2820
- if (a.setX(Math.max(Math.abs(p[0]), Math.abs(g[0]))), a.setY(Math.max(Math.abs(p[1]), Math.abs(g[1]))), a.setZ(Math.max(Math.abs(p[2]), Math.abs(g[2]))), d.normalized) {
2821
- const A = it(le[d.componentType]);
2822
- a.multiplyScalar(A);
1603
+ if (o.setX(Math.max(Math.abs(p[0]), Math.abs(g[0]))), o.setY(Math.max(Math.abs(p[1]), Math.abs(g[1]))), o.setZ(Math.max(Math.abs(p[2]), Math.abs(g[2]))), d.normalized) {
1604
+ const A = ge(X[d.componentType]);
1605
+ o.multiplyScalar(A);
2823
1606
  }
2824
- c.max(a);
1607
+ a.max(o);
2825
1608
  } else
2826
1609
  console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");
2827
1610
  }
2828
1611
  }
2829
- n.expandByVector(c);
1612
+ n.expandByVector(a);
2830
1613
  }
2831
- i.boundingBox = n;
2832
- const o = new On();
2833
- n.getCenter(o.center), o.radius = n.min.distanceTo(n.max) / 2, i.boundingSphere = o;
1614
+ l.boundingBox = n;
1615
+ const s = new kt();
1616
+ n.getCenter(s.center), s.radius = n.min.distanceTo(n.max) / 2, l.boundingSphere = s;
2834
1617
  }
2835
- function yt(i, e, t) {
2836
- const s = e.attributes, n = [];
2837
- function r(o, c) {
2838
- return t.getDependency("accessor", o).then(function(a) {
2839
- i.setAttribute(c, a);
1618
+ function De(l, t, e) {
1619
+ const r = t.attributes, n = [];
1620
+ function i(s, a) {
1621
+ return e.getDependency("accessor", s).then(function(o) {
1622
+ l.setAttribute(a, o);
2840
1623
  });
2841
1624
  }
2842
- for (const o in s) {
2843
- const c = ot[o] || o.toLowerCase();
2844
- c in i.attributes || n.push(r(s[o], c));
1625
+ for (const s in r) {
1626
+ const a = me[s] || s.toLowerCase();
1627
+ a in l.attributes || n.push(i(r[s], a));
2845
1628
  }
2846
- if (e.indices !== void 0 && !i.index) {
2847
- const o = t.getDependency("accessor", e.indices).then(function(c) {
2848
- i.setIndex(c);
1629
+ if (t.indices !== void 0 && !l.index) {
1630
+ const s = e.getDependency("accessor", t.indices).then(function(a) {
1631
+ l.setIndex(a);
2849
1632
  });
2850
- n.push(o);
1633
+ n.push(s);
2851
1634
  }
2852
- return At.workingColorSpace !== V && "COLOR_0" in s && console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${At.workingColorSpace}" not supported.`), K(i, e), dr(i, e, t), Promise.all(n).then(function() {
2853
- return e.targets !== void 0 ? ir(i, e.targets, t) : i;
1635
+ return Ie.workingColorSpace !== D && "COLOR_0" in r && console.warn(`THREE.GLTFLoader: Converting vertex colors from "srgb-linear" to "${Ie.workingColorSpace}" not supported.`), F(l, t), wn(l, t, e), Promise.all(n).then(function() {
1636
+ return t.targets !== void 0 ? Tn(l, t.targets, e) : l;
2854
1637
  });
2855
1638
  }
2856
- const Ce = [0, 0, -10], ne = [0.5, 0.5, 0.5], Kt = 1, Je = /* @__PURE__ */ new Map(), fr = (i) => {
2857
- const e = Je.get(i);
2858
- if (e) return e;
2859
- const t = new Ns(), s = Bt(i).then(
2860
- (n) => new Promise((r, o) => {
2861
- t.parse(n, "", r, o);
1639
+ const $ = [0, 0, -10], U = [0.5, 0.5, 0.5], ze = 1, ue = /* @__PURE__ */ new Map(), Sn = (l) => {
1640
+ const t = ue.get(l);
1641
+ if (t) return t;
1642
+ const e = new Kt(), r = jt(l).then(
1643
+ (n) => new Promise((i, s) => {
1644
+ e.parse(n, "", i, s);
2862
1645
  })
2863
1646
  ).catch((n) => {
2864
- throw Je.delete(i), n;
1647
+ throw ue.delete(l), n;
2865
1648
  });
2866
- return Je.set(i, s), s;
2867
- }, Yt = ({
2868
- position: i,
2869
- rotation: e,
2870
- scale: t,
2871
- url: s,
1649
+ return ue.set(l, r), r;
1650
+ }, We = ({
1651
+ position: l,
1652
+ rotation: t,
1653
+ scale: e,
1654
+ url: r,
2872
1655
  showDebugMaterial: n = !1,
2873
- opacity: r = Kt
1656
+ opacity: i = ze
2874
1657
  }) => {
2875
- const o = s ?? new URL("/assets/xr/3d-models/head-occluder-v2.glb", Pe.assetStorageEndpoint).toString(), [c, a] = at(null);
2876
- $(() => {
2877
- let u = !1;
2878
- return fr(o).then((h) => {
2879
- u || a(h.scene);
2880
- }).catch((h) => {
2881
- u || console.error(`${Pe.loggerPrefix} head occluder load failed`, h);
1658
+ const s = r ?? new URL("/assets/xr/3d-models/head-occluder-v2.glb", Ne.assetStorageEndpoint).toString(), [a, o] = tt(null);
1659
+ we(() => {
1660
+ let h = !1;
1661
+ return Sn(s).then((u) => {
1662
+ h || o(u.scene);
1663
+ }).catch((u) => {
1664
+ h || console.error(`${Ne.loggerPrefix} head occluder load failed`, u);
2882
1665
  }), () => {
2883
- u = !0;
1666
+ h = !0;
2884
1667
  };
2885
- }, [o]);
2886
- const l = j(() => {
2887
- if (!c) return null;
2888
- const u = c.clone();
2889
- return u.traverse((h) => {
2890
- h instanceof R.Mesh && (h.material = new R.MeshStandardMaterial({
1668
+ }, [s]);
1669
+ const c = Ae(() => {
1670
+ if (!a) return null;
1671
+ const h = a.clone();
1672
+ return h.traverse((u) => {
1673
+ u instanceof K.Mesh && (u.material = new K.MeshStandardMaterial({
2891
1674
  color: 15132390,
2892
1675
  colorWrite: n,
2893
1676
  depthWrite: !0,
2894
- opacity: n ? r : 1,
2895
- side: R.DoubleSide,
1677
+ opacity: n ? i : 1,
1678
+ side: K.DoubleSide,
2896
1679
  transparent: n
2897
1680
  }));
2898
- }), u;
2899
- }, [c, n, r]);
2900
- return $(() => {
2901
- if (l)
1681
+ }), h;
1682
+ }, [a, n, i]);
1683
+ return we(() => {
1684
+ if (c)
2902
1685
  return () => {
2903
- l.traverse((u) => {
2904
- u instanceof R.Mesh && u.material.dispose();
1686
+ c.traverse((h) => {
1687
+ h instanceof K.Mesh && h.material.dispose();
2905
1688
  });
2906
1689
  };
2907
- }, [l]), l ? (i ? l.position.set(i[0], i[1], i[2]) : l.position.set(
2908
- Ce[0],
2909
- Ce[1],
2910
- Ce[2]
2911
- ), e && l.rotation.set(e[0], e[1], e[2]), t ? l.scale.set(t[0], t[1], t[2]) : l.scale.set(
2912
- ne[0],
2913
- ne[1],
2914
- ne[2]
2915
- ), l.renderOrder = -1, /* @__PURE__ */ T("primitive", { object: l })) : null;
2916
- }, pr = 4, Yr = ({
2917
- children: i,
2918
- faceIndex: e = 0,
2919
- numFaces: t = pr,
2920
- scaleWithFace: s = !0,
1690
+ }, [c]), c ? (l ? c.position.set(l[0], l[1], l[2]) : c.position.set(
1691
+ $[0],
1692
+ $[1],
1693
+ $[2]
1694
+ ), t && c.rotation.set(t[0], t[1], t[2]), e ? c.scale.set(e[0], e[1], e[2]) : c.scale.set(
1695
+ U[0],
1696
+ U[1],
1697
+ U[2]
1698
+ ), c.renderOrder = -1, /* @__PURE__ */ R("primitive", { object: c })) : null;
1699
+ }, yn = 4, vn = ({
1700
+ children: l,
1701
+ faceIndex: t = 0,
1702
+ numFaces: e = yn,
1703
+ scaleWithFace: r = !0,
2921
1704
  occluder: n = !0,
2922
- showFaceMesh: r = !1,
2923
- faceMeshMaterial: o
1705
+ showFaceMesh: i = !1,
1706
+ faceMeshMaterial: s
2924
1707
  }) => {
2925
- const c = j(
2926
- () => new R.MeshBasicMaterial({
1708
+ const a = Ae(
1709
+ () => new K.MeshBasicMaterial({
2927
1710
  color: "#22c55e",
2928
- side: R.BackSide,
1711
+ side: K.BackSide,
2929
1712
  transparent: !0,
2930
1713
  opacity: 0.35,
2931
1714
  depthWrite: !1
2932
1715
  }),
2933
1716
  []
2934
- ), a = n === !1 ? null : n === !0 ? {} : n;
2935
- return /* @__PURE__ */ w(Hn, { faceIndex: e, numFaces: t, scaleWithFace: s, children: [
2936
- a && /* @__PURE__ */ T(
2937
- Yt,
1717
+ ), o = n === !1 ? null : n === !0 ? {} : n;
1718
+ return /* @__PURE__ */ S(Ut, { faceIndex: t, numFaces: e, scaleWithFace: r, children: [
1719
+ o && /* @__PURE__ */ R(
1720
+ We,
2938
1721
  {
2939
- position: a.position ?? Ce,
2940
- rotation: a.rotation,
2941
- scale: a.scale ?? ne,
2942
- url: a.url,
2943
- showDebugMaterial: a.showDebugMaterial,
2944
- opacity: a.opacity ?? Kt
1722
+ position: o.position ?? $,
1723
+ rotation: o.rotation,
1724
+ scale: o.scale ?? U,
1725
+ url: o.url,
1726
+ showDebugMaterial: o.showDebugMaterial,
1727
+ opacity: o.opacity ?? ze
2945
1728
  }
2946
1729
  ),
2947
- i,
2948
- r && /* @__PURE__ */ T(
2949
- jn,
1730
+ l,
1731
+ i && /* @__PURE__ */ R(
1732
+ vt,
2950
1733
  {
2951
- faceIndex: e,
2952
- numFaces: t,
2953
- material: o ?? c
1734
+ faceIndex: t,
1735
+ numFaces: e,
1736
+ material: s ?? a
2954
1737
  }
2955
1738
  )
2956
1739
  ] });
2957
- }, mr = 57, gr = 15.5, et = mr / Math.PI / gr, Ar = -0.134, Tr = -0.024, Y = (i, e, t) => Math.min(t, Math.max(e, i)), Vt = (i, e) => i * e - e / 2, Wt = (i, e) => -(i * e - e / 2), xr = ({
2958
- eyeMidX: i,
2959
- noseX: e,
2960
- offsetX: t,
2961
- rawYaw: s,
1740
+ }, Ln = 57, bn = 15.5, he = Ln / Math.PI / bn, In = -0.134, Nn = -0.024, O = (l, t, e) => Math.min(e, Math.max(t, l)), qe = (l, t) => l * t - t / 2, Ze = (l, t) => -(l * t - t / 2), Cn = ({
1741
+ eyeMidX: l,
1742
+ noseX: t,
1743
+ offsetX: e,
1744
+ rawYaw: r,
2962
1745
  sideMidX: n
2963
1746
  }) => {
2964
- const r = Y((Math.abs(s) - 0.18) / 0.42, 0, 1), o = n * 0.75 + i * 0.25, c = i * 0.7 + e * 0.3;
2965
- return o * (1 - r) + c * r + t;
2966
- }, Vr = ({
2967
- baseScale: i,
2968
- pitchRadians: e
1747
+ const i = O((Math.abs(r) - 0.18) / 0.42, 0, 1), s = n * 0.75 + l * 0.25, a = l * 0.7 + t * 0.3;
1748
+ return s * (1 - i) + a * i + e;
1749
+ }, jn = ({
1750
+ baseScale: l,
1751
+ pitchRadians: t
2969
1752
  }) => {
2970
- const t = e * 180 / Math.PI, n = 1 + Y((t - 6) / 22, 0, 1) * 0.22;
2971
- return [i[0] * n, i[1] * n, i[2] * n];
2972
- }, Wr = ({ yawRadians: i }) => {
2973
- const e = Math.abs(i * 180 / Math.PI), s = 0.066 * Y((e - 8) / 12, 0, 1);
2974
- return Math.sign(i) * s;
2975
- }, zr = ({
2976
- pitchRadians: i
1753
+ const e = t * 180 / Math.PI, n = 1 + O((e - 6) / 22, 0, 1) * 0.22;
1754
+ return [l[0] * n, l[1] * n, l[2] * n];
1755
+ }, Kn = ({ yawRadians: l }) => {
1756
+ const t = Math.abs(l * 180 / Math.PI), r = 0.066 * O((t - 8) / 12, 0, 1);
1757
+ return Math.sign(l) * r;
1758
+ }, Xn = ({
1759
+ pitchRadians: l
2977
1760
  }) => {
2978
- const e = i * 180 / Math.PI;
2979
- return -0.026 * Y((-e - 6) / 18, 0, 1);
2980
- }, qr = ({
2981
- baseOffset: i,
2982
- yawRadians: e
1761
+ const t = l * 180 / Math.PI;
1762
+ return -0.026 * O((-t - 6) / 18, 0, 1);
1763
+ }, Yn = ({
1764
+ baseOffset: l,
1765
+ yawRadians: t
2983
1766
  }) => {
2984
- const t = Math.abs(e * 180 / Math.PI), s = Y((t - 8) / 24, 0, 1);
2985
- return i + s * 0.25;
2986
- }, Zr = ({
2987
- baseOffsetY: i,
2988
- baseScaleY: e,
2989
- face: t
1767
+ const e = Math.abs(t * 180 / Math.PI), r = O((e - 8) / 24, 0, 1);
1768
+ return l + r * 0.25;
1769
+ }, Vn = ({
1770
+ baseOffsetY: l,
1771
+ baseScaleY: t,
1772
+ face: e
2990
1773
  }) => {
2991
- if (!t || t.bounds.width <= 0)
1774
+ if (!e || e.bounds.width <= 0)
2992
1775
  return {
2993
1776
  aspectRatio: 0,
2994
1777
  normalizedAspect: 0,
2995
- scaleY: e,
2996
- offsetY: i
1778
+ scaleY: t,
1779
+ offsetY: l
2997
1780
  };
2998
- const s = t.bounds.height / t.bounds.width, n = Y((s - 1.55) / 0.35, -1, 1);
1781
+ const r = e.bounds.height / e.bounds.width, n = O((r - 1.55) / 0.35, -1, 1);
2999
1782
  return {
3000
- aspectRatio: s,
1783
+ aspectRatio: r,
3001
1784
  normalizedAspect: n,
3002
- scaleY: e + n * 0.06,
3003
- offsetY: i + n * 5e-3
1785
+ scaleY: t + n * 0.06,
1786
+ offsetY: l + n * 5e-3
3004
1787
  };
3005
- }, vr = ({
3006
- face: i,
3007
- offsetX: e,
3008
- offsetY: t,
3009
- scaleX: s,
1788
+ }, Pn = ({
1789
+ face: l,
1790
+ offsetX: t,
1791
+ offsetY: e,
1792
+ scaleX: r,
3010
1793
  scaleY: n
3011
1794
  }) => {
3012
- const r = i.bounds.width * s, o = i.bounds.height * n, c = i.bounds.centerX + e, a = i.bounds.centerY + t;
1795
+ const i = l.bounds.width * r, s = l.bounds.height * n, a = l.bounds.centerX + t, o = l.bounds.centerY + e;
3013
1796
  return {
3014
- x: c - r * 0.5,
3015
- y: a - o * 0.5,
3016
- width: r,
3017
- height: o,
3018
- centerX: c,
3019
- centerY: a
1797
+ x: a - i * 0.5,
1798
+ y: o - s * 0.5,
1799
+ width: i,
1800
+ height: s,
1801
+ centerX: a,
1802
+ centerY: o
3020
1803
  };
3021
- }, br = ({
3022
- face: i,
3023
- height: e,
3024
- lockDepth: t,
3025
- lockRotation: s,
1804
+ }, Fn = ({
1805
+ face: l,
1806
+ height: t,
1807
+ lockDepth: e,
1808
+ lockRotation: r,
3026
1809
  model: n,
3027
- offsetX: r,
3028
- offsetY: o,
3029
- scaleX: c,
3030
- scaleY: a,
3031
- scaleZ: l,
3032
- width: u
1810
+ offsetX: i,
1811
+ offsetY: s,
1812
+ scaleX: a,
1813
+ scaleY: o,
1814
+ scaleZ: c,
1815
+ width: h
3033
1816
  }) => {
3034
- const h = vr({
3035
- face: i,
3036
- offsetX: r,
3037
- offsetY: o,
3038
- scaleX: c,
3039
- scaleY: a
3040
- }), d = i.landmarks[33], p = i.landmarks[263], g = i.landmarks[234], A = i.landmarks[454], m = i.landmarks[1], f = i.landmarks[10], x = i.landmarks[152], v = h.width * u, b = h.height * e, y = d && p ? (d.x + p.x) * 0.5 : i.bounds.centerX, L = d && p ? (d.y + p.y) * 0.5 : i.bounds.centerY - i.bounds.height * 0.15, _ = g && A ? (g.x + A.x) * 0.5 : y, D = (f == null ? void 0 : f.y) ?? i.bounds.minY, M = (x == null ? void 0 : x.y) ?? i.bounds.maxY, P = (D + M) * 0.5, re = d && p ? Math.atan2(p.y - d.y, p.x - d.x) : 0, I = m && i.bounds.width > 0 ? Y((m.x - i.bounds.centerX) / (i.bounds.width * 0.5), -1, 1) * 0.75 : 0, W = xr({
3041
- eyeMidX: y,
3042
- noseX: (m == null ? void 0 : m.x) ?? y,
3043
- offsetX: r,
3044
- rawYaw: I,
3045
- sideMidX: _
3046
- }), S = P * 0.75 + L * 0.25 + o, oe = n === "v2" ? Vt(W, u) : h.centerX * u - u / 2, z = n === "v2" ? Wt(i.bounds.centerY + o * 0.75, e) : -(h.centerY * e - e / 2), q = f && m ? Math.max(1e-4, m.y - f.y) : i.bounds.height * 0.42, ue = m && x ? Math.max(1e-4, x.y - m.y) : i.bounds.height * 0.58, he = (ue - q) / (ue + q), de = Y((he - Ar) / 0.28, -1, 1) * 0.58, fe = m && i.bounds.height > 0 ? Y(
3047
- (i.bounds.centerY - m.y) / (i.bounds.height * 0.5) - Tr,
1817
+ const u = Pn({
1818
+ face: l,
1819
+ offsetX: i,
1820
+ offsetY: s,
1821
+ scaleX: a,
1822
+ scaleY: o
1823
+ }), d = l.landmarks[33], p = l.landmarks[263], g = l.landmarks[234], A = l.landmarks[454], m = l.landmarks[1], f = l.landmarks[10], E = l.landmarks[152], _ = u.width * h, x = u.height * t, w = d && p ? (d.x + p.x) * 0.5 : l.bounds.centerX, b = d && p ? (d.y + p.y) * 0.5 : l.bounds.centerY - l.bounds.height * 0.15, y = g && A ? (g.x + A.x) * 0.5 : w, C = (f == null ? void 0 : f.y) ?? l.bounds.minY, L = (E == null ? void 0 : E.y) ?? l.bounds.maxY, P = (C + L) * 0.5, Q = d && p ? Math.atan2(p.y - d.y, p.x - d.x) : 0, H = m && l.bounds.width > 0 ? O((m.x - l.bounds.centerX) / (l.bounds.width * 0.5), -1, 1) * 0.75 : 0, j = Cn({
1824
+ eyeMidX: w,
1825
+ noseX: (m == null ? void 0 : m.x) ?? w,
1826
+ offsetX: i,
1827
+ rawYaw: H,
1828
+ sideMidX: y
1829
+ }), M = P * 0.75 + b * 0.25 + s, te = n === "v2" ? qe(j, h) : u.centerX * h - h / 2, Y = n === "v2" ? Ze(l.bounds.centerY + s * 0.75, t) : -(u.centerY * t - t / 2), V = f && m ? Math.max(1e-4, m.y - f.y) : l.bounds.height * 0.42, Te = m && E ? Math.max(1e-4, E.y - m.y) : l.bounds.height * 0.58, Ee = (Te - V) / (Te + V), xe = O((Ee - In) / 0.28, -1, 1) * 0.58, Re = m && l.bounds.height > 0 ? O(
1830
+ (l.bounds.centerY - m.y) / (l.bounds.height * 0.5) - Nn,
3048
1831
  -1,
3049
1832
  1
3050
- ) * 0.18 : 0, ie = de * 0.82 + fe * 0.18, ae = s ? 0 : n === "v2" ? I * 0.72 : I, pe = s ? 0 : n === "v2" ? -ie * 0.78 : -ie, me = s ? 0 : -re, be = t ? v * et : n === "v2" ? v * (et + Math.abs(ae) * 0.18) : v * et;
1833
+ ) * 0.18 : 0, ne = xe * 0.82 + Re * 0.18, _e = r ? 0 : n === "v2" ? H * 0.72 : H, Je = r ? 0 : n === "v2" ? -ne * 0.78 : -ne, $e = r ? 0 : -Q, et = e ? _ * he : n === "v2" ? _ * (he + Math.abs(_e) * 0.18) : _ * he;
3051
1834
  return {
3052
- centerXPx: oe,
3053
- centerYPx: z,
3054
- depthPx: be * l,
3055
- heightPx: b,
3056
- pitch: pe,
3057
- rawPitch: ie,
3058
- rawPitchFromBalance: de,
3059
- rawPitchFromCenter: fe,
3060
- rawYaw: I,
3061
- rotationZ: me,
3062
- roll: re,
3063
- shape: h,
3064
- skullAnchorX: W,
3065
- skullAnchorY: S,
3066
- verticalBalance: he,
3067
- widthPx: v,
3068
- yaw: ae
1835
+ centerXPx: te,
1836
+ centerYPx: Y,
1837
+ depthPx: et * c,
1838
+ heightPx: x,
1839
+ pitch: Je,
1840
+ rawPitch: ne,
1841
+ rawPitchFromBalance: xe,
1842
+ rawPitchFromCenter: Re,
1843
+ rawYaw: H,
1844
+ rotationZ: $e,
1845
+ roll: Q,
1846
+ shape: u,
1847
+ skullAnchorX: j,
1848
+ skullAnchorY: M,
1849
+ verticalBalance: Ee,
1850
+ widthPx: _,
1851
+ yaw: _e
3069
1852
  };
3070
- }, Er = ({
3071
- lockDepth: i,
3072
- lockRotation: e,
3073
- model: t,
3074
- face: s,
1853
+ }, On = ({
1854
+ lockDepth: l,
1855
+ lockRotation: t,
1856
+ model: e,
1857
+ face: r,
3075
1858
  height: n,
3076
- headDepthOffset: r,
3077
- offsetX: o,
3078
- offsetY: c,
3079
- rotationOffsetX: a,
3080
- rotationOffsetY: l,
3081
- rotationOffsetZ: u,
3082
- scaleX: h,
1859
+ headDepthOffset: i,
1860
+ offsetX: s,
1861
+ offsetY: a,
1862
+ rotationOffsetX: o,
1863
+ rotationOffsetY: c,
1864
+ rotationOffsetZ: h,
1865
+ scaleX: u,
3083
1866
  scaleY: d,
3084
1867
  scaleZ: p,
3085
1868
  skullCenterMode: g,
3086
1869
  skullVerticalBias: A,
3087
1870
  width: m
3088
- }) => zt({
3089
- lockDepth: i,
3090
- lockRotation: e,
3091
- model: t,
3092
- face: s,
1871
+ }) => Qe({
1872
+ lockDepth: l,
1873
+ lockRotation: t,
1874
+ model: e,
1875
+ face: r,
3093
1876
  height: n,
3094
- headDepthOffset: r,
3095
- offsetX: o,
3096
- offsetY: c,
3097
- rotationOffsetX: a,
3098
- rotationOffsetY: l,
3099
- rotationOffsetZ: u,
3100
- scaleX: h,
1877
+ headDepthOffset: i,
1878
+ offsetX: s,
1879
+ offsetY: a,
1880
+ rotationOffsetX: o,
1881
+ rotationOffsetY: c,
1882
+ rotationOffsetZ: h,
1883
+ scaleX: u,
3101
1884
  scaleY: d,
3102
1885
  scaleZ: p,
3103
1886
  skullCenterMode: g,
3104
1887
  skullVerticalBias: A,
3105
1888
  width: m
3106
- }).pose, zt = ({
3107
- lockDepth: i,
3108
- lockRotation: e,
3109
- model: t,
3110
- face: s,
1889
+ }).pose, Qe = ({
1890
+ lockDepth: l,
1891
+ lockRotation: t,
1892
+ model: e,
1893
+ face: r,
3111
1894
  height: n,
3112
- headDepthOffset: r,
3113
- offsetX: o,
3114
- offsetY: c,
3115
- rotationOffsetX: a,
3116
- rotationOffsetY: l,
3117
- rotationOffsetZ: u,
3118
- scaleX: h,
1895
+ headDepthOffset: i,
1896
+ offsetX: s,
1897
+ offsetY: a,
1898
+ rotationOffsetX: o,
1899
+ rotationOffsetY: c,
1900
+ rotationOffsetZ: h,
1901
+ scaleX: u,
3119
1902
  scaleY: d,
3120
1903
  scaleZ: p,
3121
1904
  skullCenterMode: g,
3122
1905
  skullVerticalBias: A,
3123
1906
  width: m
3124
1907
  }) => {
3125
- const f = br({
3126
- face: s,
1908
+ const f = Fn({
1909
+ face: r,
3127
1910
  height: n,
3128
- lockDepth: i,
3129
- lockRotation: e,
3130
- model: t,
3131
- offsetX: o,
3132
- offsetY: c,
3133
- scaleX: h,
1911
+ lockDepth: l,
1912
+ lockRotation: t,
1913
+ model: e,
1914
+ offsetX: s,
1915
+ offsetY: a,
1916
+ scaleX: u,
3134
1917
  scaleY: d,
3135
1918
  scaleZ: p,
3136
1919
  width: m
3137
1920
  });
3138
1921
  if (g) {
3139
- const v = new te(
1922
+ const _ = new G(
3140
1923
  0,
3141
1924
  f.heightPx * A,
3142
- -f.depthPx * r
1925
+ -f.depthPx * i
3143
1926
  ).applyEuler(
3144
- new Dn(f.pitch, f.yaw, f.rotationZ, "XYZ")
3145
- ), b = Vt(f.skullAnchorX, m), y = Wt(f.skullAnchorY, n);
1927
+ new Gt(f.pitch, f.yaw, f.rotationZ, "XYZ")
1928
+ ), x = qe(f.skullAnchorX, m), w = Ze(f.skullAnchorY, n);
3146
1929
  return {
3147
1930
  pose: {
3148
- boxCenterZ: v.z,
3149
- centerX: b + v.x,
3150
- centerY: y + v.y,
1931
+ boxCenterZ: _.z,
1932
+ centerX: x + _.x,
1933
+ centerY: w + _.y,
3151
1934
  width: f.widthPx,
3152
1935
  height: f.heightPx,
3153
1936
  depth: f.depthPx,
3154
- rotationX: f.pitch + a,
3155
- rotationY: f.yaw + l,
3156
- rotationZ: f.rotationZ + u
1937
+ rotationX: f.pitch + o,
1938
+ rotationY: f.yaw + c,
1939
+ rotationZ: f.rotationZ + h
3157
1940
  },
3158
1941
  debugMetrics: {
3159
1942
  face: {
@@ -3173,18 +1956,18 @@ const Ce = [0, 0, -10], ne = [0.5, 0.5, 0.5], Kt = 1, Je = /* @__PURE__ */ new M
3173
1956
  pose: {
3174
1957
  pitch: f.pitch,
3175
1958
  yaw: f.yaw,
3176
- rotationX: f.pitch + a,
3177
- rotationY: f.yaw + l,
3178
- rotationZ: f.rotationZ + u
1959
+ rotationX: f.pitch + o,
1960
+ rotationY: f.yaw + c,
1961
+ rotationZ: f.rotationZ + h
3179
1962
  },
3180
1963
  skullAnchor: {
3181
1964
  x: f.skullAnchorX,
3182
1965
  y: f.skullAnchorY
3183
1966
  },
3184
1967
  center: {
3185
- x: b + v.x,
3186
- y: y + v.y,
3187
- z: v.z
1968
+ x: x + _.x,
1969
+ y: w + _.y,
1970
+ z: _.z
3188
1971
  },
3189
1972
  depthPx: f.depthPx,
3190
1973
  screen: {
@@ -3196,15 +1979,15 @@ const Ce = [0, 0, -10], ne = [0.5, 0.5, 0.5], Kt = 1, Je = /* @__PURE__ */ new M
3196
1979
  }
3197
1980
  return {
3198
1981
  pose: {
3199
- boxCenterZ: -f.depthPx * r,
1982
+ boxCenterZ: -f.depthPx * i,
3200
1983
  centerX: f.centerXPx,
3201
1984
  centerY: f.centerYPx,
3202
1985
  width: f.widthPx,
3203
1986
  height: f.heightPx,
3204
1987
  depth: f.depthPx,
3205
- rotationX: f.pitch + a,
3206
- rotationY: f.yaw + l,
3207
- rotationZ: f.rotationZ + u
1988
+ rotationX: f.pitch + o,
1989
+ rotationY: f.yaw + c,
1990
+ rotationZ: f.rotationZ + h
3208
1991
  },
3209
1992
  debugMetrics: {
3210
1993
  face: {
@@ -3224,9 +2007,9 @@ const Ce = [0, 0, -10], ne = [0.5, 0.5, 0.5], Kt = 1, Je = /* @__PURE__ */ new M
3224
2007
  pose: {
3225
2008
  pitch: f.pitch,
3226
2009
  yaw: f.yaw,
3227
- rotationX: f.pitch + a,
3228
- rotationY: f.yaw + l,
3229
- rotationZ: f.rotationZ + u
2010
+ rotationX: f.pitch + o,
2011
+ rotationY: f.yaw + c,
2012
+ rotationZ: f.rotationZ + h
3230
2013
  },
3231
2014
  skullAnchor: {
3232
2015
  x: f.skullAnchorX,
@@ -3235,7 +2018,7 @@ const Ce = [0, 0, -10], ne = [0.5, 0.5, 0.5], Kt = 1, Je = /* @__PURE__ */ new M
3235
2018
  center: {
3236
2019
  x: f.centerXPx,
3237
2020
  y: f.centerYPx,
3238
- z: -f.depthPx * r
2021
+ z: -f.depthPx * i
3239
2022
  },
3240
2023
  depthPx: f.depthPx,
3241
2024
  screen: {
@@ -3244,151 +2027,151 @@ const Ce = [0, 0, -10], ne = [0.5, 0.5, 0.5], Kt = 1, Je = /* @__PURE__ */ new M
3244
2027
  }
3245
2028
  }
3246
2029
  };
3247
- }, Qr = ({
3248
- lockDepth: i,
3249
- lockRotation: e,
3250
- model: t,
3251
- face: s,
2030
+ }, zn = ({
2031
+ lockDepth: l,
2032
+ lockRotation: t,
2033
+ model: e,
2034
+ face: r,
3252
2035
  height: n,
3253
- headDepthOffset: r,
3254
- offsetX: o,
3255
- offsetY: c,
3256
- rotationOffsetX: a,
3257
- rotationOffsetY: l,
3258
- rotationOffsetZ: u,
3259
- scaleX: h,
2036
+ headDepthOffset: i,
2037
+ offsetX: s,
2038
+ offsetY: a,
2039
+ rotationOffsetX: o,
2040
+ rotationOffsetY: c,
2041
+ rotationOffsetZ: h,
2042
+ scaleX: u,
3260
2043
  scaleY: d,
3261
2044
  scaleZ: p,
3262
2045
  skullCenterMode: g,
3263
2046
  skullVerticalBias: A,
3264
2047
  width: m
3265
- }) => zt({
3266
- lockDepth: i,
3267
- lockRotation: e,
3268
- model: t,
3269
- face: s,
2048
+ }) => Qe({
2049
+ lockDepth: l,
2050
+ lockRotation: t,
2051
+ model: e,
2052
+ face: r,
3270
2053
  height: n,
3271
- headDepthOffset: r,
3272
- offsetX: o,
3273
- offsetY: c,
3274
- rotationOffsetX: a,
3275
- rotationOffsetY: l,
3276
- rotationOffsetZ: u,
3277
- scaleX: h,
2054
+ headDepthOffset: i,
2055
+ offsetX: s,
2056
+ offsetY: a,
2057
+ rotationOffsetX: o,
2058
+ rotationOffsetY: c,
2059
+ rotationOffsetZ: h,
2060
+ scaleX: u,
3278
2061
  scaleY: d,
3279
2062
  scaleZ: p,
3280
2063
  skullCenterMode: g,
3281
2064
  skullVerticalBias: A,
3282
2065
  width: m
3283
- }).debugMetrics, $r = ({
3284
- boxColor: i,
3285
- boxOpacity: e,
3286
- face: t,
3287
- headDepthOffset: s,
2066
+ }).debugMetrics, Wn = ({
2067
+ boxColor: l,
2068
+ boxOpacity: t,
2069
+ face: e,
2070
+ headDepthOffset: r,
3288
2071
  lockDepth: n,
3289
- lockRotation: r,
3290
- model: o,
3291
- occluderOffset: c,
3292
- occluderOpacity: a,
3293
- occluderScale: l,
3294
- showOccluderProxy: u = !1,
3295
- offsetX: h,
2072
+ lockRotation: i,
2073
+ model: s,
2074
+ occluderOffset: a,
2075
+ occluderOpacity: o,
2076
+ occluderScale: c,
2077
+ showOccluderProxy: h = !1,
2078
+ offsetX: u,
3296
2079
  offsetY: d,
3297
2080
  pose: p,
3298
2081
  rotationOffsetX: g,
3299
2082
  rotationOffsetY: A,
3300
2083
  rotationOffsetZ: m,
3301
2084
  scaleX: f,
3302
- scaleY: x,
3303
- scaleZ: v,
3304
- show: b,
3305
- showCenterDot: y,
3306
- showFacePlaneReference: L,
3307
- showGizmo: _,
3308
- showHeadOccluder: D,
3309
- skullCenterMode: M,
2085
+ scaleY: E,
2086
+ scaleZ: _,
2087
+ show: x,
2088
+ showCenterDot: w,
2089
+ showFacePlaneReference: b,
2090
+ showGizmo: y,
2091
+ showHeadOccluder: C,
2092
+ skullCenterMode: L,
3310
2093
  skullVerticalBias: P,
3311
- url: re,
3312
- viewportHeight: I,
3313
- viewportWidth: W
2094
+ url: Q,
2095
+ viewportHeight: H,
2096
+ viewportWidth: j
3314
2097
  }) => {
3315
- const S = j(() => p || (!t || W <= 0 || I <= 0 ? null : Er({
3316
- face: t,
3317
- width: W,
3318
- height: I,
3319
- headDepthOffset: s,
2098
+ const M = Ae(() => p || (!e || j <= 0 || H <= 0 ? null : On({
2099
+ face: e,
2100
+ width: j,
2101
+ height: H,
2102
+ headDepthOffset: r,
3320
2103
  lockDepth: n,
3321
- lockRotation: r,
3322
- model: o,
3323
- offsetX: h,
2104
+ lockRotation: i,
2105
+ model: s,
2106
+ offsetX: u,
3324
2107
  offsetY: d,
3325
2108
  rotationOffsetX: g,
3326
2109
  rotationOffsetY: A,
3327
2110
  rotationOffsetZ: m,
3328
2111
  scaleX: f,
3329
- scaleY: x,
3330
- scaleZ: v,
3331
- skullCenterMode: M,
2112
+ scaleY: E,
2113
+ scaleZ: _,
2114
+ skullCenterMode: L,
3332
2115
  skullVerticalBias: P
3333
2116
  })), [
3334
- t,
3335
- s,
3336
- n,
2117
+ e,
3337
2118
  r,
3338
- o,
3339
- h,
2119
+ n,
2120
+ i,
2121
+ s,
2122
+ u,
3340
2123
  d,
3341
2124
  g,
3342
2125
  A,
3343
2126
  m,
3344
2127
  f,
3345
- x,
3346
- v,
3347
- M,
2128
+ E,
2129
+ _,
2130
+ L,
3348
2131
  P,
3349
2132
  p,
3350
- I,
3351
- W
2133
+ H,
2134
+ j
3352
2135
  ]);
3353
- if (!b || !S) return null;
3354
- const oe = M ? [0, -S.height * P, S.depth * s] : [0, 0, 0], z = S.height, q = [
3355
- ne[0] * l[0] * z,
3356
- ne[1] * l[1] * z,
3357
- ne[2] * l[2] * z
2136
+ if (!x || !M) return null;
2137
+ const te = L ? [0, -M.height * P, M.depth * r] : [0, 0, 0], Y = M.height, V = [
2138
+ U[0] * c[0] * Y,
2139
+ U[1] * c[1] * Y,
2140
+ U[2] * c[2] * Y
3358
2141
  ];
3359
- return /* @__PURE__ */ w(rt, { children: [
3360
- /* @__PURE__ */ w(
2142
+ return /* @__PURE__ */ S(Me, { children: [
2143
+ /* @__PURE__ */ S(
3361
2144
  "group",
3362
2145
  {
3363
- position: [S.centerX, S.centerY, S.boxCenterZ],
3364
- rotation: [S.rotationX, S.rotationY, S.rotationZ],
2146
+ position: [M.centerX, M.centerY, M.boxCenterZ],
2147
+ rotation: [M.rotationX, M.rotationY, M.rotationZ],
3365
2148
  children: [
3366
- /* @__PURE__ */ T("group", { scale: [S.width, S.height, S.depth], children: e > 0 && /* @__PURE__ */ w("mesh", { children: [
3367
- /* @__PURE__ */ T("boxGeometry", { args: [1, 1, 1] }),
3368
- /* @__PURE__ */ T("meshBasicMaterial", { color: i, wireframe: !0, transparent: !0, opacity: e })
2149
+ /* @__PURE__ */ R("group", { scale: [M.width, M.height, M.depth], children: t > 0 && /* @__PURE__ */ S("mesh", { children: [
2150
+ /* @__PURE__ */ R("boxGeometry", { args: [1, 1, 1] }),
2151
+ /* @__PURE__ */ R("meshBasicMaterial", { color: l, wireframe: !0, transparent: !0, opacity: t })
3369
2152
  ] }) }),
3370
- y && /* @__PURE__ */ w("mesh", { children: [
3371
- /* @__PURE__ */ T("sphereGeometry", { args: [6, 20, 20] }),
3372
- /* @__PURE__ */ T("meshBasicMaterial", { color: i })
2153
+ w && /* @__PURE__ */ S("mesh", { children: [
2154
+ /* @__PURE__ */ R("sphereGeometry", { args: [6, 20, 20] }),
2155
+ /* @__PURE__ */ R("meshBasicMaterial", { color: l })
3373
2156
  ] }),
3374
- L && /* @__PURE__ */ w("group", { position: oe, children: [
3375
- /* @__PURE__ */ w("mesh", { rotation: [0, 0, Math.PI / 4], children: [
3376
- /* @__PURE__ */ T("ringGeometry", { args: [6, 8, 24] }),
3377
- /* @__PURE__ */ T("meshBasicMaterial", { color: "#f8fafc", side: Ie })
2157
+ b && /* @__PURE__ */ S("group", { position: te, children: [
2158
+ /* @__PURE__ */ S("mesh", { rotation: [0, 0, Math.PI / 4], children: [
2159
+ /* @__PURE__ */ R("ringGeometry", { args: [6, 8, 24] }),
2160
+ /* @__PURE__ */ R("meshBasicMaterial", { color: "#f8fafc", side: J })
3378
2161
  ] }),
3379
- /* @__PURE__ */ w("mesh", { rotation: [0, 0, Math.PI / 2], children: [
3380
- /* @__PURE__ */ T("planeGeometry", { args: [3, 16] }),
3381
- /* @__PURE__ */ T("meshBasicMaterial", { color: "#f8fafc", transparent: !0, opacity: 0.9, side: Ie })
2162
+ /* @__PURE__ */ S("mesh", { rotation: [0, 0, Math.PI / 2], children: [
2163
+ /* @__PURE__ */ R("planeGeometry", { args: [3, 16] }),
2164
+ /* @__PURE__ */ R("meshBasicMaterial", { color: "#f8fafc", transparent: !0, opacity: 0.9, side: J })
3382
2165
  ] }),
3383
- /* @__PURE__ */ w("mesh", { children: [
3384
- /* @__PURE__ */ T("planeGeometry", { args: [16, 3] }),
3385
- /* @__PURE__ */ T("meshBasicMaterial", { color: "#f8fafc", transparent: !0, opacity: 0.9, side: Ie })
2166
+ /* @__PURE__ */ S("mesh", { children: [
2167
+ /* @__PURE__ */ R("planeGeometry", { args: [16, 3] }),
2168
+ /* @__PURE__ */ R("meshBasicMaterial", { color: "#f8fafc", transparent: !0, opacity: 0.9, side: J })
3386
2169
  ] })
3387
2170
  ] }),
3388
- D && /* @__PURE__ */ w(rt, { children: [
3389
- u && /* @__PURE__ */ w("mesh", { position: c, scale: q, renderOrder: 20, children: [
3390
- /* @__PURE__ */ T("sphereGeometry", { args: [1, 24, 16] }),
3391
- /* @__PURE__ */ T(
2171
+ C && /* @__PURE__ */ S(Me, { children: [
2172
+ h && /* @__PURE__ */ S("mesh", { position: a, scale: V, renderOrder: 20, children: [
2173
+ /* @__PURE__ */ R("sphereGeometry", { args: [1, 24, 16] }),
2174
+ /* @__PURE__ */ R(
3392
2175
  "meshBasicMaterial",
3393
2176
  {
3394
2177
  color: "#facc15",
@@ -3400,57 +2183,57 @@ const Ce = [0, 0, -10], ne = [0.5, 0.5, 0.5], Kt = 1, Je = /* @__PURE__ */ new M
3400
2183
  }
3401
2184
  )
3402
2185
  ] }),
3403
- /* @__PURE__ */ T(
3404
- Yt,
2186
+ /* @__PURE__ */ R(
2187
+ We,
3405
2188
  {
3406
- opacity: a,
3407
- position: c,
3408
- scale: q,
2189
+ opacity: o,
2190
+ position: a,
2191
+ scale: V,
3409
2192
  showDebugMaterial: !0,
3410
- url: re
2193
+ url: Q
3411
2194
  }
3412
2195
  )
3413
2196
  ] })
3414
2197
  ]
3415
2198
  }
3416
2199
  ),
3417
- _ && /* @__PURE__ */ T(
2200
+ y && /* @__PURE__ */ R(
3418
2201
  "group",
3419
2202
  {
3420
- position: [S.centerX, S.centerY, S.boxCenterZ],
3421
- rotation: [S.rotationX, S.rotationY, S.rotationZ],
2203
+ position: [M.centerX, M.centerY, M.boxCenterZ],
2204
+ rotation: [M.rotationX, M.rotationY, M.rotationZ],
3422
2205
  renderOrder: 10,
3423
- children: /* @__PURE__ */ w("group", { children: [
3424
- /* @__PURE__ */ w("mesh", { children: [
3425
- /* @__PURE__ */ T("sphereGeometry", { args: [6, 20, 20] }),
3426
- /* @__PURE__ */ T("meshBasicMaterial", { color: "#e2e8f0", depthTest: !1, depthWrite: !1 })
2206
+ children: /* @__PURE__ */ S("group", { children: [
2207
+ /* @__PURE__ */ S("mesh", { children: [
2208
+ /* @__PURE__ */ R("sphereGeometry", { args: [6, 20, 20] }),
2209
+ /* @__PURE__ */ R("meshBasicMaterial", { color: "#e2e8f0", depthTest: !1, depthWrite: !1 })
3427
2210
  ] }),
3428
- /* @__PURE__ */ w("mesh", { position: [18, 0, 0], rotation: [0, 0, -Math.PI / 2], children: [
3429
- /* @__PURE__ */ T("cylinderGeometry", { args: [1.6, 1.6, 24, 12] }),
3430
- /* @__PURE__ */ T("meshBasicMaterial", { color: "#ef4444", depthTest: !1, depthWrite: !1 })
2211
+ /* @__PURE__ */ S("mesh", { position: [18, 0, 0], rotation: [0, 0, -Math.PI / 2], children: [
2212
+ /* @__PURE__ */ R("cylinderGeometry", { args: [1.6, 1.6, 24, 12] }),
2213
+ /* @__PURE__ */ R("meshBasicMaterial", { color: "#ef4444", depthTest: !1, depthWrite: !1 })
3431
2214
  ] }),
3432
- /* @__PURE__ */ w("mesh", { position: [34, 0, 0], rotation: [0, 0, -Math.PI / 2], children: [
3433
- /* @__PURE__ */ T("coneGeometry", { args: [4.2, 12, 16] }),
3434
- /* @__PURE__ */ T("meshBasicMaterial", { color: "#ef4444", depthTest: !1, depthWrite: !1 })
2215
+ /* @__PURE__ */ S("mesh", { position: [34, 0, 0], rotation: [0, 0, -Math.PI / 2], children: [
2216
+ /* @__PURE__ */ R("coneGeometry", { args: [4.2, 12, 16] }),
2217
+ /* @__PURE__ */ R("meshBasicMaterial", { color: "#ef4444", depthTest: !1, depthWrite: !1 })
3435
2218
  ] }),
3436
- /* @__PURE__ */ w("mesh", { position: [0, 18, 0], children: [
3437
- /* @__PURE__ */ T("cylinderGeometry", { args: [1.6, 1.6, 24, 12] }),
3438
- /* @__PURE__ */ T("meshBasicMaterial", { color: "#22c55e", depthTest: !1, depthWrite: !1 })
2219
+ /* @__PURE__ */ S("mesh", { position: [0, 18, 0], children: [
2220
+ /* @__PURE__ */ R("cylinderGeometry", { args: [1.6, 1.6, 24, 12] }),
2221
+ /* @__PURE__ */ R("meshBasicMaterial", { color: "#22c55e", depthTest: !1, depthWrite: !1 })
3439
2222
  ] }),
3440
- /* @__PURE__ */ w("mesh", { position: [0, 34, 0], children: [
3441
- /* @__PURE__ */ T("coneGeometry", { args: [4.2, 12, 16] }),
3442
- /* @__PURE__ */ T("meshBasicMaterial", { color: "#22c55e", depthTest: !1, depthWrite: !1 })
2223
+ /* @__PURE__ */ S("mesh", { position: [0, 34, 0], children: [
2224
+ /* @__PURE__ */ R("coneGeometry", { args: [4.2, 12, 16] }),
2225
+ /* @__PURE__ */ R("meshBasicMaterial", { color: "#22c55e", depthTest: !1, depthWrite: !1 })
3443
2226
  ] }),
3444
- /* @__PURE__ */ w("mesh", { position: [0, 0, 18], rotation: [Math.PI / 2, 0, 0], children: [
3445
- /* @__PURE__ */ T("cylinderGeometry", { args: [1.6, 1.6, 24, 12] }),
3446
- /* @__PURE__ */ T("meshBasicMaterial", { color: "#3b82f6", depthTest: !1, depthWrite: !1 })
2227
+ /* @__PURE__ */ S("mesh", { position: [0, 0, 18], rotation: [Math.PI / 2, 0, 0], children: [
2228
+ /* @__PURE__ */ R("cylinderGeometry", { args: [1.6, 1.6, 24, 12] }),
2229
+ /* @__PURE__ */ R("meshBasicMaterial", { color: "#3b82f6", depthTest: !1, depthWrite: !1 })
3447
2230
  ] }),
3448
- /* @__PURE__ */ w("mesh", { position: [0, 0, 34], rotation: [Math.PI / 2, 0, 0], children: [
3449
- /* @__PURE__ */ T("coneGeometry", { args: [4.2, 12, 16] }),
3450
- /* @__PURE__ */ T("meshBasicMaterial", { color: "#3b82f6", depthTest: !1, depthWrite: !1 })
2231
+ /* @__PURE__ */ S("mesh", { position: [0, 0, 34], rotation: [Math.PI / 2, 0, 0], children: [
2232
+ /* @__PURE__ */ R("coneGeometry", { args: [4.2, 12, 16] }),
2233
+ /* @__PURE__ */ R("meshBasicMaterial", { color: "#3b82f6", depthTest: !1, depthWrite: !1 })
3451
2234
  ] }),
3452
- /* @__PURE__ */ T(
3453
- Ye,
2235
+ /* @__PURE__ */ R(
2236
+ oe,
3454
2237
  {
3455
2238
  position: [42, 0, 0],
3456
2239
  fontSize: 10,
@@ -3462,8 +2245,8 @@ const Ce = [0, 0, -10], ne = [0.5, 0.5, 0.5], Kt = 1, Je = /* @__PURE__ */ new M
3462
2245
  children: "X"
3463
2246
  }
3464
2247
  ),
3465
- /* @__PURE__ */ T(
3466
- Ye,
2248
+ /* @__PURE__ */ R(
2249
+ oe,
3467
2250
  {
3468
2251
  position: [0, 42, 0],
3469
2252
  fontSize: 10,
@@ -3475,8 +2258,8 @@ const Ce = [0, 0, -10], ne = [0.5, 0.5, 0.5], Kt = 1, Je = /* @__PURE__ */ new M
3475
2258
  children: "Y"
3476
2259
  }
3477
2260
  ),
3478
- /* @__PURE__ */ T(
3479
- Ye,
2261
+ /* @__PURE__ */ R(
2262
+ oe,
3480
2263
  {
3481
2264
  position: [0, 0, 42],
3482
2265
  fontSize: 10,
@@ -3494,49 +2277,57 @@ const Ce = [0, 0, -10], ne = [0.5, 0.5, 0.5], Kt = 1, Je = /* @__PURE__ */ new M
3494
2277
  ] });
3495
2278
  };
3496
2279
  export {
3497
- Cr as CanonicalFaceMeshRenderer,
3498
- Nr as DEFAULT_APPEARANCE,
3499
- ys as DEFAULT_FEATURE_GROUPS,
3500
- _s as DEFAULT_FEATURE_POINT_INDICES,
3501
- Pr as DEFAULT_MASKING,
3502
- ct as FACE_MASK_SIZE,
3503
- Gt as FACE_OVAL,
3504
- jr as FaceRetouchBackground,
3505
- Kt as HEAD_OCCLUDER_DEFAULT_OPACITY,
3506
- Ce as HEAD_OCCLUDER_DEFAULT_POSITION,
3507
- ne as HEAD_OCCLUDER_DEFAULT_SCALE,
3508
- Yr as HeadBinding,
3509
- $r as HeadBindingOccluder,
3510
- Yt as HeadOccluder,
3511
- Ht as INNER_MOUTH,
3512
- os as LEFT_EYE,
3513
- cs as LEFT_EYEBROW,
3514
- as as OUTER_LIPS,
3515
- is as RIGHT_EYE,
3516
- ls as RIGHT_EYEBROW,
3517
- Br as alphaMapOptions,
3518
- Tt as blendModeIndices,
3519
- Ur as blendModeOptions,
3520
- Zr as computeAdaptiveVerticalFit,
3521
- Er as computeHeadBindingCubePose,
3522
- Qr as computeHeadBindingDebugMetrics,
3523
- vr as computeHeadBindingShape,
3524
- qr as computeUniversalHeadDepthOffset,
3525
- Vr as computeUniversalOccluderScale,
3526
- zr as computeUniversalPitchOffsetY,
3527
- Wr as computeUniversalYawOffsetX,
3528
- Is as createFaceRetouchRegions,
3529
- ds as drawFaceRetouchMask,
3530
- fs as drawMouthRetouchMask,
3531
- Fr as materialTypeOptions,
3532
- Yn as parseCanonicalFaceModel,
3533
- Or as shaderPresetOptions,
3534
- Dr as sideOptions,
3535
- zt as solveHeadBinding,
3536
- Hr as supportsBlendMode,
3537
- Gr as supportsTexturePanel,
3538
- kr as textureMapOptions,
3539
- qn as useCanonicalFaceMesh,
3540
- Xr as useFaceRetouchMask,
3541
- Kr as useFaceRetouchRegions
2280
+ Qn as CANONICAL_FACE_MESH_GEOMETRY_SPECS,
2281
+ Jn as CanonicalFaceMeshRenderer,
2282
+ $n as DEFAULT_APPEARANCE,
2283
+ es as DEFAULT_FACE_MESH_RENDERER,
2284
+ ts as DEFAULT_FACE_MESH_TRANSFORM,
2285
+ Ms as DEFAULT_FACE_WARP_3D_SETTINGS,
2286
+ ns as DEFAULT_MASKING,
2287
+ ss as FACE_MESH_ALPHA_MAPS,
2288
+ rs as FACE_MESH_BLEND_MODES,
2289
+ is as FACE_MESH_MASK_TEXTURE_SOURCES,
2290
+ os as FACE_MESH_MATERIAL_TYPES,
2291
+ as as FACE_MESH_SHADER_PRESETS,
2292
+ cs as FACE_MESH_SIDES,
2293
+ ls as FACE_MESH_TEXTURE_MAPS,
2294
+ ws as FACE_RETOUCH_DEFAULT_CONTROLS,
2295
+ Ss as FACE_RETOUCH_SETTINGS_FIELDS,
2296
+ ys as FACE_WARP_3D_PRESET,
2297
+ us as FaceMeshMaterial,
2298
+ hs as FaceMeshRenderer,
2299
+ Ls as FaceRetouch,
2300
+ ze as HEAD_OCCLUDER_DEFAULT_OPACITY,
2301
+ $ as HEAD_OCCLUDER_DEFAULT_POSITION,
2302
+ U as HEAD_OCCLUDER_DEFAULT_SCALE,
2303
+ vn as HeadBinding,
2304
+ Wn as HeadBindingOccluder,
2305
+ We as HeadOccluder,
2306
+ bs as alphaMapOptions,
2307
+ ds as blendModeIndices,
2308
+ Is as blendModeOptions,
2309
+ fs as canonicalFaceAlphaMaskUrl,
2310
+ ps as canonicalFaceTextureStyle2Url,
2311
+ ms as canonicalFaceTextureUrl,
2312
+ Vn as computeAdaptiveVerticalFit,
2313
+ On as computeHeadBindingCubePose,
2314
+ zn as computeHeadBindingDebugMetrics,
2315
+ Pn as computeHeadBindingShape,
2316
+ Yn as computeUniversalHeadDepthOffset,
2317
+ jn as computeUniversalOccluderScale,
2318
+ Xn as computeUniversalPitchOffsetY,
2319
+ Kn as computeUniversalYawOffsetX,
2320
+ gs as mapFaceMeshRendererSettingsToProps,
2321
+ Ns as materialTypeOptions,
2322
+ As as parseCanonicalFaceModel,
2323
+ Cs as patchFaceRetouchControls,
2324
+ Ts as resolveFaceMeshRendererSettings,
2325
+ Ps as resolveFaceRetouchControls,
2326
+ Fs as shaderPresetOptions,
2327
+ Os as sideOptions,
2328
+ Qe as solveHeadBinding,
2329
+ Es as supportsBlendMode,
2330
+ xs as supportsTexturePanel,
2331
+ Ds as textureMapOptions,
2332
+ Rs as useCanonicalFaceMesh
3542
2333
  };