@shopware-ag/dive 2.0.1-beta.1 → 2.0.1-beta.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 (280) hide show
  1. package/build/chunks/AssetCache-CsfCIl9J.mjs +79 -0
  2. package/build/chunks/AssetCache-DGLqbo2B.cjs +1 -0
  3. package/build/chunks/AssetExporter-DsbC2rqv.cjs +164 -0
  4. package/build/{src/modules/asset/exporter/AssetExporter.mjs → chunks/AssetExporter-brT7ogoM.mjs} +22 -21
  5. package/build/chunks/AssetLoader-DvF8gL8a.mjs +2341 -0
  6. package/build/chunks/AssetLoader-H_GSIMop.cjs +4 -0
  7. package/build/chunks/FileTypes-CHutqD19.cjs +30 -0
  8. package/build/chunks/FileTypes-IBuu9ohV.mjs +1057 -0
  9. package/build/chunks/MathUtils-CBW56ZuG.cjs +1 -0
  10. package/build/chunks/MathUtils-CFGjHuVF.mjs +159 -0
  11. package/build/chunks/OrbitController-BQ6SV1O_.mjs +1159 -0
  12. package/build/chunks/OrbitController-CpFQ3A1H.cjs +1 -0
  13. package/build/chunks/{PerspectiveCamera-sm4_81KJ.mjs → PerspectiveCamera-PMJPzAn3.mjs} +2 -2
  14. package/build/chunks/PovSchema-Co9FznEz.cjs +1 -0
  15. package/build/chunks/PovSchema-DWWvr_ED.mjs +10 -0
  16. package/build/chunks/{SelectTool-Bd8cC9nb.mjs → SelectTool-BU0vTDXg.mjs} +44 -39
  17. package/build/chunks/SelectTool-CAqDMcoM.cjs +1 -0
  18. package/build/chunks/draco_decoder-Bh9flJPu.cjs +1 -0
  19. package/build/chunks/draco_decoder-CEzwqP9o.mjs +38 -0
  20. package/build/chunks/draco_decoder-DtHHc5d0.mjs +4 -0
  21. package/build/chunks/draco_decoder-DvYjcLz_.cjs +35 -0
  22. package/build/chunks/draco_wasm_wrapper-FoEVV9af.cjs +118 -0
  23. package/build/chunks/draco_wasm_wrapper-yQy2VLhb.mjs +121 -0
  24. package/build/chunks/fflate.module-DHdJvhNh.cjs +6 -0
  25. package/build/chunks/fflate.module-xyO_T3Zm.mjs +602 -0
  26. package/build/chunks/findInterface-C6mrvf_t.cjs +1 -0
  27. package/build/chunks/findInterface-DbJ5qzbc.mjs +11 -0
  28. package/build/chunks/isFileTypeSupported-BSpswPHU.mjs +12 -0
  29. package/build/chunks/isFileTypeSupported-CrEqYiv9.cjs +1 -0
  30. package/build/chunks/network-error-BONfHWQq.mjs +14 -0
  31. package/build/chunks/network-error-CdDXil5g.cjs +1 -0
  32. package/build/chunks/package-CmvmIjT5.cjs +1 -0
  33. package/build/chunks/package-DSKqbNMb.mjs +39 -0
  34. package/build/chunks/parse-error-DfOPyLWM.mjs +14 -0
  35. package/build/chunks/parse-error-Dy_EE4rL.cjs +1 -0
  36. package/build/dive.cjs +1 -30
  37. package/build/dive.mjs +674 -1535
  38. package/build/plugins/animation/index.cjs +1 -0
  39. package/build/plugins/animation/index.d.ts +2 -0
  40. package/build/plugins/animation/index.mjs +126 -0
  41. package/build/plugins/ar/index.cjs +1 -0
  42. package/build/plugins/ar/index.d.ts +2 -0
  43. package/build/plugins/ar/index.mjs +207 -0
  44. package/build/plugins/assetcache/index.cjs +1 -0
  45. package/build/plugins/assetcache/index.d.ts +2 -0
  46. package/build/plugins/assetcache/index.mjs +5 -0
  47. package/build/plugins/assetconverter/index.d.ts +2 -0
  48. package/build/plugins/assetexporter/index.cjs +1 -0
  49. package/build/plugins/assetexporter/index.d.ts +2 -0
  50. package/build/plugins/assetexporter/index.mjs +4 -0
  51. package/build/plugins/assetloader/index.cjs +1 -0
  52. package/build/plugins/assetloader/index.d.ts +2 -0
  53. package/build/plugins/assetloader/index.mjs +6 -0
  54. package/build/plugins/mediacreator/index.cjs +1 -0
  55. package/build/plugins/mediacreator/index.d.ts +2 -0
  56. package/build/{src/modules/mediacreator/MediaCreator.mjs → plugins/mediacreator/index.mjs} +4 -4
  57. package/build/plugins/orbitcontroller/index.cjs +1 -0
  58. package/build/plugins/orbitcontroller/index.d.ts +2 -0
  59. package/build/plugins/orbitcontroller/index.mjs +5 -0
  60. package/build/plugins/orientationdisplay/index.cjs +1 -0
  61. package/build/plugins/orientationdisplay/index.d.ts +2 -0
  62. package/build/plugins/orientationdisplay/index.mjs +5 -0
  63. package/build/plugins/state/index.cjs +27 -0
  64. package/build/plugins/state/index.d.ts +2 -0
  65. package/build/plugins/state/index.mjs +4266 -0
  66. package/build/plugins/systeminfo/index.cjs +1 -0
  67. package/build/plugins/systeminfo/index.d.ts +2 -0
  68. package/build/{chunks/SystemInfo-DPAQG-S5.mjs → plugins/systeminfo/index.mjs} +48 -51
  69. package/build/plugins/toolbox/index.cjs +1 -0
  70. package/build/plugins/toolbox/index.d.ts +2 -0
  71. package/build/{src/modules/toolbox/Toolbox.mjs → plugins/toolbox/index.mjs} +29 -23
  72. package/build/src/components/boundingbox/BoundingBox.d.ts +136 -0
  73. package/build/src/components/gizmo/Gizmo.d.ts +1 -1
  74. package/build/src/components/gizmo/handles/AxisHandle.d.ts +1 -1
  75. package/build/src/components/gizmo/handles/RadialHandle.d.ts +1 -1
  76. package/build/src/components/gizmo/handles/ScaleHandle.d.ts +1 -1
  77. package/build/src/components/gizmo/rotate/RotateGizmo.d.ts +2 -2
  78. package/build/src/components/gizmo/scale/ScaleGizmo.d.ts +2 -2
  79. package/build/src/components/gizmo/translate/TranslateGizmo.d.ts +2 -2
  80. package/build/src/components/group/Group.d.ts +4 -4
  81. package/build/src/components/model/Model.d.ts +2 -2
  82. package/build/src/components/node/Node.d.ts +7 -7
  83. package/build/src/components/primitive/Primitive.d.ts +3 -3
  84. package/build/src/components/root/Root.d.ts +5 -7
  85. package/build/src/core/Dive.d.ts +5 -4
  86. package/build/src/engine/clock/Clock.d.ts +1 -0
  87. package/build/src/engine/index.d.ts +6 -0
  88. package/build/src/engine/renderer/Renderer.d.ts +47 -7
  89. package/build/src/engine/scene/xrroot/XRRoot.d.ts +2 -2
  90. package/build/src/engine/scene/xrroot/xrlightroot/XRLightRoot.d.ts +2 -2
  91. package/build/src/error/file-content/file-content-error.d.ts +4 -0
  92. package/build/src/error/index.d.ts +4 -0
  93. package/build/src/error/network/network-error.d.ts +1 -1
  94. package/build/src/error/parse/parse-error.d.ts +2 -1
  95. package/build/src/events/dispatcher/EventDispatcher.d.ts +6 -0
  96. package/build/src/events/index.d.ts +1 -0
  97. package/build/src/helpers/deepClone/deepClone.d.ts +34 -0
  98. package/build/src/helpers/index.d.ts +5 -4
  99. package/build/src/index.d.ts +5 -5
  100. package/build/src/interfaces/Draggable.d.ts +1 -1
  101. package/build/src/plugins/animation/index.d.ts +2 -0
  102. package/build/src/{modules/animation → plugins/animation/src}/animator/Animator.d.ts +2 -3
  103. package/build/src/plugins/animation/src/index.d.ts +3 -0
  104. package/build/src/plugins/animation/src/system/AnimationSystem.d.ts +23 -0
  105. package/build/src/plugins/ar/index.d.ts +4 -0
  106. package/build/src/plugins/ar/src/ARSystem.d.ts +24 -0
  107. package/build/src/plugins/ar/src/arquicklook/ARQuickLook.d.ts +15 -0
  108. package/build/src/plugins/ar/src/error/ar-errors.d.ts +24 -0
  109. package/build/src/{modules/ar → plugins/ar/src}/sceneviewer/SceneViewer.d.ts +10 -0
  110. package/build/src/{modules/ar → plugins/ar/src}/webxr/WebXR.d.ts +4 -4
  111. package/build/src/{modules/ar → plugins/ar/src}/webxr/controller/WebXRController.d.ts +5 -5
  112. package/build/src/{modules/ar → plugins/ar/src}/webxr/crosshair/WebXRCrosshair.d.ts +2 -2
  113. package/build/src/{modules/ar → plugins/ar/src}/webxr/origin/WebXROrigin.d.ts +4 -4
  114. package/build/src/{modules/ar → plugins/ar/src}/webxr/overlay/Overlay.d.ts +2 -2
  115. package/build/src/{modules/ar → plugins/ar/src}/webxr/raycaster/WebXRRaycaster.d.ts +8 -8
  116. package/build/src/{modules/ar → plugins/ar/src}/webxr/raycaster/ar/WebXRRaycasterAR.d.ts +4 -4
  117. package/build/src/{modules/ar → plugins/ar/src}/webxr/raycaster/three/WebXRRaycasterTHREE.d.ts +4 -4
  118. package/build/src/{modules/ar → plugins/ar/src}/webxr/touchscreencontrols/WebXRTouchscreenControls.d.ts +3 -3
  119. package/build/src/plugins/assetcache/index.d.ts +1 -0
  120. package/build/src/plugins/assetcache/src/cache/AssetCache.d.ts +12 -0
  121. package/build/src/plugins/assetcache/src/chunk/Chunk.d.ts +16 -0
  122. package/build/src/plugins/assetcache/src/index.d.ts +2 -0
  123. package/build/src/plugins/assetconverter/index.d.ts +1 -0
  124. package/build/src/plugins/assetconverter/src/AssetConverter.d.ts +13 -0
  125. package/build/src/plugins/assetexporter/index.d.ts +1 -0
  126. package/build/src/{modules/asset/exporter → plugins/assetexporter/src}/AssetExporter.d.ts +0 -17
  127. package/build/src/plugins/assetloader/index.d.ts +3 -0
  128. package/build/src/plugins/assetloader/src/draco/DracoLoader.d.ts +10 -0
  129. package/build/src/plugins/assetloader/src/loader/AssetLoader.d.ts +14 -0
  130. package/build/src/plugins/mediacreator/index.d.ts +1 -0
  131. package/build/src/plugins/mediacreator/src/MediaCreator.d.ts +15 -0
  132. package/build/src/plugins/orbitcontroller/index.d.ts +1 -0
  133. package/build/src/plugins/orbitcontroller/src/OrbitController.d.ts +45 -0
  134. package/build/src/plugins/orientationdisplay/index.d.ts +2 -0
  135. package/build/src/plugins/orientationdisplay/src/OrientationDisplay.d.ts +18 -0
  136. package/build/src/plugins/orientationdisplay/src/axes/Axes.d.ts +6 -0
  137. package/build/src/plugins/state/index.d.ts +4 -0
  138. package/build/src/{modules/state → plugins/state/src}/State.d.ts +4 -27
  139. package/build/src/{modules/state → plugins/state/src}/actions/action.d.ts +1 -1
  140. package/build/src/{modules/state → plugins/state/src}/actions/ar/launchar.d.ts +2 -2
  141. package/build/src/{modules/state → plugins/state/src}/actions/camera/computeencompassingview.d.ts +1 -1
  142. package/build/src/{modules/state → plugins/state/src}/actions/camera/getcameratransform.d.ts +1 -1
  143. package/build/src/{modules/state → plugins/state/src}/actions/camera/lockcamera.d.ts +1 -1
  144. package/build/src/{modules/state → plugins/state/src}/actions/camera/movecamera.d.ts +3 -3
  145. package/build/src/{modules/state → plugins/state/src}/actions/camera/setcameralayer.d.ts +1 -1
  146. package/build/src/{modules/state → plugins/state/src}/actions/camera/setcameratransform.d.ts +1 -1
  147. package/build/src/{modules/state → plugins/state/src}/actions/camera/zoomcamera.d.ts +1 -1
  148. package/build/src/{modules/state → plugins/state/src}/actions/media/generatemedia.d.ts +1 -1
  149. package/build/src/plugins/state/src/actions/object/addobject.d.ts +9 -0
  150. package/build/src/plugins/state/src/actions/object/deleteobject.d.ts +13 -0
  151. package/build/src/plugins/state/src/actions/object/deselectobject.d.ts +13 -0
  152. package/build/src/{modules/state → plugins/state/src}/actions/object/dropit.d.ts +3 -3
  153. package/build/src/{modules/state → plugins/state/src}/actions/object/getallobjects.d.ts +3 -2
  154. package/build/src/plugins/state/src/actions/object/getobjects.d.ts +13 -0
  155. package/build/src/{modules/state → plugins/state/src}/actions/object/modelloaded.d.ts +1 -1
  156. package/build/src/{modules/state → plugins/state/src}/actions/object/placeonfloor.d.ts +3 -3
  157. package/build/src/plugins/state/src/actions/object/selectobject.d.ts +13 -0
  158. package/build/src/plugins/state/src/actions/object/setparent.d.ts +23 -0
  159. package/build/src/plugins/state/src/actions/object/updateobject.d.ts +13 -0
  160. package/build/src/{modules/state → plugins/state/src}/actions/renderer/startrender.d.ts +1 -1
  161. package/build/src/{modules/state → plugins/state/src}/actions/scene/exportscene.d.ts +4 -4
  162. package/build/src/plugins/state/src/actions/scene/getallscenedata.d.ts +9 -0
  163. package/build/src/{modules/state → plugins/state/src}/actions/scene/setbackground.d.ts +1 -1
  164. package/build/src/{modules/state → plugins/state/src}/actions/scene/updatescene.d.ts +1 -1
  165. package/build/src/{modules/state → plugins/state/src}/actions/toolbox/setgizmomode.d.ts +1 -1
  166. package/build/src/{modules/state → plugins/state/src}/actions/toolbox/setgizmoscalelinked.d.ts +1 -1
  167. package/build/src/plugins/state/src/actions/toolbox/setgizmovisible.d.ts +8 -0
  168. package/build/src/{modules/state → plugins/state/src}/actions/toolbox/usetool.d.ts +2 -2
  169. package/build/src/plugins/state/types/ActionTypes.d.ts +17 -0
  170. package/build/src/{types/SceneType.d.ts → plugins/state/types/StateExportFileType.d.ts} +1 -1
  171. package/build/src/plugins/state/types/StateSceneData.d.ts +19 -0
  172. package/build/src/plugins/state/types/index.d.ts +1 -0
  173. package/build/src/plugins/systeminfo/index.d.ts +2 -0
  174. package/build/src/{modules/systeminfo → plugins/systeminfo/src}/SystemInfo.d.ts +22 -32
  175. package/build/src/plugins/toolbox/index.d.ts +4 -0
  176. package/build/src/{modules/toolbox → plugins/toolbox/src}/BaseTool.d.ts +4 -6
  177. package/build/src/{modules/toolbox → plugins/toolbox/src}/Toolbox.d.ts +8 -17
  178. package/build/src/{modules/toolbox → plugins/toolbox/src}/select/SelectTool.d.ts +7 -11
  179. package/build/src/{modules/toolbox → plugins/toolbox/src}/transform/TransformTool.d.ts +6 -10
  180. package/build/src/types/components/DIVELight.d.ts +4 -0
  181. package/build/src/types/components/DIVESceneObject.d.ts +6 -0
  182. package/build/src/types/components/index.d.ts +2 -0
  183. package/build/src/types/index.d.ts +2 -5
  184. package/build/src/types/schema/BaseEntitySchema.d.ts +8 -0
  185. package/build/src/types/schema/EntitySchema.d.ts +11 -0
  186. package/build/src/types/schema/EntityTypeSchema.d.ts +1 -0
  187. package/build/src/types/schema/GeometrySchema.d.ts +7 -0
  188. package/build/src/types/schema/GeometryTypeSchema.d.ts +1 -0
  189. package/build/src/types/schema/GroupSchema.d.ts +11 -0
  190. package/build/src/types/schema/LightSchema.d.ts +28 -0
  191. package/build/src/{modules/state/types/COMMaterial.d.ts → types/schema/MaterialSchema.d.ts} +1 -1
  192. package/build/src/types/schema/ModelSchema.d.ts +14 -0
  193. package/build/src/types/schema/PovSchema.d.ts +10 -0
  194. package/build/src/types/schema/PrimitiveSchema.d.ts +14 -0
  195. package/build/src/types/schema/index.d.ts +11 -0
  196. package/package.json +59 -41
  197. package/build/chunks/FileTypes-BjZ0rrIV.cjs +0 -1
  198. package/build/chunks/FileTypes-qgYnI0Jg.mjs +0 -30
  199. package/build/chunks/ModuleRegistry-NyNtjHb2.cjs +0 -1
  200. package/build/chunks/ModuleRegistry-RSub8W0G.mjs +0 -13
  201. package/build/chunks/SelectTool-BAXTVyWs.cjs +0 -1
  202. package/build/chunks/SystemInfo-oX-NNneO.cjs +0 -1
  203. package/build/chunks/findInterface-BEdL2iUQ.cjs +0 -1
  204. package/build/chunks/findInterface-OrXgmwxj.mjs +0 -18
  205. package/build/chunks/index-C_uFFwT2.mjs +0 -5
  206. package/build/chunks/index-DAwIH9xh.cjs +0 -1
  207. package/build/chunks/package-BHjZWYD6.mjs +0 -39
  208. package/build/chunks/package-JHvTSNgQ.cjs +0 -1
  209. package/build/chunks/parse-error-2f5qpXP5.cjs +0 -6
  210. package/build/chunks/parse-error-DRBVHL9E.mjs +0 -614
  211. package/build/src/error/ar-compatibility/ar-compatibility-error.d.ts +0 -12
  212. package/build/src/modules/ModuleRegistry.d.ts +0 -19
  213. package/build/src/modules/animation/AnimationSystem.cjs +0 -1
  214. package/build/src/modules/animation/AnimationSystem.d.ts +0 -36
  215. package/build/src/modules/animation/AnimationSystem.mjs +0 -95
  216. package/build/src/modules/ar/ARSystem.cjs +0 -1
  217. package/build/src/modules/ar/ARSystem.d.ts +0 -71
  218. package/build/src/modules/ar/ARSystem.mjs +0 -163
  219. package/build/src/modules/ar/arquicklook/ARQuickLook.d.ts +0 -7
  220. package/build/src/modules/asset/converter/AssetConverter.d.ts +0 -30
  221. package/build/src/modules/asset/draco/README.md +0 -32
  222. package/build/src/modules/asset/draco/draco_decoder.js +0 -33
  223. package/build/src/modules/asset/draco/draco_decoder.wasm +0 -0
  224. package/build/src/modules/asset/draco/draco_encoder.js +0 -33
  225. package/build/src/modules/asset/draco/draco_wasm_wrapper.js +0 -116
  226. package/build/src/modules/asset/draco/gltf/draco_decoder.js +0 -33
  227. package/build/src/modules/asset/draco/gltf/draco_decoder.wasm +0 -0
  228. package/build/src/modules/asset/draco/gltf/draco_encoder.js +0 -33
  229. package/build/src/modules/asset/draco/gltf/draco_wasm_wrapper.js +0 -116
  230. package/build/src/modules/asset/exporter/AssetExporter.cjs +0 -164
  231. package/build/src/modules/asset/loader/AssetLoader.cjs +0 -3
  232. package/build/src/modules/asset/loader/AssetLoader.d.ts +0 -29
  233. package/build/src/modules/asset/loader/AssetLoader.mjs +0 -2154
  234. package/build/src/modules/axiscamera/AxisCamera.d.ts +0 -21
  235. package/build/src/modules/controller/orbit/OrbitController.d.ts +0 -30
  236. package/build/src/modules/events/EventExecutor.d.ts +0 -5
  237. package/build/src/modules/mediacreator/MediaCreator.cjs +0 -1
  238. package/build/src/modules/mediacreator/MediaCreator.d.ts +0 -44
  239. package/build/src/modules/state/State.cjs +0 -27
  240. package/build/src/modules/state/State.mjs +0 -4296
  241. package/build/src/modules/state/actions/object/addobject.d.ts +0 -8
  242. package/build/src/modules/state/actions/object/deleteobject.d.ts +0 -12
  243. package/build/src/modules/state/actions/object/deselectobject.d.ts +0 -12
  244. package/build/src/modules/state/actions/object/getobjects.d.ts +0 -12
  245. package/build/src/modules/state/actions/object/selectobject.d.ts +0 -12
  246. package/build/src/modules/state/actions/object/setparent.d.ts +0 -22
  247. package/build/src/modules/state/actions/object/updateobject.d.ts +0 -12
  248. package/build/src/modules/state/actions/scene/getallscenedata.d.ts +0 -9
  249. package/build/src/modules/state/actions/toolbox/setgizmovisible.d.ts +0 -8
  250. package/build/src/modules/state/types/ActionTypes.d.ts +0 -18
  251. package/build/src/modules/state/types/COMBaseEntity.d.ts +0 -8
  252. package/build/src/modules/state/types/COMEntity.d.ts +0 -11
  253. package/build/src/modules/state/types/COMEntityType.d.ts +0 -1
  254. package/build/src/modules/state/types/COMGeometry.d.ts +0 -7
  255. package/build/src/modules/state/types/COMGeometryType.d.ts +0 -1
  256. package/build/src/modules/state/types/COMGroup.d.ts +0 -11
  257. package/build/src/modules/state/types/COMLight.d.ts +0 -28
  258. package/build/src/modules/state/types/COMModel.d.ts +0 -14
  259. package/build/src/modules/state/types/COMPov.d.ts +0 -10
  260. package/build/src/modules/state/types/COMPrimitive.d.ts +0 -14
  261. package/build/src/modules/state/types/index.d.ts +0 -11
  262. package/build/src/modules/systeminfo/SystemInfo.cjs +0 -1
  263. package/build/src/modules/systeminfo/SystemInfo.mjs +0 -5
  264. package/build/src/modules/toolbox/Toolbox.cjs +0 -1
  265. package/build/src/types/SceneData.d.ts +0 -19
  266. package/build/src/types/SceneObjects.d.ts +0 -9
  267. package/build/src/types/UUID.d.ts +0 -1
  268. /package/build/{src/modules/asset/converter/AssetConverter.cjs → plugins/assetconverter/index.cjs} +0 -0
  269. /package/build/{src/modules/asset/converter/AssetConverter.mjs → plugins/assetconverter/index.mjs} +0 -0
  270. /package/build/src/{modules/animation → plugins/animation/src}/types/AnimatorParameters.d.ts +0 -0
  271. /package/build/src/{modules/state → plugins/state/src}/ActionRegistry.d.ts +0 -0
  272. /package/build/src/{modules/state → plugins/state/src}/actions/ar/index.d.ts +0 -0
  273. /package/build/src/{modules/state → plugins/state/src}/actions/camera/index.d.ts +0 -0
  274. /package/build/src/{modules/state → plugins/state/src}/actions/index.d.ts +0 -0
  275. /package/build/src/{modules/state → plugins/state/src}/actions/media/index.d.ts +0 -0
  276. /package/build/src/{modules/state → plugins/state/src}/actions/object/index.d.ts +0 -0
  277. /package/build/src/{modules/state → plugins/state/src}/actions/renderer/index.d.ts +0 -0
  278. /package/build/src/{modules/state → plugins/state/src}/actions/scene/index.d.ts +0 -0
  279. /package/build/src/{modules/state → plugins/state/src}/actions/toolbox/index.d.ts +0 -0
  280. /package/build/src/{types/info → plugins/systeminfo/types}/index.d.ts +0 -0
