@roomle/web-sdk 2.99.0 → 2.100.0
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.
- package/lib/Object3D-2abce9d8.nomodule.js +2 -0
- package/lib/Object3D-2abce9d8.nomodule.js.map +1 -0
- package/lib/Object3D-80e9d0f8.js +2 -0
- package/lib/Object3D-80e9d0f8.js.map +1 -0
- package/lib/SpotLightHelper-56c85cfb.nomodule.js +2 -0
- package/lib/SpotLightHelper-56c85cfb.nomodule.js.map +1 -0
- package/lib/SpotLightHelper-79188e47.js +2 -0
- package/lib/SpotLightHelper-79188e47.js.map +1 -0
- package/lib/{banana-for-scale-22ad6a20.nomodule.js → banana-for-scale-795d9c6c.nomodule.js} +2 -2
- package/lib/{banana-for-scale-22ad6a20.nomodule.js.map → banana-for-scale-795d9c6c.nomodule.js.map} +1 -1
- package/lib/{banana-for-scale-da4282fd.js → banana-for-scale-c5d8d13e.js} +2 -2
- package/lib/{banana-for-scale-da4282fd.js.map → banana-for-scale-c5d8d13e.js.map} +1 -1
- package/lib/camera-behaviour-ceced6f1.nomodule.js +2 -0
- package/lib/{camera-behaviour-90408ba5.nomodule.js.map → camera-behaviour-ceced6f1.nomodule.js.map} +1 -1
- package/lib/camera-behaviour-fe3f4008.js +2 -0
- package/lib/{camera-behaviour-2f2ffe82.js.map → camera-behaviour-fe3f4008.js.map} +1 -1
- package/lib/{component-dimensioning-a5e291d6.nomodule.js → component-dimensioning-5417ce83.nomodule.js} +2 -2
- package/lib/component-dimensioning-5417ce83.nomodule.js.map +1 -0
- package/lib/{component-dimensioning-ca877f31.js → component-dimensioning-b575bfa7.js} +2 -2
- package/lib/component-dimensioning-b575bfa7.js.map +1 -0
- package/lib/{component-raycast-helper-785b39cd.js → component-raycast-helper-8faecce8.js} +2 -2
- package/lib/component-raycast-helper-8faecce8.js.map +1 -0
- package/lib/{component-raycast-helper-40f9eb14.nomodule.js → component-raycast-helper-cde6065c.nomodule.js} +2 -2
- package/lib/component-raycast-helper-cde6065c.nomodule.js.map +1 -0
- package/lib/configurator-0ad4d1f9.nomodule.js +2 -0
- package/lib/configurator-0ad4d1f9.nomodule.js.map +1 -0
- package/lib/configurator-4565594d.js +2 -0
- package/lib/configurator-4565594d.js.map +1 -0
- package/lib/configurator-main-c79ddf0c.js +2 -0
- package/lib/configurator-main-c79ddf0c.js.map +1 -0
- package/lib/configurator-main.nomodule.js +1 -1
- package/lib/continuous-drawing-helper-6a23cf51.js +2 -0
- package/lib/continuous-drawing-helper-6a23cf51.js.map +1 -0
- package/lib/continuous-drawing-helper-70637238.nomodule.js +2 -0
- package/lib/continuous-drawing-helper-70637238.nomodule.js.map +1 -0
- package/lib/default-light-setting-755cfddc.js +2 -0
- package/lib/default-light-setting-755cfddc.js.map +1 -0
- package/lib/default-light-setting-e6087240.nomodule.js +2 -0
- package/lib/default-light-setting-e6087240.nomodule.js.map +1 -0
- package/lib/definitions/common-core/src/cameracontrol/camera-control-3d.d.ts +2 -1
- package/lib/definitions/common-core/src/cameracontrol/configurator-camera-behaviour.d.ts +1 -1
- package/lib/definitions/common-core/src/utils/common-utils.d.ts +1 -0
- package/lib/definitions/common-core/src/utils/init-data.d.ts +3 -0
- package/lib/definitions/common-core/src/utils/shims.d.ts +8 -3
- package/lib/definitions/common-core/src/webgl/image-renderer.d.ts +1 -0
- package/lib/definitions/common-core/src/webgl/roomle-webgl-renderer.d.ts +3 -0
- package/lib/definitions/common-core/src/webgl/scene-manager.d.ts +1 -0
- package/lib/definitions/packages/common-core/src/cameracontrol/camera-control-3d.d.ts +2 -1
- package/lib/definitions/packages/common-core/src/cameracontrol/configurator-camera-behaviour.d.ts +1 -1
- package/lib/definitions/packages/common-core/src/utils/common-utils.d.ts +1 -0
- package/lib/definitions/packages/common-core/src/utils/init-data.d.ts +3 -0
- package/lib/definitions/packages/common-core/src/utils/shims.d.ts +8 -3
- package/lib/definitions/packages/common-core/src/webgl/image-renderer.d.ts +1 -0
- package/lib/definitions/packages/common-core/src/webgl/roomle-webgl-renderer.d.ts +3 -0
- package/lib/definitions/packages/common-core/src/webgl/scene-manager.d.ts +1 -0
- package/lib/definitions/packages/planner-core/src/lights/ceiling-light.d.ts +19 -0
- package/lib/definitions/packages/planner-core/src/lights/lamp-light.d.ts +9 -0
- package/lib/definitions/packages/planner-core/src/lights/light-group.d.ts +11 -0
- package/lib/definitions/packages/planner-core/src/lights/rect-area-light.d.ts +7 -0
- package/lib/definitions/packages/planner-core/src/roomle-planner-ui-callback.d.ts +1 -1
- package/lib/definitions/packages/planner-core/src/roomle-planner.d.ts +10 -2
- package/lib/definitions/packages/planner-core/src/utils/{planner-scene-manager.d.ts → planner-scene-utils.d.ts} +5 -2
- package/lib/definitions/packages/planner-core/src/view-model/floor-plan-element-view-model.d.ts +1 -0
- package/lib/definitions/packages/planner-core/src/view-model/plan-view-model.d.ts +21 -0
- package/lib/definitions/packages/planner-core/src/webgl/planner-scene-manager.d.ts +3 -6
- package/lib/definitions/packages/typings/planner.d.ts +7 -1
- package/lib/definitions/planner-core/src/lights/ceiling-light.d.ts +19 -0
- package/lib/definitions/planner-core/src/lights/lamp-light.d.ts +9 -0
- package/lib/definitions/planner-core/src/lights/light-group.d.ts +11 -0
- package/lib/definitions/planner-core/src/lights/rect-area-light.d.ts +7 -0
- package/lib/definitions/planner-core/src/roomle-planner-ui-callback.d.ts +1 -1
- package/lib/definitions/planner-core/src/roomle-planner.d.ts +10 -2
- package/lib/definitions/planner-core/src/utils/{planner-scene-manager.d.ts → planner-scene-utils.d.ts} +5 -2
- package/lib/definitions/planner-core/src/view-model/floor-plan-element-view-model.d.ts +1 -0
- package/lib/definitions/planner-core/src/view-model/plan-view-model.d.ts +21 -0
- package/lib/definitions/planner-core/src/webgl/planner-scene-manager.d.ts +3 -6
- package/lib/definitions/typings/planner.d.ts +7 -1
- package/lib/dimensioning-helper-089673fa.nomodule.js +2 -0
- package/lib/dimensioning-helper-089673fa.nomodule.js.map +1 -0
- package/lib/dimensioning-helper-ba9dbb6f.js +2 -0
- package/lib/{dimensioning-helper-fb456f28.js.map → dimensioning-helper-ba9dbb6f.js.map} +1 -1
- package/lib/glb-viewer-232298a7.nomodule.js +2 -0
- package/lib/{glb-viewer-58aa56b3.nomodule.js.map → glb-viewer-232298a7.nomodule.js.map} +1 -1
- package/lib/glb-viewer-bc27fd7c.js +2 -0
- package/lib/{glb-viewer-d4c6c346.js.map → glb-viewer-bc27fd7c.js.map} +1 -1
- package/lib/{glb-viewer-camera-behaviour-1b347e77.nomodule.js → glb-viewer-camera-behaviour-b9f0adaa.nomodule.js} +2 -2
- package/lib/glb-viewer-camera-behaviour-b9f0adaa.nomodule.js.map +1 -0
- package/lib/{glb-viewer-camera-behaviour-24e823bc.js → glb-viewer-camera-behaviour-f8871d34.js} +2 -2
- package/lib/glb-viewer-camera-behaviour-f8871d34.js.map +1 -0
- package/lib/glb-viewer-main-058270a7.js +2 -0
- package/lib/glb-viewer-main-058270a7.js.map +1 -0
- package/lib/glb-viewer-main.nomodule.js +1 -1
- package/lib/{imos-ix-poc-export-helper-b7a91cdb.nomodule.js → imos-ix-poc-export-helper-29ce417b.nomodule.js} +2 -2
- package/lib/imos-ix-poc-export-helper-29ce417b.nomodule.js.map +1 -0
- package/lib/{imos-ix-poc-export-helper-7b16b54e.js → imos-ix-poc-export-helper-43b4c646.js} +2 -2
- package/lib/imos-ix-poc-export-helper-43b4c646.js.map +1 -0
- package/lib/legacy/Object3D-1f141c55.legacy.js +2 -0
- package/lib/legacy/Object3D-1f141c55.legacy.js.map +1 -0
- package/lib/legacy/SpotLightHelper-28698e83.legacy.js +2 -0
- package/lib/legacy/SpotLightHelper-28698e83.legacy.js.map +1 -0
- package/lib/legacy/TextGeometry-559f28ce.legacy.js +2 -0
- package/lib/legacy/{TextGeometry-778d127b.legacy.js.map → TextGeometry-559f28ce.legacy.js.map} +1 -1
- package/lib/legacy/{banana-for-scale-b274801d.legacy.js → banana-for-scale-8a3d4091.legacy.js} +2 -2
- package/lib/legacy/{banana-for-scale-b274801d.legacy.js.map → banana-for-scale-8a3d4091.legacy.js.map} +1 -1
- package/lib/legacy/budgeteer-measure.legacy.js +1 -1
- package/lib/legacy/camera-behaviour-363a4e78.legacy.js +2 -0
- package/lib/legacy/{camera-behaviour-b47dbdd3.legacy.js.map → camera-behaviour-363a4e78.legacy.js.map} +1 -1
- package/lib/legacy/{component-dimensioning-a3ba2ba6.legacy.js → component-dimensioning-f92c2840.legacy.js} +2 -2
- package/lib/legacy/component-dimensioning-f92c2840.legacy.js.map +1 -0
- package/lib/legacy/{component-raycast-helper-a5178cda.legacy.js → component-raycast-helper-91c67dd6.legacy.js} +2 -2
- package/lib/legacy/component-raycast-helper-91c67dd6.legacy.js.map +1 -0
- package/lib/legacy/configurator-bdb72223.legacy.js +2 -0
- package/lib/legacy/configurator-bdb72223.legacy.js.map +1 -0
- package/lib/legacy/configurator-main.legacy.js +1 -1
- package/lib/legacy/continuous-drawing-helper-e8db250c.legacy.js +2 -0
- package/lib/legacy/continuous-drawing-helper-e8db250c.legacy.js.map +1 -0
- package/lib/legacy/default-light-setting-07ced87c.legacy.js +2 -0
- package/lib/legacy/default-light-setting-07ced87c.legacy.js.map +1 -0
- package/lib/legacy/dimensioning-helper-bb3492c7.legacy.js +2 -0
- package/lib/legacy/dimensioning-helper-bb3492c7.legacy.js.map +1 -0
- package/lib/legacy/external-objects-01d5a216.legacy.js +2 -0
- package/lib/legacy/external-objects-01d5a216.legacy.js.map +1 -0
- package/lib/legacy/{glb-viewer-camera-behaviour-4be0da6a.legacy.js → glb-viewer-camera-behaviour-8a35f77c.legacy.js} +2 -2
- package/lib/legacy/glb-viewer-camera-behaviour-8a35f77c.legacy.js.map +1 -0
- package/lib/legacy/glb-viewer-d69f6cae.legacy.js +2 -0
- package/lib/legacy/{glb-viewer-d3854b02.legacy.js.map → glb-viewer-d69f6cae.legacy.js.map} +1 -1
- package/lib/legacy/glb-viewer-main.legacy.js +1 -1
- package/lib/legacy/{imos-ix-poc-export-helper-ee70d653.legacy.js → imos-ix-poc-export-helper-ca5160da.legacy.js} +2 -2
- package/lib/legacy/imos-ix-poc-export-helper-ca5160da.legacy.js.map +1 -0
- package/lib/legacy/{main-thread-to-worker-da6ad96a.legacy.js → main-thread-to-worker-32b45184.legacy.js} +3 -3
- package/lib/legacy/{main-thread-to-worker-da6ad96a.legacy.js.map → main-thread-to-worker-32b45184.legacy.js.map} +1 -1
- package/lib/legacy/material-viewer-770e3a93.legacy.js +2 -0
- package/lib/legacy/material-viewer-770e3a93.legacy.js.map +1 -0
- package/lib/legacy/material-viewer-main.legacy.js +1 -1
- package/lib/legacy/planner-53e1ae1f.legacy.js +2 -0
- package/lib/legacy/{planner-f0a71818.legacy.js.map → planner-53e1ae1f.legacy.js.map} +1 -1
- package/lib/legacy/planner-main.legacy.js +1 -1
- package/lib/legacy/query-params-helper-ad6b6b64.legacy.js +2 -0
- package/lib/legacy/query-params-helper-ad6b6b64.legacy.js.map +1 -0
- package/lib/legacy/roomle-configurator-2ab0523e.legacy.js +2 -0
- package/lib/legacy/roomle-configurator-2ab0523e.legacy.js.map +1 -0
- package/lib/legacy/roomle-dependency-injection-39798155.legacy.js +9 -0
- package/lib/legacy/{roomle-dependency-injection-058aa06f.legacy.js.map → roomle-dependency-injection-39798155.legacy.js.map} +1 -1
- package/lib/legacy/roomle-sdk.legacy.js +1 -1
- package/lib/legacy/{script-loader-9921991a.legacy.js → script-loader-6f4bb7db.legacy.js} +2 -2
- package/lib/legacy/script-loader-6f4bb7db.legacy.js.map +1 -0
- package/lib/legacy/static/ConfiguratorKernel-eb2b45aa8bdd5c73.wasm +0 -0
- package/lib/legacy/static/RoomleCore-a4df483fa6f93517.wasm +0 -0
- package/lib/legacy/static/RoomleToolsCore-9ea339d54e57756a.wasm +0 -0
- package/lib/legacy/{stats-helper-c7bf779b.legacy.js → stats-helper-e75d2585.legacy.js} +2 -2
- package/lib/legacy/stats-helper-e75d2585.legacy.js.map +1 -0
- package/lib/legacy/{tools-core-645fb16a.legacy.js → tools-core-c5e76ffc.legacy.js} +2 -2
- package/lib/legacy/tools-core-c5e76ffc.legacy.js.map +1 -0
- package/lib/material-viewer-a489d3c2.nomodule.js +2 -0
- package/lib/material-viewer-a489d3c2.nomodule.js.map +1 -0
- package/lib/material-viewer-f818f681.js +2 -0
- package/lib/material-viewer-f818f681.js.map +1 -0
- package/lib/material-viewer-main-a4985787.js +2 -0
- package/lib/material-viewer-main-a4985787.js.map +1 -0
- package/lib/material-viewer-main.nomodule.js +1 -1
- package/lib/planner-32c9b79e.nomodule.js +2 -0
- package/lib/{planner-cb1acb4d.nomodule.js.map → planner-32c9b79e.nomodule.js.map} +1 -1
- package/lib/planner-9b39cf77.js +2 -0
- package/lib/{planner-a30840a8.js.map → planner-9b39cf77.js.map} +1 -1
- package/lib/planner-main-32eac04d.js +2 -0
- package/lib/planner-main-32eac04d.js.map +1 -0
- package/lib/planner-main.nomodule.js +1 -1
- package/lib/roomle-configurator-2d336119.nomodule.js +2 -0
- package/lib/roomle-configurator-2d336119.nomodule.js.map +1 -0
- package/lib/roomle-configurator-3bf23b9e.js +2 -0
- package/lib/roomle-configurator-3bf23b9e.js.map +1 -0
- package/lib/{roomle-dependency-injection-8fd89dfe.js → roomle-dependency-injection-c52a0000.js} +3 -3
- package/lib/{roomle-dependency-injection-8fd89dfe.js.map → roomle-dependency-injection-c52a0000.js.map} +1 -1
- package/lib/roomle-dependency-injection-e789a72d.nomodule.js +9 -0
- package/lib/{roomle-dependency-injection-22befdc7.nomodule.js.map → roomle-dependency-injection-e789a72d.nomodule.js.map} +1 -1
- package/lib/{roomle-sdk-3f72ba15.js → roomle-sdk-b28548bd.js} +2 -2
- package/lib/roomle-sdk-b28548bd.js.map +1 -0
- package/lib/roomle-sdk.nomodule.js +1 -1
- package/lib/{script-loader-36a9dcdc.js → script-loader-524d3415.js} +2 -2
- package/lib/script-loader-524d3415.js.map +1 -0
- package/lib/{script-loader-8e8886dd.nomodule.js → script-loader-f57678af.nomodule.js} +2 -2
- package/lib/script-loader-f57678af.nomodule.js.map +1 -0
- package/lib/static/ConfiguratorKernel-eb2b45aa8bdd5c73.wasm +0 -0
- package/lib/static/RoomleCore-a4df483fa6f93517.wasm +0 -0
- package/lib/static/RoomleToolsCore-9ea339d54e57756a.wasm +0 -0
- package/lib/{stats-helper-b5614bb9.js → stats-helper-8557e89e.js} +2 -2
- package/lib/stats-helper-8557e89e.js.map +1 -0
- package/lib/{stats-helper-1a0748a7.nomodule.js → stats-helper-a6ed29fb.nomodule.js} +2 -2
- package/lib/stats-helper-a6ed29fb.nomodule.js.map +1 -0
- package/lib/{tools-core-43082fe5.js → tools-core-26ff177e.js} +2 -2
- package/lib/tools-core-26ff177e.js.map +1 -0
- package/lib/{tools-core-a5f68507.nomodule.js → tools-core-feefe6d1.nomodule.js} +2 -2
- package/lib/tools-core-feefe6d1.nomodule.js.map +1 -0
- package/package.json +2 -2
- package/lib/camera-behaviour-2f2ffe82.js +0 -2
- package/lib/camera-behaviour-90408ba5.nomodule.js +0 -2
- package/lib/component-dimensioning-a5e291d6.nomodule.js.map +0 -1
- package/lib/component-dimensioning-ca877f31.js.map +0 -1
- package/lib/component-raycast-helper-40f9eb14.nomodule.js.map +0 -1
- package/lib/component-raycast-helper-785b39cd.js.map +0 -1
- package/lib/configurator-2d025a93.nomodule.js +0 -2
- package/lib/configurator-2d025a93.nomodule.js.map +0 -1
- package/lib/configurator-3e5c27eb.js +0 -2
- package/lib/configurator-3e5c27eb.js.map +0 -1
- package/lib/configurator-main-f75e4553.js +0 -2
- package/lib/configurator-main-f75e4553.js.map +0 -1
- package/lib/continuous-drawing-helper-ae2fcdd3.js +0 -2
- package/lib/continuous-drawing-helper-ae2fcdd3.js.map +0 -1
- package/lib/continuous-drawing-helper-c71ae2ed.nomodule.js +0 -2
- package/lib/continuous-drawing-helper-c71ae2ed.nomodule.js.map +0 -1
- package/lib/default-light-setting-98201048.nomodule.js +0 -2
- package/lib/default-light-setting-98201048.nomodule.js.map +0 -1
- package/lib/default-light-setting-ba00bf2b.js +0 -2
- package/lib/default-light-setting-ba00bf2b.js.map +0 -1
- package/lib/dimensioning-helper-4d7e768a.nomodule.js +0 -2
- package/lib/dimensioning-helper-4d7e768a.nomodule.js.map +0 -1
- package/lib/dimensioning-helper-fb456f28.js +0 -2
- package/lib/glb-viewer-58aa56b3.nomodule.js +0 -2
- package/lib/glb-viewer-camera-behaviour-1b347e77.nomodule.js.map +0 -1
- package/lib/glb-viewer-camera-behaviour-24e823bc.js.map +0 -1
- package/lib/glb-viewer-d4c6c346.js +0 -2
- package/lib/glb-viewer-main-64179adf.js +0 -2
- package/lib/glb-viewer-main-64179adf.js.map +0 -1
- package/lib/imos-ix-poc-export-helper-7b16b54e.js.map +0 -1
- package/lib/imos-ix-poc-export-helper-b7a91cdb.nomodule.js.map +0 -1
- package/lib/legacy/TextGeometry-778d127b.legacy.js +0 -2
- package/lib/legacy/camera-behaviour-b47dbdd3.legacy.js +0 -2
- package/lib/legacy/component-dimensioning-a3ba2ba6.legacy.js.map +0 -1
- package/lib/legacy/component-raycast-helper-a5178cda.legacy.js.map +0 -1
- package/lib/legacy/configurator-002d161a.legacy.js +0 -2
- package/lib/legacy/configurator-002d161a.legacy.js.map +0 -1
- package/lib/legacy/continuous-drawing-helper-654d7604.legacy.js +0 -2
- package/lib/legacy/continuous-drawing-helper-654d7604.legacy.js.map +0 -1
- package/lib/legacy/default-light-setting-af961df8.legacy.js +0 -2
- package/lib/legacy/default-light-setting-af961df8.legacy.js.map +0 -1
- package/lib/legacy/dimensioning-helper-4baa9955.legacy.js +0 -2
- package/lib/legacy/dimensioning-helper-4baa9955.legacy.js.map +0 -1
- package/lib/legacy/external-objects-2fd4ef1a.legacy.js +0 -2
- package/lib/legacy/external-objects-2fd4ef1a.legacy.js.map +0 -1
- package/lib/legacy/glb-viewer-camera-behaviour-4be0da6a.legacy.js.map +0 -1
- package/lib/legacy/glb-viewer-d3854b02.legacy.js +0 -2
- package/lib/legacy/imos-ix-poc-export-helper-ee70d653.legacy.js.map +0 -1
- package/lib/legacy/material-viewer-117426bc.legacy.js +0 -2
- package/lib/legacy/material-viewer-117426bc.legacy.js.map +0 -1
- package/lib/legacy/planner-f0a71818.legacy.js +0 -2
- package/lib/legacy/query-params-helper-e3e05119.legacy.js +0 -2
- package/lib/legacy/query-params-helper-e3e05119.legacy.js.map +0 -1
- package/lib/legacy/roomle-configurator-6db65c94.legacy.js +0 -2
- package/lib/legacy/roomle-configurator-6db65c94.legacy.js.map +0 -1
- package/lib/legacy/roomle-dependency-injection-058aa06f.legacy.js +0 -9
- package/lib/legacy/script-loader-9921991a.legacy.js.map +0 -1
- package/lib/legacy/static/ConfiguratorKernel-e0b064b9d4228a3b.wasm +0 -0
- package/lib/legacy/static/RoomleCore-e599a6ccf3dd7c2a.wasm +0 -0
- package/lib/legacy/static/RoomleToolsCore-83af26798774f70c.wasm +0 -0
- package/lib/legacy/stats-helper-c7bf779b.legacy.js.map +0 -1
- package/lib/legacy/tools-core-645fb16a.legacy.js.map +0 -1
- package/lib/material-viewer-8c7e05be.nomodule.js +0 -2
- package/lib/material-viewer-8c7e05be.nomodule.js.map +0 -1
- package/lib/material-viewer-d211106c.js +0 -2
- package/lib/material-viewer-d211106c.js.map +0 -1
- package/lib/material-viewer-main-9668a68c.js +0 -2
- package/lib/material-viewer-main-9668a68c.js.map +0 -1
- package/lib/planner-a30840a8.js +0 -2
- package/lib/planner-cb1acb4d.nomodule.js +0 -2
- package/lib/planner-main-5c76b2c2.js +0 -2
- package/lib/planner-main-5c76b2c2.js.map +0 -1
- package/lib/roomle-configurator-a11055fd.nomodule.js +0 -2
- package/lib/roomle-configurator-a11055fd.nomodule.js.map +0 -1
- package/lib/roomle-configurator-ab3900ec.js +0 -2
- package/lib/roomle-configurator-ab3900ec.js.map +0 -1
- package/lib/roomle-dependency-injection-22befdc7.nomodule.js +0 -9
- package/lib/roomle-sdk-3f72ba15.js.map +0 -1
- package/lib/script-loader-36a9dcdc.js.map +0 -1
- package/lib/script-loader-8e8886dd.nomodule.js.map +0 -1
- package/lib/static/ConfiguratorKernel-e0b064b9d4228a3b.wasm +0 -0
- package/lib/static/RoomleCore-e599a6ccf3dd7c2a.wasm +0 -0
- package/lib/static/RoomleToolsCore-83af26798774f70c.wasm +0 -0
- package/lib/stats-helper-1a0748a7.nomodule.js.map +0 -1
- package/lib/stats-helper-b5614bb9.js.map +0 -1
- package/lib/tools-core-43082fe5.js.map +0 -1
- package/lib/tools-core-a5f68507.nomodule.js.map +0 -1
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
System.register(["./script-loader-9921991a.legacy.js","./roomle-dependency-injection-058aa06f.legacy.js","./camera-behaviour-b47dbdd3.legacy.js","./main-thread-to-worker-da6ad96a.legacy.js","./roomle-configurator-6db65c94.legacy.js","./glb-viewer-camera-behaviour-4be0da6a.legacy.js","./external-objects-2fd4ef1a.legacy.js","./query-params-helper-e3e05119.legacy.js","./default-light-setting-af961df8.legacy.js"],(function(e,t){var n,a,i,r,s,o,l,c,h,d,g,m,u,_,p,C,v,f,w,b,P,E,M,I,S,O,y,D,H,j,A,x,L,B,k,R,V,T,F,W,K,U,N,G,z,Z,q,X,J,Q,Y,$,ee,te,ne,ae,ie,re,se,oe,le,ce,he,de,ge,me,ue,_e,pe,Ce,ve,fe,we,be,Pe,Ee,Me,Ie,Se,Oe,ye,De,He,je,Ae,xe,Le,Be,ke,Re,Ve,Te,Fe,We,Ke,Ue,Ne,Ge,ze,Ze,qe,Xe,Je,Qe,Ye,$e,et,tt;return{setters:[function(e){n=e.S,a=e.M},function(e){i=e.ah,r=e.E,s=e.o,o=e.F,l=e._,c=e.i,h=e.as,d=e.t,g=e.M,m=e.N,u=e.at,_=e.ad,p=e.l,C=e.S,v=e.au,f=e.av,w=e.aw,b=e.n,P=e.C,E=e.ax,M=e.w,I=e.W,S=e.ay,O=e.a1,y=e.az,D=e.aA,H=e.j,j=e.aB,A=e.aC,x=e.T,L=e.aD,B=e.a9,k=e.k,R=e.aE,V=e.aF,T=e.aG,F=e.aH,W=e.H,K=e.J,U=e.K,N=e.aI,G=e.aJ,z=e.aK,Z=e.aL,q=e.aM,X=e.Y,J=e.B,Q=e.aN,Y=e.aO,$=e.z,ee=e.U,te=e.u,ne=e.aP,ae=e.D,ie=e.L,re=e.aQ,se=e.R,oe=e.b},function(e){le=e.L,ce=e.b,he=e.d,de=e.B,ge=e.C,me=e.e,ue=e.T},function(e){_e=e.a,pe=e.A,Ce=e.C,ve=e.D,fe=e.V,we=e.al,be=e.bK,Pe=e.aK,Ee=e.bi,Me=e.h,Ie=e.x,Se=e.bW,Oe=e.b1,ye=e.aM,De=e.ak,He=e.H,je=e._,Ae=e.e,xe=e.k,Le=e.ax,Be=e.ay,ke=e.bq,Re=e.a0,Ve=e.aY,Te=e.ad,Fe=e.q,We=e.a$,Ke=e.c8,Ue=e.aN,Ne=e.c9,Ge=e.K,ze=e.aZ},function(e){Ze=e.S,qe=e.b,Xe=e.C,Je=e.P,Qe=e.c,Ye=e.R},function(e){$e=e.G},function(e){et=e.i,tt=e.a},function(){},function(){}],execute:function(){class nt extends le{constructor(e,t){super(e,t),this._center=new _e(0,0,0),this._params={ambientLight:{color:"#ffffff"},hemiLight:{color:"#ffffff"},mainDirLight:{direction:{x:2,y:1,z:2},color:"#ffffff"}},this._ambientLight=new pe(new Ce(this._params.ambientLight.color),.4),this._ambientLight.layers.set(1),this._mainDirLight=new ve(new Ce(this._params.mainDirLight.color),.5),this._mainDirLight.castShadow=!0,this._mainDirLight.shadow.camera.near=.5,this._mainDirLight.shadow.camera.far=100,this._mainDirLight.shadow.mapSize=new fe(1024,1024),this._mainDirLight.visible=!0,this.addToScene()}updateSunPosition(e,t){}addToScene(){this._scene.add(this._mainDirLight),this._scene.add(this._ambientLight),this._scene.add(this._mainDirLight.target)}removeFromScene(){this._scene.remove(this._mainDirLight),this._scene.remove(this._ambientLight),this._scene.remove(this._mainDirLight.target)}reload(){this.removeFromScene(),this.addToScene()}needsBounds(){return!0}updateBounds(e){this._center.copy(e.getCenter(new _e));const t=new we;e.getBoundingSphere(t);const n=t.radius,a=new _e(this._params.mainDirLight.direction.x,this._params.mainDirLight.direction.y,this._params.mainDirLight.direction.z);a.normalize(),a.multiplyScalar(n),this._mainDirLight.position.copy(this._center),this._mainDirLight.position.add(a),this._mainDirLight.target.position.copy(this._center),this._mainDirLight.target.updateMatrixWorld(!0),this._mainDirLight.shadow.camera.top=n,this._mainDirLight.shadow.camera.bottom=-n,this._mainDirLight.shadow.camera.left=-n,this._mainDirLight.shadow.camera.right=n,this._mainDirLight.shadow.camera.near=.01,this._mainDirLight.shadow.camera.far=2*n,this._mainDirLight.shadow.camera.updateProjectionMatrix()}showGUI(){let e=i();if(e){if(this._ambientLight){let t=e.addFolder("Ambient Light");t.add(this._ambientLight,"visible"),t.add(this._ambientLight,"intensity").min(0).max(5).step(.1),t.addColor(this._params.ambientLight,"color").onChange(e=>this._ambientLight.color=new Ce(e))}if(this._hemiLight){let t=e.addFolder("Hemi Light");t.add(this._hemiLight,"visible"),t.add(this._hemiLight,"intensity").min(0).max(5).step(.1),t.addColor(this._params.hemiLight,"color").onChange(e=>this._hemiLight.color=new Ce(e))}if(this._mainDirLight){let t=e.addFolder("Main Directional Light");t.add(this._mainDirLight,"visible"),t.add(this._mainDirLight,"intensity").min(0).max(10).step(.1),t.add(this._mainDirLight,"castShadow"),t.addColor(this._params.mainDirLight,"color").onChange(e=>this._mainDirLight.color=new Ce(e)),t.add(this._mainDirLight.position,"x").min(-10).max(10).step(.1).onChange(()=>this._mainDirLight.lookAt(this._center)),t.add(this._mainDirLight.position,"y").min(-10).max(50).step(.1).onChange(()=>this._mainDirLight.lookAt(this._center)),t.add(this._mainDirLight.position,"z").min(-10).max(10).step(.1).onChange(()=>this._mainDirLight.lookAt(this._center))}}}}const at=e=>e instanceof s||e instanceof o;class it{constructor(e){const{planElementViewModel:t,planElementViewModels:n,selectionMode:a,reason:i}=e;this.planElementViewModel=t,this.planElementViewModels=n,this.selectionMode=a,this.reason=i}}class rt{constructor(e){const{planElementViewModel:t,resetCamera:n,state:a,oldState:i,reason:r}=e;this.planElementViewModel=t,this.resetCamera=void 0===n||n,this.state=void 0===a?0:a,this.oldState=void 0===i?0:i,this.reason=r}}class st extends Ze{constructor(e,t,n,a){super(e,t,n,a),this._isDrawingEnabled=!1,this._isCurrentlyDrawing=!1,this._isMeasurementLineDrawActive=!1,this._state=0,this._inputManager.addEventListener(4,()=>this._position=null,this),this._raycastHelper.setMode(0),this._raycastHelper.addEventListener(0,()=>{2!==this._state?this._plannerSelectionHandler.cancelSelection("click_outside"):this.resetState()},this),this._plannerSelectionHandler.addEventListener(0,({planElementViewModel:e})=>{this.dispatchEvent(this.isDragIn()?19:0,new rt({planElementViewModel:e}))},this),this._plannerSelectionHandler.addEventListener(2,({planElementViewModels:e})=>{this._roomlePlannerUiCallback.onMultiSelectionChange(e)},this),this._plannerSelectionHandler.addEventListener(3,({selectionMode:e})=>{"multiselect"===e&&this._hoveredObject&&this._hoverOnMultiSelect(this._hoveredObject),this._roomlePlannerUiCallback.onSelectionModeChange(e),this._checkRaycasterSnapping()},this),this._plannerSelectionHandler.addEventListener(1,({planElementViewModel:e,reason:t})=>{1!==this._state&&this.setState(0),this.dispatchEvent(1,new rt({planElementViewModel:e,reason:t}))},this),this._inputManager.addEventListener(6,e=>this._move(e),this)}disable(){const e=new be;e.disableAll(),this._raycastHelper.setLayers(e),this._raycastHelper.disableEvents()}get planInteractionHandler(){var e;return null===(e=this._plannerKernelAccess)||void 0===e?void 0:e.planInteractionHandler}get hoveredObjectId(){var e;return(null===(e=this._hoveredObject)||void 0===e?void 0:e.getPlanElement())?this._hoveredObject.getId():null}get isCurrentlyDrawing(){return this._isCurrentlyDrawing}enable(){const e=new be;e.disableAll(),e.enable(3),e.enable(7),e.enable(6),e.enable(9),e.enable(2),this._raycastHelper.setLayers(e),this._raycastHelper.enableEvents()}enableConstructionEvents(e){e?this._raycastHelper.getLayers().enable(9):this._raycastHelper.getLayers().disable(9)}enableObjectEvents(e){e?this._raycastHelper.getLayers().enable(6):this._raycastHelper.getLayers().disable(6)}getSelectionMode(){return this._plannerSelectionHandler.getSelectionMode()}addConstructionPlanObjectHandlers(e,t){t||(t=e.getBoundingBox());const n={planElementName:e.getName(),hasListener:!0,priority:qe.CONSTRUCTION,roomleId:e.getId(),snapToWall:!0};this._addPlanObjectHandlers(e,t,n)}addPlanObjectHandlers(e,t){t||(t=e.getBoundingBox());const n={planElementName:e.getName(),hasListener:!0,priority:qe.DEFAULT,roomleId:e.getId()};this._addPlanObjectHandlers(e,t,n)}addWallHandlers(e){this._addPlanElementHandlers(e,e.getBoundingBox(),{planElementName:e.getName(),hasListener:!0,priority:qe.WALL,roomleId:e.getId()})}addWallAtticHandlers(e){this._addPlanElementHandlers(e,e.getBoundingBox(),{planElementName:e.getName(),hasListener:!0,priority:qe.WALL,roomleId:e.getId()})}addMeasurementLineHandlers(e){const t={planElementName:e.getName(),hasListener:!0,priority:qe.DEFAULT,roomleId:e.getId()};this._addMeasurementLinePlanElementHandlers(e,e.getPoint1DraggableBoundingBox(),t,h.POINT1),this._addMeasurementLinePlanElementHandlers(e,e.getPoint2DraggableBoundingBox(),t,h.POINT2),this._addMeasurementLinePlanElementHandlers(e,e.getBoundingBox(),t,null)}addFloorHandlers(e){this._addFloorElementHandlers(e,e.getObject(),{planElementName:e.getName(),hasListener:!0,priority:qe.FLOOR,roomleId:e.getId()})}addNodeHandlers(e){this._addPlanElementHandlers(e,e.getBoundingBox(),{planElementName:e.getName(),hasListener:!0,priority:qe.DEFAULT,roomleId:e.getId()})}_addPlanObjectHandlers(e,t,n){t.userData.hasListener||(t.userData=Pe(t.userData,n),t.addEventListener("select",()=>this._clickElement(e)),t.addEventListener("drag_start",()=>this._dragStart(e)),t.addEventListener("drag",t=>this._drag(e,t.attachment.position)),t.addEventListener("drag_end",t=>this._dragEnd(e,t.attachment.position)),t.addEventListener("hover_on",()=>this._hoverOn(e)),t.addEventListener("hover_off",()=>this._hoverOff(e)),t.addEventListener("rotate",t=>this._rotate(e,t.attachment.rotation)))}_addFloorElementHandlers(e,t,n){this._addElementHandlers(e,t,n)}_addElementHandlers(e,t,n){t.userData.hasListener||(t.userData=Pe(t.userData,n),t.addEventListener("select",()=>this._clickElement(e)),t.addEventListener("double_click",t=>{var n;this._doubleClickElement(e,t.attachment.type,null===(n=t.attachment.intersection)||void 0===n?void 0:n.point)}),t.addEventListener("hover_on",()=>this._hoverOn(e)),t.addEventListener("hover_off",()=>this._hoverOff(e)))}_addPlanElementHandlers(e,t,n){t.userData.hasListener||(this._addElementHandlers(e,t,n),t.addEventListener("drag_start",()=>this._dragStart(e)),t.addEventListener("drag",t=>this._drag(e,t.attachment.position)),t.addEventListener("drag_end",t=>this._dragEnd(e,t.attachment.position)))}_addMeasurementLinePlanElementHandlers(e,t,n,a){if(t.userData.hasListener)return;t.userData=Pe(t.userData,n);const i=()=>{e.currentPoint=a};t.addEventListener("select",()=>{this._clickElement(e),i()}),t.addEventListener("drag_start",()=>{i(),e.selectPointOnDragStart(e),this._dragStart(e)}),t.addEventListener("drag",t=>{i(),e.hideDraggablePointsOnDragStart(e,a),this._drag(e,t.attachment.position)}),t.addEventListener("drag_end",t=>{e.showDraggablePointsOnDragEnd(e,a),this._dragEnd(e,t.attachment.position),e.showDraggableNodes(),i()}),t.addEventListener("hover_on",()=>{i(),e.showDraggablePointsOnHoverOn(e),this._hoverOn(e)}),t.addEventListener("hover_off",()=>{i(),e.showDraggablePointsOnHoverOff(e),this._hoverOff(e)})}_createFloorMeshWithHandler(){const e=new Ee(1e3,1e3,8,8),t=new Me;t.visible=!1;const n=new Ie(e,t);n.name="2D raycaster floor mesh",n.rotation.set(-Math.PI/2,0,0),n.layers.enable(2),n.userData.ignoreElementHit=!0;const a={planElementName:"2D raycaster floor mesh",hasListener:!0,priority:qe.RAYCASTER_FLOOR,roomleId:void 0};return n.userData=Pe(n.userData,a),n.addEventListener("double_click",e=>{this._doubleClickOnPlane(d(e.attachment.intersection.point),e.attachment.type)}),n.addEventListener("select",e=>{const t=d(e.attachment.intersection.point);this._isCurrentlyDrawing?this._clickOnPlane(t):this._plannerSelectionHandler.cancelSelection("click_outside")}),n}_clickOnPlane(e){this._createNode(null,e)}_doubleClickOnPlane(e,t=0){this._isMeasurementLineDrawActive||(this._closeToPoint(e)?this.stopDrawing():this._toggleDrawing(null,e,t))}_closeToPoint(e){let t=!1;for(const n of this._planViewModel.getNodePlanObjectViewModels())this._close(n.getPlanElement().getCenter(),e)&&(t=!0);return t}_close(e,t){return Math.abs(e.x-t.x)<500&&Math.abs(e.y-t.y)<500&&Math.abs(e.z-t.z)<500}_clickElement(e){wt(e,this._initData)?this._plannerSelectionHandler.cancelSelection("click_outside"):this._isCurrentlyDrawing||(e instanceof g&&e.handleDraggablePointsSelection(e),this._debug&&e.getId(),2!==this._state?(this._plannerSelectionHandler.check(e),this._roomlePlannerUiCallback.onClickElement(e),this._setCursor()):this.resetState())}_doubleClickElement(e,t=0,n){if(!this._isDrawingEnabled||!(e instanceof m||e instanceof s))return;let a;this._debug&&e.getId(),e instanceof s&&this._plannerSelectionHandler.cancelSelection("double_click_wall"),e instanceof m?a=e.getPlanElement().getCenter():n&&(a=d(new _e(n.x,0,n.z))),this._isCurrentlyDrawing?this.endWallDrawing(null,a):this._startWallDrawing(null,a,t)}_hoverOn(e){e instanceof g&&e.showDraggablePointsOnHoverOn(e),this._isCurrentlyDrawing||("multiselect"===this._plannerSelectionHandler.getSelectionMode()?this._hoverOnMultiSelect(e):this._hoverOnStandard(e))}_hoverOnMultiSelect(e){at(this._hoveredObject)||at(e)?(this._hoveredObject=null,Se("default")):this._hoverOnStandard(e)}_hoverOnStandard(e){e.hoverOn(),this._hoveredObject=e,this.dispatchEvent(3,new rt({planElementViewModel:e})),this._interaction(),this._setCursor()}_hoverOff(e){e.hoverOff(),e instanceof g&&e.showDraggablePointsOnHoverOff(e),this.dispatchEvent(4,new rt({planElementViewModel:e})),this._interaction(),this._hoveredObject=null,this._setCursor()}_isHoveredObjectNonDraggable(){return this._hoveredObject instanceof o}_setCursor(){4===this._state?Se("crosshair"):2===this._state&&this._hasSelection()?Se("ew-resize"):1===this._state?Se("grabbing"):!this._isHoveredObjectNonDraggable&&this._plannerSelectionHandler.isSelected(this.hoveredObjectId)?Se("move"):this._hoveredObject?wt(this._hoveredObject,this._initData)?Se("default"):Se("pointer"):3===this._state?Se(u?"url('https://res.cloudinary.com/roomle/image/upload/v1664957371/pencil_j5vkhm.svg') 0 15, auto":"url('https://res.cloudinary.com/roomle/image/upload/v1664957371/pencil_j5vkhm.svg') 3 20, auto"):Se("default")}setCamera(e){this._raycastHelper.setCamera(e)}setObject(e){this._raycastHelper.setObject(e)}getSelectedIds(){return this._plannerSelectionHandler.getSelectedIds()}setSelectionMode(e){this._plannerSelectionHandler.setSelectionMode(e),"multiselect"===e&&this._roomlePlannerUiCallback.onMultiSelectionChange(this._plannerSelectionHandler.getSelectedPlanElementViewModels())}setPlanViewModel(e){this._planViewModel=e}cancelSelection(e){this.isDragIn()&&"dock_component"===e||this._plannerSelectionHandler.cancelSelection(e)}removeSelection(){this._plannerSelectionHandler.removeSelection()}_dragStart(e){this._isMeasurementLineDrawActive||((this._plannerSelectionHandler.isSelected(e.getId())||this._dragIn)&&0===this._state||this._isDrawingEnabled)&&(this.dispatchEvent(8),Oe(w.DRAG).then(()=>{if(this._inputManager.isMouseUp())return this.setState(0),Se("pointer"),void this.dispatchEvent(12);this._draggedObject=e,this.setState(1),this._roomlePlannerUiCallback.onDragElementStart(e.getId()),this.dispatchEvent(9,new rt({planElementViewModel:e}))}))}_drag(e,t){if(!this._draggedObject||1!==this._state)return;const n=this.planInteractionHandler;if(this._plannerSelectionHandler.getSelectedIds().length>1){const e=new this._plannerKernelAccess.kernelContainer.PlanObjectPtrList;this._lastDragPosition||(this._lastDragPosition=t);let a=t.clone().sub(this._lastDragPosition);this._plannerSelectionHandler.getSelectedIds().forEach(t=>e.push_back(this._planViewModel.getPlanObjectForId(t).getPlanElement()));const i=d(a);this._plannerSelectionHandler.hasMultiSelection()&&(i.z=0),n.moveObjectsBy(e,i),this._lastDragPosition.copy(t)}else e instanceof g?this._dragMeasurementLine(e,t):((e instanceof m||e instanceof s||this._planViewModel.cameraType===ye.CAMERA_2D)&&(t.y=_(e.getPlanElement().getCenter()).y),n.moveElementTo(e.getPlanElement(),d(t)));this.dispatchEvent(10,new rt({planElementViewModel:e}))}_dragEnd(e,t){this._draggedObject&&(this._draggedObject=null,this._lastDragPosition=null,this.setState(0),this.dispatchEvent(11,new rt({planElementViewModel:e})),this._dragIn&&this.setDragIn(!1),this._roomlePlannerUiCallback.onDragElementEnd(),this._setCursor())}_rotate(e,t){if(this._plannerSelectionHandler.isSelected(e.getId())){const n=this.planInteractionHandler,a=e.getPlanObject();n.setObjectRotation(e.getPlanElement(),a.rotation-t)}}setState(e){var t,n;const a=this._state;this._state=e,this._setCursor(),this.dispatchEvent(2,new rt({state:this._state,oldState:a})),this._position=null,2===this._state?null===(t=this.planInteractionHandler)||void 0===t||t.deactivateAllSnappingActivity():2===a&&(null===(n=this.planInteractionHandler)||void 0===n||n.reactivateAllSnappingActivity())}resetState(){this.setState(0)}_move(e){if(3!==this._state&&4!==this._state&&2===this._state&&this._hasSelection()){this._setCursor();let t=Math.PI/180;const{x:n,y:a}=e.positionRelative;this._position?t=1.4*e.positionRelative.x*Math.PI-1.4*this._position.x*Math.PI:this._position=new _e(e.positionRelative.x,e.positionRelative.y,0);const i=new this._plannerKernelAccess.kernelContainer.PlanObjectPtrList,r=new De;this.getSelectedIds().forEach(e=>{var t;const n=null===(t=this._planViewModel)||void 0===t?void 0:t.getPlanObjectForId(e);n&&n.getObject()&&(i.push_back(n.getPlanElement()),r.expandByObject(n.getContainer()))});const s=r.getCenter(new _e);this.planInteractionHandler.rotateObjectsBy(i,t,d(s)),this._position.copy(new _e(n,a,0))}}_hasSelection(){return this._plannerSelectionHandler.getSelectedIds().length>0}async selectPlanElement(e){(e instanceof p||e instanceof C)&&await e.isInitDone(),this._plannerSelectionHandler.check(e)}_interaction(e){this.dispatchEvent(13,new rt({}))}addComponentDragInHandler(e){if(!this._dragIn)return;const t=e.getBoundingBox(),n=e instanceof b||e instanceof P;this._addPlanElementHandlers(e,t,{planElementName:e.getName(),hasListener:!0,priority:qe.DEFAULT,roomleId:e.getId(),snapToWall:n}),this._raycastHelper.enableDragIn(t),this._dragStart(e)}enableSnapping(){this.planInteractionHandler.enableSnap=!0,this._checkRaycasterSnapping()}disableSnapping(){this.planInteractionHandler.enableSnap=!1,this._checkRaycasterSnapping()}enableAdvancedDocking(){this.planInteractionHandler.dockWhenSnap=!0}disableAdvancedDocking(){this.planInteractionHandler.dockWhenSnap=!1}showsChildrenOfPlanObject(e){return this.planInteractionHandler.getShowChildrenOfPlanObject(e).value!==v.OFF}enableShowChildrenOfPlanObject(e){this.planInteractionHandler.setShowChildrenOfPlanObject(e,{value:v.GROUND_COMPONENTS},!1)}disableShowChildrenOfPlanObject(e){this.planInteractionHandler.setShowChildrenOfPlanObject(e,{value:v.OFF},!1)}_checkRaycasterSnapping(){const e=this.planInteractionHandler.enableSnap,t="multiselect"===this.getSelectionMode();e&&!t?this._raycastHelper.enableOnWallSnapping():this._raycastHelper.disableOnWallSnapping()}enableWallDrawing(){return this._isDrawingEnabled=!0,this._drawingGroup=new He,this._drawingGroup.name="Drawing",this._drawingGroup.add(this._createFloorMeshWithHandler()),this._inputManager.addEventListener(6,this._drawWallOnMouseMove,this),this._inputManager.addEventListener(13,this.endWallDrawing,this),this._drawingGroup}cancelWallDrawing(){return this._isDrawingEnabled=!1,this._setStateAndCursor(0),this._inputManager.removeEventListener(6,this._drawWallOnMouseMove),this._inputManager.removeEventListener(13,this.endWallDrawing),this._raycastHelper.clear(),this._drawingGroup}stopDrawing(e=!0){var t;this.planInteractionHandler.endInteraction(),e&&this.planInteractionHandler.cancelDrawing(),this._raycastHelper.getLayers().enable(9),this._isCurrentlyDrawing=!1,this._setStateAndCursor(0),this.dispatchEvent(7),null===(t=this._continuousDrawingHelper)||void 0===t||t.endDrawing(),this._roomlePlannerUiCallback.onDrawingStateChanged(!1)}startDrawing(){var e;this._isCurrentlyDrawing||(this._isCurrentlyDrawing=!0,this._raycastHelper.getLayers().disable(9),this.dispatchEvent(6),this._setStateAndCursor(3),null===(e=this._continuousDrawingHelper)||void 0===e||e.update(),this._roomlePlannerUiCallback.onDrawingStateChanged(!0))}_toggleDrawing(e,t,n){this._isCurrentlyDrawing?this.endWallDrawing(e,t):this._startWallDrawing(e,t,n)}endWallDrawing(e,t){if(this._isCurrentlyDrawing){if(this.planInteractionHandler.getContinuousDrawingManager().shouldShowCircle()&&this.planInteractionHandler.getContinuousDrawingManager().shouldShowCircle())this.planInteractionHandler.cancelDrawing();else{const{x:n,y:a}=t||this._getIntersectionPointWithScene(e);this.planInteractionHandler.endDrawing({x:n,y:a,z:0})}this.stopDrawing(!1)}}async _startWallDrawing(e,t,n){var a,i;(e&&2===e.type||2===n)&&(await this._initMobileDrawing(),this._continuousDrawingHelper.update()),this.planInteractionHandler.startInteraction();const{x:r,y:s}=t||this._getIntersectionPointWithScene(e),o=(null===(i=null===(a=this._initData)||void 0===a?void 0:a.featureFlags)||void 0===i?void 0:i.drawPreviewMode)===f.VECTOR;this.planInteractionHandler.beginDrawing({x:r,y:s,z:0},o),this.startDrawing()}async _initMobileDrawing(){if(this.planInteractionHandler.setDrawingType(0),this.planInteractionHandler.setSnapFeedbackWhileDrawing(!0),!this._continuousDrawingHelper){const{default:e}=await t.import("./continuous-drawing-helper-654d7604.legacy.js");this._continuousDrawingHelper=new e,this._continuousDrawingHelper.init(this._drawingGroup,this.planInteractionHandler.getContinuousDrawingManager(),this._kernelZoomFactor)}}_drawWallOnMouseMove(e){var t;if(!this._isCurrentlyDrawing||this._isMeasurementLineDrawActive)return;const{x:n,y:a}=this._getIntersectionPointWithScene(e);this.planInteractionHandler.currentDrawingPosition({x:n,y:a,z:0}),null===(t=this._continuousDrawingHelper)||void 0===t||t.update(),this.dispatchEvent(5)}_createNode(e,t){if(!this._isCurrentlyDrawing)return;const{x:n,y:a}=t||this._getIntersectionPointWithScene(e);this.planInteractionHandler.forceNode({x:n,y:a,z:0}),this._raycastHelper.clear()}_getIntersectionPointWithScene(e){return this._raycastHelper.intersectMouseOnScene(e)}_setStateAndCursor(e){this.setState(e),this._setCursor()}setKernelZoomFactor(e){var t;this._kernelZoomFactor=e,null===(t=this._continuousDrawingHelper)||void 0===t||t.setKernelZoomFactor(e)}enableMeasurementLineDrawing(){this._setStateAndCursor(4),this._isMeasurementLineDrawActive=!0,this._enableDrawingListeners()}disableMeasurementLineDrawing(){this._disableDrawingListeners(),this.dispatchEvent(17),this.setState(0),this._isMeasurementLineDrawActive=!1,this._currentPlanMeasure=null}_handleMeasurementLineDrawingEvent(e){return 6===e?this._drawMeasurementLineOnMouseMove:5===e||14===e||13===e?this._createPlanMeasure:null}_enableDrawingListeners(){[5,6,14,13].forEach(e=>{this._inputManager.addEventListener(e,this._handleMeasurementLineDrawingEvent(e),this)})}_disableDrawingListeners(){[5,6,14,13].forEach(e=>{this._inputManager.removeEventListener(e,this._handleMeasurementLineDrawingEvent(e))})}_drawMeasurementLineOnMouseMove(e){if(!this._currentPlanMeasure)return;4!==this._state&&this._setStateAndCursor(4);const{x:t,y:n}=this._getIntersectionPointWithScene(e);this.planInteractionHandler.setMeasurePoint2(this._currentPlanMeasure,{x:t,y:n,z:0},!0,!0)}_updateMeasurementLineViewModels(e){"hide_dragged_node"===e?this._planViewModel.getMeasurementLineObjectViewModels().forEach(e=>{this._currentPlanMeasure.getId()===e.getId()&&e.hidePoint2DraggableNode()}):"showDraggableNodes"===e&&this._planViewModel.getMeasurementLineObjectViewModels().forEach(e=>{this._currentPlanMeasure.getId()===e.getId()&&(e.showDraggableNodes(),e.showDraggablePointsOnDragEnd(e,"point2"))})}_createPlanMeasure(e){const{x:t,y:n}=this._getIntersectionPointWithScene(e),a={x:t,y:n,z:0};if(!this._currentPlanMeasure)return this.dispatchEvent(16),this._currentPlanMeasure=this.planInteractionHandler.addMeasure(a,a),void this._updateMeasurementLineViewModels("hide_dragged_node");this.planInteractionHandler.setMeasurePoint2(this._currentPlanMeasure,a,!0,!0),this._updateMeasurementLineViewModels("showDraggableNodes"),this.disableMeasurementLineDrawing()}_dragMeasurementLine(e,t){const n=e.getPlanElement();if(!e.currentPoint){if(!this._lastDragPosition)return void(this._lastDragPosition=t.clone());const a=t.clone().sub(this._lastDragPosition),i=_(n.getCenter()).add(a);return this.planInteractionHandler.moveElementTo(n,d(i)),this._lastDragPosition.copy(t),e.update(),void this.dispatchEvent(18)}e.currentPoint===h.POINT1&&this.planInteractionHandler.setMeasurePoint1(n,d(t),!0,!0),e.currentPoint===h.POINT2&&this.planInteractionHandler.setMeasurePoint2(n,d(t),!0,!0)}setMeasurementLineLength(e,t,n){if(!e)return void console.error("Measurement line not found");const a=t/1e3,i="left"===n.toLowerCase(),r=i?e.getPoint2Draggable().position.clone():e.getPoint1Draggable().position.clone(),s=(new _e).subVectors(e.getPoint2Draggable().position,e.getPoint1Draggable().position).normalize().multiplyScalar(a),o=i?r.sub(s):r.add(s);i?this.planInteractionHandler.setMeasurePoint1(e.getPlanElement(),d(o),!1,!1):this.planInteractionHandler.setMeasurePoint2(e.getPlanElement(),d(o),!1,!1)}}l([c],st.prototype,"_plannerSelectionHandler",void 0),l([c],st.prototype,"_plannerKernelAccess",void 0),l([c],st.prototype,"_roomlePlannerUiCallback",void 0),l([c],st.prototype,"_initData",void 0);const ot=(e,t,n,a)=>{const i=(new De).setFromObject(e.getContainer()).getCenter(new _e);return{runtimeIds:[e.getId()],position2d:E(M(i,t,n,a))}},lt=e=>{if(e instanceof C){const t=e.getPlanObject().getObjectType();return"door"!==t&&"window"!==t?"static":t}return e instanceof p?"configuration":e instanceof s?"wall":e instanceof o?"floor":e instanceof g?"measure":e instanceof I?"attic":"unknown"};var ct=function(e){function t(){var e;xe(this,t);var n=t.SkyShader,a=new Le({name:n.name,uniforms:Be.clone(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:ke,depthWrite:!1});return(e=Re(this,t,[new Ve(1,1,1),a])).isSky=!0,e}return je(t,e),Ae(t)}(Ie);ct.SkyShader={name:"SkyShader",uniforms:{turbidity:{value:2},rayleigh:{value:1},mieCoefficient:{value:.005},mieDirectionalG:{value:.8},sunPosition:{value:new _e},up:{value:new _e(0,1,0)}},vertexShader:"\n\t\tuniform vec3 sunPosition;\n\t\tuniform float rayleigh;\n\t\tuniform float turbidity;\n\t\tuniform float mieCoefficient;\n\t\tuniform vec3 up;\n\n\t\tvarying vec3 vWorldPosition;\n\t\tvarying vec3 vSunDirection;\n\t\tvarying float vSunfade;\n\t\tvarying vec3 vBetaR;\n\t\tvarying vec3 vBetaM;\n\t\tvarying float vSunE;\n\n\t\t// constants for atmospheric scattering\n\t\tconst float e = 2.71828182845904523536028747135266249775724709369995957;\n\t\tconst float pi = 3.141592653589793238462643383279502884197169;\n\n\t\t// wavelength of used primaries, according to preetham\n\t\tconst vec3 lambda = vec3( 680E-9, 550E-9, 450E-9 );\n\t\t// this pre-calculation replaces older TotalRayleigh(vec3 lambda) function:\n\t\t// (8.0 * pow(pi, 3.0) * pow(pow(n, 2.0) - 1.0, 2.0) * (6.0 + 3.0 * pn)) / (3.0 * N * pow(lambda, vec3(4.0)) * (6.0 - 7.0 * pn))\n\t\tconst vec3 totalRayleigh = vec3( 5.804542996261093E-6, 1.3562911419845635E-5, 3.0265902468824876E-5 );\n\n\t\t// mie stuff\n\t\t// K coefficient for the primaries\n\t\tconst float v = 4.0;\n\t\tconst vec3 K = vec3( 0.686, 0.678, 0.666 );\n\t\t// MieConst = pi * pow( ( 2.0 * pi ) / lambda, vec3( v - 2.0 ) ) * K\n\t\tconst vec3 MieConst = vec3( 1.8399918514433978E14, 2.7798023919660528E14, 4.0790479543861094E14 );\n\n\t\t// earth shadow hack\n\t\t// cutoffAngle = pi / 1.95;\n\t\tconst float cutoffAngle = 1.6110731556870734;\n\t\tconst float steepness = 1.5;\n\t\tconst float EE = 1000.0;\n\n\t\tfloat sunIntensity( float zenithAngleCos ) {\n\t\t\tzenithAngleCos = clamp( zenithAngleCos, -1.0, 1.0 );\n\t\t\treturn EE * max( 0.0, 1.0 - pow( e, -( ( cutoffAngle - acos( zenithAngleCos ) ) / steepness ) ) );\n\t\t}\n\n\t\tvec3 totalMie( float T ) {\n\t\t\tfloat c = ( 0.2 * T ) * 10E-18;\n\t\t\treturn 0.434 * c * MieConst;\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\tvec4 worldPosition = modelMatrix * vec4( position, 1.0 );\n\t\t\tvWorldPosition = worldPosition.xyz;\n\n\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t\t\tgl_Position.z = gl_Position.w; // set z to camera.far\n\n\t\t\tvSunDirection = normalize( sunPosition );\n\n\t\t\tvSunE = sunIntensity( dot( vSunDirection, up ) );\n\n\t\t\tvSunfade = 1.0 - clamp( 1.0 - exp( ( sunPosition.y / 450000.0 ) ), 0.0, 1.0 );\n\n\t\t\tfloat rayleighCoefficient = rayleigh - ( 1.0 * ( 1.0 - vSunfade ) );\n\n\t\t\t// extinction (absorption + out scattering)\n\t\t\t// rayleigh coefficients\n\t\t\tvBetaR = totalRayleigh * rayleighCoefficient;\n\n\t\t\t// mie coefficients\n\t\t\tvBetaM = totalMie( turbidity ) * mieCoefficient;\n\n\t\t}",fragmentShader:"\n\t\tvarying vec3 vWorldPosition;\n\t\tvarying vec3 vSunDirection;\n\t\tvarying float vSunfade;\n\t\tvarying vec3 vBetaR;\n\t\tvarying vec3 vBetaM;\n\t\tvarying float vSunE;\n\n\t\tuniform float mieDirectionalG;\n\t\tuniform vec3 up;\n\n\t\t// constants for atmospheric scattering\n\t\tconst float pi = 3.141592653589793238462643383279502884197169;\n\n\t\tconst float n = 1.0003; // refractive index of air\n\t\tconst float N = 2.545E25; // number of molecules per unit volume for air at 288.15K and 1013mb (sea level -45 celsius)\n\n\t\t// optical length at zenith for molecules\n\t\tconst float rayleighZenithLength = 8.4E3;\n\t\tconst float mieZenithLength = 1.25E3;\n\t\t// 66 arc seconds -> degrees, and the cosine of that\n\t\tconst float sunAngularDiameterCos = 0.999956676946448443553574619906976478926848692873900859324;\n\n\t\t// 3.0 / ( 16.0 * pi )\n\t\tconst float THREE_OVER_SIXTEENPI = 0.05968310365946075;\n\t\t// 1.0 / ( 4.0 * pi )\n\t\tconst float ONE_OVER_FOURPI = 0.07957747154594767;\n\n\t\tfloat rayleighPhase( float cosTheta ) {\n\t\t\treturn THREE_OVER_SIXTEENPI * ( 1.0 + pow( cosTheta, 2.0 ) );\n\t\t}\n\n\t\tfloat hgPhase( float cosTheta, float g ) {\n\t\t\tfloat g2 = pow( g, 2.0 );\n\t\t\tfloat inverse = 1.0 / pow( 1.0 - 2.0 * g * cosTheta + g2, 1.5 );\n\t\t\treturn ONE_OVER_FOURPI * ( ( 1.0 - g2 ) * inverse );\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\tvec3 direction = normalize( vWorldPosition - cameraPosition );\n\n\t\t\t// optical length\n\t\t\t// cutoff angle at 90 to avoid singularity in next formula.\n\t\t\tfloat zenithAngle = acos( max( 0.0, dot( up, direction ) ) );\n\t\t\tfloat inverse = 1.0 / ( cos( zenithAngle ) + 0.15 * pow( 93.885 - ( ( zenithAngle * 180.0 ) / pi ), -1.253 ) );\n\t\t\tfloat sR = rayleighZenithLength * inverse;\n\t\t\tfloat sM = mieZenithLength * inverse;\n\n\t\t\t// combined extinction factor\n\t\t\tvec3 Fex = exp( -( vBetaR * sR + vBetaM * sM ) );\n\n\t\t\t// in scattering\n\t\t\tfloat cosTheta = dot( direction, vSunDirection );\n\n\t\t\tfloat rPhase = rayleighPhase( cosTheta * 0.5 + 0.5 );\n\t\t\tvec3 betaRTheta = vBetaR * rPhase;\n\n\t\t\tfloat mPhase = hgPhase( cosTheta, mieDirectionalG );\n\t\t\tvec3 betaMTheta = vBetaM * mPhase;\n\n\t\t\tvec3 Lin = pow( vSunE * ( ( betaRTheta + betaMTheta ) / ( vBetaR + vBetaM ) ) * ( 1.0 - Fex ), vec3( 1.5 ) );\n\t\t\tLin *= mix( vec3( 1.0 ), pow( vSunE * ( ( betaRTheta + betaMTheta ) / ( vBetaR + vBetaM ) ) * Fex, vec3( 1.0 / 2.0 ) ), clamp( pow( 1.0 - dot( up, vSunDirection ), 5.0 ), 0.0, 1.0 ) );\n\n\t\t\t// nightsky\n\t\t\tfloat theta = acos( direction.y ); // elevation --\x3e y-axis, [-pi/2, pi/2]\n\t\t\tfloat phi = atan( direction.z, direction.x ); // azimuth --\x3e x-axis [-pi/2, pi/2]\n\t\t\tvec2 uv = vec2( phi, theta ) / vec2( 2.0 * pi, pi ) + vec2( 0.5, 0.0 );\n\t\t\tvec3 L0 = vec3( 0.1 ) * Fex;\n\n\t\t\t// composition + solar disc\n\t\t\tfloat sundisk = smoothstep( sunAngularDiameterCos, sunAngularDiameterCos + 0.00002, cosTheta );\n\t\t\tL0 += ( vSunE * 19000.0 * Fex ) * sundisk;\n\n\t\t\tvec3 texColor = ( Lin + L0 ) * 0.04 + vec3( 0.0, 0.0003, 0.00075 );\n\n\t\t\tvec3 retColor = pow( texColor, vec3( 1.0 / ( 1.2 + ( 1.2 * vSunfade ) ) ) );\n\n\t\t\tgl_FragColor = vec4( retColor, 1.0 );\n\n\t\t\t#include <tonemapping_fragment>\n\t\t\t#include <colorspace_fragment>\n\n\t\t}"};const ht=async(e,t,n)=>{const{objects:a,itemIds:i,configurationIds:r}=await(async(e,t)=>{const n=[],a=[],i=[];return await Promise.all(e.map(async e=>{var r;if((null===(r=e.configurationType)||void 0===r?void 0:r.value)!==S.EXTERNAL){const r=O(e);if(r.configurationHash?i.push(r.configurationHash):r.catalogItemId&&a.push(r.catalogItemId),r.parts){const e=r.configurationHash||r.catalogItemId;r.parts=await t.addUiDataAndPriceToPartList(r.parts,e)}if(r.configuration){const e=await t.getConfigurationData(r.runtimeId);r.configuration=e.configuration}r.data=null,n.push(r)}})),{objects:n,itemIds:a,configurationIds:i}})(e,t),{data:s,rootComponentIds:o}=await(async(e=[],t=[],n)=>{const[a,i]=await Promise.allSettled([n.getItems(e),n.getConfigurations(t)]),r=[],s=new Map;if("fulfilled"===a.status)for(const e of a.value)s.set(e.id,e);if("fulfilled"===i.status)for(const e of i.value)s.set(e.id,e),r.push(e.rootComponentId);else console.warn("Could not fetch configuration for data property. This happens when a configuration has not been saved yet");return{data:s,rootComponentIds:r}})(i,r,n),l=await n.getComponents(o),c=new Map;for(const e of l)c.set(e.id,e);for(const e of a){const t=e.catalogItemId||e.configurationHash,n=s.get(e.catalogItemId)||s.get(e.configurationHash)||null;if(n&&!n.label&&c.has(n.rootComponentId)){const e=c.get(n.rootComponentId);n.label=e.label}n&&!n.label&&(n.label=t),e.data=n}return a};class dt extends Ie{constructor(){const e=new Ee(1e3,1e3,8,8);e.rotateX(-Math.PI/2);const t=new Me;(new Te).load("static/paper_background-119811362010cc9d.png",e=>{e.wrapS=Fe,e.wrapT=Fe,e.repeat.set(200,200),t.map=e,t.alphaTest=.3,t.transparent=!0}),super(e,t),this.name="2d paper background",this.position.set(0,-.1,0),this.layers.set(2),this.userData.ignoreElementHit=!0}}class gt extends ce{get cameraControl(){return this._cameraControl}}class mt extends gt{get cameraControl(){return this._cameraControl}resetCameraOnPlanCompletelyLoaded(e){this.cameraControl.zoomToFitBounds(y(e,this.cameraControl.domHelper.element.clientWidth,this.cameraControl.domHelper.element.clientHeight,1.1),!0)}externalApiResetCameraPosition(e){this.cameraControl.zoomToFitBounds(y(e,this.cameraControl.domHelper.element.clientWidth,this.cameraControl.domHelper.element.clientHeight,1.1),!0)}resetCameraOnSwitchTo2d(e){this.cameraControl.zoomToFitBounds(y(e,this.cameraControl.domHelper.element.clientWidth,this.cameraControl.domHelper.element.clientHeight,1.1),!0)}updateCameraOnDrawWalls(e){this.cameraControl.zoomToFitBounds(e,!1,!0)}updateCameraOnPlanElementInsertedOutsideCurrentCameraView(e){this.cameraControl.zoomToFitBounds(e,!1,!0)}updateCameraOnPlanElementInsertedInsideCurrentCameraView(e){}updateCameraOnPlanElementDraggedOutsidePlanBounds(e){this.cameraControl.zoomToFitBounds(e,!1,!0)}updateCameraOnPlanElementRemoved(e){}updateCameraOnBackToPlanner(e,t,n){this.cameraControl.zoomToFitBounds(e,!1,!0)}resetCameraOnEnableWallDrawing(e){this.cameraControl.zoomToFitBounds(e,!1,!0)}}class ut extends gt{get cameraControl(){return this._cameraControl}resetCameraOnPlanCompletelyLoaded(e){this.cameraControl.updateAndReset(e,!0)}externalApiResetCameraPosition(e){this.cameraControl.updateAndReset(e,!0)}resetCameraOnSwitchTo3d(e){this.cameraControl.updateAndReset(e,!1)}disablePanningOnShiftRelease(){this.cameraControl.disablePanning()}enablePanningOnShiftClick(){this.cameraControl.enablePanning()}updateCameraOnDrawWalls(e){this.cameraControl.zoomToFitBounds(e,!0)}updateCameraOnPlanElementInsertedOutsideCurrentCameraView(e){this.cameraControl.zoomToFitBounds(e,!1)}updateCameraOnPlanElementDraggedOutsidePlanBounds(e){this.cameraControl.adjustToBoundsWithoutChangingDistance(e)}updateCameraOnPlanElementInsertedInsideCurrentCameraView(e){this.cameraControl.adjustToBoundsWithoutChangingDistance(e)}updateCameraOnPlanElementRemoved(e){this.cameraControl.adjustToBoundsWithoutChangingDistance(e)}async updateCameraOnBackToPlanner(e,t,n){n&&(this.cameraControl.setObjectRotation(0),await this._cameraControl.setToState(t,n))}resetCameraOnEnableWallDrawing(e){this.cameraControl.updateAndReset(e,!0)}async externalApiMoveCamera(e){await this.cameraControl.moveCamera(e),this._onCameraChanged()}}class _t extends gt{get cameraControl(){return this._cameraControl}resetCameraOnPlanCompletelyLoaded(e){this.cameraControl.updateCamera()}externalApiResetCameraPosition(e){this.cameraControl.updateCamera()}updateCameraOnDrawWalls(e){this.cameraControl.updateCamera()}updateCameraOnPlanElementInsertedOutsideCurrentCameraView(e){this.cameraControl.updateCamera()}updateCameraOnPlanElementInsertedInsideCurrentCameraView(e){this.cameraControl.updateCamera()}updateCameraOnPlanElementDraggedOutsidePlanBounds(e){this.cameraControl.updateCamera()}updateCameraOnPlanElementRemoved(e){this.cameraControl.updateCamera()}updateCameraOnBackToPlanner(e,t,n){this.cameraControl.updateCamera()}resetCameraOnEnableWallDrawing(e){this.cameraControl.updateCamera()}resetCameraOnSwitchToFirstPerson(){this.cameraControl.updateCamera()}}class pt{constructor(e,t,n){this._sceneEventHandler=e,this._roomleRenderer=t,this._planViewModel=n}_processViewModel(e,t){var n,a,i;e instanceof s&&(null===(a=(n=e.getKernelObject()).getAttachedAttics)||void 0===a?void 0:a.call(n).size())>0?e.getBoundingBox().children.forEach(e=>{e.isChildPlanObject||t.add(e)}):((e instanceof b||e instanceof P)&&e.getTopViewContainer()&&t.add(e.getTopViewContainer()),(null===(i=e.getObject())||void 0===i?void 0:i.children)&&e.getObject().children.forEach(e=>{e.isChildPlanObject||t.add(e)}))}_processSelectedPlanElementIds(e){var t;((null===(t=this._sceneEventHandler)||void 0===t?void 0:t.getSelectedIds())||[]).forEach(t=>{const n=this._planViewModel.getPlanObjectForId(t);n&&this._processViewModel(n,e)})}_highlightPlanElementsBase(e,t){var n;let a=new Set;t&&this._processViewModel(t,a),null==e||e.forEach(e=>{const t=this._planViewModel.getPlanObjectForId(e);t&&this._processViewModel(t,a)}),this._processSelectedPlanElementIds(a),null===(n=this._roomleRenderer)||void 0===n||n.highlightObjects(Array.from(a))}highlightPlanElements(e){this._highlightPlanElementsBase(e)}highlightPlanElement(e){this._highlightPlanElementsBase(void 0,e)}clearHighlighting(){this._highlightPlanElementsBase()}}function Ct(e,t,n,a){e.fromPosition2d=M(e.fromPosition3d,t,n,a),e.toPosition2d=M(e.toPosition3d,t,n,a),e.textPosition2d=M(e.textPosition3d,t,n,a),e.fromWithoutPadding=M(e.fromWithoutPadding,t,n,a),e.toWithoutPadding=M(e.toWithoutPadding,t,n,a)}function vt(e,t,n,a){e.textPosition2d=e.fromPosition3d?M(e.textPosition3d,t,n,a):void 0,e.fromPosition2d=e.fromPosition3d?M(e.fromPosition3d,t,n,a):void 0,e.toPosition2d=e.toPosition3d?M(e.toPosition3d,t,n,a):void 0,e.atticCenterPosition2d=e.atticCenterPosition3d?M(e.atticCenterPosition3d,t,n,a):void 0,e.wallCenterPosition2d=M(e.wallCenterPosition3d,t,n,a),e.labelCPosition2d=M(e.labelCPosition3d,t,n,a),e.labelHeightPosition2d=M(e.labelHeightPosition3d,t,n,a),e.shiftedWallCenter2d=M(e.shiftedWallCenter3d,t,n,a),e.heightAt2mPosition2d=M(e.heightAt2mPosition3d,t,n,a),e.attic2mCornerFrom2d=M(e.attic2mCornerFrom3d,t,n,a),e.attic2mCornerto2d=M(e.attic2mCornerto3d,t,n,a)}function ft(e,t){const n=new We(.1,32,16),a=new Me({color:16711680}),i=new Ie(n,a);i.position.copy(e.fromPosition3d);const r=new Ie(n,a);r.position.copy(e.toPosition3d);const s=new Ie(n,new Me({color:65280}));if(s.position.copy(e.textPosition3d),t.wallPoints.add(i),t.wallPoints.add(r),t.wallPoints.add(s),e.attic){const a=new Ie(n,new Me({color:255}));e.attic.fromPosition3d&&a.position.copy(e.attic.fromPosition3d);const i=new Ie(n,new Me({color:16711935}));e.attic.toPosition3d&&i.position.copy(e.attic.toPosition3d);const r=new Ie(n,new Me({color:16776960}));e.attic.atticCenterPosition3d&&r.position.copy(e.attic.atticCenterPosition3d),t.wallPoints.add(a),t.wallPoints.add(i),t.wallPoints.add(r)}}function wt(e,t){var n;const a=lt(e),i=null===(n=null==t?void 0:t.featureFlags)||void 0===n?void 0:n.lockPlan,r=e&&"getPlanElement"in e&&e.getPlanElement()&&"getAttachedWall"in e.getPlanElement();return!(!i||"wall"!==a&&"floor"!==a&&!r)}const bt=e=>"Meta"===e.key||"Control"===e.key,Pt=(e,t=!1)=>{const n=!1===t?t:bt(e);return e.key&&(e.metaKey||e.ctrlKey||n)},Et=e=>["altKey","ctrlKey","shiftKey","metaKey"].reduce((t,n)=>(e[n]&&t++,t),0);class Mt extends Xe{constructor(e,t,n,a){var i;super(e,t,a),this._itemsLoadingStatePromises=[],this._staticItemGuard=new H,this._completelyLoaded=!1,this._configurableItemGuard=new H,this._planCompletelyLoadedGuard=new H,this.currentSelection=null,this._paperBackground=null,this._cameraState=null,this._debugSpheres={wallPoints:new He,constructionElementsPoints:new He,floorPoints:new He},this._stopRendering=!0,this._configureInRoom=this._initData.configureInRoom,this._configuratorContext.baseContext="planner",this._roomlePlannerCallback=n,this._plannerMeshGenerator.maxAnisotropy=this._renderer.capabilities.getMaxAnisotropy(),this._plannerMeshGenerator.maxTextures=this._renderer.capabilities.maxTextures,this._plannerSceneEventHandler=new st(e,this._scene,this.cameraBehaviour.cameraControl.getCamera(),this._getInputManager()),null===(i=this._roomleRenderer)||void 0===i||i.switchToPlanner(j.Mode3D),this._imageRenderer.switchToPlannerSettings(),this._planElementHighlighter=new pt(this._plannerSceneEventHandler,this._roomleRenderer,this._getViewModel()),this._plannerSceneEventHandler.addEventListener(2,({state:e,oldState:t})=>{2===t&&e!==t&&this._roomlePlannerUiCallback.onRotationCancel(),2===e||1===e||4===e||3===e?(this.cameraBehaviour.cameraControl.lock(),this._onCameraMove()):(this.cameraBehaviour.cameraControl.unlock(),this._onCameraIdle())},this),this._plannerSceneEventHandler.addEventListener(13,()=>this._renderWithoutShadowsAndAO(),this),this._plannerSceneEventHandler.addEventListener(19,e=>this._activateElement(e),this),this._plannerSceneEventHandler.addEventListener(0,e=>{this._activateElement(e);const t=e.planElementViewModel;this._sendElementMeasurements(),t instanceof C&&this._initData.debug&&t.getGLBUrl(),wt(t,this._initData)||this._planElementHighlighter.highlightPlanElement(t),this._onSelectionChange(t),this._renderWithoutShadowsAndAO()},this),this._plannerSceneEventHandler.addEventListener(1,({planElementViewModel:e,reason:t})=>{this._planElementHighlighter.clearHighlighting(),this._onSelectionCancel(e,t),this._roomlePlannerUiCallback.onSelectionCancel(t),this._renderWithoutShadowsAndAO()},this),this._plannerSceneEventHandler.addEventListener(8,()=>{this.cameraBehaviour.cameraControl.lock()},this),this._plannerSceneEventHandler.addEventListener(9,({planElementViewModel:e})=>{this._getKernelAccess().planInteractionHandler.startInteraction(),this._sendElementMeasurements(),e instanceof s&&this._sendWallDimensions(),this._requestRender(),this._dragStartBounds=this.getBounds()},this),this._plannerSceneEventHandler.addEventListener(10,({planElementViewModel:e})=>{this.cameraBehaviour.cameraControl.checkNearFarDistance(e.getPosition()),this._requestRender()},this),this._plannerSceneEventHandler.addEventListener(11,async({planElementViewModel:e})=>{const t=this._getKernelAccess().planInteractionHandler;t.endInteraction(),this.cameraBehaviour.cameraControl.unlock();const n=this._getDragPosition(e.getPosition());n&&t.moveElementTo(e.getPlanElement(),d(n)),this.updateEnvironment(this.getBounds(),!0),this._renderEverything();const a=this.getPlanObject(e.getId());let i;a&&(i=await ht([a],this._plannerKernelAccess,this._rapiAccess)),this._roomlePlannerUiCallback.onPlanElementChanged(A.MOVED,i.length?i[0]:{...a,data:null});const r=e instanceof s||e instanceof g||e instanceof m;this._cameraBehaviourState.isWithinPlanBounds(e.getPosition(),this.getBounds())||r||this.plannerCameraBehaviour.updateCameraOnPlanElementDraggedOutsidePlanBounds(this.getBounds())},this),this._plannerSceneEventHandler.addEventListener(12,()=>{this.cameraBehaviour.cameraControl.unlock()},this),this._plannerSceneEventHandler.addEventListener(16,()=>{this.cameraBehaviour.cameraControl.lock()},this),this._plannerSceneEventHandler.addEventListener(18,()=>{this._roomlePlannerUiCallback.onUpdateMeasurementLineDimensions([])},this),this._plannerSceneEventHandler.addEventListener(17,()=>{this.cameraBehaviour.cameraControl.unlock(),this._roomlePlannerUiCallback.onMeasurementLineStateChange(!1)},this),this._plannerSceneEventHandler.addEventListener(6,()=>{var e;this._setKernelZoomFactor(),this._renderWithoutShadowsAndAO(),null===(e=this._roomleRenderer)||void 0===e||e.setGroundShadow(!1)},this),this._plannerSceneEventHandler.addEventListener(5,()=>this._renderWithoutShadowsAndAO(),this),this._plannerSceneEventHandler.addEventListener(7,()=>{var e;this._renderWithoutShadowsAndAO(),null===(e=this._roomleRenderer)||void 0===e||e.setGroundShadow(!0)},this),this._getKernelAccess().addPlannerListener(this),this._plannerMeshGenerator.setMaterialLoadedListener(()=>{this._configurableItemGuard.resolve(),this._requestRender()}),window.onbeforeunload=this.clearScene.bind(this),this._getInputManager().addEventListener(7,this._renderListener,this),this._getInputManager().addEventListener(8,this._renderListener,this),this.disableConfiguratorEvents(),a!==ye.CAMERA_FP&&this.enablePlannerEvents(),setTimeout(()=>this._updatePaperBackground(),0),this._initData.debug&&(this._debugSpheres.wallPoints.name="Walls debug points",this._debugSpheres.constructionElementsPoints.name="Construction elements debug points",this._debugSpheres.floorPoints.name="Floor debug points",this._scene.add(this._debugSpheres.wallPoints),this._scene.add(this._debugSpheres.constructionElementsPoints),this._scene.add(this._debugSpheres.floorPoints))}get configuratorContext(){return this._configuratorContext}get hasSingleRoom(){const e=this._getViewModel().getFloorPlanObjectViewModels();return 1===new Set(e.map(e=>e.getId())).size}_activateElement({planElementViewModel:e},t=(()=>{})){const n=this._plannerSceneEventHandler.isDragIn()?e:null;this._sendElementMeasurements(n),e instanceof C&&this._initData.debug&&e.getGLBUrl(),wt(e,this._initData)||this._planElementHighlighter.highlightPlanElement(e),t(),this._renderWithoutShadowsAndAO()}planCleared(){}planHistoryStateChanged(){var e,t;if(this._sendRoomMeasurements(),this._completelyLoaded){const{configuratorId:n}=this._globalInitData,a=null===(t=(null===(e=this._plannerKernelAccess)||void 0===e?void 0:e.planInteractionHandler).getPlan())||void 0===t?void 0:t.getPlanXML(!1,2),i=this._idbManager.getKey(x(),n,this._initData.id);this._idbManager.setValue(i,a,this._idbManager.configStore)}}_getViewModel(){return this._viewModel||(this._viewModel=new Je(this._creator_),this._viewModel.setRequestRenderCallback(()=>this._renderEverything()),this._viewModel.setRequestRenderSceneUpdateCallback(()=>{var e;return null===(e=this._roomleRenderer)||void 0===e?void 0:e.clearCache()}),this._viewModel.setInvalidateRenderCallback(()=>{var e;return null===(e=this._roomleRenderer)||void 0===e?void 0:e.forceShadowUpdates(!0)})),this._viewModel}_getDragPosition(e){if(!this._plannerSceneEventHandler.isDragIn())return null;const t=this._dragStartBounds?this._dragStartBounds:this.getBounds(),n=t.getCenter(new _e),a=e.distanceTo(n),i=t.getSize(new _e),r=Math.max(i.x,i.z)+3;if(a>r){const t=(new _e).subVectors(e,n).normalize();return n.clone().add(t.multiplyScalar(r))}return null}_hideAllMeasurementsNodeOnElementChange(e){this._getViewModel().getMeasurementLineObjectViewModels().forEach(e=>e.hideDraggableNodes()),e instanceof g&&e.showDraggableNodes()}_onSelectionChange(e){this._hideAllMeasurementsNodeOnElementChange(e);const t={};if(e instanceof C&&(t.item=e.getRapiItem(),t.staticItemRuntimeId=e.getPlanElement().getId(),this._configuratorUiCallbacks.onUpdateParameters([])),e instanceof P&&(t.staticItemRuntimeId=e.getPlanElement().getId()),e instanceof p){const n=e.getId(),a=this.getRootPlanObjectId(n),i=this._getViewModel().getPlanObjectForId(a);t.configurationRuntimeId=i.getConfigurationRuntimeId()}if(e instanceof s){const n=this.cameraBehaviour.cameraControl.getKernelZoomFactor(),{clientWidth:a,clientHeight:i}=this._domHelper.element;t.wall=e.getWallDimension(n,a,i)}e instanceof g&&(t.measurementLine=e.getMeasurementLineDimension()),e instanceof o&&(t.staticItemRuntimeId=e.getPlanElement().getId());let n=lt(e);const a=(async()=>{const t={};if(e instanceof C&&(t.item=e.getRapiItem(),t.staticItemRuntimeId=e.getPlanElement().getId()),e instanceof p){await e.isInitDone();const a=e.getConfigurationRuntimeId();this._getKernelAccess().updatePlanObjectDependencies(a);const i=e.getPlanObject().getCatalogItemId();let r=i;r||(r=this._getKernelAccess().kernelInstance.getHashOfConfiguration(a));const s=this._getKernelAccess().kernelInstance.isExternalPlanObject(a);if(s){const t=this.getRootPlanObjectId(e.getId()),n=this._getViewModel().getPlanObjectForId(t);this._planObjectSelectionChanged(n.getConfigurationRuntimeId(),e.getRootComponentRuntimeId())}let o;if(this._configuratorContext.planObjectId=a,this._configuratorContext.planElementId=e.getId(),this._configuratorContext.rootComponentId=e.getRootComponentRuntimeId(),!s)if(i&&X(i)){const e=await this._rapiAccess.getItem(i);t.item=e,o=e.rootComponentId?e.rootComponentId:null}else try{const e=await this._rapiAccess.getConfiguration(r);t.configuration=e,o=e.rootComponentId?e.rootComponentId:null}catch(e){console.warn("Could not get RAPI configuration for kernel hash "+r+", saving configuration...");const n=await this._getKernelAccess().getConfigurationData(a),i=await this._rapiAccess.saveConfiguration(n);t.configuration=i,o=i.rootComponentId?i.rootComponentId:null}if(o){const e=await this._rapiAccess.getComponent(o);t.component=e}t.configurationRuntimeId=a,n="configuration"}return t.planElementId=e.getId(),Ke(t)})();if(this.currentSelection=Ke(t),this._sendElementMeasurements(),this._sendPlanObjectPositions(),e instanceof p){const a=e.getConfigurationRuntimeId();a&&-1!==a&&this._getKernelAccess().kernelInstance.isExternalPlanObject(a)&&(n="external-configuration",t.externalConfigurationType="tc-config")}this._roomlePlannerUiCallback.onSelectionChange(Ke(this._plannerSceneEventHandler.getSelectionMode()),Ke(n),Ke(t),a,e),(e instanceof s||e instanceof m)&&(this._getViewModel().getNodePlanObjectViewModels().forEach(e=>e.show()),this._updateNodeSize()),this._renderWithoutShadowsAndAO()}_onSelectionCancel(e,t){this._getViewModel().getNodePlanObjectViewModels().forEach(e=>e.hide()),this._renderWithoutShadowsAndAO(),this.resetConfiguratorContext(t),this.cancelComponentSelection(!1,t),this._handleMeasurementLineDraggablePoints(e),this.currentSelection=null}_handleMeasurementLineDraggablePoints(e){this._getViewModel().getMeasurementLineObjectViewModels().forEach(e=>{e.hideDraggableNodes(),e.deselectAllDraggablePoints()}),e instanceof g&&(e.deselectAllDraggablePoints(),e.currentPoint=null)}resetConfiguratorContext(e){var t;try{this._configuratorContext.planObjectId&&(null===(t=this.getPlanObject(this._configuratorContext.planElementId).configurationType)||void 0===t?void 0:t.value)===S.EXTERNAL&&this.notifyPlannerOnComponentSelectionCancel(!0,e)}catch(e){console.error(e)}this._configuratorContext.planObjectId=0,this._configuratorContext.planElementId=0,this._configuratorContext.rootComponentId=0,this._configuratorContext.dockingRootComponentId=0}_setupScene(e,t){super._setupScene(e,t,!0),this._initData.legacyLight&&(this._lightSetting=new nt(this._scene,this._lightSetting)),this._initData.moc||this._addSky(),t||this._setEnvironment(new de(this._scene,this._environment,Ue(this._initData.colors.DEFAULT_BACKGROUND)))}onBeforeRender(){var e;this.cameraBehaviour.cameraControl instanceof ge&&L(this.cameraBehaviour.cameraControl.getCamera(),this._getViewModel().getWallPlanObjectViewModels())&&(null===(e=this._roomleRenderer)||void 0===e||e.forceShadowUpdates(!0))}_getInputManager(){return this._plannerInputManager}createCameraControl(e,t){this.setMode(e)}startViewing(){this._configuratorContext.baseContext="glb-viewer";const e=this._plannerSceneEventHandler.getSelectedIds();if(1===e.length){const t=this._getViewModel().getPlanObjectForId(e[0]);this._setCameraPosition();const n=this.cameraBehaviour.cameraControl.getCurrentCameraParameters();this._changeCameraBehaviour(new $e(this._getCameraControl3D(n),this._cameraBehaviourState)),this.cameraBehaviour.cameraControl instanceof ge&&this.cameraBehaviour.cameraControl.setObjectRotation(t.getPlanElement().rotation),this._configureInRoom||this._getViewModel().hideAllExcept(t.getId()),this.cameraBehaviour.updateCameraOnItemLoaded(this.getBounds()).then(()=>{this.updateEnvironment(this.getBounds(),!0)})}this.disablePlannerEvents(),this.updateScene()}startConfiguring(){var e,t,n;this._configuratorContext.baseContext="configurator";let{planElementId:a}=this._configuratorContext;a=this.getRootPlanObjectId(a),this._configuratorContext.planElementId!==a&&this.selectPlanObject(a),this._selectExternalObjectModule();const i=this._getViewModel().getPlanObjectForId(a);this._setCameraPosition();const r=this.cameraBehaviour.cameraControl.getCurrentCameraParameters();this._changeCameraBehaviour(new Qe(this._getCameraControl3D(r),this._cameraBehaviourState));let s=0;i&&(this.setRootComponentId(i.getRootComponentRuntimeId()),s=i.getPlanElement().rotationToPreferredFront,null===(e=this._componentRaycastHelper)||void 0===e||e.setObject(i.getObject()));const o=null==i?void 0:i.getConfigurationRuntimeId();this._configuratorContext.planObjectId!==o&&(this._configuratorContext.planObjectId=o),this._plannerSceneEventHandler.removeSelection(),this._planElementHighlighter.clearHighlighting(),this._configureInRoom||this._getViewModel().hideAllExcept(a),this.configuratorCameraBehaviour.resetCameraOnStartConfiguring(this.getBounds(),r,s).then(()=>{this.updateEnvironment(this.getBounds(),!0)}),this.setEventHandlerObject(i.getContainer()),this.disablePlannerEvents(),this.enableConfiguratorEvents(),null===(t=this._roomleRenderer)||void 0===t||t.switchToConfigurator(),this._imageRenderer.switchToConfiguratorSettings(),this.updateScene(),this._getKernelAccess().updatePlanObjectDependencies(o),this._getKernelAccess().requestPartListAndUpdatePricesOfParts(),this._getKernelAccess().planObjectUpdated(o,!1);const l=null===(n=this._plannerKernelAccess)||void 0===n?void 0:n.planInteractionHandler;null==l||l.startInteraction()}_setCameraPosition(){this._cameraState=this.cameraBehaviour.cameraControl.getCurrentCameraParameters()}_resetCameraPosition(e){if(this.cameraBehaviour.cameraControl instanceof ge){if(!this._cameraState)return;this.plannerCameraBehaviour.updateCameraOnBackToPlanner(this.getBounds(),e,this._cameraState)}}async selectPlanObject(e){if(this._plannerSceneEventHandler.getSelectedIds().includes(e))return;e=this.getRootPlanObjectId(e);const t=this._getViewModel().getPlanObjectForId(e);await this._plannerSceneEventHandler.selectPlanElement(t)}backToPlanner(){var e,t,n,a,i;if("planner"===this._configuratorContext.baseContext)return;if("configurator"===this._configuratorContext.baseContext){const i=null===(e=this._plannerKernelAccess)||void 0===e?void 0:e.planInteractionHandler;null==i||i.endInteraction(),(null===(a=this._getKernelAccess().kernelInstance.getPlanObject(null!==(n=null===(t=this.currentSelection)||void 0===t?void 0:t.configurationRuntimeId)&&void 0!==n?n:0))||void 0===a?void 0:a.externalObject)&&this.notifyPlannerOnComponentSelectionCancel(!0,"isolation_mode_cancelled")}this._configuratorContext.baseContext="planner";const r=this.cameraBehaviour.cameraControl.getCurrentCameraParameters(),s=this._getViewModel().cameraType;this._changeCameraBehaviour(s===ye.CAMERA_3D||s===ye.CAMERA_FP?new ut(this._getCameraControl3D(r),this._cameraBehaviourState):new mt(this._getCameraControl2D(),this._cameraBehaviourState)),this._resetCameraPosition(r),this._getViewModel().showAll(),this.setEventHandlerObject(this._scene),this.enablePlannerEvents();const o=this.cameraBehaviour.cameraControl instanceof ge||this.cameraBehaviour.cameraControl instanceof me;this._getViewModel().setCameraType(o?ye.CAMERA_3D:ye.CAMERA_2D),this.disableConfiguratorEvents(),null===(i=this._roomleRenderer)||void 0===i||i.switchToPlanner(this.cameraBehaviour.cameraControl instanceof ge?j.Mode3D:j.Mode2D),this._imageRenderer.switchToPlannerSettings(),this.updateScene()}_getYRotationOfObject(e){let t=e.getWorldDirection(new _e).clone();t.y=0,t.lengthSq()<.01&&(t=new _e(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}loadStaticPlanObjects(){let e=new Map;this._getViewModel().getStaticPlanObjectViewModels().forEach(t=>{let n=t.getPlanObject();e.has(n.getCatalogItemId())?e.get(n.getCatalogItemId()).push(t):e.set(n.getCatalogItemId(),[t])}),this._rapiAccess.getItems(Array.from(e.keys())).then(t=>{let n=[];t.forEach(t=>{this._getKernelAccess().catalogItemLoaded(t),e.get(t.id).forEach(e=>{n.push(new Promise((n,a)=>{e.setRapiItem(t).then(()=>{this._requestRender(),n()},a)}))})}),Promise.all(n).then(()=>this._staticItemsLoaded())})}requestCatalogItem(e){this._rapiAccess.getItem(e).then(e=>{this._getKernelAccess().catalogItemLoaded(e)})}_staticItemsLoaded(){this._requestRender(),this._staticItemGuard.resolve(),this._roomlePlannerUiCallback.onItemsLoaded()}preload(e){this._planId=e;let t=this._localStorageHelper.getItem(this._planId,"rml_plans");t&&this._loadGLTF(t).then(e=>{this._preloadScene=e,this._preloadScene&&this._scene.add(this._preloadScene),this._requestRender()})}planXMLLoaded(e){this.endPlanConstruction(e),this.loadStaticPlanObjects()}planCompletelyLoaded(e){this._stopRendering=!1,this._renderEverything(),setTimeout(()=>this._planCompletelyLoadedGuard.resolve(),0),this._getViewModel().getNodePlanObjectViewModels().forEach(e=>e.hide()),this._getViewModel().getMeasurementLineObjectViewModels().forEach(e=>e.hideDraggableNodes())}handlerSwitchedPlans(e,t){if(this._completelyLoaded=!1,this._roomlePlannerUiCallback.onHandlerSwitchedPlans(),this._getViewModel().setReference(t),this._getKernelAccess().coupleReferences(this._getViewModel(),t),this._getViewModel().setPlannerSceneEventHandler(this._plannerSceneEventHandler),this._getViewModel().setGeometriesMergedListener(()=>{this._renderEverything()}),this._plannerSceneEventHandler.setPlanViewModel(this._getViewModel()),e&&this.clearScene(),!this._initData.moc){this._addSky();let e=new Ee(1e3,1e3);e.rotateX(-Math.PI/2);let t=B.createMeshStandardMaterial({color:"#f0f0f0",roughness:1,metalness:0,depthWrite:!1}),n=new Ie(e,t);n.name="Ground",n.position.y=-.01,n.userData.isFloor=!0,this._scene.add(n)}this._setCeiling(),this._staticItemGuard.reset(),this._configurableItemGuard.reset(),this._planCompletelyLoadedGuard.reset();const n=this._plannerMeshGenerator.materialQueue.length>0?this._configurableItemGuard.wait():Promise.resolve();Promise.all([this._staticItemGuard.wait(),n,this._planCompletelyLoadedGuard.wait()]).then(this._itemsLoaded.bind(this))}async _itemsLoaded(){const e=this._getViewModel().getCorePlan();if(this._roomleRenderer){const t=k(e.getBounds());this._roomleRenderer.updateBounds(t),this._imageRenderer.updateBounds(t)}await Promise.allSettled(this._itemsLoadingStatePromises),this._roomlePlannerUiCallback.onCompletelyLoaded(),this.updateEnvironment(this.getBounds(),!0),this._renderEverything(),"planner"===this._configuratorContext.baseContext&&this.plannerCameraBehaviour.resetCameraOnPlanCompletelyLoaded(this.getBounds()),this._completelyLoaded=!0,this._readyForRender()}beginPlanConstruction(e){}addPlanMesh(e,t,n,a,i,r,s){}endPlanConstruction(e){this._renderLoopFunction=()=>{var e;this._scene.add(this._getViewModel().getConstructionGroup()),this._scene.add(this._getViewModel().getCeilingGroup()),this._scene.add(this._getViewModel().getFloorGroup()),this._scene.add(this._getViewModel().getMeasurementLineGroup()),this._scene.add(this._getViewModel().getWallAtticsGroup()),(null===(e=this._lightSetting)||void 0===e?void 0:e.needsBounds())&&this._lightSetting.updateBounds(this._getViewModel().getBoundingBox()),this._scene.remove(this._preloadScene)}}async addPlanObjectToScene(e){if(!e)return Promise.resolve();let t,n;try{const a=new Promise((e,a)=>(t=e,n=a));this._itemsLoadingStatePromises.push(a);const i=e.getContainer();R(i),this._scene.add(i),this._plannerSceneEventHandler.isDragIn()&&(this._plannerSceneEventHandler.addComponentDragInHandler(e),this._requestRender()),this._roomlePlannerUiCallback.onPlanChanged(),await e.isInitDone(),this.updateEnvironment(this.getBounds()),this._renderEverything();const r=this.getPlanObject(e.getId());let s;r&&(s=await ht([r],this._plannerKernelAccess,this._rapiAccess)),this._roomlePlannerUiCallback.onPlanElementChanged(A.ADDED,s.length?s[0]:{...r,data:null}),(e instanceof p||e instanceof C)&&!this._plannerSceneEventHandler.isDragIn()&&this.cameraBehaviour instanceof gt&&(V(this.cameraBehaviour.cameraControl.getCamera(),e.getBounds())?this.plannerCameraBehaviour.updateCameraOnPlanElementInsertedInsideCurrentCameraView(this.getBounds()):this.plannerCameraBehaviour.updateCameraOnPlanElementInsertedOutsideCurrentCameraView(this.getBounds()))}catch(e){console.error(e),n()}t()}removePlanObjectFromScene(e){(e instanceof s||e instanceof m)&&this._sendWallDimensions(),e instanceof g&&this._sendMeasurementLineDimension(),this._scene.remove(e.getContainer()),e.clear(),this.updateEnvironment(this.getBounds(),!0),e instanceof s||e instanceof g||e instanceof m||this.plannerCameraBehaviour.updateCameraOnPlanElementRemoved(this.getBounds()),this._renderEverything()}planElementChanged(e,t){this._drawingEnabled&&this._sendWallDimensions(!1);const n=this._plannerSceneEventHandler.isDragIn()?t:null;if(this._sendElementMeasurements(n),this._sendRoomAreaData(),this.updateEnvironment(this.getBounds(),!0),this._renderEverything(),this._onPlanChanged(),!this._plannerSceneEventHandler.isDragIn()){const e=this.getPlanObject(t.getId());this._roomlePlannerUiCallback.onPlanElementChanged(A.MOVED,{...e,data:null})}}exportGLB(e,t){}importGLB(e){this._loadGLB(e).then(e=>this._scene.add(e))}clearScene(){this._plannerMeshGenerator.clear(),this._getViewModel().sceneCleared(),super.clearScene()}_addSky(){if(!this._sky){this._sky=new ct,this._sky.name="Sky",this._sky.scale.setScalar(45e4),this._sky.frustumCulled=!1,this._scene.add(this._sky),this._sky.material.uniforms.turbidity.value=10,this._sky.material.uniforms.rayleigh.value=2,this._sky.material.uniforms.mieCoefficient.value=.005,this._sky.material.uniforms.mieDirectionalG.value=.8;let e=T(4e5,0,.6);this._sky.material.uniforms.sunPosition.value.copy(e);let t=new Ie(new We(2e4,16,8),new Me({color:16777215}));t.name="Sunsphere",t.position.y=-7e5,t.visible=!1,t.position.set(e.x,-e.z,e.y)}this._lightSetting instanceof nt&&this._lightSetting.updateSunPosition(.6,0)}toggleConfigureInRoom(){this._configureInRoom=!this._configureInRoom,this._roomleRenderer.isConfiguring&&(this._configureInRoom?this._getViewModel().showAll():this._hideAllExceptSelectedElement(),this._renderEverything(),this.updateScene())}switchTo2D(){var e,t,n,a,i;if(!((null===(e=this.cameraBehaviour)||void 0===e?void 0:e.cameraControl)instanceof he)){(null===(t=this.cameraBehaviour)||void 0===t?void 0:t.cameraControl)instanceof me&&this._getCameraControlFirstPerson().cleanUp(),null===(n=this._roomleRenderer)||void 0===n||n.setCameraType(ye.CAMERA_2D),null===(a=this._plannerSceneEventHandler)||void 0===a||a.enable();for(const e of this._getViewModel().getWallPlanObjectViewModels())e.show();this._getViewModel().setCameraType(ye.CAMERA_2D).then(()=>this._planElementHighlighter.highlightPlanElement()),null===(i=this._roomleRenderer)||void 0===i||i.switchToPlanner(j.Mode2D),this._renderEverything(),this._changeCameraBehaviour(new mt(this._getCameraControl2D(),this._cameraBehaviourState)),this._onCameraMove(),this.plannerCameraBehaviour.resetCameraOnSwitchTo2d(this.getBounds()),this._addCameraControlListener(),this._setCeiling(),this._roomlePlannerUiCallback.onCameraChanged(ye.CAMERA_2D),this._setKernelZoomFactor(),this._onCameraMove()}}switchTo3D(){var e,t,n,a,i;(null===(e=this.cameraBehaviour)||void 0===e?void 0:e.cameraControl)instanceof ge||((null===(t=this.cameraBehaviour)||void 0===t?void 0:t.cameraControl)instanceof me&&this._getCameraControlFirstPerson().cleanUp(),null===(n=this._roomleRenderer)||void 0===n||n.setCameraType(ye.CAMERA_3D),null===(a=this._plannerSceneEventHandler)||void 0===a||a.enable(),this._getViewModel().setCameraType(ye.CAMERA_3D),null===(i=this._roomleRenderer)||void 0===i||i.switchToPlanner(j.Mode3D),this._renderEverything(),this._changeCameraBehaviour(new ut(this._getCameraControl3D(),this._cameraBehaviourState)),this._onCameraMove(),this.plannerCameraBehaviour.resetCameraOnSwitchTo3d(this.getBounds()),this._addCameraControlListener(),this._setCeiling(),this._roomlePlannerUiCallback.onCameraChanged(ye.CAMERA_3D))}switchToFirstPerson(){var e,t,n;(null===(e=this.cameraBehaviour)||void 0===e?void 0:e.cameraControl)instanceof me||(null===(t=this._roomleRenderer)||void 0===t||t.setCameraType(ye.CAMERA_FP),null===(n=this._plannerSceneEventHandler)||void 0===n||n.disable(),this._plannerMeshGenerator.wallMeshes.forEach(e=>F(e.material,!1,!1)),this._getViewModel().getWallPlanObjectViewModels().forEach(e=>{e.show()}),this._getViewModel().setCameraType(ye.CAMERA_FP),this._renderEverything(),this._changeCameraBehaviour(new _t(this._getCameraControlFirstPerson(),this._cameraBehaviourState)),this._getCameraControlFirstPerson().cleanUp(),this._getCameraControlFirstPerson().setUp(),this._addCameraControlListener(),this._setCeiling(),this._roomlePlannerUiCallback.onCameraChanged(ye.CAMERA_FP),this.plannerCameraBehaviour.resetCameraOnSwitchToFirstPerson())}onCameraChanged(){}_setCameraControlListeners(){super._setCameraControlListeners(),this.cameraBehaviour instanceof gt&&(this.cameraBehaviour.cameraControl.addEventListener(8,()=>{this._onCameraIdle()},this),this.cameraBehaviour.cameraControl.addEventListener(1,()=>{this._onCameraMove()},this),this.cameraBehaviour.cameraControl.addEventListener(7,()=>{this._onCameraMove()},this),this.cameraBehaviour.cameraControl.addEventListener(3,()=>{this._onCameraMove()},this),this.cameraBehaviour.cameraControl.addEventListener(4,()=>{this._onCameraMove()},this),this.cameraBehaviour.cameraControl.addEventListener(5,()=>{this._onCameraZoomChange()},this))}_onCameraZoomChange(){this._setKernelZoomFactor()}_setKernelZoomFactor(){var e,t;const n=this.cameraBehaviour.cameraControl.getKernelZoomFactor();n&&isFinite(n)&&n>=0&&(null===(e=this._getKernelAccess().planInteractionHandler)||void 0===e||e.setZoomFactor(n)),null===(t=this._plannerSceneEventHandler)||void 0===t||t.setKernelZoomFactor(n)}_setCeiling(){this._getViewModel()&&(this.cameraBehaviour.cameraControl instanceof me?this._getViewModel().getCeilingGroup().visible=!0:this._getViewModel().getCeilingGroup().visible=!1)}cameraBehaviourChanged(){var e;super.cameraBehaviourChanged(),null===(e=this._plannerSceneEventHandler)||void 0===e||e.setCamera(this.cameraBehaviour.cameraControl.getCamera()),this._updatePaperBackground()}_updatePaperBackground(){var e,t;this.cameraBehaviour.cameraControl instanceof he?(this._paperBackground||(this._paperBackground=new dt),null===(e=this._scene)||void 0===e||e.add(this._paperBackground),this._requestRender()):this._paperBackground&&(null===(t=this._scene)||void 0===t||t.remove(this._paperBackground))}sceneChanged(){this._plannerSceneEventHandler&&this._plannerSceneEventHandler.setObject(this._scene)}_onKeyDown(e){if(super._onKeyDown(e),this._initData.debug&&this._checkNumKey(e),Pt(e)){const t=Et(e),n=e.metaKey&&"Meta"===e.key||e.ctrlKey&&"Control"===e.key,a=t>1?"standard":n?"multiselect":"standard";this._plannerSceneEventHandler.setSelectionMode(a)}e.key&&e.key.includes("Shift")&&this.cameraBehaviour.cameraControl instanceof ge&&(this.cameraBehaviour.cameraControl.enablePanning(),e.preventDefault())}_checkNumKey(e){e.key&&"1"===e.key&&(this.switchTo2D(),e.preventDefault()),e.key&&"2"===e.key&&(this.switchTo3D(),e.preventDefault()),e.key&&"3"===e.key&&(this.switchToFirstPerson(),e.preventDefault())}_onKeyUp(e,t=!1){if(super._onKeyUp(e,t),Pt(e,!0)){const t=Et(e);let n="standard";bt(e)||1!==t||(n="multiselect"),this._plannerSceneEventHandler.setSelectionMode(n),e.preventDefault()}e.key&&e.key.includes("Shift")&&this.cameraBehaviour.cameraControl instanceof ge&&(this.cameraBehaviour.cameraControl.disablePanning(),e.preventDefault()),!e.key||"Escape"!==e.key&&"Esc"!==e.key||this._drawingEnabled&&(this.escapeDrawing(!0),this._roomlePlannerUiCallback.onDrawCancel())}setMode(e){switch(e){case ye.CAMERA_2D:this.switchTo2D();break;case ye.CAMERA_3D:this.switchTo3D();break;case ye.CAMERA_FP:this.switchToFirstPerson()}}_clearHighlighting(){this._planElementHighlighter.clearHighlighting(),this._renderWithoutShadowsAndAO()}highlightPlanElementsById(e){null!==e?this._planElementHighlighter.highlightPlanElements(e):this._clearHighlighting()}highlightPlanElementById(e){if(null===e)return void this._clearHighlighting();e=this.getRootPlanObjectId(e);const t=this._getViewModel().getPlanObjectForId(e);this._planElementHighlighter.highlightPlanElement(t)}destroy(){super.destroy(),this._plannerMeshGenerator.removeMaterialLoadedListener(),this._getViewModel().removeGeometriesMergedListener()}planObjectConfigurationLoaded(e,t,n){if(n||console.error("Plan object configuration loading failed",t.getCatalogItemId()||t.getConfigurationHash()),e&&e.extRef&&t&&t.extRef){let e=t.extRef.jsObject.getPlanObject().getConfigurationRuntimeId();e>0&&this._getViewModel().constructComponents(e)}}async planObjectConfigurationChanged(e,t){const n=this.getPlanObject(t.getId());let a;!n||t instanceof p||t instanceof P||(a=await ht([n],this._plannerKernelAccess,this._rapiAccess)),this._roomlePlannerUiCallback.onPlanElementChanged(A.CHANGED,(null==a?void 0:a.length)?a[0]:{...n,data:null})}addMesh(e,t,n,a,i,r){}updateCameraOnDrawWalls(){this.plannerCameraBehaviour.updateCameraOnDrawWalls(this.getBounds())}getBounds(){return this._getViewModel()?this._getViewModel().getBoundingBox():null}getGeometryBounds(){return"configurator"===this._configuratorContext.baseContext?super.getGeometryBounds():this.getBounds()}getPlanObject(e){const t=this._getKernelAccess().planInteractionHandler,n=this._plannerKernelAccess.planModelViewHelper,a=t.getPlan();return n.getPlanObject(a,e)}getRootPlanObjectId(e){var t;if(!(null===(t=this._plannerKernelAccess)||void 0===t?void 0:t.kernelContainer))return e;const n=this._getKernelAccess().planInteractionHandler,a=this._plannerKernelAccess.planModelViewHelper,i=n.getPlan();return a.getRootPlanObjectId(i,e)}cancelPlanElementSelection(e){this._plannerSceneEventHandler.cancelSelection(e),this._planElementHighlighter.clearHighlighting(),this._requestRender()}async deletePlanElementSelection(){const e=this._plannerSceneEventHandler.getSelectedIds();this.cancelPlanElementSelection("delete_object");const t=this._getKernelAccess().planInteractionHandler;t.startInteraction(),await this.deletePlanElementByIds(e),t.endInteraction()}async deletePlanElementByIds(e){for(const t of e){const e=this._getViewModel().getPlanObjectForId(t);if(e&&e.getObject()){const t=this.getPlanObject(e.getId());let n;t&&(n=await ht([t],this._plannerKernelAccess,this._rapiAccess)),this._roomlePlannerUiCallback.onPlanElementChanged(A.REMOVED,n.length?n[0]:{...t,data:null}),this._getKernelAccess().planInteractionHandler.removeElement(e.getKernelObject())}}}rotatePlanElementSelection(e){const t=new(this._getKernelAccess().kernelContainer.PlanObjectPtrList),n=new De;let a={x:0,y:0,z:0};if(this._plannerSceneEventHandler.getSelectedIds().forEach(e=>{const i=this._getViewModel().getPlanObjectForId(e);i&&i.getObject()&&(a=i.getPlanElement().getCenter(),t.push_back(i.getPlanElement()),n.expandByObject(i.getContainer()))}),t.size()>1){const e=n.getCenter(new _e);a=d(e)}this._getKernelAccess().planInteractionHandler.rotateObjectsBy(t,e,a)}planBoundsChanged(){this.updateEnvironment(this.getBounds()),this._requestRender()}planElementRemoved(e){this._configuratorContext.planElementId===e.getId()&&(this._roomlePlannerUiCallback.onSelectionCancel("delete_object"),this._configuratorContext.planElementId=0),this._onPlanChanged(),this._renderEverything()}_onPlanChanged(){this._roomlePlannerUiCallback.onPlanChanged()}prepareTopImage(e={},t){return"configurator"===this._configuratorContext.baseContext&&t?super.preparePerspectiveImage(e):new Promise(t=>{this._getViewModel().materialQueue.finished(!0).then(async()=>{var n,a,i;let r=this._calculateBoundingBoxOfAllMeshes(.1);null===(n=this._lightSetting)||void 0===n||n.removeFromScene(),this.cameraBehaviour.cameraControl instanceof ge&&(await this._getViewModel().setCameraType(ye.CAMERA_2D),this._getViewModel().setNodeVisibility(!1));let s=await this._imageRenderer.prepareTopImage(this._scene,null,r,e);this.cameraBehaviour.cameraControl instanceof ge&&await this._getViewModel().setCameraType(ye.CAMERA_3D),null===(a=this._lightSetting)||void 0===a||a.addToScene(),null===(i=this._roomleRenderer)||void 0===i||i.clearCache(),this._requestRender(),t(s)})})}preparePerspectiveImageOf(e,t={}){const n=this._getViewModel().getPlanObjectForId(e);if(!n){const t="Object with runtimeId "+e+" not found";throw console.warn(t),new Error(t)}return this._preparePerspectiveImage({...t,object:n.getObject().clone()})}async _waitForAssets(){await super._waitForAssets(),await this._getViewModel().materialQueue.finished(!0)}_preparePerspectiveImage(e={},t){if("configurator"===this._configuratorContext.baseContext&&t)return super.preparePerspectiveImage(e);const n=this._handlePlannerIsolationModeState(t);return new Promise((t,a)=>{this._getViewModel().materialQueue.finished(!0).then(async()=>{var a,i,r;let s;this.cameraBehaviour.cameraControl instanceof ge?s=this.cameraBehaviour.cameraControl.getCamera().clone():(s=this.getPerspectiveOffsetCamera().clone(),this._getViewModel().getCeilingGroup().visible=!1,s.layers.enableAll(),this._getViewModel().setCameraType(ye.CAMERA_3D)),s.resetOffset();let o=e.object?W.getCameraTargetForBBox((new De).setFromObject(e.object)):this._calculateBoundingBoxOfAllMeshes();null===(a=this._lightSetting)||void 0===a||a.removeFromScene();let l=e.object?K(this._scene):this._scene;e.object&&l.add(e.object);const c=await this._imageRenderer.preparePerspectiveImage(l,null,s,o,e,void 0,e=>{L(e,this._getViewModel().getWallPlanObjectViewModels())});U(s),e.object&&U(l),this.cameraBehaviour.cameraControl instanceof he?(this._getViewModel().setCameraType(ye.CAMERA_2D),this._getViewModel().getWallPlanObjectViewModels().forEach(e=>e.show())):L(this.cameraBehaviour.cameraControl.getCamera(),this._getViewModel().getWallPlanObjectViewModels()),null===(i=this._lightSetting)||void 0===i||i.addToScene(),null===(r=this._roomleRenderer)||void 0===r||r.clearCache(),this._requestRender(),this._setCeiling(),n(),t(c)},a)})}_handlePlannerIsolationModeState(e){if(!e){const e=this._configuratorContext.baseContext;return this._getViewModel().showAll(),this._configuratorContext.baseContext="planner",()=>{this._configuratorContext.baseContext=e,"configurator"===e&&(this._configureInRoom||this._hideAllExceptSelectedElement())}}return()=>null}_hideAllExceptSelectedElement(){const{planElementId:e}=this._configuratorContext,t=this.getRootPlanObjectId(e);this._getViewModel().hideAllExcept(t)}preparePerspectiveImage(e={},t){return this._preparePerspectiveImage(e,t)}_calculateBoundingBoxOfAllMeshes(e=0){const t=this.getBounds();return W.getCameraTargetForBBox(t,e)}enableRotation(){this._plannerSceneEventHandler.setState(2)}disableRotation(){this._plannerSceneEventHandler.resetState()}enableSnapping(){this._plannerSceneEventHandler.enableSnapping()}disableSnapping(){this._plannerSceneEventHandler.disableSnapping()}enableAdvancedDocking(){this._plannerSceneEventHandler.enableAdvancedDocking()}disableAdvancedDocking(){this._plannerSceneEventHandler.disableAdvancedDocking()}showsChildrenOfPlanObject(e){if(e instanceof p){const t=e.getKernelObject();return this._plannerSceneEventHandler.showsChildrenOfPlanObject(t)}return!1}enableShowChildrenOfPlanObject(e){if(e instanceof p){const t=e.getKernelObject();this._plannerSceneEventHandler.enableShowChildrenOfPlanObject(t)}}disableShowChildrenOfPlanObject(e){if(e instanceof p){const t=e.getKernelObject();this._plannerSceneEventHandler.disableShowChildrenOfPlanObject(t)}}dragIn(e){this._plannerSceneEventHandler.getSelectedIds().length>0&&this._plannerSceneEventHandler.cancelSelection("dragIn"),this._plannerSceneEventHandler.setDragIn(!0,e)}getPlannerSceneEventHandler(){return this._plannerSceneEventHandler}disablePlannerEvents(){this._plannerSceneEventHandler.disable()}enablePlannerEvents(){this._plannerSceneEventHandler.enable()}_onCameraIdle(){return super._onCameraIdle()&&(this._sendRoomMeasurements(),this._sendPlanObjectPositions(),this._roomlePlannerUiCallback.onCameraIdle(),this._sendElementMeasurements(),this._hideAllNodeIfThereAreNoSelections()),!0}_hideAllNodeIfThereAreNoSelections(){this.currentSelection||this.getPlannerSceneEventHandler().isCurrentlyDrawing||(this._getViewModel().getMeasurementLineObjectViewModels().forEach(e=>e.hideDraggableNodes()),this._getViewModel().getNodePlanObjectViewModels().forEach(e=>e.hide()))}_onCameraMove(){return super._onCameraMove()&&(this._roomlePlannerUiCallback.disableWallDimensions(),this._roomlePlannerUiCallback.cameraStartsMoving()),this._updateNodeSize(),this._renderEverything(),!0}_showWallNodes(){this._getViewModel().getNodePlanObjectViewModels().forEach(e=>e.show())}_updateNodeSize(){if(this.cameraBehaviour.cameraControl instanceof he){const e=1/this.cameraBehaviour.cameraControl.getCamera().zoom;this._getViewModel().setNodeZoom(e)}}_sendPlanObjectPositions(){if(this.cameraBehaviour.cameraControl.isLocked())return;const{clientWidth:e,clientHeight:t}=this._domHelper.element,n=this.cameraBehaviour.cameraControl.getCamera(),a=this._plannerSceneEventHandler.getSelectedIds();a.length>1?this._sendMultiSelectionPosition(a,n,e,t):this._sendSelectedPlanObjectPositions(n,e,t)}_sendMultiSelectionPosition(e,t,n,a){const i=new De;for(const t of e){const e=this._getViewModel().getPlanObjectForId(t);e&&i.expandByObject(e.getContainer())}const r=i.getCenter(new _e),s=E(M(r,t,n,a));this._roomlePlannerUiCallback.onUpdatePlanObjectPositions([{runtimeIds:e,position2d:s}])}_sendSelectedPlanObjectPositions(e,t,n){const a=this._getViewModel(),i=[],r=[...a.getStaticPlanObjectViewModels(),...a.getConfigurablePlanObjectViewModels(),...a.getConfigurableConstructionPlanObjectViewModels(),...a.getConstructionPlanObjectViewModels(),...a.getWallPlanObjectViewModels(),...a.getFloorPlanObjectViewModels(),...a.getNodePlanObjectViewModels()];for(const a of r)i.push(ot(a,e,t,n));this._roomlePlannerUiCallback.onUpdatePlanObjectPositions(i)}_sendRoomAreaData(){const e=this._getViewModel().getFloorPlanObjectViewModels(),t=this.cameraBehaviour.cameraControl.getCamera(),{clientWidth:n,clientHeight:a}=this._domHelper.element,i=[],r=this.cameraBehaviour.cameraControl.getKernelZoomFactor();this._initData.debug&&this._debugSpheres.floorPoints.children.length&&this._debugSpheres.floorPoints.clear();for(const s of e){const e=s.getFloorData(r);if(!e||!e.textPosition3d)return;if(e.formattedArea=this._unitFormatter.formatSquareMMValueToUnitString(e.area),e.textPosition2d=M(e.textPosition3d,t,n,a),i.push(N(e)),this._initData.debug){const t=new We(.1,32,16),n=new Me({color:255}),a=new Ie(t,n);a.position.copy(e.textPosition3d),this._debugSpheres.floorPoints.add(a)}}i.length>0&&this._roomlePlannerUiCallback.onFloorPlanAreasUpdated(i)}_updateMeasurementPositions(e,t,n,a){return e.fromPosition3d&&(e.fromPosition2d=M(e.fromPosition3d,t,n,a)),e.toPosition3d&&(e.toPosition2d=M(e.toPosition3d,t,n,a)),e.textPosition3d&&(e.textPosition2d=M(e.textPosition3d,t,n,a)),e}_sendElementMeasurements(e){this.cameraBehaviour.cameraControl instanceof he&&(this._sendConstructionElementDimensions(e),this._sendObjectMeasurements(e),this._sendMeasurementLineDimension())}_sendRoomMeasurements(){this.cameraBehaviour.cameraControl instanceof he&&(this._sendWallDimensions(),this._sendRoomAreaData())}_sendMeasurementLineDimension(){if(!(this.cameraBehaviour.cameraControl instanceof he))return;const e=this.cameraBehaviour.cameraControl.getCamera(),{clientWidth:t,clientHeight:n}=this._domHelper.element,a=[],i=this._getViewModel().getMeasurementLineObjectViewModels();for(const r of i){const i=r.getMeasurementLineDimension();i.fromPosition2d=M(i.fromPosition3d,e,t,n),i.toPosition2d=M(i.toPosition3d,e,t,n),i.textPosition2d=M(i.textPosition3d,e,t,n),i.lengthFormatted=this._unitFormatter.formatMMValueToUnitString(i.length),a.push(G(i))}this._roomlePlannerUiCallback.onUpdateMeasurementLineDimensions(a)}_sendObjectMeasurements(e){if(!(this.cameraBehaviour.cameraControl instanceof he))return;if(!this.currentSelection&&!e)return;const t=this._plannerSceneEventHandler.getSelectedIds();if(0===t.length&&!e)return;const n=e||this._getViewModel().getPlanObjectForId(t[0]);if(!n||n instanceof b||n instanceof P||!(n instanceof C)&&!(n instanceof p))return;const a=this.cameraBehaviour.cameraControl.getCamera(),{clientWidth:i,clientHeight:r}=this._domHelper.element,s=this.cameraBehaviour.cameraControl.getKernelZoomFactor(),o=n.getObjectMeasurements(s,i,r),l=this.transformMeasurements(o.rectMeasurements,a,i,r),c=this.transformMeasurements(o.objectMeasurements,a,i,r),h=this.transformMeasurements(o.objectToWallsMeasurements,a,i,r);this._roomlePlannerUiCallback.onUpdateObjectMeasurements({rectMeasurements:l,objectMeasurements:c,objectToWallsMeasurements:h})}transformMeasurements(e,t,n,a){return e.map(e=>{const i=M(e.fromPosition3d,t,n,a),r=M(e.toPosition3d,t,n,a),s=M(e.textPosition3d,t,n,a);return z({...e,fromPosition2d:i,toPosition2d:r,textPosition2d:s})})}_sendConstructionElementDimensions(e){if(!this.currentSelection&&!e)return;const t=e||this._getViewModel().getPlanObjectForId(this.currentSelection.staticItemRuntimeId||this.currentSelection.configurationRuntimeId);if(!t||!(t instanceof b||t instanceof P))return;this._initData.debug&&this._debugSpheres.constructionElementsPoints.children.length>0&&this._debugSpheres.constructionElementsPoints.clear();const n=this.cameraBehaviour.cameraControl.getCamera(),{clientWidth:a,clientHeight:i}=this._domHelper.element,r=this.cameraBehaviour.cameraControl.getKernelZoomFactor(),s=t.getConstructionElementMeasurements(r,a,i);if(!s)return;if(this._initData.debug){const e=new Me({color:16711680}),t=new Me({color:65280}),n=new Me({color:255}),a=new We(.1,32,16),i=new Ie(a,e);i.position.copy(s.leftMeasurement.fromPosition3d),i.position.y=5;const r=new Ie(a,e);r.position.copy(s.leftMeasurement.toPosition3d),r.position.y=5;const o=new Ie(a,t);o.position.copy(s.rightMeasurement.fromPosition3d),o.position.y=5;const l=new Ie(a,t);l.position.copy(s.rightMeasurement.toPosition3d),l.position.y=5;const c=new Ie(a,n);c.position.copy(s.elementRange.fromPosition3d),c.position.y=5;const h=new Ie(a,n);h.position.copy(s.elementRange.toPosition3d),h.position.y=5,this._debugSpheres.constructionElementsPoints.add(i),this._debugSpheres.constructionElementsPoints.add(r),this._debugSpheres.constructionElementsPoints.add(o),this._debugSpheres.constructionElementsPoints.add(l),this._debugSpheres.constructionElementsPoints.add(c),this._debugSpheres.constructionElementsPoints.add(h)}s.leftMeasurement=this._updateMeasurementPositions(s.leftMeasurement,n,a,i),s.rightMeasurement=this._updateMeasurementPositions(s.rightMeasurement,n,a,i),s.elementRange=this._updateMeasurementPositions(s.elementRange,n,a,i);const o={leftMeasurement:{...Z(s.leftMeasurement)},rightMeasurement:{...Z(s.rightMeasurement)},elementRange:{...Z(s.elementRange)}};this._roomlePlannerUiCallback.onUpdateConstructionElementsMeasurements(o)}_sendWallDimensions(e=!0){this._initData.debug&&this._debugSpheres.wallPoints.children.length>0&&this._debugSpheres.wallPoints.clear(),function(e,t,n,a,i,r,s,o=!0,l=!1){if(!(t.cameraControl instanceof he))return;if(t.cameraControl.isLocked()&&o)return;const c=[],{x:h,y:d}=e.getClientDimensions(),g=i.getWallPlanObjectViewModels(),m=t.cameraControl.getKernelZoomFactor(),u=t.cameraControl.getCamera();for(const e of g){const t=e.getWallDimension(m,h,d);t.isCurrentlyDrawn=a.isCurrentlyDrawing&&e.getPlanElement().getTo().extRef.jsObject===i.latestNodePlanObjectViewModel;const{isVectorWall:n}=e.getKernelObject();t.length<=0&&!n||(Ct(t,u,h,d),t.attic&&vt(t.attic,u,h,d),t.lengthFormatted=r.formatMMValueToUnitString(t.length),l&&ft(t,s),c.push(D(t)))}n.onUpdateWallDimensions(c)}(this._domHelper,this.cameraBehaviour,this._roomlePlannerUiCallback,this._plannerSceneEventHandler,this._getViewModel(),this._unitFormatter,this._debugSpheres,e,this._initData.debug)}enableWallDrawing(){if(this.cameraBehaviour.cameraControl instanceof he){const e=y(this.getBounds(),this._domHelper.element.clientWidth,this._domHelper.element.clientHeight);this.plannerCameraBehaviour.resetCameraOnEnableWallDrawing(e)}this._drawingEnabled||(this._drawingEnabled=!0,this._scene.add(this._plannerSceneEventHandler.enableWallDrawing()))}disableWallDrawing(){this._drawingEnabled=!1,this.cameraBehaviour.cameraControl.unlock(),this._scene.remove(this._plannerSceneEventHandler.cancelWallDrawing())}escapeDrawing(e){this._plannerSceneEventHandler.stopDrawing(e)}setSceneEvents(e){var t,n;this.cameraBehaviour.cameraControl instanceof me||(void 0!==e.construction&&(null===(t=this._plannerSceneEventHandler)||void 0===t||t.enableConstructionEvents(e.construction)),void 0!==e.objects&&(null===(n=this._plannerSceneEventHandler)||void 0===n||n.enableObjectEvents(e.objects)))}startedDrawing(){this._plannerSceneEventHandler.startDrawing(),this._showWallNodes()}stoppedDrawing(){this._plannerSceneEventHandler.stopDrawing()}disableEvents(){super.disableEvents(),this.disablePlannerEvents()}enableEvents(){super.enableEvents(),"planner"!==this._configuratorContext.baseContext||this.cameraBehaviour.cameraControl instanceof me||this.enablePlannerEvents()}resetCameraPositionToStart(){this.plannerCameraBehaviour.externalApiResetCameraPosition(this.getBounds())}async moveCamera(e){return this.plannerCameraBehaviour instanceof ut||this.plannerCameraBehaviour instanceof Qe?this.plannerCameraBehaviour.externalApiMoveCamera(e):Promise.resolve()}_setInteriorOrExteriorWallMaterial(e,t){const n=this._getViewModel().getWallPlanObjectViewModels();if(!n.length)return;const a=this._getKernelAccess().planInteractionHandler,i=e=>{a.setWallLeftMaterial(e,Ne(e.leftMaterial,t))},r=e=>{a.setWallRightMaterial(e,Ne(e.rightMaterial,t))},s=n.map(e=>e.getKernelObject()),o=this._plannerKernelAccess.kernelContainer.WallType.InnerWall,l=this._plannerKernelAccess.kernelContainer.WallType.OuterWallLeft,c=this._plannerKernelAccess.kernelContainer.WallType.OuterWallRight;for(const t of s)t.wallType===o&&"interior"===e&&(i(t),r(t)),t.wallType===l&&("interior"===e?r(t):i(t)),t.wallType===c&&("exterior"===e?r(t):i(t))}changeInteriorWallsMaterial(e){this._setInteriorOrExteriorWallMaterial("interior",e)}changeExteriorWallsMaterial(e){this._setInteriorOrExteriorWallMaterial("exterior",e)}changeFloorsMaterial(e){const t=this._getViewModel().getFloorPlanObjectViewModels();if(!t.length)return;const n=this._getKernelAccess().planInteractionHandler,a=t.map(e=>e.getKernelObject());n.startInteraction();for(const t of a)n.setFloorMaterial(t,Ne(t.material,e));n.endInteraction()}getWallAngleDegrees(e){if(!(e instanceof s))return 0;const t=this.cameraBehaviour.cameraControl.getCamera(),n=new fe(t.position.x,t.position.z),a=new fe(e.getPosition().x,e.getPosition().z).clone().sub(n).normalize(),i=e.getKernelObject(),r=new fe(Math.sin(i.getAngle()),Math.cos(i.getAngle())),o=a.angle()-r.angle();return Ge.radToDeg(o)}moveElementPosition(e,t){const n=this._getKernelAccess().planInteractionHandler;n.setObjectFixedZ(e.getPlanElement(),!0),n.moveElementTo(e.getPlanElement(),t),this._sendPlanObjectPositions()}moveElementsPosition(e,t){const n=new this._plannerKernelAccess.kernelContainer.PlanObjectPtrList;let a=_(t).sub(e[e.length-1].getPosition());e.forEach(e=>n.push_back(e.getPlanElement()));const i=d(a);this._getKernelAccess().planInteractionHandler.moveObjectsBy(n,i),this._sendPlanObjectPositions()}get plannerCameraBehaviour(){return this.cameraBehaviour}enableMeasurementLineDrawing(){this._roomlePlannerUiCallback.onMeasurementLineStateChange(!0),this._plannerSceneEventHandler.enableMeasurementLineDrawing()}disableMeasurementLineDrawing(){this._plannerSceneEventHandler.disableMeasurementLineDrawing()}setCompletelyLoaded(e){this._completelyLoaded=e}enablePanning(){this.plannerCameraBehaviour instanceof ut&&this.plannerCameraBehaviour.enablePanningOnShiftClick()}disablePanning(){this.plannerCameraBehaviour instanceof ut&&this.plannerCameraBehaviour.disablePanningOnShiftRelease()}setObjectToWallMeasurementLength(e,t,n){const a=this._getViewModel().getPlanObjectForId(e),i=a.getPlanElement(),r=q(i.getWallDistances()).find(e=>ze(e.angle+"_"+e.length)===t);if(!r)return;const s=_(r.startPoint),o=_(r.endPoint),l=s.clone().sub(o).normalize(),c=(n-r.length)/1e3,h=a.getPosition().clone().add(l.multiplyScalar(c));this._getKernelAccess().planInteractionHandler.moveElementTo(i,d(h)),this._sendObjectMeasurements()}setWallMeasurementLength(e,t,n){const a=this.getPlannerSceneEventHandler().isCurrentlyDrawing,i=this._getKernelAccess().planInteractionHandler;let r=this._getViewModel().getPlanObjectForId(e);const s=i.isVectorPreviewModeEnabled();if(a&&!s){const e=this._getViewModel().latestNodePlanObjectViewModel,t=d(e.getPosition());i.endDrawing(t),this.escapeDrawing(!1),r=this._getViewModel().latestWallPlanObjectViewModel}if(r){const e=r.getKernelObject();i.startInteraction(),i.setLengthOfWall(e,t,e.getPreferredSide(),n,!0),i.endInteraction()}if(a&&!s){i.startInteraction();const e=this._getViewModel().latestNodePlanObjectViewModel,t=d(e.getPosition());i.beginDrawing(t,!1),this._plannerSceneEventHandler.startDrawing()}}setMeasurementLineLength(e,t,n){const a=this._getViewModel().getPlanObjectForId(e);this._plannerSceneEventHandler.setMeasurementLineLength(a,t,n)}setEventHandlerObject(e){super.setEventHandlerObject(e),this._plannerSceneEventHandler.setObject(e)}_readyForRender(){this._roomlePlannerUiCallback.onReadyForRender(),this._globalCallback.onReadyForRender()}notifyPlannerOnComponentSelectionCancel(e,t){var n;if(e)if("configurator"===this.configuratorContext.baseContext){if("click_outside"===t){let e=this.getObjectComponent(null!==(n=this.configuratorContext.rootComponentId)&&void 0!==n?n:this.configuratorContext.planObjectId);this._roomlePlannerUiCallback.onExternalObjectModuleSelected(e.externalObjectGroupId,null,null)}}else this._roomlePlannerUiCallback.onExternalObjectSelectionCancel(t);else this._roomlePlannerUiCallback.onComponentSelectionCancel()}_planObjectSelectionChanged(e,t){var n,a;const i=this.getObjectComponent(null!=t?t:e);if((null===(n=null==i?void 0:i.configurationType)||void 0===n?void 0:n.value)!==S.EXTERNAL)return;let r=this.getObjectComponent(null!==(a=this.configuratorContext.selectedRuntimeComponentId)&&void 0!==a?a:this.configuratorContext.planObjectId);r.externalRootModuleId===i.externalRootModuleId&&r.externalSubModuleId===i.externalSubModuleId||this._getKernelAccess().planObjectSelectionChanged(e,t)}highlightExternalObject(e){this.highlightPlanElementById(e.runtimeId),this._renderWithoutShadowsAndAO()}_selectExternalObjectModule(){var e,t;(null===(e=this._getKernelAccess())||void 0===e?void 0:e.kernelContainer)&&!this._configuratorContext.selectedRuntimeComponentId&&(null===(t=this.getPlanObject(this._configuratorContext.planElementId).configurationType)||void 0===t?void 0:t.value)===S.EXTERNAL&&this.selectComponent(this._configuratorContext.rootComponentId)}getObjectComponent(e){const t=this._getKernelAccess().planInteractionHandler.getPlan();return this._getKernelAccess().planModelViewHelper.getObjectComponent(t,e)}getCameraParameters3d(){return this._getViewModel().cameraType===ye.CAMERA_3D?this.cameraBehaviour3d.cameraControl.getCurrentCameraParameters():null}}l([c],Mt.prototype,"_rapiAccess",void 0),l([c],Mt.prototype,"_plannerMeshGenerator",void 0),l([c],Mt.prototype,"_plannerInputManager",void 0),l([c],Mt.prototype,"_roomlePlannerUiCallback",void 0),l([c],Mt.prototype,"_localStorageHelper",void 0),l([c],Mt.prototype,"_unitFormatter",void 0);const It="Could not retrieve configuration for external object! Did you implement onGetConfigurationForExternalObject?",St={left:0,top:1,right:1,bottom:0};class Ot{constructor(e,t){this._hscInstance=null,this._glbInstance=null,this._configurator=null,this._currentMode=1,this._creator_=e,this._activePlugins=t||[],this._kernelAccessCallback.addListener(this)}setEnvironmentMap(e){const{url:t,intensity:n,rotation:a,maxLightSources:i}=e;this._sceneManager.setEnvironmentMap(t,n,a,i)}deleteSelection(){this._sceneManager.deletePlanElementSelection()}rotateSelection(e){this._sceneManager.rotatePlanElementSelection(e)}cancelSelection(e="unknown"){this._sceneManager.cancelPlanElementSelection(e)}init(e,t,n){return J.start("loadingTime"),this._domHelper.setDomElement(e),this._sceneManager?(this._lifeCycleManager.resume(),Promise.resolve()):(this._preloadPlanId=t,this.setOverrides(n),new Promise(this._initPromiseCallback.bind(this)))}async createPlanFromObject(e,t,n){if(!this._planInteractionHandler)throw new Error("no plan interaction handler");t&&(t=d(new _e(t.x,t.y,t.z)));const a=await(X(e)?this._rapiAccess.getItem(e):this._rapiAccess.getConfiguration(e));this._plan=this._plannerKernelAccess.createPlanFromObject(a,t,n),this._sceneManager.planXMLLoaded(this._plan),this._sceneManager.updateScene(),this.resetCameraPosition();const i=O(this._plan.getPlanObjects());return(null==i?void 0:i.length)?i[0].getId():-1}loadPlanXml(e,t){return this._sceneManager.setCompletelyLoaded(!1),this.setOverrides(t),new Promise(n=>{this._plan=this._planInteractionHandler.loadPlanXML(e),this._sceneManager.planXMLLoaded(this._plan),this._roomlePlannerUiCallback.onTotalFloorAreaChanged(this._planInteractionHandler.getPlan().getTotalFloorArea()),this._currentMode=1,this._initData.moc&&(t.id?this._rapiAccess.trackView(t.id,Q.ROOM_DESIGNER):this._rapiAccess.trackView("planXML",Q.ROOM_DESIGNER)),n()})}loadPlan(e,t){return this.setOverrides(t),new Promise((t,n)=>{const a=Y(e);(a?this._rapiAccess.getPlanSnapshot(e):this._rapiAccess.getPlan(e)).then(n=>{this._sceneManager.setCompletelyLoaded(!1);const i=a?n.plan:n.planObjects;this._plan=this._planInteractionHandler.loadPlanXML(i),this._sceneManager.planXMLLoaded(this._plan),this._roomlePlannerUiCallback.onTotalFloorAreaChanged(this._planInteractionHandler.getPlan().getTotalFloorArea()),this._configuratorContext.lastLoadedPlanId=e,this._currentMode=1,this._initData.moc&&this._rapiAccess.trackView(e,Q.ROOM_DESIGNER),t(n)},n)})}setOverrides(e){e&&(this._initData.setOverrides(e),this._globalInitData.setOverrides(e))}toggleConfigureInRoom(){this._sceneManager.toggleConfigureInRoom()}switch2D(){this._sceneManager.switchTo2D()}switch3D(){this._sceneManager.switchTo3D()}switchToFirstPerson(){this._sceneManager.switchToFirstPerson()}resetCameraPosition(){this._sceneManager.resetCameraPositionToStart()}exportGLB(){this._sceneManager.exportGLB()}importGLB(e){this._sceneManager.importGLB(e)}_initPromiseCallback(e,t){Promise.all([this._scriptLoader.fetch(ue,{id:"tween-js"})]).then(()=>{this._kernelReadyCallback=e;const{dls:t,ls:n,mode:a,stats:i}=this._initData;this._sceneManager||(this._sceneManager=new Mt(this._creator_,St,this,a)),this._preloadPlanId&&this._sceneManager.preload(this._preloadPlanId);const r=$.createDynamicLightSettingSource(t,n);i&&this.showStats(),this._sceneManager.enableHD(r),this._planInteractionHandler&&this._kernelReadyCallback()})}isReady(){this._planInteractionHandler=this._plannerKernelAccess.planInteractionHandler,this._kernelReadyCallback&&this._kernelReadyCallback()}showBenchmarks(){J.showBenchmarks()}getConfiguratorApi(){return this._configurator||(this._configurator=new Ye(this._creator_,this._activePlugins),this._configurator.setOverrides(this._initData),this._configurator.initSceneManager(this._sceneManager)),this._configurator}startViewing(){this._sceneManager.startViewing(),this._roomlePlannerUiCallback.onContextChanged("glb-viewer")}startConfiguring(){var e,t;const n=this._sceneManager.currentSelection,a=(null===(e=n.item)||void 0===e?void 0:e.id)||(null===(t=n.configuration)||void 0===t?void 0:t.id);this._sceneManager.startConfiguring(),a&&this._configurator.notifyUiAboutNewLabel(a),this._roomlePlannerUiCallback.onContextChanged("configurator")}async selectPlanObjectById(e){return this._sceneManager.selectPlanObject(e)}highlightPlanElements(e){null===e?this._sceneManager.highlightPlanElementsById(null):Array.isArray(e)?this._sceneManager.highlightPlanElementsById(e):this._sceneManager.highlightPlanElementById(e)}backToPlanner(){this._sceneManager.backToPlanner(),this._roomlePlannerUiCallback.onContextChanged("planner")}showGUI(){this._sceneManager.showGUI()}async switchToConfigurator(){const e=await this._singlePromiseFactory.create(3,"startHSC",e=>{if(this._hscInstance)return e(this._hscInstance);t.import("./configurator-002d161a.legacy.js").then(({Configurator:t})=>{const n=new t(this._creator_);n.boot({kernelInstance:this._planInteractionHandler.getConfiguratorKernel(),kernelContainer:this._plannerKernelAccess.kernelContainer}),n.getApi().setOverrides(this._initData),n.getApi().initSceneManager(this._sceneManager),n.getApi().init(this._domHelper.element).then(()=>{this._hscInstance=n,e(this._hscInstance)})})});return this._currentMode=0,this.cancelSelection("isolation_mode_started"),e}async switchToViewer(){const e=await this._singlePromiseFactory.create(4,"startGLB",e=>{if(this._glbInstance)return e(this._glbInstance);t.import("./glb-viewer-d3854b02.legacy.js").then(t=>{const n=new t.GlbViewer(this._creator_);n.boot(),n.getApi().setOverrides(this._initData),n.getApi().init(this._domHelper.element).then(()=>{this._glbInstance=n,e(this._glbInstance)})})});return this._currentMode=2,this.cancelSelection("isolation_mode_started"),e}switchToPlanner(e){e&&this.loadPlan(e),this._currentMode=1}updateSize(){this._sceneManager.updateCamera()}getMain(){}update(){this.updateSize(),this._glbInstance&&this._glbInstance.getApi().updateSize(),this._hscInstance&&this._hscInstance.getApi().updateSize()}get callbacks(){return this._roomlePlannerUiCallback}set callbacks(e){this._roomlePlannerUiCallback=e}get hasSingleRoom(){return this._sceneManager.hasSingleRoom}showStats(){this._sceneManager.showStats()}onCloseHSC(){this._hscInstance&&this._hscInstance.getApi().pauseKernelCallbacks()}back(){if(2===this._currentMode&&this._glbInstance&&this._glbInstance.getApi().clearScene(),0===this._currentMode&&this._hscInstance){const e=this._hscInstance.getApi();e.cancelSelection({reason:"isolation_mode_cancelled"}),e.cancelDockings(),e.hideDimensions(),e.disableMultiselect(),this._sceneManager.updateScene()}this._currentMode=1}backTo(e){console.error("backTo in planner Needs to be implemented later")}getConfigurator(){return this._hscInstance}getCurrentSkin(){return this._rapiAccess.getCurrentSkin()}getRuntimeComponentIdOfRootComponent(e){return e?this._plannerKernelAccess.planInteractionHandler?this._plannerKernelAccess.planInteractionHandler.getConfiguratorKernel().getRootPlanComponentIdFromObjectId(e):(console.warn("Can not retrieve runtime id without planInteractionHandler"),0):(console.warn("Can not retrieve runtime id without planObjectId"),0)}resumeTest(e){this._domHelper.setDomElement(e),this._lifeCycleManager.resume()}pauseTest(){this._lifeCycleManager.pause()}syncCatalog(e){return this._dataSyncer.syncCatalog(e)}loadError(e){}getPlanInteractionHandler(){return Promise.resolve(this._planInteractionHandler)}getPlanModelViewHelper(){return Promise.resolve(this._plannerKernelAccess.planModelViewHelper)}async insertObject(e,t,n){if(!this._planInteractionHandler)throw new Error("no plan interaction handler");if(t&&(t=d(new _e(t.x,t.y,t.z))),et(e)){if(t||n)throw new Error("External objects do not support position and rotation");return this._insertExternalObject(e)}const a=await(X(e)?this._rapiAccess.getItem(e):this._rapiAccess.getConfiguration(e)),i=await this._plannerKernelAccess.addPlanObjectFromItem(a,t,n);return this._sceneManager.updateScene(),i}async insertItemList(e){if(0===e.length)return[];const t=e.map((e,t)=>({id:e,index:t})),n=async(e,t)=>({runtimeId:await this._insertExternalObject(e),originalIndex:t}),a=[],i=[];for(const{index:e,id:r}of t)et(r)?a.push(n(r,e)):i.push({index:e,id:r});const r=(async e=>{const t=e.map(({id:e})=>X(e)?this._rapiAccess.getItem(e):this._rapiAccess.getConfiguration(e)),n=await Promise.all(t);return(await this._plannerKernelAccess.insertItems(n)).map((t,n)=>({runtimeId:t,originalIndex:e[n].index}))})(i),[s,o]=await Promise.all([Promise.all(a),r]),l=[...s,...o];return l.sort((e,t)=>e.originalIndex-t.originalIndex),l.map(e=>e.runtimeId)}async insertItems(e){if(0===e.length)return[];const t=e.map(e=>"string"==typeof e?e:e.id);return this.insertItemList(t)}duplicateItems(e){return this._plannerKernelAccess.duplicateItems(e)}getScene(){return this._sceneManager.getScene()}updateScene(){this._sceneManager.updateScene()}getCameraOffset(){return this._sceneManager.getCameraOffset()}setCameraOffset(e){this._sceneManager.setCameraOffset(e)}async getObjects(){const e=(await this.getPlanModelViewHelper()).getPlanOverview(this._plan),t=O(e.objects);return ht(t,this._plannerKernelAccess,this._rapiAccess)}async getPlanOverview(){const e=(await this.getPlanModelViewHelper()).getPlanOverview(this._plan);return O(e)}prepareTopImage(e={}){return this._sceneManager.prepareTopImage(e)}preparePerspectiveImage(e={},t=!1){return this._sceneManager.preparePerspectiveImage(e,t)}enableRotation(){this._sceneManager.enableRotation()}disableRotation(){this._sceneManager.disableRotation()}enableMultiselect(){this._sceneManager.getPlannerSceneEventHandler().setSelectionMode("multiselect"),this._configuratorContext.selectionMode="multiselect"}disableMultiselect(){this._sceneManager.getPlannerSceneEventHandler().setSelectionMode("standard"),this._configuratorContext.selectionMode="standard"}async _insertExternalObject(e,t={}){var n,a,i;let r=e;if(et(e)&&(r=await this._roomlePlannerUiCallback.onGetConfigurationForExternalObject(e),!r))throw new Error(It);if(tt(e)&&(null===(n=e.externalMeta)||void 0===n?void 0:n.refresh)&&(r=await this._roomlePlannerUiCallback.onGetConfigurationForExternalObject(e.id),!r))throw new Error(It);const s=null===(a=t.findFreeSpaceInPlan)||void 0===a||a,o=null!==(i=t.dragIn)&&void 0!==i&&i;return await this._loadExternalObjectGroup(r,s,o,!1),-1}async dragInObject(e,t,n="rml_id"){if("rml_serialized"===n)throw new Error("dragInObject is not supported for tc_id or rml_serialized");if(this._sceneManager.dragIn(t),"rml_id"===n){const t=X(e)?await this._rapiAccess.getItem(e):await this._rapiAccess.getConfiguration(e),n=await this.insertItems([t]);if(1!==n.length)throw new Error("More than one object added, abort");return n[0]}if("tc_id"===n||"tc_serialized"===n)return this._insertExternalObject(e,{dragIn:!0});throw new Error("dragInObject is not supported for "+n)}enableSnapping(){this._sceneManager.enableSnapping()}disableSnapping(){this._sceneManager.disableSnapping()}enableAdvancedDocking(){this._sceneManager.enableAdvancedDocking()}disableAdvancedDocking(){this._sceneManager.disableAdvancedDocking()}showsChildrenOfPlanObject(e){return this._sceneManager.showsChildrenOfPlanObject(e)}enableShowChildrenOfPlanObject(e){this._sceneManager.enableShowChildrenOfPlanObject(e)}disableShowChildrenOfPlanObject(e){this._sceneManager.disableShowChildrenOfPlanObject(e)}async getPartlistOf(e){const t=this._plannerKernelAccess.kernelInstance.getHashOfConfiguration(e);if(!t){const e="Object has no partlist because it is not a configuration: "+t;return console.warn(e),Promise.reject(e)}const n=this._plannerKernelAccess.kernelInstance.getPartList(e);return await this._plannerKernelAccess.addUiDataAndPriceToPartList(n,t)}formatValueToUnitString(e,t){return this._unitFormatter.formatValueToUnitString(e,t)}drawWalls(e,t={}){var n,a;const i=this._planInteractionHandler;i.startInteraction();const r=[];for(const t of e){const e=i.addNode(t.from),s=i.addNode(t.to),o=i.addWall(e,s);void 0!==(null===(n=t.props)||void 0===n?void 0:n.height)&&i.setWallHeight(o,t.props.height),void 0!==(null===(a=t.props)||void 0===a?void 0:a.thickness)&&i.setWallThickness(o,t.props.thickness),r.push(o)}return t.keepInteractionOpen||i.endInteraction(),this._sceneManager.updateCameraOnDrawWalls(),this._sceneManager.updateScene(),r}async removeElements(e,t={}){this._sceneManager.lockCamera();const n=this._planInteractionHandler;for(const t of e){const e=this._sceneManager.getPlanObject(t.getId());let n;e&&(n=await ht([e],this._plannerKernelAccess,this._rapiAccess)),this._roomlePlannerUiCallback.onPlanElementChanged(A.REMOVED,(null==n?void 0:n.length)?n[0]:{...e,data:null}),this._planInteractionHandler.removeElement(t)}t.keepInteractionOpen||n.endInteraction(),this._sceneManager.unlockCamera()}hasWalls(){const e=this._planInteractionHandler,t=null==e?void 0:e.getPlan();return!(!t||t.getWallCount()<1)}enableWallDrawing(){this._sceneManager.enableWallDrawing()}disableWallDrawing(){this._sceneManager.disableWallDrawing()}getUnitFormatter(){return this._unitFormatter}getStorage(){return this._idbManager}getConfiguratorContext(){return this._configuratorContext}get PlannerCoreTypes(){return this._plannerKernelAccess.kernelContainer}setSceneEvents(e){this._sceneManager.setSceneEvents(e)}async saveExternalObjectSnapshot(e){const t=await this.getPlanModelViewHelper(),n=this._planInteractionHandler.getPlan(),a=O(t.getExternalObjectGroups(n)).map(e=>e.uniqueId);if(0===a.length)return null;const i=await this.saveCurrentPlanSnapshot(e,a);return{...i,glb:`https://api.roomle.com/v2/planSnapshots/${i.id}/3dAssets/glTF/plan.glb`,usdz:`https://api.roomle.com/v2/planSnapshots/${i.id}/3dAssets/usdz/plan.usdz`}}async saveCurrentPlanSnapshot(e,t){const n=await this.getPlanModelViewHelper(),a=this._planInteractionHandler.getPlan(),i=n.getPlanOverview(a),r={parentId:e||null,planObjects:[],combinedIds:[],plan:t?a.createPlanXmlWithObjects(t,!1,2):a.getPlanXML(!1,2)},s=i.objects,o=s.size();for(let e=0;e<o;e++){const n=s.get(e),a=n.configurationHash||n.catalogItemId;if(!t||a===t){const{center:e,dimensions:t,rotation:i,rootComponentCenter:s}=n,o=JSON.stringify({center:e,dimensions:t,rotation:i,rootComponentCenter:s});r.planObjects.push({combinedId:a,position:o})}}const l=await this._rapiAccess.savePlanSnapshot(r);this._plannerKernelAccess.planSnapshotCreated(l);const c=new Promise((e,t)=>{Promise.allSettled([this.preparePerspectiveImage(),this.prepareTopImage()]).then(async([n,a])=>{if("rejected"!==n.status&&"rejected"!==a.status)try{const t=await this._rapiAccess.savePlanSnapshotImage(l,n.value,"perspectiveImage",a.value,"topImage");e({...t})}catch(e){t(e)}else t("Could not generate images of plan snapshot")})});try{return await c}catch(e){return console.error(e),l}}getPlanXmlFrom(e){return e?Y(e.id)?e.plan:e.planObjects:null}async moveCamera(e){return this._sceneManager.moveCamera(e)}async createNewSerializedConfiguration(e){return Promise.resolve(this._plannerKernelAccess.createNewSerializedConfiguration(e))}changeInteriorWallsMaterial(e){this._sceneManager.changeInteriorWallsMaterial(e)}changeExteriorWallsMaterial(e){this._sceneManager.changeExteriorWallsMaterial(e)}changeFloorsMaterial(e){this._sceneManager.changeFloorsMaterial(e)}getWallAngleDegrees(e){return this._sceneManager.getWallAngleDegrees(e)}calcPartsPriceSum(e){return this._plannerKernelAccess.calcPartsPriceSum(e)}async swapObject(e,t){const n=e.getPosition(),a=e.getRotation();return await this._sceneManager.deletePlanElementByIds([e.getPlanElement().getId()]),this.cancelSelection("swap_object"),await this.insertObject(t,n,a)}exportImageFromCamera(e="image",t=!1){return this._sceneManager.exportImageFromCamera(e,t)}exportCanvasScreenshot(e){return this._sceneManager.exportCanvasScreenshot(e)}moveElementPosition(e,t){this._sceneManager.moveElementPosition(e,t)}moveElementsPosition(e,t){this._sceneManager.moveElementsPosition(e,t)}preparePerspectiveImageOf(e,t={}){return this._sceneManager.preparePerspectiveImageOf(e,t)}async generateTCExport(e=[]){try{const t=new this._plannerKernelAccess.kernelContainer.StringArray;for(const n of e)t.push(n);return Promise.resolve(JSON.parse(this._planInteractionHandler.generateTCExport(t)))}catch(e){return console.error(e),Promise.reject("Could not create Blue Ocean MVP JSON")}}enableMeasurementLineDrawing(){this._sceneManager.enableMeasurementLineDrawing()}disableMeasurementLineDrawing(){this._sceneManager.disableMeasurementLineDrawing()}setObjectToWallMeasurementLength(e,t,n){this._sceneManager.setObjectToWallMeasurementLength(e,t,n)}setWallMeasurementLength(e,t,n){this._sceneManager.setWallMeasurementLength(e,t,n)}setMeasurementLineLength(e,t,n){this._sceneManager.setMeasurementLineLength(e,t,n)}escapeDrawing(e){this._sceneManager.escapeDrawing(e),this._roomlePlannerUiCallback.onDrawCancel()}isCurrentlyDrawing(){return this._sceneManager.getPlannerSceneEventHandler().isCurrentlyDrawing}async resolveShortUrl(e){const[,,,t]=e.split("/"),n=await this._rapiAccess.resolveShortUrl(t);if(!n)throw new Error("Failed to resolve short URL");const{url:a}=n;return a}enableEvents(){this._sceneManager.enableEvents()}disableEvents(){this._sceneManager.disableEvents()}async downloadHomagIxExportPoC(){const{downloadHomagIxExportPoC:e}=await t.import("./imos-ix-poc-export-helper-ee70d653.legacy.js");return e((await this.getPlanModelViewHelper()).getPlanOverview(this._plan),this._plannerKernelAccess.configurationExporter,this._plannerKernelAccess.kernelInstance)}async configureExternalObjectApi(e){let t="string"==typeof e?JSON.parse(e):e;await this._plannerKernelAccess.configureExternalObjectApi(t)}loadExternalObjectLibrary(e){const t=this._planInteractionHandler.getConfiguratorKernel(),n="string"==typeof e?e:JSON.stringify(e);t.loadExternalAttributeDefinition(n),this.updateScene()}async loadExternalObjectGroup(e,t,n=!1,a=[]){return this._loadExternalObjectGroup(e,t,!1,n,a)}async _loadExternalObjectGroup(e,t,n,a,i=[]){"configurator"===this.getConfiguratorContext().baseContext?await this._loadExternalObjectGroupInConfigurator(e,t,n,a,i):await this._loadExternalObjectGroupInPlanner(e,t,n,a,i)}async _loadExternalObjectGroupInConfigurator(e,t,n,a,i=[]){await this._loadOrUpdateExternalObjectGroup(e,t,n,a,i,!0),this.updateScene()}async _loadExternalObjectGroupInPlanner(e,t,n,a,i=[]){var r;const s=this.getConfiguratorContext(),o=this._sceneManager.getPlanObject(s.planElementId);if(await this._loadOrUpdateExternalObjectGroup(e,t,n,a,i,!1),(null===(r=o.configurationType)||void 0===r?void 0:r.value)===S.EXTERNAL)if(i.includes(o.configurationHash)){const t=this._createSerializedGroupCollection(e),n=JSON.parse(t[0]).id;await this._selectExternalObjectGroup(n,!1)}else await this._selectExternalObjectGroup(o.configurationHash,!1);this.updateScene()}async _loadOrUpdateExternalObjectGroup(e,t,n,a,i,r){const s=this._createSerializedGroupCollection(e);n?this._planInteractionHandler.startInteraction():this._planInteractionHandler.resumeInteraction();const o=n&&!r?this._getFaceTheCameraAngle(90):0,l={findFreeSpaceInPlan:t,applyGlobalChildMode:!1,isVisible:!n,correctArrangement:a},c=this._planInteractionHandler.addOrUpdateExternalPlanObjects(s,{x:0,y:0,z:0},o,l,i);n||this._planInteractionHandler.endInteraction();const h=this._planInteractionHandler.getPlan().extRef.jsObject,d=[];for(const e of c)e.hasConfiguration()&&d.push(h.getConfigurablePlanObjectForId(e.getId()));await Promise.all(d.map(async e=>{await e.isInitDone()}))}_createSerializedGroupCollection(e){const t=Array.isArray(e)?e:[e],n=[];for(const e of t){const t="string"==typeof e?e:JSON.stringify(e);n.push(t)}return n}_getFaceTheCameraAngle(e){const t=this._sceneManager.getCameraParameters3d();if(!(null==t?void 0:t.yaw))return 0;const n=ee(t.yaw),a=Math.round(n/e)*e;return te(a)}async renderImagesOfExternalObjectGroup(e){const t=Array.isArray(e)?e:[e],n={},a=this._initData.animateCamera;this._initData.animateCamera=!1;for(const e of t){try{await this._loadExternalObjectGroup(e,!1,!1,!1),await this._selectExternalObjectModule(e.id,null,!0,!0,!1,!1),this.preparePerspectiveImage(),await this._sceneManager.waitForMaterialQueue(),this.updateScene();const t=await this.exportCanvasScreenshot();n[e.id]=t}catch(e){console.error(e)}this.backToPlanner()}for(const e of t)await this.removeExternalObjectGroup(e.id,!1);return this._initData.animateCamera=a,n}async removeExternalObjectGroup(e,t=!1){const n=await this.getPlanModelViewHelper(),a=this._planInteractionHandler.getPlan(),i=n.getExternalObjectComponent(a,e,"");this.getConfiguratorContext().planElementId===i.runtimeId&&this._sceneManager.cancelPlanElementSelection("delete_object"),0!==i.runtimeId&&(t?(this._planInteractionHandler.resumeInteraction(),this._planInteractionHandler.removeObjectWithId(e),this._planInteractionHandler.endInteraction()):(this._planInteractionHandler.startInteraction(),this._sceneManager.deletePlanElementByIds([i.runtimeId]),this._planInteractionHandler.endInteraction())),this.updateScene()}removeExternalObjectRootModule(e){this._planInteractionHandler.startInteraction(),this._planInteractionHandler.removeObjectWithId(e),this._planInteractionHandler.endInteraction(),this.updateScene()}async selectExternalObjectGroup(e){"configurator"===this.getConfiguratorContext().baseContext||this._planInteractionHandler.setShowChildrenOfExternalObject(e,{value:v.OFF},!1),await this._selectExternalObjectGroup(e,!0),this.updateScene()}async selectExternalObjectRootModule(e){const t="configurator"===this.getConfiguratorContext().baseContext;t||this._planInteractionHandler.setShowChildrenOfExternalObject(e,{value:v.GROUND_COMPONENTS},!1),await this._selectExternalObjectModule(e,null,!t,t,!0,!0),this.updateScene()}async selectExternalObjectSubModule(e,t){const n="configurator"!==this.getConfiguratorContext().baseContext;await this._selectExternalObjectModule(e,t,n,!0,!0,!0),this.updateScene()}async openOrCloseGeometryOfExternalObject(e,t,n,a){const i=await this.getPlanModelViewHelper(),r=this._planInteractionHandler.getPlan(),s=i.getExternalObjectComponent(r,e,"");if(null==s?void 0:s.configurationRuntimeId){const e=n?"open":"close";this._sceneManager.animateElement(s.configurationRuntimeId,"openClose",e,!0,a),this.updateScene()}}async _selectKernelComponent(e){e.configurationHash&&e.configurationType.value===S.EXTERNAL&&await this._selectExternalObjectModule(e.configurationHash,e.componentId,!0,!0,!0,!1),this.updateScene()}async _selectExternalObjectGroup(e,t){const n=await this.getPlanModelViewHelper(),a=this._planInteractionHandler.getPlan(),i=n.getExternalObjectComponent(a,e,"");0!==i.runtimeId&&(t&&await this._roomlePlannerUiCallback.onBackToPlanner(),await this._sceneManager.selectPlanObject(i.runtimeId))}async _selectExternalObjectModule(e,t,n,a,i,r){const s=await this.getPlanModelViewHelper(),o=this._planInteractionHandler.getPlan(),l=s.getExternalObjectComponent(o,e,null!=t?t:"");if(0===l.runtimeId)return;const c="configurator"===this.getConfiguratorContext().baseContext,h=this._getSelectedPlanObjectComponent();let d=!1,g=n;c&&(d=(null==h?void 0:h.configurationRuntimeId)===l.configurationRuntimeId,g=!d,d||this._sceneManager.backToPlanner()),g&&await this._selectPlanObject(l),a&&!d&&await this._roomlePlannerUiCallback.onStartConfiguring(),0!==l.planComponentRuntimeId&&i&&this._sceneManager.selectComponent(l.planComponentRuntimeId,!1),r&&!c&&this._sceneManager.highlightExternalObject(l)}async _selectPlanObject(e){let t=e.runtimeId;const n=O(this._plan.getPlanObjects());for(const a of n)if(a.getConfigurationRuntimeId()===e.planComponentRuntimeId){t=a.getId();break}await this._sceneManager.selectPlanObject(t)}_getSelectedPlanObjectComponent(){var e;const t=this.getConfiguratorContext(),n=null!==(e=t.selectedRuntimeComponentId)&&void 0!==e?e:t.planObjectId;return this._sceneManager.getObjectComponent(n)}async getExternalObjectGroups(){const e=await this.getPlanModelViewHelper(),t=this._planInteractionHandler.getPlan(),n=[],a=O(e.getExternalObjectGroups(t));for(const e of a)n.push(JSON.parse(e.serializedDefinition));return n}get globalCallbacks(){return this._globalCallback}_executeWithInteraction(e){const t=this._plannerKernelAccess.planInteractionHandler;t.startInteraction();const n=e();return t.endInteraction(),n}addAtticToWall(e,t,n,a){return this._executeWithInteraction(()=>this._plannerKernelAccess.planInteractionHandler.addAttic(e,t,n,a)||null)}removeAttic(e){this._executeWithInteraction(()=>this._plannerKernelAccess.planInteractionHandler.removeElement(e))}setAtticSide(e,t){this._executeWithInteraction(()=>this._plannerKernelAccess.planInteractionHandler.setAtticSide(e,t))}getAttachedAttic(e){const t=e.getAttachedAttics();return t.size()>0?t.get(0):null}updateAtticKneeHeight(e,t){this._executeWithInteraction(()=>this._plannerKernelAccess.planInteractionHandler.setAtticKneeHeight(e,t))}updateAtticWidth(e,t){this._executeWithInteraction(()=>this._plannerKernelAccess.planInteractionHandler.setAtticWidth(e,t))}}l([c],Ot.prototype,"_configuratorContext",void 0),l([c],Ot.prototype,"_domHelper",void 0),l([c],Ot.prototype,"_scriptLoader",void 0),l([c],Ot.prototype,"_kernelAccessCallback",void 0),l([c],Ot.prototype,"_plannerKernelAccess",void 0),l([c],Ot.prototype,"_rapiAccess",void 0),l([c],Ot.prototype,"_singlePromiseFactory",void 0),l([c],Ot.prototype,"_roomlePlannerUiCallback",void 0),l([c],Ot.prototype,"_lifeCycleManager",void 0),l([c],Ot.prototype,"_dataSyncer",void 0),l([c],Ot.prototype,"_initData",void 0),l([c],Ot.prototype,"_idbManager",void 0),l([c],Ot.prototype,"_globalInitData",void 0),l([c],Ot.prototype,"_globalCallback",void 0),l([c],Ot.prototype,"_unitFormatter",void 0);const yt=[new ae("script-loader",n),new ae("planner-input-manager",class extends ne{_canDrag(e){return!0}},1),new ae("logger",ie),new ae("planner-mesh-generator",re),new ae("rapi-access",se),new ae("planner-selection-handler",class extends r{constructor(){super(...arguments),this._selectionMode="standard",this._selectedPlanElementViewModels=new Map}check(e){"standard"===this._selectionMode&&this._checkStandard(e),"multiselect"===this._selectionMode&&this._checkMulti(e)}removeSelection(){this._selectedPlanElementViewModels.clear()}cancelSelection(e){0!==this._selectedPlanElementViewModels.size&&this._selectedPlanElementViewModels.forEach((t,n)=>{this._selectedPlanElementViewModels.delete(n),t.deselect(),this.dispatchEvent(1,new it({planElementViewModel:t,reason:e}))})}_checkStandard(e){const t=e.getId();this._selectedPlanElementViewModels.has(t)&&this._selectedPlanElementViewModels.get(t)||(this._selectedPlanElementViewModels.size>0&&this._selectedPlanElementViewModels.forEach((e,t)=>{this._selectedPlanElementViewModels.delete(t),e.deselect(),this.dispatchEvent(1,new it({planElementViewModel:e,reason:"select_other"}))}),this._selectedPlanElementViewModels.set(e.getId(),e),e.select(),this.dispatchEvent(0,new it({planElementViewModel:e})))}_checkMulti(e){at(e)||this._selectedPlanElementViewModels.has(e.getId())||(this._selectedPlanElementViewModels.set(e.getId(),e),e.select(),this.dispatchEvent(2,new it({planElementViewModels:this.getSelectedPlanElementViewModels()})),this.dispatchEvent(0,new it({planElementViewModel:e})))}_deselectWallAndFloorElements(){this._selectedPlanElementViewModels.forEach((e,t)=>{at(e)&&(this._selectedPlanElementViewModels.delete(t),e.deselect(),this.dispatchEvent(1,new it({planElementViewModel:e,reason:"selection_mode_changed"})))})}setSelectionMode(e){this._selectionMode!==e&&("multiselect"===e&&this._deselectWallAndFloorElements(),this._selectionMode=e,this.dispatchEvent(3,new it({selectionMode:e})))}getSelectionMode(){return this._selectionMode}hasSelection(){return this._selectedPlanElementViewModels.size>0}hasMultiSelection(){return this._selectedPlanElementViewModels.size>1}getSelectedPlanElementViewModels(){return[...this._selectedPlanElementViewModels].map(([e,t])=>t)}getSelectedIds(){let e=[];return this._selectedPlanElementViewModels.forEach(t=>e.push(t.getId())),e}isSelected(e){return!!this._selectedPlanElementViewModels.get(e)}})];e("Planner",class extends a{constructor(e,t){super(e),this._activePlugins=t||[]}setupGlobals(){}setupDependencies(){oe.setup(yt),this.lookup("logger",this._context),this.lookup("planner-kernel-access",this._context).init(0)}cleanUpGlobals(){throw new Error("Method not implemented.")}cleanUpDependencies(){throw new Error("Method not implemented.")}bootFinished(){this._planner=new Ot(this._context,this._activePlugins),this._planner.getMain=()=>this,window.RoomlePlanner||(this._activePlugins.length,window.RoomlePlanner=this._planner)}getApi(){return this._planner}getContextName(){return"planner"}})}}}));
|
|
2
|
-
//# sourceMappingURL=planner-f0a71818.legacy.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
System.register(["./main-thread-to-worker-da6ad96a.legacy.js"],(function(t){var e;return{setters:[function(t){e=t.bU}],execute:function(){t("g",(function(t){t||(t=window.location.href);const r=t.split("?");if(2!==r.length)return{};const n=r[1].split("&");let a={};return n.forEach(t=>{const r=t.split("=");let n=r[0],i=r[1];var s,o;"true"===i&&(i=!0),"false"===i&&(i=!1),o=s=i,!Number.isNaN(o)&&!isNaN(o)&&Number.isFinite(parseFloat(s))&&(i=parseFloat(i)),"mode"===n&&(i=e(i)),a[r[0]]=i}),a}))}}}));
|
|
2
|
-
//# sourceMappingURL=query-params-helper-e3e05119.legacy.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"query-params-helper-e3e05119.legacy.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
System.register(["./roomle-dependency-injection-058aa06f.legacy.js","./camera-behaviour-b47dbdd3.legacy.js","./main-thread-to-worker-da6ad96a.legacy.js","./default-light-setting-af961df8.legacy.js","./external-objects-2fd4ef1a.legacy.js"],(function(e,t){var n,i,o,s,r,a,l,c,h,d,_,u,g,m,p,C,f,v,b,w,P,y,M,I,O,E,D,S,A,x,k,H,j,R,V,L,B,T,F,G,K,U,W,N,q,z,Z,Q,J,X,Y,$,ee,te,ne,ie,oe,se,re,ae,le,ce,he,de,_e,ue,ge,me,pe,Ce,fe,ve,be,we,Pe,ye,Me,Ie,Oe,Ee,De,Se,Ae,xe,ke,He;return{setters:[function(e){n=e._,i=e.i,o=e.b,s=e.c,r=e.d,a=e.e,l=e.s,c=e.m,h=e.B,d=e.f,_=e.g,u=e.h,g=e.k,m=e.j,p=e.C,C=e.l,f=e.n,v=e.S,b=e.M,w=e.W,P=e.o,y=e.F,M=e.p,I=e.N,O=e.P,E=e.E,D=e.q,S=e.v,A=e.r,x=e.t,k=e.u,H=e.w,j=e.x,R=e.y,V=e.z,L=e.G,B=e.H,T=e.J,F=e.K,G=e.O,K=e.Q,U=e.T,W=e.U,N=e.V,q=e.X,z=e.Y,Z=e.A,Q=e.Z,J=e.$,X=e.a0,Y=e.a1,$=e.a2},function(e){ee=e.R,te=e.b,ne=e.S,ie=e.P,oe=e.c,se=e.B,re=e.D,ae=e.C,le=e.F,ce=e.T},function(e){he=e.x,de=e.B,_e=e.Y,ue=e.ak,ge=e.H,me=e.aM,pe=e.a,Ce=e.bM,fe=e.bN,ve=e.V,be=e.Q,we=e.bK,Pe=e.aK,ye=e.bO,Me=e.bP,Ie=e.bQ,Oe=e.aN,Ee=e.ao,De=e.bR,Se=e.aL,Ae=e.bS,xe=e.bT},function(e){ke=e.D},function(e){He=e.c}],execute:function(){class je{constructor(e){this._mergeThreshold=3,this._componentsToMerge=new Re,this._mergeInProgress=!1,this._components=new Map,this._previews=new Map,this._componentNumberOfPossibleChildren=new Map,this._creator_=e,this._getKernelAccess().addConfiguratorListener(this),this._componentFactory=ee()}get materialQueue(){return this.getMeshGenerator().materialQueue}_getKernelAccess(){return o.lookup("planner-kernel-access",this._creator_)}_applyMeshTransform(e,t,n,i,o,r,a){if(i){const e=t.userData.transform=s(i);n&&(t.userData.transform=e),t.applyMatrix4(e)}this._applyMeshUVTransform(t,n,o,a),this._addMeshAnimations(e,t,r)}_applyMeshUVTransform(e,t,n,i){if(6!==(null==n?void 0:n.length)||r(n))t&&(t.uvTransform=void 0),i&&(e.geometry=i);else{const o=a(n);t&&(t.uvTransform=o);const s=null!=i?i:e.geometry;if(s&&s.attributes.uv){const t=s.clone();t.attributes.uv.applyMatrix4(o),e.geometry=t}}}_addMeshAnimations(e,t,n){var i;n||(t.userData.animations=void 0);const o=new Map,r=this.getComponent(e);for(const e in n){const a={matrix:s(n[e].matrix),visible:n[e].visibility,initial:n[e].initial};o.set(e,a);let c=a.initial;if(null==r?void 0:r.animationValues){const t=e.split(":");c=(null===(i=null==r?void 0:r.animationValues)||void 0===i?void 0:i.get(t[0]))===t[1]}if(c){if(t.userData.transform){const e=t.userData.transform.clone().multiply(a.matrix);l(t,e)}t.visible=a.visible}}t.userData.animationMatrixMap=o}_animateComponent(e,t,n,i,o){const s=t.split(":")[1];e.animateMeshes&&e.animateMeshes(s,n,i,o,this._invalidateRenderCallback)}updateAnimationParameters(e,t){const n=[];for(const e of t)e.key.startsWith("animation:")&&n.push(e);if(0===n.length)return;const i=Array.isArray(e)?e:[e];for(const e of i){const t=this.getComponentFromElementId(e);if(null==t?void 0:t.animationValues)for(const e of n){const n=e.key.split(":")[1],i=t.animationValues.get(n);i&&(e.value=i)}else if(t){t.animationValues=new Map;for(const e of n){const n=e.key.split(":")[1];t.animationValues.set(n,e.value)}}}}changeAnimationValue(e,t,n,i,o){const s=this.getComponentFromElementId(e);s&&(i?s.traverse(e=>{e.id&&this._changeAnimationValue(e,t,n,o)}):this._changeAnimationValue(s,t,n,o))}_changeAnimationValue(e,t,n,i){e.animationValues||(e.animationValues=new Map);const o=t.split(":")[1],s=e.animationValues.get(o);e.animationValues.set(o,n),this._animateComponent(e,t,s,n,i)}getComponentFromElementId(e){let t=this.getComponent(e);if(!t){const n=this._getKernelAccess().kernelInstance.getRootPlanComponentIdFromObjectId(e);t=this.getComponent(n)}return t||console.warn("component not found!",e),t}_addMeshToSubPart(e,t,n,i,o,s,r,a,l,c,h){const d=this._generateMesh(e,t,n,s,r,a,l,void 0,void 0,c);this._applyMeshTransform(e,d,null,i,o,h),this._subPartObject.add(d)}_addMeshToComponent(e,t,n,i,o,s,r,a,l,c,h,d,_){if(this._subPartGuard&&this._subPartGuard.info===e)return void this._addMeshToSubPart(e,null,i,null,null,r,a,l,c,d,_);const u=this.getComponent(e);if(!u)return;const g=this._componentFactory.isPreview(u),m=this._generateMesh(e,n,g?null:i,r,a,l,c,void 0,void 0,d);m.userData.meshId=t,m.userData.geometryId=n,m.userData.materialId=i,this._applyMeshTransform(e,m,m.userData,o,s,_),g&&m.layers.set(5),u&&u.addMesh(m),u.meshes.length>this._mergeThreshold&&this._componentsToMerge.set(e,u.meshes.length)}_changeMeshOfComponent(e,t,n,i,o,s,r,a){const l=this.getComponent(e);if(!l)return;const c=l.getMeshById(t);if(c){c.userData.geometryId!==n&&console.warn("Geometry of mesh has changed!"),c.userData.materialId=i,c.userData.materialAttributes=r;const t=c.material.clone();this._configuratorMeshGenerator.setMaterial(c,i,void 0,r).then(()=>{this._requestRenderSceneUpdateCallback&&this._requestRenderSceneUpdateCallback()}),t.opacity!==c.material.opacity&&this._requestRenderCallback&&this._requestRenderCallback(),o&&(c.position.set(0,0,0),c.scale.set(1,1,1),c.rotation.set(0,0,0));const l=this._configuratorMeshGenerator.getGeometry(n);this._applyMeshTransform(e,c,c.userData,o,s,a,l)}}_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: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 o=t.userData.materialId;if(!o)return void console.warn("mesh has no material id set");if(!e.has(o)){const i=new he(new de,t.material);i.userData.materialId=o,i.receiveShadow=!0,i.castShadow=!0,i.layers.set(3),this._setMaterial(i,o),n.push(i),e.set(o,i)}const s=e.get(o),r=s.geometry;t.userData.transform&&t.geometry.applyMatrix4(t.userData.transform),s.geometry=c([r,t.geometry]),i.push(t)}),n.forEach(e=>t.addMesh(e)),i.forEach(e=>t.removeMesh(e)),this._cacheHolder.componentCache.set(t.hash,t)}}_addComponent(e){this._listener&&e.isRootComponent&&this._listener.display(e)}removeDockingComponent(){this._getKernelAccess().requestDeleteComponent(this._configuratorContext.dockingRootComponentId),this._configuratorContext.dockingRootComponentId=null}dockComponent(e,t,n,i,o){let s=this._components.get(n),r=this._components.get(e);r&&(r.roomlePosition=i,r.roomleRotation=o,s&&s.add(r),r.parentObjectId=n,r.isRootComponent=t,this._addComponent(r))}dockComponentWithPosition(e,t){let n,i=this._components.get(e.parentId);n=t?t.getKernelPosition(i):e.getKernelPosition(i),h.start("dock_component_with_position_"+e.childId),this._getKernelAccess().dockComponentWithPosition(e.parentId,e.parentDockId,e.childId,e.childDockId,n),this._configuratorContext.dockingRootComponentId=null}removePreviews(){this._previews.size>0&&(this._previews.forEach(e=>{e.removeFromParent(),e.removeAllMeshes()}),this._previews.clear())}_updatePlanObject(e,t){const n=this._components.get(e.rootPlanComponentId);let i=!0;n&&(i=n.geometryChanged),this._listener&&this._listener.planObjectUpdated(e,i,t)}Editor3dAddDockPreview(e,t){const n=this._componentFactory.createPreview(t,e,this._creator_);this._previews.set(t.toString(),n)}Editor3dAddMesh(e,t,n,i,o,s){this._addMeshToComponent(e,t,n,o.materialId,o.transform,o.uvTransform,s.vertices,s.indices,s.uvCoords,s.normals,i,o.materialAttributes,o.animations)}Editor3ChangedMesh(e,t,n,i){this._changeMeshOfComponent(e,t,n,i.materialId,i.transform,i.uvTransform,i.materialAttributes,i.animations)}Editor3dRemoveMesh(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 _e)}Editor3dComponentCreated(e,t,n,i,o){i&&(this._configuratorContext.rootComponentId=e);let s=null;this._components.has(e)?(s=this._components.get(e),s.removeAllMeshes()):(s=this._componentFactory.create(e,t,n,o,i),s.layers.set(3)),this._components.set(e,s),this._addComponent(s)}Editor3dComponentDocked(e,t,n,i,o){this.dockComponent(e,t,n,i,o)}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)];d.finishOperation(2,n),this._updatePlanObject(t,!1),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,this._creator_),o=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=_(e[t].rotation),n.roomlePosition=e[t].position,n.roomleLineFrom=e[t].lineFrom,n.roomleLineTo=e[t].lineTo,n.lineSegments=[];for(const i of e[t].lineSegments)n.lineSegments.push({from:i.from/1e3,to:i.to/1e3});n.roomlePositionFrom=e[t].positionFrom,n.roomlePositionTo=e[t].positionTo,o.add(n),n.preparePreview(),this._previews.set(n.stringId,n)}}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 o;0===t?o=n:(o=n.clonePreview(t),this._previews.set(o.stringId,o)),o.name="Preview Point",o.parentDockId=e[t].parentDockId,o.parentId=e[t].parentId,o.childDockId=e[t].childDockId,o.childId=e[t].childId,o.preparePreview(),o.receivedPointAssociation=!0,o.userData.ignoreComponentRaycast=!0,i.add(o);let s=e[t].position;o.roomlePosition=s,o.roomleRotation=e[t].rotation,o.startPulsating()}}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,o){e===u&&(this._configuratorContext.dockingRootComponentId=n);let s=0===t;s?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,s&&void 0!==a.boundingBoxMesh)}finishParameterChange(e,t){this.materialQueue.registerCallback(e)}planObjectConfigurationUpdated(e,t,n,i){let o=this._getKernelAccess().kernelInstance.getPlanObject(e);this._updatePlanObject(o,i)}planObjectCreated(e,t){this._configuratorContext.planObjectId=t,this._listener&&this._listener.clearScene()}planObjectUpdated(e,t){this._updatePlanObject(e,t)}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 g(e.boxForMeasurement)}else if(this._configuratorContext.rootComponentId){const e=this._components.get(this._configuratorContext.rootComponentId);return(new ue).setFromObject(e)}return null}getBoundingBoxOfGeometry(){if(this._configuratorContext.planObjectId){const e=this._getKernelAccess().kernelInstance.getPlanObject(this._configuratorContext.planObjectId);if(e&&e.boxOfGeometry)return g(e.boxOfGeometry)}else if(this._configuratorContext.rootComponentId){const e=this._components.get(this._configuratorContext.rootComponentId);return(new ue).setFromObject(e)}return null}getBoundingBoxWithPreviews(){const e=this._components.get(this._configuratorContext.rootComponentId);return e?(new ue).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())}hasPreviewLines(){for(const e of this._previews.values())if(this._componentFactory.isPreviewLine(e))return!0;return!1}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,o,s,r,a,l,c){return this._configuratorMeshGenerator.generateMesh(e,t,n,i,o,s,r,!1,c)}_setMaterial(e,t,n){this._configuratorMeshGenerator.setMaterial(e,t)}constructComponents(e){this._getKernelAccess().kernelInstance.requestPlanObjectConstruction(e)}requestSubPartConstruction(e){return this._subPartGuard=new m(e),this._getKernelAccess().requestPlanComponentConstruction(e,!1),this._subPartGuard.wait()}getMeshGenerator(){return this._configuratorMeshGenerator}setRequestRenderCallback(e){this._requestRenderCallback=e}setRequestRenderSceneUpdateCallback(e){this._requestRenderSceneUpdateCallback=e}setInvalidateRenderCallback(e){this._invalidateRenderCallback=e}}e("a",je),n([i],je.prototype,"_configuratorMeshGenerator",void 0),n([i],je.prototype,"_configuratorContext",void 0),n([i],je.prototype,"_cacheHolder",void 0),n([i],je.prototype,"_initData",void 0);class Re extends Map{largestValue(){let e=this.entries().next().value[0],t=0;return this.forEach((n,i)=>{n>t&&(e=i,t=n)}),e}}class Ve extends je{constructor(e){super(e),this._configurablePlanObjectViewModels=[],this._configurableConstructionPlanObjectViewModels=[],this._staticPlanObjectViewModels=[],this._constructionPlanObjectViewModels=[],this._wallPlanObjectViewModels=[],this._measurementLinePlanObjectViewModels=[],this._wallAtticsPlanObjectViewModels=[],this._floorPlanObjectViewModels=[],this._nodePlanObjectViewModels=[],this._constructionGroup=new ge,this._constructionGroup.name="Construction",this._ceilingGroup=new ge,this._ceilingGroup.name="Ceiling",this._floorGroup=new ge,this._floorGroup.name="Floor",this._measurementLineGroup=new ge,this._measurementLineGroup.name="Measurement Line",this._wallAtticsGroup=new ge,this._wallAtticsGroup.name="Wall Attics",this._getKernelAccess().addPlannerListener(this)}get latestWallPlanObjectViewModel(){return this._latestWallPlanObjectViewModel}get latestNodePlanObjectViewModel(){return this._latestNodePlanObjectViewModel}startedDrawing(){}stoppedDrawing(){}planBoundsChanged(){}setReference(e){this._coreReference=e.clone()}clearReference(){this._coreReference.delete(),this._coreReference=null}getCorePlan(){return this._coreReference}addPlanElementViewModel(e){e instanceof p?this._handleConfiguratorConstructionPlanObjectViewModel(e):e instanceof C?this._handleConfiguratorPlanObjectViewModel(e):e instanceof f?this._handleConstructionPlanObjectViewModel(e):e instanceof v?this._handleStaticPlanObjectViewModel(e):e instanceof b?this._handleMeasurementLinePlanElementViewModel(e):e instanceof w?this._handleWallAtticPlanElementViewModel(e):e instanceof P?this._handleWallPlanElementViewModel(e):e instanceof y?this._handleFloorPlanElementViewModel(e):e instanceof M?this._handleCeilingPlanElementViewModel(e):e instanceof I&&this._handleNodePlanElementViewModel(e)}_handleConfiguratorPlanObjectViewModel(e){this._configurablePlanObjectViewModels.push(e),this._linkPlanObjectViewModelAndComponent(e)}_linkPlanObjectViewModelAndComponent(e){const t=e.getConfigurationRuntimeId();if(t>0)for(const e of this._components.values())if(e.parentObjectId===t||e.runtimeId===t){this._addComponent(e);break}}_detachPlanObjectViewModelFromComponent(e){const t=e.getConfigurationRuntimeId();if(t>0)for(const e of this._components.values())if(e.parentObjectId===t||e.runtimeId===t){e.isChildPlanObject=!1;break}}_handleConfiguratorConstructionPlanObjectViewModel(e){e.setTopView(this._cameraType===me.CAMERA_2D),this._configurableConstructionPlanObjectViewModels.push(e)}_handleConstructionPlanObjectViewModel(e){this._initData.edit&&this._plannerSceneEventHandler.addConstructionPlanObjectHandlers(e),e.setTopView(this._cameraType===me.CAMERA_2D),this._constructionPlanObjectViewModels.push(e)}_handleStaticPlanObjectViewModel(e){this._staticPlanObjectViewModels.push(e),this.commonHandlerForEditableAndTopView(e)}_handleMeasurementLinePlanElementViewModel(e){this._initData.edit&&this._plannerSceneEventHandler.addMeasurementLineHandlers(e),e.setTopView(this._cameraType===me.CAMERA_2D),e.getPoint1Draggable().scale.setScalar(this._nodeZoom),e.getPoint2Draggable().scale.setScalar(this._nodeZoom),this._measurementLinePlanObjectViewModels.push(e),this._measurementLineGroup.add(e.getContainer())}_handleWallAtticPlanElementViewModel(e){this._initData.edit&&this._plannerSceneEventHandler.addWallAtticHandlers(e),e.setTopView(this._cameraType===me.CAMERA_2D),this._wallAtticsPlanObjectViewModels.push(e),this._wallAtticsGroup.add(e.getContainer())}_handleWallPlanElementViewModel(e){this._initData.edit&&this._plannerSceneEventHandler.addWallHandlers(e),e.setTopView(this._cameraType===me.CAMERA_2D),this._wallPlanObjectViewModels.push(e),this._latestWallPlanObjectViewModel=e,this._constructionGroup.add(e.getContainer())}_handleFloorPlanElementViewModel(e){const t=e.getContainer();t.name="Floor",this._initData.edit&&this._plannerSceneEventHandler.addFloorHandlers(e),this._floorPlanObjectViewModels.push(e),this._floorGroup.add(t)}_handleCeilingPlanElementViewModel(e){this._ceilingGroup.add(e.getContainer())}_handleNodePlanElementViewModel(e){this._initData.edit&&this._plannerSceneEventHandler.addNodeHandlers(e),e.setTopView(this._cameraType===me.CAMERA_2D),e.setZoom(this._nodeZoom),this._nodePlanObjectViewModels.push(e),this._latestNodePlanObjectViewModel=e,this._constructionGroup.add(e.getContainer())}commonHandlerForEditableAndTopView(e){this._initData.edit&&this._plannerSceneEventHandler.addPlanObjectHandlers(e),e.setTopView(this._cameraType===me.CAMERA_2D)}dockComponent(e,t,n,i,o){var s;null===(s=this._plannerSceneEventHandler)||void 0===s||s.cancelSelection("dock_component"),super.dockComponent(e,t,n,i,o)}_addComponent(e){const t=e.isRootComponent?e.parentObjectId:e.runtimeId,n=this._getPlanObjectViewModelForRuntimeId(t);n&&n instanceof C&&(e.isRootComponent?n.addRootComponent(e):n.addChildEntityComponent(e),this._initData.edit&&(n instanceof p?this._plannerSceneEventHandler.addConstructionPlanObjectHandlers(n):this._plannerSceneEventHandler.addPlanObjectHandlers(n)),n.hidePreviewBox())}_getPlanObjectViewModelForRuntimeId(e){let t=null;return[...this._configurableConstructionPlanObjectViewModels,...this._configurablePlanObjectViewModels].forEach(n=>{e===n.getConfigurationRuntimeId()&&(t=n)}),t}getConfigurablePlanObjectForId(e){for(const t of[...this._configurableConstructionPlanObjectViewModels,...this._configurablePlanObjectViewModels])if(e===t.getId())return t;return null}getStaticPlanObjectForId(e){for(const t of this._staticPlanObjectViewModels)if(e===t.getId())return t;return null}getConstructionObjectForId(e){for(const t of this._constructionPlanObjectViewModels)if(e===t.getId())return t;return null}getStaticPlanObjectViewModelForId(e){return this.getStaticPlanObjectForId(e)||this.getConstructionObjectForId(e)}getPlanObjectForId(e){const t=this.getConfigurablePlanObjectForId(e);if(t)return t;const n=this.getStaticPlanObjectForId(e);if(n)return n;for(const t of this._nodePlanObjectViewModels)if(e===t.getId())return t;for(const t of this._wallPlanObjectViewModels)if(e===t.getId())return t;for(const t of this._measurementLinePlanObjectViewModels)if(e===t.getId())return t;for(const t of this._floorPlanObjectViewModels)if(e===t.getId())return t;for(const t of this._constructionPlanObjectViewModels)if(e===t.getId())return t;return null}getPlanObjectViewModelsFromRapiId(){return[...this._configurablePlanObjectViewModels,...this._configurableConstructionPlanObjectViewModels,...this._staticPlanObjectViewModels]}getPlanObjectCount(){return this._configurablePlanObjectViewModels.length+this._configurableConstructionPlanObjectViewModels.length+this._staticPlanObjectViewModels.length}getConstructionGroup(){return this._constructionGroup}getCeilingGroup(){return this._ceilingGroup}getFloorGroup(){return this._floorGroup}getMeasurementLineGroup(){return this._measurementLineGroup}getWallAtticsGroup(){return this._wallAtticsGroup}getBoundingBox(){if("configurator"===this._configuratorContext.baseContext){const e=this.getPlanObjectForId(this._configuratorContext.planElementId);if(e)return e.getBounds()}if("glb-viewer"===this._configuratorContext.baseContext){const e=this._plannerSceneEventHandler.getSelectedIds();if(e&&1===e.length){const t=this.getPlanObjectForId(e[0]);if(t)return t.getBounds()}}const e=this.getCorePlan();if(e)try{return g(e.getBounds())}catch(e){console.error(e)}const t=new ue;t.expandByObject(this._constructionGroup);for(const e of this._staticPlanObjectViewModels)t.expandByObject(e.getContainer());for(const e of this._configurablePlanObjectViewModels)t.expandByObject(e.getContainer());for(const e of this._configurableConstructionPlanObjectViewModels)t.expandByObject(e.getContainer());return t}getBoundingBoxOfGeometry(){return this.getBoundingBox()}setPlannerSceneEventHandler(e){this._plannerSceneEventHandler=e}getStaticPlanObjectViewModels(){return this._staticPlanObjectViewModels}getConfigurablePlanObjectViewModels(){return this._configurablePlanObjectViewModels}getConfigurableConstructionPlanObjectViewModels(){return this._configurableConstructionPlanObjectViewModels}getConstructionPlanObjectViewModels(){return this._constructionPlanObjectViewModels}getWallPlanObjectViewModels(){return this._wallPlanObjectViewModels}getNodePlanObjectViewModels(){return this._nodePlanObjectViewModels}getFloorPlanObjectViewModels(){return this._floorPlanObjectViewModels}getMeasurementLineObjectViewModels(){return this._measurementLinePlanObjectViewModels}getWallAtticsObjectViewModels(){return this._wallAtticsPlanObjectViewModels}_generateMesh(e=0,t=null,n,i,o,s,r,a,l,c){return this._plannerMeshGenerator.generateMesh(e,t,n,i,o,s,r,a,l,c)}_setMaterial(e,t,n,i){this._plannerMeshGenerator.setMaterial(e,t,n,i)}Editor3dComponentCreated(e,t,n,i,o){super.Editor3dComponentCreated(e,t,n,i,o),this._getKernelAccess()instanceof O&&this.dockComponent(e,i,o,t,n)}addPlanObjectToScene(e){}handlerSwitchedPlans(e,t){this._constructionGroup.clear(),this._ceilingGroup.clear(),this._floorGroup.clear(),this._measurementLineGroup.clear(),this._wallAtticsGroup.clear()}planCompletelyLoaded(e){}beginPlanConstruction(e){}addPlanMesh(e,t,n,i,o,s,r){}endPlanConstruction(e){}planElementChanged(e,t){}planObjectConfigurationLoaded(e,t,n){const i=this.getConfigurablePlanObjectForId(t.getId());if(!i)return void console.warn("planObjectConfigurationLoaded but no view model found");n?i.finishConstruction():i.failConstruction();const o=t.extRef.jsObject;o instanceof C&&this._linkPlanObjectViewModelAndComponent(o)}planObjectConfigurationChanged(e,t){}addMesh(e,t,n,i,o,s){const r=e.extRef.jsObject;let a=r.getMesh(t);a?a.geometry=this._plannerMeshGenerator.generateGeometry(null,n,i,o,s):(a=this._generateMesh(0,null,t,n,i,o,s,e.getType()),r.addMesh(a))}removePlanObjectFromScene(e){const t=e.getPlanElement().getType();this._isConstructionType(t)?this._constructionGroup.remove(e.getContainer()):t===this._getKernelAccess().kernelContainer.PlanElementType.FLOOR?this._floorGroup.remove(e.getContainer()):t===this._getKernelAccess().kernelContainer.PlanElementType.CEILING?this._ceilingGroup.remove(e.getContainer()):t===this._getKernelAccess().kernelContainer.PlanElementType.MEASURE?this._measurementLineGroup.remove(e.getContainer()):t===this._getKernelAccess().kernelContainer.PlanElementType.ATTIC&&this._wallAtticsGroup.remove(e.getContainer()),e.clear()}_isConstructionType(e){return e===this._getKernelAccess().kernelContainer.PlanElementType.WALL||e===this._getKernelAccess().kernelContainer.PlanElementType.NODE}planElementRemoved(e){var t;const n=null===(t=e.extRef)||void 0===t?void 0:t.jsObject;n instanceof p?this._removeObject(this._configurableConstructionPlanObjectViewModels,n):n instanceof C?(this._detachPlanObjectViewModelFromComponent(n),this._removeObject(this._configurablePlanObjectViewModels,n)):n instanceof f?this._removeObject(this._constructionPlanObjectViewModels,n):n instanceof v?this._removeObject(this._staticPlanObjectViewModels,n):n instanceof y?this._removeObject(this._floorPlanObjectViewModels,n):n instanceof P?this._removeObject(this._wallPlanObjectViewModels,n):n instanceof I?this._removeObject(this._nodePlanObjectViewModels,n):n instanceof b?this._removeObject(this._measurementLinePlanObjectViewModels,n):n instanceof w&&this._removeObject(this._wallAtticsPlanObjectViewModels,n)}_removeObject(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}getMeshGenerator(){return this._plannerMeshGenerator}componentConfigurationUpdated(e,t){super.componentConfigurationUpdated(e,t)}hideAllExcept(e){this._ceilingGroup.visible=!1,this._floorGroup.visible=!1,this._measurementLineGroup.visible=!1,this._wallAtticsGroup.visible=!1,this._constructionGroup.visible=!1,this._staticPlanObjectViewModels.forEach(t=>{t.getId()!==e&&(t.getContainer().visible=!1)}),this._configurablePlanObjectViewModels.forEach(t=>{t.getId()!==e&&(t.getContainer().visible=!1)}),this._configurableConstructionPlanObjectViewModels.forEach(t=>{t.getId()!==e&&(t.getContainer().visible=!1)}),this._constructionPlanObjectViewModels.forEach(t=>{t.getId()!==e&&(t.getContainer().visible=!1)})}showAll(){this._ceilingGroup.visible=this._cameraType===me.CAMERA_FP,this._floorGroup.visible=!0,this._measurementLineGroup.visible=!0,this._wallAtticsGroup.visible=!0,this._constructionGroup.visible=!0,this._staticPlanObjectViewModels.forEach(e=>e.getContainer().visible=!0),this._configurablePlanObjectViewModels.forEach(e=>e.getContainer().visible=!0),this._configurableConstructionPlanObjectViewModels.forEach(e=>e.getContainer().visible=!0),this._constructionPlanObjectViewModels.forEach(e=>e.getContainer().visible=!0)}planHistoryStateChanged(){}setNodeVisibility(e){this._nodePlanObjectViewModels.forEach(t=>t.setTopView(e))}async setCameraType(e){this._cameraType=e;const t=[];this._wallPlanObjectViewModels.forEach(e=>e.setTopView(this._cameraType===me.CAMERA_2D)),this._measurementLinePlanObjectViewModels.forEach(e=>e.setTopView(this._cameraType===me.CAMERA_2D)),this._wallAtticsPlanObjectViewModels.forEach(e=>e.setTopView(this._cameraType===me.CAMERA_2D)),this._nodePlanObjectViewModels.forEach(e=>e.setTopView(this._cameraType===me.CAMERA_2D)),this._configurablePlanObjectViewModels.forEach(e=>e.setTopView(this._cameraType===me.CAMERA_2D)),this._constructionPlanObjectViewModels.forEach(e=>t.push(e.setTopView(this._cameraType===me.CAMERA_2D))),this._configurableConstructionPlanObjectViewModels.forEach(e=>t.push(e.setTopView(this._cameraType===me.CAMERA_2D))),await Promise.all(t)}get cameraType(){return this._cameraType}setNodeZoom(e){e=Math.min(4,e),this._nodeZoom=e;for(const t of this._nodePlanObjectViewModels)t.setZoom(e);for(const t of this._measurementLinePlanObjectViewModels)t.getPoint1Draggable().scale.setScalar(e),t.getPoint2Draggable().scale.setScalar(e)}planCleared(){[this._configurablePlanObjectViewModels,this._configurableConstructionPlanObjectViewModels,this._staticPlanObjectViewModels,this._wallPlanObjectViewModels,this._measurementLinePlanObjectViewModels,this._nodePlanObjectViewModels,this._floorPlanObjectViewModels,this._constructionPlanObjectViewModels,this._wallAtticsPlanObjectViewModels].forEach(e=>{e.forEach(e=>e.remove()),e.length=0})}requestCatalogItem(e){}}e("P",Ve),n([i],Ve.prototype,"_plannerMeshGenerator",void 0),n([i],Ve.prototype,"_roomlePlannerUiCallback",void 0);const Le=e("b",{RAYCASTER_FLOOR:.8,FLOOR:.9,WALL:.95,DEFAULT:1,CONSTRUCTION:1,COMPONENT:2,PREVIEW:3,PREVIEW_LINE:4}),Be=k(30);class Te extends E{constructor(e,t,n,i){super(),this._offset=new pe(0,0,0),this._lastMoveCheck=0,this._onWallSnapping=!1,this._mode=void 0===i?1:i,this._object=e,this._camera=t,this._raycaster=new Ce,this._raycaster.layers.disableAll(),this._inputManager=n,this._addInputListeners(n),this._planeBottom=new fe(new pe(0,1,0)),this._planeFront=new fe(new pe(0,0,1)),this._planeSide=new fe(new pe(1,0,0))}setLayers(e){this._raycaster.layers=e}getLayers(){return this._raycaster.layers}_addInputListeners(e){e.addEventListener(3,e=>{this._findCandidate(e.positionRelative)},this),e.addEventListener(5,e=>{this._findSelection(e.positionRelative)},this),e.addEventListener(12,e=>{this._findSelection(e.positionRelative,!0,e.type)},this),e.addEventListener(14,e=>{this._findSelection(e.positionRelative,!0,e.type)},this),e.addEventListener(6,e=>{Date.now()-this._lastMoveCheck>32&&(this._findHover(e.positionRelative,e.type),this._lastMoveCheck=Date.now())},this),e.addEventListener(0,e=>{this._onDragStart(e.positionRelative)},this),e.addEventListener(1,e=>{this._onDrag(e.positionRelative)},this),e.addEventListener(2,e=>{this._onDragEnd(e.positionRelative)},this),e.addEventListener(9,e=>{this._onRotate(e.positionRelative,e.rotation)},this),e.addEventListener(10,()=>{this._currentRotate=null},this)}_findCandidate(e){let t=this._intersection(e);t&&!t.object.userData.ignoreElementHit&&0===this._mode&&this._inputManager.onElementHit()}_findSelection(e,t=!1,n=0){let i=this._intersection(e);if(i){if(i){const e=t?"double_click":"select";i.object.dispatchEvent({type:e,attachment:{intersection:i,type:n}})}}else this.dispatchEvent(0)}_findHover(e,t){const n=this._intersection(e);!n&&this._currentHover?(this._currentHover.dispatchEvent({type:"hover_off",attachment:{type:t}}),this._currentHover=null):n&&(this._currentHover&&this._currentHover.id!==n.object.id&&(this._currentHover.dispatchEvent({type:"hover_off",attachment:{type:t}}),this._currentHover=null),this._currentHover?this._currentHover.dispatchEvent({type:"hover_move",attachment:{intersection:n,type:t}}):(this._currentHover=n.object,this._currentHover.dispatchEvent({type:"hover_on",attachment:{intersection:n,type:t}})))}_intersection(e){var t;if(0===e.x&&0===e.y)return null;const n=this._intersect(e);if(null===(t=window.__RML__DEBUG__)||void 0===t?void 0:t.raycaster){const e=[];for(const t of n)e.push({name:t.object.userData.planElementName,distance:t.distance,priority:t.object.userData.priority});e.length&&console.table(e)}if(n.length<=0)return null;let i=n[0];return n.length>1&&this._currentHover&&this._currentDrag&&this._currentDrag.id!==this._currentHover.id&&n.forEach(e=>{e.object.id===this._currentHover.id&&e.object.userData.priority===this._currentHover.userData.priority&&i.object.userData.priority<=e.object.userData.priority&&(i=e)}),i}_intersect(e){this._raycaster.setFromCamera(new ve(e.x,e.y),this._camera);const t=[];return this._raycaster.intersectObjects(this._object.children,!0).forEach(e=>{const n=this._findObjectWithHandler(e.object);n&&(e.object=n,t.push(e))}),t.length>=0?t.sort((e,t)=>e.object.userData.priority!==t.object.userData.priority?t.object.userData.priority-e.object.userData.priority:D((new ue).setFromObject(e.object),(new ue).setFromObject(t.object))<0?-1:e.distance-t.distance):[]}_findObjectWithHandler(e){return e.userData.hasListener?e:e.parent?this._findObjectWithHandler(e.parent):null}_onDragStart(e){let t=this._intersection(e);if(!t&&!this._currentDrag)return;if(t&&t.object.userData.roomleId===this._rootComponentId)return;!this._currentDrag&&t&&(this._currentDrag=t.object,this._currentDrag.dispatchEvent({type:"drag_start"}));let n=this._currentDrag.parent;n&&n.computeBoundingBox&&(n.computeBoundingBox(),this._calculateOffset(n)),this._positionPlanes(n)}_onDrag(e){if(!this._currentDrag)return;this._raycaster.setFromCamera(new ve(e.x,e.y),this._camera);let t,n=new pe(0,0,-5);if(this._raycaster.ray.intersectPlane(this._planeBottom,n),0===this._mode){const e=this._object.children.find(({type:e,name:t})=>"Group"===e&&"Construction"===t),i=this._currentDrag.userData.snapToWall;if(e&&(this._onWallSnapping||i)){const t=this._raycaster.intersectObjects(e.children,!0);if(t.length){const e=t[0].point.clone();return void this._currentDrag.dispatchEvent({type:"drag",attachment:{position:e}})}}t=n.clone(),t.y=this._currentDrag.parent.position.y}else t=this._getIntersectionPosition(n),t.sub(this._offset);this._currentDrag.dispatchEvent({type:"drag",attachment:{position:t}})}_getIntersectionPosition(e){let t=this._getDistanceToCamera(e),n=this._camera.userData.yaw,i=new pe(0,0,0),o=new pe(0,0,0);this._raycaster.ray.intersectPlane(this._planeFront,i),this._raycaster.ray.intersectPlane(this._planeSide,o);let s,r=this._getDistanceToCamera(o),a=this._getDistanceToCamera(i);return n>=-Be&&n<=Be?s=t<a?e.clone():i.clone():t<a&&t<r?s=e.clone():a<t&&a<r?s=i.clone():r<t&&r<a&&(s=o.clone()),s}_getDistanceToCamera(e){let t=e.clone().sub(this._camera.position).length();return S(e)&&(t=Number.POSITIVE_INFINITY),t}_onDragEnd(e){this._currentDrag&&(this._currentDrag.dispatchEvent({type:"drag_end",attachment:{position:e}}),this._currentDrag=null)}_onRotate(e,t){if(!this._currentRotate){let t=this._intersection(e);if(!t)return;this._currentRotate=t.object}this._currentRotate.dispatchEvent({type:"rotate",attachment:{rotation:t}})}_positionPlanes(e){0===this._mode?(this._planeBottom.constant=0,this._camera.userData&&this._camera.userData.pitch&&this._camera.userData.pitch<0&&(this._planeBottom.constant=-3)):e&&e.boundingBox&&this._rootComponentPosition&&(this._planeBottom.constant=-e.boundingBox.getCenter(new pe).y-this._rootComponentPosition.y,this._planeSide.constant=2*-e.boundingBox.getSize(new pe).x+e.boundingBox.getCenter(new pe).x,this._camera.userData.yaw>0&&(this._planeSide.constant*=-1),this._bounds&&(this._planeFront.constant=this._bounds.z/2+e.boundingBox.getCenter(new pe).z))}_calculateOffset(e){e&&e.boundingBox&&(this._offset.copy(e.boundingBox.getCenter(new pe)),this._offset.applyQuaternion(e.getWorldQuaternion(new be)))}update(e,t,n){if(e&&(this._bounds=e),t&&(this._rootComponentPosition=t),n){this._backgroundScene=n;let e=this._backgroundScene.children[0];e instanceof he&&e.geometry.computeBoundingBox()}}clear(){this._currentDrag&&A(this._currentDrag),this._currentHover&&A(this._currentHover)}enableDragIn(e){this._currentDrag=e}setRootComponentId(e){this._rootComponentId=e}setCamera(e){this._camera=e}setObject(e){this._object=e}setMode(e){this._mode=e}intersectMouseOnScene(e){const t=new fe,n=new pe;return n.copy(this._camera.position).normalize(),t.setFromNormalAndCoplanarPoint(n,this._object.position),this._raycaster.setFromCamera(new ve(e.positionRelative.x,e.positionRelative.y),this._camera),x(this._raycaster.ray.intersectPlane(t,new pe))}enableOnWallSnapping(){this._onWallSnapping=!0}disableOnWallSnapping(){this._onWallSnapping=!1}}class Fe extends E{constructor(e,t,n,i){super(),this._debug=!1,this._dragIn=!1,this._inputManager=i,this._raycastHelper=new Te(t,n,this._inputManager),this._creator_=e}isDragIn(){return this._dragIn}setDragIn(e,t){this._dragIn=e,e?this._inputManager.enableDragIn(t):this._raycastHelper.clear(),this._interaction()}}e("S",Fe);class Ge{constructor(e){const{component:t,preview:n,resetCamera:i,consecutive:o,type:s,forceRender:r,reason:a}=e;this.component=t,this.preview=n,this.resetCamera=void 0===i||i,this.consecutive=void 0===o||o,this.type=s||0,this.forceRender=void 0!==r&&r,this.reason=a}}class Ke extends Fe{constructor(e,t,n,i){super(e,t,n,i),this._cameraMoving=!1,this._raycastHelper.addEventListener(0,()=>{this._clickOutside()},this),this._selectionHandler.addEventListener(0,({component:e,consecutive:t})=>{this.dispatchEvent(8,new Ge({component:e,consecutive:t})),this._inputManager.setDragEnabled(!0)},this),this._selectionHandler.addEventListener(1,({component:e,resetCamera:t,reason:n})=>{this._selectionHandler.hasSelection()||this._inputManager.setDragEnabled(!1),this.dispatchEvent(9,new Ge({component:e,resetCamera:t,reason:n}))},this),this._addInputListeners(this._inputManager)}disable(){const e=new we;e.disableAll(),this._raycastHelper.setLayers(e),this._raycastHelper.disableEvents()}enable(){const e=new we;e.disableAll(),e.enable(4),e.enable(5),e.enable(7),e.enable(8),this._raycastHelper.setLayers(e),this._raycastHelper.enableEvents()}_addInputListeners(e){e.addEventListener(7,e=>this._interaction(),this),e.addEventListener(8,e=>this._interaction(),this)}addComponentHandlers(e){this._addComponentHandlers(e,e.boundingBoxMesh,{hasListener:!0,priority:Le.DEFAULT,roomleId:e.runtimeId}),e.meshes.forEach(t=>{this._addComponentHandlers(e,t,{hasListener:!0,priority:Le.COMPONENT,roomleId:e.runtimeId})})}addComponentDragInHandler(e){this._dragIn&&(this._addComponentHandlers(e,e.boundingBoxMesh,{hasListener:!0,priority:Le.DEFAULT,roomleId:e.runtimeId}),this._raycastHelper.enableDragIn(e.boundingBoxMesh))}_addComponentHandlers(e,t,n){t.userData.hasListener||(Object.assign(t.userData,n),t.addEventListener("select",()=>this.clickComponent(e)),t.addEventListener("hover_on",t=>this._hoverOn(e,t.attachment.type)),t.addEventListener("hover_off",t=>this._hoverOff(e,t.attachment.type)),t.addEventListener("drag_start",()=>this._dragStart(e)),t.addEventListener("drag",t=>this._drag(e,t.attachment.position)),t.addEventListener("drag_end",()=>this._dragEnd(e)))}addPreviewHandlers(e){let t=e.boundingBoxMesh;t.userData.hasListener||(t.userData=Pe(t.userData,{hasListener:!0,priority:Le.PREVIEW,roomleId:e.runtimeId}),t.addEventListener("select",()=>this._clickPreview(e)),t.addEventListener("hover_on",()=>this._hoverOnPreview(e)),t.addEventListener("hover_off",()=>this._hoverOffPreview(e)))}addPreviewLineHandlers(e){let t=e.boundingLineMesh;t.userData.hasListener||(t.userData=Pe(t.userData,{hasListener:!0,priority:Le.PREVIEW_LINE,roomleId:e.runtimeId}),t.addEventListener("select",()=>this._clickPreviewLine(e)),t.addEventListener("hover_on",t=>this._hoverOnPreviewLine(e,t.attachment.intersection)),t.addEventListener("hover_move",t=>this._hoverMovePreviewLine(e,t.attachment.intersection)),t.addEventListener("hover_off",()=>this._hoverOffPreviewLine(e)))}_clickPreview(e){this._dragStartPosition&&(e.position.copy(this._dragStartPosition),this._dragStartPosition=null),this.dispatchEvent(7,new Ge({preview:e}))}_clickPreviewLine(e){this._dragStartPosition&&(e.position.copy(this._dragStartPosition),this._dragStartPosition=null),this.dispatchEvent(7,new Ge({preview:e}))}clickComponent(e,t=!0){this._debug&&e.runtimeId,this._selectionHandler.check(e),t&&this._configuratorUiCallbacks.onClickComponent(e)}_clickOutside(){this._selectionHandler.cancelSelection("click_outside"),this.dispatchEvent(3),this._interaction()}_hoverOn(e,t){this._cameraMoving||(this._debug&&e.runtimeId,e.hoverOn(),this._interaction(),this.dispatchEvent(1,new Ge({component:e,type:t})),this._hoveredComponent=e)}_hoverOff(e,t){this._cameraMoving||(this._debug&&e.runtimeId,e.hoverOff(),this._interaction(),this.dispatchEvent(2,new Ge({component:e,type:t})),this._hoveredComponent=null)}_hoverOnPreview(e){e.hoverOn(),this._interaction(!0),this._hoveredPreview=e}_hoverOffPreview(e){e.hoverOff(),this._interaction(!0),this._hoveredPreview=null}_hoverOnPreviewLine(e,t){this._updatePositionForPreviewLine(e,t),this._draggedComponent||e.hoverOn(),this._interaction(),this._hoveredPreview=e}_hoverMovePreviewLine(e,t){this._updatePositionForPreviewLine(e,t),this._hoveredPreview=e,this._interaction(!0)}_updatePositionForPreviewLine(e,t){let n=t.object.parent.parent.worldToLocal(t.point);this._previewLineIntersection=n,e&&(this._draggedComponent?this._draggedComponent.visible=!0:e.updatePreviewPosition(n))}_hoverOffPreviewLine(e){this._draggedComponent||e.hoverOff(),this._interaction(),this._hoveredPreview=null,this._previewLineIntersection=null}_setDragComponentShadow(e){var t;null===(t=this._draggedComponent)||void 0===t||t.traverse(t=>{if(t instanceof he){const n=t;e&&void 0!==n.castShadowOld?(n.receiveShadow=n.receiveShadowOld,n.castShadow=n.castShadowOld):(n.receiveShadowOld=t.receiveShadow,n.castShadowOld=t.castShadow,n.receiveShadow=!1,n.castShadow=!1)}})}_dragStart(e){e&&(this._selectionHandler.isSelected(e)||this.isDragIn())&&(this._dragStartPosition=e.position.clone(),this._dragStartRotation=e.rotation.clone(),this._draggedComponent=e,this._setDragComponentShadow(!1),this.dispatchEvent(4,new Ge({component:e})),this._interaction())}_drag(e,t){if(e&&(this._selectionHandler.isSelected(e)||this.isDragIn())){if(e&&!this._draggedComponent&&(this._draggedComponent=e),this._previewLineIntersection){let e=this._hoveredPreview,t=e.getPositionForIntersectionPoint(this._previewLineIntersection),n=e.parent.localToWorld(t);this._draggedComponent.position.copy(this._draggedComponent.parent.worldToLocal(n)),this._draggedComponent.rotation.copy(e.docklineRotation),e.hideSelectionLine()}else e.parent?e.position.copy(e.parent.worldToLocal(t)):e.position.copy(t);this._hoveredPreview?e.visible=!1:e.visible=!0,this.dispatchEvent(5,new Ge({component:e})),this._interaction()}}_dragEnd(e){if(e&&(this._selectionHandler.isSelected(e)||this.isDragIn())){if(this._hoveredPreview&&this._previewLineIntersection){let t=this._hoveredPreview,n=t.getPositionForIntersectionPoint(this._previewLineIntersection),i=t.parent.localToWorld(n);e.position.copy(e.parent.worldToLocal(i)),e.rotation.copy(t.docklineRotation)}else this._dragStartPosition&&this._dragStartRotation&&(e.position.copy(this._dragStartPosition),e.rotation.copy(this._dragStartRotation),this._dragStartPosition=null,this._dragStartRotation=null,this.addComponentHandlers(e));e.visible=!0,this._setDragComponentShadow(!0),this._draggedComponent=null,this._previewLineIntersection=null,this.dispatchEvent(6,new Ge({component:e,preview:this._hoveredPreview})),this._interaction()}}_interaction(e){this.dispatchEvent(0,new Ge({forceRender:e}))}hasSelection(){return this._selectionHandler.hasSelection()}update(e,t,n){this._raycastHelper.update(e,t,n)}isDragIn(){return this._dragIn}isDragging(){return null!=this._draggedComponent}setRootComponentId(e){this._raycastHelper.setRootComponentId(e)}cancelSelection(e){return this._selectionHandler.setSelectionMode("standard"),this._selectionHandler.cancelSelection(e)}setSelectionMode(e){this._selectionHandler.setSelectionMode(e)}getSelectionMode(){return this._selectionHandler.getSelectionMode()}getSelectedRuntimeComponentIds(){return this._selectionHandler.getSelectedRuntimeComponentIds()}setCameraMoving(e){e&&this._hoveredComponent&&this._hoverOff(this._hoveredComponent,0),this._cameraMoving=e}setCamera(e){this._raycastHelper.setCamera(e)}setObject(e){this._raycastHelper.setObject(e)}}n([i],Ke.prototype,"_selectionHandler",void 0),n([i],Ke.prototype,"_configuratorUiCallbacks",void 0);class Ue extends E{constructor(e){super(),this._uiIntersectionMask=0,this.floorEnvironment=!1,this._camera=e}updateToBounds(e,t,n){let i=new pe(-e.x/2,0,-e.z/2),o=new pe(e.x/2,e.y,e.z/2);this._boundingBox=new ue(i,o),this._clientWidth=t,this._clientHeight=n;let s=this._boundingBox.getSize(new pe);this._boxVertices=[],this._boxVertices.push(this._boundingBox.min),this._boxVertices.push(this._boundingBox.min.clone().add(new pe(s.x,0,0))),this._boxVertices.push(this._boundingBox.max),this._boxVertices.push(this._boundingBox.max.clone().sub(new pe(s.x,0,0)))}set canvasOffset(e){this._offset=e,this.calculateUIIntersection()}calculateUIIntersection(){let e=[];if(null==this._boundingBox||null==this._offset)return;let t=this._checkPaddings();t.bottom=this._clientHeight-t.bottom,t.right=this._clientWidth-t.right;let n=0;this.floorEnvironment?(e=["left","right","bottom"],n=11):(this._offset.left>0&&t.left<this._offset.left*this._clientWidth&&(e.push("left"),n|=8),this._offset.right<1&&t.right<(1-this._offset.right)*this._clientWidth&&(e.push("right"),n|=2),this._offset.bottom>0&&t.bottom<this._offset.bottom*this._clientHeight&&(e.push("bottom"),n|=1)),this._offset.top<1&&t.top<(1-this._offset.top)*this._clientHeight&&(e.push("top"),n|=4),n!==this._uiIntersectionMask&&(this.dispatchEvent(0,e),this._uiIntersectionMask=n)}_checkPaddings(){let e={left:this._clientWidth/2,top:this._clientHeight/2,right:this._clientWidth/2,bottom:this._clientHeight/2};return this._boxVertices.forEach(t=>{let n=H(t,this._camera,this._clientWidth,this._clientHeight);n.x<e.left&&(e.left=n.x),n.x>e.right&&(e.right=n.x),n.y<e.top&&(e.top=n.y),n.y>e.bottom&&(e.bottom=n.y)}),e}}class We extends te{get cameraControl(){return this._cameraControl}resetCameraOnSceneClear(){this.cameraControl.clear()}async externalApiMoveCamera(e){await this.cameraControl.moveCamera(e),this._onCameraChanged()}externalApiZoomIn(e){this.cameraControl.zoomIn(e),this._onCameraChanged()}externalApiZoomOut(e){this.cameraControl.zoomOut(e),this._onCameraChanged()}externalApiResetCameraPosition(e){this.cameraControl.updateAndReset(e,!0),this._onCameraChanged()}disablePanningOnShiftRelease(){this.cameraControl.disablePanning()}enablePanningOnShiftClick(){this.cameraControl.enablePanning()}resetCameraToStartOnConfigurationLoaded(e){this.cameraControl.updateAndReset(e,!1)}updateBoundsOnPlanObjectUpdated(e){this.cameraControl.updateToBounds(e,!1,!1)}updateBoundsOnCancelDockings(e){this.cameraControl.updateToBounds(e,!1,!1)}async zoomToComponentOnConsecutiveClick(e){this.cameraControl.saveState(!1),await this.cameraControl.zoomTo(e),this._onCameraChanged()}resetCameraToStateOnCancelSelection(){this.cameraControl.hasSavedState()&&(this.cameraControl.resetToState(),this._onCameraChanged())}zoomToFitBoundsAfterUserInitiatedPreviews(e){this.cameraControl.zoomToFitBounds(e),this._onCameraChanged()}async resetCameraOnStartConfiguring(e,t,n=0){this.cameraControl.setCurrentCameraParameters(t),this.cameraControl.setObjectRotation(n),await this.cameraControl.updateAndReset(e,!0)}}e("c",We);class Ne extends ne{constructor(e,t,n){super(e,t,j.HSC,n),this._configuratorContext.baseContext="configurator",this._getViewModel().setListener(this),this._sceneEventHandler=new Ke(this._creator_,this._scene,this.cameraBehaviour3d.cameraControl.getCamera(),this._getInputManager()),this._sceneEventHandler.addEventListener(0,({forceRender:e})=>{this._uiIntersectionHelper.calculateUIIntersection(),e&&this._renderEverything()},this),this._sceneEventHandler.addEventListener(1,({component:e,type:t})=>this._onHoverOn(e,t),this),this._sceneEventHandler.addEventListener(2,({component:e,type:t})=>this._onHoverOff(e,t),this),this._sceneEventHandler.addEventListener(3,()=>{this._configuratorUiCallbacks.onClickOutside(),this.cameraBehaviour.cameraControl.unlock(),this._cancelDockings(!1,null,this._getViewModel().hasPreviews(),!0,!1),this.cancelComponentSelection(!0,"click_outside"),this._componentRaycastHelper&&this._componentRaycastHelper.checkComponentVisibility(this._sceneEventHandler,this._getViewModel()),this._requestRender()},this),this._sceneEventHandler.addEventListener(8,({component:e,consecutive:t})=>{this._getViewModel().hasPreviews()&&this._cancelDockings(!1,null,this._getViewModel().hasPreviews(),!0,!1),this._selectComponent(e,t),this._requestRender()},this),this._sceneEventHandler.addEventListener(9,({component:e,resetCamera:t,reason:n})=>{this._deselectComponent(e,t,n),this._requestRender()},this),this._sceneEventHandler.addEventListener(4,({component:e})=>{var t;"multiselect"===this._sceneEventHandler.getSelectionMode()&&this.cancelComponentSelection(!1,"dragIn"),this._requestDockingsPreviewWithDrag(e.runtimeId),this.cameraBehaviour.cameraControl.lock(),null===(t=this._roomleRenderer)||void 0===t||t.enableUiInteractionMode(),this._requestRender()},this),this._sceneEventHandler.addEventListener(5,()=>{this._renderEverything()},this),this._sceneEventHandler.addEventListener(6,({component:e,preview:t})=>{var n;if(t){let n=t;this._getViewModel().isPreviewLine(n)?this._getViewModel().dockComponentWithPosition(n,e):this._getViewModel().isPreview(n)?this._dockComponent(n):this._getKernelAccess().cancelDocking(e.runtimeId),this._cancelDockings(!t,e,!0,!0)}else{this._getKernelAccess().cancelDocking(e.runtimeId);let t=this._sceneEventHandler.isDragIn()?e:null;this._cancelDockings(this._sceneEventHandler.isDragIn(),t,!1,!0);const n=this._getViewModel().getBoundingBox();this._environment&&this._environment.needsBounds()&&this._environment.updateBounds(n.getSize(new pe))}this.cameraBehaviour.cameraControl.unlock(),null===(n=this._roomleRenderer)||void 0===n||n.disableUiInteractionMode(),this._renderEverything()},this),this._sceneEventHandler.addEventListener(7,({preview:e})=>{this._getViewModel().isPreview(e)&&(this._getViewModel().isPreviewLine(e)?this._getViewModel().dockComponentWithPosition(e):this._dockComponent(e),this._cancelDockings(!1,null,!this._getViewModel().hasPreviews(),!1,!1),this.requestDockingsPreview(!1),this._requestRender())},this),R.isProduction||(window.__RML__DEBUG__.SceneManager=this),this.enableConfiguratorEvents(),this._initOptionalModules(),this._offsetAnimationStart=ye(this._offsetAnimationStart.bind(this),250),this._offsetAnimationEnd=Me(this._offsetAnimationEnd.bind(this),32)}async _initOptionalModules(){const{transparentHighlighting:e}=this._initData;if(e){const{default:e}=await t.import("./component-raycast-helper-a5178cda.legacy.js");this._componentRaycastHelper=new e,this._componentRaycastHelper.init(this._scene,this.cameraBehaviour3d.cameraControl.getCamera())}}_changeCameraBehaviour(e){var t;super._changeCameraBehaviour(e),null===(t=this._componentRaycastHelper)||void 0===t||t.setCamera(this.cameraBehaviour3d.cameraControl.getCamera())}disableEvents(){this.disableConfiguratorEvents()}enableEvents(){"configurator"===this._configuratorContext.baseContext&&this.enableConfiguratorEvents()}enableConfiguratorEvents(){this._sceneEventHandler.enable()}disableConfiguratorEvents(){this._sceneEventHandler.disable()}_getViewModel(){return this._viewModel||(this._viewModel=o.lookup("configurator-view-model",this._creator_),this._viewModel.setRequestRenderCallback(()=>this._renderEverything()),this._viewModel.setRequestRenderSceneUpdateCallback(()=>{var e;return null===(e=this._roomleRenderer)||void 0===e?void 0:e.clearCache()}),this._viewModel.setInvalidateRenderCallback(()=>{var e;return null===(e=this._roomleRenderer)||void 0===e?void 0:e.forceShadowUpdates(!0)})),this._viewModel}_getKernelAccess(){return this._plannerKernelAccess}_showDockings(){var e,t,n;if(null===(e=this._roomleRenderer)||void 0===e||e.enableUiInteractionMode(),null===(n=null===(t=this._initData)||void 0===t?void 0:t.featureFlags)||void 0===n?void 0:n.pulsePreview){this._renderEverything();const e=setInterval(()=>this._renderEverything(),16);setTimeout(()=>clearInterval(e),(ie+1)*oe)}}cancelDockings(){this._cancelDockings(!0,null,!0,!0,!1),this._renderEverything()}_cancelDockings(e,t,n,i,o=!0){var s,r;null===(s=this._roomleRenderer)||void 0===s||s.disableUiInteractionMode(),e&&(this._sceneEventHandler.setDragIn(!1),this._getViewModel().removeDockingComponent(),t&&this._scene.remove(t)),this._getViewModel().removePreviews(),n&&o&&Ie().then(()=>{var e;null===(e=this.configuratorCameraBehaviour)||void 0===e||e.updateBoundsOnCancelDockings(this.getBounds())}),i&&n&&this._configuratorUiCallbacks.onDockingsPreviewRemoved(),this._componentRaycastHelper&&this._componentRaycastHelper.changeMaterialsOnSelect(this._scene,null,!1,()=>{var e,t;null===(e=this._roomleRenderer)||void 0===e||e.forceShadowUpdates(!0),this._initData.transparentHighlighting&&(null===(t=this._roomleRenderer)||void 0===t||t.clearCache()),this._renderEverything()}),n&&(null===(r=this._roomleRenderer)||void 0===r||r.forceShadowUpdates(!0))}_onHoverOn(e,t){2!==t&&this._highlightComponent(e),this._componentDimensioningHelper&&this._componentDimensioningHelper.add(e)&&this._renderEverything()}_onHoverOff(e,t){2!==t&&this._highlightComponent(),this._componentDimensioningHelper&&this._componentDimensioningHelper.hasComponentDimensions()&&(this._componentDimensioningHelper.remove(e),this._renderEverything()),this._requestRender()}_highlightComponent(e=null,t=[]){var n;if(!this._shouldHighlightComponent())return;const i=[],o=this._initData.meshSelection;e?o?i.push(...e.meshes):e.boundingBoxMesh&&i.push(e.boundingBoxMesh):t&&t.length||(t=this._sceneEventHandler.getSelectedRuntimeComponentIds()),this._getViewModel().getComponentsForIds(t).forEach(e=>{e&&(o?i.push(...e.meshes):e.boundingBoxMesh&&i.push(e.boundingBoxMesh))}),null===(n=this._roomleRenderer)||void 0===n||n.highlightObjects(i)}shouldClearShadowsAndAO(){var e;return super.shouldClearShadowsAndAO()||!(null===(e=this._sceneEventHandler)||void 0===e?void 0:e.isDragging())}resume(){super.resume(),this._getViewModel().materialQueue.registerCallback(()=>this._materialLoaded()),this._configuratorMeshGenerator.setMaterialLoadedListener(()=>{this._renderWithoutShadowsAndAO()})}_materialLoaded(){this._renderEverything()}async waitForMaterialQueue(){await this._getViewModel().materialQueue.finished()}pause(){super.pause(),this._getViewModel().materialQueue.unregisterCallback(),this._configuratorMeshGenerator.removeMaterialLoadedListener()}_setupScene(e,t,n){super._setupScene(e,t),this._uiIntersectionHelper=new Ue(this.cameraBehaviour3d.cameraControl.getCamera()),this._uiIntersectionHelper.canvasOffset=e,this._uiIntersectionHelper.addEventListener(0,e=>{this._configuratorUiCallbacks.onUiIntersectionChange(e)},this),this._configuratorMeshGenerator.maxAnisotropy=this._maxAnisotropy,this._configuratorMeshGenerator.maxTextures=this._renderer.capabilities.maxTextures,this._configuratorMeshGenerator.setMaterialLoadedListener(()=>{this._renderWithoutShadowsAndAO()}),this._domHelper.element.appendChild(this._renderer.domElement),n||!this._initData.legacyLight||this._initData.ls||this._initData.dls||(this._renderer.capabilities.maxTextures>8?this.loadDynamicLightSetting(V.createDynamicLightSettingSource(null,L.CAMERA)):this._lightSetting=new ke(this._scene,this._lightSetting)),this._requestRender(),t||this._setEnvironment(new se(this._scene,this._environment,Oe(this._initData.colors.DEFAULT_BACKGROUND))),this._getViewModel().materialQueue.registerCallback(()=>this._materialLoaded())}sceneCleared(e){this._internalClearScene(e)}display(e){this._scene.add(e),this.setRootComponentId(e.runtimeId),this._requestRender()}setRootComponentId(e){this._sceneEventHandler.setRootComponentId(e)}debugSceneGraph(e){this._getViewModel().debugSceneGraph(e),this._printObjectGraph(this._scene,"")}debugScene(){return this._scene}_printObjectGraph(e,t){e.material&&e.material.opacity,e.type,e.id,e.runtimeId,e.children.length>0&&e.children.forEach(e=>{let n=t+" ";this._printObjectGraph(e,n)})}clearScene(){var e,t;null===(e=this.configuratorCameraBehaviour)||void 0===e||e.resetCameraOnSceneClear(),this._internalClearScene(!1),null===(t=this._sceneEventHandler)||void 0===t||t.cancelSelection("reset_scene"),this._pluginSystem.clearScene(this._scene,this._uiScene)}planObjectConstructionDone(e){this._componentDimensioningHelper.reset(),this._componentDimensioningHelper.setCamera(this.cameraBehaviour3d.cameraControl.getCamera())}_internalClearScene(e){var t;this._scene.children.forEach(e=>{"Object3D"!==e.type&&"Mesh"!==e.type&&"Line"!==e.type||this._scene.remove(e)}),this._uiScene.children.forEach(e=>{this._uiScene.remove(e)}),this._getViewModel().sceneCleared(),null===(t=this._componentDimensioningHelper)||void 0===t||t.invalidateDimensioningsCache(),(e||this._memoryManager.shouldHardReset())&&(this._configuratorMeshGenerator.clear(),this._renderer.renderLists.dispose(),this._memoryManager.executedHardReset()),this._renderEverything()}async _waitForAssets(){await super._waitForAssets(),await this._externalMeshesAndMaterialsReady()}async preparePerspectiveImage(e={},t){var n,i;await this._externalMeshesAndMaterialsReady();const{showDimensions:o=!1}=e;this._cancelDockings(!0,null,!0,!0);const s=this.cameraBehaviour3d.cameraControl.getCamera().clone();s.resetOffset();let r=this._calculateBoundingBoxOfAllMeshes(0,o);null===(n=this._lightSetting)||void 0===n||n.removeFromScene();const a=!!this._dimensionHelper&&this._dimensionHelper.areDimensionsEnabled();a&&this._dimensionHelper.disableDimensions();const l=this.cameraBehaviour3d.cameraControl.getObjectRotation();if(o){await this._initDimensions(),await this._dimensionHelper.isInitialized();const e=-30+W(l);B.placeCameraForPerspectiveImage(s,r,-20,e),this._dimensionHelper.enableDimensions(),this._dimensionHelper.moveCameraEnd(s.position),r=this._calculateBoundingBoxOfAllMeshes(0,o)}this._componentDimensioningHelper&&this._componentDimensioningHelper.hasComponentDimensions()&&await this._componentDimensioningHelper.reset();const c=await this._imageRenderer.preparePerspectiveImage(this._scene,this._uiScene,s,r,e,l);return a?(this._dimensionHelper.enableDimensions(),this._dimensionHelper.moveCameraEnd(this.cameraBehaviour3d.cameraControl.getCamera().position)):o&&this._dimensionHelper.disableDimensions(),null===(i=this._lightSetting)||void 0===i||i.addToScene(),this._renderEverything(),c}async renderImage(e){await this._externalMeshesAndMaterialsReady(),this._getViewModel().getPreviews()&&this._cancelDockings(!0,null,!0,!0);let t=this.cameraBehaviour3d.cameraControl.getCamera(),n=null;e.useCurrentPerspective||(t=this.cameraBehaviour3d.cameraControl.getCamera().clone(),t.resetOffset(),n=this._calculateBoundingBoxOfAllMeshes());const i=!!this._dimensionHelper&&this._dimensionHelper.areDimensionsEnabled();i&&this._dimensionHelper.disableDimensions(),this._componentDimensioningHelper&&this._componentDimensioningHelper.hasComponentDimensions()&&await this._componentDimensioningHelper.reset();const o=await this._imageRenderer.renderPerspectiveImage(this._scene,t,n);return i&&(this._dimensionHelper.enableDimensions(),this._dimensionHelper.moveCameraEnd(this.cameraBehaviour3d.cameraControl.getCamera().position)),this._renderEverything(),o}async preparePartImage(e,t){return new Promise((n,i)=>{this._getViewModel().requestSubPartConstruction(e).then(async e=>{t.size||(t.size=256);const i=this.cameraBehaviour3d.cameraControl.getCamera().clone();i.resetOffset();let o=B.getCameraTargetForBBox((new ue).setFromObject(e));const s=T(this._scene);s.add(e);const r=await this._imageRenderer.preparePerspectiveImage(s,null,i,o,t);F(s),n(r)},i)})}_calculateBoundingBoxOfAllMeshes(e=0,t){let n=null;return n=t&&this._dimensionHelper?this._dimensionHelper.getBoundingBox():this._getViewModel().getBoundingBox(),B.getCameraTargetForBBox(n,e)}async _externalMeshesAndMaterialsReady(){await this._getKernelAccess().externalMeshQueue.finished(!0),await this._getViewModel().materialQueue.finished(!0)}async prepareTopImage(e={},t){var n,i;await this._externalMeshesAndMaterialsReady();const{showDimensions:o=!1}=e;this._cancelDockings(!0,null,!0,!0),o&&(await this._initDimensions(!0),await this._dimensionHelper.isInitialized(),this._dimensionHelper.enableTopDimensions()),this._componentDimensioningHelper&&this._componentDimensioningHelper.hasComponentDimensions()&&await this._componentDimensioningHelper.reset();let s=this._calculateBoundingBoxOfAllMeshes(.1,o);null===(n=this._lightSetting)||void 0===n||n.removeFromScene();let r=await this._imageRenderer.prepareTopImage(this._scene,this._uiScene,s,e);return o&&this._dimensionHelper.disableTopDimensions(),null===(i=this._lightSetting)||void 0===i||i.addToScene(),this._renderEverything(),r}enableDragIn(e){this._sceneEventHandler.setDragIn(!0,e),this._requestRender()}async _zoomToComponentOnConsecutiveClick(e){var t;let n=e.boundingBox.getSize(new pe),i=G(e),o=new Ee(0,i,0),s=e.getWorldPosition(new pe).clone().add(e.boundingBox.getCenter(new pe).applyEuler(o));const r=new ve;this._renderer.getSize(r);const a={yaw:o.y,pitch:k(15),distance:K(n.x,n.y,n.z,this.cameraBehaviour3d.cameraControl.getCamera().fov,r.width,r.height)*re,targetX:s.x,targetY:s.y,targetZ:s.z,blockOtherTweens:!0};De(this.cameraBehaviour.cameraControl.getCurrentCameraParameters(),a)||(this._configuratorUiCallbacks.onZoomToComponent(),await(null===(t=this.configuratorCameraBehaviour)||void 0===t?void 0:t.zoomToComponentOnConsecutiveClick(a)))}resetCameraPositionToStart(){this._requestRender();const e=this._getViewModel().getBoundingBox();this.configuratorCameraBehaviour.externalApiResetCameraPosition(e)}resetPreviews(){this._getViewModel().removePreviews(),this._requestRender()}changeOffset(e){this.cameraBehaviour3d.cameraControl.getCamera().offset=e,this._uiIntersectionHelper&&(this._uiIntersectionHelper.canvasOffset=e)}setCameraOffset(e){this._offsetAnimationStart(),this.cameraBehaviour3d.cameraControl.getCamera().offset&&(this.cameraBehaviour3d.cameraControl.getCamera().offset=e,this._renderEverything()),this._offsetAnimationEnd()}_offsetAnimationStart(){this._onCameraMove()}_offsetAnimationEnd(){this._onCameraIdle()}getCameraOffset(){var e,t,n;return(null===(n=null===(t=null===(e=this.cameraBehaviour3d)||void 0===e?void 0:e.cameraControl)||void 0===t?void 0:t.getCamera())||void 0===n?void 0:n.offset)?JSON.parse(JSON.stringify(this.cameraBehaviour3d.cameraControl.getCamera().offset)):{left:0,top:1,right:1,bottom:0}}_onKeyDown(e){super._onKeyDown(e),!e.key||"Escape"!==e.key&&"Esc"!==e.key||(this._getViewModel().hasPreviews()||this.cancelComponentSelection(!1,"click_outside"),e.preventDefault()),e.key&&e.key.includes("Shift")&&this.cameraBehaviour3d.cameraControl instanceof ae&&(this.enablePanning(),e.preventDefault()),this._sceneEventHandler&&this._sceneEventHandler.hasSelection()&&e.key&&("Backspace"===e.key||"Delete"===e.key)&&(this.requestDeleteSelectedComponent(),e.preventDefault())}_onKeyUp(e,t=!1){super._onKeyUp(e,t),e.key&&e.key.includes("Shift")&&(t||this.disablePanning(),e.preventDefault())}enablePanning(){this.configuratorCameraBehaviour.enablePanningOnShiftClick()}disablePanning(){this.configuratorCameraBehaviour.disablePanningOnShiftRelease()}cancelPreviousDockings(){var e;this._cancelDockings(!0,null,!1,!1),null===(e=this._roomleRenderer)||void 0===e||e.forceShadowUpdates(!0),this._renderEverything()}cancelComponentSelection(e,t){(this._sceneEventHandler.hasSelection()||"standard"!==this._sceneEventHandler.getSelectionMode())&&this._cancelSelection(e,t)}notifyPlannerOnComponentSelectionCancel(e,t){}_cancelSelection(e,t){var n;this._sceneEventHandler.cancelSelection(t),this._configuratorContext.selectionMode="standard",this._configuratorContext.selectedRuntimeComponentIds=[],this._getViewModel().removePreviews(),e&&!this._initData.debug&&this.configuratorCameraBehaviour&&this.configuratorCameraBehaviour.resetCameraToStateOnCancelSelection();const i=null===(n=this._getKernelAccess().kernelInstance.getPlanObject(this._configuratorContext.planObjectId))||void 0===n?void 0:n.externalObject;this._getKernelAccess().updatePlanObjectDependencies(this._configuratorContext.planObjectId),this._configuratorUiCallbacks.onSelectionCancel(t),this.notifyPlannerOnComponentSelectionCancel(i,t)}_selectComponent(e,t){this._configuratorContext.selectedRuntimeComponentIds=this._sceneEventHandler.getSelectedRuntimeComponentIds(),t||("standard"===this._sceneEventHandler.getSelectionMode()?this._onSelectedRuntimeComponentChange(e):this._onSelectedRuntimeComponentsChange(this._sceneEventHandler.getSelectedRuntimeComponentIds())),this._highlightComponent(e),!this._initData.debug&&t&&this._zoomToComponentOnConsecutiveClick(e)}_deselectComponent(e,t,n){"standard"===this._sceneEventHandler.getSelectionMode()&&(this._cancelSelection(t,n),this._highlightComponent()),"multiselect"===this._sceneEventHandler.getSelectionMode()&&(this._sceneEventHandler.hasSelection()?this._configuratorContext.selectedRuntimeComponentIds=this._sceneEventHandler.getSelectedRuntimeComponentIds():(this._cancelSelection(t,n),this._highlightComponent())),this._componentRaycastHelper&&this._componentRaycastHelper.changeMaterialsOnSelect(this._scene,null)}getScreenXY(e){return H(e,this.cameraBehaviour.cameraControl.getCamera(),this._domHelper.element.clientWidth,this._domHelper.element.clientHeight)}setSelectionMode(e){this._sceneEventHandler.setSelectionMode(e)}changeFloorMaterial(e){return this._environment&&this._environment instanceof le||(this._environment=new le(this._scene,this._environment,!0),this._uiIntersectionHelper.floorEnvironment=!0),new Promise((t,n)=>{this._environment.changeFloorMaterial(e,this._maxAnisotropy).then(()=>{this._requestRender(),t()},n)})}zoomIn(e){this.configuratorCameraBehaviour.externalApiZoomIn(e),this._renderEverything()}zoomOut(e){this.configuratorCameraBehaviour.externalApiZoomOut(e),this._renderEverything()}async showDimensions(){await this._initDimensions(),this._dimensionHelper.enableDimensions(),this._dimensionHelper.onDimensionsVisibilityChanged(e=>{e&&this._renderEverything(),this._configuratorUiCallbacks.onDimensionsVisibilityChange(e)}),this._configuratorUiCallbacks.onDimensionsVisibilityChange(!0),this._renderEverything()}async _initDimensions(e=!1){this._dimensionHelper||await t.import("./dimensioning-helper-4baa9955.legacy.js").then(({default:e})=>{this._dimensionHelper=new e(this._creator_)}),this._dimensionHelper.setUiScene(this._uiScene),this._dimensionHelper.setObject(this._getViewModel().getComponent(this._configuratorContext.rootComponentId),this.cameraBehaviour3d.cameraControl.getObjectRotation());const n=this._getKernelAccess().kernelInstance.getPlanObject(this._configuratorContext.planObjectId);n&&n.boxForMeasurement&&this._dimensionHelper.updateSize(n.boxForMeasurement);let i=this.cameraBehaviour3d.cameraControl.getCamera().position;if(e){const e=g(n.boxForMeasurement);i.copy(e.getCenter(new pe)),i.y=e.getSize(new pe).y+1}this._dimensionHelper.moveCameraEnd(i)}hideDimensions(){this._dimensionHelper&&this._dimensionHelper.disableDimensions(),this._componentDimensioningHelper&&this._componentDimensioningHelper.hasComponentDimensions()&&this._componentDimensioningHelper.reset(),this._renderEverything()}async loadSceneSettings(e){await super.loadSceneSettings(e),this._uiIntersectionHelper.floorEnvironment=this._environment instanceof le}onCameraChanged(){super.onCameraChanged(),this._configuratorUiCallbacks.onCameraPositionChanges(),this._updateComponentPosition()}requestDockingsPreview(e,t,n,i){i||(i=!1),e&&this.cancelPreviousDockings(),this.cancelComponentSelection(!1,"dock_preview"),i&&this.enableDragIn(n),t&&(this._configuratorContext.lastPossibleChild=t),this._configuratorContext.requestPreviewsIsUserInitiated=e,this.resetPreviews(),this._getKernelAccess().webGlPreviewDockings(this._configuratorContext,i),this._showDockings()}_requestDockingsPreviewWithDrag(e){this.cancelPreviousDockings(),this._configuratorContext.rootComponentId!==e&&(this.resetPreviews(),this._getKernelAccess().previewDockingsWithDrag(e,this._configuratorContext.planObjectId),this._showDockings())}_dockComponent(e){this._getKernelAccess().kernelInstance.isExternalPlanObject(e.parentId)?this._dockExternalComponent(e):this._dockKernelComponent(e)}_dockKernelComponent(e){h.start("dock_component_"+e.childId),this._getKernelAccess().dockComponent(e.parentId,e.parentDockId,e.childId,e.childDockId),this._configuratorContext.dockingRootComponentId=null;const t=this._getKernelAccess().kernelInstance.getComponent(e.childId);this._configuratorUiCallbacks.onElementDocked(JSON.parse(JSON.stringify(t)),e.childId),this.saveConfigToIdb()}_dockExternalComponent(e){this._getKernelAccess().dockExternalObjectComponent(e.parentId,e.parentDockId,e.childId,e.childDockId)}_onSelectedRuntimeComponentsChange(e){this._getKernelAccess().multiSelectionChange(e,this._configuratorContext.rootComponentId)}_onSelectedRuntimeComponentChange(e){let t=!1,n=null;e&&(t=e.runtimeId===this._configuratorContext.rootComponentId,n=e.runtimeId),this._getKernelAccess().selectionChange(n,t),e&&this._getKernelAccess().selectedComponent(e.runtimeId)}requestDeleteSelectedComponent(){const e=this._configuratorContext.selectedRuntimeComponentIds,t=this._configuratorContext.rootComponentId;if(this._getKernelAccess().isExternalObjectOrComponent(t)||Array.isArray(e)&&0!==e.length&&t&&-1===e.indexOf(t)){switch(this._configuratorContext.selectionMode){case"standard":this._getKernelAccess().requestDeleteComponent(this._configuratorContext.selectedRuntimeComponentId);break;case"multiselect":this._getKernelAccess().requestDeleteComponents(this._configuratorContext.selectedRuntimeComponentIds)}this._configuratorContext.selectedRuntimeComponentIds=[]}}componentUpdated(e,t){var n;if(e.runtimeId===this._configuratorContext.rootComponentId){let t=new pe(e.position.x/1e3,e.position.z/1e3,e.position.y/-1e3);this._sceneEventHandler.update(null,t,null)}void 0===e.geometryChanged||e.geometryChanged?this._renderEverything():this._renderWithoutShadowsAndAO(),null===(n=this._componentDimensioningHelper)||void 0===n||n.invalidateDimensioningsCache(e.runtimeId)}planObjectUpdated(e,t,n){const i=this._getKernelAccess().kernelInstance.getSerializedConfiguration(this._configuratorContext.planObjectId);if(n||this._configuratorHistory.push(i),e.bounds){if(this._configuratorContext.planObjectId===e.id&&this.cameraBehaviour3d instanceof We){const e=this._getViewModel().getBoundingBox();this.cameraBehaviour3d.updateBoundsOnPlanObjectUpdated(e);const n=this._getViewModel().getBoundingBoxOfGeometry();this._updateBounds(e,n,t)}this._highlightComponent(),this._requestRender()}}componentDeleted(e){-1===this._sceneEventHandler.getSelectedRuntimeComponentIds().indexOf(e.runtimeId)&&"multiselect"!==this._sceneEventHandler.getSelectionMode()||this.cancelComponentSelection(!1,"delete_component")}previewConstructionDone(e,t){const n=this._getViewModel().getBoundingBoxWithPreviews();t||(this._cancelDockings(!0,null,!1,!1,!1),this._configuratorContext.requestPreviewsIsUserInitiated&&this._configuratorUiCallbacks.onNoDockingsAvailable());let i=!0;this._componentRaycastHelper&&(i=!this._componentRaycastHelper.areAllComponentsInFrustum(this._getViewModel().getPreviews())),this._configuratorContext.requestPreviewsIsUserInitiated&&i&&this.configuratorCameraBehaviour.zoomToFitBoundsAfterUserInitiatedPreviews(n),this._lightSetting&&this._lightSetting.needsBounds()&&(this._lightSetting.updateBounds(n),this._environment&&this._environment.needsBounds()&&this._environment.updateBounds(n.getSize(new pe))),this._componentRaycastHelper&&this._componentRaycastHelper.checkPreviewVisibility(this._getViewModel())}configurationLoaded(e,t){e&&t&&this._sceneEventHandler.isDragIn()?(e.position.copy(new pe(0,100,0)),this._scene.add(e),this._sceneEventHandler.addComponentDragInHandler(e),this._requestRender()):t||this._initData.debug||this._initData.moc||this.configuratorCameraBehaviour.resetCameraToStartOnConfigurationLoaded(this.getBounds()),this._environment&&this._environment.reload(),this._waitForAssets().then(()=>{this._readyForRender()})}addComponentHandlers(e){this._sceneEventHandler.addComponentHandlers(e)}addPreviewHandlers(e){this._sceneEventHandler.addPreviewHandlers(e)}addPreviewLineHandlers(e){this._sceneEventHandler.addPreviewLineHandlers(e)}_updateComponentPosition(){if(!this._configuratorUiCallbacks.onComponentPositionsUpdated||"configurator"!==this._configuratorContext.baseContext)return;const e=[];this._getViewModel().getComponents().forEach(t=>{if(!t.boundingBoxMesh)return;const n=(new ue).setFromObject(t.boundingBoxMesh);let i=this._getKernelAccess().kernelInstance.getComponent(t.runtimeId);const o=i.parameters||i.possibleChildren?["edit"]:[];e.push({id:t.runtimeId,position:this.getScreenXY(n.getCenter(new pe)),type:"component",actions:o})}),this._getViewModel().getPreviews().forEach(t=>{const n=(new ue).setFromObject(t);e.push({id:t.runtimeId,position:this.getScreenXY(n.getCenter(new pe)),type:"preview",actions:["add"]})}),this._configuratorUiCallbacks.onComponentPositionsUpdated(e)}_updateBounds(e,t,n=!1){var i;if(super._updateBounds(e,t,n),!e)return;let o=e.getSize(new pe);const s=this._getKernelAccess().kernelInstance.getPlanObject(this._configuratorContext.planObjectId);s&&s.boxForMeasurement&&(null===(i=this._dimensionHelper)||void 0===i||i.updateSize(s.boxForMeasurement)),this._sceneEventHandler.update(o,null,null),this._uiIntersectionHelper.updateToBounds(o,this._domHelper.element.clientWidth,this._domHelper.element.clientHeight),this._componentDimensioningHelper&&this._componentDimensioningHelper.hasComponentDimensions()&&this._componentDimensioningHelper.reset(),this.cameraBehaviour3d.cameraControl.getCamera().updateProjectionMatrix()}async moveCamera(e){return this.configuratorCameraBehaviour.externalApiMoveCamera(e)}getSelectedRuntimeComponentIds(){return this._sceneEventHandler.getSelectedRuntimeComponentIds()}selectComponent(e,t=!0){if(!e)return;const n=this._getViewModel().getComponents().find(t=>t.runtimeId===e);n?this._sceneEventHandler.clickComponent(n,t):console.warn('Can not select "'+e+'" because it was not found')}highlightParts(e){this._highlightComponent(null,e),this._requestRender()}_shouldHighlightComponent(){return"configurator"===this._configuratorContext.baseContext&&(this._initData.highlighting===Se.ALWAYS||this._initData.highlighting!==Se.OFF&&(!!this._getKernelAccess().kernelInstance.getComponent(this._configuratorContext.rootComponentId).externalComponent||(this._plannerKernelAccess.kernelInstance.getChildrenOfPlanComponent(this._configuratorContext.rootComponentId,!0,!1)||[]).length>1))}saveConfigToIdb(){var e,t;let n,i;const{configuratorId:o}=this._globalInitData,{lastLoadedPlanId:s,lastLoadedRapiId:r}=this._configuratorContext;this._initData.moc?(n=s,i=null===(t=null===(e=this._getKernelAccess())||void 0===e?void 0:e.planInteractionHandler.getPlan())||void 0===t?void 0:t.getPlanXML(!1,2)):(n=r,i=this._getKernelAccess().kernelInstance.getSerializedConfiguration(this._configuratorContext.planObjectId));const a=this._idbManager.getKey(U(),o,n);this._idbManager.setValue(a,i,this._idbManager.configStore)}_getInputManager(){return this._configuratorInputManager}createCameraControl(e,t){this._componentFactory=ee();const n=this._domHelper.getClientDimensions(),i=n.x,o=n.y,s=this._componentFactory.createPerspectiveCamera(30,i/o,.1,20,t);s.layers.set(3),s.layers.enable(1),s.layers.enable(2),s.layers.enable(6),s.layers.enable(5),s.position.copy(new pe(0,.5,5)),this._changeCameraBehaviour(new We(new ae(this._creator_,this._getInputManager(),null,s),this._cameraBehaviourState))}getBounds(){return this._getViewModel().getBoundingBox()}getGeometryBounds(){return this._getViewModel().getBoundingBoxOfGeometry()}sceneChanged(){}get configuratorCameraBehaviour(){return this.cameraBehaviour instanceof We?this.cameraBehaviour:null}get cameraBehaviour3d(){return this.cameraBehaviour}_onCameraIdle(){return super._onCameraIdle()}_onCameraMove(){return super._onCameraMove()}getComponent(e){return this._plannerKernelAccess.kernelInstance.getComponent(e)}cameraBehaviourChanged(){var e;super.cameraBehaviourChanged(),null===(e=this._sceneEventHandler)||void 0===e||e.setCamera(this.cameraBehaviour.cameraControl.getCamera()),this._setCameraControlListeners()}_setCameraControlListeners(){this.cameraBehaviour3d&&(this.cameraBehaviour.cameraControl.addEventListener(0,()=>{this._configuratorUiCallbacks.onCameraPositionChanges(),this._sceneEventHandler.setCameraMoving(!0),this._requestRender()},this),this.cameraBehaviour.cameraControl.addEventListener(1,()=>{this._componentRaycastHelper&&this._componentRaycastHelper.checkComponentAndPreviewVisibility(this._sceneEventHandler,this._getViewModel()),this._requestRender()},this),this.cameraBehaviour.cameraControl.addEventListener(2,()=>{this._sceneEventHandler.setCameraMoving(!1),this._requestRender()},this),this.cameraBehaviour.cameraControl.addEventListener(5,({minZoom:e,maxZoom:t})=>{this._configuratorUiCallbacks.onZoomChange(e,t)},this),this.cameraBehaviour.cameraControl.addEventListener(3,()=>{this._configuratorUiCallbacks.onCameraPositionChanges(),this._requestRender()},this),this.cameraBehaviour.cameraControl.addEventListener(4,()=>{this._configuratorUiCallbacks.onCameraPositionChanges(),this._requestRender()},this),this.cameraBehaviour.cameraControl.addEventListener(7,()=>{var e;this._pluginSystem.moveCameraStart(this.cameraBehaviour.cameraControl.getCamera().position),null===(e=this._dimensionHelper)||void 0===e||e.moveCameraStart(this.cameraBehaviour.cameraControl.getCamera().position)},this),this.cameraBehaviour.cameraControl.addEventListener(8,()=>{var e;this._pluginSystem.moveCameraEnd(this.cameraBehaviour.cameraControl.getCamera().position),null===(e=this._dimensionHelper)||void 0===e||e.moveCameraEnd(this.cameraBehaviour.cameraControl.getCamera().position),this._updateComponentPosition()},this))}_shouldRenderUi(){var e;return super._shouldRenderUi()||(null===(e=this._dimensionHelper)||void 0===e?void 0:e.areDimensionsEnabled())}setEventHandlerObject(e){this._sceneEventHandler.setObject(e)}_readyForRender(){"configurator"===this._configuratorContext.baseContext&&(this._configuratorUiCallbacks.onReadyForRender(),this._globalCallback.onReadyForRender())}animateElement(e,t,n,i,o){const s="animation:"+t;this._viewModel.changeAnimationValue(e,s,n,i,o)}}e("C",Ne),n([i],Ne.prototype,"_configuratorInputManager",void 0),n([i],Ne.prototype,"_configuratorMeshGenerator",void 0),n([i],Ne.prototype,"_memoryManager",void 0),n([i],Ne.prototype,"_configuratorContext",void 0),n([i],Ne.prototype,"_componentDimensioningHelper",void 0),n([i],Ne.prototype,"_configuratorHistory",void 0),n([i],Ne.prototype,"_configuratorUiCallbacks",void 0),n([i],Ne.prototype,"_plannerKernelAccess",void 0),n([i],Ne.prototype,"_globalInitData",void 0);const qe=(e,t)=>{let n=J(e,t);return 0!==n?n:(n=$(e.label,t.label),0!==n?n:$(e.id,t.id))},ze=e=>(e.sort(qe),e.forEach(e=>e.materials.sort(qe)),e),Ze=(e,t)=>{if("external"!==e.source)return t;const n=xe(t),i=e.validValues.reduce((e,{label:t,value:n})=>(e.has(n)||e.set(n,t),e),new Map);for(const e of n)for(const t of e.materials)i.has(t.id)&&(t.label=i.get(t.id)||"");return n};class Qe{_isInitDone(){return this._isKernelReady&&this._isWebGlReady&&this._isPreloadReady}_checkInitDone(){this._isInitDone()&&(this._onInitDoneCollection.forEach(e=>e()),this._onInitDoneCollection=[])}_onInitDone(e){this._isInitDone()?e():this._onInitDoneCollection.push(e)}constructor(e,t){this._onInitDoneCollection=[],this._isKernelReady=!1,this._isWebGlReady=!1,this._isPreloadReady=!0,this._isLoadError=!1,this._isReloading=!1,this._needsSync=!1,this._creator_=e,this._activePlugins=t||[],this._configuratorKernelAccessCallback.addListener(this);const{dls:n,ls:i}=this._initData;(i||n)&&(this._initData.legacyLight=!0),this._initData.legacyLight&&(this._initData.envMapIntensity=.9);const o=this._errorHandler;o.subscribe(0,e=>this._configuratorUiCallbacks.onErrorDueToOffline(e)),o.subscribe(1,e=>this._configuratorUiCallbacks.onError(e)),o.subscribe(2,(e,t)=>this._configuratorUiCallbacks.onContentProblem({rapiPath:e,ids:t,message:"Could not load the ids"}))}exportCanvasScreenshot(e){return this._sceneManager.exportCanvasScreenshot(e)}initSceneManager(e){this._sceneManager=e||o.lookup("configurator-scene-manager",this._creator_)}getScene(){return this._sceneManager.getScene()}updateScene(){this._sceneManager.updateScene()}_loadWebGlLib(e,t){this._loadingWebGlSuccess(e,t)}_loadingWebGlSuccess(e,t){this.initSceneManager(),t&&this._sceneManager.changeOffset(t);const{initialFloorMaterial:n,dls:i,ls:o,stats:s}=this._initData,r=V.createDynamicLightSettingSource(i,o);s&&this.showStats(),this._sceneManager.enableHD(r),this._needsSync&&(this._needsSync=!1,this._plannerKernelAccess.requestSync(N,this._configuratorContext.planObjectId));const a=[this._scriptLoader.fetch(ce,{id:"tween-js"})];n&&a.push(this._rapiAccess.getMaterial(n).then(e=>this._sceneManager.changeFloorMaterial(e))),Promise.all(a).then(this._webGlIsReady.bind(this),this.loadError.bind(this))}_webGlIsReady(){this._isWebGlReady=!0,this._checkInitDone()}_initPromiseCallback(e,t){this._isInitDone()?e():this._isLoadError?t("_initPromiseCallback failed"):(this._onInitDone(()=>e()),this._rejectOnLoadError=t)}_notifyOnConfigurationReady(e){return async t=>{const n=await this._plannerKernelAccess.addUiDataAndPriceToPartList(t.partList,t.hash);t.partList=n,e(t),this._configuratorUiCallbacks.onConfigurationReady(n,t.hash,t.rootComponentLabel),this._configuratorHistory.clearHistory()}}_notifyOnConfigurationLoadingError(e){return t=>{this._configuratorUiCallbacks.onConfigurationLoadError(),e(t)}}_loadItemOrConfigById(e,t){this._configuratorContext.lastLoadedRapiId=e,this._onLoadConfiguration(),this._preloadPackage(e),this._clearScene();const{offlineSync:n}=this._initData;if(n){const t=q(e);t&&this._dataSyncer.start(t)}return new Promise((n,i)=>{(t?this._rapiAccess.getConfiguration(e):this._rapiAccess.getItem(e)).then(t=>{t&&t.configuration?this._loadConfiguration(t.configuration).then(e=>{const i=this._notifyOnConfigurationReady(n);t.label?this._notifyUiAboutNewItem(t,e.rootComponentLabel):this._notifyUiAboutNewConfiguration(t),i(e)},this._notifyOnConfigurationLoadingError(i).bind(this)):i(new Error("Could not load item or config with id "+e))},i)})}_shouldBroadcastToUi(e){return!(0===e&&this._configuratorContext.selectedRuntimeComponentId||1===e&&!this._configuratorContext.selectedRuntimeComponentId||2===e&&!this._configuratorContext.selectedRuntimeComponentIds.length)}_isCorrectResponse(e,t){if(0===e)return t===this._configuratorContext.planObjectId;if(1===e)return t===this._configuratorContext.selectedRuntimeComponentId;const n=t.length;if(n!==this._configuratorContext.selectedRuntimeComponentIds.length)return!1;for(let e=0;e<n;e++)if(t[e]!==this._configuratorContext.selectedRuntimeComponentIds[e])return!1;return!0}_onLoadConfiguration(){this._clearScene(),this._configuratorUiCallbacks.onLoadConfiguration()}_clearScene(){this._sceneManager&&this._sceneManager.clearScene()}_notifyUiAboutNewItem(e,t){this._rapiAccess.getCatalog(e.catalog).then(n=>this._configuratorUiCallbacks.onConfigurationLabelChange(n.name,e.label,t))}_notifyUiAboutNewConfiguration(e){Promise.all([this._rapiAccess.getCatalog(e.catalog),this._rapiAccess.getComponent(e.rootComponentId)]).then(([e,t])=>this._configuratorUiCallbacks.onConfigurationLabelChange(e.name,null,t.label))}notifyUiAboutNewLabel(e){if(z(e)){const t=this._rapiAccess.peekItem(e),n=this._rapiAccess.peekComponent(t.rootComponentId);this._notifyUiAboutNewItem(t,n.label)}else this._notifyUiAboutNewConfiguration(this._rapiAccess.peekConfiguration(e))}_getMaterialGroups(e){if(e.validGroups.length>0)return new Promise((t,n)=>this._rapiAccess.getMaterialsByGroup(e.validGroups).then(n=>t(Ze(e,ze(n))),n));const t=e.validValues.filter(e=>null!==e.value&&void 0!==e.value).map(e=>e.value);return new Promise((n,i)=>{this._rapiAccess.getMaterials(t).then(t=>{this._rapiAccess.combineMaterialsToGroups(t).then(t=>{n(Ze(e,ze(t)))})},i)})}_loadConfiguration(e){return this._plannerKernelAccess.externalMeshQueue.clear(),new Promise((t,n)=>{const i=()=>{const{x:i,y:o}=this._domHelper.getClientDimensions();if(i<=0&&o<=0){let e="Size of canvas is 0/0! When using embedding set correct size or remove id to load in idle mode!";return console.error(e),n(e)}this.resumeKernelCallbacks(),h.start("ui_load_configuration");const s=[];if(this._initData.applyCurrentGlobalParameters){const e=this._configuratorContext.planObjectId,t=this._configuratorContext.rootComponentParametersAsGlobal;s.push(this._plannerKernelAccess.getGlobalParameters(e,t))}Promise.all(s).then(([i])=>{const o=[d.waitFor(4),d.waitFor(2)];Promise.all(o).then(([e,[n,o,s,r]])=>{const a=[];i&&this._initData.applyCurrentGlobalParameters&&i.forEach(e=>a.push(this.setParameter(e,e.value,!0)));const l=this._rapiAccess.peekComponent(r);Promise.all(a).then(()=>{const n=[];a.length&&(n.push(this._plannerKernelAccess.getPartList()),n.push(this._plannerKernelAccess.getConfigurationHash(this._configuratorContext))),Promise.all(n).then(async n=>{const i=n&&n[0]?n[0]:o,r=n&&n[1]?n[1]:s,a=await this._plannerKernelAccess.addUiDataAndPriceToPartList(i,r);let c=e.errors;const h=c?Y(c):[];this._configuratorUiCallbacks.onPartListUpdate(a,window.btoa(s)),t({partList:a,hash:r,rootComponentLabel:l?l.label:"",errors:h})})})},n),this._plannerKernelAccess.loadConfiguration(e)},n)};this._onInitDone(()=>i())})}_preLoadItemOrConfig(e,t){return new Promise((n,i)=>{(t?this._rapiAccess.getConfiguration(e):this._rapiAccess.getItem(e)).then(n,i)})}_preloadPackage(e){this._isPreloadReady=!1;let t=null;t=z(e)?this._rapiAccess.getPreloadForItem.bind(this._rapiAccess):this._rapiAccess.getPreloadForConfiguration.bind(this._rapiAccess),h.start("rapi_preloads");const n=()=>{const t=h.getMeasure("rapi_preloads");if(Array.isArray(t)&&1===t.length){const n=t[0];this._configuratorUiCallbacks.onTrackTiming("Timing","RapiPreloads",Math.round(n.duration),{id:e})}};t(e).then(()=>{this._isPreloadReady=!0,this._checkInitDone(),n()},e=>{this._isPreloadReady=!0,this._checkInitDone(),console.error(e),n()})}_reloadConfiguration(e,t,n,i){return this._performLoadConfiguration(e).then(e=>{this._isReloading=!1,n(e)},e=>{this._isReloading=!1,i(e)})}_performLoadConfiguration(e){return this._onLoadConfiguration(),new Promise((t,n)=>{this._initData.preloadHint?this._preloadPackage(this._initData.preloadHint):console.warn("When loading a configuration string you have to supply a preloadHint to use fast loading!"),setTimeout(()=>{this._loadConfiguration(e).then(this._notifyOnConfigurationReady(t).bind(this),this._notifyOnConfigurationLoadingError(n).bind(this))},0)})}_changeHDGeometry(e){return new Promise((t,n)=>e===Z.useHDGeometry?t():this._isReloading?n("Change of HD Geometry in progress"):(this._isReloading=!0,d.waitFor(3).then(([e,i])=>{this._reloadConfiguration(e,i,t,n)},n),Z.useHDGeometry=e,void this._plannerKernelAccess.changeUseOfHDGeometry(this._configuratorContext,Z.useHDGeometry)))}async _callOnPartListUpdate(){const{hash:e}=await d.waitFor(4),t=await this._plannerKernelAccess.getPartList(),n=await this._plannerKernelAccess.getConfigurationHash(this._configuratorContext),i=await this._plannerKernelAccess.addUiDataAndPriceToPartList(t,n);this._configuratorUiCallbacks.onPartListUpdate(i,window.btoa(e))}setOverrides(e){e&&(this._initData.setOverrides(e),this._globalInitData.setOverrides(e))}init(e,t){this.setOverrides(t);const{preloadHint:n,offset:i,startTag:o}=this._initData;return this._domHelper.setDomElement(e),n?this._preloadPackage(n):console.warn("No preload hint! Therefore no preload during init!!"),o&&this.getTagById(o,{include:["items"]}).then(e=>this._configuratorUiCallbacks.onOpenTag(e),e=>console.error(e)),this._loadWebGlLib(e,i),new Promise(this._initPromiseCallback.bind(this))}cancelSelection({reason:e,resetCamera:t}={}){this._sceneManager.cancelComponentSelection(null!=t&&t,e||"unknown")}enableHDGeometry(){return this._changeHDGeometry(!0)}disableHDGeometry(){return this._changeHDGeometry(!1)}changeOffset(e){this._sceneManager.changeOffset(e)}previewDockings(e,t,n){this._sceneManager.requestDockingsPreview(!0,e,t,n)}cancelDockings(){this._sceneManager.cancelDockings()}requestDeleteComponent(){this._sceneManager.requestDeleteSelectedComponent()}renderImage(e){return this._sceneManager.renderImage(e)}preparePerspectiveImage(e={}){return this._sceneManager.preparePerspectiveImage(e)}preparePartImage(e,t){let n={};return"number"==typeof t?n.size=t:(t||(t={}),"number"!=typeof t.size&&(t.size=256),n=t),this._sceneManager.preparePartImage(e,n)}async saveCurrentConfiguration(){var e;try{const t=await this._plannerKernelAccess.getConfigurationData(this._configuratorContext.planObjectId);if(null===(e=this._plannerKernelAccess.kernelInstance)||void 0===e?void 0:e.isExternalPlanObject(this._configuratorContext.planObjectId)){this._activePlugins.includes("external-objects")||console.warn("External objects are not enabled, expect unexpected behavior");const{image:e}=await this._sceneManager.preparePerspectiveImage();return{...t,id:He(t.configurationHash),label:"",perspectiveImage:e,externalObject:!0}}const n=await this._rapiAccess.saveConfiguration(t);this._configuratorUiCallbacks.onConfigurationSaved(n.configurationHash);const i=await this._rapiAccess.getComponent(n.rootComponentId);let o=null,s=null;if(n.perspectiveImage&&!this._initData.featureFlags.forceSaveThumbnails||(o=await this._sceneManager.preparePerspectiveImage({},!0)),n.topImage&&!this._initData.featureFlags.forceSaveThumbnails||(s=await this._sceneManager.prepareTopImage({},!0)),o&&s){const e=await this._rapiAccess.saveConfigurationImage(n,o,"perspectiveImage",s,"topImage");n.perspectiveImage=e.perspectiveImage,n.topImage=e.topImage}return n.label=i.label,n.externalObject=!1,this._rapiAccess.updateCache("configurations",n),n}catch(e){throw new Error(e)}}generateImagesOfCurrentConfiguration(){return new Promise((e,t)=>this.saveCurrentConfiguration().then(t=>e({topImage:t.topImage,perspectiveImage:t.perspectiveImage,isLocally:t.isLocally}),t))}prepareTopImage(e){let t={};return"boolean"==typeof e?t.showDimensions=e:(e||(e={}),"boolean"!=typeof e.showDimensions&&(e.showDimensions=!1),t=e),this._sceneManager.prepareTopImage(t)}resetCameraPosition(){this._sceneManager.resetCameraPositionToStart()}showBenchmarks(e){h.showBenchmarks(e)}debugSceneGraph(e){this._sceneManager.debugSceneGraph(e)}async loadConfiguration(e,t){this.setOverrides(t),this._configuratorContext.lastLoadedRapiId=null,this._sceneManager&&this._sceneManager.clearScene();const n=await this._performLoadConfiguration(e);return this._rapiAccess.trackView("configuration string"),n}async loadConfigurationById(e,t){this.setOverrides(t);const n=await this._loadItemOrConfigById(e,!0);return this._rapiAccess.trackView(e),n}async loadConfigurableItemById(e,t){this.setOverrides(t);const n=await this._loadItemOrConfigById(e,!1);return this._rapiAccess.trackView(e),n}preLoadConfigurationById(e){return this._preLoadItemOrConfig(e,!0)}preLoadConfigurableItemById(e){return this._preLoadItemOrConfig(e,!1)}_getTag(e){return this._rapiAccess.getTag(e)}_dispatchSetParameter(e,t,n,i,o){const s=this._configuratorContext.selectedRuntimeComponentId?"local":"global";switch(h.start("kernel_change_param_"+s+"_"+e),this._configuratorContext.selectionMode){case"standard":if(this._configuratorContext.selectedRuntimeComponentId||this._configuratorContext.rootComponentParametersAsGlobal){let s=this._configuratorContext.selectedRuntimeComponentId?this._configuratorContext.selectedRuntimeComponentId:this._configuratorContext.rootComponentId;this._plannerKernelAccess.changeComponentParameter(s,e,t,n,i,o)}else this._plannerKernelAccess.changePlanObjectParameter(this._configuratorContext.planObjectId,e,t,n,i,o);break;case"multiselect":this._plannerKernelAccess.changeCommonComponentParameter(this._configuratorContext.selectedRuntimeComponentIds,e,t,n,i,o)}}setParameter(e,t,n=!1){return new Promise((i,o)=>{const{key:s,type:r}=e;if(Q(e)){if(!n&&!this._unitFormatter.isParseableUnitString(t,e))return o(new SyntaxError('Value "'+t+'" is not parseable'));const i=n?t:this._unitFormatter.parseValue(t,e),{valueFrom:s,valueTo:a}=e.validRange,l=this._unitFormatter.getAllowedDelta();if(!Number.isNaN(s)&&i<s-l)return o(new RangeError('Value "'+t+'" is too small, min-val "'+s+'"'));if(!Number.isNaN(a)&&i>a+l)return o(new RangeError('Value "'+t+'" is too big, max-val "'+a+'"'));t="Integer"===r&&"number"==typeof i?i.toFixed():i.toString()}this._sceneManager.cancelDockings(),this._dispatchSetParameter(s,r,t,i,o),this._sceneManager.saveConfigToIdb()})}setParameterOfPlanObject(e,t){return new Promise((n,i)=>{const{planObjectId:o,rootComponentId:s,rootComponentParametersAsGlobal:r}=this._configuratorContext,{type:a,key:l}=e;r?this._plannerKernelAccess.changeComponentParameter(s,l,a,t,n,i):this._plannerKernelAccess.changePlanObjectParameter(o,l,a,t,n,i)})}getParametersOfPlanObject(){const{planObjectId:e,rootComponentParametersAsGlobal:t}=this._configuratorContext;return this._plannerKernelAccess.getGlobalParameters(e,t)}setParameterOfRootComponent(e,t){return new Promise((n,i)=>{const{rootComponentId:o}=this._configuratorContext,{type:s,key:r}=e;this._plannerKernelAccess.changeComponentParameter(o,r,s,t,n,i)})}getParametersOfRootComponent(){const{planObjectId:e}=this._configuratorContext;return this._plannerKernelAccess.getGlobalParameters(e,!0)}enableMultiselect(){this._sceneManager.setSelectionMode("multiselect"),this._configuratorContext.selectionMode="multiselect"}disableMultiselect(){this._sceneManager.setSelectionMode("standard"),this._configuratorContext.selectionMode="standard"}getCurrentConfiguration(){return d.waitFor(1,()=>this._plannerKernelAccess.uiRequestConfiguration(this._configuratorContext.planObjectId))}loadComponentIntoKernel(e){return d.waitFor(0,()=>{let t=null;try{if(t=JSON.parse(e).id,!t)throw new Error("Component string has no ID")}catch(e){return this._configuratorUiCallbacks.onContentProblem({rapiPath:"components",ids:[t],message:"Component string is not a valid JSON or has no ID"}),void d.failOperation(0,e)}this._kernelIo.setMeta({componentId:t}),this._plannerKernelAccess.loadComponentIntoKernel(e,t)})}getShortUrlOfCurrentConfiguration(){return new Promise((e,t)=>{this.saveCurrentConfiguration().then(n=>navigator.onLine?this._rapiAccess.getShortUrl(n.id,3).then(t=>{const n=t.shortId,i=R.APP.SHORTENER_URL+n;e(i)},t):t("Can not generate short url when offline"),t)})}formatValueToUnitString(e,t){return this._unitFormatter.formatValueToUnitString(e,t)}getTagById(e,t){return new Promise((n,i)=>{this._getTag(e).then(e=>{let o=Promise.resolve([]),s=Promise.resolve([]);t&&t.include&&t.include.forEach(t=>{"materials"===t&&(o=this._rapiAccess.getMaterialsOf(e)),"items"===t&&(s=this._rapiAccess.getItems(e.items))}),Promise.all([o,s]).then(([t,i])=>(i.sort(J),t.sort(J),n({...e,items:i,materials:t})),i)},i)})}requestAsset(e){return this._dataSyncer.requestAsset(e)}changeFloorMaterial(e){return this._sceneManager.changeFloorMaterial(e)}async changeFloorMaterialById(e){const t=await this._rapiAccess.getMaterial(e);return this._sceneManager.changeFloorMaterial(t)}openFloorMaterials(){this._configuratorUiCallbacks.onOpenFloorMaterials()}openPartList(){this._configuratorUiCallbacks.onOpenPartList()}getAdditionalContentsOf(e){return this._rapiAccess.getAdditionalContentsOfItems(e)}changeTypeChangeTag(e){navigator.onLine&&this._initData.offlineSync&&this._dataSyncer.syncTypeChangeTag(e),this._configuratorUiCallbacks.onChangeTypeChangeTag(e)}removeTypeChangeTag(e){this._configuratorUiCallbacks.onRemoveTypeChangeTag(e)}showGUI(){this._sceneManager.showGUI()}showStats(){this._sceneManager.showStats()}showDimensions(){this._sceneManager.showDimensions()}hideDimensions(){this._sceneManager.hideDimensions()}syncCatalog(e){return this._dataSyncer.syncCatalog(e)}syncFloorTag(e){return this._dataSyncer.syncFloorTag(e)}syncTypeChangeTag(e){return this._dataSyncer.syncTypeChangeTag(e)}loadDynamicLightSetting(e){return this._sceneManager.loadDynamicLightSetting(e)}setBackgroundColor(e){this._sceneManager.setBackgroundColor(e)}setBackgroundImage(e){this._sceneManager.setBackgroundImage(e)}loadSceneSetting(e){return this._sceneManager.loadSceneSettings(e)}enableMeshSelection(e){this._initData.meshSelection=e}updateSize(){this._sceneManager.updateCamera()}setCameraOffset(e){this._sceneManager.setCameraOffset(e)}getCameraOffset(){return this._sceneManager.getCameraOffset()}getMain(){}cleanup(e={}){this._configuratorContext.selectedRuntimeComponentIds=[],this._plannerKernelAccess.cleanUpCallbacks(),this._sceneManager.sceneCleared(!!e.resetMeshCache),e.resetCoreCache&&this._plannerKernelAccess.kernelInstance.clearAll(),e.resetApiCache&&this._rapiAccess.cleanUp()}resumeTest(e){e&&this._domHelper.setDomElement(e),this._lifeCycleManager.resume()}pauseTest(){this._lifeCycleManager.pause()}zoomIn(e){this._sceneManager.zoomIn(e)}zoomOut(e){this._sceneManager.zoomOut(e)}get callbacks(){return this._configuratorUiCallbacks}get globalCallbacks(){return this._globalCallback}getRuntimeComponentIdOfRootComponent(){const e=this._configuratorContext.planObjectId;return e?this._plannerKernelAccess.getRuntimeComponentIdOfRootComponent(e):(console.warn("planObjectId not set"),0)}getCurrentConfigurationHash(){return this._plannerKernelAccess.getConfigurationHash(this._configuratorContext)}getCurrentSelection(){let e=this._configuratorContext.selectedRuntimeComponentIds;return e&&e.length||(e=[this._configuratorContext.rootComponentId]),e.map(e=>this._plannerKernelAccess.getRuntimeComponentId(e))}isReady(){const e=h.getMeasure("kernel_is_ready");if(Array.isArray(e)&&1===e.length){const t=e[0],n=h.getMeta("kernel_is_ready");this._configuratorUiCallbacks.onTrackTiming("Timing","KernelIsReady",Math.round(t.duration),Object.assign(n,{startTime:t.startTime}))}this._isKernelReady=!0,this._checkInitDone(),"function"==typeof this._configuratorUiCallbacks.onKernelIsReady&&this._configuratorUiCallbacks.onKernelIsReady()}async updatePossibleChildren(e,t,n){const i=await this._addAdditionalInfoToPossibleChildren(e,t,n);if(i){const{tags:e,defaultChild:t}=i;this._shouldBroadcastToUi(n)&&this._configuratorUiCallbacks.onUpdatePossibleChildren(e,t)}}updateParameters(e,t,n,i){this._setParameterTooltip(e,n),this._addGroupsToParameters(n,e,t,i),this._plannerKernelAccess.updateAnimationParameters(n,e),this._shouldBroadcastToUi(i)&&this._configuratorUiCallbacks.onUpdateParameters(e)}loadError(e){this._isLoadError=!0,this._rejectOnLoadError&&this._rejectOnLoadError(e)}resumeKernelCallbacks(){this._plannerKernelAccess.muteKernelCallbacks=!1,this._plannerKernelAccess.resume()}pauseKernelCallbacks(){this._plannerKernelAccess.muteKernelCallbacks=!0,this._plannerKernelAccess.pause()}setActiveGroupInView(e){this._plannerKernelAccess.setActiveGroupInView(e)}setActiveGroupInViewForPlanObject(e,t){this._plannerKernelAccess.setActiveGroupInViewForPlanObject(e,t)}getParameterGroups(){return this._plannerKernelAccess.getParameterGroups()}async getConfiguratorSettings(){return this._rapiAccess.getConfiguratorSettings()}async moveCamera(e){return this._sceneManager.moveCamera(e)}selectComponent(e){return this._configuratorContext.selectedRuntimeComponentId===e?Promise.resolve():Promise.resolve(this._sceneManager.selectComponent(e))}setComponentParameter(e,t,n){const{key:i,type:o}=t;return new Promise((t,s)=>this._plannerKernelAccess.changeComponentParameter(e,i,o,n,t,s))}highlightParts(e){this._sceneManager.highlightParts(e)}undo(){return new Promise((e,t)=>{const n=this._configuratorHistory.undo();n&&(this._callOnPartListUpdate().then(e,t),this._plannerKernelAccess.loadConfiguration(n))})}redo(){return new Promise((e,t)=>{const n=this._configuratorHistory.redo();n&&(this._callOnPartListUpdate().then(e,t),this._plannerKernelAccess.loadConfiguration(n))})}clearHistory(){this._configuratorHistory.clearHistory()}getHashOfSerializedConfiguration(e){return this._plannerKernelAccess.kernelInstance.getHashOfSerializedConfiguration(e)}getParametersOfComponent(e){const t=this._plannerKernelAccess.getComponentParameters(e),n=this.getParameterGroups();return this._mapComponentTooltipsToParamKeys(t,e),this._addGroupsToParameters(e,t,n,1,!0)}_mapComponentTooltipsToParamKeys(e,t){const n=this._plannerKernelAccess.kernelInstance.getComponentId(t),i=this._rapiAccess.peekComponent(n);if(i&&i.additionalInfos)for(const t of e){const e=i.additionalInfos.find(e=>e.key.toLocaleLowerCase()===t.key.toLocaleLowerCase()&&"parameter"===e.type);e&&(t.tooltip=e.tooltip,t.additionalInfos=i.additionalInfos)}}_setParameterTooltip(e,t){Array.isArray(t)?t.forEach(t=>this._mapComponentTooltipsToParamKeys(e,t)):this._mapComponentTooltipsToParamKeys(e,t)}_addGroupsToParameters(e,t,n,i,o=!1){n||(n=[],console.warn("Kernel returned no parameter groups! Check why!"));const s={};return n.forEach(e=>{s[e.key]=e}),t.sort(J),t.forEach(t=>{t.group?t.grouping=s[t.group]:t.grouping=null,this._unitFormatter.formatParameter(t),X(t)&&Object.defineProperty(t,"groups",{get:()=>new Promise((n,s)=>{this._getMaterialGroups(t).then(t=>{this._isCorrectResponse(i,e)&&this._shouldBroadcastToUi(i)||o?n(t):s("Response does not match to ids")},s)})})}),t}async _getChildrenOf(e,t,n,i){const o=i(e,t,n);return await this._addAdditionalInfoToPossibleChildren(e,o,2,!1,!0)}async getChildrenOfPlanComponent(e,t=!1,n=!1){const i=this._plannerKernelAccess.kernelInstance.getChildrenOfPlanComponent.bind(this._plannerKernelAccess.kernelInstance);return this._getChildrenOf(e,t,n,i)}async getChildrenOfPlanObject(e=!1,t=!1){const{planObjectId:n}=this._configuratorContext,i=this._plannerKernelAccess.kernelInstance.getChildrenOfPlanObject.bind(this._plannerKernelAccess.kernelInstance);return this._getChildrenOf(n,e,t,i)}async _addAdditionalInfoToPossibleChildren(e,t,n,i=!0,o=!1){const{possibleChildren:s,defaultChild:r}=await this._getPossibleChildrenForKernelPossibleChildren(t,o),a=[],l=new Map,c=[];if(s.forEach(e=>{const t=e.tags;if(e.tags&&Array.isArray(e.tags)&&e.tags.length)for(let n=0,i=e.tags.length;n<i;n++){const i=t[n];-1===a.indexOf(i)&&a.push(i);let o=l.get(i);if(!o){const e=[];l.set(i,e),o=l.get(i)}o.push(e)}else c.push(e)}),this._isCorrectResponse(n,e)||!i){let e=[];try{e=(await this._rapiAccess.getTags(a)).map(e=>({...e,possibleChildren:l.get(e.id)}))}catch(t){console.error("Couldnt load tags of possible children"),console.error(t),e=[]}return e.sort(J),c.length&&e.unshift({id:"",externalIdentifier:"",global:!1,created:(new Date).toISOString(),updated:(new Date).toISOString(),language:this._globalInitData.locale,catalog:null,tags:[],parents:[],materials:[],items:[],possibleChildren:c}),{tags:e,defaultChild:r}}return null}async _getPossibleChildrenForKernelPossibleChildren(e,t=!1){const n=[],i=[];let o;const s=new Map,r=new Map;e.forEach(e=>{if(!e.possible&&!t)return;let a=e.itemId;e.itemId?(i.push(e.itemId),r.has(e.itemId)?r.get(e.itemId).push(e):r.set(e.itemId,[e])):(n.push(e.componentId),s.has(e.componentId)?s.get(e.componentId).push(e):s.set(e.componentId,[e]),a=e.componentId),e.isDefault&&!o&&(o=a)});const a=await Promise.all([this._rapiAccess.getComponents(n),this._rapiAccess.getItems(i)]),l=a[0],c=a[1],h=[];let d=null;return l.forEach(e=>{var t;e.isItem=!1,e.isComponent=!0;for(const n of null!==(t=s.get(e.id))&&void 0!==t?t:[]){const t=JSON.parse(JSON.stringify(e));t.group=n.group,t.possible=n.possible,t.id===o&&(t.isDefault=!0,d=t),h.push(t)}}),c.forEach(e=>{var t;e.isItem=!0,e.isComponent=!1;for(const n of null!==(t=r.get(e.id))&&void 0!==t?t:[]){const t=JSON.parse(JSON.stringify(e));t.group=n.group,t.possible=n.possible,t.id===o&&(t.isDefault=!0,d=t),h.push(t)}}),h.sort(J),{possibleChildren:h,defaultChild:d}}getUnitFormatter(){return this._unitFormatter}getStorage(){return this._idbManager}getConfiguratorContext(){return this._configuratorContext}getComponent(e){return this._sceneManager.getComponent(e)}async getTools(){const e=o.lookup("roomle-tools-core",this._creator_);return await e.init(),e}exportImageFromCamera(e="image",t=!1){return this._sceneManager.exportImageFromCamera(e,t)}calcPartsPriceSum(e){return this._plannerKernelAccess.calcPartsPriceSum(e)}async generateProductionServiceExport(e=""){return this.generateHomagIxExport(0,e)}async generateTCExport(e=""){return this.generateHomagIxExport(0,e)}async generateIMOSiXExport(e=""){return this.generateHomagIxExport(1,e)}async generateHOMAGiXExport(e="",n={},i={},o={}){let s=await this.generateHomagIxExport(2,e);const{homagIxMockUpData:r}=await t.import("./imos-ix-poc-export-helper-ee70d653.legacy.js");return r(s,n,i,o)}async downloadHomagIxExportPoC(){const e=await this.generateHOMAGiXExport();Ae("IMOSiX.xml",e)}async generateHomagIxExport(e,n=""){const{generateExportHomagIxConfiguration:i}=await t.import("./imos-ix-poc-export-helper-ee70d653.legacy.js"),o=this._configuratorContext.planObjectId;i(o,e,this._plannerKernelAccess.configurationExporter,this._plannerKernelAccess.kernelInstance,n);try{return this._plannerKernelAccess.configurationExporter.setDefaultExportDataDefinition(n),Promise.resolve(JSON.parse(this._plannerKernelAccess.configurationExporter.generateExport(e,o,this._plannerKernelAccess.kernelInstance)))}catch(t){return console.error(t),Promise.reject("Could not create export JSON "+e)}}setEnvironmentMap(e){const{url:t,intensity:n,rotation:i,maxLightSources:o}=e;this._sceneManager.setEnvironmentMap(t,n,i,o)}enableEvents(){this._sceneManager.enableEvents()}disableEvents(){this._sceneManager.disableEvents()}enableDebugging(){const e={debugValueMapChange:e=>{this.callbacks.onValueMapChanged(e)}};this._plannerKernelAccess.addDebugClient(e)}}e("R",Qe),n([i],Qe.prototype,"_rapiAccess",void 0),n([i],Qe.prototype,"_dataSyncer",void 0),n([i],Qe.prototype,"_errorHandler",void 0),n([i],Qe.prototype,"_unitFormatter",void 0),n([i],Qe.prototype,"_idbManager",void 0),n([i],Qe.prototype,"_domHelper",void 0),n([i],Qe.prototype,"_configuratorUiCallbacks",void 0),n([i],Qe.prototype,"_configuratorKernelAccessCallback",void 0),n([i],Qe.prototype,"_lifeCycleManager",void 0),n([i],Qe.prototype,"_plannerKernelAccess",void 0),n([i],Qe.prototype,"_scriptLoader",void 0),n([i],Qe.prototype,"_configuratorContext",void 0),n([i],Qe.prototype,"_initData",void 0),n([i],Qe.prototype,"_globalInitData",void 0),n([i],Qe.prototype,"_globalCallback",void 0),n([i],Qe.prototype,"_kernelIo",void 0),n([i],Qe.prototype,"_configuratorHistory",void 0)}}}));
|
|
2
|
-
//# sourceMappingURL=roomle-configurator-6db65c94.legacy.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"roomle-configurator-6db65c94.legacy.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|