@roomle/web-sdk 2.43.0 → 2.44.0-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (316) hide show
  1. package/.releaserc.json +55 -58
  2. package/README.md +3 -0
  3. package/lib/banana-for-scale-58aa07e7.nomodule.js +2 -0
  4. package/lib/{banana-for-scale-d4c457d4.nomodule.js.map → banana-for-scale-58aa07e7.nomodule.js.map} +1 -1
  5. package/lib/banana-for-scale-b0cad920.js +2 -0
  6. package/lib/{banana-for-scale-29fe9ece.js.map → banana-for-scale-b0cad920.js.map} +1 -1
  7. package/lib/budgeteer-measure-23a42ba1.js +2 -0
  8. package/lib/budgeteer-measure-23a42ba1.js.map +1 -0
  9. package/lib/budgeteer-measure.nomodule.js +1 -1
  10. package/lib/budgeteer-measure.nomodule.js.map +1 -1
  11. package/lib/component-dimensioning-3e2b21b8.nomodule.js +2 -0
  12. package/lib/component-dimensioning-3e2b21b8.nomodule.js.map +1 -0
  13. package/lib/{component-dimensioning-7b9b757c.nomodule.js → component-dimensioning-c2294a31.js} +2 -2
  14. package/lib/component-dimensioning-c2294a31.js.map +1 -0
  15. package/lib/{component-raycast-helper-e2883ebb.nomodule.js → component-raycast-helper-0b429141.nomodule.js} +2 -2
  16. package/lib/component-raycast-helper-0b429141.nomodule.js.map +1 -0
  17. package/lib/{component-raycast-helper-1eac1f65.js → component-raycast-helper-96be30dc.js} +2 -2
  18. package/lib/component-raycast-helper-96be30dc.js.map +1 -0
  19. package/lib/{configurator-df61a67c.js → configurator-1a9502eb.js} +2 -2
  20. package/lib/configurator-1a9502eb.js.map +1 -0
  21. package/lib/{configurator-9b988733.nomodule.js → configurator-ad930002.nomodule.js} +2 -2
  22. package/lib/configurator-ad930002.nomodule.js.map +1 -0
  23. package/lib/configurator-dummy-app.js.map +1 -1
  24. package/lib/configurator-dummy.html +167 -79
  25. package/lib/configurator-main-d4d311c0.js +2 -0
  26. package/lib/configurator-main-d4d311c0.js.map +1 -0
  27. package/lib/configurator-main.nomodule.js +1 -1
  28. package/lib/{default-light-setting-004b9cd2.js → default-light-setting-17aeb133.js} +2 -2
  29. package/lib/default-light-setting-17aeb133.js.map +1 -0
  30. package/lib/{default-light-setting-c6c8e1ad.nomodule.js → default-light-setting-917cc079.nomodule.js} +2 -2
  31. package/lib/default-light-setting-917cc079.nomodule.js.map +1 -0
  32. package/lib/definitions/acceptance-tests/src/utils/async-acceptance-test.d.ts +1 -1
  33. package/lib/definitions/common-core/mock/three-mock.d.ts +1 -1
  34. package/lib/definitions/common-core/src/error-handler.d.ts +1 -1
  35. package/lib/definitions/common-core/src/kernel-io.d.ts +1 -1
  36. package/lib/definitions/common-core/src/lightsetting/dynamic-light-setting-loader.d.ts +1 -1
  37. package/lib/definitions/common-core/src/rapi-access.d.ts +3 -3
  38. package/lib/definitions/common-core/src/script-loader.d.ts +1 -1
  39. package/lib/definitions/common-core/src/utils/common-utils.d.ts +1 -1
  40. package/lib/definitions/common-core/src/view-model/configurator-view-model.d.ts +1 -0
  41. package/lib/definitions/common-core/src/webgl/image-renderer.d.ts +1 -1
  42. package/lib/definitions/configurator-core/src/roomle-configurator.d.ts +58 -58
  43. package/lib/definitions/configurator-core/src/services/configurator-ui-callback.d.ts +2 -2
  44. package/lib/definitions/configurator-core/src/utils/event-dispatcher.d.ts +1 -1
  45. package/lib/definitions/configurator-core/src/utils/indexeddb-adapter.d.ts +2 -2
  46. package/lib/definitions/configurator-core/src/utils/test-helpers/interaction-helper.d.ts +2 -2
  47. package/lib/definitions/configurator-core/src/utils/test-helpers/ui-mock.d.ts +3 -3
  48. package/lib/definitions/configurator-core/src/utils/ui-intersection-helper.d.ts +2 -2
  49. package/lib/definitions/planner-core/mock/planner-kernel-access-mock.d.ts +1 -1
  50. package/lib/definitions/planner-core/src/roomle-planner-ui-callback.d.ts +1 -0
  51. package/lib/definitions/tools-core/src/roomle-tools-core.d.ts +1 -1
  52. package/lib/definitions/typings/global-definitions.d.ts +1 -1
  53. package/lib/definitions/typings/helper.d.ts +1 -1
  54. package/lib/definitions/typings/kernel.d.ts +1 -1
  55. package/lib/definitions/typings/rapi-types.d.ts +9 -9
  56. package/lib/definitions/workers/src/budgeteer.sw.d.ts +1 -1
  57. package/lib/dimensioning-helper-0995e4b8.nomodule.js +2 -0
  58. package/lib/dimensioning-helper-0995e4b8.nomodule.js.map +1 -0
  59. package/lib/dimensioning-helper-b166264a.js +2 -0
  60. package/lib/{dimensioning-helper-707197b7.js.map → dimensioning-helper-b166264a.js.map} +1 -1
  61. package/lib/embedding-dummy.html +122 -94
  62. package/lib/glb-viewer-45e04caa.js +2 -0
  63. package/lib/{glb-viewer-a3b1ff73.js.map → glb-viewer-45e04caa.js.map} +1 -1
  64. package/lib/glb-viewer-dummy-app.js.map +1 -1
  65. package/lib/glb-viewer-dummy.html +44 -30
  66. package/lib/glb-viewer-f5f9a050.nomodule.js +2 -0
  67. package/lib/{glb-viewer-23b774e0.nomodule.js.map → glb-viewer-f5f9a050.nomodule.js.map} +1 -1
  68. package/lib/glb-viewer-main-be603c6d.js +2 -0
  69. package/lib/glb-viewer-main-be603c6d.js.map +1 -0
  70. package/lib/glb-viewer-main.nomodule.js +1 -1
  71. package/lib/legacy/banana-for-scale-2021b8ce.legacy.js +2 -0
  72. package/lib/legacy/{banana-for-scale-f8ab137f.legacy.js.map → banana-for-scale-2021b8ce.legacy.js.map} +1 -1
  73. package/lib/legacy/budgeteer-measure.legacy.js +1 -1
  74. package/lib/legacy/budgeteer-measure.legacy.js.map +1 -1
  75. package/lib/legacy/component-dimensioning-f4289533.legacy.js +2 -0
  76. package/lib/legacy/component-dimensioning-f4289533.legacy.js.map +1 -0
  77. package/lib/legacy/{component-raycast-helper-59acc8b8.legacy.js → component-raycast-helper-afb624ed.legacy.js} +2 -2
  78. package/lib/legacy/component-raycast-helper-afb624ed.legacy.js.map +1 -0
  79. package/lib/legacy/{configurator-678bed92.legacy.js → configurator-431855b5.legacy.js} +2 -2
  80. package/lib/legacy/configurator-431855b5.legacy.js.map +1 -0
  81. package/lib/legacy/configurator-main.legacy.js +1 -1
  82. package/lib/legacy/{default-light-setting-0eae7ddf.legacy.js → default-light-setting-29282b63.legacy.js} +2 -2
  83. package/lib/legacy/default-light-setting-29282b63.legacy.js.map +1 -0
  84. package/lib/legacy/dimensioning-helper-b5001288.legacy.js +2 -0
  85. package/lib/legacy/dimensioning-helper-b5001288.legacy.js.map +1 -0
  86. package/lib/legacy/glb-viewer-0020898e.legacy.js +2 -0
  87. package/lib/legacy/{glb-viewer-ddc7a29d.legacy.js.map → glb-viewer-0020898e.legacy.js.map} +1 -1
  88. package/lib/legacy/glb-viewer-main.legacy.js +1 -1
  89. package/lib/legacy/main-thread-to-worker-cc24f989.legacy.js +2 -0
  90. package/lib/legacy/main-thread-to-worker-cc24f989.legacy.js.map +1 -0
  91. package/lib/legacy/material-viewer-51065b97.legacy.js +2 -0
  92. package/lib/legacy/material-viewer-51065b97.legacy.js.map +1 -0
  93. package/lib/legacy/material-viewer-main.legacy.js +1 -1
  94. package/lib/legacy/pixotron-e0f1cf47.legacy.js +2 -0
  95. package/lib/legacy/{pixotron-80fe5913.legacy.js.map → pixotron-e0f1cf47.legacy.js.map} +1 -1
  96. package/lib/legacy/planner-1af4bef2.legacy.js +2 -0
  97. package/lib/legacy/{planner-e41a2569.legacy.js.map → planner-1af4bef2.legacy.js.map} +1 -1
  98. package/lib/legacy/planner-main.legacy.js +1 -1
  99. package/lib/legacy/roomle-configurator-40f860e2.legacy.js +2 -0
  100. package/lib/legacy/{roomle-configurator-6602a267.legacy.js.map → roomle-configurator-40f860e2.legacy.js.map} +1 -1
  101. package/lib/legacy/roomle-dependency-injection-c465c69e.legacy.js +16 -0
  102. package/lib/legacy/{roomle-dependency-injection-e294616d.legacy.js.map → roomle-dependency-injection-c465c69e.legacy.js.map} +1 -1
  103. package/lib/legacy/roomle-sdk.legacy.js +1 -1
  104. package/lib/legacy/{script-loader-9dc48cfd.legacy.js → script-loader-f53b8215.legacy.js} +2 -2
  105. package/lib/legacy/script-loader-f53b8215.legacy.js.map +1 -0
  106. package/lib/legacy/static/{ConfiguratorKernel-e9065c8be4011f61.js → ConfiguratorKernel-0f003a2d53bdb498.js} +74 -73
  107. package/lib/legacy/static/ConfiguratorKernel-fee68dd17368f9c8.wasm +0 -0
  108. package/lib/legacy/static/ConfiguratorKernelJs-397177488117675e.js +146 -0
  109. package/lib/legacy/static/ConfiguratorKernelJs-6735c733ccd66361.mem +0 -0
  110. package/lib/legacy/static/DepthShadowGenerator-a3a9d85ff2c3d24c.js +266 -0
  111. package/lib/legacy/static/RoomleCore-4eb435620392fcc4.js +130 -0
  112. package/lib/legacy/static/RoomleCore-83f9a9bf9e4d7f73.wasm +0 -0
  113. package/lib/legacy/static/RoomleCoreJs-46a5e90adbb12d0c.js +154 -0
  114. package/lib/legacy/static/RoomleCoreJs-8bc350683d3c35ae.mem +0 -0
  115. package/lib/legacy/static/{RoomleToolsCore-eb38af3a8c882dff.js → RoomleToolsCore-2ec3c50f245db642.js} +70 -70
  116. package/lib/legacy/static/RoomleToolsCore-e949cc1f9026c61f.wasm +0 -0
  117. package/lib/legacy/static/Tween-5ebfb82307807fdc.js +767 -0
  118. package/lib/legacy/static/{asset-loader.worker-796c70f59b977071.js → asset-loader.worker-caa87aba0f76ce49.js} +1 -1
  119. package/lib/legacy/static/{budgeteer.sw-e7566da86237bca8.js → budgeteer.sw-0a8d4e36e18346a5.js} +1 -1
  120. package/lib/legacy/static/camera-05824b47cdb951e4.json +39 -0
  121. package/lib/legacy/static/dat.gui.min-24a0d861d5534d62.js +2447 -0
  122. package/lib/legacy/static/rubik_regular-bc008a7de2daee79.json +3535 -0
  123. package/lib/legacy/static/rubik_regular_sub-2dd2d5cca49018c5.json +168 -0
  124. package/lib/legacy/static/shaders-88030e4fbae39928.json +1 -0
  125. package/lib/legacy/stats-helper-951a6039.legacy.js +2 -0
  126. package/lib/legacy/{stats-helper-b0633f63.legacy.js.map → stats-helper-951a6039.legacy.js.map} +1 -1
  127. package/lib/legacy/{tools-core-0b66a05d.legacy.js → tools-core-8e9fd5dd.legacy.js} +2 -2
  128. package/lib/legacy/tools-core-8e9fd5dd.legacy.js.map +1 -0
  129. package/lib/main-thread-to-worker-6a4eb1ee.nomodule.js +2 -0
  130. package/lib/main-thread-to-worker-6a4eb1ee.nomodule.js.map +1 -0
  131. package/lib/main-thread-to-worker-88f74244.js +2 -0
  132. package/lib/main-thread-to-worker-88f74244.js.map +1 -0
  133. package/lib/material-viewer-2df0572f.nomodule.js +2 -0
  134. package/lib/material-viewer-2df0572f.nomodule.js.map +1 -0
  135. package/lib/material-viewer-ca21925a.js +2 -0
  136. package/lib/material-viewer-ca21925a.js.map +1 -0
  137. package/lib/material-viewer-dummy-app.js.map +1 -1
  138. package/lib/material-viewer-dummy.html +39 -22
  139. package/lib/material-viewer-main-5b2d8fb1.js +2 -0
  140. package/lib/material-viewer-main-5b2d8fb1.js.map +1 -0
  141. package/lib/material-viewer-main.nomodule.js +1 -1
  142. package/lib/measure.html +27 -34
  143. package/lib/pixotron-32c4e05d.js +2 -0
  144. package/lib/{pixotron-4eb69a29.js.map → pixotron-32c4e05d.js.map} +1 -1
  145. package/lib/pixotron-3be821e5.nomodule.js +2 -0
  146. package/lib/{pixotron-b8a4128f.nomodule.js.map → pixotron-3be821e5.nomodule.js.map} +1 -1
  147. package/lib/planner-07dfff6d.js +2 -0
  148. package/lib/{planner-05629dc5.js.map → planner-07dfff6d.js.map} +1 -1
  149. package/lib/planner-21a6fccd.nomodule.js +2 -0
  150. package/lib/{planner-0c378c93.nomodule.js.map → planner-21a6fccd.nomodule.js.map} +1 -1
  151. package/lib/planner-dummy-app.js.map +1 -1
  152. package/lib/planner-dummy.html +64 -43
  153. package/lib/planner-main-8a56d68d.js +2 -0
  154. package/lib/planner-main-8a56d68d.js.map +1 -0
  155. package/lib/planner-main.nomodule.js +1 -1
  156. package/lib/roomle-configurator-072f6af1.nomodule.js +2 -0
  157. package/lib/{roomle-configurator-ca8a3f05.nomodule.js.map → roomle-configurator-072f6af1.nomodule.js.map} +1 -1
  158. package/lib/roomle-configurator-21e1c87c.js +2 -0
  159. package/lib/{roomle-configurator-a2354193.js.map → roomle-configurator-21e1c87c.js.map} +1 -1
  160. package/lib/roomle-dependency-injection-8d66ecac.js +16 -0
  161. package/lib/{roomle-dependency-injection-dade8841.js.map → roomle-dependency-injection-8d66ecac.js.map} +1 -1
  162. package/lib/roomle-dependency-injection-f0b933f6.nomodule.js +16 -0
  163. package/lib/{roomle-dependency-injection-4d02aeed.nomodule.js.map → roomle-dependency-injection-f0b933f6.nomodule.js.map} +1 -1
  164. package/lib/{roomle-sdk-acba0c06.js → roomle-sdk-038a1704.js} +2 -2
  165. package/lib/roomle-sdk-038a1704.js.map +1 -0
  166. package/lib/roomle-sdk.nomodule.js +1 -1
  167. package/lib/{script-loader-122c197b.js → script-loader-a1d7afdd.js} +2 -2
  168. package/lib/script-loader-a1d7afdd.js.map +1 -0
  169. package/lib/{script-loader-425dddf6.nomodule.js → script-loader-c56ceed8.nomodule.js} +2 -2
  170. package/lib/script-loader-c56ceed8.nomodule.js.map +1 -0
  171. package/lib/static/ConfiguratorKernel-0f003a2d53bdb498.js +1 -0
  172. package/lib/static/ConfiguratorKernel-0f003a2d53bdb498.js.map +1 -0
  173. package/lib/static/ConfiguratorKernel-fee68dd17368f9c8.wasm +0 -0
  174. package/lib/static/ConfiguratorKernelJs-397177488117675e.js +146 -0
  175. package/lib/static/ConfiguratorKernelJs-6735c733ccd66361.mem +0 -0
  176. package/lib/static/{DepthShadowGenerator-4c4b06f0801c4034.js → DepthShadowGenerator-a3a9d85ff2c3d24c.js} +0 -0
  177. package/lib/static/DepthShadowGenerator-a3a9d85ff2c3d24c.js.map +1 -0
  178. package/lib/static/RoomleCore-4eb435620392fcc4.js +1 -0
  179. package/lib/static/RoomleCore-4eb435620392fcc4.js.map +1 -0
  180. package/lib/static/RoomleCore-83f9a9bf9e4d7f73.wasm +0 -0
  181. package/lib/static/RoomleCoreJs-46a5e90adbb12d0c.js +154 -0
  182. package/lib/static/RoomleCoreJs-8bc350683d3c35ae.mem +0 -0
  183. package/lib/static/RoomleToolsCore-2ec3c50f245db642.js +1 -0
  184. package/lib/static/RoomleToolsCore-2ec3c50f245db642.js.map +1 -0
  185. package/lib/static/RoomleToolsCore-e949cc1f9026c61f.wasm +0 -0
  186. package/lib/static/{Tween-d024b02fe34f25ab.js → Tween-5ebfb82307807fdc.js} +0 -0
  187. package/lib/static/Tween-5ebfb82307807fdc.js.map +1 -0
  188. package/lib/static/{asset-loader.worker-796c70f59b977071.js → asset-loader.worker-caa87aba0f76ce49.js} +1 -1
  189. package/lib/static/{asset-loader.worker-796c70f59b977071.js.map → asset-loader.worker-caa87aba0f76ce49.js.map} +0 -0
  190. package/lib/static/asset-loader.worker.js +1 -1
  191. package/lib/static/{budgeteer.sw-e7566da86237bca8.js → budgeteer.sw-0a8d4e36e18346a5.js} +1 -1
  192. package/lib/static/{budgeteer.sw-e7566da86237bca8.js.map → budgeteer.sw-0a8d4e36e18346a5.js.map} +0 -0
  193. package/lib/static/budgeteer.sw.js +1 -1
  194. package/lib/static/camera-05824b47cdb951e4.json +39 -0
  195. package/lib/static/{dat.gui.min-b5cbb61e5c62f0bf.js → dat.gui.min-24a0d861d5534d62.js} +0 -0
  196. package/lib/static/dat.gui.min-24a0d861d5534d62.js.map +1 -0
  197. package/lib/static/rubik_regular-bc008a7de2daee79.json +3535 -0
  198. package/lib/static/rubik_regular_sub-2dd2d5cca49018c5.json +168 -0
  199. package/lib/static/shaders-88030e4fbae39928.json +1 -0
  200. package/lib/static/worker-to-main-thread-3ad1cee7.js +1 -0
  201. package/lib/static/worker-to-main-thread-3ad1cee7.js.map +1 -0
  202. package/lib/static/worker-to-main-thread-73234f7a.js +1 -0
  203. package/lib/static/worker-to-main-thread-73234f7a.js.map +1 -0
  204. package/lib/stats-helper-53909b17.js +2 -0
  205. package/lib/{stats-helper-c731f63a.js.map → stats-helper-53909b17.js.map} +1 -1
  206. package/lib/{stats-helper-c731f63a.js → stats-helper-a75dc3da.nomodule.js} +2 -2
  207. package/lib/{stats-helper-37c0d77c.nomodule.js.map → stats-helper-a75dc3da.nomodule.js.map} +1 -1
  208. package/lib/{tools-core-4c13977c.js → tools-core-4e24e712.js} +2 -2
  209. package/lib/tools-core-4e24e712.js.map +1 -0
  210. package/lib/{tools-core-89d54f1f.nomodule.js → tools-core-865f89df.nomodule.js} +2 -2
  211. package/lib/tools-core-865f89df.nomodule.js.map +1 -0
  212. package/package.json +2 -2
  213. package/scripts/copy-assets-sdk.js +68 -56
  214. package/lib/banana-for-scale-29fe9ece.js +0 -2
  215. package/lib/banana-for-scale-d4c457d4.nomodule.js +0 -2
  216. package/lib/budgeteer-measure-1377faa9.js +0 -2
  217. package/lib/budgeteer-measure-1377faa9.js.map +0 -1
  218. package/lib/component-dimensioning-7b9b757c.nomodule.js.map +0 -1
  219. package/lib/component-dimensioning-d77dc5fd.js +0 -2
  220. package/lib/component-dimensioning-d77dc5fd.js.map +0 -1
  221. package/lib/component-raycast-helper-1eac1f65.js.map +0 -1
  222. package/lib/component-raycast-helper-e2883ebb.nomodule.js.map +0 -1
  223. package/lib/configurator-9b988733.nomodule.js.map +0 -1
  224. package/lib/configurator-df61a67c.js.map +0 -1
  225. package/lib/configurator-main-c2a9b119.js +0 -2
  226. package/lib/configurator-main-c2a9b119.js.map +0 -1
  227. package/lib/default-light-setting-004b9cd2.js.map +0 -1
  228. package/lib/default-light-setting-c6c8e1ad.nomodule.js.map +0 -1
  229. package/lib/dimensioning-helper-62227f7c.nomodule.js +0 -2
  230. package/lib/dimensioning-helper-62227f7c.nomodule.js.map +0 -1
  231. package/lib/dimensioning-helper-707197b7.js +0 -2
  232. package/lib/glb-viewer-23b774e0.nomodule.js +0 -2
  233. package/lib/glb-viewer-a3b1ff73.js +0 -2
  234. package/lib/glb-viewer-main-b413d64a.js +0 -2
  235. package/lib/glb-viewer-main-b413d64a.js.map +0 -1
  236. package/lib/legacy/banana-for-scale-f8ab137f.legacy.js +0 -2
  237. package/lib/legacy/component-dimensioning-06a6f9ee.legacy.js +0 -2
  238. package/lib/legacy/component-dimensioning-06a6f9ee.legacy.js.map +0 -1
  239. package/lib/legacy/component-raycast-helper-59acc8b8.legacy.js.map +0 -1
  240. package/lib/legacy/configurator-678bed92.legacy.js.map +0 -1
  241. package/lib/legacy/default-light-setting-0eae7ddf.legacy.js.map +0 -1
  242. package/lib/legacy/dimensioning-helper-97e8b9c5.legacy.js +0 -2
  243. package/lib/legacy/dimensioning-helper-97e8b9c5.legacy.js.map +0 -1
  244. package/lib/legacy/glb-viewer-ddc7a29d.legacy.js +0 -2
  245. package/lib/legacy/main-thread-to-worker-e2f2b9cb.legacy.js +0 -2
  246. package/lib/legacy/main-thread-to-worker-e2f2b9cb.legacy.js.map +0 -1
  247. package/lib/legacy/material-viewer-a01fd304.legacy.js +0 -2
  248. package/lib/legacy/material-viewer-a01fd304.legacy.js.map +0 -1
  249. package/lib/legacy/pixotron-80fe5913.legacy.js +0 -2
  250. package/lib/legacy/planner-e41a2569.legacy.js +0 -2
  251. package/lib/legacy/roomle-configurator-6602a267.legacy.js +0 -2
  252. package/lib/legacy/roomle-dependency-injection-e294616d.legacy.js +0 -16
  253. package/lib/legacy/script-loader-9dc48cfd.legacy.js.map +0 -1
  254. package/lib/legacy/static/ConfiguratorKernel-2e859fe27a3c86ed.wasm +0 -0
  255. package/lib/legacy/static/ConfiguratorKernelJs-23e7a53b8a38380c.mem +0 -0
  256. package/lib/legacy/static/ConfiguratorKernelJs-b43dc826821e864e.js +0 -146
  257. package/lib/legacy/static/DepthShadowGenerator-4c4b06f0801c4034.js +0 -262
  258. package/lib/legacy/static/RoomleCore-07c1ebfd847560ef.wasm +0 -0
  259. package/lib/legacy/static/RoomleCore-b08e77d418a3f4a0.js +0 -130
  260. package/lib/legacy/static/RoomleCoreJs-b207f4e5106d5bf5.js +0 -154
  261. package/lib/legacy/static/RoomleCoreJs-f9d0ac5ec78a81f3.mem +0 -0
  262. package/lib/legacy/static/RoomleToolsCore-c33ca3a9cb8ba880.wasm +0 -0
  263. package/lib/legacy/static/Tween-d024b02fe34f25ab.js +0 -913
  264. package/lib/legacy/static/camera-f4cef679615485dc.json +0 -39
  265. package/lib/legacy/static/dat.gui.min-b5cbb61e5c62f0bf.js +0 -13
  266. package/lib/legacy/static/rubik_regular-75bd7bb699e9e39d.json +0 -1
  267. package/lib/legacy/static/rubik_regular_sub-eb3f3b61078695cc.json +0 -1
  268. package/lib/legacy/static/shaders-7bdb2939b2a0d677.json +0 -1
  269. package/lib/legacy/stats-helper-b0633f63.legacy.js +0 -2
  270. package/lib/legacy/tools-core-0b66a05d.legacy.js.map +0 -1
  271. package/lib/main-thread-to-worker-681bab1a.js +0 -2
  272. package/lib/main-thread-to-worker-681bab1a.js.map +0 -1
  273. package/lib/main-thread-to-worker-7283a354.nomodule.js +0 -2
  274. package/lib/main-thread-to-worker-7283a354.nomodule.js.map +0 -1
  275. package/lib/material-viewer-2ca0de10.js +0 -2
  276. package/lib/material-viewer-2ca0de10.js.map +0 -1
  277. package/lib/material-viewer-ba8646c8.nomodule.js +0 -2
  278. package/lib/material-viewer-ba8646c8.nomodule.js.map +0 -1
  279. package/lib/material-viewer-main-dd95bf93.js +0 -2
  280. package/lib/material-viewer-main-dd95bf93.js.map +0 -1
  281. package/lib/pixotron-4eb69a29.js +0 -2
  282. package/lib/pixotron-b8a4128f.nomodule.js +0 -2
  283. package/lib/planner-05629dc5.js +0 -2
  284. package/lib/planner-0c378c93.nomodule.js +0 -2
  285. package/lib/planner-main-117f91e4.js +0 -2
  286. package/lib/planner-main-117f91e4.js.map +0 -1
  287. package/lib/roomle-configurator-a2354193.js +0 -2
  288. package/lib/roomle-configurator-ca8a3f05.nomodule.js +0 -2
  289. package/lib/roomle-dependency-injection-4d02aeed.nomodule.js +0 -16
  290. package/lib/roomle-dependency-injection-dade8841.js +0 -16
  291. package/lib/roomle-sdk-acba0c06.js.map +0 -1
  292. package/lib/script-loader-122c197b.js.map +0 -1
  293. package/lib/script-loader-425dddf6.nomodule.js.map +0 -1
  294. package/lib/static/ConfiguratorKernel-2e859fe27a3c86ed.wasm +0 -0
  295. package/lib/static/ConfiguratorKernel-e9065c8be4011f61.js +0 -1
  296. package/lib/static/ConfiguratorKernel-e9065c8be4011f61.js.map +0 -1
  297. package/lib/static/ConfiguratorKernelJs-23e7a53b8a38380c.mem +0 -0
  298. package/lib/static/ConfiguratorKernelJs-b43dc826821e864e.js +0 -146
  299. package/lib/static/DepthShadowGenerator-4c4b06f0801c4034.js.map +0 -1
  300. package/lib/static/RoomleCore-07c1ebfd847560ef.wasm +0 -0
  301. package/lib/static/RoomleCore-b08e77d418a3f4a0.js +0 -1
  302. package/lib/static/RoomleCore-b08e77d418a3f4a0.js.map +0 -1
  303. package/lib/static/RoomleCoreJs-b207f4e5106d5bf5.js +0 -154
  304. package/lib/static/RoomleCoreJs-f9d0ac5ec78a81f3.mem +0 -0
  305. package/lib/static/RoomleToolsCore-c33ca3a9cb8ba880.wasm +0 -0
  306. package/lib/static/RoomleToolsCore-eb38af3a8c882dff.js +0 -1
  307. package/lib/static/RoomleToolsCore-eb38af3a8c882dff.js.map +0 -1
  308. package/lib/static/Tween-d024b02fe34f25ab.js.map +0 -1
  309. package/lib/static/camera-f4cef679615485dc.json +0 -39
  310. package/lib/static/dat.gui.min-b5cbb61e5c62f0bf.js.map +0 -1
  311. package/lib/static/rubik_regular-75bd7bb699e9e39d.json +0 -1
  312. package/lib/static/rubik_regular_sub-eb3f3b61078695cc.json +0 -1
  313. package/lib/static/shaders-7bdb2939b2a0d677.json +0 -1
  314. package/lib/stats-helper-37c0d77c.nomodule.js +0 -2
  315. package/lib/tools-core-4c13977c.js.map +0 -1
  316. package/lib/tools-core-89d54f1f.nomodule.js.map +0 -1
