@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,1057 @@
1
+ var z = Object.defineProperty;
2
+ var F = (o, i, e) => i in o ? z(o, i, { enumerable: !0, configurable: !0, writable: !0, value: e }) : o[i] = e;
3
+ var s = (o, i, e) => F(o, typeof i != "symbol" ? i + "" : i, e);
4
+ import { D as v, O as U, B as H, a as I } from "./OrbitController-BQ6SV1O_.mjs";
5
+ import { Object3D as g, AxesHelper as W, Color as l, Matrix4 as Y, OrthographicCamera as $, MathUtils as w, Vector4 as N, AmbientLight as J, PointLight as K, SphereGeometry as C, MeshBasicMaterial as Q, FrontSide as k, Mesh as b, HemisphereLight as q, DirectionalLight as X, MeshStandardMaterial as D, Vector3 as m, Raycaster as S, CylinderGeometry as Z, BufferGeometry as V, BufferAttribute as x, BoxGeometry as f, ConeGeometry as j, LineDashedMaterial as ee, Line as te, PlaneGeometry as ie, Box3 as se, GridHelper as re, Scene as ne, WebGLRenderer as L, PCFSoftShadowMap as oe, PCFShadowMap as ae, BasicShadowMap as he } from "three";
6
+ import { C as p, P as _, U as le, H as de } from "./VisibilityLayerMask-CXgt1fJc.mjs";
7
+ import { a as ce, D as _e } from "./PerspectiveCamera-PMJPzAn3.mjs";
8
+ import y from "three-spritetext";
9
+ class ue extends g {
10
+ constructor() {
11
+ super();
12
+ s(this, "_axesHelper");
13
+ this._axesHelper = new W(0.5), this._axesHelper.layers.mask = p, this._axesHelper.material.depthTest = !1, this._axesHelper.position.set(0, 0, -1), this._axesHelper.setColors(
14
+ new l(Se),
15
+ new l(Ve),
16
+ new l(Me)
17
+ );
18
+ const e = new y("X", 0.2, R), t = new y("Y", 0.2, G), r = new y("Z", 0.2, A);
19
+ e.layers.mask = p, t.layers.mask = p, r.layers.mask = p, e.position.set(0.7, 0, 0), t.position.set(0, 0.7, 0), r.position.set(0, 0, 0.7), this._axesHelper.add(e), this._axesHelper.add(t), this._axesHelper.add(r);
20
+ }
21
+ setFromCameraMatrix(e) {
22
+ this._axesHelper.rotation.setFromRotationMatrix(
23
+ new Y().extractRotation(e).invert()
24
+ );
25
+ }
26
+ }
27
+ class me {
28
+ constructor(i, e, t) {
29
+ s(this, "uuid", w.generateUUID());
30
+ s(this, "_axes");
31
+ s(this, "_orthographicCamera");
32
+ s(this, "_restoreViewport", new N());
33
+ this._renderer = i, this._scene = e, this._camera = t, this._orthographicCamera = new $(
34
+ -1,
35
+ 1,
36
+ 1,
37
+ -1,
38
+ 0.1,
39
+ 100
40
+ ), this._orthographicCamera.layers.mask = p, this._scene.add(this._orthographicCamera), this._axes = new ue(), this._scene.add(this._axes);
41
+ }
42
+ tick() {
43
+ const i = this._scene.background;
44
+ this._scene.background = null, this._renderer.webglrenderer.getViewport(this._restoreViewport), this._renderer.webglrenderer.setViewport(0, 0, 150, 150), this._renderer.webglrenderer.autoClear = !1, this._axes.setFromCameraMatrix(this._camera.matrix), this._renderer.webglrenderer.render(
45
+ this._scene,
46
+ this._orthographicCamera
47
+ ), this._renderer.webglrenderer.setViewport(this._restoreViewport), this._renderer.webglrenderer.autoClear = !0, this._scene.background = i;
48
+ }
49
+ dispose() {
50
+ this._scene.remove(this._axes), this._scene.remove(this._orthographicCamera);
51
+ }
52
+ }
53
+ class ge extends g {
54
+ constructor() {
55
+ super();
56
+ s(this, "isDIVELight", !0);
57
+ s(this, "isDIVEAmbientLight", !0);
58
+ s(this, "_light");
59
+ this.name = "DIVEAmbientLight", this._light = new J(16777215, 1), this._light.layers.mask = _, this.add(this._light);
60
+ }
61
+ setColor(e) {
62
+ this._light.color = e;
63
+ }
64
+ setIntensity(e) {
65
+ this._light.intensity = e;
66
+ }
67
+ setEnabled(e) {
68
+ this._light.visible = e;
69
+ }
70
+ }
71
+ class pe extends g {
72
+ constructor() {
73
+ super();
74
+ s(this, "isDIVELight", !0);
75
+ s(this, "isDIVEPointLight", !0);
76
+ s(this, "isMovable", !0);
77
+ s(this, "isSelectable", !0);
78
+ s(this, "gizmo", null);
79
+ s(this, "light");
80
+ s(this, "mesh");
81
+ this.name = "DIVEPointLight", this.light = new K(16777215, 1), this.light.layers.mask = _, this.light.castShadow = !0, this.light.shadow.mapSize.width = 512, this.light.shadow.mapSize.height = 512, this.add(this.light);
82
+ const e = 0.1, t = new C(
83
+ e,
84
+ e * 320,
85
+ e * 320
86
+ ), r = new Q({
87
+ color: this.light.color,
88
+ transparent: !0,
89
+ opacity: 0.8,
90
+ side: k
91
+ });
92
+ this.mesh = new b(t, r), this.mesh.layers.mask = le, this.add(this.mesh);
93
+ }
94
+ setColor(e) {
95
+ this.light.color = e, this.mesh.material.color = e;
96
+ }
97
+ setIntensity(e) {
98
+ this.light.intensity = e, this.mesh.material.opacity = e > 0.8 ? 0.8 : e * 0.8;
99
+ }
100
+ setEnabled(e) {
101
+ this.light.visible = e;
102
+ }
103
+ onMove() {
104
+ import("../plugins/state/index.mjs").then(({ State: e }) => {
105
+ var t;
106
+ (t = e.get(this.userData.id)) == null || t.performAction("UPDATE_OBJECT", {
107
+ id: this.userData.id,
108
+ position: this.position
109
+ });
110
+ });
111
+ }
112
+ onSelect() {
113
+ import("../plugins/state/index.mjs").then(({ State: e }) => {
114
+ var t;
115
+ (t = e.get(this.userData.id)) == null || t.performAction("SELECT_OBJECT", {
116
+ id: this.userData.id
117
+ });
118
+ });
119
+ }
120
+ onDeselect() {
121
+ import("../plugins/state/index.mjs").then(({ State: e }) => {
122
+ var t;
123
+ (t = e.get(this.userData.id)) == null || t.performAction("DESELECT_OBJECT", {
124
+ id: this.userData.id
125
+ });
126
+ });
127
+ }
128
+ }
129
+ class M extends g {
130
+ constructor() {
131
+ super();
132
+ s(this, "isDIVELight", !0);
133
+ s(this, "isDIVESceneLight", !0);
134
+ s(this, "_hemiLight");
135
+ s(this, "_dirLight");
136
+ this.name = "DIVESceneLight", this._hemiLight = new q(16777215, 16777215, 2), this._hemiLight.layers.mask = _, this._hemiLight.position.set(0, 50, 0), this.add(this._hemiLight), this._dirLight = new X(16777215, 3), this._dirLight.layers.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;
137
+ const e = 5;
138
+ this._dirLight.shadow.camera.left = -5, this._dirLight.shadow.camera.right = e, this._dirLight.shadow.camera.top = e, this._dirLight.shadow.camera.bottom = -5, this._dirLight.shadow.camera.far = 3500, this.add(this._dirLight);
139
+ }
140
+ setColor(e) {
141
+ this._hemiLight.color = e, this._dirLight.color = e;
142
+ }
143
+ setIntensity(e) {
144
+ this._hemiLight.intensity = e * 2, this._dirLight.intensity = e * 3;
145
+ }
146
+ setEnabled(e) {
147
+ this._hemiLight.visible = e, this._dirLight.visible = e;
148
+ }
149
+ }
150
+ const E = (o) => o.parent ? E(o.parent) : o;
151
+ class B extends v {
152
+ constructor() {
153
+ super(...arguments);
154
+ s(this, "isDIVEModel", !0);
155
+ s(this, "_mesh", null);
156
+ s(this, "_material", null);
157
+ s(this, "_assetLoader", null);
158
+ }
159
+ async _getAssetLoader() {
160
+ return this._assetLoader || (this._assetLoader = new (await import("../plugins/assetloader/index.mjs")).AssetLoader()), this._assetLoader;
161
+ }
162
+ async setFromURL(e) {
163
+ const r = await (await this._getAssetLoader()).load(e);
164
+ this.setFromGLTF(r), import("../plugins/state/index.mjs").then(({ State: n }) => {
165
+ var a;
166
+ (a = n.get(this.userData.id)) == null || a.performAction("MODEL_LOADED", {
167
+ id: this.userData.id
168
+ });
169
+ });
170
+ }
171
+ setFromGLTF(e) {
172
+ this.clear(), this._boundingBox.makeEmpty(), e.traverse((t) => {
173
+ t.castShadow = !0, t.receiveShadow = !0, t.layers.mask = this.layers.mask, this._boundingBox.expandByObject(t), !this._mesh && "isMesh" in t && (this._mesh = t, this._material ? this._mesh.material = this._material : this._material = t.material);
174
+ }), this.add(e);
175
+ }
176
+ setMaterial(e) {
177
+ this._material || (this._material = new D()), e.vertexColors !== void 0 && (this._material.vertexColors = e.vertexColors), e.color !== void 0 && this._material.color.set(e.color), e.map !== void 0 && (this._material.map = e.map), e.normalMap !== void 0 && (this._material.normalMap = e.normalMap), e.roughness !== void 0 && (this._material.roughness = e.roughness), e.roughnessMap !== void 0 && (this._material.roughnessMap = e.roughnessMap, this._material.roughnessMap && (this._material.roughness = 1)), e.metalness !== void 0 && (this._material.metalness = e.metalness), e.metalnessMap !== void 0 && (this._material.metalnessMap = e.metalnessMap, this._material.metalnessMap && (this._material.metalness = 1)), this._mesh && (this._mesh.material = this._material);
178
+ }
179
+ placeOnFloor() {
180
+ var n, a, h, d;
181
+ const e = this.getWorldPosition(this._positionWorldBuffer), t = e.clone();
182
+ (a = (n = this._mesh) == null ? void 0 : n.geometry) == null || a.computeBoundingBox();
183
+ const r = (d = (h = this._mesh) == null ? void 0 : h.geometry) == null ? void 0 : d.boundingBox;
184
+ !r || !this._mesh || (e.y = e.y - this._mesh.localToWorld(r.min.clone()).y, e.y !== t.y && import("../plugins/state/index.mjs").then(({ State: u }) => {
185
+ var c;
186
+ (c = u.get(this.userData.id)) == null || c.performAction("UPDATE_OBJECT", {
187
+ id: this.userData.id,
188
+ position: e,
189
+ rotation: this.rotation,
190
+ scale: this.scale
191
+ });
192
+ }));
193
+ }
194
+ dropIt() {
195
+ if (!this.parent) {
196
+ console.warn(
197
+ "DIVEModel: dropIt() called on a model that is not in the scene.",
198
+ this
199
+ );
200
+ return;
201
+ }
202
+ const e = this._boundingBox.min.y * this.scale.y, t = this.localToWorld(
203
+ this._boundingBox.getCenter(new m()).multiply(this.scale)
204
+ );
205
+ t.y = e + this.position.y;
206
+ const r = new S(t, new m(0, -1, 0));
207
+ r.layers.mask = _;
208
+ const n = r.intersectObjects(
209
+ E(this).root.children,
210
+ !0
211
+ );
212
+ if (n.length > 0) {
213
+ const a = n[0].object;
214
+ a.geometry.computeBoundingBox();
215
+ const h = a.geometry.boundingBox, d = a.localToWorld(h.max.clone()), u = this.position.clone(), c = this.position.clone().setY(d.y).sub(new m(0, e, 0));
216
+ if (this.position.copy(c), this.position.y === u.y) return;
217
+ this.onMove();
218
+ }
219
+ }
220
+ }
221
+ class we extends v {
222
+ constructor() {
223
+ super();
224
+ s(this, "isDIVEPrimitive", !0);
225
+ s(this, "_mesh");
226
+ this._mesh = new b(), this._mesh.layers.mask = _, this._mesh.castShadow = !0, this._mesh.receiveShadow = !0, this._mesh.material = new D(), this.add(this._mesh);
227
+ }
228
+ setGeometry(e) {
229
+ const t = this.assembleGeometry(e);
230
+ t && (this._mesh.geometry = t, this._boundingBox.setFromObject(this._mesh));
231
+ }
232
+ setMaterial(e) {
233
+ const t = this._mesh.material;
234
+ e.vertexColors !== void 0 && (t.vertexColors = e.vertexColors), e.color !== void 0 && (t.color = new l(e.color)), e.map !== void 0 && (t.map = e.map), e.normalMap !== void 0 && (t.normalMap = e.normalMap), e.roughness !== void 0 && (t.roughness = e.roughness), e.roughnessMap !== void 0 && (t.roughnessMap = e.roughnessMap, t.roughnessMap && (t.roughness = 1)), e.metalness !== void 0 && (t.metalness = e.metalness), e.metalnessMap !== void 0 && (t.metalnessMap = e.metalnessMap, t.metalnessMap && (t.metalness = 0)), this._mesh && (this._mesh.material = t);
235
+ }
236
+ placeOnFloor() {
237
+ var n, a, h, d;
238
+ const e = this.getWorldPosition(this._positionWorldBuffer), t = e.clone();
239
+ (a = (n = this._mesh) == null ? void 0 : n.geometry) == null || a.computeBoundingBox();
240
+ const r = (d = (h = this._mesh) == null ? void 0 : h.geometry) == null ? void 0 : d.boundingBox;
241
+ !r || !this._mesh || (e.y = e.y - this._mesh.localToWorld(r.min.clone()).y, e.y !== t.y && import("../plugins/state/index.mjs").then(({ State: u }) => {
242
+ var c;
243
+ (c = u.get(this.userData.id)) == null || c.performAction("UPDATE_OBJECT", {
244
+ id: this.userData.id,
245
+ position: e,
246
+ rotation: this.rotation,
247
+ scale: this.scale
248
+ });
249
+ }));
250
+ }
251
+ dropIt() {
252
+ if (!this.parent) {
253
+ console.warn(
254
+ "DIVEPrimitive: dropIt() called on a model that is not in the scene.",
255
+ this
256
+ );
257
+ return;
258
+ }
259
+ const e = this._boundingBox.min.y * this.scale.y, t = this.localToWorld(
260
+ this._boundingBox.getCenter(new m()).multiply(this.scale)
261
+ );
262
+ t.y = e + this.position.y;
263
+ const r = new S(t, new m(0, -1, 0));
264
+ r.layers.mask = _;
265
+ const n = r.intersectObjects(
266
+ E(this).root.children,
267
+ !0
268
+ );
269
+ if (n.length > 0) {
270
+ const a = n[0].object;
271
+ a.geometry.computeBoundingBox();
272
+ const h = a.geometry.boundingBox, d = a.localToWorld(h.max.clone()), u = this.position.clone(), c = this.position.clone().setY(d.y).sub(new m(0, e, 0));
273
+ if (this.position.copy(c), this.position.y === u.y) return;
274
+ this.onMove();
275
+ }
276
+ }
277
+ assembleGeometry(e) {
278
+ switch (this._mesh.material.flatShading = !1, e.name.toLowerCase()) {
279
+ case "cylinder":
280
+ return this.createCylinderGeometry(e);
281
+ case "sphere":
282
+ return this.createSphereGeometry(e);
283
+ case "pyramid":
284
+ return this._mesh.material.flatShading = !0, this.createPyramidGeometry(e);
285
+ case "cube":
286
+ case "box":
287
+ return this.createBoxGeometry(e);
288
+ case "cone":
289
+ return this.createConeGeometry(e);
290
+ case "wall":
291
+ return this.createWallGeometry(e);
292
+ case "plane":
293
+ return this.createPlaneGeometry(e);
294
+ default:
295
+ return console.warn(
296
+ "DIVEPrimitive.assembleGeometry: Invalid geometry type:",
297
+ e.name.toLowerCase()
298
+ ), null;
299
+ }
300
+ }
301
+ createCylinderGeometry(e) {
302
+ const t = new Z(
303
+ e.width / 2,
304
+ e.width / 2,
305
+ e.height,
306
+ 64
307
+ );
308
+ return t.translate(0, e.height / 2, 0), t;
309
+ }
310
+ createSphereGeometry(e) {
311
+ return new C(e.width / 2, 256, 256);
312
+ }
313
+ createPyramidGeometry(e) {
314
+ const t = new Float32Array([
315
+ -e.width / 2,
316
+ 0,
317
+ -e.depth / 2,
318
+ // 0
319
+ e.width / 2,
320
+ 0,
321
+ -e.depth / 2,
322
+ // 1
323
+ e.width / 2,
324
+ 0,
325
+ e.depth / 2,
326
+ // 2
327
+ -e.width / 2,
328
+ 0,
329
+ e.depth / 2,
330
+ // 3
331
+ 0,
332
+ e.height,
333
+ 0
334
+ ]), r = new Uint16Array([
335
+ 0,
336
+ 1,
337
+ 2,
338
+ 0,
339
+ 2,
340
+ 3,
341
+ 0,
342
+ 4,
343
+ 1,
344
+ 1,
345
+ 4,
346
+ 2,
347
+ 2,
348
+ 4,
349
+ 3,
350
+ 3,
351
+ 4,
352
+ 0
353
+ ]), n = new V();
354
+ return n.setAttribute(
355
+ "position",
356
+ new x(t, 3)
357
+ ), n.setIndex(new x(r, 1)), n.computeVertexNormals(), n.computeBoundingBox(), n.computeBoundingSphere(), n;
358
+ }
359
+ createBoxGeometry(e) {
360
+ const t = new f(
361
+ e.width,
362
+ e.height,
363
+ e.depth
364
+ );
365
+ return t.translate(0, e.height / 2, 0), t;
366
+ }
367
+ createConeGeometry(e) {
368
+ const t = new j(e.width / 2, e.height, 256);
369
+ return t.translate(0, e.height / 2, 0), t;
370
+ }
371
+ createWallGeometry(e) {
372
+ const t = new f(
373
+ e.width,
374
+ e.height,
375
+ e.depth || 0.05,
376
+ 16
377
+ );
378
+ return t.translate(0, e.height / 2, 0), t;
379
+ }
380
+ createPlaneGeometry(e) {
381
+ const t = new f(
382
+ e.width,
383
+ e.height,
384
+ e.depth
385
+ );
386
+ return t.translate(0, e.height / 2, 0), t;
387
+ }
388
+ }
389
+ class fe extends v {
390
+ // lines to children
391
+ constructor() {
392
+ super();
393
+ s(this, "isDIVEGroup", !0);
394
+ s(this, "_members");
395
+ s(this, "_lines");
396
+ this.name = "DIVEGroup", this._members = [], this._lines = [];
397
+ }
398
+ // children objects
399
+ get members() {
400
+ return this._members;
401
+ }
402
+ setPosition(e) {
403
+ super.setPosition(e), this._members.forEach((t) => {
404
+ "isDIVENode" in t && t.onMove();
405
+ });
406
+ }
407
+ setLinesVisibility(e, t) {
408
+ if (!t) {
409
+ this._lines.forEach((n) => {
410
+ n.visible = e;
411
+ });
412
+ return;
413
+ }
414
+ const r = this._members.indexOf(t);
415
+ r !== -1 && (this._lines[r].visible = e);
416
+ }
417
+ attach(e) {
418
+ if (this._members.includes(e))
419
+ return this;
420
+ const t = this.createLine();
421
+ return this.add(t), this._lines.push(t), super.attach(e), this._members.push(e), this._updateLineTo(t, e), this.setLinesVisibility(!0, e), this;
422
+ }
423
+ /**
424
+ * Removes an object from the group.
425
+ * @param object - The object to remove.
426
+ * @returns The group instance.
427
+ */
428
+ remove(e) {
429
+ const t = this._members.indexOf(e);
430
+ if (t === -1)
431
+ return this;
432
+ const r = this._lines[t];
433
+ return super.remove(r), this._lines.splice(t, 1), super.remove(e), this._members.splice(t, 1), this;
434
+ }
435
+ updateLineTo(e) {
436
+ const t = this._members.indexOf(e);
437
+ t !== -1 && this._updateLineTo(this._lines[t], e);
438
+ }
439
+ /**
440
+ * Creates a line for visualization.
441
+ */
442
+ createLine() {
443
+ const e = new V(), t = new ee({
444
+ color: 6710886,
445
+ dashSize: 0.05,
446
+ gapSize: 0.025
447
+ }), r = new te(e, t);
448
+ return r.visible = !1, r;
449
+ }
450
+ /**
451
+ * Updates a line to the object.
452
+ */
453
+ _updateLineTo(e, t) {
454
+ const r = [
455
+ new m(0, 0, 0),
456
+ t.position.clone()
457
+ ];
458
+ e.geometry.setFromPoints(r), e.computeLineDistances();
459
+ }
460
+ // public setBoundingBoxVisibility(visible: boolean): void {
461
+ // this._boxMesh.visible = visible;
462
+ // }
463
+ // /**
464
+ // * Recalculates the position of the group based on it's bounding box.
465
+ // * Children's world positions are kept.
466
+ // */
467
+ // private recalculatePosition(): void {
468
+ // // store all children's world positions
469
+ // const childrensWorldPositions: Vector3[] = this.children.map((child) => child.getWorldPosition(new Vector3()));
470
+ // // calculate new center and set it as the group's position
471
+ // const bbcenter = this.updateBB();
472
+ // this.position.copy(bbcenter);
473
+ // // set childrens's positions so their world positions are kept
474
+ // this.children.forEach((child, i) => {
475
+ // if (child.uuid === this._boxMesh.uuid) return;
476
+ // child.position.copy(this.worldToLocal(childrensWorldPositions[i]));
477
+ // });
478
+ // DIVECommunication.get(this.userData.id)?.performAction('UPDATE_OBJECT', { id: this.userData.id, position: this.position });
479
+ // }
480
+ // /**
481
+ // * Updates the bounding box of the group.
482
+ // * @returns {Vector3} The new center of the bounding box.
483
+ // */
484
+ // private updateBB(): Vector3 {
485
+ // this._boundingBox.makeEmpty();
486
+ // if (this.children.length === 1) {
487
+ // // because we always have the box mesh as 1 child
488
+ // return this.position.clone();
489
+ // }
490
+ // this.children.forEach((child) => {
491
+ // if (child.uuid === this._boxMesh.uuid) return;
492
+ // this._boundingBox.expandByObject(child);
493
+ // });
494
+ // return this._boundingBox.getCenter(new Vector3());
495
+ // }
496
+ // private updateBoxMesh(): void {
497
+ // if (this.children.length === 1) {
498
+ // // because we always have the box mesh as 1 child
499
+ // this._boxMesh.visible = false;
500
+ // return;
501
+ // }
502
+ // this._boxMesh.quaternion.copy(this.quaternion.clone().invert());
503
+ // this._boxMesh.scale.set(1 / this.scale.x, 1 / this.scale.y, 1 / this.scale.z);
504
+ // this._boxMesh.geometry = new BoxGeometry(this._boundingBox.max.x - this._boundingBox.min.x, this._boundingBox.max.y - this._boundingBox.min.y, this._boundingBox.max.z - this._boundingBox.min.z);
505
+ // this._boxMesh.visible = true;
506
+ // }
507
+ }
508
+ class ye extends b {
509
+ constructor() {
510
+ const e = new ie(1, 1);
511
+ e.scale(1e3, 1e3, 1), e.rotateX(-Math.PI / 2);
512
+ const t = new D({
513
+ color: new l(16777215),
514
+ side: k
515
+ });
516
+ super(e, t);
517
+ s(this, "isDIVEFloor", !0);
518
+ this.name = "Floor", this.layers.mask = _, this.receiveShadow = !0;
519
+ }
520
+ setVisibility(e) {
521
+ this.visible = e;
522
+ }
523
+ setColor(e) {
524
+ this.material.color = new l(e);
525
+ }
526
+ }
527
+ class ve extends g {
528
+ constructor() {
529
+ super();
530
+ s(this, "isDIVERoot", !0);
531
+ s(this, "_floor");
532
+ this.name = "Root", this._floor = new ye(), this.add(this._floor);
533
+ }
534
+ get floor() {
535
+ return this._floor;
536
+ }
537
+ computeSceneBB() {
538
+ const e = new se();
539
+ return this.children.forEach((t) => {
540
+ "isDIVEFloor" in t || t.traverse((r) => {
541
+ "isObject3D" in r && e.expandByObject(r);
542
+ });
543
+ }), e;
544
+ }
545
+ getSceneObject(e) {
546
+ let t;
547
+ return this.traverse((r) => {
548
+ t || r.userData.id === e.id && (t = r);
549
+ }), t;
550
+ }
551
+ addSceneObject(e) {
552
+ let t = this.getSceneObject(e);
553
+ if (t)
554
+ return console.warn(
555
+ `DIVERoot.addSceneObject: Scene object with id ${e.id} already exists`
556
+ ), t;
557
+ switch (e.entityType) {
558
+ case "pov":
559
+ break;
560
+ case "light": {
561
+ switch (e.type) {
562
+ case "scene": {
563
+ t = new M();
564
+ break;
565
+ }
566
+ case "ambient": {
567
+ t = new ge();
568
+ break;
569
+ }
570
+ case "point": {
571
+ t = new pe();
572
+ break;
573
+ }
574
+ default:
575
+ throw new Error(
576
+ `DIVERoot.addSceneObject: Unknown light type: ${e.type}`
577
+ );
578
+ }
579
+ t.name = e.name, t.userData.id = e.id, this.add(t), this._updateLight(t, e);
580
+ break;
581
+ }
582
+ case "model": {
583
+ t = new B(), t.name = e.name, t.userData.id = e.id, t.userData.uri = e.uri, this.add(t), this._updateModel(t, e);
584
+ break;
585
+ }
586
+ case "primitive": {
587
+ t = new we(), t.name = e.name, t.userData.id = e.id, this.add(t), this._updatePrimitive(t, e);
588
+ break;
589
+ }
590
+ case "group": {
591
+ t = new fe(), t.name = e.name, t.userData.id = e.id, this.add(t), this._updateGroup(t, e);
592
+ break;
593
+ }
594
+ default:
595
+ throw new Error(
596
+ `DIVERoot.addSceneObject: Unknown entity type: ${e.entityType}`
597
+ );
598
+ }
599
+ return t;
600
+ }
601
+ updateSceneObject(e) {
602
+ const t = this.getSceneObject(e);
603
+ if (!t) {
604
+ console.warn(
605
+ `DIVERoot.updateSceneObject: Scene object with id ${e.id} does not exist`
606
+ );
607
+ return;
608
+ }
609
+ switch (e.entityType) {
610
+ case "pov":
611
+ break;
612
+ case "light": {
613
+ this._updateLight(t, e);
614
+ break;
615
+ }
616
+ case "model": {
617
+ this._updateModel(t, e);
618
+ break;
619
+ }
620
+ case "primitive": {
621
+ this._updatePrimitive(t, e);
622
+ break;
623
+ }
624
+ case "group": {
625
+ this._updateGroup(t, e);
626
+ break;
627
+ }
628
+ default:
629
+ throw new Error(
630
+ `DIVERoot.updateSceneObject: Unknown entity type: ${e.entityType}`
631
+ );
632
+ }
633
+ }
634
+ deleteSceneObject(e) {
635
+ const t = this.getSceneObject(e);
636
+ if (!t) {
637
+ console.warn(
638
+ `DIVERoot.deleteSceneObject: Object with id ${e.id} not found`
639
+ );
640
+ return;
641
+ }
642
+ switch (e.entityType) {
643
+ case "pov":
644
+ break;
645
+ case "light": {
646
+ this._deleteLight(t);
647
+ break;
648
+ }
649
+ case "model": {
650
+ this._deleteModel(t);
651
+ break;
652
+ }
653
+ case "primitive": {
654
+ this._deletePrimitive(t);
655
+ break;
656
+ }
657
+ case "group": {
658
+ this._deleteGroup(t);
659
+ break;
660
+ }
661
+ default:
662
+ throw new Error(
663
+ `DIVERoot.deleteSceneObject: Unknown entity type: ${e.entityType}`
664
+ );
665
+ }
666
+ }
667
+ _updateLight(e, t) {
668
+ t.name !== void 0 && t.name !== null && (e.name = t.name), t.position !== void 0 && t.position !== null && e.position.set(
669
+ t.position.x,
670
+ t.position.y,
671
+ t.position.z
672
+ ), t.intensity !== void 0 && t.intensity !== null && e.setIntensity(t.intensity), t.enabled !== void 0 && t.enabled !== null && e.setEnabled(t.enabled), t.color !== void 0 && t.color !== null && e.setColor(new l(t.color)), t.visible !== void 0 && t.visible !== null && (e.visible = t.visible), t.parentId !== void 0 && this._setParent({ ...t, parentId: t.parentId });
673
+ }
674
+ _updateModel(e, t) {
675
+ t.uri !== void 0 && e.setFromURL(t.uri), t.name !== void 0 && (e.name = t.name), t.position !== void 0 && e.setPosition(t.position), t.rotation !== void 0 && e.setRotation(t.rotation), t.scale !== void 0 && e.setScale(t.scale), t.visible !== void 0 && e.setVisibility(t.visible), t.material !== void 0 && e.setMaterial(t.material), t.parentId !== void 0 && this._setParent({ ...t, parentId: t.parentId });
676
+ }
677
+ _updatePrimitive(e, t) {
678
+ t.name !== void 0 && (e.name = t.name), t.geometry !== void 0 && e.setGeometry(t.geometry), t.position !== void 0 && e.setPosition(t.position), t.rotation !== void 0 && e.setRotation(t.rotation), t.scale !== void 0 && e.setScale(t.scale), t.visible !== void 0 && e.setVisibility(t.visible), t.material !== void 0 && e.setMaterial(t.material), t.parentId !== void 0 && this._setParent({ ...t, parentId: t.parentId });
679
+ }
680
+ _updateGroup(e, t) {
681
+ t.name !== void 0 && (e.name = t.name), t.position !== void 0 && e.setPosition(t.position), t.rotation !== void 0 && e.setRotation(t.rotation), t.scale !== void 0 && e.setScale(t.scale), t.visible !== void 0 && e.setVisibility(t.visible), t.bbVisible !== void 0 && e.setLinesVisibility(t.bbVisible), t.parentId !== void 0 && this._setParent({ ...t, parentId: t.parentId });
682
+ }
683
+ _deleteLight(e) {
684
+ this._detachTransformControls(e), e.parent.remove(e);
685
+ }
686
+ _deleteModel(e) {
687
+ this._detachTransformControls(e), e.parent.remove(e);
688
+ }
689
+ _deletePrimitive(e) {
690
+ this._detachTransformControls(e), e.parent.remove(e);
691
+ }
692
+ _deleteGroup(e) {
693
+ this._detachTransformControls(e);
694
+ for (let t = e.members.length - 1; t >= 0; t--)
695
+ this.attach(e.members[t]);
696
+ e.parent.remove(e);
697
+ }
698
+ _setParent(e) {
699
+ const t = this.getSceneObject(e);
700
+ if (e.parentId !== null) {
701
+ const r = this.getSceneObject({
702
+ id: e.parentId,
703
+ entityType: e.entityType
704
+ });
705
+ if (!r) return;
706
+ r.attach(t);
707
+ } else
708
+ this.attach(t);
709
+ }
710
+ _detachTransformControls(e) {
711
+ this._findScene(e).children.find((t) => {
712
+ "isTransformControls" in t && t.detach();
713
+ });
714
+ }
715
+ _findScene(e) {
716
+ return e.parent !== null ? this._findScene(e.parent) : e;
717
+ }
718
+ }
719
+ const be = "#888888", De = "#dddddd";
720
+ class Ee extends g {
721
+ constructor() {
722
+ super(), this.name = "Grid";
723
+ const i = new re(
724
+ 100,
725
+ 100,
726
+ be,
727
+ De
728
+ );
729
+ i.material.depthTest = !1, i.layers.mask = de, this.add(i);
730
+ }
731
+ setVisibility(i) {
732
+ this.visible = i;
733
+ }
734
+ }
735
+ class Ie extends ne {
736
+ constructor() {
737
+ super();
738
+ s(this, "_root");
739
+ s(this, "_grid");
740
+ this.background = new l(16777215), this._root = new ve(), this.add(this._root), this._grid = new Ee(), this.add(this._grid);
741
+ }
742
+ get root() {
743
+ return this._root;
744
+ }
745
+ get grid() {
746
+ return this._grid;
747
+ }
748
+ setBackground(e) {
749
+ this.background = new l(e);
750
+ }
751
+ computeSceneBB() {
752
+ return this.root.computeSceneBB();
753
+ }
754
+ }
755
+ const P = {
756
+ canvas: void 0,
757
+ antialias: !0,
758
+ alpha: !0,
759
+ powerPreference: "high-performance",
760
+ precision: "highp",
761
+ stencil: !1,
762
+ depth: !0,
763
+ logarithmicDepthBuffer: !1,
764
+ shadows: !0,
765
+ shadowQuality: "high"
766
+ };
767
+ class xe {
768
+ constructor(i, e, t) {
769
+ s(this, "_webglrenderer");
770
+ s(this, "_settings");
771
+ this._scene = i, this._camera = e, this._settings = {
772
+ ...P,
773
+ ...t ?? {}
774
+ }, this._webglrenderer = new L(this._settings), this._webglrenderer.shadowMap.enabled = this._settings.shadows, this._webglrenderer.shadowMap.type = this._settings.shadowQuality === "high" ? oe : this._settings.shadowQuality === "medium" ? ae : he;
775
+ }
776
+ get webglrenderer() {
777
+ return this._webglrenderer;
778
+ }
779
+ setCanvas(i) {
780
+ this._webglrenderer.dispose(), this._settings.canvas = i, this._webglrenderer = new L(this._settings);
781
+ }
782
+ render() {
783
+ this._webglrenderer.render(this._scene, this._camera);
784
+ }
785
+ onResize(i, e) {
786
+ this._webglrenderer.setSize(i, e, !1);
787
+ }
788
+ dispose() {
789
+ this._webglrenderer.dispose();
790
+ }
791
+ }
792
+ class Le {
793
+ constructor() {
794
+ s(this, "_renderer", null);
795
+ s(this, "_lastTime", 0);
796
+ s(this, "_isRunning", !1);
797
+ s(this, "_tickers", []);
798
+ }
799
+ start() {
800
+ this._isRunning || (this._isRunning = !0, this._lastTime = performance.now(), requestAnimationFrame(this._tick.bind(this)));
801
+ }
802
+ stop() {
803
+ this._isRunning = !1;
804
+ }
805
+ setRenderer(i) {
806
+ this._renderer = i;
807
+ }
808
+ addTicker(i) {
809
+ this._tickers.find((e) => e.uuid === i.uuid) || this._tickers.push(i);
810
+ }
811
+ hasTicker(i) {
812
+ return this._tickers.find((e) => e.uuid === i.uuid) !== void 0;
813
+ }
814
+ removeTicker(i) {
815
+ const e = this._tickers.findIndex((t) => t.uuid === i.uuid);
816
+ e !== -1 && this._tickers.splice(e, 1);
817
+ }
818
+ dispose() {
819
+ this.stop(), this._tickers.forEach((i) => {
820
+ var e;
821
+ return (e = i.dispose) == null ? void 0 : e.call(i);
822
+ }), this._tickers = [], this._isRunning = !1, this._lastTime = 0;
823
+ }
824
+ _tick(i) {
825
+ var t;
826
+ if (!this._isRunning) return;
827
+ const e = (i - this._lastTime) / 1e3;
828
+ this._lastTime = i, this._tickers.forEach((r) => r.tick(e)), (t = this._renderer) == null || t.render(), requestAnimationFrame(this._tick.bind(this));
829
+ }
830
+ }
831
+ class Ce {
832
+ constructor(i, e) {
833
+ s(this, "_resizeObserver");
834
+ s(this, "_width", 0);
835
+ s(this, "_height", 0);
836
+ this._resizeObserver = new ResizeObserver((t) => {
837
+ for (const r of t) {
838
+ const { width: n, height: a } = r.contentRect;
839
+ n === this._width && a === this._height || (i.onResize(n, a), e.onResize(n, a), this._width = n, this._height = a);
840
+ }
841
+ }), this._observeCanvas(i.webglrenderer.domElement);
842
+ }
843
+ setCanvas(i) {
844
+ this._resizeObserver.disconnect(), this._observeCanvas(i);
845
+ }
846
+ dispose() {
847
+ this._resizeObserver.disconnect();
848
+ }
849
+ _observeCanvas(i) {
850
+ if (i.parentElement)
851
+ this._resizeObserver.observe(i.parentElement);
852
+ else {
853
+ const e = setInterval(() => {
854
+ i.parentElement && (this._resizeObserver.observe(i.parentElement), clearInterval(e));
855
+ }, 16);
856
+ }
857
+ }
858
+ }
859
+ const T = {
860
+ autoStart: !0,
861
+ displayAxes: !1,
862
+ ...ce,
863
+ ...P
864
+ };
865
+ class ke {
866
+ constructor(i) {
867
+ s(this, "_renderer");
868
+ s(this, "_scene");
869
+ s(this, "_camera");
870
+ s(this, "_resizeManager");
871
+ s(this, "_clock");
872
+ s(this, "_settings");
873
+ this._settings = {
874
+ ...T,
875
+ ...i ?? {}
876
+ }, this._scene = new Ie(), this._camera = new _e(this._settings), this._renderer = new xe(
877
+ this._scene,
878
+ this._camera,
879
+ this._settings
880
+ ), this._resizeManager = new Ce(
881
+ this._renderer,
882
+ this._camera
883
+ ), this._clock = new Le(), this._clock.setRenderer(this._renderer), this._settings.autoStart && this.start();
884
+ }
885
+ get scene() {
886
+ return this._scene;
887
+ }
888
+ get camera() {
889
+ return this._camera;
890
+ }
891
+ get renderer() {
892
+ return this._renderer;
893
+ }
894
+ setCanvas(i) {
895
+ this._renderer.setCanvas(i), this._resizeManager.setCanvas(i);
896
+ }
897
+ get clock() {
898
+ return this._clock;
899
+ }
900
+ start() {
901
+ this._clock.start();
902
+ }
903
+ stop() {
904
+ this._clock.stop();
905
+ }
906
+ dispose() {
907
+ this._clock.dispose(), this._resizeManager.dispose(), this._renderer.dispose();
908
+ }
909
+ }
910
+ const R = "#c20017", G = "#00ab26", A = "#0081d4", Se = R, Ve = G, Me = A;
911
+ window.DIVE = {
912
+ instances: [],
913
+ get instance() {
914
+ return window.DIVE.instances[0];
915
+ }
916
+ };
917
+ const Be = {
918
+ ...T,
919
+ ...U
920
+ };
921
+ class O {
922
+ constructor(i) {
923
+ // descriptive members
924
+ s(this, "_instanceId", w.generateUUID());
925
+ s(this, "_settings");
926
+ s(this, "_engine");
927
+ s(this, "orbitController");
928
+ s(this, "orientationDisplay");
929
+ this._settings = {
930
+ ...Be,
931
+ ...i ?? {}
932
+ }, this._engine = new ke(i), this.orbitController = new I(
933
+ this._engine.camera,
934
+ this._engine.renderer.webglrenderer.domElement,
935
+ this._settings
936
+ ), this._engine.clock.addTicker(this.orbitController), this._settings.displayAxes ? (this.orientationDisplay = new me(
937
+ this._engine.renderer,
938
+ this._engine.scene,
939
+ this._engine.camera
940
+ ), this._engine.clock.addTicker(this.orientationDisplay)) : this.orientationDisplay = null, import("./package-DSKqbNMb.mjs").then((e) => {
941
+ console.log(
942
+ `DIVE ${e.default.version} initialized successfully!`
943
+ ), console.log(`
944
+ @@@@@@@@@@@@@@@@@@@@@@@ @@@@@@@@@@@@@@@@@@@@@@@
945
+ @@@@+-:::::::---------------------==------------------------------=#@@@@
946
+ @@%=::::.......::---------------------------------------------------------+@@
947
+ @@+:::...........::-----------------------------------------------------------#@@
948
+ @@=:::.........::::::-------------------------------------------------------------%@
949
+ @%:::.......:::::::-----------------------------------------------------------------#@
950
+ @*:::.....:::::-----------------------------------------------------------------------*@
951
+ @%::::::.::::---------------------------------------------------------------------------@@
952
+ @@-:::::::::-----------------------------------------------------------------------------=@
953
+ @%::::::::--------------------------------------------------------------------------------%@
954
+ @+::::::::--------------------------------=@@@@@%-----------------------------------------%@
955
+ @=:::::::--------------------------------*@@ @@+---------------------------------------#@
956
+ @+:::::::-------------------------------*@ @*--------------------------------------%@
957
+ @#::::::::-----------------------------=@@ @@=-------------------------------------%@
958
+ @@-::::::::----------------------------@@ @@------------------------------------=@
959
+ @%:::::::::--------------------------*@ @*-----------------------------------@@
960
+ @*:::::::::-------------------------@@ @@----------------------------------%@
961
+ @#::::::::::----------------------%@ @%--------------------------------%@
962
+ @#:::::::::::-------------------=@@ @@=------------------------------%@
963
+ @@-::::::::::::----------------%@ @%----------------------------=@@
964
+ @@#::::::::::::::------------*@ @*--------------------------#@@
965
+ @@+::::::::::::::::--------@@ @@------------------------+@@
966
+ @@*:::::::::::::::::----@@ @@---------------------+@@
967
+ @@@-:::::::::::::::--#@ @#-----------------=%@@
968
+ @@%-::::::::::::-%@ @%-------------=%@@
969
+ @@@@+:::::::#@@ @@*-------*@@@@
970
+ @@@@@@@ @@@@@@
971
+
972
+ `);
973
+ }), window.DIVE.instances.push(this);
974
+ }
975
+ // static members
976
+ static async QuickView(i, e) {
977
+ const t = new O(e);
978
+ t.engine.scene.background = new l(16777215), t.engine.scene.grid.setVisibility(!1), t.engine.scene.root.floor.setVisibility(!0), t.engine.camera.position.set(0, 2, 2), t.orbitController.target.set(0, 0.5, 0);
979
+ const r = new M();
980
+ r.name = "SceneLight", r.userData.id = w.generateUUID(), r.setEnabled(!0), r.visible = !0, r.setIntensity((e == null ? void 0 : e.lightIntensity) ?? 1), r.setColor(new l(16777215)), t.engine.scene.root.add(r);
981
+ const n = new B();
982
+ n.name = "object", n.userData.id = w.generateUUID(), n.userData.uri = i, n.visible = !0, t.engine.scene.root.add(n), await n.setFromURL(i);
983
+ const a = new H(n);
984
+ t.engine.scene.add(a);
985
+ const h = t.orbitController.computeEncompassingView(a);
986
+ return t.engine.camera.position.copy(h.position), t.orbitController.target.copy(h.target), t;
987
+ }
988
+ get engine() {
989
+ return this._engine;
990
+ }
991
+ get canvas() {
992
+ return this._engine.renderer.webglrenderer.domElement;
993
+ }
994
+ setCanvas(i) {
995
+ this._engine.setCanvas(i), this._engine.clock.removeTicker(this.orbitController), this.orbitController.dispose(), this.orbitController = new I(
996
+ this._engine.camera,
997
+ i,
998
+ this._settings
999
+ ), this._engine.clock.addTicker(this.orbitController);
1000
+ }
1001
+ async dispose() {
1002
+ return new Promise((i) => {
1003
+ this._engine.clock.removeTicker(this.orbitController), this.orbitController.dispose(), this.orientationDisplay && (this._engine.clock.removeTicker(this.orientationDisplay), this.orientationDisplay.dispose()), window.DIVE.instances = window.DIVE.instances.filter(
1004
+ (e) => e._instanceId !== this._instanceId
1005
+ ), i();
1006
+ });
1007
+ }
1008
+ }
1009
+ const Pe = {
1010
+ glb: {
1011
+ key: "glb",
1012
+ extension: "glb"
1013
+ },
1014
+ gltf: {
1015
+ key: "gltf",
1016
+ extension: "gltf"
1017
+ },
1018
+ usdz: {
1019
+ key: "usdz",
1020
+ extension: "usdz"
1021
+ }
1022
+ }, Fe = Object.values(Pe).map(
1023
+ (o) => o.extension
1024
+ );
1025
+ export {
1026
+ Se as A,
1027
+ Be as D,
1028
+ T as E,
1029
+ Pe as F,
1030
+ be as G,
1031
+ me as O,
1032
+ Fe as S,
1033
+ ue as a,
1034
+ Ve as b,
1035
+ Me as c,
1036
+ O as d,
1037
+ R as e,
1038
+ G as f,
1039
+ A as g,
1040
+ De as h,
1041
+ ye as i,
1042
+ Ee as j,
1043
+ fe as k,
1044
+ ge as l,
1045
+ pe as m,
1046
+ M as n,
1047
+ B as o,
1048
+ we as p,
1049
+ ve as q,
1050
+ Le as r,
1051
+ P as s,
1052
+ xe as t,
1053
+ Ce as u,
1054
+ Ie as v,
1055
+ ke as w,
1056
+ E as x
1057
+ };