@roomle/web-sdk 2.60.0-alpha.2 → 2.60.0-alpha.3

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 (442) hide show
  1. package/lib/TextGeometry-0776cbf7.js +2 -0
  2. package/lib/TextGeometry-0776cbf7.js.map +1 -0
  3. package/lib/TextGeometry-a3187fcf.nomodule.js +2 -0
  4. package/lib/TextGeometry-a3187fcf.nomodule.js.map +1 -0
  5. package/lib/banana-for-scale-1cd9a2fc.js +2 -0
  6. package/lib/{banana-for-scale-42f1dc5b.js.map → banana-for-scale-1cd9a2fc.js.map} +1 -1
  7. package/lib/banana-for-scale-70f00b0d.nomodule.js +2 -0
  8. package/lib/{banana-for-scale-f49704e0.nomodule.js.map → banana-for-scale-70f00b0d.nomodule.js.map} +1 -1
  9. package/lib/{budgeteer-measure-21e9de2e.js → budgeteer-measure-7daaf07a.js} +2 -2
  10. package/lib/{budgeteer-measure-21e9de2e.js.map → budgeteer-measure-7daaf07a.js.map} +1 -1
  11. package/lib/budgeteer-measure.nomodule.js +1 -1
  12. package/lib/component-dimensioning-5fb755f6.js +2 -0
  13. package/lib/component-dimensioning-5fb755f6.js.map +1 -0
  14. package/lib/component-dimensioning-72e9b95a.nomodule.js +2 -0
  15. package/lib/component-dimensioning-72e9b95a.nomodule.js.map +1 -0
  16. package/lib/component-raycast-helper-37e29c9e.js +2 -0
  17. package/lib/component-raycast-helper-37e29c9e.js.map +1 -0
  18. package/lib/component-raycast-helper-88babaeb.nomodule.js +2 -0
  19. package/lib/component-raycast-helper-88babaeb.nomodule.js.map +1 -0
  20. package/lib/configurator-55acafcc.nomodule.js +2 -0
  21. package/lib/configurator-55acafcc.nomodule.js.map +1 -0
  22. package/lib/configurator-89ce03c4.js +2 -0
  23. package/lib/configurator-89ce03c4.js.map +1 -0
  24. package/lib/configurator-dummy-app.js +1 -1
  25. package/lib/configurator-dummy-app.js.map +1 -1
  26. package/lib/configurator-dummy.html +1 -0
  27. package/lib/configurator-main-07f34c9f.js +2 -0
  28. package/lib/configurator-main-07f34c9f.js.map +1 -0
  29. package/lib/configurator-main.nomodule.js +1 -1
  30. package/lib/continuous-drawing-helper-14c9e7da.js +2 -0
  31. package/lib/continuous-drawing-helper-14c9e7da.js.map +1 -0
  32. package/lib/continuous-drawing-helper-a59e7a93.nomodule.js +2 -0
  33. package/lib/continuous-drawing-helper-a59e7a93.nomodule.js.map +1 -0
  34. package/lib/default-light-setting-3531c5f5.js +2 -0
  35. package/lib/default-light-setting-3531c5f5.js.map +1 -0
  36. package/lib/default-light-setting-bcb1df58.nomodule.js +2 -0
  37. package/lib/default-light-setting-bcb1df58.nomodule.js.map +1 -0
  38. package/lib/definitions/common-core/__tests__/image-renderer.d.ts +13 -0
  39. package/lib/definitions/common-core/config/environment.d.ts +2 -1
  40. package/lib/definitions/common-core/mock/mock-draco-loader.d.ts +6 -0
  41. package/lib/definitions/common-core/mock/mock-gltf-loader.d.ts +9 -0
  42. package/lib/definitions/common-core/mock/mock-image-renderer.d.ts +18 -0
  43. package/lib/definitions/common-core/mock/mock-pixotron.d.ts +5 -5
  44. package/lib/definitions/common-core/mock/mock-utils.d.ts +2 -2
  45. package/lib/definitions/common-core/mock/three-mock.d.ts +10 -1
  46. package/lib/definitions/common-core/src/cameracontrol/camera-control-2d.d.ts +5 -4
  47. package/lib/definitions/common-core/src/cameracontrol/camera-control-3d.d.ts +11 -10
  48. package/lib/definitions/common-core/src/cameracontrol/camera-control.d.ts +13 -12
  49. package/lib/definitions/common-core/src/environment/background-environment.d.ts +4 -3
  50. package/lib/definitions/common-core/src/environment/dynamic-environment-setting-loader.d.ts +3 -2
  51. package/lib/definitions/common-core/src/environment/environment.d.ts +7 -6
  52. package/lib/definitions/common-core/src/environment/ground-projected-environment.d.ts +14 -0
  53. package/lib/definitions/common-core/src/lightsetting/dynamic-light-setting-loader.d.ts +7 -4
  54. package/lib/definitions/common-core/src/lightsetting/dynamic-light-setting.d.ts +4 -3
  55. package/lib/definitions/common-core/src/lightsetting/light-setting.d.ts +5 -4
  56. package/lib/definitions/common-core/src/main.d.ts +2 -1
  57. package/lib/definitions/common-core/src/rapi-access.d.ts +1 -1
  58. package/lib/definitions/common-core/src/services/cache-holder.d.ts +3 -2
  59. package/lib/definitions/common-core/src/services/common-kernel-access.d.ts +3 -1
  60. package/lib/definitions/common-core/src/services/hdr-environment-loader.d.ts +18 -0
  61. package/lib/definitions/common-core/src/static-files/environment-maps.d.ts +3 -0
  62. package/lib/definitions/common-core/src/static-files/roomle-core.d.ts +1 -0
  63. package/lib/definitions/common-core/src/static-files/three.d.ts +0 -13
  64. package/lib/definitions/common-core/src/utils/dom-helper.d.ts +2 -1
  65. package/lib/definitions/common-core/src/utils/fps-couter.d.ts +12 -0
  66. package/lib/definitions/common-core/src/utils/init-data.d.ts +3 -5
  67. package/lib/definitions/common-core/src/utils/kernel-utils.d.ts +8 -7
  68. package/lib/definitions/common-core/src/utils/material-creator.d.ts +12 -0
  69. package/lib/definitions/common-core/src/utils/shims.d.ts +12 -0
  70. package/lib/definitions/common-core/src/utils/stats-helper.d.ts +2 -4
  71. package/lib/definitions/common-core/src/utils/threejs-utils.d.ts +43 -40
  72. package/lib/definitions/common-core/src/view-model/configurator-view-model.d.ts +6 -5
  73. package/lib/definitions/common-core/src/view-model/plan-element-view-model.d.ts +14 -13
  74. package/lib/definitions/common-core/src/view-model/plan-object-view-model.d.ts +2 -1
  75. package/lib/definitions/common-core/src/webgl/EnvMapReader.d.ts +1 -1
  76. package/lib/definitions/common-core/src/webgl/baked-shadow-plane.d.ts +4 -3
  77. package/lib/definitions/common-core/src/webgl/hdr-env-map-reader.d.ts +18 -0
  78. package/lib/definitions/common-core/src/webgl/image-renderer.d.ts +16 -9
  79. package/lib/definitions/common-core/src/webgl/mesh-generator.d.ts +15 -15
  80. package/lib/definitions/common-core/src/webgl/renderer/baked-ground-contact-shadow.d.ts +59 -0
  81. package/lib/definitions/common-core/src/webgl/renderer/effect-pass.d.ts +108 -0
  82. package/lib/definitions/common-core/src/webgl/renderer/gbuffer-render-target.d.ts +43 -0
  83. package/lib/definitions/common-core/src/webgl/renderer/ground-reflection-pass.d.ts +72 -0
  84. package/lib/definitions/common-core/src/webgl/renderer/light-source-detection.d.ts +76 -0
  85. package/lib/definitions/common-core/src/webgl/renderer/outline-pass.d.ts +56 -0
  86. package/lib/definitions/common-core/src/webgl/renderer/outline-renderer.d.ts +32 -0
  87. package/lib/definitions/common-core/src/webgl/renderer/render-utility.d.ts +83 -0
  88. package/lib/definitions/common-core/src/webgl/renderer/scene-renderer-gui.d.ts +16 -0
  89. package/lib/definitions/common-core/src/webgl/renderer/scene-renderer.d.ts +111 -0
  90. package/lib/definitions/common-core/src/webgl/renderer/screen-space-shadow-map.d.ts +139 -0
  91. package/lib/definitions/common-core/src/webgl/renderer/shader-utility.d.ts +98 -0
  92. package/lib/definitions/common-core/src/webgl/renderer/shadow-and-ao-pass.d.ts +123 -0
  93. package/lib/definitions/common-core/src/webgl/roomle-component-factory.d.ts +24 -22
  94. package/lib/definitions/common-core/src/webgl/roomle-webl-renderer.d.ts +42 -0
  95. package/lib/definitions/common-core/src/webgl/scene-event-handler.d.ts +2 -1
  96. package/lib/definitions/common-core/src/webgl/scene-manager.d.ts +21 -27
  97. package/lib/definitions/common-core/src/webgl/static-item-loader.d.ts +5 -6
  98. package/lib/definitions/configurator-core/src/roomle-configurator.d.ts +7 -11
  99. package/lib/definitions/configurator-core/src/utils/async-dependency-loader.d.ts +2 -1
  100. package/lib/definitions/configurator-core/src/utils/component-dimensioning-helper.d.ts +2 -1
  101. package/lib/definitions/configurator-core/src/utils/component-dimensioning.d.ts +4 -2
  102. package/lib/definitions/configurator-core/src/utils/component-raycast-helper.d.ts +3 -2
  103. package/lib/definitions/configurator-core/src/utils/dimensioning-helper.d.ts +10 -9
  104. package/lib/definitions/configurator-core/src/utils/raycast-helper.d.ts +8 -7
  105. package/lib/definitions/configurator-core/src/utils/text-with-background.d.ts +5 -3
  106. package/lib/definitions/configurator-core/src/utils/ui-intersection-helper.d.ts +3 -2
  107. package/lib/definitions/configurator-core/src/webgl/banana-for-scale.d.ts +4 -3
  108. package/lib/definitions/configurator-core/src/webgl/configurator-mesh-generator.d.ts +5 -4
  109. package/lib/definitions/configurator-core/src/webgl/configurator-scene-event-handler.d.ts +3 -2
  110. package/lib/definitions/configurator-core/src/webgl/configurator-scene-manager.d.ts +6 -9
  111. package/lib/definitions/configurator-core/src/webgl/environment/floor-environment.d.ts +6 -7
  112. package/lib/definitions/configurator-core/src/webgl/lightsetting/default-light-setting.d.ts +3 -2
  113. package/lib/definitions/configurator-core/src/webgl/lightsetting/hd-light-setting.d.ts +2 -1
  114. package/lib/definitions/configurator-core/src/webgl/lightsetting/top-image-light-setting.d.ts +2 -1
  115. package/lib/definitions/configurator-core/src/webgl/plugin-system.d.ts +18 -17
  116. package/lib/definitions/glb-viewer-core/src/camera-control/adjustable-camera-control-3d.d.ts +3 -2
  117. package/lib/definitions/glb-viewer-core/src/roomle-glb-viewer.d.ts +2 -9
  118. package/lib/definitions/glb-viewer-core/src/webgl/glb-viewer-light-setting.d.ts +2 -1
  119. package/lib/definitions/glb-viewer-core/src/webgl/glb-viewer-scene-manager.d.ts +5 -7
  120. package/lib/definitions/material-viewer/src/roomle-material-viewer.d.ts +2 -9
  121. package/lib/definitions/material-viewer/src/webgl/material-viewer-scene-manager.d.ts +2 -4
  122. package/lib/definitions/planner-core/src/camera-control/camera-control-first-person.d.ts +4 -3
  123. package/lib/definitions/planner-core/src/roomle-planner.d.ts +4 -4
  124. package/lib/definitions/planner-core/src/utils/planner-scene-manager.d.ts +2 -1
  125. package/lib/definitions/planner-core/src/view-model/ceiling-plan-element-view-model.d.ts +2 -1
  126. package/lib/definitions/planner-core/src/view-model/construction-plan-object-view-model.d.ts +3 -2
  127. package/lib/definitions/planner-core/src/view-model/floor-plan-element-view-model.d.ts +2 -1
  128. package/lib/definitions/planner-core/src/view-model/node-plan-element-view-model.d.ts +4 -2
  129. package/lib/definitions/planner-core/src/view-model/plan-view-model.d.ts +7 -6
  130. package/lib/definitions/planner-core/src/view-model/wall-plan-element-view-model.d.ts +4 -3
  131. package/lib/definitions/planner-core/src/webgl/continuous-drawing-helper.d.ts +2 -1
  132. package/lib/definitions/planner-core/src/webgl/lightsetting/planner-light-setting.d.ts +3 -2
  133. package/lib/definitions/planner-core/src/webgl/planner-mesh-generator.d.ts +5 -4
  134. package/lib/definitions/planner-core/src/webgl/planner-scene-event-handler.d.ts +7 -6
  135. package/lib/definitions/planner-core/src/webgl/planner-scene-manager.d.ts +5 -7
  136. package/lib/definitions/typings/configurator-kernel-container.d.ts +3 -2
  137. package/lib/definitions/typings/kernel.d.ts +17 -4
  138. package/lib/definitions/typings/pixotron.d.ts +7 -28
  139. package/lib/definitions/typings/planner-kernel-container.d.ts +4 -3
  140. package/lib/definitions/typings/stats.d.ts +1 -17
  141. package/lib/dimensioning-helper-79e88370.nomodule.js +2 -0
  142. package/lib/{dimensioning-helper-e0cb55a5.nomodule.js.map → dimensioning-helper-79e88370.nomodule.js.map} +1 -1
  143. package/lib/dimensioning-helper-89e15d5c.js +2 -0
  144. package/lib/{dimensioning-helper-db71ae43.js.map → dimensioning-helper-89e15d5c.js.map} +1 -1
  145. package/lib/glb-viewer-220acd23.nomodule.js +2 -0
  146. package/lib/{glb-viewer-04fd6e23.nomodule.js.map → glb-viewer-220acd23.nomodule.js.map} +1 -1
  147. package/lib/glb-viewer-4f0558f5.js +2 -0
  148. package/lib/{glb-viewer-305d8bd7.js.map → glb-viewer-4f0558f5.js.map} +1 -1
  149. package/lib/glb-viewer-dummy-app.js +1 -1
  150. package/lib/glb-viewer-dummy-app.js.map +1 -1
  151. package/lib/glb-viewer-main-e4717d13.js +2 -0
  152. package/lib/glb-viewer-main-e4717d13.js.map +1 -0
  153. package/lib/glb-viewer-main.nomodule.js +1 -1
  154. package/lib/legacy/TextGeometry-7b0ba2a4.legacy.js +2 -0
  155. package/lib/legacy/TextGeometry-7b0ba2a4.legacy.js.map +1 -0
  156. package/lib/legacy/banana-for-scale-e04c4cff.legacy.js +2 -0
  157. package/lib/legacy/{banana-for-scale-7bad9610.legacy.js.map → banana-for-scale-e04c4cff.legacy.js.map} +1 -1
  158. package/lib/legacy/budgeteer-measure.legacy.js +1 -1
  159. package/lib/legacy/component-dimensioning-5060f862.legacy.js +2 -0
  160. package/lib/legacy/component-dimensioning-5060f862.legacy.js.map +1 -0
  161. package/lib/legacy/component-raycast-helper-07671bc4.legacy.js +2 -0
  162. package/lib/legacy/component-raycast-helper-07671bc4.legacy.js.map +1 -0
  163. package/lib/legacy/configurator-b4e0e93e.legacy.js +2 -0
  164. package/lib/legacy/configurator-b4e0e93e.legacy.js.map +1 -0
  165. package/lib/legacy/configurator-main.legacy.js +1 -1
  166. package/lib/legacy/continuous-drawing-helper-a7c2d434.legacy.js +2 -0
  167. package/lib/legacy/continuous-drawing-helper-a7c2d434.legacy.js.map +1 -0
  168. package/lib/legacy/default-light-setting-195b2ab7.legacy.js +2 -0
  169. package/lib/legacy/default-light-setting-195b2ab7.legacy.js.map +1 -0
  170. package/lib/legacy/dimensioning-helper-7d4bb1f1.legacy.js +2 -0
  171. package/lib/legacy/{dimensioning-helper-be8595e0.legacy.js.map → dimensioning-helper-7d4bb1f1.legacy.js.map} +1 -1
  172. package/lib/legacy/glb-viewer-c0216056.legacy.js +2 -0
  173. package/lib/legacy/{glb-viewer-1aef71c0.legacy.js.map → glb-viewer-c0216056.legacy.js.map} +1 -1
  174. package/lib/legacy/glb-viewer-main.legacy.js +1 -1
  175. package/lib/legacy/main-thread-to-worker-ebe10a2b.legacy.js +7 -0
  176. package/lib/legacy/main-thread-to-worker-ebe10a2b.legacy.js.map +1 -0
  177. package/lib/legacy/material-viewer-32a9186e.legacy.js +2 -0
  178. package/lib/legacy/material-viewer-32a9186e.legacy.js.map +1 -0
  179. package/lib/legacy/material-viewer-main.legacy.js +1 -1
  180. package/lib/legacy/planner-b3649aa5.legacy.js +2 -0
  181. package/lib/legacy/planner-b3649aa5.legacy.js.map +1 -0
  182. package/lib/legacy/planner-main.legacy.js +1 -1
  183. package/lib/legacy/roomle-configurator-9d57ec02.legacy.js +2 -0
  184. package/lib/legacy/roomle-configurator-9d57ec02.legacy.js.map +1 -0
  185. package/lib/legacy/roomle-dependency-injection-ddf49a56.legacy.js +9 -0
  186. package/lib/legacy/roomle-dependency-injection-ddf49a56.legacy.js.map +1 -0
  187. package/lib/legacy/roomle-sdk.legacy.js +1 -1
  188. package/lib/legacy/scene-manager-f62f275a.legacy.js +2 -0
  189. package/lib/legacy/scene-manager-f62f275a.legacy.js.map +1 -0
  190. package/lib/legacy/script-loader-0bad813a.legacy.js +2 -0
  191. package/lib/legacy/script-loader-0bad813a.legacy.js.map +1 -0
  192. package/lib/legacy/static/Tween-d57ee5d181fce582.js +767 -0
  193. package/lib/legacy/static/default_1k-2aa6d42244d30fb1.exr +0 -0
  194. package/lib/legacy/static/default_256-f1c66a2764f88cc0.exr +0 -0
  195. package/lib/legacy/static/draco_decoder-b048235474cbf09e.wasm +0 -0
  196. package/lib/legacy/static/draco_decoder-dc7f397e2a2ebac4.js +34 -0
  197. package/lib/legacy/static/draco_wasm_wrapper-6263f3a4b71cdf3b.js +117 -0
  198. package/lib/legacy/static/legacy_env-d5810ec5057d4716.exr +0 -0
  199. package/lib/{stats-helper-9c26a9c0.nomodule.js → legacy/stats-helper-546b9aa8.legacy.js} +2 -2
  200. package/lib/legacy/stats-helper-546b9aa8.legacy.js.map +1 -0
  201. package/lib/legacy/tools-core-2745a165.legacy.js +2 -0
  202. package/lib/legacy/tools-core-2745a165.legacy.js.map +1 -0
  203. package/lib/main-thread-to-worker-29498ad3.js +7 -0
  204. package/lib/main-thread-to-worker-29498ad3.js.map +1 -0
  205. package/lib/main-thread-to-worker-a2554a6a.nomodule.js +8 -0
  206. package/lib/main-thread-to-worker-a2554a6a.nomodule.js.map +1 -0
  207. package/lib/material-viewer-015815c1.nomodule.js +2 -0
  208. package/lib/material-viewer-015815c1.nomodule.js.map +1 -0
  209. package/lib/material-viewer-eedffa51.js +2 -0
  210. package/lib/material-viewer-eedffa51.js.map +1 -0
  211. package/lib/material-viewer-main-24ebdc40.js +2 -0
  212. package/lib/material-viewer-main-24ebdc40.js.map +1 -0
  213. package/lib/material-viewer-main.nomodule.js +1 -1
  214. package/lib/planner-60e8f69a.nomodule.js +2 -0
  215. package/lib/planner-60e8f69a.nomodule.js.map +1 -0
  216. package/lib/planner-dummy-app.js +1 -1
  217. package/lib/planner-dummy-app.js.map +1 -1
  218. package/lib/planner-dummy.html +1 -0
  219. package/lib/planner-f9aa0a27.js +2 -0
  220. package/lib/planner-f9aa0a27.js.map +1 -0
  221. package/lib/planner-main-b3dffe75.js +2 -0
  222. package/lib/planner-main-b3dffe75.js.map +1 -0
  223. package/lib/planner-main.nomodule.js +1 -1
  224. package/lib/roomle-configurator-0a88aea7.js +2 -0
  225. package/lib/roomle-configurator-0a88aea7.js.map +1 -0
  226. package/lib/roomle-configurator-3ab6dfeb.nomodule.js +2 -0
  227. package/lib/roomle-configurator-3ab6dfeb.nomodule.js.map +1 -0
  228. package/lib/roomle-dependency-injection-2fde2714.nomodule.js +16 -0
  229. package/lib/roomle-dependency-injection-2fde2714.nomodule.js.map +1 -0
  230. package/lib/roomle-dependency-injection-5533da82.js +16 -0
  231. package/lib/roomle-dependency-injection-5533da82.js.map +1 -0
  232. package/lib/roomle-sdk-c61e6974.js +2 -0
  233. package/lib/roomle-sdk-c61e6974.js.map +1 -0
  234. package/lib/roomle-sdk.nomodule.js +1 -1
  235. package/lib/scene-manager-3ee00913.js +2 -0
  236. package/lib/scene-manager-3ee00913.js.map +1 -0
  237. package/lib/scene-manager-b2128ea9.nomodule.js +2 -0
  238. package/lib/scene-manager-b2128ea9.nomodule.js.map +1 -0
  239. package/lib/script-loader-69c064c2.nomodule.js +2 -0
  240. package/lib/script-loader-69c064c2.nomodule.js.map +1 -0
  241. package/lib/script-loader-de8249e5.js +2 -0
  242. package/lib/script-loader-de8249e5.js.map +1 -0
  243. package/lib/static/Tween-d57ee5d181fce582.js.map +1 -0
  244. package/lib/static/default_1k-2aa6d42244d30fb1.exr +0 -0
  245. package/lib/static/default_256-f1c66a2764f88cc0.exr +0 -0
  246. package/lib/static/draco_decoder-b048235474cbf09e.wasm +0 -0
  247. package/lib/static/draco_decoder-dc7f397e2a2ebac4.js +34 -0
  248. package/lib/static/draco_wasm_wrapper-6263f3a4b71cdf3b.js +117 -0
  249. package/lib/static/legacy_env-d5810ec5057d4716.exr +0 -0
  250. package/lib/stats-helper-6a0d378d.nomodule.js +2 -0
  251. package/lib/stats-helper-6a0d378d.nomodule.js.map +1 -0
  252. package/lib/stats-helper-969d208f.js +2 -0
  253. package/lib/stats-helper-969d208f.js.map +1 -0
  254. package/lib/{tools-core-d85bfa17.js → tools-core-6284706e.js} +2 -2
  255. package/lib/tools-core-6284706e.js.map +1 -0
  256. package/lib/tools-core-94cba552.nomodule.js +2 -0
  257. package/lib/tools-core-94cba552.nomodule.js.map +1 -0
  258. package/package.json +6 -4
  259. package/lib/banana-for-scale-42f1dc5b.js +0 -2
  260. package/lib/banana-for-scale-f49704e0.nomodule.js +0 -2
  261. package/lib/component-dimensioning-057d1f9f.nomodule.js +0 -2
  262. package/lib/component-dimensioning-057d1f9f.nomodule.js.map +0 -1
  263. package/lib/component-dimensioning-9f8009b8.js +0 -2
  264. package/lib/component-dimensioning-9f8009b8.js.map +0 -1
  265. package/lib/component-raycast-helper-01d2984c.js +0 -2
  266. package/lib/component-raycast-helper-01d2984c.js.map +0 -1
  267. package/lib/component-raycast-helper-1db43efc.nomodule.js +0 -2
  268. package/lib/component-raycast-helper-1db43efc.nomodule.js.map +0 -1
  269. package/lib/configurator-4ecaafca.nomodule.js +0 -2
  270. package/lib/configurator-4ecaafca.nomodule.js.map +0 -1
  271. package/lib/configurator-a73acc5a.js +0 -2
  272. package/lib/configurator-a73acc5a.js.map +0 -1
  273. package/lib/configurator-main-14811ccb.js +0 -2
  274. package/lib/configurator-main-14811ccb.js.map +0 -1
  275. package/lib/continuous-drawing-helper-69c971e8.nomodule.js +0 -2
  276. package/lib/continuous-drawing-helper-69c971e8.nomodule.js.map +0 -1
  277. package/lib/continuous-drawing-helper-eb1b4a47.js +0 -2
  278. package/lib/continuous-drawing-helper-eb1b4a47.js.map +0 -1
  279. package/lib/default-light-setting-8eeeb3da.js +0 -2
  280. package/lib/default-light-setting-8eeeb3da.js.map +0 -1
  281. package/lib/default-light-setting-ef6a0979.nomodule.js +0 -2
  282. package/lib/default-light-setting-ef6a0979.nomodule.js.map +0 -1
  283. package/lib/definitions/common-core/__tests__/environment/baked-shadow-environment.d.ts +0 -1
  284. package/lib/definitions/common-core/__tests__/three-loader.d.ts +0 -1
  285. package/lib/definitions/common-core/__tests__/webgl/baked-shadow-plane.d.ts +0 -1
  286. package/lib/definitions/common-core/__tests__/webgl/pixotron-util.d.ts +0 -1
  287. package/lib/definitions/common-core/mock/mock-environment-loader.d.ts +0 -5
  288. package/lib/definitions/common-core/mock/mock-plane-shadow-bake-pass.d.ts +0 -8
  289. package/lib/definitions/common-core/mock/pixotron-mock.d.ts +0 -5
  290. package/lib/definitions/common-core/src/dynamic-quality-setting-loader.d.ts +0 -35
  291. package/lib/definitions/common-core/src/environment/baked-shadow-environment.d.ts +0 -45
  292. package/lib/definitions/common-core/src/services/environment-loader.d.ts +0 -27
  293. package/lib/definitions/common-core/src/three-loader.d.ts +0 -11
  294. package/lib/definitions/common-core/src/webgl/pixotron-util.d.ts +0 -39
  295. package/lib/definitions/configurator-core/__tests__/configurator-image-renderer.d.ts +0 -1
  296. package/lib/dimensioning-helper-db71ae43.js +0 -2
  297. package/lib/dimensioning-helper-e0cb55a5.nomodule.js +0 -2
  298. package/lib/glb-viewer-04fd6e23.nomodule.js +0 -2
  299. package/lib/glb-viewer-305d8bd7.js +0 -2
  300. package/lib/glb-viewer-main-64649f2c.js +0 -2
  301. package/lib/glb-viewer-main-64649f2c.js.map +0 -1
  302. package/lib/legacy/banana-for-scale-7bad9610.legacy.js +0 -2
  303. package/lib/legacy/component-dimensioning-cabc5380.legacy.js +0 -2
  304. package/lib/legacy/component-dimensioning-cabc5380.legacy.js.map +0 -1
  305. package/lib/legacy/component-raycast-helper-3169ff61.legacy.js +0 -2
  306. package/lib/legacy/component-raycast-helper-3169ff61.legacy.js.map +0 -1
  307. package/lib/legacy/configurator-a5c2c92c.legacy.js +0 -2
  308. package/lib/legacy/configurator-a5c2c92c.legacy.js.map +0 -1
  309. package/lib/legacy/continuous-drawing-helper-02495806.legacy.js +0 -2
  310. package/lib/legacy/continuous-drawing-helper-02495806.legacy.js.map +0 -1
  311. package/lib/legacy/default-light-setting-c6c84dbc.legacy.js +0 -2
  312. package/lib/legacy/default-light-setting-c6c84dbc.legacy.js.map +0 -1
  313. package/lib/legacy/dimensioning-helper-be8595e0.legacy.js +0 -2
  314. package/lib/legacy/glb-viewer-1aef71c0.legacy.js +0 -2
  315. package/lib/legacy/main-thread-to-worker-84353cef.legacy.js +0 -2
  316. package/lib/legacy/main-thread-to-worker-84353cef.legacy.js.map +0 -1
  317. package/lib/legacy/material-viewer-4bd2076c.legacy.js +0 -2
  318. package/lib/legacy/material-viewer-4bd2076c.legacy.js.map +0 -1
  319. package/lib/legacy/pixotron-b035ec35.legacy.js +0 -2
  320. package/lib/legacy/pixotron-b035ec35.legacy.js.map +0 -1
  321. package/lib/legacy/planner-1cd6147c.legacy.js +0 -2
  322. package/lib/legacy/planner-1cd6147c.legacy.js.map +0 -1
  323. package/lib/legacy/roomle-configurator-70bd6103.legacy.js +0 -2
  324. package/lib/legacy/roomle-configurator-70bd6103.legacy.js.map +0 -1
  325. package/lib/legacy/roomle-dependency-injection-acdca8a9.legacy.js +0 -16
  326. package/lib/legacy/roomle-dependency-injection-acdca8a9.legacy.js.map +0 -1
  327. package/lib/legacy/script-loader-53bf7b92.legacy.js +0 -2
  328. package/lib/legacy/script-loader-53bf7b92.legacy.js.map +0 -1
  329. package/lib/legacy/static/CopyShader-cde53240fcc3e06e.js +0 -46
  330. package/lib/legacy/static/DRACOLoader-5edeeab4a8dbc0bd.js +0 -678
  331. package/lib/legacy/static/DepthShadowGenerator-a3a9d85ff2c3d24c.js +0 -266
  332. package/lib/legacy/static/EffectComposer-1e936e5d03ff43cc.js +0 -298
  333. package/lib/legacy/static/GLTFExporter-86edae059df3a219.js +0 -2297
  334. package/lib/legacy/static/GLTFLoader-5b296b5fb14cfe1a.js +0 -3279
  335. package/lib/legacy/static/GammaCorrectionShader-b3b56f244f0d1e0e.js +0 -45
  336. package/lib/legacy/static/HDRCubeTextureLoader-8f7805ba456eca09.js +0 -131
  337. package/lib/legacy/static/LuminosityHighPassShader-dd5826656142421d.js +0 -64
  338. package/lib/legacy/static/OutlinePass-f4bcd337cdd89b8d.js +0 -592
  339. package/lib/legacy/static/RGBELoader-5b196b2428d96312.js +0 -526
  340. package/lib/legacy/static/RectAreaLightUniformsLib-4b74882185efd473.js +0 -47
  341. package/lib/legacy/static/RenderPass-bc5df3810a01b2c6.js +0 -79
  342. package/lib/legacy/static/ShaderPass-31f36160e0ea282d.js +0 -66
  343. package/lib/legacy/static/Sky-6621935ea8a523af.js +0 -224
  344. package/lib/legacy/static/Tween-5ebfb82307807fdc.js +0 -767
  345. package/lib/legacy/static/dat.gui.min-24a0d861d5534d62.js +0 -2447
  346. package/lib/legacy/static/draco_decoder-3866672a1fa2f980.js +0 -31
  347. package/lib/legacy/static/draco_decoder-979e668167e37c95.wasm +0 -0
  348. package/lib/legacy/static/draco_wasm_wrapper-d775f9f135cb30ff.js +0 -129
  349. package/lib/legacy/static/pi.min-0272f873b3a4380a.js +0 -1
  350. package/lib/legacy/static/rthree-750136f8399d9f72.js +0 -2
  351. package/lib/legacy/static/shaders-940522a5e460efd1.json +0 -1
  352. package/lib/legacy/static/stats.min-f33a6e08a8864d76.js +0 -5
  353. package/lib/legacy/stats-helper-c0b5d8b6.legacy.js +0 -2
  354. package/lib/legacy/stats-helper-c0b5d8b6.legacy.js.map +0 -1
  355. package/lib/legacy/tools-core-227c6513.legacy.js +0 -2
  356. package/lib/legacy/tools-core-227c6513.legacy.js.map +0 -1
  357. package/lib/main-thread-to-worker-1651b1df.js +0 -2
  358. package/lib/main-thread-to-worker-1651b1df.js.map +0 -1
  359. package/lib/main-thread-to-worker-b7956e5b.nomodule.js +0 -2
  360. package/lib/main-thread-to-worker-b7956e5b.nomodule.js.map +0 -1
  361. package/lib/material-viewer-3fd75160.nomodule.js +0 -2
  362. package/lib/material-viewer-3fd75160.nomodule.js.map +0 -1
  363. package/lib/material-viewer-5324de36.js +0 -2
  364. package/lib/material-viewer-5324de36.js.map +0 -1
  365. package/lib/material-viewer-main-a45f2d04.js +0 -2
  366. package/lib/material-viewer-main-a45f2d04.js.map +0 -1
  367. package/lib/pixotron-cd9b0143.nomodule.js +0 -2
  368. package/lib/pixotron-cd9b0143.nomodule.js.map +0 -1
  369. package/lib/pixotron-e481d9b2.js +0 -2
  370. package/lib/pixotron-e481d9b2.js.map +0 -1
  371. package/lib/planner-377d1061.nomodule.js +0 -2
  372. package/lib/planner-377d1061.nomodule.js.map +0 -1
  373. package/lib/planner-b018f99c.js +0 -2
  374. package/lib/planner-b018f99c.js.map +0 -1
  375. package/lib/planner-main-ec5a6efa.js +0 -2
  376. package/lib/planner-main-ec5a6efa.js.map +0 -1
  377. package/lib/roomle-configurator-0d5ba529.nomodule.js +0 -2
  378. package/lib/roomle-configurator-0d5ba529.nomodule.js.map +0 -1
  379. package/lib/roomle-configurator-98c3c172.js +0 -2
  380. package/lib/roomle-configurator-98c3c172.js.map +0 -1
  381. package/lib/roomle-dependency-injection-7dcab742.nomodule.js +0 -16
  382. package/lib/roomle-dependency-injection-7dcab742.nomodule.js.map +0 -1
  383. package/lib/roomle-dependency-injection-f7298e7e.js +0 -16
  384. package/lib/roomle-dependency-injection-f7298e7e.js.map +0 -1
  385. package/lib/roomle-sdk-f9cc3d20.js +0 -2
  386. package/lib/roomle-sdk-f9cc3d20.js.map +0 -1
  387. package/lib/script-loader-17506a98.nomodule.js +0 -2
  388. package/lib/script-loader-17506a98.nomodule.js.map +0 -1
  389. package/lib/script-loader-c9cba6e8.js +0 -2
  390. package/lib/script-loader-c9cba6e8.js.map +0 -1
  391. package/lib/static/CopyShader-cde53240fcc3e06e.js +0 -1
  392. package/lib/static/CopyShader-cde53240fcc3e06e.js.map +0 -1
  393. package/lib/static/DRACOLoader-5edeeab4a8dbc0bd.js +0 -1
  394. package/lib/static/DRACOLoader-5edeeab4a8dbc0bd.js.map +0 -1
  395. package/lib/static/DepthShadowGenerator-a3a9d85ff2c3d24c.js +0 -1
  396. package/lib/static/DepthShadowGenerator-a3a9d85ff2c3d24c.js.map +0 -1
  397. package/lib/static/EffectComposer-1e936e5d03ff43cc.js +0 -1
  398. package/lib/static/EffectComposer-1e936e5d03ff43cc.js.map +0 -1
  399. package/lib/static/GLTFExporter-86edae059df3a219.js +0 -1
  400. package/lib/static/GLTFExporter-86edae059df3a219.js.map +0 -1
  401. package/lib/static/GLTFLoader-5b296b5fb14cfe1a.js +0 -1
  402. package/lib/static/GLTFLoader-5b296b5fb14cfe1a.js.map +0 -1
  403. package/lib/static/GammaCorrectionShader-b3b56f244f0d1e0e.js +0 -1
  404. package/lib/static/GammaCorrectionShader-b3b56f244f0d1e0e.js.map +0 -1
  405. package/lib/static/HDRCubeTextureLoader-8f7805ba456eca09.js +0 -1
  406. package/lib/static/HDRCubeTextureLoader-8f7805ba456eca09.js.map +0 -1
  407. package/lib/static/LuminosityHighPassShader-dd5826656142421d.js +0 -1
  408. package/lib/static/LuminosityHighPassShader-dd5826656142421d.js.map +0 -1
  409. package/lib/static/OutlinePass-f4bcd337cdd89b8d.js +0 -1
  410. package/lib/static/OutlinePass-f4bcd337cdd89b8d.js.map +0 -1
  411. package/lib/static/RGBELoader-5b196b2428d96312.js +0 -1
  412. package/lib/static/RGBELoader-5b196b2428d96312.js.map +0 -1
  413. package/lib/static/RectAreaLightUniformsLib-4b74882185efd473.js +0 -1
  414. package/lib/static/RectAreaLightUniformsLib-4b74882185efd473.js.map +0 -1
  415. package/lib/static/RenderPass-bc5df3810a01b2c6.js +0 -1
  416. package/lib/static/RenderPass-bc5df3810a01b2c6.js.map +0 -1
  417. package/lib/static/ShaderPass-31f36160e0ea282d.js +0 -1
  418. package/lib/static/ShaderPass-31f36160e0ea282d.js.map +0 -1
  419. package/lib/static/Sky-6621935ea8a523af.js +0 -1
  420. package/lib/static/Sky-6621935ea8a523af.js.map +0 -1
  421. package/lib/static/Tween-5ebfb82307807fdc.js.map +0 -1
  422. package/lib/static/dat.gui.min-24a0d861d5534d62.js +0 -1
  423. package/lib/static/dat.gui.min-24a0d861d5534d62.js.map +0 -1
  424. package/lib/static/draco_decoder-3866672a1fa2f980.js +0 -31
  425. package/lib/static/draco_decoder-979e668167e37c95.wasm +0 -0
  426. package/lib/static/draco_wasm_wrapper-d775f9f135cb30ff.js +0 -129
  427. package/lib/static/pi.min-0272f873b3a4380a.js +0 -1
  428. package/lib/static/pi.min-0272f873b3a4380a.js.map +0 -1
  429. package/lib/static/rthree-750136f8399d9f72.js +0 -1
  430. package/lib/static/rthree-750136f8399d9f72.js.map +0 -1
  431. package/lib/static/shaders-940522a5e460efd1.json +0 -1
  432. package/lib/static/stats.min-f33a6e08a8864d76.js +0 -1
  433. package/lib/static/stats.min-f33a6e08a8864d76.js.map +0 -1
  434. package/lib/stats-helper-9c26a9c0.nomodule.js.map +0 -1
  435. package/lib/stats-helper-bccf87d4.js +0 -2
  436. package/lib/stats-helper-bccf87d4.js.map +0 -1
  437. package/lib/tools-core-15d100e4.nomodule.js +0 -2
  438. package/lib/tools-core-15d100e4.nomodule.js.map +0 -1
  439. package/lib/tools-core-d85bfa17.js.map +0 -1
  440. /package/lib/definitions/{common-core/__tests__/dynamic-quality-setting-loader.d.ts → test-helpers/unit/global-setup.d.ts} +0 -0
  441. /package/lib/definitions/{common-core/__tests__/environment-loader.d.ts → test-helpers/unit/modules-setup.d.ts} +0 -0
  442. /package/lib/static/{Tween-5ebfb82307807fdc.js → Tween-d57ee5d181fce582.js} +0 -0
