@vincentt-xr/sdk 2.0.0-alpha.1 → 2.0.0-alpha.11

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 (885) hide show
  1. package/GROUNDING.md +8066 -120
  2. package/README.md +86 -52
  3. package/dist/CanonicalHeadFrame-CZFvPzN_.cjs +1 -0
  4. package/dist/CanonicalHeadFrame-vn-jM9fG.js +1506 -0
  5. package/dist/DebuggerUI-DDpU-nBF.js +275 -0
  6. package/dist/DebuggerUI-Db-1VtQJ.cjs +1 -0
  7. package/dist/FaceRetouch-D2xH5OpW.js +1071 -0
  8. package/dist/FaceRetouch-DHhn1nSV.cjs +134 -0
  9. package/dist/FaceSurface-CHAMEeG1.cjs +1 -0
  10. package/dist/FaceSurface-DmP9AEeC.js +27 -0
  11. package/dist/SkeletonUtils-C2r90MtN.js +21 -0
  12. package/dist/SkeletonUtils-CddIup1F.cjs +1 -0
  13. package/dist/TextLabel-Ctp-a7g9.cjs +2 -0
  14. package/dist/TextLabel-Dgt-uNN9.js +984 -0
  15. package/dist/assets/cache.d.ts +99 -0
  16. package/dist/assets/estimate.d.ts +11 -0
  17. package/dist/assets/gltfLoader.d.ts +16 -0
  18. package/dist/assets/index.d.ts +7 -0
  19. package/dist/assets/loaders.d.ts +43 -0
  20. package/dist/assets/react.d.ts +33 -0
  21. package/dist/assets/sdkModels.d.ts +22 -0
  22. package/dist/audio/AudioEngine.d.ts +3 -1
  23. package/dist/audio/AudioPlayer.d.ts +29 -0
  24. package/dist/audio/AudioPlayerLogic.d.ts +4 -0
  25. package/dist/audio/index.d.ts +2 -0
  26. package/dist/body/__fixtures__/syntheticRig.d.ts +21 -0
  27. package/dist/body/bodyFlipGuard.d.ts +39 -0
  28. package/dist/body/bodyIdentity.d.ts +72 -0
  29. package/dist/body/bodyMask.d.ts +79 -0
  30. package/dist/body/bodyMaskMaterial.d.ts +15 -0
  31. package/dist/body/bodyPose.d.ts +58 -0
  32. package/dist/body/bodyRigFit.d.ts +148 -0
  33. package/dist/body/bodyRigSolver.d.ts +114 -0
  34. package/dist/body/bodySubject.d.ts +46 -0
  35. package/dist/body-pose/index.d.ts +521 -0
  36. package/dist/body-trigger/__fixtures__/syntheticBody.d.ts +83 -0
  37. package/dist/body-trigger/frame.d.ts +88 -0
  38. package/dist/body-trigger/index.d.ts +6 -0
  39. package/dist/body-trigger/moves.d.ts +235 -0
  40. package/dist/body-trigger/trigger.d.ts +75 -0
  41. package/dist/bodyMaskMaterial-C3aXItLo.js +207 -0
  42. package/dist/bodyMaskMaterial-Q6rYywwW.cjs +68 -0
  43. package/dist/cache-C85JjyZA.js +212 -0
  44. package/dist/cache-DFqZYsHC.cjs +1 -0
  45. package/dist/calibration/calibration.d.ts +75 -0
  46. package/dist/calibration/index.d.ts +6 -0
  47. package/dist/calibration/storage.d.ts +13 -0
  48. package/dist/calibration/types.d.ts +53 -0
  49. package/dist/calibration/useXRCalibration.d.ts +46 -0
  50. package/dist/camera/CameraPermissionGate.d.ts +26 -0
  51. package/dist/camera/devices.d.ts +26 -0
  52. package/dist/camera/index.d.ts +8 -0
  53. package/dist/camera/permission.d.ts +86 -0
  54. package/dist/camera/useCameraPermission.d.ts +35 -0
  55. package/dist/canonicalFace-BHwyCx1c.js +9 -0
  56. package/dist/canonicalFace-C83I225R.cjs +1 -0
  57. package/dist/capabilities/detect.d.ts +45 -0
  58. package/dist/capabilities/index.d.ts +5 -0
  59. package/dist/capabilities/types.d.ts +120 -0
  60. package/dist/capabilities/useXRCapabilities.d.ts +18 -0
  61. package/dist/compat/environment.d.ts +5 -0
  62. package/dist/compat/index.d.ts +4 -0
  63. package/dist/compat/run.d.ts +18 -0
  64. package/dist/compat/scenarios.d.ts +10 -0
  65. package/dist/compat/types.d.ts +101 -0
  66. package/dist/components/Axes/index.d.ts +6 -0
  67. package/dist/components/BodyInstruction/BodyPoseHint.d.ts +63 -0
  68. package/dist/components/BodyInstruction/index.d.ts +76 -0
  69. package/dist/components/BodyInstruction/useBodyPose.d.ts +30 -0
  70. package/dist/components/BodyRig/BodyAttachment.d.ts +28 -0
  71. package/dist/components/BodyRig/BodyOccluder.d.ts +27 -0
  72. package/dist/components/BodyRig/bodyDepth.d.ts +57 -0
  73. package/dist/components/BodyRig/index.d.ts +129 -0
  74. package/dist/components/BodyRig/useBodyDepthTexture.d.ts +40 -0
  75. package/dist/components/BodyTracker/index.d.ts +26 -1
  76. package/dist/components/BodyTrigger/index.d.ts +56 -0
  77. package/dist/components/Debugger/DebuggerProvider.d.ts +14 -1
  78. package/dist/components/Debugger/DebuggerUI.d.ts +3 -1
  79. package/dist/components/FaceAtlas/FaceAtlasLayer.d.ts +114 -0
  80. package/dist/components/FaceAtlas/MadeUpCamera.d.ts +80 -0
  81. package/dist/components/FaceAtlas/constants.d.ts +8 -0
  82. package/dist/components/FaceAtlas/index.d.ts +7 -0
  83. package/dist/components/FaceAtlas/useFaceAtlasSurface.d.ts +84 -0
  84. package/dist/components/FaceAtlas/useFaceSkin.d.ts +84 -0
  85. package/dist/components/FaceCharacter/ExternalFaceMesh.d.ts +109 -0
  86. package/dist/components/FaceCharacter/FaceExpressionController.d.ts +53 -0
  87. package/dist/components/FaceCharacter/FaceMorph.d.ts +71 -0
  88. package/dist/components/FaceCharacter/FacePiercing.d.ts +65 -0
  89. package/dist/components/FaceCharacter/FaceReprojection.d.ts +85 -0
  90. package/dist/components/FaceCharacter/FaceRig.d.ts +38 -0
  91. package/dist/components/FaceCharacter/FaceSurface.d.ts +49 -0
  92. package/dist/components/FaceCharacter/FaceSurfaceOccluder.d.ts +39 -0
  93. package/dist/components/FaceCharacter/PinToFaceMesh.d.ts +68 -0
  94. package/dist/components/FaceCharacter/index.d.ts +18 -0
  95. package/dist/components/FaceCharacter/useFaceReprojector.d.ts +10 -0
  96. package/dist/components/FaceInset/FaceInset.d.ts +68 -0
  97. package/dist/components/FaceInset/frame.d.ts +94 -0
  98. package/dist/components/FaceInset/index.d.ts +6 -0
  99. package/dist/components/FaceInset/material.d.ts +40 -0
  100. package/dist/components/FaceInset/useFaceInsetTexture.d.ts +37 -0
  101. package/dist/components/FaceInstruction/FaceExpressionHint.d.ts +43 -0
  102. package/dist/components/FaceInstruction/index.d.ts +56 -0
  103. package/dist/components/FaceInstruction/useFaceExpression.d.ts +20 -0
  104. package/dist/components/FaceLiquify/FaceLiquify.d.ts +49 -0
  105. package/dist/components/FaceLiquify/debug.d.ts +37 -0
  106. package/dist/components/FaceLiquify/frame.d.ts +55 -0
  107. package/dist/components/FaceLiquify/index.d.ts +10 -0
  108. package/dist/components/FaceLiquify/material.d.ts +39 -0
  109. package/dist/components/FaceLiquify/pass.d.ts +49 -0
  110. package/dist/components/FaceLiquify/presence.d.ts +25 -0
  111. package/dist/components/FaceLiquify/presets.d.ts +82 -0
  112. package/dist/components/FaceLiquify/selfTest.d.ts +66 -0
  113. package/dist/components/FaceLiquify/target.d.ts +85 -0
  114. package/dist/components/FaceLiquify/warp.d.ts +72 -0
  115. package/dist/components/FaceMesh/FaceMeshRenderer.d.ts +25 -0
  116. package/dist/components/FaceMesh/canonical/CanonicalFaceMeshRenderer.d.ts +67 -3
  117. package/dist/components/FaceMesh/canonical/FaceMeshMaterial.d.ts +25 -0
  118. package/dist/components/FaceMesh/canonical/assets.d.ts +3 -0
  119. package/dist/components/FaceMesh/canonical/geometryGroups.d.ts +30 -0
  120. package/dist/components/FaceMesh/canonical/parseCanonicalFaceModel.d.ts +24 -0
  121. package/dist/components/FaceMesh/canonical/shaders.d.ts +2 -0
  122. package/dist/components/FaceMesh/deform.d.ts +3 -0
  123. package/dist/components/FaceMesh/index.d.ts +6 -1
  124. package/dist/components/FaceMesh/material/defaults.d.ts +70 -0
  125. package/dist/components/FaceMesh/material/index.d.ts +1 -0
  126. package/dist/components/FaceMesh/material/options.d.ts +5 -1
  127. package/dist/components/FaceMesh/material/support.d.ts +7 -2
  128. package/dist/components/FaceMesh/material/textures.d.ts +4 -0
  129. package/dist/components/FaceMesh/material/types.d.ts +2 -2
  130. package/dist/components/FaceRetouch/Background.d.ts +7 -6
  131. package/dist/components/FaceRetouch/FaceRetouch.d.ts +52 -0
  132. package/dist/components/FaceRetouch/index.d.ts +2 -8
  133. package/dist/components/FaceRetouch/landmarkMask.d.ts +0 -5
  134. package/dist/components/FaceRetouch/renderState.d.ts +19 -0
  135. package/dist/components/FaceRetouch/useFaceRetouchMask.d.ts +3 -7
  136. package/dist/components/FaceSwap/FaceMirror.d.ts +46 -0
  137. package/dist/components/FaceSwap/FaceSwap.d.ts +58 -0
  138. package/dist/components/FaceSwap/FaceTextureLayer.d.ts +72 -0
  139. package/dist/components/FaceSwap/faceSwapPlan.d.ts +91 -0
  140. package/dist/components/FaceSwap/index.d.ts +13 -0
  141. package/dist/components/FaceSwap/settings.d.ts +300 -0
  142. package/dist/components/FaceSwap/useFaceTexture.d.ts +35 -0
  143. package/dist/components/FaceSwap/useLiveFace.d.ts +38 -0
  144. package/dist/components/FaceSwap/useLiveFaceTexture.d.ts +31 -0
  145. package/dist/components/FaceTracker/index.d.ts +5 -3
  146. package/dist/components/FaceWarp3D/FaceWarp3D.d.ts +50 -0
  147. package/dist/components/FaceWarp3D/index.d.ts +2 -3
  148. package/dist/components/Faceless/Faceless.d.ts +51 -0
  149. package/dist/components/Faceless/index.d.ts +2 -0
  150. package/dist/components/GestureListener/index.d.ts +11 -0
  151. package/dist/components/HairLock/HairLock.d.ts +39 -0
  152. package/dist/components/HairLock/index.d.ts +2 -0
  153. package/dist/components/HairLock/lockGeometry.d.ts +15 -0
  154. package/dist/components/HandCutout/index.d.ts +35 -0
  155. package/dist/components/HandEffect/index.d.ts +36 -0
  156. package/dist/components/HandInstruction/HandGestureHint.d.ts +70 -0
  157. package/dist/components/HandInstruction/index.d.ts +74 -0
  158. package/dist/components/HandInstruction/useHandGesture.d.ts +22 -0
  159. package/dist/components/HandJoints2D/index.d.ts +1 -1
  160. package/dist/components/HandRig/ForearmOccluder.d.ts +29 -0
  161. package/dist/components/HandRig/HandAttachment.d.ts +34 -0
  162. package/dist/components/HandRig/HandNails.d.ts +61 -0
  163. package/dist/components/HandRig/HandOccluder.d.ts +45 -0
  164. package/dist/components/HandRig/HandTattoo.d.ts +61 -0
  165. package/dist/components/HandRig/WristAttachment.d.ts +34 -0
  166. package/dist/components/HandRig/index.d.ts +127 -0
  167. package/dist/components/HandRig/useArmMask.d.ts +29 -0
  168. package/dist/components/HandRig/wristSolve.d.ts +96 -0
  169. package/dist/components/HandTouch/HandTouch.d.ts +62 -0
  170. package/dist/components/HandTouch/Touchable.d.ts +36 -0
  171. package/dist/components/HandTouch/index.d.ts +2 -0
  172. package/dist/components/HandTracker/index.d.ts +10 -0
  173. package/dist/components/HandTracking2D/HandVisual.d.ts +1 -1
  174. package/dist/components/HandTracking2D/index.d.ts +1 -1
  175. package/dist/components/HandTracking2DController/index.d.ts +1 -1
  176. package/dist/components/HandTracking3D/index.d.ts +1 -1
  177. package/dist/components/HeadBinding/index.d.ts +14 -0
  178. package/dist/components/HeadOccluder/CanonicalHeadFrame.d.ts +22 -0
  179. package/dist/components/HeadOccluder/Earrings.d.ts +55 -0
  180. package/dist/components/HeadOccluder/HeadAttachment.d.ts +38 -0
  181. package/dist/components/HeadOccluder/NeckOccluder.d.ts +67 -0
  182. package/dist/components/HeadOccluder/earringPlacement.d.ts +31 -0
  183. package/dist/components/HeadOccluder/headAttachmentPoints.d.ts +69 -0
  184. package/dist/components/HeadOccluder/index.d.ts +57 -3
  185. package/dist/components/HeadOccluder/useCanonicalHeadFit.d.ts +36 -0
  186. package/dist/components/HeadOccluder/useLandmarkPoseFit.d.ts +80 -0
  187. package/dist/components/HolisticTracker/index.d.ts +69 -0
  188. package/dist/components/HolisticTracker/settings.d.ts +58 -0
  189. package/dist/components/HolisticTracker/signals.d.ts +49 -0
  190. package/dist/components/Instruction/HintStage.d.ts +29 -0
  191. package/dist/components/Instruction/InstructionCue.d.ts +126 -0
  192. package/dist/components/Instruction/gestureHold.d.ts +20 -0
  193. package/dist/components/Instruction/ghost.d.ts +129 -0
  194. package/dist/components/Instruction/hintBlend.d.ts +19 -0
  195. package/dist/components/Instruction/hintLook.d.ts +81 -0
  196. package/dist/components/Instruction/hintLoop.d.ts +36 -0
  197. package/dist/components/Instruction/index.d.ts +41 -0
  198. package/dist/components/Instruction/useGhostModel.d.ts +33 -0
  199. package/dist/components/Instruction/useInstructionHold.d.ts +72 -0
  200. package/dist/components/IrisEffect/IrisMaterial.d.ts +73 -0
  201. package/dist/components/IrisEffect/index.d.ts +51 -0
  202. package/dist/components/IrisEffect/settings.d.ts +117 -0
  203. package/dist/components/LightObject/index.d.ts +20 -0
  204. package/dist/components/LipEffect/LipEffect.d.ts +28 -0
  205. package/dist/components/LipEffect/LipEffectMaterial.d.ts +98 -0
  206. package/dist/components/LipEffect/LipEffects.d.ts +12 -0
  207. package/dist/components/LipEffect/defaults.d.ts +51 -0
  208. package/dist/components/LipEffect/index.d.ts +12 -0
  209. package/dist/components/LipEffect/lipShading.d.ts +73 -0
  210. package/dist/components/LipEffect/settings.d.ts +375 -0
  211. package/dist/components/LipEffect/shader.d.ts +39 -0
  212. package/dist/components/LipEffect/types.d.ts +141 -0
  213. package/dist/components/LipEffect/useLipDesignTextures.d.ts +17 -0
  214. package/dist/components/LipEffect/uvGuide.d.ts +74 -0
  215. package/dist/components/LookAt/index.d.ts +23 -0
  216. package/dist/components/Makeup/Blush.d.ts +18 -0
  217. package/dist/components/Makeup/Brows.d.ts +20 -0
  218. package/dist/components/Makeup/Contour.d.ts +17 -0
  219. package/dist/components/Makeup/Eyeliner.d.ts +20 -0
  220. package/dist/components/Makeup/Eyeshadow.d.ts +20 -0
  221. package/dist/components/Makeup/Highlighter.d.ts +18 -0
  222. package/dist/components/Makeup/MakeupDesign.d.ts +37 -0
  223. package/dist/components/Makeup/MakeupRegion.d.ts +132 -0
  224. package/dist/components/Makeup/constants.d.ts +44 -0
  225. package/dist/components/Makeup/design.d.ts +106 -0
  226. package/dist/components/Makeup/designSamples.d.ts +42 -0
  227. package/dist/components/Makeup/eyes.d.ts +114 -0
  228. package/dist/components/Makeup/fields.d.ts +10 -0
  229. package/dist/components/Makeup/geometry.d.ts +106 -0
  230. package/dist/components/Makeup/index.d.ts +26 -0
  231. package/dist/components/Makeup/looks.d.ts +28 -0
  232. package/dist/components/Makeup/material.d.ts +239 -0
  233. package/dist/components/Makeup/settings.d.ts +54 -0
  234. package/dist/components/Makeup/shades.d.ts +143 -0
  235. package/dist/components/Makeup/shapes.d.ts +27 -0
  236. package/dist/components/Makeup/skinTone.d.ts +135 -0
  237. package/dist/components/Makeup/types.d.ts +110 -0
  238. package/dist/components/Makeup/useMakeupSkinTone.d.ts +40 -0
  239. package/dist/components/MeshRenderer/index.d.ts +59 -0
  240. package/dist/components/Necklace/Necklace.d.ts +44 -0
  241. package/dist/components/Necklace/index.d.ts +1 -0
  242. package/dist/components/ParticleEmitter/ParticleEmitter.d.ts +69 -0
  243. package/dist/components/ParticleEmitter/index.d.ts +1 -0
  244. package/dist/components/PersonCutout/index.d.ts +46 -0
  245. package/dist/components/PersonCutout/personCutout.d.ts +16 -0
  246. package/dist/components/PersonCutout/personMask.d.ts +19 -0
  247. package/dist/components/PersonCutout/useBodyMaskTexture.d.ts +35 -0
  248. package/dist/components/PerspectiveCamera/index.d.ts +2 -8
  249. package/dist/components/PinToMesh/index.d.ts +47 -0
  250. package/dist/components/RenderGroupLayer/index.d.ts +6 -0
  251. package/dist/components/SceneObjectRenderer/index.d.ts +23 -0
  252. package/dist/components/Screen2D/ScreenTransformFrame.d.ts +11 -0
  253. package/dist/components/Screen2D/ScreenTransformHelpers.d.ts +19 -0
  254. package/dist/components/Screen2D/ScreenTransformInteraction.d.ts +18 -0
  255. package/dist/components/Screen2D/index.d.ts +5 -0
  256. package/dist/components/ScreenGlass/defaults.d.ts +3 -0
  257. package/dist/components/ScreenGlass/index.d.ts +5 -0
  258. package/dist/components/ScreenGlass/shaders.d.ts +2 -0
  259. package/dist/components/ScreenGlass/types.d.ts +10 -0
  260. package/dist/components/ScreenGradient/defaults.d.ts +5 -0
  261. package/dist/components/ScreenGradient/index.d.ts +5 -0
  262. package/dist/components/ScreenGradient/shaders.d.ts +2 -0
  263. package/dist/components/ScreenGradient/types.d.ts +19 -0
  264. package/dist/components/ScreenImage/ScreenImage.d.ts +7 -0
  265. package/dist/components/ScreenImage/components/DynamicTextureSync.d.ts +9 -0
  266. package/dist/components/ScreenImage/components/ScreenImageBody.d.ts +9 -0
  267. package/dist/components/ScreenImage/components/ScreenImageFrame.d.ts +9 -0
  268. package/dist/components/ScreenImage/components/ScreenImageTransformFrame.d.ts +9 -0
  269. package/dist/components/ScreenImage/fit.d.ts +52 -0
  270. package/dist/components/ScreenImage/index.d.ts +10 -87
  271. package/dist/components/ScreenImage/materials/ScreenImageBlendMaterial.d.ts +9 -0
  272. package/dist/components/ScreenImage/materials/ScreenImageMaskMaterial.d.ts +11 -0
  273. package/dist/components/ScreenImage/materials/ScreenImageMatcap.d.ts +3 -0
  274. package/dist/components/ScreenImage/source.d.ts +25 -0
  275. package/dist/components/ScreenImage/types.d.ts +64 -0
  276. package/dist/components/ScreenImage/utils/ScreenImageConstants.d.ts +9 -0
  277. package/dist/components/ScreenImage/utils/ScreenImageHelpers.d.ts +4 -0
  278. package/dist/components/ScreenShape/geometry.d.ts +5 -0
  279. package/dist/components/ScreenShape/index.d.ts +8 -0
  280. package/dist/components/ScreenShape/types.d.ts +54 -0
  281. package/dist/components/ScreenSpaceUI/ScreenTransformGuide.d.ts +15 -0
  282. package/dist/components/ScreenSpaceUI/ScreenTransformOverlayGuide.d.ts +9 -0
  283. package/dist/components/ScreenSpaceUI/index.d.ts +3 -0
  284. package/dist/components/ScreenText/components/ScreenTextBody.d.ts +2 -0
  285. package/dist/components/ScreenText/components/ScreenTextTransformFrame.d.ts +9 -0
  286. package/dist/components/ScreenText/constants.d.ts +5 -0
  287. package/dist/components/ScreenText/index.d.ts +9 -20
  288. package/dist/components/ScreenText/types.d.ts +31 -0
  289. package/dist/components/ScreenText/utils/ScreenTextHelpers.d.ts +14 -0
  290. package/dist/components/ScreenText/utils/ScreenTextMappings.d.ts +17 -0
  291. package/dist/components/SegmentationOverlay/SegmentationOverlay.d.ts +37 -0
  292. package/dist/components/SegmentationOverlay/SegmentationOverlayMaterial.d.ts +31 -0
  293. package/dist/components/SegmentationOverlay/index.d.ts +9 -0
  294. package/dist/components/SegmentationOverlay/maskTexture.d.ts +23 -0
  295. package/dist/components/SegmentationOverlay/providers.d.ts +72 -0
  296. package/dist/components/SegmentationOverlay/settings.d.ts +65 -0
  297. package/dist/components/SequentialRenderPasses/index.d.ts +6 -0
  298. package/dist/components/ShoulderOccluder/index.d.ts +46 -0
  299. package/dist/components/ShoulderOccluder/useCanonicalTorsoFit.d.ts +27 -0
  300. package/dist/components/SpringSwing/SpringSwing.d.ts +22 -0
  301. package/dist/components/SpringSwing/index.d.ts +1 -0
  302. package/dist/components/TextLabel/TextLabel.d.ts +5 -0
  303. package/dist/components/TextLabel/alignment.d.ts +4 -0
  304. package/dist/components/TextLabel/bend.d.ts +9 -0
  305. package/dist/components/TextLabel/canvas/buildTextLabelTexture.d.ts +4 -0
  306. package/dist/components/TextLabel/canvas/canvasTypography.d.ts +13 -0
  307. package/dist/components/TextLabel/canvas/drawBackground.d.ts +21 -0
  308. package/dist/components/TextLabel/canvas/drawEffects.d.ts +34 -0
  309. package/dist/components/TextLabel/canvas/drawText.d.ts +19 -0
  310. package/dist/components/TextLabel/components/TextLabelMesh.d.ts +13 -0
  311. package/dist/components/TextLabel/constants.d.ts +2 -0
  312. package/dist/components/TextLabel/hooks/useTextLabelTexture.d.ts +7 -0
  313. package/dist/components/TextLabel/index.d.ts +2 -161
  314. package/dist/components/TextLabel/layout/measurement.d.ts +8 -0
  315. package/dist/components/TextLabel/layout/resolveTextLayout.d.ts +25 -0
  316. package/dist/components/TextLabel/layout/wrapText.d.ts +6 -0
  317. package/dist/components/TextLabel/types.d.ts +337 -0
  318. package/dist/components/TrackingAnchor/index.d.ts +18 -2
  319. package/dist/components/Transform3D/index.d.ts +30 -0
  320. package/dist/components/XRMediaSurface/index.d.ts +8 -7
  321. package/dist/components/XRProvider/index.d.ts +16 -2
  322. package/dist/components/XRScene/renderOutputTarget.d.ts +12 -0
  323. package/dist/components/XRViewport/XRViewport.d.ts +11 -0
  324. package/dist/components/XRViewport/components/HiddenMedia.d.ts +7 -0
  325. package/dist/components/XRViewport/components/MediaAssetPicker.d.ts +8 -0
  326. package/dist/components/XRViewport/components/MediaControlStack.d.ts +13 -0
  327. package/dist/components/XRViewport/components/XRViewportLayers.d.ts +30 -0
  328. package/dist/components/XRViewport/constants.d.ts +24 -0
  329. package/dist/components/XRViewport/contexts.d.ts +6 -0
  330. package/dist/components/XRViewport/hooks/useViewportExternalFaces.d.ts +13 -0
  331. package/dist/components/XRViewport/hooks/useViewportMediaSource.d.ts +16 -0
  332. package/dist/components/XRViewport/hooks/useViewportMediaTexture.d.ts +10 -0
  333. package/dist/components/XRViewport/hooks/useViewportPipeline.d.ts +41 -0
  334. package/dist/components/XRViewport/hooks/useViewportRenderState.d.ts +47 -0
  335. package/dist/components/XRViewport/index.d.ts +3 -118
  336. package/dist/components/XRViewport/layout.d.ts +16 -0
  337. package/dist/components/XRViewport/slots.d.ts +16 -0
  338. package/dist/components/XRViewport/types.d.ts +89 -0
  339. package/dist/components/XRViewport/useViewportSize.d.ts +3 -0
  340. package/dist/components/index.d.ts +24 -0
  341. package/dist/components/occluder/skinnedOccluder.d.ts +39 -0
  342. package/dist/config/index.d.ts +1 -1
  343. package/dist/constants/index.d.ts +4 -1
  344. package/dist/context-DTxSQvp4.js +13 -0
  345. package/dist/context-hA0Rb2Xa.cjs +1 -0
  346. package/dist/contexts-B5GODwuV.js +667 -0
  347. package/dist/contexts-CSz9stBV.cjs +1 -0
  348. package/dist/coordinates/feed.d.ts +52 -0
  349. package/dist/coordinates/index.d.ts +7 -0
  350. package/dist/coordinates/side.d.ts +40 -0
  351. package/dist/coordinates/spaces.d.ts +49 -0
  352. package/dist/coordinates/viewport.d.ts +32 -0
  353. package/dist/coordinates/world.d.ts +15 -0
  354. package/dist/debug-ui/component-editor/index.d.ts +19 -0
  355. package/dist/debug-ui/default-setting.cjs +2 -2
  356. package/dist/debug-ui/face-mesh-renderer-settings/index.d.ts +8 -0
  357. package/dist/debug-ui/face-retouch/index.d.ts +11 -0
  358. package/dist/debug-ui/face-swap-settings/index.d.ts +22 -0
  359. package/dist/debug-ui/gesture-settings/index.d.ts +14 -0
  360. package/dist/debug-ui/hand-joints-2d/index.d.ts +1 -1
  361. package/dist/debug-ui/hand-tracking-2d/index.d.ts +1 -1
  362. package/dist/debug-ui/hand-tracking-2d-controller/index.d.ts +1 -1
  363. package/dist/debug-ui/hand-tracking-3d/index.d.ts +1 -1
  364. package/dist/debug-ui/hierarchy-panel/index.d.ts +30 -0
  365. package/dist/debug-ui/holistic-tracker-settings/index.d.ts +16 -0
  366. package/dist/debug-ui/index.d.ts +43 -5
  367. package/dist/debug-ui/iris-effect-settings/index.d.ts +12 -0
  368. package/dist/debug-ui/layer-panel/index.d.ts +3 -2
  369. package/dist/debug-ui/lip-effect-settings/index.d.ts +15 -0
  370. package/dist/debug-ui/media-source/index.d.ts +4 -2
  371. package/dist/debug-ui/media-source/media-preset.d.ts +12 -0
  372. package/dist/debug-ui/media-source/session.d.ts +40 -0
  373. package/dist/debug-ui/media-source.cjs +1 -1
  374. package/dist/debug-ui/media-source.js +8 -4
  375. package/dist/debug-ui/mesh-renderer-settings/index.d.ts +6 -0
  376. package/dist/debug-ui/object-inspector-panel/index.d.ts +26 -0
  377. package/dist/debug-ui/pin-to-mesh-settings/index.d.ts +10 -0
  378. package/dist/debug-ui/product-hotspots/index.d.ts +25 -0
  379. package/dist/debug-ui/scene-editor/context.d.ts +38 -0
  380. package/dist/debug-ui/scene-editor/hierarchy-panel.d.ts +11 -0
  381. package/dist/debug-ui/scene-editor/index.d.ts +11 -0
  382. package/dist/debug-ui/scene-editor/inspector-panel.d.ts +9 -0
  383. package/dist/debug-ui/scene-editor/store-utils.d.ts +2 -0
  384. package/dist/debug-ui/scene-editor/viewport-toolbar.d.ts +4 -0
  385. package/dist/debug-ui/scene-editor/viewport.d.ts +21 -0
  386. package/dist/debug-ui/screen-glass-settings/index.d.ts +6 -0
  387. package/dist/debug-ui/screen-gradient-settings/GradientStopsEditor.d.ts +5 -0
  388. package/dist/debug-ui/screen-gradient-settings/index.d.ts +6 -0
  389. package/dist/debug-ui/screen-gradient-settings/styles.d.ts +3 -0
  390. package/dist/debug-ui/screen-image-settings/index.d.ts +6 -2
  391. package/dist/debug-ui/screen-shape-settings/index.d.ts +6 -0
  392. package/dist/debug-ui/screen-text-settings/NumberField.d.ts +9 -0
  393. package/dist/debug-ui/screen-text-settings/ScreenTextSettingsPanel.d.ts +3 -0
  394. package/dist/debug-ui/screen-text-settings/controls/NestedSection.d.ts +7 -0
  395. package/dist/debug-ui/screen-text-settings/controls/Section.d.ts +8 -0
  396. package/dist/debug-ui/screen-text-settings/controls/icons.d.ts +4 -0
  397. package/dist/debug-ui/screen-text-settings/index.d.ts +2 -122
  398. package/dist/debug-ui/screen-text-settings/sections/BackgroundSection.d.ts +8 -0
  399. package/dist/debug-ui/screen-text-settings/sections/ContentSection.d.ts +5 -0
  400. package/dist/debug-ui/screen-text-settings/sections/EffectsSection.d.ts +25 -0
  401. package/dist/debug-ui/screen-text-settings/sections/StyleSection.d.ts +5 -0
  402. package/dist/debug-ui/screen-text-settings/sections/TransformSection.d.ts +5 -0
  403. package/dist/debug-ui/screen-text-settings/sections/background/BackgroundFillControls.d.ts +2 -0
  404. package/dist/debug-ui/screen-text-settings/sections/background/BackgroundSizeControls.d.ts +2 -0
  405. package/dist/debug-ui/screen-text-settings/sections/background/BackgroundStrokeControls.d.ts +2 -0
  406. package/dist/debug-ui/screen-text-settings/sections/background/types.d.ts +7 -0
  407. package/dist/debug-ui/screen-text-settings/sections/effects/BendEffectSection.d.ts +4 -0
  408. package/dist/debug-ui/screen-text-settings/sections/effects/EffectChrome.d.ts +21 -0
  409. package/dist/debug-ui/screen-text-settings/sections/effects/GlowEffectSection.d.ts +4 -0
  410. package/dist/debug-ui/screen-text-settings/sections/effects/InnerShadowEffectSection.d.ts +4 -0
  411. package/dist/debug-ui/screen-text-settings/sections/effects/OutlineEffectSection.d.ts +4 -0
  412. package/dist/debug-ui/screen-text-settings/sections/effects/ShadowEffectSection.d.ts +4 -0
  413. package/dist/debug-ui/screen-text-settings/sections/effects/types.d.ts +14 -0
  414. package/dist/debug-ui/screen-text-settings/settings.d.ts +90 -0
  415. package/dist/debug-ui/screen-text-settings/styles.d.ts +26 -0
  416. package/dist/debug-ui/screen-text-settings/transform.d.ts +6 -0
  417. package/dist/debug-ui/screen-text-settings/types.d.ts +11 -0
  418. package/dist/debug-ui/segmentation-overlay-settings/index.d.ts +12 -0
  419. package/dist/debug-ui/settings-panel/index.d.ts +6 -1
  420. package/dist/debug-ui/shared/ScreenTransformSection.d.ts +6 -3
  421. package/dist/debug-ui/shared/debugWindow.d.ts +51 -0
  422. package/dist/debug-ui/transform-3d-settings/index.d.ts +11 -0
  423. package/dist/debug-ui/xr-diagnostics/index.d.ts +26 -0
  424. package/dist/debug-ui.cjs +3 -13
  425. package/dist/debug-ui.js +8166 -5178
  426. package/dist/detector-K8aej4MB.js +59 -0
  427. package/dist/detector-ijypGtse.cjs +1 -0
  428. package/dist/drawNormalizedCrop-BLfB484W.js +135 -0
  429. package/dist/drawNormalizedCrop-DaGT5mZ5.cjs +1 -0
  430. package/dist/entries/all.d.ts +4 -1
  431. package/dist/entries/core.d.ts +74 -8
  432. package/dist/entries/face-effects.d.ts +130 -12
  433. package/dist/entries/instructions.d.ts +48 -0
  434. package/dist/entries/internal.d.ts +5 -2
  435. package/dist/entries/low-level.d.ts +101 -6
  436. package/dist/entries/particles.d.ts +15 -0
  437. package/dist/entries/product.d.ts +11 -0
  438. package/dist/entries/scene-object.d.ts +10 -0
  439. package/dist/entries/tracking.d.ts +110 -2
  440. package/dist/face-action/index.d.ts +34 -0
  441. package/dist/face-atlas/attributes.d.ts +30 -0
  442. package/dist/face-atlas/eyes.d.ts +272 -0
  443. package/dist/face-atlas/faceAtlas.generated.d.ts +46 -0
  444. package/dist/face-atlas/glsl/atlasVertex.d.ts +46 -0
  445. package/dist/face-atlas/glsl/common.d.ts +55 -0
  446. package/dist/face-atlas/glsl/design.d.ts +49 -0
  447. package/dist/face-atlas/glsl/eyes.d.ts +73 -0
  448. package/dist/face-atlas/glsl/finish.d.ts +24 -0
  449. package/dist/face-atlas/glsl/format.d.ts +4 -0
  450. package/dist/face-atlas/glsl/index.d.ts +59 -0
  451. package/dist/face-atlas/glsl/shading.d.ts +15 -0
  452. package/dist/face-atlas/glsl/shapes.d.ts +66 -0
  453. package/dist/face-atlas/glsl/sparkle.d.ts +19 -0
  454. package/dist/face-atlas/glsl/uniforms.d.ts +106 -0
  455. package/dist/face-atlas/guide.d.ts +51 -0
  456. package/dist/face-atlas/index.d.ts +25 -0
  457. package/dist/face-atlas/lead.d.ts +117 -0
  458. package/dist/face-atlas/madeUpCamera.d.ts +125 -0
  459. package/dist/face-atlas/masks.d.ts +53 -0
  460. package/dist/face-atlas/obj.d.ts +69 -0
  461. package/dist/face-atlas/polylines.d.ts +63 -0
  462. package/dist/face-atlas/probe/FaceSkinProbe.d.ts +208 -0
  463. package/dist/face-atlas/probe/__fixtures__/emulate.d.ts +9 -0
  464. package/dist/face-atlas/probe/__fixtures__/face.d.ts +24 -0
  465. package/dist/face-atlas/probe/constants.d.ts +137 -0
  466. package/dist/face-atlas/probe/glsl.d.ts +43 -0
  467. package/dist/face-atlas/probe/lightFit.d.ts +108 -0
  468. package/dist/face-atlas/probe/schedule.d.ts +44 -0
  469. package/dist/face-atlas/probe/selfTest.d.ts +87 -0
  470. package/dist/face-atlas/probe/stats.d.ts +143 -0
  471. package/dist/face-atlas/probe/targets.d.ts +70 -0
  472. package/dist/face-atlas/probe/unwrap.d.ts +76 -0
  473. package/dist/face-atlas/quality.d.ts +28 -0
  474. package/dist/face-atlas/regions.d.ts +31 -0
  475. package/dist/face-atlas/registry.d.ts +252 -0
  476. package/dist/face-atlas/renderState.d.ts +86 -0
  477. package/dist/face-atlas/selfOcclusion.d.ts +62 -0
  478. package/dist/face-atlas/shading.d.ts +406 -0
  479. package/dist/face-atlas/shapes.d.ts +86 -0
  480. package/dist/face-atlas/sides.d.ts +41 -0
  481. package/dist/face-atlas/skinMask.d.ts +35 -0
  482. package/dist/face-atlas/surface.d.ts +155 -0
  483. package/dist/face-atlas/topology.d.ts +44 -0
  484. package/dist/face-attribute-expression/index.d.ts +10 -0
  485. package/dist/face-character/__fixtures__/faceImageDetections.d.ts +25 -0
  486. package/dist/face-character/__fixtures__/faceNode.d.ts +22 -0
  487. package/dist/face-character/bindFaceModel.d.ts +106 -0
  488. package/dist/face-character/canonicalFace.d.ts +17 -0
  489. package/dist/face-character/canonicalFaceGeometry.d.ts +11 -0
  490. package/dist/face-character/canonicalFacePositions.d.ts +7 -0
  491. package/dist/face-character/driveFaceModel.d.ts +57 -0
  492. package/dist/face-character/expressionOutputs.d.ts +45 -0
  493. package/dist/face-character/faceExpressions.d.ts +104 -0
  494. package/dist/face-character/faceImageLandmarker.d.ts +93 -0
  495. package/dist/face-character/faceMeshBinding.d.ts +62 -0
  496. package/dist/face-character/faceMorph.d.ts +77 -0
  497. package/dist/face-character/faceMorphs.d.ts +46 -0
  498. package/dist/face-character/facePhoto.d.ts +138 -0
  499. package/dist/face-character/facePiercings.d.ts +116 -0
  500. package/dist/face-character/facePin.d.ts +131 -0
  501. package/dist/face-character/faceReprojection.d.ts +273 -0
  502. package/dist/face-character/faceReprojector.d.ts +171 -0
  503. package/dist/face-character/faceRig.d.ts +176 -0
  504. package/dist/face-character/faceSwapPresence.d.ts +85 -0
  505. package/dist/face-character/faceTexture.d.ts +169 -0
  506. package/dist/face-character/faceTextureBaker.d.ts +86 -0
  507. package/dist/face-character/faceTextureGuide.d.ts +106 -0
  508. package/dist/face-character/faceTextureStats.d.ts +298 -0
  509. package/dist/face-character/faceTransfer.d.ts +396 -0
  510. package/dist/face-character/faceTransferGeometry.d.ts +109 -0
  511. package/dist/face-character/faceTransferSelfTest.d.ts +94 -0
  512. package/dist/face-character/faceWarp3D.d.ts +101 -0
  513. package/dist/face-character/faceless.d.ts +79 -0
  514. package/dist/face-character/featureWarp.d.ts +28 -0
  515. package/dist/face-character/liveFaceRegistry.d.ts +370 -0
  516. package/dist/face-character/liveValue.d.ts +12 -0
  517. package/dist/face-character/memo.d.ts +15 -0
  518. package/dist/face-effects.cjs +2271 -289
  519. package/dist/face-effects.js +14240 -3562
  520. package/dist/face-expression/index.d.ts +182 -0
  521. package/dist/face-info/blendshapes.d.ts +3 -0
  522. package/dist/face-info/derive.d.ts +8 -0
  523. package/dist/face-info/drawFaceCrop.d.ts +10 -0
  524. package/dist/face-info/getFaceInfo.d.ts +8 -0
  525. package/dist/face-info/index.d.ts +8 -0
  526. package/dist/face-info/landmarks.d.ts +35 -0
  527. package/dist/face-info/types.d.ts +69 -0
  528. package/dist/footage-input/index.d.ts +46 -0
  529. package/dist/gestures/definitions.d.ts +98 -0
  530. package/dist/gestures/detector.d.ts +87 -0
  531. package/dist/gestures/index.d.ts +8 -0
  532. package/dist/gestures/measures.d.ts +114 -0
  533. package/dist/gestures/settings.d.ts +49 -0
  534. package/dist/getFaceInfo-BbcKq8PJ.cjs +1 -0
  535. package/dist/getFaceInfo-D_tCSQC7.js +62 -0
  536. package/dist/hand/armFit.d.ts +46 -0
  537. package/dist/hand/armMask.d.ts +190 -0
  538. package/dist/hand/forearm.d.ts +114 -0
  539. package/dist/hand/handCutout.d.ts +23 -0
  540. package/dist/hand/handCutoutRegistry.d.ts +7 -0
  541. package/dist/hand/handEffect.d.ts +38 -0
  542. package/dist/hand/handGestures.d.ts +524 -0
  543. package/dist/{handJoints2d.d.ts → hand/handJoints2d.d.ts} +1 -1
  544. package/dist/hand/handNail.d.ts +73 -0
  545. package/dist/hand/handPose.d.ts +98 -0
  546. package/dist/hand/handRigSolver.d.ts +159 -0
  547. package/dist/hand/handTattoo.d.ts +81 -0
  548. package/dist/hand/handTouch.d.ts +240 -0
  549. package/dist/{handTracking2d.d.ts → hand/handTracking2d.d.ts} +1 -1
  550. package/dist/{handTracking2dController.d.ts → hand/handTracking2dController.d.ts} +1 -1
  551. package/dist/{handTracking3d.d.ts → hand/handTracking3d.d.ts} +1 -1
  552. package/dist/hand/nailImageMask.d.ts +40 -0
  553. package/dist/hand/nailMaskFingers.d.ts +23 -0
  554. package/dist/hand/nailTipRefine.d.ts +37 -0
  555. package/dist/hand/wrist.d.ts +44 -0
  556. package/dist/hand/wristFilter.d.ts +44 -0
  557. package/dist/hooks/faceResults.d.ts +1 -1
  558. package/dist/hooks/selectors.d.ts +77 -4
  559. package/dist/hooks/useBodies.d.ts +39 -0
  560. package/dist/hooks/useCalibrationFaceTracker.d.ts +1 -1
  561. package/dist/hooks/useFaceAction.d.ts +3 -0
  562. package/dist/hooks/useFaceAttributeExpression.d.ts +16 -0
  563. package/dist/hooks/useFaceDetection.d.ts +18 -0
  564. package/dist/hooks/useFaceInfo.d.ts +19 -0
  565. package/dist/hooks/useFaceInfos.d.ts +15 -0
  566. package/dist/hooks/useFaceModelAcquisition.d.ts +38 -0
  567. package/dist/hooks/useFaceResultReader.d.ts +10 -0
  568. package/dist/hooks/useFrameCapture.d.ts +18 -0
  569. package/dist/hooks/useGesture.d.ts +39 -0
  570. package/dist/hooks/useIrisTracking.d.ts +45 -0
  571. package/dist/hooks/useMediaRecorder.d.ts +14 -2
  572. package/dist/hooks/useOwnedTexture.d.ts +6 -0
  573. package/dist/hooks/useTrackerContext.d.ts +14 -2
  574. package/dist/hooks/useXRDiagnostics.d.ts +81 -0
  575. package/dist/hooks/useXRModel.d.ts +12 -0
  576. package/dist/hooks/useXRSession/facade.d.ts +47 -2
  577. package/dist/hooks/useXRSession/index.d.ts +2 -2
  578. package/dist/hooks/useXRSession/reason.d.ts +21 -0
  579. package/dist/hooks/useXRSession/registry.d.ts +23 -0
  580. package/dist/hooks/useXRSession/store.d.ts +64 -7
  581. package/dist/index-B9DdHE4u.js +442 -0
  582. package/dist/index-Bxb_UcfF.cjs +46 -0
  583. package/dist/index-CNt8esFO.js +240 -0
  584. package/dist/index-CTqQJj5p.js +3814 -0
  585. package/dist/index-CXaj3tOT.js +1108 -0
  586. package/dist/index-CYwAL_d7.cjs +21 -0
  587. package/dist/index-CelqbDSR.cjs +1 -0
  588. package/dist/index-D10O6vqR.js +190 -0
  589. package/dist/index-DIYaENN3.cjs +1 -0
  590. package/dist/index-DlP4xxaT.js +188 -0
  591. package/dist/index-DzdKBXGE.cjs +1 -0
  592. package/dist/index-J3Qy6hi3.cjs +1 -0
  593. package/dist/index-LC2Xs08E.cjs +1 -0
  594. package/dist/index-WkEZBuB4.js +1432 -0
  595. package/dist/instructions.cjs +30 -0
  596. package/dist/instructions.js +1528 -0
  597. package/dist/internal-DS8Pdlsm.cjs +1 -0
  598. package/dist/{internal-Cae1ps15.js → internal-TD4QhIry.js} +152 -127
  599. package/dist/internal.cjs +1 -1
  600. package/dist/internal.js +16 -9
  601. package/dist/iris/compute.d.ts +27 -0
  602. package/dist/iris/index.d.ts +4 -0
  603. package/dist/iris/lead.d.ts +19 -0
  604. package/dist/iris/types.d.ts +89 -0
  605. package/dist/landmarkMask-CvN-L5NT.cjs +1 -0
  606. package/dist/landmarkMask-DHivVjJm.js +225 -0
  607. package/dist/landmarks-BP6RbRHN.cjs +1 -0
  608. package/dist/landmarks-vLy5QKt6.js +76 -0
  609. package/dist/low-level.cjs +1 -1
  610. package/dist/low-level.js +1766 -85
  611. package/dist/main.cjs +1 -73
  612. package/dist/main.js +1299 -1713
  613. package/dist/material/MaterialFill.d.ts +20 -0
  614. package/dist/material/MeshMaterial.d.ts +14 -0
  615. package/dist/material/index.d.ts +2 -0
  616. package/dist/models/Base/index.d.ts +49 -0
  617. package/dist/models/Body/index.d.ts +30 -1
  618. package/dist/models/Face/constants.d.ts +8 -0
  619. package/dist/models/Face/index.d.ts +5 -12
  620. package/dist/models/Face/rotation.d.ts +18 -0
  621. package/dist/models/Hand/GestureTracking.d.ts +1 -1
  622. package/dist/models/Hand/HandTracking.d.ts +17 -1
  623. package/dist/models/Holistic/index.d.ts +49 -0
  624. package/dist/models/Holistic/result.d.ts +68 -0
  625. package/dist/models/Segmentation/index.d.ts +6 -3
  626. package/dist/models/SemanticSegmentation/index.d.ts +31 -0
  627. package/dist/models/SemanticSegmentation/presets.d.ts +28 -0
  628. package/dist/models/index.d.ts +2 -0
  629. package/dist/models/nodeSource.d.ts +9 -0
  630. package/dist/particles/emission.d.ts +24 -0
  631. package/dist/particles/eyes.d.ts +24 -0
  632. package/dist/particles/glsl.d.ts +14 -0
  633. package/dist/particles/index.d.ts +10 -0
  634. package/dist/particles/motion.d.ts +42 -0
  635. package/dist/particles/presets.d.ts +12 -0
  636. package/dist/particles/ring.d.ts +58 -0
  637. package/dist/particles/selfTest.d.ts +53 -0
  638. package/dist/particles/settings.d.ts +127 -0
  639. package/dist/particles/shapes.d.ts +29 -0
  640. package/dist/particles/spawner.d.ts +71 -0
  641. package/dist/particles/system.d.ts +66 -0
  642. package/dist/particles.cjs +122 -0
  643. package/dist/particles.js +999 -0
  644. package/dist/product/ProductDimensions.d.ts +16 -0
  645. package/dist/product/ProductHotspot.d.ts +16 -0
  646. package/dist/product/ProductViewer.d.ts +9 -0
  647. package/dist/product/details.d.ts +53 -0
  648. package/dist/product/index.d.ts +14 -0
  649. package/dist/product/loadModelViewer.d.ts +4 -0
  650. package/dist/product/types.d.ts +71 -0
  651. package/dist/product/useProductAr.d.ts +37 -0
  652. package/dist/product/useProductDetails.d.ts +60 -0
  653. package/dist/product.cjs +1 -0
  654. package/dist/product.js +414 -0
  655. package/dist/providers-BRSbw214.cjs +62 -0
  656. package/dist/providers-DmJlgrDD.js +424 -0
  657. package/dist/quality/XRQualityController.d.ts +25 -0
  658. package/dist/quality/controller.d.ts +33 -0
  659. package/dist/quality/index.d.ts +6 -0
  660. package/dist/quality/types.d.ts +100 -0
  661. package/dist/quality/useXRQuality.d.ts +28 -0
  662. package/dist/render/renderGroups.d.ts +47 -0
  663. package/dist/render/renderPasses.d.ts +26 -0
  664. package/dist/render/sceneBeforeRender.d.ts +12 -0
  665. package/dist/renderGroups-B0N58SIA.cjs +1 -0
  666. package/dist/renderGroups-BcQYy_J2.js +152 -0
  667. package/dist/renderPasses-Bt8k0dkm.cjs +158 -0
  668. package/dist/renderPasses-DIPTIU_x.js +1290 -0
  669. package/dist/renderState-CJNmj5jz.js +39 -0
  670. package/dist/renderState-apSfg4eR.cjs +1 -0
  671. package/dist/scene-object/index.d.ts +146 -0
  672. package/dist/scene-object/runtimeRegistry.d.ts +14 -0
  673. package/dist/scene-object.cjs +1 -0
  674. package/dist/scene-object.js +40 -0
  675. package/dist/{screenImageSettings.d.ts → screen-image/screenImageSettings.d.ts} +9 -2
  676. package/dist/{screenTextSettings.d.ts → screen-text/screenTextSettings.d.ts} +18 -2
  677. package/dist/screen2d/coordinates.d.ts +144 -0
  678. package/dist/screen2d/index.d.ts +3 -0
  679. package/dist/screen2d/screenTransform.d.ts +60 -0
  680. package/dist/screen2d/smoothing.d.ts +5 -0
  681. package/dist/segmentation-CZs5aVvY.js +1911 -0
  682. package/dist/segmentation-Cz7oeNcS.cjs +1 -0
  683. package/dist/segmentation2d/faceMemory.d.ts +28 -0
  684. package/dist/segmentation2d/faceRegions.d.ts +24 -0
  685. package/dist/segmentation2d/index.d.ts +9 -0
  686. package/dist/segmentation2d/maskUv.d.ts +23 -0
  687. package/dist/segmentation2d/rasterize.d.ts +14 -0
  688. package/dist/segmentation2d/types.d.ts +52 -0
  689. package/dist/selectors-Bq6tSgOY.cjs +1 -0
  690. package/dist/selectors-K5JKCWxw.js +196 -0
  691. package/dist/services/MetricsCollector/index.d.ts +7 -1
  692. package/dist/services/MetricsCollector/utils.d.ts +1 -1
  693. package/dist/session-3aCMNb8W.cjs +31 -0
  694. package/dist/session-DHBNTyJJ.js +493 -0
  695. package/dist/settings-BJ7FMBsO.js +111 -0
  696. package/dist/settings-C63FMBlF.cjs +1 -0
  697. package/dist/similarityFit-BFqHND2e.cjs +1 -0
  698. package/dist/similarityFit-Bbz-R8AY.js +91 -0
  699. package/dist/spring/index.d.ts +2 -0
  700. package/dist/spring/spring.d.ts +69 -0
  701. package/dist/spring/swing.d.ts +54 -0
  702. package/dist/subjects/index.d.ts +2 -0
  703. package/dist/subjects/select.d.ts +70 -0
  704. package/dist/subjects/types.d.ts +59 -0
  705. package/dist/texture/animatedTexture.d.ts +63 -0
  706. package/dist/texture/animationMath.d.ts +8 -0
  707. package/dist/texture/gifReader.d.ts +17 -0
  708. package/dist/texture/gifTextureSource.d.ts +16 -0
  709. package/dist/texture/sourceResolver.d.ts +30 -0
  710. package/dist/textures-BVwo9Z7z.js +38 -0
  711. package/dist/textures-DAfc61zz.cjs +1 -0
  712. package/dist/tracking/coordinates.d.ts +5 -0
  713. package/dist/tracking-config/apply.d.ts +57 -0
  714. package/dist/tracking-config/index.d.ts +7 -0
  715. package/dist/tracking-config/resolve.d.ts +25 -0
  716. package/dist/tracking-config/storage.d.ts +8 -0
  717. package/dist/tracking-config/types.d.ts +106 -0
  718. package/dist/tracking-config/useXRTrackingConfig.d.ts +38 -0
  719. package/dist/tracking.cjs +10 -1
  720. package/dist/tracking.js +1529 -317
  721. package/dist/trigger-BwZ81ENx.js +3726 -0
  722. package/dist/trigger-UjeJY5uh.cjs +147 -0
  723. package/dist/types/common.d.ts +11 -1
  724. package/dist/types/compositor.d.ts +21 -0
  725. package/dist/types/face.d.ts +21 -14
  726. package/dist/types/gesture-tracking.d.ts +2 -2
  727. package/dist/types/hand-tracking.d.ts +12 -3
  728. package/dist/types/holistic.d.ts +121 -0
  729. package/dist/types/index.d.ts +1 -1
  730. package/dist/types/model.d.ts +22 -2
  731. package/dist/types/nodes.d.ts +81 -6
  732. package/dist/types/segmentation.d.ts +26 -0
  733. package/dist/types/session.d.ts +50 -4
  734. package/dist/types/tracking.d.ts +8 -2
  735. package/dist/types/util-types.d.ts +1 -1
  736. package/dist/useBodies-BMKHXAOL.js +75 -0
  737. package/dist/useBodies-CXomEo0i.cjs +1 -0
  738. package/dist/useFaceInfo-BEMMiZxw.cjs +1 -0
  739. package/dist/useFaceInfo-BNVdnprN.js +75 -0
  740. package/dist/useFaceResultReader-B15wn6RB.js +61 -0
  741. package/dist/useFaceResultReader-D9qibKmm.cjs +1 -0
  742. package/dist/useInstructionHold-DOu-RpCM.js +53 -0
  743. package/dist/useInstructionHold-DwJY1Alr.cjs +1 -0
  744. package/dist/useIrisTracking-CYm-KDIZ.js +6190 -0
  745. package/dist/useIrisTracking-DExhnhlt.cjs +35 -0
  746. package/dist/useLandmarkPoseFit-Bg-h9BPb.cjs +1 -0
  747. package/dist/useLandmarkPoseFit-Bmb3h6Mw.js +87 -0
  748. package/dist/useXRCapabilities-ClWlG5_Y.js +30 -0
  749. package/dist/useXRCapabilities-D-EhcDzM.cjs +1 -0
  750. package/dist/utils/canonicalRigidLandmarks.d.ts +8 -0
  751. package/dist/utils/drawNormalizedCrop.d.ts +22 -0
  752. package/dist/utils/fns.d.ts +6 -3
  753. package/dist/utils/headOccluderFit.d.ts +42 -0
  754. package/dist/utils/integrity.d.ts +25 -26
  755. package/dist/utils/landmarkBounds.d.ts +1 -1
  756. package/dist/utils/logger.d.ts +2 -2
  757. package/dist/utils/resolveNumFaces.d.ts +13 -0
  758. package/dist/utils/shoulderOccluderFit.d.ts +38 -0
  759. package/dist/utils/similarityFit.d.ts +23 -0
  760. package/dist/utils/updateThrottle.d.ts +2 -0
  761. package/dist/utils/useEditOverrides.d.ts +26 -0
  762. package/dist/utils/useStableUniforms.d.ts +18 -0
  763. package/dist/utils/visionWasm.d.ts +18 -0
  764. package/dist/uv-BMFt19bg.cjs +1 -0
  765. package/dist/{index-BGNbrc4C.js → uv-DJU_XfmN.js} +15 -156
  766. package/docs/MIGRATION_GUIDE.md +589 -0
  767. package/docs/SDK_DOCUMENTATION.md +1157 -0
  768. package/docs/api/adaptive-quality.mdx +104 -0
  769. package/docs/api/asset-lifecycle.mdx +78 -0
  770. package/docs/api/audio.mdx +36 -0
  771. package/docs/api/behavior-components.mdx +164 -0
  772. package/docs/api/body-instructions.mdx +287 -0
  773. package/docs/api/body-rig.mdx +384 -0
  774. package/docs/api/body-triggers.mdx +235 -0
  775. package/docs/api/camera-permission.mdx +142 -0
  776. package/docs/api/capture-recording.mdx +111 -0
  777. package/docs/api/coordinate-spaces.mdx +168 -0
  778. package/docs/api/cross-camera.mdx +89 -0
  779. package/docs/api/debug-ui-scene-editor.mdx +270 -0
  780. package/docs/api/diagnostics-calibration.mdx +97 -0
  781. package/docs/api/external-face-mesh.mdx +231 -0
  782. package/docs/api/face-actions.mdx +108 -0
  783. package/docs/api/face-attribute-expression.mdx +87 -0
  784. package/docs/api/face-binding-anchors.mdx +55 -0
  785. package/docs/api/face-character.mdx +157 -0
  786. package/docs/api/face-effects.mdx +28 -0
  787. package/docs/api/face-expression-controller.mdx +153 -0
  788. package/docs/api/face-info.mdx +118 -0
  789. package/docs/api/face-inset.mdx +204 -0
  790. package/docs/api/face-instructions.mdx +183 -0
  791. package/docs/api/face-liquify.mdx +196 -0
  792. package/docs/api/face-mesh.mdx +130 -0
  793. package/docs/api/face-morph.mdx +117 -0
  794. package/docs/api/face-painting.mdx +40 -0
  795. package/docs/api/face-reprojection.mdx +154 -0
  796. package/docs/api/face-retouching.mdx +81 -0
  797. package/docs/api/face-swap.mdx +350 -0
  798. package/docs/api/face-warp-3d.mdx +166 -0
  799. package/docs/api/faceless.mdx +143 -0
  800. package/docs/api/gestures.mdx +210 -0
  801. package/docs/api/hair.mdx +97 -0
  802. package/docs/api/hand-instructions.mdx +222 -0
  803. package/docs/api/hand-rig.mdx +661 -0
  804. package/docs/api/hand-touch.mdx +162 -0
  805. package/docs/api/head-occluder.mdx +563 -0
  806. package/docs/api/holistic-tracker.mdx +164 -0
  807. package/docs/api/instructions.mdx +323 -0
  808. package/docs/api/iris-tracking.mdx +247 -0
  809. package/docs/api/made-up-camera.mdx +131 -0
  810. package/docs/api/makeup-skin-tone.mdx +135 -0
  811. package/docs/api/makeup.mdx +353 -0
  812. package/docs/api/material-render-state.mdx +132 -0
  813. package/docs/api/multi-subject.mdx +185 -0
  814. package/docs/api/particles.mdx +183 -0
  815. package/docs/api/person-cutout.mdx +171 -0
  816. package/docs/api/pin-to-face-mesh.mdx +274 -0
  817. package/docs/api/product-ar.mdx +114 -0
  818. package/docs/api/product-details.mdx +78 -0
  819. package/docs/api/runtime-3d.mdx +316 -0
  820. package/docs/api/scene-object-store.mdx +213 -0
  821. package/docs/api/screen-image.mdx +67 -0
  822. package/docs/api/screen-shape.mdx +64 -0
  823. package/docs/api/screen-space-coordinates.mdx +83 -0
  824. package/docs/api/screen-text.mdx +39 -0
  825. package/docs/api/segmentation-overlay.mdx +301 -0
  826. package/docs/api/session-lifecycle.mdx +165 -0
  827. package/docs/api/texture-sources.mdx +74 -0
  828. package/docs/api/trackers.mdx +65 -0
  829. package/docs/api/tracking-config.mdx +108 -0
  830. package/docs/docs.json +121 -0
  831. package/docs/examples/lip-shaders.mdx +273 -0
  832. package/docs/examples/scene-object-recipes.mdx +194 -0
  833. package/docs/guides/face-atlas-template.svg +1 -0
  834. package/docs/guides/face-atlas-textures.mdx +186 -0
  835. package/docs/guides/face-texture-template.svg +1 -0
  836. package/docs/guides/harness-debug-ui.mdx +139 -0
  837. package/docs/guides/lip-effect-textures.mdx +368 -0
  838. package/docs/guides/lip-uv-template.png +0 -0
  839. package/docs/guides/lip-uv-template.svg +1 -0
  840. package/docs/guides/makeup-design-textures.mdx +109 -0
  841. package/docs/inspector/hierarchy-panel.mdx +51 -0
  842. package/docs/inspector/object-inspector-panel.mdx +51 -0
  843. package/docs/introduction.mdx +120 -0
  844. package/docs/scene-objects/overview.mdx +127 -0
  845. package/docs/scene-objects/render-groups.mdx +77 -0
  846. package/docs/scene-objects/runtime-rendering.mdx +75 -0
  847. package/docs/texture-api-consumer.md +84 -0
  848. package/package.json +69 -9
  849. package/settings.json +2049 -0
  850. package/dist/DebuggerUI-CatYc-RG.cjs +0 -1
  851. package/dist/DebuggerUI-gLMKiVwJ.js +0 -269
  852. package/dist/MediaSourceSwitcher-C-xYg0nQ.js +0 -317
  853. package/dist/MediaSourceSwitcher-Cq3g4IKw.cjs +0 -31
  854. package/dist/components/FaceRetouch/defaults.d.ts +0 -13
  855. package/dist/components/FaceRetouch/retouchRegions.d.ts +0 -23
  856. package/dist/components/FaceRetouch/useFaceRetouchRegions.d.ts +0 -12
  857. package/dist/components/FaceWarp3D/FaceWarp3DHead.d.ts +0 -15
  858. package/dist/components/FaceWarp3D/defaults.d.ts +0 -37
  859. package/dist/components/FaceWarp3D/warp.d.ts +0 -13
  860. package/dist/debug-ui/face-warp-3d/index.d.ts +0 -6
  861. package/dist/defaults-BLpcN3pG.cjs +0 -1
  862. package/dist/defaults-LtY4M7dg.js +0 -55
  863. package/dist/index-BXyObVHF.cjs +0 -1
  864. package/dist/index-CY3bUAcW.js +0 -12
  865. package/dist/index-C_Duh13c.cjs +0 -1
  866. package/dist/index-D8fpPQkC.cjs +0 -1
  867. package/dist/index-DxshgBu0.cjs +0 -1
  868. package/dist/index-O-2crZ3M.js +0 -1102
  869. package/dist/index-safCs_af.js +0 -1341
  870. package/dist/internal-BjyhBP8i.cjs +0 -1
  871. package/dist/modules/XRClient/index.d.ts +0 -9
  872. package/dist/modules/index.d.ts +0 -1
  873. package/dist/screenImageSettings-6NRg4cx9.js +0 -39
  874. package/dist/screenImageSettings-y_B4_767.cjs +0 -1
  875. package/dist/selectors-BLl2JUWW.cjs +0 -1
  876. package/dist/selectors-CXd_x-6t.js +0 -59
  877. package/dist/services/ApiService.d.ts +0 -12
  878. package/dist/types/client.d.ts +0 -3
  879. package/dist/useFaceResults-cpsSmKKc.js +0 -81
  880. package/dist/useFaceResults-hVUJYSEY.cjs +0 -1
  881. package/dist/useXRModel-3DcUa28n.cjs +0 -1
  882. package/dist/useXRModel-BMJE1hrk.js +0 -28
  883. /package/dist/{layerStack.d.ts → render/layerStack.d.ts} +0 -0
  884. /package/dist/{screenImagePresets.d.ts → screen-image/screenImagePresets.d.ts} +0 -0
  885. /package/dist/{screenTextPresets.d.ts → screen-text/screenTextPresets.d.ts} +0 -0
package/dist/debug-ui.cjs CHANGED
@@ -1,20 +1,10 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const $e=require("./MediaSourceSwitcher-Cq3g4IKw.cjs"),Ht=require("./debug-ui/default-setting.cjs"),e=require("react/jsx-runtime"),ie=require("react-dom"),c=require("react"),Kt=require("./screenImageSettings-y_B4_767.cjs"),Bt=require("./defaults-BLpcN3pG.cjs"),$t={enabled:!0,bothHands:!0,space:"scene",showJoints:!0,showBones:!0,showLabels:!1,handScale:1,depthScale:1,trackingDistanceM:.6096,projectionDistanceM:2,fitX:1,fitY:.9,offsetX:0,offsetY:0,offsetZ:0,jointRadius:.012,boneRadius:.012,opacity:.88,smoothing:.35},Vt={enabled:!0,attachImageEnabled:!0,showBoundingBox:!1,verticalAlign:"middle",horizontalAlign:"center",sizeResponsiveToHandBoundingBox:!1,size:1,offsetX:0,offsetY:.02,rotation:0,alpha:1,smoothFollowing:!0,smoothing:.35},At=[{label:"Top",value:"top"},{label:"Middle",value:"middle"},{label:"Bottom",value:"bottom"}],Nt=[{label:"Left",value:"left"},{label:"Middle",value:"center"},{label:"Right",value:"right"}],Dt={enabled:!0,bothHands:!0,visualScale:1,opacity:.92,pointRadius:3,lineWidth:3,labelScale:1.2,smoothing:.35,color:"#22d3ee",showBoundingBox:!0,showLabels:!1,logToConsole:!1},Ot={enabled:!0,bothHands:!0,countEnabled:!0,minCountConfidence:.35,showBones:!0,showJoints:!0,showBoundingBox:!0,showLabels:!1,visualScale:1,opacity:.9,jointRadius:3,lineWidth:1.5,labelScale:1,smoothing:.35},Pt={clean:{fontWeight:400,strokeLayers:[],shadowLayers:[]},sticker:{color:"#101828",fontWeight:800,strokeLayers:[{color:"#ffffff",width:26,opacity:1},{color:"#101828",width:10,opacity:1}],shadowLayers:[]},"shadow-pop":{color:"#fff8df",fontWeight:800,strokeLayers:[{color:"#101828",width:12,opacity:1}],shadowLayers:[{color:"#0f172a",blur:0,offsetX:18,offsetY:18,opacity:.9},{color:"#0f172a",blur:10,offsetX:10,offsetY:10,opacity:.35}]},neon:{color:"#ffffff",fontWeight:700,strokeLayers:[{color:"#9be7ff",width:8,opacity:.9}],shadowLayers:[{color:"#38bdf8",blur:18,opacity:.8},{color:"#0ea5e9",blur:40,opacity:.7},{color:"#7c3aed",blur:70,opacity:.5}]},editorial:{color:"#f8fafc",fontWeight:500,strokeLayers:[{color:"#0f172a",width:4,opacity:.5}],shadowLayers:[]},"comic-burst":{color:"#fff06a",fontWeight:900,strokeLayers:[{color:"#ef4444",width:28,opacity:1},{color:"#111827",width:12,opacity:1}],shadowLayers:[{color:"#111827",blur:0,offsetX:12,offsetY:12,opacity:.65}]},"ice-outline":{color:"#eff8ff",fontWeight:800,strokeLayers:[{color:"#dbeafe",width:16,opacity:1},{color:"#1d4ed8",width:6,opacity:.95}],shadowLayers:[{color:"#38bdf8",blur:24,opacity:.32}]},"sunset-glow":{color:"#fff7ed",fontWeight:800,strokeLayers:[{color:"#fb7185",width:8,opacity:.95}],shadowLayers:[{color:"#fb7185",blur:18,opacity:.7},{color:"#f97316",blur:42,opacity:.55},{color:"#facc15",blur:70,opacity:.28}]},cutout:{color:"#fffaf0",fontWeight:800,strokeLayers:[{color:"#0f172a",width:6,opacity:.9}],shadowLayers:[{color:"#0f172a",blur:0,offsetX:8,offsetY:8,opacity:.95},{color:"#0f172a",blur:0,offsetX:16,offsetY:16,opacity:.4}]},"badge-arc":{color:"#ffffff",fontWeight:900,outlineEnabled:!0,shadowEnabled:!0,glowEnabled:!1,innerShadowEnabled:!1,bendEnabled:!0,bend:{preset:"arc",strength:100},strokeLayers:[{color:"#0b1020",width:24,opacity:1},{color:"#ffffff",width:8,opacity:1}],shadowLayers:[{color:"#020617",blur:8,offset:10,angle:-45,feather:.2,opacity:.65}]},"chrome-bulge":{color:"#f8fafc",fontWeight:900,outlineEnabled:!0,shadowEnabled:!1,glowEnabled:!0,innerShadowEnabled:!0,bendEnabled:!0,bend:{preset:"bulge",strength:100},glow:{color:"#dbeafe",style:"contoured",intensity:.55,range:.35,horizontalAngle:0,verticalAngle:0},innerShadow:{color:"#64748b",opacity:.9,offset:16,angle:-45,feather:.25},strokeLayers:[{color:"#0f172a",width:5,opacity:.9}],shadowLayers:[]},"retro-wave":{color:"#fffbeb",fontWeight:900,outlineEnabled:!0,shadowEnabled:!0,glowEnabled:!0,innerShadowEnabled:!1,bendEnabled:!0,bend:{preset:"wave",strength:100},glow:{color:"#fb7185",style:"outward",intensity:.65,range:.55,horizontalAngle:0,verticalAngle:0},strokeLayers:[{color:"#fb7185",width:12,opacity:1},{color:"#7c2d12",width:5,opacity:.9}],shadowLayers:[{color:"#7c2d12",blur:4,offset:14,angle:45,feather:.1,opacity:.75}]},"flag-pop":{color:"#ffffff",fontWeight:900,outlineEnabled:!0,shadowEnabled:!0,glowEnabled:!0,innerShadowEnabled:!1,bendEnabled:!0,bend:{preset:"flag",strength:100},glow:{color:"#38bdf8",style:"outward",intensity:.5,range:.45,horizontalAngle:.15,verticalAngle:-.1},strokeLayers:[{color:"#fde047",width:18,opacity:1},{color:"#111827",width:7,opacity:1}],shadowLayers:[{color:"#111827",blur:0,offset:14,angle:35,feather:0,opacity:.75}]},"fisheye-poster":{color:"#fff7ed",fontWeight:900,outlineEnabled:!0,shadowEnabled:!0,glowEnabled:!1,innerShadowEnabled:!0,bendEnabled:!0,bend:{preset:"fisheye",strength:100},innerShadow:{color:"#92400e",opacity:.55,offset:10,angle:-45,feather:.15},strokeLayers:[{color:"#020617",width:24,opacity:1},{color:"#f97316",width:8,opacity:.9}],shadowLayers:[{color:"#020617",blur:0,offset:12,angle:40,feather:0,opacity:.8}]}},Zt={display:"grid",gridTemplateColumns:"repeat(2, minmax(0, 1fr))",gap:6},P={display:"flex",flexDirection:"column",gap:4},Se={...P,gridColumn:"1 / -1"},M={fontSize:9,color:"rgba(226,232,240,0.72)"},kt={width:"100%",height:24,borderRadius:7,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(15,23,42,0.68)",color:"#f8fafc",fontSize:10.5,outline:"none",padding:"0 7px",boxSizing:"border-box"},_t={...kt,fontVariantNumeric:"tabular-nums"},Fe={display:"flex",alignItems:"center",justifyContent:"space-between",gap:12,minHeight:24},Me={width:16,height:16},Xt={width:"100%",height:26,borderRadius:8,border:"1px solid rgba(255,255,255,0.12)",background:"rgba(56,189,248,0.16)",color:"#e0f2fe",fontSize:10.5,fontWeight:700,cursor:"pointer"},Gt=t=>/^-?\d*(\.\d*)?$/.test(t),X=({value:t,onChange:i,step:p=1,min:w,max:j,disabled:S=!1})=>{const[R,k]=c.useState(String(t));c.useEffect(()=>k(String(t)),[t]);const u=r=>{let o=r;return typeof w=="number"&&(o=Math.max(w,o)),typeof j=="number"&&(o=Math.min(j,o)),o};return e.jsx("input",{type:"text",inputMode:"decimal",pattern:"-?[0-9]*[.,]?[0-9]*",style:_t,value:R,disabled:S,onChange:r=>{const o=r.target.value;if(!Gt(o)||(k(o),o===""||o==="-"||o==="."||o==="-."))return;const v=Number(o);Number.isNaN(v)||i(u(v))},onBlur:()=>{const r=Number(R);if(Number.isNaN(r)){k(String(t));return}const o=u(r);k(String(o)),i(o)},onKeyDown:r=>{if(r.key!=="ArrowUp"&&r.key!=="ArrowDown")return;r.preventDefault();const o=r.shiftKey?p*10:r.altKey?p/10:p,v=r.key==="ArrowUp"?t+o:t-o;i(u(Number.isInteger(v)?v:Number(v.toFixed(6))))}})},vt=({value:t,onChange:i,guideLabel:p,copyLabel:w,copyValue:j,showRenderOrder:S=!0})=>{const[R,k]=c.useState(!1),u=t.coordinateSpace??"normalized",r=t.canvasSize??{width:720,height:1280},o=u==="canvas",v=async()=>{await navigator.clipboard.writeText(JSON.stringify(j??{name:w??"Selected layer",transform:t},null,2)),k(!0),window.setTimeout(()=>k(!1),1200)};return e.jsxs("div",{style:Zt,children:[e.jsxs("label",{style:P,children:[e.jsx("span",{style:M,children:"Coordinate Space"}),e.jsxs("select",{style:kt,value:u,onChange:d=>i({...t,coordinateSpace:d.target.value}),children:[e.jsx("option",{value:"normalized",children:"Normalized"}),e.jsx("option",{value:"canvas",children:"Canvas"})]})]}),e.jsxs("label",{style:P,children:[e.jsx("span",{style:M,children:"Canvas Width"}),e.jsx(X,{value:r.width,min:1,max:4096,step:1,disabled:!o,onChange:d=>i({...t,canvasSize:{...r,width:d}})})]}),e.jsxs("label",{style:P,children:[e.jsx("span",{style:M,children:"Canvas Height"}),e.jsx(X,{value:r.height,min:1,max:4096,step:1,disabled:!o,onChange:d=>i({...t,canvasSize:{...r,height:d}})})]}),e.jsxs("label",{style:P,children:[e.jsx("span",{style:M,children:"Position X"}),e.jsx(X,{value:t.position.x,min:o?-r.width:-10,max:o?r.width:10,step:o?1:.01,onChange:d=>i({...t,position:{...t.position,x:d}})})]}),e.jsxs("label",{style:P,children:[e.jsx("span",{style:M,children:"Position Y"}),e.jsx(X,{value:t.position.y,min:o?-r.height:-10,max:o?r.height:10,step:o?1:.01,onChange:d=>i({...t,position:{...t.position,y:d}})})]}),e.jsxs("label",{style:P,children:[e.jsx("span",{style:M,children:"Size Width"}),e.jsx(X,{value:t.size.width,min:o?0:-10,max:o?r.width*2:10,step:o?1:.01,onChange:d=>i({...t,size:{...t.size,width:d}})})]}),e.jsxs("label",{style:P,children:[e.jsx("span",{style:M,children:"Size Height"}),e.jsx(X,{value:t.size.height,min:o?0:-10,max:o?r.height*2:10,step:o?1:.01,onChange:d=>i({...t,size:{...t.size,height:d}})})]}),e.jsxs("label",{style:P,children:[e.jsx("span",{style:M,children:"Rotation"}),e.jsx(X,{value:t.rotation,min:-360,max:360,step:1,onChange:d=>i({...t,rotation:d})})]}),S?e.jsxs("label",{style:P,children:[e.jsx("span",{style:M,children:"Render Order"}),e.jsx(X,{value:t.renderOrder,min:-9999,max:9999,step:1,onChange:d=>i({...t,renderOrder:d})})]}):null,e.jsxs("label",{style:P,children:[e.jsx("span",{style:M,children:"Pivot X"}),e.jsx(X,{value:t.pivot[0],min:0,max:1,step:.01,onChange:d=>i({...t,pivot:[d,t.pivot[1]]})})]}),e.jsxs("label",{style:P,children:[e.jsx("span",{style:M,children:"Pivot Y"}),e.jsx(X,{value:t.pivot[1],min:0,max:1,step:.01,onChange:d=>i({...t,pivot:[t.pivot[0],d]})})]}),e.jsx("label",{style:Se,children:e.jsxs("div",{style:Fe,children:[e.jsx("span",{style:M,children:p}),e.jsx("input",{type:"checkbox",style:Me,checked:t.showGuides,onChange:d=>i({...t,showGuides:d.target.checked})})]})}),e.jsx("label",{style:Se,children:e.jsxs("div",{style:Fe,children:[e.jsx("span",{style:M,children:"Enabled"}),e.jsx("input",{type:"checkbox",style:Me,checked:t.enabled,onChange:d=>i({...t,enabled:d.target.checked})})]})}),e.jsx("label",{style:Se,children:e.jsxs("div",{style:Fe,children:[e.jsx("span",{style:M,children:"Visible"}),e.jsx("input",{type:"checkbox",style:Me,checked:t.visible,onChange:d=>i({...t,visible:d.target.checked})})]})}),e.jsx("label",{style:Se,children:e.jsxs("div",{style:Fe,children:[e.jsx("span",{style:M,children:"Overlay"}),e.jsx("input",{type:"checkbox",style:Me,checked:t.overlay,onChange:d=>i({...t,overlay:d.target.checked})})]})}),e.jsx("div",{style:Se,children:e.jsx("button",{type:"button",style:Xt,onClick:v,children:R?"Copied Transform":"Copy Transform"})})]})},Yt=[{label:"Space Grotesk",value:'"Space Grotesk", sans-serif'},{label:"Bebas Neue",value:'"Bebas Neue", sans-serif'},{label:"DM Serif Display",value:'"DM Serif Display", serif'},{label:"Caveat",value:'"Caveat", cursive'}],Ut=["clean","sticker","shadow-pop","neon","editorial","comic-burst","ice-outline","sunset-glow","cutout","badge-arc","chrome-bulge","retro-wave","flag-pop","fisheye-poster"],Jt={clean:"NONE",sticker:"sticker","shadow-pop":"shadow-pop",neon:"neon",editorial:"editorial","comic-burst":"comic-burst","ice-outline":"ice-outline","sunset-glow":"sunset-glow",cutout:"cutout","badge-arc":"badge-arc","chrome-bulge":"chrome-bulge","retro-wave":"retro-wave","flag-pop":"flag-pop","fisheye-poster":"fisheye-poster"},qt=()=>({color:"#000000",opacity:1,width:30}),De=()=>({color:"#000000",opacity:1,offset:10,angle:-45,feather:0,blur:0,offsetX:7.071,offsetY:-7.071}),Qe=()=>({color:"#ffffff",style:"outward",intensity:.5,range:.5,horizontalAngle:0,verticalAngle:0}),et=()=>({preset:"arc",strength:100}),Qt=[{label:"Arc",value:"arc"},{label:"Arc Lower",value:"arc-lower"},{label:"Arc Upper",value:"arc-upper"},{label:"Arch",value:"arch"},{label:"Bulge",value:"bulge"},{label:"Shell Lower",value:"shell-lower"},{label:"Shell Upper",value:"shell-upper"},{label:"Flag",value:"flag"},{label:"Wave",value:"wave"},{label:"Fish",value:"fish"},{label:"Rise",value:"rise"},{label:"Fisheye",value:"fisheye"},{label:"Inflate",value:"inflate"},{label:"Squeeze",value:"squeeze"},{label:"Twist",value:"twist"}],es=(t,i)=>{const p=Pt[i],w=p.strokeLayers??t.style.strokeLayers,j=p.shadowLayers??t.style.shadowLayers;return{...t,textArtPreset:i,style:{...t.style,...p,fontWeight:t.style.bold?"bold":p.fontWeight??t.style.fontWeight,background:{...t.style.background,...p.background},outlineEnabled:p.strokeLayers?p.strokeLayers.length>0:t.style.outlineEnabled,shadowEnabled:p.shadowLayers?p.shadowLayers.length>0:t.style.shadowEnabled,strokeLayers:w,shadowLayers:j}}},ts={position:"fixed",left:14,top:104,zIndex:2e4,pointerEvents:"none"},Ct={pointerEvents:"auto",width:298,borderRadius:16,border:"1px solid rgba(255,255,255,0.12)",background:"rgba(8, 15, 28, 0.58)",boxShadow:"0 16px 36px rgba(0,0,0,0.28)",backdropFilter:"blur(20px) saturate(1.1)",WebkitBackdropFilter:"blur(20px) saturate(1.1)",color:"#f8fafc",overflowX:"hidden",overflowY:"auto",scrollbarWidth:"thin",scrollbarColor:"rgba(148,163,184,0.55) rgba(255,255,255,0.06)",overscrollBehavior:"contain"},ss={...Ct,width:32,height:32,borderRadius:16,display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer"},ns={position:"sticky",top:0,zIndex:1,display:"flex",alignItems:"center",gap:7,padding:"7px 8px",borderBottom:"1px solid rgba(255,255,255,0.08)",background:"rgba(8, 15, 28, 0.88)",backdropFilter:"blur(20px) saturate(1.1)",WebkitBackdropFilter:"blur(20px) saturate(1.1)"},ls={width:16,height:16,display:"flex",alignItems:"center",justifyContent:"center",cursor:"grab",color:"rgba(148,163,184,0.82)",flex:"0 0 auto"},is={display:"flex",alignItems:"center",gap:6,fontSize:11,fontWeight:600,minWidth:0},tt={display:"flex",width:18,height:18,alignItems:"center",justifyContent:"center",borderRadius:6,background:"rgba(255,255,255,0.08)",border:"1px solid rgba(255,255,255,0.08)",color:"#e2e8f0",flex:"0 0 auto"},os={display:"grid",gap:6,padding:7},rs={borderRadius:12,border:"1px solid rgba(255,255,255,0.08)",background:"rgba(255,255,255,0.03)",overflow:"hidden"},as={display:"flex",alignItems:"center",gap:7,padding:"6px 7px"},ds={display:"flex",alignItems:"center",gap:6,fontSize:11,fontWeight:500,flex:"1 1 auto",minWidth:0},cs={width:28,height:16,borderRadius:999,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(255,255,255,0.08)",padding:2,display:"flex",alignItems:"center",cursor:"pointer",flex:"0 0 auto"},hs=t=>({width:10,height:10,borderRadius:999,background:t?"#f8fafc":"rgba(148,163,184,0.7)",transform:t?"translateX(12px)":"translateX(0)",transition:"transform 140ms ease, background 140ms ease"}),ps={display:"grid",gap:7,padding:"0 7px 7px"},U={display:"grid",gridTemplateColumns:"repeat(2, minmax(0, 1fr))",gap:6},z={display:"flex",flexDirection:"column",gap:4},T={...z,gridColumn:"1 / -1"},ge={gridColumn:"1 / -1",display:"grid",gap:6,padding:"8px 8px 2px 12px",marginTop:-2,borderLeft:"1px solid rgba(255,255,255,0.10)"},be={display:"flex",alignItems:"center",justifyContent:"space-between",gap:6,width:"100%",padding:0,border:0,background:"transparent",fontSize:9,color:"rgba(226,232,240,0.64)",textTransform:"uppercase",cursor:"pointer"},ue={display:"flex",alignItems:"center",gap:6,minWidth:0},fe={width:16,height:16,borderRadius:999,display:"inline-flex",alignItems:"center",justifyContent:"center",background:"rgba(255,255,255,0.06)",color:"rgba(226,232,240,0.72)",flex:"0 0 auto"},x={fontSize:9,color:"rgba(226,232,240,0.72)"},Ve={width:"100%",height:24,borderRadius:7,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(15,23,42,0.68)",color:"#f8fafc",fontSize:10.5,outline:"none",padding:"0 7px",boxSizing:"border-box"},ys={...Ve,height:72,padding:"7px",resize:"vertical",lineHeight:1.35,fontFamily:"inherit"},Q={...Ve,padding:2,cursor:"pointer"},J={...Ve,appearance:"none"},xs={...Ve,fontVariantNumeric:"tabular-nums"},zt={opacity:.45,cursor:"not-allowed"},F={display:"flex",alignItems:"center",justifyContent:"space-between",gap:12,minHeight:24},B={width:16,height:16},ke={display:"inline-flex",alignItems:"center",justifyContent:"center",width:24,height:24,borderRadius:8,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(255,255,255,0.05)",color:"#e2e8f0",cursor:"pointer",padding:0,flex:"0 0 auto"},gs=()=>e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M7 10h10v2H7v-2zm0 4h10v2H7v-2zm0-8h10v2H7V6z"})}),bs=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M18.3 5.71 12 12l6.3 6.29-1.41 1.41L10.59 13.41 4.29 19.7 2.88 18.29 9.17 12 2.88 5.71 4.29 4.3l6.3 6.29 6.29-6.3z"})}),us=()=>e.jsx("svg",{width:"11",height:"15",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M8 6a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM8 12a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM8 18a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM16 6a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM16 12a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM16 18a2 2 0 1 1-4 0 2 2 0 0 1 4 0z"})}),fs=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M6 4h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2zm1 3v2h4v8h2V9h4V7H7z"})}),st=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M4 6V4h16v2h-7v14h-2V6H4z"})}),js=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M12 3a9 9 0 1 0 0 18h1.2a2.8 2.8 0 0 0 0-5.6h-.4a1.8 1.8 0 0 1 0-3.6H16a5 5 0 0 0 0-10h-4zm-4 7a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3zm1 5a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3zm6-7a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3z"})}),ms=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M4 4h6v2H7.4l3.3 3.3-1.4 1.4L6 7.4V10H4V4zm10 0h6v6h-2V7.4l-3.3 3.3-1.4-1.4L16.6 6H14V4zM9.3 13.3l1.4 1.4L7.4 18H10v2H4v-6h2v2.6l3.3-3.3zm5.4 0 3.3 3.3V14h2v6h-6v-2h2.6l-3.3-3.3 1.4-1.4z"})}),ws=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M3 5h18v2H3V5zm0 6h12v2H3v-2zm0 6h18v2H3v-2z"})}),Ss=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M7 7h10a5 5 0 1 1 0 10H7A5 5 0 1 1 7 7zm0 2a3 3 0 1 0 0 6h10a3 3 0 1 0 0-6H7z"})}),je=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M7 5h10v2H9v6h8v2H7V5zm4 8h6v6h-6v-2h4v-2h-4v-2z"})}),ks=t=>/^-?\d*(\.\d*)?$/.test(t),E=({value:t,onChange:i,step:p=1,min:w,max:j,disabled:S=!1})=>{const[R,k]=c.useState(String(t));c.useEffect(()=>k(String(t)),[t]);const u=r=>{let o=r;return typeof w=="number"&&(o=Math.max(w,o)),typeof j=="number"&&(o=Math.min(j,o)),o};return e.jsx("input",{type:"text",inputMode:"decimal",pattern:"-?[0-9]*[.,]?[0-9]*",style:{...xs,...S?zt:{}},value:R,disabled:S,onChange:r=>{if(S)return;const o=r.target.value;if(!ks(o)||(k(o),o===""||o==="-"||o==="."||o==="-."))return;const v=Number(o);Number.isNaN(v)||i(u(v))},onBlur:()=>{if(S)return;const r=Number(R);if(Number.isNaN(r)){k(String(t));return}const o=u(r);k(String(o)),i(o)},onKeyDown:r=>{if(S||r.key!=="ArrowUp"&&r.key!=="ArrowDown")return;r.preventDefault();const o=r.shiftKey?p*10:r.altKey?p/10:p,v=r.key==="ArrowUp"?t+o:t-o;i(u(Number.isInteger(v)?v:Number(v.toFixed(6))))}})},nt=t=>({enabled:t.enabled,showGuides:t.showTransformGuides,coordinateSpace:t.coordinateSpace,canvasSize:t.canvasSize,position:t.position,size:t.size,rotation:t.rotation,pivot:t.pivot,renderOrder:t.renderOrder,overlay:t.overlay,visible:t.visible}),vs=(t,i)=>({...i,enabled:t.enabled,showTransformGuides:t.showGuides,coordinateSpace:t.coordinateSpace,canvasSize:t.canvasSize,position:t.position,size:t.size,rotation:t.rotation,pivot:t.pivot,renderOrder:t.renderOrder,overlay:t.overlay,visible:t.visible}),Cs=({value:t,onChange:i,copyLabel:p})=>{var qe;const[w,j]=c.useState(!0),[S,R]=c.useState({x:14,y:104}),[k,u]=c.useState(typeof window>"u"?0:window.innerHeight),[r,o]=c.useState(!0),[v,d]=c.useState(!0),[h,s]=c.useState(!0),[y,a]=c.useState(!0),[b,I]=c.useState(!0),[N,C]=c.useState(!0),[D,K]=c.useState({renderer:!0,content:!0,transformation:!0,style:!0,layout:!0,visibility:!1}),Y=c.useRef(null),Lt=Math.max(240,k-S.y-16);c.useEffect(()=>{const l=W=>{Y.current&&R({x:Math.max(8,W.clientX-Y.current.x),y:Math.max(8,W.clientY-Y.current.y)})},n=()=>{Y.current=null,document.body.classList.remove("select-none")};return window.addEventListener("pointermove",l),window.addEventListener("pointerup",n),()=>{window.removeEventListener("pointermove",l),window.removeEventListener("pointerup",n)}},[]),c.useEffect(()=>{const l=()=>u(window.innerHeight);return window.addEventListener("resize",l),()=>window.removeEventListener("resize",l)},[]);const Ft=l=>{const n=l.currentTarget.getBoundingClientRect();Y.current={x:l.clientX-n.left,y:l.clientY-n.top},document.body.classList.add("select-none"),l.currentTarget.setPointerCapture(l.pointerId)},g=l=>{i({...t,screenText:l(t.screenText)})},Mt=l=>{g(n=>({...n,transformation:l(n.transformation)}))},Ae=t.screenText.style.strokeLayers??[],Ne=t.screenText.style.shadowEnabled!==!1&&(((qe=t.screenText.style.shadowLayers)==null?void 0:qe.length)??0)===0?[De()]:t.screenText.style.shadowLayers??[],_=t.screenText.style.innerShadow??{color:"#000000",opacity:1,offset:10,angle:-45,feather:0},O=t.screenText.style.glow??Qe(),Le=t.screenText.style.bend??et(),xe=(l,n,W,m)=>e.jsxs("div",{style:rs,children:[e.jsxs("div",{style:as,children:[e.jsx("button",{type:"button",onClick:()=>K(f=>({...f,[l]:!f[l]})),style:cs,children:e.jsx("div",{style:hs(D[l])})}),e.jsxs("div",{style:ds,children:[e.jsx("span",{style:tt,children:W}),e.jsx("span",{children:n})]})]}),D[l]?e.jsx("div",{style:ps,children:m}):null]},l);return typeof document>"u"?null:ie.createPortal(e.jsxs("div",{style:{...ts,left:S.x,top:S.y},children:[e.jsx("style",{children:`
2
- .xr-screen-text-settings-scroll::-webkit-scrollbar { width: 10px; }
3
- .xr-screen-text-settings-scroll::-webkit-scrollbar-track { background: rgba(255,255,255,0.06); border-radius: 999px; }
4
- .xr-screen-text-settings-scroll::-webkit-scrollbar-thumb { background: rgba(148,163,184,0.55); border-radius: 999px; border: 2px solid transparent; background-clip: padding-box; }
5
- .xr-screen-text-settings-scroll::-webkit-scrollbar-thumb:hover { background: rgba(226,232,240,0.68); background-clip: padding-box; }
6
- `}),w?e.jsxs("div",{className:"xr-screen-text-settings-scroll",style:{...Ct,height:Lt},children:[e.jsxs("div",{style:ns,children:[e.jsx("div",{onPointerDown:Ft,style:ls,children:e.jsx(us,{})}),e.jsxs("div",{style:is,children:[e.jsx("span",{style:tt,children:e.jsx(fs,{})}),e.jsx("span",{children:"Screen Text"})]}),e.jsx("div",{style:{flex:"1 1 auto"}}),e.jsx("button",{type:"button",onClick:()=>j(!1),style:ke,children:e.jsx(bs,{})})]}),e.jsx("div",{style:os,children:xe("renderer","Text Renderer",e.jsx(st,{}),e.jsxs(e.Fragment,{children:[xe("content","Content",e.jsx(st,{}),e.jsxs("div",{style:U,children:[e.jsxs("label",{style:T,children:[e.jsx("span",{style:x,children:"Text"}),e.jsx("textarea",{style:ys,value:t.screenText.content.text,onChange:l=>g(n=>({...n,content:{...n.content,text:l.target.value}}))})]}),e.jsxs("label",{style:z,children:[e.jsx("span",{style:x,children:"Text Art"}),e.jsx("select",{style:J,value:t.screenText.textArtPreset,onChange:l=>g(n=>es(n,l.target.value)),children:Ut.map(l=>e.jsx("option",{value:l,children:Jt[l]},l))})]}),e.jsxs("label",{style:z,children:[e.jsx("span",{style:x,children:"Font"}),e.jsx("select",{style:J,value:t.screenText.style.fontFamily,onChange:l=>g(n=>({...n,style:{...n.style,fontFamily:l.target.value}})),children:Yt.map(l=>e.jsx("option",{value:l.value,children:l.label},l.value))})]})]})),xe("transformation","Transformation",e.jsx(ms,{}),e.jsx(vt,{value:nt(t.screenText.transformation),guideLabel:"Show Transform Guides",copyLabel:p,copyValue:{name:p??"Selected screen text",kind:"screenText",transform:nt(t.screenText.transformation),content:t.screenText.content,style:t.screenText.style,layout:t.screenText.layout,screenSpaceUI:t.screenSpaceUI},showRenderOrder:!1,onChange:l=>Mt(n=>vs(l,n))})),xe("style","Style",e.jsx(js,{}),e.jsxs("div",{style:U,children:[e.jsxs("label",{style:z,children:[e.jsx("span",{style:x,children:"Text Color"}),e.jsx("input",{style:Q,type:"color",value:t.screenText.style.color,onChange:l=>g(n=>({...n,style:{...n.style,color:l.target.value}}))})]}),e.jsxs("label",{style:z,children:[e.jsx("span",{style:x,children:"Font Size"}),e.jsx(E,{value:t.screenText.style.fontSize,min:16,max:180,step:4,onChange:l=>g(n=>({...n,layout:{...n.layout,minFontSize:Math.min(n.layout.minFontSize??l,l)},style:{...n.style,fontSize:l}}))})]}),e.jsxs("label",{style:z,children:[e.jsx("span",{style:x,children:"Letter Spacing"}),e.jsx(E,{value:t.screenText.style.letterSpacing,min:0,max:1,step:.05,onChange:l=>g(n=>({...n,style:{...n.style,letterSpacing:l}}))})]}),e.jsxs("label",{style:z,children:[e.jsx("span",{style:x,children:"Line Spacing"}),e.jsx(E,{value:t.screenText.style.lineSpacing,min:0,max:1,step:.05,onChange:l=>g(n=>({...n,style:{...n.style,lineSpacing:l}}))})]}),e.jsx("label",{style:T,children:e.jsxs("div",{style:F,children:[e.jsx("span",{style:x,children:"Bold"}),e.jsx("input",{type:"checkbox",style:B,checked:t.screenText.style.bold===!0,onChange:l=>g(n=>({...n,style:{...n.style,bold:l.target.checked}}))})]})}),e.jsx("label",{style:T,children:e.jsxs("div",{style:F,children:[e.jsx("span",{style:x,children:"Italic"}),e.jsx("input",{type:"checkbox",style:B,checked:t.screenText.style.fontStyle==="italic",onChange:l=>g(n=>({...n,style:{...n.style,fontStyle:l.target.checked?"italic":"normal"}}))})]})}),e.jsx("label",{style:T,children:e.jsxs("div",{style:F,children:[e.jsx("span",{style:x,children:"Underline"}),e.jsx("input",{type:"checkbox",style:B,checked:t.screenText.style.underline===!0,onChange:l=>g(n=>({...n,style:{...n.style,underline:l.target.checked}}))})]})}),e.jsx("label",{style:T,children:e.jsxs("div",{style:F,children:[e.jsx("span",{style:x,children:"Outline"}),e.jsx("input",{type:"checkbox",style:B,checked:t.screenText.style.outlineEnabled!==!1,onChange:l=>g(n=>({...n,style:{...n.style,outlineEnabled:l.target.checked}}))})]})}),t.screenText.style.outlineEnabled!==!1?e.jsxs("div",{style:ge,children:[e.jsxs("button",{type:"button",style:be,onClick:()=>o(l=>!l),children:[e.jsxs("span",{style:ue,children:[e.jsx(je,{}),e.jsx("span",{children:"Outline Editor"})]}),e.jsx("span",{style:fe,children:r?"−":"+"})]}),r?e.jsxs(e.Fragment,{children:[e.jsxs("div",{style:{...F,gridColumn:"1 / -1"},children:[e.jsxs("span",{style:x,children:["Layers: ",Ae.length]}),e.jsx("button",{type:"button",style:ke,onClick:()=>g(l=>({...l,style:{...l.style,strokeLayers:[...l.style.strokeLayers??[],qt()]}})),children:"+"})]}),Ae.length>0?Ae.map((l,n)=>e.jsxs("div",{style:{gridColumn:"1 / -1",display:"grid",gap:6,padding:"8px",borderRadius:10,border:"1px solid rgba(255,255,255,0.08)",background:"rgba(255,255,255,0.03)"},children:[e.jsxs("div",{style:F,children:[e.jsxs("span",{style:x,children:["Outline ",n+1]}),e.jsx("button",{type:"button",style:ke,onClick:()=>g(W=>({...W,style:{...W.style,strokeLayers:(W.style.strokeLayers??[]).filter((m,f)=>f!==n)}})),children:"×"})]}),e.jsxs("div",{style:U,children:[e.jsxs("label",{style:z,children:[e.jsx("span",{style:x,children:"Outline Color"}),e.jsx("input",{style:Q,type:"color",value:l.color,onChange:W=>g(m=>{const f=[...m.style.strokeLayers??[]];return f[n]={...f[n],color:W.target.value},{...m,style:{...m.style,strokeLayers:f}}})})]}),e.jsxs("label",{style:z,children:[e.jsx("span",{style:x,children:"Outline Opacity"}),e.jsx(E,{value:l.opacity??1,min:0,max:1,step:.05,onChange:W=>g(m=>{const f=[...m.style.strokeLayers??[]];return f[n]={...f[n],opacity:W},{...m,style:{...m.style,strokeLayers:f}}})})]}),e.jsxs("label",{style:T,children:[e.jsx("span",{style:x,children:"Outline Size"}),e.jsx(E,{value:l.width,min:0,max:100,step:1,onChange:W=>g(m=>{const f=[...m.style.strokeLayers??[]];return f[n]={...f[n],width:W},{...m,style:{...m.style,strokeLayers:f}}})})]})]})]},n)):e.jsx("div",{style:{...x,gridColumn:"1 / -1"},children:"No outlines. Use `+` to add one."})]}):null]}):null,e.jsx("label",{style:T,children:e.jsxs("div",{style:F,children:[e.jsx("span",{style:x,children:"Outer Shadow"}),e.jsx("input",{type:"checkbox",style:B,checked:t.screenText.style.shadowEnabled!==!1,onChange:l=>g(n=>{var W;return{...n,style:{...n.style,shadowEnabled:l.target.checked,shadowLayers:l.target.checked&&(((W=n.style.shadowLayers)==null?void 0:W.length)??0)===0?[De()]:n.style.shadowLayers}}})})]})}),t.screenText.style.shadowEnabled!==!1?e.jsxs("div",{style:ge,children:[e.jsxs("button",{type:"button",style:be,onClick:()=>d(l=>!l),children:[e.jsxs("span",{style:ue,children:[e.jsx(je,{}),e.jsx("span",{children:"Shadow Editor"})]}),e.jsx("span",{style:fe,children:v?"−":"+"})]}),v?e.jsxs(e.Fragment,{children:[e.jsxs("div",{style:{...F,gridColumn:"1 / -1"},children:[e.jsxs("span",{style:x,children:["Layers: ",Ne.length]}),e.jsx("button",{type:"button",style:ke,onClick:()=>g(l=>({...l,style:{...l.style,shadowLayers:[...l.style.shadowLayers??[],De()]}})),children:"+"})]}),Ne.length>0?Ne.map((l,n)=>e.jsxs("div",{style:{gridColumn:"1 / -1",display:"grid",gap:6,padding:"8px",borderRadius:10,border:"1px solid rgba(255,255,255,0.08)",background:"rgba(255,255,255,0.03)"},children:[e.jsxs("div",{style:F,children:[e.jsxs("span",{style:x,children:["Shadow ",n+1]}),e.jsx("button",{type:"button",style:ke,onClick:()=>g(W=>({...W,style:{...W.style,shadowLayers:(W.style.shadowLayers??[]).filter((m,f)=>f!==n)}})),children:"×"})]}),e.jsxs("div",{style:U,children:[e.jsxs("label",{style:z,children:[e.jsx("span",{style:x,children:"Shadow Color"}),e.jsx("input",{style:Q,type:"color",value:l.color,onChange:W=>g(m=>{const f=[...m.style.shadowLayers??[]];return f[n]={...f[n],color:W.target.value},{...m,style:{...m.style,shadowLayers:f}}})})]}),e.jsxs("label",{style:z,children:[e.jsx("span",{style:x,children:"Shadow Opacity"}),e.jsx(E,{value:l.opacity??1,min:0,max:1,step:.05,onChange:W=>g(m=>{const f=[...m.style.shadowLayers??[]];return f[n]={...f[n],opacity:W},{...m,style:{...m.style,shadowLayers:f}}})})]}),e.jsxs("label",{style:z,children:[e.jsx("span",{style:x,children:"Shadow Offset"}),e.jsx(E,{value:l.offset??10,min:0,max:100,step:1,onChange:W=>g(m=>{const f=[...m.style.shadowLayers??[]];return f[n]={...f[n],offset:W},{...m,style:{...m.style,shadowLayers:f}}})})]}),e.jsxs("label",{style:z,children:[e.jsx("span",{style:x,children:"Shadow Angle"}),e.jsx(E,{value:l.angle??-45,min:-180,max:180,step:1,onChange:W=>g(m=>{const f=[...m.style.shadowLayers??[]];return f[n]={...f[n],angle:W},{...m,style:{...m.style,shadowLayers:f}}})})]}),e.jsxs("label",{style:T,children:[e.jsx("span",{style:x,children:"Shadow Feather"}),e.jsx(E,{value:l.feather??0,min:0,max:1,step:.05,onChange:W=>g(m=>{const f=[...m.style.shadowLayers??[]];return f[n]={...f[n],feather:W},{...m,style:{...m.style,shadowLayers:f}}})})]})]})]},n)):e.jsx("div",{style:{...x,gridColumn:"1 / -1"},children:"No outer shadows. Use `+` to add one."})]}):null]}):null,e.jsx("label",{style:T,children:e.jsxs("div",{style:F,children:[e.jsx("span",{style:x,children:"Inner Shadow"}),e.jsx("input",{type:"checkbox",style:B,checked:t.screenText.style.innerShadowEnabled===!0,onChange:l=>g(n=>({...n,style:{...n.style,innerShadowEnabled:l.target.checked,innerShadow:n.style.innerShadow??{color:"#000000",opacity:1,offset:10,angle:-45,feather:0}}}))})]})}),t.screenText.style.innerShadowEnabled===!0?e.jsxs("div",{style:ge,children:[e.jsxs("button",{type:"button",style:be,onClick:()=>a(l=>!l),children:[e.jsxs("span",{style:ue,children:[e.jsx(je,{}),e.jsx("span",{children:"Inner Shadow"})]}),e.jsx("span",{style:fe,children:y?"−":"+"})]}),y?e.jsxs("div",{style:U,children:[e.jsxs("label",{style:z,children:[e.jsx("span",{style:x,children:"Shadow Color"}),e.jsx("input",{style:Q,type:"color",value:_.color,onChange:l=>g(n=>({...n,style:{...n.style,innerShadow:{...n.style.innerShadow??_,color:l.target.value}}}))})]}),e.jsxs("label",{style:z,children:[e.jsx("span",{style:x,children:"Shadow Opacity"}),e.jsx(E,{value:_.opacity??1,min:0,max:1,step:.05,onChange:l=>g(n=>({...n,style:{...n.style,innerShadow:{...n.style.innerShadow??_,opacity:l}}}))})]}),e.jsxs("label",{style:z,children:[e.jsx("span",{style:x,children:"Shadow Offset"}),e.jsx(E,{value:_.offset??10,min:0,max:100,step:1,onChange:l=>g(n=>({...n,style:{...n.style,innerShadow:{...n.style.innerShadow??_,offset:l}}}))})]}),e.jsxs("label",{style:z,children:[e.jsx("span",{style:x,children:"Shadow Angle"}),e.jsx(E,{value:_.angle??-45,min:-180,max:180,step:1,onChange:l=>g(n=>({...n,style:{...n.style,innerShadow:{...n.style.innerShadow??_,angle:l}}}))})]}),e.jsxs("label",{style:T,children:[e.jsx("span",{style:x,children:"Shadow Feather"}),e.jsx(E,{value:_.feather??0,min:0,max:1,step:.05,onChange:l=>g(n=>({...n,style:{...n.style,innerShadow:{...n.style.innerShadow??_,feather:l}}}))})]})]}):null]}):null,e.jsx("label",{style:T,children:e.jsxs("div",{style:F,children:[e.jsx("span",{style:x,children:"Glow"}),e.jsx("input",{type:"checkbox",style:B,checked:t.screenText.style.glowEnabled===!0,onChange:l=>g(n=>({...n,style:{...n.style,glowEnabled:l.target.checked,glow:n.style.glow??Qe()}}))})]})}),t.screenText.style.glowEnabled===!0?e.jsxs("div",{style:ge,children:[e.jsxs("button",{type:"button",style:be,onClick:()=>s(l=>!l),children:[e.jsxs("span",{style:ue,children:[e.jsx(je,{}),e.jsx("span",{children:"Glow"})]}),e.jsx("span",{style:fe,children:h?"−":"+"})]}),h?e.jsxs("div",{style:U,children:[e.jsxs("label",{style:z,children:[e.jsx("span",{style:x,children:"Color"}),e.jsx("input",{style:Q,type:"color",value:O.color,onChange:l=>g(n=>({...n,style:{...n.style,glow:{...n.style.glow??O,color:l.target.value}}}))})]}),e.jsxs("label",{style:z,children:[e.jsx("span",{style:x,children:"Style"}),e.jsxs("select",{style:J,value:O.style,onChange:l=>g(n=>({...n,style:{...n.style,glow:{...n.style.glow??O,style:l.target.value}}})),children:[e.jsx("option",{value:"outward",children:"Outward"}),e.jsx("option",{value:"contoured",children:"Contoured"})]})]}),e.jsxs("label",{style:z,children:[e.jsx("span",{style:x,children:"Intensity"}),e.jsx(E,{value:O.intensity??.5,min:0,max:1,step:.05,onChange:l=>g(n=>({...n,style:{...n.style,glow:{...n.style.glow??O,intensity:l}}}))})]}),e.jsxs("label",{style:z,children:[e.jsx("span",{style:x,children:"Range"}),e.jsx(E,{value:O.range??.5,min:0,max:1,step:.05,onChange:l=>g(n=>({...n,style:{...n.style,glow:{...n.style.glow??O,range:l}}}))})]}),e.jsxs("label",{style:z,children:[e.jsx("span",{style:x,children:"Horizontal Angle"}),e.jsx(E,{value:O.horizontalAngle??0,min:-.5,max:.5,step:.05,onChange:l=>g(n=>({...n,style:{...n.style,glow:{...n.style.glow??O,horizontalAngle:l}}}))})]}),e.jsxs("label",{style:z,children:[e.jsx("span",{style:x,children:"Vertical Angle"}),e.jsx(E,{value:O.verticalAngle??0,min:-.5,max:.5,step:.05,onChange:l=>g(n=>({...n,style:{...n.style,glow:{...n.style.glow??O,verticalAngle:l}}}))})]})]}):null]}):null,e.jsx("label",{style:T,children:e.jsxs("div",{style:F,children:[e.jsx("span",{style:x,children:"Bend"}),e.jsx("input",{type:"checkbox",style:B,checked:t.screenText.style.bendEnabled===!0,onChange:l=>g(n=>({...n,style:{...n.style,bendEnabled:l.target.checked,bend:n.style.bend??et()}}))})]})}),t.screenText.style.bendEnabled===!0?e.jsxs("div",{style:ge,children:[e.jsxs("button",{type:"button",style:be,onClick:()=>I(l=>!l),children:[e.jsxs("span",{style:ue,children:[e.jsx(je,{}),e.jsx("span",{children:"Bend"})]}),e.jsx("span",{style:fe,children:b?"−":"+"})]}),b?e.jsxs("div",{style:U,children:[e.jsxs("label",{style:T,children:[e.jsx("span",{style:x,children:"Bend Preset"}),e.jsx("select",{style:J,value:Le.preset,onChange:l=>g(n=>({...n,style:{...n.style,bend:{...n.style.bend??Le,preset:l.target.value}}})),children:Qt.map(l=>e.jsx("option",{value:l.value,children:l.label},l.value))})]}),e.jsxs("label",{style:T,children:[e.jsx("span",{style:x,children:"Bend Strength"}),e.jsx(E,{value:Le.strength,min:-100,max:100,step:1,onChange:l=>g(n=>({...n,style:{...n.style,bend:{...n.style.bend??Le,strength:l}}}))})]})]}):null]}):null,e.jsx("label",{style:T,children:e.jsxs("div",{style:F,children:[e.jsx("span",{style:x,children:"Background Enabled"}),e.jsx("input",{type:"checkbox",style:B,checked:t.screenText.style.background.enabled,onChange:l=>g(n=>({...n,style:{...n.style,background:{...n.style.background,enabled:l.target.checked}}}))})]})}),t.screenText.style.background.enabled?e.jsxs("div",{style:ge,children:[e.jsxs("button",{type:"button",style:be,onClick:()=>C(l=>!l),children:[e.jsxs("span",{style:ue,children:[e.jsx(je,{}),e.jsx("span",{children:"Background Settings"})]}),e.jsx("span",{style:fe,children:N?"−":"+"})]}),N?e.jsxs(e.Fragment,{children:[e.jsxs("label",{style:z,children:[e.jsx("span",{style:x,children:"Fill Mode"}),e.jsxs("select",{style:J,value:t.screenText.style.background.fillMode,onChange:l=>g(n=>({...n,style:{...n.style,background:{...n.style.background,fillMode:l.target.value}}})),children:[e.jsx("option",{value:"solid",children:"solid"}),e.jsx("option",{value:"gradient",children:"gradient"})]})]}),e.jsxs("label",{style:z,children:[e.jsx("span",{style:x,children:"Fill Area"}),e.jsxs("select",{style:J,value:t.screenText.style.background.fit,onChange:l=>g(n=>({...n,style:{...n.style,background:{...n.style.background,fit:l.target.value}}})),children:[e.jsx("option",{value:"text",children:"text"}),e.jsx("option",{value:"full",children:"full"})]})]}),t.screenText.style.background.fillMode==="solid"?e.jsxs("label",{style:z,children:[e.jsx("span",{style:x,children:"Background Color"}),e.jsx("input",{style:Q,type:"color",value:t.screenText.style.background.color,onChange:l=>g(n=>({...n,style:{...n.style,background:{...n.style.background,color:l.target.value}}}))})]}):e.jsx("div",{style:{gridColumn:"1 / -1",display:"grid",gap:6},children:t.screenText.style.background.gradientStops.slice(0,3).map((l,n)=>e.jsxs("label",{style:z,children:[e.jsxs("span",{style:x,children:["Gradient ",n+1]}),e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 60px",gap:4},children:[e.jsx("input",{style:Q,type:"color",value:l.color,onChange:W=>g(m=>{const f=[...m.style.background.gradientStops];return f[n]={...f[n],color:W.target.value},{...m,style:{...m.style,background:{...m.style.background,gradientStops:f}}}})}),e.jsx(E,{value:l.position,min:0,max:1,step:.05,onChange:W=>g(m=>{const f=[...m.style.background.gradientStops];return f[n]={...f[n],position:W},{...m,style:{...m.style,background:{...m.style.background,gradientStops:f}}}})})]})]},n))}),e.jsxs("label",{style:z,children:[e.jsx("span",{style:x,children:"Background Opacity"}),e.jsx(E,{value:t.screenText.style.background.opacity,min:0,max:1,step:.05,onChange:l=>g(n=>({...n,style:{...n.style,background:{...n.style.background,opacity:l}}}))})]}),e.jsxs("label",{style:z,children:[e.jsx("span",{style:x,children:"Corner Radius"}),e.jsx(E,{value:t.screenText.style.background.borderRadius,min:0,max:200,step:2,onChange:l=>g(n=>({...n,style:{...n.style,background:{...n.style.background,borderRadius:l}}}))})]}),e.jsx("label",{style:T,children:e.jsxs("div",{style:F,children:[e.jsx("span",{style:x,children:"Background Stroke"}),e.jsx("input",{type:"checkbox",style:B,checked:t.screenText.style.background.borderEnabled,onChange:l=>g(n=>({...n,style:{...n.style,background:{...n.style.background,borderEnabled:l.target.checked,borderColor:l.target.checked&&n.style.background.borderColor==="transparent"?"#ffffff":n.style.background.borderColor,borderWidth:l.target.checked?Math.max(n.style.background.borderWidth,2):n.style.background.borderWidth}}}))})]})}),e.jsxs("label",{style:z,children:[e.jsx("span",{style:x,children:"Stroke Color"}),e.jsx("input",{style:{...Q,...t.screenText.style.background.borderEnabled?{}:zt},type:"color",value:t.screenText.style.background.borderColor,disabled:!t.screenText.style.background.borderEnabled,onChange:l=>g(n=>({...n,style:{...n.style,background:{...n.style.background,borderColor:l.target.value}}}))})]}),e.jsxs("label",{style:z,children:[e.jsx("span",{style:x,children:"Stroke Width"}),e.jsx(E,{value:t.screenText.style.background.borderWidth,min:0,max:64,step:1,disabled:!t.screenText.style.background.borderEnabled,onChange:l=>g(n=>({...n,style:{...n.style,background:{...n.style.background,borderWidth:l}}}))})]}),e.jsx("label",{style:T,children:e.jsxs("div",{style:F,children:[e.jsx("span",{style:x,children:"Auto Width / Height"}),e.jsx("input",{type:"checkbox",style:B,checked:t.screenText.style.background.autoSize,onChange:l=>g(n=>({...n,style:{...n.style,background:{...n.style.background,autoSize:l.target.checked}}}))})]})}),e.jsxs("label",{style:z,children:[e.jsx("span",{style:x,children:"Width"}),e.jsx(E,{value:t.screenText.style.background.width,min:32,max:1024,step:8,disabled:t.screenText.style.background.autoSize,onChange:l=>g(n=>({...n,style:{...n.style,background:{...n.style.background,width:l}}}))})]}),e.jsxs("label",{style:z,children:[e.jsx("span",{style:x,children:"Height"}),e.jsx(E,{value:t.screenText.style.background.height,min:32,max:1024,step:8,disabled:t.screenText.style.background.autoSize,onChange:l=>g(n=>({...n,style:{...n.style,background:{...n.style.background,height:l}}}))})]})]}):null]}):null]})),xe("layout","Layout",e.jsx(ws,{}),e.jsxs("div",{style:U,children:[e.jsxs("label",{style:z,children:[e.jsx("span",{style:x,children:"Text Align"}),e.jsxs("select",{style:J,value:t.screenText.layout.textAlign??"center",onChange:l=>g(n=>({...n,layout:{...n.layout,textAlign:l.target.value}})),children:[e.jsx("option",{value:"left",children:"left"}),e.jsx("option",{value:"center",children:"center"}),e.jsx("option",{value:"right",children:"right"})]})]}),e.jsxs("label",{style:z,children:[e.jsx("span",{style:x,children:"Y Position"}),e.jsxs("select",{style:J,value:t.screenText.layout.verticalAlign??"center",onChange:l=>g(n=>({...n,layout:{...n.layout,verticalAlign:l.target.value}})),children:[e.jsx("option",{value:"top",children:"top"}),e.jsx("option",{value:"center",children:"center"}),e.jsx("option",{value:"bottom",children:"bottom"})]})]}),e.jsxs("label",{style:z,children:[e.jsx("span",{style:x,children:"Overflow"}),e.jsxs("select",{style:J,value:t.screenText.layout.overflow,onChange:l=>g(n=>({...n,layout:{...n.layout,overflow:l.target.value}})),children:[e.jsx("option",{value:"clip",children:"clip"}),e.jsx("option",{value:"ellipsis",children:"ellipsis"}),e.jsx("option",{value:"clamp",children:"clamp"}),e.jsx("option",{value:"shrink",children:"shrink"})]})]}),e.jsx("label",{style:T,children:e.jsxs("div",{style:F,children:[e.jsx("span",{style:x,children:"Resize To Fit"}),e.jsx("input",{type:"checkbox",style:B,checked:t.screenText.layout.resizeToFit===!0,onChange:l=>g(n=>({...n,layout:{...n.layout,resizeToFit:l.target.checked}}))})]})})]})),xe("visibility","Visibility",e.jsx(Ss,{}),e.jsxs("div",{style:U,children:[e.jsx("label",{style:T,children:e.jsxs("div",{style:F,children:[e.jsx("span",{style:x,children:"Enable UI"}),e.jsx("input",{type:"checkbox",style:B,checked:t.screenSpaceUI.enabled,onChange:l=>i({...t,screenSpaceUI:{...t.screenSpaceUI,enabled:l.target.checked}})})]})}),e.jsx("label",{style:T,children:e.jsxs("div",{style:F,children:[e.jsx("span",{style:x,children:"Enable Text"}),e.jsx("input",{type:"checkbox",style:B,checked:t.screenText.enabled,onChange:l=>g(n=>({...n,enabled:l.target.checked}))})]})})]}))]}))})]}):e.jsx("div",{role:"button",tabIndex:0,onClick:()=>j(!0),style:ss,children:e.jsx(gs,{})})]}),document.body)},zs="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAtAAAAUAAgMAAAAToI2uAAAAAXNSR0IB2cksfwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAlQTFRFqampbGxsAAAA/lGquwAAAAN0Uk5T//8A18oNQQAABPRJREFUeJztzssNQWEYQEG3CP1oQqJGsdCfBFs7j8X8+eRMBbPtBtpWB35RWimtlFZKK6WV0kppZWj6uLrwrceltFFaKa2UVkorpZXSSmlldPp2XT350P5Q2iitlFZKK6WV0kpppbRSWimtlFZKK3+RPq8OvXM/lTZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK3+THqG0UloprZRWSiulldJKaaW0UloprZRWSiuv6VFKK6WV0kpppbRSWimtlFbGpgcqrZRWSiulldJKaaW0MjL9BFWtRqVFuJpUAAAAAElFTkSuQmCC",Rs={placeholder:"Placeholder","hero-image":"Hero Image","photo-frame":"Default Frame"},Ws=Object.entries(Rs).map(([t,i])=>({value:t,label:i})),Is={placeholder:{transformation:{showFitGuides:!1},image:{sourceKind:"default",stretchMode:"fit",materialType:"unlit",blendMode:"normal",opacity:1,color:"#ffffff",flipX:!1,flipY:!1,transparent:!0,alphaTest:0}},"hero-image":{transformation:{position:{x:0,y:.08},size:{width:.96,height:.62},rotation:0,pivot:[.5,.5],overlay:!0,visible:!0},image:{sourceKind:"image",stretchMode:"fillAndCut",materialType:"unlit",blendMode:"normal",opacity:1,color:"#ffffff",flipX:!1,flipY:!1,transparent:!0,alphaTest:0}},"photo-frame":{transformation:{position:{x:0,y:.01},size:{width:2,height:2},rotation:0,pivot:[.5,.5],overlay:!0,visible:!0},image:{sourceKind:"image",src:zs,stretchMode:"fill",materialType:"unlit",blendMode:"normal",opacity:1,color:"#ffffff",flipX:!1,flipY:!1,transparent:!0,alphaTest:0}}},Es=(t,i)=>{const p=Is[i];return{...t,preset:i,...p.enabled!==void 0?{enabled:p.enabled}:{},transformation:{...t.transformation,...p.transformation??{}},image:{...t.image,...p.image??{}}}},Ts={display:"grid",gridTemplateColumns:"repeat(2, minmax(0, 1fr))",gap:6},Te={display:"flex",flexDirection:"column",gap:4},Ls={...Te,gridColumn:"1 / -1"},ve={fontSize:9,color:"rgba(226,232,240,0.72)"},Je={width:"100%",height:24,borderRadius:7,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(15,23,42,0.68)",color:"#f8fafc",fontSize:10.5,outline:"none",padding:"0 7px",boxSizing:"border-box"},lt={...Je,appearance:"none"},Fs={...Je,fontVariantNumeric:"tabular-nums"},Ms={...Je,padding:2,cursor:"pointer"},Hs=t=>/^-?\d*(\.\d*)?$/.test(t),it=({value:t,onChange:i,step:p=1,min:w,max:j})=>{const[S,R]=c.useState(String(t));c.useEffect(()=>R(String(t)),[t]);const k=u=>{let r=u;return typeof w=="number"&&(r=Math.max(w,r)),typeof j=="number"&&(r=Math.min(j,r)),r};return e.jsx("input",{type:"text",inputMode:"decimal",pattern:"-?[0-9]*[.,]?[0-9]*",style:Fs,value:S,onChange:u=>{const r=u.target.value;if(!Hs(r)||(R(r),r===""||r==="-"||r==="."||r==="-."))return;const o=Number(r);Number.isNaN(o)||i(k(o))},onBlur:()=>{const u=Number(S);if(Number.isNaN(u)){R(String(t));return}const r=k(u);R(String(r)),i(r)},onKeyDown:u=>{if(u.key!=="ArrowUp"&&u.key!=="ArrowDown")return;u.preventDefault();const r=u.shiftKey?p*10:u.altKey?p/10:p,o=u.key==="ArrowUp"?t+r:t-r;i(k(Number.isInteger(o)?o:Number(o.toFixed(6))))}})},Ks=({value:t,onChange:i})=>e.jsxs("div",{style:Ts,children:[e.jsxs("label",{style:Te,children:[e.jsx("span",{style:ve,children:"Material Type"}),e.jsxs("select",{style:lt,value:t.materialType,onChange:p=>i({...t,materialType:p.target.value}),children:[e.jsx("option",{value:"unlit",children:"Unlit"}),e.jsx("option",{value:"standardPBR",children:"Standard PBR"}),e.jsx("option",{value:"matcap",children:"Matcap"})]})]}),e.jsxs("label",{style:Te,children:[e.jsx("span",{style:ve,children:"Blend Mode"}),e.jsxs("select",{style:lt,value:t.blendMode,onChange:p=>i({...t,blendMode:p.target.value}),children:[e.jsx("option",{value:"normal",children:"Normal"}),e.jsx("option",{value:"add",children:"Add"}),e.jsx("option",{value:"subtract",children:"Subtract"}),e.jsx("option",{value:"multiply",children:"Multiply"}),e.jsx("option",{value:"screen",children:"Screen"}),e.jsx("option",{value:"lighten",children:"Lighten"}),e.jsx("option",{value:"darken",children:"Darken"}),e.jsx("option",{value:"overlay",children:"Overlay"}),e.jsx("option",{value:"softLight",children:"Soft Light"}),e.jsx("option",{value:"hardLight",children:"Hard Light"}),e.jsx("option",{value:"difference",children:"Difference"}),e.jsx("option",{value:"exclusion",children:"Exclusion"})]})]}),e.jsxs("label",{style:Te,children:[e.jsx("span",{style:ve,children:"Opacity"}),e.jsx(it,{value:t.opacity,min:0,max:1,step:.01,onChange:p=>i({...t,opacity:p})})]}),e.jsxs("label",{style:Te,children:[e.jsx("span",{style:ve,children:"Tint"}),e.jsx("input",{type:"color",style:Ms,value:t.color,onChange:p=>i({...t,color:p.target.value})})]}),e.jsxs("label",{style:Ls,children:[e.jsx("span",{style:ve,children:"Alpha Test"}),e.jsx(it,{value:t.alphaTest,min:0,max:1,step:.01,onChange:p=>i({...t,alphaTest:p})})]})]}),Bs={position:"fixed",left:14,top:104,zIndex:2e4,pointerEvents:"none"},Rt={pointerEvents:"auto",width:298,borderRadius:16,border:"1px solid rgba(255,255,255,0.12)",background:"rgba(8, 15, 28, 0.58)",boxShadow:"0 16px 36px rgba(0,0,0,0.28)",backdropFilter:"blur(20px) saturate(1.1)",WebkitBackdropFilter:"blur(20px) saturate(1.1)",color:"#f8fafc",overflowX:"hidden",overflowY:"auto",scrollbarWidth:"thin",scrollbarColor:"rgba(148,163,184,0.55) rgba(255,255,255,0.06)",overscrollBehavior:"contain"},$s={...Rt,width:32,height:32,borderRadius:16,display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer"},Vs={position:"sticky",top:0,zIndex:1,display:"flex",alignItems:"center",gap:7,padding:"7px 8px",borderBottom:"1px solid rgba(255,255,255,0.08)",background:"rgba(8, 15, 28, 0.88)",backdropFilter:"blur(20px) saturate(1.1)",WebkitBackdropFilter:"blur(20px) saturate(1.1)"},As={width:16,height:16,display:"flex",alignItems:"center",justifyContent:"center",cursor:"grab",color:"rgba(148,163,184,0.82)",flex:"0 0 auto"},Ns={display:"flex",alignItems:"center",gap:6,fontSize:11,fontWeight:600,minWidth:0},ot={display:"flex",width:18,height:18,alignItems:"center",justifyContent:"center",borderRadius:6,background:"rgba(255,255,255,0.08)",border:"1px solid rgba(255,255,255,0.08)",color:"#e2e8f0",flex:"0 0 auto"},Ds={display:"grid",gap:6,padding:7},Os={borderRadius:12,border:"1px solid rgba(255,255,255,0.08)",background:"rgba(255,255,255,0.03)",overflow:"hidden"},Ps={display:"flex",alignItems:"center",gap:7,padding:"6px 7px"},Zs={display:"flex",alignItems:"center",gap:6,fontSize:11,fontWeight:500,flex:"1 1 auto",minWidth:0},_s={width:28,height:16,borderRadius:999,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(255,255,255,0.08)",padding:2,display:"flex",alignItems:"center",cursor:"pointer",flex:"0 0 auto"},Xs=t=>({width:10,height:10,borderRadius:999,background:t?"#f8fafc":"rgba(148,163,184,0.7)",transform:t?"translateX(12px)":"translateX(0)",transition:"transform 140ms ease, background 140ms ease"}),Gs={display:"grid",gap:7,padding:"0 7px 7px"},Ys={display:"grid",gridTemplateColumns:"repeat(2, minmax(0, 1fr))",gap:6},Ge={display:"flex",flexDirection:"column",gap:4},ee={...Ge,gridColumn:"1 / -1"},G={fontSize:9,color:"rgba(226,232,240,0.72)"},Us={width:"100%",height:24,borderRadius:7,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(15,23,42,0.68)",color:"#f8fafc",fontSize:10.5,outline:"none",padding:"0 7px",boxSizing:"border-box"},rt={...Us,appearance:"none"},te={display:"flex",alignItems:"center",justifyContent:"space-between",gap:12,minHeight:24},se={width:16,height:16},at={display:"inline-flex",alignItems:"center",justifyContent:"center",width:24,height:24,borderRadius:8,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(255,255,255,0.05)",color:"#e2e8f0",cursor:"pointer",padding:0,flex:"0 0 auto"},Js=()=>e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M7 10h10v2H7v-2zm0 4h10v2H7v-2zm0-8h10v2H7V6z"})}),qs=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M18.3 5.71 12 12l6.3 6.29-1.41 1.41L10.59 13.41 4.29 19.7 2.88 18.29 9.17 12 2.88 5.71 4.29 4.3l6.3 6.29 6.29-6.3z"})}),Qs=()=>e.jsx("svg",{width:"11",height:"15",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M8 6a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM8 12a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM8 18a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM16 6a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM16 12a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM16 18a2 2 0 1 1-4 0 2 2 0 0 1 4 0z"})}),dt=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M5 4h14a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2zm0 2v8.76l4.5-4.5 3.2 3.2 2.8-2.8L19 14.16V6H5zm12 3a2 2 0 1 1-4 0 2 2 0 0 1 4 0z"})}),en=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M11 2h2v4h3l-4 4-4-4h3V2zm0 20v-4H8l4-4 4 4h-3v4h-2zM2 11h4V8l4 4-4 4v-3H2v-2zm20 0v2h-4v3l-4-4 4-4v3h4z"})}),tn=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M7 7h10a5 5 0 1 1 0 10H7A5 5 0 1 1 7 7zm0 2a3 3 0 1 0 0 6h10a3 3 0 1 0 0-6H7z"})}),sn=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M12 5V2L7 7l5 5V9a4 4 0 1 1-4 4H6a6 6 0 1 0 6-8z"})}),ct=t=>({enabled:t.enabled,showGuides:t.showFitGuides,coordinateSpace:t.coordinateSpace,canvasSize:t.canvasSize,position:t.position,size:t.size,rotation:t.rotation,pivot:t.pivot,renderOrder:t.renderOrder,overlay:t.overlay,visible:t.visible}),nn=(t,i)=>({...i,enabled:t.enabled,showFitGuides:t.showGuides,coordinateSpace:t.coordinateSpace,canvasSize:t.canvasSize,position:t.position,size:t.size,rotation:t.rotation,pivot:t.pivot,renderOrder:t.renderOrder,overlay:t.overlay,visible:t.visible}),ln=({value:t,onChange:i,copyLabel:p})=>{const[w,j]=c.useState(!0),[S,R]=c.useState({x:14,y:104}),[k,u]=c.useState(typeof window>"u"?0:window.innerHeight),[r,o]=c.useState({transformation:!0,image:!0,visibility:!1}),v=c.useRef(null),d=Math.max(240,k-S.y-16);c.useEffect(()=>{const a=I=>{v.current&&R({x:Math.max(8,I.clientX-v.current.x),y:Math.max(8,I.clientY-v.current.y)})},b=()=>{v.current=null,document.body.classList.remove("select-none")};return window.addEventListener("pointermove",a),window.addEventListener("pointerup",b),()=>{window.removeEventListener("pointermove",a),window.removeEventListener("pointerup",b)}},[]),c.useEffect(()=>{const a=()=>u(window.innerHeight);return window.addEventListener("resize",a),()=>window.removeEventListener("resize",a)},[]);const h=a=>{const b=a.currentTarget.getBoundingClientRect();v.current={x:a.clientX-b.left,y:a.clientY-b.top},document.body.classList.add("select-none"),a.currentTarget.setPointerCapture(a.pointerId)},s=a=>{i({...t,screenImage:a(t.screenImage)})},y=(a,b,I,N)=>e.jsxs("div",{style:Os,children:[e.jsxs("div",{style:Ps,children:[e.jsx("button",{type:"button",onClick:()=>o(C=>({...C,[a]:!C[a]})),style:_s,children:e.jsx("div",{style:Xs(r[a])})}),e.jsxs("div",{style:Zs,children:[e.jsx("span",{style:ot,children:I}),e.jsx("span",{children:b})]})]}),r[a]?e.jsx("div",{style:Gs,children:N}):null]},a);return typeof document>"u"?null:ie.createPortal(e.jsxs("div",{style:{...Bs,left:S.x,top:S.y},children:[e.jsx("style",{children:`
7
- .xr-screen-image-settings-scroll::-webkit-scrollbar { width: 10px; }
8
- .xr-screen-image-settings-scroll::-webkit-scrollbar-track { background: rgba(255,255,255,0.06); border-radius: 999px; }
9
- .xr-screen-image-settings-scroll::-webkit-scrollbar-thumb { background: rgba(148,163,184,0.55); border-radius: 999px; border: 2px solid transparent; background-clip: padding-box; }
10
- .xr-screen-image-settings-scroll::-webkit-scrollbar-thumb:hover { background: rgba(226,232,240,0.68); background-clip: padding-box; }
11
- `}),w?e.jsxs("div",{className:"xr-screen-image-settings-scroll",style:{...Rt,height:d},children:[e.jsxs("div",{style:Vs,children:[e.jsx("div",{onPointerDown:h,style:As,children:e.jsx(Qs,{})}),e.jsxs("div",{style:Ns,children:[e.jsx("span",{style:ot,children:e.jsx(dt,{})}),e.jsx("span",{children:"Screen Image"})]}),e.jsx("div",{style:{flex:"1 1 auto"}}),e.jsx("button",{type:"button",onClick:()=>i(Kt.DEFAULT_SCREEN_IMAGE_SCENE_SETTINGS),style:at,children:e.jsx(sn,{})}),e.jsx("button",{type:"button",onClick:()=>j(!1),style:at,children:e.jsx(qs,{})})]}),e.jsxs("div",{style:Ds,children:[y("transformation","Transformation",e.jsx(en,{}),e.jsx(vt,{value:ct(t.screenImage.transformation),guideLabel:"Show Fit Guides",copyLabel:p,copyValue:{name:p??"Selected screen image",kind:"screenImage",transform:ct(t.screenImage.transformation),image:t.screenImage.image,material:{materialType:t.screenImage.image.materialType,blendMode:t.screenImage.image.blendMode,opacity:t.screenImage.image.opacity,color:t.screenImage.image.color,alphaTest:t.screenImage.image.alphaTest,transparent:t.screenImage.image.transparent},screenSpaceUI:t.screenSpaceUI},showRenderOrder:!1,onChange:a=>s(b=>({...b,transformation:nn(a,b.transformation)}))})),y("image","Image",e.jsx(dt,{}),e.jsxs("div",{style:{display:"grid",gap:6},children:[e.jsxs("label",{style:Ge,children:[e.jsx("span",{style:G,children:"Preset"}),e.jsx("select",{style:rt,value:t.screenImage.preset,onChange:a=>s(b=>Es(b,a.target.value)),children:Ws.map(a=>e.jsx("option",{value:a.value,children:a.label},a.value))})]}),e.jsxs("label",{style:Ge,children:[e.jsx("span",{style:G,children:"Stretch Mode"}),e.jsxs("select",{style:rt,value:t.screenImage.image.stretchMode,onChange:a=>s(b=>({...b,image:{...b.image,stretchMode:a.target.value}})),children:[e.jsx("option",{value:"fit",children:"Fit"}),e.jsx("option",{value:"fitWidth",children:"Fit Width"}),e.jsx("option",{value:"fitHeight",children:"Fit Height"}),e.jsx("option",{value:"stretch",children:"Stretch"}),e.jsx("option",{value:"fill",children:"Fill"}),e.jsx("option",{value:"fillAndCut",children:"Fill and Cut"})]})]}),e.jsx(Ks,{value:t.screenImage.image,onChange:a=>s(b=>({...b,image:{...b.image,materialType:a.materialType,blendMode:a.blendMode,opacity:a.opacity,color:a.color,alphaTest:a.alphaTest}}))})]})),y("visibility","Visibility",e.jsx(tn,{}),e.jsxs("div",{style:Ys,children:[e.jsx("label",{style:ee,children:e.jsxs("div",{style:te,children:[e.jsx("span",{style:G,children:"ScreenSpaceUI Enabled"}),e.jsx("input",{type:"checkbox",style:se,checked:t.screenSpaceUI.enabled,onChange:a=>i({...t,screenSpaceUI:{enabled:a.target.checked}})})]})}),e.jsx("label",{style:ee,children:e.jsxs("div",{style:te,children:[e.jsx("span",{style:G,children:"Screen Image Enabled"}),e.jsx("input",{type:"checkbox",style:se,checked:t.screenImage.enabled,onChange:a=>s(b=>({...b,enabled:a.target.checked}))})]})}),e.jsx("label",{style:ee,children:e.jsxs("div",{style:te,children:[e.jsx("span",{style:G,children:"Transformation Enabled"}),e.jsx("input",{type:"checkbox",style:se,checked:t.screenImage.transformation.enabled,onChange:a=>s(b=>({...b,transformation:{...b.transformation,enabled:a.target.checked}}))})]})}),e.jsx("label",{style:ee,children:e.jsxs("div",{style:te,children:[e.jsx("span",{style:G,children:"Visible"}),e.jsx("input",{type:"checkbox",style:se,checked:t.screenImage.transformation.visible,onChange:a=>s(b=>({...b,transformation:{...b.transformation,visible:a.target.checked}}))})]})}),e.jsx("label",{style:ee,children:e.jsxs("div",{style:te,children:[e.jsx("span",{style:G,children:"Overlay"}),e.jsx("input",{type:"checkbox",style:se,checked:t.screenImage.transformation.overlay,onChange:a=>s(b=>({...b,transformation:{...b.transformation,overlay:a.target.checked}}))})]})}),e.jsx("label",{style:ee,children:e.jsxs("div",{style:te,children:[e.jsx("span",{style:G,children:"Flip X"}),e.jsx("input",{type:"checkbox",style:se,checked:t.screenImage.image.flipX,onChange:a=>s(b=>({...b,image:{...b.image,flipX:a.target.checked}}))})]})}),e.jsx("label",{style:ee,children:e.jsxs("div",{style:te,children:[e.jsx("span",{style:G,children:"Flip Y"}),e.jsx("input",{type:"checkbox",style:se,checked:t.screenImage.image.flipY,onChange:a=>s(b=>({...b,image:{...b.image,flipY:a.target.checked}}))})]})}),e.jsx("label",{style:ee,children:e.jsxs("div",{style:te,children:[e.jsx("span",{style:G,children:"Transparent"}),e.jsx("input",{type:"checkbox",style:se,checked:t.screenImage.image.transparent,onChange:a=>s(b=>({...b,image:{...b.image,transparent:a.target.checked}}))})]})})]}))]})]}):e.jsx("div",{role:"button",tabIndex:0,onClick:()=>j(!0),style:$s,children:e.jsx(Js,{})})]}),document.body)},on={position:"fixed",left:14,top:104,zIndex:2e4,pointerEvents:"none"},Wt={pointerEvents:"auto",width:286,borderRadius:16,border:"1px solid rgba(255,255,255,0.12)",background:"rgba(8, 15, 28, 0.58)",boxShadow:"0 16px 36px rgba(0,0,0,0.28)",backdropFilter:"blur(20px) saturate(1.1)",WebkitBackdropFilter:"blur(20px) saturate(1.1)",color:"#f8fafc",overflowX:"hidden",overflowY:"auto",scrollbarWidth:"thin",scrollbarColor:"rgba(148,163,184,0.55) rgba(255,255,255,0.06)",overscrollBehavior:"contain"},rn={...Wt,width:32,height:32,borderRadius:16,display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer"},an={position:"sticky",top:0,zIndex:1,display:"flex",alignItems:"center",gap:7,padding:"7px 8px",borderBottom:"1px solid rgba(255,255,255,0.08)",background:"rgba(8, 15, 28, 0.88)",backdropFilter:"blur(20px) saturate(1.1)",WebkitBackdropFilter:"blur(20px) saturate(1.1)"},dn={width:16,height:16,display:"flex",alignItems:"center",justifyContent:"center",cursor:"grab",color:"rgba(148,163,184,0.82)",flex:"0 0 auto"},cn={display:"flex",alignItems:"center",gap:6,fontSize:11,fontWeight:600,minWidth:0},ht={display:"flex",width:18,height:18,alignItems:"center",justifyContent:"center",borderRadius:6,background:"rgba(255,255,255,0.08)",border:"1px solid rgba(255,255,255,0.08)",color:"#e2e8f0",flex:"0 0 auto"},hn={display:"grid",gap:6,padding:7},pn={borderRadius:12,border:"1px solid rgba(255,255,255,0.08)",background:"rgba(255,255,255,0.03)",overflow:"hidden"},yn={display:"flex",alignItems:"center",gap:7,padding:"6px 7px"},xn={display:"flex",alignItems:"center",gap:6,fontSize:11,fontWeight:500,flex:"1 1 auto",minWidth:0},gn={width:28,height:16,borderRadius:999,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(255,255,255,0.08)",padding:2,display:"flex",alignItems:"center",cursor:"pointer",flex:"0 0 auto"},bn=t=>({width:10,height:10,borderRadius:999,background:t?"#f8fafc":"rgba(148,163,184,0.7)",transform:t?"translateX(12px)":"translateX(0)",transition:"transform 140ms ease, background 140ms ease"}),un={display:"grid",gap:7,padding:"0 7px 7px"},fn={display:"grid",gridTemplateColumns:"repeat(2, minmax(0, 1fr))",gap:6},ye={display:"flex",flexDirection:"column",gap:4},Ce={...ye,gridColumn:"1 / -1"},Z={fontSize:9,color:"rgba(226,232,240,0.72)"},me={width:"100%",height:24,borderRadius:7,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(15,23,42,0.68)",color:"#f8fafc",fontSize:10.5,outline:"none",padding:"0 7px",boxSizing:"border-box"},ze={display:"flex",alignItems:"center",justifyContent:"space-between",gap:12,minHeight:24},Re={width:16,height:16},pt={display:"inline-flex",alignItems:"center",justifyContent:"center",width:24,height:24,borderRadius:8,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(255,255,255,0.05)",color:"#e2e8f0",cursor:"pointer",padding:0,flex:"0 0 auto"},jn=()=>e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M7 10h10v2H7v-2zm0 4h10v2H7v-2zm0-8h10v2H7V6z"})}),mn=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M18.3 5.71 12 12l6.3 6.29-1.41 1.41L10.59 13.41 4.29 19.7 2.88 18.29 9.17 12 2.88 5.71 4.29 4.3l6.3 6.29 6.29-6.3z"})}),wn=()=>e.jsx("svg",{width:"11",height:"15",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M8 6a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM8 12a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM8 18a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM16 6a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM16 12a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM16 18a2 2 0 1 1-4 0 2 2 0 0 1 4 0z"})}),Oe=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M11 2a1 1 0 0 1 1 1v6h1V3a1 1 0 1 1 2 0v6h1V4a1 1 0 1 1 2 0v7.3l1.6 2.4a5 5 0 0 1 .8 2.7V18a4 4 0 0 1-4 4H9a6 6 0 0 1-6-6v-3.5a2.5 2.5 0 0 1 5 0V15h1V3a1 1 0 0 1 1-1z"})}),Sn=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M12 5V2L7 7l5 5V9a4 4 0 1 1-4 4H6a6 6 0 1 0 6-8z"})}),kn=({value:t,onChange:i})=>{const[p,w]=c.useState(!0),[j,S]=c.useState({x:14,y:104}),[R,k]=c.useState(typeof window>"u"?0:window.innerHeight),[u,r]=c.useState({overlay:!0,visibility:!1}),o=c.useRef(null),v=Math.max(240,R-j.y-16);c.useEffect(()=>{const s=a=>{o.current&&S({x:Math.max(8,a.clientX-o.current.x),y:Math.max(8,a.clientY-o.current.y)})},y=()=>{o.current=null,document.body.classList.remove("select-none")};return window.addEventListener("pointermove",s),window.addEventListener("pointerup",y),()=>{window.removeEventListener("pointermove",s),window.removeEventListener("pointerup",y)}},[]),c.useEffect(()=>{const s=()=>k(window.innerHeight);return window.addEventListener("resize",s),()=>window.removeEventListener("resize",s)},[]);const d=s=>{const y=s.currentTarget.getBoundingClientRect();o.current={x:s.clientX-y.left,y:s.clientY-y.top},document.body.classList.add("select-none"),s.currentTarget.setPointerCapture(s.pointerId)},h=(s,y,a,b)=>e.jsxs("div",{style:pn,children:[e.jsxs("div",{style:yn,children:[e.jsx("button",{type:"button",onClick:()=>r(I=>({...I,[s]:!I[s]})),style:gn,children:e.jsx("div",{style:bn(u[s])})}),e.jsxs("div",{style:xn,children:[e.jsx("span",{style:ht,children:a}),e.jsx("span",{children:y})]})]}),u[s]?e.jsx("div",{style:un,children:b}):null]},s);return typeof document>"u"?null:ie.createPortal(e.jsxs("div",{style:{...on,left:j.x,top:j.y},children:[e.jsx("style",{children:`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Oe=require("./session-3aCMNb8W.cjs"),Hs=require("./debug-ui/default-setting.cjs"),e=require("react/jsx-runtime"),y=require("react"),Le=require("./renderGroups-B0N58SIA.cjs"),K=require("./index-CYwAL_d7.cjs"),Ae=require("react-dom"),$e=require("./index-J3Qy6hi3.cjs"),Gs=require("three"),J=require("./renderPasses-Bt8k0dkm.cjs"),Ne=require("./settings-C63FMBlF.cjs"),N=require("./FaceRetouch-DHhn1nSV.cjs"),It=require("./landmarkMask-CvN-L5NT.cjs"),_s=require("./index-DzdKBXGE.cjs"),Us=require("./index-LC2Xs08E.cjs"),Zt=require("@react-three/drei"),Xs=require("@react-three/fiber"),Yt=require("./index-Bxb_UcfF.cjs"),Zs=require("./contexts-CSz9stBV.cjs"),Ys=require("./selectors-Bq6tSgOY.cjs"),qs={position:"fixed",zIndex:2e4,pointerEvents:"none"},kt={width:"100%",maxHeight:"none",border:"none",borderRadius:0,background:"transparent",boxShadow:"none",backdropFilter:"none",WebkitBackdropFilter:"none",overflow:"visible"},js=({docked:t=!1,initialPosition:s,position:l,onPositionChange:n})=>{const[a,d]=y.useState(s),r=l??a,o=y.useRef(null),h=y.useRef(n);return h.current=n,y.useEffect(()=>{if(t)return;const p=g=>{var j;const i=o.current;if(!i)return;const u={x:Math.max(8,g.clientX-i.x),y:Math.max(8,g.clientY-i.y)};d(u),(j=h.current)==null||j.call(h,u)},f=()=>{const g=o.current;g&&(o.current=null,g.selectNone&&document.body.classList.remove("select-none"))};return window.addEventListener("pointermove",p),window.addEventListener("pointerup",f),()=>{window.removeEventListener("pointermove",p),window.removeEventListener("pointerup",f)}},[t]),{docked:t,position:r,startDrag:(p,{capture:f=!0,selectNone:g=!0}={})=>{if(t)return;const i=p.currentTarget.getBoundingClientRect();o.current={x:p.clientX-i.left,y:p.clientY-i.top,selectNone:g},g&&document.body.classList.add("select-none"),f&&p.currentTarget.setPointerCapture(p.pointerId)},place:p=>t?p:typeof document>"u"?null:Ae.createPortal(e.jsx("div",{style:{...qs,left:r.x,top:r.y},children:p}),document.body)}},qt={pointerEvents:"auto",width:306,maxHeight:"calc(100vh - 124px)",borderRadius:16,border:"1px solid rgba(255,255,255,0.12)",background:"rgba(8, 15, 28, 0.58)",boxShadow:"0 16px 36px rgba(0,0,0,0.28)",backdropFilter:"blur(20px) saturate(1.1)",WebkitBackdropFilter:"blur(20px) saturate(1.1)",color:"#f8fafc",overflow:"hidden"},Js=306,Qs=()=>({x:typeof window>"u"?14:window.innerWidth-(Js+20),y:30}),en={display:"grid",gap:7,padding:"7px 8px 8px",borderBottom:"1px solid rgba(255,255,255,0.08)",background:"rgba(8, 15, 28, 0.88)"},ms={display:"grid",gridTemplateColumns:"16px 22px minmax(0, 1fr) 28px",alignItems:"center",gap:7},tn={...ms,gridTemplateColumns:"22px minmax(0, 1fr) 28px"},sn={display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:11,fontWeight:700},nn={width:"100%",height:24,borderRadius:7,border:"1px solid rgba(125,211,252,0.46)",background:"rgba(15,23,42,0.82)",color:"#f8fafc",fontSize:11,fontWeight:700,outline:"none",padding:"0 7px",boxSizing:"border-box"},ln={display:"flex",width:20,height:20,alignItems:"center",justifyContent:"center",borderRadius:7,background:"rgba(255,255,255,0.08)",border:"1px solid rgba(255,255,255,0.08)",color:"#e2e8f0"},on={width:16,height:18,display:"flex",alignItems:"center",justifyContent:"center",cursor:"grab",color:"rgba(148,163,184,0.82)"},Jt={display:"grid",gap:8,padding:8,overflowY:"auto",maxHeight:"calc(100vh - 215px)"},rn={display:"grid",gridTemplateColumns:"minmax(0, 1fr) 30px",gap:6},an={width:"100%",height:26,borderRadius:8,border:"1px solid rgba(255,255,255,0.12)",background:"rgba(56,189,248,0.16)",color:"#e0f2fe",fontSize:10.5,fontWeight:700,cursor:"pointer"},dn=t=>({display:"inline-flex",alignItems:"center",justifyContent:"center",width:30,height:26,borderRadius:8,border:"1px solid rgba(255,255,255,0.10)",color:t?"#e0f2fe":"rgba(148,163,184,0.72)",background:t?"rgba(56,189,248,0.16)":"rgba(255,255,255,0.04)",cursor:"pointer",padding:0}),cn={display:"inline-flex",alignItems:"center",justifyContent:"center",width:28,height:24,borderRadius:8,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(255,255,255,0.05)",color:"#e2e8f0",cursor:"pointer",padding:0},pn={width:"fit-content",maxWidth:"100%",height:24,borderRadius:7,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(255,255,255,0.07)",color:"#e2e8f0",fontSize:10,padding:"0 8px"},hn=()=>e.jsx("svg",{width:"11",height:"15",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M8 6a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM8 12a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM8 18a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM16 6a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM16 12a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM16 18a2 2 0 1 1-4 0 2 2 0 0 1 4 0z"})}),xn=()=>e.jsx("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"m12 2 8 4.6v10.8L12 22l-8-4.6V6.6L12 2zm0 2.3L6.3 7.6 12 10.9l5.7-3.3L12 4.3zM6 9.3v6.9l5 2.9v-6.9L6 9.3zm12 0-5 2.9v6.9l5-2.9V9.3z"})}),un=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M12 5c5 0 8.7 4.2 10 7-1.3 2.8-5 7-10 7s-8.7-4.2-10-7c1.3-2.8 5-7 10-7zm0 2c-3.6 0-6.4 2.7-7.7 5 1.3 2.3 4.1 5 7.7 5s6.4-2.7 7.7-5C18.4 9.7 15.6 7 12 7zm0 2.5a2.5 2.5 0 1 1 0 5 2.5 2.5 0 0 1 0-5z"})}),gn=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M3.3 2 22 20.7 20.7 22l-3.1-3.1A10.5 10.5 0 0 1 12 20c-5 0-8.7-4.2-10-7a16.4 16.4 0 0 1 4-4.9L2 3.3 3.3 2zm4.1 7.5A14.4 14.4 0 0 0 4.3 13c1.3 2.3 4.1 5 7.7 5 1.5 0 2.8-.5 4-1.2l-2.1-2.1A2.5 2.5 0 0 1 9.3 10L7.4 9.5zM12 4c5 0 8.7 4.2 10 7a15 15 0 0 1-3.2 4.2l-1.4-1.4A13 13 0 0 0 19.7 11C18.4 8.7 15.6 6 12 6c-.9 0-1.8.2-2.6.5L7.8 4.9C9.1 4.3 10.5 4 12 4z"})}),yn=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M7 10h10v2H7v-2zm0 4h10v2H7v-2z"})}),bn=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M11 5h2v6h6v2h-6v6h-2v-6H5v-2h6V5z"})}),fn=async t=>{var l;if((l=navigator.clipboard)!=null&&l.writeText){await navigator.clipboard.writeText(t);return}const s=document.createElement("textarea");s.value=t,s.setAttribute("readonly",""),s.style.position="fixed",s.style.left="-9999px",document.body.appendChild(s),s.select(),document.execCommand("copy"),document.body.removeChild(s)},Ct=({children:t,copyConfig:s,docked:l=!1,initialPosition:n,layer:a="Default Layer",objectId:d,objectName:r,onObjectNameChange:o,onPositionChange:h,onVisibleChange:x,position:c,title:p,visible:f})=>{const{startDrag:g,place:i}=js({docked:l,initialPosition:n??Qs,position:c,onPositionChange:h}),[u,j]=y.useState(!1),[w,v]=y.useState(!0),M=r??p??d??"Scene Object",[U,b]=y.useState(!1),[F,E]=y.useState(M);y.useEffect(()=>{U||E(M)},[M,U]);const P=async()=>{try{await fn(JSON.stringify(s,null,2)),j(!0),window.setTimeout(()=>j(!1),1200)}catch{j(!1)}},le=()=>{const L=F.trim();if(b(!1),!o||!L||L===M){E(M);return}o(L)},ae=()=>{E(M),b(!1)};return i(e.jsxs("div",{style:l?{...qt,...kt}:qt,children:[e.jsxs("div",{style:en,children:[e.jsxs("div",{style:l?tn:ms,children:[!l&&e.jsx("div",{onPointerDown:g,style:on,children:e.jsx(hn,{})}),e.jsx("span",{style:ln,children:e.jsx(xn,{})}),U?e.jsx("input",{autoFocus:!0,"aria-label":"Object Name",style:nn,value:F,onBlur:le,onChange:L=>E(L.currentTarget.value),onKeyDown:L=>{L.key==="Enter"&&le(),L.key==="Escape"&&ae()}}):e.jsx("button",{type:"button",style:{...sn,padding:0,border:0,background:"transparent",color:"inherit",cursor:o?"text":"default",textAlign:"left"},onDoubleClick:()=>{o&&b(!0)},children:M}),e.jsx("button",{type:"button","aria-label":w?"Fold Inspector":"Expand Inspector",title:w?"Fold Inspector":"Expand Inspector",style:cn,onClick:()=>v(L=>!L),children:w?e.jsx(yn,{}):e.jsx(bn,{})})]}),w?e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",style:pn,children:a}),e.jsxs("div",{style:rn,children:[e.jsx("button",{type:"button",style:an,onClick:P,children:u?"Copied Config":"Copy Config"}),e.jsx("button",{type:"button",style:dn(f),onClick:()=>x(!f),children:f?e.jsx(un,{}):e.jsx(gn,{})})]})]}):null]}),w?e.jsx("div",{style:l?{...Jt,maxHeight:"none"}:Jt,children:t}):null]}))},jn={clean:{fontWeight:400,strokeLayers:[],shadowLayers:[]},sticker:{color:"#101828",fontWeight:800,strokeLayers:[{color:"#ffffff",width:26,opacity:1},{color:"#101828",width:10,opacity:1}],shadowLayers:[]},"shadow-pop":{color:"#fff8df",fontWeight:800,strokeLayers:[{color:"#101828",width:12,opacity:1}],shadowLayers:[{color:"#0f172a",blur:0,offsetX:18,offsetY:18,opacity:.9},{color:"#0f172a",blur:10,offsetX:10,offsetY:10,opacity:.35}]},neon:{color:"#ffffff",fontWeight:700,strokeLayers:[{color:"#9be7ff",width:8,opacity:.9}],shadowLayers:[{color:"#38bdf8",blur:18,opacity:.8},{color:"#0ea5e9",blur:40,opacity:.7},{color:"#7c3aed",blur:70,opacity:.5}]},editorial:{color:"#f8fafc",fontWeight:500,strokeLayers:[{color:"#0f172a",width:4,opacity:.5}],shadowLayers:[]},"comic-burst":{color:"#fff06a",fontWeight:900,strokeLayers:[{color:"#ef4444",width:28,opacity:1},{color:"#111827",width:12,opacity:1}],shadowLayers:[{color:"#111827",blur:0,offsetX:12,offsetY:12,opacity:.65}]},"ice-outline":{color:"#eff8ff",fontWeight:800,strokeLayers:[{color:"#dbeafe",width:16,opacity:1},{color:"#1d4ed8",width:6,opacity:.95}],shadowLayers:[{color:"#38bdf8",blur:24,opacity:.32}]},"sunset-glow":{color:"#fff7ed",fontWeight:800,strokeLayers:[{color:"#fb7185",width:8,opacity:.95}],shadowLayers:[{color:"#fb7185",blur:18,opacity:.7},{color:"#f97316",blur:42,opacity:.55},{color:"#facc15",blur:70,opacity:.28}]},cutout:{color:"#fffaf0",fontWeight:800,strokeLayers:[{color:"#0f172a",width:6,opacity:.9}],shadowLayers:[{color:"#0f172a",blur:0,offsetX:8,offsetY:8,opacity:.95},{color:"#0f172a",blur:0,offsetX:16,offsetY:16,opacity:.4}]},"badge-arc":{color:"#ffffff",fontWeight:900,outlineEnabled:!0,shadowEnabled:!0,glowEnabled:!1,innerShadowEnabled:!1,bendEnabled:!0,bend:{preset:"arc",strength:100},strokeLayers:[{color:"#0b1020",width:24,opacity:1},{color:"#ffffff",width:8,opacity:1}],shadowLayers:[{color:"#020617",blur:8,offset:10,angle:-45,feather:.2,opacity:.65}]},"chrome-bulge":{color:"#f8fafc",fontWeight:900,outlineEnabled:!0,shadowEnabled:!1,glowEnabled:!0,innerShadowEnabled:!0,bendEnabled:!0,bend:{preset:"bulge",strength:100},glow:{color:"#dbeafe",style:"contoured",intensity:.55,range:.35,horizontalAngle:0,verticalAngle:0},innerShadow:{color:"#64748b",opacity:.9,offset:16,angle:-45,feather:.25},strokeLayers:[{color:"#0f172a",width:5,opacity:.9}],shadowLayers:[]},"retro-wave":{color:"#fffbeb",fontWeight:900,outlineEnabled:!0,shadowEnabled:!0,glowEnabled:!0,innerShadowEnabled:!1,bendEnabled:!0,bend:{preset:"wave",strength:100},glow:{color:"#fb7185",style:"outward",intensity:.65,range:.55,horizontalAngle:0,verticalAngle:0},strokeLayers:[{color:"#fb7185",width:12,opacity:1},{color:"#7c2d12",width:5,opacity:.9}],shadowLayers:[{color:"#7c2d12",blur:4,offset:14,angle:45,feather:.1,opacity:.75}]},"flag-pop":{color:"#ffffff",fontWeight:900,outlineEnabled:!0,shadowEnabled:!0,glowEnabled:!0,innerShadowEnabled:!1,bendEnabled:!0,bend:{preset:"flag",strength:100},glow:{color:"#38bdf8",style:"outward",intensity:.5,range:.45,horizontalAngle:.15,verticalAngle:-.1},strokeLayers:[{color:"#fde047",width:18,opacity:1},{color:"#111827",width:7,opacity:1}],shadowLayers:[{color:"#111827",blur:0,offset:14,angle:35,feather:0,opacity:.75}]},"fisheye-poster":{color:"#fff7ed",fontWeight:900,outlineEnabled:!0,shadowEnabled:!0,glowEnabled:!1,innerShadowEnabled:!0,bendEnabled:!0,bend:{preset:"fisheye",strength:100},innerShadow:{color:"#92400e",opacity:.55,offset:10,angle:-45,feather:.15},strokeLayers:[{color:"#020617",width:24,opacity:1},{color:"#f97316",width:8,opacity:.9}],shadowLayers:[{color:"#020617",blur:0,offset:12,angle:40,feather:0,opacity:.8}]}},mn=[{label:"Space Grotesk",value:'"Space Grotesk", sans-serif'},{label:"Bebas Neue",value:'"Bebas Neue", sans-serif'},{label:"DM Serif Display",value:'"DM Serif Display", serif'},{label:"Caveat",value:'"Caveat", cursive'}],Sn=["clean","sticker","shadow-pop","neon","editorial","comic-burst","ice-outline","sunset-glow","cutout","badge-arc","chrome-bulge","retro-wave","flag-pop","fisheye-poster"],vn={clean:"NONE",sticker:"sticker","shadow-pop":"shadow-pop",neon:"neon",editorial:"editorial","comic-burst":"comic-burst","ice-outline":"ice-outline","sunset-glow":"sunset-glow",cutout:"cutout","badge-arc":"badge-arc","chrome-bulge":"chrome-bulge","retro-wave":"retro-wave","flag-pop":"flag-pop","fisheye-poster":"fisheye-poster"},wn=()=>({color:"#000000",opacity:1,width:30}),Bt=()=>({color:"#000000",opacity:1,offset:10,angle:-45,feather:0,blur:0,offsetX:7.071,offsetY:-7.071}),Ss=()=>({color:"#ffffff",style:"outward",intensity:.5,range:.5,horizontalAngle:0,verticalAngle:0}),vs=()=>({preset:"arc",strength:100}),kn=[{label:"Arc",value:"arc"},{label:"Arc Lower",value:"arc-lower"},{label:"Arc Upper",value:"arc-upper"},{label:"Arch",value:"arch"},{label:"Bulge",value:"bulge"},{label:"Shell Lower",value:"shell-lower"},{label:"Shell Upper",value:"shell-upper"},{label:"Flag",value:"flag"},{label:"Wave",value:"wave"},{label:"Fish",value:"fish"},{label:"Rise",value:"rise"},{label:"Fisheye",value:"fisheye"},{label:"Inflate",value:"inflate"},{label:"Squeeze",value:"squeeze"},{label:"Twist",value:"twist"}],Cn=(t,s)=>{const l=jn[s],n=l.strokeLayers??t.style.strokeLayers,a=l.shadowLayers??t.style.shadowLayers;return{...t,textArtPreset:s,style:{...t.style,...l,fontWeight:t.style.bold?"bold":l.fontWeight??t.style.fontWeight,background:{...t.style.background,...l.background},outlineEnabled:l.strokeLayers?l.strokeLayers.length>0:t.style.outlineEnabled,shadowEnabled:l.shadowLayers?l.shadowLayers.length>0:t.style.shadowEnabled,strokeLayers:n,shadowLayers:a}}},ws=(t,s)=>({enabled:(s==null?void 0:s.enabled)??t.enabled,showGuides:(s==null?void 0:s.showTransformGuides)??t.showTransformGuides,coordinateSpace:t.coordinateSpace,canvasSize:t.canvasSize,position:(s==null?void 0:s.position)??t.position,size:(s==null?void 0:s.size)??t.size,rotation:(s==null?void 0:s.rotation)??t.rotation,scale2D:s==null?void 0:s.scale2D,referencePixelsPerUnit:s==null?void 0:s.referencePixelsPerUnit,pivot:(s==null?void 0:s.pivot)??t.pivot,renderOrder:(s==null?void 0:s.renderOrder)??t.renderOrder,overlay:(s==null?void 0:s.overlay)??t.overlay,visible:(s==null?void 0:s.visible)??t.visible}),Rn=(t,s)=>({...s,enabled:t.enabled,showTransformGuides:t.showGuides,coordinateSpace:t.coordinateSpace,canvasSize:t.canvasSize,position:t.position,size:t.size,rotation:t.rotation,pivot:t.pivot,renderOrder:t.renderOrder,overlay:t.overlay,visible:t.visible}),ks=(t,s)=>({...$e.DEFAULT_SCREEN_TRANSFORM_2D,...s,enabled:t.enabled,showTransformGuides:t.showGuides,position:t.position,size:t.size,rotation:t.rotation,scale2D:t.scale2D??(s==null?void 0:s.scale2D)??$e.DEFAULT_SCREEN_TRANSFORM_2D.scale2D,referencePixelsPerUnit:t.referencePixelsPerUnit??(s==null?void 0:s.referencePixelsPerUnit)??$e.DEFAULT_SCREEN_TRANSFORM_2D.referencePixelsPerUnit,pivot:t.pivot,renderOrder:t.renderOrder,overlay:t.overlay,visible:t.visible}),In={display:"flex",width:18,height:18,alignItems:"center",justifyContent:"center",borderRadius:6,background:"rgba(255,255,255,0.08)",border:"1px solid rgba(255,255,255,0.08)",color:"#e2e8f0",flex:"0 0 auto"},En={borderRadius:12,border:"1px solid rgba(255,255,255,0.08)",background:"rgba(255,255,255,0.03)",overflow:"hidden"},Tn={display:"flex",alignItems:"center",gap:7,padding:"6px 7px"},zn={display:"flex",alignItems:"center",gap:6,fontSize:11,fontWeight:500,flex:"1 1 auto",minWidth:0},Mn={width:28,height:16,borderRadius:999,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(255,255,255,0.08)",padding:2,display:"flex",alignItems:"center",cursor:"pointer",flex:"0 0 auto"},Fn=t=>({width:10,height:10,borderRadius:999,background:t?"#f8fafc":"rgba(148,163,184,0.7)",transform:t?"translateX(12px)":"translateX(0)",transition:"transform 140ms ease, background 140ms ease"}),Wn={display:"grid",gap:7,padding:"0 7px 7px"},me={display:"grid",gridTemplateColumns:"repeat(2, minmax(0, 1fr))",gap:6},k={display:"flex",flexDirection:"column",gap:4},ee={...k,gridColumn:"1 / -1"},Ln={gridColumn:"1 / -1",display:"grid",gap:6,padding:"8px 8px 2px 12px",marginTop:-2,borderLeft:"1px solid rgba(255,255,255,0.10)"},$n={display:"flex",alignItems:"center",justifyContent:"space-between",gap:6,width:"100%",padding:0,border:0,background:"transparent",fontSize:9,color:"rgba(226,232,240,0.64)",textTransform:"uppercase",cursor:"pointer"},Nn={display:"flex",alignItems:"center",gap:6,minWidth:0},On={width:16,height:16,borderRadius:999,display:"inline-flex",alignItems:"center",justifyContent:"center",background:"rgba(255,255,255,0.06)",color:"rgba(226,232,240,0.72)",flex:"0 0 auto"},S={fontSize:9,color:"rgba(226,232,240,0.72)"},Kt={width:"100%",height:24,borderRadius:7,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(15,23,42,0.68)",color:"#f8fafc",fontSize:10.5,outline:"none",padding:"0 7px",boxSizing:"border-box"},An={...Kt,height:72,padding:"7px",resize:"vertical",lineHeight:1.35,fontFamily:"inherit"},je={...Kt,padding:2,cursor:"pointer"},xe={...Kt,appearance:"none"},Pn={opacity:.45,cursor:"not-allowed"},ue={display:"flex",alignItems:"center",justifyContent:"space-between",gap:12,minHeight:24},gt={width:16,height:16},Dn={display:"grid",gridTemplateColumns:"1.25fr repeat(4, 1fr)",gap:4,width:"100%"},Je=t=>({height:26,borderRadius:8,border:t?"1px solid rgba(125,211,252,0.72)":"1px solid rgba(255,255,255,0.10)",background:t?"rgba(56,189,248,0.20)":"rgba(255,255,255,0.05)",color:t?"#f0f9ff":"#e2e8f0",fontSize:10.5,fontWeight:700,cursor:"pointer",padding:"0 6px"}),wt={display:"inline-flex",alignItems:"center",justifyContent:"center",width:24,height:24,borderRadius:8,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(255,255,255,0.05)",color:"#e2e8f0",cursor:"pointer",padding:0,flex:"0 0 auto"};function Bn({label:t,icon:s,open:l,onToggle:n,children:a}){return e.jsxs("div",{style:En,children:[e.jsxs("div",{style:Tn,children:[e.jsx("button",{type:"button",onClick:n,style:Mn,children:e.jsx("div",{style:Fn(l)})}),e.jsxs("div",{style:zn,children:[e.jsx("span",{style:In,children:s}),e.jsx("span",{children:t})]})]}),l?e.jsx("div",{style:Wn,children:a}):null]})}const Qt=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M4 6V4h16v2h-7v14h-2V6H4z"})}),es=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M12 3a9 9 0 1 0 0 18h1.2a2.8 2.8 0 0 0 0-5.6h-.4a1.8 1.8 0 0 1 0-3.6H16a5 5 0 0 0 0-10h-4zm-4 7a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3zm1 5a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3zm6-7a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3z"})}),Vn=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M4 4h6v2H7.4l3.3 3.3-1.4 1.4L6 7.4V10H4V4zm10 0h6v6h-2V7.4l-3.3 3.3-1.4-1.4L16.6 6H14V4zM9.3 13.3l1.4 1.4L7.4 18H10v2H4v-6h2v2.6l3.3-3.3zm5.4 0 3.3 3.3V14h2v6h-6v-2h2.6l-3.3-3.3 1.4-1.4z"})}),Kn=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M7 5h10v2H9v6h8v2H7V5zm4 8h6v6h-6v-2h4v-2h-4v-2z"})});function Hn({value:t,onChange:s}){return e.jsxs("div",{style:me,children:[e.jsxs("label",{style:ee,children:[e.jsx("span",{style:S,children:"Text"}),e.jsx("textarea",{style:An,value:t.content.text,onChange:l=>s(n=>({...n,content:{...n.content,text:l.target.value}}))})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Text Art"}),e.jsx("select",{style:xe,value:t.textArtPreset,onChange:l=>s(n=>Cn(n,l.target.value)),children:Sn.map(l=>e.jsx("option",{value:l,children:vn[l]},l))})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Font"}),e.jsx("select",{style:xe,value:t.style.fontFamily,onChange:l=>s(n=>({...n,style:{...n.style,fontFamily:l.target.value}})),children:mn.map(l=>e.jsx("option",{value:l.value,children:l.label},l.value))})]})]})}const Gn={width:"100%",boxSizing:"border-box",border:"1px solid rgba(148,163,184,0.22)",borderRadius:8,background:"rgba(15,23,42,0.8)",color:"#e2e8f0",padding:"7px 9px"},_n=t=>/^-?\d*(\.\d*)?$/.test(t),z=({value:t,onChange:s,step:l=1,min:n,max:a,disabled:d=!1})=>{const[r,o]=y.useState(String(t));y.useEffect(()=>o(String(t)),[t]);const h=x=>Math.min(typeof a=="number"?a:1/0,Math.max(typeof n=="number"?n:-1/0,x));return e.jsx("input",{type:"text",inputMode:"decimal",pattern:"-?[0-9]*[.,]?[0-9]*",style:{...Gn,...d?{cursor:"not-allowed",opacity:.45}:{}},value:r,disabled:d,onChange:x=>{if(d)return;const c=x.target.value;if(!_n(c)||(o(c),["","-",".","-."].includes(c)))return;const p=Number(c);Number.isNaN(p)||s(h(p))},onBlur:()=>{if(d)return;const x=Number(r);if(Number.isNaN(x))return o(String(t));const c=h(x);o(String(c)),s(c)},onKeyDown:x=>{if(d||x.key!=="ArrowUp"&&x.key!=="ArrowDown")return;x.preventDefault();const c=x.shiftKey?l*10:x.altKey?l/10:l,p=x.key==="ArrowUp"?t+c:t-c;s(h(Number.isInteger(p)?p:Number(p.toFixed(6))))}})};function Un({background:t,onChange:s}){return e.jsxs(e.Fragment,{children:[e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Fill Mode"}),e.jsxs("select",{style:xe,value:t.fillMode,onChange:l=>s(n=>({...n,style:{...n.style,background:{...n.style.background,fillMode:l.target.value}}})),children:[e.jsx("option",{value:"solid",children:"solid"}),e.jsx("option",{value:"gradient",children:"gradient"})]})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Fill Area"}),e.jsxs("select",{style:xe,value:t.fit,onChange:l=>s(n=>({...n,style:{...n.style,background:{...n.style.background,fit:l.target.value}}})),children:[e.jsx("option",{value:"text",children:"text"}),e.jsx("option",{value:"full",children:"full"})]})]}),t.fillMode==="solid"?e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Background Color"}),e.jsx("input",{style:je,type:"color",value:t.color,onChange:l=>s(n=>({...n,style:{...n.style,background:{...n.style.background,color:l.target.value}}}))})]}):e.jsx("div",{style:{gridColumn:"1 / -1",display:"grid",gap:6},children:t.gradientStops.slice(0,3).map((l,n)=>e.jsxs("label",{style:k,children:[e.jsxs("span",{style:S,children:["Gradient ",n+1]}),e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 60px",gap:4},children:[e.jsx("input",{style:je,type:"color",value:l.color,onChange:a=>s(d=>{const r=[...d.style.background.gradientStops];return r[n]={...r[n],color:a.target.value},{...d,style:{...d.style,background:{...d.style.background,gradientStops:r}}}})}),e.jsx(z,{value:l.position,min:0,max:1,step:.05,onChange:a=>s(d=>{const r=[...d.style.background.gradientStops];return r[n]={...r[n],position:a},{...d,style:{...d.style,background:{...d.style.background,gradientStops:r}}}})})]})]},n))}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Background Opacity"}),e.jsx(z,{value:t.opacity,min:0,max:1,step:.05,onChange:l=>s(n=>({...n,style:{...n.style,background:{...n.style.background,opacity:l}}}))})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Corner Radius"}),e.jsx(z,{value:t.borderRadius,min:0,max:200,step:2,onChange:l=>s(n=>({...n,style:{...n.style,background:{...n.style.background,borderRadius:l}}}))})]})]})}function Xn({background:t,onChange:s}){return e.jsxs(e.Fragment,{children:[e.jsx("label",{style:ee,children:e.jsxs("div",{style:ue,children:[e.jsx("span",{style:S,children:"Auto Width / Height"}),e.jsx("input",{type:"checkbox",style:gt,checked:t.autoSize,onChange:l=>s(n=>({...n,style:{...n.style,background:{...n.style.background,autoSize:l.target.checked}}}))})]})}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Width"}),e.jsx(z,{value:t.width,min:32,max:1024,step:8,disabled:t.autoSize,onChange:l=>s(n=>({...n,style:{...n.style,background:{...n.style.background,width:l}}}))})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Height"}),e.jsx(z,{value:t.height,min:32,max:1024,step:8,disabled:t.autoSize,onChange:l=>s(n=>({...n,style:{...n.style,background:{...n.style.background,height:l}}}))})]})]})}function Zn({background:t,onChange:s}){return e.jsxs(e.Fragment,{children:[e.jsx("label",{style:ee,children:e.jsxs("div",{style:ue,children:[e.jsx("span",{style:S,children:"Background Stroke"}),e.jsx("input",{type:"checkbox",style:gt,checked:t.borderEnabled,onChange:l=>s(n=>({...n,style:{...n.style,background:{...n.style.background,borderEnabled:l.target.checked,borderColor:l.target.checked&&n.style.background.borderColor==="transparent"?"#ffffff":n.style.background.borderColor,borderWidth:l.target.checked?Math.max(n.style.background.borderWidth,2):n.style.background.borderWidth}}}))})]})}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Stroke Color"}),e.jsx("input",{style:{...je,...t.borderEnabled?{}:Pn},type:"color",value:t.borderColor,disabled:!t.borderEnabled,onChange:l=>s(n=>({...n,style:{...n.style,background:{...n.style.background,borderColor:l.target.value}}}))})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Stroke Width"}),e.jsx(z,{value:t.borderWidth,min:0,max:64,step:1,disabled:!t.borderEnabled,onChange:l=>s(n=>({...n,style:{...n.style,background:{...n.style.background,borderWidth:l}}}))})]})]})}const Cs={gridColumn:"1 / -1",display:"grid",gap:6,padding:"8px",borderRadius:10,border:"1px solid rgba(255,255,255,0.08)",background:"rgba(255,255,255,0.03)"};function yt({checked:t,label:s,onChange:l}){return e.jsx("label",{style:ee,children:e.jsxs("div",{style:ue,children:[e.jsx("span",{style:S,children:s}),e.jsx("input",{type:"checkbox",style:gt,checked:t,onChange:n=>l(n.target.checked)})]})})}function Xe({children:t,label:s,open:l,setOpen:n}){return e.jsxs("div",{style:Ln,children:[e.jsxs("button",{type:"button",style:$n,onClick:()=>n(a=>!a),children:[e.jsxs("span",{style:Nn,children:[e.jsx(Kn,{}),e.jsx("span",{children:s})]}),e.jsx("span",{style:On,children:l?"−":"+"})]}),l?t:null]})}function Yn({value:t,onChange:s,open:l,setOpen:n}){const a=t.style.background;return e.jsxs(e.Fragment,{children:[e.jsx("label",{style:ee,children:e.jsxs("div",{style:ue,children:[e.jsx("span",{style:S,children:"Background Enabled"}),e.jsx("input",{type:"checkbox",style:gt,checked:a.enabled,onChange:d=>s(r=>({...r,style:{...r.style,background:{...r.style.background,enabled:d.target.checked}}}))})]})}),a.enabled?e.jsx(Xe,{label:"Background Settings",open:l,setOpen:n,children:e.jsxs(e.Fragment,{children:[e.jsx(Un,{background:a,onChange:s}),e.jsx(Zn,{background:a,onChange:s}),e.jsx(Xn,{background:a,onChange:s})]})}):null]})}function qn({bend:t,open:s,onChange:l,setOpen:n,value:a}){const d=r=>l(o=>({...o,style:{...o.style,bend:{...o.style.bend??t,...r}}}));return e.jsxs(e.Fragment,{children:[e.jsx(yt,{label:"Bend",checked:a.style.bendEnabled===!0,onChange:r=>l(o=>({...o,style:{...o.style,bendEnabled:r,bend:o.style.bend??vs()}}))}),a.style.bendEnabled===!0?e.jsx(Xe,{label:"Bend",open:s,setOpen:n,children:e.jsxs("div",{style:me,children:[e.jsxs("label",{style:ee,children:[e.jsx("span",{style:S,children:"Bend Preset"}),e.jsx("select",{style:xe,value:t.preset,onChange:r=>d({preset:r.target.value}),children:kn.map(r=>e.jsx("option",{value:r.value,children:r.label},r.value))})]}),e.jsxs("label",{style:ee,children:[e.jsx("span",{style:S,children:"Bend Strength"}),e.jsx(z,{value:t.strength,min:-100,max:100,step:1,onChange:r=>d({strength:r})})]})]})}):null]})}function Jn({glow:t,open:s,onChange:l,setOpen:n,value:a}){const d=r=>l(o=>({...o,style:{...o.style,glow:{...o.style.glow??t,...r}}}));return e.jsxs(e.Fragment,{children:[e.jsx(yt,{label:"Glow",checked:a.style.glowEnabled===!0,onChange:r=>l(o=>({...o,style:{...o.style,glowEnabled:r,glow:o.style.glow??Ss()}}))}),a.style.glowEnabled===!0?e.jsx(Xe,{label:"Glow",open:s,setOpen:n,children:e.jsxs("div",{style:me,children:[e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Color"}),e.jsx("input",{style:je,type:"color",value:t.color,onChange:r=>d({color:r.target.value})})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Style"}),e.jsxs("select",{style:xe,value:t.style,onChange:r=>d({style:r.target.value}),children:[e.jsx("option",{value:"outward",children:"Outward"}),e.jsx("option",{value:"contoured",children:"Contoured"})]})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Intensity"}),e.jsx(z,{value:t.intensity??.5,min:0,max:1,step:.05,onChange:r=>d({intensity:r})})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Range"}),e.jsx(z,{value:t.range??.5,min:0,max:1,step:.05,onChange:r=>d({range:r})})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Horizontal Angle"}),e.jsx(z,{value:t.horizontalAngle??0,min:-.5,max:.5,step:.05,onChange:r=>d({horizontalAngle:r})})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Vertical Angle"}),e.jsx(z,{value:t.verticalAngle??0,min:-.5,max:.5,step:.05,onChange:r=>d({verticalAngle:r})})]})]})}):null]})}const Qn={color:"#000000",opacity:1,offset:10,angle:-45,feather:0};function el({innerShadow:t,open:s,onChange:l,setOpen:n,value:a}){const d=r=>l(o=>({...o,style:{...o.style,innerShadow:{...o.style.innerShadow??t,...r}}}));return e.jsxs(e.Fragment,{children:[e.jsx(yt,{label:"Inner Shadow",checked:a.style.innerShadowEnabled===!0,onChange:r=>l(o=>({...o,style:{...o.style,innerShadowEnabled:r,innerShadow:o.style.innerShadow??Qn}}))}),a.style.innerShadowEnabled===!0?e.jsx(Xe,{label:"Inner Shadow",open:s,setOpen:n,children:e.jsxs("div",{style:me,children:[e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Shadow Color"}),e.jsx("input",{style:je,type:"color",value:t.color,onChange:r=>d({color:r.target.value})})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Shadow Opacity"}),e.jsx(z,{value:t.opacity??1,min:0,max:1,step:.05,onChange:r=>d({opacity:r})})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Shadow Offset"}),e.jsx(z,{value:t.offset??10,min:0,max:100,step:1,onChange:r=>d({offset:r})})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Shadow Angle"}),e.jsx(z,{value:t.angle??-45,min:-180,max:180,step:1,onChange:r=>d({angle:r})})]}),e.jsxs("label",{style:ee,children:[e.jsx("span",{style:S,children:"Shadow Feather"}),e.jsx(z,{value:t.feather??0,min:0,max:1,step:.05,onChange:r=>d({feather:r})})]})]})}):null]})}function tl({layers:t,open:s,onChange:l,setOpen:n,value:a}){const d=(r,o)=>l(h=>{const x=[...h.style.strokeLayers??[]];return x[r]={...x[r],...o},{...h,style:{...h.style,strokeLayers:x}}});return e.jsxs(e.Fragment,{children:[e.jsx(yt,{label:"Outline",checked:a.style.outlineEnabled!==!1,onChange:r=>l(o=>({...o,style:{...o.style,outlineEnabled:r}}))}),a.style.outlineEnabled!==!1?e.jsx(Xe,{label:"Outline Editor",open:s,setOpen:n,children:e.jsxs(e.Fragment,{children:[e.jsxs("div",{style:{...ue,gridColumn:"1 / -1"},children:[e.jsxs("span",{style:S,children:["Layers: ",t.length]}),e.jsx("button",{type:"button",style:wt,onClick:()=>l(r=>({...r,style:{...r.style,strokeLayers:[...r.style.strokeLayers??[],wn()]}})),children:"+"})]}),t.length>0?t.map((r,o)=>e.jsxs("div",{style:Cs,children:[e.jsxs("div",{style:ue,children:[e.jsxs("span",{style:S,children:["Outline ",o+1]}),e.jsx("button",{type:"button",style:wt,onClick:()=>l(h=>({...h,style:{...h.style,strokeLayers:(h.style.strokeLayers??[]).filter((x,c)=>c!==o)}})),children:"×"})]}),e.jsxs("div",{style:me,children:[e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Outline Color"}),e.jsx("input",{style:je,type:"color",value:r.color,onChange:h=>d(o,{color:h.target.value})})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Outline Opacity"}),e.jsx(z,{value:r.opacity??1,min:0,max:1,step:.05,onChange:h=>d(o,{opacity:h})})]}),e.jsxs("label",{style:ee,children:[e.jsx("span",{style:S,children:"Outline Size"}),e.jsx(z,{value:r.width,min:0,max:100,step:1,onChange:h=>d(o,{width:h})})]})]})]},o)):e.jsx("div",{style:{...S,gridColumn:"1 / -1"},children:"No outlines. Use `+` to add one."})]})}):null]})}function sl({layers:t,open:s,onChange:l,setOpen:n,value:a}){const d=(r,o)=>l(h=>{const x=[...h.style.shadowLayers??[]];return x[r]={...x[r],...o},{...h,style:{...h.style,shadowLayers:x}}});return e.jsxs(e.Fragment,{children:[e.jsx(yt,{label:"Outer Shadow",checked:a.style.shadowEnabled!==!1,onChange:r=>l(o=>{var h;return{...o,style:{...o.style,shadowEnabled:r,shadowLayers:r&&(((h=o.style.shadowLayers)==null?void 0:h.length)??0)===0?[Bt()]:o.style.shadowLayers}}})}),a.style.shadowEnabled!==!1?e.jsx(Xe,{label:"Shadow Editor",open:s,setOpen:n,children:e.jsxs(e.Fragment,{children:[e.jsxs("div",{style:{...ue,gridColumn:"1 / -1"},children:[e.jsxs("span",{style:S,children:["Layers: ",t.length]}),e.jsx("button",{type:"button",style:wt,onClick:()=>l(r=>({...r,style:{...r.style,shadowLayers:[...r.style.shadowLayers??[],Bt()]}})),children:"+"})]}),t.length>0?t.map((r,o)=>e.jsxs("div",{style:Cs,children:[e.jsxs("div",{style:ue,children:[e.jsxs("span",{style:S,children:["Shadow ",o+1]}),e.jsx("button",{type:"button",style:wt,onClick:()=>l(h=>({...h,style:{...h.style,shadowLayers:(h.style.shadowLayers??[]).filter((x,c)=>c!==o)}})),children:"×"})]}),e.jsxs("div",{style:me,children:[e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Shadow Color"}),e.jsx("input",{style:je,type:"color",value:r.color,onChange:h=>d(o,{color:h.target.value})})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Shadow Opacity"}),e.jsx(z,{value:r.opacity??1,min:0,max:1,step:.05,onChange:h=>d(o,{opacity:h})})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Shadow Offset"}),e.jsx(z,{value:r.offset??10,min:0,max:100,step:1,onChange:h=>d(o,{offset:h})})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Shadow Angle"}),e.jsx(z,{value:r.angle??-45,min:-180,max:180,step:1,onChange:h=>d(o,{angle:h})})]}),e.jsxs("label",{style:ee,children:[e.jsx("span",{style:S,children:"Shadow Feather"}),e.jsx(z,{value:r.feather??0,min:0,max:1,step:.05,onChange:h=>d(o,{feather:h})})]})]})]},o)):e.jsx("div",{style:{...S,gridColumn:"1 / -1"},children:"No outer shadows. Use `+` to add one."})]})}):null]})}function nl({backgroundSettingsOpen:t,bend:s,bendSettingsOpen:l,glow:n,glowSettingsOpen:a,innerShadow:d,innerShadowSettingsOpen:r,onChange:o,outlineLayers:h,outlineSettingsOpen:x,setBackgroundSettingsOpen:c,setBendSettingsOpen:p,setGlowSettingsOpen:f,setInnerShadowSettingsOpen:g,setOutlineSettingsOpen:i,setShadowSettingsOpen:u,shadowLayers:j,shadowSettingsOpen:w,value:v}){return e.jsxs("div",{style:me,children:[e.jsx(tl,{value:v,onChange:o,layers:h,open:x,setOpen:i}),e.jsx(sl,{value:v,onChange:o,layers:j,open:w,setOpen:u}),e.jsx(el,{value:v,onChange:o,innerShadow:d,open:a,setOpen:f}),e.jsx(Jn,{value:v,onChange:o,glow:n,open:r,setOpen:g}),e.jsx(qn,{value:v,onChange:o,bend:s,open:l,setOpen:p}),e.jsx(Yn,{value:v,onChange:o,open:t,setOpen:c})]})}function ll({value:t,onChange:s}){const l=t.style.bold===!0||t.style.fontStyle==="italic"||t.style.underline===!0||t.style.strikethrough===!0;return e.jsxs("div",{style:me,children:[e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Text Color"}),e.jsx("input",{style:je,type:"color",value:t.style.color,onChange:n=>s(a=>({...a,style:{...a.style,color:n.target.value}}))})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Font Size"}),e.jsx(z,{value:t.style.fontSize,min:16,max:180,step:4,onChange:n=>s(a=>({...a,layout:{...a.layout,minFontSize:Math.min(a.layout.minFontSize??n,n)},style:{...a.style,fontSize:n}}))})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Letter Spacing"}),e.jsx(z,{value:t.style.letterSpacing,min:0,max:1,step:.05,onChange:n=>s(a=>({...a,style:{...a.style,letterSpacing:n}}))})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Line Spacing"}),e.jsx(z,{value:t.style.lineSpacing,min:0,max:1,step:.05,onChange:n=>s(a=>({...a,style:{...a.style,lineSpacing:n}}))})]}),e.jsxs("div",{style:ee,children:[e.jsx("span",{style:S,children:"Text Style"}),e.jsxs("div",{style:Dn,children:[e.jsx("button",{type:"button",style:Je(!l),onClick:()=>s(n=>({...n,style:{...n.style,bold:!1,fontWeight:n.style.fontWeight==="bold"?"normal":n.style.fontWeight,fontStyle:"normal",underline:!1,strikethrough:!1}})),children:"None"}),e.jsx("button",{type:"button",style:Je(t.style.bold===!0),onClick:()=>s(n=>({...n,style:{...n.style,bold:n.style.bold!==!0,fontWeight:n.style.bold!==!0?"bold":400}})),children:"B"}),e.jsx("button",{type:"button",style:Je(t.style.fontStyle==="italic"),onClick:()=>s(n=>({...n,style:{...n.style,fontStyle:n.style.fontStyle==="italic"?"normal":"italic"}})),children:"I"}),e.jsx("button",{type:"button",style:Je(t.style.underline===!0),onClick:()=>s(n=>({...n,style:{...n.style,underline:n.style.underline!==!0}})),children:"U"}),e.jsx("button",{type:"button",style:Je(t.style.strikethrough===!0),onClick:()=>s(n=>({...n,style:{...n.style,strikethrough:n.style.strikethrough!==!0}})),children:"S"})]})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Horizontal Alignment"}),e.jsxs("select",{style:xe,value:t.layout.textAlign??"center",onChange:n=>s(a=>({...a,layout:{...a.layout,textAlign:n.target.value}})),children:[e.jsx("option",{value:"left",children:"left"}),e.jsx("option",{value:"center",children:"center"}),e.jsx("option",{value:"right",children:"right"})]})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Vertical Alignment"}),e.jsxs("select",{style:xe,value:t.layout.verticalAlign??"center",onChange:n=>s(a=>({...a,layout:{...a.layout,verticalAlign:n.target.value}})),children:[e.jsx("option",{value:"top",children:"top"}),e.jsx("option",{value:"center",children:"center"}),e.jsx("option",{value:"bottom",children:"bottom"})]})]}),e.jsxs("label",{style:k,children:[e.jsx("span",{style:S,children:"Overflow"}),e.jsxs("select",{style:xe,value:t.layout.overflow,onChange:n=>s(a=>({...a,layout:{...a.layout,overflow:n.target.value}})),children:[e.jsx("option",{value:"clip",children:"Clip text"}),e.jsx("option",{value:"ellipsis",children:"Show ellipsis"}),e.jsx("option",{value:"clamp",children:"Clamp"}),e.jsx("option",{value:"shrink",children:"Shrink"})]})]}),e.jsx("label",{style:ee,children:e.jsxs("div",{style:ue,children:[e.jsx("span",{style:S,children:"Resize To Fit"}),e.jsx("input",{type:"checkbox",style:gt,checked:t.layout.resizeToFit===!0,onChange:n=>s(a=>({...a,layout:{...a.layout,resizeToFit:n.target.checked}}))})]})})]})}const il={display:"grid",gridTemplateColumns:"repeat(2, minmax(0, 1fr))",gap:6},re={display:"flex",flexDirection:"column",gap:4},Et={...re,gridColumn:"1 / -1"},Y={fontSize:9,color:"rgba(226,232,240,0.72)"},ol={width:"100%",height:24,borderRadius:7,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(15,23,42,0.68)",color:"#f8fafc",fontSize:10.5,outline:"none",padding:"0 7px",boxSizing:"border-box"},rl={...ol,fontVariantNumeric:"tabular-nums"},al={display:"flex",alignItems:"center",justifyContent:"space-between",gap:12,minHeight:24},dl={width:16,height:16},cl=t=>/^-?\d*(\.\d*)?$/.test(t),se=({value:t,onChange:s,step:l=1,min:n,max:a,disabled:d=!1})=>{const[r,o]=y.useState(String(t));y.useEffect(()=>o(String(t)),[t]);const h=x=>{let c=x;return typeof n=="number"&&(c=Math.max(n,c)),typeof a=="number"&&(c=Math.min(a,c)),c};return e.jsx("input",{type:"text",inputMode:"decimal",pattern:"-?[0-9]*[.,]?[0-9]*",style:rl,value:r,disabled:d,onChange:x=>{const c=x.target.value;if(!cl(c)||(o(c),c===""||c==="-"||c==="."||c==="-."))return;const p=Number(c);Number.isNaN(p)||s(h(p))},onBlur:()=>{const x=Number(r);if(Number.isNaN(x)){o(String(t));return}const c=h(x);o(String(c)),s(c)},onKeyDown:x=>{if(x.key!=="ArrowUp"&&x.key!=="ArrowDown")return;x.preventDefault();const c=x.shiftKey?l*10:x.altKey?l/10:l,p=x.key==="ArrowUp"?t+c:t-c;s(h(Number.isInteger(p)?p:Number(p.toFixed(6))))}})},Ht=({value:t,onChange:s,guideLabel:l,showRenderOrder:n=!0})=>{var a,d;return e.jsxs("div",{style:il,children:[e.jsxs("label",{style:re,children:[e.jsx("span",{style:Y,children:"Position X"}),e.jsx(se,{value:t.position.x,min:-4096,max:4096,step:1,onChange:r=>s({...t,position:{...t.position,x:r}})})]}),e.jsxs("label",{style:re,children:[e.jsx("span",{style:Y,children:"Position Y"}),e.jsx(se,{value:t.position.y,min:-4096,max:4096,step:1,onChange:r=>s({...t,position:{...t.position,y:r}})})]}),e.jsxs("label",{style:re,children:[e.jsx("span",{style:Y,children:"Size X"}),e.jsx(se,{value:t.size.width,min:0,max:8192,step:1,onChange:r=>s({...t,size:{...t.size,width:r}})})]}),e.jsxs("label",{style:re,children:[e.jsx("span",{style:Y,children:"Size Y"}),e.jsx(se,{value:t.size.height,min:0,max:8192,step:1,onChange:r=>s({...t,size:{...t.size,height:r}})})]}),e.jsxs("label",{style:Et,children:[e.jsx("span",{style:Y,children:"Rotation"}),e.jsx(se,{value:t.rotation,min:-360,max:360,step:1,onChange:r=>s({...t,rotation:r})})]}),e.jsxs("label",{style:re,children:[e.jsx("span",{style:Y,children:"Scale 2D X"}),e.jsx(se,{value:((a=t.scale2D)==null?void 0:a.x)??1,min:-10,max:10,step:.01,onChange:r=>{var o;return s({...t,scale2D:{x:r,y:((o=t.scale2D)==null?void 0:o.y)??1}})}})]}),e.jsxs("label",{style:re,children:[e.jsx("span",{style:Y,children:"Scale 2D Y"}),e.jsx(se,{value:((d=t.scale2D)==null?void 0:d.y)??1,min:-10,max:10,step:.01,onChange:r=>{var o;return s({...t,scale2D:{x:((o=t.scale2D)==null?void 0:o.x)??1,y:r}})}})]}),e.jsxs("label",{style:Et,children:[e.jsx("span",{style:Y,children:"Reference Pixels Per Unit"}),e.jsx(se,{value:t.referencePixelsPerUnit??32,min:1,max:512,step:1,onChange:r=>s({...t,referencePixelsPerUnit:r})})]}),n?e.jsxs("label",{style:re,children:[e.jsx("span",{style:Y,children:"Render Order"}),e.jsx(se,{value:t.renderOrder,min:-9999,max:9999,step:1,onChange:r=>s({...t,renderOrder:r})})]}):null,e.jsxs("label",{style:re,children:[e.jsx("span",{style:Y,children:"Pivot X"}),e.jsx(se,{value:t.pivot[0],min:0,max:1,step:.01,onChange:r=>s({...t,pivot:[r,t.pivot[1]]})})]}),e.jsxs("label",{style:re,children:[e.jsx("span",{style:Y,children:"Pivot Y"}),e.jsx(se,{value:t.pivot[1],min:0,max:1,step:.01,onChange:r=>s({...t,pivot:[t.pivot[0],r]})})]}),e.jsx("label",{style:Et,children:e.jsxs("div",{style:al,children:[e.jsx("span",{style:Y,children:l}),e.jsx("input",{type:"checkbox",style:dl,checked:t.showGuides,onChange:r=>s({...t,showGuides:r.target.checked})})]})})]})};function pl({value:t,onChange:s}){return e.jsx(Ht,{value:ws(t.transformation,t.screenTransform),guideLabel:"Transform Control On",showRenderOrder:!1,onChange:l=>s(n=>({...n,transformation:Rn(l,n.transformation),screenTransform:ks(l,n.screenTransform)}))})}const hl=({value:t,onChange:s,copyLabel:l,inspector:n,docked:a})=>{var Ze;const[d,r]=y.useState(()=>K.createSceneObject({name:l??"Screen Text",renderGroupId:Le.DEFAULT_RENDER_GROUP_IDS.screen2d})),[o]=y.useState(()=>{const $=d.id,Z=K.createDefaultComponent("ScreenTransform",$),m=K.createDefaultComponent("ScreenText",$),R=K.createDefaultComponent("Material",$),D=K.createDefaultComponent("Texture",$);return{screenTransform:Z,screenText:m,material:R,texture:D}}),[h,x]=y.useState(!0),[c,p]=y.useState(!0),[f,g]=y.useState(!0),[i,u]=y.useState(!0),[j,w]=y.useState(!0),[v,M]=y.useState(!0),[U,b]=y.useState({text2d:!0,content:!0,transformation:!0,style:!0,textEffect:!0}),F=ws(t.screenText.transformation,t.screenText.screenTransform),E={object:{...d,componentIds:[o.screenTransform.id,o.screenText.id,o.material.id,o.texture.id]},kind:"screenText",components:[{...o.screenTransform,settings:t.screenText.screenTransform??ks(F)},{...o.screenText,settings:t.screenText},{...o.material,settings:{...o.material.settings,color:t.screenText.style.color,opacity:t.screenText.style.opacity}},{...o.texture,settings:{...o.texture.settings,url:t.screenText.style.background.textureUrl,flipX:t.screenText.style.background.textureFlipX,flipY:t.screenText.style.background.textureFlipY}}],scene:{screenSpaceUI:t.screenSpaceUI}},P=$=>{s({...t,screenText:$(t.screenText)})},le=t.screenText.style.strokeLayers??[],ae=t.screenText.style.shadowEnabled!==!1&&(((Ze=t.screenText.style.shadowLayers)==null?void 0:Ze.length)??0)===0?[Bt()]:t.screenText.style.shadowLayers??[],L=t.screenText.style.innerShadow??{color:"#000000",opacity:1,offset:10,angle:-45,feather:0},Pe=t.screenText.style.glow??Ss(),De=t.screenText.style.bend??vs(),W=$=>b(Z=>({...Z,[$]:!Z[$]})),ve=($,Z,m,R)=>e.jsx(Bn,{label:Z,icon:m,open:U[$],onToggle:()=>W($),children:R},$);return e.jsxs(Ct,{objectId:(n==null?void 0:n.objectId)??d.id,objectName:(n==null?void 0:n.objectName)??d.name,onObjectNameChange:(n==null?void 0:n.onObjectNameChange)??($=>r(Z=>({...Z,name:$}))),layer:(n==null?void 0:n.layer)??"Default Layer",visible:(n==null?void 0:n.visible)??t.screenText.enabled,onVisibleChange:(n==null?void 0:n.onVisibleChange)??($=>P(Z=>({...Z,enabled:$}))),copyConfig:(n==null?void 0:n.copyConfig)??E,docked:a??(n==null?void 0:n.docked),initialPosition:n==null?void 0:n.initialPosition,position:n==null?void 0:n.position,onPositionChange:n==null?void 0:n.onPositionChange,title:n==null?void 0:n.title,children:[ve("transformation","Transformation",e.jsx(Vn,{}),e.jsx(pl,{value:t.screenText,onChange:P})),ve("text2d","2D Text",e.jsx(Qt,{}),e.jsxs(e.Fragment,{children:[ve("content","Content",e.jsx(Qt,{}),e.jsx(Hn,{value:t.screenText,onChange:P})),ve("style","Style",e.jsx(es,{}),e.jsx(ll,{value:t.screenText,onChange:P})),ve("textEffect","Text Effect",e.jsx(es,{}),e.jsx(nl,{value:t.screenText,onChange:P,outlineLayers:le,shadowLayers:ae,innerShadow:L,glow:Pe,bend:De,outlineSettingsOpen:h,setOutlineSettingsOpen:x,shadowSettingsOpen:c,setShadowSettingsOpen:p,innerShadowSettingsOpen:f,setInnerShadowSettingsOpen:g,glowSettingsOpen:i,setGlowSettingsOpen:u,bendSettingsOpen:j,setBendSettingsOpen:w,backgroundSettingsOpen:v,setBackgroundSettingsOpen:M}))]}))]})},xl="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAtAAAAUAAgMAAAAToI2uAAAAAXNSR0IB2cksfwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAlQTFRFqampbGxsAAAA/lGquwAAAAN0Uk5T//8A18oNQQAABPRJREFUeJztzssNQWEYQEG3CP1oQqJGsdCfBFs7j8X8+eRMBbPtBtpWB35RWimtlFZKK6WV0kppZWj6uLrwrceltFFaKa2UVkorpZXSSmlldPp2XT350P5Q2iitlFZKK6WV0kpppbRSWimtlFZKK3+RPq8OvXM/lTZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK6WV0kpppbRSWimtlFZKK3+THqG0UloprZRWSiulldJKaaW0UloprZRWSiuv6VFKK6WV0kpppbRSWimtlFbGpgcqrZRWSiulldJKaaW0MjL9BFWtRqVFuJpUAAAAAElFTkSuQmCC",ul={placeholder:"Placeholder","hero-image":"Hero Image","photo-frame":"Default Frame"},gl=Object.entries(ul).map(([t,s])=>({value:t,label:s})),yl={placeholder:{transformation:{showFitGuides:!1},image:{sourceKind:"default",stretchMode:"fit",materialType:"unlit",blendMode:"normal",opacity:1,color:"#ffffff",flipX:!1,flipY:!1,transparent:!0,alphaTest:0}},"hero-image":{transformation:{position:{x:0,y:.08},size:{width:.96,height:.62},rotation:0,pivot:[.5,.5],overlay:!0,visible:!0},image:{sourceKind:"image",stretchMode:"fillAndCut",materialType:"unlit",blendMode:"normal",opacity:1,color:"#ffffff",flipX:!1,flipY:!1,transparent:!0,alphaTest:0}},"photo-frame":{transformation:{position:{x:0,y:.01},size:{width:2,height:2},rotation:0,pivot:[.5,.5],overlay:!0,visible:!0},image:{sourceKind:"image",src:xl,stretchMode:"fill",materialType:"unlit",blendMode:"normal",opacity:1,color:"#ffffff",flipX:!1,flipY:!1,transparent:!0,alphaTest:0}}},bl=(t,s)=>{const l=yl[s];return{...t,preset:s,...l.enabled!==void 0?{enabled:l.enabled}:{},transformation:{...t.transformation,...l.transformation??{}},image:{...t.image,...l.image??{}}}},fl={display:"grid",gridTemplateColumns:"repeat(2, minmax(0, 1fr))",gap:6},ct={display:"flex",flexDirection:"column",gap:4},jl={...ct,gridColumn:"1 / -1"},Qe={fontSize:9,color:"rgba(226,232,240,0.72)"},Gt={width:"100%",height:24,borderRadius:7,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(15,23,42,0.68)",color:"#f8fafc",fontSize:10.5,outline:"none",padding:"0 7px",boxSizing:"border-box"},ts={...Gt,appearance:"none"},ml={...Gt,fontVariantNumeric:"tabular-nums"},Sl={...Gt,padding:2,cursor:"pointer"},vl=t=>/^-?\d*(\.\d*)?$/.test(t),ss=({value:t,onChange:s,step:l=1,min:n,max:a})=>{const[d,r]=y.useState(String(t));y.useEffect(()=>r(String(t)),[t]);const o=h=>{let x=h;return typeof n=="number"&&(x=Math.max(n,x)),typeof a=="number"&&(x=Math.min(a,x)),x};return e.jsx("input",{type:"text",inputMode:"decimal",pattern:"-?[0-9]*[.,]?[0-9]*",style:ml,value:d,onChange:h=>{const x=h.target.value;if(!vl(x)||(r(x),x===""||x==="-"||x==="."||x==="-."))return;const c=Number(x);Number.isNaN(c)||s(o(c))},onBlur:()=>{const h=Number(d);if(Number.isNaN(h)){r(String(t));return}const x=o(h);r(String(x)),s(x)},onKeyDown:h=>{if(h.key!=="ArrowUp"&&h.key!=="ArrowDown")return;h.preventDefault();const x=h.shiftKey?l*10:h.altKey?l/10:l,c=h.key==="ArrowUp"?t+x:t-x;s(o(Number.isInteger(c)?c:Number(c.toFixed(6))))}})},wl=({value:t,onChange:s})=>e.jsxs("div",{style:fl,children:[e.jsxs("label",{style:ct,children:[e.jsx("span",{style:Qe,children:"Material Type"}),e.jsxs("select",{style:ts,value:t.materialType,onChange:l=>s({...t,materialType:l.target.value}),children:[e.jsx("option",{value:"unlit",children:"Unlit"}),e.jsx("option",{value:"standardPBR",children:"Standard PBR"}),e.jsx("option",{value:"matcap",children:"Matcap"})]})]}),e.jsxs("label",{style:ct,children:[e.jsx("span",{style:Qe,children:"Blend Mode"}),e.jsxs("select",{style:ts,value:t.blendMode,onChange:l=>s({...t,blendMode:l.target.value}),children:[e.jsx("option",{value:"normal",children:"Normal"}),e.jsx("option",{value:"add",children:"Add"}),e.jsx("option",{value:"subtract",children:"Subtract"}),e.jsx("option",{value:"multiply",children:"Multiply"}),e.jsx("option",{value:"screen",children:"Screen"}),e.jsx("option",{value:"lighten",children:"Lighten"}),e.jsx("option",{value:"darken",children:"Darken"}),e.jsx("option",{value:"overlay",children:"Overlay"}),e.jsx("option",{value:"softLight",children:"Soft Light"}),e.jsx("option",{value:"hardLight",children:"Hard Light"}),e.jsx("option",{value:"difference",children:"Difference"}),e.jsx("option",{value:"exclusion",children:"Exclusion"})]})]}),e.jsxs("label",{style:ct,children:[e.jsx("span",{style:Qe,children:"Opacity"}),e.jsx(ss,{value:t.opacity,min:0,max:1,step:.01,onChange:l=>s({...t,opacity:l})})]}),e.jsxs("label",{style:ct,children:[e.jsx("span",{style:Qe,children:"Tint"}),e.jsx("input",{type:"color",style:Sl,value:t.color,onChange:l=>s({...t,color:l.target.value})})]}),e.jsxs("label",{style:jl,children:[e.jsx("span",{style:Qe,children:"Alpha Test"}),e.jsx(ss,{value:t.alphaTest,min:0,max:1,step:.01,onChange:l=>s({...t,alphaTest:l})})]})]}),kl={display:"flex",width:18,height:18,alignItems:"center",justifyContent:"center",borderRadius:6,background:"rgba(255,255,255,0.08)",border:"1px solid rgba(255,255,255,0.08)",color:"#e2e8f0",flex:"0 0 auto"},Cl={borderRadius:12,border:"1px solid rgba(255,255,255,0.08)",background:"rgba(255,255,255,0.03)",overflow:"hidden"},Rl={display:"flex",alignItems:"center",gap:7,padding:"6px 7px"},Il={display:"flex",alignItems:"center",gap:6,fontSize:11,fontWeight:500,flex:"1 1 auto",minWidth:0},El={width:28,height:16,borderRadius:999,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(255,255,255,0.08)",padding:2,display:"flex",alignItems:"center",cursor:"pointer",flex:"0 0 auto"},Tl=t=>({width:10,height:10,borderRadius:999,background:t?"#f8fafc":"rgba(148,163,184,0.7)",transform:t?"translateX(12px)":"translateX(0)",transition:"transform 140ms ease, background 140ms ease"}),zl={display:"grid",gap:7,padding:"0 7px 7px"},Ml={display:"grid",gridTemplateColumns:"repeat(2, minmax(0, 1fr))",gap:6},pt={display:"flex",flexDirection:"column",gap:4},Tt={...pt,gridColumn:"1 / -1"},we={fontSize:9,color:"rgba(226,232,240,0.72)"},Rs={width:"100%",height:24,borderRadius:7,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(15,23,42,0.68)",color:"#f8fafc",fontSize:10.5,outline:"none",padding:"0 7px",boxSizing:"border-box"},zt={...Rs,appearance:"none"},Mt={display:"flex",alignItems:"center",justifyContent:"space-between",gap:12,minHeight:24},Ft={width:16,height:16},Fl=[{value:"default",label:"Default"},{value:"image",label:"Image"},{value:"gif",label:"GIF"}],Wl=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M5 4h14a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2zm0 2v8.76l4.5-4.5 3.2 3.2 2.8-2.8L19 14.16V6H5zm12 3a2 2 0 1 1-4 0 2 2 0 0 1 4 0z"})}),Ll=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M11 2h2v4h3l-4 4-4-4h3V2zm0 20v-4H8l4-4 4 4h-3v4h-2zM2 11h4V8l4 4-4 4v-3H2v-2zm20 0v2h-4v3l-4-4 4-4v3h4z"})}),$l=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M12 2 3 7v10l9 5 9-5V7l-9-5zm0 2.3L17.9 7 12 9.7 6.1 7 12 4.3zM5 8.5l6 2.7v7.9l-6-3.3V8.5zm8 10.6v-7.9l6-2.7v7.3l-6 3.3z"})}),ns=(t,s)=>({enabled:(s==null?void 0:s.enabled)??t.enabled,showGuides:(s==null?void 0:s.showTransformGuides)??t.showFitGuides,coordinateSpace:t.coordinateSpace,canvasSize:t.canvasSize,position:(s==null?void 0:s.position)??t.position,size:(s==null?void 0:s.size)??t.size,rotation:(s==null?void 0:s.rotation)??t.rotation,scale2D:s==null?void 0:s.scale2D,referencePixelsPerUnit:s==null?void 0:s.referencePixelsPerUnit,pivot:(s==null?void 0:s.pivot)??t.pivot,renderOrder:(s==null?void 0:s.renderOrder)??t.renderOrder,overlay:(s==null?void 0:s.overlay)??t.overlay,visible:(s==null?void 0:s.visible)??t.visible}),Nl=(t,s)=>({...s,enabled:t.enabled,showFitGuides:t.showGuides,coordinateSpace:t.coordinateSpace,canvasSize:t.canvasSize,position:t.position,size:t.size,rotation:t.rotation,pivot:t.pivot,renderOrder:t.renderOrder,overlay:t.overlay,visible:t.visible}),ls=(t,s)=>({...$e.DEFAULT_SCREEN_TRANSFORM_2D,...s,enabled:t.enabled,showTransformGuides:t.showGuides,position:t.position,size:t.size,rotation:t.rotation,scale2D:t.scale2D??(s==null?void 0:s.scale2D)??$e.DEFAULT_SCREEN_TRANSFORM_2D.scale2D,referencePixelsPerUnit:t.referencePixelsPerUnit??(s==null?void 0:s.referencePixelsPerUnit)??$e.DEFAULT_SCREEN_TRANSFORM_2D.referencePixelsPerUnit,pivot:t.pivot,renderOrder:t.renderOrder,overlay:t.overlay,visible:t.visible}),Ol=({value:t,onChange:s,copyLabel:l,inspector:n,docked:a})=>{const[d,r]=y.useState(()=>K.createSceneObject({name:l??"Screen Image",renderGroupId:Le.DEFAULT_RENDER_GROUP_IDS.screen2d})),[o]=y.useState(()=>{const i=d.id,u=K.createDefaultComponent("ScreenTransform",i),j=K.createDefaultComponent("ScreenImage",i),w=K.createDefaultComponent("Material",i),v=K.createDefaultComponent("Texture",i);return{screenTransform:u,screenImage:j,material:w,texture:v}}),[h,x]=y.useState({transformation:!0,image:!0,material:!0}),c=ns(t.screenImage.transformation,t.screenImage.screenTransform),p={object:{...d,componentIds:[o.screenTransform.id,o.screenImage.id,o.material.id,o.texture.id]},kind:"screenImage",components:[{...o.screenTransform,settings:t.screenImage.screenTransform??ls(c)},{...o.screenImage,settings:t.screenImage},{...o.material,settings:{...o.material.settings,color:t.screenImage.image.color,opacity:t.screenImage.image.opacity}},{...o.texture,settings:{...o.texture.settings,url:t.screenImage.image.src||void 0,flipX:t.screenImage.image.flipX,flipY:t.screenImage.image.flipY}}],scene:{screenSpaceUI:t.screenSpaceUI}},f=i=>{s({...t,screenImage:i(t.screenImage)})},g=(i,u,j,w)=>e.jsxs("div",{style:Cl,children:[e.jsxs("div",{style:Rl,children:[e.jsx("button",{type:"button",onClick:()=>x(v=>({...v,[i]:!v[i]})),style:El,children:e.jsx("div",{style:Tl(h[i])})}),e.jsxs("div",{style:Il,children:[e.jsx("span",{style:kl,children:j}),e.jsx("span",{children:u})]})]}),h[i]?e.jsx("div",{style:zl,children:w}):null]},i);return e.jsxs(Ct,{objectId:(n==null?void 0:n.objectId)??d.id,objectName:(n==null?void 0:n.objectName)??d.name,onObjectNameChange:(n==null?void 0:n.onObjectNameChange)??(i=>r(u=>({...u,name:i}))),layer:(n==null?void 0:n.layer)??"Default Layer",visible:(n==null?void 0:n.visible)??t.screenImage.enabled,onVisibleChange:(n==null?void 0:n.onVisibleChange)??(i=>f(u=>({...u,enabled:i}))),copyConfig:(n==null?void 0:n.copyConfig)??p,docked:a??(n==null?void 0:n.docked),initialPosition:n==null?void 0:n.initialPosition,position:n==null?void 0:n.position,onPositionChange:n==null?void 0:n.onPositionChange,title:n==null?void 0:n.title,children:[g("transformation","Transformation",e.jsx(Ll,{}),e.jsx(Ht,{value:ns(t.screenImage.transformation,t.screenImage.screenTransform),guideLabel:"Transform Control On",showRenderOrder:!1,onChange:i=>f(u=>({...u,transformation:Nl(i,u.transformation),screenTransform:ls(i,u.screenTransform)}))})),g("image","Image",e.jsx(Wl,{}),e.jsxs("div",{style:{display:"grid",gap:6},children:[e.jsxs("label",{style:pt,children:[e.jsx("span",{style:we,children:"Preset"}),e.jsx("select",{style:zt,value:t.screenImage.preset,onChange:i=>f(u=>bl(u,i.target.value)),children:gl.map(i=>e.jsx("option",{value:i.value,children:i.label},i.value))})]}),e.jsxs("label",{style:pt,children:[e.jsx("span",{style:we,children:"Source Kind"}),e.jsx("select",{style:zt,value:t.screenImage.image.sourceKind,onChange:i=>f(u=>({...u,image:{...u.image,sourceKind:i.target.value}})),children:Fl.map(i=>e.jsx("option",{value:i.value,children:i.label},i.value))})]}),t.screenImage.image.sourceKind==="image"||t.screenImage.image.sourceKind==="gif"?e.jsxs("label",{style:pt,children:[e.jsx("span",{style:we,children:"Source URL"}),e.jsx("input",{style:Rs,value:t.screenImage.image.src,onChange:i=>f(u=>({...u,image:{...u.image,src:i.target.value}}))})]}):null,e.jsxs("label",{style:pt,children:[e.jsx("span",{style:we,children:"Stretch Mode"}),e.jsxs("select",{style:zt,value:t.screenImage.image.stretchMode,onChange:i=>f(u=>({...u,image:{...u.image,stretchMode:i.target.value}})),children:[e.jsx("option",{value:"fit",children:"Fit"}),e.jsx("option",{value:"fitWidth",children:"Fit Width"}),e.jsx("option",{value:"fitHeight",children:"Fit Height"}),e.jsx("option",{value:"center",children:"Center"}),e.jsx("option",{value:"stretch",children:"Stretch"}),e.jsx("option",{value:"fill",children:"Fill"}),e.jsx("option",{value:"fillAndCut",children:"Fill and Cut"})]})]}),e.jsx("label",{style:Tt,children:e.jsxs("div",{style:Mt,children:[e.jsx("span",{style:we,children:"Flip X"}),e.jsx("input",{type:"checkbox",style:Ft,checked:t.screenImage.image.flipX,onChange:i=>f(u=>({...u,image:{...u.image,flipX:i.target.checked}}))})]})}),e.jsx("label",{style:Tt,children:e.jsxs("div",{style:Mt,children:[e.jsx("span",{style:we,children:"Flip Y"}),e.jsx("input",{type:"checkbox",style:Ft,checked:t.screenImage.image.flipY,onChange:i=>f(u=>({...u,image:{...u.image,flipY:i.target.checked}}))})]})})]})),g("material","Material",e.jsx($l,{}),e.jsxs("div",{style:Ml,children:[e.jsx(wl,{value:t.screenImage.image,onChange:i=>f(u=>({...u,image:{...u.image,materialType:i.materialType,blendMode:i.blendMode,opacity:i.opacity,color:i.color,alphaTest:i.alphaTest}}))}),e.jsx("label",{style:Tt,children:e.jsxs("div",{style:Mt,children:[e.jsx("span",{style:we,children:"Transparent"}),e.jsx("input",{type:"checkbox",style:Ft,checked:t.screenImage.image.transparent,onChange:i=>f(u=>({...u,image:{...u.image,transparent:i.target.checked}}))})]})})]}))]})},_e={display:"grid",gridTemplateColumns:"92px minmax(0,1fr)",alignItems:"center",gap:10,margin:"8px 0",color:"#cbd5e1",fontSize:12},We={width:"100%",boxSizing:"border-box",padding:"8px 9px",border:"1px solid rgba(148,163,184,.16)",borderRadius:6,background:"rgba(15,23,42,.72)",color:"#e2e8f0"},Al=({onChange:t,value:s})=>e.jsxs("fieldset",{style:{border:0,padding:0,margin:0},children:[s.map((l,n)=>e.jsxs("div",{style:_e,children:[e.jsx("input",{"aria-label":`Gradient stop ${n+1} color`,type:"color",style:{...We,padding:2},value:l.color,onChange:a=>t(s.map((d,r)=>r===n?{...d,color:a.currentTarget.value}:d))}),e.jsxs("span",{style:{display:"grid",gridTemplateColumns:"1fr auto",gap:4},children:[e.jsx("input",{"aria-label":`Gradient stop ${n+1} position`,type:"number",min:0,max:1,step:.05,style:We,value:l.offset,onChange:a=>t(s.map((d,r)=>r===n?{...d,offset:Number(a.currentTarget.value)}:d))}),s.length>2?e.jsx("button",{type:"button",onClick:()=>t(s.filter((a,d)=>d!==n)),children:"−"}):null]})]},`${n}-${l.color}`)),s.length<J.MAX_SCREEN_GRADIENT_STOPS?e.jsx("button",{type:"button",onClick:()=>{var l;return t([...s,{offset:.5,color:((l=s[s.length-1])==null?void 0:l.color)??"#ffffff"}])},children:"Add stop"}):null]}),Is=({onChange:t,value:s})=>e.jsxs("fieldset",{style:{border:0,padding:0,margin:0},children:[e.jsxs("label",{style:_e,children:[e.jsx("span",{children:"Gradient"}),e.jsxs("select",{style:We,value:s.type,onChange:l=>t({...s,type:l.currentTarget.value}),children:[e.jsx("option",{value:"linear",children:"Linear"}),e.jsx("option",{value:"radial",children:"Radial"}),e.jsx("option",{value:"angular",children:"Conic / Angular"})]})]}),e.jsx(Al,{value:s.stops,onChange:l=>t({...s,stops:l})}),s.type!=="radial"?e.jsxs("label",{style:_e,children:[e.jsx("span",{children:"Angle"}),e.jsx("input",{type:"number",style:We,step:5,value:s.angle,onChange:l=>t({...s,angle:Number(l.currentTarget.value)})})]}):null,s.type!=="linear"?e.jsxs(e.Fragment,{children:[e.jsxs("label",{style:_e,children:[e.jsx("span",{children:"Center X"}),e.jsx("input",{type:"number",style:We,min:0,max:1,step:.05,value:s.center.x,onChange:l=>t({...s,center:{...s.center,x:Number(l.currentTarget.value)}})})]}),e.jsxs("label",{style:_e,children:[e.jsx("span",{children:"Center Y"}),e.jsx("input",{type:"number",style:We,min:0,max:1,step:.05,value:s.center.y,onChange:l=>t({...s,center:{...s.center,y:Number(l.currentTarget.value)}})})]})]}):null,s.type==="radial"?e.jsxs("label",{style:_e,children:[e.jsx("span",{children:"Radius"}),e.jsx("input",{type:"number",style:We,min:.01,step:.05,value:s.radius,onChange:l=>t({...s,radius:Number(l.currentTarget.value)})})]}):null]}),is={display:"grid",gridTemplateColumns:"92px minmax(0,1fr)",alignItems:"center",gap:10,margin:"8px 0",color:"#cbd5e1",fontSize:12},os={width:"100%",boxSizing:"border-box",padding:"8px 9px",border:"1px solid rgba(148,163,184,.16)",borderRadius:6,background:"rgba(15,23,42,.72)",color:"#e2e8f0"},Es=({value:t,onChange:s})=>e.jsxs("fieldset",{style:{border:0,padding:0,margin:0},children:[e.jsxs("label",{style:is,children:[e.jsx("span",{children:"Tint"}),e.jsx("input",{type:"color",style:{...os,padding:2},value:t.tint,onChange:l=>s({...t,tint:l.currentTarget.value})})]}),["opacity","frost","highlight"].map(l=>e.jsxs("label",{style:is,children:[e.jsx("span",{children:l[0].toUpperCase()+l.slice(1)}),e.jsx("input",{type:"number",style:os,min:0,max:1,step:.05,value:t[l],onChange:n=>s({...t,[l]:Number(n.currentTarget.value)})})]},l))]}),Pl={borderRadius:12,border:"1px solid rgba(255,255,255,.08)",background:"rgba(255,255,255,.03)",padding:8},Ue={display:"grid",gridTemplateColumns:"92px minmax(0,1fr)",alignItems:"center",gap:10,margin:"8px 0",color:"#cbd5e1",fontSize:12},ht={width:"100%",boxSizing:"border-box",padding:"8px 9px",border:"1px solid rgba(148,163,184,.16)",borderRadius:6,background:"rgba(15,23,42,.72)",color:"#e2e8f0"},ie=({label:t,onValue:s,...l})=>e.jsxs("label",{style:Ue,children:[e.jsx("span",{children:t}),e.jsx("input",{...l,type:"number",style:ht,onChange:n=>s(Number(n.currentTarget.value))})]}),Ts=({value:t,onChange:s})=>e.jsxs("section",{style:Pl,children:[e.jsx("div",{style:{fontSize:11,fontWeight:700,marginBottom:7},children:"Screen Shape"}),e.jsxs("label",{style:Ue,children:[e.jsx("span",{children:"Shape"}),e.jsxs("select",{style:ht,value:t.kind,onChange:l=>s({...t,kind:l.currentTarget.value}),children:[e.jsx("option",{value:"circle",children:"Circle"}),e.jsx("option",{value:"ellipse",children:"Ellipse"}),e.jsx("option",{value:"rectangle",children:"Rectangle"}),e.jsx("option",{value:"roundedRectangle",children:"Rounded Rectangle"}),e.jsx("option",{value:"polygon",children:"Polygon"}),e.jsx("option",{value:"star",children:"Star"}),e.jsx("option",{value:"line",children:"Line"})]})]}),t.kind!=="line"?e.jsxs(e.Fragment,{children:[e.jsxs("label",{style:Ue,children:[e.jsx("span",{children:"Fill"}),e.jsxs("select",{style:ht,value:t.fillMode,onChange:l=>s({...t,fillMode:l.currentTarget.value}),children:[e.jsx("option",{value:"solid",children:"Solid"}),e.jsx("option",{value:"gradient",children:"Gradient"}),e.jsx("option",{value:"glass",children:"Glass"})]})]}),t.fillMode==="gradient"?e.jsx(Is,{value:t.gradient,onChange:l=>s({...t,gradient:l})}):t.fillMode==="glass"?e.jsx(Es,{value:t.glass,onChange:l=>s({...t,glass:l})}):e.jsxs("label",{style:Ue,children:[e.jsx("span",{children:"Color"}),e.jsx("input",{type:"color",style:{...ht,padding:2},value:t.fillColor,onChange:l=>s({...t,fillColor:l.currentTarget.value})})]}),e.jsx(ie,{label:"Fill Opacity",min:0,max:1,step:.05,value:t.fillOpacity,onValue:l=>s({...t,fillOpacity:l})})]}):null,e.jsxs("label",{style:Ue,children:[e.jsx("span",{children:"Stroke"}),e.jsx("input",{type:"color",style:{...ht,padding:2},value:t.strokeColor,onChange:l=>s({...t,strokeColor:l.currentTarget.value})})]}),e.jsx(ie,{label:"Stroke Width",min:0,step:1,value:t.strokeWidth,onValue:l=>s({...t,strokeWidth:l})}),e.jsx(ie,{label:"Stroke Opacity",min:0,max:1,step:.05,value:t.strokeOpacity,onValue:l=>s({...t,strokeOpacity:l})}),e.jsxs("label",{style:Ue,children:[e.jsx("span",{children:"Dashed"}),e.jsx("input",{type:"checkbox",checked:t.dashed,onChange:l=>s({...t,dashed:l.currentTarget.checked})})]}),t.kind==="roundedRectangle"?e.jsx(ie,{label:"Corner Radius",min:0,max:.5,step:.01,value:t.cornerRadius,onValue:l=>s({...t,cornerRadius:l})}):null,t.kind==="polygon"||t.kind==="star"?e.jsx(ie,{label:t.kind==="star"?"Points":"Sides",min:3,max:12,step:1,value:t.sides,onValue:l=>s({...t,sides:l})}):null,t.kind==="star"?e.jsx(ie,{label:"Inner Radius",min:.05,max:.95,step:.05,value:t.innerRadiusRatio,onValue:l=>s({...t,innerRadiusRatio:l})}):null,t.kind==="line"?e.jsxs(e.Fragment,{children:[e.jsx(ie,{label:"Start X",min:0,max:1,step:.05,value:t.lineStart.x,onValue:l=>s({...t,lineStart:{...t.lineStart,x:l}})}),e.jsx(ie,{label:"Start Y",min:0,max:1,step:.05,value:t.lineStart.y,onValue:l=>s({...t,lineStart:{...t.lineStart,y:l}})}),e.jsx(ie,{label:"End X",min:0,max:1,step:.05,value:t.lineEnd.x,onValue:l=>s({...t,lineEnd:{...t.lineEnd,x:l}})}),e.jsx(ie,{label:"End Y",min:0,max:1,step:.05,value:t.lineEnd.y,onValue:l=>s({...t,lineEnd:{...t.lineEnd,y:l}})})]}):null]}),Dl={enabled:!0,bothHands:!0,visualScale:1,opacity:.92,pointRadius:3,lineWidth:3,labelScale:1.2,smoothing:.35,color:"#22d3ee",showBoundingBox:!0,showLabels:!1,logToConsole:!1},Bl={position:"fixed",left:14,top:104,zIndex:2e4,pointerEvents:"none"},zs={pointerEvents:"auto",width:286,borderRadius:16,border:"1px solid rgba(255,255,255,0.12)",background:"rgba(8, 15, 28, 0.58)",boxShadow:"0 16px 36px rgba(0,0,0,0.28)",backdropFilter:"blur(20px) saturate(1.1)",WebkitBackdropFilter:"blur(20px) saturate(1.1)",color:"#f8fafc",overflowX:"hidden",overflowY:"auto",scrollbarWidth:"thin",scrollbarColor:"rgba(148,163,184,0.55) rgba(255,255,255,0.06)",overscrollBehavior:"contain"},Vl={...zs,width:32,height:32,borderRadius:16,display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer"},Kl={position:"sticky",top:0,zIndex:1,display:"flex",alignItems:"center",gap:7,padding:"7px 8px",borderBottom:"1px solid rgba(255,255,255,0.08)",background:"rgba(8, 15, 28, 0.88)",backdropFilter:"blur(20px) saturate(1.1)",WebkitBackdropFilter:"blur(20px) saturate(1.1)"},Hl={width:16,height:16,display:"flex",alignItems:"center",justifyContent:"center",cursor:"grab",color:"rgba(148,163,184,0.82)",flex:"0 0 auto"},Gl={display:"flex",alignItems:"center",gap:6,fontSize:11,fontWeight:600,minWidth:0},rs={display:"flex",width:18,height:18,alignItems:"center",justifyContent:"center",borderRadius:6,background:"rgba(255,255,255,0.08)",border:"1px solid rgba(255,255,255,0.08)",color:"#e2e8f0",flex:"0 0 auto"},_l={display:"grid",gap:6,padding:7},Ul={borderRadius:12,border:"1px solid rgba(255,255,255,0.08)",background:"rgba(255,255,255,0.03)",overflow:"hidden"},Xl={display:"flex",alignItems:"center",gap:7,padding:"6px 7px"},Zl={display:"flex",alignItems:"center",gap:6,fontSize:11,fontWeight:500,flex:"1 1 auto",minWidth:0},Yl={width:28,height:16,borderRadius:999,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(255,255,255,0.08)",padding:2,display:"flex",alignItems:"center",cursor:"pointer",flex:"0 0 auto"},ql=t=>({width:10,height:10,borderRadius:999,background:t?"#f8fafc":"rgba(148,163,184,0.7)",transform:t?"translateX(12px)":"translateX(0)",transition:"transform 140ms ease, background 140ms ease"}),Jl={display:"grid",gap:7,padding:"0 7px 7px"},Ql={display:"grid",gridTemplateColumns:"repeat(2, minmax(0, 1fr))",gap:6},Fe={display:"flex",flexDirection:"column",gap:4},et={...Fe,gridColumn:"1 / -1"},ne={fontSize:9,color:"rgba(226,232,240,0.72)"},Ve={width:"100%",height:24,borderRadius:7,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(15,23,42,0.68)",color:"#f8fafc",fontSize:10.5,outline:"none",padding:"0 7px",boxSizing:"border-box"},tt={display:"flex",alignItems:"center",justifyContent:"space-between",gap:12,minHeight:24},st={width:16,height:16},as={display:"inline-flex",alignItems:"center",justifyContent:"center",width:24,height:24,borderRadius:8,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(255,255,255,0.05)",color:"#e2e8f0",cursor:"pointer",padding:0,flex:"0 0 auto"},ei=()=>e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M7 10h10v2H7v-2zm0 4h10v2H7v-2zm0-8h10v2H7V6z"})}),ti=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M18.3 5.71 12 12l6.3 6.29-1.41 1.41L10.59 13.41 4.29 19.7 2.88 18.29 9.17 12 2.88 5.71 4.29 4.3l6.3 6.29 6.29-6.3z"})}),si=()=>e.jsx("svg",{width:"11",height:"15",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M8 6a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM8 12a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM8 18a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM16 6a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM16 12a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM16 18a2 2 0 1 1-4 0 2 2 0 0 1 4 0z"})}),Wt=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M11 2a1 1 0 0 1 1 1v6h1V3a1 1 0 1 1 2 0v6h1V4a1 1 0 1 1 2 0v7.3l1.6 2.4a5 5 0 0 1 .8 2.7V18a4 4 0 0 1-4 4H9a6 6 0 0 1-6-6v-3.5a2.5 2.5 0 0 1 5 0V15h1V3a1 1 0 0 1 1-1z"})}),ni=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M12 5V2L7 7l5 5V9a4 4 0 1 1-4 4H6a6 6 0 1 0 6-8z"})}),li=({value:t,onChange:s})=>{const[l,n]=y.useState(!0),[a,d]=y.useState({x:14,y:104}),[r,o]=y.useState(typeof window>"u"?0:window.innerHeight),[h,x]=y.useState({overlay:!0,visibility:!1}),c=y.useRef(null),p=Math.max(240,r-a.y-16);y.useEffect(()=>{const i=j=>{c.current&&d({x:Math.max(8,j.clientX-c.current.x),y:Math.max(8,j.clientY-c.current.y)})},u=()=>{c.current=null,document.body.classList.remove("select-none")};return window.addEventListener("pointermove",i),window.addEventListener("pointerup",u),()=>{window.removeEventListener("pointermove",i),window.removeEventListener("pointerup",u)}},[]),y.useEffect(()=>{const i=()=>o(window.innerHeight);return window.addEventListener("resize",i),()=>window.removeEventListener("resize",i)},[]);const f=i=>{const u=i.currentTarget.getBoundingClientRect();c.current={x:i.clientX-u.left,y:i.clientY-u.top},document.body.classList.add("select-none"),i.currentTarget.setPointerCapture(i.pointerId)},g=(i,u,j,w)=>e.jsxs("div",{style:Ul,children:[e.jsxs("div",{style:Xl,children:[e.jsx("button",{type:"button",onClick:()=>x(v=>({...v,[i]:!v[i]})),style:Yl,children:e.jsx("div",{style:ql(h[i])})}),e.jsxs("div",{style:Zl,children:[e.jsx("span",{style:rs,children:j}),e.jsx("span",{children:u})]})]}),h[i]?e.jsx("div",{style:Jl,children:w}):null]},i);return typeof document>"u"?null:Ae.createPortal(e.jsxs("div",{style:{...Bl,left:a.x,top:a.y},children:[e.jsx("style",{children:`
12
2
  .xr-hand-tracking-2d-scroll::-webkit-scrollbar { width: 10px; }
13
3
  .xr-hand-tracking-2d-scroll::-webkit-scrollbar-track { background: rgba(255,255,255,0.06); border-radius: 999px; }
14
4
  .xr-hand-tracking-2d-scroll::-webkit-scrollbar-thumb { background: rgba(148,163,184,0.55); border-radius: 999px; border: 2px solid transparent; background-clip: padding-box; }
15
5
  .xr-hand-tracking-2d-scroll::-webkit-scrollbar-thumb:hover { background: rgba(226,232,240,0.68); background-clip: padding-box; }
16
- `}),p?e.jsxs("div",{className:"xr-hand-tracking-2d-scroll",style:{...Wt,height:v},children:[e.jsxs("div",{style:an,children:[e.jsx("div",{onPointerDown:d,style:dn,children:e.jsx(wn,{})}),e.jsxs("div",{style:cn,children:[e.jsx("span",{style:ht,children:e.jsx(Oe,{})}),e.jsx("span",{children:"HandTracking2D"})]}),e.jsx("div",{style:{flex:"1 1 auto"}}),e.jsx("button",{type:"button",onClick:()=>i(Dt),style:pt,children:e.jsx(Sn,{})}),e.jsx("button",{type:"button",onClick:()=>w(!1),style:pt,children:e.jsx(mn,{})})]}),e.jsxs("div",{style:hn,children:[h("overlay","Overlay",e.jsx(Oe,{}),e.jsxs("div",{style:fn,children:[e.jsxs("label",{style:ye,children:[e.jsx("span",{style:Z,children:"Hand Size"}),e.jsx("input",{style:me,type:"number",min:.25,max:1.8,step:.05,value:t.visualScale,onChange:s=>i({...t,visualScale:Number(s.target.value)})})]}),e.jsxs("label",{style:ye,children:[e.jsx("span",{style:Z,children:"Opacity"}),e.jsx("input",{style:me,type:"number",min:0,max:1,step:.01,value:t.opacity,onChange:s=>i({...t,opacity:Number(s.target.value)})})]}),e.jsxs("label",{style:ye,children:[e.jsx("span",{style:Z,children:"Joint Radius"}),e.jsx("input",{style:me,type:"number",min:1,max:20,step:1,value:t.pointRadius,onChange:s=>i({...t,pointRadius:Number(s.target.value)})})]}),e.jsxs("label",{style:ye,children:[e.jsx("span",{style:Z,children:"Stroke"}),e.jsx("input",{style:me,type:"number",min:.01,max:100,step:.01,value:t.lineWidth,onChange:s=>i({...t,lineWidth:Number(s.target.value)})})]}),e.jsxs("label",{style:ye,children:[e.jsx("span",{style:Z,children:"Smoothing"}),e.jsx("input",{style:me,type:"number",min:0,max:1,step:.01,value:t.smoothing,onChange:s=>i({...t,smoothing:Number(s.target.value)})})]}),e.jsxs("label",{style:ye,children:[e.jsx("span",{style:Z,children:"Label Size"}),e.jsx("input",{style:me,type:"number",min:.25,max:3,step:.05,value:t.labelScale,onChange:s=>i({...t,labelScale:Number(s.target.value)})})]}),e.jsx("label",{style:Ce,children:e.jsxs("div",{style:ze,children:[e.jsx("span",{style:Z,children:"Bounding Box"}),e.jsx("input",{type:"checkbox",style:Re,checked:t.showBoundingBox,onChange:s=>i({...t,showBoundingBox:s.target.checked})})]})})]})),h("visibility","Visibility",e.jsx(Oe,{}),e.jsxs(e.Fragment,{children:[e.jsx("label",{style:Ce,children:e.jsxs("div",{style:ze,children:[e.jsx("span",{style:Z,children:"Show Overlay"}),e.jsx("input",{type:"checkbox",style:Re,checked:t.enabled,onChange:s=>i({...t,enabled:s.target.checked})})]})}),e.jsx("label",{style:Ce,children:e.jsxs("div",{style:ze,children:[e.jsx("span",{style:Z,children:"Both Hands"}),e.jsx("input",{type:"checkbox",style:Re,checked:t.bothHands,onChange:s=>i({...t,bothHands:s.target.checked})})]})}),e.jsx("label",{style:Ce,children:e.jsxs("div",{style:ze,children:[e.jsx("span",{style:Z,children:"Show Labels"}),e.jsx("input",{type:"checkbox",style:Re,checked:t.showLabels,onChange:s=>i({...t,showLabels:s.target.checked})})]})}),e.jsx("label",{style:Ce,children:e.jsxs("div",{style:ze,children:[e.jsx("span",{style:Z,children:"Log to Console"}),e.jsx("input",{type:"checkbox",style:Re,checked:t.logToConsole,onChange:s=>i({...t,logToConsole:s.target.checked})})]})})]}))]})]}):e.jsx("div",{role:"button",tabIndex:0,onClick:()=>w(!0),style:rn,children:e.jsx(jn,{})})]}),document.body)},vn={position:"fixed",left:320,top:104,zIndex:2e4,pointerEvents:"none"},It={pointerEvents:"auto",width:286,borderRadius:16,border:"1px solid rgba(255,255,255,0.12)",background:"rgba(8, 15, 28, 0.58)",boxShadow:"0 16px 36px rgba(0,0,0,0.28)",backdropFilter:"blur(20px) saturate(1.1)",WebkitBackdropFilter:"blur(20px) saturate(1.1)",color:"#f8fafc",overflowX:"hidden",overflowY:"auto",scrollbarWidth:"thin",scrollbarColor:"rgba(148,163,184,0.55) rgba(255,255,255,0.06)",overscrollBehavior:"contain"},Cn={...It,width:32,height:32,borderRadius:16,display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer"},zn={position:"sticky",top:0,zIndex:1,display:"flex",alignItems:"center",gap:7,padding:"7px 8px",borderBottom:"1px solid rgba(255,255,255,0.08)",background:"rgba(8, 15, 28, 0.88)",backdropFilter:"blur(20px) saturate(1.1)",WebkitBackdropFilter:"blur(20px) saturate(1.1)"},Rn={display:"grid",gap:6,padding:7},Wn={borderRadius:12,border:"1px solid rgba(255,255,255,0.08)",background:"rgba(255,255,255,0.03)",overflow:"hidden"},In={display:"flex",alignItems:"center",gap:7,padding:"6px 7px"},En={display:"flex",alignItems:"center",gap:6,fontSize:11,fontWeight:500,flex:"1 1 auto",minWidth:0},Tn={width:28,height:16,borderRadius:999,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(255,255,255,0.08)",padding:2,display:"flex",alignItems:"center",cursor:"pointer",flex:"0 0 auto"},Ln=t=>({width:10,height:10,borderRadius:999,background:t?"#f8fafc":"rgba(148,163,184,0.7)",transform:t?"translateX(12px)":"translateX(0)",transition:"transform 140ms ease, background 140ms ease"}),Fn={display:"grid",gap:7,padding:"0 7px 7px"},Mn={display:"grid",gridTemplateColumns:"repeat(2, minmax(0, 1fr))",gap:6},q={display:"flex",flexDirection:"column",gap:4},oe={...q,gridColumn:"1 / -1"},H={fontSize:9,color:"rgba(226,232,240,0.72)"},ne={width:"100%",height:24,borderRadius:7,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(15,23,42,0.68)",color:"#f8fafc",fontSize:10.5,outline:"none",padding:"0 7px",boxSizing:"border-box"},re={display:"flex",alignItems:"center",justifyContent:"space-between",gap:12,minHeight:24},ae={width:16,height:16},yt={display:"inline-flex",alignItems:"center",justifyContent:"center",width:24,height:24,borderRadius:8,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(255,255,255,0.05)",color:"#e2e8f0",cursor:"pointer",padding:0,flex:"0 0 auto"},Hn=()=>e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M7 10h10v2H7v-2zm0 4h10v2H7v-2zm0-8h10v2H7V6z"})}),Kn=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M18.3 5.71 12 12l6.3 6.29-1.41 1.41L10.59 13.41 4.29 19.7 2.88 18.29 9.17 12 2.88 5.71 4.29 4.3l6.3 6.29 6.29-6.3z"})}),Bn=()=>e.jsx("svg",{width:"11",height:"15",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M8 6a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM8 12a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM8 18a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM16 6a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM16 12a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM16 18a2 2 0 1 1-4 0 2 2 0 0 1 4 0z"})}),Pe=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M11 2a1 1 0 0 1 1 1v6h1V3a1 1 0 1 1 2 0v6h1V4a1 1 0 1 1 2 0v7.3l1.6 2.4a5 5 0 0 1 .8 2.7V18a4 4 0 0 1-4 4H9a6 6 0 0 1-6-6v-3.5a2.5 2.5 0 0 1 5 0V15h1V3a1 1 0 0 1 1-1z"})}),$n=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M12 5V2L7 7l5 5V9a4 4 0 1 1-4 4H6a6 6 0 1 0 6-8z"})}),Vn=({value:t,onChange:i})=>{const[p,w]=c.useState(!0),[j,S]=c.useState({x:320,y:104}),[R,k]=c.useState(typeof window>"u"?0:window.innerHeight),[u,r]=c.useState({controller:!0,visibility:!1}),o=c.useRef(null),v=Math.max(240,R-j.y-16);c.useEffect(()=>{const s=a=>{o.current&&S({x:Math.max(8,a.clientX-o.current.x),y:Math.max(8,a.clientY-o.current.y)})},y=()=>{o.current=null,document.body.classList.remove("select-none")};return window.addEventListener("pointermove",s),window.addEventListener("pointerup",y),()=>{window.removeEventListener("pointermove",s),window.removeEventListener("pointerup",y)}},[]),c.useEffect(()=>{const s=()=>k(window.innerHeight);return window.addEventListener("resize",s),()=>window.removeEventListener("resize",s)},[]);const d=s=>{const y=s.currentTarget.getBoundingClientRect();o.current={x:s.clientX-y.left,y:s.clientY-y.top},document.body.classList.add("select-none"),s.currentTarget.setPointerCapture(s.pointerId)},h=(s,y,a,b)=>e.jsxs("div",{style:Wn,children:[e.jsxs("div",{style:In,children:[e.jsx("button",{type:"button",onClick:()=>r(I=>({...I,[s]:!I[s]})),style:Tn,children:e.jsx("div",{style:Ln(u[s])})}),e.jsxs("div",{style:En,children:[e.jsx("span",{style:{display:"flex",width:18,height:18,alignItems:"center",justifyContent:"center",borderRadius:6,background:"rgba(255,255,255,0.08)",border:"1px solid rgba(255,255,255,0.08)",color:"#e2e8f0",flex:"0 0 auto"},children:a}),e.jsx("span",{children:y})]})]}),u[s]?e.jsx("div",{style:Fn,children:b}):null]},s);return typeof document>"u"?null:ie.createPortal(e.jsxs("div",{style:{...vn,left:j.x,top:j.y},children:[e.jsx("style",{children:`
6
+ `}),l?e.jsxs("div",{className:"xr-hand-tracking-2d-scroll",style:{...zs,height:p},children:[e.jsxs("div",{style:Kl,children:[e.jsx("div",{onPointerDown:f,style:Hl,children:e.jsx(si,{})}),e.jsxs("div",{style:Gl,children:[e.jsx("span",{style:rs,children:e.jsx(Wt,{})}),e.jsx("span",{children:"HandTracking2D"})]}),e.jsx("div",{style:{flex:"1 1 auto"}}),e.jsx("button",{type:"button",onClick:()=>s(Dl),style:as,children:e.jsx(ni,{})}),e.jsx("button",{type:"button",onClick:()=>n(!1),style:as,children:e.jsx(ti,{})})]}),e.jsxs("div",{style:_l,children:[g("overlay","Overlay",e.jsx(Wt,{}),e.jsxs("div",{style:Ql,children:[e.jsxs("label",{style:Fe,children:[e.jsx("span",{style:ne,children:"Hand Size"}),e.jsx("input",{style:Ve,type:"number",min:.25,max:1.8,step:.05,value:t.visualScale,onChange:i=>s({...t,visualScale:Number(i.target.value)})})]}),e.jsxs("label",{style:Fe,children:[e.jsx("span",{style:ne,children:"Opacity"}),e.jsx("input",{style:Ve,type:"number",min:0,max:1,step:.01,value:t.opacity,onChange:i=>s({...t,opacity:Number(i.target.value)})})]}),e.jsxs("label",{style:Fe,children:[e.jsx("span",{style:ne,children:"Joint Radius"}),e.jsx("input",{style:Ve,type:"number",min:1,max:20,step:1,value:t.pointRadius,onChange:i=>s({...t,pointRadius:Number(i.target.value)})})]}),e.jsxs("label",{style:Fe,children:[e.jsx("span",{style:ne,children:"Stroke"}),e.jsx("input",{style:Ve,type:"number",min:.01,max:100,step:.01,value:t.lineWidth,onChange:i=>s({...t,lineWidth:Number(i.target.value)})})]}),e.jsxs("label",{style:Fe,children:[e.jsx("span",{style:ne,children:"Smoothing"}),e.jsx("input",{style:Ve,type:"number",min:0,max:1,step:.01,value:t.smoothing,onChange:i=>s({...t,smoothing:Number(i.target.value)})})]}),e.jsxs("label",{style:Fe,children:[e.jsx("span",{style:ne,children:"Label Size"}),e.jsx("input",{style:Ve,type:"number",min:.25,max:3,step:.05,value:t.labelScale,onChange:i=>s({...t,labelScale:Number(i.target.value)})})]}),e.jsx("label",{style:et,children:e.jsxs("div",{style:tt,children:[e.jsx("span",{style:ne,children:"Bounding Box"}),e.jsx("input",{type:"checkbox",style:st,checked:t.showBoundingBox,onChange:i=>s({...t,showBoundingBox:i.target.checked})})]})})]})),g("visibility","Visibility",e.jsx(Wt,{}),e.jsxs(e.Fragment,{children:[e.jsx("label",{style:et,children:e.jsxs("div",{style:tt,children:[e.jsx("span",{style:ne,children:"Show Overlay"}),e.jsx("input",{type:"checkbox",style:st,checked:t.enabled,onChange:i=>s({...t,enabled:i.target.checked})})]})}),e.jsx("label",{style:et,children:e.jsxs("div",{style:tt,children:[e.jsx("span",{style:ne,children:"Both Hands"}),e.jsx("input",{type:"checkbox",style:st,checked:t.bothHands,onChange:i=>s({...t,bothHands:i.target.checked})})]})}),e.jsx("label",{style:et,children:e.jsxs("div",{style:tt,children:[e.jsx("span",{style:ne,children:"Show Labels"}),e.jsx("input",{type:"checkbox",style:st,checked:t.showLabels,onChange:i=>s({...t,showLabels:i.target.checked})})]})}),e.jsx("label",{style:et,children:e.jsxs("div",{style:tt,children:[e.jsx("span",{style:ne,children:"Log to Console"}),e.jsx("input",{type:"checkbox",style:st,checked:t.logToConsole,onChange:i=>s({...t,logToConsole:i.target.checked})})]})})]}))]})]}):e.jsx("div",{role:"button",tabIndex:0,onClick:()=>n(!0),style:Vl,children:e.jsx(ei,{})})]}),document.body)},ii={enabled:!0,attachImageEnabled:!0,showBoundingBox:!1,verticalAlign:"middle",horizontalAlign:"center",sizeResponsiveToHandBoundingBox:!1,size:1,offsetX:0,offsetY:.02,rotation:0,alpha:1,smoothFollowing:!0,smoothing:.35},oi=[{label:"Top",value:"top"},{label:"Middle",value:"middle"},{label:"Bottom",value:"bottom"}],ri=[{label:"Left",value:"left"},{label:"Middle",value:"center"},{label:"Right",value:"right"}],ai={position:"fixed",left:320,top:104,zIndex:2e4,pointerEvents:"none"},Ms={pointerEvents:"auto",width:286,borderRadius:16,border:"1px solid rgba(255,255,255,0.12)",background:"rgba(8, 15, 28, 0.58)",boxShadow:"0 16px 36px rgba(0,0,0,0.28)",backdropFilter:"blur(20px) saturate(1.1)",WebkitBackdropFilter:"blur(20px) saturate(1.1)",color:"#f8fafc",overflowX:"hidden",overflowY:"auto",scrollbarWidth:"thin",scrollbarColor:"rgba(148,163,184,0.55) rgba(255,255,255,0.06)",overscrollBehavior:"contain"},di={...Ms,width:32,height:32,borderRadius:16,display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer"},ci={position:"sticky",top:0,zIndex:1,display:"flex",alignItems:"center",gap:7,padding:"7px 8px",borderBottom:"1px solid rgba(255,255,255,0.08)",background:"rgba(8, 15, 28, 0.88)",backdropFilter:"blur(20px) saturate(1.1)",WebkitBackdropFilter:"blur(20px) saturate(1.1)"},pi={display:"grid",gap:6,padding:7},hi={borderRadius:12,border:"1px solid rgba(255,255,255,0.08)",background:"rgba(255,255,255,0.03)",overflow:"hidden"},xi={display:"flex",alignItems:"center",gap:7,padding:"6px 7px"},ui={display:"flex",alignItems:"center",gap:6,fontSize:11,fontWeight:500,flex:"1 1 auto",minWidth:0},gi={width:28,height:16,borderRadius:999,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(255,255,255,0.08)",padding:2,display:"flex",alignItems:"center",cursor:"pointer",flex:"0 0 auto"},yi=t=>({width:10,height:10,borderRadius:999,background:t?"#f8fafc":"rgba(148,163,184,0.7)",transform:t?"translateX(12px)":"translateX(0)",transition:"transform 140ms ease, background 140ms ease"}),bi={display:"grid",gap:7,padding:"0 7px 7px"},fi={display:"grid",gridTemplateColumns:"repeat(2, minmax(0, 1fr))",gap:6},pe={display:"flex",flexDirection:"column",gap:4},ke={...pe,gridColumn:"1 / -1"},B={fontSize:9,color:"rgba(226,232,240,0.72)"},ge={width:"100%",height:24,borderRadius:7,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(15,23,42,0.68)",color:"#f8fafc",fontSize:10.5,outline:"none",padding:"0 7px",boxSizing:"border-box"},Ce={display:"flex",alignItems:"center",justifyContent:"space-between",gap:12,minHeight:24},Re={width:16,height:16},ds={display:"inline-flex",alignItems:"center",justifyContent:"center",width:24,height:24,borderRadius:8,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(255,255,255,0.05)",color:"#e2e8f0",cursor:"pointer",padding:0,flex:"0 0 auto"},ji=()=>e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M7 10h10v2H7v-2zm0 4h10v2H7v-2zm0-8h10v2H7V6z"})}),mi=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M18.3 5.71 12 12l6.3 6.29-1.41 1.41L10.59 13.41 4.29 19.7 2.88 18.29 9.17 12 2.88 5.71 4.29 4.3l6.3 6.29 6.29-6.3z"})}),Si=()=>e.jsx("svg",{width:"11",height:"15",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M8 6a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM8 12a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM8 18a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM16 6a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM16 12a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM16 18a2 2 0 1 1-4 0 2 2 0 0 1 4 0z"})}),Lt=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M11 2a1 1 0 0 1 1 1v6h1V3a1 1 0 1 1 2 0v6h1V4a1 1 0 1 1 2 0v7.3l1.6 2.4a5 5 0 0 1 .8 2.7V18a4 4 0 0 1-4 4H9a6 6 0 0 1-6-6v-3.5a2.5 2.5 0 0 1 5 0V15h1V3a1 1 0 0 1 1-1z"})}),vi=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M12 5V2L7 7l5 5V9a4 4 0 1 1-4 4H6a6 6 0 1 0 6-8z"})}),wi=({value:t,onChange:s})=>{const[l,n]=y.useState(!0),[a,d]=y.useState({x:320,y:104}),[r,o]=y.useState(typeof window>"u"?0:window.innerHeight),[h,x]=y.useState({controller:!0,visibility:!1}),c=y.useRef(null),p=Math.max(240,r-a.y-16);y.useEffect(()=>{const i=j=>{c.current&&d({x:Math.max(8,j.clientX-c.current.x),y:Math.max(8,j.clientY-c.current.y)})},u=()=>{c.current=null,document.body.classList.remove("select-none")};return window.addEventListener("pointermove",i),window.addEventListener("pointerup",u),()=>{window.removeEventListener("pointermove",i),window.removeEventListener("pointerup",u)}},[]),y.useEffect(()=>{const i=()=>o(window.innerHeight);return window.addEventListener("resize",i),()=>window.removeEventListener("resize",i)},[]);const f=i=>{const u=i.currentTarget.getBoundingClientRect();c.current={x:i.clientX-u.left,y:i.clientY-u.top},document.body.classList.add("select-none"),i.currentTarget.setPointerCapture(i.pointerId)},g=(i,u,j,w)=>e.jsxs("div",{style:hi,children:[e.jsxs("div",{style:xi,children:[e.jsx("button",{type:"button",onClick:()=>x(v=>({...v,[i]:!v[i]})),style:gi,children:e.jsx("div",{style:yi(h[i])})}),e.jsxs("div",{style:ui,children:[e.jsx("span",{style:{display:"flex",width:18,height:18,alignItems:"center",justifyContent:"center",borderRadius:6,background:"rgba(255,255,255,0.08)",border:"1px solid rgba(255,255,255,0.08)",color:"#e2e8f0",flex:"0 0 auto"},children:j}),e.jsx("span",{children:u})]})]}),h[i]?e.jsx("div",{style:bi,children:w}):null]},i);return typeof document>"u"?null:Ae.createPortal(e.jsxs("div",{style:{...ai,left:a.x,top:a.y},children:[e.jsx("style",{children:`
17
7
  .xr-hand-tracking-2d-controller-scroll::-webkit-scrollbar { width: 10px; }
18
8
  .xr-hand-tracking-2d-controller-scroll::-webkit-scrollbar-track { background: rgba(255,255,255,0.06); border-radius: 999px; }
19
9
  .xr-hand-tracking-2d-controller-scroll::-webkit-scrollbar-thumb { background: rgba(148,163,184,0.55); border-radius: 999px; border: 2px solid transparent; background-clip: padding-box; }
20
- `}),p?e.jsxs("div",{className:"xr-hand-tracking-2d-controller-scroll",style:{...It,height:v},children:[e.jsxs("div",{style:zn,children:[e.jsx("div",{onPointerDown:d,style:{width:16,height:16,display:"flex",alignItems:"center",justifyContent:"center",cursor:"grab",color:"rgba(148,163,184,0.82)",flex:"0 0 auto"},children:e.jsx(Bn,{})}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,fontSize:11,fontWeight:600,minWidth:0},children:[e.jsx("span",{style:{display:"flex",width:18,height:18,alignItems:"center",justifyContent:"center",borderRadius:6,background:"rgba(255,255,255,0.08)",border:"1px solid rgba(255,255,255,0.08)",color:"#e2e8f0",flex:"0 0 auto"},children:e.jsx(Pe,{})}),e.jsx("span",{children:"HandTracking2DController"})]}),e.jsx("div",{style:{flex:"1 1 auto"}}),e.jsx("button",{type:"button",onClick:()=>i(Vt),style:yt,children:e.jsx($n,{})}),e.jsx("button",{type:"button",onClick:()=>w(!1),style:yt,children:e.jsx(Kn,{})})]}),e.jsxs("div",{style:Rn,children:[h("controller","Controller",e.jsx(Pe,{}),e.jsxs("div",{style:Mn,children:[e.jsx("label",{style:oe,children:e.jsxs("div",{style:re,children:[e.jsx("span",{style:H,children:"Enabled"}),e.jsx("input",{type:"checkbox",style:ae,checked:t.enabled,onChange:s=>i({...t,enabled:s.target.checked})})]})}),e.jsx("label",{style:oe,children:e.jsxs("div",{style:re,children:[e.jsx("span",{style:H,children:"Attach Image"}),e.jsx("input",{type:"checkbox",style:ae,checked:t.attachImageEnabled,onChange:s=>i({...t,attachImageEnabled:s.target.checked})})]})}),e.jsx("label",{style:oe,children:e.jsxs("div",{style:re,children:[e.jsx("span",{style:H,children:"Size Responsive to Hand Bounding Box"}),e.jsx("input",{type:"checkbox",style:ae,checked:t.sizeResponsiveToHandBoundingBox,onChange:s=>i({...t,sizeResponsiveToHandBoundingBox:s.target.checked})})]})}),e.jsxs("label",{style:q,children:[e.jsx("span",{style:H,children:"Size"}),e.jsx("input",{style:ne,type:"number",min:.1,max:3,step:.01,value:t.size,onChange:s=>i({...t,size:Number(s.target.value)})})]}),e.jsxs("label",{style:q,children:[e.jsx("span",{style:H,children:"Vertical Align"}),e.jsx("select",{style:ne,value:t.verticalAlign,onChange:s=>i({...t,verticalAlign:s.target.value}),children:At.map(s=>e.jsx("option",{value:s.value,children:s.label},s.value))})]}),e.jsxs("label",{style:q,children:[e.jsx("span",{style:H,children:"Horizontal Align"}),e.jsx("select",{style:ne,value:t.horizontalAlign,onChange:s=>i({...t,horizontalAlign:s.target.value}),children:Nt.map(s=>e.jsx("option",{value:s.value,children:s.label},s.value))})]}),e.jsxs("label",{style:q,children:[e.jsx("span",{style:H,children:"Offset X"}),e.jsx("input",{style:ne,type:"number",min:-1,max:1,step:.01,value:t.offsetX,onChange:s=>i({...t,offsetX:Number(s.target.value)})})]}),e.jsxs("label",{style:q,children:[e.jsx("span",{style:H,children:"Offset Y"}),e.jsx("input",{style:ne,type:"number",min:-1,max:1,step:.01,value:t.offsetY,onChange:s=>i({...t,offsetY:Number(s.target.value)})})]}),e.jsxs("label",{style:q,children:[e.jsx("span",{style:H,children:"Rotation"}),e.jsx("input",{style:ne,type:"number",min:-180,max:180,step:.1,value:t.rotation,onChange:s=>i({...t,rotation:Number(s.target.value)})})]}),e.jsxs("label",{style:q,children:[e.jsx("span",{style:H,children:"Alpha"}),e.jsx("input",{style:ne,type:"number",min:0,max:1,step:.01,value:t.alpha,onChange:s=>i({...t,alpha:Number(s.target.value)})})]}),e.jsx("label",{style:oe,children:e.jsxs("div",{style:re,children:[e.jsx("span",{style:H,children:"Smooth Following"}),e.jsx("input",{type:"checkbox",style:ae,checked:t.smoothFollowing,onChange:s=>i({...t,smoothFollowing:s.target.checked})})]})}),e.jsxs("label",{style:q,children:[e.jsx("span",{style:H,children:"Smoothing"}),e.jsx("input",{style:ne,type:"number",min:0,max:1,step:.01,value:t.smoothing,onChange:s=>i({...t,smoothing:Number(s.target.value)})})]})]})),h("visibility","Visibility",e.jsx(Pe,{}),e.jsxs(e.Fragment,{children:[e.jsx("label",{style:oe,children:e.jsxs("div",{style:re,children:[e.jsx("span",{style:H,children:"Show Overlay"}),e.jsx("input",{type:"checkbox",style:ae,checked:t.enabled,onChange:s=>i({...t,enabled:s.target.checked})})]})}),e.jsx("label",{style:oe,children:e.jsxs("div",{style:re,children:[e.jsx("span",{style:H,children:"Show Attach Image"}),e.jsx("input",{type:"checkbox",style:ae,checked:t.attachImageEnabled,onChange:s=>i({...t,attachImageEnabled:s.target.checked})})]})}),e.jsx("label",{style:oe,children:e.jsxs("div",{style:re,children:[e.jsx("span",{style:H,children:"Show Bounding Box"}),e.jsx("input",{type:"checkbox",style:ae,checked:t.showBoundingBox,onChange:s=>i({...t,showBoundingBox:s.target.checked})})]})})]}))]})]}):e.jsx("div",{role:"button",tabIndex:0,onClick:()=>w(!0),style:Cn,children:e.jsx(Hn,{})})]}),document.body)},An={position:"fixed",left:320,top:104,zIndex:2e4,pointerEvents:"none"},Et={pointerEvents:"auto",width:286,borderRadius:16,border:"1px solid rgba(255,255,255,0.12)",background:"rgba(8, 15, 28, 0.58)",boxShadow:"0 16px 36px rgba(0,0,0,0.28)",backdropFilter:"blur(20px) saturate(1.1)",WebkitBackdropFilter:"blur(20px) saturate(1.1)",color:"#f8fafc",overflowX:"hidden",overflowY:"auto",scrollbarWidth:"thin",scrollbarColor:"rgba(148,163,184,0.55) rgba(255,255,255,0.06)",overscrollBehavior:"contain"},Nn={...Et,width:32,height:32,borderRadius:16,display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer"},Dn={position:"sticky",top:0,zIndex:1,display:"flex",alignItems:"center",gap:7,padding:"7px 8px",borderBottom:"1px solid rgba(255,255,255,0.08)",background:"rgba(8, 15, 28, 0.88)",backdropFilter:"blur(20px) saturate(1.1)",WebkitBackdropFilter:"blur(20px) saturate(1.1)"},On={display:"grid",gap:6,padding:7},Pn={borderRadius:12,border:"1px solid rgba(255,255,255,0.08)",background:"rgba(255,255,255,0.03)",overflow:"hidden"},Zn={display:"flex",alignItems:"center",gap:7,padding:"6px 7px"},_n={display:"flex",alignItems:"center",gap:6,fontSize:11,fontWeight:500,flex:"1 1 auto",minWidth:0},Xn={width:28,height:16,borderRadius:999,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(255,255,255,0.08)",padding:2,display:"flex",alignItems:"center",cursor:"pointer",flex:"0 0 auto"},Gn=t=>({width:10,height:10,borderRadius:999,background:t?"#f8fafc":"rgba(148,163,184,0.7)",transform:t?"translateX(12px)":"translateX(0)",transition:"transform 140ms ease, background 140ms ease"}),Yn={display:"grid",gap:7,padding:"0 7px 7px"},xt={display:"grid",gridTemplateColumns:"repeat(2, minmax(0, 1fr))",gap:6},le={display:"flex",flexDirection:"column",gap:4},de={...le,gridColumn:"1 / -1"},$={fontSize:9,color:"rgba(226,232,240,0.72)"},ce={width:"100%",height:24,borderRadius:7,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(15,23,42,0.68)",color:"#f8fafc",fontSize:10.5,outline:"none",padding:"0 7px",boxSizing:"border-box"},he={display:"flex",alignItems:"center",justifyContent:"space-between",gap:12,minHeight:24},pe={width:16,height:16},gt={display:"inline-flex",alignItems:"center",justifyContent:"center",width:24,height:24,borderRadius:8,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(255,255,255,0.05)",color:"#e2e8f0",cursor:"pointer",padding:0,flex:"0 0 auto"},Un=()=>e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M7 10h10v2H7v-2zm0 4h10v2H7v-2zm0-8h10v2H7V6z"})}),Jn=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M18.3 5.71 12 12l6.3 6.29-1.41 1.41L10.59 13.41 4.29 19.7 2.88 18.29 9.17 12 2.88 5.71 4.29 4.3l6.3 6.29 6.29-6.3z"})}),qn=()=>e.jsx("svg",{width:"11",height:"15",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M8 6a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM8 12a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM8 18a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM16 6a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM16 12a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM16 18a2 2 0 1 1-4 0 2 2 0 0 1 4 0z"})}),Ze=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M8 5a3 3 0 1 1-3-3 3 3 0 0 1 3 3zm11 11a3 3 0 1 0 3 3 3 3 0 0 0-3-3zM7.1 7.1l9.8 9.8 1.4-1.4-9.8-9.8-1.4 1.4zM19 2a3 3 0 1 0 3 3 3 3 0 0 0-3-3zM7.1 16.9l9.8-9.8-1.4-1.4-9.8 9.8 1.4 1.4zM5 16a3 3 0 1 0 3 3 3 3 0 0 0-3-3z"})}),Qn=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M12 5V2L7 7l5 5V9a4 4 0 1 1-4 4H6a6 6 0 1 0 6-8z"})}),el=({value:t,onChange:i})=>{const[p,w]=c.useState(!0),[j,S]=c.useState({x:320,y:104}),[R,k]=c.useState(typeof window>"u"?0:window.innerHeight),[u,r]=c.useState({joints:!0,visibility:!0}),o=c.useRef(null),v=Math.max(240,R-j.y-16);c.useEffect(()=>{const s=a=>{o.current&&S({x:Math.max(8,a.clientX-o.current.x),y:Math.max(8,a.clientY-o.current.y)})},y=()=>{o.current=null,document.body.classList.remove("select-none")};return window.addEventListener("pointermove",s),window.addEventListener("pointerup",y),()=>{window.removeEventListener("pointermove",s),window.removeEventListener("pointerup",y)}},[]),c.useEffect(()=>{const s=()=>k(window.innerHeight);return window.addEventListener("resize",s),()=>window.removeEventListener("resize",s)},[]);const d=s=>{const y=s.currentTarget.getBoundingClientRect();o.current={x:s.clientX-y.left,y:s.clientY-y.top},document.body.classList.add("select-none"),s.currentTarget.setPointerCapture(s.pointerId)},h=(s,y,a,b)=>e.jsxs("div",{style:Pn,children:[e.jsxs("div",{style:Zn,children:[e.jsx("button",{type:"button",onClick:()=>r(I=>({...I,[s]:!I[s]})),style:Xn,children:e.jsx("div",{style:Gn(u[s])})}),e.jsxs("div",{style:_n,children:[e.jsx("span",{style:{display:"flex",width:18,height:18,alignItems:"center",justifyContent:"center",borderRadius:6,background:"rgba(255,255,255,0.08)",border:"1px solid rgba(255,255,255,0.08)",color:"#e2e8f0",flex:"0 0 auto"},children:a}),e.jsx("span",{children:y})]})]}),u[s]?e.jsx("div",{style:Yn,children:b}):null]},s);return typeof document>"u"?null:ie.createPortal(e.jsx("div",{style:{...An,left:j.x,top:j.y},children:p?e.jsxs("div",{style:{...Et,height:v},children:[e.jsxs("div",{style:Dn,children:[e.jsx("div",{onPointerDown:d,style:{width:16,height:16,display:"flex",alignItems:"center",justifyContent:"center",cursor:"grab",color:"rgba(148,163,184,0.82)",flex:"0 0 auto"},children:e.jsx(qn,{})}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,fontSize:11,fontWeight:600,minWidth:0},children:[e.jsx("span",{style:{display:"flex",width:18,height:18,alignItems:"center",justifyContent:"center",borderRadius:6,background:"rgba(255,255,255,0.08)",border:"1px solid rgba(255,255,255,0.08)",color:"#e2e8f0",flex:"0 0 auto"},children:e.jsx(Ze,{})}),e.jsx("span",{children:"HandJoints2D"})]}),e.jsx("div",{style:{flex:"1 1 auto"}}),e.jsx("button",{type:"button",onClick:()=>i(Ot),style:gt,children:e.jsx(Qn,{})}),e.jsx("button",{type:"button",onClick:()=>w(!1),style:gt,children:e.jsx(Jn,{})})]}),e.jsxs("div",{style:On,children:[h("joints","Joints",e.jsx(Ze,{}),e.jsxs("div",{style:xt,children:[e.jsxs("label",{style:le,children:[e.jsx("span",{style:$,children:"Visual Scale"}),e.jsx("input",{style:ce,type:"number",min:.25,max:2,step:.01,value:t.visualScale,onChange:s=>i({...t,visualScale:Number(s.target.value)})})]}),e.jsxs("label",{style:le,children:[e.jsx("span",{style:$,children:"Opacity"}),e.jsx("input",{style:ce,type:"number",min:0,max:1,step:.01,value:t.opacity,onChange:s=>i({...t,opacity:Number(s.target.value)})})]}),e.jsxs("label",{style:le,children:[e.jsx("span",{style:$,children:"Joint Radius"}),e.jsx("input",{style:ce,type:"number",min:.5,max:24,step:.5,value:t.jointRadius,onChange:s=>i({...t,jointRadius:Number(s.target.value)})})]}),e.jsxs("label",{style:le,children:[e.jsx("span",{style:$,children:"Line Width"}),e.jsx("input",{style:ce,type:"number",min:.01,max:100,step:.1,value:t.lineWidth,onChange:s=>i({...t,lineWidth:Number(s.target.value)})})]}),e.jsxs("label",{style:le,children:[e.jsx("span",{style:$,children:"Label Size"}),e.jsx("input",{style:ce,type:"number",min:.25,max:3,step:.05,value:t.labelScale,onChange:s=>i({...t,labelScale:Number(s.target.value)})})]}),e.jsxs("label",{style:le,children:[e.jsx("span",{style:$,children:"Smoothing"}),e.jsx("input",{style:ce,type:"number",min:0,max:1,step:.01,value:t.smoothing,onChange:s=>i({...t,smoothing:Number(s.target.value)})})]}),e.jsxs("label",{style:le,children:[e.jsx("span",{style:$,children:"Min Count Confidence"}),e.jsx("input",{style:ce,type:"number",min:0,max:1,step:.01,value:t.minCountConfidence,onChange:s=>i({...t,minCountConfidence:Number(s.target.value)})})]})]})),h("visibility","Visibility",e.jsx(Ze,{}),e.jsxs("div",{style:xt,children:[e.jsx("label",{style:de,children:e.jsxs("div",{style:he,children:[e.jsx("span",{style:$,children:"Show Joints"}),e.jsx("input",{type:"checkbox",style:pe,checked:t.enabled,onChange:s=>i({...t,enabled:s.target.checked})})]})}),e.jsx("label",{style:de,children:e.jsxs("div",{style:he,children:[e.jsx("span",{style:$,children:"Both Hands"}),e.jsx("input",{type:"checkbox",style:pe,checked:t.bothHands,onChange:s=>i({...t,bothHands:s.target.checked})})]})}),e.jsx("label",{style:de,children:e.jsxs("div",{style:he,children:[e.jsx("span",{style:$,children:"Count Fingers"}),e.jsx("input",{type:"checkbox",style:pe,checked:t.countEnabled,onChange:s=>i({...t,countEnabled:s.target.checked})})]})}),e.jsx("label",{style:de,children:e.jsxs("div",{style:he,children:[e.jsx("span",{style:$,children:"Joint Dots"}),e.jsx("input",{type:"checkbox",style:pe,checked:t.showJoints,onChange:s=>i({...t,showJoints:s.target.checked})})]})}),e.jsx("label",{style:de,children:e.jsxs("div",{style:he,children:[e.jsx("span",{style:$,children:"Bone Lines"}),e.jsx("input",{type:"checkbox",style:pe,checked:t.showBones,onChange:s=>i({...t,showBones:s.target.checked})})]})}),e.jsx("label",{style:de,children:e.jsxs("div",{style:he,children:[e.jsx("span",{style:$,children:"Bounding Box"}),e.jsx("input",{type:"checkbox",style:pe,checked:t.showBoundingBox,onChange:s=>i({...t,showBoundingBox:s.target.checked})})]})}),e.jsx("label",{style:de,children:e.jsxs("div",{style:he,children:[e.jsx("span",{style:$,children:"Labels"}),e.jsx("input",{type:"checkbox",style:pe,checked:t.showLabels,onChange:s=>i({...t,showLabels:s.target.checked})})]})})]}))]})]}):e.jsx("div",{role:"button",tabIndex:0,onClick:()=>w(!0),style:Nn,children:e.jsx(Un,{})})}),document.body)},tl={position:"fixed",left:320,top:104,zIndex:2e4,pointerEvents:"none"},Tt={pointerEvents:"auto",width:286,borderRadius:16,border:"1px solid rgba(255,255,255,0.12)",background:"rgba(8, 15, 28, 0.58)",boxShadow:"0 16px 36px rgba(0,0,0,0.28)",backdropFilter:"blur(20px) saturate(1.1)",WebkitBackdropFilter:"blur(20px) saturate(1.1)",color:"#f8fafc",overflowX:"hidden",overflowY:"auto",scrollbarWidth:"thin",scrollbarColor:"rgba(148,163,184,0.55) rgba(255,255,255,0.06)",overscrollBehavior:"contain"},sl={...Tt,width:32,height:32,borderRadius:16,display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer"},nl={position:"sticky",top:0,zIndex:1,display:"flex",alignItems:"center",gap:7,padding:"7px 8px",borderBottom:"1px solid rgba(255,255,255,0.08)",background:"rgba(8, 15, 28, 0.88)",backdropFilter:"blur(20px) saturate(1.1)",WebkitBackdropFilter:"blur(20px) saturate(1.1)"},ll={display:"grid",gap:6,padding:7},il={borderRadius:12,border:"1px solid rgba(255,255,255,0.08)",background:"rgba(255,255,255,0.03)",overflow:"hidden"},ol={display:"flex",alignItems:"center",gap:7,padding:"6px 7px"},rl={display:"flex",alignItems:"center",gap:6,fontSize:11,fontWeight:500,flex:"1 1 auto",minWidth:0},al={width:28,height:16,borderRadius:999,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(255,255,255,0.08)",padding:2,display:"flex",alignItems:"center",cursor:"pointer",flex:"0 0 auto"},dl=t=>({width:10,height:10,borderRadius:999,background:t?"#f8fafc":"rgba(148,163,184,0.7)",transform:t?"translateX(12px)":"translateX(0)",transition:"transform 140ms ease, background 140ms ease"}),cl={display:"grid",gap:7,padding:"0 7px 7px"},_e={display:"grid",gridTemplateColumns:"repeat(2, minmax(0, 1fr))",gap:6},A={display:"flex",flexDirection:"column",gap:4},we={...A,gridColumn:"1 / -1"},L={fontSize:9,color:"rgba(226,232,240,0.72)"},V={width:"100%",height:24,borderRadius:7,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(15,23,42,0.68)",color:"#f8fafc",fontSize:10.5,outline:"none",padding:"0 7px",boxSizing:"border-box"},We={display:"flex",alignItems:"center",justifyContent:"space-between",gap:12,minHeight:24},Ie={width:16,height:16},bt={display:"inline-flex",alignItems:"center",justifyContent:"center",width:24,height:24,borderRadius:8,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(255,255,255,0.05)",color:"#e2e8f0",cursor:"pointer",padding:0,flex:"0 0 auto"},hl=()=>e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M7 10h10v2H7v-2zm0 4h10v2H7v-2zm0-8h10v2H7V6z"})}),pl=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M18.3 5.71 12 12l6.3 6.29-1.41 1.41L10.59 13.41 4.29 19.7 2.88 18.29 9.17 12 2.88 5.71 4.29 4.3l6.3 6.29 6.29-6.3z"})}),yl=()=>e.jsx("svg",{width:"11",height:"15",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M8 6a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM8 12a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM8 18a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM16 6a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM16 12a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM16 18a2 2 0 1 1-4 0 2 2 0 0 1 4 0z"})}),He=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M11 2a1 1 0 0 1 1 1v6h1V3a1 1 0 1 1 2 0v6h1V4a1 1 0 1 1 2 0v7.3l1.6 2.4a5 5 0 0 1 .8 2.7V18a4 4 0 0 1-4 4H9a6 6 0 0 1-6-6v-3.5a2.5 2.5 0 0 1 5 0V15h1V3a1 1 0 0 1 1-1z"})}),xl=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M12 5V2L7 7l5 5V9a4 4 0 1 1-4 4H6a6 6 0 1 0 6-8z"})}),gl=({value:t,onChange:i})=>{const[p,w]=c.useState(!0),[j,S]=c.useState({x:320,y:104}),[R,k]=c.useState(typeof window>"u"?0:window.innerHeight),[u,r]=c.useState({visual:!0,calibration:!0,visibility:!0}),o=c.useRef(null),v=Math.max(240,R-j.y-16);c.useEffect(()=>{const s=a=>{o.current&&S({x:Math.max(8,a.clientX-o.current.x),y:Math.max(8,a.clientY-o.current.y)})},y=()=>{o.current=null,document.body.classList.remove("select-none")};return window.addEventListener("pointermove",s),window.addEventListener("pointerup",y),()=>{window.removeEventListener("pointermove",s),window.removeEventListener("pointerup",y)}},[]),c.useEffect(()=>{const s=()=>k(window.innerHeight);return window.addEventListener("resize",s),()=>window.removeEventListener("resize",s)},[]);const d=s=>{const y=s.currentTarget.getBoundingClientRect();o.current={x:s.clientX-y.left,y:s.clientY-y.top},document.body.classList.add("select-none"),s.currentTarget.setPointerCapture(s.pointerId)},h=(s,y,a,b)=>e.jsxs("div",{style:il,children:[e.jsxs("div",{style:ol,children:[e.jsx("button",{type:"button",onClick:()=>r(I=>({...I,[s]:!I[s]})),style:al,children:e.jsx("div",{style:dl(u[s])})}),e.jsxs("div",{style:rl,children:[e.jsx("span",{style:{display:"flex",width:18,height:18,alignItems:"center",justifyContent:"center",borderRadius:6,background:"rgba(255,255,255,0.08)",border:"1px solid rgba(255,255,255,0.08)",color:"#e2e8f0",flex:"0 0 auto"},children:a}),e.jsx("span",{children:y})]})]}),u[s]?e.jsx("div",{style:cl,children:b}):null]},s);return typeof document>"u"?null:ie.createPortal(e.jsx("div",{style:{...tl,left:j.x,top:j.y},children:p?e.jsxs("div",{style:{...Tt,height:v},children:[e.jsxs("div",{style:nl,children:[e.jsx("div",{onPointerDown:d,style:{width:16,height:16,display:"flex",alignItems:"center",justifyContent:"center",cursor:"grab",color:"rgba(148,163,184,0.82)",flex:"0 0 auto"},children:e.jsx(yl,{})}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,fontSize:11,fontWeight:600,minWidth:0},children:[e.jsx("span",{style:{display:"flex",width:18,height:18,alignItems:"center",justifyContent:"center",borderRadius:6,background:"rgba(255,255,255,0.08)",border:"1px solid rgba(255,255,255,0.08)",color:"#e2e8f0",flex:"0 0 auto"},children:e.jsx(He,{})}),e.jsx("span",{children:"HandTracking3D"})]}),e.jsx("div",{style:{flex:"1 1 auto"}}),e.jsx("button",{type:"button",onClick:()=>i($t),style:bt,children:e.jsx(xl,{})}),e.jsx("button",{type:"button",onClick:()=>w(!1),style:bt,children:e.jsx(pl,{})})]}),e.jsxs("div",{style:ll,children:[h("visual","Visual",e.jsx(He,{}),e.jsxs("div",{style:_e,children:[e.jsxs("label",{style:we,children:[e.jsx("span",{style:L,children:"Space"}),e.jsxs("select",{style:V,value:t.space,onChange:s=>i({...t,space:s.target.value}),children:[e.jsx("option",{value:"scene",children:"Scene"}),e.jsx("option",{value:"screen",children:"Screen Fit"})]})]}),e.jsxs("label",{style:A,children:[e.jsx("span",{style:L,children:"Joint Size"}),e.jsx("input",{style:V,type:"number",min:5e-4,max:.08,step:5e-4,value:t.jointRadius,onChange:s=>i({...t,jointRadius:Number(s.target.value)})})]}),e.jsxs("label",{style:A,children:[e.jsx("span",{style:L,children:"Bone Radius"}),e.jsx("input",{style:V,type:"number",min:.001,max:.12,step:.001,value:t.boneRadius,onChange:s=>i({...t,boneRadius:Number(s.target.value)})})]}),e.jsxs("label",{style:A,children:[e.jsx("span",{style:L,children:"Opacity"}),e.jsx("input",{style:V,type:"number",min:0,max:1,step:.01,value:t.opacity,onChange:s=>i({...t,opacity:Number(s.target.value)})})]}),e.jsxs("label",{style:A,children:[e.jsx("span",{style:L,children:"Smoothing"}),e.jsx("input",{style:V,type:"number",min:0,max:1,step:.01,value:t.smoothing,onChange:s=>i({...t,smoothing:Number(s.target.value)})})]})]})),h("calibration","Calibration",e.jsx(He,{}),e.jsxs("div",{style:_e,children:[e.jsxs("label",{style:A,children:[e.jsx("span",{style:L,children:"Hand Distance Ref (m)"}),e.jsx("input",{style:V,type:"number",min:.05,max:5,step:.01,value:t.trackingDistanceM,onChange:s=>i({...t,trackingDistanceM:Number(s.target.value)})})]}),e.jsxs("label",{style:A,children:[e.jsx("span",{style:L,children:"Projection Distance"}),e.jsx("input",{style:V,type:"number",min:.05,max:10,step:.01,value:t.projectionDistanceM,onChange:s=>i({...t,projectionDistanceM:Number(s.target.value)})})]}),e.jsxs("label",{style:A,children:[e.jsx("span",{style:L,children:"Hand Scale"}),e.jsx("input",{style:V,type:"number",min:.1,max:8,step:.01,value:t.handScale,onChange:s=>i({...t,handScale:Number(s.target.value)})})]}),e.jsxs("label",{style:A,children:[e.jsx("span",{style:L,children:"Fit X"}),e.jsx("input",{style:V,type:"number",min:.1,max:4,step:.01,value:t.fitX,onChange:s=>i({...t,fitX:Number(s.target.value)})})]}),e.jsxs("label",{style:A,children:[e.jsx("span",{style:L,children:"Fit Y"}),e.jsx("input",{style:V,type:"number",min:.1,max:4,step:.01,value:t.fitY,onChange:s=>i({...t,fitY:Number(s.target.value)})})]}),e.jsxs("label",{style:A,children:[e.jsx("span",{style:L,children:"Offset X"}),e.jsx("input",{style:V,type:"number",min:-5,max:5,step:.01,value:t.offsetX,onChange:s=>i({...t,offsetX:Number(s.target.value)})})]}),e.jsxs("label",{style:A,children:[e.jsx("span",{style:L,children:"Offset Y"}),e.jsx("input",{style:V,type:"number",min:-5,max:5,step:.01,value:t.offsetY,onChange:s=>i({...t,offsetY:Number(s.target.value)})})]}),e.jsxs("label",{style:A,children:[e.jsx("span",{style:L,children:"Offset Z"}),e.jsx("input",{style:V,type:"number",min:-5,max:5,step:.01,value:t.offsetZ,onChange:s=>i({...t,offsetZ:Number(s.target.value)})})]}),e.jsxs("label",{style:A,children:[e.jsx("span",{style:L,children:"Depth Scale"}),e.jsx("input",{style:V,type:"number",min:0,max:10,step:.1,value:t.depthScale,onChange:s=>i({...t,depthScale:Number(s.target.value)})})]})]})),h("visibility","Visibility",e.jsx(He,{}),e.jsxs("div",{style:_e,children:[e.jsx("label",{style:we,children:e.jsxs("div",{style:We,children:[e.jsx("span",{style:L,children:"Show 3D Hand"}),e.jsx("input",{type:"checkbox",style:Ie,checked:t.enabled,onChange:s=>i({...t,enabled:s.target.checked})})]})}),e.jsx("label",{style:we,children:e.jsxs("div",{style:We,children:[e.jsx("span",{style:L,children:"Both Hands"}),e.jsx("input",{type:"checkbox",style:Ie,checked:t.bothHands,onChange:s=>i({...t,bothHands:s.target.checked})})]})}),e.jsx("label",{style:we,children:e.jsxs("div",{style:We,children:[e.jsx("span",{style:L,children:"Joint Spheres"}),e.jsx("input",{type:"checkbox",style:Ie,checked:t.showJoints,onChange:s=>i({...t,showJoints:s.target.checked})})]})}),e.jsx("label",{style:we,children:e.jsxs("div",{style:We,children:[e.jsx("span",{style:L,children:"Bone Cylinders"}),e.jsx("input",{type:"checkbox",style:Ie,checked:t.showBones,onChange:s=>i({...t,showBones:s.target.checked})})]})}),e.jsx("label",{style:we,children:e.jsxs("div",{style:We,children:[e.jsx("span",{style:L,children:"Labels"}),e.jsx("input",{type:"checkbox",style:Ie,checked:t.showLabels,onChange:s=>i({...t,showLabels:s.target.checked})})]})})]}))]})]}):e.jsx("div",{role:"button",tabIndex:0,onClick:()=>w(!0),style:sl,children:e.jsx(hl,{})})}),document.body)},bl=1e3;function ul(t,i=bl){return t.map((p,w)=>({...p,renderOrder:i+(t.length-w)}))}function fl(t,i,p){const w=t.findIndex(k=>k.id===i),j=t.findIndex(k=>k.id===p);if(w<0||j<0||w===j)return t;const S=[...t],[R]=S.splice(w,1);return S.splice(j,0,R),ul(S)}const jl={position:"fixed",left:14,top:104,zIndex:2e4,pointerEvents:"none"},ut={pointerEvents:"auto",width:284,borderRadius:16,border:"1px solid rgba(255,255,255,0.12)",background:"rgba(8, 15, 28, 0.58)",boxShadow:"0 16px 36px rgba(0,0,0,0.28)",backdropFilter:"blur(20px) saturate(1.1)",WebkitBackdropFilter:"blur(20px) saturate(1.1)",color:"#f8fafc",overflowX:"hidden",overflowY:"auto",scrollbarWidth:"thin",scrollbarColor:"rgba(148,163,184,0.55) rgba(255,255,255,0.06)",overscrollBehavior:"contain"},Ye={display:"inline-flex",alignItems:"center",justifyContent:"center",width:22,height:22,borderRadius:8,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(255,255,255,0.05)",color:"#e2e8f0",cursor:"pointer",padding:0,flex:"0 0 auto"},ml={position:"sticky",top:0,zIndex:1,display:"flex",alignItems:"center",gap:8,padding:"8px 8px",borderBottom:"1px solid rgba(255,255,255,0.08)",background:"rgba(8, 15, 28, 0.88)",backdropFilter:"blur(20px) saturate(1.1)",WebkitBackdropFilter:"blur(20px) saturate(1.1)"},wl={width:16,height:16,display:"flex",alignItems:"center",justifyContent:"center",cursor:"grab",color:"rgba(148,163,184,0.82)",flex:"0 0 auto"},Sl={display:"flex",alignItems:"center",gap:6,fontSize:11,fontWeight:600,minWidth:0},kl={display:"flex",width:18,height:18,alignItems:"center",justifyContent:"center",borderRadius:6,background:"rgba(255,255,255,0.08)",border:"1px solid rgba(255,255,255,0.08)",color:"#e2e8f0",flex:"0 0 auto"},vl={display:"grid",gap:6,padding:7},Cl=t=>({display:"grid",gridTemplateColumns:"20px 20px 20px minmax(0, 1fr)",alignItems:"center",gap:6,minHeight:34,padding:"6px 7px",borderRadius:10,border:t?"1px solid rgba(56,189,248,0.5)":"1px solid rgba(255,255,255,0.08)",background:t?"rgba(56,189,248,0.10)":"rgba(255,255,255,0.03)",cursor:"pointer",opacity:1}),zl={display:"flex",flexDirection:"column",gap:2,minWidth:0},Rl={fontSize:10,fontWeight:600,lineHeight:1.15,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},Wl={fontSize:9,color:"rgba(226,232,240,0.6)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},Xe={...Ye,width:20,height:20,borderRadius:7,fontSize:11,lineHeight:1},Il=({off:t=!1})=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:t?e.jsx("path",{d:"M2 2l20 20-1.4 1.4-3.2-3.2C15.9 21 14.1 21.5 12 21.5 6.5 21.5 2 16 1 12c.4-1.8 1.1-3.4 2.2-4.8L.6 4.6 2 2zm10 4c3.9 0 7.4 2.8 9.2 6-1 1.8-2.6 3.5-4.4 4.6l-2-2c.1-.3.2-.7.2-1.1a3 3 0 0 0-3-3c-.4 0-.8.1-1.1.2l-1.9-1.9C10.2 6.8 11.1 6 12 6z"}):e.jsx("path",{d:"M12 5c5.5 0 10 5 11 7-.9 2-5.5 7-11 7S2 14 1 12c1-2 5.5-7 11-7zm0 3.2A3.8 3.8 0 1 0 12 16.8 3.8 3.8 0 0 0 12 8.2z"})}),El=({off:t=!1})=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:t?e.jsx("path",{d:"M18 8h-1V6a5 5 0 0 0-9.1-2.9l1.5 1.5A3 3 0 0 1 16 6v2H8a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h9.2l1.8 1.8 1.4-1.4L2.6 3.4 1.2 4.8 5 8.6V20h14a2 2 0 0 0 2-2v-8a2 2 0 0 0-2-2z"}):e.jsx("path",{d:"M7 10V8a5 5 0 0 1 10 0v2h1a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h1zm2 0h6V8a3 3 0 0 0-6 0v2z"})}),Tl=()=>e.jsx("svg",{width:"11",height:"15",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M11 2h2v4h3l-4 4-4-4h3V2zm0 20v-4H8l4-4 4 4h-3v4h-2zM2 11h4V8l4 4-4 4v-3H2v-2zm20 0v2h-4v3l-4-4 4-4v3h4z"})}),ft=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M12 3 1 9l11 6 11-6-11-6zm0 8L1 5v4l11 6 11-6V5l-11 6zm0 6L1 11v4l11 6 11-6v-4l-11 6z"})}),Ll=({layers:t,selectedLayerId:i,onSelectLayer:p,onToggleVisible:w,onToggleEnabled:j,onReorder:S,onToggleLocked:R,initialPosition:k})=>{const[u,r]=c.useState(!0),[o,v]=c.useState(k??{x:644,y:104}),[d,h]=c.useState(typeof window>"u"?0:window.innerHeight),s=c.useRef(null),[y,a]=c.useState(null),b=Math.max(240,d-o.y-16);if(c.useEffect(()=>{const C=K=>{s.current&&v({x:Math.max(8,K.clientX-s.current.x),y:Math.max(8,K.clientY-s.current.y)})},D=()=>{s.current=null,document.body.classList.remove("select-none")};return window.addEventListener("pointermove",C),window.addEventListener("pointerup",D),()=>{window.removeEventListener("pointermove",C),window.removeEventListener("pointerup",D)}},[]),c.useEffect(()=>{const C=()=>h(window.innerHeight);return window.addEventListener("resize",C),()=>window.removeEventListener("resize",C)},[]),typeof document>"u")return null;const I=C=>{const D=C.currentTarget.getBoundingClientRect();s.current={x:C.clientX-D.left,y:C.clientY-D.top},document.body.classList.add("select-none"),C.currentTarget.setPointerCapture(C.pointerId)},N=C=>{if(!y||y===C){a(null);return}const D=t.findIndex(Y=>Y.id===y),K=t.findIndex(Y=>Y.id===C);if(D<0||K<0){a(null);return}S(fl(t,y,C)),a(null)};return ie.createPortal(e.jsx("div",{style:{...jl,left:o.x,top:o.y},children:u?e.jsxs("div",{style:{...ut,height:b},children:[e.jsxs("div",{style:ml,children:[e.jsx("div",{onPointerDown:I,style:wl,children:e.jsx(Tl,{})}),e.jsxs("div",{style:Sl,children:[e.jsx("span",{style:kl,children:e.jsx(ft,{})}),e.jsx("span",{children:"Layers"})]}),e.jsx("div",{style:{flex:"1 1 auto"}}),e.jsx("button",{type:"button",onClick:()=>r(!1),style:Ye,children:"−"})]}),e.jsx("div",{style:vl,children:t.map((C,D)=>e.jsxs("div",{style:Cl(i===C.id),draggable:!0,onDragStart:()=>a(C.id),onDragOver:K=>K.preventDefault(),onDrop:()=>N(C.id),onClick:()=>p(C.id),title:C.label,children:[e.jsx("button",{type:"button",style:Xe,onClick:K=>{K.stopPropagation(),w(C.id,!C.visible)},children:e.jsx(Il,{off:!C.visible})}),e.jsx("button",{type:"button",style:Xe,onClick:K=>{K.stopPropagation(),j(C.id,!C.enabled)},children:C.enabled?"●":"○"}),e.jsx("button",{type:"button",style:Xe,onClick:K=>{K.stopPropagation(),R==null||R(C.id,!C.locked)},children:e.jsx(El,{off:!C.locked})}),e.jsxs("div",{style:zl,children:[e.jsx("div",{style:Rl,children:C.label}),e.jsxs("div",{style:Wl,children:[C.domain," / ",C.type," • #",t.length-D]})]})]},C.id))})]}):e.jsx("div",{role:"button",tabIndex:0,onClick:()=>r(!0),style:{...ut,...Ye,width:32,height:32,display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx(ft,{})})}),document.body)},Fl={position:"fixed",zIndex:2e4,pointerEvents:"none"},Ml={pointerEvents:"auto",width:284,maxHeight:"min(620px, calc(100vh - 32px))",borderRadius:16,border:"1px solid rgba(255,255,255,0.12)",background:"rgba(8, 15, 28, 0.62)",boxShadow:"0 16px 36px rgba(0,0,0,0.28)",backdropFilter:"blur(20px) saturate(1.1)",WebkitBackdropFilter:"blur(20px) saturate(1.1)",color:"#f8fafc",overflow:"hidden",fontFamily:"Inter, ui-sans-serif, system-ui, sans-serif"},Hl={display:"flex",alignItems:"center",justifyContent:"space-between",gap:8,padding:"8px 8px",borderBottom:"1px solid rgba(255,255,255,0.08)",background:"rgba(8, 15, 28, 0.88)"},Kl={display:"flex",alignItems:"center",gap:6,minWidth:0,fontSize:11,fontWeight:700},Bl={width:16,height:16,display:"flex",alignItems:"center",justifyContent:"center",cursor:"grab",color:"rgba(148,163,184,0.82)",flex:"0 0 auto"},$l={display:"grid",gap:8,padding:10,maxHeight:"min(548px, calc(100vh - 104px))",overflowY:"auto",scrollbarWidth:"thin",scrollbarColor:"rgba(148,163,184,0.55) rgba(255,255,255,0.06)",overscrollBehavior:"contain"},Ee={display:"grid",gap:4,fontSize:10,color:"rgba(226,232,240,0.78)"},Ke={width:"100%",minWidth:0,height:28,borderRadius:8,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(15,23,42,0.8)",color:"#f8fafc",padding:"0 8px",boxSizing:"border-box"},Vl={height:24,borderRadius:8,border:"1px solid rgba(56,189,248,0.25)",background:"rgba(56,189,248,0.16)",color:"#e0f2fe",cursor:"pointer",fontSize:10,fontWeight:700,padding:"0 8px"},Al={display:"grid",gridTemplateColumns:"1fr 74px",alignItems:"center",gap:8},Nl=()=>e.jsx("svg",{width:"11",height:"15",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M11 2h2v4h3l-4 4-4-4h3V2zm0 20v-4H8l4-4 4 4h-3v4h-2zM2 11h4V8l4 4-4 4v-3H2v-2zm20 0v2h-4v3l-4-4 4-4v3h4z"})}),Dl=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M19.4 13.5c.1-.5.1-1 .1-1.5s0-1-.1-1.5l2.1-1.6-2-3.5-2.5 1a8 8 0 0 0-2.6-1.5L14 2h-4l-.4 2.9A8 8 0 0 0 7 6.4l-2.5-1-2 3.5 2.1 1.6A10 10 0 0 0 4.5 12c0 .5 0 1 .1 1.5l-2.1 1.6 2 3.5 2.5-1a8 8 0 0 0 2.6 1.5L10 22h4l.4-2.9a8 8 0 0 0 2.6-1.5l2.5 1 2-3.5-2.1-1.6zM12 15.5A3.5 3.5 0 1 1 12 8a3.5 3.5 0 0 1 0 7.5z"})}),Ol=(t,i)=>{const p=t.find(w=>String(w.value)===i);return(p==null?void 0:p.value)??i};function Pl({title:t,value:i,fields:p,onChange:w,copyLabel:j,copyPayload:S,initialPosition:R}){const[k,u]=c.useState(R??{x:14,y:452}),r=c.useRef(null);c.useEffect(()=>{const h=y=>{r.current&&u({x:Math.max(8,y.clientX-r.current.x),y:Math.max(8,y.clientY-r.current.y)})},s=()=>{r.current=null,document.body.classList.remove("select-none")};return window.addEventListener("pointermove",h),window.addEventListener("pointerup",s),()=>{window.removeEventListener("pointermove",h),window.removeEventListener("pointerup",s)}},[]);const o=(h,s)=>{w({...i,[h]:s})},v=async()=>{var s;const h=(S==null?void 0:S(i))??{name:j??t,kind:"settings",settings:i};await((s=navigator.clipboard)==null?void 0:s.writeText(JSON.stringify(h,null,2)))},d=h=>{var y;const s=(y=h.currentTarget.parentElement)==null?void 0:y.parentElement;s&&(r.current={x:h.clientX-s.getBoundingClientRect().left,y:h.clientY-s.getBoundingClientRect().top},document.body.classList.add("select-none"))};return e.jsx("div",{style:{...Fl,left:k.x,top:k.y},children:e.jsxs("div",{style:Ml,children:[e.jsxs("div",{style:Hl,children:[e.jsxs("div",{style:Kl,children:[e.jsx("span",{style:Bl,onPointerDown:d,children:e.jsx(Nl,{})}),e.jsx(Dl,{}),e.jsx("span",{children:t})]}),e.jsx("button",{style:Vl,type:"button",onClick:v,children:"Copy"})]}),e.jsx("div",{style:$l,children:p.map(h=>{const s=i[h.key];if(h.type==="boolean")return e.jsxs("label",{style:Ee,children:[e.jsx("span",{children:h.label}),e.jsx("input",{type:"checkbox",checked:!!s,onChange:y=>o(h.key,y.target.checked)})]},h.key);if(h.type==="number"){const y=Number(s),a=h.min??0,b=h.max??1,I=h.step??.01;return e.jsxs("label",{style:Ee,children:[e.jsx("span",{children:h.label}),e.jsxs("div",{style:Al,children:[e.jsx("input",{type:"range",min:a,max:b,step:I,value:y,onChange:N=>o(h.key,Number(N.target.value))}),e.jsx("input",{style:Ke,type:"number",min:a,max:b,step:I,value:y,onChange:N=>o(h.key,Number(N.target.value))})]})]},h.key)}return h.type==="color"?e.jsxs("label",{style:Ee,children:[e.jsx("span",{children:h.label}),e.jsx("input",{style:{...Ke,padding:2},type:"color",value:String(s),onChange:y=>o(h.key,y.target.value)})]},h.key):h.type==="select"?e.jsxs("label",{style:Ee,children:[e.jsx("span",{children:h.label}),e.jsx("select",{style:Ke,value:String(s),onChange:y=>o(h.key,Ol(h.options,y.target.value)),children:h.options.map(y=>e.jsx("option",{value:String(y.value),children:y.label},`${h.key}-${String(y.value)}`))})]},h.key):e.jsxs("label",{style:Ee,children:[e.jsx("span",{children:h.label}),e.jsx("input",{style:Ke,type:"text",value:String(s),onChange:y=>o(h.key,y.target.value)})]},h.key)})})]})})}var Ue,Be=ie;if(process.env.NODE_ENV==="production")Ue=Be.createRoot,Be.hydrateRoot;else{var jt=Be.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;Ue=function(t,i){jt.usingClientEntryPoint=!0;try{return Be.createRoot(t,i)}finally{jt.usingClientEntryPoint=!1}}}const mt=[{title:"Head and Face",controls:[{key:"strength",label:"Overall Strength",min:0},{key:"faceWidth",label:"Face Width"},{key:"faceHeight",label:"Face Height"},{key:"faceRoundness",label:"Face Roundness"},{key:"midfaceHeight",label:"Midface Height"},{key:"foreheadHeight",label:"Forehead Height"},{key:"foreheadWidth",label:"Forehead Width"},{key:"cheekboneWidth",label:"Cheekbone Width"},{key:"cheekWidth",label:"Cheek Width"},{key:"cheekHollowness",label:"Cheek Hollowness"},{key:"midfaceDepth",label:"Midface Depth"},{key:"scalpHeight",label:"Scalp Height"},{key:"headCurve",label:"Head Curve"},{key:"faceTwist",label:"Face Twist"},{key:"faceSwirl",label:"Face Swirl"}]},{title:"Eyebrows",controls:[{key:"browDistance",label:"Brow Distance"},{key:"browHeight",label:"Brow Height"},{key:"browDepth",label:"Brow Depth"}]},{title:"Eyes",controls:[{key:"leftEyeSize",label:"Left Eye Size"},{key:"rightEyeSize",label:"Right Eye Size"},{key:"eyeDistance",label:"Eye Distance"},{key:"leftEyeX",label:"Left Eye X Offset"},{key:"rightEyeX",label:"Right Eye X Offset"},{key:"leftEyeY",label:"Left Eye Y Offset"},{key:"rightEyeY",label:"Right Eye Y Offset"}]},{title:"Nose, Mouth and Jaw",controls:[{key:"noseSize",label:"Nose Size"},{key:"noseLength",label:"Nose Length"},{key:"mouthWidth",label:"Mouth Width"},{key:"mouthHeight",label:"Mouth Height"},{key:"jawWidth",label:"Jaw Width"},{key:"chinHeight",label:"Chin Height"}]}],wt={pointerEvents:"auto",width:300,maxHeight:"calc(100vh - 32px)",overflow:"auto",borderRadius:16,border:"1px solid rgba(255,255,255,0.12)",background:"rgba(8,15,28,0.72)",boxShadow:"0 16px 36px rgba(0,0,0,0.28)",backdropFilter:"blur(20px) saturate(1.1)",color:"#f8fafc",fontFamily:"system-ui, sans-serif"},St={width:26,height:26,borderRadius:8,border:"1px solid rgba(255,255,255,0.1)",background:"rgba(255,255,255,0.06)",color:"#e2e8f0",cursor:"pointer"},Zl=({value:t,onChange:i})=>{const[p,w]=c.useState(!0),[j,S]=c.useState({x:16,y:96}),[R,k]=c.useState(Object.fromEntries(mt.map(({title:d})=>[d,!0]))),u=c.useRef(null),r=c.useRef(null);c.useEffect(()=>{const d=s=>{u.current&&S({x:Math.max(8,s.clientX-u.current.x),y:Math.max(8,s.clientY-u.current.y)})},h=()=>{u.current=null};return window.addEventListener("pointermove",d),window.addEventListener("pointerup",h),()=>{window.removeEventListener("pointermove",d),window.removeEventListener("pointerup",h)}},[]);const o=d=>{const h=d.currentTarget.getBoundingClientRect();u.current={x:d.clientX-h.left,y:d.clientY-h.top},d.currentTarget.setPointerCapture(d.pointerId)},v=e.jsx("div",{style:{position:"fixed",left:j.x,top:j.y,zIndex:2e4},children:p?e.jsxs("div",{style:wt,children:[e.jsxs("div",{onPointerDown:o,style:{position:"sticky",top:0,zIndex:1,display:"flex",alignItems:"center",gap:8,padding:8,background:"rgba(8,15,28,0.94)",borderBottom:"1px solid rgba(255,255,255,0.08)",cursor:"grab"},children:[e.jsx("span",{style:{fontSize:11,fontWeight:650,flex:1},children:"3D Face Warp"}),e.jsxs("label",{style:{display:"flex",alignItems:"center",gap:5,fontSize:9},children:[e.jsx("span",{children:"Enabled"}),e.jsx("input",{type:"checkbox",checked:t.enabled,onPointerDown:d=>d.stopPropagation(),onChange:d=>i({...t,enabled:d.target.checked})})]}),e.jsx("button",{type:"button",style:St,title:"Reset",onPointerDown:d=>d.stopPropagation(),onClick:()=>i({...Bt.DEFAULT_FACE_WARP_3D_SETTINGS,enabled:!0}),children:"↺"}),e.jsx("button",{type:"button",style:St,title:"Close",onPointerDown:d=>d.stopPropagation(),onClick:()=>w(!1),children:"×"})]}),e.jsx("div",{style:{display:"grid",gap:6,padding:7},children:mt.map(({title:d,controls:h})=>e.jsxs("section",{style:{border:"1px solid rgba(255,255,255,0.08)",borderRadius:12,overflow:"hidden"},children:[e.jsxs("button",{type:"button",onClick:()=>k(s=>({...s,[d]:!s[d]})),style:{width:"100%",padding:"8px",border:0,background:"rgba(255,255,255,0.03)",color:"#e2e8f0",display:"flex",justifyContent:"space-between",cursor:"pointer",fontSize:10.5},children:[e.jsx("span",{children:d}),e.jsx("span",{children:R[d]?"−":"+"})]}),R[d]?e.jsx("div",{style:{display:"grid",gap:6,padding:8},children:h.map(({key:s,label:y,min:a=-100,max:b=100})=>{const I=Math.round(t[s]*100);return e.jsxs("label",{style:{display:"grid",gridTemplateColumns:"105px 32px 1fr",gap:7,alignItems:"center",fontSize:9},children:[e.jsx("span",{style:{color:"rgba(226,232,240,0.76)"},children:y}),e.jsx("output",{style:{textAlign:"right",fontVariantNumeric:"tabular-nums"},children:I}),e.jsx("input",{type:"range",min:a,max:b,value:I,onChange:N=>i({...t,[s]:Number(N.target.value)/100}),style:{width:"100%",accentColor:"#e2e8f0"}})]},s)})}):null]},d))})]}):e.jsx("button",{type:"button",style:{...wt,width:38,height:38,cursor:"pointer"},onClick:()=>w(!0),title:"Open 3D Face Warp settings",children:"3D"})});return c.useEffect(()=>{const d=document.createElement("div");return d.dataset.xrDebugUi="face-warp-3d",document.body.appendChild(d),r.current=Ue(d),()=>{var h;(h=r.current)==null||h.unmount(),r.current=null,d.remove()}},[]),c.useEffect(()=>{var d;(d=r.current)==null||d.render(v)},[v]),null};exports.MediaSourceSwitcher=$e.MediaSourceSwitcher;exports.defaultMediaSources=$e.defaultMediaSources;exports.sdkImageMediaSources=$e.sdkImageMediaSources;exports.sdkVideoMediaSources=$e.sdkVideoMediaSources;exports.DefaultSettingPanel=Ht.DefaultSettingPanel;exports.FaceWarp3DSettingsPanel=Zl;exports.HandJoints2DSettingsPanel=el;exports.HandTracking2DControllerSettingsPanel=Vn;exports.HandTracking2DSettingsPanel=kn;exports.HandTracking3DSettingsPanel=gl;exports.LayerPanel=Ll;exports.ScreenImageSettingsPanel=ln;exports.ScreenTextSettingsPanel=Cs;exports.SettingsPanel=Pl;
10
+ `}),l?e.jsxs("div",{className:"xr-hand-tracking-2d-controller-scroll",style:{...Ms,height:p},children:[e.jsxs("div",{style:ci,children:[e.jsx("div",{onPointerDown:f,style:{width:16,height:16,display:"flex",alignItems:"center",justifyContent:"center",cursor:"grab",color:"rgba(148,163,184,0.82)",flex:"0 0 auto"},children:e.jsx(Si,{})}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,fontSize:11,fontWeight:600,minWidth:0},children:[e.jsx("span",{style:{display:"flex",width:18,height:18,alignItems:"center",justifyContent:"center",borderRadius:6,background:"rgba(255,255,255,0.08)",border:"1px solid rgba(255,255,255,0.08)",color:"#e2e8f0",flex:"0 0 auto"},children:e.jsx(Lt,{})}),e.jsx("span",{children:"HandTracking2DController"})]}),e.jsx("div",{style:{flex:"1 1 auto"}}),e.jsx("button",{type:"button",onClick:()=>s(ii),style:ds,children:e.jsx(vi,{})}),e.jsx("button",{type:"button",onClick:()=>n(!1),style:ds,children:e.jsx(mi,{})})]}),e.jsxs("div",{style:pi,children:[g("controller","Controller",e.jsx(Lt,{}),e.jsxs("div",{style:fi,children:[e.jsx("label",{style:ke,children:e.jsxs("div",{style:Ce,children:[e.jsx("span",{style:B,children:"Enabled"}),e.jsx("input",{type:"checkbox",style:Re,checked:t.enabled,onChange:i=>s({...t,enabled:i.target.checked})})]})}),e.jsx("label",{style:ke,children:e.jsxs("div",{style:Ce,children:[e.jsx("span",{style:B,children:"Attach Image"}),e.jsx("input",{type:"checkbox",style:Re,checked:t.attachImageEnabled,onChange:i=>s({...t,attachImageEnabled:i.target.checked})})]})}),e.jsx("label",{style:ke,children:e.jsxs("div",{style:Ce,children:[e.jsx("span",{style:B,children:"Size Responsive to Hand Bounding Box"}),e.jsx("input",{type:"checkbox",style:Re,checked:t.sizeResponsiveToHandBoundingBox,onChange:i=>s({...t,sizeResponsiveToHandBoundingBox:i.target.checked})})]})}),e.jsxs("label",{style:pe,children:[e.jsx("span",{style:B,children:"Size"}),e.jsx("input",{style:ge,type:"number",min:.1,max:3,step:.01,value:t.size,onChange:i=>s({...t,size:Number(i.target.value)})})]}),e.jsxs("label",{style:pe,children:[e.jsx("span",{style:B,children:"Vertical Align"}),e.jsx("select",{style:ge,value:t.verticalAlign,onChange:i=>s({...t,verticalAlign:i.target.value}),children:oi.map(i=>e.jsx("option",{value:i.value,children:i.label},i.value))})]}),e.jsxs("label",{style:pe,children:[e.jsx("span",{style:B,children:"Horizontal Align"}),e.jsx("select",{style:ge,value:t.horizontalAlign,onChange:i=>s({...t,horizontalAlign:i.target.value}),children:ri.map(i=>e.jsx("option",{value:i.value,children:i.label},i.value))})]}),e.jsxs("label",{style:pe,children:[e.jsx("span",{style:B,children:"Offset X"}),e.jsx("input",{style:ge,type:"number",min:-1,max:1,step:.01,value:t.offsetX,onChange:i=>s({...t,offsetX:Number(i.target.value)})})]}),e.jsxs("label",{style:pe,children:[e.jsx("span",{style:B,children:"Offset Y"}),e.jsx("input",{style:ge,type:"number",min:-1,max:1,step:.01,value:t.offsetY,onChange:i=>s({...t,offsetY:Number(i.target.value)})})]}),e.jsxs("label",{style:pe,children:[e.jsx("span",{style:B,children:"Rotation"}),e.jsx("input",{style:ge,type:"number",min:-180,max:180,step:.1,value:t.rotation,onChange:i=>s({...t,rotation:Number(i.target.value)})})]}),e.jsxs("label",{style:pe,children:[e.jsx("span",{style:B,children:"Alpha"}),e.jsx("input",{style:ge,type:"number",min:0,max:1,step:.01,value:t.alpha,onChange:i=>s({...t,alpha:Number(i.target.value)})})]}),e.jsx("label",{style:ke,children:e.jsxs("div",{style:Ce,children:[e.jsx("span",{style:B,children:"Smooth Following"}),e.jsx("input",{type:"checkbox",style:Re,checked:t.smoothFollowing,onChange:i=>s({...t,smoothFollowing:i.target.checked})})]})}),e.jsxs("label",{style:pe,children:[e.jsx("span",{style:B,children:"Smoothing"}),e.jsx("input",{style:ge,type:"number",min:0,max:1,step:.01,value:t.smoothing,onChange:i=>s({...t,smoothing:Number(i.target.value)})})]})]})),g("visibility","Visibility",e.jsx(Lt,{}),e.jsxs(e.Fragment,{children:[e.jsx("label",{style:ke,children:e.jsxs("div",{style:Ce,children:[e.jsx("span",{style:B,children:"Show Overlay"}),e.jsx("input",{type:"checkbox",style:Re,checked:t.enabled,onChange:i=>s({...t,enabled:i.target.checked})})]})}),e.jsx("label",{style:ke,children:e.jsxs("div",{style:Ce,children:[e.jsx("span",{style:B,children:"Show Attach Image"}),e.jsx("input",{type:"checkbox",style:Re,checked:t.attachImageEnabled,onChange:i=>s({...t,attachImageEnabled:i.target.checked})})]})}),e.jsx("label",{style:ke,children:e.jsxs("div",{style:Ce,children:[e.jsx("span",{style:B,children:"Show Bounding Box"}),e.jsx("input",{type:"checkbox",style:Re,checked:t.showBoundingBox,onChange:i=>s({...t,showBoundingBox:i.target.checked})})]})})]}))]})]}):e.jsx("div",{role:"button",tabIndex:0,onClick:()=>n(!0),style:di,children:e.jsx(ji,{})})]}),document.body)},ki={position:"fixed",left:320,top:104,zIndex:2e4,pointerEvents:"none"},Fs={pointerEvents:"auto",width:286,borderRadius:16,border:"1px solid rgba(255,255,255,0.12)",background:"rgba(8, 15, 28, 0.58)",boxShadow:"0 16px 36px rgba(0,0,0,0.28)",backdropFilter:"blur(20px) saturate(1.1)",WebkitBackdropFilter:"blur(20px) saturate(1.1)",color:"#f8fafc",overflowX:"hidden",overflowY:"auto",scrollbarWidth:"thin",scrollbarColor:"rgba(148,163,184,0.55) rgba(255,255,255,0.06)",overscrollBehavior:"contain"},Ci={...Fs,width:32,height:32,borderRadius:16,display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer"},Ri={position:"sticky",top:0,zIndex:1,display:"flex",alignItems:"center",gap:7,padding:"7px 8px",borderBottom:"1px solid rgba(255,255,255,0.08)",background:"rgba(8, 15, 28, 0.88)",backdropFilter:"blur(20px) saturate(1.1)",WebkitBackdropFilter:"blur(20px) saturate(1.1)"},Ii={display:"grid",gap:6,padding:7},Ei={borderRadius:12,border:"1px solid rgba(255,255,255,0.08)",background:"rgba(255,255,255,0.03)",overflow:"hidden"},Ti={display:"flex",alignItems:"center",gap:7,padding:"6px 7px"},zi={display:"flex",alignItems:"center",gap:6,fontSize:11,fontWeight:500,flex:"1 1 auto",minWidth:0},Mi={width:28,height:16,borderRadius:999,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(255,255,255,0.08)",padding:2,display:"flex",alignItems:"center",cursor:"pointer",flex:"0 0 auto"},Fi=t=>({width:10,height:10,borderRadius:999,background:t?"#f8fafc":"rgba(148,163,184,0.7)",transform:t?"translateX(12px)":"translateX(0)",transition:"transform 140ms ease, background 140ms ease"}),Wi={display:"grid",gap:7,padding:"0 7px 7px"},cs={display:"grid",gridTemplateColumns:"repeat(2, minmax(0, 1fr))",gap:6},be={display:"flex",flexDirection:"column",gap:4},Ie={...be,gridColumn:"1 / -1"},H={fontSize:9,color:"rgba(226,232,240,0.72)"},Ee={width:"100%",height:24,borderRadius:7,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(15,23,42,0.68)",color:"#f8fafc",fontSize:10.5,outline:"none",padding:"0 7px",boxSizing:"border-box"},Te={display:"flex",alignItems:"center",justifyContent:"space-between",gap:12,minHeight:24},ze={width:16,height:16},ps={display:"inline-flex",alignItems:"center",justifyContent:"center",width:24,height:24,borderRadius:8,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(255,255,255,0.05)",color:"#e2e8f0",cursor:"pointer",padding:0,flex:"0 0 auto"},Li=()=>e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M7 10h10v2H7v-2zm0 4h10v2H7v-2zm0-8h10v2H7V6z"})}),$i=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M18.3 5.71 12 12l6.3 6.29-1.41 1.41L10.59 13.41 4.29 19.7 2.88 18.29 9.17 12 2.88 5.71 4.29 4.3l6.3 6.29 6.29-6.3z"})}),Ni=()=>e.jsx("svg",{width:"11",height:"15",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M8 6a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM8 12a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM8 18a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM16 6a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM16 12a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM16 18a2 2 0 1 1-4 0 2 2 0 0 1 4 0z"})}),$t=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M8 5a3 3 0 1 1-3-3 3 3 0 0 1 3 3zm11 11a3 3 0 1 0 3 3 3 3 0 0 0-3-3zM7.1 7.1l9.8 9.8 1.4-1.4-9.8-9.8-1.4 1.4zM19 2a3 3 0 1 0 3 3 3 3 0 0 0-3-3zM7.1 16.9l9.8-9.8-1.4-1.4-9.8 9.8 1.4 1.4zM5 16a3 3 0 1 0 3 3 3 3 0 0 0-3-3z"})}),Oi=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M12 5V2L7 7l5 5V9a4 4 0 1 1-4 4H6a6 6 0 1 0 6-8z"})}),Ai=({value:t,onChange:s})=>{const[l,n]=y.useState(!0),[a,d]=y.useState({x:320,y:104}),[r,o]=y.useState(typeof window>"u"?0:window.innerHeight),[h,x]=y.useState({joints:!0,visibility:!0}),c=y.useRef(null),p=Math.max(240,r-a.y-16);y.useEffect(()=>{const i=j=>{c.current&&d({x:Math.max(8,j.clientX-c.current.x),y:Math.max(8,j.clientY-c.current.y)})},u=()=>{c.current=null,document.body.classList.remove("select-none")};return window.addEventListener("pointermove",i),window.addEventListener("pointerup",u),()=>{window.removeEventListener("pointermove",i),window.removeEventListener("pointerup",u)}},[]),y.useEffect(()=>{const i=()=>o(window.innerHeight);return window.addEventListener("resize",i),()=>window.removeEventListener("resize",i)},[]);const f=i=>{const u=i.currentTarget.getBoundingClientRect();c.current={x:i.clientX-u.left,y:i.clientY-u.top},document.body.classList.add("select-none"),i.currentTarget.setPointerCapture(i.pointerId)},g=(i,u,j,w)=>e.jsxs("div",{style:Ei,children:[e.jsxs("div",{style:Ti,children:[e.jsx("button",{type:"button",onClick:()=>x(v=>({...v,[i]:!v[i]})),style:Mi,children:e.jsx("div",{style:Fi(h[i])})}),e.jsxs("div",{style:zi,children:[e.jsx("span",{style:{display:"flex",width:18,height:18,alignItems:"center",justifyContent:"center",borderRadius:6,background:"rgba(255,255,255,0.08)",border:"1px solid rgba(255,255,255,0.08)",color:"#e2e8f0",flex:"0 0 auto"},children:j}),e.jsx("span",{children:u})]})]}),h[i]?e.jsx("div",{style:Wi,children:w}):null]},i);return typeof document>"u"?null:Ae.createPortal(e.jsx("div",{style:{...ki,left:a.x,top:a.y},children:l?e.jsxs("div",{style:{...Fs,height:p},children:[e.jsxs("div",{style:Ri,children:[e.jsx("div",{onPointerDown:f,style:{width:16,height:16,display:"flex",alignItems:"center",justifyContent:"center",cursor:"grab",color:"rgba(148,163,184,0.82)",flex:"0 0 auto"},children:e.jsx(Ni,{})}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,fontSize:11,fontWeight:600,minWidth:0},children:[e.jsx("span",{style:{display:"flex",width:18,height:18,alignItems:"center",justifyContent:"center",borderRadius:6,background:"rgba(255,255,255,0.08)",border:"1px solid rgba(255,255,255,0.08)",color:"#e2e8f0",flex:"0 0 auto"},children:e.jsx($t,{})}),e.jsx("span",{children:"HandJoints2D"})]}),e.jsx("div",{style:{flex:"1 1 auto"}}),e.jsx("button",{type:"button",onClick:()=>s(Ne.DEFAULT_HAND_JOINTS_2D_SETTINGS),style:ps,children:e.jsx(Oi,{})}),e.jsx("button",{type:"button",onClick:()=>n(!1),style:ps,children:e.jsx($i,{})})]}),e.jsxs("div",{style:Ii,children:[g("joints","Joints",e.jsx($t,{}),e.jsxs("div",{style:cs,children:[e.jsxs("label",{style:be,children:[e.jsx("span",{style:H,children:"Visual Scale"}),e.jsx("input",{style:Ee,type:"number",min:.25,max:2,step:.01,value:t.visualScale,onChange:i=>s({...t,visualScale:Number(i.target.value)})})]}),e.jsxs("label",{style:be,children:[e.jsx("span",{style:H,children:"Opacity"}),e.jsx("input",{style:Ee,type:"number",min:0,max:1,step:.01,value:t.opacity,onChange:i=>s({...t,opacity:Number(i.target.value)})})]}),e.jsxs("label",{style:be,children:[e.jsx("span",{style:H,children:"Joint Radius"}),e.jsx("input",{style:Ee,type:"number",min:.5,max:24,step:.5,value:t.jointRadius,onChange:i=>s({...t,jointRadius:Number(i.target.value)})})]}),e.jsxs("label",{style:be,children:[e.jsx("span",{style:H,children:"Line Width"}),e.jsx("input",{style:Ee,type:"number",min:.01,max:100,step:.1,value:t.lineWidth,onChange:i=>s({...t,lineWidth:Number(i.target.value)})})]}),e.jsxs("label",{style:be,children:[e.jsx("span",{style:H,children:"Label Size"}),e.jsx("input",{style:Ee,type:"number",min:.25,max:3,step:.05,value:t.labelScale,onChange:i=>s({...t,labelScale:Number(i.target.value)})})]}),e.jsxs("label",{style:be,children:[e.jsx("span",{style:H,children:"Smoothing"}),e.jsx("input",{style:Ee,type:"number",min:0,max:1,step:.01,value:t.smoothing,onChange:i=>s({...t,smoothing:Number(i.target.value)})})]}),e.jsxs("label",{style:be,children:[e.jsx("span",{style:H,children:"Min Count Confidence"}),e.jsx("input",{style:Ee,type:"number",min:0,max:1,step:.01,value:t.minCountConfidence,onChange:i=>s({...t,minCountConfidence:Number(i.target.value)})})]})]})),g("visibility","Visibility",e.jsx($t,{}),e.jsxs("div",{style:cs,children:[e.jsx("label",{style:Ie,children:e.jsxs("div",{style:Te,children:[e.jsx("span",{style:H,children:"Show Joints"}),e.jsx("input",{type:"checkbox",style:ze,checked:t.enabled,onChange:i=>s({...t,enabled:i.target.checked})})]})}),e.jsx("label",{style:Ie,children:e.jsxs("div",{style:Te,children:[e.jsx("span",{style:H,children:"Both Hands"}),e.jsx("input",{type:"checkbox",style:ze,checked:t.bothHands,onChange:i=>s({...t,bothHands:i.target.checked})})]})}),e.jsx("label",{style:Ie,children:e.jsxs("div",{style:Te,children:[e.jsx("span",{style:H,children:"Count Fingers"}),e.jsx("input",{type:"checkbox",style:ze,checked:t.countEnabled,onChange:i=>s({...t,countEnabled:i.target.checked})})]})}),e.jsx("label",{style:Ie,children:e.jsxs("div",{style:Te,children:[e.jsx("span",{style:H,children:"Joint Dots"}),e.jsx("input",{type:"checkbox",style:ze,checked:t.showJoints,onChange:i=>s({...t,showJoints:i.target.checked})})]})}),e.jsx("label",{style:Ie,children:e.jsxs("div",{style:Te,children:[e.jsx("span",{style:H,children:"Bone Lines"}),e.jsx("input",{type:"checkbox",style:ze,checked:t.showBones,onChange:i=>s({...t,showBones:i.target.checked})})]})}),e.jsx("label",{style:Ie,children:e.jsxs("div",{style:Te,children:[e.jsx("span",{style:H,children:"Bounding Box"}),e.jsx("input",{type:"checkbox",style:ze,checked:t.showBoundingBox,onChange:i=>s({...t,showBoundingBox:i.target.checked})})]})}),e.jsx("label",{style:Ie,children:e.jsxs("div",{style:Te,children:[e.jsx("span",{style:H,children:"Labels"}),e.jsx("input",{type:"checkbox",style:ze,checked:t.showLabels,onChange:i=>s({...t,showLabels:i.target.checked})})]})})]}))]})]}):e.jsx("div",{role:"button",tabIndex:0,onClick:()=>n(!0),style:Ci,children:e.jsx(Li,{})})}),document.body)},Pi={enabled:!0,bothHands:!0,space:"scene",showJoints:!0,showBones:!0,showLabels:!1,handScale:1,depthScale:1,trackingDistanceM:.6096,projectionDistanceM:2,fitX:1,fitY:.9,offsetX:0,offsetY:0,offsetZ:0,jointRadius:.012,boneRadius:.012,opacity:.88,smoothing:.35},Di={position:"fixed",left:320,top:104,zIndex:2e4,pointerEvents:"none"},Ws={pointerEvents:"auto",width:286,borderRadius:16,border:"1px solid rgba(255,255,255,0.12)",background:"rgba(8, 15, 28, 0.58)",boxShadow:"0 16px 36px rgba(0,0,0,0.28)",backdropFilter:"blur(20px) saturate(1.1)",WebkitBackdropFilter:"blur(20px) saturate(1.1)",color:"#f8fafc",overflowX:"hidden",overflowY:"auto",scrollbarWidth:"thin",scrollbarColor:"rgba(148,163,184,0.55) rgba(255,255,255,0.06)",overscrollBehavior:"contain"},Bi={...Ws,width:32,height:32,borderRadius:16,display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer"},Vi={position:"sticky",top:0,zIndex:1,display:"flex",alignItems:"center",gap:7,padding:"7px 8px",borderBottom:"1px solid rgba(255,255,255,0.08)",background:"rgba(8, 15, 28, 0.88)",backdropFilter:"blur(20px) saturate(1.1)",WebkitBackdropFilter:"blur(20px) saturate(1.1)"},Ki={display:"grid",gap:6,padding:7},Hi={borderRadius:12,border:"1px solid rgba(255,255,255,0.08)",background:"rgba(255,255,255,0.03)",overflow:"hidden"},Gi={display:"flex",alignItems:"center",gap:7,padding:"6px 7px"},_i={display:"flex",alignItems:"center",gap:6,fontSize:11,fontWeight:500,flex:"1 1 auto",minWidth:0},Ui={width:28,height:16,borderRadius:999,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(255,255,255,0.08)",padding:2,display:"flex",alignItems:"center",cursor:"pointer",flex:"0 0 auto"},Xi=t=>({width:10,height:10,borderRadius:999,background:t?"#f8fafc":"rgba(148,163,184,0.7)",transform:t?"translateX(12px)":"translateX(0)",transition:"transform 140ms ease, background 140ms ease"}),Zi={display:"grid",gap:7,padding:"0 7px 7px"},Nt={display:"grid",gridTemplateColumns:"repeat(2, minmax(0, 1fr))",gap:6},_={display:"flex",flexDirection:"column",gap:4},Ke={..._,gridColumn:"1 / -1"},O={fontSize:9,color:"rgba(226,232,240,0.72)"},G={width:"100%",height:24,borderRadius:7,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(15,23,42,0.68)",color:"#f8fafc",fontSize:10.5,outline:"none",padding:"0 7px",boxSizing:"border-box"},nt={display:"flex",alignItems:"center",justifyContent:"space-between",gap:12,minHeight:24},lt={width:16,height:16},hs={display:"inline-flex",alignItems:"center",justifyContent:"center",width:24,height:24,borderRadius:8,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(255,255,255,0.05)",color:"#e2e8f0",cursor:"pointer",padding:0,flex:"0 0 auto"},Yi=()=>e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M7 10h10v2H7v-2zm0 4h10v2H7v-2zm0-8h10v2H7V6z"})}),qi=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M18.3 5.71 12 12l6.3 6.29-1.41 1.41L10.59 13.41 4.29 19.7 2.88 18.29 9.17 12 2.88 5.71 4.29 4.3l6.3 6.29 6.29-6.3z"})}),Ji=()=>e.jsx("svg",{width:"11",height:"15",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M8 6a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM8 12a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM8 18a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM16 6a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM16 12a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM16 18a2 2 0 1 1-4 0 2 2 0 0 1 4 0z"})}),jt=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M11 2a1 1 0 0 1 1 1v6h1V3a1 1 0 1 1 2 0v6h1V4a1 1 0 1 1 2 0v7.3l1.6 2.4a5 5 0 0 1 .8 2.7V18a4 4 0 0 1-4 4H9a6 6 0 0 1-6-6v-3.5a2.5 2.5 0 0 1 5 0V15h1V3a1 1 0 0 1 1-1z"})}),Qi=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M12 5V2L7 7l5 5V9a4 4 0 1 1-4 4H6a6 6 0 1 0 6-8z"})}),eo=({value:t,onChange:s})=>{const[l,n]=y.useState(!0),[a,d]=y.useState({x:320,y:104}),[r,o]=y.useState(typeof window>"u"?0:window.innerHeight),[h,x]=y.useState({visual:!0,calibration:!0,visibility:!0}),c=y.useRef(null),p=Math.max(240,r-a.y-16);y.useEffect(()=>{const i=j=>{c.current&&d({x:Math.max(8,j.clientX-c.current.x),y:Math.max(8,j.clientY-c.current.y)})},u=()=>{c.current=null,document.body.classList.remove("select-none")};return window.addEventListener("pointermove",i),window.addEventListener("pointerup",u),()=>{window.removeEventListener("pointermove",i),window.removeEventListener("pointerup",u)}},[]),y.useEffect(()=>{const i=()=>o(window.innerHeight);return window.addEventListener("resize",i),()=>window.removeEventListener("resize",i)},[]);const f=i=>{const u=i.currentTarget.getBoundingClientRect();c.current={x:i.clientX-u.left,y:i.clientY-u.top},document.body.classList.add("select-none"),i.currentTarget.setPointerCapture(i.pointerId)},g=(i,u,j,w)=>e.jsxs("div",{style:Hi,children:[e.jsxs("div",{style:Gi,children:[e.jsx("button",{type:"button",onClick:()=>x(v=>({...v,[i]:!v[i]})),style:Ui,children:e.jsx("div",{style:Xi(h[i])})}),e.jsxs("div",{style:_i,children:[e.jsx("span",{style:{display:"flex",width:18,height:18,alignItems:"center",justifyContent:"center",borderRadius:6,background:"rgba(255,255,255,0.08)",border:"1px solid rgba(255,255,255,0.08)",color:"#e2e8f0",flex:"0 0 auto"},children:j}),e.jsx("span",{children:u})]})]}),h[i]?e.jsx("div",{style:Zi,children:w}):null]},i);return typeof document>"u"?null:Ae.createPortal(e.jsx("div",{style:{...Di,left:a.x,top:a.y},children:l?e.jsxs("div",{style:{...Ws,height:p},children:[e.jsxs("div",{style:Vi,children:[e.jsx("div",{onPointerDown:f,style:{width:16,height:16,display:"flex",alignItems:"center",justifyContent:"center",cursor:"grab",color:"rgba(148,163,184,0.82)",flex:"0 0 auto"},children:e.jsx(Ji,{})}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,fontSize:11,fontWeight:600,minWidth:0},children:[e.jsx("span",{style:{display:"flex",width:18,height:18,alignItems:"center",justifyContent:"center",borderRadius:6,background:"rgba(255,255,255,0.08)",border:"1px solid rgba(255,255,255,0.08)",color:"#e2e8f0",flex:"0 0 auto"},children:e.jsx(jt,{})}),e.jsx("span",{children:"HandTracking3D"})]}),e.jsx("div",{style:{flex:"1 1 auto"}}),e.jsx("button",{type:"button",onClick:()=>s(Pi),style:hs,children:e.jsx(Qi,{})}),e.jsx("button",{type:"button",onClick:()=>n(!1),style:hs,children:e.jsx(qi,{})})]}),e.jsxs("div",{style:Ki,children:[g("visual","Visual",e.jsx(jt,{}),e.jsxs("div",{style:Nt,children:[e.jsxs("label",{style:Ke,children:[e.jsx("span",{style:O,children:"Space"}),e.jsxs("select",{style:G,value:t.space,onChange:i=>s({...t,space:i.target.value}),children:[e.jsx("option",{value:"scene",children:"Scene"}),e.jsx("option",{value:"screen",children:"Screen Fit"})]})]}),e.jsxs("label",{style:_,children:[e.jsx("span",{style:O,children:"Joint Size"}),e.jsx("input",{style:G,type:"number",min:5e-4,max:.08,step:5e-4,value:t.jointRadius,onChange:i=>s({...t,jointRadius:Number(i.target.value)})})]}),e.jsxs("label",{style:_,children:[e.jsx("span",{style:O,children:"Bone Radius"}),e.jsx("input",{style:G,type:"number",min:.001,max:.12,step:.001,value:t.boneRadius,onChange:i=>s({...t,boneRadius:Number(i.target.value)})})]}),e.jsxs("label",{style:_,children:[e.jsx("span",{style:O,children:"Opacity"}),e.jsx("input",{style:G,type:"number",min:0,max:1,step:.01,value:t.opacity,onChange:i=>s({...t,opacity:Number(i.target.value)})})]}),e.jsxs("label",{style:_,children:[e.jsx("span",{style:O,children:"Smoothing"}),e.jsx("input",{style:G,type:"number",min:0,max:1,step:.01,value:t.smoothing,onChange:i=>s({...t,smoothing:Number(i.target.value)})})]})]})),g("calibration","Calibration",e.jsx(jt,{}),e.jsxs("div",{style:Nt,children:[e.jsxs("label",{style:_,children:[e.jsx("span",{style:O,children:"Hand Distance Ref (m)"}),e.jsx("input",{style:G,type:"number",min:.05,max:5,step:.01,value:t.trackingDistanceM,onChange:i=>s({...t,trackingDistanceM:Number(i.target.value)})})]}),e.jsxs("label",{style:_,children:[e.jsx("span",{style:O,children:"Projection Distance"}),e.jsx("input",{style:G,type:"number",min:.05,max:10,step:.01,value:t.projectionDistanceM,onChange:i=>s({...t,projectionDistanceM:Number(i.target.value)})})]}),e.jsxs("label",{style:_,children:[e.jsx("span",{style:O,children:"Hand Scale"}),e.jsx("input",{style:G,type:"number",min:.1,max:8,step:.01,value:t.handScale,onChange:i=>s({...t,handScale:Number(i.target.value)})})]}),e.jsxs("label",{style:_,children:[e.jsx("span",{style:O,children:"Fit X"}),e.jsx("input",{style:G,type:"number",min:.1,max:4,step:.01,value:t.fitX,onChange:i=>s({...t,fitX:Number(i.target.value)})})]}),e.jsxs("label",{style:_,children:[e.jsx("span",{style:O,children:"Fit Y"}),e.jsx("input",{style:G,type:"number",min:.1,max:4,step:.01,value:t.fitY,onChange:i=>s({...t,fitY:Number(i.target.value)})})]}),e.jsxs("label",{style:_,children:[e.jsx("span",{style:O,children:"Offset X"}),e.jsx("input",{style:G,type:"number",min:-5,max:5,step:.01,value:t.offsetX,onChange:i=>s({...t,offsetX:Number(i.target.value)})})]}),e.jsxs("label",{style:_,children:[e.jsx("span",{style:O,children:"Offset Y"}),e.jsx("input",{style:G,type:"number",min:-5,max:5,step:.01,value:t.offsetY,onChange:i=>s({...t,offsetY:Number(i.target.value)})})]}),e.jsxs("label",{style:_,children:[e.jsx("span",{style:O,children:"Offset Z"}),e.jsx("input",{style:G,type:"number",min:-5,max:5,step:.01,value:t.offsetZ,onChange:i=>s({...t,offsetZ:Number(i.target.value)})})]}),e.jsxs("label",{style:_,children:[e.jsx("span",{style:O,children:"Depth Scale"}),e.jsx("input",{style:G,type:"number",min:0,max:10,step:.1,value:t.depthScale,onChange:i=>s({...t,depthScale:Number(i.target.value)})})]})]})),g("visibility","Visibility",e.jsx(jt,{}),e.jsxs("div",{style:Nt,children:[e.jsx("label",{style:Ke,children:e.jsxs("div",{style:nt,children:[e.jsx("span",{style:O,children:"Show 3D Hand"}),e.jsx("input",{type:"checkbox",style:lt,checked:t.enabled,onChange:i=>s({...t,enabled:i.target.checked})})]})}),e.jsx("label",{style:Ke,children:e.jsxs("div",{style:nt,children:[e.jsx("span",{style:O,children:"Both Hands"}),e.jsx("input",{type:"checkbox",style:lt,checked:t.bothHands,onChange:i=>s({...t,bothHands:i.target.checked})})]})}),e.jsx("label",{style:Ke,children:e.jsxs("div",{style:nt,children:[e.jsx("span",{style:O,children:"Joint Spheres"}),e.jsx("input",{type:"checkbox",style:lt,checked:t.showJoints,onChange:i=>s({...t,showJoints:i.target.checked})})]})}),e.jsx("label",{style:Ke,children:e.jsxs("div",{style:nt,children:[e.jsx("span",{style:O,children:"Bone Cylinders"}),e.jsx("input",{type:"checkbox",style:lt,checked:t.showBones,onChange:i=>s({...t,showBones:i.target.checked})})]})}),e.jsx("label",{style:Ke,children:e.jsxs("div",{style:nt,children:[e.jsx("span",{style:O,children:"Labels"}),e.jsx("input",{type:"checkbox",style:lt,checked:t.showLabels,onChange:i=>s({...t,showLabels:i.target.checked})})]})})]}))]})]}):e.jsx("div",{role:"button",tabIndex:0,onClick:()=>n(!0),style:Bi,children:e.jsx(Yi,{})})}),document.body)},to=1e3;function so(t,s=to){return t.map((l,n)=>({...l,renderOrder:s+(t.length-n)}))}function no(t,s,l){const n=t.findIndex(o=>o.id===s),a=t.findIndex(o=>o.id===l);if(n<0||a<0||n===a)return t;const d=[...t],[r]=d.splice(n,1);return d.splice(a,0,r),so(d)}const lo={position:"fixed",left:14,top:104,zIndex:2e4,pointerEvents:"none"},xs={pointerEvents:"auto",width:284,borderRadius:16,border:"1px solid rgba(255,255,255,0.12)",background:"rgba(8, 15, 28, 0.58)",boxShadow:"0 16px 36px rgba(0,0,0,0.28)",backdropFilter:"blur(20px) saturate(1.1)",WebkitBackdropFilter:"blur(20px) saturate(1.1)",color:"#f8fafc",overflowX:"hidden",overflowY:"auto",scrollbarWidth:"thin",scrollbarColor:"rgba(148,163,184,0.55) rgba(255,255,255,0.06)",overscrollBehavior:"contain"},Vt={display:"inline-flex",alignItems:"center",justifyContent:"center",width:22,height:22,borderRadius:8,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(255,255,255,0.05)",color:"#e2e8f0",cursor:"pointer",padding:0,flex:"0 0 auto"},io={position:"sticky",top:0,zIndex:1,display:"flex",alignItems:"center",gap:8,padding:"8px 8px",borderBottom:"1px solid rgba(255,255,255,0.08)",background:"rgba(8, 15, 28, 0.88)",backdropFilter:"blur(20px) saturate(1.1)",WebkitBackdropFilter:"blur(20px) saturate(1.1)"},oo={width:16,height:16,display:"flex",alignItems:"center",justifyContent:"center",cursor:"grab",color:"rgba(148,163,184,0.82)",flex:"0 0 auto"},ro={display:"flex",alignItems:"center",gap:6,fontSize:11,fontWeight:600,minWidth:0},ao={display:"flex",width:18,height:18,alignItems:"center",justifyContent:"center",borderRadius:6,background:"rgba(255,255,255,0.08)",border:"1px solid rgba(255,255,255,0.08)",color:"#e2e8f0",flex:"0 0 auto"},co={display:"grid",gap:6,padding:7},po=t=>({display:"grid",gridTemplateColumns:"20px 20px 20px minmax(0, 1fr)",alignItems:"center",gap:6,minHeight:34,padding:"6px 7px",borderRadius:10,border:t?"1px solid rgba(56,189,248,0.5)":"1px solid rgba(255,255,255,0.08)",background:t?"rgba(56,189,248,0.10)":"rgba(255,255,255,0.03)",cursor:"pointer",opacity:1}),ho={display:"flex",flexDirection:"column",gap:2,minWidth:0},xo={fontSize:10,fontWeight:600,lineHeight:1.15,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},uo={fontSize:9,color:"rgba(226,232,240,0.6)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},Ot={...Vt,width:20,height:20,borderRadius:7,fontSize:11,lineHeight:1},go=({off:t=!1})=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:t?e.jsx("path",{d:"M2 2l20 20-1.4 1.4-3.2-3.2C15.9 21 14.1 21.5 12 21.5 6.5 21.5 2 16 1 12c.4-1.8 1.1-3.4 2.2-4.8L.6 4.6 2 2zm10 4c3.9 0 7.4 2.8 9.2 6-1 1.8-2.6 3.5-4.4 4.6l-2-2c.1-.3.2-.7.2-1.1a3 3 0 0 0-3-3c-.4 0-.8.1-1.1.2l-1.9-1.9C10.2 6.8 11.1 6 12 6z"}):e.jsx("path",{d:"M12 5c5.5 0 10 5 11 7-.9 2-5.5 7-11 7S2 14 1 12c1-2 5.5-7 11-7zm0 3.2A3.8 3.8 0 1 0 12 16.8 3.8 3.8 0 0 0 12 8.2z"})}),yo=({off:t=!1})=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:t?e.jsx("path",{d:"M18 8h-1V6a5 5 0 0 0-9.1-2.9l1.5 1.5A3 3 0 0 1 16 6v2H8a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h9.2l1.8 1.8 1.4-1.4L2.6 3.4 1.2 4.8 5 8.6V20h14a2 2 0 0 0 2-2v-8a2 2 0 0 0-2-2z"}):e.jsx("path",{d:"M7 10V8a5 5 0 0 1 10 0v2h1a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h1zm2 0h6V8a3 3 0 0 0-6 0v2z"})}),bo=()=>e.jsx("svg",{width:"11",height:"15",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M11 2h2v4h3l-4 4-4-4h3V2zm0 20v-4H8l4-4 4 4h-3v4h-2zM2 11h4V8l4 4-4 4v-3H2v-2zm20 0v2h-4v3l-4-4 4-4v3h4z"})}),us=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M12 3 1 9l11 6 11-6-11-6zm0 8L1 5v4l11 6 11-6V5l-11 6zm0 6L1 11v4l11 6 11-6v-4l-11 6z"})}),fo=({layers:t,selectedLayerId:s,onSelectLayer:l,onToggleVisible:n,onToggleEnabled:a,onReorder:d,onToggleLocked:r,initialPosition:o,title:h="Layers"})=>{const[x,c]=y.useState(!0),[p,f]=y.useState(o??{x:644,y:104}),[g,i]=y.useState(typeof window>"u"?0:window.innerHeight),u=y.useRef(null),[j,w]=y.useState(null),v=Math.max(240,g-p.y-16);if(y.useEffect(()=>{const b=E=>{u.current&&f({x:Math.max(8,E.clientX-u.current.x),y:Math.max(8,E.clientY-u.current.y)})},F=()=>{u.current=null,document.body.classList.remove("select-none")};return window.addEventListener("pointermove",b),window.addEventListener("pointerup",F),()=>{window.removeEventListener("pointermove",b),window.removeEventListener("pointerup",F)}},[]),y.useEffect(()=>{const b=()=>i(window.innerHeight);return window.addEventListener("resize",b),()=>window.removeEventListener("resize",b)},[]),typeof document>"u")return null;const M=b=>{const F=b.currentTarget.getBoundingClientRect();u.current={x:b.clientX-F.left,y:b.clientY-F.top},document.body.classList.add("select-none"),b.currentTarget.setPointerCapture(b.pointerId)},U=b=>{if(!j||j===b){w(null);return}const F=t.findIndex(P=>P.id===j),E=t.findIndex(P=>P.id===b);if(F<0||E<0){w(null);return}d(no(t,j,b)),w(null)};return Ae.createPortal(e.jsx("div",{style:{...lo,left:p.x,top:p.y},children:x?e.jsxs("div",{style:{...xs,height:v},children:[e.jsxs("div",{style:io,children:[e.jsx("div",{onPointerDown:M,style:oo,children:e.jsx(bo,{})}),e.jsxs("div",{style:ro,children:[e.jsx("span",{style:ao,children:e.jsx(us,{})}),e.jsx("span",{children:h})]}),e.jsx("div",{style:{flex:"1 1 auto"}}),e.jsx("button",{type:"button",onClick:()=>c(!1),style:Vt,children:"−"})]}),e.jsx("div",{style:co,children:t.map((b,F)=>e.jsxs("div",{style:po(s===b.id),draggable:!0,onDragStart:()=>w(b.id),onDragOver:E=>E.preventDefault(),onDrop:()=>U(b.id),onClick:()=>l(b.id),title:b.label,children:[e.jsx("button",{type:"button",style:Ot,onClick:E=>{E.stopPropagation(),n(b.id,!b.visible)},children:e.jsx(go,{off:!b.visible})}),e.jsx("button",{type:"button",style:Ot,onClick:E=>{E.stopPropagation(),a(b.id,!b.enabled)},children:b.enabled?"●":"○"}),e.jsx("button",{type:"button",style:Ot,onClick:E=>{E.stopPropagation(),r==null||r(b.id,!b.locked)},children:e.jsx(yo,{off:!b.locked})}),e.jsxs("div",{style:ho,children:[e.jsx("div",{style:xo,children:b.label}),e.jsxs("div",{style:uo,children:[b.domain," / ",b.type," • #",t.length-F]})]})]},b.id))})]}):e.jsx("div",{role:"button",tabIndex:0,onClick:()=>c(!0),style:{...xs,...Vt,width:32,height:32,display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx(us,{})})}),document.body)},At={pointerEvents:"auto",width:300,borderRadius:16,border:"1px solid rgba(255,255,255,.12)",background:"rgba(8,15,28,.78)",boxShadow:"0 16px 36px rgba(0,0,0,.28)",backdropFilter:"blur(20px) saturate(1.1)",color:"#f8fafc",overflow:"auto"},it={display:"inline-flex",alignItems:"center",justifyContent:"center",width:22,height:22,padding:0,borderRadius:7,border:"1px solid rgba(255,255,255,.1)",background:"rgba(255,255,255,.05)",color:"#e2e8f0",cursor:"pointer"},gs=t=>{try{return JSON.parse(t.dataTransfer.getData("application/x-xr-hierarchy"))}catch{return null}},jo=async t=>{var l;if((l=navigator.clipboard)!=null&&l.writeText){await navigator.clipboard.writeText(t);return}const s=document.createElement("textarea");s.value=t,s.setAttribute("readonly",""),s.style.position="fixed",s.style.left="-9999px",document.body.appendChild(s),s.select(),document.execCommand("copy"),document.body.removeChild(s)},Ls=({groups:t,objects:s,selectedObjectId:l,onSelectObject:n,onReorderGroup:a,onReorderObject:d,onMoveObject:r,onSetObjectParent:o,onToggleGroupEnabled:h,onToggleObjectVisible:x,copyConfig:c,docked:p=!1,initialPosition:f={x:10,y:30},title:g="Hierarchy"})=>{const[i,u]=y.useState(!0),{position:j,startDrag:w,place:v}=js({docked:p,initialPosition:f}),M=p?{...At,...kt}:At,[U,b]=y.useState(new Set),[F,E]=y.useState(new Set),[P,le]=y.useState(!1),[ae,L]=y.useState(null),Pe=t.filter(m=>m.objectIds.some(R=>!!s[R])),De=(m,R)=>{m.stopPropagation(),m.dataTransfer.effectAllowed="move",m.dataTransfer.setData("application/x-xr-hierarchy",JSON.stringify(R)),L(null)},W=(m,R,D)=>{var C;m.preventDefault(),m.stopPropagation();const I=gs(m);if(I){if(I.kind==="group"){a(I.groupId,D);return}if(!(o!=null&&o(I.objectId,null,R.objectIds.length,R.id))){if(I.groupId===R.id){d(R.id,I.objectId,R.objectIds.length-1);return}r(I.objectId,R.id,R.objectIds.length)||L(`${((C=s[I.objectId])==null?void 0:C.name)??"Object"} is not compatible with ${R.name}.`)}}},ve=(m,R,D,I)=>{var Ye;m.preventDefault(),m.stopPropagation();const C=gs(m);if(!(!C||C.kind!=="object")&&C.objectId!==D){if(o!=null&&o(C.objectId,D,Ze(D).length,R.id)){E(Be=>{const qe=new Set(Be);return qe.delete(D),qe});return}C.groupId===R.id?d(R.id,C.objectId,I):r(C.objectId,R.id,I)||L(`${((Ye=s[C.objectId])==null?void 0:Ye.name)??"Object"} is not compatible with ${R.name}.`)}},Ze=m=>{const R=s[m],D=(R==null?void 0:R.childObjectIds)??[],I=Object.values(s).filter(C=>C.parentObjectId===m).map(C=>C.id);return[...new Set([...D,...I])].filter(C=>!!s[C])},$=(m,R,D,I)=>{const C=s[m];if(!C)return null;const Ye=l===m,Be=Ze(m),qe=F.has(m);return e.jsxs("div",{style:{display:"grid",gap:4},children:[e.jsxs("div",{draggable:!0,onDragStart:te=>De(te,{kind:"object",groupId:R.id,objectId:m}),onDragOver:te=>te.preventDefault(),onDrop:te=>ve(te,R,m,D),onClick:()=>n(m),style:{display:"grid",gridTemplateColumns:`${Be.length?22:0}px ${x?"22px ":""}minmax(0,1fr)`,alignItems:"center",gap:Be.length||x?6:0,minHeight:30,padding:`4px 7px 4px ${Math.max(10,24+I*16)}px`,border:Ye?"1px solid rgba(56,189,248,.55)":"1px solid transparent",borderRadius:8,background:Ye?"rgba(56,189,248,.12)":"rgba(255,255,255,.025)",cursor:"grab",opacity:C.enabled?1:.5},children:[Be.length?e.jsx("button",{type:"button",style:it,onClick:te=>{te.stopPropagation(),E(Rt=>{const ft=new Set(Rt);return ft.has(m)?ft.delete(m):ft.add(m),ft})},children:qe?"▸":"▾"}):e.jsx("span",{}),x?e.jsx("button",{type:"button",style:it,onClick:te=>{te.stopPropagation(),x(m,!C.enabled)},children:C.enabled?"●":"○"}):null,e.jsx("span",{style:{overflow:"hidden",textOverflow:"ellipsis",fontSize:10},children:C.name})]}),qe?null:Be.map((te,Rt)=>$(te,R,Rt,I+1))]},m)},Z=async()=>{if(c!==void 0)try{await jo(JSON.stringify(c,null,2)),le(!0),window.setTimeout(()=>le(!1),1400)}catch{L("Unable to copy the scene configuration.")}};return v(e.jsx(e.Fragment,{children:i?e.jsxs("section",{style:p?M:{...At,maxHeight:`calc(100vh - ${j.y+16}px)`},children:[e.jsx("header",{onPointerDown:m=>w(m,{capture:!1,selectNone:!1}),style:{position:"sticky",top:0,zIndex:2,padding:"10px 12px",borderBottom:"1px solid rgba(255,255,255,.08)",background:"rgba(8,15,28,.94)",cursor:p?"default":"grab"},children:e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,fontSize:12},children:[e.jsx("strong",{children:g}),e.jsx("div",{style:{flex:"1 1 auto"}}),e.jsx("button",{type:"button","aria-label":`Fold ${g}`,"aria-expanded":"true",onPointerDown:m=>m.stopPropagation(),onClick:()=>u(!1),style:it,children:"−"})]})}),e.jsxs("div",{style:{display:"grid",gap:7,padding:7},children:[c!==void 0&&e.jsx("button",{type:"button",onClick:Z,style:{width:"100%",height:28,borderRadius:8,border:"1px solid rgba(56,189,248,.28)",background:"rgba(56,189,248,.14)",color:"#e0f2fe",cursor:"pointer",fontSize:10,fontWeight:700},children:P?"Copied Config":"Copy Config"}),Pe.map(m=>{const R=t.findIndex(I=>I.id===m.id),D=U.has(m.id);return e.jsxs("section",{onDragOver:I=>I.preventDefault(),onDrop:I=>W(I,m,R),style:{border:"1px solid rgba(255,255,255,.1)",borderRadius:10,overflow:"hidden",opacity:m.enabled?1:.55},children:[e.jsxs("div",{draggable:!0,onDragStart:I=>De(I,{kind:"group",groupId:m.id}),style:{display:"grid",gridTemplateColumns:"22px 22px minmax(0,1fr)",gap:5,alignItems:"center",padding:"6px",background:"rgba(255,255,255,.06)",cursor:"grab"},children:[e.jsx("button",{type:"button",style:it,onClick:()=>b(I=>{const C=new Set(I);return C.has(m.id)?C.delete(m.id):C.add(m.id),C}),children:D?"▸":"▾"}),e.jsx("button",{type:"button",style:it,title:"Toggle group visibility",onClick:()=>h(m.id,!m.enabled),children:m.enabled?"◉":"○"}),e.jsx("div",{style:{minWidth:0},children:e.jsx("div",{style:{fontSize:10,fontWeight:700},children:m.name})})]}),!D&&e.jsx("div",{style:{display:"grid",gap:4,padding:m.objectIds.length?5:0},children:m.objectIds.filter(I=>{var C;return!((C=s[I])!=null&&C.parentObjectId)}).map((I,C)=>$(I,m,C,0))})]},m.id)}),ae&&e.jsx("div",{role:"alert",style:{color:"#fca5a5",fontSize:9,padding:"2px 5px 5px"},children:ae})]})]}):e.jsx("button",{type:"button","aria-expanded":"false",onClick:()=>u(!0),style:{...M,width:"auto",padding:"9px 12px",cursor:"pointer",fontSize:11,fontWeight:700},children:g})}))},mt={display:"grid",gridTemplateColumns:"92px minmax(0, 1fr)",alignItems:"center",gap:10,margin:"8px 0",color:"#cbd5e1",fontSize:12},mo=t=>({display:"grid",gridTemplateColumns:`92px repeat(${t}, minmax(0, 1fr))`,alignItems:"center",gap:6,margin:"8px 0"}),So={fontSize:12,color:"#cbd5e1"},Pt={width:"100%",boxSizing:"border-box",padding:"8px 9px",border:"1px solid rgba(148,163,184,.16)",borderRadius:6,background:"rgba(15,23,42,.72)",color:"#e2e8f0"},vo={width:"100%",minWidth:0,height:24,boxSizing:"border-box",borderRadius:7,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(15,23,42,0.68)",padding:"0 7px",outline:0,color:"#f8fafc",fontSize:10.5,fontVariantNumeric:"tabular-nums"},wo=t=>/^-?\d*(\.\d*)?$/.test(t),St=t=>Number.isFinite(t)?String(t):"0",ko=({onChange:t,value:s})=>{const[l,n]=y.useState(St(s));return y.useEffect(()=>{n(St(s))},[s]),e.jsx("input",{style:vo,type:"text",inputMode:"decimal",value:l,placeholder:"0",onBlur:()=>{if(l.trim()===""){n(St(s));return}const a=Number(l);if(Number.isNaN(a)){n(St(s));return}t(a)},onChange:a=>{const d=a.currentTarget.value;if(!wo(d)||(n(d),d===""||d==="-"||d==="."||d==="-."))return;const r=Number(d);Number.isNaN(r)||t(r)},onKeyDown:a=>{if(a.key!=="ArrowUp"&&a.key!=="ArrowDown")return;a.preventDefault();const d=a.shiftKey?1:a.altKey?.01:.1,r=a.key==="ArrowUp"?s+d:s-d;t(Number(r.toFixed(6)))}})},Dt=({axes:t=["x","y","z"],label:s,onChange:l,value:n})=>e.jsxs("div",{style:mo(t.length),children:[e.jsx("div",{style:So,children:s}),t.map(a=>e.jsx(ko,{value:n[a],onChange:d=>l({...n,[a]:d})},a))]}),$s=({value:t,onChange:s,targets:l=[]})=>e.jsxs("section",{style:{padding:10,borderRadius:10,background:"rgba(255,255,255,.04)"},children:[e.jsxs("div",{style:{display:"flex",justifyContent:"space-between",fontWeight:700,color:"#f8fafc"},children:[e.jsx("span",{children:"Pin to Mesh"}),e.jsx("input",{type:"checkbox",checked:t.enabled,onChange:n=>s({...t,enabled:n.target.checked})})]}),e.jsxs("label",{style:mt,children:[e.jsx("span",{children:"Target"}),e.jsxs("select",{style:Pt,value:t.targetObjectId??"",onChange:n=>s({...t,targetObjectId:n.target.value||null}),children:[e.jsx("option",{value:"",children:"None (Transform)"}),l.map(n=>e.jsx("option",{value:n.id,children:n.name},n.id))]})]}),e.jsxs("label",{style:mt,children:[e.jsx("span",{children:"Orientation"}),e.jsxs("select",{style:Pt,value:t.orientation,onChange:n=>s({...t,orientation:n.target.value}),children:[e.jsx("option",{value:"none",children:"None"}),e.jsx("option",{value:"position",children:"Position"}),e.jsx("option",{value:"positionAndDirection",children:"Position and Direction"})]})]}),e.jsxs("label",{style:mt,children:[e.jsx("span",{children:"Offset Space"}),e.jsxs("select",{style:Pt,value:t.offsetSpace,onChange:n=>s({...t,offsetSpace:n.target.value}),children:[e.jsx("option",{value:"local",children:"Local"}),e.jsx("option",{value:"world",children:"World"})]})]}),e.jsx(Dt,{axes:["x","y"],label:"UV",value:{x:t.uv.x,y:t.uv.y,z:0},onChange:n=>s({...t,uv:{x:n.x,y:n.y}})}),e.jsxs("label",{style:mt,children:[e.jsx("span",{children:"Vertex Normal"}),e.jsx("input",{type:"checkbox",checked:t.vertexNormal,onChange:n=>s({...t,vertexNormal:n.target.checked})})]}),e.jsx(Dt,{label:"Offset Position",value:t.offsetPosition,onChange:n=>s({...t,offsetPosition:n})}),e.jsx(Dt,{label:"Offset Rotation",value:t.offsetRotation,onChange:n=>s({...t,offsetRotation:n})})]}),Co={position:"fixed",zIndex:2e4,pointerEvents:"none"},Ro={pointerEvents:"auto",width:284,maxHeight:"min(620px, calc(100vh - 32px))",borderRadius:16,border:"1px solid rgba(255,255,255,0.12)",background:"rgba(8, 15, 28, 0.62)",boxShadow:"0 16px 36px rgba(0,0,0,0.28)",backdropFilter:"blur(20px) saturate(1.1)",WebkitBackdropFilter:"blur(20px) saturate(1.1)",color:"#f8fafc",overflow:"hidden",fontFamily:"Inter, ui-sans-serif, system-ui, sans-serif"},Io={display:"flex",alignItems:"center",justifyContent:"space-between",gap:8,padding:"8px 8px",borderBottom:"1px solid rgba(255,255,255,0.08)",background:"rgba(8, 15, 28, 0.88)"},Eo={display:"flex",alignItems:"center",gap:6,minWidth:0,fontSize:11,fontWeight:700},To={width:16,height:16,display:"flex",alignItems:"center",justifyContent:"center",cursor:"grab",color:"rgba(148,163,184,0.82)",flex:"0 0 auto"},zo={display:"grid",gap:8,padding:10,maxHeight:"min(548px, calc(100vh - 104px))",overflowY:"auto",scrollbarWidth:"thin",scrollbarColor:"rgba(148,163,184,0.55) rgba(255,255,255,0.06)",overscrollBehavior:"contain"},ot={display:"grid",gap:4,fontSize:10,color:"rgba(226,232,240,0.78)"},vt={width:"100%",minWidth:0,height:28,borderRadius:8,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(15,23,42,0.8)",color:"#f8fafc",padding:"0 8px",boxSizing:"border-box"},Mo={height:24,borderRadius:8,border:"1px solid rgba(56,189,248,0.25)",background:"rgba(56,189,248,0.16)",color:"#e0f2fe",cursor:"pointer",fontSize:10,fontWeight:700,padding:"0 8px"},Fo={display:"grid",gridTemplateColumns:"1fr 74px",alignItems:"center",gap:8},Wo=()=>e.jsx("svg",{width:"11",height:"15",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M11 2h2v4h3l-4 4-4-4h3V2zm0 20v-4H8l4-4 4 4h-3v4h-2zM2 11h4V8l4 4-4 4v-3H2v-2zm20 0v2h-4v3l-4-4 4-4v3h4z"})}),Lo=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M19.4 13.5c.1-.5.1-1 .1-1.5s0-1-.1-1.5l2.1-1.6-2-3.5-2.5 1a8 8 0 0 0-2.6-1.5L14 2h-4l-.4 2.9A8 8 0 0 0 7 6.4l-2.5-1-2 3.5 2.1 1.6A10 10 0 0 0 4.5 12c0 .5 0 1 .1 1.5l-2.1 1.6 2 3.5 2.5-1a8 8 0 0 0 2.6 1.5L10 22h4l.4-2.9a8 8 0 0 0 2.6-1.5l2.5 1 2-3.5-2.1-1.6zM12 15.5A3.5 3.5 0 1 1 12 8a3.5 3.5 0 0 1 0 7.5z"})}),$o=(t,s)=>{const l=t.find(n=>String(n.value)===s);return(l==null?void 0:l.value)??s};function Se({title:t,value:s,fields:l,onChange:n,copyLabel:a,copyPayload:d,initialPosition:r}){const[o,h]=y.useState(r??{x:14,y:452}),x=y.useRef(null);y.useEffect(()=>{const g=u=>{x.current&&h({x:Math.max(8,u.clientX-x.current.x),y:Math.max(8,u.clientY-x.current.y)})},i=()=>{x.current=null,document.body.classList.remove("select-none")};return window.addEventListener("pointermove",g),window.addEventListener("pointerup",i),()=>{window.removeEventListener("pointermove",g),window.removeEventListener("pointerup",i)}},[]);const c=(g,i)=>{n({...s,[g]:i})},p=async()=>{var i;const g=(d==null?void 0:d(s))??{name:a??t,kind:"settings",settings:s};await((i=navigator.clipboard)==null?void 0:i.writeText(JSON.stringify(g,null,2)))},f=g=>{var u;const i=(u=g.currentTarget.parentElement)==null?void 0:u.parentElement;i&&(x.current={x:g.clientX-i.getBoundingClientRect().left,y:g.clientY-i.getBoundingClientRect().top},document.body.classList.add("select-none"))};return e.jsx("div",{style:{...Co,left:o.x,top:o.y},children:e.jsxs("div",{style:Ro,children:[e.jsxs("div",{style:Io,children:[e.jsxs("div",{style:Eo,children:[e.jsx("span",{style:To,onPointerDown:f,children:e.jsx(Wo,{})}),e.jsx(Lo,{}),e.jsx("span",{children:t})]}),e.jsx("button",{style:Mo,type:"button",onClick:p,children:"Copy"})]}),e.jsx("div",{style:zo,children:l.map(g=>{const i=s[g.key];if(g.type==="boolean")return e.jsxs("label",{style:ot,children:[e.jsx("span",{children:g.label}),e.jsx("input",{type:"checkbox",checked:!!i,onChange:u=>c(g.key,u.target.checked)})]},g.key);if(g.type==="number"){const u=Number(i),j=g.min??0,w=g.max??1,v=g.step??.01;return e.jsxs("label",{style:ot,children:[e.jsx("span",{children:g.label}),e.jsxs("div",{style:Fo,children:[e.jsx("input",{type:"range",min:j,max:w,step:v,value:u,onChange:M=>c(g.key,Number(M.target.value))}),e.jsx("input",{style:vt,type:"number",min:j,max:w,step:v,value:u,onChange:M=>c(g.key,Number(M.target.value))})]})]},g.key)}return g.type==="color"?e.jsxs("label",{style:ot,children:[e.jsx("span",{children:g.label}),e.jsx("input",{style:{...vt,padding:2},type:"color",value:String(i),onChange:u=>c(g.key,u.target.value)})]},g.key):g.type==="select"?e.jsxs("label",{style:ot,children:[e.jsx("span",{children:g.label}),e.jsx("select",{style:vt,value:String(i),onChange:u=>c(g.key,$o(g.options,u.target.value)),children:g.options.map(u=>e.jsx("option",{value:String(u.value),children:u.label},`${g.key}-${String(u.value)}`))})]},g.key):e.jsxs("label",{style:ot,children:[e.jsx("span",{children:g.label}),e.jsx("input",{style:vt,type:"text",value:String(i),onChange:u=>c(g.key,u.target.value)})]},g.key)})})]})})}const No=({title:t="Face Retouch",value:s,onChange:l,initialPosition:n})=>{const a=N.resolveFaceRetouchControls(s);return e.jsx(Se,{title:t,value:a,fields:N.FACE_RETOUCH_SETTINGS_FIELDS,onChange:d=>l(N.patchFaceRetouchControls(a,d)),initialPosition:n})},Oo=({title:t="Face Swap",value:s,onChange:l,source:n,initialPosition:a})=>{const d=N.resolveFaceSwapSettings(s,{source:n});return e.jsx(Se,{title:t,value:d,fields:N.FACE_SWAP_SETTINGS_FIELDS,onChange:r=>l(N.patchFaceSwapSettings(d,r)),initialPosition:a})},Ao=({title:t="Gesture",value:s,defaults:l,onChange:n,initialPosition:a})=>{const d=Ne.resolveGestureSettings(s,l);return e.jsx(Se,{title:t,value:d,fields:Ne.GESTURE_SETTINGS_FIELDS,onChange:r=>n(Ne.patchGestureSettings(d,r)),initialPosition:a})},Po=({title:t="Iris Effect",value:s,onChange:l,initialPosition:n})=>{const a=N.resolveIrisEffectSettings(s);return e.jsx(Se,{title:t,value:a,fields:N.IRIS_EFFECT_SETTINGS_FIELDS,onChange:d=>l(N.patchIrisEffectSettings(a,d)),initialPosition:n})},Do=({title:t="Lip Effect",value:s,onChange:l,initialPosition:n})=>{const a=N.resolveLipEffectSettings(s);return e.jsx(Se,{title:t,value:a,fields:N.LIP_EFFECT_SETTINGS_FIELDS,onChange:d=>l(N.patchLipEffectSettings(a,d)),initialPosition:n})},Bo=({title:t="Product hotspots",hotspots:s,placing:l,onPlacingChange:n,variants:a,initialPosition:d={x:16,y:16},docked:r=!1})=>{const[o,h]=y.useState(!1),x=async()=>{try{await navigator.clipboard.writeText(s.json),h(!0),setTimeout(()=>h(!1),1200)}catch{h(!1)}};return e.jsxs("div",{style:r?{...A.shell,...kt,position:"static"}:{...A.shell,left:d.x,top:d.y},children:[e.jsx("div",{style:A.header,children:t}),e.jsxs("div",{style:A.body,children:[a&&a.variants.length>0&&e.jsxs("label",{style:A.row,children:[e.jsx("span",{style:A.label,children:"variant"}),e.jsxs("select",{style:A.input,value:a.variant??"",onChange:c=>a.setVariant(c.target.value||null),children:[e.jsx("option",{value:"",children:"default"}),a.variants.map(c=>e.jsx("option",{value:c,children:c},c))]})]}),e.jsxs("div",{style:A.row,children:[e.jsx("button",{type:"button",style:{...A.button,...l?A.active:null},onClick:()=>n(!l),children:l?"placing: click the model":"place hotspot"}),e.jsx("button",{type:"button",style:A.button,onClick:()=>void x(),children:o?"copied":"copy JSON"}),e.jsx("button",{type:"button",style:A.button,onClick:s.clear,children:"clear"})]}),s.hotspots.length===0?e.jsx("div",{style:A.hint,children:"no hotspots yet"}):s.hotspots.map(c=>e.jsxs("div",{style:A.item,children:[e.jsx("input",{style:{...A.input,flex:1},value:c.label??"",placeholder:c.id,onChange:p=>s.update(c.id,{label:p.target.value})}),e.jsx("span",{style:A.coord,children:c.position.map(p=>p.toFixed(2)).join(", ")}),e.jsx("button",{type:"button",style:A.button,onClick:()=>s.remove(c.id),children:"×"})]},c.id))]})]})},A={shell:{position:"fixed",zIndex:2e4,width:300,maxHeight:"min(560px, calc(100vh - 32px))",overflow:"auto",borderRadius:16,border:"1px solid rgba(255,255,255,0.12)",background:"rgba(8, 15, 28, 0.72)",boxShadow:"0 16px 36px rgba(0,0,0,0.28)",backdropFilter:"blur(20px) saturate(1.1)",color:"#f8fafc",fontFamily:"ui-monospace, SFMono-Regular, Menlo, monospace",fontSize:11},header:{padding:"8px 10px",fontWeight:700,borderBottom:"1px solid rgba(255,255,255,0.08)"},body:{padding:"6px 10px 10px"},row:{display:"flex",gap:6,alignItems:"center",margin:"4px 0",flexWrap:"wrap"},label:{color:"#94a3b8"},input:{font:"inherit",background:"#0b1220",color:"#f8fafc",border:"1px solid #334155",borderRadius:4,padding:"3px 6px"},button:{background:"rgba(255,255,255,0.08)",border:"1px solid rgba(255,255,255,0.18)",color:"#f8fafc",borderRadius:6,padding:"4px 8px",cursor:"pointer",font:"inherit"},active:{borderColor:"#22d3ee",color:"#22d3ee"},hint:{color:"#94a3b8"},item:{display:"flex",gap:6,alignItems:"center",margin:"4px 0"},coord:{color:"#94a3b8",whiteSpace:"nowrap"}},rt={ready:"#4ade80",loading:"#facc15",paused:"#93c5fd",unavailable:"#64748b",error:"#f87171"},He=(t,s=0,l="")=>t==null||Number.isNaN(t)?"–":`${t.toFixed(s)}${l}`,X=({label:t,value:s,color:l})=>e.jsxs("div",{style:V.row,children:[e.jsx("span",{style:V.rowLabel,children:t}),e.jsx("span",{style:{...V.rowValue,color:l??V.rowValue.color},children:s})]}),Vo=({title:t="XR Diagnostics",intervalMs:s=250,models:l,initialPosition:n={x:16,y:16},docked:a=!1,defaultCollapsed:d=!1,onSample:r})=>{const o=$e.useXRDiagnostics({intervalMs:s,models:l}),[h,x]=y.useState(d);r==null||r(o);const{session:c}=o;return e.jsxs("div",{style:a?{...V.shell,...kt,position:"static"}:{...V.shell,left:n.x,top:n.y},"data-testid":"xr-diagnostics-panel",children:[e.jsxs("div",{style:V.header,children:[e.jsx("span",{style:V.title,children:t}),e.jsx("button",{type:"button",onClick:()=>x(p=>!p),style:V.toggle,"aria-label":h?"Expand diagnostics":"Collapse diagnostics",children:h?"+":"–"})]}),!h&&e.jsxs("div",{style:V.body,children:[e.jsx("div",{style:V.section,children:"session"}),e.jsx(X,{label:"lifecycle",value:c.lifecycle,color:c.lifecycle==="running"?rt.ready:rt.paused}),e.jsx(X,{label:"ready",value:c.ready?"yes":"no"}),e.jsx(X,{label:"source",value:`${c.source??"–"} / ${c.sourceKind??"–"}`}),e.jsx(X,{label:"camera",value:c.sourceWidth?`${c.sourceWidth}×${c.sourceHeight}`:"unbound"}),e.jsx(X,{label:"feed",value:c.renderWidth?`${c.renderWidth}×${c.renderHeight} @ ${He(c.feedFps,0)} fps`:"–"}),e.jsx(X,{label:"inference",value:He(o.inferenceMsTotal,1," ms / frame")}),o.quality&&e.jsx(X,{label:"quality",value:`${o.quality.tier} (${o.quality.reason})${o.quality.locked?" · locked":""}`}),c.error&&e.jsx(X,{label:"error",value:`${c.error.reason}`,color:rt.error}),o.models.map(p=>e.jsxs("div",{style:V.model,children:[e.jsxs("div",{style:V.modelHeader,children:[e.jsx("span",{style:V.modelName,children:p.label}),e.jsx("span",{style:{...V.badge,color:rt[p.state]},children:p.state})]}),p.state!=="unavailable"&&e.jsxs(e.Fragment,{children:[e.jsx(X,{label:"inference",value:`${He(p.inferenceMs,1," ms")} · ${He(p.inferenceFps,0)} fps${p.targetFps?` (cap ${p.targetFps})`:""}`}),e.jsx(X,{label:"frames",value:`${p.inferences} run · ${p.skippedFrames} skipped`}),e.jsx(X,{label:"detections",value:`${He(p.detections)} · conf ${He(p.confidence,2)}`}),e.jsx(X,{label:"owners",value:`${p.owners.refs.length} (${p.owners.active.length} active)`})]}),p.error&&e.jsx(X,{label:"error",value:p.error.message,color:rt.error})]},p.model))]})]})},V={shell:{position:"fixed",zIndex:2e4,width:284,maxHeight:"min(640px, calc(100vh - 32px))",overflow:"auto",borderRadius:16,border:"1px solid rgba(255,255,255,0.12)",background:"rgba(8, 15, 28, 0.72)",boxShadow:"0 16px 36px rgba(0,0,0,0.28)",backdropFilter:"blur(20px) saturate(1.1)",WebkitBackdropFilter:"blur(20px) saturate(1.1)",color:"#f8fafc",fontFamily:"ui-monospace, SFMono-Regular, Menlo, monospace",fontSize:11},header:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 10px",borderBottom:"1px solid rgba(255,255,255,0.08)",background:"rgba(8, 15, 28, 0.88)",position:"sticky",top:0},title:{fontWeight:700},toggle:{background:"transparent",border:"1px solid rgba(255,255,255,0.2)",color:"#f8fafc",borderRadius:6,width:22,height:22,cursor:"pointer"},body:{padding:"6px 10px 10px"},section:{color:"#94a3b8",textTransform:"uppercase",fontSize:9,letterSpacing:1,margin:"6px 0 2px"},row:{display:"flex",justifyContent:"space-between",gap:8,padding:"2px 0"},rowLabel:{color:"#94a3b8"},rowValue:{color:"#e2e8f0",textAlign:"right",overflowWrap:"anywhere"},model:{marginTop:8,paddingTop:6,borderTop:"1px solid rgba(255,255,255,0.08)"},modelHeader:{display:"flex",justifyContent:"space-between",alignItems:"center"},modelName:{fontWeight:700},badge:{fontSize:10,textTransform:"uppercase",letterSpacing:.5}},Ko=({title:t="Holistic Tracker",value:s,onChange:l,initialPosition:n})=>{const a=Ne.resolveHolisticTrackerSettings(s);return e.jsx(Se,{title:t,value:a,fields:Ne.HOLISTIC_TRACKER_SETTINGS_FIELDS,onChange:d=>l(Ne.patchHolisticTrackerSettings(a,d)),initialPosition:n})},Ho=({title:t="Segmentation Overlay",value:s,onChange:l,initialPosition:n})=>{const a=It.resolveSegmentationOverlaySettings(s);return e.jsx(Se,{title:t,value:a,fields:It.SEGMENTATION_OVERLAY_SETTINGS_FIELDS,onChange:d=>l(It.patchSegmentationOverlaySettings(a,d)),initialPosition:n})},Go={position:"fixed",left:14,top:104,zIndex:2e4,pointerEvents:"none"},_o={pointerEvents:"auto",width:298,borderRadius:16,border:"1px solid rgba(255,255,255,0.12)",background:"rgba(8, 15, 28, 0.58)",boxShadow:"0 16px 36px rgba(0,0,0,0.28)",backdropFilter:"blur(20px) saturate(1.1)",WebkitBackdropFilter:"blur(20px) saturate(1.1)",color:"#f8fafc",overflow:"hidden"},Uo={display:"flex",alignItems:"center",gap:7,padding:"7px 8px",borderBottom:"1px solid rgba(255,255,255,0.08)",background:"rgba(8, 15, 28, 0.88)"},Xo={display:"grid",gap:8,padding:8},Ns={display:"flex",alignItems:"center",gap:6,fontSize:11,fontWeight:700},Os={display:"flex",width:18,height:18,alignItems:"center",justifyContent:"center",borderRadius:6,background:"rgba(255,255,255,0.08)",border:"1px solid rgba(255,255,255,0.08)",color:"#e2e8f0"},Zo={width:16,height:16,display:"flex",alignItems:"center",justifyContent:"center",cursor:"grab",color:"rgba(148,163,184,0.82)"},Yo={display:"grid",gridTemplateColumns:"minmax(0, 1fr) 30px",gap:6},qo={width:"100%",height:26,borderRadius:8,border:"1px solid rgba(255,255,255,0.12)",background:"rgba(56,189,248,0.16)",color:"#e0f2fe",fontSize:10.5,fontWeight:700,cursor:"pointer"},Jo={display:"inline-flex",alignItems:"center",justifyContent:"center",width:24,height:24,borderRadius:8,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(255,255,255,0.05)",color:"#e2e8f0",cursor:"pointer",padding:0},Qo=t=>({...Jo,width:30,height:26,color:t?"#e0f2fe":"rgba(148,163,184,0.72)",background:t?"rgba(56,189,248,0.16)":"rgba(255,255,255,0.04)"}),er={borderRadius:12,border:"1px solid rgba(255,255,255,0.08)",background:"rgba(255,255,255,0.03)",padding:8},tr={display:"grid",gridTemplateColumns:"repeat(2, minmax(0, 1fr))",gap:6},sr={display:"grid",gridTemplateColumns:"repeat(3, minmax(0, 1fr))",gap:6},nr={display:"flex",alignItems:"center",justifyContent:"space-between",gap:8,marginBottom:7},lr={display:"grid",gridTemplateColumns:"62px repeat(3, minmax(0, 1fr)) 24px",alignItems:"center",gap:6,marginTop:6},ir={fontSize:10,color:"rgba(226,232,240,0.82)"},or=t=>({display:"inline-flex",alignItems:"center",justifyContent:"center",width:24,height:22,borderRadius:7,border:t?"1px solid rgba(125,211,252,0.72)":"1px solid rgba(255,255,255,0.10)",background:t?"rgba(56,189,248,0.20)":"rgba(255,255,255,0.05)",color:t?"#e0f2fe":"rgba(226,232,240,0.75)",cursor:"pointer"}),ys={display:"flex",flexDirection:"column",gap:4,fontSize:9,color:"rgba(226,232,240,0.72)"},rr={width:"100%",height:24,borderRadius:7,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(15,23,42,0.68)",color:"#f8fafc",fontSize:10.5,outline:"none",padding:"0 7px",boxSizing:"border-box",fontVariantNumeric:"tabular-nums"},ar={display:"flex",alignItems:"center",justifyContent:"space-between",gap:8,fontSize:9,color:"rgba(226,232,240,0.72)"},As={width:15,height:15,accentColor:"#38bdf8",cursor:"pointer"},bs=t=>({height:25,borderRadius:8,border:t?"1px solid rgba(125,211,252,0.72)":"1px solid rgba(255,255,255,0.10)",background:t?"rgba(56,189,248,0.20)":"rgba(255,255,255,0.05)",color:t?"#e0f2fe":"rgba(226,232,240,0.82)",fontSize:10,fontWeight:700,cursor:"pointer"}),dr=t=>/^-?\d*(\.\d*)?$/.test(t),cr=({value:t,onChange:s,step:l=.1})=>{const[n,a]=y.useState(String(t));return y.useEffect(()=>a(String(t)),[t]),e.jsx("input",{type:"text",inputMode:"decimal",style:rr,value:n,onChange:d=>{const r=d.target.value;if(!dr(r)||(a(r),r===""||r==="-"||r==="."||r==="-."))return;const o=Number(r);Number.isNaN(o)||s(o)},onBlur:()=>{const d=Number(n);if(Number.isNaN(d)){a(String(t));return}s(d)},onKeyDown:d=>{if(d.key!=="ArrowUp"&&d.key!=="ArrowDown")return;d.preventDefault();const r=d.shiftKey?l*10:d.altKey?l/10:l,o=d.key==="ArrowUp"?t+r:t-r;s(Number(o.toFixed(6)))}})},Ps=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M4 4h6v2H7.4l3.3 3.3-1.4 1.4L6 7.4V10H4V4zm10 0h6v6h-2V7.4l-3.3 3.3-1.4-1.4L16.6 6H14V4zM9.3 13.3l1.4 1.4L7.4 18H10v2H4v-6h2v2.6l3.3-3.3zm5.4 0 3.3 3.3V14h2v6h-6v-2h2.6l-3.3-3.3 1.4-1.4z"})}),pr=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M7 12a5 5 0 0 1 5-5h3v2h-3a3 3 0 0 0 0 6h3v2h-3a5 5 0 0 1-5-5zm4-1h2v2h-2v-2zm-2 6H6a5 5 0 0 1 0-10h3v2H6a3 3 0 0 0 0 6h3v2zm6-10h3a5 5 0 0 1 0 10h-3v-2h3a3 3 0 0 0 0-6h-3V7z"})}),hr=()=>e.jsx("svg",{width:"11",height:"15",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M8 6a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM8 12a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM8 18a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM16 6a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM16 12a2 2 0 1 1-4 0 2 2 0 0 1 4 0zM16 18a2 2 0 1 1-4 0 2 2 0 0 1 4 0z"})}),xr=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M12 5c5 0 8.7 4.2 10 7-1.3 2.8-5 7-10 7s-8.7-4.2-10-7c1.3-2.8 5-7 10-7zm0 2c-3.6 0-6.4 2.7-7.7 5 1.3 2.3 4.1 5 7.7 5s6.4-2.7 7.7-5C18.4 9.7 15.6 7 12 7zm0 2.5a2.5 2.5 0 1 1 0 5 2.5 2.5 0 0 1 0-5z"})}),ur=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M3.3 2 22 20.7 20.7 22l-3.1-3.1A10.5 10.5 0 0 1 12 20c-5 0-8.7-4.2-10-7a16.4 16.4 0 0 1 4-4.9L2 3.3 3.3 2zm4.1 7.5A14.4 14.4 0 0 0 4.3 13c1.3 2.3 4.1 5 7.7 5 1.5 0 2.8-.5 4-1.2l-2.1-2.1A2.5 2.5 0 0 1 9.3 10L7.4 9.5zM12 4c5 0 8.7 4.2 10 7a15 15 0 0 1-3.2 4.2l-1.4-1.4A13 13 0 0 0 19.7 11C18.4 8.7 15.6 6 12 6c-.9 0-1.8.2-2.6.5L7.8 4.9C9.1 4.3 10.5 4 12 4z"})}),gr=({value:t,onChange:s})=>{const l=t.transformControlMode??"translate",n=t.transformControlSpace??"local",a=t.showTransformControls??!1;return e.jsxs("div",{style:{marginTop:8},children:[e.jsxs("label",{style:ar,children:[e.jsx("span",{children:"Show Transform On"}),e.jsx("input",{type:"checkbox",checked:a,style:As,onChange:d=>s({...t,showTransformControls:d.currentTarget.checked})})]}),e.jsxs("div",{style:{...ys,marginTop:8},children:["Mode",e.jsx("div",{style:sr,children:["translate","rotate","scale"].map(d=>e.jsx("button",{type:"button",style:bs(l===d),onClick:()=>s({...t,transformControlMode:d}),children:d==="translate"?"Move":d==="rotate"?"Rotate":"Scale"},d))})]}),e.jsxs("div",{style:{...ys,marginTop:8},children:["Space",e.jsx("div",{style:tr,children:["local","world"].map(d=>e.jsx("button",{type:"button",style:bs(n===d),onClick:()=>s({...t,transformControlSpace:d}),children:d==="local"?"Local":"World"},d))})]})]})},_t=({value:t,onChange:s})=>{var d,r,o;const l={position:((d=t.linked)==null?void 0:d.position)??!1,rotation:((r=t.linked)==null?void 0:r.rotation)??!1,scale:((o=t.linked)==null?void 0:o.scale)??!1},n=(h,x)=>{const c=t[h];s({...t,linked:{...l,[h]:x},[h]:x?{x:c.x,y:c.x,z:c.x}:c})},a=(h,x,c,p)=>e.jsxs("div",{style:lr,children:[e.jsx("div",{style:ir,children:x}),["x","y","z"].map(f=>e.jsx(cr,{value:c[f],step:p,onChange:g=>l[h]?s({...t,[h]:{x:g,y:g,z:g}}):s({...t,[h]:{...c,[f]:g}})},f)),e.jsx("button",{type:"button","aria-label":l[h]?`Unlink ${x}`:`Link ${x}`,title:l[h]?`Unlink ${x}`:`Link ${x}`,style:or(l[h]),onClick:()=>n(h,!l[h]),children:e.jsx(pr,{})})]});return e.jsxs("div",{style:er,children:[e.jsxs("div",{style:nr,children:[e.jsxs("div",{style:Ns,children:[e.jsx("span",{style:Os,children:e.jsx(Ps,{})}),e.jsx("span",{children:"Transform"})]}),e.jsx("input",{type:"checkbox",checked:t.enabled,style:As,onChange:h=>s({...t,enabled:h.currentTarget.checked})})]}),a("position","Position",t.position,.001),a("rotation","Rotation",t.rotation,1),a("scale","Scale",t.scale),e.jsx(gr,{value:t,onChange:s})]})},yr=({value:t,onChange:s,copyLabel:l="Selected transform"})=>{const[n,a]=y.useState({x:14,y:104}),[d,r]=y.useState(!1),o=y.useRef(null);y.useEffect(()=>{const c=f=>{o.current&&a({x:Math.max(8,f.clientX-o.current.x),y:Math.max(8,f.clientY-o.current.y)})},p=()=>{o.current=null,document.body.classList.remove("select-none")};return window.addEventListener("pointermove",c),window.addEventListener("pointerup",p),()=>{window.removeEventListener("pointermove",c),window.removeEventListener("pointerup",p)}},[]);const h=c=>{const p=c.currentTarget.getBoundingClientRect();o.current={x:c.clientX-p.left,y:c.clientY-p.top},document.body.classList.add("select-none"),c.currentTarget.setPointerCapture(c.pointerId)},x=async()=>{await navigator.clipboard.writeText(JSON.stringify({name:l,kind:"transform3D",transform:t},null,2)),r(!0),window.setTimeout(()=>r(!1),1200)};return typeof document>"u"?null:Ae.createPortal(e.jsx("div",{style:{...Go,left:n.x,top:n.y},children:e.jsxs("div",{style:_o,children:[e.jsxs("div",{style:Uo,children:[e.jsx("div",{onPointerDown:h,style:Zo,children:e.jsx(hr,{})}),e.jsxs("div",{style:Ns,children:[e.jsx("span",{style:Os,children:e.jsx(Ps,{})}),e.jsx("span",{children:"Transform"})]})]}),e.jsxs("div",{style:Xo,children:[e.jsxs("div",{style:Yo,children:[e.jsx("button",{type:"button",style:qo,onClick:x,children:d?"Copied Config":"Copy Config"}),e.jsx("button",{type:"button","aria-label":t.visible?"Hide Transform":"Show Transform",title:t.visible?"Hide Transform":"Show Transform",style:Qo(t.visible),onClick:()=>s({...t,visible:!t.visible}),children:t.visible?e.jsx(xr,{}):e.jsx(ur,{})})]}),e.jsx(_t,{value:t,onChange:s})]})]})}),document.body)},br={borderRadius:12,border:"1px solid rgba(255,255,255,0.08)",background:"rgba(255,255,255,0.03)",padding:8},fr={display:"flex",alignItems:"center",gap:6,marginBottom:7,fontSize:11,fontWeight:700},jr={display:"flex",width:18,height:18,alignItems:"center",justifyContent:"center",borderRadius:6,background:"rgba(255,255,255,0.08)",border:"1px solid rgba(255,255,255,0.08)",color:"#e2e8f0"},fs={display:"grid",gridTemplateColumns:"repeat(2, minmax(0, 1fr))",gap:6},q={display:"flex",flexDirection:"column",gap:4,fontSize:9,color:"rgba(226,232,240,0.72)"},Ut={width:"100%",height:24,borderRadius:7,border:"1px solid rgba(255,255,255,0.10)",background:"rgba(15,23,42,0.68)",color:"#f8fafc",fontSize:10.5,outline:"none",padding:"0 7px",boxSizing:"border-box"},Ge={...Ut,cursor:"pointer"},de={display:"flex",alignItems:"center",justifyContent:"space-between",gap:8,height:24,fontSize:9,color:"rgba(226,232,240,0.72)"},ce={width:15,height:15,accentColor:"#38bdf8",cursor:"pointer"},mr={marginTop:10,paddingTop:10,borderTop:"1px solid rgba(255,255,255,0.08)"},Sr={marginBottom:7,fontSize:10,fontWeight:700,letterSpacing:"0.06em",textTransform:"uppercase",color:"rgba(226,232,240,0.74)"},vr=()=>e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"m12 2 8 4.6v10.8L12 22l-8-4.6V6.6L12 2zm0 2.3L6.3 7.6 12 10.9l5.7-3.3L12 4.3zM6 9.3v6.9l5 2.9v-6.9L6 9.3zm12 0-5 2.9v6.9l5-2.9V9.3z"})}),wr=(t,s,l)=>Math.min(l,Math.max(s,t)),at=({max:t,min:s,onChange:l,step:n,value:a})=>e.jsx("input",{type:"number",min:s,max:t,step:n??.01,style:Ut,value:a,onChange:d=>{const r=Number(d.currentTarget.value);Number.isNaN(r)||l(wr(r,s??Number.NEGATIVE_INFINITY,t??Number.POSITIVE_INFINITY))}}),Ds=({value:t,onChange:s})=>{const l=o=>{s({...t,material:{...t.material,...o}})},n=_s.normalizeMeshRendererRenderState(t.material.renderState),a=o=>{l({renderState:{...n,...o,colorMask:{...n.colorMask,...o.colorMask},polygonOffset:{...n.polygonOffset,...o.polygonOffset}}})},d=o=>{a({polygonOffset:{...n.polygonOffset,...o}})},r=o=>{a({colorMask:{...n.colorMask,...o}})};return e.jsxs("div",{style:br,children:[e.jsxs("div",{style:fr,children:[e.jsx("span",{style:jr,children:e.jsx(vr,{})}),e.jsx("span",{children:"Mesh Renderer"})]}),e.jsxs("div",{style:fs,children:[e.jsxs("label",{style:q,children:["Mesh",e.jsxs("select",{style:Ge,value:t.mesh,onChange:o=>s({...t,mesh:o.currentTarget.value}),children:[e.jsx("option",{value:"cube",children:"Cube"}),e.jsx("option",{value:"sphere",children:"Sphere"}),e.jsx("option",{value:"plane",children:"Plane"})]})]}),e.jsxs("label",{style:q,children:["Material",e.jsxs("select",{style:Ge,value:t.material.type,onChange:o=>l({type:o.currentTarget.value}),children:[e.jsx("option",{value:"standard",children:"Standard"}),e.jsx("option",{value:"basic",children:"Basic"})]})]}),e.jsxs("label",{style:q,children:["Color",e.jsx("input",{type:"color",style:{...Ut,padding:2},value:t.material.color,onChange:o=>l({color:o.currentTarget.value})})]}),e.jsxs("label",{style:q,children:["Opacity",e.jsx(at,{min:0,max:1,step:.01,value:t.material.opacity,onChange:o=>l({opacity:o})})]}),e.jsxs("label",{style:q,children:["Roughness",e.jsx(at,{min:0,max:1,step:.01,value:t.material.roughness,onChange:o=>l({roughness:o})})]}),e.jsxs("label",{style:q,children:["Metalness",e.jsx(at,{min:0,max:1,step:.01,value:t.material.metalness,onChange:o=>l({metalness:o})})]}),e.jsxs("label",{style:q,children:["Shadow Mode",e.jsxs("select",{style:Ge,value:t.shadowMode,onChange:o=>s({...t,shadowMode:o.currentTarget.value}),children:[e.jsx("option",{value:"off",children:"Off"}),e.jsx("option",{value:"cast",children:"Cast"}),e.jsx("option",{value:"receive",children:"Receive"}),e.jsx("option",{value:"castReceive",children:"Cast + Receive"})]})]}),e.jsxs("label",{style:de,children:["Wireframe",e.jsx("input",{type:"checkbox",checked:t.material.wireframe,style:ce,onChange:o=>l({wireframe:o.currentTarget.checked})})]})]}),e.jsxs("div",{style:mr,children:[e.jsx("div",{style:Sr,children:"Render State"}),e.jsxs("div",{style:fs,children:[e.jsxs("label",{style:de,children:["Depth Test",e.jsx("input",{type:"checkbox",checked:n.depthTest,style:ce,onChange:o=>a({depthTest:o.currentTarget.checked})})]}),e.jsxs("label",{style:de,children:["Depth Write",e.jsx("input",{type:"checkbox",checked:n.depthWrite,style:ce,onChange:o=>a({depthWrite:o.currentTarget.checked})})]}),e.jsxs("label",{style:q,children:["Depth Function",e.jsxs("select",{style:Ge,value:n.depthFunc,onChange:o=>a({depthFunc:o.currentTarget.value}),children:[e.jsx("option",{value:"never",children:"Never"}),e.jsx("option",{value:"less",children:"Less"}),e.jsx("option",{value:"equal",children:"Equal"}),e.jsx("option",{value:"lessEqual",children:"Less Equal"}),e.jsx("option",{value:"greater",children:"Greater"}),e.jsx("option",{value:"notEqual",children:"Not Equal"}),e.jsx("option",{value:"greaterEqual",children:"Greater Equal"}),e.jsx("option",{value:"always",children:"Always"})]})]}),e.jsxs("label",{style:de,children:["Color Write",e.jsx("input",{type:"checkbox",checked:n.colorWrite,style:ce,onChange:o=>a({colorWrite:o.currentTarget.checked})})]}),e.jsxs("label",{style:de,children:["Mask R",e.jsx("input",{type:"checkbox",checked:n.colorMask.r,style:ce,onChange:o=>r({r:o.currentTarget.checked})})]}),e.jsxs("label",{style:de,children:["Mask G",e.jsx("input",{type:"checkbox",checked:n.colorMask.g,style:ce,onChange:o=>r({g:o.currentTarget.checked})})]}),e.jsxs("label",{style:de,children:["Mask B",e.jsx("input",{type:"checkbox",checked:n.colorMask.b,style:ce,onChange:o=>r({b:o.currentTarget.checked})})]}),e.jsxs("label",{style:de,children:["Mask A",e.jsx("input",{type:"checkbox",checked:n.colorMask.a,style:ce,onChange:o=>r({a:o.currentTarget.checked})})]}),e.jsxs("label",{style:q,children:["Cull Mode",e.jsxs("select",{style:Ge,value:n.cullMode,onChange:o=>a({cullMode:o.currentTarget.value}),children:[e.jsx("option",{value:"back",children:"Back"}),e.jsx("option",{value:"front",children:"Front"}),e.jsx("option",{value:"off",children:"Off"})]})]}),e.jsxs("label",{style:q,children:["Blend Mode",e.jsxs("select",{style:Ge,value:n.blendMode,onChange:o=>a({blendMode:o.currentTarget.value}),children:[e.jsx("option",{value:"normal",children:"Normal"}),e.jsx("option",{value:"additive",children:"Additive"}),e.jsx("option",{value:"subtractive",children:"Subtractive"}),e.jsx("option",{value:"multiply",children:"Multiply"}),e.jsx("option",{value:"none",children:"None"})]})]}),e.jsxs("label",{style:de,children:["Polygon Offset",e.jsx("input",{type:"checkbox",checked:n.polygonOffset.enabled,style:ce,onChange:o=>d({enabled:o.currentTarget.checked})})]}),e.jsxs("label",{style:q,children:["Offset Factor",e.jsx(at,{step:.1,value:n.polygonOffset.factor,onChange:o=>d({factor:o})})]}),e.jsxs("label",{style:q,children:["Offset Units",e.jsx(at,{step:.1,value:n.polygonOffset.units,onChange:o=>d({units:o})})]})]})]})]})},kr={borderRadius:12,border:"1px solid rgba(255,255,255,0.08)",background:"rgba(255,255,255,0.03)",padding:"8px 8px 56px"},Cr={marginBottom:7,fontSize:11,fontWeight:700},Rr={marginTop:10,paddingTop:10,borderTop:"1px solid rgba(255,255,255,0.08)"},Ir={marginBottom:7,fontSize:10,fontWeight:700,letterSpacing:"0.06em",textTransform:"uppercase",color:"rgba(226,232,240,0.74)"},T={display:"grid",gridTemplateColumns:"92px minmax(0, 1fr)",alignItems:"center",gap:10,margin:"8px 0",color:"#cbd5e1",fontSize:12},he={width:"100%",boxSizing:"border-box",padding:"8px 9px",border:"1px solid rgba(148,163,184,.16)",borderRadius:6,background:"rgba(15,23,42,.72)",color:"#e2e8f0"},Er={display:"grid",gridTemplateColumns:"repeat(2, minmax(0, 1fr))",gap:6,marginTop:8,color:"#cbd5e1",fontSize:11},ye=({max:t,min:s,onChange:l,step:n,value:a})=>e.jsx("input",{type:"number",min:s,max:t,step:n??1,style:he,value:a,onChange:d=>{const r=Number(d.currentTarget.value);Number.isNaN(r)||l(r)}}),Me=({onChange:t,options:s,value:l})=>e.jsx("select",{style:he,value:l,onChange:n=>t(n.currentTarget.value),children:s.map(n=>e.jsx("option",{value:n.value,children:n.label},n.value))}),dt=({children:t,title:s})=>e.jsxs("div",{style:Rr,children:[e.jsx("div",{style:Ir,children:s}),t]}),Xt=({onChange:t,value:s})=>{const l=p=>t(J.resolveFaceMeshRendererSettings(s,p)),n=J.supportsTexturePanel(s.materialType,s.shaderPreset),a=J.supportsBlendMode(s.materialType,s.shaderPreset,s.textureMap),d=s.materialType===J.FACE_MESH_MATERIAL_TYPES.shader&&s.shaderPreset===J.FACE_MESH_SHADER_PRESETS.composite?N.textureMapOptions.filter(p=>p.value!==J.FACE_MESH_TEXTURE_MAPS.none):N.textureMapOptions,r=J.usesMaskColor(s.maskTextureSource),o=J.usesMaskSourceUrl(s.maskTextureSource),h=p=>{l({shaderPreset:p})},x=p=>{l({materialType:p})},c=e.jsxs(dt,{title:"Geometry",children:[e.jsxs("div",{style:Er,children:[e.jsxs("label",{children:[e.jsx("input",{type:"checkbox",checked:s.showLeftEyeGeometry,onChange:p=>l({showLeftEyeGeometry:p.currentTarget.checked})})," ","Left Eye"]}),e.jsxs("label",{children:[e.jsx("input",{type:"checkbox",checked:s.showRightEyeGeometry,onChange:p=>l({showRightEyeGeometry:p.currentTarget.checked})})," ","Right Eye"]}),e.jsxs("label",{children:[e.jsx("input",{type:"checkbox",checked:s.showNoseGeometry,onChange:p=>l({showNoseGeometry:p.currentTarget.checked})})," ","Nose"]}),e.jsxs("label",{children:[e.jsx("input",{type:"checkbox",checked:s.showMouthGeometry,onChange:p=>l({showMouthGeometry:p.currentTarget.checked})})," ","Mouth"]})]}),e.jsxs("label",{style:T,children:[e.jsx("span",{children:"Show Overlay Mask"}),e.jsx("input",{type:"checkbox",checked:s.showOverlayMask,onChange:p=>l({showOverlayMask:p.currentTarget.checked})})]}),e.jsxs("label",{style:T,children:[e.jsx("span",{children:"Source"}),e.jsx(Me,{value:s.maskTextureSource,options:N.maskTextureSourceOptions,onChange:p=>l({maskTextureSource:p})})]}),o?e.jsxs("label",{style:T,children:[e.jsx("span",{children:"URL"}),e.jsx("input",{type:"url",style:he,value:s.maskSourceUrl,onChange:p=>l({maskSourceUrl:p.currentTarget.value})})]}):null,r?e.jsxs("label",{style:T,children:[e.jsx("span",{children:"Color"}),e.jsx("input",{type:"color",style:{...he,padding:2},value:s.maskColor,onChange:p=>l({maskColor:p.currentTarget.value})})]}):null,e.jsxs("label",{style:T,children:[e.jsx("span",{children:"Overlay Opacity"}),e.jsx(ye,{min:0,max:1,step:.1,value:s.maskOpacity,onChange:p=>l({maskOpacity:p})})]})]});return e.jsxs("section",{style:kr,children:[e.jsxs("label",{style:{...Cr,display:"flex",justifyContent:"space-between"},children:[e.jsx("span",{children:"Face Mesh Renderer"}),e.jsx("input",{type:"checkbox",checked:s.enabled,onChange:p=>l({enabled:p.currentTarget.checked})})]}),e.jsxs(dt,{title:"Renderer",children:[e.jsxs("label",{style:T,children:[e.jsx("span",{children:"Face Index"}),e.jsx(ye,{min:0,step:1,value:s.faceIndex,onChange:p=>l({faceIndex:p})})]}),e.jsxs("label",{style:T,children:[e.jsx("span",{children:"Target FPS"}),e.jsx(ye,{min:1,step:1,value:s.targetFps??24,onChange:p=>l({targetFps:p})})]}),e.jsxs("label",{style:T,children:[e.jsx("span",{children:"Render Order"}),e.jsx(ye,{step:1,value:s.renderOrder,onChange:p=>l({renderOrder:p})})]}),e.jsxs("label",{style:T,children:[e.jsx("span",{children:"External Mesh"}),e.jsx("input",{type:"url",style:he,value:s.externalMeshUrl??"",onChange:p=>l({externalMeshUrl:p.currentTarget.value||void 0})})]}),e.jsxs("label",{style:T,children:[e.jsx("span",{children:"Mesh Scale"}),e.jsx(ye,{min:.01,step:.01,value:s.externalScale,onChange:p=>l({externalScale:p})})]})]}),c,e.jsxs(dt,{title:"Material",children:[e.jsxs("label",{style:T,children:[e.jsx("span",{children:"Type"}),e.jsx(Me,{value:s.materialType,options:N.materialTypeOptions,onChange:x})]}),s.materialType===J.FACE_MESH_MATERIAL_TYPES.shader?e.jsxs("label",{style:T,children:[e.jsx("span",{children:"Shader"}),e.jsx(Me,{value:s.shaderPreset,options:N.shaderPresetOptions,onChange:h})]}):null,e.jsxs("label",{style:T,children:[e.jsx("span",{children:"Base Color"}),e.jsx("input",{type:"color",style:{...he,padding:2},value:s.baseColor,onChange:p=>l({baseColor:p.currentTarget.value})})]}),e.jsxs("label",{style:T,children:[e.jsx("span",{children:"Material Opacity"}),e.jsx(ye,{min:0,max:1,step:.01,value:s.opacity,onChange:p=>l({opacity:p})})]}),e.jsxs("label",{style:T,children:[e.jsx("span",{children:"Side"}),e.jsx(Me,{value:s.side,options:N.sideOptions,onChange:p=>l({side:p})})]})]}),n?e.jsxs(dt,{title:"Texture",children:[e.jsxs("label",{style:T,children:[e.jsx("span",{children:"Map"}),e.jsx(Me,{value:s.textureMap,options:d,onChange:p=>l({textureMap:p})})]}),s.textureMap===J.FACE_MESH_TEXTURE_MAPS.canonical?e.jsxs("label",{style:T,children:[e.jsx("span",{children:"Face URL"}),e.jsx("input",{type:"url",style:he,value:s.faceTextureUrl,onChange:p=>l({faceTextureUrl:p.currentTarget.value})})]}):null,s.textureMap===J.FACE_MESH_TEXTURE_MAPS.style2?e.jsxs("label",{style:T,children:[e.jsx("span",{children:"Style URL"}),e.jsx("input",{type:"url",style:he,value:s.faceTextureStyle2Url,onChange:p=>l({faceTextureStyle2Url:p.currentTarget.value})})]}):null,e.jsxs("label",{style:T,children:[e.jsx("span",{children:"Material Alpha"}),e.jsx(Me,{value:s.alphaMap,options:N.alphaMapOptions,onChange:p=>l({alphaMap:p})})]}),e.jsxs("label",{style:T,children:[e.jsx("span",{children:"Alpha Texture URL"}),e.jsx("input",{type:"url",style:he,value:s.faceAlphaMaskUrl,onChange:p=>l({faceAlphaMaskUrl:p.currentTarget.value})})]}),e.jsxs("label",{style:T,children:[e.jsx("span",{children:"Alpha Strength"}),e.jsx(ye,{min:0,max:1,step:.01,value:s.alphaOpacity,onChange:p=>l({alphaOpacity:p})})]})]}):null,a?e.jsxs(dt,{title:"Blend",children:[e.jsxs("label",{style:T,children:[e.jsx("span",{children:"Mode"}),e.jsx(Me,{value:s.blendMode,options:N.blendModeOptions,onChange:p=>l({blendMode:p})})]}),e.jsxs("label",{style:T,children:[e.jsx("span",{children:"Blend Strength"}),e.jsx(ye,{min:0,max:1,step:.01,value:s.blendOpacity,onChange:p=>l({blendOpacity:p})})]}),e.jsxs("label",{style:T,children:[e.jsx("span",{children:"Composite"}),e.jsx("input",{type:"checkbox",checked:s.compositeShading,onChange:p=>l({compositeShading:p.currentTarget.checked})})]})]}):null]})},Tr=({component:t,onChange:s})=>e.jsx(Xt,{value:t.settings,onChange:l=>s==null?void 0:s({...t,settings:l})}),Bs=y.createContext(null),zr=({children:t,defaultOrbitEnabled:s=!0,defaultSelectedObjectId:l=null,defaultShowGrid:n=!0,defaultShowVideoBackground:a=!0,onComponentChange:d,onObjectChange:r,onOrbitEnabledChange:o,onSelectObject:h,onShowGridChange:x,onShowVideoBackgroundChange:c,onStoreChange:p,orbitEnabled:f,selectedObjectId:g,showGrid:i,showVideoBackground:u,store:j})=>{const[w,v]=y.useState(l),[M,U]=y.useState(s),[b,F]=y.useState(n),[E,P]=y.useState(a),le=g??w,ae=f??M,L=i??b,Pe=u??E,De=y.useMemo(()=>({store:j,selectedObjectId:le,orbitEnabled:ae,showGrid:L,showVideoBackground:Pe,onStoreChange:p,onSelectObject:W=>{v(W),h==null||h(W)},onComponentChange:d??(W=>{p({...j,components:{...j.components,[W.id]:W}})}),onObjectChange:r??(W=>{p({...j,objects:{...j.objects,[W.id]:W}})}),onOrbitEnabledChange:W=>{U(W),o==null||o(W)},onShowGridChange:W=>{F(W),x==null||x(W)},onShowVideoBackgroundChange:W=>{P(W),c==null||c(W)}}),[d,r,o,h,x,c,p,ae,le,L,Pe,j]);return e.jsx(Bs.Provider,{value:De,children:t})},bt=()=>{const t=y.useContext(Bs);if(!t)throw new Error("useXRSceneEditor must be used inside XRSceneEditorProvider.");return t},Vs=t=>t.renderGroupOrder.map(s=>t.renderGroups[s]).filter(Boolean),Mr=({initialPosition:t,rootOnly:s=!1,title:l,docked:n})=>{const{onSelectObject:a,onStoreChange:d,selectedObjectId:r,store:o}=bt(),h=Vs(o),x=s?Object.fromEntries(Object.entries(o.objects).filter(([,c])=>!c.parentObjectId)):o.objects;return e.jsx(Ls,{title:l,initialPosition:t,docked:n,groups:h,objects:x,selectedObjectId:r??void 0,onSelectObject:c=>a(c),onReorderGroup:(c,p)=>d(Le.reorderRenderGroup(o,c,p)),onReorderObject:(c,p,f)=>d(Le.reorderObjectWithinGroup(o,c,p,f)),onMoveObject:(c,p,f)=>{const g=Le.moveObjectToGroup(o,c,p,f);return g===o?!1:(d(g),!0)},onSetObjectParent:(c,p,f,g)=>{let i=o;const u=i.objects[c];if(!u||g&&u.renderGroupId!==g&&(i=Le.moveObjectToGroup(i,c,g,f),i===o))return!1;const j=K.setSceneObjectParentPreserveWorldTransform(i,c,p,f);return j===o?!1:(d(j),!0)},onToggleGroupEnabled:(c,p)=>{const f=o.renderGroups[c];f&&d({...o,renderGroups:{...o.renderGroups,[c]:{...f,enabled:p}}})},onToggleObjectVisible:(c,p)=>d(K.setSceneObjectVisible(o,c,p)),copyConfig:{kind:"scene",version:1,renderGroupOrder:o.renderGroupOrder,renderGroups:o.renderGroups,objects:o.objects,components:o.components}})},Q={display:"grid",gridTemplateColumns:"92px minmax(0, 1fr)",alignItems:"center",gap:10,margin:"8px 0",color:"#cbd5e1",fontSize:12},fe={width:"100%",boxSizing:"border-box",padding:"8px 9px",border:"1px solid rgba(148,163,184,.16)",borderRadius:6,background:"rgba(15,23,42,.72)",color:"#e2e8f0"},xt={borderRadius:12,border:"1px solid rgba(255,255,255,0.08)",background:"rgba(255,255,255,0.03)",padding:8},ut={display:"flex",alignItems:"center",gap:6,marginBottom:7,fontSize:11,fontWeight:700},oe=(t,s)=>t.find(l=>l.type===s),Fr=({onChange:t,value:s})=>e.jsxs("section",{style:xt,children:[e.jsx("div",{style:ut,children:"Light"}),e.jsxs("label",{style:Q,children:[e.jsx("span",{children:"Type"}),e.jsxs("select",{style:fe,value:s.type,onChange:l=>t({...s,type:l.currentTarget.value}),children:[e.jsx("option",{value:"ambient",children:"Ambient"}),e.jsx("option",{value:"directional",children:"Directional"}),e.jsx("option",{value:"point",children:"Point"}),e.jsx("option",{value:"spot",children:"Spot"})]})]}),e.jsxs("label",{style:Q,children:[e.jsx("span",{children:"Color"}),e.jsx("input",{type:"color",style:{...fe,padding:2},value:s.color,onChange:l=>t({...s,color:l.currentTarget.value})})]}),e.jsxs("label",{style:Q,children:[e.jsx("span",{children:"Intensity"}),e.jsx("input",{type:"number",min:0,step:.1,style:fe,value:s.intensity,onChange:l=>t({...s,intensity:Number(l.currentTarget.value)})})]}),e.jsxs("label",{style:Q,children:[e.jsx("span",{children:"Cast Shadow"}),e.jsx("input",{type:"checkbox",checked:s.castShadow,onChange:l=>t({...s,castShadow:l.currentTarget.checked})})]}),e.jsxs("label",{style:Q,children:[e.jsx("span",{children:"Show Helper"}),e.jsx("input",{type:"checkbox",checked:s.showHelper,onChange:l=>t({...s,showHelper:l.currentTarget.checked})})]})]}),Wr=({onChange:t,value:s})=>e.jsxs("section",{style:xt,children:[e.jsxs("label",{style:{...ut,justifyContent:"space-between"},children:[e.jsx("span",{children:"Look At"}),e.jsx("input",{type:"checkbox",checked:s.enabled,onChange:l=>t({...s,enabled:l.currentTarget.checked})})]}),e.jsxs("label",{style:Q,children:[e.jsx("span",{children:"Mode"}),e.jsxs("select",{style:fe,value:s.mode,onChange:l=>t({...s,mode:l.currentTarget.value}),children:[e.jsx("option",{value:"point",children:"Point"}),e.jsx("option",{value:"direction",children:"Direction"})]})]}),e.jsxs("label",{style:Q,children:[e.jsx("span",{children:"Children Inherit"}),e.jsx("input",{type:"checkbox",checked:s.inheritChildren,onChange:l=>t({...s,inheritChildren:l.currentTarget.checked})})]})]}),Lr=({onChange:t,value:s})=>{const l=(n,a,d)=>["x","y","z"].map(r=>e.jsxs("label",{style:Q,children:[e.jsx("span",{children:`${n} ${r.toUpperCase()}`}),e.jsx("input",{type:"number",step:.05,style:fe,value:a[r],onChange:o=>d({...a,[r]:Number(o.currentTarget.value)})})]},`${n}-${r}`));return e.jsxs("section",{style:xt,children:[e.jsx("div",{style:ut,children:"Face Binding"}),e.jsxs("label",{style:Q,children:[e.jsx("span",{children:"Target"}),e.jsx("select",{style:fe,value:s.target,onChange:n=>t({...s,target:n.currentTarget.value}),children:Us.FACE_TARGETS.map(n=>e.jsx("option",{value:n,children:n.replace("face.","")},n))})]}),s.target==="face.custom"?l("Custom",s.customAnchorPoint,n=>t({...s,customAnchorPoint:n})):null,l("Offset",s.offset,n=>t({...s,offset:n})),e.jsxs("label",{style:Q,children:[e.jsx("span",{children:"Smoothing"}),e.jsx("input",{type:"number",min:0,step:1,style:fe,value:s.smoothing,onChange:n=>t({...s,smoothing:Number(n.currentTarget.value)})})]}),e.jsxs("label",{style:Q,children:[e.jsx("span",{children:"Follow Face Roll"}),e.jsx("input",{type:"checkbox",checked:s.followFaceRoll,onChange:n=>t({...s,followFaceRoll:n.currentTarget.checked})})]})]})},$r=({initialPosition:t,docked:s})=>{const{onComponentChange:l,onObjectChange:n,onStoreChange:a,selectedObjectId:d,store:r}=bt(),o=d?r.objects[d]:null,h=o?K.getOrderedComponents(r,o.id):[],x=oe(h,"Transform"),c=oe(h,"ScreenTransform"),p=oe(h,"ScreenShape"),f=oe(h,"MeshRenderer"),g=oe(h,"FaceMeshRenderer"),i=oe(h,"Light"),u=oe(h,"LookAt"),j=oe(h,"PinToMesh"),w=oe(h,"TrackingAnchor"),v=o!=null&&o.renderGroupId?r.renderGroups[o.renderGroupId]:void 0;if(!o)return null;const M=Object.values(r.objects).filter(b=>b.id!==o.id).filter(b=>{const F=K.getOrderedComponents(r,b.id);return!!oe(F,"MeshRenderer")}).map(b=>({id:b.id,name:b.name})),U=Object.values(r.objects).filter(b=>b.id!==o.id);return e.jsxs(Ct,{objectId:o.id,objectName:o.name,onObjectNameChange:b=>n({...o,name:b}),visible:o.enabled,onVisibleChange:b=>n({...o,enabled:b}),layer:(v==null?void 0:v.name)??"3D Scene",initialPosition:t,docked:s,copyConfig:{object:o,components:h},children:[e.jsxs("section",{style:xt,children:[e.jsx("div",{style:ut,children:"Hierarchy"}),e.jsxs("label",{style:Q,children:[e.jsx("span",{children:"Parent"}),e.jsxs("select",{style:fe,value:o.parentObjectId??"",onChange:b=>a(K.setSceneObjectParentPreserveWorldTransform(r,o.id,b.currentTarget.value||null)),children:[e.jsx("option",{value:"",children:"None"}),U.map(b=>e.jsx("option",{value:b.id,children:b.name},b.id))]})]})]}),x?e.jsx(_t,{value:x.settings,onChange:b=>l({...x,settings:b})}):null,c?e.jsxs("section",{style:xt,children:[e.jsx("div",{style:ut,children:"Screen Transform"}),e.jsx(Ht,{guideLabel:"Screen Transform",value:{...c.settings,showGuides:c.settings.showTransformGuides},onChange:b=>{const{showGuides:F,...E}=b;l({...c,settings:{...c.settings,...E,showTransformGuides:F}})}})]}):null,f?e.jsx(Ds,{value:f.settings,onChange:b=>l({...f,settings:b})}):null,g?e.jsx(Xt,{value:g.settings,onChange:b=>l({...g,settings:b})}):null,p?e.jsx(Ts,{value:p.settings,onChange:b=>l({...p,settings:b})}):null,i?e.jsx(Fr,{value:i.settings,onChange:b=>l({...i,settings:b})}):null,u?e.jsx(Wr,{value:u.settings,onChange:b=>l({...u,settings:b})}):null,j?e.jsx($s,{value:j.settings,onChange:b=>l({...j,settings:b}),targets:M}):null,w?e.jsx(Lr,{value:w.settings,onChange:b=>l({...w,settings:b})}):null]})},Nr=({renderOrder:t=-999})=>{const{camera:s,size:l}=Xs.useThree(),n=Ys.useXRCameraTexture(),a=y.useMemo(()=>{if(!s.isPerspectiveCamera)return[10,10];const d=s,h=(d.position.z||5)- -1,x=d.fov*Math.PI/180,c=2*Math.tan(x/2)*h;return[c*(l.width/l.height),c]},[s,l]);return n?e.jsxs("mesh",{position:[0,0,-1],renderOrder:t,children:[e.jsx("planeGeometry",{args:a}),e.jsx("meshBasicMaterial",{map:n,depthTest:!0,depthWrite:!0,toneMapped:!1,side:Gs.DoubleSide})]}):null},Or=({camera:t={position:{x:0,y:.2,z:5.5},fov:42},grid:s={size:12,divisions:12,position:{x:0,y:-2.5,z:0}},style:l})=>{const{onComponentChange:n,orbitEnabled:a,showGrid:d,showVideoBackground:r,store:o}=bt(),h=Le.createRenderPlan(o),x=Array.from(new Set(h.map(f=>f.renderLayer))),c=t.position??{x:0,y:.2,z:5.5},p=s.position??{x:0,y:-2.5,z:0};return e.jsxs(Zs.XRScene,{style:{width:"100%",height:"100%",...l},canvasProps:{shadows:!0},children:[r?e.jsx(Nr,{renderOrder:-999}):null,e.jsx("color",{attach:"background",args:["#18212b"]}),e.jsx(Zt.PerspectiveCamera,{makeDefault:!0,position:[c.x,c.y,c.z],fov:t.fov??42}),e.jsx("ambientLight",{intensity:1.1}),d?e.jsx("gridHelper",{args:[s.size??12,s.divisions??12,"#344454","#263544"],position:[p.x,p.y,p.z]}):null,h.map(f=>e.jsx(Yt.SceneObjectRenderer,{objectId:f.objectId,store:o,editorMode:!0,renderOrder:f.renderOrder,renderLayer:f.renderLayer,onComponentChange:n},f.objectId)),e.jsx(Yt.SequentialRenderPasses,{layers:x}),e.jsx(Zt.OrbitControls,{enabled:a,enablePan:!1,minDistance:.05,maxDistance:1/0})]})},Ar=t=>({position:"absolute",top:12,left:t==="top-left"?12:t==="top-right"?"auto":"50%",right:t==="top-right"?12:"auto",transform:t==="top-center"||!t?"translateX(-50%)":"none",zIndex:5,display:"flex",alignItems:"center",gap:12,padding:"7px 10px",border:"1px solid rgba(148,163,184,.24)",borderRadius:9,background:"rgba(15,23,42,.78)",color:"#d8e2ec",backdropFilter:"blur(12px)",fontSize:11}),Pr=({position:t="top-center"})=>{const{onOrbitEnabledChange:s,orbitEnabled:l}=bt();return e.jsxs("div",{style:Ar(t),children:[e.jsx("span",{style:{color:"#7e95aa",fontSize:9,fontWeight:800,letterSpacing:"0.14em"},children:"VIEWPORT"}),e.jsxs("label",{style:{display:"flex",alignItems:"center",gap:6,cursor:"pointer"},children:[e.jsx("input",{type:"checkbox",checked:l,onChange:n=>s(n.currentTarget.checked)}),"Orbit Controls"]})]})},Dr={borderRadius:12,border:"1px solid rgba(251,191,36,0.30)",background:"rgba(251,191,36,0.08)",color:"#fde68a",padding:8,fontSize:10.5,lineHeight:1.45},Br={display:"block",marginTop:6,overflow:"auto",maxHeight:160,borderRadius:8,background:"rgba(15,23,42,0.55)",color:"#f8fafc",padding:8,fontSize:10},Ks=({component:t})=>e.jsxs("div",{style:Dr,children:[e.jsxs("div",{children:["Missing editor for component type: ",t.type]}),e.jsxs("div",{children:["Component ID: ",t.id]}),e.jsx("pre",{style:Br,children:JSON.stringify(t,null,2)})]}),Vr=({component:t,editors:s={},onChange:l})=>{const n=s[t.type];return n?e.jsx(n,{component:t,onChange:l}):e.jsx(Ks,{component:t})},Kr=t=>t.slice(0,12);exports.MediaSourceSwitcher=Oe.MediaSourceSwitcher;exports.defaultMediaSources=Oe.defaultMediaSources;exports.sampleVideoMediaSources=Oe.sampleVideoMediaSources;exports.sdkImageMediaSources=Oe.sdkImageMediaSources;exports.sdkVideoMediaSources=Oe.sdkVideoMediaSources;exports.useFaceTrackingMediaSourceSession=Oe.useFaceTrackingMediaSourceSession;exports.useMediaSourceSession=Oe.useMediaSourceSession;exports.DefaultSettingPanel=Hs.DefaultSettingPanel;exports.ComponentEditor=Vr;exports.ComponentEditorFallback=Ks;exports.FaceMeshRendererComponentEditor=Tr;exports.FaceMeshRendererSettingsPanel=Xt;exports.FaceRetouchSettingsPanel=No;exports.FaceSwapSettingsPanel=Oo;exports.GestureSettingsPanel=Ao;exports.HandJoints2DSettingsPanel=Ai;exports.HandTracking2DControllerSettingsPanel=wi;exports.HandTracking2DSettingsPanel=li;exports.HandTracking3DSettingsPanel=eo;exports.HierarchyPanel=Ls;exports.HolisticTrackerSettingsPanel=Ko;exports.IrisEffectSettingsPanel=Po;exports.LayerPanel=fo;exports.LipEffectSettingsPanel=Do;exports.MeshRendererSettingsPanel=Ds;exports.ObjectInspectorPanel=Ct;exports.PinToMeshSettingsPanel=$s;exports.ProductHotspotPanel=Bo;exports.SceneHierarchyPanel=Mr;exports.SceneInspectorPanel=$r;exports.ScreenGlassSettingsPanel=Es;exports.ScreenGradientSettingsPanel=Is;exports.ScreenImageSettingsPanel=Ol;exports.ScreenShapeSettingsPanel=Ts;exports.ScreenTextSettingsPanel=hl;exports.SegmentationOverlaySettingsPanel=Ho;exports.SettingsPanel=Se;exports.Transform3DSettingsPanel=yr;exports.Transform3DSettingsSection=_t;exports.ViewportToolbar=Pr;exports.XRDiagnosticsPanel=Vo;exports.XRSceneEditorProvider=zr;exports.XRSceneViewport=Or;exports.createComponentIdLabel=Kr;exports.getSceneEditorGroups=Vs;exports.useXRSceneEditor=bt;