@@ -0,0 +1,39 @@
1
+ const e = "@shopware-ag/dive", i = "2.0.1-beta.11", s = "Shopware Spatial Framework", t = "module", n = "build/dive.cjs", r = "build/dive.mjs", d = "build/dive.d.ts", o = { ".": { types: "./build/dive.d.ts", import: "./build/dive.mjs", require: "./build/dive.cjs" }, "./animation": { types: "./build/plugins/animation/index.d.ts", import: "./build/plugins/animation/index.mjs", require: "./build/plugins/animation/index.cjs" }, "./ar": { types: "./build/plugins/ar/index.d.ts", import: "./build/plugins/ar/index.mjs", require: "./build/plugins/ar/index.cjs" }, "./assetcache": { types: "./build/plugins/assetcache/index.d.ts", import: "./build/plugins/assetcache/index.mjs", require: "./build/plugins/assetcache/index.cjs" }, "./assetconverter": { types: "./build/plugins/assetconverter/index.d.ts", import: "./build/plugins/assetconverter/index.mjs", require: "./build/plugins/assetconverter/index.cjs" }, "./assetexporter": { types: "./build/plugins/assetexporter/index.d.ts", import: "./build/plugins/assetexporter/index.mjs", require: "./build/plugins/assetexporter/index.cjs" }, "./assetloader": { types: "./build/plugins/assetloader/index.d.ts", import: "./build/plugins/assetloader/index.mjs", require: "./build/plugins/assetloader/index.cjs" }, "./mediacreator": { types: "./build/plugins/mediacreator/index.d.ts", import: "./build/plugins/mediacreator/index.mjs", require: "./build/plugins/mediacreator/index.cjs" }, "./orbitcontroller": { types: "./build/plugins/orbitcontroller/index.d.ts", import: "./build/plugins/orbitcontroller/index.mjs", require: "./build/plugins/orbitcontroller/index.cjs" }, "./orientationdisplay": { types: "./build/plugins/orientationdisplay/index.d.ts", import: "./build/plugins/orientationdisplay/index.mjs", require: "./build/plugins/orientationdisplay/index.cjs" }, "./state": { types: "./build/plugins/state/index.d.ts", import: "./build/plugins/state/index.mjs", require: "./build/plugins/state/index.cjs" }, "./systeminfo": { types: "./build/plugins/systeminfo/index.d.ts", import: "./build/plugins/systeminfo/index.mjs", require: "./build/plugins/systeminfo/index.cjs" }, "./toolbox": { types: "./build/plugins/toolbox/index.d.ts", import: "./build/plugins/toolbox/index.mjs", require: "./build/plugins/toolbox/index.cjs" } }, l = ["build", "LICENSE", "package.json"], a = ["dive", "shopware", "sw6", "three", "three.js", "3d", "typescript"], p = "git@github.com:shopware/dive.git", u = "ffrank <f.frank@shopware.com>", c = "MIT", b = ["> 1%, not dead, not ie 11, not op_mini all"], g = { three: "^0.163.0", "@tweenjs/tween.js": "^23.1.1", "three-spritetext": "^1.8.2", lodash: "^4.17.21" }, m = { "@eslint/js": "^9.1.1", "@testing-library/jest-dom": "^6.6.3", "@types/jest": "^29.5.12", "@types/lodash": "^4.17.12", "@types/node": "^20.12.7", "@types/three": "^0.163.0", "@vitest/coverage-v8": "3.1.2", acorn: "^8.14.1", "acorn-walk": "^8.3.4", eslint: "^9.1.1", glob: "^11.0.1", globals: "^15.0.0", jsdom: "^26.1.0", "log-update": "^6.1.0", "magic-string": "^0.30.17", prettier: "^3.3.3", "prettier-plugin-multiline-arrays": "^3.0.6", "rollup-plugin-copy": "^3.5.0", "ts-jest": "^29.1.2", "ts-morph": "^25.0.1", "ts-node": "^10.9.2", tsc: "^2.0.4", tsx: "^4.19.4", typescript: "^5.8.2", "typescript-eslint": "^7.7.1", vite: "^6.2.1", "vite-plugin-dts": "^4.5.3", "vite-plugin-wasm": "^3.4.1", "vite-tsconfig-paths": "^5.1.4", vitest: "^3.1.2" }, x = { "validate-build-paths": "NODE_OPTIONS='--loader ts-node/esm' ts-node ci/build/validate-build-paths.ts", build: "vite build", dev: "vite build --watch", lint: "eslint", "prettier:check": "prettier --check .", "prettier:fix": "prettier --write .", unit: "vitest --run", coverage: "vitest --coverage --run", docs: "yarn docs:actions && yarn docs:modules", "docs:actions": "tsx docs/generators/generate-actions-docs.ts", "docs:modules": "tsx docs/generators/generate-modules-docs.ts", ci: "yarn && yarn lint && yarn prettier:check && yarn coverage && yarn build" }, y = {
2
+ name: e,
3
+ version: i,
4
+ description: s,
5
+ type: t,
6
+ main: n,
7
+ module: r,
8
+ types: d,
9
+ exports: o,
10
+ files: l,
11
+ keywords: a,
12
+ repository: p,
13
+ author: u,
14
+ license: c,
15
+ browserslist: b,
16
+ dependencies: g,
17
+ devDependencies: m,
18
+ scripts: x
19
+ };
20
+ export {
21
+ u as author,
22
+ b as browserslist,
23
+ y as default,
24
+ g as dependencies,
25
+ s as description,
26
+ m as devDependencies,
27
+ o as exports,
28
+ l as files,
29
+ a as keywords,
30
+ c as license,
31
+ n as main,
32
+ r as module,
33
+ e as name,
34
+ p as repository,
35
+ x as scripts,
36
+ t as type,
37
+ d as types,
38
+ i as version
39
+ };
@@ -0,0 +1,14 @@
1
+ class t extends Error {
2
+ constructor(r, e) {
3
+ super(r), this.requestedFileType = e, this.name = "FileTypeError";
4
+ }
5
+ }
6
+ class a extends Error {
7
+ constructor(r, e) {
8
+ super(`Failed to parse array buffer from ${r}`), this.uri = r, this.cause = e, this.name = "ParseError";
9
+ }
10
+ }
11
+ export {
12
+ t as F,
13
+ a as P
14
+ };
@@ -0,0 +1 @@
1
+ "use strict";class t extends Error{constructor(r,e){super(r),this.requestedFileType=e,this.name="FileTypeError"}}class o extends Error{constructor(r,e){super(`Failed to parse array buffer from ${r}`),this.uri=r,this.cause=e,this.name="ParseError"}}exports.FileTypeError=t;exports.ParseError=o;
package/build/dive.cjs CHANGED
@@ -1,30 +1 @@
1
- "use strict";var ht=Object.defineProperty;var dt=(c,n,t)=>n in c?ht(c,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):c[n]=t;var l=(c,n,t)=>dt(c,typeof n!="symbol"?n+"":n,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("three"),ae=require("three-spritetext"),y=require("./chunks/VisibilityLayerMask-BI7jPKdx.cjs"),P=require("./chunks/findInterface-BEdL2iUQ.cjs"),E=require("./chunks/ModuleRegistry-NyNtjHb2.cjs"),ke=require("./chunks/PerspectiveCamera-BByyG5R4.cjs"),Q=require("./chunks/FileTypes-BjZ0rrIV.cjs"),Be=require("./chunks/index-DAwIH9xh.cjs"),Re={type:"change"},le={type:"start"},ve={type:"end"},q=new s.Ray,Ve=new s.Plane,ut=Math.cos(70*s.MathUtils.DEG2RAD);class mt extends s.EventDispatcher{constructor(n,t){super(),this.object=n,this.domElement=t,this.domElement.style.touchAction="none",this.enabled=!0,this.target=new s.Vector3,this.cursor=new s.Vector3,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minTargetRadius=0,this.maxTargetRadius=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.zoomToCursor=!1,this.autoRotate=!1,this.autoRotateSpeed=2,this.keys={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"},this.mouseButtons={LEFT:s.MOUSE.ROTATE,MIDDLE:s.MOUSE.DOLLY,RIGHT:s.MOUSE.PAN},this.touches={ONE:s.TOUCH.ROTATE,TWO:s.TOUCH.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._domElementKeyEvents=null,this.getPolarAngle=function(){return h.phi},this.getAzimuthalAngle=function(){return h.theta},this.getDistance=function(){return this.object.position.distanceTo(this.target)},this.listenToKeyEvents=function(i){i.addEventListener("keydown",re),this._domElementKeyEvents=i},this.stopListenToKeyEvents=function(){this._domElementKeyEvents.removeEventListener("keydown",re),this._domElementKeyEvents=null},this.saveState=function(){e.target0.copy(e.target),e.position0.copy(e.object.position),e.zoom0=e.object.zoom},this.reset=function(){e.target.copy(e.target0),e.object.position.copy(e.position0),e.object.zoom=e.zoom0,e.object.updateProjectionMatrix(),e.dispatchEvent(Re),e.update(),r=o.NONE},this.update=function(){const i=new s.Vector3,a=new s.Quaternion().setFromUnitVectors(n.up,new s.Vector3(0,1,0)),u=a.clone().invert(),m=new s.Vector3,b=new s.Quaternion,x=new s.Vector3,w=2*Math.PI;return function(ct=null){const Oe=e.object.position;i.copy(Oe).sub(e.target),i.applyQuaternion(a),h.setFromVector3(i),e.autoRotate&&r===o.NONE&&N(He(ct)),e.enableDamping?(h.theta+=p.theta*e.dampingFactor,h.phi+=p.phi*e.dampingFactor):(h.theta+=p.theta,h.phi+=p.phi);let S=e.minAzimuthAngle,M=e.maxAzimuthAngle;isFinite(S)&&isFinite(M)&&(S<-Math.PI?S+=w:S>Math.PI&&(S-=w),M<-Math.PI?M+=w:M>Math.PI&&(M-=w),S<=M?h.theta=Math.max(S,Math.min(M,h.theta)):h.theta=h.theta>(S+M)/2?Math.max(S,h.theta):Math.min(M,h.theta)),h.phi=Math.max(e.minPolarAngle,Math.min(e.maxPolarAngle,h.phi)),h.makeSafe(),e.enableDamping===!0?e.target.addScaledVector(_,e.dampingFactor):e.target.add(_),e.target.sub(e.cursor),e.target.clampLength(e.minTargetRadius,e.maxTargetRadius),e.target.add(e.cursor);let G=!1;if(e.zoomToCursor&&K||e.object.isOrthographicCamera)h.radius=ne(h.radius);else{const T=h.radius;h.radius=ne(h.radius*f),G=T!=h.radius}if(i.setFromSpherical(h),i.applyQuaternion(u),Oe.copy(e.target).add(i),e.object.lookAt(e.target),e.enableDamping===!0?(p.theta*=1-e.dampingFactor,p.phi*=1-e.dampingFactor,_.multiplyScalar(1-e.dampingFactor)):(p.set(0,0,0),_.set(0,0,0)),e.zoomToCursor&&K){let T=null;if(e.object.isPerspectiveCamera){const j=i.length();T=ne(j*f);const X=j-T;e.object.position.addScaledVector(ue,X),e.object.updateMatrixWorld(),G=!!X}else if(e.object.isOrthographicCamera){const j=new s.Vector3(L.x,L.y,0);j.unproject(e.object);const X=e.object.zoom;e.object.zoom=Math.max(e.minZoom,Math.min(e.maxZoom,e.object.zoom/f)),e.object.updateProjectionMatrix(),G=X!==e.object.zoom;const Ae=new s.Vector3(L.x,L.y,0);Ae.unproject(e.object),e.object.position.sub(Ae).add(j),e.object.updateMatrixWorld(),T=i.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),e.zoomToCursor=!1;T!==null&&(this.screenSpacePanning?e.target.set(0,0,-1).transformDirection(e.object.matrix).multiplyScalar(T).add(e.object.position):(q.origin.copy(e.object.position),q.direction.set(0,0,-1).transformDirection(e.object.matrix),Math.abs(e.object.up.dot(q.direction))<ut?n.lookAt(e.target):(Ve.setFromNormalAndCoplanarPoint(e.object.up,e.target),q.intersectPlane(Ve,e.target))))}else if(e.object.isOrthographicCamera){const T=e.object.zoom;e.object.zoom=Math.max(e.minZoom,Math.min(e.maxZoom,e.object.zoom/f)),T!==e.object.zoom&&(e.object.updateProjectionMatrix(),G=!0)}return f=1,K=!1,G||m.distanceToSquared(e.object.position)>d||8*(1-b.dot(e.object.quaternion))>d||x.distanceToSquared(e.target)>d?(e.dispatchEvent(Re),m.copy(e.object.position),b.copy(e.object.quaternion),x.copy(e.target),!0):!1}}(),this.dispose=function(){e.domElement.removeEventListener("contextmenu",Ce),e.domElement.removeEventListener("pointerdown",Me),e.domElement.removeEventListener("pointercancel",F),e.domElement.removeEventListener("wheel",Te),e.domElement.removeEventListener("pointermove",oe),e.domElement.removeEventListener("pointerup",F),e.domElement.getRootNode().removeEventListener("keydown",Le,{capture:!0}),e._domElementKeyEvents!==null&&(e._domElementKeyEvents.removeEventListener("keydown",re),e._domElementKeyEvents=null)};const e=this,o={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6};let r=o.NONE;const d=1e-6,h=new s.Spherical,p=new s.Spherical;let f=1;const _=new s.Vector3,C=new s.Vector2,I=new s.Vector2,v=new s.Vector2,O=new s.Vector2,A=new s.Vector2,V=new s.Vector2,k=new s.Vector2,B=new s.Vector2,R=new s.Vector2,ue=new s.Vector3,L=new s.Vector2;let K=!1;const g=[],Y={};let te=!1;function He(i){return i!==null?2*Math.PI/60*e.autoRotateSpeed*i:2*Math.PI/60/60*e.autoRotateSpeed}function W(i){const a=Math.abs(i*.01);return Math.pow(.95,e.zoomSpeed*a)}function N(i){p.theta-=i}function Z(i){p.phi-=i}const me=function(){const i=new s.Vector3;return function(u,m){i.setFromMatrixColumn(m,0),i.multiplyScalar(-u),_.add(i)}}(),pe=function(){const i=new s.Vector3;return function(u,m){e.screenSpacePanning===!0?i.setFromMatrixColumn(m,1):(i.setFromMatrixColumn(m,0),i.crossVectors(e.object.up,i)),i.multiplyScalar(u),_.add(i)}}(),U=function(){const i=new s.Vector3;return function(u,m){const b=e.domElement;if(e.object.isPerspectiveCamera){const x=e.object.position;i.copy(x).sub(e.target);let w=i.length();w*=Math.tan(e.object.fov/2*Math.PI/180),me(2*u*w/b.clientHeight,e.object.matrix),pe(2*m*w/b.clientHeight,e.object.matrix)}else e.object.isOrthographicCamera?(me(u*(e.object.right-e.object.left)/e.object.zoom/b.clientWidth,e.object.matrix),pe(m*(e.object.top-e.object.bottom)/e.object.zoom/b.clientHeight,e.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),e.enablePan=!1)}}();function ie(i){e.object.isPerspectiveCamera||e.object.isOrthographicCamera?f/=i:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),e.enableZoom=!1)}function fe(i){e.object.isPerspectiveCamera||e.object.isOrthographicCamera?f*=i:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),e.enableZoom=!1)}function se(i,a){if(!e.zoomToCursor)return;K=!0;const u=e.domElement.getBoundingClientRect(),m=i-u.left,b=a-u.top,x=u.width,w=u.height;L.x=m/x*2-1,L.y=-(b/w)*2+1,ue.set(L.x,L.y,1).unproject(e.object).sub(e.object.position).normalize()}function ne(i){return Math.max(e.minDistance,Math.min(e.maxDistance,i))}function ge(i){C.set(i.clientX,i.clientY)}function Ke(i){se(i.clientX,i.clientX),k.set(i.clientX,i.clientY)}function _e(i){O.set(i.clientX,i.clientY)}function We(i){I.set(i.clientX,i.clientY),v.subVectors(I,C).multiplyScalar(e.rotateSpeed);const a=e.domElement;N(2*Math.PI*v.x/a.clientHeight),Z(2*Math.PI*v.y/a.clientHeight),C.copy(I),e.update()}function Ze(i){B.set(i.clientX,i.clientY),R.subVectors(B,k),R.y>0?ie(W(R.y)):R.y<0&&fe(W(R.y)),k.copy(B),e.update()}function Xe(i){A.set(i.clientX,i.clientY),V.subVectors(A,O).multiplyScalar(e.panSpeed),U(V.x,V.y),O.copy(A),e.update()}function qe(i){se(i.clientX,i.clientY),i.deltaY<0?fe(W(i.deltaY)):i.deltaY>0&&ie(W(i.deltaY)),e.update()}function Je(i){let a=!1;switch(i.code){case e.keys.UP:i.ctrlKey||i.metaKey||i.shiftKey?Z(2*Math.PI*e.rotateSpeed/e.domElement.clientHeight):U(0,e.keyPanSpeed),a=!0;break;case e.keys.BOTTOM:i.ctrlKey||i.metaKey||i.shiftKey?Z(-2*Math.PI*e.rotateSpeed/e.domElement.clientHeight):U(0,-e.keyPanSpeed),a=!0;break;case e.keys.LEFT:i.ctrlKey||i.metaKey||i.shiftKey?N(2*Math.PI*e.rotateSpeed/e.domElement.clientHeight):U(e.keyPanSpeed,0),a=!0;break;case e.keys.RIGHT:i.ctrlKey||i.metaKey||i.shiftKey?N(-2*Math.PI*e.rotateSpeed/e.domElement.clientHeight):U(-e.keyPanSpeed,0),a=!0;break}a&&(i.preventDefault(),e.update())}function ye(i){if(g.length===1)C.set(i.pageX,i.pageY);else{const a=z(i),u=.5*(i.pageX+a.x),m=.5*(i.pageY+a.y);C.set(u,m)}}function be(i){if(g.length===1)O.set(i.pageX,i.pageY);else{const a=z(i),u=.5*(i.pageX+a.x),m=.5*(i.pageY+a.y);O.set(u,m)}}function Ee(i){const a=z(i),u=i.pageX-a.x,m=i.pageY-a.y,b=Math.sqrt(u*u+m*m);k.set(0,b)}function $e(i){e.enableZoom&&Ee(i),e.enablePan&&be(i)}function Qe(i){e.enableZoom&&Ee(i),e.enableRotate&&ye(i)}function we(i){if(g.length==1)I.set(i.pageX,i.pageY);else{const u=z(i),m=.5*(i.pageX+u.x),b=.5*(i.pageY+u.y);I.set(m,b)}v.subVectors(I,C).multiplyScalar(e.rotateSpeed);const a=e.domElement;N(2*Math.PI*v.x/a.clientHeight),Z(2*Math.PI*v.y/a.clientHeight),C.copy(I)}function De(i){if(g.length===1)A.set(i.pageX,i.pageY);else{const a=z(i),u=.5*(i.pageX+a.x),m=.5*(i.pageY+a.y);A.set(u,m)}V.subVectors(A,O).multiplyScalar(e.panSpeed),U(V.x,V.y),O.copy(A)}function Se(i){const a=z(i),u=i.pageX-a.x,m=i.pageY-a.y,b=Math.sqrt(u*u+m*m);B.set(0,b),R.set(0,Math.pow(B.y/k.y,e.zoomSpeed)),ie(R.y),k.copy(B);const x=(i.pageX+a.x)*.5,w=(i.pageY+a.y)*.5;se(x,w)}function et(i){e.enableZoom&&Se(i),e.enablePan&&De(i)}function tt(i){e.enableZoom&&Se(i),e.enableRotate&&we(i)}function Me(i){e.enabled!==!1&&(g.length===0&&(e.domElement.setPointerCapture(i.pointerId),e.domElement.addEventListener("pointermove",oe),e.domElement.addEventListener("pointerup",F)),!lt(i)&&(rt(i),i.pointerType==="touch"?Pe(i):it(i)))}function oe(i){e.enabled!==!1&&(i.pointerType==="touch"?ot(i):st(i))}function F(i){switch(at(i),g.length){case 0:e.domElement.releasePointerCapture(i.pointerId),e.domElement.removeEventListener("pointermove",oe),e.domElement.removeEventListener("pointerup",F),e.dispatchEvent(ve),r=o.NONE;break;case 1:const a=g[0],u=Y[a];Pe({pointerId:a,pageX:u.x,pageY:u.y});break}}function it(i){let a;switch(i.button){case 0:a=e.mouseButtons.LEFT;break;case 1:a=e.mouseButtons.MIDDLE;break;case 2:a=e.mouseButtons.RIGHT;break;default:a=-1}switch(a){case s.MOUSE.DOLLY:if(e.enableZoom===!1)return;Ke(i),r=o.DOLLY;break;case s.MOUSE.ROTATE:if(i.ctrlKey||i.metaKey||i.shiftKey){if(e.enablePan===!1)return;_e(i),r=o.PAN}else{if(e.enableRotate===!1)return;ge(i),r=o.ROTATE}break;case s.MOUSE.PAN:if(i.ctrlKey||i.metaKey||i.shiftKey){if(e.enableRotate===!1)return;ge(i),r=o.ROTATE}else{if(e.enablePan===!1)return;_e(i),r=o.PAN}break;default:r=o.NONE}r!==o.NONE&&e.dispatchEvent(le)}function st(i){switch(r){case o.ROTATE:if(e.enableRotate===!1)return;We(i);break;case o.DOLLY:if(e.enableZoom===!1)return;Ze(i);break;case o.PAN:if(e.enablePan===!1)return;Xe(i);break}}function Te(i){e.enabled===!1||e.enableZoom===!1||r!==o.NONE||(i.preventDefault(),e.dispatchEvent(le),qe(nt(i)),e.dispatchEvent(ve))}function nt(i){const a=i.deltaMode,u={clientX:i.clientX,clientY:i.clientY,deltaY:i.deltaY};switch(a){case 1:u.deltaY*=16;break;case 2:u.deltaY*=100;break}return i.ctrlKey&&!te&&(u.deltaY*=10),u}function Le(i){i.key==="Control"&&(te=!0,e.domElement.getRootNode().addEventListener("keyup",xe,{passive:!0,capture:!0}))}function xe(i){i.key==="Control"&&(te=!1,e.domElement.getRootNode().removeEventListener("keyup",xe,{passive:!0,capture:!0}))}function re(i){e.enabled===!1||e.enablePan===!1||Je(i)}function Pe(i){switch(Ie(i),g.length){case 1:switch(e.touches.ONE){case s.TOUCH.ROTATE:if(e.enableRotate===!1)return;ye(i),r=o.TOUCH_ROTATE;break;case s.TOUCH.PAN:if(e.enablePan===!1)return;be(i),r=o.TOUCH_PAN;break;default:r=o.NONE}break;case 2:switch(e.touches.TWO){case s.TOUCH.DOLLY_PAN:if(e.enableZoom===!1&&e.enablePan===!1)return;$e(i),r=o.TOUCH_DOLLY_PAN;break;case s.TOUCH.DOLLY_ROTATE:if(e.enableZoom===!1&&e.enableRotate===!1)return;Qe(i),r=o.TOUCH_DOLLY_ROTATE;break;default:r=o.NONE}break;default:r=o.NONE}r!==o.NONE&&e.dispatchEvent(le)}function ot(i){switch(Ie(i),r){case o.TOUCH_ROTATE:if(e.enableRotate===!1)return;we(i),e.update();break;case o.TOUCH_PAN:if(e.enablePan===!1)return;De(i),e.update();break;case o.TOUCH_DOLLY_PAN:if(e.enableZoom===!1&&e.enablePan===!1)return;et(i),e.update();break;case o.TOUCH_DOLLY_ROTATE:if(e.enableZoom===!1&&e.enableRotate===!1)return;tt(i),e.update();break;default:r=o.NONE}}function Ce(i){e.enabled!==!1&&i.preventDefault()}function rt(i){g.push(i.pointerId)}function at(i){delete Y[i.pointerId];for(let a=0;a<g.length;a++)if(g[a]==i.pointerId){g.splice(a,1);return}}function lt(i){for(let a=0;a<g.length;a++)if(g[a]==i.pointerId)return!0;return!1}function Ie(i){let a=Y[i.pointerId];a===void 0&&(a=new s.Vector2,Y[i.pointerId]=a),a.set(i.pageX,i.pageY)}function z(i){const a=i.pointerId===g[0]?g[1]:g[0];return Y[a]}e.domElement.addEventListener("contextmenu",Ce),e.domElement.addEventListener("pointerdown",Me),e.domElement.addEventListener("pointercancel",F),e.domElement.addEventListener("wheel",Te,{passive:!1}),e.domElement.getRootNode().addEventListener("keydown",Le,{passive:!0,capture:!0}),this.update()}}const J={enableDamping:!0,dampingFactor:.05},H=class H extends mt{constructor(t,e,o=J){super(t,e);l(this,"uuid",s.MathUtils.generateUUID());l(this,"object");this.domElement=e,this.domElement=e,this.object=t,this.enableDamping=o.enableDamping??J.enableDamping,this.dampingFactor=o.dampingFactor??J.dampingFactor,this.object.position.set(0,2,2),this.target.copy({x:0,y:.5,z:0}),this.update()}tick(){this.enabled&&this.update()}computeEncompassingView(t){const e=t.getCenter(new s.Vector3),o=t.getSize(new s.Vector3),r=Math.max(o.x,o.y,o.z)*1.25;return{position:this.object.position.clone().normalize().clone().multiplyScalar(r),target:e.clone()}}zoomIn(t){const e=t||H.DEFAULT_ZOOM_FACTOR,{minDistance:o,maxDistance:r}=this;this.minDistance=this.maxDistance=s.MathUtils.clamp(this.getDistance()-e,o+e,r-e),this.update(),this.minDistance=o,this.maxDistance=r}zoomOut(t){const e=t||H.DEFAULT_ZOOM_FACTOR,{minDistance:o,maxDistance:r}=this;this.minDistance=this.maxDistance=s.MathUtils.clamp(this.getDistance()+e,o+e,r-e),this.update(),this.minDistance=o,this.maxDistance=r}};l(H,"DEFAULT_ZOOM_FACTOR",1);let $=H;class pt extends s.OrthographicCamera{constructor(t,e,o){super(-1,1,1,-1,.1,100);l(this,"axesHelper");l(this,"_renderer");l(this,"_scene");l(this,"_camera");l(this,"_restoreViewport",new s.Vector4);this.layers.mask=y.COORDINATE_LAYER_MASK,this.axesHelper=new s.AxesHelper(.5),this.axesHelper.layers.mask=y.COORDINATE_LAYER_MASK,this.axesHelper.material.depthTest=!1,this.axesHelper.position.set(0,0,-1),this.axesHelper.setColors(new s.Color(P.AxesColorRed),new s.Color(P.AxesColorGreen),new s.Color(P.AxesColorBlue));const r=new ae("X",.2,P.AxesColorRedLetter),d=new ae("Y",.2,P.AxesColorGreenLetter),h=new ae("Z",.2,P.AxesColorBlueLetter);r.layers.mask=y.COORDINATE_LAYER_MASK,d.layers.mask=y.COORDINATE_LAYER_MASK,h.layers.mask=y.COORDINATE_LAYER_MASK,r.position.set(.7,0,0),d.position.set(0,.7,0),h.position.set(0,0,.7),this.axesHelper.add(r),this.axesHelper.add(d),this.axesHelper.add(h),this.add(this.axesHelper),this._renderer=t,this._scene=e,this._camera=o,this._scene.add(this)}tick(){const t=this._scene.background;this._scene.background=null,this._renderer.webglrenderer.getViewport(this._restoreViewport),this._renderer.webglrenderer.setViewport(0,0,150,150),this._renderer.webglrenderer.autoClear=!1,this.SetFromCameraMatrix(this._camera.matrix),this._renderer.webglrenderer.render(this._scene,this),this._renderer.webglrenderer.setViewport(this._restoreViewport),this._renderer.webglrenderer.autoClear=!0,this._scene.background=t}Dispose(){this._scene.remove(this)}SetFromCameraMatrix(t){this.axesHelper.rotation.setFromRotationMatrix(new s.Matrix4().extractRotation(t).invert())}}class ft extends s.Object3D{constructor(){super();l(this,"isDIVELight",!0);l(this,"isDIVEAmbientLight",!0);l(this,"_light");this.name="DIVEAmbientLight",this._light=new s.AmbientLight(16777215,1),this._light.layers.mask=y.PRODUCT_LAYER_MASK,this.add(this._light)}setColor(t){this._light.color=t}setIntensity(t){this._light.intensity=t}setEnabled(t){this._light.visible=t}}class gt extends s.Object3D{constructor(){super();l(this,"isDIVELight",!0);l(this,"isDIVEPointLight",!0);l(this,"isMovable",!0);l(this,"isSelectable",!0);l(this,"gizmo",null);l(this,"light");l(this,"mesh");this.name="DIVEPointLight",this.light=new s.PointLight(16777215,1),this.light.layers.mask=y.PRODUCT_LAYER_MASK,this.light.castShadow=!0,this.light.shadow.mapSize.width=512,this.light.shadow.mapSize.height=512,this.add(this.light);const t=.1,e=new s.SphereGeometry(t,t*320,t*320),o=new s.MeshBasicMaterial({color:this.light.color,transparent:!0,opacity:.8,side:s.FrontSide});this.mesh=new s.Mesh(e,o),this.mesh.layers.mask=y.UI_LAYER_MASK,this.add(this.mesh)}setColor(t){this.light.color=t,this.mesh.material.color=t}setIntensity(t){this.light.intensity=t,this.mesh.material.opacity=t>.8?.8:t*.8}setEnabled(t){this.light.visible=t}onMove(){E.getModule("State").then(t=>{var e;(e=t.get(this.userData.id))==null||e.performAction("UPDATE_OBJECT",{id:this.userData.id,position:this.position})})}onSelect(){E.getModule("State").then(t=>{var e;(e=t.get(this.userData.id))==null||e.performAction("SELECT_OBJECT",{id:this.userData.id})})}onDeselect(){E.getModule("State").then(t=>{var e;(e=t.get(this.userData.id))==null||e.performAction("DESELECT_OBJECT",{id:this.userData.id})})}}class Ue extends s.Object3D{constructor(){super();l(this,"isDIVELight",!0);l(this,"isDIVESceneLight",!0);l(this,"_hemiLight");l(this,"_dirLight");this.name="DIVESceneLight",this._hemiLight=new s.HemisphereLight(16777215,16777215,2),this._hemiLight.layers.mask=y.PRODUCT_LAYER_MASK,this._hemiLight.position.set(0,50,0),this.add(this._hemiLight),this._dirLight=new s.DirectionalLight(16777215,3),this._dirLight.layers.mask=y.PRODUCT_LAYER_MASK,this._dirLight.position.set(1,1.75,1),this._dirLight.position.multiplyScalar(30),this._dirLight.castShadow=!0,this._dirLight.shadow.mapSize.width=2048,this._dirLight.shadow.mapSize.height=2048;const t=5;this._dirLight.shadow.camera.left=-5,this._dirLight.shadow.camera.right=t,this._dirLight.shadow.camera.top=t,this._dirLight.shadow.camera.bottom=-5,this._dirLight.shadow.camera.far=3500,this.add(this._dirLight)}setColor(t){this._hemiLight.color=t,this._dirLight.color=t}setIntensity(t){this._hemiLight.intensity=t*2,this._dirLight.intensity=t*3}setEnabled(t){this._hemiLight.visible=t,this._dirLight.visible=t}}const ee=c=>c.parent?ee(c.parent):c;class _t{constructor(){l(this,"isMovable",!0)}}class yt{constructor(){l(this,"isSelectable",!0)}}function ze(c,n){return n.forEach(t=>{Object.getOwnPropertyNames(t.prototype).forEach(e=>{Object.defineProperty(c.prototype,e,Object.getOwnPropertyDescriptor(t.prototype,e))})}),c}class he extends ze(s.Object3D,[yt,_t]){constructor(){super();l(this,"isDIVENode",!0);l(this,"gizmo",null);l(this,"_positionWorldBuffer");l(this,"_boundingBox");this.layers.mask=y.PRODUCT_LAYER_MASK,this._positionWorldBuffer=new s.Vector3,this._boundingBox=new s.Box3}SetPosition(t){if(!this.parent){this.position.set(t.x,t.y,t.z);return}const e=new s.Vector3(t.x,t.y,t.z);this.position.copy(this.parent.worldToLocal(e)),"isDIVEGroup"in this.parent&&this.parent.UpdateLineTo(this)}SetRotation(t){this.rotation.set(t.x,t.y,t.z)}SetScale(t){this.scale.set(t.x,t.y,t.z)}setVisibility(t){this.visible=t}SetToWorldOrigin(){this.position.set(0,0,0),E.getModule("State").then(t=>{var e;(e=t.get(this.userData.id))==null||e.performAction("UPDATE_OBJECT",{id:this.userData.id,position:this.getWorldPosition(this._positionWorldBuffer),rotation:this.rotation,scale:this.scale})})}onMove(){E.getModule("State").then(t=>{var e;(e=t.get(this.userData.id))==null||e.performAction("UPDATE_OBJECT",{id:this.userData.id,position:this.getWorldPosition(this._positionWorldBuffer),rotation:this.rotation,scale:this.scale})})}onSelect(){E.getModule("State").then(t=>{var e;(e=t.get(this.userData.id))==null||e.performAction("SELECT_OBJECT",{id:this.userData.id})})}onDeselect(){E.getModule("State").then(t=>{var e;(e=t.get(this.userData.id))==null||e.performAction("DESELECT_OBJECT",{id:this.userData.id})})}}class Ye extends he{constructor(){super(...arguments);l(this,"isDIVEModel",!0);l(this,"_mesh",null);l(this,"_material",null);l(this,"_assetLoader",null)}async _getAssetLoader(){return this._assetLoader||(this._assetLoader=new(await E.getModule("AssetLoader"))),this._assetLoader}async setFromURL(t){const o=await(await this._getAssetLoader()).load(t);this.setFromGLTF(o),E.getModule("State").then(r=>{var d;(d=r.get(this.userData.id))==null||d.performAction("MODEL_LOADED",{id:this.userData.id})})}setFromGLTF(t){this.clear(),this._boundingBox.makeEmpty(),t.traverse(e=>{e.castShadow=!0,e.receiveShadow=!0,e.layers.mask=this.layers.mask,this._boundingBox.expandByObject(e),!this._mesh&&"isMesh"in e&&(this._mesh=e,this._material?this._mesh.material=this._material:this._material=e.material)}),this.add(t)}setMaterial(t){this._material||(this._material=new s.MeshStandardMaterial),t.vertexColors!==void 0&&(this._material.vertexColors=t.vertexColors),t.color!==void 0&&this._material.color.set(t.color),t.map!==void 0&&(this._material.map=t.map),t.normalMap!==void 0&&(this._material.normalMap=t.normalMap),t.roughness!==void 0&&(this._material.roughness=t.roughness),t.roughnessMap!==void 0&&(this._material.roughnessMap=t.roughnessMap,this._material.roughnessMap&&(this._material.roughness=1)),t.metalness!==void 0&&(this._material.metalness=t.metalness),t.metalnessMap!==void 0&&(this._material.metalnessMap=t.metalnessMap,this._material.metalnessMap&&(this._material.metalness=1)),this._mesh&&(this._mesh.material=this._material)}placeOnFloor(){var r,d,h,p;const t=this.getWorldPosition(this._positionWorldBuffer),e=t.clone();(d=(r=this._mesh)==null?void 0:r.geometry)==null||d.computeBoundingBox();const o=(p=(h=this._mesh)==null?void 0:h.geometry)==null?void 0:p.boundingBox;!o||!this._mesh||(t.y=t.y-this._mesh.localToWorld(o.min.clone()).y,t.y!==e.y&&E.getModule("State").then(f=>{var _;(_=f.get(this.userData.id))==null||_.performAction("UPDATE_OBJECT",{id:this.userData.id,position:t,rotation:this.rotation,scale:this.scale})}))}dropIt(){if(!this.parent){console.warn("DIVEModel: dropIt() called on a model that is not in the scene.",this);return}const t=this._boundingBox.min.y*this.scale.y,e=this.localToWorld(this._boundingBox.getCenter(new s.Vector3).multiply(this.scale));e.y=t+this.position.y;const o=new s.Raycaster(e,new s.Vector3(0,-1,0));o.layers.mask=y.PRODUCT_LAYER_MASK;const r=o.intersectObjects(ee(this).root.children,!0);if(r.length>0){const d=r[0].object;d.geometry.computeBoundingBox();const h=d.geometry.boundingBox,p=d.localToWorld(h.max.clone()),f=this.position.clone(),_=this.position.clone().setY(p.y).sub(new s.Vector3(0,t,0));if(this.position.copy(_),this.position.y===f.y)return;this.onMove()}}}class bt extends he{constructor(){super();l(this,"isDIVEPrimitive",!0);l(this,"_mesh");this._mesh=new s.Mesh,this._mesh.layers.mask=y.PRODUCT_LAYER_MASK,this._mesh.castShadow=!0,this._mesh.receiveShadow=!0,this._mesh.material=new s.MeshStandardMaterial,this.add(this._mesh)}SetGeometry(t){const e=this.assembleGeometry(t);e&&(this._mesh.geometry=e,this._boundingBox.setFromObject(this._mesh))}setMaterial(t){const e=this._mesh.material;t.vertexColors!==void 0&&(e.vertexColors=t.vertexColors),t.color!==void 0&&(e.color=new s.Color(t.color)),t.map!==void 0&&(e.map=t.map),t.normalMap!==void 0&&(e.normalMap=t.normalMap),t.roughness!==void 0&&(e.roughness=t.roughness),t.roughnessMap!==void 0&&(e.roughnessMap=t.roughnessMap,e.roughnessMap&&(e.roughness=1)),t.metalness!==void 0&&(e.metalness=t.metalness),t.metalnessMap!==void 0&&(e.metalnessMap=t.metalnessMap,e.metalnessMap&&(e.metalness=0)),this._mesh&&(this._mesh.material=e)}placeOnFloor(){var r,d,h,p;const t=this.getWorldPosition(this._positionWorldBuffer),e=t.clone();(d=(r=this._mesh)==null?void 0:r.geometry)==null||d.computeBoundingBox();const o=(p=(h=this._mesh)==null?void 0:h.geometry)==null?void 0:p.boundingBox;!o||!this._mesh||(t.y=t.y-this._mesh.localToWorld(o.min.clone()).y,t.y!==e.y&&E.getModule("State").then(f=>{var _;(_=f.get(this.userData.id))==null||_.performAction("UPDATE_OBJECT",{id:this.userData.id,position:t,rotation:this.rotation,scale:this.scale})}))}dropIt(){if(!this.parent){console.warn("DIVEPrimitive: dropIt() called on a model that is not in the scene.",this);return}const t=this._boundingBox.min.y*this.scale.y,e=this.localToWorld(this._boundingBox.getCenter(new s.Vector3).multiply(this.scale));e.y=t+this.position.y;const o=new s.Raycaster(e,new s.Vector3(0,-1,0));o.layers.mask=y.PRODUCT_LAYER_MASK;const r=o.intersectObjects(ee(this).root.children,!0);if(r.length>0){const d=r[0].object;d.geometry.computeBoundingBox();const h=d.geometry.boundingBox,p=d.localToWorld(h.max.clone()),f=this.position.clone(),_=this.position.clone().setY(p.y).sub(new s.Vector3(0,t,0));if(this.position.copy(_),this.position.y===f.y)return;this.onMove()}}assembleGeometry(t){switch(this._mesh.material.flatShading=!1,t.name.toLowerCase()){case"cylinder":return this.createCylinderGeometry(t);case"sphere":return this.createSphereGeometry(t);case"pyramid":return this._mesh.material.flatShading=!0,this.createPyramidGeometry(t);case"cube":case"box":return this.createBoxGeometry(t);case"cone":return this.createConeGeometry(t);case"wall":return this.createWallGeometry(t);case"plane":return this.createPlaneGeometry(t);default:return console.warn("DIVEPrimitive.assembleGeometry: Invalid geometry type:",t.name.toLowerCase()),null}}createCylinderGeometry(t){const e=new s.CylinderGeometry(t.width/2,t.width/2,t.height,64);return e.translate(0,t.height/2,0),e}createSphereGeometry(t){return new s.SphereGeometry(t.width/2,256,256)}createPyramidGeometry(t){const e=new Float32Array([-t.width/2,0,-t.depth/2,t.width/2,0,-t.depth/2,t.width/2,0,t.depth/2,-t.width/2,0,t.depth/2,0,t.height,0]),o=new Uint16Array([0,1,2,0,2,3,0,4,1,1,4,2,2,4,3,3,4,0]),r=new s.BufferGeometry;return r.setAttribute("position",new s.BufferAttribute(e,3)),r.setIndex(new s.BufferAttribute(o,1)),r.computeVertexNormals(),r.computeBoundingBox(),r.computeBoundingSphere(),r}createBoxGeometry(t){const e=new s.BoxGeometry(t.width,t.height,t.depth);return e.translate(0,t.height/2,0),e}createConeGeometry(t){const e=new s.ConeGeometry(t.width/2,t.height,256);return e.translate(0,t.height/2,0),e}createWallGeometry(t){const e=new s.BoxGeometry(t.width,t.height,t.depth||.05,16);return e.translate(0,t.height/2,0),e}createPlaneGeometry(t){const e=new s.BoxGeometry(t.width,t.height,t.depth);return e.translate(0,t.height/2,0),e}}class Et extends he{constructor(){super();l(this,"isDIVEGroup",!0);l(this,"_members");l(this,"_lines");this.name="DIVEGroup",this._members=[],this._lines=[]}get members(){return this._members}SetPosition(t){super.SetPosition(t),this._members.forEach(e=>{"isDIVENode"in e&&e.onMove()})}SetLinesVisibility(t,e){if(!e){this._lines.forEach(r=>{r.visible=t});return}const o=this._members.indexOf(e);o!==-1&&(this._lines[o].visible=t)}attach(t){if(this._members.includes(t))return this;const e=this.createLine();return this.add(e),this._lines.push(e),super.attach(t),this._members.push(t),this.updateLineTo(e,t),this.SetLinesVisibility(!0,t),this}remove(t){const e=this._members.indexOf(t);if(e===-1)return this;const o=this._lines[e];return super.remove(o),this._lines.splice(e,1),super.remove(t),this._members.splice(e,1),this}UpdateLineTo(t){const e=this._members.indexOf(t);e!==-1&&this.updateLineTo(this._lines[e],t)}createLine(){const t=new s.BufferGeometry,e=new s.LineDashedMaterial({color:6710886,dashSize:.05,gapSize:.025}),o=new s.Line(t,e);return o.visible=!1,o}updateLineTo(t,e){const o=[new s.Vector3(0,0,0),e.position.clone()];t.geometry.setFromPoints(o),t.computeLineDistances()}}class wt extends s.Mesh{constructor(){super(new s.PlaneGeometry(1e4,1e4),new s.MeshStandardMaterial({color:new s.Color(150/255,150/255,150/255)}));l(this,"isDIVEFloor",!0);this.name="Floor",this.layers.mask=y.PRODUCT_LAYER_MASK,this.receiveShadow=!0,this.rotateX(-Math.PI/2)}setVisibility(t){this.visible=t}setColor(t){this.material.color=new s.Color(t)}}class Dt extends s.Object3D{constructor(){super();l(this,"isDIVERoot",!0);l(this,"_floor");l(this,"_assetLoader",null);this.name="Root",this._floor=new wt,this.add(this._floor)}get floor(){return this._floor}async _getAssetLoader(){return this._assetLoader||(this._assetLoader=new(await E.getModule("AssetLoader"))),this._assetLoader}computeSceneBB(){const t=new s.Box3;return this.children.forEach(e=>{"isDIVEFloor"in e||e.traverse(o=>{"isObject3D"in o&&t.expandByObject(o)})}),t}getSceneObject(t){let e;return this.traverse(o=>{e||o.userData.id===t.id&&(e=o)}),e}addSceneObject(t){let e=this.getSceneObject(t);if(e)return console.warn(`DIVERoot.addSceneObject: Scene object with id ${t.id} already exists`),e;switch(t.entityType){case"pov":break;case"light":{switch(t.type){case"scene":{e=new Ue;break}case"ambient":{e=new ft;break}case"point":{e=new gt;break}default:throw new Error(`DIVERoot.addSceneObject: Unknown light type: ${t.type}`)}e.name=t.name,e.userData.id=t.id,this.add(e),this._updateLight(e,t);break}case"model":{e=new Ye,e.name=t.name,e.userData.id=t.id,e.userData.uri=t.uri,this.add(e),this._updateModel(e,t);break}case"primitive":{e=new bt,e.name=t.name,e.userData.id=t.id,this.add(e),this._updatePrimitive(e,t);break}case"group":{e=new Et,e.name=t.name,e.userData.id=t.id,this.add(e),this._updateGroup(e,t);break}default:throw new Error(`DIVERoot.addSceneObject: Unknown entity type: ${t.entityType}`)}return e}updateSceneObject(t){const e=this.getSceneObject(t);if(!e){console.warn(`DIVERoot.updateSceneObject: Scene object with id ${t.id} does not exist`);return}switch(t.entityType){case"pov":break;case"light":{this._updateLight(e,t);break}case"model":{this._updateModel(e,t);break}case"primitive":{this._updatePrimitive(e,t);break}case"group":{this._updateGroup(e,t);break}default:throw new Error(`DIVERoot.updateSceneObject: Unknown entity type: ${t.entityType}`)}}deleteSceneObject(t){const e=this.getSceneObject(t);if(!e){console.warn(`DIVERoot.deleteSceneObject: Object with id ${t.id} not found`);return}switch(t.entityType){case"pov":break;case"light":{this._deleteLight(e);break}case"model":{this._deleteModel(e);break}case"primitive":{this._deletePrimitive(e);break}case"group":{this._deleteGroup(e);break}default:throw new Error(`DIVERoot.deleteSceneObject: Unknown entity type: ${t.entityType}`)}}_updateLight(t,e){e.name!==void 0&&e.name!==null&&(t.name=e.name),e.position!==void 0&&e.position!==null&&t.position.set(e.position.x,e.position.y,e.position.z),e.intensity!==void 0&&e.intensity!==null&&t.setIntensity(e.intensity),e.enabled!==void 0&&e.enabled!==null&&t.setEnabled(e.enabled),e.color!==void 0&&e.color!==null&&t.setColor(new s.Color(e.color)),e.visible!==void 0&&e.visible!==null&&(t.visible=e.visible),e.parentId!==void 0&&this._setParent({...e,parentId:e.parentId})}_updateModel(t,e){e.uri!==void 0&&t.setFromURL(e.uri),e.name!==void 0&&(t.name=e.name),e.position!==void 0&&t.SetPosition(e.position),e.rotation!==void 0&&t.SetRotation(e.rotation),e.scale!==void 0&&t.SetScale(e.scale),e.visible!==void 0&&t.setVisibility(e.visible),e.material!==void 0&&t.setMaterial(e.material),e.parentId!==void 0&&this._setParent({...e,parentId:e.parentId})}_updatePrimitive(t,e){e.name!==void 0&&(t.name=e.name),e.geometry!==void 0&&t.SetGeometry(e.geometry),e.position!==void 0&&t.SetPosition(e.position),e.rotation!==void 0&&t.SetRotation(e.rotation),e.scale!==void 0&&t.SetScale(e.scale),e.visible!==void 0&&t.setVisibility(e.visible),e.material!==void 0&&t.setMaterial(e.material),e.parentId!==void 0&&this._setParent({...e,parentId:e.parentId})}_updateGroup(t,e){e.name!==void 0&&(t.name=e.name),e.position!==void 0&&t.SetPosition(e.position),e.rotation!==void 0&&t.SetRotation(e.rotation),e.scale!==void 0&&t.SetScale(e.scale),e.visible!==void 0&&t.setVisibility(e.visible),e.bbVisible!==void 0&&t.SetLinesVisibility(e.bbVisible),e.parentId!==void 0&&this._setParent({...e,parentId:e.parentId})}_deleteLight(t){this._detachTransformControls(t),t.parent.remove(t)}_deleteModel(t){this._detachTransformControls(t),t.parent.remove(t)}_deletePrimitive(t){this._detachTransformControls(t),t.parent.remove(t)}_deleteGroup(t){this._detachTransformControls(t);for(let e=t.members.length-1;e>=0;e--)this.attach(t.members[e]);t.parent.remove(t)}_setParent(t){const e=this.getSceneObject(t);if(t.parentId!==null){const o=this.getSceneObject({id:t.parentId,entityType:t.entityType});if(!o)return;o.attach(e)}else this.attach(e)}_detachTransformControls(t){this._findScene(t).children.find(e=>{"isTransformControls"in e&&e.detach()})}_findScene(t){return t.parent!==null?this._findScene(t.parent):t}}const St="#888888",Mt="#dddddd";class Tt extends s.Object3D{constructor(){super(),this.name="Grid";const n=new s.GridHelper(100,100,St,Mt);n.material.depthTest=!1,n.layers.mask=y.HELPER_LAYER_MASK,this.add(n)}setVisibility(n){this.visible=n}}class Lt extends s.Scene{constructor(){super();l(this,"_root");l(this,"_grid");this.background=new s.Color(16777215),this._root=new Dt,this.add(this._root),this._grid=new Tt,this.add(this._grid)}get root(){return this._root}get grid(){return this._grid}setBackground(t){this.background=new s.Color(t)}computeSceneBB(){return this.root.computeSceneBB()}}const Ne={canvas:void 0,antialias:!0,alpha:!0,powerPreference:"high-performance",precision:"highp",stencil:!1,depth:!0,logarithmicDepthBuffer:!1};class xt{constructor(n,t,e){l(this,"_webglrenderer");l(this,"_settings");this._scene=n,this._camera=t,this._settings={...Ne,...e??{}},this._webglrenderer=new s.WebGLRenderer({canvas:this._settings.canvas,antialias:this._settings.antialias,alpha:this._settings.alpha,powerPreference:this._settings.powerPreference,precision:this._settings.precision,stencil:this._settings.stencil,depth:this._settings.depth,logarithmicDepthBuffer:this._settings.logarithmicDepthBuffer})}get webglrenderer(){return this._webglrenderer}setCanvas(n){this._webglrenderer.dispose(),this._settings.canvas=n,this._webglrenderer=new s.WebGLRenderer(this._settings)}render(){this._webglrenderer.render(this._scene,this._camera)}onResize(n,t){this._webglrenderer.setSize(n,t,!1)}dispose(){this._webglrenderer.dispose()}}class Pt{constructor(){l(this,"_renderer",null);l(this,"_lastTime",0);l(this,"_isRunning",!1);l(this,"_tickers",[])}start(){this._isRunning||(this._isRunning=!0,this._lastTime=performance.now(),requestAnimationFrame(this._tick.bind(this)))}stop(){this._isRunning=!1}setRenderer(n){this._renderer=n}addTicker(n){this._tickers.find(t=>t.uuid===n.uuid)||this._tickers.push(n)}removeTicker(n){const t=this._tickers.findIndex(e=>e.uuid===n.uuid);t!==-1&&this._tickers.splice(t,1)}dispose(){this.stop(),this._tickers.forEach(n=>{var t;return(t=n.dispose)==null?void 0:t.call(n)}),this._tickers=[],this._isRunning=!1,this._lastTime=0}_tick(n){var e;if(!this._isRunning)return;const t=(n-this._lastTime)/1e3;this._lastTime=n,this._tickers.forEach(o=>o.tick(t)),(e=this._renderer)==null||e.render(),requestAnimationFrame(this._tick.bind(this))}}class Ct{constructor(n,t){l(this,"_resizeObserver");l(this,"_width",0);l(this,"_height",0);this._resizeObserver=new ResizeObserver(e=>{for(const o of e){const{width:r,height:d}=o.contentRect;r===this._width&&d===this._height||(n.onResize(r,d),t.onResize(r,d),this._width=r,this._height=d)}}),this._observeCanvas(n.webglrenderer.domElement)}setCanvas(n){this._resizeObserver.disconnect(),this._observeCanvas(n)}dispose(){this._resizeObserver.disconnect()}_observeCanvas(n){if(n.parentElement)this._resizeObserver.observe(n.parentElement);else{const t=setInterval(()=>{n.parentElement&&(this._resizeObserver.observe(n.parentElement),clearInterval(t))},16)}}}const Fe={autoStart:!0,displayAxes:!1,...ke.DIVEPerspectiveCameraDefaultSettings,...Ne};class It{constructor(n){l(this,"_renderer");l(this,"_scene");l(this,"_camera");l(this,"_resizeManager");l(this,"_clock");l(this,"_settings");this._settings={...Fe,...n??{}},this._scene=new Lt,this._camera=new ke.DIVEPerspectiveCamera(this._settings),this._renderer=new xt(this._scene,this._camera,this._settings),this._resizeManager=new Ct(this._renderer,this._camera),this._clock=new Pt,this._clock.setRenderer(this._renderer),this._settings.autoStart&&this.start()}get scene(){return this._scene}get camera(){return this._camera}get renderer(){return this._renderer}setCanvas(n){this._renderer.setCanvas(n),this._resizeManager.setCanvas(n)}get clock(){return this._clock}start(){this._clock.start()}stop(){this._clock.stop()}dispose(){this._clock.dispose(),this._resizeManager.dispose(),this._renderer.dispose()}}function D(c,n){const t=(c+"e").split("e");return+(t[0]+"e"+(+t[1]+(n||0)))}function Ot(c,n=0){const t=D(c,+n);return D(Math.ceil(t),-n)}function At(c,n=0){const t=D(c,+n);return D(Math.floor(t),-n)}function Ge(c,n=0){if(c<0)return-Ge(-c,n);const t=D(c,+n);return D(Math.round(t),-n)}function Rt(c,n,t){return Math.atan2(c.clone().cross(n).dot(t),n.clone().dot(c))}function vt(c,n=0){const t=D(c,+n);return D(Math.round(t),-n).toFixed(n)}function Vt(c,n=0){const t=D(c,+n);return D(Math.trunc(t),-n)}function kt(c){return(s.MathUtils.radToDeg(c)+360)%360}function Bt(c){return s.MathUtils.degToRad(c)}const Ut={ceilExp:Ot,floorExp:At,roundExp:Ge,toFixedExp:vt,truncateExp:Vt,signedAngleTo:Rt,radToDeg:kt,degToRad:Bt};window.DIVE={instances:[],get instance(){return window.DIVE.instances[0]}};const je={...Fe,...J};class de{constructor(n){l(this,"_settings");l(this,"_engine");l(this,"orbitController");l(this,"axisCamera");this._settings={...je,...n??{}},this._engine=new It(n),this.orbitController=new $(this._engine.camera,this._engine.renderer.webglrenderer.domElement,this._settings),this._engine.clock.addTicker(this.orbitController),this._settings.displayAxes?(this.axisCamera=new pt(this._engine.renderer,this._engine.scene,this._engine.camera),this._engine.clock.addTicker(this.axisCamera)):this.axisCamera=null,Promise.resolve().then(()=>require("./chunks/package-JHvTSNgQ.cjs")).then(t=>{console.log(`DIVE ${t.default.version} initialized successfully!`),console.log(`
2
- @@@@@@@@@@@@@@@@@@@@@@@ @@@@@@@@@@@@@@@@@@@@@@@
3
- @@@@+-:::::::---------------------==------------------------------=#@@@@
4
- @@%=::::.......::---------------------------------------------------------+@@
5
- @@+:::...........::-----------------------------------------------------------#@@
6
- @@=:::.........::::::-------------------------------------------------------------%@
7
- @%:::.......:::::::-----------------------------------------------------------------#@
8
- @*:::.....:::::-----------------------------------------------------------------------*@
9
- @%::::::.::::---------------------------------------------------------------------------@@
10
- @@-:::::::::-----------------------------------------------------------------------------=@
11
- @%::::::::--------------------------------------------------------------------------------%@
12
- @+::::::::--------------------------------=@@@@@%-----------------------------------------%@
13
- @=:::::::--------------------------------*@@ @@+---------------------------------------#@
14
- @+:::::::-------------------------------*@ @*--------------------------------------%@
15
- @#::::::::-----------------------------=@@ @@=-------------------------------------%@
16
- @@-::::::::----------------------------@@ @@------------------------------------=@
17
- @%:::::::::--------------------------*@ @*-----------------------------------@@
18
- @*:::::::::-------------------------@@ @@----------------------------------%@
19
- @#::::::::::----------------------%@ @%--------------------------------%@
20
- @#:::::::::::-------------------=@@ @@=------------------------------%@
21
- @@-::::::::::::----------------%@ @%----------------------------=@@
22
- @@#::::::::::::::------------*@ @*--------------------------#@@
23
- @@+::::::::::::::::--------@@ @@------------------------+@@
24
- @@*:::::::::::::::::----@@ @@---------------------+@@
25
- @@@-:::::::::::::::--#@ @#-----------------=%@@
26
- @@%-::::::::::::-%@ @%-------------=%@@
27
- @@@@+:::::::#@@ @@*-------*@@@@
28
- @@@@@@@ @@@@@@
29
-
30
- `)})}static async QuickView(n,t){const e=new de(t);window.DIVE.instances.push(e),e.engine.scene.background=new s.Color(16777215),e.engine.scene.grid.setVisibility(!1),e.engine.scene.root.floor.setVisibility(!1),e.engine.scene.root.floor.setColor(16777215),e.engine.camera.position.set(0,2,2),e.orbitController.target.set(0,.5,0);const o=new Ue;o.name="SceneLight",o.userData.id=s.MathUtils.generateUUID(),o.setEnabled(!0),o.visible=!0,o.setIntensity((t==null?void 0:t.lightIntensity)??1),o.setColor(new s.Color(16777215)),e.engine.scene.root.add(o);const r=new Ye;r.name="object",r.userData.id=s.MathUtils.generateUUID(),r.userData.uri=n,r.visible=!0,e.engine.scene.root.add(r),await r.setFromURL(n);const d=e.engine.scene.computeSceneBB(),h=e.orbitController.computeEncompassingView(d);return e.engine.camera.position.copy(h.position),e.orbitController.target.copy(h.target),e}get engine(){return this._engine}get canvas(){return this._engine.renderer.webglrenderer.domElement}setCanvas(n){this._engine.setCanvas(n),this._engine.clock.removeTicker(this.orbitController),this.orbitController.dispose(),this.orbitController=new $(this._engine.camera,n,this._settings),this._engine.clock.addTicker(this.orbitController)}async Dispose(){return new Promise(n=>{this._engine.clock.removeTicker(this.orbitController),this.orbitController.dispose(),this.axisCamera&&(this._engine.clock.removeTicker(this.axisCamera),this.axisCamera.Dispose()),n()})}}const ce=(c,n)=>{if(Object.keys(c).length===0&&Object.keys(n).length===0)return{};if(typeof c!="object"||typeof n!="object")return n;let t={};return Object.keys(n).forEach(e=>{if(!Object.keys(c).includes(e)){t={...t,[e]:n[e]};return}if(Array.isArray(n[e])){if(!Array.isArray(c[e])){t={...t,[e]:n[e]};return}const o=c[e],r=n[e];if(o.length===0&&r.length===0){t={...t};return}if(o.length!==r.length){t={...t,[e]:n[e]};return}const d=[];if(r.forEach((h,p)=>{const f=ce(o[p],r[p]);Object.keys(f).length&&d.push(r[p])}),Object.keys(d).length){t={...t,[e]:d};return}return}if(typeof n[e]=="object"){if(typeof c[e]!="object"){t={...t,[e]:n[e]};return}const o=ce(c[e],n[e]);if(Object.keys(o).length){t={...t,[e]:o};return}}c[e]!==n[e]&&(t={...t,[e]:n[e]})}),t};exports.findInterface=P.findInterface;exports.implementsInterface=P.implementsInterface;exports.getModule=E.getModule;exports.FILE_TYPES=Q.FILE_TYPES;exports.SUPPORTED_FILE_TYPES=Q.SUPPORTED_FILE_TYPES;exports.getFileTypeFromUri=Q.getFileTypeFromUri;exports.isFileTypeSupported=Q.isFileTypeSupported;exports.ESystem=Be.ESystem;exports.EWebXRUnsupportedReason=Be.EWebXRUnsupportedReason;exports.DIVE=de;exports.DIVEDefaultSettings=je;exports.DIVEMath=Ut;exports.applyMixins=ze;exports.findSceneRecursive=ee;exports.getObjectDelta=ce;
1
+ "use strict";var b=Object.defineProperty;var R=(r,i,e)=>i in r?b(r,i,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[i]=e;var n=(r,i,e)=>R(r,typeof i!="symbol"?i+"":i,e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./chunks/FileTypes-CHutqD19.cjs"),u=require("./chunks/VisibilityLayerMask-BI7jPKdx.cjs"),s=require("three"),O=require("./chunks/OrbitController-CpFQ3A1H.cjs"),I=require("./chunks/PerspectiveCamera-BByyG5R4.cjs"),y=require("./chunks/findInterface-C6mrvf_t.cjs"),V=require("./chunks/isFileTypeSupported-CrEqYiv9.cjs"),w=require("./chunks/network-error-CdDXil5g.cjs"),P=require("./chunks/parse-error-Dy_EE4rL.cjs"),A=require("./chunks/PovSchema-Co9FznEz.cjs");class E extends s.Object3D{constructor(e,t,o,h,a){super();n(this,"isHoverable",!0);n(this,"isDraggable",!0);n(this,"parent",null);n(this,"axis");n(this,"_color",new s.Color(16711935));n(this,"_colorHover");n(this,"_hovered");n(this,"_highlight");n(this,"_lineMaterial");n(this,"_colliderMesh");this.name="DIVERadialHandle",this.axis=e,this._color.set(a),this._colorHover=this._color.clone().multiplyScalar(2),this._hovered=!1,this._highlight=!1;const c=new s.TorusGeometry(t,.01,13,48,o);this._lineMaterial=new s.MeshBasicMaterial({color:a,depthTest:!1,depthWrite:!1});const d=new s.Mesh(c,this._lineMaterial);d.layers.mask=u.UI_LAYER_MASK,d.renderOrder=1/0,this.add(d);const p=new s.TorusGeometry(t,.1,3,48,o),f=new s.MeshBasicMaterial({color:16711935,transparent:!0,opacity:.15,depthTest:!1,depthWrite:!1});this._colliderMesh=new s.Mesh(p,f),this._colliderMesh.visible=!1,this._colliderMesh.layers.mask=u.UI_LAYER_MASK,this._colliderMesh.renderOrder=1/0,this.add(this._colliderMesh),this.lookAt(h)}set debug(e){this._colliderMesh.visible=e}get highlight(){return this._highlight}set highlight(e){this._highlight=e,this._lineMaterial.color=this._highlight||this._hovered?this._colorHover:this._color}get forwardVector(){return new s.Vector3(0,0,1).applyQuaternion(this.quaternion).normalize()}get rightVector(){return new s.Vector3(1,0,0).applyQuaternion(this.quaternion).normalize()}get upVector(){return new s.Vector3(0,1,0).applyQuaternion(this.quaternion).normalize()}reset(){this._lineMaterial.color=this._color}onPointerEnter(){this._hovered=!0,this.parent&&this.parent.onHandleHover(this,!0)}onPointerLeave(){this._hovered=!1,this.parent&&this.parent.onHandleHover(this,!1)}onDragStart(){this.parent&&this.parent.onHandleDragStart(this)}onDrag(e){this.parent&&this.parent.onHandleDrag(this,e)}onDragEnd(){this.parent&&this.parent.onHandleDragEnd(this)}}function _(r,i){const e=(r+"e").split("e");return+(e[0]+"e"+(+e[1]+(i||0)))}function v(r,i=0){const e=_(r,+i);return _(Math.ceil(e),-i)}function H(r,i=0){const e=_(r,+i);return _(Math.floor(e),-i)}function x(r,i=0){if(r<0)return-x(-r,i);const e=_(r,+i);return _(Math.round(e),-i)}function z(r,i,e){return Math.atan2(r.clone().cross(i).dot(e),i.clone().dot(r))}function G(r,i=0){const e=_(r,+i);return _(Math.round(e),-i).toFixed(i)}function C(r,i=0){const e=_(r,+i);return _(Math.trunc(e),-i)}function L(r){return(s.MathUtils.radToDeg(r)+360)%360}function T(r){return s.MathUtils.degToRad(r)}const S={ceilExp:v,floorExp:H,roundExp:x,toFixedExp:G,truncateExp:C,signedAngleTo:z,radToDeg:L,degToRad:T};class Y extends s.Object3D{constructor(e){super();n(this,"children");n(this,"_controller");n(this,"_startRot");this.name="DIVERotateGizmo",this.children=[],this._startRot=null,this._controller=e,this.add(new E("x",1,Math.PI/2,new s.Vector3(1,0,0),l.AxesColorRed)),this.add(new E("y",1,-Math.PI/2,new s.Vector3(0,1,0),l.AxesColorGreen)),this.add(new E("z",1,Math.PI/2,new s.Vector3(0,0,1),l.AxesColorBlue))}set debug(e){this.children.forEach(t=>{t.debug=e})}reset(){this.children.forEach(e=>{e.reset()})}handleHighlight(e,t,o){this.children.forEach(h=>{o?h.highlight=h.axis===e&&o:h.highlight=h.axis===e&&t})}onHandleHover(e,t){this._startRot||this.parent&&this.parent.parent&&(this.parent.parent.onHover("rotate",e.axis,t),this.handleHighlight(e.axis,t,!1))}onHandleDragStart(e){if(!this.parent||!this.parent.parent)return;const t=this.parent.parent.object;t&&(this._startRot=t.rotation.clone(),this.handleHighlight(e.axis,!0,!0))}onHandleDrag(e,t){if(!this._startRot||!this.parent||!this.parent.parent||!("onChange"in this.parent.parent))return;const o=t.dragCurrent.clone().sub(this.parent.parent.position).normalize(),h=t.dragStart.clone().sub(this.parent.parent.position).normalize(),a=S.signedAngleTo(h,o,e.forwardVector),c=new s.Euler(this._startRot.x+e.forwardVector.x*a,this._startRot.y+e.forwardVector.y*a,this._startRot.z+e.forwardVector.z*a);this.parent.parent.onChange(void 0,c)}onHandleDragEnd(e){this._startRot=null,this.handleHighlight(e.axis,!1,!1)}}class m extends s.Object3D{constructor(e,t,o,h){super();n(this,"isHoverable",!0);n(this,"isDraggable",!0);n(this,"parent",null);n(this,"axis");n(this,"_color",new s.Color(16711935));n(this,"_colorHover");n(this,"_hovered");n(this,"_highlight");n(this,"_lineMaterial");n(this,"_colliderMesh");this.name="DIVEAxisHandle",this.axis=e,this._color.set(h),this._colorHover=this._color.clone().multiplyScalar(2),this._highlight=!1,this._hovered=!1;const a=new s.CylinderGeometry(.01,.01,t,13);this._lineMaterial=new s.MeshBasicMaterial({color:h,depthTest:!1,depthWrite:!1});const c=new s.Mesh(a,this._lineMaterial);c.layers.mask=u.UI_LAYER_MASK,c.renderOrder=1/0,c.rotateX(Math.PI/2),c.translateY(t/2),this.add(c);const d=new s.CylinderGeometry(.1,.1,t,3),p=new s.MeshBasicMaterial({color:16711935,transparent:!0,opacity:.15,depthTest:!1,depthWrite:!1});this._colliderMesh=new s.Mesh(d,p),this._colliderMesh.visible=!1,this._colliderMesh.layers.mask=u.UI_LAYER_MASK,this._colliderMesh.renderOrder=1/0,this._colliderMesh.rotateX(Math.PI/2),this._colliderMesh.translateY(t/2),this.add(this._colliderMesh),this.rotateX(o.y*-Math.PI/2),this.rotateY(o.x*Math.PI/2)}set debug(e){this._colliderMesh.visible=e}get highlight(){return this._highlight}set highlight(e){this._highlight=e,this._lineMaterial.color=this._highlight||this._hovered?this._colorHover:this._color}get forwardVector(){return new s.Vector3(0,0,1).applyQuaternion(this.quaternion).normalize()}get rightVector(){return new s.Vector3(1,0,0).applyQuaternion(this.quaternion).normalize()}get upVector(){return new s.Vector3(0,1,0).applyQuaternion(this.quaternion).normalize()}reset(){this._lineMaterial.color=this._color}onPointerEnter(){this._hovered=!0,this.parent&&this.parent.onHandleHover(this,!0)}onPointerLeave(){this._hovered=!1,this.parent&&this.parent.onHandleHover(this,!1)}onDragStart(){this.parent&&this.parent.onHandleDragStart(this)}onDrag(e){this.parent&&this.parent.onHandleDrag(this,e)}onDragEnd(){this.parent&&this.parent.onHandleDragEnd(this)}}class j extends s.Object3D{constructor(e){super();n(this,"_controller");n(this,"children");n(this,"_startPos");this.name="DIVETranslateGizmo",this.children=[],this._startPos=null,this._controller=e,this.add(new m("x",1,new s.Vector3(1,0,0),l.AxesColorRed)),this.add(new m("y",1,new s.Vector3(0,1,0),l.AxesColorGreen)),this.add(new m("z",1,new s.Vector3(0,0,1),l.AxesColorBlue))}set debug(e){this.children.forEach(t=>{t.debug=e})}reset(){this.children.forEach(e=>{e.reset()})}handleHighlight(e,t,o){this.children.forEach(h=>{o?h.highlight=h.axis===e&&o:h.highlight=h.axis===e&&t})}onHandleHover(e,t){this._startPos||this.parent&&this.parent.parent&&(this.parent.parent.onHover("translate",e.axis,t),this.handleHighlight(e.axis,t,!1))}onHandleDragStart(e){if(!this.parent||!this.parent.parent)return;const t=this.parent.parent.object;t&&(this._startPos=t.position.clone(),this.handleHighlight(e.axis,!0,!0))}onHandleDrag(e,t){if(!this._startPos||!this.parent||!this.parent.parent||!("onChange"in this.parent.parent))return;const o=t.dragDelta.clone().projectOnVector(e.forwardVector);this.parent.parent.onChange(this._startPos.clone().add(o))}onHandleDragEnd(e){this._startPos=null,this.handleHighlight(e.axis,!1,!1)}}class D extends s.Object3D{constructor(e,t,o,h,a=.05){super();n(this,"isHoverable",!0);n(this,"isDraggable",!0);n(this,"parent",null);n(this,"axis");n(this,"_color",new s.Color(16711935));n(this,"_colorHover");n(this,"_hovered");n(this,"_highlight");n(this,"_lineMaterial");n(this,"_colliderMesh");n(this,"_box");n(this,"_boxSize");this.name="DIVEScaleHandle",this.axis=e,this._color.set(h),this._colorHover=this._color.clone().multiplyScalar(2),this._hovered=!1,this._highlight=!1,this._boxSize=a;const c=new s.CylinderGeometry(.01,.01,t-a/2,13);this._lineMaterial=new s.MeshBasicMaterial({color:h,depthTest:!1,depthWrite:!1});const d=new s.Mesh(c,this._lineMaterial);d.layers.mask=u.UI_LAYER_MASK,d.renderOrder=1/0,d.rotateX(Math.PI/2),d.translateY(t/2-a/4),this.add(d),this._box=new s.Mesh(new s.BoxGeometry(a,a,a),this._lineMaterial),this._box.layers.mask=u.UI_LAYER_MASK,this._box.renderOrder=1/0,this._box.rotateX(Math.PI/2),this._box.translateY(t-a/2),this._box.rotateZ(o.x*Math.PI/2),this._box.rotateX(o.z*Math.PI/2),this.add(this._box);const p=new s.CylinderGeometry(.1,.1,t+a/2,3),f=new s.MeshBasicMaterial({color:16711935,transparent:!0,opacity:.15,depthTest:!1,depthWrite:!1});this._colliderMesh=new s.Mesh(p,f),this._colliderMesh.visible=!1,this._colliderMesh.layers.mask=u.UI_LAYER_MASK,this._colliderMesh.renderOrder=1/0,this._colliderMesh.rotateX(Math.PI/2),this._colliderMesh.translateY(t/2),this.add(this._colliderMesh),this.rotateX(o.y*-Math.PI/2),this.rotateY(o.x*Math.PI/2)}set debug(e){this._colliderMesh.visible=e}get highlight(){return this._highlight}set highlight(e){this._highlight=e,this._lineMaterial.color=this._highlight||this._hovered?this._colorHover:this._color}get forwardVector(){return new s.Vector3(0,0,1).applyQuaternion(this.quaternion).normalize()}get rightVector(){return new s.Vector3(1,0,0).applyQuaternion(this.quaternion).normalize()}get upVector(){return new s.Vector3(0,1,0).applyQuaternion(this.quaternion).normalize()}reset(){this._lineMaterial.color=this._color}update(e){this._box.scale.copy(new s.Vector3(1,1,1).sub(this.forwardVector).add(e.clone().multiply(this.forwardVector)))}onPointerEnter(){this._hovered=!0,this.parent&&this.parent.onHoverAxis(this,!0)}onPointerLeave(){this._hovered=!1,this.parent&&this.parent.onHoverAxis(this,!1)}onDragStart(){this.parent&&this.parent.onAxisDragStart(this)}onDrag(e){this.parent&&this.parent.onAxisDrag(this,e)}onDragEnd(){this.parent&&this.parent.onAxisDragEnd(this)}}class N extends s.Object3D{constructor(e){super();n(this,"isHoverable",!0);n(this,"children");n(this,"_controller");n(this,"_startScale");this.name="DIVEScaleGizmo",this.children=[],this._startScale=null,this._controller=e,this.add(new D("x",1,new s.Vector3(1,0,0),l.AxesColorRed)),this.add(new D("y",1,new s.Vector3(0,1,0),l.AxesColorGreen)),this.add(new D("z",1,new s.Vector3(0,0,1),l.AxesColorBlue))}set debug(e){this.children.forEach(t=>{t.debug=e})}reset(){this.children.forEach(e=>{e.reset()})}update(e){this.children.forEach(t=>{t.update(e)})}handleHighlight(e,t,o){this.children.forEach(h=>{o?h.highlight=h.axis===e&&o:h.highlight=h.axis===e&&t})}onHoverAxis(e,t){this._startScale||this.parent&&this.parent.parent&&(this.parent.parent.onHover("translate",e.axis,t),this.handleHighlight(e.axis,t,!1))}onAxisDragStart(e){if(!this.parent||!this.parent.parent)return;const t=this.parent.parent.object;t&&(this._startScale=t.scale.clone(),this.handleHighlight(e.axis,!0,!0))}onAxisDrag(e,t){if(!this._startScale||!this.parent||!this.parent.parent||!("onChange"in this.parent.parent))return;const o=t.dragDelta.clone().projectOnVector(e.forwardVector);this.parent.parent.onChange(void 0,void 0,this._startScale.clone().add(o))}onAxisDragEnd(e){this._startScale=null,this.handleHighlight(e.axis,!1,!1)}}class F extends s.Object3D{constructor(){super();n(this,"_meshX");n(this,"_meshY");n(this,"_meshZ");this.name="DIVEGizmoPlane";const e=new s.MeshBasicMaterial({transparent:!0,opacity:.15,depthTest:!1,depthWrite:!1,side:2}),t=new s.PlaneGeometry(100,100,2,2),o=e.clone();o.color.set(16711680),this._meshX=new s.Mesh(t,o),this._meshX.layers.mask=u.UI_LAYER_MASK,this._meshX.rotateY(Math.PI/2);const h=new s.PlaneGeometry(100,100,2,2),a=e.clone();a.color.set(65280),this._meshY=new s.Mesh(h,a),this._meshY.layers.mask=u.UI_LAYER_MASK,this._meshY.rotateX(-Math.PI/2);const c=new s.PlaneGeometry(100,100,2,2),d=e.clone();d.color.set(255),this._meshZ=new s.Mesh(c,d),this._meshZ.layers.mask=u.UI_LAYER_MASK}get XPlane(){return this._meshX}get YPlane(){return this._meshY}get ZPlane(){return this._meshZ}assemble(e,t){if(this.clear(),e==="translate"||e==="scale")switch(t){case"x":this.add(this._meshY),this.add(this._meshZ);break;case"y":this.add(this._meshX),this.add(this._meshZ);break;case"z":this.add(this._meshX),this.add(this._meshY);break}else if(e==="rotate")switch(t){case"x":this.add(this._meshX);break;case"y":this.add(this._meshY);break;case"z":this.add(this._meshZ);break}}}class U extends s.Object3D{constructor(e){super();n(this,"_mode");n(this,"_gizmoNode");n(this,"_translateGizmo");n(this,"_rotateGizmo");n(this,"_scaleGizmo");n(this,"_gizmoPlane");n(this,"_object");this.name="DIVEGizmo",e.addEventListener("change",()=>{const t=e.getDistance()/2.5;this.scale.set(t,t,t)}),this._mode="translate",this._gizmoNode=new s.Object3D,this.add(this._gizmoNode),this._translateGizmo=new j(e),this._rotateGizmo=new Y(e),this._scaleGizmo=new N(e),this._gizmoPlane=new F,this._gizmoPlane.visible=!1,this._object=null}get mode(){return this._mode}set mode(e){this._mode=e,this.assemble()}set debug(e){this._translateGizmo.debug=e,this._rotateGizmo.debug=e,this._scaleGizmo.debug=e}get gizmoNode(){return this._gizmoNode}get gizmoPlane(){return this._gizmoPlane}get object(){return this._object}attach(e){return this._object=e,this.assemble(),this}detach(){return this._object=null,this.assemble(),this}onHover(e,t,o){o&&this._gizmoPlane.assemble(e,t)}onChange(e,t,o){this.object!==null&&(e&&(this.position.copy(e),this.object.position.copy(e)),t&&this.object.rotation.copy(t),o&&(this.object.scale.copy(o),this._scaleGizmo.update(o)))}assemble(){this._gizmoNode.clear(),this._gizmoPlane.clear(),this._translateGizmo.reset(),this._rotateGizmo.reset(),this._scaleGizmo.reset(),this.object!==null&&(this._mode==="translate"&&this._gizmoNode.add(this._translateGizmo),this._mode==="rotate"&&this._gizmoNode.add(this._rotateGizmo),this._mode==="scale"&&this._gizmoNode.add(this._scaleGizmo),this.add(this._gizmoPlane))}}class K{constructor(){n(this,"isMovable",!0)}}class X{constructor(){n(this,"isSelectable",!0)}}function q(r,i){return i.forEach(e=>{Object.getOwnPropertyNames(e.prototype).forEach(o=>{if(o==="constructor")return;const h=Object.getOwnPropertyDescriptor(e.prototype,o);Object.defineProperty(r.prototype,o,h)});const t=new e;Object.getOwnPropertyNames(t).forEach(o=>{const h=Object.getOwnPropertyDescriptor(t,o);Object.defineProperty(r.prototype,o,h)})}),r}function g(r,i=new WeakMap){if(r===null||typeof r!="object")return r;if(i.has(r))return i.get(r);if(r instanceof Date)return new Date(r.getTime());if(r instanceof RegExp)return new RegExp(r.source,r.flags);if(Array.isArray(r)){const a=[];i.set(r,a);for(let c=0;c<r.length;c++)a[c]=g(r[c],i);return a}if(r instanceof Map){const a=new Map;i.set(r,a);for(const[c,d]of r)a.set(g(c,i),g(d,i));return a}if(r instanceof Set){const a=new Set;i.set(r,a);for(const c of r)a.add(g(c,i));return a}const e=r;if(typeof e.clone=="function"){const a=e.clone();return i.set(r,a),a}const t=Object.create(Object.getPrototypeOf(r));i.set(r,t);const o=Object.getOwnPropertyNames(r);for(const a of o){const c=Object.getOwnPropertyDescriptor(r,a);if(c)if(c.value!==void 0){const d=g(c.value,i);Object.defineProperty(t,a,{...c,value:d})}else Object.defineProperty(t,a,c)}const h=Object.getOwnPropertySymbols(r);for(const a of h){const c=Object.getOwnPropertyDescriptor(r,a);if(c)if(c.value!==void 0){const d=g(c.value,i);Object.defineProperty(t,a,{...c,value:d})}else Object.defineProperty(t,a,c)}return t}const M=(r,i)=>{if(Object.keys(r).length===0&&Object.keys(i).length===0)return{};if(typeof r!="object"||typeof i!="object")return i;let e={};return Object.keys(i).forEach(t=>{if(!Object.keys(r).includes(t)){e={...e,[t]:i[t]};return}if(Array.isArray(i[t])){if(!Array.isArray(r[t])){e={...e,[t]:i[t]};return}const o=r[t],h=i[t];if(o.length===0&&h.length===0){e={...e};return}if(o.length!==h.length){e={...e,[t]:i[t]};return}const a=[];if(h.forEach((c,d)=>{const p=M(o[d],h[d]);Object.keys(p).length&&a.push(h[d])}),Object.keys(a).length){e={...e,[t]:a};return}return}if(typeof i[t]=="object"){if(typeof r[t]!="object"){e={...e,[t]:i[t]};return}const o=M(r[t],i[t]);if(Object.keys(o).length){e={...e,[t]:o};return}}r[t]!==i[t]&&(e={...e,[t]:i[t]})}),e};function B(r){return r.entityType==="group"}function k(r){return r.entityType==="light"}function Z(r){return r.entityType==="primitive"}exports.AxesColorBlue=l.AxesColorBlue;exports.AxesColorBlueLetter=l.AxesColorBlueLetter;exports.AxesColorGreen=l.AxesColorGreen;exports.AxesColorGreenLetter=l.AxesColorGreenLetter;exports.AxesColorRed=l.AxesColorRed;exports.AxesColorRedLetter=l.AxesColorRedLetter;exports.DIVE=l.DIVE;exports.DIVEAmbientLight=l.DIVEAmbientLight;exports.DIVEClock=l.DIVEClock;exports.DIVEDefaultSettings=l.DIVEDefaultSettings;exports.DIVEEngine=l.DIVEEngine;exports.DIVEFloor=l.DIVEFloor;exports.DIVEGrid=l.DIVEGrid;exports.DIVEGroup=l.DIVEGroup;exports.DIVEModel=l.DIVEModel;exports.DIVEPointLight=l.DIVEPointLight;exports.DIVEPrimitive=l.DIVEPrimitive;exports.DIVERenderPipeline=l.DIVERenderPipeline;exports.DIVERenderPipelineDefaultSettings=l.DIVERenderPipelineDefaultSettings;exports.DIVEResizeManager=l.DIVEResizeManager;exports.DIVERoot=l.DIVERoot;exports.DIVEScene=l.DIVEScene;exports.DIVESceneLight=l.DIVESceneLight;exports.EngineDefaultSettings=l.EngineDefaultSettings;exports.FILE_TYPES=l.FILE_TYPES;exports.GRID_CENTER_LINE_COLOR=l.GRID_CENTER_LINE_COLOR;exports.GRID_SIDE_LINE_COLOR=l.GRID_SIDE_LINE_COLOR;exports.SUPPORTED_FILE_TYPES=l.SUPPORTED_FILE_TYPES;exports.findSceneRecursive=l.findSceneRecursive;exports.COORDINATE_LAYER_MASK=u.COORDINATE_LAYER_MASK;exports.DEFAULT_LAYER_MASK=u.DEFAULT_LAYER_MASK;exports.HELPER_LAYER_MASK=u.HELPER_LAYER_MASK;exports.PRODUCT_LAYER_MASK=u.PRODUCT_LAYER_MASK;exports.UI_LAYER_MASK=u.UI_LAYER_MASK;exports.DIVENode=O.DIVENode;exports.DIVEPerspectiveCamera=I.DIVEPerspectiveCamera;exports.DIVEPerspectiveCameraDefaultSettings=I.DIVEPerspectiveCameraDefaultSettings;exports.findInterface=y.findInterface;exports.implementsInterface=y.implementsInterface;exports.getFileTypeFromUri=V.getFileTypeFromUri;exports.isFileTypeSupported=V.isFileTypeSupported;exports.FileContentError=w.FileContentError;exports.NetworkError=w.NetworkError;exports.FileTypeError=P.FileTypeError;exports.ParseError=P.ParseError;exports.isModelSchema=A.isModelSchema;exports.isPovSchema=A.isPovSchema;exports.DIVEGizmo=U;exports.DIVEMath=S;exports.DIVEMovable=K;exports.DIVESelectable=X;exports.applyMixins=q;exports.deepClone=g;exports.getObjectDelta=M;exports.isGroupSchema=B;exports.isLightSchema=k;exports.isPrimitiveSchema=Z;