@@ -0,0 +1,2 @@
1
+ import{b as RoomleDependencyInjection,D as DependencyInjectionAssignment,R as RapiAccess,ar as GlobalCallback,as as GlobalInitData,at as InitData}from"./roomle-dependency-injection-5533da82.js";import"./main-thread-to-worker-29498ad3.js";class RoomleSdk{static getConfigurator(e,n){return n=this._setupDI("configurator",e,n),new Promise((e,t)=>import("./configurator-89ce03c4.js").then(({Configurator:t})=>e(new t(n)),t))}static getPlanner(e,n){return n=this._setupDI("planner",e,n),new Promise((e,t)=>import("./planner-f9aa0a27.js").then(({Planner:t})=>e(new t(n)),t))}static async getGlbViewer(e,n){return n=this._setupDI("glb-viewer",e,n),new Promise((e,t)=>import("./glb-viewer-4f0558f5.js").then(({GlbViewer:t})=>e(new t(n)),t))}static getMaterialViewer(e,n){return n=this._setupDI("configurator",e,n),new Promise((e,t)=>import("./material-viewer-eedffa51.js").then(({MaterialViewer:t})=>e(new t(n)),t))}static getCoreTools(e,n){return n=this._setupDI("tools-core",e,n),new Promise((e,t)=>import("./tools-core-6284706e.js").then(({ToolsCore:t})=>{const o=new t(n);o.boot(),e(o)},t))}static getRapiAccess(){return RoomleDependencyInjection.addToContainer([new DependencyInjectionAssignment("rapi-access",RapiAccess,0),new DependencyInjectionAssignment("global-callback",GlobalCallback,0)]),Promise.resolve(RoomleDependencyInjection.lookup("rapi-access"))}static get callbacks(){return RoomleDependencyInjection.addToContainer([new DependencyInjectionAssignment("global-callback",GlobalCallback,0)]),Promise.resolve(RoomleDependencyInjection.lookup("global-callback"))}static setGlobalInitData(e){e&&(RoomleDependencyInjection.addToContainer([new DependencyInjectionAssignment("global-init-data",GlobalInitData,0)]),RoomleDependencyInjection.lookup("global-init-data").setOverrides(e))}static getContext(e){return RoomleDependencyInjection.getContext(e)}static _setupDI(e,n,t){return n&&(RoomleDependencyInjection.addToContainer([new DependencyInjectionAssignment("init-data",InitData,1)]),t||(t=RoomleDependencyInjection.getContext(e)),RoomleDependencyInjection.lookup("init-data",t).setOverrides(n)),t}}export{RoomleSdk as default};
2
+ //# sourceMappingURL=roomle-sdk-c61e6974.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"roomle-sdk-c61e6974.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,2 +1,2 @@
1
- System.register(["./roomle-dependency-injection-7dcab742.nomodule.js","./main-thread-to-worker-b7956e5b.nomodule.js"],(function(e,t){var o,n,r,a,i,s;return{setters:[function(e){o=e.b,n=e.D,r=e.R,a=e.ap,i=e.aq,s=e.ar},function(){}],execute:function(){e("default",class{static getConfigurator(e,o){return o=this._setupDI("configurator",e,o),new Promise((e,n)=>t.import("./configurator-4ecaafca.nomodule.js").then(({Configurator:t})=>e(new t(o)),n))}static getPlanner(e,o){return o=this._setupDI("planner",e,o),new Promise((e,n)=>t.import("./planner-377d1061.nomodule.js").then(({Planner:t})=>e(new t(o)),n))}static async getGlbViewer(e,o){return o=this._setupDI("glb-viewer",e,o),new Promise((e,n)=>t.import("./glb-viewer-04fd6e23.nomodule.js").then(({GlbViewer:t})=>e(new t(o)),n))}static getMaterialViewer(e,o){return o=this._setupDI("configurator",e,o),new Promise((e,n)=>t.import("./material-viewer-3fd75160.nomodule.js").then(({MaterialViewer:t})=>e(new t(o)),n))}static getCoreTools(e,o){return o=this._setupDI("tools-core",e,o),new Promise((e,n)=>t.import("./tools-core-15d100e4.nomodule.js").then(({ToolsCore:t})=>{const n=new t(o);n.boot(),e(n)},n))}static getRapiAccess(){return o.addToContainer([new n("rapi-access",r,0),new n("global-callback",a,0)]),Promise.resolve(o.lookup("rapi-access"))}static get callbacks(){return o.addToContainer([new n("global-callback",a,0)]),Promise.resolve(o.lookup("global-callback"))}static setGlobalInitData(e){e&&(o.addToContainer([new n("global-init-data",i,0)]),o.lookup("global-init-data").setOverrides(e))}static getContext(e){return o.getContext(e)}static _setupDI(e,t,r){return t&&(o.addToContainer([new n("init-data",s,1)]),r||(r=o.getContext(e)),o.lookup("init-data",r).setOverrides(t)),r}})}}}));
1
+ System.register(["./roomle-dependency-injection-2fde2714.nomodule.js","./main-thread-to-worker-a2554a6a.nomodule.js"],(function(e,t){var o,n,r,a,i,s;return{setters:[function(e){o=e.b,n=e.D,r=e.R,a=e.ar,i=e.as,s=e.at},function(){}],execute:function(){e("default",class{static getConfigurator(e,o){return o=this._setupDI("configurator",e,o),new Promise((e,n)=>t.import("./configurator-55acafcc.nomodule.js").then(({Configurator:t})=>e(new t(o)),n))}static getPlanner(e,o){return o=this._setupDI("planner",e,o),new Promise((e,n)=>t.import("./planner-60e8f69a.nomodule.js").then(({Planner:t})=>e(new t(o)),n))}static async getGlbViewer(e,o){return o=this._setupDI("glb-viewer",e,o),new Promise((e,n)=>t.import("./glb-viewer-220acd23.nomodule.js").then(({GlbViewer:t})=>e(new t(o)),n))}static getMaterialViewer(e,o){return o=this._setupDI("configurator",e,o),new Promise((e,n)=>t.import("./material-viewer-015815c1.nomodule.js").then(({MaterialViewer:t})=>e(new t(o)),n))}static getCoreTools(e,o){return o=this._setupDI("tools-core",e,o),new Promise((e,n)=>t.import("./tools-core-94cba552.nomodule.js").then(({ToolsCore:t})=>{const n=new t(o);n.boot(),e(n)},n))}static getRapiAccess(){return o.addToContainer([new n("rapi-access",r,0),new n("global-callback",a,0)]),Promise.resolve(o.lookup("rapi-access"))}static get callbacks(){return o.addToContainer([new n("global-callback",a,0)]),Promise.resolve(o.lookup("global-callback"))}static setGlobalInitData(e){e&&(o.addToContainer([new n("global-init-data",i,0)]),o.lookup("global-init-data").setOverrides(e))}static getContext(e){return o.getContext(e)}static _setupDI(e,t,r){return t&&(o.addToContainer([new n("init-data",s,1)]),r||(r=o.getContext(e)),o.lookup("init-data",r).setOverrides(t)),r}})}}}));
2
2
  //# sourceMappingURL=roomle-sdk.nomodule.js.map