@@ -1,16 +0,0 @@
1
- import{a as getValue,g as getAssetPath,M as MainThreadToWorker,h as handleJsonResponse,R as ROOMLE_COLORS,d as deepMerge,s as setDescriptor,b as setWriteable,c as createBenchmarkMaterial,e as createBenchmarkTexture,r as removeItem,f as getGlbUrl,w as wait,o as objectArrayToMap,u as uuid,i as setCursor,j as isString}from"./main-thread-to-worker-681bab1a.js";class Container{constructor(){this._context=new Map,this._lookups=new Map,this._singletons=new Map}getContext(e){if(this._context.has(e)){const t=this._context.get(e);return this._context.set(e,t+1),e+t}return this._context.set(e,1),e+0}addDependencyInjectionAssignments(e){e.forEach(e=>{this._lookups.set(e.className,e)})}lookup(e,t){if(!this._lookups.has(e))return null;const n=this._lookups.get(e);if(1===n.type&&void 0===t){const t="Dependency "+e+" has definition context but no context was defined!";return console.trace(t),console.error(t),null}let i=t&&1===n.type?t:"global";if(i+="_"+e,2===n.type)return new n.classDefinition;if(this._singletons.has(i))return this._singletons.get(i);const s=new n.classDefinition(t);return this._singletons.set(i,s),s}cleanUp(e){if(e){let t=[];this._singletons.forEach((n,i)=>{i.startsWith(e)&&t.push(i)}),t.forEach(e=>{this._singletons.delete(e)})}else this._singletons.clear(),this._singletons=new Map}}class DependencyInjectionAssignment{constructor(e,t,n){this.className=e,this.classDefinition=t,this.type=void 0===n?0:n}}const IMAGE_FORMATS={JPG:".jpg",JPEG:".jpeg",PNG:".png",GIF:".gif"};class FormDataUtil{_base64toBlob(e,t){t=t||"";const n=atob(e),i=n.length,s=Math.ceil(i/1024),o=new Array(s);for(let e=0;e<s;++e){let t=1024*e,s=Math.min(t+1024,i);const r=new Array(s-t);for(let e=t,i=0;e<s;++i,++e)r[i]=n[e].charCodeAt(0);o[e]=new Uint8Array(r)}return new Blob(o,{type:t})}_createFormData(e,t,n,i){const s=new FormData;-1!==e.indexOf(",")&&(e=e.substr(e.indexOf(",")+1));const o=-1===Object.keys(IMAGE_FORMATS).map(e=>IMAGE_FORMATS[e]).indexOf(n)?"application":"image",r=this._base64toBlob(e,o+"/"+n.substr(1));return s.append(i,r,t+n),s}create(e,t,n,i){return this._createFormData(e,t,n,i)}}
2
- /*! *****************************************************************************
3
- Copyright (c) Microsoft Corporation.
4
-
5
- Permission to use, copy, modify, and/or distribute this software for any
6
- purpose with or without fee is hereby granted.
7
-
8
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
9
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
10
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
11
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
12
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
13
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14
- PERFORMANCE OF THIS SOFTWARE.
15
- ***************************************************************************** */function __decorate(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}class EnvMapReader{constructor(){this._size=256,this._maxLod=0,this._encoding=THREE.LinearEncoding,this._type=THREE.UnsignedByteType,this._format=THREE.RGBAFormat,this._cubeTextures=[],this._lightDirection=new THREE.Vector3,this._path=""}setPath(e){this._path=e}load(e){return new Promise(t=>{(new THREE.FileLoader).setResponseType("arraybuffer").load(this._path+e,e=>{this.parseData_(e),t(this._cubeTexture)})})}parseHeader_(e){let t=new DataView(e,0,30);this._size=t.getUint16(0),this._maxLod=t.getUint8(2),this._encoding=t.getUint16(3),this._type=t.getUint16(5),this._format=t.getUint16(7),this._lightDirection.x=t.getFloat32(9),this._lightDirection.y=t.getFloat32(13),this._lightDirection.z=t.getFloat32(17)}parseBufferData_(e,t){let n=this._size;const i=Math.log2(this._size)+1;this._cubeTextures=[];for(let s=0;s<i;s++){let i=new THREE.CubeTexture;this._cubeTextures.push(i),i.format=THREE.RGBAFormat,i.encoding=this._encoding,i.type=this._type,i.minFilter=THREE.LinearMipMapLinearFilter,i.magFilter=THREE.LinearFilter,i.generateMipmaps=!1;for(let s=0;s<6;s++){let o=new Uint8Array(e,t,4*n*n),r=new THREE.DataTexture(o,n,n);r.format=i.format,r.encoding=i.encoding,r.type=i.type,r.generateMipmaps=!1,t+=4*n*n,i.images[s]=r,r.needsUpdate=!0}i.needsUpdate=!0,n/=2}this._cubeTexture=new THREE.CubeTexture,this._cubeTexture.format=THREE.RGBAFormat,this._cubeTexture.encoding=this._encoding,this._cubeTexture.type=this._type,this._cubeTexture.minFilter=THREE.LinearMipMapLinearFilter,this._cubeTexture.magFilter=THREE.LinearFilter,this._cubeTexture.generateMipmaps=!1;for(let e=0;e<6;e++){this._cubeTexture.image[e]=this._cubeTextures[0].images[e];for(let e=1;e<i;e++)this._cubeTexture.mipmaps[e-1]=this._cubeTextures[e],this._cubeTextures[e].needsUpdate=!0}this._cubeTexture.needsUpdate=!0,this._cubeTexture.maxLod=this._maxLod-1}convertToRGBABuffer(e){let t=new Uint8Array(e,30,e.byteLength-30),n=4;this._format===THREE.RGBFormat&&(n=3);const i=4*t.length/n;let s=new ArrayBuffer(i),o=new DataView(s),r=0,a=t.length/n;if(3===n)for(let e=0;e<a;e++)o.setUint8(r++,t[e]),o.setUint8(r++,t[e+a]),o.setUint8(r++,t[e+2*a]),o.setUint8(r++,255);else for(let e=0;e<a;e++)o.setUint8(r++,t[e]),o.setUint8(r++,t[e+a]),o.setUint8(r++,t[e+2*a]),o.setUint8(r++,t[e+3*a]);return s}parseData_(e){this.parseHeader_(e);let t=30;t=0;let n=this.convertToRGBABuffer(e);this.parseBufferData_(n,0)}}const toRadiant=function(e){return e*(Math.PI/180)},toDegrees=function(e){return e*(180/Math.PI)},getIdealDistance=function(e,t,n,i,s,o){e=Math.sqrt(e*e+n*n);const r=s/o,a=2*Math.atan(Math.tan(i*Math.PI/180/2)*r)*180/Math.PI,l=toRadiant(i),c=t/2/Math.tan(l/2),h=e/(2*Math.atan(Math.PI*a/360));return Math.max(c,h)},round=function(e){return Math.round(1e3*e)/1e3},getDelta=function(e,t){return Math.abs(e.y-t.y)+Math.abs(e.x-t.x)},getScreenXY=(e,t,n,i)=>{if(!e||!t||0===n||0===i)return new THREE.Vector3;let s=e.clone(),o=n/2,r=i/2;return s.project(t),s.x=Math.floor(s.x*o+o),s.y=Math.floor(-s.y*r+r),s.z=e.distanceTo(t.position),s},kernelBoxToThreeBox=(e,t)=>{t||(t=new THREE.Vector3(0,0,0));let n=new THREE.Vector3(e.size.x/1e3,e.size.z/1e3,e.size.y/1e3),i=new THREE.Vector3(e.origin.x/1e3,e.origin.z/1e3,e.origin.y/-1e3),s=new THREE.Vector3(0,0,-n.z).add(i).sub(t),o=new THREE.Vector3(n.x,n.y,0).add(i).add(t);return new THREE.Box3(s,o)},position3VectorsAreEqual=(e,t)=>{let n=round(e.x),i=round(e.y),s=round(e.z),o=round(t.x),r=round(t.y),a=round(t.z);return n===o&&i===r&&s===a},rotationQuaternionsAreEqual=(e,t)=>{let n=round(e.w),i=round(e.x),s=round(e.y),o=round(e.z),r=round(t.w),a=round(t.x),l=round(t.y),c=round(t.z);return n===r&&i===a&&s===l&&o===c},position2VectorsAreEqual=(e,t)=>{let n=round(e.x),i=round(e.y),s=round(t.x),o=round(t.y);return n===s&&i===o};let whiteTexture=null;const getWhiteTexture=()=>{if(whiteTexture)return whiteTexture;const e=new Uint8Array(4);for(let t=0;t<1;t++){const n=4*t;e[n]=255,e[n+1]=255,e[n+2]=255,e[n+3]=255}const t=new THREE.DataTexture(e,1,1,THREE.RGBAFormat);return t.needsUpdate=!0,t},createColorTexture=(e,t,n,i)=>{const s=new Uint8Array(4),o=Math.floor(255*e),r=Math.floor(255*t),a=Math.floor(255*n),l=Math.floor(255*i);for(let e=0;e<4;e++){const t=4*e;s[t]=o,s[t+1]=r,s[t+2]=a,s[t+3]=l}const c=new THREE.DataTexture(s,1,1,THREE.RGBAFormat);return c.needsUpdate=!0,c},createMaterial=(e,t)=>setMaterial(null,e,t),setMaterial=(e,t,n)=>{if(e||(e=createMeshPhysicalMaterial()),e.name=t.id?t.id.toString():"",void 0!==t.shading.metallic&&(e.metalness=1===t.shading.metallic?1:.5,e.reflectivity=getValue(t.shading.metallic,.5)),t.shading.transmission&&t.shading.transmission>0?(e.transmission=t.shading.transmission,e.opacity=1,e.transparent=!0,e.depthWrite=!1,e.metalness=0):void 0!==t.shading.alpha&&t.shading.alpha<1&&(e.transparent=t.shading.alpha<1,e.opacity=t.shading.alpha,e.depthWrite=t.shading.alpha>=1),e.aoMapIntensity=getValue(t.shading.occlusion,1),e.roughness=getValue(t.shading.roughness,.5),e.alphaTest=getValue(t.shading.alphaCutoff,0),void 0!==t.shading.basecolor){const n=new THREE.Color(t.shading.basecolor.r,t.shading.basecolor.g,t.shading.basecolor.b);e.color.copy(n.convertSRGBToLinear())}return null==n||n.setEnvMap(e),t.shading.doubleSided?e.side=THREE.DoubleSide:e.side=THREE.FrontSide,e.map||(whiteTexture||(whiteTexture=getWhiteTexture()),e.map=whiteTexture),e},createMeshPhysicalMaterial=()=>new THREE.MeshPhysicalMaterial({}),getMaterialShading=e=>{let t=e.color.clone().convertLinearToSRGB(),n={alpha:e.opacity,metallic:e.reflectivity,basecolor:{r:t.r,g:t.g,b:t.b},roughness:e.roughness,doubleSided:e.side===THREE.DoubleSide,alphaCutoff:e.alphaTest,transmission:e.transmission};return 1===e.metalness?n.metallic=1:n.metallic=e.reflectivity,n};let textureLoader=null;const addTexture=(e,t,n,i,s,o,r=16)=>(textureLoader||(textureLoader=new THREE.TextureLoader,textureLoader.crossOrigin=""),new Promise((a,l)=>{if(!e)return console.warn("trying to add a texture without image",t),void a();textureLoader.load(e,e=>{addExistingTexture(e,t,n,i,s,o,r),a()},l)})),addExistingTexture=(e,t,n,i,s,o,r=16)=>{e.anisotropy=i,e.wrapS=THREE.RepeatWrapping,e.wrapT=THREE.RepeatWrapping,"ORM"===t.mapping&&r<=8?console.warn("ORM maps are not supported on devices with only "+r+" texture units"):(e.repeat.set(s,o),"XYZ"===t.mapping?(n.normalMap=e,n.map===getWhiteTexture()&&(n.map=null)):"ORM"===t.mapping?(n.aoMap=e,n.roughnessMap=e,n.metalnessMap=e):(e.encoding=THREE.sRGBEncoding,n.map=e),"RGBA"===t.mapping&&(n.transparent=!0),n.needsUpdate=!0)},getGUI=(e=!0)=>window.dat&&window.dat.GUI?(window.__RML_GUI__||(window.__RML_GUI__=new dat.GUI({autoPlace:e})),window.__RML_GUI__):null,setWallTransparencyBasedOnCamera=(e,t,n=!0)=>{let i=e.getWorldDirection(new THREE.Vector3),s=Math.abs(i.y);s<.5&&!t.transparent&&setWallTransparency(t,!0,n),s>.5&&t.transparent&&setWallTransparency(t,!1,n)},setWallTransparency=(e,t,n=!0)=>{if(!e.userData.tween)if(t)if(e.transparent=!0,n){let t={opacity:1};e.userData.tween=!0,new TWEEN.Tween(t).to({opacity:.2},400).easing(TWEEN.Easing.Sinusoidal.In).onUpdate(()=>{e.opacity=t.opacity}).onComplete(()=>{e.userData.tween=!1}).start()}else e.opacity=.2;else if(n){let t={opacity:.2};e.userData.tween=!0,new TWEEN.Tween(t).to({opacity:1},400).easing(TWEEN.Easing.Sinusoidal.In).onUpdate(()=>{e.opacity=t.opacity}).onComplete(()=>{e.transparent=!1,e.userData.tween=!1}).start()}else e.opacity=1,e.transparent=!1},transitionTransparencyOfMaterial=(e,t)=>{e.traverse(e=>{if(e instanceof THREE.Mesh&&TWEEN){const n=e.material;e.userData.tween&&e.userData.tween.stop();const i={opacity:n.opacity};t.transparent&&(n.transparent=t.transparent),e.userData.tween=new TWEEN.Tween(i).to(t,250).easing(TWEEN.Easing.Linear.None).onUpdate(()=>{n.opacity=i.opacity}).onStop(()=>{t.transparent||(n.transparent=t.transparent),n.opacity=t.opacity,n.needsUpdate=!0,e.userData.tween=void 0}).onComplete(()=>{t.transparent||(n.transparent=t.transparent),n.needsUpdate=!0,e.userData.tween=void 0}).start()}})},fadeIn=e=>{e.traverse(e=>{if(e instanceof THREE.Mesh&&TWEEN){let t=e.material;if(0===t.opacity)return;let n={opacity:0,transparent:!0},i={opacity:t.opacity,transparent:t.transparent};t.transparent=n.transparent,t.opacity=n.opacity,new TWEEN.Tween(n).to(i,500).easing(TWEEN.Easing.Linear.None).onUpdate(()=>{t.opacity=n.opacity}).onComplete(()=>{t.transparent=i.transparent}).start()}})},dispose=e=>{"Mesh"===e.type?disposeMesh(e):disposeObject(e)},disposeObject=e=>{e&&e.children&&0!==e.children.length&&e.children.forEach(e=>{disposeMesh(e)})},disposeMesh=e=>{e&&(e.material&&disposeMaterial(e.material),e.geometry&&disposeGeometry(e.geometry),e.children&&e.children.length>0&&disposeObject(e))},disposeGeometry=e=>{e&&e.dispose()},disposeMaterial=e=>{e&&(e.map&&e.map.dispose(),e.normalMap&&e.normalMap.dispose(),e.dispose())};let boundingBoxMaterial;const vectorIsZero=e=>0===e.x&&0===e.y&&0===e.z,getMaterialId=(e,t)=>{let n="";return e||""===e?(e.materialId&&""!==e.materialId?n=e.materialId:e.catalogItemId&&""!==e.catalogItemId?n=e.catalogItemId:e.rgbValue>0?n="rbg"+JSON.stringify(e.rgbValue):e.length>0?n=e:t&&1===t.value?n="default_wall_material_"+e.getSourceType().value:t&&7===t.value&&(n="default_ceiling_material_"+e.getSourceType().value),n):null},vectorIsEqual=(e,t,n=.01)=>!(!e||!t)&&Math.abs(e.x-t.x)<=n&&Math.abs(e.y-t.y)<=n&&Math.abs(e.z-t.z)<=n,getYRotationOfObject=e=>{let t=e.getWorldDirection(new THREE.Vector3).clone();t.y=0,t.lengthSq()<.01&&(t=new THREE.Vector3(0,1,0),t.applyQuaternion(e.quaternion),t.y=0),t.normalize();let n=Math.asin(t.x);return t.z<0&&(n=Math.PI-n),n<0&&(n+=2*Math.PI),n},compareBox3Size=(e,t)=>{if(!e||!t)return 0;const n=e.getSize(new THREE.Vector3),i=t.getSize(new THREE.Vector3);return n.x<=i.x&&n.z<=i.z?-1:i.x<=n.x&&i.z<=n.z?1:0},isUVIdentityMatrix=e=>1===e[0]&&0===e[1]&&0===e[2]&&1===e[3]&&0===e[4]&&0===e[5],dashCase=function(e){return e.startsWith("_")&&(e=e.substr(1)),e.replace(/[A-Z](?:(?=[^A-Z])|[A-Z]*(?=[A-Z][^A-Z]|$))/g,(function(e,t){return(t>0?"-":"")+e.toLowerCase()}))};function inject(e,t){const n=Symbol("property-cache");Object.defineProperty(e,t,{get(){if(!this[n]){const e=window.__RML__DI__.lookup(dashCase(t),this._creator_);e?this[n]=e:console.error("Dependency "+dashCase(t)+" not found! Add dependency to /utils/injectables.ts")}return this[n]}})}let EnvironmentLoader=(()=>{class e{constructor(e){this._hdrCubeUrl="static/roomle-91862a5e7f3f46e5.envmap",this._hdrCubeUrlLowres="static/roomle64-adb0f447a54b5143.envmap",this._envMapReader=new EnvMapReader,this._onEnvMapUpdate=[],this._creator_=e;const t=new THREE.Color("#DDDDDD");this._environmentMap=((e,t,n,i)=>{const s=new THREE.CubeTexture;s.format=THREE.RGBAFormat,s.generateMipmaps=!1;for(let i=0;i<6;++i){const o=createColorTexture(e,t,n,1);o.format=s.format,o.type=s.type,o.minFilter=s.minFilter,o.magFilter=s.magFilter,o.generateMipmaps=s.generateMipmaps,o.needsUpdate=!0,s.images[i]=o}return s.needsUpdate=!0,s})(t.r,t.g,t.b),this._envMapReader.setPath(getAssetPath()),this._loadHDREnvMap(this._hdrCubeUrlLowres)}static setEnvironmentMap(e,t){e&&t&&(e.envMap=t,e.envMapIntensity=1,e.needsUpdate=!0)}getEnvironmentMap(){return this._environmentMap}_processPMREM(e){const t=new THREE.PMREMGenerator(this._renderer);let n=t.fromCubemap(e);return e.magFilter=THREE.LinearFilter,e.needsUpdate=!0,t.dispose(),n.texture}_loadHDREnvMap(e){return this._initData.disableEnvMap?Promise.resolve():new Promise(t=>{this._envMapReader.load(e).then(n=>{n.encoding=THREE.sRGBEncoding;const i=this._renderer.extensions.get("EXT_shader_texture_lod");this._environmentMap=i?this._processPMREM(n):n,e!==this._hdrCubeUrl&&(this._environmentMap.encoding=THREE.sRGBEncoding,window.requestIdleCallback(this._loadHDREnvMap.bind(this,this._hdrCubeUrl))),this._updateEnvironmentMap(),t(),this._envChangedCallback&&this._envChangedCallback()})})}setRendererAndScene(e,t){this._renderer=e,this._scene=t}registerEnvironmentChangedCallback(e){this._envChangedCallback=e}_updateEnvironmentMap(){this._initData.disableEnvMap||(this._scene.traverse(t=>{t instanceof THREE.Mesh&&(t.material instanceof THREE.MeshStandardMaterial||"MeshPhysicalMaterial"===t.material.type)&&e.setEnvironmentMap(t.material,this._environmentMap)}),this._onEnvMapUpdate.forEach(e=>e()),this._onEnvMapUpdate=[])}onEnvMapUpdate(e){this._onEnvMapUpdate.push(e)}setEnvMap(t){this._initData.disableEnvMap||e.setEnvironmentMap(t,this.getEnvironmentMap())}}return __decorate([inject],e.prototype,"_initData",void 0),e})();const PREDEFINED_LIGHTSETTING={SOFA:"sofa",SHELF:"shelf",SHELF_FRONT:"shelf_front",BAKED:"baked",CAMERA:"camera",EQUAL:"equal"};class DynamicLightSettingLoader{static createDynamicLightSettingSource(e,t){let n={};if(e)n.url=e;else if(t)switch(t){case PREDEFINED_LIGHTSETTING.SHELF:n.url=getAssetPath()+"static/shelf-2975dd3f2fa9c763.json";break;case PREDEFINED_LIGHTSETTING.SHELF_FRONT:n.url=getAssetPath()+"static/shelf_front-8c9566a4512f0de8.json";break;case PREDEFINED_LIGHTSETTING.SOFA:n.url=getAssetPath()+"static/sofa-997b116bc5f2e92e.json";break;case PREDEFINED_LIGHTSETTING.BAKED:n.url=getAssetPath()+"static/baked-6485a2b1daeb69e8.json";break;case PREDEFINED_LIGHTSETTING.CAMERA:n.url=getAssetPath()+"static/camera-f4cef679615485dc.json";break;case PREDEFINED_LIGHTSETTING.EQUAL:n.url=getAssetPath()+"static/equal-319f6b83c827913f.json";break;default:n.url=getAssetPath()+"static/camera-f4cef679615485dc.json"}else n=null;return n}parse(e){let t=JSON.parse(e);return t.lights?this.load(t):[]}load(e){let t=[];return e.lights?(e.lights.forEach(e=>{let n;switch(e.type){case"ambient":n=this._parseAmbientLight(e);break;case"rectarea":n=this._parseRectAreaLight(e);break;case"spot":n=this._parseSpotLight(e);break;case"directional":n=this._parseDirectionalLight(e)}n&&t.push(n)}),t):[]}_parseAmbientLight(e){let t=new THREE.AmbientLight;return this._parseCommon(t,e),t}_parseRectAreaLight(e){let t=new THREE.RectAreaLight;this._parseCommon(t,e);let{intensity:n,castShadow:i,target:s,width:o,height:r}=e;return t.width=o||.8,t.height=r||.8,t.castShadow=i||!1,t.matrixAutoUpdate=!0,t.intensity=(n||240)/((o||.8)*(r||.8)),t.lookAt(s?new THREE.Vector3(s.x,s.y,s.z):new THREE.Vector3(0,0,0)),t}_parseSpotLight(e){let t=new THREE.SpotLight;this._parseCommon(t,e);let{angle:n,penumbra:i,target:s,castShadow:o}=e;return t.angle=(n||100)*Math.PI/180,t.penumbra=i||.5,t.lookAt(s?new THREE.Vector3(s.x,s.y,s.z):new THREE.Vector3(0,0,0)),t.shadow.camera.near=.1,t.shadow.camera.far=10,t.shadow.mapSize=new THREE.Vector2(1024,1024),t.castShadow=o||!1,t}_parseDirectionalLight(e){let t=new THREE.DirectionalLight;this._parseCommon(t,e);let{target:n,castShadow:i}=e;return t.castShadow=i||!1,t.shadow.camera.near=.1,t.shadow.camera.far=100,t.shadow.mapSize=new THREE.Vector2(1024,1024),t.shadow.bias=-5e-5,t.lookAt(n?new THREE.Vector3(n.x,n.y,n.z):new THREE.Vector3(0,0,0)),t}_parseCommon(e,t){let{name:n,intensity:i,color:s,position:o,movesWithCamera:r}=t;e.name=n||"",e.intensity=i||1,e.color=new THREE.Color(s||"#ffffff"),e.position.copy(o?new THREE.Vector3(o.x,o.y,o.z):new THREE.Vector3(0,0,0)),e.visible=!0,e.layers.set(1),e.userData.movesWithCamera=r}}const NAMES_FOR_LOCALHOST=["127.0.0.1","localhost","0.0.0.0"],isIdItemId=function(e){return!(!e||"string"!=typeof e||e.split(":").length>2)},getCatalogIdFromItemOrConfigurationId=e=>{if(!e||"string"!=typeof e)return null;const t=e.split(":");return t.length<2?null:t[0]},kernelPartToPriceId=({articleNr:e,componentId:t})=>e&&""!==e?t.split(":")[0]+":"+e:null,wasRequestSuccess=(e,t)=>null!=e?"string"==typeof e?"true"===e:!0===e:("string"==typeof t&&(t=parseInt(t,10)),t>=200&&t<300);class NetworkLayer{constructor(){this._queue=[],this._pendingRequests=0}_nextSlot(){if(this._pendingRequests-=1,!this._queue.length)return;const{request:e,resolve:t,reject:n}=this._queue.shift();this._fetch(e).then(t,n)}_fetch(e,t={}){return this._pendingRequests+=1,new Promise((n,i)=>{self.fetch(e,t).then(function(e){if(this._nextSlot(),wasRequestSuccess(e.ok,e.status))n(...arguments);else{const t=(null==e?void 0:e.url)||"URL unknown";i(new Error(e.statusText||'Http error "'+(e&&e.status?e.status:"unknown")+'", for "'+t+'"'))}}.bind(this),e=>{this._nextSlot(),i(e)})})}fetch(e,t={}){return this._pendingRequests>=40?new Promise((t,n)=>this._queue.push({request:e,resolve:t,reject:n})):this._fetch(e,t)}}class Logger{info(...e){console}log(...e){console}warn(...e){console.warn.apply(console,e)}error(...e){console.warn.apply(console,e)}}let KernelIo=(()=>{class e extends Logger{constructor(e){super(),this._creator_=e}setMeta(e){this._meta=e}get meta(){return this._meta?this._meta:{}}throw(e){const t="[Kernel Exception]: "+e;this._globalCallback.onKernelMsg("exception",e,this.meta),this.error(t)}error(e){this._globalCallback.onKernelMsg("error",e,this.meta),super.error(e)}warn(e){this._globalCallback.onKernelMsg("warning",e,this.meta),super.warn(e)}}return __decorate([inject],e.prototype,"_globalCallback",void 0),e})();const ASSET_CACHE=new Map,SYNCED_CATALOGS=new Map,SYNCED_FLOORS_TAGS=new Map,SYNCED_TYPE_CHANGE_TAGS=new Map;let DataSyncer=(()=>{class e{constructor(e){this._bootCallbacks=[],this._isStarted=!1,this._isStarting=!1,this._alwaysUseCache=!1,this._creator_=e}start(e){return this._configuratorUiCallbacks.onSyncStarted(),this._startWorker().then(()=>this._handleCatalog(e)).then(()=>{const{typeChangeTag:e,floorMaterialsTag:t}=this._initData;Promise.all([this._syncFloorTag(t),this._syncTypeChangeTag(e)]).then(()=>{SYNCED_TYPE_CHANGE_TAGS.set(e,!0),this._configuratorUiCallbacks.onSyncDone()})})}syncCatalog(e){return this._startWorker().then(()=>this._handleCatalog(e))}syncFloorTag(e){return this._startWorker().then(()=>this._syncFloorTag(e))}syncTypeChangeTag(e){return this._startWorker().then(()=>this._syncTypeChangeTag(e))}_syncFloorTag(e){const t=[];return e&&!SYNCED_FLOORS_TAGS.get(e)?(t.push(this._handleTags([e])),this._rapiAccess.getTag(e).then(e=>{t.push(this._handleMaterialsAndTextures(e))}),this._singlePromiseFactory.create(1,e,n=>{Promise.all(t).then(()=>{SYNCED_FLOORS_TAGS.set(e,!0),n()},e=>this._softReject(n,'_syncFloorTag error: "'+e+'"'))})):Promise.resolve()}_syncTypeChangeTag(e){const t=[];return e&&!SYNCED_TYPE_CHANGE_TAGS.get(e)?(t.push(this._handleTags([e])),this._rapiAccess.getTag(e).then(e=>{this._rapiAccess.getItems(e.items).then(e=>{e.forEach(e=>{this.getIsCatalogSynced(e.catalog)&&t.push(this._handleCatalog(e.catalog))})})}),this._singlePromiseFactory.create(2,e,n=>{Promise.all(t).then(()=>{SYNCED_FLOORS_TAGS.set(e,!0),n()},e=>this._softReject(n,'_syncTypeChangeTag error: "'+e+'"'))})):Promise.resolve()}getIsCatalogSynced(e){return!!SYNCED_CATALOGS.get(e)}_startWorker(){return new Promise((e,t)=>{if(this._isStarted)return e();this._bootCallbacks.push({resolve:e,reject:t}),this._isStarting||(this._worker=new Worker(getAssetPath()+"static/asset-loader.worker-796c70f59b977071.js"),this._mainThreadToWorker=new MainThreadToWorker(this,this._worker),this._isStarting=!0,this._mainThreadToWorker.sendToWorker(1))})}onCommand(e,t,n){switch(e){case 4:this._isStarted=!0,this._bootCallbacks.forEach(({resolve:e})=>e());break;case 3:this._mainThreadToWorker.resolvePromises(t,n)}}_handleCatalog(e){return this._singlePromiseFactory.create(0,e,t=>this.getIsCatalogSynced(e)?t():this._rapiAccess.getCatalog(e).then(e=>Promise.all([this._handleContentWithAssets(this._rapiAccess.getComponentsOf(e),["perspectiveImage"]),this._handleItemsAndAdditionalContents(e),this._handleMaterialsAndTextures(e),this._handleExternalMeshes(e),this._handleTags(e.tags)])).then(()=>{SYNCED_CATALOGS.set(e,!0),t()},e=>this._softReject(t,'Catalog sync error: "'+e+'"')))}_handleTags(e){return this._handleContentWithAssets(this._rapiAccess.getTags(e),["pngIcon","svgIcon"])}_handleExternalMeshes(e){return new Promise(t=>{this._rapiAccess.getMeshesOfCatalog(e.id).then(e=>{const n=[];e.forEach(e=>{n.push(this._handleContentWithAssets(Promise.all([this._rapiAccess.getMesh(e.id)]),["url"]))}),Promise.all(n).then(t,e=>this._softReject(t,'Sync crt files error: "'+e+'"'))},e=>this._softReject(t,'getMeshesOfCatalog error: "'+e+'"'))})}_handleItemsAndAdditionalContents(e){return new Promise(t=>{this._rapiAccess.getItemsOf(e).then(e=>{const n=[];n.push(this._handleContentWithAssets(Promise.resolve(e),["perspectiveImage"])),this._rapiAccess.getAdditionalContentsOfItems(e).then(e=>{const t=e.filter(e=>-1!==[5,6,4].indexOf(e.type));n.push(this._handleContentWithAssets(Promise.resolve(t),["content"]))},e=>this._softReject(t,'getAdditionalContentsOfItems error: "'+e+'"')),Promise.all(n).then(t,e=>this._softReject(t,'AdditionalContent image sync error:"'+e+'"'))})})}_handleMaterialsAndTextures(e){return new Promise(t=>{this._rapiAccess.getMaterialsOf(e).then(e=>{const n=[];n.push(this._handleContentWithAssets(Promise.resolve(e),["thumbnail"])),e.forEach(e=>{n.push(this._handleContentWithAssets(this._rapiAccess.getTexturesOf(e),["image"]))}),Promise.all(n).then(t,e=>this._softReject(t,'getTexturesOf error: "'+e+'"'))},e=>this._softReject(t,'getMaterialsOf error: "'+e+'"'))})}_handleContentWithAssets(e,t){return new Promise(n=>e.then(e=>this._fetchAssets(e,t).then(n,e=>this._softReject(n,'_handleContentWithAssets error: "'+e+'"')),e=>this._softReject(n,'_handleContentWithAssets promise error: "'+e+'"')))}_fetchAssets(e,t){const n=[];e||(e=[]);for(let i=0,s=e.length;i<s;i++){const s=e[i];t.forEach(e=>{const t=s[e];t&&n.push(this._preCacheAsset(t))})}return Promise.all(n)}_preCacheAsset(e){return new Promise(t=>{if(ASSET_CACHE.get(e))return t();this._assetUrlToBase64(e).then(n=>{ASSET_CACHE.set(e,n),t()},e=>this._softReject(t,'_preCacheAsset error: "'+e+'"'))})}_assetUrlToBase64(e){return new Promise(t=>{this._mainThreadToWorker.sendToWorker(5,e,t,e=>this._softReject(t,'_assetUrlToBase64 error: "'+e+'"'))})}_softReject(e,t){this._errorHandler.softReject(e,t,2)}requestAsset(e,t=!1){return navigator.onLine&&!this._alwaysUseCache?e:ASSET_CACHE.get(e)||(t?e:null)}setAlwaysUseCache(e){this._alwaysUseCache=e}preFillAssetCache(e,t){ASSET_CACHE.set(e,t)}}return __decorate([inject],e.prototype,"_rapiAccess",void 0),__decorate([inject],e.prototype,"_singlePromiseFactory",void 0),__decorate([inject],e.prototype,"_errorHandler",void 0),__decorate([inject],e.prototype,"_configuratorUiCallbacks",void 0),__decorate([inject],e.prototype,"_initData",void 0),e})();class AsyncGuard{constructor(e){this.info=e,this._init()}_init(){this._promise=new Promise((e,t)=>{this._resolve=e,this._reject=t})}resolve(e){e&&this._resolve(e),this._resolve()}reject(e){this._reject(e)}wait(){return this._promise}reset(){this._init()}}var GLTF_LOADER_FILE_NAME="static/GLTFLoader-5b296b5fb14cfe1a.js",DRACO_LOADER_FILE_NAME="static/DRACOLoader-5edeeab4a8dbc0bd.js";const DRACO_LIB_FILES={"draco_wasm_wrapper.js":"static/draco_wasm_wrapper-d775f9f135cb30ff.js","draco_decoder.wasm":"static/draco_decoder-979e668167e37c95.wasm","draco_decoder.js":"static/draco_decoder-3866672a1fa2f980.js"};let StaticItemLoader=(()=>{class e{constructor(e){if(this._gltfLoaderGuard=new AsyncGuard,this._creator_=e,THREE.GLTFLoader&&THREE.DRACOLoader)this._initLoaders();else{let e=this._scriptLoader.fetch("static/GLTFLoader-5b296b5fb14cfe1a.js",{id:"gltf-loader"}),t=this._scriptLoader.fetch("static/DRACOLoader-5edeeab4a8dbc0bd.js",{id:"draco-loader"});Promise.all([e,t]).then(()=>this._initLoaders())}}_initLoaders(){this._gltfLoader=new THREE.GLTFLoader;const e=new THREE.DRACOLoader;if("function"!=typeof e._loadLibrary)throw new Error("Can not patch draco loader! Did three.js update the DracoLoader example?");const t=e._loadLibrary.bind(e._loadLibrary);e._loadLibrary=(e,n)=>{const i=DRACO_LIB_FILES[e];if(!i)throw new Error('Can not load draco dependency "'+e+'" did three.js update DracoLoader lib? Available files'+JSON.stringify(DRACO_LIB_FILES));return t(getAssetPath()+i,n)},this._gltfLoader.setDRACOLoader(e),this._gltfLoaderGuard.resolve(this._gltfLoader)}async loadGLB(e,t,n,i,s,o,r,a){return await this._gltfLoaderGuard.wait(),new Promise((l,c)=>{this._gltfLoader.load(e,e=>{l(this._handleGLTFScene("GLB",e,t,n,i,s,o,r))},e=>{a&&a(e.loaded/e.total)},e=>{c(e)})})}async loadGLTF(e,t,n,i,s,o,r,a){return await this._gltfLoaderGuard.wait(),new Promise((l,c)=>{this._gltfLoader.parse(e,null,e=>{l(this._handleGLTFScene("GLTF",e,t,n,i,s,o,r))},e=>{a&&a(e.loaded/e.total)},e=>{c(e)})})}_handleGLTFScene(e,t,n,i,s,o,r,a){if(!t||!t.scene||!t.scene.children||0===t.scene.children.length)return null;if(n&&t.scene.position.copy(n),i&&(t.scene.rotation.y=i),s){const e=new THREE.Box3;e.setFromObject(t.scene);const{x:n,y:i,z:o}=e.getSize(new THREE.Vector3);let r=new THREE.Vector3(s.x/n,s.y/i,s.z/o);t.scene.scale.copy(r)}return o&&t.scene.scale.multiply(o),t.scene.type=e,t.scene.traverse(e=>{if(e instanceof THREE.Mesh){if(e.layers.set(3),e.material instanceof THREE.MeshStandardMaterial){const t=e.material;if(this._environmentLoader.setEnvMap(t),a&&r&&r>0){let e=new THREE.Color(r);t.color=e.copyGammaToLinear(e),t.roughness=.5,t.metalness=.1}t.needsUpdate=!0}e.castShadow=!0,e.receiveShadow=!0}}),t.scene}}return __decorate([inject],e.prototype,"_environmentLoader",void 0),__decorate([inject],e.prototype,"_scriptLoader",void 0),e})(),ThreeLoader=(()=>{class e{constructor(e){this._jsonLoaded=!1,this._creator_=e}_loadShaders(){return new Promise((e,t)=>{if(this._jsonLoaded)return e();this._networkLayer.fetch(getAssetPath()+"static/shaders-7bdb2939b2a0d677.json",{credentials:"same-origin"}).then(handleJsonResponse,t).then(t=>{window._rsl=t,this._jsonLoaded=!0,e()},t)})}fetch(){return window._rsl||(window._rsl={}),new Promise((e,t)=>this._loadShaders().then(()=>{this._scriptLoader.fetch("static/rthree-ffe182e11c947389.js",{id:"three-lib"}).then(e,t)},t))}}return __decorate([inject],e.prototype,"_scriptLoader",void 0),__decorate([inject],e.prototype,"_networkLayer",void 0),e})(),LocalStorageHelper=(()=>{class e{constructor(e){this._context_=e}getStore(e="rml_default"){return this._localStorage.getItem(e)||{entries:[]}}saveStore(e,t){this._localStorage.setItem(e,t)}addItem(e,t,n="rml_default",i=5){const s=this.getStore(n),o=s.entries.find(t=>t.id===e);if(o?(o.payload=t,o.date=Date.now()):s.entries.push({id:e,date:Date.now(),payload:t}),s.entries.length>i)for(s.entries.sort((e,t)=>t.date-e.date);s.entries.length>i;)s.entries.pop();this.saveStore(n,s)}getItem(e,t="rml_default"){const n=this.getStore(t).entries.find(t=>t.id===e);return n?n.payload:null}}return __decorate([inject],e.prototype,"_localStorage",void 0),e})();class DynamicQualitySettingLoader{set(e,t){t&&(void 0!==t.enableAA&&(e.enableAA=t.enableAA),this._setSAOPass(e,t),this._setShadowPass(e,t),this._setGroundShadow(e,t))}_setSAOPass(e,t){if(t.SAOPass){const n=t.SAOPass;void 0!==n.enabled&&(e.getSAOPass().enabled=n.enabled),void 0!==n.smoothTransition&&(e.getSAOPass().smoothTransition=n.smoothTransition),n.occlusionWorldRadius&&(e.getSAOPass().occlusionWorldRadius=n.occlusionWorldRadius),n.intensity&&(e.getSAOPass().intensity=n.intensity),n.bias&&(e.getSAOPass().bias=n.bias),n.numSamples&&(e.getSAOPass().numSamples=n.numSamples)}}_setShadowPass(e,t){if(t.shadowPass){const n=t.shadowPass;void 0!==n.enabled&&(e.getShadowPass().enabled=n.enabled),void 0!==n.smoothTransition&&(e.getShadowPass().smoothTransition=n.smoothTransition),void 0!==n.enableAccumulation&&(e.getShadowPass().enableAccumulation=n.enableAccumulation),n.shadowRadius&&(e.getShadowPass().shadowRadius=n.shadowRadius),n.shadowBiasMultiplier&&(e.getShadowPass().shadowBiasMultiplier=n.shadowBiasMultiplier),n.numSamples&&(e.getShadowPass().numSamples=n.numSamples)}}_setGroundShadow(e,t){if(t.groundShadow){const n=t.groundShadow;void 0!==n.enable&&(e.getShadowPlanePass().enable=n.enable),void 0!==n.smoothTransition&&(e.getShadowPlanePass().smoothTransition=n.smoothTransition),n.numSamples&&(e.getShadowPlanePass().numSamples=n.numSamples),n.numSamplesPerFrame&&(e.getShadowPlanePass().numSamplesPerFrame=n.numSamplesPerFrame)}}}class InitData{constructor(e){this.autoQuality=!0,this.colors=ROOMLE_COLORS,this.unit=null,this.unitStringType=null,this.meshSelection=!0,this.stats=!1,this._measureTraffic=!1,this.gammaOutput=!0,this.disableDebugGUI=!1,this.disableEnvMap=!1,this.dls=null,this.ls=null,this.cameraSpacing=0,this.transparentHighlighting=!0,this.mode="3D",this.edit=!1,this.moc=!1,this._creator_=e}setOverrides(e){deepMerge(this,e)}}const BROWSER_LANGUAGE_PROPERTY_KEYS_KNOWN=["language","browserLanguage","userLanguage","systemLanguage"],isSafari=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);class GlobalInitData{constructor(e){this.locale=((e=null)=>{const t=window.navigator;if(e)return e.substr(0,2);if(Array.isArray(t.languages)&&t.languages.length>0)return t.languages[0].substr(0,2);for(let e=0,n=BROWSER_LANGUAGE_PROPERTY_KEYS_KNOWN.length;e<n;e++){const n=t[BROWSER_LANGUAGE_PROPERTY_KEYS_KNOWN[e]];if(n)return n.substr(0,2)}return"en"})()||"en",this.overrideCountry=null,this._creator_=e}setOverrides(e){deepMerge(this,e)}}class UiCallback{constructor(e){return this._isMute=!1,this.cameraStartsMoving=()=>{},this._creator_=e,setDescriptor(this,"_isMute",{enumerable:!1,writable:!1}),setDescriptor(UiCallback.prototype,"_setMute",{enumerable:!1,writable:!1}),setDescriptor(UiCallback.prototype,"mute",{enumerable:!1,writable:!1}),setDescriptor(UiCallback.prototype,"unmute",{enumerable:!1,writable:!1}),new Proxy(this,this)}_setMute(e){setWriteable(this,"_isMute",!0),this._isMute=e,setWriteable(this,"_isMute",!1)}mute(){this._setMute(!0)}unmute(){this._setMute(!1)}get(e,t){return this._isMute&&"function"==typeof this[t]&&"on"===t.substr(0,2)?()=>{}:this[t]}}class GlobalCallback extends UiCallback{constructor(){super(...arguments),this.onNetworkRequest=(e,t,n)=>{},this.onKernelMsg=(e,t,n={})=>{},this.onCheckExternalCache=async(e,t)=>Promise.resolve(null)}}const CANVAS_ID={HSC:"rml-configurator",HSP:"rml-hsp",GLB:"rml-glb",RMV:"rml-mv"};let DomHelper=(()=>{class e{constructor(e){this._creator_=e,this._lifeCycleManager.addEventListener(this)}get element(){return this._container}setDomElement(e){if(!this._container){this._container=document.createElement("div"),this._container.classList.add("rml-threejs-canvas-container"),this._container.setAttribute("ondragover","return false"),this._container.style.position="relative",this._container.style.width="100%",this._container.style.height="100%";const t=document.createElement("style");t.innerText=".rml-threejs-canvas-container canvas{position:absolute;top:0;left:0;right:0;bottom:0;z-index:100; opacity:1;}",this._container.appendChild(t),e.appendChild(this._container)}this._element=e}getClientDimensions(){return new THREE.Vector2(this._element.clientWidth,this._element.clientHeight)}_removeDomElement(e){if(!e)return;const t=e.parentElement;t&&t.removeChild(e)}reset(){this._element=null,this._removeDomElement(this._container),this._container=null}pause(){this.reset()}resume(){}destroy(){}}return __decorate([inject],e.prototype,"_lifeCycleManager",void 0),e})();class ScenePluginDefaultImplementation{constructor(e){this._creator_=e}setScene(e){}setUiScene(e){}updateBounds(e){}clearScene(e,t){}moveCameraEnd(e){}moveCameraStart(e){}needsUiScene(){return!1}}let PluginSystem=(()=>{class e{constructor(e){this._plugins=[],this._creator_=e}async init(e,t,n){this._scene=e,this._uiScene=t,this._cameraPosition=n;const{bananaForScale:i}=this._initData;i&&await import("./banana-for-scale-29fe9ece.js").then(({default:e})=>this._plugins.push(new e(this._creator_))),this._plugins.forEach(e=>e.setScene(this._scene)),this._plugins.forEach(e=>e.setUiScene(this._uiScene)),this._plugins.forEach(e=>e.updateBounds(this._bounds)),this._plugins.forEach(e=>e.moveCameraEnd(this._cameraPosition))}addPlugin(e){this._plugins.push(e),e.setScene(this._scene),e.setUiScene(this._uiScene),e.updateBounds(this._bounds),e.moveCameraEnd(this._cameraPosition)}updateBounds(e){this._bounds=e,this._plugins.forEach(t=>t.updateBounds(e))}clearScene(e,t){this._plugins.forEach(n=>n.clearScene(e,t))}getActivePlugins(){return this._plugins}getPlugin(e){for(let t of this._plugins)if(t instanceof e)return t;return null}moveCameraEnd(e){this._cameraPosition=e,this._plugins.forEach(t=>t.moveCameraEnd(e))}moveCameraStart(e){this._cameraPosition=e,this._plugins.forEach(t=>t.moveCameraStart(e))}needsUiScene(){return this._plugins.map(e=>e.needsUiScene()).reduce((e,t)=>e||t,!1)}}return __decorate([inject],e.prototype,"_initData",void 0),e})();class PromiseQueue{constructor(e,t){this._waitingPromises=[],this._finishPromiseExecutor=[],this._errorCallback=()=>{},Promise.allSettled=Promise.allSettled||(e=>Promise.all(e.map(e=>e.then(e=>({status:"fulfilled",value:e})).catch(e=>({status:"rejected",reason:e}))))),e&&this.registerCallback(e),t&&(this._errorCallback=t)}push(e){this._waitingPromises.push(e),Promise.all(this._waitingPromises).then(e=>{e.length===this._waitingPromises.length&&(this._callback&&this._callback(e),this._waitingPromises=[])},this._errorCallback)}finished(e=!1){return new Promise((t,n)=>{this._finishPromiseExecutor.push({resolve:t,reject:n});const i=e?"allSettled":"all";Promise[i](this._waitingPromises).then(e=>{if("allSettled"===i){const t=[];e.forEach(({value:e,status:n})=>{"fulfilled"===n&&t.push(e)}),this._resolveAllExecutors(t)}else this._resolveAllExecutors(e)},e=>{this._rejectAllExecutors(e)})})}registerCallback(e){this._callback=e}unregisterCallback(){this._callback=null}_resolveAllExecutors(e){this._finishPromiseExecutor.forEach(({resolve:t})=>t(e)),this._finishPromiseExecutor=[]}_rejectAllExecutors(e){this._finishPromiseExecutor.forEach(({reject:t})=>t(e)),this._finishPromiseExecutor=[]}clear(){const e=this._waitingPromises.length>0;this._waitingPromises=[],e?this._rejectAllExecutors(new Error("Promise queue has been cleared")):this._resolveAllExecutors([])}get length(){return this._waitingPromises.length}}let MeshGenerator=(()=>{class e{constructor(e){this.materialQueue=new PromiseQueue,this._geometryComponentMaterialCache=new Map,this._maxAnisotropy=1,this._maxTextures=16,this._textureLoader=new THREE.TextureLoader,this._configuratorPreviewMaterial=new THREE.MeshStandardMaterial({color:"#DDDDDD",transparent:!0,opacity:1,roughness:1,envMap:null}),this._creator_=e,this._previewMaterial=new THREE.MeshStandardMaterial({color:"#DDDDDD",roughness:1,metalness:0}),this._environmentLoader.setEnvMap(this._previewMaterial)}getGeometry(e){return e&&this._cacheHolder.geometryCache.has(e)?this._cacheHolder.geometryCache.get(e):null}_generateGeometry(e,t,n,i,s){let o;return e&&this._cacheHolder.geometryCache.has(e)?o=this._cacheHolder.geometryCache.get(e):(o=new THREE.BufferGeometry,o.setIndex(new THREE.Uint32BufferAttribute(n,1)),o.setAttribute("position",new THREE.Float32BufferAttribute(t,3)),o.setAttribute("normal",new THREE.Float32BufferAttribute(s,3)),o.setAttribute("uv",new THREE.Float32BufferAttribute(i,2)),o.scale(.001,.001,.001),o.rotateX(-Math.PI/2),e&&this._cacheHolder.geometryCache.set(e,o)),o}changeMaterialOfMesh(e,t){e&&t?(e.material=t,e.material.transparent||0===e.material.opacity||e.material.transmission>0?(e.castShadow=!1,e.receiveShadow=!1):(e.castShadow=!0,e.receiveShadow=!0),e.material.needsUpdate=!0,this._materialLoaded&&this._materialLoaded(t)):console.warn("could not assign material to mesh",{mesh:e},{material:t})}_createMaterial(e,t,n,i,s){if(this._cacheHolder.materialCache.has(e))t();else if(e.startsWith("benchmarkMaterial")){let o=createBenchmarkMaterial(e),r=createMaterial(o,this._environmentLoader);this._loadBenchmarkTextures(o,r,i,s).then(t,n)}else this._rapiAccess.getMaterial(e).then(e=>{let o=createMaterial(e,this._environmentLoader);this._loadTextures(e,o,i,s).then(t,n)},n)}_loadBenchmarkTextures(e,t,n=1,i=1){return new Promise((s,o)=>{const r=createBenchmarkTexture(e.id);addTexture(this._dataSyncer.requestAsset(r.image,!0),r,t,this._maxAnisotropy,n/(0===r.mmWidth?1:r.mmWidth),i/(0===r.mmHeight?1:r.mmHeight),this._maxTextures).then(()=>{this._cacheHolder.materialCache.set(e.id,t),s()},o)})}_loadTextures(e,t,n=1,i=1){return new Promise((s,o)=>{if(!e.textures||e.textures&&0===e.textures.length)return this._cacheHolder.materialCache.set(e.id,t),s();this._rapiAccess.getTexturesOf(e).then(r=>{let a=[];r.forEach(e=>{a.push(addTexture(this._dataSyncer.requestAsset(e.image,!0),e,t,this._maxAnisotropy,n/(0===e.mmWidth?1:e.mmWidth),i/(0===e.mmHeight?1:e.mmHeight),this._maxTextures))}),Promise.all(a).then(()=>{this._cacheHolder.materialCache.set(e.id,t),s()},o)})})}_loadMaterial(e,t,n){return new Promise((i,s)=>{this._singlePromiseFactory.create(6,e,(i,s)=>this._createMaterial(e,i,s,t,n)).then(()=>{setTimeout(()=>i(this._cacheHolder.materialCache.get(e)),0)},s)})}_assignMaterial(e,t){return this._cacheHolder.materialCache.has(t)?(this.changeMaterialOfMesh(e,this._cacheHolder.materialCache.get(t)),Promise.resolve()):new Promise((n,i)=>{this._loadMaterial(t).then(i=>{e.userData.materialId===t&&this.changeMaterialOfMesh(e,i),n()},i)})}get maxAnisotropy(){return this._maxAnisotropy}set maxAnisotropy(e){this._maxAnisotropy=e}get maxTextures(){return this._maxTextures}set maxTextures(e){this._maxTextures=e}clear(){this._cacheHolder.clear()}_assignRGB(e,t){return new Promise(n=>{let i,s="rbg"+JSON.stringify(t);this._cacheHolder.materialCache.has(s)?i=this._cacheHolder.materialCache.get(s):(i=new THREE.MeshStandardMaterial({color:t}),this._environmentLoader.setEnvMap(i),this._cacheHolder.materialCache.set(s,i)),this.changeMaterialOfMesh(e,i),setTimeout(()=>n(),0)})}_assignItem(e,t){return new Promise((n,i)=>{if(this._cacheHolder.materialCache.has(t))return this.changeMaterialOfMesh(e,this._cacheHolder.materialCache.get(t)),void n();this._rapiAccess.getItem(t).then(s=>{if(s.topImage)this._textureLoader.load(s.topImage,i=>{i.anisotropy=this._maxAnisotropy,i.wrapS=THREE.RepeatWrapping,i.wrapT=THREE.RepeatWrapping;let o=new THREE.Vector2(1,1);s.width>0&&(o.x=1/s.width),s.depth>0&&(o.y=1/s.depth),i.repeat.set(o.x,o.y);const r=new THREE.MeshPhysicalMaterial({map:i,roughness:.5,metalness:.1});this._environmentLoader.setEnvMap(r),this._cacheHolder.materialCache.set(t,r),this.changeMaterialOfMesh(e,r),setTimeout(()=>n(),0)});else{const e="can not set material, catalog item top image is not set";console.warn(e),i(e)}},i)})}setMaterialLoadedListener(e){this._materialLoaded=e}removeMaterialLoadedListener(){this._materialLoaded=void 0}_createMesh(e,t,n){if(e&&t){const i=this._getComponentMeshId(e,t);if(this._geometryComponentMaterialCache.has(i)){const e=this._geometryComponentMaterialCache.get(i);if(this._cacheHolder.materialCache.has(e)){const t=this._cacheHolder.materialCache.get(e);return new THREE.Mesh(n,t)}}}return new THREE.Mesh(n,this._configuratorPreviewMaterial.clone())}_getComponentMeshId(e,t){return e+"_"+t}}return __decorate([inject],e.prototype,"_rapiAccess",void 0),__decorate([inject],e.prototype,"_environmentLoader",void 0),__decorate([inject],e.prototype,"_dataSyncer",void 0),__decorate([inject],e.prototype,"_singlePromiseFactory",void 0),__decorate([inject],e.prototype,"_cacheHolder",void 0),__decorate([inject],e.prototype,"_plannerMeshGenerator",void 0),e})();class ConfiguratorMeshGenerator extends MeshGenerator{constructor(e){super(e),this._environmentLoader.setEnvMap(this._configuratorPreviewMaterial)}generateMesh(e=0,t=null,n,i,s,o,r,a=!1){let l;l=a?this._generateGeometry(t,i,s,o,r).clone():this._generateGeometry(t,i,s,o,r);const c=this._createMesh(e,t,l);return c.userData.materialId=n,n&&this.materialQueue.push(this._assignMaterial(c,n).then(()=>{e&&t&&this._geometryComponentMaterialCache.set(this._getComponentMeshId(e,t),n)})),c}setMaterial(e,t,n){return this._assignMaterial(e,t)}loadMaterial(e,t,n){return super._loadMaterial(e,t,n)}loadTextures(e,t,n,i){return super._loadTextures(e,t,n,i)}}class EventDispatcher{constructor(){this._listeners={},this._disabled=!1}_addEventListener(e,t,n){this._listeners[e]||(this._listeners[e]=[]),this._listeners[e].push({callback:t,scope:n})}addEventListener(e,t,n){this._addEventListener(e,t,n)}dispatchEvent(e,t){if(!this._listeners[e]||this._disabled)return;const n=this._listeners[e];let i=n.length;for(let e=0;e<i;e++){const i=n[e];t?i.callback.apply(i.scope,[t]):i.callback.call(i.scope)}}removeEventListener(e,t){const n=this._listeners[e];if(n)for(let e=0,i=n.length;e<i;e++)if(n[e].callback===t)return void n.splice(e,1)}enableEvents(){this._disabled=!1}disableEvents(){this._disabled=!0}}const BROWSER_EVENTS={SCROLL:"scroll",MOUSE_MOVE:"mousemove",MOUSE_DOWN:"mousedown",MOUSE_UP:"mouseup",MOUSE_LEAVE:"mouseleave",MOUSE_ENTER:"mouseenter",MOUSE_WHEEL:"wheel",TOUCH_MOVE:"touchmove",TOUCH_START:"touchstart",TOUCH_END:"touchend",CONTEXT_MENU:"contextmenu",DOUBLE_CLICK:"dblclick"};class InputEvent{constructor(e,t,n,i,s){this.position=e,this.positionRelative=t,this.type=n,this.rotation=i,this.event=s}}const MIN_MOVE_DISTANCE=5*window.devicePixelRatio,MIN_DOLLY_DISTANCE=3*window.devicePixelRatio;let InputManager=(()=>{class e extends EventDispatcher{constructor(e){super(),this._elementHit=!1,this._delta=-1,this._state=0,this._pinchDistance=-1,this._rotationAngle=-1,this._lastMouseWheelEvent=null,this._lastTouchEvent=null,this._events=Object.keys(BROWSER_EVENTS).map(e=>BROWSER_EVENTS[e]),this._boundingClientRectInvalid=!0,this._creator_=e,this._downPosition={x:0,y:0},this._downPositionRelative={x:0,y:0},this._boundingClientRect=this._getBoundingClientRect()}enableDragIn(e){this._setState(1),this._dragEnabled=!0,e&&(this._dragMV=this._dragM.bind(this),this._dragEV=this._dragE.bind(this),this._dragTarget=e.currentTarget||e.target,this._delta=-1,this._dragMVName="drag",this._dragEVName="dragend",window.TouchEvent&&e instanceof TouchEvent?(this._dragMVName="touchmove",this._dragEVName="touchend"):e.dataTransfer&&e.dataTransfer.setData&&e.dataTransfer.setData("text/plain"," "),this._firefoxDragPosition={x:0,y:0},document.ondragover=e=>{e=e||window.event,this._firefoxDragPosition.x=e.pageX,this._firefoxDragPosition.y=e.pageY},this._dragTarget.addEventListener(this._dragMVName,this._dragMV,!1),this._dragTarget.addEventListener(this._dragEVName,this._dragEV,!1))}_dragM(e){let t=e,n=null,i=null;window.TouchEvent&&e instanceof TouchEvent?(n=this._getTouchPosition(t),i=this._getTouchPositionRelative(t)):(n=this._getMousePosition(t),i=this._getMousePositionRelative(t)),n.x>0&&n.y>0&&this._move(n,i)}_dragE(e){let t=e;document.ondragover=null,this._firefoxDragPosition=null,this._dragTarget.removeEventListener(this._dragMVName,this._dragMV),this._dragTarget.removeEventListener(this._dragEVName,this._dragEV),window.TouchEvent&&e instanceof TouchEvent?this._onUp(this._getTouchPosition(t),this._getTouchPositionRelative(t),2):this._onUp(this._getMousePosition(t),this._getMousePositionRelative(t),1)}addEvents(e){this._events.forEach(t=>e.addEventListener(t,this,!1)),null===window||void 0===window||window.addEventListener("scroll",this,!1)}removeEvents(e){this._events.forEach(t=>e.removeEventListener(t,this,!1)),null===window||void 0===window||window.removeEventListener("scroll",this,!1)}_move2(e){if(this._lastTouchEvent&&e.timeStamp-this._lastTouchEvent.timeStamp<16)return;const t=e.touches[0],n=e.touches[1],i=t.pageX-n.pageX,s=t.pageY-n.pageY,o=Math.abs(i)+Math.abs(s);this._pinchDistance>-1&&(o>this._pinchDistance+MIN_DOLLY_DISTANCE?(this._setState(3),this.dispatchEvent(7,new InputEvent(this._getTouchPosition(e),this._getTouchPositionRelative(e)))):o<this._pinchDistance-MIN_DOLLY_DISTANCE?(this._setState(3),this.dispatchEvent(8,new InputEvent(this._getTouchPosition(e),this._getTouchPositionRelative(e)))):o<=this._pinchDistance+MIN_DOLLY_DISTANCE&&o>=this._pinchDistance-MIN_DOLLY_DISTANCE&&(this._setState(5),this.dispatchEvent(11,new InputEvent(this._getTouchPosition(e),this._getTouchPositionRelative(e))))),this._pinchDistance=o,this._lastTouchEvent=e}_setState(e){this._state=e}_move(e,t,n,i){void 0===n&&(n=0),void 0===this._dragEnabled&&(this._dragEnabled=!1),1===this._state&&this._canDrag(n)&&(this._delta=this._getDelta(e),this._delta>MIN_MOVE_DISTANCE&&(this._setState(2),this._longClickTimer&&clearTimeout(this._longClickTimer),this.dispatchEvent(0,new InputEvent(this._downPosition,this._downPositionRelative)))),2===this._state&&this.dispatchEvent(1,new InputEvent(e,t)),this.dispatchEvent(6,new InputEvent(e,t,n,null,i))}_longClick(){this._setState(2),this._longClickTimer&&clearTimeout(this._longClickTimer),this.dispatchEvent(0,new InputEvent(this._downPosition,this._downPositionRelative)),this.dispatchEvent(1,new InputEvent(this._downPosition,this._downPositionRelative)),this.dispatchEvent(14,new InputEvent(this._downPosition,this._downPositionRelative,2))}_onUp(e,t,n){this.dispatchEvent(4,new InputEvent(e,t,n)),this._getDelta(e)<=MIN_MOVE_DISTANCE&&this.dispatchEvent(5,new InputEvent(e,t)),2===this._state&&this.dispatchEvent(2,new InputEvent(e,t)),4===this._state&&(this.dispatchEvent(10,new InputEvent(e,t)),this._rotationAngle=-1),3===this._state&&(this._pinchDistance=-1),this._lastTouchEvent=null,this._setState(0),this._dragTarget=null,this._elementHit=!1,this._longClickTimer&&clearTimeout(this._longClickTimer)}_getTouchPosition(e){if(e.touches.length){let{clientX:t,clientY:n}=e.touches[0];if(e.touches.length>1){const i=e.touches[1],s=i.clientX,o=i.clientY;t=(t+s)/2,n=(n+o)/2}return{x:t,y:n}}const t=e.changedTouches[0];return{x:t.clientX,y:t.clientY}}_getTouchPositionRelative(e){const t=this._getBoundingClientRect(),{clientWidth:n,clientHeight:i}=this._domHelper.element;if(e.touches.length){const{clientX:s,clientY:o}=e.touches[0];return{x:(s-t.left)/n*2-1,y:-(o-t.top)/i*2+1}}const s=e.changedTouches[0];return{x:(s.clientX-t.left)/n*2-1,y:-(s.clientY-t.top)/i*2+1}}_getMousePosition(e){if(0!==e.clientX&&0!==e.clientY)return{x:e.clientX,y:e.clientY};{let{x:t,y:n}=this._getFireFoxMousePosition(e);return{x:t,y:n}}}_getFireFoxMousePosition(e){let{x:t,y:n}=this._domHelper.getClientDimensions();return{x:t-(t+e.offsetX),y:n-(n+e.offsetY)}}_getMousePositionRelative(e){const t=this._getBoundingClientRect();return 0!==e.clientX&&0!==e.clientY?{x:(e.clientX-t.left)/this._domHelper.element.clientWidth*2-1,y:-(e.clientY-t.top)/this._domHelper.element.clientHeight*2+1}:this._firefoxDragPosition&&0!==this._firefoxDragPosition.x&&0!==this._firefoxDragPosition.y?{x:(this._firefoxDragPosition.x-t.left)/this._domHelper.element.clientWidth*2-1,y:-(this._firefoxDragPosition.y-t.top)/this._domHelper.element.clientHeight*2+1}:{x:0,y:0}}_getDelta(e){return Math.abs(this._downPosition.y-e.y)+Math.abs(this._downPosition.x-e.x)}setDragEnabled(e){this._dragEnabled=e}handleEvent(e){switch(e.type){case BROWSER_EVENTS.SCROLL:this._boundingClientRectInvalid=!0;break;case BROWSER_EVENTS.MOUSE_MOVE:this._onMouseMove(e);break;case BROWSER_EVENTS.DOUBLE_CLICK:this._onDoubleClick(e);break;case BROWSER_EVENTS.MOUSE_DOWN:this._onMouseDown(e);break;case BROWSER_EVENTS.MOUSE_UP:this._onMouseUp(e);break;case BROWSER_EVENTS.MOUSE_LEAVE:this._onMouseLeave(e);break;case BROWSER_EVENTS.MOUSE_ENTER:this._onMouseEnter(e);break;case BROWSER_EVENTS.MOUSE_WHEEL:this._onMouseWheel(e);break;case BROWSER_EVENTS.TOUCH_MOVE:this._onTouchMove(e);break;case BROWSER_EVENTS.TOUCH_START:this._onTouchStart(e);break;case BROWSER_EVENTS.TOUCH_END:this._onTouchEnd(e);break;case BROWSER_EVENTS.CONTEXT_MENU:this._onContextMenu(e)}}_onMouseDown(e){if(e.preventDefault(),2===e.detail)return;let{x:t,y:n}=this._getMousePosition(e);this._downPosition={x:t,y:n},this._downPositionRelative=this._getMousePositionRelative(e),this.dispatchEvent(3,new InputEvent({x:t,y:n},this._downPositionRelative,1)),this._setState(1)}_onMouseUp(e){e.preventDefault(),2!==e.detail&&this._onUp(this._getMousePosition(e),this._getMousePositionRelative(e),1)}_onMouseMove(e){e.preventDefault(),this._move(this._getMousePosition(e),this._getMousePositionRelative(e),1,e)}_onDoubleClick(e){e.preventDefault(),this.dispatchEvent(12,new InputEvent(this._getMousePosition(e),this._getMousePositionRelative(e),1))}_onMouseLeave(e){var t;this._delta=-1,(null===(t=e.relatedTarget)||void 0===t?void 0:t.closest('[data-rml-sdk="ignore-mouse-leave"]'))||this._onMouseUp(e)}_onMouseEnter(e){e.preventDefault()}_onMouseWheel(e){if(this._lastMouseWheelEvent&&e.timeStamp-this._lastMouseWheelEvent.timeStamp<40)return e.preventDefault(),void e.stopPropagation();e.deltaY<0?this.dispatchEvent(7,new InputEvent(this._getMousePosition(e),this._getMousePositionRelative(e),1,0,e)):this.dispatchEvent(8,new InputEvent(this._getMousePosition(e),this._getMousePositionRelative(e),1,0,e)),this._lastMouseWheelEvent=e}_onTouchMove(e){if(e.preventDefault(),!this._dragTarget)if(1===e.touches.length)this._move(this._getTouchPosition(e),this._getTouchPositionRelative(e),2);else if(2===e.touches.length)if(this._elementHit||4===this._state){const i=e.touches[0],s=e.touches[1],o=function(e){let t=toDegrees(e);return t<0&&(t=180+(180+t)),t}((t={x:i.pageX,y:i.pageY},n={x:s.pageX,y:s.pageY},Math.atan2(n.y-t.y,n.x-t.x)));this._rotationAngle<0&&(this._rotationAngle=o);const r=o-this._rotationAngle;this._rotationAngle=o,this.dispatchEvent(9,new InputEvent(this._getTouchPosition(e),this._getTouchPositionRelative(e),2,toRadiant(r))),this._setState(4)}else this._move2(e);var t,n}_onTouchStart(e){if(e.preventDefault(),1===e.touches.length){let{x:t,y:n}=this._getTouchPosition(e);this._downPosition={x:t,y:n},this._downPositionRelative=this._getTouchPositionRelative(e),this.dispatchEvent(3,new InputEvent({x:t,y:n},this._downPositionRelative,2)),this._setState(1),this._longClickTimer=window.setTimeout(this._longClick.bind(this),350)}else 2===e.touches.length&&(1!==this._state&&2!==this._state||this._onUp(this._getTouchPosition(e),this._getTouchPositionRelative(e),2),this._setState(3))}_onTouchEnd(e){e.preventDefault(),e.touches.length>1&&5===this._state||3===this._state||(this.dispatchEvent(13,new InputEvent(this._getTouchPosition(e),this._getTouchPositionRelative(e),2)),this._onUp(this._getTouchPosition(e),this._getTouchPositionRelative(e),2))}_onContextMenu(e){e.preventDefault()}_canDrag(e){return this._dragEnabled}onElementHit(){this._elementHit=!0}_getBoundingClientRect(){return this._boundingClientRectInvalid&&(this._boundingClientRect=this._domHelper.element.getBoundingClientRect(),this._boundingClientRectInvalid=!1),this._boundingClientRect}updateSize(){this._boundingClientRectInvalid=!0}}return __decorate([inject],e.prototype,"_domHelper",void 0),e})();class SelectionHandlerEvent{constructor(e){const{component:t,resetCamera:n,consecutive:i}=e;this.component=t,this.resetCamera=void 0===n||n,this.consecutive=void 0===i||i}}const PROMISE_CALLBACKS=new Map,RESOURCES=new Map;class AsyncDependencyLoader{static loadFont(e){if(RESOURCES.has(e))return new Promise(t=>{t(RESOURCES.get(e))});if(PROMISE_CALLBACKS.has(e))return new Promise((t,n)=>{PROMISE_CALLBACKS.get(e).push({resolve:t,reject:n})});let t=new THREE.FontLoader;return new Promise((n,i)=>{PROMISE_CALLBACKS.set(e,[{resolve:n,reject:i}]),t.load(getAssetPath()+e,t=>{RESOURCES.set(e,t),AsyncDependencyLoader._resolveAll(e,t)})})}static _resolveAll(e,t){PROMISE_CALLBACKS.has(e)&&PROMISE_CALLBACKS.get(e).forEach(e=>e.resolve(t)),PROMISE_CALLBACKS.delete(e)}}let ComponentDimensioningHelper=(()=>{class e{constructor(e){this._activeComponents=[],this._componentDimensioningsExist=new Map,this._creator_=e}setCamera(e){this._camera=e}add(e){if(this._componentDimensioningsExist.has(e.runtimeId)&&!this._componentDimensioningsExist.get(e.runtimeId))return!1;const t=this._plannerKernelAccess.kernelInstance.getComponent(e.runtimeId),n=t.dimensionings;if(this._componentDimensioningsExist.set(e.runtimeId,n.length>0),!n||0===n.length||this._camera.position.z<0)return!1;const i=kernelBoxToThreeBox(t.boxForMeasurement),s={x:this._camera.position.x,y:this._camera.position.z};return import("./component-dimensioning-d77dc5fd.js").then(t=>{AsyncDependencyLoader.loadFont("static/rubik_regular-75bd7bb699e9e39d.json").then(o=>{n.forEach(n=>{var r;e.add(new t.default(((r=n).from=r.from/1e3,r.to=r.to/1e3,1===r.type.value?(r.type={value:2},r.from*=-1,r.to*=-1):2===r.type.value&&(r.type={value:1}),r),i,o,s))})})}),this._activeComponents.push(e),!0}remove(e,t=!0){return new Promise(n=>{import("./component-dimensioning-d77dc5fd.js").then(i=>{let s=[];e.children.forEach(e=>{e instanceof i.default&&s.push(e)}),s.forEach(t=>{e.remove(t),dispose(t)}),t&&removeItem(this._activeComponents,e),n()})})}hasComponentDimensions(){return this._activeComponents.length>0}async reset(){for(const e of this._activeComponents)await this.remove(e);this._activeComponents=[]}invalidateDimensioningsCache(e){e?this._componentDimensioningsExist.delete(e):this._componentDimensioningsExist.clear()}}return __decorate([inject],e.prototype,"_plannerKernelAccess",void 0),e})();const convertToTHREE=e=>new THREE.Vector3(e.x/1e3,e.z/1e3,e.y/-1e3),convertToThreeDimensions=e=>new THREE.Vector3(e.x/1e3,e.z/1e3,e.y/1e3),convertToKernel=e=>({x:Math.round(1e3*e.x),y:Math.round(-1e3*e.z),z:Math.round(1e3*e.y)}),utilityStringToUTF16=e=>decodeURIComponent(encodeURIComponent(e)),convertCObject=e=>{if(!e){const t=typeof e;return"number"===t||"boolean"===t?e:null}if(!e.hasOwnProperty("size")&&e.size&&"function"==typeof e.size){let t=utilityToArray(e);for(let e=0;e<t.length;e++)t[e]=convertCObject(t[e]);return"string"==typeof t?utilityStringToUTF16(t):t}if("object"==typeof e)for(let t in e)e.hasOwnProperty(t)&&(e[t]=convertCObject(e[t]));return"string"==typeof e?utilityStringToUTF16(e):e},utilityToArray=e=>{let t=[];if(e){let n=e.size();for(let i=0;i<n;i++)t.push(e.get(i))}return t},convertToThreeMatrix=e=>{let t=new THREE.Matrix4,n=convertCObject(e);return t.fromArray(n),t.transpose(),(e=>{let t=new THREE.Matrix4;t.set(1,0,0,0,0,0,1,0,0,-1,0,0,0,0,0,1),t.scale(new THREE.Vector3(.001,.001,.001));let n=new THREE.Matrix4;return n.set(1,0,0,0,0,0,-1,0,0,1,0,0,0,0,0,1),n.scale(new THREE.Vector3(1e3,1e3,1e3)),t.multiply(e).multiply(n)})(t)};class Waiter{constructor(){this._promiseExecutors=[]}create(){return new Promise((e,t)=>{this._promiseExecutors.push({resolve:e,reject:t})})}resolve(e){return new Promise(t=>{this._promiseExecutors.forEach(t=>t.resolve(e)),this._promiseExecutors=[],t(e)})}reject(e){return new Promise((t,n)=>{this._promiseExecutors.forEach(t=>t.reject(e)),this._promiseExecutors=[],n(e)})}}class PlanElementViewModel extends class{constructor(e){this._coreReference=e.clone()}clearReference(){this._coreReference.delete(),this._coreReference=null}getKernelObject(){return this._coreReference}}{constructor(e){super(e),this._objectWaiter=new Waiter;const t=convertToTHREE(e.getCenter());this._container=new THREE.Object3D,this._container.position.copy(t),this._boundingBox=this._generateBoundingBox(),fadeIn(this._boundingBox),this._container.add(this._boundingBox),2!==this.getPlanElement().getType().value&&(this._object=new THREE.Object3D,this._container.add(this._object))}getSize(){return this._object?(new THREE.Box3).setFromObject(this._object).getSize(new THREE.Vector3):new THREE.Vector3}update(){if(this._container.position.copy(convertToTHREE(this.getPlanElement().getCenter())),this._boundingBox){const e=this.getSize();this._boundingBox.geometry=new THREE.BoxGeometry(e.x,e.y,e.z),this._boundingBox.position.y=e.y/2}}getPosition(){return this._container.position}getRotation(){return this._container.rotation.y}getBounds(){let e;return this.getPlanElement().boxForMeasurement?(e=kernelBoxToThreeBox(this.getPlanElement().boxForMeasurement),e.applyMatrix4(this.getContainer().matrix)):(e=new THREE.Box3,e.setFromObject(this._container)),e}getBoundingBox(){return this._boundingBox}getPlanElement(){return this._coreReference}setObject(e){this._object=e,this._objectWaiter.resolve(e)}getObject(){return this._object}async getObjectAsync(){return this._object?Promise.resolve(this._object):this._objectWaiter.create()}addMesh(e){this._object.add(e),this.hidePreviewBox()}getMesh(e){if(!this._object||0===this._object.children.length)return null;const t=getMaterialId(e,this.getPlanElement().getType());return this._object.children.find(e=>e.userData.material===t)}getContainer(){return this._container}getId(){return this.getPlanElement().getId()}clear(){dispose(this._container),this._selectionMesh&&dispose(this._selectionMesh)}remove(){var e;null===(e=this._container.parent)||void 0===e||e.remove(this._container),this.clear()}hidePreviewBox(){this._container&&this._boundingBox&&(this._boundingBox.material=(boundingBoxMaterial||(boundingBoxMaterial=new THREE.MeshBasicMaterial,boundingBoxMaterial.visible=!1),boundingBoxMaterial))}_generateBoundingBox(){const e=this.getSize(),t=new THREE.BoxGeometry(e.x,e.y,e.z);let n=new THREE.Color("#DDDDDD");const i=this.getPlanElement().customColor;i>0&&(n=(e=>{let t=new THREE.Color;return t.setRGB((e>>16)/255,(e>>8&255)/255,(e>>0&255)/255),t})(i));let s=new THREE.MeshStandardMaterial({color:n,opacity:1,transparent:!0}),o=new THREE.Mesh(t,s);return o.name="bounding box",o.position.y=e.y/2,o.castShadow=!1,o.receiveShadow=!1,o.layers.set(6),o}select(){this._isSelected=!0,this._selectionMesh&&this._container.add(this._selectionMesh)}deselect(){this._isSelected=!1,this._selectionMesh&&this._container.remove(this._selectionMesh)}hoverOn(){}hoverOff(){}setPrimaryColor(e){this._primaryColor=e}}class PlanObjectViewModel extends PlanElementViewModel{constructor(e){super(e),this._container.rotation.y=e.rotation}getPlanObject(){return this.getPlanElement()}getSize(){return convertToThreeDimensions(this.getPlanObject().size)}update(){super.update(),this._container.rotation.y=this.getPlanObject().rotation}}class ConfiguratorPlanObjectViewModel extends PlanObjectViewModel{constructor(e){super(e),this._container.name="Configurable "+this._container.name}addRootComponent(e){this.setObject(e),this._rootComponentId=e.id,this._rootComponentRuntimeId=e.runtimeId,this._container.add(this.getObject())}getConfigurationRuntimeId(){return this.getPlanObject().getConfigurationRuntimeId()}getRootComponentId(){return this._rootComponentId}getRootComponentRuntimeId(){return this._rootComponentRuntimeId}}var defaultSettings={isProduction:!0,isUnitTesting:!1,environment:"production",detailEnvironment:"development",features:{},APP:{RAPI:{server:"/api/v2",localReverseProxy:"https://www.roomle.com/api/v2",liveServer:"https://www.roomle.com/api/v2",testServer:"https://www.test.roomle.com/api/v2",headers:{apiKey:"roomle_portal_v2",currentTenant:9,locale:"en",language:"en",device:1,token:"anonymous",platform:"web"},itemHeaders:{assetRevision:"glb",assetFileFormat:"glb"}},SHORTENER_URL:"http://rml.co/"},environments:{PRODUCTION:"production",DEVELOPMENT:"development",TEST:"test",TEST_SERVER:"test_server",ALPHA:"alpha"}};"undefined"!=typeof module&&module.exports||(window.IS_DEBUG=!0),function(e=!1){if(e){let e=JSON.parse(JSON.stringify(defaultSettings));e.APP,e.features}}();var Env=JSON.parse(JSON.stringify(defaultSettings));let WALL_TOP_VIEW_MATERIAL,StaticPlanObjectViewModel=(()=>{class e extends PlanObjectViewModel{constructor(e){super(e),this._container.name="Static "+this._container.name}setRapiItem(e){return this._rapiItem?Promise.resolve():this._addStaticItem(e)}_addStaticItem(e){this._rapiItem=e;let t=this.getPlanObject();if(this._glbUrl=getGlbUrl(e),!this._glbUrl)return Promise.reject("No glb url found");let n=e.scaleable?convertToThreeDimensions(t.size):void 0,i=new THREE.Vector3(1,1,1);return t.flipX&&(i.x*=-1),t.flipY&&(i.z*=-1),new Promise(s=>{this._staticItemLoader.loadGLB(this._glbUrl,void 0,void 0,n,i,t.customColor,e.colorable).then(t=>{t.name=e.label,this.setObject(t),((e,t)=>{let n=(new THREE.Box3).setFromObject(e),i=n.getSize(new THREE.Vector3),s=Math.min(i.x,i.y,i.z),o=!0;s>5&&(console.warn("GLB seems to be too big ("+s+")",t),o=!1),n.min.y<-.01&&(console.warn("GLB seems to be under the floor ("+n.min.y+"): ",t),o=!1)})(t,this._glbUrl),fadeIn(t),this._container.add(this.getObject()),this.hidePreviewBox(),s()})})}getRapiItem(){return this._rapiItem}needsRapiItem(){return!this._glbUrl}getGLBUrl(){return this._glbUrl}}return __decorate([inject],e.prototype,"_staticItemLoader",void 0),e})();const getTopViewMaterial=()=>(WALL_TOP_VIEW_MATERIAL||(WALL_TOP_VIEW_MATERIAL=new THREE.MeshPhysicalMaterial({color:0})),WALL_TOP_VIEW_MATERIAL);class WallPlanElementViewModel extends PlanElementViewModel{constructor(e){super(e),this._topView=!1,this._container.name="Wall Plan Element"}getWallDimension(e=.2){const t=this.getPlanElement(),n=convertToTHREE(t.getCenter()),i=t.getPreferredSide();let s,o;0===i?(s=convertToTHREE(t.getCornerFromLeft()),o=convertToTHREE(t.getCornerToLeft())):(s=convertToTHREE(t.getCornerFromRight()),o=convertToTHREE(t.getCornerToRight()));const r=s.clone().add(o).divideScalar(2),a=s.clone().sub(o),l=a.clone().cross(new THREE.Vector3(0,1,0)).normalize();l.clone().dot(r.clone().sub(n))<0&&l.multiplyScalar(-1);const c=l.multiplyScalar(e),h=s.add(c),d=o.add(c),u=a.clone();a.dot(new THREE.Vector3(1,0,0))<0&&u.multiplyScalar(-1);const _=Math.atan2(u.z,u.x),p=h.clone().add(d).divideScalar(2);return{id:t.getId(),fromPosition3d:h,toPosition3d:d,textPosition3d:p,textDirection:u,textRotation:_,length:t.getLength(i)}}addMesh(e){e.traverse(e=>{this._setMaterial(e)}),e.layers.enable(9),super.addMesh(e);const t=(new THREE.Box3).setFromObject(this.getObject()).getSize(new THREE.Vector3);this._boundingBox.geometry=new THREE.BoxGeometry(t.x,t.y,t.z),this._boundingBox.position.y=t.y/2}_enableTopView(){this._container.traverse(e=>{this._setTopMaterial(e)})}_setTopMaterial(e){e instanceof THREE.Mesh&&!e.userData.originalMaterial&&e.material&&e!==this._boundingBox&&(e.userData.originalMaterial=e.material,e.material=getTopViewMaterial())}_disableTopView(){this._container.traverse(e=>{e instanceof THREE.Mesh&&e.userData.originalMaterial&&(e.material=e.userData.originalMaterial,delete e.userData.originalMaterial)})}setTopView(e){this._topView=e,this._topView?this._enableTopView():this._disableTopView()}getKernelObject(){return super.getKernelObject()}_setMaterial(e){e instanceof THREE.Mesh&&e.material&&e!==this._boundingBox&&(e.userData.originalMaterial||(e.userData.originalMaterial=e.material),this._topView&&this._isSelected?e.material=new THREE.MeshBasicMaterial({color:10526880,side:THREE.DoubleSide}):this._topView&&!this._isSelected?e.material=getTopViewMaterial():(e.material=e.userData.originalMaterial,delete e.userData.originalMaterial))}select(){super.select(),this._container.traverse(e=>{this._setMaterial(e)})}deselect(){super.deselect(),this._container.traverse(e=>{this._setMaterial(e)})}}class FloorPlanElementViewModel extends PlanElementViewModel{constructor(e){super(e),this._container.name="Floor Plan Element"}addMesh(e){super.addMesh(e),e.castShadow=!1;const t=(new THREE.Box3).setFromObject(this.getObject()).getSize(new THREE.Vector3);this._boundingBox.geometry=new THREE.BoxGeometry(t.x,.01,t.z)}}class CeilingPlanElementViewModel extends PlanElementViewModel{constructor(e){super(e),this._container.name="Ceiling Plan Element"}addMesh(e){super.addMesh(e),e.castShadow=!1;const t=(new THREE.Box3).setFromObject(this.getObject()).getSize(new THREE.Vector3);this._boundingBox.geometry=new THREE.BoxGeometry(t.x,.01,t.z)}}const META_INFO=new Map;class Benchmark{static start(e){if(!window.performance||!window.performance.getEntriesByName)return"";let t=window.performance.getEntriesByName(e).length++,n="";t<100&&(n="0"),t<10&&(n="0"+n);const i=t>0?e+"_"+n+t:e,s=i+"_start";return window.performance.mark(s),i}static addMeta(e,t){const n=Benchmark.getMeta(e);META_INFO.set(e,Object.assign(n,t))}static getMeta(e){return META_INFO.get(e)||{}}static end(e){}static getMeasure(e){return[]}static showBenchmarks(e){const t=window.performance.getEntriesByType("measure");t.sort((function(e,t){return e.startTime-t.startTime}));const n=[];for(let i=0,s=t.length;i<s;i++){const s=t[i];e&&-1===s.name.indexOf(e)||n.push({Start:parseFloat(s.startTime.toFixed(2)),Name:s.name,Duration:parseFloat(s.duration.toFixed(2))})}console.table(n)}}let AppContext=(()=>{class e{static init(t={}){const{kernelInstance:n,kernelContainer:i,planObjectId:s}=t;e.kernelInstance=n,e.kernelContainer=i,e.planObjectId=s}static cleanUp(){e.useHDGeometry=!1,e.kernelInstance=null,e.kernelContainer=null,e.planObjectId=null}}return e.useHDGeometry=!1,e.kernelInstance=null,e.kernelContainer=null,e.planObjectId=null,e})();const WAITERS=new Map,_endOperation=function(e,t,n){let i=WAITERS.get(e);if(i){const s=n?[n]:void 0;i.forEach(({resolve:e,reject:n})=>t?e.apply(e,s):n.apply(n,s)),WAITERS.delete(e)}};class AsyncHelper{static finishOperation(e,t){_endOperation(e,!0,t)}static failOperation(e,t){_endOperation(e,!1,t)}static waitFor(e,t){return new Promise((n,i)=>{let s=WAITERS.get(e);s||(WAITERS.set(e,[]),s=WAITERS.get(e)),s.push({resolve:n,reject:i}),"function"==typeof t&&t.apply(t)})}}const isRange=function(e){return e.validRange&&"string"==typeof e.validRange.type},isOptions=function(e){return e.validValues&&e.validValues.length>0},isMaterial=function(e){return"Material"===e.type};let MEM_URL,WASM_URL,WASM_LOADER,ASM_LOADER,CACHE_COMPILATION;const KERNEL_PATHS={WASM:{CONFIGURATOR:{URL:"static/ConfiguratorKernel-2e859fe27a3c86ed.wasm",LOADER:"static/ConfiguratorKernel-e9065c8be4011f61.js"},PLANNER:{URL:"static/RoomleCore-07c1ebfd847560ef.wasm",LOADER:"static/RoomleCore-b08e77d418a3f4a0.js"}},ASM:{CONFIGURATOR:{MEM_URL:"static/ConfiguratorKernelJs-23e7a53b8a38380c.mem",LOADER:"static/ConfiguratorKernelJs-b43dc826821e864e.js"},PLANNER:{MEM_URL:"static/RoomleCoreJs-f9d0ac5ec78a81f3.mem",LOADER:"static/RoomleCoreJs-b207f4e5106d5bf5.js"}}},USE_WASM=!!window.WebAssembly;let CommonKernelAccess=(()=>{class e{constructor(e){this._requestedMaterialIds=[],this._configuratorKernelCallbackListener=new Set,this._cachedGroupIds=[],this._waitingForGroups=!1,this._subComponentsWaiters=new Map,this._shouldWait=!0,this._creator_=e,window.KernelCallback={isReady:this.isReady.bind(this)},this._lifeCycleManager.addEventListener(this)}_utilityToLongArray(e){const t=new this._kernelContainer.LongArray;return e.forEach(e=>t.push_back(e)),t}init(e){this._kernelType=e,this._setupKernelPaths(e),this._setupEmsModule(e),this._useWASM=USE_WASM,this._kernelPath=USE_WASM?WASM_LOADER:ASM_LOADER}_initKernel(){const{unit:e,unitStringType:t}=this._initData;this._kernelInstance.setEnvironmentVariable("unit",e||"cm"),this._kernelInstance.setEnvironmentVariable("unitString",t||"short"),this._kernelInstance.useEnvironmentGeometry(1===this._kernelType);const{overrideCountry:n,locale:i}=this._globalInitData;n&&(this._kernelInstance.resetPriceListIds(),this._kernelInstance.addPriceList(n)),this._kernelInstance.setEnvironmentVariable("language",i)}get kernelContainer(){return this._kernelContainer}get kernelInstance(){return this._kernelInstance}_setupKernelPaths(e){const t=0===e?"PLANNER":"CONFIGURATOR";MEM_URL=KERNEL_PATHS.ASM[t].MEM_URL,WASM_URL=KERNEL_PATHS.WASM[t].URL,WASM_LOADER=KERNEL_PATHS.WASM[t].LOADER,ASM_LOADER=KERNEL_PATHS.ASM[t].LOADER,CACHE_COMPILATION=!0}_setupEmsModule(e){const t=this;this._kernelContainer={locateFile(t){const n=0===e?/RoomleCoreJs[\-a-z0-9]*\.js\.mem/:/ConfiguratorKernelJs[\-a-z0-9]*\.js\.mem/;return t.match(n)?getAssetPath()+MEM_URL:t},wasmBinaryFile:getAssetPath()+WASM_URL,preRun:[],postRun:[],setStatus:null,print(e){t._kernelIo.log(e)},printErr(e){t._kernelIo.error(e)},quit(e){0!==e&&t._kernelIo.throw(e&&e.toString?e.toString():"Unknown error while C/C++ main executes")}},CACHE_COMPILATION&&USE_WASM&&(this._kernelContainer.instantiateWasm=function(e,t){return((e,t,n)=>{const i="function"==typeof WebAssembly.instantiateStreaming;Benchmark.addMeta("kernel_is_ready",{cachedInIndexedDB:!1});let s=null;i?(Benchmark.start("kernel_stream_compile"),s=WebAssembly.instantiateStreaming(fetch(getAssetPath()+e),t),Benchmark.end("kernel_stream_compile")):(Benchmark.start("kernel_legacy_compile"),s=fetch(getAssetPath()+e).then(e=>e.arrayBuffer()).then(e=>WebAssembly.instantiate(e,t))),Benchmark.addMeta("kernel_is_ready",{instantiateStreaming:i}),s.then(e=>{Benchmark.end(i?"kernel_stream_compile":"kernel_legacy_compile"),n(e.instance)},e=>console.error(e))})(WASM_URL,e,t),{}})}_passSubComponentsToKernel(e,t){const n=e.id,i=t.get(n);if(i)for(let t=0,s=i.length;t<s;t++){const{parentId:s,partId:o}=i[t];this._kernelIo.setMeta({componentId:n}),this._kernelInstance.loadedSubComponent(s,o,n,e.configuration)}}_fetchSubComponents(e){let t=[...e.keys()];t.length&&this._rapiAccess.getComponents(t).then(t=>{for(let n=0,i=t.length;n<i;n++)this._passSubComponentsToKernel(t[n],e);this._flushSubComponentsWaiters()})}_flushSubComponentsWaiters(){this._fetchSubComponents(this._subComponentsWaiters),this._subComponentsWaiters=new Map,this._shouldWait=!1}isReady(){this._kernelContainer.setExternalHelpers(this._kernelIo,{convertCObject}),Env.isProduction||Env.isUnitTesting||this.addDebugInfo(),window.KernelCallback&&(window.KernelCallback=null,delete window.KernelCallback),this._unitFormatter.init(this._kernelContainer)}addDebugInfo(){const e=function(t,n=[]){const i=Object.getPrototypeOf(t),s=i?Object.getOwnPropertyNames(i):[],o=t?Object.getOwnPropertyNames(t):[];return i?e(i,[...n,...o,...s]):[...o,...s,...n]},t=e(this),n=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toString","valueOf"];[...new Set(t)].forEach(e=>{if(!e.startsWith("_")&&"function"==typeof this[e]&&-1===n.indexOf(e))try{const t=this[e].bind(this);this[e]=function(...n){return this._kernelIo.log("[ KernelCommunication ]: "+e),t(...n)}}catch(e){}})}getConfigurationData(e){return new Promise(t=>{var n;const i=this.kernelInstance.getPlanObject(e),s=(new Date).toISOString(),o=this.kernelInstance.getComponentId(e),r=getCatalogIdFromItemOrConfigurationId(o),a=(null===(n=i.boxForMeasurement)||void 0===n?void 0:n.size)||i.bounds;t({created:s,lastAccess:s,configuration:this.kernelInstance.getSerializedConfiguration(e),configurationHash:this.kernelInstance.getHashOfConfiguration(e),parts:JSON.stringify(this.kernelInstance.getPartList(e)),rootComponentId:o,width:a.x,height:a.z,depth:a.y,catalog:r,orderable:!1,requestable:!1})})}loadComponent(e,t,n){this._rapiAccess.getComponent(t.componentId).then(i=>{var s;let o=i.configuration;o||(o="error",null===(s=this._configuratorUiCallbacks)||void 0===s||s.onContentProblem({rapiPath:"components",ids:[t.componentId],message:t.componentId+" has no configuration"})),this._kernelIo.setMeta({componentId:t.componentId}),this._kernelInstance.loadComponent(e,o,t,n),this._flushSubComponentsWaiters()},i=>{var s;this._kernelInstance.loadComponent(e,"error",t,n),this.onLoadComponentError(i,t.componentId),null===(s=this._configuratorUiCallbacks)||void 0===s||s.onError(new Error(`Component with id "${t.componentId}" can not be loaded. "${i}"`)),this._flushSubComponentsWaiters()})}loadSubComponent(e,t,n){if(this._shouldWait){let i=this._subComponentsWaiters.get(n);i||this._subComponentsWaiters.set(n,[]),i=this._subComponentsWaiters.get(n),i.push({parentId:e,partId:t}),this._subComponentsWaiters.set(n,i)}else this._rapiAccess.getComponent(n).then(i=>{var s;let o=i.configuration;o||(o="error",null===(s=this._configuratorUiCallbacks)||void 0===s||s.onContentProblem({rapiPath:"components",ids:[n],message:"SubComponent "+n+" has no configuration"})),this._kernelIo.setMeta({componentId:n,parentId:e}),this._kernelInstance.loadedSubComponent(e,t,n,o)})}requestDeleteComponent(e){e&&this._kernelInstance.deleteComponent(e)}dockComponentWithPosition(e,t,n,i,s){var o;this._kernelInstance.dockComponentWithPosition(n,i,e,t,s);const r=this._kernelInstance.getComponentId(n),a=this._kernelInstance.getComponentId(e);null===(o=this._configuratorUiCallbacks)||void 0===o||o.onUserInitiatedDockDone(r,i,a,t,s)}Editor3dAddBakedMesh(e,t,n,i,s,o,r){this._configuratorKernelCallbackListener.forEach(a=>a.Editor3dAddBakedMesh(e,t,n,i,s,o,r))}Editor3dAddNamedMesh(e,t,n,i,s,o,r,a,l,c,h){this._configuratorKernelCallbackListener.forEach(d=>d.Editor3dAddNamedMesh(e,t,n,i,s,o,r,a,l,c,h))}Editor3ChangedNamedMesh(e,t,n,i,s,o){this._configuratorKernelCallbackListener.forEach(r=>r.Editor3ChangedNamedMesh(e,t,n,i,s,o))}Editor3dRemoveNamedMesh(e,t){this._configuratorKernelCallbackListener.forEach(n=>n.Editor3dRemoveNamedMesh(e,t))}Editor3dBeginConstruction(e,t){this._configuratorKernelCallbackListener.forEach(n=>n.Editor3dBeginConstruction(e,t))}Editor3dEndConstruction(e){this._configuratorKernelCallbackListener.forEach(t=>t.Editor3dEndConstruction(e))}Editor3dComponentCreated(e,t,n,i){this._configuratorKernelCallbackListener.forEach(s=>s.Editor3dComponentCreated(e,t,n,i,!1))}Editor3dComponentDocked(e,t,n,i){this._configuratorKernelCallbackListener.forEach(s=>s.Editor3dComponentDocked(e,t,n,i))}Editor3dGeometryReady(e){this._configuratorKernelCallbackListener.forEach(t=>t.Editor3dGeometryReady(e)),this.requestPlanComponentConstruction(e)}Editor3dGeometryNotReady(e){this._configuratorKernelCallbackListener.forEach(t=>t.Editor3dGeometryNotReady(e))}componentDeleted(e){this._configuratorKernelCallbackListener.forEach(t=>t.componentDeleted(e))}componentMetaUpdated(e){let t=this._kernelInstance.getComponent(e);this._configuratorKernelCallbackListener.forEach(e=>e.componentMetaUpdated(t))}sceneCleared(){this._configuratorKernelCallbackListener.forEach(e=>e.sceneCleared())}requestMaterialsInGroup(e){(Array.isArray(e)?e:[e]).forEach(e=>{-1===this._cachedGroupIds.indexOf(e)&&this._cachedGroupIds.push(e)}),this._waitingForGroups||(this._waitingForGroups=!0,AsyncHelper.waitFor(4).then(()=>{this._rapiAccess.getMaterialsByGroup(this._cachedGroupIds).then(e=>{let t=[];e.forEach(e=>{const n=[];e.materials.forEach(e=>n.push(e.id));const i=e.legacyId||e.id;e.legacyId||console.warn("Material group has no legacy id, please check content why this is the case"),t.push({group:i,materials:n})}),t.length&&this._kernelInstance.setMaterialsInGroup(t),this._cachedGroupIds=[]},e=>{var t;console.error(e),null===(t=this._configuratorUiCallbacks)||void 0===t||t.onError(new Error(`Material group with ids "${this._cachedGroupIds.join(",")}" can not be loaded. "${e}"`)),this._cachedGroupIds=[]})}))}requestPlanComponentConstruction(e){this._kernelInstance.requestDeltaPlanComponentConstruction(e)}addConfiguratorListener(e){this._configuratorKernelCallbackListener.add(e)}removeConfiguratorListener(e){this._configuratorKernelCallbackListener.delete(e)}cleanUpCallbacks(){"function"==typeof this._kernelContainer.unregisterConfiguratorCallback&&this._kernelContainer.unregisterConfiguratorCallback(this)}async requestMaterialProperties(e){let t=Array.isArray(e)?e:[e];if(this._requestedMaterialIds.push(...t),await wait(0),!this._requestedMaterialIds.length)return;const n=[...this._requestedMaterialIds];this._requestedMaterialIds=[];const i=await this._rapiAccess.getMaterials(n);let s=[];i.forEach(e=>{const t=new this._kernelContainer.StringStringMap,n=e.properties||{};for(let e in n)n.hasOwnProperty(e)&&t.set(e,n[e]);t.size()&&s.push({id:e.id,properties:t})}),s.length&&this._kernelInstance.setMaterialProperties(s)}registerCallbacks(){this._kernelContainer.registerConfiguratorCallback(this)}pause(){this.cleanUpCallbacks()}resume(){this.cleanUpCallbacks(),this.registerCallbacks()}destroy(){}_handleCortoMesh(e,t,n){var i;try{this._kernelInstance.addMeshCorto(t,n,new Uint8Array(e))}catch(e){console.error(e),null===(i=this._configuratorUiCallbacks)||void 0===i||i.onMemoryCorruption()}}_calcPrice(){const e=new Map;if(this._initData.useRoomlePrice){let e=this._kernelInstance.getFullPartList();if(e&&e.fullList&&e.fullList.length){const t=e.fullList[0].currencySymbol,n=e.fullList.reduce((e,t)=>e+(t.count?t.count:0)*(t.price?t.price:0),0);this._configuratorUiCallbacks.onUpdatePrice(t,n)}}else if(this._initData.usePriceService){let t=this._kernelInstance.getFullPartList();if(t&&t.fullList&&t.fullList.length){const n=t.fullList.reduce((t,n)=>{const i=kernelPartToPriceId(n);return i&&(e.set(i,n),t.push(i)),t},[]);return new Promise((i,s)=>{this._rapiAccess.getPrices(n).then(n=>{if(!n.length)return s(new Error("prices are empty"));const o=objectArrayToMap(n,"priceId");let r=0;return t.fullList.forEach(e=>{const t=kernelPartToPriceId(e);if(!o.has(t))return void console.warn("PriceId: "+t+" has no corresponding kernel-part");const{price:n,currencySymbol:i}=o.get(t);e.price=n,e.currencySymbol=i,r+=n*e.count}),this._configuratorUiCallbacks.onUpdatePrice(n[0].currencySymbol,r),i({totalSum:r,partMap:e})},e=>{console.error(e),s(e)})})}}return Promise.resolve({totalSum:0,partMap:e})}async addUiDataAndPriceToPartList(e,t){const{fullList:n,originPart:i}=e,s=e.perMainComponent;let o;this.addUiDataToPartList(n,t);try{const e=await this._calcPrice();o=e.partMap}catch(e){console.error(e),o=new Map}const r=this._initData.usePriceService||this._initData.useRoomlePrice,a=e=>{r||(e.price=null,e.currencySymbol=null);const t=kernelPartToPriceId(e);if(!t)return;if(!o.has(t))return;const{price:n,currencySymbol:i}=o.get(t);"number"==typeof n&&(e.price=n,e.currencySymbol=i)};return n.forEach(a),s.forEach(({fullList:e,perMainComponent:n})=>{n.length>0&&console.error("Not implemented! perMainComponent is deeper than one level"),this.addUiDataToPartList(e,t),e.forEach(a)}),{fullList:n,perMainComponent:s,originPart:i}}addUiDataToPartList(e,t){const n=[];return e.forEach(e=>{const t=this._rapiAccess.peekComponent(e.componentId);!t||e.labelIsCalculated&&e.label||(e.label=t.label),e.parameters.forEach(e=>{if(this._unitFormatter.formatPartListParameter(e),isMaterial(e)){const t=this._rapiAccess.peekMaterial(e.value);t?e.valueLabel=t.label||t.name||e.value:-1===n.indexOf(e.value)&&n.push(e.value)}})}),n.length&&this._rapiAccess.getMaterials(n).then(e=>{const n=this._lastPartListHash!==t;Array.isArray(e)&&e.length&&n&&(this._lastPartListHash=t,this.requestPartListAndUpdatePricesOfParts())}),e}async requestPartListAndUpdatePricesOfParts(e,t){let n=this._kernelInstance.getFullPartList();e||(e=this._kernelInstance.getHashOfConfiguration(this._configuratorContext.planObjectId));const i=await this.addUiDataAndPriceToPartList(n,e);this._configuratorUiCallbacks.onPartListUpdate(i,btoa(e))}}return __decorate([inject],e.prototype,"_rapiAccess",void 0),__decorate([inject],e.prototype,"_scriptLoader",void 0),__decorate([inject],e.prototype,"_kernelIo",void 0),__decorate([inject],e.prototype,"_dataSyncer",void 0),__decorate([inject],e.prototype,"_lifeCycleManager",void 0),__decorate([inject],e.prototype,"_configuratorUiCallbacks",void 0),__decorate([inject],e.prototype,"_globalCallback",void 0),__decorate([inject],e.prototype,"_initData",void 0),__decorate([inject],e.prototype,"_unitFormatter",void 0),__decorate([inject],e.prototype,"_configuratorContext",void 0),__decorate([inject],e.prototype,"_globalInitData",void 0),e})();const{APP:APP$1}=Env,{RAPI}=APP$1,headers=RAPI.headers,itemHeaders=RAPI.itemHeaders,TOKEN_IDENTIFIER=headers.token,LEGACY_GROUP_INDICATOR=uuid();let RAPI_MATERIAL_GROUP_CACHE=new Map,ITEM_ADDITIONAL_CONTENT_CACHE=new Map,RAPI_RELATIONS_CACHE=new Map,RAPI_CACHE=new Map,MESHES_TO_CATALOG_CACHE=new Map,RAPI_PACKAGE_CACHE=new Map,RAPI_PRELOAD_CACHE=new Map,WAITERS_FOR_URL=new Map,RAPI_ERROR_CACHE=new Map;const getCachedMaterialGroup=e=>RAPI_MATERIAL_GROUP_CACHE.get(e)||RAPI_MATERIAL_GROUP_CACHE.get(LEGACY_GROUP_INDICATOR+e),hasMaterialTags=e=>e&&e.tags&&e.tags.length,materialHasNoTagsButGroup=e=>!hasMaterialTags(e)&&e.group;let RapiAccess=(()=>{class e{constructor(e){this._itemLoaded=!1,this._currentToken=null,this._creator_=e,window.addEventListener("online",this._flushOfflineQueue.bind(this))}getPreloadForItem(e){return this._getPreload(e,!0)}getPreloadForConfiguration(e){return this._getPreload(e,!1)}_getPreload(e,t){return new Promise((n,i)=>{if(!navigator.onLine)return n();if(this._dataSyncer.getIsCatalogSynced(getCatalogIdFromItemOrConfigurationId(e)))return n();if(RAPI_PRELOAD_CACHE.get(e))return n();const s=t?"?itemId=":"?configurationId=";this._get("/preloads/components/"+s+e,"preloads/components").then(t=>{if(RAPI_PRELOAD_CACHE.get(e))return n();t.forEach(e=>{this._prepareData(e,"components")}),RAPI_PRELOAD_CACHE.set(e,!0),n()},i)})}changeUseOfHDGeometry(){const e=RAPI_CACHE.get("components");RAPI_PRELOAD_CACHE.clear(),RAPI_PACKAGE_CACHE.clear(),e&&RAPI_CACHE.delete("components")}getHSCPackage(e){return new Promise((t,n)=>{if(RAPI_PACKAGE_CACHE.get(e))return t();this._get("/catalogs/"+e+"/package","package").then(n=>{if(RAPI_PACKAGE_CACHE.get(e))return t(n);n.components.forEach(e=>{this._prepareData(e,"components")}),n.materials.forEach(e=>{this._prepareData(e,"materials"),this._prepareGroups(e)}),n.textures.forEach(e=>{this._prepareData(e,"textures")}),RAPI_PACKAGE_CACHE.set(e,!0),t(n)},n)})}getComponent(e){return this._getById(e,"components")}getConfiguration(e){return this._getById(e,"configurations")}getConfigurations(e){return this._getByIds(e,"configurations")}getItem(e){return this._getById(e,"items",{additionalHeaders:itemHeaders})}getComponents(e){return this._getByIds(e,"components")}getItems(e){return this._getByIds(e,"items",{additionalHeaders:itemHeaders})}getTag(e){return this._getById(e,"tags")}getTags(e){return this._getByIds(e,"tags")}getTexture(e){return this._getById(e,"textures")}getCatalog(e){return this._getById(e,"catalogs")}getMesh(e,t="crt",n=50){return this._getById(e,"meshes",{pathSuffix:"/data?format="+t+"&targetQuality="+n.toString()})}getMeshesOfCatalog(e){return new Promise((t,n)=>{const i=MESHES_TO_CATALOG_CACHE.get(e);i?t(i):this._get("/meshes?catalog="+e,"catalogMeshes").then(n=>{MESHES_TO_CATALOG_CACHE.set(e,n),t(n)},n)})}getTexturesOf(e){return this._getRelationData(e,{rapiPath:"textures"})}getItemsOf(e){return this._getRelationData(e,{rapiPath:"items"})}async getMaterialsOf(e){return(await this._getRelationData(e,{rapiPath:"materials"},{embed:["textures"]})).filter(e=>e.active)}getComponentsOf(e){return this._getRelationData(e,{rapiPath:"components"})}getAdditionalContentsOfItems(e){const t=[],n=[];return e.forEach(e=>{const i=ITEM_ADDITIONAL_CONTENT_CACHE.get(e.id.toString());i?n.push(...i):t.push(e.id.toString())}),new Promise((e,i)=>{0!==t.length?this._getByIdsPackets(t,"itemAdditionalContents",{filterKey:"itemIds"}).then(t=>{t.forEach(e=>{let t=ITEM_ADDITIONAL_CONTENT_CACHE.get(e.itemId);t||(t=[]);for(let n=0,i=t.length;n<i;n++)if(t[n].id===e.id)return;t.push(e),ITEM_ADDITIONAL_CONTENT_CACHE.set(e.itemId,t)}),e([...t,...n])},i):e(n)})}getMaterial(e){return this._getById(e,"materials",{embed:["textures"]})}peekMaterial(e){return this._peekData(e,"materials")}peekComponent(e){return this._peekData(e,"components")}peekItem(e){return this._peekData(e,"items")}peekConfiguration(e){return this._peekData(e,"configurations")}async getMaterials(e){return(await this._getByIds(e,"materials",{embed:["textures"]})).filter(e=>e.active)}getPlan(e){return this._getById(e,"plans")}static clearCaches(){RAPI_MATERIAL_GROUP_CACHE=new Map,RAPI_RELATIONS_CACHE=new Map,RAPI_CACHE=new Map,RAPI_PACKAGE_CACHE=new Map,RAPI_PRELOAD_CACHE=new Map,WAITERS_FOR_URL=new Map,ITEM_ADDITIONAL_CONTENT_CACHE=new Map}cleanUp(){e.clearCaches()}getMaterialsByGroup(e){const t=e.slice(),n=[];let i=t.length;for(let e=0;e<i;e++){const s=getCachedMaterialGroup(t[e]);if(s){const o=s.length;for(let e=0;e<o;e++){const t=this._getCache("materials").get(s[e]);n.push(t)}t.splice(e,1),i--,e--}}return new Promise((e,i)=>{0!==t.length&&navigator.onLine?this._getByIdsPackets(t,"materials",{filterKey:"groups",embed:["textures"]}).then(t=>{e(this.combineMaterialsToGroups([...t,...n]))},i):e(this.combineMaterialsToGroups(n))})}_flushOfflineQueue(){return new Promise((e,t)=>{const n=this._localStorage.getItem("hsc_configurations_offline_queue_v1"),i=[];for(let e in n)if(n.hasOwnProperty(e)){const t=n[e];i.push(new Promise((e,n)=>{this.saveConfiguration(t.data).then(i=>{const s=[];t.perspectiveImage&&!i.perspectiveImage&&s.push(this.savePerspectiveImage(i,t.perspectiveImage)),t.topImage&&!i.topImage&&s.push(this.savePerspectiveImage(i,t.topImage)),Promise.all(s).then(e,n)},n)}))}Promise.all(i).then(()=>{this._localStorage.setItem("hsc_configurations_offline_queue_v1",{}),e()},t)})}_setQueuedConfiguration(e,t={}){const n=e.configurationHash,{perspectiveImage:i,topImage:s}=t;let o=this._localStorage.getItem("hsc_configurations_offline_queue_v1")||{},r=o[n]||{};r.data=e,r.perspectiveImage=i,r.topImage=s,o[n]=r,this._localStorage.setItem("hsc_configurations_offline_queue_v1",o)}async saveConfiguration(e){return navigator.onLine?await this._save("/configurations",{configuration:e},"configurations",{accept:"application/json",contentType:"application/json; charset=UTF-8"}):(e.perspectiveImage=null,e.topImage=null,this._setQueuedConfiguration(e),this._markConfigurationAsLocally(e),Promise.resolve(e))}saveTopImage(e,t){return this._saveConfigurationImage(e,t,"topImage")}savePerspectiveImage(e,t){return this._saveConfigurationImage(e,t,"perspectiveImage")}getShortUrl(e,t){return new Promise((n,i)=>this._fetchJson("/shortIds","shortIds",{method:"POST",resolve:n,reject:i,data:JSON.stringify({shortId:{type:t,referencedId:e}}),accept:"application/json",contentType:"application/json; charset=UTF-8"}))}_peekData(e,t){const n=RAPI_CACHE.get(t);return n&&n.get(e)||null}_saveConfigurationImage(e,t,n){if(!navigator.onLine){const i={};return i[n]=t,this._setQueuedConfiguration(e,i),this._markConfigurationAsLocally(e),e[n]=t.image,Promise.resolve(e)}const i=this._formDataUtil.create(t.image,e.configurationHash,IMAGE_FORMATS.PNG,n);return this._save("/configurations/"+e.id+"/"+n,i,"configurations",{accept:"application/json"})}_markConfigurationAsLocally(e){e.isLocally=!0,e.id=e.configurationHash}_save(e,t,n,i={}){const s=t instanceof FormData?t:JSON.stringify(t);return new Promise((t,o)=>{const r={method:i.method||"POST",data:s,resolve:t,reject:o};i.contentType&&(r.contentType=i.contentType),i.accept&&(r.accept=i.accept),this._fetchJson(e,n,r)})}combineMaterialsToGroups(e){return new Promise((t,n)=>{const i=new Map,s={id:null,label:null,materials:[]},o=[];for(let t=0,n=e.length;t<n;t++){const n=e[t],r=n.tags&&n.tags.length?n.tags.map(e=>({isTag:!0,id:e})):[];n.group&&r.push({isTag:!1,id:LEGACY_GROUP_INDICATOR+n.group,legacyId:n.group}),r.length||r.push({isTag:!1,id:null}),n.tags&&n.tags.length&&n.tags.forEach(e=>-1===o.indexOf(e)?o.push(e):null),r.forEach(({isTag:e,id:t,legacyId:o})=>{const r=n.id;let a=t?getCachedMaterialGroup(t):[];a||(RAPI_MATERIAL_GROUP_CACHE.set(t,[]),a=getCachedMaterialGroup(t)),-1===a.indexOf(r.toString())&&a.push(r.toString());const l=hasMaterialTags(n),c=l&&e,h=materialHasNoTagsButGroup(n);if(c||h&&!e||!l&&!h&&!t){let e=t?i.get(t):s;e||(i.set(t,{id:t,label:n.groupLabel,legacyId:o,materials:[]}),e=i.get(t)),e.materials.push(n)}})}const r=s.materials.length?[s]:[];this.getTags(o).then(e=>{const n=e.reduce((e,t)=>(e[t.id]=t,e),{});return i.forEach((e,t)=>{r.push({id:t,label:n[t]?n[t].label:e.label,materials:e.materials,legacyId:e.legacyId,sort:n[t]?n[t].sort:void 0})}),t(r)},n)})}_getByIds(e,t,n={}){const i=this._getCache(t),s=this._getErrorCache(t),o=[],r=[...new Set(e)];let a=r.length;if(i&&i.size){const e=(new Date).getTime();for(let t=0;t<a;t++){const n=r[t],l=i.get(n),c=s.get(n);let h=!1;null!=l?(o.push(l),h=!0):h=void 0!==c&&(e-c.timestamp<6e4||!1===navigator.onLine),h&&(r.splice(t,1),a--,t--)}}return new Promise((e,i)=>{0!==r.length&&navigator.onLine?this._getByIdsPackets(r,t,n).then(t=>{e([...t,...o])},i):e(o)})}_getByIdsPackets(e,t,n={}){const i=n.filterKey||"ids";let s,o="/"+t+"/",r="?",a=[];const l=e.length;if(!l)return new Promise(e=>e([]));let c=!0,h=[];for(s=0;s<l;s++){c=!1;const n=e[s],l=r+i+"[]="+n,d=l.length+o.length;h.push(n),r="&",d<=1500?o+=l:(d>1500&&(h.pop(),s--),a.push({url:o,ids:h}),c=!0,o="/"+t+"/",r="?",h=[])}c||a.push({url:o,ids:h});const d=[];return a.forEach(e=>d.push(this._getByIdsSingle(e.ids,e.url,t,n))),new Promise((e,t)=>{Promise.all(d).then(t=>{const n=[];t.length&&t.forEach(e=>n.push(...e)),e(n)},t)})}_getByIdsSingle(e,t,n,i={}){return new Promise((s,o)=>{this._get(t,n,i).then(t=>{for(let n=0,s=t.length;n<s;n++){const s=i&&i.cacheKey?t[n][i.cacheKey]:t[n].id,o=e.indexOf(s.toString());-1!==o&&e.splice(o,1)}const o=e.length;if(o){const t=this._getCache(n),i=this._getErrorCache(n),s=(new Date).getTime();for(let n=0;n<o;n++)i.set(e[n],{code:0,timestamp:s}),t.delete(e[n]);this._errorHandler.dispatch(2,[n,e.map(e=>'"'+e+'"').join(",")])}s(t)},o)})}_getById(e,t,n={}){if(!e||""===e||"string"!=typeof e)return console.error("no id passed to _getById"),Promise.reject(new Error("no id passed to _getById"));const i=this._getCache(t).get(e);if(i)return new Promise(e=>e(i));if(!navigator.onLine)return Promise.reject("Nothing cached but tried to fetch in offline mode");const s={...n,id:e},o=n.pathSuffix||"";return this._get("/"+t+"/"+e+o,t,s)}_get(e,t,n={}){const i=AppContext.useHDGeometry?"includeGeometryHD=true":"";let s=-1===e.indexOf("?")?"?":"&";return""!==i&&(e+=s+i),n.embed&&Array.isArray(n.embed)&&n.embed.forEach(t=>{e+=s+"embed"+(t[0].toUpperCase()+t.substr(1))+"=true",s="&"}),new Promise((i,s)=>{const o=WAITERS_FOR_URL.get(e);Array.isArray(o)&&o.length>0?o.push({resolve:i,reject:s}):(WAITERS_FOR_URL.set(e,[{resolve:i,reject:s}]),this._fetchJson(e,t,n))})}_fetchJson(e,t,n={}){this._fetch(e,n).then(handleJsonResponse.bind(this)).then(this._handleJson(e,t,n).bind(this)).catch(this._handleError(e,n).bind(this))}async _fetch(e,t){const n={method:t.method?t.method:"GET",headers:this._createHeaders(t),mode:"cors",cache:"default"};t.data&&(n.body=t.data);let i=RAPI.server;const s=this._globalInitData.overrideRapi;s&&(i="live"===s?RAPI.liveServer:RAPI.testServer),(this._globalInitData.customApiUrl||""===this._globalInitData.customApiUrl)&&(i=this._globalInitData.customApiUrl);const o=new Request(i+e,n);this._globalCallback.onNetworkRequest(e,n,t);const r=await this._globalCallback.onCheckExternalCache(e,n);return r?{headers:{get:()=>"application/json"},json:()=>Promise.resolve(r)}:this._networkLayer.fetch(o)}_createHeaders(e={}){const t={...headers};this._globalInitData.overrideTenant&&(t.currentTenant=this._globalInitData.overrideTenant),this._globalInitData.overrideCountry&&(t.country=this._globalInitData.overrideCountry);const n=this._globalInitData.locale||"en";t.language=n,t.locale=n;const{contentType:i,accept:s,additionalHeaders:o,data:r}=e;if(i&&(t["content-type"]=e.contentType),s&&(t.accept=e.accept),o)for(let e in o)o.hasOwnProperty(e)&&(t[e]=o[e]);this._globalInitData.configuratorId&&(t.configurator=this._globalInitData.configuratorId);const a=this._currentToken||TOKEN_IDENTIFIER;t.token="03-"+window.btoa((new Date).toISOString()+";"+a+";"+headers.apiKey);const l=new Headers(t);return r instanceof FormData&&l.delete("content-type"),l}_handleJson(e,t,n={}){return i=>{let s=null,o=null;"number"==typeof i&&(s=i);for(let e in i)"meta"!==e&&i.hasOwnProperty(e)&&(s=i[e],o=e);if("error"===o)return this._handleError(e,n)(new Error(JSON.stringify(s)));if(!s)throw new TypeError("RAPI returned empty JSON");if(Array.isArray(s))for(let e=0,i=s.length;e<i;e++)this._prepareData(s[e],t,n),this._prepareEmbeddedData(s[e],t,n);else this._prepareData(s,t,n),this._prepareEmbeddedData(s,t,n);n.resolve?n.resolve(s):this._notifyWaiters(e,null,s)}}_prepareEmbeddedData(e,t,n={}){n.embed&&Array.isArray(n.embed)&&n.embed.forEach(i=>{const s=e[i.slice(0,-1)+"Objects"];if(Array.isArray(s)){for(let e=0,t=s.length;e<t;e++)this._prepareData(s[e],i,n);this._prepareRelationalData(t,i,e.id,s)}else s&&(this._prepareData(s,i,n),this._prepareRelationalData(t,i,e.id,[s]))})}_getCache(e){return this._getCacheFrom(e,RAPI_CACHE)}_getErrorCache(e){return this._getCacheFrom(e,RAPI_ERROR_CACHE)}_getCacheFrom(e,t){let n=t.get(e);return n||(t.set(e,new Map),n=t.get(e)),n}_setCache(e,t,n){n.set(e.toString(),t)}_prepareData(e,t,n=null){let i=this._getCache(t);const s=n&&n.cacheKey?e[n.cacheKey]:e.id;if(s||n&&n.id||"tenants/me"===t)if("tenants/me"!==t){{const t=s||n.id;this._setCache(t,e,i)}e.__rapi_path__=t}else this._setCache("0",e,i);else"shortIds"!==t&&console.error("Can not cache because there is no ID!")}_getRelationsCacheFor(e,t,n){let i=RAPI_RELATIONS_CACHE.get(t);if(!i){const s=new Map,o=new Map;o.set(n,void 0),s.set(e,o),RAPI_RELATIONS_CACHE.set(t,s),i=RAPI_RELATIONS_CACHE.get(t)}let s=i.get(e);if(!s){const t=new Map;t.set(n,void 0),i.set(e,t),s=i.get(e)}return s.get(n)}_prepareGroups(e){const t=e.group,n=e.id;let i=getCachedMaterialGroup(t);i||(RAPI_MATERIAL_GROUP_CACHE.set(t,[]),i=getCachedMaterialGroup(t)),-1===i.indexOf(n.toString())&&i.push(n.toString())}_handleError(e,t={}){return n=>{navigator.onLine?(n.rmlErrorCode=1,n.message='Failed to load "'+e+'" because of "'+n.message+'"',this._errorHandler.dispatch(1,[n])):(n.rmlErrorCode=0,n.message='Failed to load "'+e+'" because of "'+n.message+'"',this._errorHandler.dispatch(0,[n])),t.reject?t.reject(n):this._notifyWaiters(e,n,null)}}_getRelationData(e,t,n={}){const i=e.id;if(!i)return Promise.resolve([]);const s=e.__rapi_path__,o=t.rapiPath;let r=this._getCache(o),a=this._getRelationsCacheFor(i.toString(),s,o),l=[];return a?(a.forEach(e=>l.push(r.get(e))),new Promise(e=>e(l))):navigator.onLine?new Promise((e,t)=>{this._get("/"+s+"/"+i+"/"+o,o,n).then(t=>{this._prepareRelationalData(s,o,i,t),e(t)},t)}):Promise.resolve([])}_prepareRelationalData(e,t,n,i){RAPI_RELATIONS_CACHE.has(e)||RAPI_RELATIONS_CACHE.set(e,new Map);let s=RAPI_RELATIONS_CACHE.get(e);const o=n.toString();s.has(o)||s.set(o,new Map);let r=s.get(o),a=this._getCache(t),l=[];for(let e=0,t=i.length;e<t;e++){const t=i[e],n=t.id.toString();l.push(n),a.set(n,t)}r.set(t,l)}_notifyWaiters(e,t,n){const i=WAITERS_FOR_URL.get(e);if(i&&i.length){for(let e=0,s=i.length;e<s;e++)t?i[e].reject(t):i[e].resolve(n);WAITERS_FOR_URL.delete(e)}}_tenantMe(){return new Promise((e,t)=>{const n=this._getCache("tenants/me"),i=this._globalInitData.overrideTenant?this._globalInitData.overrideTenant:n.get("0");if(i)return e(i);this._fetchJson("/tenants/me","tenants/me",{resolve:t=>e(t),reject:t})})}async getTenant(e){return e||(e=await this._tenantMe()),this._getById(e.toString(),"tenants")}getCurrentSkin(){return this._tenantMe().then(e=>this._getById(e.toString(),"tenants").then(e=>this._getById(e.skin.toString(),"skins")))}getPrices(e){return this._getByIds(e,"prices",{filterKey:"priceIds",cacheKey:"priceId"})}async getConfiguratorSettings(e){const t=await this._getById(e,"configurators");return t.allowedHosts||(t.allowedHosts=[]),t.allowedHosts&&!Array.isArray(t.allowedHosts)&&(t.allowedHosts=t.allowedHosts.split(" ")),t}sendUserAction(e){return this._save("/userActions",{userAction:e},"userActions",{accept:"application/json",contentType:"application/json; charset=UTF-8"})}shareConfiguration(e,t,n){const i="/configurations/"+e+"/shares",s=new FormData;return s.append("email",t),s.append("type",n.toString()),new Promise((e,t)=>{const n={method:"POST",data:s,resolve:e,reject:t,accept:"application/json",contentType:"application/json; charset=UTF-8"};this._fetch(i,n).then(n.resolve,n.reject)})}export3D(e,t,n,i={}){const s="/configurations/"+e+"/3d-exports",o={formats:[{file_format:n,pack_external_data:!0,...i}]},r=JSON.stringify(o),a=new FormData;return a.append("email",t),a.append("settings",r),new Promise((e,t)=>{const n={method:"POST",data:a,resolve:e,reject:t};this._fetch(s,n).then(n.resolve,n.reject)})}async trackView(e){if(this._itemLoaded||(t=(()=>{var e;const t=(()=>{if(window.__RML__ENV__&&window.__RML__ENV__.skipIframeCheck)return!1;try{return window.self!==window.top}catch(e){return!0}})();let n=null===(e=null===window||void 0===window?void 0:window.location)||void 0===e?void 0:e.href;if(!n)return null;if(t){if(!document.referrer)return null;n=document.referrer}const{hostname:i}=new URL(n);return i})())&&(NAMES_FOR_LOCALHOST.includes(t)||t.endsWith("gitlab.io")||t.endsWith("gitlab.com")||t.endsWith("codesandbox.io")||t.endsWith("stackblitz.com")||/^(admin.*.roomle.com)$/.test(t)))return;var t;const{configuratorId:n}=this._globalInitData,i={module:3,action:1,actionId:e,actionLabel:n};await this.sendUserAction(i),this._itemLoaded=!0}signinUser(e,t){return new Promise((n,i)=>{const s={method:"POST",accept:"application/json",contentType:"application/json; charset=UTF-8",data:JSON.stringify({identification:e,passwordMD5:t}),cacheKey:"token",resolve:n,reject:i};this._fetchJson("/auth/signin","auth",s)})}async signoutUser(e){const t=this._currentToken;t!==e&&this.setCurrentToken(e),await this._fetch("/auth/signout",{}),t&&t!==e?this.setCurrentToken(t):this.removeCurrentToken()}async savePlan(e){const t=e.id?"/plans/"+e.id:"/plans";return this._save(t,{plan:e},"plans",{method:e.id?"PUT":"POST",accept:"application/json",contentType:"application/json; charset=UTF-8"})}setCurrentToken(e){this._currentToken=e}removeCurrentToken(){this._currentToken=null}createNewPlan(){return{name:"",description:"",changeDate:(new Date).toISOString(),created:(new Date).toISOString(),draftId:null,thumbnail:"data:image/png;base64,missing",planObjects:null,active:!0,open:0,planDirectory:0,changed:0,version:2,floorLevel:0,visibility:9,user:null,tenant:null,assets:[],parent:null,setting:null}}}return __decorate([inject],e.prototype,"_formDataUtil",void 0),__decorate([inject],e.prototype,"_errorHandler",void 0),__decorate([inject],e.prototype,"_dataSyncer",void 0),__decorate([inject],e.prototype,"_networkLayer",void 0),__decorate([inject],e.prototype,"_localStorage",void 0),__decorate([inject],e.prototype,"_globalInitData",void 0),__decorate([inject],e.prototype,"_globalCallback",void 0),e})();function RoomleComponentFactoryInitializer(){class e extends THREE.Object3D{constructor(e,t,n,i){super(),this._selected=!1,this.geometryChanged=!0,this.meshes=[],this.castShadow=!1,this.receiveShadow=!0,this._setValues(e,t,n,i)}static _generateOutline(e,t){let n=new THREE.LineSegments(new THREE.EdgesGeometry(e),new THREE.LineDashedMaterial({color:"#000000",dashSize:.03,gapSize:.01,linewidth:1}));return n.translateOnAxis(t,1),n.userData.ignoreComponentRaycast=!0,n}static cloneDockLine(e,t){let n=new THREE.LineSegments(e.geometry,e.material);return n.translateOnAxis(t.getCenter(new THREE.Vector3),1),n.name="dockline",n.layers.set(5),n.userData.ignoreComponentRaycast=!0,n}_setValues(e,t,n,i){e&&(this.runtimeId=e,this.name=e.toString()),t&&(this.roomlePosition=Object.assign({},t)),n&&(this.roomleRotation=Object.assign({},n)),i&&(this.parentObjectId=i)}get loadingMesh(){return this._loadingMesh}get boundingBoxMesh(){return this._boundingBoxMesh}get boundingBox(){return this._boundingBox}set roomlePosition(e){this._roomlePosition=e,e&&this.position.set(e.x/1e3,e.z/1e3,e.y/-1e3)}get roomlePosition(){return this._roomlePosition}set roomleRotation(e){this._roomleRotation=e,e&&this.rotation.set(e.x,e.z,-e.y)}get roomleRotation(){return this._roomleRotation}replaceMeshes(e){this.removeAllMeshes(),e.forEach(e=>{this.addMesh(new THREE.Mesh(e.geometry,e.material))})}addMesh(e,t){e.renderOrder=2,e.userData.meshType=0,t&&e.applyMatrix4(convertToThreeMatrix(t)),this.add(e),this.meshes.push(e)}getMeshById(e){return this.meshes.find(t=>t.userData.meshId===e)}removeMeshById(e){const t=this.getMeshById(e);t?this.removeMesh(t):console.warn("Could not remove mesh with id "+e,this.runtimeId,this.meshes)}removeMesh(e){const t=this.meshes.indexOf(e);this.remove(e),disposeMesh(e),t<0||this.meshes.splice(t,1)}removeAllMeshes(e=!0){this.meshes.forEach(t=>{this.remove(t),e&&disposeMesh(t)}),this.meshes=[],this._removeLoadingMesh(),this.remove(this._boundingBoxMesh),disposeMesh(this._boundingBoxMesh),this._boundingBoxMesh=null}_hideAllMeshes(){this.meshes.forEach(e=>e.visible=!1)}_showAllMeshes(){this.meshes.forEach(e=>e.visible=!0)}select(){this._selected=!0}loading(){if(!this._kernelBoundingBox)return void console.warn("Bounding box (box for measurements) for component "+this.runtimeId+" not set, can not show external mesh loading box!");this._removeLoadingMesh(),this._hideAllMeshes();const{x:e,y:t,z:n}=this._kernelBoundingBox.getSize(new THREE.Vector3);let i=new THREE.BoxGeometry(e,t,n);this._loadingMesh=new THREE.Mesh(i,new THREE.MeshStandardMaterial({transparent:!0,opacity:1,color:new THREE.Color("#DDDDDD")})),this._loadingMesh.name="loading mesh",this._loadingMesh.receiveShadow=!1,this._loadingMesh.castShadow=!1,this._loadingMesh.layers.set(5),this._loadingMesh.translateOnAxis(this._kernelBoundingBox.getCenter(new THREE.Vector3),1),this._loadingMesh.renderOrder=3,this.add(this._loadingMesh)}_removeLoadingMesh(){this._loadingMesh&&(this.remove(this._loadingMesh),disposeMesh(this._loadingMesh),this._loadingMesh=null)}loadingFinished(){this._removeLoadingMesh(),this._showAllMeshes()}deselect(){this._selected=!1}hoverOn(){setCursor("pointer")}hoverOff(){setCursor("default")}removeFromParent(){this.parent&&(this.parent.remove(this),this.removeAllMeshes())}computeBoundingBox(t,n=!1){if(this._boundingBoxMesh&&this.remove(this._boundingBoxMesh),!n&&t&&0===t.size.x&&0===t.size.y&&0===t.size.z)return;let i;if(!t||n){this._boundingBox=new THREE.Box3;let e=new THREE.Vector3;this.meshes.forEach(t=>{if(t.geometry instanceof THREE.Geometry){let n=t.geometry.vertices;for(let i=0,s=n.length;i<s;i++)e.copy(n[i]),e.applyMatrix4(t.matrix),this._boundingBox.expandByPoint(e)}else if(t.geometry instanceof THREE.BufferGeometry){let n=t.geometry.attributes.position;if(void 0!==n)for(let i=0,s=n.count;i<s;i++)e.fromBufferAttribute(n,i).applyMatrix4(t.matrix),this._boundingBox.expandByPoint(e)}}),this._kernelBoundingBox=this._boundingBox.clone();let t=this._boundingBox.max.x-this._boundingBox.min.x,n=this._boundingBox.max.y-this._boundingBox.min.y,s=this._boundingBox.max.z-this._boundingBox.min.z;i=new THREE.BoxGeometry(t,n,s)}else{this._kernelBoundingBox=kernelBoxToThreeBox(t),this._boundingBox=this._kernelBoundingBox.clone();let{x:e,y:n,z:s}=this._boundingBox.getSize(new THREE.Vector3);i=new THREE.BoxGeometry(e,n,s)}this._boundingBoxMesh=new THREE.Mesh(i,new THREE.MeshStandardMaterial({color:"#FFFFFF",transparent:!0,opacity:0,polygonOffset:!0,polygonOffsetFactor:-1,visible:!1})),this._boundingBoxMesh.name="bounding box mesh";let s=this._boundingBox.getCenter(new THREE.Vector3);this._boundingBoxMesh.position.add(s),this._boundingBoxMesh.layers.set(5),this._boundingBoxMesh.renderOrder=3,this._boundingBoxMesh.castShadow=!1,this._boundingBoxMesh.receiveShadow=!1,this.add(this._boundingBoxMesh),this._dockline=e._generateOutline(i,s),this._dockline.name="bounding box outline",this._dockline.layers.set(5),this._selected&&this.add(this._dockline)}recursiveMeshes(){let t=this.meshes.slice();return this.children.forEach(n=>{n instanceof e&&t.push(...n.recursiveMeshes())}),t}isChild(t){let n=!1;return this.children.forEach(i=>{i instanceof e&&!n&&(n=i.runtimeId===t||i.isChild(t))}),n}getKernelPosition(e){let t=this.parent.localToWorld(this.position);return convertToKernel(e.worldToLocal(t))}}class t extends e{constructor(e,t){super(e,null,null,null),this.glbUrl=t}}class n extends e{constructor(e,t,n,i){super(e,t,n,i),this._stringId=null,this.receivedPointAssociation=!1,this.castShadow=!1,this.receiveShadow=!1}get stringId(){return this._stringId?this._stringId:this.runtimeId.toString()}addMesh(e,t){super.addMesh(e,t),e.material instanceof THREE.MeshStandardMaterial&&(e.material.opacity=.6,e.material.roughness=1,e.material.metalness=0,e.material.color=new THREE.Color("#DDDDDD")),e.renderOrder=1,e.castShadow=!1,e.receiveShadow=!1}hoverOn(){this.remove(this._dockline),this.meshes.forEach(({material:e})=>{e.opacity=.9,e.roughness=1,e.metalness=0,e.color=new THREE.Color("#DDDDDD")}),setCursor("pointer")}hoverOff(){this.add(this._dockline),this.meshes.forEach(({material:e})=>{e.opacity=.6,e.roughness=1,e.metalness=0,e.color=new THREE.Color("#DDDDDD")}),setCursor("default")}clonePreview(t){const i=new n(this.runtimeId,this.roomlePosition,this.roomleRotation,this.parentObjectId);return i._stringId=this.runtimeId+"_"+t,this.children.forEach(e=>{e instanceof THREE.Mesh&&0===e.userData.meshType&&i.meshes.push(e.clone(!0))}),i.meshes.forEach(e=>{e.material=e.material.clone(),e.geometry=e.geometry.clone(),i.add(e)}),this._dockline&&(i._dockline=e.cloneDockLine(this._dockline,this._boundingBox)),this._boundingBoxMesh&&(i._boundingBoxMesh=this._boundingBoxMesh.clone(!0)),this._boundingBox&&(i._boundingBox=this._boundingBox.clone()),i}preparePreview(){this.add(this._dockline),this.add(this._boundingBoxMesh)}}class i extends n{constructor(e,t,n,i,s){super(e,t,n,i),s&&(this._stringId=this.runtimeId+"_has_additional_dock_point_copy")}set roomleLineFrom(e){this._roomleLineFrom=e,this.lineFrom=convertToTHREE(e)}get roomleLineFrom(){return this._roomleLineFrom}set roomleLineTo(e){this._roomleLineTo=e;let t=convertToTHREE(e);t.equals(this.lineFrom)&&(console.warn("lineFrom and lineTo are equal!"),t.add(new THREE.Vector3(0,.01,0))),this.lineTo=t}get roomleLineTo(){return this._roomleLineTo}set roomlePositionFrom(e){this._roomlePositionFrom=e,this.positionFrom=convertToTHREE(e)}get roomlePositionFrom(){return this._roomlePositionFrom}set roomlePositionTo(e){this._roomlePositionTo=e;let t=convertToTHREE(e);t.equals(this.positionFrom)&&(console.warn("positionFrom and positionTo are equal!"),t.add(new THREE.Vector3(0,.01,0))),this.positionTo=t}get roomlePositionTo(){return this._roomlePositionTo}addMesh(e,t){super.addMesh(e,t),e.visible=!1,e.renderOrder=3}hoverOn(){this._dockline.visible=!0,setCursor("pointer")}hoverOff(){this._dockline.visible=!1,setCursor("default")}preparePreview(){super.preparePreview(),this._dockline.visible=!1;let e=this.lineTo.clone(),t=this.lineFrom.clone();const n=(new THREE.Vector3).subVectors(e,t);let i=n.length(),s=n.normalize(),o=new THREE.ArrowHelper(s,t),r=new THREE.CylinderGeometry(.01,.01,i,16,1);this.lineMesh=new THREE.Mesh(r,new THREE.MeshStandardMaterial({color:"#DDDDDD",transparent:!0,opacity:.4})),this.lineMesh.name="line mesh";const a=(new THREE.Quaternion).setFromEuler(o.rotation);this.lineMesh.quaternion.multiply(a),this.lineMesh.renderOrder=1;let l=(new THREE.Vector3).addVectors(e,t).multiplyScalar(.5);this.lineMesh.position.copy((new THREE.Vector3).subVectors(l,this.position.clone())),this.add(this.lineMesh);let c=this._boundingBox.getCenter(new THREE.Vector3).applyEuler(this.docklineRotation),h=null,d=0,u=Math.abs(s.x),_=Math.abs(s.y),p=Math.abs(s.z);u>=_&&u>=p?(h=new THREE.Vector3(c.x,0,0),d=Math.sqrt(c.y*c.y+c.z*c.z)):_>=u&&_>=p?(h=new THREE.Vector3(0,c.y,0),d=Math.sqrt(c.x*c.x+c.z*c.z)):p>=_&&p>=u&&(h=new THREE.Vector3(0,0,c.z),d=Math.sqrt(c.y*c.y+c.x*c.x)),d=d>0?d:.01;let g=(new THREE.Vector3).subVectors(this.positionTo.clone(),this.positionFrom.clone()).length()+h.length(),m=new THREE.CylinderGeometry(1.1*d,1.1*d,g,32,1);this.boundingLineMesh=new THREE.Mesh(m,new THREE.MeshStandardMaterial({color:"#ffffff",transparent:!0,opacity:0})),this.boundingLineMesh.name="bounding line mesh",this.boundingLineMesh.userData.ignoreComponentRaycast=!0;let E=this.positionTo.clone(),f=this.positionFrom.clone(),C=(new THREE.Vector3).subVectors(E,f).normalize(),y=new THREE.ArrowHelper(C,f);const w=(new THREE.Quaternion).setFromEuler(y.rotation);this.boundingLineMesh.quaternion.multiply(w),this.boundingLineMesh.renderOrder=3;let M=(new THREE.Vector3).addVectors(this.positionTo.clone(),this.positionFrom.clone()).multiplyScalar(.5).add(c);this.boundingLineMesh.position.copy((new THREE.Vector3).subVectors(M,this.position.clone())),this.add(this.boundingLineMesh)}clonePreviewLine(t){let n=new i(this.runtimeId,this.roomlePosition,this.roomleRotation,this.parentObjectId,this.receivedPointAssociation);return n._stringId=this.runtimeId+"_"+t,this.children.forEach(e=>{e instanceof THREE.Mesh&&0===e.userData.meshType&&n.meshes.push(e.clone(!0))}),n.meshes.forEach(e=>{e.material=e.material.clone(),e.geometry=e.geometry.clone(),n.add(e)}),this._dockline&&(n._dockline=e.cloneDockLine(this._dockline,this._boundingBox)),this._boundingBoxMesh&&(n._boundingBoxMesh=this._boundingBoxMesh.clone(!0)),this._boundingBox&&(n._boundingBox=this._boundingBox.clone()),n}getPositionForIntersectionPoint(e){let t=this._boundingBox.getCenter(new THREE.Vector3).applyEuler(this.docklineRotation),n=this.positionTo.clone().add(t),i=this.positionFrom.clone().add(t),s=new THREE.Line3(i,n).closestPointToPoint(e,!0,new THREE.Vector3);return(isNaN(s.x)||isNaN(s.y)||isNaN(s.z))&&s.copy(e),s.sub(t)}updatePreviewPosition(e){let t=this.getPositionForIntersectionPoint(e),n=this.parent.localToWorld(t);this._newPosition=this.worldToLocal(n);let i=this._boundingBox.getCenter(new THREE.Vector3).applyEuler(this.docklineRotation);this._dockline.position.copy((new THREE.Vector3).addVectors(this._newPosition,i)),this._dockline.rotation.copy(this.docklineRotation)}hideSelectionLine(){this._dockline.visible=!1}getKernelPosition(e){if(this._newPosition){let t=this.localToWorld(this._newPosition);return convertToKernel(e.worldToLocal(t))}return super.getKernelPosition(e)}}class s extends THREE.OrthographicCamera{constructor(e,t,n,i,s,o,r){super(e,t,n,i,s,o),r||(r={left:0,top:1,right:1,bottom:0}),this.offset=r}set offset(e){this._offset=e,this.updateProjectionMatrix()}get offset(){return this._offset}updateProjectionMatrix(){this._offset?(this.projectionMatrix=this._calculateProjectionMatrix(),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()):super.updateProjectionMatrix()}_calculateProjectionMatrix(){const e=this._calculate2DPlanes();if(this._offset.left>=this._offset.right||this._offset.bottom>this._offset.top)return(new THREE.Matrix4).makeOrthographic(e.left,e.right,e.top,e.bottom,this.near,this.far);const t=this._scaleRange(e.left,e.right,this._offset.left,this._offset.right);let n=t.from,i=t.to;const s=this._scaleRange(e.bottom,e.top,this._offset.bottom,this._offset.top);let o=s.from,r=s.to;const a=(e.right-e.left)/(e.top-e.bottom),l=(i-n)/(r-o);if(l>a){const e=(o+r)/2,t=(r-o)*l/a;o=e-t/2,r=e+t/2}else{const e=(n+i)/2,t=(i-n)*a/l;n=e-t/2,i=e+t/2}return(new THREE.Matrix4).makeOrthographic(n,i,r,o,this.near,this.far)}_scaleRange(e,t,n,i){const s=(t-e)/(i-n);return{from:e-s*n,to:t+s*(1-i)}}_calculate2DPlanes(){const e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,i=(this.top+this.bottom)/2;let s=n-e,o=n+e,r=i+t,a=i-t;if(null!==this.view&&this.view.enabled){const e=(this.right-this.left)/this.view.fullWidth/this.zoom,t=(this.top-this.bottom)/this.view.fullHeight/this.zoom;s+=e*this.view.offsetX,o=s+e*this.view.width,r-=t*this.view.offsetY,a=r-t*this.view.height}return{left:s,right:o,top:r,bottom:a}}}class o extends THREE.PerspectiveCamera{constructor(e,t,n,i,s){super(e,t,n,i),s||(s={left:0,top:1,right:1,bottom:0}),this.offset=s}set offset(e){this._offset=e,this.updateProjectionMatrix()}get offset(){return this._offset}_calculateProjectionMatrix(){let e,t,n,i,s=this.fov*(2*Math.PI/360)/2;n=Math.tan(s),i=-n;let o=Math.atan(this.aspect*Math.tan(s));t=Math.tan(o),e=-t;let r=this._offset.left,a=this._offset.right,l=this._offset.top,c=this._offset.bottom,h=new THREE.Vector2(a-r,l-c),d=new THREE.Vector2(r+h.x/2,c+h.y/2);if(h.x<h.y){let s=(1-d.x)/(h.x/2),o=d.x/(h.x/2);t*=s,e*=o;let r=(s+o)/2;n*=r,i*=r}else{let s=(1-d.y)/(h.y/2),o=d.y/(h.y/2);n*=s,i*=o;let r=(o+s)/2;e*=r,t*=r}e*=this.near,t*=this.near,n*=this.near,i*=this.near;let u=this.near*Math.tan(Math.PI/180*.5*this.fov)/this.zoom*2,_=this.aspect*u;return this.view&&this.view.enabled&&(e+=this.view.offsetX*_/this.view.fullWidth,n-=this.view.offsetY*u/this.view.fullHeight,t+=this.view.offsetX*_/this.view.fullWidth,i-=this.view.offsetY*u/this.view.fullHeight),(new THREE.Matrix4).makePerspective(e,t,n,i,this.near,this.far)}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){this._offset?(this.projectionMatrix=this._calculateProjectionMatrix(),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()):super.updateProjectionMatrix()}}return{create:function(t,n,i,s){return new e(t,n,i,s)},createPreview:function(e,t){return new n(e,{x:0,y:0,z:0},{x:0,y:0,z:0},t)},createStatic:function(e,n){return new t(e,n)},createPreviewLine:function(e){let t=new i(e.id,e.roomlePosition,e.roomleRotation,e.parentObjectId,e.receivedPointAssociation);return e.meshes.forEach(e=>{let n=e.clone();n.material=e.material.clone(),n.geometry=e.geometry.clone(),t.addMesh(n)}),t.computeBoundingBox(),t},isPreview:function(e){return e instanceof n},isPreviewLine:function(e){return e instanceof i},createPerspectiveCamera:function(e,t,n,i,s){return new o(e,t,n,i,s)},createOrthographicCamera:function(e,t,n,i,o,r,a){return new s(e,t,n,i,o,r,a)}}}const DEFAULT_CONVERSATION_ID=9;let ConfiguratorViewModel=(()=>{class e{constructor(e){this._mergeThreshold=3,this._componentsToMerge=new OccurrenceMap,this._mergeInProgress=!1,this._components=new Map,this._previews=new Map,this._componentNumberOfPossibleChildren=new Map,this._creator_=e,this._getKernelAccess().addConfiguratorListener(this),this._componentFactory=RoomleComponentFactoryInitializer()}get materialQueue(){return this.getMeshGenerator().materialQueue}_getKernelAccess(){return RoomleDependencyInjection.lookup("planner-kernel-access",this._creator_)}clearReference(){this._getKernelAccess().removeConfiguratorListener(this)}_applyMeshTransform(e,t,n,i,s){if(n){const i=e.userData.transform=convertToThreeMatrix(n);t&&(e.userData.transform=i),e.applyMatrix4(i)}if(i&&6===(null==i?void 0:i.length)&&(!isUVIdentityMatrix(i)||(null==t?void 0:t.uvTransform)&&!isUVIdentityMatrix(null==t?void 0:t.uvTransform))){const n=(e=>{const t=new THREE.Matrix4;return t.set(e[0],e[2],0,e[4],e[1],e[3],0,e[5],0,0,1,0,0,0,0,1),t})(i);t&&(t.uvTransform=n);const o=null!=s?s:e.geometry;if(o&&o.attributes.uv){const t=o.clone();t.attributes.uv.applyMatrix4(n),e.geometry=t}}}_addMeshToSubPart(e,t,n,i,s,o,r,a,l){const c=this._generateMesh(e,t,n,o,r,a,l);this._applyMeshTransform(c,null,i,s),this._subPartObject.add(c)}_addMeshToComponent(e,t,n,i,s,o,r,a,l,c,h){if(this._subPartGuard&&this._subPartGuard.info===e)return void this._addMeshToSubPart(e,null,i,null,null,r,a,l,c);const d=this.getComponent(e);if(!d)return;const u=this._componentFactory.isPreview(d),_=this._generateMesh(e,n,u?null:i,r,a,l,c);_.userData.meshId=t,_.userData.geometryId=n,_.userData.materialId=i,this._applyMeshTransform(_,_.userData,s,o),u&&_.layers.set(5),d&&d.addMesh(_),d.meshes.length>this._mergeThreshold&&this._componentsToMerge.set(e,d.meshes.length)}_changeMeshOfComponent(e,t,n,i,s,o){const r=this.getComponent(e);if(!r)return;const a=r.getMeshById(t);if(a){a.userData.geometryId!==n&&console.warn("Geometry of mesh has changed!"),a.userData.materialId=i,this._configuratorMeshGenerator.setMaterial(a,i),s&&(a.position.set(0,0,0),a.scale.set(1,1,1),a.rotation.set(0,0,0));const e=this._configuratorMeshGenerator.getGeometry(n);this._applyMeshTransform(a,a.userData,s,o,e)}}_removeMeshFromComponent(e,t){const n=this.getComponent(e);n&&n.removeMeshById(t)}getComponent(e){let t=this._components.get(e);return t||(t=this._previews.get(e.toString()),t)?t:(console.warn("component not found!",e),null)}getNumberOfPossibleChildrenForComponent(e){if(this._componentNumberOfPossibleChildren.has(e))return this._componentNumberOfPossibleChildren.get(e);const t=this._getKernelAccess().kernelInstance.getPlanComponentPossibleChildren(e).length;return this._componentNumberOfPossibleChildren.set(e,t),t}tryToMergeComponents(){this._initData.moc||this._mergeInProgress||(this._mergeInProgress=!0,this._componentsToMerge.size,this._requestMergeComponents())}_requestMergeComponents(){window.requestIdleCallback(this._mergeNextComponent.bind(this))}_mergeNextComponent(){if(this._componentsToMerge.size>0){const e=this._componentsToMerge.largestValue();this._componentsToMerge.delete(e),this._mergeComponent(e),this._requestMergeComponents()}else this._mergeInProgress=!1,this._geometriesMerged&&this._geometriesMerged(),this._components.forEach(e=>{e.loadingMesh&&console.warn("component still has loading mesh: ",e.hash)})}_mergeComponent(e){const t=this._components.get(e);if(t&&!(t.meshes.length<=this._mergeThreshold))if(this._cacheHolder.componentCache.has(t.hash)){const e=this._cacheHolder.componentCache.get(t.hash).meshes;t.replaceMeshes(e)}else{const e=new Map,n=[],i=[];t.meshes.forEach(t=>{const s=t.userData.material;if(!s)return void console.warn("mesh has no material id set");if(!e.has(s)){const i=new THREE.Mesh(new THREE.Geometry,t.material);i.userData.material=s,i.receiveShadow=!0,i.castShadow=!0,i.layers.set(3),this._setMaterial(i,s),n.push(i),e.set(s,i)}const o=e.get(s).geometry;t.userData.transform?o.merge(t.geometry,t.userData.transform):o.merge(t.geometry),i.push(t)}),n.forEach(e=>t.addMesh(e)),i.forEach(e=>t.removeMesh(e)),this._cacheHolder.componentCache.set(t.hash,t)}}_addRootComponent(e){this._listener&&this._listener.display(e)}removeDockingComponent(){this._getKernelAccess().requestDeleteComponent(this._configuratorContext.dockingRootComponentId),this._configuratorContext.dockingRootComponentId=null}dockComponent(e,t,n,i){let s=this._components.get(t),o=this._components.get(e);o&&(o.roomlePosition=n,o.roomleRotation=i,s&&s.add(o))}dockComponentWithPosition(e,t){let n,i=this._components.get(e.parentId);n=t?t.getKernelPosition(i):e.getKernelPosition(i);const s=Benchmark.start("dock_component_with_position_"+e.childId);this._getKernelAccess().dockComponentWithPosition(e.parentId,e.parentDockId,e.childId,e.childDockId,n),this._configuratorContext.dockingRootComponentId=null,Benchmark.end(s)}removePreviews(){this._previews.size>0&&(this._previews.forEach(e=>{e.removeFromParent(),e.removeAllMeshes()}),this._previews.clear())}_updatePlanObject(e){const t=this._components.get(e.rootPlanComponentId);let n=!0;t&&(n=t.geometryChanged),this._listener&&this._listener.planObjectUpdated(e,n)}Editor3dAddBakedMesh(e,t,n,i,s,o,r){this._addMeshToComponent(e,null,null,t,null,null,n,i,s,o,r)}Editor3dAddDockPreview(e,t){const n=this._componentFactory.createPreview(t,e);this._previews.set(t.toString(),n)}Editor3dAddNamedMesh(e,t,n,i,s,o,r,a,l,c,h){this._addMeshToComponent(e,t,n,i,s,h,o,r,a,l,c)}Editor3ChangedNamedMesh(e,t,n,i,s,o){this._changeMeshOfComponent(e,t,n,i,s,o)}Editor3dRemoveNamedMesh(e,t){this._removeMeshFromComponent(e,t)}Editor3dBeginConstruction(e,t){if(!t){const t=this._components.get(e);t&&t.removeAllMeshes()}this._subPartGuard&&e===this._subPartGuard.info&&(this._subPartObject=new THREE.Object3D)}Editor3dComponentCreated(e,t,n,i,s){s&&(this._configuratorContext.rootComponentId=e);let o=null;this._components.has(e)?(o=this._components.get(e),o.removeAllMeshes()):(o=this._componentFactory.create(e,t,n,i),o.layers.set(3)),this._components.set(e,o),s&&this._addRootComponent(o)}Editor3dComponentDocked(e,t,n,i){this.dockComponent(e,t,n,i)}Editor3dEndConstruction(e){if(this._subPartGuard&&this._subPartGuard.info===e)return void this._subPartGuard.resolve(this._subPartObject);const t=this._getKernelAccess().kernelInstance.getComponent(e),n=this._components.get(e);n&&(n.computeBoundingBox(t.boxForMeasurement),n.boundingBoxMesh&&this._listener&&this._listener.addComponentHandlers(n));let i=this._previews.get(e.toString());i&&i.computeBoundingBox(t.boxForMeasurement,!0)}Editor3dGeometryReady(e){const t=this._components.get(e);t&&t.loadingFinished()}Editor3dGeometryNotReady(e){const t=this._components.get(e);t&&t.loading()}Editor3dPlanObjectConstructionDone(e){const t=this._getKernelAccess().kernelInstance.getPlanObject(e),n=[t,this._getKernelAccess().kernelInstance.getFullPartList(),this._getKernelAccess().kernelInstance.getHashOfConfiguration(e),this._getKernelAccess().kernelInstance.getComponentId(t.rootPlanComponentId)];AsyncHelper.finishOperation(2,n),this._updatePlanObject(t),this._listener&&this._listener.planObjectConstructionDone(t)}Editor3dPreviewConstructionDone(e,t){let n=!1;this._previews.forEach(e=>{null!==e.parent&&(this._listener&&(this._componentFactory.isPreviewLine(e)?this._listener.addPreviewLineHandlers(e):this._listener.addPreviewHandlers(e)),n=!0)}),this._listener&&this._listener.previewConstructionDone(this._components.get(e),n)}Editor3dSetPreviewLineAssociations(e,t){let n=this._previews.get(t.toString());if(n.clear(),!n)return;let i=this._componentFactory.createPreviewLine(n),s=this._components.get(this._configuratorContext.rootComponentId);for(let t=0;t<e.length;t++){let n;n=0===t?i:i.clonePreviewLine(t),n.name="Preview Line",n.parentDockId=e[t].parentDockId,n.parentId=e[t].parentId,n.childDockId=e[t].childDockId,n.childId=e[t].childId,n.docklineRotation=(o=e[t].rotation,new THREE.Euler(o.x,o.z,-o.y)),n.roomlePosition=e[t].position,e[t].lineFrom.x>e[t].lineTo.x||e[t].lineFrom.y>e[t].lineTo.y||e[t].lineFrom.z>e[t].lineTo.z?(n.roomleLineFrom=e[t].lineTo,n.roomleLineTo=e[t].lineFrom):(n.roomleLineFrom=e[t].lineFrom,n.roomleLineTo=e[t].lineTo),e[t].positionFrom.x>e[t].positionTo.x||e[t].positionFrom.y>e[t].positionTo.y||e[t].positionFrom.z>e[t].positionTo.z?(n.roomlePositionFrom=e[t].positionTo,n.roomlePositionTo=e[t].positionFrom):(n.roomlePositionFrom=e[t].positionFrom,n.roomlePositionTo=e[t].positionTo),s.add(n),n.preparePreview(),this._previews.set(n.stringId,n)}var o}Editor3dSetPreviewPointAssociations(e,t){let n=this._previews.get(t.toString());if(!n)return;let i=this._components.get(this._configuratorContext.rootComponentId);for(let t=0;t<e.length;t++){let s;0===t?s=n:(s=n.clonePreview(t),this._previews.set(s.stringId,s)),s.name="Preview Point",s.parentDockId=e[t].parentDockId,s.parentId=e[t].parentId,s.childDockId=e[t].childDockId,s.childId=e[t].childId,s.preparePreview(),s.receivedPointAssociation=!0,s.userData.ignoreComponentRaycast=!0,i.add(s),s.roomlePosition=e[t].position,s.roomleRotation=e[t].rotation}}componentDeleted(e){const t=this._components.get(e);t&&(this._listener&&this._listener.componentDeleted(t),t.removeFromParent(),t.removeAllMeshes(),this._components.delete(e))}componentMetaUpdated(e){const t=this._getRuntimeComponent(e.id);t&&(t.hash=e.hash,t.roomlePosition=e.position,t.roomleRotation=e.rotation,e.boxForMeasurement&&t.computeBoundingBox(e.boxForMeasurement),this._listener&&this._listener.componentUpdated(t,e))}componentConfigurationUpdated(e,t){const n=this._getRuntimeComponent(e);n&&(n.geometryChanged=t)}_getRuntimeComponent(e){let t=this._components.get(e);return t||(t=this._previews.get(e.toString()),t)?t:null}configurationLoaded(e,t,n,i,s){10===e&&(this._configuratorContext.dockingRootComponentId=n);let o=0===t;o?this._getKernelAccess().kernelInstance.requestPlanComponentConstructionRecursive(n):this._getKernelAccess().kernelInstance.requestPlanObjectConstruction(t);let r=this._getKernelAccess().kernelInstance.getComponent(n),a=this._components.get(n);a&&(a.computeBoundingBox(r.boxForMeasurement),a.hash=r.hash),this._listener&&this._listener.configurationLoaded(a,o&&void 0!==a.boundingBoxMesh)}finishParameterChange(e,t){this.materialQueue.registerCallback(e)}planObjectConfigurationUpdated(e,t,n){let i=this._getKernelAccess().kernelInstance.getPlanObject(e);this._updatePlanObject(i)}planObjectCreated(e,t){this._configuratorContext.planObjectId=t,this._listener&&this._listener.clearScene()}planObjectUpdated(e){this._updatePlanObject(e)}sceneCleared(){this._components.forEach((function(e){e.removeFromParent(),e.removeAllMeshes()})),this._components.clear(),this._componentNumberOfPossibleChildren.clear(),this._previews.forEach(e=>{e.removeFromParent(),e.removeAllMeshes()}),this._previews.clear()}setListener(e){this._listener=e}getBoundingBox(){if(this._configuratorContext.planObjectId){const e=this._getKernelAccess().kernelInstance.getPlanObject(this._configuratorContext.planObjectId);if(e&&e.boxForMeasurement)return kernelBoxToThreeBox(e.boxForMeasurement)}else if(this._configuratorContext.rootComponentId){const e=this._components.get(this._configuratorContext.rootComponentId);return(new THREE.Box3).setFromObject(e)}return null}getBoundingBoxWithPreviews(){const e=this._components.get(this._configuratorContext.rootComponentId);return e?(new THREE.Box3).setFromObject(e):null}hasPreviews(){return this._previews.size>0}clearRootComponent(){var e;null===(e=this._components.get(this._configuratorContext.rootComponentId))||void 0===e||e.hoverOff()}debugSceneGraph(e){e?this._components.has(e)?this._components.get(e):this._previews.has(e.toString())&&this._previews.get(e.toString()):this._configuratorContext}getComponentsForIds(e){let t=[];return e.forEach(e=>{const n=this._components.get(e);n&&t.push(n)}),t}getComponents(){return Array.from(this._components.values())}getPreviews(){return Array.from(this._previews.values())}isPreviewLine(e){return this._componentFactory.isPreviewLine(e)}isPreview(e){return this._componentFactory.isPreview(e)}setGeometriesMergedListener(e){this._geometriesMerged=e}removeGeometriesMergedListener(){this._geometriesMerged=void 0}setMergeThreshold(e){this._mergeThreshold=e}_generateMesh(e=0,t=null,n,i,s,o,r,a,l){return this._configuratorMeshGenerator.generateMesh(e,t,n,i,s,o,r)}_setMaterial(e,t,n){this._configuratorMeshGenerator.setMaterial(e,t)}constructComponents(e){this._getKernelAccess().kernelInstance.requestPlanObjectConstruction(e)}requestSubPartConstruction(e){return this._subPartGuard=new AsyncGuard(e),this._getKernelAccess().requestPlanComponentConstruction(e),this._subPartGuard.wait()}getMeshGenerator(){return this._configuratorMeshGenerator}}return __decorate([inject],e.prototype,"_configuratorMeshGenerator",void 0),__decorate([inject],e.prototype,"_configuratorContext",void 0),__decorate([inject],e.prototype,"_cacheHolder",void 0),__decorate([inject],e.prototype,"_initData",void 0),e})();class OccurrenceMap extends Map{largestValue(){let e=this.entries().next().value[0],t=0;return this.forEach((n,i)=>{n>t&&(e=i,t=n)}),e}}const ASYNC_PARAMTER_CHANGES=["material"];let ConfiguratorKernelAccess=(()=>{class e extends CommonKernelAccess{constructor(e){super(e),this.externalMeshQueue=new PromiseQueue,this.muteKernelCallbacks=!1,this.listOfVariants=(e,t)=>{}}init(e){super.init(e),Benchmark.addMeta("kernel_is_ready",{isWasm:this._useWASM}),AppContext.kernelInstance?(this._kernelContainer=AppContext.kernelContainer,setTimeout(()=>this._loadSuccess(),0)):this._scriptLoader.fetch(this._kernelPath,{id:"kernel"}).then(this._loadSuccess.bind(this),this._loadError.bind(this))}_loadSuccess(){Benchmark.start("kernel_is_ready"),window.ConfiguratorKernel&&(AppContext.kernelInstance?setTimeout(()=>this.isReady(),0):(window.ConfiguratorKernel(this._kernelContainer),window.ConfiguratorKernel=null))}_loadError(){this._configuratorKernelAccessCallback.loadError()}selectedComponent(e){this._updateComponentDependencies(e)}uiRequestConfiguration(e){const t=this._kernelInstance.getSerializedConfiguration(e);AsyncHelper.finishOperation(1,t)}_updateComponentParameters(e){let t=this._kernelInstance.getComponentParameters(e);const n=this._kernelInstance.getComponent(e);this._configuratorKernelAccessCallback.updateParameters(t,n.parameterGroups,e,1)}selectionChange(e,t){let n=!1,i=[];if(e){let t=this._kernelInstance.getComponent(e);t.componentId=this._kernelInstance.getComponentId(e),t&&t.childIds&&t.childIds.length>0&&(n=!0),i.push(t)}this._configuratorUiCallbacks.onSelectionChange("standard",t,n,i)}multiSelectionChange(e,t){this._updateCommonComponentDependencies(e);let n=!1,i=!1,s=[];e&&e.forEach(e=>{let o=this._kernelInstance.getComponent(e);o.componentId=this._kernelInstance.getComponentId(e),o&&o.childIds&&o.childIds.length>0&&(n=!0),o.id===t&&(i=!0),s.push(o)}),this._configuratorUiCallbacks.onSelectionChange("multiselect",i,n,s)}_updateCommonComponentDependencies(e){const{parameters:t,parameterGroups:n}=this._kernelInstance.getCommonPlanComponentParameters(this._utilityToLongArray(e));this._configuratorKernelAccessCallback.updateParameters(t,n,e,2)}_updateComponentChildren(e){const t=this._kernelInstance.getPlanComponentPossibleChildren(e);this._configuratorKernelAccessCallback.updatePossibleChildren(e,t,1)}_updateComponentDependencies(e){this._updateComponentParameters(e),this._updateComponentChildren(e)}_updatePlanObjectParameters(e){let t,n=this._kernelInstance.getPlanObjectParameters(e);if(0===n.length){let i=this._kernelInstance.getRootPlanComponentIdFromObjectId(e);n=this._kernelInstance.getComponentParameters(i),this._enableRootComponentParametersAsGlobal(),t=this._kernelInstance.getComponent(i)}else this._configuratorContext.rootComponentParametersAsGlobal=!1,t=this._kernelInstance.getPlanObject(e);this._configuratorKernelAccessCallback.updateParameters(n,t.parameterGroups,e,0)}_enableRootComponentParametersAsGlobal(){this._configuratorContext.selectedRuntimeComponentId||(this._configuratorContext.rootComponentParametersAsGlobal=!0)}_updatePlanObjectChildren(e){const t=this._kernelInstance.getPlanObjectPossibleChildren(e);this._configuratorKernelAccessCallback.updatePossibleChildren(e,t,0)}updatePlanObjectDependencies(e){this._updatePlanObjectParameters(e),this._updatePlanObjectChildren(e)}_updateConfigurationHasChildren(e,t=null){t||(t=this._kernelInstance.getComponent(this._kernelInstance.getRootPlanComponentIdFromObjectId(e)));const n=t.childIds.size?t.childIds.size():t.childIds.length;this._configuratorUiCallbacks.onConfigurationHasChildren(n>0)}dockComponent(e,t,n,i){const s=this._kernelInstance.getComponentId(n),o=this._kernelInstance.getComponentId(e);this._kernelInstance.dockComponent(n,i,e,t),this._configuratorUiCallbacks.onUserInitiatedDockDone(s,i,o,t,null)}changeUseOfHDGeometry(e,t){this._rapiAccess.changeUseOfHDGeometry();const n=e.planObjectId,i=e.lastLoadedRapiId?e.lastLoadedRapiId:this._kernelInstance.getComponentId(n),s=this._kernelInstance.getSerializedConfiguration(n);this._kernelInstance.clearAll(),this._kernelInstance.useHDGeometry(t),AsyncHelper.finishOperation(3,[s,i])}webGlPreviewDockings(e,t){AsyncHelper.waitFor(4).then(({componentId:n})=>{t&&this.requestPlanComponentConstruction(n),this._kernelInstance.requestPreviewGeometry(n,e.planObjectId)}),e.lastPossibleChild&&e.lastPossibleChild.isComponent&&(this._kernelIo.setMeta({componentId:e.lastPossibleChild.id}),this._kernelInstance.loadPlainComponent(10,e.lastPossibleChild.id,e.lastPossibleChild.configuration)),e.lastPossibleChild&&e.lastPossibleChild.isItem&&this._kernelInstance.loadFreeFlyingConfiguration(10,e.lastPossibleChild.configuration)}previewDockingsWithDrag(e,t){this._kernelInstance.requestPreviewGeometry(e,t)}loadConfiguration(e){this._initData.id?this._memoryManager.loadingConfiguration(this._initData.id):this._memoryManager.loadingConfigurationString(),this._memoryManager.shouldHardReset()?this._kernelInstance.clearAll():this._kernelInstance.clearScene(),this._kernelInstance.loadConfiguration(9,e,{x:0,y:0,z:0})}changeCommonComponentParameter(e,t,n,i,s,o){"string"==typeof i?this._kernelInstance.setPlanComponentParameters(this._utilityToLongArray(e),t,i):console.warn("tried to set a parameter to a none string value!",i,t,n),this._finishParameterChange(n,s,o),this._updateCommonComponentDependencies(e)}changeComponentParameter(e,t,n,i,s,o){"string"==typeof i?this._kernelInstance.setComponentParameter(e,t,i):console.warn("tried to set a parameter to a none string value!",i,t,n),this._finishParameterChange(n,s,o),this._updateComponentDependencies(e)}changePlanObjectParameter(e,t,n,i,s,o){"string"==typeof i?this._kernelInstance.setPlanObjectParameter(e,t,i):console.warn("tried to set a parameter to a none string value!",i,t,n),this._finishParameterChange(n,s,o)}_finishParameterChange(e,t,n){-1===ASYNC_PARAMTER_CHANGES.indexOf(e)?setTimeout(()=>t(),0):this._configuratorKernelCallbackListener.forEach(e=>e.finishParameterChange(t,n))}requestDeleteComponents(e){e&&this._kernelInstance.deletePlanComponents(this._utilityToLongArray(e))}loadComponentIntoKernel(e,t){this._kernelIo.setMeta({componentId:t}),this._kernelInstance.loadComponentDefinition(10,e)}async requestPartListAndUpdatePricesOfParts(e,t){let n=this._kernelInstance.getFullPartList();e||(e=this._kernelInstance.getHashOfConfiguration(this._configuratorContext.planObjectId));const i=await this.addUiDataAndPriceToPartList(n,e);this._configuratorUiCallbacks.onPartListUpdate(i,btoa(e))}requestSync(e,t){this.planObjectCreated(e,t),this._kernelInstance.syncPlanObjectToView(e,t)}getGlobalParameters(e,t){return new Promise(n=>{let i=this._kernelInstance.getPlanObjectParameters,s=e;t&&(i=this._kernelInstance.getComponentParameters,s=this._kernelInstance.getRootPlanComponentIdFromObjectId(e)),n(i.apply(this._kernelInstance,[s]))})}getPartList(){return new Promise(e=>{e(this._kernelInstance.getFullPartList())})}getConfigurationHash(e){return new Promise(t=>t(this._kernelInstance.getHashOfConfiguration(e.planObjectId)))}requestPlanObjectConstruction(e){this._kernelInstance.requestPlanObjectConstruction(e)}isReady(){super.isReady(),Benchmark.end("kernel_is_ready"),this._setupKernel(),Env.isProduction||(window.__RML__DEBUG__.Kernel=this._kernelInstance,window.__RML__DEBUG__.KernelContainer=this._kernelContainer,window.__RML__DEBUG__.Helper={convertCObject}),this._configuratorKernelAccessCallback.isReady(),this._configuratorUiCallbacks.onConfiguratorKernelIsReady(this._kernelContainer,this._kernelInstance),AppContext.planObjectId&&this.planObjectCreated(-1,AppContext.planObjectId)}_setupKernel(){1===this._kernelType&&(Benchmark.start("kernel_create_instance"),AppContext.kernelInstance?this._kernelInstance=AppContext.kernelInstance:this._kernelInstance=new this._kernelContainer.Kernel,Benchmark.end("kernel_create_instance")),this._initKernel()}onLoadComponentError(e,t){this._configuratorUiCallbacks.onComponentLoadError(e,t)}configurationLoaded(e,t,n,i,s){AsyncHelper.finishOperation(4,{conversationId:e,objectId:t,componentId:n,hash:i,errors:convertCObject(s)}),this._configuratorKernelCallbackListener.forEach(o=>o.configurationLoaded(e,t,n,i,s))}componentDefinitionLoaded(e,t){AsyncHelper.finishOperation(0,t)}componentDefinitionLoadingError(e,t){this._kernelIo.error(t),AsyncHelper.failOperation(0,new Error(t))}configurationLoadingError(e,t){let n="Configuration loading error";if(t){const e=convertCObject(t);Array.isArray(e)&&(n=e.join("\n"),e.forEach(e=>this._kernelIo.error(e)))}AsyncHelper.failOperation(4,new Error(n)),AsyncHelper.failOperation(2,new Error(n))}componentConfigurationUpdated(e,t){this._configuratorKernelCallbackListener.forEach(n=>n.componentConfigurationUpdated(e,t)),this._kernelInstance.requestDeltaPlanComponentConstruction(e)}setActiveGroupInView(e){this._kernelInstance.setActiveGroupInView(e)}componentParameters(){}requestComponentDimensions(){}planObjectCreated(e,t){this._configuratorKernelCallbackListener.forEach(n=>n.planObjectCreated(e,t))}planObjectUpdated(e){const t=this._kernelInstance.getPlanObject(e);this._onBoundsUpdate(t),this._configuratorKernelCallbackListener.forEach(e=>e.planObjectUpdated(t))}planObjectConfigurationUpdated(e,t,n){this.updatePlanObjectDependencies(e);let i=this._kernelInstance.getComponent(this._kernelInstance.getRootPlanComponentIdFromObjectId(e));this._configuratorKernelCallbackListener.forEach(i=>i.planObjectConfigurationUpdated(e,t,n));const s=this._kernelInstance.getPlanObject(e);return this._onBoundsUpdate(s),this._configuratorHistory.push(t),this._updateConfigurationHasChildren(e,i),this.requestPartListAndUpdatePricesOfParts(n)}_onBoundsUpdate(e){if(!e.boxForMeasurement)return;const t={width:this._unitFormatter.formatMMValueToUnitString(e.boxForMeasurement.size.x),height:this._unitFormatter.formatMMValueToUnitString(e.boxForMeasurement.size.z),depth:this._unitFormatter.formatMMValueToUnitString(e.boxForMeasurement.size.y),kernelBounds:e.boxForMeasurement};this._configuratorUiCallbacks.onBoundsUpdate(t)}planObjectDeleted(){}requestPlanObjectDimensions(){}async requestExternalMesh(e,t){let n=()=>{};const i=new Promise((e,t)=>{n=e});let s;this.externalMeshQueue.push(i);try{s=await this._rapiAccess.getMesh(e,"crt",t)}catch(t){throw this._configuratorUiCallbacks.onError(new Error(`Mesh with id "${e}" can not be loaded. "${t}"`)),console.error(t),t}try{const i=await fetch(new Request(this._dataSyncer.requestAsset(s.url,!0))),o=await i.arrayBuffer();this._handleCortoMesh(o,e,t),n()}catch(t){throw this._configuratorUiCallbacks.onError(new Error(`Mesh with id "${e}" breaks. "${t}"`)),console.error(t),t}}Editor3dComponentCreated(e,t,n,i){this._configuratorKernelCallbackListener.forEach(s=>s.Editor3dComponentCreated(e,t,n,i,!1)),i&&i>0&&this._configuratorKernelCallbackListener.forEach(s=>s.Editor3dComponentDocked(e,i,t,n))}Editor3dRootComponentCreated(e,t,n,i){this._configuratorKernelCallbackListener.forEach(s=>s.Editor3dComponentCreated(e,t,n,i,!0))}Editor3dPlanObjectConstructionDone(e){return this._configuratorKernelCallbackListener.forEach(t=>t.Editor3dPlanObjectConstructionDone(e)),this.updatePlanObjectDependencies(e),this._updateConfigurationHasChildren(e),Benchmark.end("ui_load_configuration"),this._calcPrice()}Editor3dBeginGroup(){}Editor3dEndGroup(){}Editor3dSetMaterial(){}Editor3dLoadMaterial(){}Editor3dAddDockPreview(e,t){this._configuratorKernelCallbackListener.forEach(n=>n.Editor3dAddDockPreview(e,t))}Editor3dSetPreviewPointAssociations(e,t){this._configuratorKernelCallbackListener.forEach(n=>n.Editor3dSetPreviewPointAssociations(e,t))}Editor3dSetPreviewLineAssociations(e,t){this._configuratorKernelCallbackListener.forEach(n=>n.Editor3dSetPreviewLineAssociations(e,t))}Editor3dPreviewConstructionDone(e,t){this._configuratorKernelCallbackListener.forEach(n=>n.Editor3dPreviewConstructionDone(e,t))}Editor3dTranslateBy(){}Editor3dRotateBy(){}Editor3dRotateAround(){}Editor3dAddCube(){}Editor3dAddCubeUVMod(){}Editor3dAddSphere(){}Editor3dAddSphereUVMod(){}Editor3dAddRectangle(){}Editor3dAddRectangleUVMod(){}Editor3dAddMesh(){}Editor3dAddMeshUVMod(){}Editor3dAddMeshUVCoord(){}Editor3dAddCylinder(){}Editor3dAddCylinderUVMod(){}Editor3dAddPrism(){}Editor3dAddPrismUVMod(){}Editor3dAddFittingPoint(){}Editor3dAddFittingLine(){}Editor3dSelectObject(){}Editor3dCopy(){}Editor3dUpdatePlanObjectPosition(){}Editor3dUpdatePlanObjectRotation(){}Editor3dUpdatePlanObjectTransform(){}Editor3dUpdatePlanComponentPosition(){}Editor3dUpdatePlanComponentRotation(){}Editor3dUpdatePlanComponentTransform(){}getRuntimeComponentIdOfRootComponent(e){return this._kernelInstance?this._kernelInstance.getRootPlanComponentIdFromObjectId(e):(console.warn("this._kernelInstance not ready now"),0)}getRuntimeComponentId(e){return this._kernelInstance.getComponentId(e)}getParameterGroups(){if(!this._configuratorContext.planObjectId)return[];const e=this._kernelInstance.getRootPlanComponentIdFromObjectId(this._configuratorContext.planObjectId);return this._kernelInstance.getComponent(e).parameterGroups}resume(){this.muteKernelCallbacks||super.resume()}getSerializedConfiguration(e){return this._kernelInstance.getSerializedConfiguration(e)}getCurrentConfigurationHash(e){return this._kernelInstance.getHashOfConfiguration(e)}listOfVariantsError(e,t){this._kernelIo.setMeta({rapiId:e}),this._kernelIo.error(t)}}return __decorate([inject],e.prototype,"_memoryManager",void 0),__decorate([inject],e.prototype,"_configuratorKernelAccessCallback",void 0),__decorate([inject],e.prototype,"_initData",void 0),__decorate([inject],e.prototype,"_configuratorHistory",void 0),e})();class NodePlanElementViewModel extends PlanElementViewModel{constructor(e){super(e),this._topView=!1;const t=this.getPlanElement().getMaxWallHeight();this._container.position.y=(t<0?2800:t)/1e3+.01,this._container.name="Node Plan Element",this.addMesh(this._nodeUiMesh)}update(){super.update(),this._container.position.y=this.getPlanElement().getMaxWallHeight()/1e3+.01}_initNodeMesh(){if(this._nodeUiMesh)return;const e=new THREE.SphereGeometry(.125,32),t=new THREE.MeshBasicMaterial({color:16777215});this._sphere=new THREE.Mesh(e,t);const n=new THREE.RingGeometry(.125,.175,32),i=new THREE.MeshBasicMaterial({color:0,side:THREE.DoubleSide});this._innerRingMesh=new THREE.Mesh(n,i),this._innerRingMesh.rotation.set(Math.PI/2,0,0);const s=new THREE.RingGeometry(.175,.185,32),o=new THREE.MeshBasicMaterial({color:16777215,side:THREE.DoubleSide});this._outerRingMesh=new THREE.Mesh(s,o),this._outerRingMesh.rotation.set(Math.PI/2,0,0),this._nodeUiMesh=new THREE.Mesh,this._nodeUiMesh.add(this._sphere),this._nodeUiMesh.add(this._innerRingMesh),this._nodeUiMesh.add(this._outerRingMesh)}setTopView(e){this._topView=e,this._topView||(this._nodeUiMesh.visible=!1)}getSize(){return this._initNodeMesh(),(new THREE.Box3).setFromObject(this._nodeUiMesh).getSize(new THREE.Vector3)}show(){this._nodeUiMesh.visible=this._topView}hide(){this._nodeUiMesh.visible=!1}select(){this._innerRingMesh.material=new THREE.MeshBasicMaterial({color:10526880,side:THREE.DoubleSide}),super.select()}deselect(){this._innerRingMesh.material=new THREE.MeshBasicMaterial({color:0,side:THREE.DoubleSide}),super.deselect()}hoverOn(){this._sphere.geometry=new THREE.SphereGeometry(.145,32),this._innerRingMesh.geometry=new THREE.RingGeometry(.145,.175+.02,32),this._outerRingMesh.geometry=new THREE.RingGeometry(.175+.02,.205,32),super.hoverOn()}hoverOff(){this._sphere.geometry=new THREE.SphereGeometry(.125,32),this._innerRingMesh.geometry=new THREE.RingGeometry(.125,.175,32),this._outerRingMesh.geometry=new THREE.RingGeometry(.175,.185,32),super.hoverOff()}_generateBoundingBox(){const e=super._generateBoundingBox();return e.layers.set(9),e}}let PlannerKernelAccess=(()=>{class e extends ConfiguratorKernelAccess{constructor(e){super(e),this._plannerKernelCallbackListener=new Set}get kernelContainer(){return this._kernelContainer}_loadSuccess(){super._loadSuccess(),window.RoomleCore&&window.RoomleCore(this._kernelContainer)}_loadError(){super._loadError(),console.error("kernel load error")}_createPlanInteractionHandler(){this._planInteractionHandler=new this._kernelContainer.PlanInteractionHandler,this._planInteractionHandler.init(this._planInteractionHandler,1,100,!0,!0,this._kernelContainer.DrawingType.CLICK_PER_CLICK),this._roomlePlannerUiCallback.onPlanInteractionHandlerCreated(this._planInteractionHandler)}addPlannerListener(e){this._plannerKernelCallbackListener.add(e)}removePlannerListener(e){this._plannerKernelCallbackListener.delete(e)}isReady(){super.isReady(),this.registerCallbacks(),this._roomlePlannerUiCallback.onPlannerKernelIsReady(this._kernelContainer),this._roomlePlannerUiCallback.onConfiguratorKernelIsReady(this._kernelContainer,this._kernelInstance),Env.isProduction||(window.__RML__DEBUG__.ConfiguratorKernel=this._kernelInstance,window.__RML__DEBUG__.PlannerKernelContainer=this._kernelContainer),this._kernelAccessCallback.isReady()}_setupKernel(){0===this._kernelType&&(this._createPlanInteractionHandler(),AppContext.kernelInstance?this._kernelInstance=AppContext.kernelInstance:this._kernelInstance=this._planInteractionHandler.getConfiguratorKernel()),super._setupKernel()}get callbacks(){return this._roomlePlannerUiCallback}get planInteractionHandler(){return this._planInteractionHandler}get planModelViewHelper(){return this._kernelContainer.PlanModelViewHelper}catalogItemLoaded(e){const t=this._rapiItemToKernelItem(e);this._kernelContainer.catalogItemLoaded(t)}async insertItems(e){this.planInteractionHandler.startInteraction();let t=new this._kernelContainer.CatalogItemPtrList;e.forEach(e=>{let n=e.count||1;for(let i=0;i<n;i++)e.count||(e.count=0),t.push_back(this._rapiItemToKernelItem(e))}),this._planInteractionHandler.addPlanObjects(t);const n=this._planInteractionHandler.getPlan().extRef.jsObject;await Promise.all(n.getStaticPlanObjectViewModels().map(async e=>{if(e.needsRapiItem()){const t=await this._rapiAccess.getItem(e.getPlanObject().getCatalogItemId());e.setRapiItem(t)}})),this.planInteractionHandler.endInteraction()}_rapiItemToKernelItem(e){let t=new this._kernelContainer.CatalogItem(e.id),n=t.size;return n.x=e.width||0,n.y=e.depth||0,n.z=e.height||0,t.size=n,t.flipable=e.flipable,e.layer&&(t.layer=e.layer),t.orderable=e.orderable,t.scaleable=e.scaleable,t.type=e.type||"other",t.detailType=e.detailType||t.type||"other",t.configuration=e.configuration||"",t}planObjectDeleted(){}requestPlanObjectDimensions(){}cleanUpCallbacks(){var e;super.cleanUpCallbacks(),(null===(e=this._kernelContainer)||void 0===e?void 0:e.unregisterPlannerCallback)&&this._kernelContainer.unregisterPlannerCallback(this)}registerCallbacks(){var e;super.registerCallbacks(),(null===(e=this._kernelContainer)||void 0===e?void 0:e.registerPlannerCallback)&&this._kernelContainer.registerPlannerCallback(this)}planElementRemoved(e){this._plannerKernelCallbackListener.forEach(t=>t.planElementRemoved(e)),this._plannerKernelCallbackListener.forEach(t=>t.removePlanObjectFromScene(e.extRef.jsObject)),this._decoupleReferences(e)}handlerSwitchedPlans(e,t){this._decoupleReferences(e),t&&this._plannerKernelCallbackListener.forEach(n=>n.handlerSwitchedPlans(e,t))}planBoundsChanged(){this._plannerKernelCallbackListener.forEach(e=>e.planBoundsChanged())}planCleared(){this._plannerKernelCallbackListener.forEach(e=>e.planCleared())}planCompletelyLoaded(e){this._plannerKernelCallbackListener.forEach(t=>t.planCompletelyLoaded(e))}planElement3dMeshChanged(e,t){if(t.extRef){const e=t.extRef.jsObject;for(let t=e.getObject().children.length-1;t>=0;t--)e.getObject().remove(e.getObject().children[t])}this.planModelViewHelper.requestMesh3d(t)}planElementAdded(e,t){if(e&&e.extRef)if(t.getType()===this._kernelContainer.PlanElementType.OBJECT){let n,i=t;if(i.hasConfiguration())n=new ConfiguratorPlanObjectViewModel(i),this.coupleReferences(n,i),e.extRef.jsObject.addPlanElementViewModel(n);else{n=new StaticPlanObjectViewModel(i),this.coupleReferences(n,i),e.extRef.jsObject.addPlanElementViewModel(n);const s=t.getCatalogItemId();s&&this._rapiAccess.getItem(s).then(e=>{n.setRapiItem(e)})}this._plannerKernelCallbackListener.forEach(e=>e.addPlanObjectToScene(n))}else{const n=t;let i;if(t.getType()===this._kernelContainer.PlanElementType.WALL?i=new WallPlanElementViewModel(n):t.getType()===this._kernelContainer.PlanElementType.FLOOR?i=new FloorPlanElementViewModel(n):t.getType()===this._kernelContainer.PlanElementType.CEILING?i=new CeilingPlanElementViewModel(n):t.getType()===this._kernelContainer.PlanElementType.NODE&&(i=new NodePlanElementViewModel(n)),!i)return;this.coupleReferences(i,n),e.extRef.jsObject.addPlanElementViewModel(i),i.setPrimaryColor(this._initData.colors.PRIMARY),this.planModelViewHelper.requestMesh3d(t),this._plannerKernelCallbackListener.forEach(e=>e.addPlanObjectToScene(null))}}planElementChanged(e,t){if(t.extRef){let n=t.extRef.jsObject;n.update(),this._plannerKernelCallbackListener.forEach(t=>t.planElementChanged(e,n))}}planHistoryStateChanged(){this.planInteractionHandler&&(this._plannerKernelCallbackListener.forEach(e=>e.planHistoryStateChanged()),this._roomlePlannerUiCallback.onHistoryChange(this.planInteractionHandler.isUndoPossible(),this.planInteractionHandler.isRedoPossible()))}planObjectConfigurationCreated(e,t){}planObjectConfigurationLoaded(e,t,n){e&&e.extRef&&t&&t.extRef&&t.extRef.jsObject.getPlanObject().getConfigurationRuntimeId()>0&&this._plannerKernelCallbackListener.forEach(i=>i.planObjectConfigurationLoaded(e,t,n))}requestCatalogItem(e){}startedDrawing(){this._planInteractionHandler.setViewSnapDist(100)}stoppedDrawing(){this._planInteractionHandler.cancelDrawing()}updateMesh2d(){}beginConstruction(){}addMesh(e,t,n,i,s,o){this._plannerKernelCallbackListener.forEach(r=>r.addMesh(e,t,n,i,s,o))}endConstruction(){}beginPlanConstruction(e){this._plannerKernelCallbackListener.forEach(t=>t.beginPlanConstruction(e))}addPlanMesh(e,t,n,i,s,o,r){this._plannerKernelCallbackListener.forEach(a=>a.addPlanMesh(e,t,n,i,s,o,r))}endPlanConstruction(e){this._plannerKernelCallbackListener.forEach(t=>t.endPlanConstruction(e))}addPlanObjectFromItem(e,t,n){if(!t&&!n)return this.insertItems([e]);n=n||0===n?n:0,t=t||{x:0,y:0,z:0};const i=this._rapiItemToKernelItem(e);return this._planInteractionHandler.addPlanObjectFromItem(i,t,n)}coupleReferences(e,t){let n=new this._kernelContainer.EMSReference;n.jsObject=e,t.extRef=n}_decoupleReferences(e){e&&e.extRef&&(e.extRef.jsObject.clearReference(),e.extRef.jsObject=null,e.extRef.delete(),e.extRef=null)}}return __decorate([inject],e.prototype,"_kernelAccessCallback",void 0),__decorate([inject],e.prototype,"_roomlePlannerUiCallback",void 0),e})();class PlannerMeshGenerator extends MeshGenerator{constructor(e){super(e),this._wallMeshes=[],this._defaultMaterial=new THREE.MeshPhysicalMaterial({color:"#ffffff"}),this._environmentLoader.setEnvMap(this._defaultMaterial),this._defaultMaterialFloor=new THREE.MeshPhysicalMaterial({color:"#ffffff"}),this._environmentLoader.setEnvMap(this._defaultMaterialFloor),this._environmentLoader.onEnvMapUpdate(()=>{this._environmentLoader.setEnvMap(this._defaultMaterial),this._environmentLoader.setEnvMap(this._defaultMaterialFloor)})}generateGeometry(e=null,t,n,i,s,o=!1){let r;return r=o?this._generateGeometry(e,t,n,i,s).clone():this._generateGeometry(e,t,n,i,s),r}generateMesh(e=0,t=null,n,i,s,o,r,a,l=!1){let c;c=l?this._generateGeometry(t,i,s,o,r).clone():this._generateGeometry(t,i,s,o,r);const h=this._createMesh(e,t,c);return h.userData.materialId=n,h.layers.set(4),n&&this.setMaterial(h,n,a).then(()=>{e&&t&&n&&this._geometryComponentMaterialCache.set(this._getComponentMeshId(e,t),n);const i=a&&3===a.value;h.castShadow=!i}),this._checkWallMaterial(h,a),h}async setMaterial(e,t,n){if(e.userData.material=getMaterialId(t,n),e.userData.materialId=t,isString(t))t?await this._assignMaterial(e,t):(console.warn("Used default material because material is empty"),this.changeMaterialOfMesh(e,this._getDefaultMaterial(n)));else{if(!t)return void this.changeMaterialOfMesh(e,this._configuratorPreviewMaterial);2===(t=t).getSourceType().value?await this._assignMaterial(e,t.materialId):1===t.getSourceType().value?await this._assignItem(e,t.catalogItemId):3===t.getSourceType().value?await this._assignRGB(e,t.rgbValue):0===t.getSourceType().value?this.changeMaterialOfMesh(e,this._getDefaultMaterial(n)):(this.changeMaterialOfMesh(e,this._getDefaultMaterial(n)),1!==n.value&&7!==n.value&&3!==n.value&&console.warn("Used default material because material is not supported",t))}}_getDefaultMaterial(e){return 3===(null==e?void 0:e.value)?this._defaultMaterialFloor:this._defaultMaterial}set maxAnisotropy(e){this._maxAnisotropy=e}_checkWallMaterial(e,t){t&&1===t.value&&(e.renderOrder=5,this._wallMeshes.push(e))}clear(){super.clear(),this.clearWallMeshes()}clearWallMeshes(){this._wallMeshes.forEach(e=>{disposeMesh(e)}),this._wallMeshes=[]}get wallMeshes(){return this._wallMeshes}}let KERNEL_UNIT={InchFeet:null,MM:null,CM:null},KERNEL_UNIT_STRING_TYPE={NoUnitString:null,LongUnitString:null,ShortUnitString:null},UnitFormatter=(()=>{class e{constructor(e){this._formatter=null,this._precision=0,this._creator_=e}init(e){const t=new e.UnitMeasureFormatter;KERNEL_UNIT=e.Unit,KERNEL_UNIT_STRING_TYPE=e.UnitStringType,this._initActualUnit(),this._initActualUnitStringType();const{precisionCm:n,precisionInch:i}=this._initData;this._actualUnit===KERNEL_UNIT.InchFeet?this._precision=void 0!==i?parseInt(i,10):2:this._actualUnit===KERNEL_UNIT.CM&&(this._precision=void 0!==n?parseInt(n,10):1),t.init("mm","cm","'","ft",'"',"inch","m²","sqft",!0,this._precision),this._formatter=t}_initActualUnit(){const{unit:e}=this._initData;switch(e){case"cm":this._actualUnit=KERNEL_UNIT.CM;break;case"mm":this._actualUnit=KERNEL_UNIT.MM;break;case"inchfeet":this._actualUnit=KERNEL_UNIT.InchFeet;break;default:this._actualUnit=KERNEL_UNIT.CM}}_initActualUnitStringType(){const{unitStringType:e}=this._initData;switch(e){case"none":this._actualUnitStringType=KERNEL_UNIT_STRING_TYPE.NoUnitString;break;case"long":this._actualUnitStringType=KERNEL_UNIT_STRING_TYPE.LongUnitString;break;case"short":this._actualUnitStringType=KERNEL_UNIT_STRING_TYPE.ShortUnitString;break;default:this._actualUnitStringType=KERNEL_UNIT_STRING_TYPE.ShortUnitString}}_isFormatterReady(){return!!this._formatter||(console.warn("Formatter is not ready..."),!1)}formatAngleValueToUnitString(e,t){const n="Integer"===t.type?0:2;return e.toFixed(n)+"°"}parseAngleValueFromUnitString(e){return e.replace("°","").replace(/\s/g,"")}parseValue(e,t){return null===t.unitType||"unknown"===t.unitType||"count"===t.unitType?e:"length"===t.unitType?this.parseMMValueFromUnitString(e,t.unitType):"angle"===t.unitType||"area"===t.unitType?this.parseAngleValueFromUnitString(e):e}formatValueToUnitString(e,t){return null===t.unitType||"unknown"===t.unitType||"count"===t.unitType?"Integer"===t.type?e.toString():parseFloat(e.toString()).toFixed(2):"length"===t.unitType?this.formatMMValueToUnitString(e,t.unitType):"angle"===t.unitType?this.formatAngleValueToUnitString(e,t):"area"===t.unitType?this.formatSquareMMValueToUnitString(e):e}isParseableNumber(e){return this._isFormatterReady()?this._formatter.isParseableNumber(e):null}isParseableUnitString(e,t){return this._isFormatterReady()?"angle"===t.unitType?this._formatter.isParseableUnitString(this.parseAngleValueFromUnitString(e),this._actualUnit):this._formatter.isParseableUnitString(e,this._actualUnit):null}parseMMValueFromUnitString(e,t){return this._isFormatterReady()?"count"===t?parseFloat(e):this._formatter.parseMMValueFromUnitString(e,this._actualUnit):null}parseNumber(e){return this._isFormatterReady()?this._formatter.parseNumber(e):null}formatNumber(e,t=0){return this._isFormatterReady()?this._formatter.formatNumber(e,t):null}formatSquareMMValueToUnitString(e){return this._isFormatterReady()?this._formatter.formatSquareMMValueToUnitString(e,this._actualUnit):null}formatMMValueToUnitString(e,t){return this._isFormatterReady()?"count"===t?e.toString():this._formatter.formatMMValueToUnitString(e,this._actualUnit,this._actualUnitStringType):null}formatMMValueWithReqMaxLength(e,t){return this._isFormatterReady()?this._formatter.formatMMValueWithReqMaxLength(e,this._actualUnit,t):null}_formatParameterValue(e,t){return"length"===t?this.formatMMValueToUnitString(parseFloat(e)):"area"===t?this.formatSquareMMValueToUnitString(parseFloat(e)):e}formatPartListParameter(e){(function(e){return"length"===e.unitType||"area"===e.unitType})(e)&&(e.valueLabel=this._formatParameterValue(e.value,e.unitType))}formatParameter(e){if(e.valueLabel=this._formatParameterValue(e.value,e.unitType),isMaterial(e))e.uiType="Material";else if(function(e){return"Boolean"===e.type}(e))e.uiType="Boolean";else if(isRange(e)){e.uiType="Range";const t=null!==e.validRange.valueFrom?e.validRange.valueFrom:Number.MIN_SAFE_INTEGER,n=null!==e.validRange.valueTo?e.validRange.valueTo:Number.MAX_SAFE_INTEGER;e.validRangeLabels={valueFrom:this._formatParameterValue(t.toString(),e.unitType),valueTo:this._formatParameterValue(n.toString(),e.unitType),type:e.validRange.type}}else isOptions(e)?(e.uiType="Options",function(e){return!!isOptions(e)&&Array.isArray(e.validValues)&&e.validValues.length>0&&"string"==typeof e.validValues[0].thumbnail}(e)&&(e.uiType="Thumbnails")):(console.error("Could not detect uiType of param"),e.uiType=null)}isInch(){return this._actualUnit===KERNEL_UNIT.InchFeet}getPrecision(){return this._precision}getAllowedDelta(){const e=1/Math.pow(10,this._precision);return this.isInch()?25.4*e:e}setUnitInitData(e){this._initData.unit=e,this._initActualUnit(),this._initActualUnitStringType()}}return __decorate([inject],e.prototype,"_initData",void 0),e})(),ConfiguratorHistory=(()=>{class e{constructor(e){this._history=[],this._index=0,this._creator_=e}undo(){if(!this.canUndo())return null;this._index++;const[e]=this._history.slice(this._index);return this._index===this._history.length-1?this._configuratorUiCallbacks.onHistoryChange(!1,!0):this._configuratorUiCallbacks.onHistoryChange(!0,!0),e}redo(){if(!this.canRedo())return null;this._index--;const[e]=this._history.slice(this._index);return 0===this._index?this._configuratorUiCallbacks.onHistoryChange(!0,!1):this._configuratorUiCallbacks.onHistoryChange(!0,!0),e}push(e){const[t]=this._history.slice(this._index);t!==e&&(this._history=this._history.slice(this._index),this._history.unshift(e),this._index=0,1===this._history.length?this._configuratorUiCallbacks.onHistoryChange(!1,!1):this._configuratorUiCallbacks.onHistoryChange(!0,!1))}canUndo(){return this._index!==this._history.length-1}canRedo(){return 0!==this._index}getHistory(){return this._history}clearHistory(){this._history=[],this._index=0}}return __decorate([inject],e.prototype,"_configuratorUiCallbacks",void 0),e})(),RoomleToolsCore=(()=>{class e{constructor(e){this._kernelCallbacks={isReady:()=>{},throw:e=>console.error("Kernel exception",e),log:e=>{},error:(e,t,n,i)=>{},message:e=>{this._analyzeComponentCallback&&this._analyzeComponentCallback(e)}},this._creator_=e}async init(){if(this._toolsCoreInstance)return Promise.resolve();const e=this,t={locateFile:e=>"RoomleToolsCore.wasm"===e?getAssetPath()+"static/RoomleToolsCore-c33ca3a9cb8ba880.wasm":e,wasmBinaryFile:getAssetPath()+"static/RoomleToolsCore-c33ca3a9cb8ba880.wasm",preRun:[],postRun:[],setStatus:null,print(t){e._kernelIo.log(t)},printErr(t){e._kernelIo.error(t)},quit(t){0!==t&&e._kernelIo.throw(t&&t.toString?t.toString():"Unknown error while C/C++ main executes")}};await this._scriptLoader.fetch("static/RoomleToolsCore-eb38af3a8c882dff.js",{id:"core-tool"});const n=await window.RoomleToolsCore(t);n.setContext(this._kernelCallbacks),this._toolsCoreInstance=new n.ToolsCoreInterface}analyzeComponent(e,t){const n=[];return this._analyzeComponentCallback=e=>{n.push(e)},this._toolsCoreInstance.analyzeComponent(e,t),this._analyzeComponentCallback=null,Promise.resolve(n)}}return __decorate([inject],e.prototype,"_scriptLoader",void 0),__decorate([inject],e.prototype,"_kernelIo",void 0),e})();const INJECTABLES=[new DependencyInjectionAssignment("error-handler",class{constructor(){this._listeners={}}_subscribe(e,t){this._listeners[e]||(this._listeners[e]=[]),this._listeners[e].push(t)}subscribe(e,t){this._subscribe(e,t)}dispatch(e,t){if(!this._listeners[e])return;const n=this._listeners[e];let i=n.length;for(let e=0;e<i;e++){const i=n[e];i.apply(i,t)}}unsubscribe(e,t){if(!this._listeners[e])return;const n=this._listeners[e];let i=n.length;for(let e=0;e<i;e++)if(n[e]===t)return n.splice(e,1),i--,void e--}softReject(e,t,n){return this.dispatch(n,[t]),e()}}),new DependencyInjectionAssignment("form-data-util",FormDataUtil),new DependencyInjectionAssignment("environment-loader",EnvironmentLoader),new DependencyInjectionAssignment("static-item-loader",StaticItemLoader,0),new DependencyInjectionAssignment("form-data-util",FormDataUtil),new DependencyInjectionAssignment("single-promise-factory",class{constructor(e){this._promises=new Map,this._creator_=e}create(e,t,n){return new Promise((i,s)=>{let o=this._promises.get(e),r=!0;if(!o){const t=new Map;this._promises.set(e,t),o=this._promises.get(e),r=!1}o.get(t)||(o.set(t,[]),r=!1);const a=o.get(t);a.push({resolve:i,reject:s}),o.set(t,a);const l=()=>{o.delete(t),0===o.size&&this._promises.delete(e)};r||new Promise(n).then(e=>{o.get(t).forEach(({resolve:t})=>t(e)),l()},e=>{o.get(t).forEach(({reject:t})=>t(e)),l()})})}},1),new DependencyInjectionAssignment("dynamic-light-setting-loader",DynamicLightSettingLoader),new DependencyInjectionAssignment("dynamic-quality-setting-loader",DynamicQualitySettingLoader),new DependencyInjectionAssignment("network-layer",NetworkLayer),new DependencyInjectionAssignment("local-storage",class{constructor(e){this._context_=e}get _localStorage(){let e=null;try{e=window.localStorage}catch(e){console.error(e)}return e}getItem(e){if(!this._localStorage)return null;const t=this._localStorage.getItem(e);try{return JSON.parse(t)}catch(e){return t}}setItem(e,t){if(this._localStorage)try{const n=JSON.stringify(t);this._localStorage.setItem(e,n)}catch(e){console.error(e)}}}),new DependencyInjectionAssignment("network-layer",NetworkLayer),new DependencyInjectionAssignment("kernel-io",KernelIo,0),new DependencyInjectionAssignment("data-syncer",DataSyncer),new DependencyInjectionAssignment("memory-manager",class{constructor(){this._configurationStringSet=new Set,this._singleLoadCounter=0}loadingConfigurationString(){this._singleLoadCounter+=1}loadingConfiguration(e){this._configurationStringSet.add(e),this._singleLoadCounter+=1}shouldHardReset(){return this._configurationStringSet.size>=15||this._singleLoadCounter>=30}executedHardReset(){this._configurationStringSet.clear(),this._singleLoadCounter=0}}),new DependencyInjectionAssignment("life-cycle-manager",class{constructor(){this._listeners=[]}addEventListener(e){this._listeners.push(e)}removeEventListener(e){const t=this._listeners;let n=t.length;if(n)for(let i=0;i<n;i++)t[i]===e&&(t.splice(i,1),i--,n--)}pause(){this._listeners.forEach(e=>e.pause())}resume(){this._listeners.forEach(e=>e.resume())}destroy(){this._listeners.forEach(e=>e.destroy())}},1),new DependencyInjectionAssignment("three-loader",ThreeLoader),new DependencyInjectionAssignment("local-storage-helper",LocalStorageHelper),new DependencyInjectionAssignment("cache-holder",class{constructor(){this._componentCache=new Map,this._geometryCache=new Map,this._materialCache=new Map}get componentCache(){return this._componentCache}get geometryCache(){return this._geometryCache}get materialCache(){return this._materialCache}clear(){for(const e of this._componentCache.values())disposeObject(e);for(const e of this._materialCache.values())disposeMaterial(e);for(const e of this._geometryCache.values())disposeGeometry(e);this._componentCache.clear(),this._geometryCache.clear(),this._materialCache.clear()}},0),new DependencyInjectionAssignment("kernel-access-callback",class{constructor(e){this._callbackListener=new Set,this._creator_=e}addListener(e){this._callbackListener.add(e)}removeListener(e){this._callbackListener.delete(e)}isReady(){this._callbackListener.forEach(e=>e.isReady())}loadError(e){this._callbackListener.forEach(t=>t.loadError(e))}},1),new DependencyInjectionAssignment("configurator-kernel-access-callback",class{constructor(e){this._callbackListener=new Set,this._creator_=e}addListener(e){this._callbackListener.add(e)}removeListener(e){this._callbackListener.delete(e)}isReady(){this._callbackListener.forEach(e=>e.isReady())}updatePossibleChildren(e,t,n){this._callbackListener.forEach(i=>i.updatePossibleChildren(e,t,n))}updateParameters(e,t,n,i){this._callbackListener.forEach(s=>s.updateParameters(e,t,n,i))}loadError(e){this._callbackListener.forEach(t=>t.loadError(e))}},1),new DependencyInjectionAssignment("configurator-context",class{constructor(){this.planObjectId=0,this.planElementId=0,this.rootComponentId=0,this.dockingRootComponentId=0,this.baseContext=null,this.rootComponentParametersAsGlobal=!1,this.lastLoadedRapiId=null,this.selectedRuntimeComponentIds=[],this.selectionMode="standard"}get selectedRuntimeComponentId(){return this.selectedRuntimeComponentIds.length>0?this.selectedRuntimeComponentIds[0]:null}},1),new DependencyInjectionAssignment("init-data",InitData,1),new DependencyInjectionAssignment("global-init-data",GlobalInitData,0),new DependencyInjectionAssignment("global-callback",GlobalCallback,0),new DependencyInjectionAssignment("dom-helper",DomHelper,1),new DependencyInjectionAssignment("unit-formatter",UnitFormatter,0),new DependencyInjectionAssignment("plugin-system",PluginSystem,1),new DependencyInjectionAssignment("configurator-mesh-generator",ConfiguratorMeshGenerator),new DependencyInjectionAssignment("configurator-input-manager",class extends InputManager{},1),new DependencyInjectionAssignment("selection-handler",class extends EventDispatcher{constructor(){super(...arguments),this._selectionMode="standard",this._selectedComponents=new Map}check(e){"standard"===this._selectionMode&&this._checkStandard(e),"multiselect"===this._selectionMode&&this._checkMulti(e)}cancelSelection(){0!==this._selectedComponents.size&&this._selectedComponents.forEach((e,t)=>{e.deselect(),this._selectedComponents.delete(t),this.dispatchEvent(1,new SelectionHandlerEvent({component:e}))})}_checkStandard(e){this._selectedComponents.has(e.runtimeId)?this.dispatchEvent(0,new SelectionHandlerEvent({component:e,consecutive:!0})):(this._selectedComponents.size>0&&this._selectedComponents.forEach((e,t)=>{this._selectedComponents.delete(t),this.dispatchEvent(1,new SelectionHandlerEvent({component:e,resetCamera:!1}))}),this._selectedComponents.set(e.runtimeId,e),this.dispatchEvent(0,new SelectionHandlerEvent({component:e,consecutive:!1})))}_checkMulti(e){if(this._selectedComponents.has(e.runtimeId))return this._selectedComponents.delete(e.runtimeId),void this.dispatchEvent(1,new SelectionHandlerEvent({component:e,resetCamera:0===this._selectedComponents.size}));this._selectedComponents.set(e.runtimeId,e),this.dispatchEvent(0,new SelectionHandlerEvent({component:e}))}setSelectionMode(e){this._selectionMode=e}getSelectionMode(){return this._selectionMode}hasSelection(){return this._selectedComponents.size>0}getSelectedRuntimeComponentIds(){let e=[];return this._selectedComponents.forEach(t=>e.push(t.runtimeId)),e}isSelected(e){return this._selectedComponents.has(e.runtimeId)}},1),new DependencyInjectionAssignment("component-dimensioning-helper",ComponentDimensioningHelper,1),new DependencyInjectionAssignment("component-dimensioning-helper",ComponentDimensioningHelper,1),new DependencyInjectionAssignment("planner-kernel-access",PlannerKernelAccess),new DependencyInjectionAssignment("planner-mesh-generator",PlannerMeshGenerator,1),new DependencyInjectionAssignment("unit-formatter",UnitFormatter),new DependencyInjectionAssignment("configurator-history",ConfiguratorHistory,1),new DependencyInjectionAssignment("roomle-planner-ui-callback",class extends UiCallback{constructor(e){super(e),this.onItemsLoaded=()=>{},this.onCameraChanged=e=>{},this.onTotalFloorAreaChanged=e=>{},this.onPlanInteractionHandlerCreated=e=>{},this.onPlannerKernelIsReady=e=>{},this.onConfiguratorKernelIsReady=(e,t)=>{},this.onSelectionChange=(e,t,n,i,s)=>{},this.onSelectionCancel=()=>{},this.onPlanChanged=()=>{},this.onPlanElementChanged=()=>{},this.onCompletelyLoaded=()=>{},this.onRotationCancel=()=>{},this.onHistoryChange=(e,t)=>{},this.enableWallDimensions=e=>{},this.disableWallDimensions=()=>{},this.enablePlanObjectPositions=e=>{},this.onDrawCancel=()=>{}}}),new DependencyInjectionAssignment("configurator-ui-callbacks",class extends UiCallback{constructor(e){super(e),this.onKernelIsReady=null,this.onComponentPositionsUpdated=null,this.onUpdateParameters=e=>{},this.onUpdatePossibleChildren=(e,t)=>{},this.onUpdatePrice=(e,t)=>{},this.onSelectionChange=(e,t,n,i)=>{},this.onSelectionCancel=()=>{},this.onPartListUpdate=(e,t)=>{},this.onBoundsUpdate=e=>{},this.onLoadConfiguration=()=>{},this.onConfigurationReady=(e,t,n)=>{},this.onOpenTag=e=>{},this.onOpenAddOns=()=>{},this.onClickOutside=()=>{},this.onNoDockingsAvailable=()=>{},this.onUiIntersectionChange=e=>{},this.onZoomChange=(e,t)=>{},this.onDimensionsVisibilityChange=e=>{},this.onErrorDueToOffline=e=>{},this.onError=e=>{},this.onDockingsPreviewRemoved=()=>{},this.onConfigurationHasChildren=e=>{},this.onTrackTiming=(e,t,n,i)=>{},this.onUserInitiatedDockDone=(e,t,n,i,s)=>{},this.onAddonPlusHover=()=>{},this.onAddonPlusHoverOff=()=>{},this.onAddonPlusShown=()=>{},this.onAddonPlusHidden=()=>{},this.onContentProblem=e=>{},this.onSyncStarted=()=>{},this.onSyncDone=()=>{},this.onOpenFloorMaterials=()=>{},this.onOpenPartList=()=>{},this.onComponentLoadError=(e,t)=>{},this.onConfigurationLoadError=()=>{},this.onChangeTypeChangeTag=e=>{},this.onRemoveTypeChangeTag=e=>{},this.onConfigurationLabelChange=(e,t,n)=>{},this.onMemoryCorruption=()=>{},this.onConfiguratorKernelIsReady=(e,t)=>{},this.onConfigurationSaved=e=>{},this.onCameraPositionChanges=()=>{},this.onHistoryChange=(e,t)=>{}}},1),new DependencyInjectionAssignment("roomle-tools-core",RoomleToolsCore,0)];class RoomleDependencyInjection{static _ensureContainer(){window.__RML__DI__||(window.__RML__DI__=new Container,window.__RML__DI__.addDependencyInjectionAssignments(INJECTABLES))}static setup(e){RoomleDependencyInjection.addToContainer(e)}static lookup(e,t){return window.__RML__DI__?window.__RML__DI__.lookup(e,t):null}static getContext(e){return RoomleDependencyInjection._ensureContainer(),window.__RML__DI__.getContext(e)}static cleanUp(e){return window.__RML__DI__?window.__RML__DI__.cleanUp(e):null}static addToContainer(e){RoomleDependencyInjection._ensureContainer(),window.__RML__DI__.addDependencyInjectionAssignments(e)}}export{DynamicQualitySettingLoader as $,AppContext as A,Benchmark as B,ConfiguratorViewModel as C,DependencyInjectionAssignment as D,EventDispatcher as E,FloorPlanElementViewModel as F,convertCObject as G,position3VectorsAreEqual as H,INJECTABLES as I,position2VectorsAreEqual as J,compareBox3Size as K,Logger as L,getIdealDistance as M,NodePlanElementViewModel as N,AsyncGuard as O,PlannerKernelAccess as P,vectorIsEqual as Q,RapiAccess as R,StaticPlanObjectViewModel as S,fadeIn as T,createMaterial as U,addTexture as V,WallPlanElementViewModel as W,rotationQuaternionsAreEqual as X,getDelta as Y,MIN_MOVE_DISTANCE as Z,__decorate as _,DataSyncer as a,transitionTransparencyOfMaterial as a0,isSafari as a1,setWallTransparencyBasedOnCamera as a2,setWallTransparency as a3,GLTF_LOADER_FILE_NAME as a4,DRACO_LOADER_FILE_NAME as a5,InputManager as a6,PlannerMeshGenerator as a7,setMaterial as a8,getMaterialShading as a9,addExistingTexture as aa,UiCallback as ab,EnvironmentLoader as ac,ConfiguratorMeshGenerator as ad,GlobalCallback as ae,GlobalInitData as af,InitData as ag,AsyncDependencyLoader as ah,ScenePluginDefaultImplementation as ai,RoomleDependencyInjection as b,ConfiguratorPlanObjectViewModel as c,CeilingPlanElementViewModel as d,disposeMesh as e,convertToKernel as f,getScreenXY as g,getGUI as h,inject as i,toDegrees as j,kernelBoxToThreeBox as k,CANVAS_ID as l,Env as m,DynamicLightSettingLoader as n,PREDEFINED_LIGHTSETTING as o,dispose as p,getYRotationOfObject as q,RoomleComponentFactoryInitializer as r,DEFAULT_CONVERSATION_ID as s,toRadiant as t,getCatalogIdFromItemOrConfigurationId as u,vectorIsZero as v,isIdItemId as w,AsyncHelper as x,isRange as y,isMaterial as z};
16
- //# sourceMappingURL=roomle-dependency-injection-dade8841.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"roomle-sdk-acba0c06.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1 +0,0 @@
1
- {"version":3,"file":"script-loader-122c197b.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1 +0,0 @@
1
- {"version":3,"file":"script-loader-425dddf6.nomodule.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1 +0,0 @@
1
- var _scriptDir,ConfiguratorKernel=(_scriptDir="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0,function(t){var n,r,e;t=t||{},n||(n=void 0!==t?t:{}),n.ready=new Promise((function(t,n){r=t,e=n}));var i=Object.assign({},n),a="./this.program",o=(t,n)=>{throw n},c="";"undefined"!=typeof document&&document.currentScript&&(c=document.currentScript.src),_scriptDir&&(c=_scriptDir),c=0!==c.indexOf("blob:")?c.substr(0,c.replace(/[?#].*/,"").lastIndexOf("/")+1):"";var u=n.print||console.log.bind(console),f=n.printErr||console.warn.bind(console);Object.assign(n,i),i=null,n.thisProgram&&(a=n.thisProgram),n.quit&&(o=n.quit);var s,l=0;n.wasmBinary&&(s=n.wasmBinary);var h=n.noExitRuntime||!0;"object"!=typeof WebAssembly&&z("no native wasm support detected");var v,b=!1,p="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function y(t,n,r){var e=n+r;for(r=n;t[r]&&!(r>=e);)++r;if(16<r-n&&t.subarray&&p)return p.decode(t.subarray(n,r));for(e="";n<r;){var i=t[n++];if(128&i){var a=63&t[n++];if(192==(224&i))e+=String.fromCharCode((31&i)<<6|a);else{var o=63&t[n++];65536>(i=224==(240&i)?(15&i)<<12|a<<6|o:(7&i)<<18|a<<12|o<<6|63&t[n++])?e+=String.fromCharCode(i):(i-=65536,e+=String.fromCharCode(55296|i>>10,56320|1023&i))}}else e+=String.fromCharCode(i)}return e}function d(t,n,r,e){if(0<e){e=r+e-1;for(var i=0;i<t.length;++i){var a=t.charCodeAt(i);if(55296<=a&&57343>=a&&(a=65536+((1023&a)<<10)|1023&t.charCodeAt(++i)),127>=a){if(r>=e)break;n[r++]=a}else{if(2047>=a){if(r+1>=e)break;n[r++]=192|a>>6}else{if(65535>=a){if(r+2>=e)break;n[r++]=224|a>>12}else{if(r+3>=e)break;n[r++]=240|a>>18,n[r++]=128|a>>12&63}n[r++]=128|a>>6&63}n[r++]=128|63&a}}n[r]=0}}function g(t){for(var n=0,r=0;r<t.length;++r){var e=t.charCodeAt(r);55296<=e&&57343>=e&&(e=65536+((1023&e)<<10)|1023&t.charCodeAt(++r)),127>=e?++n:n=2047>=e?n+2:65535>=e?n+3:n+4}return n}var m,w,T,_,S,R,A,C,W,j="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0;function k(t,n){for(var r=t>>1,e=r+n/2;!(r>=e)&&S[r];)++r;if(32<(r<<=1)-t&&j)return j.decode(T.subarray(t,r));for(r="",e=0;!(e>=n/2);++e){var i=_[t+2*e>>1];if(0==i)break;r+=String.fromCharCode(i)}return r}function P(t,n,r){if(void 0===r&&(r=2147483647),2>r)return 0;var e=n;r=(r-=2)<2*t.length?r/2:t.length;for(var i=0;i<r;++i)_[n>>1]=t.charCodeAt(i),n+=2;return _[n>>1]=0,n-e}function D(t){return 2*t.length}function F(t,n){for(var r=0,e="";!(r>=n/4);){var i=R[t+4*r>>2];if(0==i)break;++r,65536<=i?(i-=65536,e+=String.fromCharCode(55296|i>>10,56320|1023&i)):e+=String.fromCharCode(i)}return e}function E(t,n,r){if(void 0===r&&(r=2147483647),4>r)return 0;var e=n;r=e+r-4;for(var i=0;i<t.length;++i){var a=t.charCodeAt(i);if(55296<=a&&57343>=a&&(a=65536+((1023&a)<<10)|1023&t.charCodeAt(++i)),R[n>>2]=a,(n+=4)+4>r)break}return R[n>>2]=0,n-e}function O(t){for(var n=0,r=0;r<t.length;++r){var e=t.charCodeAt(r);55296<=e&&57343>=e&&++r,n+=4}return n}function U(){var t=v.buffer;m=t,n.HEAP8=w=new Int8Array(t),n.HEAP16=_=new Int16Array(t),n.HEAP32=R=new Int32Array(t),n.HEAPU8=T=new Uint8Array(t),n.HEAPU16=S=new Uint16Array(t),n.HEAPU32=A=new Uint32Array(t),n.HEAPF32=C=new Float32Array(t),n.HEAPF64=W=new Float64Array(t)}var M,x=[],Y=[],I=[],V=[];function H(){var t=n.preRun.shift();x.unshift(t)}var X,B=0,Z=null,$=null;function z(t){throw n.onAbort&&n.onAbort(t),f(t="Aborted("+t+")"),b=!0,t=new WebAssembly.RuntimeError(t+". Build with -s ASSERTIONS=1 for more info."),e(t),t}function q(){return X.startsWith("data:application/octet-stream;base64,")}if(n.preloadedImages={},n.preloadedAudios={},X="ConfiguratorKernel.wasm",!q()){var N=X;X=n.locateFile?n.locateFile(N,c):c+N}function K(){var t=X;try{if(t==X&&s)return new Uint8Array(s);throw"both async and sync fetching of the wasm failed"}catch(t){z(t)}}function L(t){for(;0<t.length;){var r=t.shift();if("function"==typeof r)r(n);else{var e=r.jd;"number"==typeof e?void 0===r.yc?G(e)():G(e)(r.yc):e(void 0===r.yc?null:r.yc)}}}function G(t){return M.get(t)}function J(t){this.Fc=t,this.Sb=t-16,this.wc=function(t){R[this.Sb+4>>2]=t},this.lc=function(){return R[this.Sb+4>>2]},this.cc=function(t){R[this.Sb+8>>2]=t},this.Qc=function(){return R[this.Sb+8>>2]},this.ec=function(){R[this.Sb>>2]=0},this.Dc=function(t){w[this.Sb+12>>0]=t?1:0},this.Pc=function(){return 0!=w[this.Sb+12>>0]},this.sc=function(t){w[this.Sb+13>>0]=t?1:0},this.Hc=function(){return 0!=w[this.Sb+13>>0]},this.bc=function(t,n){this.wc(t),this.cc(n),this.ec(),this.Dc(!1),this.sc(!1)},this.xc=function(){R[this.Sb>>2]+=1},this.Zc=function(){var t=R[this.Sb>>2];return R[this.Sb>>2]=t-1,1===t}}function Q(t){this.zc=function(){kn(this.Sb),this.Sb=0},this.cc=function(t){R[this.Sb>>2]=t},this.hc=function(){return R[this.Sb>>2]},this.bc=function(t){R[this.Sb+4>>2]=t},this.ec=function(){return this.Sb+4},this.wc=function(){return R[this.Sb+4>>2]},this.Jc=function(){if(xn(this.ic().lc()))return R[this.hc()>>2];var t=this.wc();return 0!==t?t:this.hc()},this.ic=function(){return new J(this.hc())},void 0===t?(this.Sb=Pn(8),this.bc(0)):this.Sb=t}var tt=[],nt=0;function rt(t){return kn(new J(t).Sb)}function et(t){if(t.Zc()&&!t.Hc()){var n=t.Qc();n&&G(n)(t.Fc),rt(t.Fc)}}var it=0;function at(){var t=tt.pop();t||z("no exception to throw");var n=t.ic(),r=t.hc();throw n.Hc()?t.zc():(tt.push(t),n.sc(!0),n.Dc(!1),nt++),it=r,r}var ot={};function ct(t){for(;t.length;){var n=t.pop();t.pop()(n)}}function ut(t){return this.fromWireType(A[t>>2])}var ft={},st={},lt={};function ht(t){if(void 0===t)return"_unknown";var n=(t=t.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return 48<=n&&57>=n?"_"+t:t}function vt(t,n){return t=ht(t),new Function("body","return function "+t+'() {\n "use strict"; return body.apply(this, arguments);\n};\n')(n)}function bt(t){var n=Error,r=vt(t,(function(n){this.name=t,this.message=n,void 0!==(n=Error(n).stack)&&(this.stack=this.toString()+"\n"+n.replace(/^Error(:[^\n]*)?\n/,""))}));return r.prototype=Object.create(n.prototype),r.prototype.constructor=r,r.prototype.toString=function(){return void 0===this.message?this.name:this.name+": "+this.message},r}var pt=void 0;function yt(t){throw new pt(t)}function dt(t,n,r){function e(n){(n=r(n)).length!==t.length&&yt("Mismatched type converter count");for(var e=0;e<t.length;++e)St(t[e],n[e])}t.forEach((function(t){lt[t]=n}));var i=Array(n.length),a=[],o=0;n.forEach((function(t,n){st.hasOwnProperty(t)?i[n]=st[t]:(a.push(t),ft.hasOwnProperty(t)||(ft[t]=[]),ft[t].push((function(){i[n]=st[t],++o===a.length&&e(i)})))})),0===a.length&&e(i)}function gt(t){switch(t){case 1:return 0;case 2:return 1;case 4:return 2;case 8:return 3;default:throw new TypeError("Unknown type size: "+t)}}var mt=void 0;function wt(t){for(var n="";T[t];)n+=mt[T[t++]];return n}var Tt=void 0;function _t(t){throw new Tt(t)}function St(t,n,r={}){if(!("argPackAdvance"in n))throw new TypeError("registerType registeredInstance requires argPackAdvance");var e=n.name;if(t||_t('type "'+e+'" must have a positive integer typeid pointer'),st.hasOwnProperty(t)){if(r.Uc)return;_t("Cannot register type '"+e+"' twice")}st[t]=n,delete lt[t],ft.hasOwnProperty(t)&&(n=ft[t],delete ft[t],n.forEach((function(t){t()})))}function Rt(t){_t(t.Rb.Ub.Tb.name+" instance already deleted")}var At=!1;function Ct(){}function Wt(t){--t.count.value,0===t.count.value&&(t.Wb?t.Zb.ac(t.Wb):t.Ub.Tb.ac(t.Sb))}var jt={},kt=[];function Pt(){for(;kt.length;){var t=kt.pop();t.Rb.fc=!1,t.delete()}}var Dt=void 0,Ft={};function Et(t,n){return n.Ub&&n.Sb||yt("makeClassHandle requires ptr and ptrType"),!!n.Zb!=!!n.Wb&&yt("Both smartPtrType and smartPtr must be specified"),n.count={value:1},Ot(Object.create(t,{Rb:{value:n}}))}function Ot(t){return"undefined"==typeof FinalizationRegistry?(Ot=t=>t,t):(At=new FinalizationRegistry(t=>{Wt(t.Rb)}),Ct=t=>{At.unregister(t)},(Ot=t=>{var n=t.Rb;return n.Wb&&At.register(t,{Rb:n},t),t})(t))}function Ut(){}function Mt(t,n,r){if(void 0===t[n].Vb){var e=t[n];t[n]=function(){return t[n].Vb.hasOwnProperty(arguments.length)||_t("Function '"+r+"' called with an invalid number of arguments ("+arguments.length+") - expects one of ("+t[n].Vb+")!"),t[n].Vb[arguments.length].apply(this,arguments)},t[n].Vb=[],t[n].Vb[e.pc]=e}}function xt(t,r,e){n.hasOwnProperty(t)?((void 0===e||void 0!==n[t].Vb&&void 0!==n[t].Vb[e])&&_t("Cannot register public name '"+t+"' twice"),Mt(n,t,t),n.hasOwnProperty(e)&&_t("Cannot register multiple overloads of a function with the same number of arguments ("+e+")!"),n[t].Vb[e]=r):(n[t]=r,void 0!==e&&(n[t].ld=e))}function Yt(t,n,r,e,i,a,o,c){this.name=t,this.constructor=n,this.jc=r,this.ac=e,this.$b=i,this.Nc=a,this.oc=o,this.Lc=c,this.Xc=[]}function It(t,n,r){for(;n!==r;)n.oc||_t("Expected null or instance of "+r.name+", got an instance of "+n.name),t=n.oc(t),n=n.$b;return t}function Vt(t,n){return null===n?(this.Ac&&_t("null is not a valid "+this.name),0):(n.Rb||_t('Cannot pass "'+on(n)+'" as a '+this.name),n.Rb.Sb||_t("Cannot pass deleted object as a pointer of type "+this.name),It(n.Rb.Sb,n.Rb.Ub.Tb,this.Tb))}function Ht(t,n){if(null===n){if(this.Ac&&_t("null is not a valid "+this.name),this.rc){var r=this.Bc();return null!==t&&t.push(this.ac,r),r}return 0}if(n.Rb||_t('Cannot pass "'+on(n)+'" as a '+this.name),n.Rb.Sb||_t("Cannot pass deleted object as a pointer of type "+this.name),!this.qc&&n.Rb.Ub.qc&&_t("Cannot convert argument of type "+(n.Rb.Zb?n.Rb.Zb.name:n.Rb.Ub.name)+" to parameter type "+this.name),r=It(n.Rb.Sb,n.Rb.Ub.Tb,this.Tb),this.rc)switch(void 0===n.Rb.Wb&&_t("Passing raw pointer to smart pointer is illegal"),this.cd){case 0:n.Rb.Zb===this?r=n.Rb.Wb:_t("Cannot convert argument of type "+(n.Rb.Zb?n.Rb.Zb.name:n.Rb.Ub.name)+" to parameter type "+this.name);break;case 1:r=n.Rb.Wb;break;case 2:if(n.Rb.Zb===this)r=n.Rb.Wb;else{var e=n.clone();r=this.Yc(r,rn((function(){e.delete()}))),null!==t&&t.push(this.ac,r)}break;default:_t("Unsupporting sharing policy")}return r}function Xt(t,n){return null===n?(this.Ac&&_t("null is not a valid "+this.name),0):(n.Rb||_t('Cannot pass "'+on(n)+'" as a '+this.name),n.Rb.Sb||_t("Cannot pass deleted object as a pointer of type "+this.name),n.Rb.Ub.qc&&_t("Cannot convert argument of type "+n.Rb.Ub.name+" to parameter type "+this.name),It(n.Rb.Sb,n.Rb.Ub.Tb,this.Tb))}function Bt(t,n,r,e,i,a,o,c,u,f,s){this.name=t,this.Tb=n,this.Ac=r,this.qc=e,this.rc=i,this.Wc=a,this.cd=o,this.Ic=c,this.Bc=u,this.Yc=f,this.ac=s,i||void 0!==n.$b?this.toWireType=Ht:(this.toWireType=e?Vt:Xt,this.Yb=null)}function Zt(t,r,e){n.hasOwnProperty(t)||yt("Replacing nonexistant public symbol"),void 0!==n[t].Vb&&void 0!==e?n[t].Vb[e]=r:(n[t]=r,n[t].pc=e)}function $t(t,r){var e=(t=wt(t)).includes("j")?function(t,r){var e=[];return function(){if(e.length=0,Object.assign(e,arguments),t.includes("j")){var i=n["dynCall_"+t];i=e&&e.length?i.apply(null,[r].concat(e)):i.call(null,r)}else i=G(r).apply(null,e);return i}}(t,r):G(r);return"function"!=typeof e&&_t("unknown function pointer with signature "+t+": "+r),e}var zt=void 0;function qt(t){var n=wt(t=Dn(t));return kn(t),n}function Nt(t,n){var r=[],e={};throw n.forEach((function t(n){e[n]||st[n]||(lt[n]?lt[n].forEach(t):(r.push(n),e[n]=!0))})),new zt(t+": "+r.map(qt).join([", "]))}function Kt(t,n){for(var r=[],e=0;e<t;e++)r.push(R[(n>>2)+e]);return r}function Lt(t){var n=Function;if(!(n instanceof Function))throw new TypeError("new_ called with constructor type "+typeof n+" which is not a function");var r=vt(n.name||"unknownFunctionName",(function(){}));return r.prototype=n.prototype,r=new r,(t=n.apply(r,t))instanceof Object?t:r}function Gt(t,n,r,e,i){var a=n.length;2>a&&_t("argTypes array size mismatch! Must at least get return value and 'this' types!");var o=null!==n[1]&&null!==r,c=!1;for(r=1;r<n.length;++r)if(null!==n[r]&&void 0===n[r].Yb){c=!0;break}var u="void"!==n[0].name,f="",s="";for(r=0;r<a-2;++r)f+=(0!==r?", ":"")+"arg"+r,s+=(0!==r?", ":"")+"arg"+r+"Wired";t="return function "+ht(t)+"("+f+") {\nif (arguments.length !== "+(a-2)+") {\nthrowBindingError('function "+t+" called with ' + arguments.length + ' arguments, expected "+(a-2)+" args!');\n}\n",c&&(t+="var destructors = [];\n");var l=c?"destructors":"null";for(f="throwBindingError invoker fn runDestructors retType classParam".split(" "),e=[_t,e,i,ct,n[0],n[1]],o&&(t+="var thisWired = classParam.toWireType("+l+", this);\n"),r=0;r<a-2;++r)t+="var arg"+r+"Wired = argType"+r+".toWireType("+l+", arg"+r+"); // "+n[r+2].name+"\n",f.push("argType"+r),e.push(n[r+2]);if(o&&(s="thisWired"+(0<s.length?", ":"")+s),t+=(u?"var rv = ":"")+"invoker(fn"+(0<s.length?", ":"")+s+");\n",c)t+="runDestructors(destructors);\n";else for(r=o?1:2;r<n.length;++r)a=1===r?"thisWired":"arg"+(r-2)+"Wired",null!==n[r].Yb&&(t+=a+"_dtor("+a+"); // "+n[r].name+"\n",f.push(a+"_dtor"),e.push(n[r].Yb));return u&&(t+="var ret = retType.fromWireType(rv);\nreturn ret;\n"),f.push(t+"}\n"),Lt(f).apply(null,e)}var Jt=[],Qt=[{},{value:void 0},{value:null},{value:!0},{value:!1}];function tn(t){4<t&&0==--Qt[t].Cc&&(Qt[t]=void 0,Jt.push(t))}function nn(t){return t||_t("Cannot use deleted val. handle = "+t),Qt[t].value}function rn(t){switch(t){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:var n=Jt.length?Jt.pop():Qt.length;return Qt[n]={Cc:1,value:t},n}}function en(t,n,r){switch(n){case 0:return function(t){return this.fromWireType((r?w:T)[t])};case 1:return function(t){return this.fromWireType((r?_:S)[t>>1])};case 2:return function(t){return this.fromWireType((r?R:A)[t>>2])};default:throw new TypeError("Unknown integer type: "+t)}}function an(t,n){var r=st[t];return void 0===r&&_t(n+" has unknown type "+qt(t)),r}function on(t){if(null===t)return"null";var n=typeof t;return"object"===n||"array"===n||"function"===n?t.toString():""+t}function cn(t,n){switch(n){case 2:return function(t){return this.fromWireType(C[t>>2])};case 3:return function(t){return this.fromWireType(W[t>>3])};default:throw new TypeError("Unknown float type: "+t)}}function un(t,n,r){switch(n){case 0:return r?function(t){return w[t]}:function(t){return T[t]};case 1:return r?function(t){return _[t>>1]}:function(t){return S[t>>1]};case 2:return r?function(t){return R[t>>2]}:function(t){return A[t>>2]};default:throw new TypeError("Unknown integer type: "+t)}}function fn(t,n){for(var r=Array(t),e=0;e<t;++e)r[e]=an(R[(n>>2)+e],"parameter "+e);return r}var sn={};function ln(t){var n=sn[t];return void 0===n?wt(t):n}var hn=[];function vn(){return"object"==typeof globalThis?globalThis:Function("return this")()}var bn=[],pn={},yn={};function dn(){if(!gn){var t,n={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:a||"./this.program"};for(t in yn)void 0===yn[t]?delete n[t]:n[t]=yn[t];var r=[];for(t in n)r.push(t+"="+n[t]);gn=r}return gn}var gn,mn=[null,[],[]],wn={};function Tn(t){return 0==t%4&&(0!=t%100||0==t%400)}function _n(t,n){for(var r=0,e=0;e<=n;r+=t[e++]);return r}var Sn=[31,29,31,30,31,30,31,31,30,31,30,31],Rn=[31,28,31,30,31,30,31,31,30,31,30,31];function An(t,n){for(t=new Date(t.getTime());0<n;){var r=t.getMonth(),e=(Tn(t.getFullYear())?Sn:Rn)[r];if(!(n>e-t.getDate())){t.setDate(t.getDate()+n);break}n-=e-t.getDate()+1,t.setDate(1),11>r?t.setMonth(r+1):(t.setMonth(0),t.setFullYear(t.getFullYear()+1))}return t}pt=n.InternalError=bt("InternalError");for(var Cn=Array(256),Wn=0;256>Wn;++Wn)Cn[Wn]=String.fromCharCode(Wn);mt=Cn,Tt=n.BindingError=bt("BindingError"),Ut.prototype.isAliasOf=function(t){if(!(this instanceof Ut&&t instanceof Ut))return!1;var n=this.Rb.Ub.Tb,r=this.Rb.Sb,e=t.Rb.Ub.Tb;for(t=t.Rb.Sb;n.$b;)r=n.oc(r),n=n.$b;for(;e.$b;)t=e.oc(t),e=e.$b;return n===e&&r===t},Ut.prototype.clone=function(){if(this.Rb.Sb||Rt(this),this.Rb.mc)return this.Rb.count.value+=1,this;var t=Ot,n=Object,r=n.create,e=Object.getPrototypeOf(this),i=this.Rb;return(t=t(r.call(n,e,{Rb:{value:{count:i.count,fc:i.fc,mc:i.mc,Sb:i.Sb,Ub:i.Ub,Wb:i.Wb,Zb:i.Zb}}}))).Rb.count.value+=1,t.Rb.fc=!1,t},Ut.prototype.delete=function(){this.Rb.Sb||Rt(this),this.Rb.fc&&!this.Rb.mc&&_t("Object already scheduled for deletion"),Ct(this),Wt(this.Rb),this.Rb.mc||(this.Rb.Wb=void 0,this.Rb.Sb=void 0)},Ut.prototype.isDeleted=function(){return!this.Rb.Sb},Ut.prototype.deleteLater=function(){return this.Rb.Sb||Rt(this),this.Rb.fc&&!this.Rb.mc&&_t("Object already scheduled for deletion"),kt.push(this),1===kt.length&&Dt&&Dt(Pt),this.Rb.fc=!0,this},n.getInheritedInstanceCount=function(){return Object.keys(Ft).length},n.getLiveInheritedInstances=function(){var t,n=[];for(t in Ft)Ft.hasOwnProperty(t)&&n.push(Ft[t]);return n},n.flushPendingDeletes=Pt,n.setDelayFunction=function(t){Dt=t,kt.length&&Dt&&Dt(Pt)},Bt.prototype.Oc=function(t){return this.Ic&&(t=this.Ic(t)),t},Bt.prototype.Ec=function(t){this.ac&&this.ac(t)},Bt.prototype.argPackAdvance=8,Bt.prototype.readValueFromPointer=ut,Bt.prototype.deleteObject=function(t){null!==t&&t.delete()},Bt.prototype.fromWireType=function(t){function n(){return this.rc?Et(this.Tb.jc,{Ub:this.Wc,Sb:r,Zb:this,Wb:t}):Et(this.Tb.jc,{Ub:this,Sb:t})}var r=this.Oc(t);if(!r)return this.Ec(t),null;var e=function(t,n){for(void 0===n&&_t("ptr should not be undefined");t.$b;)n=t.oc(n),t=t.$b;return Ft[n]}(this.Tb,r);if(void 0!==e)return 0===e.Rb.count.value?(e.Rb.Sb=r,e.Rb.Wb=t,e.clone()):(e=e.clone(),this.Ec(t),e);if(e=this.Tb.Nc(r),!(e=jt[e]))return n.call(this);e=this.qc?e.Kc:e.pointerType;var i=function t(n,r,e){return r===e?n:void 0===e.$b||null===(n=t(n,r,e.$b))?null:e.Lc(n)}(r,this.Tb,e.Tb);return null===i?n.call(this):this.rc?Et(e.Tb.jc,{Ub:e,Sb:i,Zb:this,Wb:t}):Et(e.Tb.jc,{Ub:e,Sb:i})},zt=n.UnboundTypeError=bt("UnboundTypeError"),n.count_emval_handles=function(){for(var t=0,n=5;n<Qt.length;++n)void 0!==Qt[n]&&++t;return t},n.get_first_emval=function(){for(var t=5;t<Qt.length;++t)if(void 0!==Qt[t])return Qt[t];return null};var jn={n:function(t){return Pn(t+16)+16},p:function(t){var n=(t=new Q(t)).ic();return n.Pc()||(n.Dc(!0),nt--),n.sc(!1),tt.push(t),n.xc(),t.Jc()},Ka:function(t){throw f("Unexpected exception thrown, this is not properly supported - aborting"),b=!0,t},Qa:function(){if(!tt.length)return 0;var t=tt[tt.length-1];return t.ic().xc(),t.hc()},wa:function(t){t&&et(new J(t))},u:function(){En(0);var t=tt.pop();et(t.ic()),t.zc(),it=0},b:function(){var t=it;if(!t)return l=0;var n=new J(t).lc(),r=new Q;if(r.cc(t),r.bc(t),!n)return l=0,0|r.Sb;t=Array.prototype.slice.call(arguments);for(var e=0;e<t.length;e++){var i=t[e];if(0===i||i===n)break;if(Mn(i,n,r.ec()))return l=i,0|r.Sb}return l=n,0|r.Sb},h:function(){var t=it;if(!t)return l=0;var n=new J(t).lc(),r=new Q;if(r.cc(t),r.bc(t),!n)return l=0,0|r.Sb;t=Array.prototype.slice.call(arguments);for(var e=0;e<t.length;e++){var i=t[e];if(0===i||i===n)break;if(Mn(i,n,r.ec()))return l=i,0|r.Sb}return l=n,0|r.Sb},G:function(){var t=it;if(!t)return l=0;var n=new J(t).lc(),r=new Q;if(r.cc(t),r.bc(t),!n)return l=0,0|r.Sb;t=Array.prototype.slice.call(arguments);for(var e=0;e<t.length;e++){var i=t[e];if(0===i||i===n)break;if(Mn(i,n,r.ec()))return l=i,0|r.Sb}return l=n,0|r.Sb},Ca:function(){var t=it;if(!t)return l=0;var n=new J(t).lc(),r=new Q;if(r.cc(t),r.bc(t),!n)return l=0,0|r.Sb;t=Array.prototype.slice.call(arguments);for(var e=0;e<t.length;e++){var i=t[e];if(0===i||i===n)break;if(Mn(i,n,r.ec()))return l=i,0|r.Sb}return l=n,0|r.Sb},o:rt,va:function(t){t&&new J(t).xc()},ua:at,Pa:function(t){if(t){var n=new Q;n.cc(t),t=n.ic(),tt.push(n),t.sc(!0),at()}},A:function(t,n,r){throw new J(t).bc(n,r),it=t,nt++,t},Ra:function(){return nt},e:function(t){var n=(t=new Q(t)).hc();throw it||(it=n),t.zc(),n},_a:function(t){var n=ot[t];delete ot[t];var r=n.Bc,e=n.ac,i=n.Gc;dt([t],i.map((function(t){return t.Tc})).concat(i.map((function(t){return t.ad}))),(function(t){var a={};return i.forEach((function(n,r){var e=t[r],o=n.Rc,c=n.Sc,u=t[r+i.length],f=n.$c,s=n.bd;a[n.Mc]={read:function(t){return e.fromWireType(o(c,t))},write:function(t,n){var r=[];f(s,t,u.toWireType(r,n)),ct(r)}}})),[{name:n.name,fromWireType:function(t){var n,r={};for(n in a)r[n]=a[n].read(t);return e(t),r},toWireType:function(t,n){for(var i in a)if(!(i in n))throw new TypeError('Missing field: "'+i+'"');var o=r();for(i in a)a[i].write(o,n[i]);return null!==t&&t.push(e,o),o},argPackAdvance:8,readValueFromPointer:ut,Yb:e}]}))},ib:function(){},Va:function(t,n,r,e,i){var a=gt(r);St(t,{name:n=wt(n),fromWireType:function(t){return!!t},toWireType:function(t,n){return n?e:i},argPackAdvance:8,readValueFromPointer:function(t){if(1===r)var e=w;else if(2===r)e=_;else{if(4!==r)throw new TypeError("Unknown boolean type size: "+n);e=R}return this.fromWireType(e[t>>a])},Yb:null})},z:function(t,n,r,e,i,a,o,c,u,f,s,l,h){s=wt(s),a=$t(i,a),c&&(c=$t(o,c)),f&&(f=$t(u,f)),h=$t(l,h);var v=ht(s);xt(v,(function(){Nt("Cannot construct "+s+" due to unbound types",[e])})),dt([t,n,r],e?[e]:[],(function(n){if(n=n[0],e)var r=n.Tb,i=r.jc;else i=Ut.prototype;n=vt(v,(function(){if(Object.getPrototypeOf(this)!==o)throw new Tt("Use 'new' to construct "+s);if(void 0===u.dc)throw new Tt(s+" has no accessible constructor");var t=u.dc[arguments.length];if(void 0===t)throw new Tt("Tried to invoke ctor of "+s+" with invalid number of parameters ("+arguments.length+") - expected ("+Object.keys(u.dc).toString()+") parameters instead!");return t.apply(this,arguments)}));var o=Object.create(i,{constructor:{value:n}});n.prototype=o;var u=new Yt(s,n,o,h,r,a,c,f);r=new Bt(s,u,!0,!1,!1),i=new Bt(s+"*",u,!1,!1,!1);var l=new Bt(s+" const*",u,!1,!0,!1);return jt[t]={pointerType:i,Kc:l},Zt(v,n),[r,i,l]}))},y:function(t,n,r,e,i,a){0<n||z(void 0);var o=Kt(n,r);i=$t(e,i),dt([],[t],(function(t){var r="constructor "+(t=t[0]).name;if(void 0===t.Tb.dc&&(t.Tb.dc=[]),void 0!==t.Tb.dc[n-1])throw new Tt("Cannot register multiple constructors with identical number of parameters ("+(n-1)+") for class '"+t.name+"'! Overload resolution is currently only performed using the parameter count, not actual type info!");return t.Tb.dc[n-1]=()=>{Nt("Cannot construct "+t.name+" due to unbound types",o)},dt([],o,(function(e){return e.splice(1,0,null),t.Tb.dc[n-1]=Gt(r,e,null,i,a),[]})),[]}))},m:function(t,n,r,e,i,a,o,c){var u=Kt(r,e);n=wt(n),a=$t(i,a),dt([],[t],(function(t){function e(){Nt("Cannot call "+i+" due to unbound types",u)}var i=(t=t[0]).name+"."+n;n.startsWith("@@")&&(n=Symbol[n.substring(2)]),c&&t.Tb.Xc.push(n);var f=t.Tb.jc,s=f[n];return void 0===s||void 0===s.Vb&&s.className!==t.name&&s.pc===r-2?(e.pc=r-2,e.className=t.name,f[n]=e):(Mt(f,n,i),f[n].Vb[r-2]=e),dt([],u,(function(e){return e=Gt(i,e,t,a,o),void 0===f[n].Vb?(e.pc=r-2,f[n]=e):f[n].Vb[r-2]=e,[]})),[]}))},Ua:function(t,n){St(t,{name:n=wt(n),fromWireType:function(t){var n=nn(t);return tn(t),n},toWireType:function(t,n){return rn(n)},argPackAdvance:8,readValueFromPointer:ut,Yb:null})},X:function(t,n,r,e){function i(){}r=gt(r),n=wt(n),i.values={},St(t,{name:n,constructor:i,fromWireType:function(t){return this.constructor.values[t]},toWireType:function(t,n){return n.value},argPackAdvance:8,readValueFromPointer:en(n,r,e),Yb:null}),xt(n,i)},W:function(t,n,r){var e=an(t,"enum");n=wt(n),t=e.constructor,e=Object.create(e.constructor.prototype,{value:{value:r},constructor:{value:vt(e.name+"_"+n,(function(){}))}}),t.values[r]=e,t[n]=e},xa:function(t,n,r){r=gt(r),St(t,{name:n=wt(n),fromWireType:function(t){return t},toWireType:function(t,n){return n},argPackAdvance:8,readValueFromPointer:cn(n,r),Yb:null})},_:function(t,n,r,e,i,a){var o=Kt(n,r);t=wt(t),i=$t(e,i),xt(t,(function(){Nt("Cannot call "+t+" due to unbound types",o)}),n-1),dt([],o,(function(r){return Zt(t,Gt(t,[r[0],null].concat(r.slice(1)),null,i,a),n-1),[]}))},N:function(t,n,r,e,i){n=wt(n),-1===i&&(i=4294967295),i=gt(r);var a=t=>t;if(0===e){var o=32-8*r;a=t=>t<<o>>>o}r=n.includes("unsigned")?function(t,n){return n>>>0}:function(t,n){return n},St(t,{name:n,fromWireType:a,toWireType:r,argPackAdvance:8,readValueFromPointer:un(n,i,0!==e),Yb:null})},J:function(t,n,r){function e(t){var n=A;return new i(m,n[1+(t>>=2)],n[t])}var i=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][n];St(t,{name:r=wt(r),fromWireType:e,argPackAdvance:8,readValueFromPointer:e},{Uc:!0})},za:function(t,n,r,e,i,a,o,c,u,f,s,l){r=wt(r),a=$t(i,a),c=$t(o,c),f=$t(u,f),l=$t(s,l),dt([t],[n],(function(t){return t=t[0],[new Bt(r,t.Tb,!1,!1,!0,t,e,a,c,f,l)]}))},ya:function(t,n){var r="std::string"===(n=wt(n));St(t,{name:n,fromWireType:function(t){var n=A[t>>2];if(r)for(var e=t+4,i=0;i<=n;++i){var a=t+4+i;if(i==n||0==T[a]){if(e=e?y(T,e,a-e):"",void 0===o)var o=e;else o+=String.fromCharCode(0),o+=e;e=a+1}}else{for(o=Array(n),i=0;i<n;++i)o[i]=String.fromCharCode(T[t+4+i]);o=o.join("")}return kn(t),o},toWireType:function(t,n){n instanceof ArrayBuffer&&(n=new Uint8Array(n));var e="string"==typeof n;e||n instanceof Uint8Array||n instanceof Uint8ClampedArray||n instanceof Int8Array||_t("Cannot pass non-string to std::string");var i=(r&&e?()=>g(n):()=>n.length)(),a=Pn(4+i+1);if(A[a>>2]=i,r&&e)d(n,T,a+4,i+1);else if(e)for(e=0;e<i;++e){var o=n.charCodeAt(e);255<o&&(kn(a),_t("String has UTF-16 code units that do not fit in 8 bits")),T[a+4+e]=o}else for(e=0;e<i;++e)T[a+4+e]=n[e];return null!==t&&t.push(kn,a),a},argPackAdvance:8,readValueFromPointer:ut,Yb:function(t){kn(t)}})},ja:function(t,n,r){if(r=wt(r),2===n)var e=k,i=P,a=D,o=()=>S,c=1;else 4===n&&(e=F,i=E,a=O,o=()=>A,c=2);St(t,{name:r,fromWireType:function(t){for(var r,i=A[t>>2],a=o(),u=t+4,f=0;f<=i;++f){var s=t+4+f*n;f!=i&&0!=a[s>>c]||(u=e(u,s-u),void 0===r?r=u:(r+=String.fromCharCode(0),r+=u),u=s+n)}return kn(t),r},toWireType:function(t,e){"string"!=typeof e&&_t("Cannot pass non-string to C++ string type "+r);var o=a(e),u=Pn(4+o+n);return A[u>>2]=o>>c,i(e,u+4,o+n),null!==t&&t.push(kn,u),u},argPackAdvance:8,readValueFromPointer:ut,Yb:function(t){kn(t)}})},C:function(t,n,r,e,i,a){ot[t]={name:wt(n),Bc:$t(r,e),ac:$t(i,a),Gc:[]}},s:function(t,n,r,e,i,a,o,c,u,f){ot[t].Gc.push({Mc:wt(n),Tc:r,Rc:$t(e,i),Sc:a,ad:o,$c:$t(c,u),bd:f})},Wa:function(t,n){St(t,{Vc:!0,name:n=wt(n),argPackAdvance:0,fromWireType:function(){},toWireType:function(){}})},ka:function(t,n,r){t=nn(t),n=an(n,"emval::as");var e=[],i=rn(e);return R[r>>2]=i,n.toWireType(e,t)},Za:function(t,n,r,e){t=nn(t),r=fn(n,r);for(var i=Array(n),a=0;a<n;++a){var o=r[a];i[a]=o.readValueFromPointer(e),e+=o.argPackAdvance}return rn(t=t.apply(void 0,i))},Q:function(t,n,r,e,i){t=hn[t],n=nn(n),r=ln(r);var a=[];return R[e>>2]=rn(a),t(n,r,a,i)},F:function(t,n,r,e){(t=hn[t])(n=nn(n),r=ln(r),null,e)},ea:tn,Xa:function(t){return 0===t?rn(vn()):(t=ln(t),rn(vn()[t]))},x:function(t,n){var r=fn(t,n),e=r[0];n=e.name+"_$"+r.slice(1).map((function(t){return t.name})).join("_")+"$";var i=bn[n];if(void 0!==i)return i;i=["retType"];for(var a=[e],o="",c=0;c<t-1;++c)o+=(0!==c?", ":"")+"arg"+c,i.push("argType"+c),a.push(r[1+c]);var u="return function "+ht("methodCaller_"+n)+"(handle, name, destructors, args) {\n",f=0;for(c=0;c<t-1;++c)u+=" var arg"+c+" = argType"+c+".readValueFromPointer(args"+(f?"+"+f:"")+");\n",f+=r[c+1].argPackAdvance;for(u+=" var rv = handle[name]("+o+");\n",c=0;c<t-1;++c)r[c+1].deleteObject&&(u+=" argType"+c+".deleteObject(arg"+c+");\n");return e.Vc||(u+=" return retType.toWireType(destructors, rv);\n"),i.push(u+"};\n"),i=function(t){var n=hn.length;return hn.push(t),n}(t=Lt(i).apply(null,a)),bn[n]=i},ab:function(t){return t=ln(t),rn(n[t])},ub:function(t,n){return rn((t=nn(t))[n=nn(n)])},fa:function(t){4<t&&(Qt[t].Cc+=1)},$a:function(t,r,e,i){t=nn(t);var a=pn[r];if(!a){a="";for(var o=0;o<r;++o)a+=(0!==o?", ":"")+"arg"+o;var c="return function emval_allocator_"+r+"(constructor, argTypes, args) {\n";for(o=0;o<r;++o)c+="var argType"+o+" = requireRegisteredType(Module['HEAP32'][(argTypes >>> 2) + "+o+'], "parameter '+o+'");\nvar arg'+o+" = argType"+o+".readValueFromPointer(args);\nargs += argType"+o+"['argPackAdvance'];\n";a=new Function("requireRegisteredType","Module","valueToHandle",c+"var obj = new constructor("+a+");\nreturn valueToHandle(obj);\n}\n")(an,n,rn),pn[r]=a}return a(t,e,i)},Ya:function(){return rn([])},lb:function(t){return rn(ln(t))},cb:function(t){ct(nn(t)),tn(t)},bb:function(t,n){return(t=nn(t))===nn(n)},D:function(t,n){return rn(t=(t=an(t,"_emval_take_value")).readValueFromPointer(n))},ha:function(){z("")},ia:function(t){var n=T.length;if(2147483648<(t>>>=0))return!1;for(var r=1;4>=r;r*=2){var e=n*(1+.2/r);e=Math.min(e,t+100663296);var i=Math;e=Math.max(t,e),i=i.min.call(i,2147483648,e+(65536-e%65536)%65536);t:{try{v.grow(i-m.byteLength+65535>>>16),U();var a=1;break t}catch(t){}a=void 0}if(a)return!0}return!1},Sa:function(t,n){var r=0;return dn().forEach((function(e,i){var a=n+r;for(i=R[t+4*i>>2]=a,a=0;a<e.length;++a)w[i++>>0]=e.charCodeAt(a);w[i>>0]=0,r+=e.length+1})),0},Ta:function(t,n){var r=dn();R[t>>2]=r.length;var e=0;return r.forEach((function(t){e+=t.length+1})),R[n>>2]=e,0},Ma:function(){return 0},Oa:function(t,n,r,e){return t=wn.kd(t),n=wn.hd(t,n,r),R[e>>2]=n,0},hb:function(){},Na:function(t,n,r,e){for(var i=0,a=0;a<r;a++){var o=R[n>>2],c=R[n+4>>2];n+=8;for(var s=0;s<c;s++){var l=T[o+s],h=mn[t];0===l||10===l?((1===t?u:f)(y(h,0)),h.length=0):h.push(l)}i+=c}return R[e>>2]=i,0},a:function(){return l},Ja:function(t,n){var r=On();try{return G(t)(n)}catch(t){if(Un(r),t!==t+0)throw t;En(1,0)}},ca:function(t,n,r){var e=On();try{return G(t)(n,r)}catch(t){if(Un(e),t!==t+0)throw t;En(1,0)}},Da:function(t,n,r,e){var i=On();try{return G(t)(n,r,e)}catch(t){if(Un(i),t!==t+0)throw t;En(1,0)}},M:function(t,n){var r=On();try{return G(t)(n)}catch(t){if(Un(r),t!==t+0)throw t;En(1,0)}},ob:function(t,n,r){var e=On();try{return G(t)(n,r)}catch(t){if(Un(e),t!==t+0)throw t;En(1,0)}},H:function(t,n,r){var e=On();try{return G(t)(n,r)}catch(t){if(Un(e),t!==t+0)throw t;En(1,0)}},qb:function(t,n,r,e,i){var a=On();try{return G(t)(n,r,e,i)}catch(t){if(Un(a),t!==t+0)throw t;En(1,0)}},K:function(t,n,r,e){var i=On();try{return G(t)(n,r,e)}catch(t){if(Un(i),t!==t+0)throw t;En(1,0)}},T:function(t){var n=On();try{return G(t)()}catch(t){if(Un(n),t!==t+0)throw t;En(1,0)}},U:function(t,n){var r=On();try{return G(t)(n)}catch(t){if(Un(r),t!==t+0)throw t;En(1,0)}},Ia:function(t,n,r,e){var i=On();try{return G(t)(n,r,e)}catch(t){if(Un(i),t!==t+0)throw t;En(1,0)}},g:function(t,n){var r=On();try{return G(t)(n)}catch(t){if(Un(r),t!==t+0)throw t;En(1,0)}},ga:function(t,n,r){var e=On();try{return G(t)(n,r)}catch(t){if(Un(e),t!==t+0)throw t;En(1,0)}},qa:function(t,n,r){var e=On();try{return G(t)(n,r)}catch(t){if(Un(e),t!==t+0)throw t;En(1,0)}},c:function(t,n,r){var e=On();try{return G(t)(n,r)}catch(t){if(Un(e),t!==t+0)throw t;En(1,0)}},pb:function(t,n,r,e,i){var a=On();try{return G(t)(n,r,e,i)}catch(t){if(Un(a),t!==t+0)throw t;En(1,0)}},ra:function(t,n,r,e,i,a,o){var c=On();try{return G(t)(n,r,e,i,a,o)}catch(t){if(Un(c),t!==t+0)throw t;En(1,0)}},i:function(t,n,r,e){var i=On();try{return G(t)(n,r,e)}catch(t){if(Un(i),t!==t+0)throw t;En(1,0)}},Ga:function(t,n,r,e,i,a,o,c,u,f,s,l,h,v){var b=On();try{return G(t)(n,r,e,i,a,o,c,u,f,s,l,h,v)}catch(t){if(Un(b),t!==t+0)throw t;En(1,0)}},q:function(t,n,r,e,i){var a=On();try{return G(t)(n,r,e,i)}catch(t){if(Un(a),t!==t+0)throw t;En(1,0)}},Ba:function(t,n,r,e,i,a){var o=On();try{return G(t)(n,r,e,i,a)}catch(t){if(Un(o),t!==t+0)throw t;En(1,0)}},v:function(t,n,r,e,i,a){var o=On();try{return G(t)(n,r,e,i,a)}catch(t){if(Un(o),t!==t+0)throw t;En(1,0)}},E:function(t,n,r,e,i,a,o){var c=On();try{return G(t)(n,r,e,i,a,o)}catch(t){if(Un(c),t!==t+0)throw t;En(1,0)}},I:function(t,n,r,e,i,a,o,c){var u=On();try{return G(t)(n,r,e,i,a,o,c)}catch(t){if(Un(u),t!==t+0)throw t;En(1,0)}},ba:function(t,n,r,e,i,a,o,c,u){var f=On();try{return G(t)(n,r,e,i,a,o,c,u)}catch(t){if(Un(f),t!==t+0)throw t;En(1,0)}},Y:function(t,n,r,e,i,a,o,c,u,f){var s=On();try{return G(t)(n,r,e,i,a,o,c,u,f)}catch(t){if(Un(s),t!==t+0)throw t;En(1,0)}},aa:function(t,n,r,e,i,a,o,c,u,f,s,l){var h=On();try{return G(t)(n,r,e,i,a,o,c,u,f,s,l)}catch(t){if(Un(h),t!==t+0)throw t;En(1,0)}},db:function(t,n,r,e){var i=On();try{return Vn(t,n,r,e)}catch(t){if(Un(i),t!==t+0)throw t;En(1,0)}},gb:function(t,n,r){var e=On();try{return Yn(t,n,r)}catch(t){if(Un(e),t!==t+0)throw t;En(1,0)}},j:function(t){var n=On();try{G(t)()}catch(t){if(Un(n),t!==t+0)throw t;En(1,0)}},l:function(t,n){var r=On();try{G(t)(n)}catch(t){if(Un(r),t!==t+0)throw t;En(1,0)}},ma:function(t,n,r){var e=On();try{G(t)(n,r)}catch(t){if(Un(e),t!==t+0)throw t;En(1,0)}},sa:function(t,n,r,e){var i=On();try{G(t)(n,r,e)}catch(t){if(Un(i),t!==t+0)throw t;En(1,0)}},Fa:function(t,n,r){var e=On();try{G(t)(n,r)}catch(t){if(Un(e),t!==t+0)throw t;En(1,0)}},ta:function(t,n,r,e,i,a,o,c,u,f){var s=On();try{G(t)(n,r,e,i,a,o,c,u,f)}catch(t){if(Un(s),t!==t+0)throw t;En(1,0)}},sb:function(t,n,r,e){var i=On();try{G(t)(n,r,e)}catch(t){if(Un(i),t!==t+0)throw t;En(1,0)}},rb:function(t,n,r,e,i,a,o,c){var u=On();try{G(t)(n,r,e,i,a,o,c)}catch(t){if(Un(u),t!==t+0)throw t;En(1,0)}},na:function(t,n,r,e,i,a,o){var c=On();try{G(t)(n,r,e,i,a,o)}catch(t){if(Un(c),t!==t+0)throw t;En(1,0)}},d:function(t,n,r){var e=On();try{G(t)(n,r)}catch(t){if(Un(e),t!==t+0)throw t;En(1,0)}},oa:function(t,n,r,e){var i=On();try{G(t)(n,r,e)}catch(t){if(Un(i),t!==t+0)throw t;En(1,0)}},P:function(t,n,r,e,i){var a=On();try{G(t)(n,r,e,i)}catch(t){if(Un(a),t!==t+0)throw t;En(1,0)}},O:function(t,n,r,e,i,a){var o=On();try{G(t)(n,r,e,i,a)}catch(t){if(Un(o),t!==t+0)throw t;En(1,0)}},Ea:function(t,n,r,e){var i=On();try{G(t)(n,r,e)}catch(t){if(Un(i),t!==t+0)throw t;En(1,0)}},pa:function(t,n,r,e,i,a){var o=On();try{G(t)(n,r,e,i,a)}catch(t){if(Un(o),t!==t+0)throw t;En(1,0)}},kb:function(t,n,r,e,i){var a=On();try{G(t)(n,r,e,i)}catch(t){if(Un(a),t!==t+0)throw t;En(1,0)}},Ha:function(t,n,r,e,i,a,o){var c=On();try{G(t)(n,r,e,i,a,o)}catch(t){if(Un(c),t!==t+0)throw t;En(1,0)}},f:function(t,n,r,e){var i=On();try{G(t)(n,r,e)}catch(t){if(Un(i),t!==t+0)throw t;En(1,0)}},nb:function(t,n,r,e,i){var a=On();try{G(t)(n,r,e,i)}catch(t){if(Un(a),t!==t+0)throw t;En(1,0)}},L:function(t,n,r,e,i,a,o){var c=On();try{G(t)(n,r,e,i,a,o)}catch(t){if(Un(c),t!==t+0)throw t;En(1,0)}},tb:function(t,n,r,e,i,a){var o=On();try{G(t)(n,r,e,i,a)}catch(t){if(Un(o),t!==t+0)throw t;En(1,0)}},k:function(t,n,r,e,i){var a=On();try{G(t)(n,r,e,i)}catch(t){if(Un(a),t!==t+0)throw t;En(1,0)}},da:function(t,n,r,e,i,a){var o=On();try{G(t)(n,r,e,i,a)}catch(t){if(Un(o),t!==t+0)throw t;En(1,0)}},mb:function(t,n,r,e,i,a,o,c){var u=On();try{G(t)(n,r,e,i,a,o,c)}catch(t){if(Un(u),t!==t+0)throw t;En(1,0)}},la:function(t,n,r,e,i,a,o){var c=On();try{G(t)(n,r,e,i,a,o)}catch(t){if(Un(c),t!==t+0)throw t;En(1,0)}},t:function(t,n,r,e,i,a){var o=On();try{G(t)(n,r,e,i,a)}catch(t){if(Un(o),t!==t+0)throw t;En(1,0)}},w:function(t,n,r,e,i,a,o){var c=On();try{G(t)(n,r,e,i,a,o)}catch(t){if(Un(c),t!==t+0)throw t;En(1,0)}},B:function(t,n,r,e,i,a,o,c){var u=On();try{G(t)(n,r,e,i,a,o,c)}catch(t){if(Un(u),t!==t+0)throw t;En(1,0)}},V:function(t,n,r,e,i,a,o,c,u){var f=On();try{G(t)(n,r,e,i,a,o,c,u)}catch(t){if(Un(f),t!==t+0)throw t;En(1,0)}},S:function(t,n,r,e,i,a,o,c,u,f){var s=On();try{G(t)(n,r,e,i,a,o,c,u,f)}catch(t){if(Un(s),t!==t+0)throw t;En(1,0)}},R:function(t,n,r,e,i,a,o,c,u,f,s){var l=On();try{G(t)(n,r,e,i,a,o,c,u,f,s)}catch(t){if(Un(l),t!==t+0)throw t;En(1,0)}},Z:function(t,n,r,e,i,a,o,c,u,f,s,l){var h=On();try{G(t)(n,r,e,i,a,o,c,u,f,s,l)}catch(t){if(Un(h),t!==t+0)throw t;En(1,0)}},jb:function(t,n,r,e,i,a,o,c,u,f,s,l,h){var v=On();try{G(t)(n,r,e,i,a,o,c,u,f,s,l,h)}catch(t){if(Un(v),t!==t+0)throw t;En(1,0)}},$:function(t,n,r,e,i,a,o,c,u,f,s,l,h,v,b,p){var y=On();try{G(t)(n,r,e,i,a,o,c,u,f,s,l,h,v,b,p)}catch(t){if(Un(y),t!==t+0)throw t;En(1,0)}},eb:function(t,n,r,e,i,a,o){var c=On();try{In(t,n,r,e,i,a,o)}catch(t){if(Un(c),t!==t+0)throw t;En(1,0)}},fb:function(t,n,r,e){var i=On();try{Hn(t,n,r,e)}catch(t){if(Un(i),t!==t+0)throw t;En(1,0)}},r:function(t){return t},Aa:function(t){l=t},La:function(t,n,r,e){return function(t,n,r,e){function i(t,n,r){for(t="number"==typeof t?t.toString():t||"";t.length<n;)t=r[0]+t;return t}function a(t,n){return i(t,n,"0")}function o(t,n){function r(t){return 0>t?-1:0<t?1:0}var e;return 0===(e=r(t.getFullYear()-n.getFullYear()))&&0===(e=r(t.getMonth()-n.getMonth()))&&(e=r(t.getDate()-n.getDate())),e}function c(t){switch(t.getDay()){case 0:return new Date(t.getFullYear()-1,11,29);case 1:return t;case 2:return new Date(t.getFullYear(),0,3);case 3:return new Date(t.getFullYear(),0,2);case 4:return new Date(t.getFullYear(),0,1);case 5:return new Date(t.getFullYear()-1,11,31);case 6:return new Date(t.getFullYear()-1,11,30)}}function u(t){t=An(new Date(t.Xb+1900,0,1),t.vc);var n=new Date(t.getFullYear()+1,0,4),r=c(new Date(t.getFullYear(),0,4));return n=c(n),0>=o(r,t)?0>=o(n,t)?t.getFullYear()+1:t.getFullYear():t.getFullYear()-1}var f=R[e+40>>2];for(var s in e={fd:R[e>>2],ed:R[e+4>>2],tc:R[e+8>>2],nc:R[e+12>>2],kc:R[e+16>>2],Xb:R[e+20>>2],uc:R[e+24>>2],vc:R[e+28>>2],md:R[e+32>>2],dd:R[e+36>>2],gd:f&&f?y(T,f,void 0):""},r=r?y(T,r,void 0):"",f={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"})r=r.replace(new RegExp(s,"g"),f[s]);var l="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),h="January February March April May June July August September October November December".split(" ");for(s in f={"%a":function(t){return l[t.uc].substring(0,3)},"%A":function(t){return l[t.uc]},"%b":function(t){return h[t.kc].substring(0,3)},"%B":function(t){return h[t.kc]},"%C":function(t){return a((t.Xb+1900)/100|0,2)},"%d":function(t){return a(t.nc,2)},"%e":function(t){return i(t.nc,2," ")},"%g":function(t){return u(t).toString().substring(2)},"%G":function(t){return u(t)},"%H":function(t){return a(t.tc,2)},"%I":function(t){return 0==(t=t.tc)?t=12:12<t&&(t-=12),a(t,2)},"%j":function(t){return a(t.nc+_n(Tn(t.Xb+1900)?Sn:Rn,t.kc-1),3)},"%m":function(t){return a(t.kc+1,2)},"%M":function(t){return a(t.ed,2)},"%n":function(){return"\n"},"%p":function(t){return 0<=t.tc&&12>t.tc?"AM":"PM"},"%S":function(t){return a(t.fd,2)},"%t":function(){return"\t"},"%u":function(t){return t.uc||7},"%U":function(t){var n=new Date(t.Xb+1900,0,1),r=0===n.getDay()?n:An(n,7-n.getDay());return 0>o(r,t=new Date(t.Xb+1900,t.kc,t.nc))?a(Math.ceil((31-r.getDate()+(_n(Tn(t.getFullYear())?Sn:Rn,t.getMonth()-1)-31)+t.getDate())/7),2):0===o(r,n)?"01":"00"},"%V":function(t){var n=new Date(t.Xb+1901,0,4),r=c(new Date(t.Xb+1900,0,4));n=c(n);var e=An(new Date(t.Xb+1900,0,1),t.vc);return 0>o(e,r)?"53":0>=o(n,e)?"01":a(Math.ceil((r.getFullYear()<t.Xb+1900?t.vc+32-r.getDate():t.vc+1-r.getDate())/7),2)},"%w":function(t){return t.uc},"%W":function(t){var n=new Date(t.Xb,0,1),r=1===n.getDay()?n:An(n,0===n.getDay()?1:7-n.getDay()+1);return 0>o(r,t=new Date(t.Xb+1900,t.kc,t.nc))?a(Math.ceil((31-r.getDate()+(_n(Tn(t.getFullYear())?Sn:Rn,t.getMonth()-1)-31)+t.getDate())/7),2):0===o(r,n)?"01":"00"},"%y":function(t){return(t.Xb+1900).toString().substring(2)},"%Y":function(t){return t.Xb+1900},"%z":function(t){var n=0<=(t=t.dd);return t=Math.abs(t)/60,(n?"+":"-")+String("0000"+(t/60*100+t%60)).slice(-4)},"%Z":function(t){return t.gd},"%%":function(){return"%"}},r=r.replace(/%%/g,"\0\0"),f)r.includes(s)&&(r=r.replace(new RegExp(s,"g"),f[s](e)));return(s=function(t){var n=Array(g(t)+1);return d(t,n,0,n.length),n}(r=r.replace(/\0\0/g,"%"))).length>n?0:(w.set(s,t),s.length-1)}(t,n,r,e)}};!function(){function t(t){n.asm=t.exports,v=n.asm.vb,U(),M=n.asm.Cb,Y.unshift(n.asm.wb),B--,n.monitorRunDependencies&&n.monitorRunDependencies(B),0==B&&(null!==Z&&(clearInterval(Z),Z=null),$&&(t=$,$=null,t()))}function r(n){t(n.instance)}function i(t){return(s||"function"!=typeof fetch?Promise.resolve().then((function(){return K()})):fetch(X,{credentials:"same-origin"}).then((function(t){if(!t.ok)throw"failed to load wasm binary file at '"+X+"'";return t.arrayBuffer()})).catch((function(){return K()}))).then((function(t){return WebAssembly.instantiate(t,a)})).then((function(t){return t})).then(t,(function(t){f("failed to asynchronously prepare wasm: "+t),z(t)}))}var a={a:jn};if(B++,n.monitorRunDependencies&&n.monitorRunDependencies(B),n.instantiateWasm)try{return n.instantiateWasm(a,t)}catch(t){return f("Module.instantiateWasm callback failed with error: "+t),!1}(s||"function"!=typeof WebAssembly.instantiateStreaming||q()||"function"!=typeof fetch?i(r):fetch(X,{credentials:"same-origin"}).then((function(t){return WebAssembly.instantiateStreaming(t,a).then(r,(function(t){return f("wasm streaming compile failed: "+t),f("falling back to ArrayBuffer instantiation"),i(r)}))}))).catch(e)}(),n.___wasm_call_ctors=function(){return(n.___wasm_call_ctors=n.asm.wb).apply(null,arguments)};var kn=n._free=function(){return(kn=n._free=n.asm.xb).apply(null,arguments)},Pn=n._malloc=function(){return(Pn=n._malloc=n.asm.yb).apply(null,arguments)};n._main=function(){return(n._main=n.asm.zb).apply(null,arguments)};var Dn=n.___getTypeName=function(){return(Dn=n.___getTypeName=n.asm.Ab).apply(null,arguments)};n.___embind_register_native_and_builtin_types=function(){return(n.___embind_register_native_and_builtin_types=n.asm.Bb).apply(null,arguments)};var Fn,En=n._setThrew=function(){return(En=n._setThrew=n.asm.Db).apply(null,arguments)},On=n.stackSave=function(){return(On=n.stackSave=n.asm.Eb).apply(null,arguments)},Un=n.stackRestore=function(){return(Un=n.stackRestore=n.asm.Fb).apply(null,arguments)},Mn=n.___cxa_can_catch=function(){return(Mn=n.___cxa_can_catch=n.asm.Gb).apply(null,arguments)},xn=n.___cxa_is_pointer_type=function(){return(xn=n.___cxa_is_pointer_type=n.asm.Hb).apply(null,arguments)},Yn=n.dynCall_jii=function(){return(Yn=n.dynCall_jii=n.asm.Ib).apply(null,arguments)},In=n.dynCall_viiiji=function(){return(In=n.dynCall_viiiji=n.asm.Jb).apply(null,arguments)},Vn=n.dynCall_iij=function(){return(Vn=n.dynCall_iij=n.asm.Kb).apply(null,arguments)},Hn=n.dynCall_vij=function(){return(Hn=n.dynCall_vij=n.asm.Lb).apply(null,arguments)};function Xn(t){this.name="ExitStatus",this.message="Program terminated with exit("+t+")",this.status=t}function Bn(){function t(){if(!Fn&&(Fn=!0,n.calledRun=!0,!b)){if(L(Y),L(I),r(n),n.onRuntimeInitialized&&n.onRuntimeInitialized(),Zn){var t=n._main;try{var e=t(0,0);h||(n.onExit&&n.onExit(e),b=!0),o(e,new Xn(e))}catch(t){t instanceof Xn||"unwind"==t||o(1,t)}}if(n.postRun)for("function"==typeof n.postRun&&(n.postRun=[n.postRun]);n.postRun.length;)t=n.postRun.shift(),V.unshift(t);L(V)}}if(!(0<B)){if(n.preRun)for("function"==typeof n.preRun&&(n.preRun=[n.preRun]);n.preRun.length;)H();L(x),0<B||(n.setStatus?(n.setStatus("Running..."),setTimeout((function(){setTimeout((function(){n.setStatus("")}),1),t()}),1)):t())}}if(n.dynCall_viijii=function(){return(n.dynCall_viijii=n.asm.Mb).apply(null,arguments)},n.dynCall_jiji=function(){return(n.dynCall_jiji=n.asm.Nb).apply(null,arguments)},n.dynCall_iiiiij=function(){return(n.dynCall_iiiiij=n.asm.Ob).apply(null,arguments)},n.dynCall_iiiiijj=function(){return(n.dynCall_iiiiijj=n.asm.Pb).apply(null,arguments)},n.dynCall_iiiiiijj=function(){return(n.dynCall_iiiiiijj=n.asm.Qb).apply(null,arguments)},$=function t(){Fn||Bn(),Fn||($=t)},n.run=Bn,n.preInit)for("function"==typeof n.preInit&&(n.preInit=[n.preInit]);0<n.preInit.length;)n.preInit.pop()();var Zn=!0;return n.noInitialRun&&(Zn=!1),Bn(),t.ready});"object"==typeof exports&&"object"==typeof module?module.exports=ConfiguratorKernel:"function"==typeof define&&define.amd?define([],(function(){return ConfiguratorKernel})):"object"==typeof exports&&(exports.ConfiguratorKernel=ConfiguratorKernel);