@@ -0,0 +1,2 @@
1
+ import{_ as __decorate,i as inject,E as EventDispatcher,t as toRadiant,Q as position3VectorsAreEqual,T as position2VectorsAreEqual,U as compareBox3Size,w as getIdealDistance,y as toDegrees,V as MaterialCreator,X as createMaterial,Y as addTexture,Z as getGUI,$ as rotationQuaternionsAreEqual,a0 as getDelta,a1 as MIN_MOVE_DISTANCE,a2 as sanitizedCameraMode,e as CAMERA_TYPE,a3 as RoomleWebGLRenderer,a4 as ENV_HDR_256_FILE_NAME,s as dispose,p as DynamicLightSettingLoader,x as RoomleComponentFactoryInitializer,a5 as changeEnvironmentMapIntensity}from"./roomle-dependency-injection-5533da82.js";import{a as Vector3,bz as debounce,J as PerspectiveCamera,V as Vector2,bA as areCameraParametersEqual,ab as Sphere,aa as Box3,ae as Euler,Q as Quaternion,ak as deepMerge,O as Object3D,x as Mesh,bB as Shape,bC as Path,bD as ShapeGeometry,k as TextureLoader,bE as Fog,C as Color,p as RepeatWrapping,u as DoubleSide,N as OrthographicCamera,K as MathUtils,aA as handleJsonResponse,S as SpotLight,A as AmbientLight,D as DirectionalLight,R as RectAreaLight,bF as IcosahedronGeometry,aT as ShaderMaterial,f as MeshBasicMaterial,bn as Clock,bg as Scene,bv as WebGLRenderer,h as SRGBColorSpace,bb as PCFSoftShadowMap,bG as download}from"./main-thread-to-worker-29498ad3.js";var TWEEN_FILE_NAME="static/Tween-d57ee5d181fce582.js";class CameraControl extends EventDispatcher{constructor(t,e,i){if(super(),this._tweenEnd=null,this._cameraStandingStill=!0,this._pitch=toRadiant(10),this._yaw=toRadiant(-30),this._distance=-1,this._locked=!1,this._inputListeners=[],this._lerpEnabled=!0,this._creator_=t,this._inputManager=e,this._initInputListener(),this._addInputListeners(),this._cameraPosition=new Vector3,this._targetPosition=new Vector3,i?this._cameraPosition.copy(i):this._cameraPosition=new Vector3(0,.5,3),this._initData.debug){const t=this.getDebugCameraPosition();t&&this._setCurrentCameraParameters(t)}let s=this._domHelper.getClientDimensions();this._width=s.x,this._height=s.y,this._dispatchCameraIdle=debounce(this._dispatchCameraIdle.bind(this),32)}getCamera(){return this._getCamera()}_addInputListeners(){this._inputListeners.forEach(t=>{this._inputManager.addEventListener(t.key,t.fun,this)})}_removeInputListeners(){this._inputListeners.forEach(t=>{this._inputManager.removeEventListener(t.key,t.fun)}),this._inputListeners=[]}cleanUp(){this._removeInputListeners()}animateCamera(t){let e=this._cameraPosition;if(!e||position3VectorsAreEqual(e,this.getCamera().position))return this._cameraStandingStill||(this._cameraStandingStill=!0,setTimeout(()=>this._dispatchCameraIdle(),16),this._initData.debug&&this.saveDebugCameraPosition()),!1;if(this._cameraStandingStill&&this.dispatchEvent(7,3),this._cameraStandingStill=!1,this._lerpEnabled&&!this._tweenEnd){let i=this.getCamera().position.clone();const s=Math.min(10*t,1);i.lerp(e,s),this.getCamera().position.copy(i)}else this.getCamera().position.copy(e);return!0}getDebugCameraPosition(){return JSON.parse(localStorage.getItem("debug_camera_position"))}saveDebugCameraPosition(){localStorage.setItem("debug_camera_position",JSON.stringify(this.getCurrentCameraParameters()))}_dispatchCameraIdle(){this.dispatchEvent(8,3)}_tweenCameraParameter(t,e,i=!1){return new Promise(s=>{if(e.yaw-t.yaw<=-Math.PI?t.yaw-=2*Math.PI:e.yaw-t.yaw>=Math.PI&&(t.yaw+=2*Math.PI),window.TWEEN){if(null!==this._tweenEnd&&this._tweenEnd.blockOtherTweens)return;this._tweenEnd=e,new TWEEN.Tween(t).to(e,400).easing(TWEEN.Easing.Sinusoidal.In).onUpdate(()=>{this.dispatchEvent(1,3),this._yaw=t.yaw,this._pitch=t.pitch,this._distance=t.distance,this._setCameraNear(),this._update(new Vector3(t.targetX,t.targetY,t.targetZ),i)}).onComplete(()=>{this.dispatchEvent(2,3),this._dispatchCameraIdle(),this._tweenEnd=null,s()}).start(),this.dispatchEvent(0,3)}})}_setCameraNear(){const t=this.getCamera();if(t instanceof PerspectiveCamera){const e=Math.max(.1,this._distance/6);t.near=e}}getCurrentCameraParameters(){const t=this._targetPosition.clone();return{yaw:this._yaw,pitch:this._pitch,distance:this._distance,targetX:t.x,targetY:t.y,targetZ:t.z}}_setCurrentCameraParameters(t){this._yaw=t.yaw,this._pitch=t.pitch,this._distance=t.distance,this._targetPosition.copy(new Vector3(t.targetX,t.targetY,t.targetZ))}_rotateHorizontal(t){this._yaw-=t,this._yaw<-Math.PI?this._yaw+=2*Math.PI:this._yaw>Math.PI&&(this._yaw-=2*Math.PI)}_rotateVertical(t){this._pitch+=t,this._pitch<-Math.PI?this._pitch+=2*Math.PI:this._pitch>Math.PI&&(this._pitch-=2*Math.PI)}saveState(t){if(t||!this._stateSaved){let t=this._yaw,e=this._pitch,i=this._distance,s=this._targetPosition.clone();if(this._stateSaved={yaw:t,pitch:e,distance:i,targetX:s.x,targetY:s.y,targetZ:s.z,blockOtherTweens:!0},this._getCamera().fov){let t=this._getCamera();this._stateSaved.fov=t.fov,this._stateSaved.near=t.near,this._stateSaved.far=t.far}return this._stateSaved}return null}resetToState(){if(this._stateSaved){this._stateSaved.blockOtherTweens=!1;let t=this._targetPosition.clone();this._tweenCameraParameter({yaw:this._yaw,pitch:this._pitch,distance:this._distance,targetX:t.x,targetY:t.y,targetZ:t.z},this._stateSaved,!0)}this._stateSaved=null}setToState(t,e){this._tweenCameraParameter(t,e,!0)}hasSavedState(){return null!=this._stateSaved}lock(){this._locked=!0}unlock(){this._locked=!1}isLocked(){return this._locked}getTargetPosition(){return this._targetPosition}_saveYawAndPitch(){this._getCamera().userData.yaw=this._yaw,this._getCamera().userData.pitch=this._pitch}getInputPosition(t){const{x:e,y:i}=this._domHelper.getClientDimensions();return new Vector3(t.x/e*2-1,-t.y/i*2+1,.5)}addLightContainer(t){t.name="lights";const e=this._getCamera(),i=e.children.find(t=>"lights"===t.name);i&&e.remove(i),e.add(t)}checkNearFarDistance(t){if(!t)return;const e=this._cameraPosition.distanceTo(t),i=this._getCamera();i instanceof PerspectiveCamera&&e>i.far&&(i.far=e+1)}setBounds(t){this._boundingBox=t}}__decorate([inject],CameraControl.prototype,"_domHelper",void 0),__decorate([inject],CameraControl.prototype,"_initData",void 0);class ZoomChangeEvent{constructor(t,e){this.minZoom=!1,this.maxZoom=!1,this.minZoom=t,this.maxZoom=e}}const DISTANCE_FACTOR=2.725;class CameraControl3D extends CameraControl{constructor(t,e,i,s){super(t,e,i),this._bounds=new Vector3,this._scale=1,this._state=0,this._zoomSpeed=Math.pow(.95,3),this.minDistance=0,this.maxDistance=5,this.minPolarAngle=toRadiant(0),this.maxPolarAngle=toRadiant(85),this._objectRotation=0,this.minAzimuthAngle=Number.NEGATIVE_INFINITY,this.maxAzimuthAngle=Number.POSITIVE_INFINITY,this._zoomDistance=.1,this._userInteraction=!1,this._currentZoomHash="",this._maxZoomedIn=!1,this._maxZoomedOut=!1,this._panningEnabled=!1,this._targetPositionIsPanned=!1,s?this._camera=s:this._initCamera(),this._targetPosition||(this._targetPosition=new Vector3(0,0,0),this._targetPositionIsPanned=!1);const{cameraRestriction:a,zoomDistance:n,minVerticalCameraAngle:o,maxVerticalCameraAngle:r,minHorizontalCameraAngle:h,maxHorizontalCameraAngle:c}=this._initData;if(n&&(this._zoomDistance=n/100),void 0!==o&&(this.minPolarAngle=toRadiant(o<0?o:-1*o)),void 0!==r&&(this.maxPolarAngle=toRadiant(r)),void 0!==h&&(this.minAzimuthAngle=toRadiant(h<0?h:-1*h)),void 0!==c&&(this.maxAzimuthAngle=toRadiant(c)),void 0!==a){let t=Math.abs(toRadiant(a));this.minAzimuthAngle=-t,this.maxAzimuthAngle=t,this.maxPolarAngle=Math.min(t,toRadiant(85))}this._update()}_getCamera(){return this._camera||this._initCamera(),this._camera}getCamera(){return super.getCamera()}_initCamera(){this._camera=new PerspectiveCamera,this._camera.fov=30,this._camera.aspect=this._width/this._height,this._camera.near=.1,this._camera.far=100,this._camera.updateProjectionMatrix(),this._camera.layers.set(3),this._camera.layers.enable(1),this._camera.layers.enable(2),this._camera.layers.enable(6),this._camera.layers.enable(5)}setObjectRotation(t){this._objectRotation=t}getObjectRotation(){return this._objectRotation}updateCamera(){let{x:t,y:e}=this._domHelper.getClientDimensions();this._camera.aspect=t/e,this._camera.updateProjectionMatrix()}animateCamera(t){if(!super.animateCamera(t))return!1;let e=this._targetPosition;return!!e&&(this.getCamera().lookAt(e),!0)}_initInputListener(){this._inputListeners.push({key:3,fun:()=>{this._state=1}}),this._inputListeners.push({key:6,fun:t=>{var e,i;1!==this._state||this._locked||(this._userInteraction=!0,!(void 0!==(null===(e=t.event)||void 0===e?void 0:e.shiftKey)&&(null===(i=t.event)||void 0===i?void 0:i.shiftKey))&&this._panningEnabled&&this.disablePanning(),this._move(new Vector2(t.position.x,t.position.y),t.type))}}),this._inputListeners.push({key:11,fun:t=>{1===this._state||this._locked||(this._userInteraction=!0,this._pan(new Vector2(t.position.x,t.position.y),t.type))}}),this._inputListeners.push({key:4,fun:t=>{1===this._state&&this.dispatchEvent(2,t.type),this._state=0,this._orbitPosition=null,this._lerpEnabled=!0}}),this._inputListeners.push({key:7,fun:({event:t})=>{this._maxZoomedIn||(t&&(t.preventDefault(),t.stopPropagation()),this.zoomIn())}}),this._inputListeners.push({key:8,fun:({event:t})=>{this._maxZoomedOut||(t&&(t.preventDefault(),t.stopPropagation()),this.zoomOut())}})}_panTargetPosition(t){const e=t.clone().sub(this._orbitPosition),i=this._domHelper.element,s=this._targetPosition.project(this._camera),a=Math.max(2,4*(1-this._distance/this.maxDistance));s.x=s.x-e.x/i.clientHeight*a,s.y=s.y+e.y/i.clientHeight*a,this._targetPositionIsPanned=!0,this._targetPosition.copy(s.unproject(this._camera))}_pan(t,e){this._lerpEnabled=!1,this._orbitPosition||(this._orbitPosition=new Vector2(t.x,t.y),this.dispatchEvent(0,e)),this._panTargetPosition(t),position2VectorsAreEqual(this._orbitPosition,t)||this.dispatchEvent(1,e),this._orbitPosition.copy(t),this._update()}_move(t,e){this._orbitPosition||(this._orbitPosition=new Vector2(t.x,t.y),this.dispatchEvent(0,e));const i=t.clone().sub(this._orbitPosition),s=this._domHelper.element;this._panningEnabled?this._panTargetPosition(t):(this._rotateHorizontal(2*Math.PI*i.x/s.clientWidth*1),this._rotateVertical(2*Math.PI*i.y/s.clientHeight*1)),position2VectorsAreEqual(this._orbitPosition,t)||this.dispatchEvent(1,e),this._orbitPosition.copy(t),this._update()}checkBoundsAndPlaceCamera(t,e=!0){this._boundingBox&&compareBox3Size(t,this._boundingBox)<=0?this.setBounds(t):this.zoomToFitBounds(t,e)}zoomToFitBounds(t,e=!0){this.setBounds(t);const i=t.getSize(new Vector3);if(this._initData.debug||i.x+i.y+i.z===0)return;const s=this.getCurrentCameraParameters(),a=t.getCenter(new Vector3),n=this._setDistanceAndRangesBasedOnBounds(i);this._checkZoomDistance(t,n);const o={yaw:e?this._yaw:s.yaw,pitch:e?this._pitch:s.pitch,distance:n,targetX:a.x,targetY:a.y,targetZ:a.z};areCameraParametersEqual(s,o)||this._tweenCameraParameter(s,o,!1)}updateToBounds(t,e,i=!0,s){if(this.setBounds(t),this._initData.debug)return;const a=t.getCenter(new Vector3);s?(this._targetPosition=s.clone(),this._targetPositionIsPanned=!1):this._targetPositionIsPanned||(this._targetPosition=new Vector3(a.x,a.y,a.z));const n=this.getCurrentCameraParameters(),o=t.getSize(new Vector3);if(i){const i=this._setDistanceAndRangesBasedOnBounds(o);this._distance=i,this._checkZoomDistance(t,i),this._userInteraction?this._tweenCameraParameter(n,{yaw:this._yaw,pitch:this._pitch,distance:this._distance,targetX:this._targetPosition.x,targetY:this._targetPosition.y,targetZ:this._targetPosition.z},e):this._update()}else this._setDistanceAndRangesBasedOnBounds(o,!1);this._update()}_checkZoomDistance(t,e){const i=t.getBoundingSphere(new Sphere);e-i.radius<this._zoomDistance&&(console.warn("the initial camera position is closer than the zoomDistance param, zoomDistance is set to initial camera position."),this._zoomDistance=e-i.radius)}_setDistanceAndRangesBasedOnBounds(t,e=!0){const{offsetWidth:i,offsetHeight:s}=this._getOffset();this._bounds.copy(t);const{cameraSpacing:a}=this._initData;t.addScalar(a/100),this.minDistance=Math.sqrt(t.x*t.x+t.y*t.y+t.z*t.z);const n=Math.max(t.x,t.y),{x:o,y:r}=this._getMargin(i,s),h=getIdealDistance(t.x+o,t.y+r,t.z,this._camera.fov,i,s);return this._distance<h&&e&&(this._distance=h),this.maxDistance=h+n,this.maxDistance<2&&(this.maxDistance=2),this._camera.far=5*this.maxDistance,this._setCameraNear(),h}_getIdealDistance(){const{offsetWidth:t,offsetHeight:e}=this._getOffset(),{x:i,y:s}=this._getMargin(t,e);return getIdealDistance(this._bounds.x+i,this._bounds.y+s,this._bounds.z,this._camera.fov,t,e)}_getOffset(){const t=this._domHelper.getClientDimensions(),e=t.x,i=t.y;return{offsetWidth:this._camera.offset?e-e*this._camera.offset.left-e*(1-this._camera.offset.right):e,offsetHeight:this._camera.offset?i-i*this._camera.offset.bottom-i*(1-this._camera.offset.top):i}}_getMargin(t,e){let i=this._bounds.x/2,s=this._bounds.y/2;return t>1080&&(i+=this._bounds.x<.3?.2:0,i+=this._bounds.x*(t/1080-1)),e>1080&&(i+=this._bounds.y<.3?.2:0,s+=this._bounds.y*(e/1080-1)),{x:i,y:s}}reset(t,e,i,s,a=!0){const n=t.getSize(new Vector3);if(n){if(e)this._targetPosition.copy(e);else{const e=t.getCenter(new Vector3);this._targetPosition.copy(e)}const o=this.getCurrentCameraParameters();if(i||(i=-30),s||(s=10),i+=toDegrees(this._objectRotation),this._initData.debug)return this._distance=this._setDistanceAndRangesBasedOnBounds(n),this._update(this._targetPosition),void this._setDistanceAndRangesBasedOnBounds(n);const r=this._setDistanceAndRangesBasedOnBounds(n),h=toRadiant(s),c=toRadiant(i);let d=this._targetPosition.clone();a?this._tweenCameraParameter(o,{yaw:c,pitch:h,distance:r,targetX:d.x,targetY:d.y,targetZ:d.z},!0):(this._pitch=h,this._yaw=c,this._distance=r,this._update(this._targetPosition))}else console.warn("you cant reset without bounds!")}updateAndReset(t,e,i,s,a,n=!0){const o=new Vector3(-t.x/2,0,-t.z/2),r=new Vector3(t.x/2,t.y,t.z/2);if(this._boundingBox=new Box3(o,r),a&&t.addScalar(a),e?this._targetPosition.copy(e):(this._targetPosition=new Vector3(0,t.y/2,0),this._targetPositionIsPanned=!1),-1===this._distance){const e=this._setDistanceAndRangesBasedOnBounds(t);this._distance=Math.max(2,e)}const h=this.getCurrentCameraParameters();i||(i=-30),s||(s=10),i+=toDegrees(this._objectRotation),this._pitch=toRadiant(s),this._yaw=toRadiant(i),this._setDistanceAndRangesBasedOnBounds(t);let c=this._targetPosition.clone();n?this._tweenCameraParameter(h,{yaw:this._yaw,pitch:this._pitch,distance:this.maxDistance,targetX:c.x,targetY:c.y,targetZ:c.z},!0):this._update(this._targetPosition)}_update(t,e){this._initData.debug?this._pitch=Math.max(toRadiant(-89),Math.min(toRadiant(89),this._pitch)):(this._yaw=Math.max(this.minAzimuthAngle,Math.min(this.maxAzimuthAngle,this._yaw)),this._pitch=Math.max(this.minPolarAngle,Math.min(this.maxPolarAngle,this._pitch))),this._saveYawAndPitch();const i=new Euler(-this._pitch,this._yaw,0,"ZYX"),s=(new Quaternion).setFromEuler(i),a=new Vector3(0,0,-1);a.applyQuaternion(s),this._distance*=this._scale,this._initData.debug||(this._distance=Math.min(this.maxDistance,this._distance)),t&&this._targetPosition.copy(t);const n=this._targetPosition.clone().sub(a.multiplyScalar(this._distance));if(this._initData.debug)this._cameraPosition.copy(n),this._zoomChanged(!1,!1);else if(e)this._cameraPosition.copy(n);else{const t=this._getCameraSphere(n);null!=this._boundingBox&&this._boundingBox.intersectsSphere(t)&&this._scale>=1?this._distance+=.1:null==this._boundingBox||this._boundingBox.intersectsSphere(t)?this._zoomChanged(!1,!0):(this._cameraPosition.copy(n),this._distance===this.maxDistance?this._zoomChanged(!0,!1):this._zoomChanged(!1,!1))}this._scale=1}_zoomChanged(t,e){let i=t+""+e;0===this._currentZoomHash.length||this._currentZoomHash!==i?(this.dispatchEvent(5,new ZoomChangeEvent(t,e)),this._currentZoomHash=i):t||e||this.dispatchEvent(5,new ZoomChangeEvent(t,e)),this._maxZoomedIn=e,this._maxZoomedOut=t}zoomTo(t){return this._tweenCameraParameter(this.getCurrentCameraParameters(),t,!0)}_getCameraSphere(t){const e=Math.max(this._bounds.x,this._bounds.y),i=Math.max(e/10,this._zoomDistance);return new Sphere(t,i)}zoomIn(t){this._lerpEnabled=!0,this._scale*=t?Math.pow(.95,t):this._zoomSpeed,this._setCameraNear(),this._update(),this.dispatchEvent(3)}zoomOut(t){this._lerpEnabled=!0,this._scale/=t?Math.pow(.95,t):this._zoomSpeed,this._setCameraNear(),this._update(),this.dispatchEvent(4)}clear(){this._userInteraction=!1,this._initData.debug||(this._distance=-1,this._targetPosition=new Vector3(0,0,0),this._targetPositionIsPanned=!1)}async moveCamera(t){const{x:e,y:i,z:s}=this._boundingBox.getCenter(new Vector3);t.targetX=t.targetX||e,t.targetY=t.targetY||i,t.targetZ=t.targetZ||s,t.distance=t.distance||this._getIdealDistance();const a=this.getCurrentCameraParameters(),n=deepMerge(JSON.parse(JSON.stringify(a)),t);return this._tweenCameraParameter(a,n,!0)}enablePanning(){this._lerpEnabled=!1,this._panningEnabled=!0}disablePanning(){this._lerpEnabled=!1,this._panningEnabled=!1}getKernelZoomFactor(){const t=this.maxDistance;return 1-this._distance/(t-2)+.2}}class Environment{constructor(t,e){this._scene=t,e&&(e.removeFromScene(),e.cleanUp())}updateCamera(t){}reload(){this.removeFromScene(),this.addToScene()}updateBounds(t,e){this._bounds=t}cleanUp(){this._scene=null}}class BakedShadowPlane{constructor(t){this._innerSize=1,this._outerSize=100,this._plane=new Object3D,this._plane.rotation.x=-Math.PI/2;const e=MaterialCreator.createMeshStandardMaterial({});this._innerPlaneMesh=new Mesh,this._innerPlaneMesh.layers.set(2),this._innerPlaneMesh.material=e,this._innerPlaneMesh.receiveShadow=!0,this._outerPlaneMesh=new Mesh,this._outerPlaneMesh.layers.set(2),this._outerPlaneMesh.material=e,this._outerPlaneMesh.receiveShadow=!0,this._plane.add(this._innerPlaneMesh),this._plane.add(this._outerPlaneMesh),this._innerSize=1,this._outerSize=t,this._updatePlane(this._innerSize,this._outerSize)}getRootNode(){return this._plane}getInnerPlane(){return this._innerPlaneMesh}getOuterPlane(){return this._outerPlaneMesh}updateSize(t){this._innerSize=t,this._updatePlane(this._innerSize,this._outerSize)}_updatePlane(t,e){const i=new Shape;i.moveTo(-t/2,-t/2),i.lineTo(-t/2,t/2),i.lineTo(t/2,t/2),i.lineTo(t/2,-t/2),i.lineTo(-t/2,-t/2);const s=new Shape;s.moveTo(-e/2,-e/2),s.lineTo(-e/2,e/2),s.lineTo(e/2,e/2),s.lineTo(e/2,-e/2),s.lineTo(-e/2,-e/2);const a=new Path;a.moveTo(-t/2,-t/2),a.lineTo(-t/2,t/2),a.lineTo(t/2,t/2),a.lineTo(t/2,-t/2),a.lineTo(-t/2,-t/2),s.holes.push(a);const n=new ShapeGeometry(i);this._innerPlaneMesh.geometry&&this._innerPlaneMesh.geometry.dispose(),this._innerPlaneMesh.geometry=n;const o=new ShapeGeometry(s);this._outerPlaneMesh.geometry&&this._outerPlaneMesh.geometry.dispose(),this._outerPlaneMesh.geometry=o;const r=n.attributes.uv.clone();n.setAttribute("uv2",r);const h=n.attributes.uv2.array;for(let t=0;t<h.length;++t)h[t]+=.5}}class FloorEnvironment extends Environment{constructor(t,e,i){super(t,e),this._longestSide=2,this._bakedShadowPlane=new BakedShadowPlane(100),this._fog=i||!1,this._textureLoader=new TextureLoader,this.addToScene()}needsBounds(){return!0}needsCamera(){return this._fog}needsRotation(){return!1}updateBounds(t){return super.updateBounds(t),this._longestSide=Math.max(t.x,t.z),this._update(),!0}updateCamera(t){this._cameraDistance=t.position.distanceTo(new Vector3(0,0,0)),this._update()}_update(){this._fog&&this._updateFog()}_updateFog(){let t=this._longestSide/2;this._scene.fog=new Fog(16185078,this._cameraDistance+t+3,this._cameraDistance+t+3+1),this._scene.background=new Color(16185078)}_updateFloor(){if(this._floorMaterial)this._bakedShadowPlane.getOuterPlane().material=this._floorMaterial,this._bakedShadowPlane.getInnerPlane().material=this._floorMaterial;else{let t=this._width/1e3,e=this._height/1e3;this._repeatable&&(this._floorTexture.wrapS=RepeatWrapping,this._floorTexture.wrapT=RepeatWrapping,this._floorTexture.repeat.set(100/t,100/e));let i=MaterialCreator.createMeshStandardMaterial({map:this._floorTexture,side:DoubleSide});this._bakedShadowPlane.getInnerPlane().material=i,this._bakedShadowPlane.getOuterPlane().material=i}}addToScene(){this._scene&&this._scene.add(this._bakedShadowPlane.getRootNode())}removeFromScene(){this._scene.remove(this._bakedShadowPlane.getRootNode())}setFloorMaterial(t,e,i,s){return this._width=e,this._height=i,this._repeatable=s,this._floorPromise=new Promise((e,i)=>{this._textureLoader.load(t,t=>{this._floorTexture=t,e()},null,i)}),new Promise((t,e)=>{this._floorPromise.then(()=>{this._updateFloor(),this._update(),t()},e)})}changeFloorMaterial(t,e,i){this._floorPromise=new Promise((s,a)=>{this._floorMaterial=createMaterial(t,i),this._rapiAccess.getTexturesOf(t).then(t=>{if(t.length>0){let i=[];t.forEach(t=>{i.push(addTexture(this._dataSyncer.requestAsset(t.image,!0),t,this._floorMaterial,e,1,1))}),Promise.all(i).then(()=>{setTimeout(()=>s(),0)},a)}else setTimeout(()=>s(),0)})});let s=[this._floorPromise];return new Promise((t,e)=>{Promise.all(s).then(()=>{this._updateFloor(),this._update(),t()},e)})}showGUI(){this._floorMaterial?this._addGUI():this._floorPromise&&this._floorPromise.then(()=>this._addGUI())}_addGUI(){let t=getGUI();if(!t)return;let e=t.addFolder("Floor");e.add(this._floorMaterial,"roughness").min(0).max(1).step(.01),e.add(this._floorMaterial,"reflectivity").min(0).max(1).step(.01),e.add(this._floorMaterial,"clearCoat").min(0).max(1).step(.01),e.add(this._floorMaterial,"clearCoatRoughness").min(0).max(1).step(.01),e.add(this._floorMaterial,"opacity").min(0).max(1).step(.01),e.add(this._floorMaterial,"metalness").min(0).max(1).step(.01),e.add(this._floorMaterial,"bumpScale").min(0).max(1).step(.01)}}__decorate([inject],FloorEnvironment.prototype,"_rapiAccess",void 0),__decorate([inject],FloorEnvironment.prototype,"_dataSyncer",void 0);class CameraControl2D extends CameraControl{constructor(t,e,i,s){super(t,e,i),this._scale=1,this._cameraZoom=1,this._state=0,this._size=5,this._lastPosition=new Vector2,this._zoomPosition=new Vector3,this._lastZoom=0,this._zoomSpeed=Math.pow(.95,2),s?(this._camera=s,this._cameraPosition=(new Vector3).copy(this._camera.position)):this._initCamera(i||new Vector3(0,10,0))}_getCamera(){return this._camera||this._initCamera(new Vector3(0,10,0)),this._camera}_initCamera(t){let{x:e,y:i}=this._domHelper.getClientDimensions(),s=e/i*this._size,a=this._size;this._camera=new OrthographicCamera(s/-2,s/2,a/2,a/-2,1,1e3),this._camera.position.copy(t),this._cameraPosition=t,this._camera.lookAt(new Vector3(0,0,0))}updateCamera(){let{x:t,y:e}=this._domHelper.getClientDimensions(),i=t/e*this._size,s=this._size;this._camera.left=i/-2,this._camera.right=i/2,this._camera.top=s/2,this._camera.bottom=s/-2,this._camera.updateProjectionMatrix()}_initInputListener(){this._inputListeners.push({key:3,fun:t=>{this._locked||(this._state=1,this._lastPosition.set(t.positionRelative.x,t.positionRelative.y),this.dispatchEvent(0))}}),this._inputListeners.push({key:6,fun:t=>{1!==this._state||this._locked||(this._move(new Vector2(t.positionRelative.x,t.positionRelative.y),t.type),this.dispatchEvent(1))}}),this._inputListeners.push({key:4,fun:t=>{1===this._state&&this.dispatchEvent(2),this._state=0}}),this._inputListeners.push({key:7,fun:t=>{t.event&&(t.event.stopPropagation(),t.event.preventDefault()),this.dispatchEvent(3),this._scale/=this._zoomSpeed,this._zoomTo(t.positionRelative),this._update()}}),this._inputListeners.push({key:8,fun:t=>{t.event&&(t.event.stopPropagation(),t.event.preventDefault()),this.dispatchEvent(4),this._scale*=this._zoomSpeed,this._zoomTo(t.positionRelative),this._update()}})}_zoomTo(t){if(Date.now()-this._lastZoom>200){let e=new Vector3(t.x,t.y,0);e.unproject(this._camera),this._zoomPosition.copy(e)}this._lastZoom=Date.now()}_move(t,e){let i=new Vector3,s=new Vector3(this._lastPosition.x,this._lastPosition.y,0),a=new Vector3(t.x,t.y,0);s.unproject(this._camera),a.unproject(this._camera),i.subVectors(a,s),this._cameraPosition.x-=i.x*(2===e?1.1:1),this._cameraPosition.z-=i.z*(2===e?1.1:1),this._lastPosition.copy(t)}zoomToFitBounds(t,e,i){if(compareBox3Size(t,this._boundingBox)<0&&!i)return void this.setBounds(t);this.setBounds(t);const s=t.getSize(new Vector3),a=t.getCenter(new Vector3),n=s.x/-2/this._camera.left,o=s.z/-2/this._camera.bottom,r=1/Math.max(n,o);(r<this._cameraZoom||e)&&(this._scale=r,this._cameraZoom=r,this._cameraPosition.x=a.x,this._cameraPosition.z=a.z)}_update(t){this._scale=Math.min(this._scale,5),this._scale=Math.max(this._scale,.1);let e=(new Vector3).subVectors(this._zoomPosition,this._cameraPosition).multiplyScalar((this._scale-this._cameraZoom)/this._scale);this._cameraPosition.x+=e.x,this._cameraPosition.z+=e.z,this._cameraZoom!==this._scale&&this.dispatchEvent(5,new ZoomChangeEvent(.1===this._scale,5===this._scale)),this._cameraZoom=this._scale,this._camera.updateProjectionMatrix()}animateCamera(t){if(!super.animateCamera(t)&&Math.abs(this._cameraZoom-this._camera.zoom)<=.01)return!1;const e=Math.min(10*t,1);return this._camera.zoom=MathUtils.lerp(this._camera.zoom,this._cameraZoom,e),!0}getKernelZoomFactor(){const t=1e3*(this._camera.right-this._camera.left);return this._domHelper.element.clientWidth/t*this._camera.zoom}}const KEYBOARD_ROTATION_ANGLE=Math.PI/4;class CameraControlFirstPerson extends CameraControl{constructor(t,e,i,s){super(t,e,i),this._state=0,this._rotationSpeed=1,this._keyMap=new Map,this.minPolarAngle=toRadiant(-60),this.maxPolarAngle=toRadiant(60),this._camera=s||new PerspectiveCamera,this._camera.fov=70,this._camera.aspect=this._width/this._height,this._camera.near=.1,this._camera.far=100,this._camera.updateProjectionMatrix(),this._camera.layers.set(3),this._camera.layers.enable(1),this._camera.layers.enable(2),this._camera.layers.enable(6),this._camera.layers.enable(5),i?this._camera.position.set(i.x,1.5,i.z):this._camera.position.set(0,1.5,0),this._cameraPosition=new Vector3,this._cameraPosition.copy(this._camera.position),this._cameraRotation=new Quaternion,this._pitch=0,this._yaw=0;let a=new Euler(-this._pitch,this._yaw,0,"ZYX");this._cameraRotation.setFromEuler(a),window.addEventListener("gamepadconnected",this._gamepadConnected.bind(this)),window.addEventListener("gamepaddisconnected",this._gamepadDisconnected.bind(this))}_gamepadConnected(t){this.startButtonPressListener()}_gamepadDisconnected(t){window.cancelAnimationFrame(this._listenerLoopAnimationFrame)}startButtonPressListener(){this._listenerLoopAnimationFrame=window.requestAnimationFrame(()=>{this.buttonPressListener()})}buttonPressListener(){let t=navigator.getGamepads()[0];this._checkRightStick(t),this._checkLeftStick(t),this._checkButtons(t),this._processKeyMap(this._keyMap,.001),this.startButtonPressListener()}_checkRightStick(t){let e=t.axes[2],i=t.axes[3];Math.abs(e)>.2&&(this._rotateHorizontal(.01*KEYBOARD_ROTATION_ANGLE*e),this._update(),this.dispatchEvent(1)),Math.abs(i)>.2&&(this._rotateVertical(.01*KEYBOARD_ROTATION_ANGLE*i),this._update(),this.dispatchEvent(1))}_checkLeftStick(t){let e=t.axes[0],i=t.axes[1];Math.abs(i)>.2?i<0?this._keyMap.set(87,!0):this._keyMap.set(83,!0):t.buttons&&t.buttons[12]&&t.buttons[12].pressed?this._keyMap.set(87,!0):t.buttons&&t.buttons[13]&&t.buttons[13].pressed?this._keyMap.set(83,!0):(this._keyMap.set(87,!1),this._keyMap.set(83,!1)),Math.abs(e)>.2?e<0?this._keyMap.set(65,!0):this._keyMap.set(68,!0):(this._keyMap.set(65,!1),this._keyMap.set(68,!1))}_checkButtons(t){t.buttons&&t.buttons[6]&&t.buttons[6].pressed?this._keyMap.set(16,!0):this._keyMap.set(16,!1),t.buttons&&t.buttons[14]&&t.buttons[14].pressed?(this._keyMap.set(37,!0),this.dispatchEvent(1)):this._keyMap.set(37,!1),t.buttons&&t.buttons[15]&&t.buttons[15].pressed?(this._keyMap.set(39,!0),this.dispatchEvent(1)):this._keyMap.set(39,!1)}animateCamera(t){let e=this._cameraPosition,i=this._cameraRotation,s=this.getCamera(),a=position3VectorsAreEqual(e,s.position),n=rotationQuaternionsAreEqual(i,s.quaternion);if(!e||a&&n)return!1;let o=this.getCamera().position.clone(),r=Math.min(10*t,1);o.lerp(e,r),this.getCamera().position.copy(o);let h=this.getCamera().quaternion.clone(),c=Math.min(5*t,1);h.slerp(i,c),this.getCamera().setRotationFromQuaternion(h);let d=!1;return this._keyMap.forEach(t=>{t&&(d=!0)}),d&&this._processKeyMap(this._keyMap,t),!0}_getCamera(){return this._camera}_initInputListener(){window.addEventListener("keyup",this._onKeyChanged.bind(this),!1),window.addEventListener("keydown",this._onKeyChanged.bind(this),!1),this._inputListeners.push({key:3,fun:t=>{this._down(t)}}),this._inputListeners.push({key:6,fun:t=>{this._move(t)}}),this._inputListeners.push({key:4,fun:t=>{this._up(t)}})}_down(t){this._downPosition=t.position,this._position=t.position,this._state=1,2===t.type&&window.setTimeout(this._onLongDown.bind(this),350),2===t.type?this._rotationSpeed=.6:this._rotationSpeed=1}_move(t){this._position=t.position,1!==this._state||this._locked||this._orbit(new Vector2(t.position.x,t.position.y)),2!==this._state||this._locked||(this._orbit(new Vector2(t.position.x,t.position.y)),this._moveForward())}_up(t){1===this._state&&this.dispatchEvent(2),2===this._state&&this._keyMap.set(87,!1),this._state=0,this._orbitPosition=null}_onLongDown(){getDelta(this._downPosition,this._position)<MIN_MOVE_DISTANCE&&1===this._state&&(this._state=2,this._orbit(new Vector2(this._position.x,this._position.y)),this._moveForward())}_update(t){let e=new Euler(-this._pitch,this._yaw,0,"ZYX");this._cameraRotation.setFromEuler(e)}updateCamera(){let{x:t,y:e}=this._domHelper.getClientDimensions();this._camera.aspect=t/e,this._camera.updateProjectionMatrix()}_onKeyChanged(t){this._keyMap.set(t.keyCode,"keydown"===t.type),this.dispatchEvent(6),this._processKeyMap(this._keyMap,.001)&&t.preventDefault()}_processKeyMap(t,e){e=Math.min(e,.1);let i=new Vector3(0,0,0),s=!1;return this._processUpDown(t,i,e),t.get(65)&&(i.x=-1*e),t.get(68)&&(i.x=1*e),t.get(37)&&(this._rotateHorizontal(-KEYBOARD_ROTATION_ANGLE*this._rotationSpeed*e),s=!0),t.get(39)&&(this._rotateHorizontal(KEYBOARD_ROTATION_ANGLE*this._rotationSpeed*e),s=!0),t.get(16)&&(i.x*=3,i.z*=3),!(0===i.x&&0===i.y&&0===i.z&&!s||(i.applyQuaternion(this.getCamera().quaternion),this._cameraPosition.add(new Vector3(i.x,0,i.z)),this._update(),0))}_processUpDown(t,e,i){(t.get(87)||t.get(38))&&(e.z=-1*i),(t.get(83)||t.get(40))&&(e.z=1*i)}_orbit(t){this._orbitPosition||(this._orbitPosition=new Vector2(t.x,t.y),this.dispatchEvent(0));let e=t.clone().sub(this._orbitPosition),i=this._domHelper.element instanceof Document?this._domHelper.element.body:this._domHelper.element;e.multiplyScalar(-1),this._rotateHorizontal(2*Math.PI*e.x/i.clientWidth*1),this._rotateVertical(2*Math.PI*e.y/i.clientHeight*1),position2VectorsAreEqual(this._orbitPosition,t)||this.dispatchEvent(1),this._orbitPosition.copy(t),this._update()}_moveForward(){this._keyMap.set(87,!0),this._processKeyMap(this._keyMap,.001)}_rotateVertical(t){let e=this._pitch+t;e>this.maxPolarAngle||e<this.minPolarAngle||(this._pitch=e,this._pitch<-Math.PI?this._pitch+=2*Math.PI:this._pitch>Math.PI&&(this._pitch-=2*Math.PI),this._saveYawAndPitch())}getKernelZoomFactor(){return this._camera.zoom}}class BackgroundEnvironment extends Environment{constructor(t,e,i,s,a){if(super(t,e),this._color=i,this._oldBackground=t.background,s&&a){this._canvas=s,this._style=document.createElement("style");let t='background-image: url("'+a+'"); background-size: cover;';this._style.innerText=".rml-scene-background {"+t+"}",this._canvas.appendChild(this._style)}}needsBounds(){return!0}needsCamera(){return!1}needsRotation(){return!1}addToScene(){this._scene&&this._color&&(this._scene.background=this._color),this._canvas&&this._canvas.classList&&(this._scene.background=null,this._canvas.classList.add("rml-scene-background"))}removeFromScene(){this._oldBackground&&(this._scene.background=this._oldBackground),this._canvas&&this._canvas.classList.remove("rml-scene-background")}showGUI(){}}class DynamicEnvironmentSettingLoader{parse(t,e,i,s,a,n){let o=JSON.parse(s);return o.environment?this.load(t,e,i,o,a,n):null}load(t,e,i,s,a,n){let o,r=s.environment;if(!r)return console.warn("No environment set in scene settings"),Promise.resolve(null);switch(r.type){case"color":o=new Promise(e=>e(new BackgroundEnvironment(t,i,new Color(r.details.color))));break;case"image":o=new Promise(s=>s(new BackgroundEnvironment(t,i,null,e,r.details.imageUrl)));break;case"floor":o=new Promise(e=>{this._rapiAccess.getMaterial(r.details.material).then(s=>{let o=void 0===r.details.fog||r.details.fog,h=new FloorEnvironment(t,i,o);h.changeFloorMaterial(s,a,n).then(()=>{e(h)})})});break;default:console.warn("Could not load environment, return old environment"),o=new Promise(t=>t(i))}return o}}__decorate([inject],DynamicEnvironmentSettingLoader.prototype,"_rapiAccess",void 0);class LightSetting{constructor(t,e){this._scene=t,e&&e.removeFromScene()}needsBounds(){return!1}updateBounds(t){}getCameraContainer(){return this._cameraContainer||(this._cameraContainer=new Object3D),this._cameraContainer}}class DynamicLightSetting extends LightSetting{constructor(t,e){super(t,e),this._lights=[]}needsBounds(){return!0}updateBounds(t){if(this._cameraLight){const e=this._cameraLight,i=new Vector3;t.getSize(i);const s=1.5*Math.max(Math.max(i.x,i.y),i.z);this._boundingSize=s,e.shadow.camera.top=s/2,e.shadow.camera.bottom=-s/2,e.shadow.camera.left=-s/2,e.shadow.camera.right=s/2,e.shadow.camera.updateProjectionMatrix()}}loadFromJSON(t){return new Promise(e=>{this._lights=this._dynamicLightSettingLoader.parse(t),this.addToScene(),e()})}loadFromObject(t){return new Promise(e=>{(null==t?void 0:t.lights)||e(),this._lights=this._dynamicLightSettingLoader.load(t),this._lights.forEach((t,e)=>{t.userData.movesWithCamera&&(this._cameraLight=t,this._lights.splice(e,1))}),this.addToScene(),e()})}loadFromURL(t){return new Promise((e,i)=>{fetch(new Request(t,{method:"GET"})).then(handleJsonResponse).then(t=>this.loadFromObject(t).then(e,i))})}addToScene(){this._lights.forEach(t=>{this._scene.add(t)}),this._cameraLight&&this._scene.add(this._cameraLight)}update(t,e){if(!this._cameraLight)return;let i=new Vector3;t.getWorldDirection(i),i.multiplyScalar(-this._boundingSize);let s=e.clone().add(i);this._cameraLight.position.copy(s)}removeFromScene(){this._lights.forEach(t=>{this._scene.remove(t)}),this._cameraLight&&this._scene.remove(this._cameraLight)}reload(){this.removeFromScene(),this.addToScene()}showGUI(){let t=getGUI();this._cameraLight&&this._addToGUI(t,this._cameraLight),this._lights.forEach(e=>{this._addToGUI(t,e)})}_addToGUI(t,e){t&&(e instanceof SpotLight&&this._addSpotLightToGUI(t,e),e instanceof AmbientLight&&this._addAmbientLightToGUI(t,e),e instanceof DirectionalLight&&this._addDirectionalLightToGUI(t,e),e instanceof RectAreaLight&&this._addRectAreaLightToGUI(t,e))}_addRectAreaLightToGUI(t,e){let i=t.addFolder(e.name),s={name:e.name,color:"#"+e.color.getHexString(),intensity:e.intensity*(e.width*e.height)};i.add(e,"visible"),i.add(s,"intensity").min(10).max(400).step(10).onChange(t=>{e.intensity=t/(e.width*e.height)}),i.add(e,"castShadow"),i.addColor(s,"color").onChange(t=>{e.color=new Color(t)}),i.add(e.position,"x").min(-10).max(10).step(.1).onChange(()=>{e.lookAt(new Vector3(0,0,0))}),i.add(e.position,"y").min(-10).max(10).step(.1).onChange(()=>{e.lookAt(new Vector3(0,0,0))}),i.add(e.position,"z").min(-10).max(10).step(.1).onChange(()=>{e.lookAt(new Vector3(0,0,0))})}_addSpotLightToGUI(t,e){let i=t.addFolder(e.name),s={name:e.name,color:"#"+e.color.getHexString(),angle:180*e.angle/Math.PI};i.add(e,"visible"),i.add(e,"intensity").min(0).max(5).step(.1),i.add(e,"penumbra").min(0).max(1).step(.1),i.addColor(s,"color").onChange(t=>{e.color=new Color(t)}),i.add(s,"angle").min(10).max(180).step(1).onChange(t=>{e.angle=t*Math.PI/180}),i.add(e.position,"x").min(-10).max(10).step(.1).onChange(()=>{e.lookAt(new Vector3(0,0,0))}),i.add(e.position,"y").min(-10).max(10).step(.1).onChange(()=>{e.lookAt(new Vector3(0,0,0))}),i.add(e.position,"z").min(-10).max(10).step(.1).onChange(()=>{e.lookAt(new Vector3(0,0,0))})}_addAmbientLightToGUI(t,e){let i={name:e.name,color:"#"+e.color.getHexString()},s=t.addFolder(e.name);s.add(e,"visible"),s.add(e,"intensity").min(0).max(5).step(.1),s.addColor(i,"color").onChange(t=>{e.color=new Color(t)})}_addDirectionalLightToGUI(t,e){let i=t.addFolder(e.name),s={name:e.name,color:"#"+e.color.getHexString()};i.add(e,"visible"),i.add(e,"intensity").min(0).max(5).step(.1),i.addColor(s,"color").onChange(t=>{e.color=new Color(t)}),i.add(e,"castShadow"),i.add(e.position,"x").min(-10).max(10).step(.1).onChange(()=>{e.lookAt(new Vector3(0,0,0))}),i.add(e.position,"y").min(-10).max(10).step(.1).onChange(()=>{e.lookAt(new Vector3(0,0,0))}),i.add(e.position,"z").min(-10).max(10).step(.1).onChange(()=>{e.lookAt(new Vector3(0,0,0))})}}__decorate([inject],DynamicLightSetting.prototype,"_dynamicLightSettingLoader",void 0);class GroundProjectedSkybox extends Mesh{constructor(t,e={}){const i=[t.isCubeTexture?"#define ENVMAP_TYPE_CUBE":""].join("\n")+"\n\n\t\t\t\tvarying vec3 vWorldPosition;\n\n\t\t\t\tuniform float radius;\n\t\t\t\tuniform float height;\n\t\t\t\tuniform float angle;\n\n\t\t\t\t#ifdef ENVMAP_TYPE_CUBE\n\n\t\t\t\t\tuniform samplerCube map;\n\n\t\t\t\t#else\n\n\t\t\t\t\tuniform sampler2D map;\n\n\t\t\t\t#endif\n\n\t\t\t\t// From: https://www.shadertoy.com/view/4tsBD7\n\t\t\t\tfloat diskIntersectWithBackFaceCulling( vec3 ro, vec3 rd, vec3 c, vec3 n, float r ) \n\t\t\t\t{\n\n\t\t\t\t\tfloat d = dot ( rd, n );\n\n\t\t\t\t\tif( d > 0.0 ) { return 1e6; }\n\n\t\t\t\t\tvec3 o = ro - c;\n\t\t\t\t\tfloat t = - dot( n, o ) / d;\n\t\t\t\t\tvec3 q = o + rd * t;\n\n\t\t\t\t\treturn ( dot( q, q ) < r * r ) ? t : 1e6;\n\n\t\t\t\t}\n\n\t\t\t\t// From: https://www.iquilezles.org/www/articles/intersectors/intersectors.htm\n\t\t\t\tfloat sphereIntersect( vec3 ro, vec3 rd, vec3 ce, float ra ) {\n\n\t\t\t\t\tvec3 oc = ro - ce;\n\t\t\t\t\tfloat b = dot( oc, rd );\n\t\t\t\t\tfloat c = dot( oc, oc ) - ra * ra;\n\t\t\t\t\tfloat h = b * b - c;\n\n\t\t\t\t\tif( h < 0.0 ) { return -1.0; }\n\n\t\t\t\t\th = sqrt( h );\n\n\t\t\t\t\treturn - b + h;\n\n\t\t\t\t}\n\n\t\t\t\tvec3 project() {\n\n\t\t\t\t\tvec3 p = normalize( vWorldPosition );\n\t\t\t\t\tvec3 camPos = cameraPosition;\n\t\t\t\t\tcamPos.y -= height;\n\n\t\t\t\t\tfloat intersection = sphereIntersect( camPos, p, vec3( 0.0 ), radius );\n\t\t\t\t\tif( intersection > 0.0 ) {\n\n\t\t\t\t\t\tvec3 h = vec3( 0.0, - height, 0.0 );\n\t\t\t\t\t\tfloat intersection2 = diskIntersectWithBackFaceCulling( camPos, p, h, vec3( 0.0, 1.0, 0.0 ), radius );\n\t\t\t\t\t\tp = ( camPos + min( intersection, intersection2 ) * p ) / radius;\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tp = vec3( 0.0, 1.0, 0.0 );\n\n\t\t\t\t\t}\n\n\t\t\t\t\treturn p;\n\n\t\t\t\t}\n\n\t\t\t\t#include <common>\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvec3 projectedWorldPosition = project();\n\n\t\t\t\t\t#ifdef ENVMAP_TYPE_CUBE\n\n\t\t\t\t\t\tvec3 outcolor = textureCube( map, projectedWorldPosition ).rgb;\n\n\t\t\t\t\t#else\n\n\t\t\t\t\t\tvec3 direction = normalize( projectedWorldPosition );\n\t\t\t\t\t\tvec2 uv = equirectUv( direction );\n\t\t\t\t\t\tvec3 outcolor = texture2D( map, uv ).rgb;\n\n\t\t\t\t\t#endif\n\n\t\t\t\t\tgl_FragColor = vec4( outcolor, 1.0 );\n\n\t\t\t\t\t#include <tonemapping_fragment>\n\t\t\t\t\t#include <colorspace_fragment>\n\n\t\t\t\t}\n\t\t\t\t",s={map:{value:t},height:{value:e.height||15},radius:{value:e.radius||100}};super(new IcosahedronGeometry(1,16),new ShaderMaterial({uniforms:s,fragmentShader:i,vertexShader:"\n\t\t\tvarying vec3 vWorldPosition;\n\n\t\t\tvoid main() {\n\n\t\t\t\tvec4 worldPosition = ( modelMatrix * vec4( position, 1.0 ) );\n\t\t\t\tvWorldPosition = worldPosition.xyz;\n\n\t\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n\t\t\t}\n\t\t\t",side:DoubleSide}))}set radius(t){this.material.uniforms.radius.value=t}get radius(){return this.material.uniforms.radius.value}set height(t){this.material.uniforms.height.value=t}get height(){return this.material.uniforms.height.value}}class GroundProjectedEnvironment extends Environment{constructor(t,e,i){super(t,e),this.updateEnvironmentTexture(i)}updateEnvironmentTexture(t){t&&(this._environmentTexture=t,this._skybox=new GroundProjectedSkybox(this._environmentTexture),this._skybox.name="Ground projected skybox",this._skybox.scale.setScalar(100)),this.reload()}needsBounds(){return!1}needsCamera(){return!1}needsRotation(){return!1}addToScene(){this._scene&&this._skybox&&this._scene.add(this._skybox)}removeFromScene(){this._scene&&this._skybox&&this._scene.remove(this._skybox)}showGUI(t){let e=getGUI();if(!e)return;let i=e.addFolder("Ground Projected Environment");i.add(this._skybox,"height").min(10).max(100).step(.1).onChange(t),i.add(this._skybox,"radius").min(20).max(200).step(.1).onChange(t)}}class SceneManager{onBeforeRender(){}constructor(t,e,i,s=CAMERA_TYPE.CAMERA_3D){this._depthWriteMaterial=new MeshBasicMaterial({colorWrite:!1}),this._maxAnisotropy=1,this._clock=new Clock,this._delta=0,this._renderListener=null,this._stopRendering=!1,this._forceRender=!1,this._lastChange=Date.now(),this._running=!1,this._perspectiveOffsetCamera=null,this._orthographicOffsetCamera=null,this._onAfterRender=()=>{},this._creator_=t,this._canvasID=i,MaterialCreator.setEnvMapIntensity(this._initData.envMapIntensity),this.createCameraControl(sanitizedCameraMode(s),e),this._setupScene(e,!1),this._lifeCycleManager.addEventListener(this)}_changeCameraControl(t){this._cameraControl&&this._cameraControl.cleanUp(),t instanceof CameraControlFirstPerson&&(this._getInputManager().removeEventListener(7,this._renderListener),this._getInputManager().removeEventListener(8,this._renderListener)),this._cameraControl instanceof CameraControlFirstPerson&&(this._getInputManager().addEventListener(7,this._renderListener,this),this._getInputManager().addEventListener(8,this._renderListener,this)),this._cameraControl=t,this.cameraControlChanged()}cameraControlChanged(){}_addCameraControlListener(){this._cameraControl.addEventListener(0,()=>{var t;null===(t=this._roomleRenderer)||void 0===t||t.movingCameraStarts(),this._requestRender()},this),this._cameraControl.addEventListener(1,this._requestRender,this),this._cameraControl.addEventListener(2,()=>{var t;null===(t=this._roomleRenderer)||void 0===t||t.movingCameraStops(),this._requestRender()},this),this._cameraControl.addEventListener(6,this._requestRender,this)}_renderEverything(){var t;this._roomleRenderer&&(this._forceRender=!0,null===(t=this._roomleRenderer)||void 0===t||t.forceShadowUpdates(!1)),this._requestRender()}_renderWithoutShadowsAndAO(){this._roomleRenderer&&(this._forceRender=!0),this._requestRender()}_requestRender(){if(!this._renderer||this._stopRendering)return;const t=()=>{var e;this._delta=this._clock.getDelta(),this._animateCamera(),this._cameraControl.getCamera().layers.mask=65535,null===(e=this._statsHelper)||void 0===e||e.updateRenderInfo(this._renderer.info),this._renderLoopFunction&&(this._renderLoopFunction(),this._renderLoopFunction=null),this.onBeforeRender(),this._roomleRenderer?(this._roomleRenderer.render(this._scene,this._cameraControl.getCamera()),this._forceRender=!1,this._shouldRenderUi()&&this._renderUi()):this._renderer.render(this._scene,this._cameraControl.getCamera()),this._onAfterRender(),window.TWEEN&&TWEEN.update(),this._lastChange+3e3<Date.now()||this._stopRendering?this._running=!1:(this._running=!0,requestAnimationFrame(t))};this._lastChange=Date.now(),this._running||this._stopRendering||(this._running=!0,requestAnimationFrame(t))}_shouldRenderUi(){return this._pluginSystem&&this._pluginSystem.needsUiScene()}_renderUi(){const t=this._scene.background?this._scene.background.clone():null;this._scene.overrideMaterial=this._depthWriteMaterial,this._scene.background=null,this._renderer.render(this._scene,this._cameraControl.getCamera()),this._scene.overrideMaterial=null;const e=this._renderer.autoClear;this._renderer.autoClear=!1,this._renderer.clearDepth(),this._renderer.render(this._uiScene,this._cameraControl.getCamera()),this._renderer.autoClear=e,this._scene.background=t}_animateCamera(){this._cameraControl&&(this._cameraControl.animateCamera(this._delta)||!this.shouldClearShadowsAndAO()||this._forceRender)&&this._lightSetting instanceof DynamicLightSetting&&this._cameraControl.getCamera()instanceof PerspectiveCamera&&this._lightSetting.update(this._cameraControl.getCamera(),this._cameraControl.getTargetPosition()),this._environment&&this._environment.needsCamera()&&this._cameraControl instanceof CameraControl3D&&this._environment.updateCamera(this._cameraControl.getCamera())}shouldClearShadowsAndAO(){return!1}_setupScene(t,e){var i;const{x:s,y:a}=this._domHelper.getClientDimensions();this._scene=new Scene,this._uiScene=new Scene,(e=e||!1)||(this._scene.background=new Color(this._initData.colors.DEFAULT_BACKGROUND));const n=Math.floor(s*window.devicePixelRatio),o=Math.floor(a*window.devicePixelRatio);this._renderer=new WebGLRenderer({antialias:!0,alpha:!0}),this._renderer.setPixelRatio(window.devicePixelRatio),this._renderer.setSize(s,a),this._renderer.outputColorSpace=SRGBColorSpace,this._renderer.autoClear=!1,this._renderer.shadowMap.enabled=!0,this._renderer.shadowMap.type=PCFSoftShadowMap,this._maxAnisotropy=this._renderer.capabilities.getMaxAnisotropy(),this._roomleRenderer=new RoomleWebGLRenderer(this._renderer,n,o),this._roomleRenderer.enableContactShadow(),this._roomleRenderer.enableShadowAndAo(),this._roomleRenderer.setAutoQuality(this._initData.autoQuality),null===(i=this._roomleRenderer)||void 0===i||i.setSize(s,a),this._renderer.domElement.classList.add(this._canvasID),this._domHelper.element.appendChild(this._renderer.domElement),this._getInputManager().addEvents(this._renderer.domElement),this._hdrEnvironmentLoader.registerEnvironmentChangedCallback(t=>{var e;this._setEnvMap(t),this._initData.legacyLight||null===(e=this._roomleRenderer)||void 0===e||e.createShadowFromEnvironmentMap(this._scene,t.environmentMap)}),this._initData.legacyLight?this.loadEnvMap("static/legacy_env-d5810ec5057d4716.exr"):this.loadEnvMap(this._initData.envMapUrl),this._requestRender(),window.addEventListener("resize",this,!1),window.addEventListener("keydown",this,!1),window.addEventListener("keyup",this,!1),document.addEventListener("visibilitychange",this),this._pluginSystem.init(this._scene,this._uiScene,this._cameraControl.getCamera().position),this._addCameraControlListener(),this.sceneChanged()}async loadEnvMap(t){await this._hdrEnvironmentLoader.loadUrl(this._renderer,t)}_setEnvMap(t){const{url:e,environmentMap:i}=t;this._scene.environment=i,this._scene.userData.equirectangularEnvironmentMap=i,this._imageRenderer.setEnvMap(this._scene,i),this._environment instanceof GroundProjectedEnvironment&&this._environment.updateEnvironmentTexture(i),e===ENV_HDR_256_FILE_NAME&&window.requestIdleCallback(this.loadEnvMap.bind(this,"static/default_1k-2aa6d42244d30fb1.exr")),this._requestRender()}_tabVisible(){this.updateCamera(!1)}updateCamera(t=!0){var e;const{x:i,y:s}=this._domHelper.getClientDimensions();null===(e=this._roomleRenderer)||void 0===e||e.setSize(i,s),this._cameraControl.updateCamera(),this._renderEverything()}_onWindowResize(){const t=this._getInputManager();t&&t.updateSize(),this.updateCamera(),this._requestRender()}_isPartOfScene(t){return"Object3D"===t.type||"Mesh"===t.type||"GLB"===t.type||"GLTF"===t.type||"Group"===t.type}cleanUp(){this._getInputManager().removeEventListener(7,this._renderListener),this._getInputManager().removeEventListener(8,this._renderListener),this._cameraControl&&this._cameraControl.cleanUp(),this._stopRendering=!0}clearScene(){let t=[];this._scene.children.forEach(e=>{this._isPartOfScene(e)&&t.push(e)}),t.forEach(t=>{dispose(t),this._scene.remove(t)}),this._renderer.renderLists.dispose()}enableHD(t){this._renderer.capabilities.maxTextures>8&&t&&this.loadDynamicLightSetting(t),this._requestRender()}_loadGLTF(t,e,i,s,a,n,o){return new Promise((r,h)=>{this._staticItemLoader.loadGLTF(t,e,i,s,a,n,null,o).then(t=>{this._setCamera("GLTF",t.scene),r(t.scene)},h)})}_loadGLB(t,e,i,s,a,n,o,r){return new Promise((h,c)=>{this._staticItemLoader.loadGLB(t,e,i,s,a,n,o,r).then(t=>{this._setCamera("GLB",t.scene),h(t.scene)},c)})}_setCamera(t,e){if(!e)return void console.warn("could not set camera for gltf",e);const i=new Box3;i.setFromObject(e),"GLB"===t?this._cameraControl instanceof CameraControl3D&&this._cameraControl.updateToBounds(i,!1):"GLTF"===t&&(this._cameraControl instanceof CameraControl3D&&this._cameraControl.updateAndReset(i.getSize(new Vector3),i.getCenter(new Vector3),-15,70,5,!1),this._cameraControl instanceof CameraControl2D&&this._cameraControl.zoomToFitBounds(i,!0)),this.updateCamera()}showGUI(){if(this._initData.disableDebugGUI)return;const t=document.createElement("style");t.innerText=".dg.main{position:absolute;z-index:999;top:0;left:0;}",document.head.appendChild(t);let e=getGUI(!1);e&&(this._domHelper.element.appendChild(e.domElement),this._guiLoaded())}_guiLoaded(){let t=getGUI();if(!t)return;const e=t.addFolder("Scene Parameter"),i={intensity:this._initData.envMapIntensity};e.add(i,"intensity",0,4,.01).name("env map intensity").onChange(t=>{this.changeEnvironmentMapIntensity(t),this._requestRender()}),this._lightSetting&&this._lightSetting.showGUI(),this._roomleRenderer&&this._roomleRenderer.showGUI(()=>this._requestRender()),this._environment&&this._environment.showGUI(()=>this._requestRender()),this._addGUIListener(t)}_addGUIListener(t){let e=t.__folders;Object.keys(e).forEach(t=>{let i=e[t];i.__folders&&Object.keys(i.__folders).forEach(t=>{let e=i.__folders[t];this._addGUIListener(e)}),i.__controllers&&i.__controllers.forEach(t=>{t.onFinishChange(()=>{this._guiParamChanged()})})})}_guiParamChanged(){this._renderEverything()}showStats(){import("./stats-helper-969d208f.js").then(t=>this._statsHelper=new t.default)}_onKeyDown(t){}_onKeyUp(t){}pause(){this._getInputManager().removeEvents(this._renderer.domElement),window.removeEventListener("resize",this,!1),window.removeEventListener("keydown",this,!1),window.removeEventListener("keyup",this,!1),document.removeEventListener("visibilitychange",this)}resume(){this._renderer.domElement.classList.add(this._canvasID),this._domHelper.element.appendChild(this._renderer.domElement),this._getInputManager().addEvents(this._renderer.domElement),window.addEventListener("resize",this,!1),window.addEventListener("keydown",this,!1),window.addEventListener("keyup",this,!1),document.addEventListener("visibilitychange",this),this.updateCamera()}destroy(){this.pause(),this.cleanUp()}handleEvent(t){switch(t.type){case"resize":this._onWindowResize();break;case"keydown":if(t.target&&(t.target instanceof HTMLInputElement||t.target instanceof HTMLTextAreaElement))break;this._onKeyDown(t);break;case"keyup":if(t.target&&(t.target instanceof HTMLInputElement||t.target instanceof HTMLTextAreaElement))break;this._onKeyUp(t);break;case"visibilitychange":this._tabVisible()}}async loadSceneSettings(t){let e,i;return e=t.environment?new Promise(e=>{(new DynamicEnvironmentSettingLoader).load(this._scene,this._renderer.domElement,this._environment,t,this._maxAnisotropy,this._initData.envMapIntensity).then(t=>{this._setEnvironment(t),e()})}):Promise.resolve(),t.lights?(this._lightSetting=new DynamicLightSetting(this._scene,this._lightSetting),i=this._lightSetting.loadFromObject(t)):i=Promise.resolve(),new Promise((t,s)=>{Promise.all([e,i]).then(()=>{this._renderEverything(),t()},s)})}setBackgroundColor(t){this._setEnvironment(new BackgroundEnvironment(this._scene,this._environment,new Color(t)))}setBackgroundImage(t){this._setEnvironment(new BackgroundEnvironment(this._scene,this._environment,null,this._renderer.domElement,t))}_setEnvironment(t){this._environment=t,this._renderEverything()}async loadDynamicLightSetting(t){this._lightSetting=new DynamicLightSetting(this._scene,this._lightSetting);let e=!1;if(t.url)await this._lightSetting.loadFromURL(t.url),e=!0;else if(t.json)await this._lightSetting.loadFromJSON(t.json),e=!0;else if(t.object)await this._lightSetting.loadFromObject(t.object),e=!0;else if(t.ls){const i=DynamicLightSettingLoader.createDynamicLightSettingSource(null,t.ls);await this._lightSetting.loadFromURL(i.url),e=!0}if(!e)throw new Error("No dynamic light setting source set");this._requestRender()}getScene(){return this._scene}updateScene(){var t;this._updateBounds(this.getBounds()),null===(t=this._roomleRenderer)||void 0===t||t.forceShadowUpdates(!0),this._renderEverything()}_updateBounds(t,e=!1){var i;t&&(this.updateEnvironment(t,e),this._lightSetting&&this._lightSetting.needsBounds()&&this._lightSetting.updateBounds(t),null===(i=this._roomleRenderer)||void 0===i||i.updateBounds(t),this._requestRender(),this._pluginSystem.updateBounds(t))}setCameraOffset(t){const e=this._cameraControl.getCamera(),i=e||e;(null==i?void 0:i.offset)?(i.offset=t,this._renderEverything()):console.warn("Cannot set offset, current camera does not support it")}getCameraOffset(){const t=this._cameraControl.getCamera(),e=t||t;return(null==e?void 0:e.offset)?JSON.parse(JSON.stringify(e.offset)):{left:0,top:0,right:1,bottom:1}}getOrthographicOffsetCamera(){if(!this._orthographicOffsetCamera){const t=this.getCameraOffset(),e=this._domHelper.getClientDimensions(),i=5;let s=e.x/e.y*i,a=i;const n=RoomleComponentFactoryInitializer();this._orthographicOffsetCamera=n.createOrthographicCamera(s/-2,s/2,a/2,a/-2,1,1e3,t),this._orthographicOffsetCamera.position.set(0,10,0),this._orthographicOffsetCamera.lookAt(new Vector3(0,0,0))}return this._orthographicOffsetCamera}getPerspectiveOffsetCamera(){if(!this._perspectiveOffsetCamera){const t=this.getCameraOffset(),e=this._domHelper.getClientDimensions(),i=e.x,s=e.y,a=RoomleComponentFactoryInitializer();this._perspectiveOffsetCamera=a.createPerspectiveCamera(30,i/s,.1,20,t)}return this._perspectiveOffsetCamera}updateEnvironment(t,e=!1){var i;if(t&&this._environment&&this._environment.needsBounds()){const i=t.getSize(new Vector3);(i.x+i.y+i.z!==0||e)&&this._environment.updateBounds(t.getSize(new Vector3),e)}null===(i=this._roomleRenderer)||void 0===i||i.updateEnvironment(t,e)}_onCameraIdle(){return!0}_onCameraMove(){return!0}exportImageFromCamera(t){this._onAfterRender=()=>{const e=this._renderer.domElement.toDataURL("image/jpeg",1),{left:i,right:s,top:a,bottom:n}=this.getCameraOffset(),o=s-i,r=a-n;if(1===o&&1===r)return void download(t,e);const h=new Image;h.src=e,h.onload=()=>{const{naturalWidth:e,naturalHeight:s}=h,n=document.createElement("canvas");n.width=e*o,n.height=s*r;const c=n.getContext("2d"),d=e*i*-1,_=s*(1-a)*-1;c.drawImage(h,d,_),c.save(),download(t,n.toDataURL("image/jpeg",1)),this._onAfterRender=()=>{}}},this._requestRender()}changeEnvironmentMapIntensity(t){changeEnvironmentMapIntensity(this._scene,t)}lockCamera(){this._cameraControl.lock()}unlockCamera(){this._cameraControl.unlock()}}__decorate([inject],SceneManager.prototype,"_domHelper",void 0),__decorate([inject],SceneManager.prototype,"_scriptLoader",void 0),__decorate([inject],SceneManager.prototype,"_lifeCycleManager",void 0),__decorate([inject],SceneManager.prototype,"_staticItemLoader",void 0),__decorate([inject],SceneManager.prototype,"_hdrEnvironmentLoader",void 0),__decorate([inject],SceneManager.prototype,"_initData",void 0),__decorate([inject],SceneManager.prototype,"_pluginSystem",void 0),__decorate([inject],SceneManager.prototype,"_imageRenderer",void 0);export{BackgroundEnvironment as B,CameraControl3D as C,DISTANCE_FACTOR as D,FloorEnvironment as F,LightSetting as L,SceneManager as S,TWEEN_FILE_NAME as T,CameraControl as a,CameraControl2D as b,CameraControlFirstPerson as c};
2
+ //# sourceMappingURL=scene-manager-3ee00913.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scene-manager-3ee00913.js","sources":["../../packages/common-core/public/textures/env/default_1k.exr","../../packages/three-build/src/Tween.js","../../node_modules/three/examples/jsm/objects/GroundProjectedSkybox.js","../../packages/common-core/public/textures/env/legacy_env.exr"],"sourcesContent":["export default \"static/default_1k-2aa6d42244d30fb1.exr\"","export default \"static/Tween-d57ee5d181fce582.js\"","import { Mesh, IcosahedronGeometry, ShaderMaterial, DoubleSide } from 'three';\n\n/**\n * Ground projected env map adapted from @react-three/drei.\n * https://github.com/pmndrs/drei/blob/master/src/core/Environment.tsx\n */\nclass GroundProjectedSkybox extends Mesh {\n\n\tconstructor( texture, options = {} ) {\n\n\t\tconst isCubeMap = texture.isCubeTexture;\n\n\t\tconst defines = [\n\t\t\tisCubeMap ? '#define ENVMAP_TYPE_CUBE' : ''\n\t\t];\n\n\t\tconst vertexShader = /* glsl */ `\n\t\t\tvarying vec3 vWorldPosition;\n\n\t\t\tvoid main() {\n\n\t\t\t\tvec4 worldPosition = ( modelMatrix * vec4( position, 1.0 ) );\n\t\t\t\tvWorldPosition = worldPosition.xyz;\n\n\t\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n\t\t\t}\n\t\t\t`;\n\t\tconst fragmentShader = defines.join( '\\n' ) + /* glsl */ `\n\n\t\t\t\tvarying vec3 vWorldPosition;\n\n\t\t\t\tuniform float radius;\n\t\t\t\tuniform float height;\n\t\t\t\tuniform float angle;\n\n\t\t\t\t#ifdef ENVMAP_TYPE_CUBE\n\n\t\t\t\t\tuniform samplerCube map;\n\n\t\t\t\t#else\n\n\t\t\t\t\tuniform sampler2D map;\n\n\t\t\t\t#endif\n\n\t\t\t\t// From: https://www.shadertoy.com/view/4tsBD7\n\t\t\t\tfloat diskIntersectWithBackFaceCulling( vec3 ro, vec3 rd, vec3 c, vec3 n, float r ) \n\t\t\t\t{\n\n\t\t\t\t\tfloat d = dot ( rd, n );\n\n\t\t\t\t\tif( d > 0.0 ) { return 1e6; }\n\n\t\t\t\t\tvec3 o = ro - c;\n\t\t\t\t\tfloat t = - dot( n, o ) / d;\n\t\t\t\t\tvec3 q = o + rd * t;\n\n\t\t\t\t\treturn ( dot( q, q ) < r * r ) ? t : 1e6;\n\n\t\t\t\t}\n\n\t\t\t\t// From: https://www.iquilezles.org/www/articles/intersectors/intersectors.htm\n\t\t\t\tfloat sphereIntersect( vec3 ro, vec3 rd, vec3 ce, float ra ) {\n\n\t\t\t\t\tvec3 oc = ro - ce;\n\t\t\t\t\tfloat b = dot( oc, rd );\n\t\t\t\t\tfloat c = dot( oc, oc ) - ra * ra;\n\t\t\t\t\tfloat h = b * b - c;\n\n\t\t\t\t\tif( h < 0.0 ) { return -1.0; }\n\n\t\t\t\t\th = sqrt( h );\n\n\t\t\t\t\treturn - b + h;\n\n\t\t\t\t}\n\n\t\t\t\tvec3 project() {\n\n\t\t\t\t\tvec3 p = normalize( vWorldPosition );\n\t\t\t\t\tvec3 camPos = cameraPosition;\n\t\t\t\t\tcamPos.y -= height;\n\n\t\t\t\t\tfloat intersection = sphereIntersect( camPos, p, vec3( 0.0 ), radius );\n\t\t\t\t\tif( intersection > 0.0 ) {\n\n\t\t\t\t\t\tvec3 h = vec3( 0.0, - height, 0.0 );\n\t\t\t\t\t\tfloat intersection2 = diskIntersectWithBackFaceCulling( camPos, p, h, vec3( 0.0, 1.0, 0.0 ), radius );\n\t\t\t\t\t\tp = ( camPos + min( intersection, intersection2 ) * p ) / radius;\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tp = vec3( 0.0, 1.0, 0.0 );\n\n\t\t\t\t\t}\n\n\t\t\t\t\treturn p;\n\n\t\t\t\t}\n\n\t\t\t\t#include <common>\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvec3 projectedWorldPosition = project();\n\n\t\t\t\t\t#ifdef ENVMAP_TYPE_CUBE\n\n\t\t\t\t\t\tvec3 outcolor = textureCube( map, projectedWorldPosition ).rgb;\n\n\t\t\t\t\t#else\n\n\t\t\t\t\t\tvec3 direction = normalize( projectedWorldPosition );\n\t\t\t\t\t\tvec2 uv = equirectUv( direction );\n\t\t\t\t\t\tvec3 outcolor = texture2D( map, uv ).rgb;\n\n\t\t\t\t\t#endif\n\n\t\t\t\t\tgl_FragColor = vec4( outcolor, 1.0 );\n\n\t\t\t\t\t#include <tonemapping_fragment>\n\t\t\t\t\t#include <colorspace_fragment>\n\n\t\t\t\t}\n\t\t\t\t`;\n\n\t\tconst uniforms = {\n\t\t\tmap: { value: texture },\n\t\t\theight: { value: options.height || 15 },\n\t\t\tradius: { value: options.radius || 100 },\n\t\t};\n\n\t\tconst geometry = new IcosahedronGeometry( 1, 16 );\n\t\tconst material = new ShaderMaterial( {\n\t\t\tuniforms,\n\t\t\tfragmentShader,\n\t\t\tvertexShader,\n\t\t\tside: DoubleSide,\n\t\t} );\n\n\t\tsuper( geometry, material );\n\n\t}\n\n\tset radius( radius ) {\n\n\t\tthis.material.uniforms.radius.value = radius;\n\n\t}\n\n\tget radius() {\n\n\t\treturn this.material.uniforms.radius.value;\n\n\t}\n\n\tset height( height ) {\n\n\t\tthis.material.uniforms.height.value = height;\n\n\t}\n\n\tget height() {\n\n\t\treturn this.material.uniforms.height.value;\n\n\t}\n\n}\n\nexport { GroundProjectedSkybox };\n","export default \"static/legacy_env-d5810ec5057d4716.exr\""],"names":["TWEEN_FILE_NAME","GroundProjectedSkybox","Mesh","[object Object]","texture","options","fragmentShader","isCubeTexture","join","uniforms","map","value","height","radius","super","IcosahedronGeometry","ShaderMaterial","vertexShader","side","DoubleSide","this","material"],"mappings":"2uCAAA,ICAeA,gBAAA,gtlCCMf,MAAMC,8BAA8BC,KAEnCC,YAAaC,EAASC,EAAU,IAE/B,MAkBMC,EAhBU,CAFEF,EAAQG,cAGb,2BAA6B,IAeXC,KAAM,MAAoB,6yEAmGnDC,EAAW,CAChBC,IAAK,CAAEC,MAAOP,GACdQ,OAAQ,CAAED,MAAON,EAAQO,QAAU,IACnCC,OAAQ,CAAEF,MAAON,EAAQQ,QAAU,MAWpCC,MARiB,IAAIC,oBAAqB,EAAG,IAC5B,IAAIC,eAAgB,CACpCP,SAAAA,EACAH,eAAAA,EACAW,aAzH+B,4RA0H/BC,KAAMC,cAORN,WAAYA,GAEXO,KAAKC,SAASZ,SAASI,OAAOF,MAAQE,EAIvCA,aAEC,OAAOO,KAAKC,SAASZ,SAASI,OAAOF,MAItCC,WAAYA,GAEXQ,KAAKC,SAASZ,SAASG,OAAOD,MAAQC,EAIvCA,aAEC,OAAOQ,KAAKC,SAASZ,SAASG,OAAOD,m4LCrKxB,41BHAA"}
@@ -0,0 +1,2 @@
1
+ System.register(["./roomle-dependency-injection-2fde2714.nomodule.js","./main-thread-to-worker-a2554a6a.nomodule.js"],(function(t,e){var i,s,n,a,o,r,h,_,d,c,l,m,u,p,g,v,w,y,f,C,P,b,x,M,S,E,k,L,I,z,D,R,T,A,B,F,O,U,H,j,Z,G,N,q,W,Y,K,V,X,J,Q,$,tt,et,it,st,nt,at,ot,rt;return{setters:[function(t){i=t._,s=t.i,n=t.E,a=t.t,o=t.Q,r=t.T,h=t.U,_=t.w,d=t.y,c=t.V,l=t.X,m=t.Y,u=t.Z,p=t.$,g=t.a0,v=t.a1,w=t.a2,y=t.e,f=t.a3,C=t.a4,P=t.s,b=t.p,x=t.x,M=t.a5},function(t){S=t.a,E=t.bz,k=t.J,L=t.V,I=t.bA,z=t.ab,D=t.aa,R=t.ae,T=t.Q,A=t.ak,B=t.O,F=t.x,O=t.bB,U=t.bC,H=t.bD,j=t.k,Z=t.bE,G=t.C,N=t.p,q=t.u,W=t.N,Y=t.K,K=t.aA,V=t.S,X=t.A,J=t.D,Q=t.R,$=t.bF,tt=t.aT,et=t.f,it=t.bn,st=t.bg,nt=t.bv,at=t.h,ot=t.bb,rt=t.bG}],execute:function(){t("T","static/Tween-d57ee5d181fce582.js");class ht extends n{constructor(t,e,i){if(super(),this._tweenEnd=null,this._cameraStandingStill=!0,this._pitch=a(10),this._yaw=a(-30),this._distance=-1,this._locked=!1,this._inputListeners=[],this._lerpEnabled=!0,this._creator_=t,this._inputManager=e,this._initInputListener(),this._addInputListeners(),this._cameraPosition=new S,this._targetPosition=new S,i?this._cameraPosition.copy(i):this._cameraPosition=new S(0,.5,3),this._initData.debug){const t=this.getDebugCameraPosition();t&&this._setCurrentCameraParameters(t)}let s=this._domHelper.getClientDimensions();this._width=s.x,this._height=s.y,this._dispatchCameraIdle=E(this._dispatchCameraIdle.bind(this),32)}getCamera(){return this._getCamera()}_addInputListeners(){this._inputListeners.forEach(t=>{this._inputManager.addEventListener(t.key,t.fun,this)})}_removeInputListeners(){this._inputListeners.forEach(t=>{this._inputManager.removeEventListener(t.key,t.fun)}),this._inputListeners=[]}cleanUp(){this._removeInputListeners()}animateCamera(t){let e=this._cameraPosition;if(!e||o(e,this.getCamera().position))return this._cameraStandingStill||(this._cameraStandingStill=!0,setTimeout(()=>this._dispatchCameraIdle(),16),this._initData.debug&&this.saveDebugCameraPosition()),!1;if(this._cameraStandingStill&&this.dispatchEvent(7,3),this._cameraStandingStill=!1,this._lerpEnabled&&!this._tweenEnd){let i=this.getCamera().position.clone();const s=Math.min(10*t,1);i.lerp(e,s),this.getCamera().position.copy(i)}else this.getCamera().position.copy(e);return!0}getDebugCameraPosition(){return JSON.parse(localStorage.getItem("debug_camera_position"))}saveDebugCameraPosition(){localStorage.setItem("debug_camera_position",JSON.stringify(this.getCurrentCameraParameters()))}_dispatchCameraIdle(){this.dispatchEvent(8,3)}_tweenCameraParameter(t,e,i=!1){return new Promise(s=>{if(e.yaw-t.yaw<=-Math.PI?t.yaw-=2*Math.PI:e.yaw-t.yaw>=Math.PI&&(t.yaw+=2*Math.PI),window.TWEEN){if(null!==this._tweenEnd&&this._tweenEnd.blockOtherTweens)return;this._tweenEnd=e,new TWEEN.Tween(t).to(e,400).easing(TWEEN.Easing.Sinusoidal.In).onUpdate(()=>{this.dispatchEvent(1,3),this._yaw=t.yaw,this._pitch=t.pitch,this._distance=t.distance,this._setCameraNear(),this._update(new S(t.targetX,t.targetY,t.targetZ),i)}).onComplete(()=>{this.dispatchEvent(2,3),this._dispatchCameraIdle(),this._tweenEnd=null,s()}).start(),this.dispatchEvent(0,3)}})}_setCameraNear(){const t=this.getCamera();if(t instanceof k){const e=Math.max(.1,this._distance/6);t.near=e}}getCurrentCameraParameters(){const t=this._targetPosition.clone();return{yaw:this._yaw,pitch:this._pitch,distance:this._distance,targetX:t.x,targetY:t.y,targetZ:t.z}}_setCurrentCameraParameters(t){this._yaw=t.yaw,this._pitch=t.pitch,this._distance=t.distance,this._targetPosition.copy(new S(t.targetX,t.targetY,t.targetZ))}_rotateHorizontal(t){this._yaw-=t,this._yaw<-Math.PI?this._yaw+=2*Math.PI:this._yaw>Math.PI&&(this._yaw-=2*Math.PI)}_rotateVertical(t){this._pitch+=t,this._pitch<-Math.PI?this._pitch+=2*Math.PI:this._pitch>Math.PI&&(this._pitch-=2*Math.PI)}saveState(t){if(t||!this._stateSaved){let t=this._yaw,e=this._pitch,i=this._distance,s=this._targetPosition.clone();if(this._stateSaved={yaw:t,pitch:e,distance:i,targetX:s.x,targetY:s.y,targetZ:s.z,blockOtherTweens:!0},this._getCamera().fov){let t=this._getCamera();this._stateSaved.fov=t.fov,this._stateSaved.near=t.near,this._stateSaved.far=t.far}return this._stateSaved}return null}resetToState(){if(this._stateSaved){this._stateSaved.blockOtherTweens=!1;let t=this._targetPosition.clone();this._tweenCameraParameter({yaw:this._yaw,pitch:this._pitch,distance:this._distance,targetX:t.x,targetY:t.y,targetZ:t.z},this._stateSaved,!0)}this._stateSaved=null}setToState(t,e){this._tweenCameraParameter(t,e,!0)}hasSavedState(){return null!=this._stateSaved}lock(){this._locked=!0}unlock(){this._locked=!1}isLocked(){return this._locked}getTargetPosition(){return this._targetPosition}_saveYawAndPitch(){this._getCamera().userData.yaw=this._yaw,this._getCamera().userData.pitch=this._pitch}getInputPosition(t){const{x:e,y:i}=this._domHelper.getClientDimensions();return new S(t.x/e*2-1,-t.y/i*2+1,.5)}addLightContainer(t){t.name="lights";const e=this._getCamera(),i=e.children.find(t=>"lights"===t.name);i&&e.remove(i),e.add(t)}checkNearFarDistance(t){if(!t)return;const e=this._cameraPosition.distanceTo(t),i=this._getCamera();i instanceof k&&e>i.far&&(i.far=e+1)}setBounds(t){this._boundingBox=t}}t("a",ht),i([s],ht.prototype,"_domHelper",void 0),i([s],ht.prototype,"_initData",void 0);class _t{constructor(t,e){this.minZoom=!1,this.maxZoom=!1,this.minZoom=t,this.maxZoom=e}}t("D",2.725);class dt extends ht{constructor(t,e,i,s){super(t,e,i),this._bounds=new S,this._scale=1,this._state=0,this._zoomSpeed=Math.pow(.95,3),this.minDistance=0,this.maxDistance=5,this.minPolarAngle=a(0),this.maxPolarAngle=a(85),this._objectRotation=0,this.minAzimuthAngle=Number.NEGATIVE_INFINITY,this.maxAzimuthAngle=Number.POSITIVE_INFINITY,this._zoomDistance=.1,this._userInteraction=!1,this._currentZoomHash="",this._maxZoomedIn=!1,this._maxZoomedOut=!1,this._panningEnabled=!1,this._targetPositionIsPanned=!1,s?this._camera=s:this._initCamera(),this._targetPosition||(this._targetPosition=new S(0,0,0),this._targetPositionIsPanned=!1);const{cameraRestriction:n,zoomDistance:o,minVerticalCameraAngle:r,maxVerticalCameraAngle:h,minHorizontalCameraAngle:_,maxHorizontalCameraAngle:d}=this._initData;if(o&&(this._zoomDistance=o/100),void 0!==r&&(this.minPolarAngle=a(r<0?r:-1*r)),void 0!==h&&(this.maxPolarAngle=a(h)),void 0!==_&&(this.minAzimuthAngle=a(_<0?_:-1*_)),void 0!==d&&(this.maxAzimuthAngle=a(d)),void 0!==n){let t=Math.abs(a(n));this.minAzimuthAngle=-t,this.maxAzimuthAngle=t,this.maxPolarAngle=Math.min(t,a(85))}this._update()}_getCamera(){return this._camera||this._initCamera(),this._camera}getCamera(){return super.getCamera()}_initCamera(){this._camera=new k,this._camera.fov=30,this._camera.aspect=this._width/this._height,this._camera.near=.1,this._camera.far=100,this._camera.updateProjectionMatrix(),this._camera.layers.set(3),this._camera.layers.enable(1),this._camera.layers.enable(2),this._camera.layers.enable(6),this._camera.layers.enable(5)}setObjectRotation(t){this._objectRotation=t}getObjectRotation(){return this._objectRotation}updateCamera(){let{x:t,y:e}=this._domHelper.getClientDimensions();this._camera.aspect=t/e,this._camera.updateProjectionMatrix()}animateCamera(t){if(!super.animateCamera(t))return!1;let e=this._targetPosition;return!!e&&(this.getCamera().lookAt(e),!0)}_initInputListener(){this._inputListeners.push({key:3,fun:()=>{this._state=1}}),this._inputListeners.push({key:6,fun:t=>{var e,i;1!==this._state||this._locked||(this._userInteraction=!0,!(void 0!==(null===(e=t.event)||void 0===e?void 0:e.shiftKey)&&(null===(i=t.event)||void 0===i?void 0:i.shiftKey))&&this._panningEnabled&&this.disablePanning(),this._move(new L(t.position.x,t.position.y),t.type))}}),this._inputListeners.push({key:11,fun:t=>{1===this._state||this._locked||(this._userInteraction=!0,this._pan(new L(t.position.x,t.position.y),t.type))}}),this._inputListeners.push({key:4,fun:t=>{1===this._state&&this.dispatchEvent(2,t.type),this._state=0,this._orbitPosition=null,this._lerpEnabled=!0}}),this._inputListeners.push({key:7,fun:({event:t})=>{this._maxZoomedIn||(t&&(t.preventDefault(),t.stopPropagation()),this.zoomIn())}}),this._inputListeners.push({key:8,fun:({event:t})=>{this._maxZoomedOut||(t&&(t.preventDefault(),t.stopPropagation()),this.zoomOut())}})}_panTargetPosition(t){const e=t.clone().sub(this._orbitPosition),i=this._domHelper.element,s=this._targetPosition.project(this._camera),n=Math.max(2,4*(1-this._distance/this.maxDistance));s.x=s.x-e.x/i.clientHeight*n,s.y=s.y+e.y/i.clientHeight*n,this._targetPositionIsPanned=!0,this._targetPosition.copy(s.unproject(this._camera))}_pan(t,e){this._lerpEnabled=!1,this._orbitPosition||(this._orbitPosition=new L(t.x,t.y),this.dispatchEvent(0,e)),this._panTargetPosition(t),r(this._orbitPosition,t)||this.dispatchEvent(1,e),this._orbitPosition.copy(t),this._update()}_move(t,e){this._orbitPosition||(this._orbitPosition=new L(t.x,t.y),this.dispatchEvent(0,e));const i=t.clone().sub(this._orbitPosition),s=this._domHelper.element;this._panningEnabled?this._panTargetPosition(t):(this._rotateHorizontal(2*Math.PI*i.x/s.clientWidth*1),this._rotateVertical(2*Math.PI*i.y/s.clientHeight*1)),r(this._orbitPosition,t)||this.dispatchEvent(1,e),this._orbitPosition.copy(t),this._update()}checkBoundsAndPlaceCamera(t,e=!0){this._boundingBox&&h(t,this._boundingBox)<=0?this.setBounds(t):this.zoomToFitBounds(t,e)}zoomToFitBounds(t,e=!0){this.setBounds(t);const i=t.getSize(new S);if(this._initData.debug||i.x+i.y+i.z===0)return;const s=this.getCurrentCameraParameters(),n=t.getCenter(new S),a=this._setDistanceAndRangesBasedOnBounds(i);this._checkZoomDistance(t,a);const o={yaw:e?this._yaw:s.yaw,pitch:e?this._pitch:s.pitch,distance:a,targetX:n.x,targetY:n.y,targetZ:n.z};I(s,o)||this._tweenCameraParameter(s,o,!1)}updateToBounds(t,e,i=!0,s){if(this.setBounds(t),this._initData.debug)return;const n=t.getCenter(new S);s?(this._targetPosition=s.clone(),this._targetPositionIsPanned=!1):this._targetPositionIsPanned||(this._targetPosition=new S(n.x,n.y,n.z));const a=this.getCurrentCameraParameters(),o=t.getSize(new S);if(i){const i=this._setDistanceAndRangesBasedOnBounds(o);this._distance=i,this._checkZoomDistance(t,i),this._userInteraction?this._tweenCameraParameter(a,{yaw:this._yaw,pitch:this._pitch,distance:this._distance,targetX:this._targetPosition.x,targetY:this._targetPosition.y,targetZ:this._targetPosition.z},e):this._update()}else this._setDistanceAndRangesBasedOnBounds(o,!1);this._update()}_checkZoomDistance(t,e){const i=t.getBoundingSphere(new z);e-i.radius<this._zoomDistance&&(console.warn("the initial camera position is closer than the zoomDistance param, zoomDistance is set to initial camera position."),this._zoomDistance=e-i.radius)}_setDistanceAndRangesBasedOnBounds(t,e=!0){const{offsetWidth:i,offsetHeight:s}=this._getOffset();this._bounds.copy(t);const{cameraSpacing:n}=this._initData;t.addScalar(n/100),this.minDistance=Math.sqrt(t.x*t.x+t.y*t.y+t.z*t.z);const a=Math.max(t.x,t.y),{x:o,y:r}=this._getMargin(i,s),h=_(t.x+o,t.y+r,t.z,this._camera.fov,i,s);return this._distance<h&&e&&(this._distance=h),this.maxDistance=h+a,this.maxDistance<2&&(this.maxDistance=2),this._camera.far=5*this.maxDistance,this._setCameraNear(),h}_getIdealDistance(){const{offsetWidth:t,offsetHeight:e}=this._getOffset(),{x:i,y:s}=this._getMargin(t,e);return _(this._bounds.x+i,this._bounds.y+s,this._bounds.z,this._camera.fov,t,e)}_getOffset(){const t=this._domHelper.getClientDimensions(),e=t.x,i=t.y;return{offsetWidth:this._camera.offset?e-e*this._camera.offset.left-e*(1-this._camera.offset.right):e,offsetHeight:this._camera.offset?i-i*this._camera.offset.bottom-i*(1-this._camera.offset.top):i}}_getMargin(t,e){let i=this._bounds.x/2,s=this._bounds.y/2;return t>1080&&(i+=this._bounds.x<.3?.2:0,i+=this._bounds.x*(t/1080-1)),e>1080&&(i+=this._bounds.y<.3?.2:0,s+=this._bounds.y*(e/1080-1)),{x:i,y:s}}reset(t,e,i,s,n=!0){const o=t.getSize(new S);if(o){if(e)this._targetPosition.copy(e);else{const e=t.getCenter(new S);this._targetPosition.copy(e)}const r=this.getCurrentCameraParameters();if(i||(i=-30),s||(s=10),i+=d(this._objectRotation),this._initData.debug)return this._distance=this._setDistanceAndRangesBasedOnBounds(o),this._update(this._targetPosition),void this._setDistanceAndRangesBasedOnBounds(o);const h=this._setDistanceAndRangesBasedOnBounds(o),_=a(s),c=a(i);let l=this._targetPosition.clone();n?this._tweenCameraParameter(r,{yaw:c,pitch:_,distance:h,targetX:l.x,targetY:l.y,targetZ:l.z},!0):(this._pitch=_,this._yaw=c,this._distance=h,this._update(this._targetPosition))}else console.warn("you cant reset without bounds!")}updateAndReset(t,e,i,s,n,o=!0){const r=new S(-t.x/2,0,-t.z/2),h=new S(t.x/2,t.y,t.z/2);if(this._boundingBox=new D(r,h),n&&t.addScalar(n),e?this._targetPosition.copy(e):(this._targetPosition=new S(0,t.y/2,0),this._targetPositionIsPanned=!1),-1===this._distance){const e=this._setDistanceAndRangesBasedOnBounds(t);this._distance=Math.max(2,e)}const _=this.getCurrentCameraParameters();i||(i=-30),s||(s=10),i+=d(this._objectRotation),this._pitch=a(s),this._yaw=a(i),this._setDistanceAndRangesBasedOnBounds(t);let c=this._targetPosition.clone();o?this._tweenCameraParameter(_,{yaw:this._yaw,pitch:this._pitch,distance:this.maxDistance,targetX:c.x,targetY:c.y,targetZ:c.z},!0):this._update(this._targetPosition)}_update(t,e){this._initData.debug?this._pitch=Math.max(a(-89),Math.min(a(89),this._pitch)):(this._yaw=Math.max(this.minAzimuthAngle,Math.min(this.maxAzimuthAngle,this._yaw)),this._pitch=Math.max(this.minPolarAngle,Math.min(this.maxPolarAngle,this._pitch))),this._saveYawAndPitch();const i=new R(-this._pitch,this._yaw,0,"ZYX"),s=(new T).setFromEuler(i),n=new S(0,0,-1);n.applyQuaternion(s),this._distance*=this._scale,this._initData.debug||(this._distance=Math.min(this.maxDistance,this._distance)),t&&this._targetPosition.copy(t);const o=this._targetPosition.clone().sub(n.multiplyScalar(this._distance));if(this._initData.debug)this._cameraPosition.copy(o),this._zoomChanged(!1,!1);else if(e)this._cameraPosition.copy(o);else{const t=this._getCameraSphere(o);null!=this._boundingBox&&this._boundingBox.intersectsSphere(t)&&this._scale>=1?this._distance+=.1:null==this._boundingBox||this._boundingBox.intersectsSphere(t)?this._zoomChanged(!1,!0):(this._cameraPosition.copy(o),this._distance===this.maxDistance?this._zoomChanged(!0,!1):this._zoomChanged(!1,!1))}this._scale=1}_zoomChanged(t,e){let i=t+""+e;0===this._currentZoomHash.length||this._currentZoomHash!==i?(this.dispatchEvent(5,new _t(t,e)),this._currentZoomHash=i):t||e||this.dispatchEvent(5,new _t(t,e)),this._maxZoomedIn=e,this._maxZoomedOut=t}zoomTo(t){return this._tweenCameraParameter(this.getCurrentCameraParameters(),t,!0)}_getCameraSphere(t){const e=Math.max(this._bounds.x,this._bounds.y),i=Math.max(e/10,this._zoomDistance);return new z(t,i)}zoomIn(t){this._lerpEnabled=!0,this._scale*=t?Math.pow(.95,t):this._zoomSpeed,this._setCameraNear(),this._update(),this.dispatchEvent(3)}zoomOut(t){this._lerpEnabled=!0,this._scale/=t?Math.pow(.95,t):this._zoomSpeed,this._setCameraNear(),this._update(),this.dispatchEvent(4)}clear(){this._userInteraction=!1,this._initData.debug||(this._distance=-1,this._targetPosition=new S(0,0,0),this._targetPositionIsPanned=!1)}async moveCamera(t){const{x:e,y:i,z:s}=this._boundingBox.getCenter(new S);t.targetX=t.targetX||e,t.targetY=t.targetY||i,t.targetZ=t.targetZ||s,t.distance=t.distance||this._getIdealDistance();const n=this.getCurrentCameraParameters(),a=A(JSON.parse(JSON.stringify(n)),t);return this._tweenCameraParameter(n,a,!0)}enablePanning(){this._lerpEnabled=!1,this._panningEnabled=!0}disablePanning(){this._lerpEnabled=!1,this._panningEnabled=!1}getKernelZoomFactor(){const t=this.maxDistance;return 1-this._distance/(t-2)+.2}}t("C",dt);class ct{constructor(t,e){this._scene=t,e&&(e.removeFromScene(),e.cleanUp())}updateCamera(t){}reload(){this.removeFromScene(),this.addToScene()}updateBounds(t,e){this._bounds=t}cleanUp(){this._scene=null}}class lt{constructor(t){this._innerSize=1,this._outerSize=100,this._plane=new B,this._plane.rotation.x=-Math.PI/2;const e=c.createMeshStandardMaterial({});this._innerPlaneMesh=new F,this._innerPlaneMesh.layers.set(2),this._innerPlaneMesh.material=e,this._innerPlaneMesh.receiveShadow=!0,this._outerPlaneMesh=new F,this._outerPlaneMesh.layers.set(2),this._outerPlaneMesh.material=e,this._outerPlaneMesh.receiveShadow=!0,this._plane.add(this._innerPlaneMesh),this._plane.add(this._outerPlaneMesh),this._innerSize=1,this._outerSize=t,this._updatePlane(this._innerSize,this._outerSize)}getRootNode(){return this._plane}getInnerPlane(){return this._innerPlaneMesh}getOuterPlane(){return this._outerPlaneMesh}updateSize(t){this._innerSize=t,this._updatePlane(this._innerSize,this._outerSize)}_updatePlane(t,e){const i=new O;i.moveTo(-t/2,-t/2),i.lineTo(-t/2,t/2),i.lineTo(t/2,t/2),i.lineTo(t/2,-t/2),i.lineTo(-t/2,-t/2);const s=new O;s.moveTo(-e/2,-e/2),s.lineTo(-e/2,e/2),s.lineTo(e/2,e/2),s.lineTo(e/2,-e/2),s.lineTo(-e/2,-e/2);const n=new U;n.moveTo(-t/2,-t/2),n.lineTo(-t/2,t/2),n.lineTo(t/2,t/2),n.lineTo(t/2,-t/2),n.lineTo(-t/2,-t/2),s.holes.push(n);const a=new H(i);this._innerPlaneMesh.geometry&&this._innerPlaneMesh.geometry.dispose(),this._innerPlaneMesh.geometry=a;const o=new H(s);this._outerPlaneMesh.geometry&&this._outerPlaneMesh.geometry.dispose(),this._outerPlaneMesh.geometry=o;const r=a.attributes.uv.clone();a.setAttribute("uv2",r);const h=a.attributes.uv2.array;for(let t=0;t<h.length;++t)h[t]+=.5}}class mt extends ct{constructor(t,e,i){super(t,e),this._longestSide=2,this._bakedShadowPlane=new lt(100),this._fog=i||!1,this._textureLoader=new j,this.addToScene()}needsBounds(){return!0}needsCamera(){return this._fog}needsRotation(){return!1}updateBounds(t){return super.updateBounds(t),this._longestSide=Math.max(t.x,t.z),this._update(),!0}updateCamera(t){this._cameraDistance=t.position.distanceTo(new S(0,0,0)),this._update()}_update(){this._fog&&this._updateFog()}_updateFog(){let t=this._longestSide/2;this._scene.fog=new Z(16185078,this._cameraDistance+t+3,this._cameraDistance+t+3+1),this._scene.background=new G(16185078)}_updateFloor(){if(this._floorMaterial)this._bakedShadowPlane.getOuterPlane().material=this._floorMaterial,this._bakedShadowPlane.getInnerPlane().material=this._floorMaterial;else{let t=this._width/1e3,e=this._height/1e3;this._repeatable&&(this._floorTexture.wrapS=N,this._floorTexture.wrapT=N,this._floorTexture.repeat.set(100/t,100/e));let i=c.createMeshStandardMaterial({map:this._floorTexture,side:q});this._bakedShadowPlane.getInnerPlane().material=i,this._bakedShadowPlane.getOuterPlane().material=i}}addToScene(){this._scene&&this._scene.add(this._bakedShadowPlane.getRootNode())}removeFromScene(){this._scene.remove(this._bakedShadowPlane.getRootNode())}setFloorMaterial(t,e,i,s){return this._width=e,this._height=i,this._repeatable=s,this._floorPromise=new Promise((e,i)=>{this._textureLoader.load(t,t=>{this._floorTexture=t,e()},null,i)}),new Promise((t,e)=>{this._floorPromise.then(()=>{this._updateFloor(),this._update(),t()},e)})}changeFloorMaterial(t,e,i){this._floorPromise=new Promise((s,n)=>{this._floorMaterial=l(t,i),this._rapiAccess.getTexturesOf(t).then(t=>{if(t.length>0){let i=[];t.forEach(t=>{i.push(m(this._dataSyncer.requestAsset(t.image,!0),t,this._floorMaterial,e,1,1))}),Promise.all(i).then(()=>{setTimeout(()=>s(),0)},n)}else setTimeout(()=>s(),0)})});let s=[this._floorPromise];return new Promise((t,e)=>{Promise.all(s).then(()=>{this._updateFloor(),this._update(),t()},e)})}showGUI(){this._floorMaterial?this._addGUI():this._floorPromise&&this._floorPromise.then(()=>this._addGUI())}_addGUI(){let t=u();if(!t)return;let e=t.addFolder("Floor");e.add(this._floorMaterial,"roughness").min(0).max(1).step(.01),e.add(this._floorMaterial,"reflectivity").min(0).max(1).step(.01),e.add(this._floorMaterial,"clearCoat").min(0).max(1).step(.01),e.add(this._floorMaterial,"clearCoatRoughness").min(0).max(1).step(.01),e.add(this._floorMaterial,"opacity").min(0).max(1).step(.01),e.add(this._floorMaterial,"metalness").min(0).max(1).step(.01),e.add(this._floorMaterial,"bumpScale").min(0).max(1).step(.01)}}t("F",mt),i([s],mt.prototype,"_rapiAccess",void 0),i([s],mt.prototype,"_dataSyncer",void 0);class ut extends ht{constructor(t,e,i,s){super(t,e,i),this._scale=1,this._cameraZoom=1,this._state=0,this._size=5,this._lastPosition=new L,this._zoomPosition=new S,this._lastZoom=0,this._zoomSpeed=Math.pow(.95,2),s?(this._camera=s,this._cameraPosition=(new S).copy(this._camera.position)):this._initCamera(i||new S(0,10,0))}_getCamera(){return this._camera||this._initCamera(new S(0,10,0)),this._camera}_initCamera(t){let{x:e,y:i}=this._domHelper.getClientDimensions(),s=e/i*this._size,n=this._size;this._camera=new W(s/-2,s/2,n/2,n/-2,1,1e3),this._camera.position.copy(t),this._cameraPosition=t,this._camera.lookAt(new S(0,0,0))}updateCamera(){let{x:t,y:e}=this._domHelper.getClientDimensions(),i=t/e*this._size,s=this._size;this._camera.left=i/-2,this._camera.right=i/2,this._camera.top=s/2,this._camera.bottom=s/-2,this._camera.updateProjectionMatrix()}_initInputListener(){this._inputListeners.push({key:3,fun:t=>{this._locked||(this._state=1,this._lastPosition.set(t.positionRelative.x,t.positionRelative.y),this.dispatchEvent(0))}}),this._inputListeners.push({key:6,fun:t=>{1!==this._state||this._locked||(this._move(new L(t.positionRelative.x,t.positionRelative.y),t.type),this.dispatchEvent(1))}}),this._inputListeners.push({key:4,fun:t=>{1===this._state&&this.dispatchEvent(2),this._state=0}}),this._inputListeners.push({key:7,fun:t=>{t.event&&(t.event.stopPropagation(),t.event.preventDefault()),this.dispatchEvent(3),this._scale/=this._zoomSpeed,this._zoomTo(t.positionRelative),this._update()}}),this._inputListeners.push({key:8,fun:t=>{t.event&&(t.event.stopPropagation(),t.event.preventDefault()),this.dispatchEvent(4),this._scale*=this._zoomSpeed,this._zoomTo(t.positionRelative),this._update()}})}_zoomTo(t){if(Date.now()-this._lastZoom>200){let e=new S(t.x,t.y,0);e.unproject(this._camera),this._zoomPosition.copy(e)}this._lastZoom=Date.now()}_move(t,e){let i=new S,s=new S(this._lastPosition.x,this._lastPosition.y,0),n=new S(t.x,t.y,0);s.unproject(this._camera),n.unproject(this._camera),i.subVectors(n,s),this._cameraPosition.x-=i.x*(2===e?1.1:1),this._cameraPosition.z-=i.z*(2===e?1.1:1),this._lastPosition.copy(t)}zoomToFitBounds(t,e,i){if(h(t,this._boundingBox)<0&&!i)return void this.setBounds(t);this.setBounds(t);const s=t.getSize(new S),n=t.getCenter(new S),a=s.x/-2/this._camera.left,o=s.z/-2/this._camera.bottom,r=1/Math.max(a,o);(r<this._cameraZoom||e)&&(this._scale=r,this._cameraZoom=r,this._cameraPosition.x=n.x,this._cameraPosition.z=n.z)}_update(t){this._scale=Math.min(this._scale,5),this._scale=Math.max(this._scale,.1);let e=(new S).subVectors(this._zoomPosition,this._cameraPosition).multiplyScalar((this._scale-this._cameraZoom)/this._scale);this._cameraPosition.x+=e.x,this._cameraPosition.z+=e.z,this._cameraZoom!==this._scale&&this.dispatchEvent(5,new _t(.1===this._scale,5===this._scale)),this._cameraZoom=this._scale,this._camera.updateProjectionMatrix()}animateCamera(t){if(!super.animateCamera(t)&&Math.abs(this._cameraZoom-this._camera.zoom)<=.01)return!1;const e=Math.min(10*t,1);return this._camera.zoom=Y.lerp(this._camera.zoom,this._cameraZoom,e),!0}getKernelZoomFactor(){const t=1e3*(this._camera.right-this._camera.left);return this._domHelper.element.clientWidth/t*this._camera.zoom}}t("b",ut);const pt=Math.PI/4;class gt extends ht{constructor(t,e,i,s){super(t,e,i),this._state=0,this._rotationSpeed=1,this._keyMap=new Map,this.minPolarAngle=a(-60),this.maxPolarAngle=a(60),this._camera=s||new k,this._camera.fov=70,this._camera.aspect=this._width/this._height,this._camera.near=.1,this._camera.far=100,this._camera.updateProjectionMatrix(),this._camera.layers.set(3),this._camera.layers.enable(1),this._camera.layers.enable(2),this._camera.layers.enable(6),this._camera.layers.enable(5),i?this._camera.position.set(i.x,1.5,i.z):this._camera.position.set(0,1.5,0),this._cameraPosition=new S,this._cameraPosition.copy(this._camera.position),this._cameraRotation=new T,this._pitch=0,this._yaw=0;let n=new R(-this._pitch,this._yaw,0,"ZYX");this._cameraRotation.setFromEuler(n),window.addEventListener("gamepadconnected",this._gamepadConnected.bind(this)),window.addEventListener("gamepaddisconnected",this._gamepadDisconnected.bind(this))}_gamepadConnected(t){this.startButtonPressListener()}_gamepadDisconnected(t){window.cancelAnimationFrame(this._listenerLoopAnimationFrame)}startButtonPressListener(){this._listenerLoopAnimationFrame=window.requestAnimationFrame(()=>{this.buttonPressListener()})}buttonPressListener(){let t=navigator.getGamepads()[0];this._checkRightStick(t),this._checkLeftStick(t),this._checkButtons(t),this._processKeyMap(this._keyMap,.001),this.startButtonPressListener()}_checkRightStick(t){let e=t.axes[2],i=t.axes[3];Math.abs(e)>.2&&(this._rotateHorizontal(.01*pt*e),this._update(),this.dispatchEvent(1)),Math.abs(i)>.2&&(this._rotateVertical(.01*pt*i),this._update(),this.dispatchEvent(1))}_checkLeftStick(t){let e=t.axes[0],i=t.axes[1];Math.abs(i)>.2?i<0?this._keyMap.set(87,!0):this._keyMap.set(83,!0):t.buttons&&t.buttons[12]&&t.buttons[12].pressed?this._keyMap.set(87,!0):t.buttons&&t.buttons[13]&&t.buttons[13].pressed?this._keyMap.set(83,!0):(this._keyMap.set(87,!1),this._keyMap.set(83,!1)),Math.abs(e)>.2?e<0?this._keyMap.set(65,!0):this._keyMap.set(68,!0):(this._keyMap.set(65,!1),this._keyMap.set(68,!1))}_checkButtons(t){t.buttons&&t.buttons[6]&&t.buttons[6].pressed?this._keyMap.set(16,!0):this._keyMap.set(16,!1),t.buttons&&t.buttons[14]&&t.buttons[14].pressed?(this._keyMap.set(37,!0),this.dispatchEvent(1)):this._keyMap.set(37,!1),t.buttons&&t.buttons[15]&&t.buttons[15].pressed?(this._keyMap.set(39,!0),this.dispatchEvent(1)):this._keyMap.set(39,!1)}animateCamera(t){let e=this._cameraPosition,i=this._cameraRotation,s=this.getCamera(),n=o(e,s.position),a=p(i,s.quaternion);if(!e||n&&a)return!1;let r=this.getCamera().position.clone(),h=Math.min(10*t,1);r.lerp(e,h),this.getCamera().position.copy(r);let _=this.getCamera().quaternion.clone(),d=Math.min(5*t,1);_.slerp(i,d),this.getCamera().setRotationFromQuaternion(_);let c=!1;return this._keyMap.forEach(t=>{t&&(c=!0)}),c&&this._processKeyMap(this._keyMap,t),!0}_getCamera(){return this._camera}_initInputListener(){window.addEventListener("keyup",this._onKeyChanged.bind(this),!1),window.addEventListener("keydown",this._onKeyChanged.bind(this),!1),this._inputListeners.push({key:3,fun:t=>{this._down(t)}}),this._inputListeners.push({key:6,fun:t=>{this._move(t)}}),this._inputListeners.push({key:4,fun:t=>{this._up(t)}})}_down(t){this._downPosition=t.position,this._position=t.position,this._state=1,2===t.type&&window.setTimeout(this._onLongDown.bind(this),350),2===t.type?this._rotationSpeed=.6:this._rotationSpeed=1}_move(t){this._position=t.position,1!==this._state||this._locked||this._orbit(new L(t.position.x,t.position.y)),2!==this._state||this._locked||(this._orbit(new L(t.position.x,t.position.y)),this._moveForward())}_up(t){1===this._state&&this.dispatchEvent(2),2===this._state&&this._keyMap.set(87,!1),this._state=0,this._orbitPosition=null}_onLongDown(){g(this._downPosition,this._position)<v&&1===this._state&&(this._state=2,this._orbit(new L(this._position.x,this._position.y)),this._moveForward())}_update(t){let e=new R(-this._pitch,this._yaw,0,"ZYX");this._cameraRotation.setFromEuler(e)}updateCamera(){let{x:t,y:e}=this._domHelper.getClientDimensions();this._camera.aspect=t/e,this._camera.updateProjectionMatrix()}_onKeyChanged(t){this._keyMap.set(t.keyCode,"keydown"===t.type),this.dispatchEvent(6),this._processKeyMap(this._keyMap,.001)&&t.preventDefault()}_processKeyMap(t,e){e=Math.min(e,.1);let i=new S(0,0,0),s=!1;return this._processUpDown(t,i,e),t.get(65)&&(i.x=-1*e),t.get(68)&&(i.x=1*e),t.get(37)&&(this._rotateHorizontal(-pt*this._rotationSpeed*e),s=!0),t.get(39)&&(this._rotateHorizontal(pt*this._rotationSpeed*e),s=!0),t.get(16)&&(i.x*=3,i.z*=3),!(0===i.x&&0===i.y&&0===i.z&&!s||(i.applyQuaternion(this.getCamera().quaternion),this._cameraPosition.add(new S(i.x,0,i.z)),this._update(),0))}_processUpDown(t,e,i){(t.get(87)||t.get(38))&&(e.z=-1*i),(t.get(83)||t.get(40))&&(e.z=1*i)}_orbit(t){this._orbitPosition||(this._orbitPosition=new L(t.x,t.y),this.dispatchEvent(0));let e=t.clone().sub(this._orbitPosition),i=this._domHelper.element instanceof Document?this._domHelper.element.body:this._domHelper.element;e.multiplyScalar(-1),this._rotateHorizontal(2*Math.PI*e.x/i.clientWidth*1),this._rotateVertical(2*Math.PI*e.y/i.clientHeight*1),r(this._orbitPosition,t)||this.dispatchEvent(1),this._orbitPosition.copy(t),this._update()}_moveForward(){this._keyMap.set(87,!0),this._processKeyMap(this._keyMap,.001)}_rotateVertical(t){let e=this._pitch+t;e>this.maxPolarAngle||e<this.minPolarAngle||(this._pitch=e,this._pitch<-Math.PI?this._pitch+=2*Math.PI:this._pitch>Math.PI&&(this._pitch-=2*Math.PI),this._saveYawAndPitch())}getKernelZoomFactor(){return this._camera.zoom}}t("c",gt);class vt extends ct{constructor(t,e,i,s,n){if(super(t,e),this._color=i,this._oldBackground=t.background,s&&n){this._canvas=s,this._style=document.createElement("style");let t='background-image: url("'+n+'"); background-size: cover;';this._style.innerText=".rml-scene-background {"+t+"}",this._canvas.appendChild(this._style)}}needsBounds(){return!0}needsCamera(){return!1}needsRotation(){return!1}addToScene(){this._scene&&this._color&&(this._scene.background=this._color),this._canvas&&this._canvas.classList&&(this._scene.background=null,this._canvas.classList.add("rml-scene-background"))}removeFromScene(){this._oldBackground&&(this._scene.background=this._oldBackground),this._canvas&&this._canvas.classList.remove("rml-scene-background")}showGUI(){}}t("B",vt);class wt{parse(t,e,i,s,n,a){let o=JSON.parse(s);return o.environment?this.load(t,e,i,o,n,a):null}load(t,e,i,s,n,a){let o,r=s.environment;if(!r)return console.warn("No environment set in scene settings"),Promise.resolve(null);switch(r.type){case"color":o=new Promise(e=>e(new vt(t,i,new G(r.details.color))));break;case"image":o=new Promise(s=>s(new vt(t,i,null,e,r.details.imageUrl)));break;case"floor":o=new Promise(e=>{this._rapiAccess.getMaterial(r.details.material).then(s=>{let o=void 0===r.details.fog||r.details.fog,h=new mt(t,i,o);h.changeFloorMaterial(s,n,a).then(()=>{e(h)})})});break;default:console.warn("Could not load environment, return old environment"),o=new Promise(t=>t(i))}return o}}i([s],wt.prototype,"_rapiAccess",void 0);class yt{constructor(t,e){this._scene=t,e&&e.removeFromScene()}needsBounds(){return!1}updateBounds(t){}getCameraContainer(){return this._cameraContainer||(this._cameraContainer=new B),this._cameraContainer}}t("L",yt);class ft extends yt{constructor(t,e){super(t,e),this._lights=[]}needsBounds(){return!0}updateBounds(t){if(this._cameraLight){const e=this._cameraLight,i=new S;t.getSize(i);const s=1.5*Math.max(Math.max(i.x,i.y),i.z);this._boundingSize=s,e.shadow.camera.top=s/2,e.shadow.camera.bottom=-s/2,e.shadow.camera.left=-s/2,e.shadow.camera.right=s/2,e.shadow.camera.updateProjectionMatrix()}}loadFromJSON(t){return new Promise(e=>{this._lights=this._dynamicLightSettingLoader.parse(t),this.addToScene(),e()})}loadFromObject(t){return new Promise(e=>{(null==t?void 0:t.lights)||e(),this._lights=this._dynamicLightSettingLoader.load(t),this._lights.forEach((t,e)=>{t.userData.movesWithCamera&&(this._cameraLight=t,this._lights.splice(e,1))}),this.addToScene(),e()})}loadFromURL(t){return new Promise((e,i)=>{fetch(new Request(t,{method:"GET"})).then(K).then(t=>this.loadFromObject(t).then(e,i))})}addToScene(){this._lights.forEach(t=>{this._scene.add(t)}),this._cameraLight&&this._scene.add(this._cameraLight)}update(t,e){if(!this._cameraLight)return;let i=new S;t.getWorldDirection(i),i.multiplyScalar(-this._boundingSize);let s=e.clone().add(i);this._cameraLight.position.copy(s)}removeFromScene(){this._lights.forEach(t=>{this._scene.remove(t)}),this._cameraLight&&this._scene.remove(this._cameraLight)}reload(){this.removeFromScene(),this.addToScene()}showGUI(){let t=u();this._cameraLight&&this._addToGUI(t,this._cameraLight),this._lights.forEach(e=>{this._addToGUI(t,e)})}_addToGUI(t,e){t&&(e instanceof V&&this._addSpotLightToGUI(t,e),e instanceof X&&this._addAmbientLightToGUI(t,e),e instanceof J&&this._addDirectionalLightToGUI(t,e),e instanceof Q&&this._addRectAreaLightToGUI(t,e))}_addRectAreaLightToGUI(t,e){let i=t.addFolder(e.name),s={name:e.name,color:"#"+e.color.getHexString(),intensity:e.intensity*(e.width*e.height)};i.add(e,"visible"),i.add(s,"intensity").min(10).max(400).step(10).onChange(t=>{e.intensity=t/(e.width*e.height)}),i.add(e,"castShadow"),i.addColor(s,"color").onChange(t=>{e.color=new G(t)}),i.add(e.position,"x").min(-10).max(10).step(.1).onChange(()=>{e.lookAt(new S(0,0,0))}),i.add(e.position,"y").min(-10).max(10).step(.1).onChange(()=>{e.lookAt(new S(0,0,0))}),i.add(e.position,"z").min(-10).max(10).step(.1).onChange(()=>{e.lookAt(new S(0,0,0))})}_addSpotLightToGUI(t,e){let i=t.addFolder(e.name),s={name:e.name,color:"#"+e.color.getHexString(),angle:180*e.angle/Math.PI};i.add(e,"visible"),i.add(e,"intensity").min(0).max(5).step(.1),i.add(e,"penumbra").min(0).max(1).step(.1),i.addColor(s,"color").onChange(t=>{e.color=new G(t)}),i.add(s,"angle").min(10).max(180).step(1).onChange(t=>{e.angle=t*Math.PI/180}),i.add(e.position,"x").min(-10).max(10).step(.1).onChange(()=>{e.lookAt(new S(0,0,0))}),i.add(e.position,"y").min(-10).max(10).step(.1).onChange(()=>{e.lookAt(new S(0,0,0))}),i.add(e.position,"z").min(-10).max(10).step(.1).onChange(()=>{e.lookAt(new S(0,0,0))})}_addAmbientLightToGUI(t,e){let i={name:e.name,color:"#"+e.color.getHexString()},s=t.addFolder(e.name);s.add(e,"visible"),s.add(e,"intensity").min(0).max(5).step(.1),s.addColor(i,"color").onChange(t=>{e.color=new G(t)})}_addDirectionalLightToGUI(t,e){let i=t.addFolder(e.name),s={name:e.name,color:"#"+e.color.getHexString()};i.add(e,"visible"),i.add(e,"intensity").min(0).max(5).step(.1),i.addColor(s,"color").onChange(t=>{e.color=new G(t)}),i.add(e,"castShadow"),i.add(e.position,"x").min(-10).max(10).step(.1).onChange(()=>{e.lookAt(new S(0,0,0))}),i.add(e.position,"y").min(-10).max(10).step(.1).onChange(()=>{e.lookAt(new S(0,0,0))}),i.add(e.position,"z").min(-10).max(10).step(.1).onChange(()=>{e.lookAt(new S(0,0,0))})}}i([s],ft.prototype,"_dynamicLightSettingLoader",void 0);class Ct extends F{constructor(t,e={}){const i=[t.isCubeTexture?"#define ENVMAP_TYPE_CUBE":""].join("\n")+"\n\n\t\t\t\tvarying vec3 vWorldPosition;\n\n\t\t\t\tuniform float radius;\n\t\t\t\tuniform float height;\n\t\t\t\tuniform float angle;\n\n\t\t\t\t#ifdef ENVMAP_TYPE_CUBE\n\n\t\t\t\t\tuniform samplerCube map;\n\n\t\t\t\t#else\n\n\t\t\t\t\tuniform sampler2D map;\n\n\t\t\t\t#endif\n\n\t\t\t\t// From: https://www.shadertoy.com/view/4tsBD7\n\t\t\t\tfloat diskIntersectWithBackFaceCulling( vec3 ro, vec3 rd, vec3 c, vec3 n, float r ) \n\t\t\t\t{\n\n\t\t\t\t\tfloat d = dot ( rd, n );\n\n\t\t\t\t\tif( d > 0.0 ) { return 1e6; }\n\n\t\t\t\t\tvec3 o = ro - c;\n\t\t\t\t\tfloat t = - dot( n, o ) / d;\n\t\t\t\t\tvec3 q = o + rd * t;\n\n\t\t\t\t\treturn ( dot( q, q ) < r * r ) ? t : 1e6;\n\n\t\t\t\t}\n\n\t\t\t\t// From: https://www.iquilezles.org/www/articles/intersectors/intersectors.htm\n\t\t\t\tfloat sphereIntersect( vec3 ro, vec3 rd, vec3 ce, float ra ) {\n\n\t\t\t\t\tvec3 oc = ro - ce;\n\t\t\t\t\tfloat b = dot( oc, rd );\n\t\t\t\t\tfloat c = dot( oc, oc ) - ra * ra;\n\t\t\t\t\tfloat h = b * b - c;\n\n\t\t\t\t\tif( h < 0.0 ) { return -1.0; }\n\n\t\t\t\t\th = sqrt( h );\n\n\t\t\t\t\treturn - b + h;\n\n\t\t\t\t}\n\n\t\t\t\tvec3 project() {\n\n\t\t\t\t\tvec3 p = normalize( vWorldPosition );\n\t\t\t\t\tvec3 camPos = cameraPosition;\n\t\t\t\t\tcamPos.y -= height;\n\n\t\t\t\t\tfloat intersection = sphereIntersect( camPos, p, vec3( 0.0 ), radius );\n\t\t\t\t\tif( intersection > 0.0 ) {\n\n\t\t\t\t\t\tvec3 h = vec3( 0.0, - height, 0.0 );\n\t\t\t\t\t\tfloat intersection2 = diskIntersectWithBackFaceCulling( camPos, p, h, vec3( 0.0, 1.0, 0.0 ), radius );\n\t\t\t\t\t\tp = ( camPos + min( intersection, intersection2 ) * p ) / radius;\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tp = vec3( 0.0, 1.0, 0.0 );\n\n\t\t\t\t\t}\n\n\t\t\t\t\treturn p;\n\n\t\t\t\t}\n\n\t\t\t\t#include <common>\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvec3 projectedWorldPosition = project();\n\n\t\t\t\t\t#ifdef ENVMAP_TYPE_CUBE\n\n\t\t\t\t\t\tvec3 outcolor = textureCube( map, projectedWorldPosition ).rgb;\n\n\t\t\t\t\t#else\n\n\t\t\t\t\t\tvec3 direction = normalize( projectedWorldPosition );\n\t\t\t\t\t\tvec2 uv = equirectUv( direction );\n\t\t\t\t\t\tvec3 outcolor = texture2D( map, uv ).rgb;\n\n\t\t\t\t\t#endif\n\n\t\t\t\t\tgl_FragColor = vec4( outcolor, 1.0 );\n\n\t\t\t\t\t#include <tonemapping_fragment>\n\t\t\t\t\t#include <colorspace_fragment>\n\n\t\t\t\t}\n\t\t\t\t",s={map:{value:t},height:{value:e.height||15},radius:{value:e.radius||100}};super(new $(1,16),new tt({uniforms:s,fragmentShader:i,vertexShader:"\n\t\t\tvarying vec3 vWorldPosition;\n\n\t\t\tvoid main() {\n\n\t\t\t\tvec4 worldPosition = ( modelMatrix * vec4( position, 1.0 ) );\n\t\t\t\tvWorldPosition = worldPosition.xyz;\n\n\t\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n\t\t\t}\n\t\t\t",side:q}))}set radius(t){this.material.uniforms.radius.value=t}get radius(){return this.material.uniforms.radius.value}set height(t){this.material.uniforms.height.value=t}get height(){return this.material.uniforms.height.value}}class Pt extends ct{constructor(t,e,i){super(t,e),this.updateEnvironmentTexture(i)}updateEnvironmentTexture(t){t&&(this._environmentTexture=t,this._skybox=new Ct(this._environmentTexture),this._skybox.name="Ground projected skybox",this._skybox.scale.setScalar(100)),this.reload()}needsBounds(){return!1}needsCamera(){return!1}needsRotation(){return!1}addToScene(){this._scene&&this._skybox&&this._scene.add(this._skybox)}removeFromScene(){this._scene&&this._skybox&&this._scene.remove(this._skybox)}showGUI(t){let e=u();if(!e)return;let i=e.addFolder("Ground Projected Environment");i.add(this._skybox,"height").min(10).max(100).step(.1).onChange(t),i.add(this._skybox,"radius").min(20).max(200).step(.1).onChange(t)}}class bt{onBeforeRender(){}constructor(t,e,i,s=y.CAMERA_3D){this._depthWriteMaterial=new et({colorWrite:!1}),this._maxAnisotropy=1,this._clock=new it,this._delta=0,this._renderListener=null,this._stopRendering=!1,this._forceRender=!1,this._lastChange=Date.now(),this._running=!1,this._perspectiveOffsetCamera=null,this._orthographicOffsetCamera=null,this._onAfterRender=()=>{},this._creator_=t,this._canvasID=i,c.setEnvMapIntensity(this._initData.envMapIntensity),this.createCameraControl(w(s),e),this._setupScene(e,!1),this._lifeCycleManager.addEventListener(this)}_changeCameraControl(t){this._cameraControl&&this._cameraControl.cleanUp(),t instanceof gt&&(this._getInputManager().removeEventListener(7,this._renderListener),this._getInputManager().removeEventListener(8,this._renderListener)),this._cameraControl instanceof gt&&(this._getInputManager().addEventListener(7,this._renderListener,this),this._getInputManager().addEventListener(8,this._renderListener,this)),this._cameraControl=t,this.cameraControlChanged()}cameraControlChanged(){}_addCameraControlListener(){this._cameraControl.addEventListener(0,()=>{var t;null===(t=this._roomleRenderer)||void 0===t||t.movingCameraStarts(),this._requestRender()},this),this._cameraControl.addEventListener(1,this._requestRender,this),this._cameraControl.addEventListener(2,()=>{var t;null===(t=this._roomleRenderer)||void 0===t||t.movingCameraStops(),this._requestRender()},this),this._cameraControl.addEventListener(6,this._requestRender,this)}_renderEverything(){var t;this._roomleRenderer&&(this._forceRender=!0,null===(t=this._roomleRenderer)||void 0===t||t.forceShadowUpdates(!1)),this._requestRender()}_renderWithoutShadowsAndAO(){this._roomleRenderer&&(this._forceRender=!0),this._requestRender()}_requestRender(){if(!this._renderer||this._stopRendering)return;const t=()=>{var e;this._delta=this._clock.getDelta(),this._animateCamera(),this._cameraControl.getCamera().layers.mask=65535,null===(e=this._statsHelper)||void 0===e||e.updateRenderInfo(this._renderer.info),this._renderLoopFunction&&(this._renderLoopFunction(),this._renderLoopFunction=null),this.onBeforeRender(),this._roomleRenderer?(this._roomleRenderer.render(this._scene,this._cameraControl.getCamera()),this._forceRender=!1,this._shouldRenderUi()&&this._renderUi()):this._renderer.render(this._scene,this._cameraControl.getCamera()),this._onAfterRender(),window.TWEEN&&TWEEN.update(),this._lastChange+3e3<Date.now()||this._stopRendering?this._running=!1:(this._running=!0,requestAnimationFrame(t))};this._lastChange=Date.now(),this._running||this._stopRendering||(this._running=!0,requestAnimationFrame(t))}_shouldRenderUi(){return this._pluginSystem&&this._pluginSystem.needsUiScene()}_renderUi(){const t=this._scene.background?this._scene.background.clone():null;this._scene.overrideMaterial=this._depthWriteMaterial,this._scene.background=null,this._renderer.render(this._scene,this._cameraControl.getCamera()),this._scene.overrideMaterial=null;const e=this._renderer.autoClear;this._renderer.autoClear=!1,this._renderer.clearDepth(),this._renderer.render(this._uiScene,this._cameraControl.getCamera()),this._renderer.autoClear=e,this._scene.background=t}_animateCamera(){this._cameraControl&&(this._cameraControl.animateCamera(this._delta)||!this.shouldClearShadowsAndAO()||this._forceRender)&&this._lightSetting instanceof ft&&this._cameraControl.getCamera()instanceof k&&this._lightSetting.update(this._cameraControl.getCamera(),this._cameraControl.getTargetPosition()),this._environment&&this._environment.needsCamera()&&this._cameraControl instanceof dt&&this._environment.updateCamera(this._cameraControl.getCamera())}shouldClearShadowsAndAO(){return!1}_setupScene(t,e){var i;const{x:s,y:n}=this._domHelper.getClientDimensions();this._scene=new st,this._uiScene=new st,(e=e||!1)||(this._scene.background=new G(this._initData.colors.DEFAULT_BACKGROUND));const a=Math.floor(s*window.devicePixelRatio),o=Math.floor(n*window.devicePixelRatio);this._renderer=new nt({antialias:!0,alpha:!0}),this._renderer.setPixelRatio(window.devicePixelRatio),this._renderer.setSize(s,n),this._renderer.outputColorSpace=at,this._renderer.autoClear=!1,this._renderer.shadowMap.enabled=!0,this._renderer.shadowMap.type=ot,this._maxAnisotropy=this._renderer.capabilities.getMaxAnisotropy(),this._roomleRenderer=new f(this._renderer,a,o),this._roomleRenderer.enableContactShadow(),this._roomleRenderer.enableShadowAndAo(),this._roomleRenderer.setAutoQuality(this._initData.autoQuality),null===(i=this._roomleRenderer)||void 0===i||i.setSize(s,n),this._renderer.domElement.classList.add(this._canvasID),this._domHelper.element.appendChild(this._renderer.domElement),this._getInputManager().addEvents(this._renderer.domElement),this._hdrEnvironmentLoader.registerEnvironmentChangedCallback(t=>{var e;this._setEnvMap(t),this._initData.legacyLight||null===(e=this._roomleRenderer)||void 0===e||e.createShadowFromEnvironmentMap(this._scene,t.environmentMap)}),this._initData.legacyLight?this.loadEnvMap("static/legacy_env-d5810ec5057d4716.exr"):this.loadEnvMap(this._initData.envMapUrl),this._requestRender(),window.addEventListener("resize",this,!1),window.addEventListener("keydown",this,!1),window.addEventListener("keyup",this,!1),document.addEventListener("visibilitychange",this),this._pluginSystem.init(this._scene,this._uiScene,this._cameraControl.getCamera().position),this._addCameraControlListener(),this.sceneChanged()}async loadEnvMap(t){await this._hdrEnvironmentLoader.loadUrl(this._renderer,t)}_setEnvMap(t){const{url:e,environmentMap:i}=t;this._scene.environment=i,this._scene.userData.equirectangularEnvironmentMap=i,this._imageRenderer.setEnvMap(this._scene,i),this._environment instanceof Pt&&this._environment.updateEnvironmentTexture(i),e===C&&window.requestIdleCallback(this.loadEnvMap.bind(this,"static/default_1k-2aa6d42244d30fb1.exr")),this._requestRender()}_tabVisible(){this.updateCamera(!1)}updateCamera(t=!0){var e;const{x:i,y:s}=this._domHelper.getClientDimensions();null===(e=this._roomleRenderer)||void 0===e||e.setSize(i,s),this._cameraControl.updateCamera(),this._renderEverything()}_onWindowResize(){const t=this._getInputManager();t&&t.updateSize(),this.updateCamera(),this._requestRender()}_isPartOfScene(t){return"Object3D"===t.type||"Mesh"===t.type||"GLB"===t.type||"GLTF"===t.type||"Group"===t.type}cleanUp(){this._getInputManager().removeEventListener(7,this._renderListener),this._getInputManager().removeEventListener(8,this._renderListener),this._cameraControl&&this._cameraControl.cleanUp(),this._stopRendering=!0}clearScene(){let t=[];this._scene.children.forEach(e=>{this._isPartOfScene(e)&&t.push(e)}),t.forEach(t=>{P(t),this._scene.remove(t)}),this._renderer.renderLists.dispose()}enableHD(t){this._renderer.capabilities.maxTextures>8&&t&&this.loadDynamicLightSetting(t),this._requestRender()}_loadGLTF(t,e,i,s,n,a,o){return new Promise((r,h)=>{this._staticItemLoader.loadGLTF(t,e,i,s,n,a,null,o).then(t=>{this._setCamera("GLTF",t.scene),r(t.scene)},h)})}_loadGLB(t,e,i,s,n,a,o,r){return new Promise((h,_)=>{this._staticItemLoader.loadGLB(t,e,i,s,n,a,o,r).then(t=>{this._setCamera("GLB",t.scene),h(t.scene)},_)})}_setCamera(t,e){if(!e)return void console.warn("could not set camera for gltf",e);const i=new D;i.setFromObject(e),"GLB"===t?this._cameraControl instanceof dt&&this._cameraControl.updateToBounds(i,!1):"GLTF"===t&&(this._cameraControl instanceof dt&&this._cameraControl.updateAndReset(i.getSize(new S),i.getCenter(new S),-15,70,5,!1),this._cameraControl instanceof ut&&this._cameraControl.zoomToFitBounds(i,!0)),this.updateCamera()}showGUI(){if(this._initData.disableDebugGUI)return;const t=document.createElement("style");t.innerText=".dg.main{position:absolute;z-index:999;top:0;left:0;}",document.head.appendChild(t);let e=u(!1);e&&(this._domHelper.element.appendChild(e.domElement),this._guiLoaded())}_guiLoaded(){let t=u();if(!t)return;const e=t.addFolder("Scene Parameter"),i={intensity:this._initData.envMapIntensity};e.add(i,"intensity",0,4,.01).name("env map intensity").onChange(t=>{this.changeEnvironmentMapIntensity(t),this._requestRender()}),this._lightSetting&&this._lightSetting.showGUI(),this._roomleRenderer&&this._roomleRenderer.showGUI(()=>this._requestRender()),this._environment&&this._environment.showGUI(()=>this._requestRender()),this._addGUIListener(t)}_addGUIListener(t){let e=t.__folders;Object.keys(e).forEach(t=>{let i=e[t];i.__folders&&Object.keys(i.__folders).forEach(t=>{let e=i.__folders[t];this._addGUIListener(e)}),i.__controllers&&i.__controllers.forEach(t=>{t.onFinishChange(()=>{this._guiParamChanged()})})})}_guiParamChanged(){this._renderEverything()}showStats(){e.import("./stats-helper-6a0d378d.nomodule.js").then(t=>this._statsHelper=new t.default)}_onKeyDown(t){}_onKeyUp(t){}pause(){this._getInputManager().removeEvents(this._renderer.domElement),window.removeEventListener("resize",this,!1),window.removeEventListener("keydown",this,!1),window.removeEventListener("keyup",this,!1),document.removeEventListener("visibilitychange",this)}resume(){this._renderer.domElement.classList.add(this._canvasID),this._domHelper.element.appendChild(this._renderer.domElement),this._getInputManager().addEvents(this._renderer.domElement),window.addEventListener("resize",this,!1),window.addEventListener("keydown",this,!1),window.addEventListener("keyup",this,!1),document.addEventListener("visibilitychange",this),this.updateCamera()}destroy(){this.pause(),this.cleanUp()}handleEvent(t){switch(t.type){case"resize":this._onWindowResize();break;case"keydown":if(t.target&&(t.target instanceof HTMLInputElement||t.target instanceof HTMLTextAreaElement))break;this._onKeyDown(t);break;case"keyup":if(t.target&&(t.target instanceof HTMLInputElement||t.target instanceof HTMLTextAreaElement))break;this._onKeyUp(t);break;case"visibilitychange":this._tabVisible()}}async loadSceneSettings(t){let e,i;return e=t.environment?new Promise(e=>{(new wt).load(this._scene,this._renderer.domElement,this._environment,t,this._maxAnisotropy,this._initData.envMapIntensity).then(t=>{this._setEnvironment(t),e()})}):Promise.resolve(),t.lights?(this._lightSetting=new ft(this._scene,this._lightSetting),i=this._lightSetting.loadFromObject(t)):i=Promise.resolve(),new Promise((t,s)=>{Promise.all([e,i]).then(()=>{this._renderEverything(),t()},s)})}setBackgroundColor(t){this._setEnvironment(new vt(this._scene,this._environment,new G(t)))}setBackgroundImage(t){this._setEnvironment(new vt(this._scene,this._environment,null,this._renderer.domElement,t))}_setEnvironment(t){this._environment=t,this._renderEverything()}async loadDynamicLightSetting(t){this._lightSetting=new ft(this._scene,this._lightSetting);let e=!1;if(t.url)await this._lightSetting.loadFromURL(t.url),e=!0;else if(t.json)await this._lightSetting.loadFromJSON(t.json),e=!0;else if(t.object)await this._lightSetting.loadFromObject(t.object),e=!0;else if(t.ls){const i=b.createDynamicLightSettingSource(null,t.ls);await this._lightSetting.loadFromURL(i.url),e=!0}if(!e)throw new Error("No dynamic light setting source set");this._requestRender()}getScene(){return this._scene}updateScene(){var t;this._updateBounds(this.getBounds()),null===(t=this._roomleRenderer)||void 0===t||t.forceShadowUpdates(!0),this._renderEverything()}_updateBounds(t,e=!1){var i;t&&(this.updateEnvironment(t,e),this._lightSetting&&this._lightSetting.needsBounds()&&this._lightSetting.updateBounds(t),null===(i=this._roomleRenderer)||void 0===i||i.updateBounds(t),this._requestRender(),this._pluginSystem.updateBounds(t))}setCameraOffset(t){const e=this._cameraControl.getCamera(),i=e||e;(null==i?void 0:i.offset)?(i.offset=t,this._renderEverything()):console.warn("Cannot set offset, current camera does not support it")}getCameraOffset(){const t=this._cameraControl.getCamera(),e=t||t;return(null==e?void 0:e.offset)?JSON.parse(JSON.stringify(e.offset)):{left:0,top:0,right:1,bottom:1}}getOrthographicOffsetCamera(){if(!this._orthographicOffsetCamera){const t=this.getCameraOffset(),e=this._domHelper.getClientDimensions(),i=5;let s=e.x/e.y*i,n=i;const a=x();this._orthographicOffsetCamera=a.createOrthographicCamera(s/-2,s/2,n/2,n/-2,1,1e3,t),this._orthographicOffsetCamera.position.set(0,10,0),this._orthographicOffsetCamera.lookAt(new S(0,0,0))}return this._orthographicOffsetCamera}getPerspectiveOffsetCamera(){if(!this._perspectiveOffsetCamera){const t=this.getCameraOffset(),e=this._domHelper.getClientDimensions(),i=e.x,s=e.y,n=x();this._perspectiveOffsetCamera=n.createPerspectiveCamera(30,i/s,.1,20,t)}return this._perspectiveOffsetCamera}updateEnvironment(t,e=!1){var i;if(t&&this._environment&&this._environment.needsBounds()){const i=t.getSize(new S);(i.x+i.y+i.z!==0||e)&&this._environment.updateBounds(t.getSize(new S),e)}null===(i=this._roomleRenderer)||void 0===i||i.updateEnvironment(t,e)}_onCameraIdle(){return!0}_onCameraMove(){return!0}exportImageFromCamera(t){this._onAfterRender=()=>{const e=this._renderer.domElement.toDataURL("image/jpeg",1),{left:i,right:s,top:n,bottom:a}=this.getCameraOffset(),o=s-i,r=n-a;if(1===o&&1===r)return void rt(t,e);const h=new Image;h.src=e,h.onload=()=>{const{naturalWidth:e,naturalHeight:s}=h,a=document.createElement("canvas");a.width=e*o,a.height=s*r;const _=a.getContext("2d"),d=e*i*-1,c=s*(1-n)*-1;_.drawImage(h,d,c),_.save(),rt(t,a.toDataURL("image/jpeg",1)),this._onAfterRender=()=>{}}},this._requestRender()}changeEnvironmentMapIntensity(t){M(this._scene,t)}lockCamera(){this._cameraControl.lock()}unlockCamera(){this._cameraControl.unlock()}}t("S",bt),i([s],bt.prototype,"_domHelper",void 0),i([s],bt.prototype,"_scriptLoader",void 0),i([s],bt.prototype,"_lifeCycleManager",void 0),i([s],bt.prototype,"_staticItemLoader",void 0),i([s],bt.prototype,"_hdrEnvironmentLoader",void 0),i([s],bt.prototype,"_initData",void 0),i([s],bt.prototype,"_pluginSystem",void 0),i([s],bt.prototype,"_imageRenderer",void 0)}}}));
2
+ //# sourceMappingURL=scene-manager-b2128ea9.nomodule.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scene-manager-b2128ea9.nomodule.js","sources":["../../packages/three-build/src/Tween.js","../../node_modules/three/examples/jsm/objects/GroundProjectedSkybox.js","../../packages/common-core/public/textures/env/legacy_env.exr","../../packages/common-core/public/textures/env/default_1k.exr"],"sourcesContent":["export default \"static/Tween-d57ee5d181fce582.js\"","import { Mesh, IcosahedronGeometry, ShaderMaterial, DoubleSide } from 'three';\n\n/**\n * Ground projected env map adapted from @react-three/drei.\n * https://github.com/pmndrs/drei/blob/master/src/core/Environment.tsx\n */\nclass GroundProjectedSkybox extends Mesh {\n\n\tconstructor( texture, options = {} ) {\n\n\t\tconst isCubeMap = texture.isCubeTexture;\n\n\t\tconst defines = [\n\t\t\tisCubeMap ? '#define ENVMAP_TYPE_CUBE' : ''\n\t\t];\n\n\t\tconst vertexShader = /* glsl */ `\n\t\t\tvarying vec3 vWorldPosition;\n\n\t\t\tvoid main() {\n\n\t\t\t\tvec4 worldPosition = ( modelMatrix * vec4( position, 1.0 ) );\n\t\t\t\tvWorldPosition = worldPosition.xyz;\n\n\t\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n\t\t\t}\n\t\t\t`;\n\t\tconst fragmentShader = defines.join( '\\n' ) + /* glsl */ `\n\n\t\t\t\tvarying vec3 vWorldPosition;\n\n\t\t\t\tuniform float radius;\n\t\t\t\tuniform float height;\n\t\t\t\tuniform float angle;\n\n\t\t\t\t#ifdef ENVMAP_TYPE_CUBE\n\n\t\t\t\t\tuniform samplerCube map;\n\n\t\t\t\t#else\n\n\t\t\t\t\tuniform sampler2D map;\n\n\t\t\t\t#endif\n\n\t\t\t\t// From: https://www.shadertoy.com/view/4tsBD7\n\t\t\t\tfloat diskIntersectWithBackFaceCulling( vec3 ro, vec3 rd, vec3 c, vec3 n, float r ) \n\t\t\t\t{\n\n\t\t\t\t\tfloat d = dot ( rd, n );\n\n\t\t\t\t\tif( d > 0.0 ) { return 1e6; }\n\n\t\t\t\t\tvec3 o = ro - c;\n\t\t\t\t\tfloat t = - dot( n, o ) / d;\n\t\t\t\t\tvec3 q = o + rd * t;\n\n\t\t\t\t\treturn ( dot( q, q ) < r * r ) ? t : 1e6;\n\n\t\t\t\t}\n\n\t\t\t\t// From: https://www.iquilezles.org/www/articles/intersectors/intersectors.htm\n\t\t\t\tfloat sphereIntersect( vec3 ro, vec3 rd, vec3 ce, float ra ) {\n\n\t\t\t\t\tvec3 oc = ro - ce;\n\t\t\t\t\tfloat b = dot( oc, rd );\n\t\t\t\t\tfloat c = dot( oc, oc ) - ra * ra;\n\t\t\t\t\tfloat h = b * b - c;\n\n\t\t\t\t\tif( h < 0.0 ) { return -1.0; }\n\n\t\t\t\t\th = sqrt( h );\n\n\t\t\t\t\treturn - b + h;\n\n\t\t\t\t}\n\n\t\t\t\tvec3 project() {\n\n\t\t\t\t\tvec3 p = normalize( vWorldPosition );\n\t\t\t\t\tvec3 camPos = cameraPosition;\n\t\t\t\t\tcamPos.y -= height;\n\n\t\t\t\t\tfloat intersection = sphereIntersect( camPos, p, vec3( 0.0 ), radius );\n\t\t\t\t\tif( intersection > 0.0 ) {\n\n\t\t\t\t\t\tvec3 h = vec3( 0.0, - height, 0.0 );\n\t\t\t\t\t\tfloat intersection2 = diskIntersectWithBackFaceCulling( camPos, p, h, vec3( 0.0, 1.0, 0.0 ), radius );\n\t\t\t\t\t\tp = ( camPos + min( intersection, intersection2 ) * p ) / radius;\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tp = vec3( 0.0, 1.0, 0.0 );\n\n\t\t\t\t\t}\n\n\t\t\t\t\treturn p;\n\n\t\t\t\t}\n\n\t\t\t\t#include <common>\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvec3 projectedWorldPosition = project();\n\n\t\t\t\t\t#ifdef ENVMAP_TYPE_CUBE\n\n\t\t\t\t\t\tvec3 outcolor = textureCube( map, projectedWorldPosition ).rgb;\n\n\t\t\t\t\t#else\n\n\t\t\t\t\t\tvec3 direction = normalize( projectedWorldPosition );\n\t\t\t\t\t\tvec2 uv = equirectUv( direction );\n\t\t\t\t\t\tvec3 outcolor = texture2D( map, uv ).rgb;\n\n\t\t\t\t\t#endif\n\n\t\t\t\t\tgl_FragColor = vec4( outcolor, 1.0 );\n\n\t\t\t\t\t#include <tonemapping_fragment>\n\t\t\t\t\t#include <colorspace_fragment>\n\n\t\t\t\t}\n\t\t\t\t`;\n\n\t\tconst uniforms = {\n\t\t\tmap: { value: texture },\n\t\t\theight: { value: options.height || 15 },\n\t\t\tradius: { value: options.radius || 100 },\n\t\t};\n\n\t\tconst geometry = new IcosahedronGeometry( 1, 16 );\n\t\tconst material = new ShaderMaterial( {\n\t\t\tuniforms,\n\t\t\tfragmentShader,\n\t\t\tvertexShader,\n\t\t\tside: DoubleSide,\n\t\t} );\n\n\t\tsuper( geometry, material );\n\n\t}\n\n\tset radius( radius ) {\n\n\t\tthis.material.uniforms.radius.value = radius;\n\n\t}\n\n\tget radius() {\n\n\t\treturn this.material.uniforms.radius.value;\n\n\t}\n\n\tset height( height ) {\n\n\t\tthis.material.uniforms.height.value = height;\n\n\t}\n\n\tget height() {\n\n\t\treturn this.material.uniforms.height.value;\n\n\t}\n\n}\n\nexport { GroundProjectedSkybox };\n","export default \"static/legacy_env-d5810ec5057d4716.exr\"","export default \"static/default_1k-2aa6d42244d30fb1.exr\""],"names":["exports","GroundProjectedSkybox","Mesh","[object Object]","texture","options","fragmentShader","isCubeTexture","join","uniforms","map","value","height","radius","super","IcosahedronGeometry","ShaderMaterial","vertexShader","side","DoubleSide","this","material"],"mappings":"+sBAAeA,EAAA,IAAA,ggiCCMf,MAAMC,WAA8BC,EAEnCC,YAAaC,EAASC,EAAU,IAE/B,MAkBMC,EAhBU,CAFEF,EAAQG,cAGb,2BAA6B,IAeXC,KAAM,MAAoB,6yEAmGnDC,EAAW,CAChBC,IAAK,CAAEC,MAAOP,GACdQ,OAAQ,CAAED,MAAON,EAAQO,QAAU,IACnCC,OAAQ,CAAEF,MAAON,EAAQQ,QAAU,MAWpCC,MARiB,IAAIC,EAAqB,EAAG,IAC5B,IAAIC,GAAgB,CACpCP,SAAAA,EACAH,eAAAA,EACAW,aAzH+B,4RA0H/BC,KAAMC,KAORN,WAAYA,GAEXO,KAAKC,SAASZ,SAASI,OAAOF,MAAQE,EAIvCA,aAEC,OAAOO,KAAKC,SAASZ,SAASI,OAAOF,MAItCC,WAAYA,GAEXQ,KAAKC,SAASZ,SAASG,OAAOD,MAAQC,EAIvCA,aAEC,OAAOQ,KAAKC,SAASZ,SAASG,OAAOD,ymLCrKxB,gzBCAA"}
@@ -0,0 +1,2 @@
1
+ System.register(["./query-params-helper-c231e1b8.nomodule.js","./roomle-dependency-injection-2fde2714.nomodule.js","./main-thread-to-worker-a2554a6a.nomodule.js"],(function(e){var t,o,n,i,_,s,r;return{setters:[function(e){t=e.g},function(e){o=e.b,n=e.B,i=e.I,_=e._,s=e.i},function(e){r=e.g}],execute:function(){e("M",class{constructor(e){this._context=e||o.getContext(this.getContextName()),n.start("loadingTime")}_setupCommonGlobals(){window.__RML__DEBUG__||(window.__RML__DEBUG__={}),window.__RML__ENV__||(window.__RML__ENV__={},window.__RML__ENV__.assetPath||(window.__RML__ENV__.assetPath=""))}_setupCommonDependencies(){o.setup(i);const e=t();this.lookup("global-init-data").setOverrides(e),this.lookup("init-data",this._context).setOverrides(e)}_cleanUpCommonGlobals(){window.__RML__DEBUG__&&(window.__RML__DEBUG__.Kernel&&window.__RML__DEBUG__.Kernel.clearAll&&window.__RML__DEBUG__.Kernel.clearAll(),delete window.__RML__DEBUG__),delete window.__RML__ENV__;for(const e in window.THREE)if(window.hasOwnProperty(e))try{delete window.THREE[e]}catch(e){console.error(e)}window.THREE=void 0}_cleanUpCommonDependencies(){}boot(e){this._setupCommonGlobals(),this._setupCommonDependencies(),this.setupGlobals(e),this.setupDependencies(),this.bootFinished()}lookup(e,t){return window.__RML__DI__.lookup(e,t)}teardown(){this.cleanUpDependencies(),this._cleanUpCommonDependencies(),this.cleanUpGlobals(),this._cleanUpCommonGlobals(),window.__RML__DI__&&delete window.__RML__DI__}pause(){this.lookup("life-cycle-manager",this._context).pause(),window.TWEEN&&TWEEN.removeAll()}resume(e){e&&this.lookup("dom-helper",this._context).setDomElement(e),this.lookup("life-cycle-manager",this._context).resume()}destroy(){this.pause(),this.lookup("life-cycle-manager",this._context).destroy(),o.cleanUp(this._context)}getRapiAccess(){return this.lookup("rapi-access",this._context)}});let l={},c={};class a{constructor(e){this._creator_=e}fetch(e,t){return this._singlePromiseFactory.create(5,e,(o,i)=>{!function(e,t,o,i){if(-1===e.indexOf("http")&&(e=r()+e),l[e])return o();if(t.id&&c[t.id])return i(new Error('There is already a script with ID "'+t.id+'"'));n.start("load_"+t.id.replace(/-/g,"_"));const _=document.createElement("script");_.async=!1,_.src=e,_.id=t.id,_.onload=()=>{l[e]=!0,c[t.id]=!0,Object.defineProperty(o,"name",{value:"resolve-"+t.id}),o()},_.onerror=e=>{i(e)},document.body.appendChild(_)}(e,t,o,i)})}loadScripts(e){const t=[];return e.forEach(e=>{let o=this.fetch(e.name,{id:e.id});t.push(o)}),Promise.all(t)}cleanUp(){for(let e in c)if(c.hasOwnProperty(e)){const t=document.getElementById(e);t&&t.parentElement.removeChild(t)}l={},c={}}}e("S",a),_([s],a.prototype,"_singlePromiseFactory",void 0)}}}));
2
+ //# sourceMappingURL=script-loader-69c064c2.nomodule.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"script-loader-69c064c2.nomodule.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ import{g as getAllParameters}from"./query-params-helper-a271f9dc.js";import{b as RoomleDependencyInjection,B as Benchmark,I as INJECTABLES,_ as __decorate,i as inject}from"./roomle-dependency-injection-5533da82.js";import{g as getAssetPath}from"./main-thread-to-worker-29498ad3.js";class Main{constructor(e){this._context=e||RoomleDependencyInjection.getContext(this.getContextName()),Benchmark.start("loadingTime")}_setupCommonGlobals(){window.__RML__DEBUG__||(window.__RML__DEBUG__={}),window.__RML__ENV__||(window.__RML__ENV__={},window.__RML__ENV__.assetPath||(window.__RML__ENV__.assetPath=""))}_setupCommonDependencies(){RoomleDependencyInjection.setup(INJECTABLES);const e=getAllParameters();this.lookup("global-init-data").setOverrides(e),this.lookup("init-data",this._context).setOverrides(e)}_cleanUpCommonGlobals(){window.__RML__DEBUG__&&(window.__RML__DEBUG__.Kernel&&window.__RML__DEBUG__.Kernel.clearAll&&window.__RML__DEBUG__.Kernel.clearAll(),delete window.__RML__DEBUG__),delete window.__RML__ENV__;for(const e in window.THREE)if(window.hasOwnProperty(e))try{delete window.THREE[e]}catch(e){console.error(e)}window.THREE=void 0}_cleanUpCommonDependencies(){}boot(e){this._setupCommonGlobals(),this._setupCommonDependencies(),this.setupGlobals(e),this.setupDependencies(),this.bootFinished()}lookup(e,t){return window.__RML__DI__.lookup(e,t)}teardown(){this.cleanUpDependencies(),this._cleanUpCommonDependencies(),this.cleanUpGlobals(),this._cleanUpCommonGlobals(),window.__RML__DI__&&delete window.__RML__DI__}pause(){this.lookup("life-cycle-manager",this._context).pause(),window.TWEEN&&TWEEN.removeAll()}resume(e){e&&this.lookup("dom-helper",this._context).setDomElement(e),this.lookup("life-cycle-manager",this._context).resume()}destroy(){this.pause(),this.lookup("life-cycle-manager",this._context).destroy(),RoomleDependencyInjection.cleanUp(this._context)}getRapiAccess(){return this.lookup("rapi-access",this._context)}}let _scriptCache={},_idCache={};class ScriptLoader{constructor(e){this._creator_=e}fetch(e,t){return this._singlePromiseFactory.create(5,e,(o,n)=>{!function(e,t,o,n){if(-1===e.indexOf("http")&&(e=getAssetPath()+e),_scriptCache[e])return o();if(t.id&&_idCache[t.id])return n(new Error('There is already a script with ID "'+t.id+'"'));Benchmark.start("load_"+t.id.replace(/-/g,"_"));const i=document.createElement("script");i.async=!1,i.src=e,i.id=t.id,i.onload=()=>{_scriptCache[e]=!0,_idCache[t.id]=!0,Object.defineProperty(o,"name",{value:"resolve-"+t.id}),o()},i.onerror=e=>{n(e)},document.body.appendChild(i)}(e,t,o,n)})}loadScripts(e){const t=[];return e.forEach(e=>{let o=this.fetch(e.name,{id:e.id});t.push(o)}),Promise.all(t)}cleanUp(){for(let e in _idCache)if(_idCache.hasOwnProperty(e)){const t=document.getElementById(e);t&&t.parentElement.removeChild(t)}_scriptCache={},_idCache={}}}__decorate([inject],ScriptLoader.prototype,"_singlePromiseFactory",void 0);export{Main as M,ScriptLoader as S};
2
+ //# sourceMappingURL=script-loader-de8249e5.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"script-loader-de8249e5.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["0"],"names":["_Group","this","_tweens","_tweensAddedDuringUpdate","prototype","getAll","Object","keys","map","tweenId","bind","removeAll","add","tween","getId","remove","update","time","preserve","tweenIds","length","undefined","TWEEN","now","i","_isPlaying","a","Group","_nextId","nextId","process","hrtime","window","performance","Date","getTime","Tween","object","group","_object","_valuesStart","_valuesEnd","_valuesStartRepeat","_duration","_repeat","_repeatDelayTime","_yoyo","_reversed","_delayTime","_startTime","_easingFunction","Easing","Linear","None","_interpolationFunction","Interpolation","_chainedTweens","_onStartCallback","_onStartCallbackFired","_onUpdateCallback","_onCompleteCallback","_onStopCallback","_group","_id","isPlaying","to","properties","duration","start","property","parseFloat","Array","concat","stop","stopChainedTweens","end","numChainedTweens","delay","amount","repeat","times","repeatDelay","yoyo","easing","interpolation","chain","arguments","onStart","callback","onUpdate","onComplete","onStop","elapsed","value","charAt","isFinite","tmp","k","Quadratic","In","Out","InOut","Cubic","Quartic","Quintic","Sinusoidal","Math","cos","PI","sin","Exponential","pow","Circular","sqrt","Elastic","Back","s","Bounce","v","m","f","floor","fn","Utils","Bezier","b","n","pw","bn","Bernstein","CatmullRom","p0","p1","t","fc","Factorial","p2","p3","v0","v1","t2","define","amd","module","exports"],"mappings":"AAWA,IAAIA,OAAS,WACTC,KAAKC,QAAU,GACfD,KAAKE,yBAA2B,IAGpCH,OAAOI,UAAY,CACfC,OAAQ,WACJ,OAAOC,OAAOC,KAAKN,KAAKC,SAASM,IAAI,SAAUC,GAC3C,OAAOR,KAAKC,QAAQO,IACtBC,KAAKT,QAGXU,UAAW,WACPV,KAAKC,QAAU,IAGnBU,IAAK,SAAUC,GACXZ,KAAKC,QAAQW,EAAMC,SAAWD,EAC9BZ,KAAKE,yBAAyBU,EAAMC,SAAWD,GAGnDE,OAAQ,SAAUF,UACPZ,KAAKC,QAAQW,EAAMC,gBACnBb,KAAKE,yBAAyBU,EAAMC,UAG/CE,OAAQ,SAAUC,EAAMC,GACpB,IAAIC,EAAWb,OAAOC,KAAKN,KAAKC,SAEhC,GAAwB,IAApBiB,EAASC,OACT,OAAO,EASX,IANAH,OAAgBI,IAATJ,EAAqBA,EAAOK,MAAMC,MAMlCJ,EAASC,OAAS,GAAG,CACxBnB,KAAKE,yBAA2B,GAEhC,IAAK,IAAIqB,EAAI,EAAGA,EAAIL,EAASC,OAAQI,IAAK,CACtC,IAAIX,EAAQZ,KAAKC,QAAQiB,EAASK,IAE9BX,IAAgC,IAAvBA,EAAMG,OAAOC,KACtBJ,EAAMY,YAAa,EAEdP,UACMjB,KAAKC,QAAQiB,EAASK,KAKzCL,EAAWb,OAAOC,KAAKN,KAAKE,0BAGhC,OAAO,IAIf,IAwoBgBuB,EAxoBZJ,MAAQ,IAAItB,OAEhBsB,MAAMK,MAAQ3B,OACdsB,MAAMM,QAAU,EAChBN,MAAMO,OAAS,WACX,OAAOP,MAAMM,WAKO,oBAAb,QAAiD,oBAAd,QAC1CN,MAAMC,IAAM,WACR,IAAIN,EAAOa,QAAQC,SAGnB,OAAiB,IAAVd,EAAK,GAAYA,EAAK,GAAK,KAIb,oBAAb,aACWI,IAAvBW,OAAOC,kBACoBZ,IAA3BW,OAAOC,YAAYV,IAGnBD,MAAMC,IAAMS,OAAOC,YAAYV,IAAIb,KAAKsB,OAAOC,kBAG7BZ,IAAba,KAAKX,IACVD,MAAMC,IAAMW,KAAKX,IAIjBD,MAAMC,IAAM,WACR,OAAO,IAAIW,MAAOC,WAI1Bb,MAAMc,MAAQ,SAAUC,EAAQC,GAC5BrC,KAAKsC,QAAUF,EACfpC,KAAKuC,aAAe,GACpBvC,KAAKwC,WAAa,GAClBxC,KAAKyC,mBAAqB,GAC1BzC,KAAK0C,UAAY,IACjB1C,KAAK2C,QAAU,EACf3C,KAAK4C,sBAAmBxB,EACxBpB,KAAK6C,OAAQ,EACb7C,KAAKwB,YAAa,EAClBxB,KAAK8C,WAAY,EACjB9C,KAAK+C,WAAa,EAClB/C,KAAKgD,WAAa,KAClBhD,KAAKiD,gBAAkB5B,MAAM6B,OAAOC,OAAOC,KAC3CpD,KAAKqD,uBAAyBhC,MAAMiC,cAAcH,OAClDnD,KAAKuD,eAAiB,GACtBvD,KAAKwD,iBAAmB,KACxBxD,KAAKyD,uBAAwB,EAC7BzD,KAAK0D,kBAAoB,KACzB1D,KAAK2D,oBAAsB,KAC3B3D,KAAK4D,gBAAkB,KACvB5D,KAAK6D,OAASxB,GAAShB,MACvBrB,KAAK8D,IAAMzC,MAAMO,UAGrBP,MAAMc,MAAMhC,UAAY,CACpBU,MAAO,WACH,OAAOb,KAAK8D,KAGhBC,UAAW,WACP,OAAO/D,KAAKwB,YAGhBwC,GAAI,SAAYC,EAAYC,GAOxB,OANAlE,KAAKwC,WAAayB,OAED7C,IAAb8C,IACAlE,KAAK0C,UAAYwB,GAGdlE,MAGXmE,MAAO,SAAenD,GAUlB,IAAK,IAAIoD,KATTpE,KAAK6D,OAAOlD,IAAIX,MAEhBA,KAAKwB,YAAa,EAElBxB,KAAKyD,uBAAwB,EAE7BzD,KAAKgD,gBAAsB5B,IAATJ,EAAqC,iBAATA,EAAoBK,MAAMC,MAAQ+C,WAAWrD,GAAQA,EAAOK,MAAMC,MAChHtB,KAAKgD,YAAchD,KAAK+C,WAEH/C,KAAKwC,WAAY,CAElC,GAAIxC,KAAKwC,WAAW4B,aAAqBE,MAAO,CAC5C,GAAyC,IAArCtE,KAAKwC,WAAW4B,GAAUjD,OAC1B,SAIJnB,KAAKwC,WAAW4B,GAAY,CAACpE,KAAKsC,QAAQ8B,IAAWG,OAAOvE,KAAKwC,WAAW4B,SAMjDhD,IAA3BpB,KAAKsC,QAAQ8B,KAKjBpE,KAAKuC,aAAa6B,GAAYpE,KAAKsC,QAAQ8B,GAEtCpE,KAAKuC,aAAa6B,aAAqBE,OAAW,IACnDtE,KAAKuC,aAAa6B,IAAa,GAGnCpE,KAAKyC,mBAAmB2B,GAAYpE,KAAKuC,aAAa6B,IAAa,GAGvE,OAAOpE,MAGXwE,KAAM,WACF,OAAKxE,KAAKwB,YAIVxB,KAAK6D,OAAO/C,OAAOd,MACnBA,KAAKwB,YAAa,EAEW,OAAzBxB,KAAK4D,iBACL5D,KAAK4D,gBAAgB5D,KAAKsC,SAG9BtC,KAAKyE,oBACEzE,MAXIA,MAcf0E,IAAK,WAED,OADA1E,KAAKe,OAAOf,KAAKgD,WAAahD,KAAK0C,WAC5B1C,MAGXyE,kBAAmB,WAEf,IAAK,IAAIlD,EAAI,EAAGoD,EAAmB3E,KAAKuD,eAAepC,OAAQI,EAAIoD,EAAkBpD,IACjFvB,KAAKuD,eAAehC,GAAGiD,QAI/BI,MAAO,SAAeC,GAElB,OADA7E,KAAK+C,WAAa8B,EACX7E,MAGX8E,OAAQ,SAAgBC,GAEpB,OADA/E,KAAK2C,QAAUoC,EACR/E,MAGXgF,YAAa,SAAqBH,GAE9B,OADA7E,KAAK4C,iBAAmBiC,EACjB7E,MAGXiF,KAAM,SAAcA,GAEhB,OADAjF,KAAK6C,MAAQoC,EACNjF,MAGXkF,OAAQ,SAAgBA,GAEpB,OADAlF,KAAKiD,gBAAkBiC,EAChBlF,MAGXmF,cAAe,SAAuBA,GAElC,OADAnF,KAAKqD,uBAAyB8B,EACvBnF,MAGXoF,MAAO,WAEH,OADApF,KAAKuD,eAAiB8B,UACfrF,MAGXsF,QAAS,SAAiBC,GAEtB,OADAvF,KAAKwD,iBAAmB+B,EACjBvF,MAGXwF,SAAU,SAAkBD,GAExB,OADAvF,KAAK0D,kBAAoB6B,EAClBvF,MAGXyF,WAAY,SAAoBF,GAE5B,OADAvF,KAAK2D,oBAAsB4B,EACpBvF,MAGX0F,OAAQ,SAAgBH,GAEpB,OADAvF,KAAK4D,gBAAkB2B,EAChBvF,MAGXe,OAAQ,SAAgBC,GACpB,IAAIoD,EACAuB,EACAC,EAEJ,GAAI5E,EAAOhB,KAAKgD,WACZ,OAAO,EAgBX,IAAKoB,KAb8B,IAA/BpE,KAAKyD,wBACyB,OAA1BzD,KAAKwD,kBACLxD,KAAKwD,iBAAiBxD,KAAKsC,SAG/BtC,KAAKyD,uBAAwB,GAIjCkC,GADAA,GAAW3E,EAAOhB,KAAKgD,YAAchD,KAAK0C,WACtB,EAAI,EAAIiD,EAE5BC,EAAQ5F,KAAKiD,gBAAgB0C,GAEZ3F,KAAKwC,WAElB,QAAoCpB,IAAhCpB,KAAKuC,aAAa6B,GAAtB,CAIA,IAAID,EAAQnE,KAAKuC,aAAa6B,IAAa,EACvCM,EAAM1E,KAAKwC,WAAW4B,GAEtBM,aAAeJ,MACftE,KAAKsC,QAAQ8B,GAAYpE,KAAKqD,uBAAuBqB,EAAKkB,IAGrC,iBAAV,IAGHlB,EADkB,MAAlBA,EAAImB,OAAO,IAAgC,MAAlBnB,EAAImB,OAAO,GAC9B1B,EAAQE,WAAWK,GAEnBL,WAAWK,IAKJ,iBAAV,IACP1E,KAAKsC,QAAQ8B,GAAYD,GAASO,EAAMP,GAASyB,IAS7D,GAJ+B,OAA3B5F,KAAK0D,mBACL1D,KAAK0D,kBAAkB1D,KAAKsC,SAGhB,IAAZqD,EAAe,CACf,GAAI3F,KAAK2C,QAAU,EAAG,CAMlB,IAAKyB,KALD0B,SAAS9F,KAAK2C,UACd3C,KAAK2C,UAIQ3C,KAAKyC,mBAAoB,CAMtC,GAJ2C,iBAA/BzC,KAAKwC,WAAW4B,KACxBpE,KAAKyC,mBAAmB2B,GAAYpE,KAAKyC,mBAAmB2B,GAAYC,WAAWrE,KAAKwC,WAAW4B,KAGnGpE,KAAK6C,MAAO,CACZ,IAAIkD,EAAM/F,KAAKyC,mBAAmB2B,GAElCpE,KAAKyC,mBAAmB2B,GAAYpE,KAAKwC,WAAW4B,GACpDpE,KAAKwC,WAAW4B,GAAY2B,EAGhC/F,KAAKuC,aAAa6B,GAAYpE,KAAKyC,mBAAmB2B,GAa1D,OAVIpE,KAAK6C,QACL7C,KAAK8C,WAAa9C,KAAK8C,gBAGG1B,IAA1BpB,KAAK4C,iBACL5C,KAAKgD,WAAahC,EAAOhB,KAAK4C,iBAE9B5C,KAAKgD,WAAahC,EAAOhB,KAAK+C,YAG3B,EAE0B,OAA7B/C,KAAK2D,qBACL3D,KAAK2D,oBAAoB3D,KAAKsC,SAGlC,IAAK,IAAIf,EAAI,EAAGoD,EAAmB3E,KAAKuD,eAAepC,OAAQI,EAAIoD,EAAkBpD,IAGjFvB,KAAKuD,eAAehC,GAAG4C,MAAMnE,KAAKgD,WAAahD,KAAK0C,WAGxD,OAAO,EAIf,OAAO,IAKfrB,MAAM6B,OAAS,CACXC,OAAQ,CACJC,KAAM,SAAU4C,GACZ,OAAOA,IAMfC,UAAW,CACPC,GAAI,SAAUF,GACV,OAAOA,EAAIA,GAGfG,IAAK,SAAUH,GACX,OAAOA,GAAK,EAAIA,IAGpBI,MAAO,SAAUJ,GACb,OAAKA,GAAK,GAAK,EACJ,GAAMA,EAAIA,GAGb,MAASA,GAAKA,EAAI,GAAK,KAMvCK,MAAO,CACHH,GAAI,SAAUF,GACV,OAAOA,EAAIA,EAAIA,GAGnBG,IAAK,SAAUH,GACX,QAASA,EAAIA,EAAIA,EAAI,GAGzBI,MAAO,SAAUJ,GACb,OAAKA,GAAK,GAAK,EACJ,GAAMA,EAAIA,EAAIA,EAGlB,KAAQA,GAAK,GAAKA,EAAIA,EAAI,KAMzCM,QAAS,CACLJ,GAAI,SAAUF,GACV,OAAOA,EAAIA,EAAIA,EAAIA,GAGvBG,IAAK,SAAUH,GAEX,OAAO,KAAOA,EAAIA,EAAIA,EAAIA,GAI9BI,MAAO,SAAUJ,GACb,OAAKA,GAAK,GAAK,EACJ,GAAMA,EAAIA,EAAIA,EAAIA,GAGrB,KAAQA,GAAK,GAAKA,EAAIA,EAAIA,EAAI,KAM9CO,QAAS,CACLL,GAAI,SAAUF,GACV,OAAOA,EAAIA,EAAIA,EAAIA,EAAIA,GAG3BG,IAAK,SAAUH,GACX,QAASA,EAAIA,EAAIA,EAAIA,EAAIA,EAAI,GAGjCI,MAAO,SAAUJ,GACb,OAAKA,GAAK,GAAK,EACJ,GAAMA,EAAIA,EAAIA,EAAIA,EAAIA,EAG1B,KAAQA,GAAK,GAAKA,EAAIA,EAAIA,EAAIA,EAAI,KAMjDQ,WAAY,CACRN,GAAI,SAAUF,GAEV,OAAO,EAAIS,KAAKC,IAAIV,EAAIS,KAAKE,GAAK,IAItCR,IAAK,SAAUH,GAEX,OAAOS,KAAKG,IAAIZ,EAAIS,KAAKE,GAAK,IAIlCP,MAAO,SAAUJ,GACb,MAAO,IAAO,EAAIS,KAAKC,IAAID,KAAKE,GAAKX,MAM7Ca,YAAa,CACTX,GAAI,SAAUF,GACV,OAAa,IAANA,EAAU,EAAIS,KAAKK,IAAI,KAAMd,EAAI,IAG5CG,IAAK,SAAUH,GACX,OAAa,IAANA,EAAU,EAAI,EAAIS,KAAKK,IAAI,GAAI,GAAKd,IAG/CI,MAAO,SAAUJ,GACb,OAAU,IAANA,EACO,EAGD,IAANA,EACO,GAGNA,GAAK,GAAK,EACJ,GAAMS,KAAKK,IAAI,KAAMd,EAAI,GAG7B,IAAqC,EAA7BS,KAAKK,IAAI,GAAI,IAAMd,EAAI,OAM9Ce,SAAU,CACNb,GAAI,SAAUF,GACV,OAAO,EAAIS,KAAKO,KAAK,EAAIhB,EAAIA,IAGjCG,IAAK,SAAUH,GAEX,OAAOS,KAAKO,KAAK,KAAOhB,EAAIA,IAIhCI,MAAO,SAAUJ,GACb,OAAKA,GAAK,GAAK,GACH,IAAOS,KAAKO,KAAK,EAAIhB,EAAIA,GAAK,GAGnC,IAAOS,KAAKO,KAAK,GAAKhB,GAAK,GAAKA,GAAK,KAMpDiB,QAAS,CACLf,GAAI,SAAUF,GACV,OAAU,IAANA,EACO,EAGD,IAANA,EACO,GAGHS,KAAKK,IAAI,EAAG,IAAMd,EAAI,IAAMS,KAAKG,IAAgB,GAAXZ,EAAI,KAAWS,KAAKE,KAGtER,IAAK,SAAUH,GACX,OAAU,IAANA,EACO,EAGD,IAANA,EACO,EAGJS,KAAKK,IAAI,GAAI,GAAKd,GAAKS,KAAKG,IAAgB,GAAXZ,EAAI,IAAWS,KAAKE,IAAM,GAGtEP,MAAO,SAAUJ,GACb,OAAU,IAANA,EACO,EAGD,IAANA,EACO,GAGXA,GAAK,GAEG,GACI,GAAMS,KAAKK,IAAI,EAAG,IAAMd,EAAI,IAAMS,KAAKG,IAAgB,GAAXZ,EAAI,KAAWS,KAAKE,IAGrE,GAAMF,KAAKK,IAAI,GAAI,IAAMd,EAAI,IAAMS,KAAKG,IAAgB,GAAXZ,EAAI,KAAWS,KAAKE,IAAM,IAMtFO,KAAM,CACFhB,GAAI,SAAUF,GACV,IAAImB,EAAI,QAER,OAAOnB,EAAIA,IAAMmB,EAAI,GAAKnB,EAAImB,IAGlChB,IAAK,SAAUH,GACX,IAAImB,EAAI,QAER,QAASnB,EAAIA,IAAMmB,EAAI,GAAKnB,EAAImB,GAAK,GAGzCf,MAAO,SAAUJ,GACb,IAAImB,EAAI,UAER,OAAKnB,GAAK,GAAK,EACGA,EAAIA,IAAMmB,EAAI,GAAKnB,EAAImB,GAA9B,GAGJ,KAAQnB,GAAK,GAAKA,IAAMmB,EAAI,GAAKnB,EAAImB,GAAK,KAMzDC,OAAQ,CACJlB,GAAI,SAAUF,GACV,OAAO,EAAI3E,MAAM6B,OAAOkE,OAAOjB,IAAI,EAAIH,IAG3CG,IAAK,SAAUH,GAEX,OAAIA,EAAK,EAAI,KACF,OAASA,EAAIA,EACbA,EAAK,EAAI,KACT,QAAUA,GAAM,IAAM,MAASA,EAAI,IACnCA,EAAK,IAAM,KACX,QAAUA,GAAM,KAAO,MAASA,EAAI,MAEpC,QAAUA,GAAM,MAAQ,MAASA,EAAI,SAIpDI,MAAO,SAAUJ,GACb,OAAIA,EAAI,GACmC,GAAhC3E,MAAM6B,OAAOkE,OAAOlB,GAAO,EAAJF,GAGU,GAArC3E,MAAM6B,OAAOkE,OAAOjB,IAAQ,EAAJH,EAAQ,GAAW,MAQ9D3E,MAAMiC,cAAgB,CAClBH,OAAQ,SAAUkE,EAAGrB,GACjB,IAAIsB,EAAID,EAAElG,OAAS,EACfoG,EAAID,EAAItB,EACRzE,EAAIkF,KAAKe,MAAMD,GACfE,EAAKpG,MAAMiC,cAAcoE,MAAMvE,OAEnC,OAAI6C,EAAI,EACGyB,EAAGJ,EAAE,GAAIA,EAAE,GAAIE,GAGtBvB,EAAI,EACGyB,EAAGJ,EAAEC,GAAID,EAAEC,EAAI,GAAIA,EAAIC,GAG3BE,EAAGJ,EAAE9F,GAAI8F,EAAE9F,EAAI,EAAI+F,EAAIA,EAAI/F,EAAI,GAAIgG,EAAIhG,IAGlDoG,OAAQ,SAAUN,EAAGrB,GAMjB,IALA,IAAI4B,EAAI,EACJC,EAAIR,EAAElG,OAAS,EACf2G,EAAKrB,KAAKK,IACViB,EAAK1G,MAAMiC,cAAcoE,MAAMM,UAE1BzG,EAAI,EAAGA,GAAKsG,EAAGtG,IACpBqG,GAAKE,EAAG,EAAI9B,EAAG6B,EAAItG,GAAKuG,EAAG9B,EAAGzE,GAAK8F,EAAE9F,GAAKwG,EAAGF,EAAGtG,GAGpD,OAAOqG,GAGXK,WAAY,SAAUZ,EAAGrB,GACrB,IAAIsB,EAAID,EAAElG,OAAS,EACfoG,EAAID,EAAItB,EACRzE,EAAIkF,KAAKe,MAAMD,GACfE,EAAKpG,MAAMiC,cAAcoE,MAAMO,WAEnC,OAAIZ,EAAE,KAAOA,EAAEC,IACPtB,EAAI,IACJzE,EAAIkF,KAAKe,MAAMD,EAAID,GAAK,EAAItB,KAGzByB,EAAGJ,GAAG9F,EAAI,EAAI+F,GAAKA,GAAID,EAAE9F,GAAI8F,GAAG9F,EAAI,GAAK+F,GAAID,GAAG9F,EAAI,GAAK+F,GAAIC,EAAIhG,IAGpEyE,EAAI,EACGqB,EAAE,IAAMI,EAAGJ,EAAE,GAAIA,EAAE,GAAIA,EAAE,GAAIA,EAAE,IAAKE,GAAKF,EAAE,IAGlDrB,EAAI,EACGqB,EAAEC,IAAMG,EAAGJ,EAAEC,GAAID,EAAEC,GAAID,EAAEC,EAAI,GAAID,EAAEC,EAAI,GAAIC,EAAID,GAAKD,EAAEC,IAG1DG,EAAGJ,EAAE9F,EAAIA,EAAI,EAAI,GAAI8F,EAAE9F,GAAI8F,EAAEC,EAAI/F,EAAI,EAAI+F,EAAI/F,EAAI,GAAI8F,EAAEC,EAAI/F,EAAI,EAAI+F,EAAI/F,EAAI,GAAIgG,EAAIhG,IAKlGmG,MAAO,CACHvE,OAAQ,SAAU+E,EAAIC,EAAIC,GACtB,OAAQD,EAAKD,GAAME,EAAIF,GAG3BF,UAAW,SAAUH,EAAGtG,GACpB,IAAI8G,EAAKhH,MAAMiC,cAAcoE,MAAMY,UAEnC,OAAOD,EAAGR,GAAKQ,EAAG9G,GAAK8G,EAAGR,EAAItG,IAGlC+G,WACQ7G,EAAI,CAAC,GAEF,SAAUoG,GACb,IAAIV,EAAI,EAER,GAAI1F,EAAEoG,GACF,OAAOpG,EAAEoG,GAGb,IAAK,IAAItG,EAAIsG,EAAGtG,EAAI,EAAGA,IACnB4F,GAAK5F,EAIT,OADAE,EAAEoG,GAAKV,EACAA,IAIfc,WAAY,SAAUC,EAAIC,EAAII,EAAIC,EAAIJ,GAClC,IAAIK,EAAiB,IAAXF,EAAKL,GACXQ,EAAiB,IAAXF,EAAKL,GACXQ,EAAKP,EAAIA,EAGb,OAAQ,EAAID,EAAK,EAAII,EAAKE,EAAKC,IAFtBN,EAAIO,KAE+B,EAAIR,EAAK,EAAII,EAAK,EAAIE,EAAKC,GAAMC,EAAKF,EAAKL,EAAID,KAU7E,mBAAXS,QAAyBA,OAAOC,IAEvCD,OAAO,IAAI,WACP,OAAOvH,SAEc,oBAAXyH,QAA6C,iBAAZC,QAE/CD,OAAOC,QAAU1H,WACDD,IAIrBpB,OAAAA,KAFUqB,MAAQA"}