@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
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{_ as __decorate,i as inject,b as RoomleDependencyInjection,c as convertToThreeMatrix,d as isUVIdentityMatrix,e as convertToThreeUVMatrix,s as setMeshMatrix,m as mergeGeometries,B as Benchmark,f as AsyncHelper,g as convertToEuler,h as DOCKING_CONVERSATION_ID,k as kernelBoxToThreeBox,j as AsyncGuard,l as RectAreaLightHelper,n as getGUI,C as ConfigurableConstructionPlanObjectViewModel,o as ConfiguratorPlanObjectViewModel,p as ConstructionPlanObjectViewModel,S as StaticPlanObjectViewModel,M as MeasurementLinePlanElementViewModel,W as WallAtticPlanElementViewModel,q as WallPlanElementViewModel,F as FloorPlanElementViewModel,r as CeilingPlanElementViewModel,N as NodePlanElementViewModel,t as convertToTHREE,u as CeilingLight,v as LampLight,P as PlannerKernelAccess,E as EventDispatcher,w as compareBox3Size,x as vectorIsZero,y as disposeMesh,z as convertToKernel,G as toRadiant,H as getScreenXY,J as CANVAS_ID,K as Env,O as DynamicLightSettingLoader,Q as PREDEFINED_LIGHTSETTING,T as ImageRenderer,U as createEmptySceneFromCurrent,V as dispose,X as getYRotationOfObject,Y as getIdealDistance,Z as getHostname,$ as toDegrees,a0 as DEFAULT_CONVERSATION_ID,a1 as getCatalogIdFromItemOrConfigurationId,a2 as isIdItemId,A as AppContext,a3 as isRange,a4 as sortBySort,a5 as isMaterial,a6 as convertCObject,a7 as sortByString}from"./roomle-dependency-injection-c52a0000.js";import{R as RoomleComponentFactoryInitializer,b as CameraBehaviour,S as SceneManager,P as PULSE_LOOPS,c as PULSE_DURATION,B as BackgroundEnvironment,D as DISTANCE_FACTOR,C as CameraControl3D,F as FloorEnvironment,T as TWEEN_FILE_NAME}from"./camera-behaviour-fe3f4008.js";import{z as Mesh,B as BufferGeometry,O as Object3D,ad as Box3,K as Group,U as PerspectiveCamera$1,R as RectAreaLight,aE as CAMERA_TYPE,a as Vector3$1,bD as Raycaster,bE as Plane$1,V as Vector2$1,Q as Quaternion,bB as Layers,aC as deepMerge,bF as callAgainAfter,bG as debounce,bH as nextTick,aF as getColor,ag as Euler,bI as areCameraParametersEqual,aD as ROOMLE_HIGHLIGHTNG,bJ as download,bK as deepCopy}from"./main-thread-to-worker-4e303a39.js";import{c as clamp,V as Vector3,M as Matrix3,W as WebGLCoordinateSystem,a as WebGPUCoordinateSystem,S as Sphere,b as Vector2,d as Matrix4,O as Object3D$1,R as RAD2DEG,D as DEG2RAD}from"./Object3D-80e9d0f8.js";import{D as DefaultLightSetting}from"./default-light-setting-755cfddc.js";import{c as createExtObjId}from"./external-objects-bf17eb19.js";class ConfiguratorViewModel{constructor(e){this._mergeThreshold=3,this._componentsToMerge=new OccurrenceMap,this._mergeInProgress=!1,this._components=new Map,this._previews=new Map,this._componentNumberOfPossibleChildren=new Map,this._creator_=e,this._getKernelAccess().addConfiguratorListener(this),this._componentFactory=RoomleComponentFactoryInitializer()}get materialQueue(){return this.getMeshGenerator().materialQueue}_getKernelAccess(){return RoomleDependencyInjection.lookup("planner-kernel-access",this._creator_)}_applyMeshTransform(e,t,n,i,o,s,r){if(i){const e=t.userData.transform=convertToThreeMatrix(i);n&&(t.userData.transform=e),t.applyMatrix4(e)}this._applyMeshUVTransform(t,n,o,r),this._addMeshAnimations(e,t,s)}_applyMeshUVTransform(e,t,n,i){if(6!==(null==n?void 0:n.length)||isUVIdentityMatrix(n))t&&(t.uvTransform=void 0),i&&(e.geometry=i);else{const o=convertToThreeUVMatrix(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,s=this.getComponent(e);for(const e in n){const r={matrix:convertToThreeMatrix(n[e].matrix),visible:n[e].visibility,initial:n[e].initial};o.set(e,r);let a=r.initial;if(null==s?void 0:s.animationValues){const t=e.split(":");a=(null===(i=null==s?void 0:s.animationValues)||void 0===i?void 0:i.get(t[0]))===t[1]}if(a){if(t.userData.transform){const e=t.userData.transform.clone().multiply(r.matrix);setMeshMatrix(t,e)}t.visible=r.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,c,l,h){const d=this._generateMesh(e,t,n,s,r,a,c,void 0,void 0,l);this._applyMeshTransform(e,d,null,i,o,h),this._subPartObject.add(d)}_addMeshToComponent(e,t,n,i,o,s,r,a,c,l,h,d,u){if(this._subPartGuard&&this._subPartGuard.info===e)return void this._addMeshToSubPart(e,null,i,null,null,r,a,c,l,d,u);const _=this.getComponent(e);if(!_)return;const m=this._componentFactory.isPreview(_),g=this._generateMesh(e,n,m?null:i,r,a,c,l,void 0,void 0,d);g.userData.meshId=t,g.userData.geometryId=n,g.userData.materialId=i,this._applyMeshTransform(e,g,g.userData,o,s,u),m&&g.layers.set(5),_&&_.addMesh(g),_.meshes.length>this._mergeThreshold&&this._componentsToMerge.set(e,_.meshes.length)}_changeMeshOfComponent(e,t,n,i,o,s,r,a){const c=this.getComponent(e);if(!c)return;const l=c.getMeshById(t);if(l){l.userData.geometryId!==n&&console.warn("Geometry of mesh has changed!"),l.userData.materialId=i,l.userData.materialAttributes=r;const t=l.material.clone();this._configuratorMeshGenerator.setMaterial(l,i,void 0,r).then(()=>{this._requestRenderSceneUpdateCallback&&this._requestRenderSceneUpdateCallback()}),t.opacity!==l.material.opacity&&this._requestRenderCallback&&this._requestRenderCallback(),o&&(l.position.set(0,0,0),l.scale.set(1,1,1),l.rotation.set(0,0,0));const c=this._configuratorMeshGenerator.getGeometry(n);this._applyMeshTransform(e,l,l.userData,o,s,a,c)}}_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 Mesh(new BufferGeometry,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=mergeGeometries([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),Benchmark.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 Object3D)}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)];AsyncHelper.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=convertToEuler(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===DOCKING_CONVERSATION_ID&&(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 kernelBoxToThreeBox(e.boxForMeasurement)}else if(this._configuratorContext.rootComponentId){const e=this._components.get(this._configuratorContext.rootComponentId);return(new Box3).setFromObject(e)}return null}getBoundingBoxOfGeometry(){if(this._configuratorContext.planObjectId){const e=this._getKernelAccess().kernelInstance.getPlanObject(this._configuratorContext.planObjectId);if(e&&e.boxOfGeometry)return kernelBoxToThreeBox(e.boxOfGeometry)}else if(this._configuratorContext.rootComponentId){const e=this._components.get(this._configuratorContext.rootComponentId);return(new Box3).setFromObject(e)}return null}getBoundingBoxWithPreviews(){const e=this._components.get(this._configuratorContext.rootComponentId);return e?(new Box3).setFromObject(e):null}hasPreviews(){return this._previews.size>0}clearRootComponent(){var e;null===(e=this._components.get(this._configuratorContext.rootComponentId))||void 0===e||e.hoverOff()}debugSceneGraph(e){e?this._components.has(e)?this._components.get(e):this._previews.has(e.toString())&&this._previews.get(e.toString()):this._configuratorContext}getComponentsForIds(e){let t=[];return e.forEach(e=>{const n=this._components.get(e);n&&t.push(n)}),t}getComponents(){return Array.from(this._components.values())}getPreviews(){return Array.from(this._previews.values())}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,c,l){return this._configuratorMeshGenerator.generateMesh(e,t,n,i,o,s,r,!1,l)}_setMaterial(e,t,n){this._configuratorMeshGenerator.setMaterial(e,t)}constructComponents(e){this._getKernelAccess().kernelInstance.requestPlanObjectConstruction(e)}requestSubPartConstruction(e){return this._subPartGuard=new AsyncGuard(e),this._getKernelAccess().requestPlanComponentConstruction(e,!1),this._subPartGuard.wait()}getMeshGenerator(){return this._configuratorMeshGenerator}setRequestRenderCallback(e){this._requestRenderCallback=e}setRequestRenderSceneUpdateCallback(e){this._requestRenderSceneUpdateCallback=e}setInvalidateRenderCallback(e){this._invalidateRenderCallback=e}}__decorate([inject],ConfiguratorViewModel.prototype,"_configuratorMeshGenerator",void 0),__decorate([inject],ConfiguratorViewModel.prototype,"_configuratorContext",void 0),__decorate([inject],ConfiguratorViewModel.prototype,"_cacheHolder",void 0),__decorate([inject],ConfiguratorViewModel.prototype,"_initData",void 0);class OccurrenceMap extends Map{largestValue(){let e=this.entries().next().value[0],t=0;return this.forEach((n,i)=>{n>t&&(e=i,t=n)}),e}}class Vector4{constructor(e=0,t=0,n=0,i=1){Vector4.prototype.isVector4=!0,this.x=e,this.y=t,this.z=n,this.w=i}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,n,i){return this.x=e,this.y=t,this.z=n,this.w=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=void 0!==e.w?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const t=this.x,n=this.y,i=this.z,o=this.w,s=e.elements;return this.x=s[0]*t+s[4]*n+s[8]*i+s[12]*o,this.y=s[1]*t+s[5]*n+s[9]*i+s[13]*o,this.z=s[2]*t+s[6]*n+s[10]*i+s[14]*o,this.w=s[3]*t+s[7]*n+s[11]*i+s[15]*o,this}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this.w/=e.w,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,n,i,o;const s=e.elements,r=s[0],a=s[4],c=s[8],l=s[1],h=s[5],d=s[9],u=s[2],_=s[6],m=s[10];if(Math.abs(a-l)<.01&&Math.abs(c-u)<.01&&Math.abs(d-_)<.01){if(Math.abs(a+l)<.1&&Math.abs(c+u)<.1&&Math.abs(d+_)<.1&&Math.abs(r+h+m-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const e=(r+1)/2,s=(h+1)/2,g=(m+1)/2,p=(a+l)/4,C=(c+u)/4,f=(d+_)/4;return e>s&&e>g?e<.01?(n=0,i=.707106781,o=.707106781):(n=Math.sqrt(e),i=p/n,o=C/n):s>g?s<.01?(n=.707106781,i=0,o=.707106781):(i=Math.sqrt(s),n=p/i,o=f/i):g<.01?(n=.707106781,i=.707106781,o=0):(o=Math.sqrt(g),n=C/o,i=f/o),this.set(n,i,o,t),this}let g=Math.sqrt((_-d)*(_-d)+(c-u)*(c-u)+(l-a)*(l-a));return Math.abs(g)<.001&&(g=1),this.x=(_-d)/g,this.y=(c-u)/g,this.z=(l-a)/g,this.w=Math.acos((r+h+m-1)/2),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this.w=t[15],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,t){return this.x=clamp(this.x,e.x,t.x),this.y=clamp(this.y,e.y,t.y),this.z=clamp(this.z,e.z,t.z),this.w=clamp(this.w,e.w,t.w),this}clampScalar(e,t){return this.x=clamp(this.x,e,t),this.y=clamp(this.y,e,t),this.z=clamp(this.z,e,t),this.w=clamp(this.w,e,t),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(clamp(n,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this.w=e.w+(t.w-e.w)*n,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}const _vector1=new Vector3,_vector2=new Vector3,_normalMatrix=new Matrix3;class Plane{constructor(e=new Vector3(1,0,0),t=0){this.isPlane=!0,this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,n,i){return this.normal.set(e,t,n),this.constant=i,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,n){const i=_vector1.subVectors(n,t).cross(_vector2.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(i,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){const e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}intersectLine(e,t){const n=e.delta(_vector1),i=this.normal.dot(n);if(0===i)return 0===this.distanceToPoint(e.start)?t.copy(e.start):null;const o=-(e.start.dot(this.normal)+this.constant)/i;return o<0||o>1?null:t.copy(e.start).addScaledVector(n,o)}intersectsLine(e){const t=this.distanceToPoint(e.start),n=this.distanceToPoint(e.end);return t<0&&n>0||n<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){const n=t||_normalMatrix.getNormalMatrix(e),i=this.coplanarPoint(_vector1).applyMatrix4(e),o=this.normal.applyMatrix3(n).normalize();return this.constant=-i.dot(o),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return(new this.constructor).copy(this)}}const _sphere=new Sphere,_vector=new Vector3;class Frustum{constructor(e=new Plane,t=new Plane,n=new Plane,i=new Plane,o=new Plane,s=new Plane){this.planes=[e,t,n,i,o,s]}set(e,t,n,i,o,s){const r=this.planes;return r[0].copy(e),r[1].copy(t),r[2].copy(n),r[3].copy(i),r[4].copy(o),r[5].copy(s),this}copy(e){const t=this.planes;for(let n=0;n<6;n++)t[n].copy(e.planes[n]);return this}setFromProjectionMatrix(e,t=WebGLCoordinateSystem){const n=this.planes,i=e.elements,o=i[0],s=i[1],r=i[2],a=i[3],c=i[4],l=i[5],h=i[6],d=i[7],u=i[8],_=i[9],m=i[10],g=i[11],p=i[12],C=i[13],f=i[14],v=i[15];if(n[0].setComponents(a-o,d-c,g-u,v-p).normalize(),n[1].setComponents(a+o,d+c,g+u,v+p).normalize(),n[2].setComponents(a+s,d+l,g+_,v+C).normalize(),n[3].setComponents(a-s,d-l,g-_,v-C).normalize(),n[4].setComponents(a-r,d-h,g-m,v-f).normalize(),t===WebGLCoordinateSystem)n[5].setComponents(a+r,d+h,g+m,v+f).normalize();else{if(t!==WebGPUCoordinateSystem)throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+t);n[5].setComponents(r,h,m,f).normalize()}return this}intersectsObject(e){if(void 0!==e.boundingSphere)null===e.boundingSphere&&e.computeBoundingSphere(),_sphere.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const t=e.geometry;null===t.boundingSphere&&t.computeBoundingSphere(),_sphere.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(_sphere)}intersectsSprite(e){return _sphere.center.set(0,0,0),_sphere.radius=.7071067811865476,_sphere.applyMatrix4(e.matrixWorld),this.intersectsSphere(_sphere)}intersectsSphere(e){const t=this.planes,n=e.center,i=-e.radius;for(let e=0;e<6;e++)if(t[e].distanceToPoint(n)<i)return!1;return!0}intersectsBox(e){const t=this.planes;for(let n=0;n<6;n++){const i=t[n];if(_vector.x=i.normal.x>0?e.max.x:e.min.x,_vector.y=i.normal.y>0?e.max.y:e.min.y,_vector.z=i.normal.z>0?e.max.z:e.min.z,i.distanceToPoint(_vector)<0)return!1}return!0}containsPoint(e){const t=this.planes;for(let n=0;n<6;n++)if(t[n].distanceToPoint(e)<0)return!1;return!0}clone(){return(new this.constructor).copy(this)}}const _projScreenMatrix$1=new Matrix4,_lightPositionWorld$1=new Vector3,_lookTarget$1=new Vector3;class Camera extends Object3D$1{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new Matrix4,this.projectionMatrix=new Matrix4,this.projectionMatrixInverse=new Matrix4,this.coordinateSystem=WebGLCoordinateSystem}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this.coordinateSystem=e.coordinateSystem,this}getWorldDirection(e){return super.getWorldDirection(e).negate()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return(new this.constructor).copy(this)}}const _v3=new Vector3,_minTarget=new Vector2,_maxTarget=new Vector2;class PerspectiveCamera extends Camera{constructor(e=50,t=1,n=.1,i=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=n,this.far=i,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=null===e.view?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){const t=.5*this.getFilmHeight()/e;this.fov=2*RAD2DEG*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(.5*DEG2RAD*this.fov);return.5*this.getFilmHeight()/e}getEffectiveFOV(){return 2*RAD2DEG*Math.atan(Math.tan(.5*DEG2RAD*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(e,t,n){_v3.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),t.set(_v3.x,_v3.y).multiplyScalar(-e/_v3.z),_v3.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),n.set(_v3.x,_v3.y).multiplyScalar(-e/_v3.z)}getViewSize(e,t){return this.getViewBounds(e,_minTarget,_maxTarget),t.subVectors(_maxTarget,_minTarget)}setViewOffset(e,t,n,i,o,s){this.aspect=e/t,null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=i,this.view.width=o,this.view.height=s,this.updateProjectionMatrix()}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let t=e*Math.tan(.5*DEG2RAD*this.fov)/this.zoom,n=2*t,i=this.aspect*n,o=-.5*i;const s=this.view;if(null!==this.view&&this.view.enabled){const e=s.fullWidth,r=s.fullHeight;o+=s.offsetX*i/e,t-=s.offsetY*n/r,i*=s.width/e,n*=s.height/r}const r=this.filmOffset;0!==r&&(o+=e*r/this.getFilmWidth()),this.projectionMatrix.makePerspective(o,o+i,t,t-n,e,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,null!==this.view&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}}const _projScreenMatrix=new Matrix4,_lightPositionWorld=new Vector3,_lookTarget=new Vector3;class PointLightShadow extends class{constructor(e){this.camera=e,this.intensity=1,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new Vector2(512,512),this.map=null,this.mapPass=null,this.matrix=new Matrix4,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new Frustum,this._frameExtents=new Vector2(1,1),this._viewportCount=1,this._viewports=[new Vector4(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){const t=this.camera,n=this.matrix;_lightPositionWorld$1.setFromMatrixPosition(e.matrixWorld),t.position.copy(_lightPositionWorld$1),_lookTarget$1.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(_lookTarget$1),t.updateMatrixWorld(),_projScreenMatrix$1.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(_projScreenMatrix$1),n.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),n.multiply(_projScreenMatrix$1)}getViewport(e){return this._viewports[e]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(e){return this.camera=e.camera.clone(),this.intensity=e.intensity,this.bias=e.bias,this.radius=e.radius,this.mapSize.copy(e.mapSize),this}clone(){return(new this.constructor).copy(this)}toJSON(){const e={};return 1!==this.intensity&&(e.intensity=this.intensity),0!==this.bias&&(e.bias=this.bias),0!==this.normalBias&&(e.normalBias=this.normalBias),1!==this.radius&&(e.radius=this.radius),512===this.mapSize.x&&512===this.mapSize.y||(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}}{constructor(){super(new PerspectiveCamera(90,1,.5,500)),this.isPointLightShadow=!0,this._frameExtents=new Vector2(4,2),this._viewportCount=6,this._viewports=[new Vector4(2,1,1,1),new Vector4(0,1,1,1),new Vector4(3,1,1,1),new Vector4(1,1,1,1),new Vector4(3,0,1,1),new Vector4(1,0,1,1)],this._cubeDirections=[new Vector3(1,0,0),new Vector3(-1,0,0),new Vector3(0,0,1),new Vector3(0,0,-1),new Vector3(0,1,0),new Vector3(0,-1,0)],this._cubeUps=[new Vector3(0,1,0),new Vector3(0,1,0),new Vector3(0,1,0),new Vector3(0,1,0),new Vector3(0,0,1),new Vector3(0,0,-1)]}updateMatrices(e,t=0){const n=this.camera,i=this.matrix,o=e.distance||n.far;o!==n.far&&(n.far=o,n.updateProjectionMatrix()),_lightPositionWorld.setFromMatrixPosition(e.matrixWorld),n.position.copy(_lightPositionWorld),_lookTarget.copy(n.position),_lookTarget.add(this._cubeDirections[t]),n.up.copy(this._cubeUps[t]),n.lookAt(_lookTarget),n.updateMatrixWorld(),i.makeTranslation(-_lightPositionWorld.x,-_lightPositionWorld.y,-_lightPositionWorld.z),_projScreenMatrix.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),this._frustum.setFromProjectionMatrix(_projScreenMatrix)}}class LightGroup extends Group{get lightsOn(){return this._lightsOn}constructor(){super(),this.children=[],this._availableShadowMaps=[],this._lightsOn=!0;for(let e=0;e<1;e++){const e=new PerspectiveCamera$1(90,1,.5,500),t=new PointLightShadow(e);t.mapSize.width=512,t.mapSize.height=512,this._availableShadowMaps.push(t)}}add(...e){for(const t of e){const e=this.children.length;if(this._availableShadowMaps.length>0){const n=this._availableShadowMaps[e%1];t.shadow=n,t.castShadow=!1,n.camera.position.copy(t.position)}}return super.add(...e),this}toggleAllLights(e){this._lightsOn=e}}class RectLampLight extends RectAreaLight{constructor(e,t){super(16711680,15,4,2);const{dimensions:n,lightPos:i,color:o,rotation:s}=e.getObject().userData;o&&this.color.setHex(o),this._helper=new RectAreaLightHelper(this),this._helper.visible=!0,this.add(this._helper),n&&(this.width=n.width,this.height=n.height),i&&this.position.set(i.x,i.y,i.z),this.rotation.x=1.5,s&&this.rotation.set(s.x,s.y,s.z),t&&this._addDebugUI()}_addDebugUI(){const e=getGUI();if(!e)return;const t={color:this.color.getHex(),intensity:this.intensity,width:this.width,height:this.height,positionX:this.position.x,positionY:this.position.y,positionZ:this.position.z,rotationX:this.rotation.x,rotationY:this.rotation.y,rotationZ:this.rotation.z},n=e.addFolder("Rect Area Lamp "+this.id);n.addColor(t,"color").onChange(e=>{this.color.setHex(e)}),n.add(t,"intensity",0,100,.01).onChange(e=>{this.intensity=e}),n.add(t,"width",0,20,.01).onChange(e=>{this.width=e}),n.add(t,"height",0,20,.01).onChange(e=>{this.height=e}),n.add(t,"positionX",-10,10,.001).onChange(e=>{this.position.x=e}),n.add(t,"positionY",-10,10,.001).onChange(e=>{this.position.y=e}),n.add(t,"positionZ",-10,10,.001).onChange(e=>{this.position.z=e}),n.add(t,"rotationX",-Math.PI,Math.PI,.001).onChange(e=>{this.rotation.x=e}),n.add(t,"rotationY",-Math.PI,Math.PI,.001).onChange(e=>{this.rotation.y=e}),n.add(t,"rotationZ",-Math.PI,Math.PI,.001).onChange(e=>{this.rotation.z=e})}}const GROUP_CEILING_LIGHTS="Ceiling Lights";class PlanViewModel extends ConfiguratorViewModel{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 Group,this._constructionGroup.name="Construction",this._ceilingGroup=new Group,this._ceilingGroup.name="Ceiling",this._floorGroup=new Group,this._floorGroup.name="Floor",this._ceilingLightsGroup=new LightGroup,this._ceilingLightsGroup.name="Ceiling Lights",this._lampLightsGroup=new Group,this._lampLightsGroup.name="Lamp Lights",this._measurementLineGroup=new Group,this._measurementLineGroup.name="Measurement Line",this._wallAtticsGroup=new Group,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 ConfigurableConstructionPlanObjectViewModel?this._handleConfiguratorConstructionPlanObjectViewModel(e):e instanceof ConfiguratorPlanObjectViewModel?this._handleConfiguratorPlanObjectViewModel(e):e instanceof ConstructionPlanObjectViewModel?this._handleConstructionPlanObjectViewModel(e):e instanceof StaticPlanObjectViewModel?this._handleStaticPlanObjectViewModel(e):e instanceof MeasurementLinePlanElementViewModel?this._handleMeasurementLinePlanElementViewModel(e):e instanceof WallAtticPlanElementViewModel?this._handleWallAtticPlanElementViewModel(e):e instanceof WallPlanElementViewModel?this._handleWallPlanElementViewModel(e):e instanceof FloorPlanElementViewModel?this._handleFloorPlanElementViewModel(e):e instanceof CeilingPlanElementViewModel?this._handleCeilingPlanElementViewModel(e):e instanceof NodePlanElementViewModel&&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===CAMERA_TYPE.CAMERA_2D),this._configurableConstructionPlanObjectViewModels.push(e)}_handleConstructionPlanObjectViewModel(e){this._initData.edit&&this._plannerSceneEventHandler.addConstructionPlanObjectHandlers(e),e.setTopView(this._cameraType===CAMERA_TYPE.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===CAMERA_TYPE.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===CAMERA_TYPE.CAMERA_2D),this._wallAtticsPlanObjectViewModels.push(e),this._wallAtticsGroup.add(e.getContainer())}_handleWallPlanElementViewModel(e){this._initData.edit&&this._plannerSceneEventHandler.addWallHandlers(e),e.setTopView(this._cameraType===CAMERA_TYPE.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===CAMERA_TYPE.CAMERA_2D),e.setZoom(this._nodeZoom),this._nodePlanObjectViewModels.push(e),this._latestNodePlanObjectViewModel=e,this._constructionGroup.add(e.getContainer())}_getCeilingLightsDistribution(){const e=this._getKernelAccess().planInteractionHandler.getPlan();if(!e)return[];const t=this._getKernelAccess().planModelViewHelper.calculateLightSourceDistribution(e,{lightSourceAreaInSquareMeters:90,minimumRoomSizeInSquareMeters:7,maximumNumberOfLightSources:8}),n=[];for(let e=0;e<t.size();e++){const i=t.get(e);for(let e=0;e<i.positionsInPlan.size();e++)n.push(convertToTHREE(i.positionsInPlan.get(e)))}return n}handleInitialLights(e,t){if(!(this._ceilingLightsGroup.children.length>0))for(let e=0;e<1;e++){const e=new CeilingLight(this._initData.debug,t);e.position.set(0,0,0),e.intensity=0,this._ceilingLightsGroup.add(e)}}handleCeilingLights(){if(!this._ceilingLightsGroup.lightsOn)return;const e=this._ceilingLightsGroup.children,t=this._getCeilingLightsDistribution();let n=0;for(let i=0;i<e.length;i++)e[i].power=0,i<t.length&&(e[i].position.copy(t[i]),e[i].position.y-=.1,e[i].power=1,n++);const i=e.filter(e=>e.power>0);for(const e of i)e.recalculatePower(n)}handleLampLight(e,t,n,i,o,s){const r=e.getObject();r.userData={...r.userData,targetPos:t,lightPos:n,color:i,decay:o,intensity:s};const a=new LampLight(e,this._initData.debug);this._lampLightsGroup.add(a),r.add(a)}handleRectLampLight(e,t,n,i,o){const s=e.getObject();s.userData={...s.userData,dimensions:t,lightPos:n,color:i,rotation:o};const r=new RectLampLight(e,this._initData.debug);this._lampLightsGroup.add(r),s.add(r)}toggleCeilingLights(e){if(this._initData.featureFlags.interiorLights)if(this._ceilingLightsGroup.toggleAllLights(e),e)this.handleCeilingLights();else for(const e of this._ceilingLightsGroup.children)e.power=0}commonHandlerForEditableAndTopView(e){this._initData.edit&&this._plannerSceneEventHandler.addPlanObjectHandlers(e),e.setTopView(this._cameraType===CAMERA_TYPE.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 ConfiguratorPlanObjectViewModel&&(e.isRootComponent?n.addRootComponent(e):n.addChildEntityComponent(e),this._initData.edit&&(n instanceof ConfigurableConstructionPlanObjectViewModel?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}getCeilingLightsGroup(){return this._ceilingLightsGroup}getLampLightsGroup(){return this._lampLightsGroup}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 kernelBoxToThreeBox(e.getBounds())}catch(e){console.error(e)}const t=new Box3;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,c,l){return this._plannerMeshGenerator.generateMesh(e,t,n,i,o,s,r,a,c,l)}_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 PlannerKernelAccess&&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 ConfiguratorPlanObjectViewModel&&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 ConfigurableConstructionPlanObjectViewModel?this._removeObject(this._configurableConstructionPlanObjectViewModels,n):n instanceof ConfiguratorPlanObjectViewModel?(this._detachPlanObjectViewModelFromComponent(n),this._removeObject(this._configurablePlanObjectViewModels,n)):n instanceof ConstructionPlanObjectViewModel?this._removeObject(this._constructionPlanObjectViewModels,n):n instanceof StaticPlanObjectViewModel?this._removeObject(this._staticPlanObjectViewModels,n):n instanceof FloorPlanElementViewModel?this._removeObject(this._floorPlanObjectViewModels,n):n instanceof WallPlanElementViewModel?this._removeObject(this._wallPlanObjectViewModels,n):n instanceof NodePlanElementViewModel?this._removeObject(this._nodePlanObjectViewModels,n):n instanceof MeasurementLinePlanElementViewModel?this._removeObject(this._measurementLinePlanObjectViewModels,n):n instanceof WallAtticPlanElementViewModel&&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)}getBoundingBoxFromRuntimeIds(e){const t=new Box3;return this._staticPlanObjectViewModels.forEach(n=>{e.includes(n.getPlanElement().getId())&&t.expandByObject(n.getContainer())}),this._configurablePlanObjectViewModels.forEach(n=>{e.includes(n.getPlanElement().getId())&&t.expandByObject(n.getContainer())}),this._configurableConstructionPlanObjectViewModels.forEach(n=>{e.includes(n.getPlanElement().getId())&&t.expandByObject(n.getContainer())}),this._constructionPlanObjectViewModels.forEach(n=>{e.includes(n.getPlanElement().getId())&&t.expandByObject(n.getContainer())}),t}hideAllExceptRuntimeIds(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=>{e.includes(t.getPlanElement().getId())||(t.getContainer().visible=!1)}),this._configurablePlanObjectViewModels.forEach(t=>{e.includes(t.getPlanElement().getId())||(t.getContainer().visible=!1)}),this._configurableConstructionPlanObjectViewModels.forEach(t=>{e.includes(t.getPlanElement().getId())||(t.getContainer().visible=!1)}),this._constructionPlanObjectViewModels.forEach(t=>{e.includes(t.getPlanElement().getId())||(t.getContainer().visible=!1)})}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===CAMERA_TYPE.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===CAMERA_TYPE.CAMERA_2D)),this._measurementLinePlanObjectViewModels.forEach(e=>e.setTopView(this._cameraType===CAMERA_TYPE.CAMERA_2D)),this._wallAtticsPlanObjectViewModels.forEach(e=>e.setTopView(this._cameraType===CAMERA_TYPE.CAMERA_2D)),this._nodePlanObjectViewModels.forEach(e=>e.setTopView(this._cameraType===CAMERA_TYPE.CAMERA_2D)),this._configurablePlanObjectViewModels.forEach(e=>e.setTopView(this._cameraType===CAMERA_TYPE.CAMERA_2D)),this._constructionPlanObjectViewModels.forEach(e=>t.push(e.setTopView(this._cameraType===CAMERA_TYPE.CAMERA_2D))),this._configurableConstructionPlanObjectViewModels.forEach(e=>t.push(e.setTopView(this._cameraType===CAMERA_TYPE.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){}}__decorate([inject],PlanViewModel.prototype,"_plannerMeshGenerator",void 0),__decorate([inject],PlanViewModel.prototype,"_roomlePlannerUiCallback",void 0);const RAYCAST_PRIORITY={RAYCASTER_FLOOR:.8,FLOOR:.9,WALL:.95,DEFAULT:1,CONSTRUCTION:1,COMPONENT:2,PREVIEW:3,PREVIEW_LINE:4},ROTATION_TO_DETECT_SIDE=toRadiant(30);class RaycastHelper extends EventDispatcher{constructor(e,t,n,i){super(),this._offset=new Vector3$1(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 Raycaster,this._raycaster.layers.disableAll(),this._inputManager=n,this._addInputListeners(n),this._planeBottom=new Plane$1(new Vector3$1(0,1,0)),this._planeFront=new Plane$1(new Vector3$1(0,0,1)),this._planeSide=new Plane$1(new Vector3$1(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 Vector2$1(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:compareBox3Size((new Box3).setFromObject(e.object),(new Box3).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 Vector2$1(e.x,e.y),this._camera);let t,n=new Vector3$1(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 Vector3$1(0,0,0),o=new Vector3$1(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>=-ROTATION_TO_DETECT_SIDE&&n<=ROTATION_TO_DETECT_SIDE?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 vectorIsZero(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 Vector3$1).y-this._rootComponentPosition.y,this._planeSide.constant=2*-e.boundingBox.getSize(new Vector3$1).x+e.boundingBox.getCenter(new Vector3$1).x,this._camera.userData.yaw>0&&(this._planeSide.constant*=-1),this._bounds&&(this._planeFront.constant=this._bounds.z/2+e.boundingBox.getCenter(new Vector3$1).z))}_calculateOffset(e){e&&e.boundingBox&&(this._offset.copy(e.boundingBox.getCenter(new Vector3$1)),this._offset.applyQuaternion(e.getWorldQuaternion(new Quaternion)))}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 Mesh&&e.geometry.computeBoundingBox()}}clear(){this._currentDrag&&disposeMesh(this._currentDrag),this._currentHover&&disposeMesh(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 Plane$1,n=new Vector3$1;return n.copy(this._camera.position).normalize(),t.setFromNormalAndCoplanarPoint(n,this._object.position),this._raycaster.setFromCamera(new Vector2$1(e.positionRelative.x,e.positionRelative.y),this._camera),convertToKernel(this._raycaster.ray.intersectPlane(t,new Vector3$1))}enableOnWallSnapping(){this._onWallSnapping=!0}disableOnWallSnapping(){this._onWallSnapping=!1}}class SceneEventHandler extends EventDispatcher{constructor(e,t,n,i){super(),this._debug=!1,this._dragIn=!1,this._inputManager=i,this._raycastHelper=new RaycastHelper(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()}}class SceneEventInfo{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 ConfiguratorSceneEventHandler extends SceneEventHandler{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 SceneEventInfo({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 SceneEventInfo({component:e,resetCamera:t,reason:n}))},this),this._addInputListeners(this._inputManager)}disable(){const e=new Layers;e.disableAll(),this._raycastHelper.setLayers(e),this._raycastHelper.disableEvents()}enable(){const e=new Layers;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:RAYCAST_PRIORITY.DEFAULT,roomleId:e.runtimeId}),e.meshes.forEach(t=>{this._addComponentHandlers(e,t,{hasListener:!0,priority:RAYCAST_PRIORITY.COMPONENT,roomleId:e.runtimeId})})}addComponentDragInHandler(e){this._dragIn&&(this._addComponentHandlers(e,e.boundingBoxMesh,{hasListener:!0,priority:RAYCAST_PRIORITY.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=deepMerge(t.userData,{hasListener:!0,priority:RAYCAST_PRIORITY.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=deepMerge(t.userData,{hasListener:!0,priority:RAYCAST_PRIORITY.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 SceneEventInfo({preview:e}))}_clickPreviewLine(e){this._dragStartPosition&&(e.position.copy(this._dragStartPosition),this._dragStartPosition=null),this.dispatchEvent(7,new SceneEventInfo({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 SceneEventInfo({component:e,type:t})),this._hoveredComponent=e)}_hoverOff(e,t){this._cameraMoving||(this._debug&&e.runtimeId,e.hoverOff(),this._interaction(),this.dispatchEvent(2,new SceneEventInfo({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 Mesh){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 SceneEventInfo({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 SceneEventInfo({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 SceneEventInfo({component:e,preview:this._hoveredPreview})),this._interaction()}}_interaction(e){this.dispatchEvent(0,new SceneEventInfo({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)}}__decorate([inject],ConfiguratorSceneEventHandler.prototype,"_selectionHandler",void 0),__decorate([inject],ConfiguratorSceneEventHandler.prototype,"_configuratorUiCallbacks",void 0);class UiIntersectionHelper extends EventDispatcher{constructor(e){super(),this._uiIntersectionMask=0,this.floorEnvironment=!1,this._camera=e}updateToBounds(e,t,n){let i=new Vector3$1(-e.x/2,0,-e.z/2),o=new Vector3$1(e.x/2,e.y,e.z/2);this._boundingBox=new Box3(i,o),this._clientWidth=t,this._clientHeight=n;let s=this._boundingBox.getSize(new Vector3$1);this._boxVertices=[],this._boxVertices.push(this._boundingBox.min),this._boxVertices.push(this._boundingBox.min.clone().add(new Vector3$1(s.x,0,0))),this._boxVertices.push(this._boundingBox.max),this._boxVertices.push(this._boundingBox.max.clone().sub(new Vector3$1(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=getScreenXY(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 ConfiguratorCameraBehaviour extends CameraBehaviour{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,i=0){this.cameraControl.setCurrentCameraParameters(t),this.cameraControl.setObjectRotation(n,i),await this.cameraControl.updateAndReset(e,!0)}}class ConfiguratorSceneManager extends SceneManager{constructor(e,t,n){super(e,t,CANVAS_ID.HSC,n),this._configuratorContext.baseContext="configurator",this._getViewModel().setListener(this),this._sceneEventHandler=new ConfiguratorSceneEventHandler(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 Vector3$1))}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),Env.isProduction||(window.__RML__DEBUG__.SceneManager=this),this.enableConfiguratorEvents(),this._initOptionalModules(),this._offsetAnimationStart=callAgainAfter(this._offsetAnimationStart.bind(this),250),this._offsetAnimationEnd=debounce(this._offsetAnimationEnd.bind(this),32)}async _initOptionalModules(){const{transparentHighlighting:e}=this._initData;if(e){const{default:e}=await import("./component-raycast-helper-8faecce8.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=RoomleDependencyInjection.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),(PULSE_LOOPS+1)*PULSE_DURATION)}}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&&nextTick().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 UiIntersectionHelper(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(DynamicLightSettingLoader.createDynamicLightSettingSource(null,PREDEFINED_LIGHTSETTING.CAMERA)):this._lightSetting=new DefaultLightSetting(this._scene,this._lightSetting)),this._requestRender(),t||this._setEnvironment(new BackgroundEnvironment(this._scene,this._environment,getColor(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 c=this.cameraBehaviour3d.cameraControl.getObjectRotation();if(o){await this._initDimensions(),await this._dimensionHelper.isInitialized();const e=-30+toDegrees(c);ImageRenderer.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 l=await this._imageRenderer.preparePerspectiveImage(this._scene,this._uiScene,s,r,e,c);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(),l}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=ImageRenderer.getCameraTargetForBBox((new Box3).setFromObject(e));const s=createEmptySceneFromCurrent(this._scene);s.add(e);const r=await this._imageRenderer.preparePerspectiveImage(s,null,i,o,t);dispose(s),n(r)},i)})}_calculateBoundingBoxOfAllMeshes(e=0,t){let n=null;return n=t&&this._dimensionHelper?this._dimensionHelper.getBoundingBox():this._getViewModel().getBoundingBox(),ImageRenderer.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 Vector3$1),i=getYRotationOfObject(e),o=new Euler(0,i,0),s=e.getWorldPosition(new Vector3$1).clone().add(e.boundingBox.getCenter(new Vector3$1).applyEuler(o));const r=new Vector2$1;this._renderer.getSize(r);const a={yaw:o.y,pitch:toRadiant(15),distance:getIdealDistance(n.x,n.y,n.z,this.cameraBehaviour3d.cameraControl.getCamera().fov,r.width,r.height)*DISTANCE_FACTOR,targetX:s.x,targetY:s.y,targetZ:s.z,blockOtherTweens:!0};areCameraParametersEqual(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 CameraControl3D&&(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 getScreenXY(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 FloorEnvironment||(this._environment=new FloorEnvironment(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 import("./dimensioning-helper-ba9dbb6f.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 t=this._getKernelAccess().kernelInstance.getPlanObject(this._configuratorContext.planObjectId);t&&t.boxForMeasurement&&this._dimensionHelper.updateSize(t.boxForMeasurement);let n=this.cameraBehaviour3d.cameraControl.getCamera().position;if(e){const e=kernelBoxToThreeBox(t.boxForMeasurement);n.copy(e.getCenter(new Vector3$1)),n.y=e.getSize(new Vector3$1).y+1}this._dimensionHelper.moveCameraEnd(n)}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 FloorEnvironment}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){Benchmark.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 Vector3$1(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 ConfiguratorCameraBehaviour){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 Vector3$1))),this._componentRaycastHelper&&this._componentRaycastHelper.checkPreviewVisibility(this._getViewModel())}configurationLoaded(e,t){e&&t&&this._sceneEventHandler.isDragIn()?(e.position.copy(new Vector3$1(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 Box3).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 Vector3$1)),type:"component",actions:o})}),this._getViewModel().getPreviews().forEach(t=>{const n=(new Box3).setFromObject(t);e.push({id:t.runtimeId,position:this.getScreenXY(n.getCenter(new Vector3$1)),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 Vector3$1);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===ROOMLE_HIGHLIGHTNG.ALWAYS||this._initData.highlighting!==ROOMLE_HIGHLIGHTNG.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(getHostname(),o,n);this._idbManager.setValue(a,i,this._idbManager.configStore)}_getInputManager(){return this._configuratorInputManager}createCameraControl(e,t){this._componentFactory=RoomleComponentFactoryInitializer();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 Vector3$1(0,.5,5)),this._changeCameraBehaviour(new ConfiguratorCameraBehaviour(new CameraControl3D(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 ConfiguratorCameraBehaviour?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)}}__decorate([inject],ConfiguratorSceneManager.prototype,"_configuratorInputManager",void 0),__decorate([inject],ConfiguratorSceneManager.prototype,"_configuratorMeshGenerator",void 0),__decorate([inject],ConfiguratorSceneManager.prototype,"_memoryManager",void 0),__decorate([inject],ConfiguratorSceneManager.prototype,"_configuratorContext",void 0),__decorate([inject],ConfiguratorSceneManager.prototype,"_componentDimensioningHelper",void 0),__decorate([inject],ConfiguratorSceneManager.prototype,"_configuratorHistory",void 0),__decorate([inject],ConfiguratorSceneManager.prototype,"_configuratorUiCallbacks",void 0),__decorate([inject],ConfiguratorSceneManager.prototype,"_plannerKernelAccess",void 0),__decorate([inject],ConfiguratorSceneManager.prototype,"_globalInitData",void 0);const comparer=(e,t)=>{let n=sortBySort(e,t);return 0!==n?n:(n=sortByString(e.label,t.label),0!==n?n:sortByString(e.id,t.id))},sortGroupsAndMaterials=e=>(e.sort(comparer),e.forEach(e=>e.materials.sort(comparer)),e),adjustForExternalParameter=(e,t)=>{if("external"!==e.source)return t;const n=deepCopy(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 RoomleConfigurator{_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||RoomleDependencyInjection.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=DynamicLightSettingLoader.createDynamicLightSettingSource(i,o);s&&this.showStats(),this._sceneManager.enableHD(r),this._needsSync&&(this._needsSync=!1,this._plannerKernelAccess.requestSync(DEFAULT_CONVERSATION_ID,this._configuratorContext.planObjectId));const a=[this._scriptLoader.fetch(TWEEN_FILE_NAME,{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=getCatalogIdFromItemOrConfigurationId(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(isIdItemId(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(adjustForExternalParameter(e,sortGroupsAndMaterials(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(adjustForExternalParameter(e,sortGroupsAndMaterials(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(),Benchmark.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=[AsyncHelper.waitFor(4),AsyncHelper.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 c=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 l=e.errors;const h=l?convertCObject(l):[];this._configuratorUiCallbacks.onPartListUpdate(a,window.btoa(s)),t({partList:a,hash:r,rootComponentLabel:c?c.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=isIdItemId(e)?this._rapiAccess.getPreloadForItem.bind(this._rapiAccess):this._rapiAccess.getPreloadForConfiguration.bind(this._rapiAccess),Benchmark.start("rapi_preloads");const n=()=>{const t=Benchmark.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===AppContext.useHDGeometry?t():this._isReloading?n("Change of HD Geometry in progress"):(this._isReloading=!0,AsyncHelper.waitFor(3).then(([e,i])=>{this._reloadConfiguration(e,i,t,n)},n),AppContext.useHDGeometry=e,void this._plannerKernelAccess.changeUseOfHDGeometry(this._configuratorContext,AppContext.useHDGeometry)))}async _callOnPartListUpdate(){const{hash:e}=await AsyncHelper.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:createExtObjId(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){Benchmark.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(Benchmark.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(isRange(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,c=this._unitFormatter.getAllowedDelta();if(!Number.isNaN(s)&&i<s-c)return o(new RangeError('Value "'+t+'" is too small, min-val "'+s+'"'));if(!Number.isNaN(a)&&i>a+c)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:c}=e;r?this._plannerKernelAccess.changeComponentParameter(s,c,a,t,n,i):this._plannerKernelAccess.changePlanObjectParameter(o,c,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 AsyncHelper.waitFor(1,()=>this._plannerKernelAccess.uiRequestConfiguration(this._configuratorContext.planObjectId))}loadComponentIntoKernel(e){return AsyncHelper.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 AsyncHelper.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=Env.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(sortBySort),t.sort(sortBySort),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=Benchmark.getMeasure("kernel_is_ready");if(Array.isArray(e)&&1===e.length){const t=e[0],n=Benchmark.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(sortBySort),t.forEach(t=>{t.group?t.grouping=s[t.group]:t.grouping=null,this._unitFormatter.formatParameter(t),isMaterial(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=[],c=new Map,l=[];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=c.get(i);if(!o){const e=[];c.set(i,e),o=c.get(i)}o.push(e)}else l.push(e)}),this._isCorrectResponse(n,e)||!i){let e=[];try{e=(await this._rapiAccess.getTags(a)).map(e=>({...e,possibleChildren:c.get(e.id)}))}catch(t){console.error("Couldnt load tags of possible children"),console.error(t),e=[]}return e.sort(sortBySort),l.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:l}),{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)]),c=a[0],l=a[1],h=[];let d=null;return c.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)}}),l.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(sortBySort),{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=RoomleDependencyInjection.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="",t={},n={},i={}){let o=await this.generateHomagIxExport(2,e);const{homagIxMockUpData:s}=await import("./imos-ix-poc-export-helper-43b4c646.js");return s(o,t,n,i)}async downloadHomagIxExportPoC(){const e=await this.generateHOMAGiXExport();download("IMOSiX.xml",e)}async generateHomagIxExport(e,t=""){const{generateExportHomagIxConfiguration:n}=await import("./imos-ix-poc-export-helper-43b4c646.js"),i=this._configuratorContext.planObjectId;n(i,e,this._plannerKernelAccess.configurationExporter,this._plannerKernelAccess.kernelInstance,t);try{return this._plannerKernelAccess.configurationExporter.setDefaultExportDataDefinition(t),Promise.resolve(JSON.parse(this._plannerKernelAccess.configurationExporter.generateExport(e,i,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)}}__decorate([inject],RoomleConfigurator.prototype,"_rapiAccess",void 0),__decorate([inject],RoomleConfigurator.prototype,"_dataSyncer",void 0),__decorate([inject],RoomleConfigurator.prototype,"_errorHandler",void 0),__decorate([inject],RoomleConfigurator.prototype,"_unitFormatter",void 0),__decorate([inject],RoomleConfigurator.prototype,"_idbManager",void 0),__decorate([inject],RoomleConfigurator.prototype,"_domHelper",void 0),__decorate([inject],RoomleConfigurator.prototype,"_configuratorUiCallbacks",void 0),__decorate([inject],RoomleConfigurator.prototype,"_configuratorKernelAccessCallback",void 0),__decorate([inject],RoomleConfigurator.prototype,"_lifeCycleManager",void 0),__decorate([inject],RoomleConfigurator.prototype,"_plannerKernelAccess",void 0),__decorate([inject],RoomleConfigurator.prototype,"_scriptLoader",void 0),__decorate([inject],RoomleConfigurator.prototype,"_configuratorContext",void 0),__decorate([inject],RoomleConfigurator.prototype,"_initData",void 0),__decorate([inject],RoomleConfigurator.prototype,"_globalInitData",void 0),__decorate([inject],RoomleConfigurator.prototype,"_globalCallback",void 0),__decorate([inject],RoomleConfigurator.prototype,"_kernelIo",void 0),__decorate([inject],RoomleConfigurator.prototype,"_configuratorHistory",void 0);export{ConfiguratorSceneManager as C,GROUP_CEILING_LIGHTS as G,PlanViewModel as P,RoomleConfigurator as R,SceneEventHandler as S,ConfiguratorViewModel as a,RAYCAST_PRIORITY as b,ConfiguratorCameraBehaviour as c};
|
|
2
|
+
//# sourceMappingURL=roomle-configurator-3bf23b9e.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"roomle-configurator-3bf23b9e.js","sources":["../../node_modules/three/src/math/Vector4.js","../../node_modules/three/src/math/Plane.js","../../node_modules/three/src/math/Frustum.js","../../node_modules/three/src/lights/LightShadow.js","../../node_modules/three/src/cameras/Camera.js","../../node_modules/three/src/cameras/PerspectiveCamera.js","../../node_modules/three/src/lights/PointLightShadow.js"],"sourcesContent":["import { clamp } from './MathUtils.js';\n\nclass Vector4 {\n\n\tconstructor( x = 0, y = 0, z = 0, w = 1 ) {\n\n\t\tVector4.prototype.isVector4 = true;\n\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t\tthis.z = z;\n\t\tthis.w = w;\n\n\t}\n\n\tget width() {\n\n\t\treturn this.z;\n\n\t}\n\n\tset width( value ) {\n\n\t\tthis.z = value;\n\n\t}\n\n\tget height() {\n\n\t\treturn this.w;\n\n\t}\n\n\tset height( value ) {\n\n\t\tthis.w = value;\n\n\t}\n\n\tset( x, y, z, w ) {\n\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t\tthis.z = z;\n\t\tthis.w = w;\n\n\t\treturn this;\n\n\t}\n\n\tsetScalar( scalar ) {\n\n\t\tthis.x = scalar;\n\t\tthis.y = scalar;\n\t\tthis.z = scalar;\n\t\tthis.w = scalar;\n\n\t\treturn this;\n\n\t}\n\n\tsetX( x ) {\n\n\t\tthis.x = x;\n\n\t\treturn this;\n\n\t}\n\n\tsetY( y ) {\n\n\t\tthis.y = y;\n\n\t\treturn this;\n\n\t}\n\n\tsetZ( z ) {\n\n\t\tthis.z = z;\n\n\t\treturn this;\n\n\t}\n\n\tsetW( w ) {\n\n\t\tthis.w = w;\n\n\t\treturn this;\n\n\t}\n\n\tsetComponent( index, value ) {\n\n\t\tswitch ( index ) {\n\n\t\t\tcase 0: this.x = value; break;\n\t\t\tcase 1: this.y = value; break;\n\t\t\tcase 2: this.z = value; break;\n\t\t\tcase 3: this.w = value; break;\n\t\t\tdefault: throw new Error( 'index is out of range: ' + index );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tgetComponent( index ) {\n\n\t\tswitch ( index ) {\n\n\t\t\tcase 0: return this.x;\n\t\t\tcase 1: return this.y;\n\t\t\tcase 2: return this.z;\n\t\t\tcase 3: return this.w;\n\t\t\tdefault: throw new Error( 'index is out of range: ' + index );\n\n\t\t}\n\n\t}\n\n\tclone() {\n\n\t\treturn new this.constructor( this.x, this.y, this.z, this.w );\n\n\t}\n\n\tcopy( v ) {\n\n\t\tthis.x = v.x;\n\t\tthis.y = v.y;\n\t\tthis.z = v.z;\n\t\tthis.w = ( v.w !== undefined ) ? v.w : 1;\n\n\t\treturn this;\n\n\t}\n\n\tadd( v ) {\n\n\t\tthis.x += v.x;\n\t\tthis.y += v.y;\n\t\tthis.z += v.z;\n\t\tthis.w += v.w;\n\n\t\treturn this;\n\n\t}\n\n\taddScalar( s ) {\n\n\t\tthis.x += s;\n\t\tthis.y += s;\n\t\tthis.z += s;\n\t\tthis.w += s;\n\n\t\treturn this;\n\n\t}\n\n\taddVectors( a, b ) {\n\n\t\tthis.x = a.x + b.x;\n\t\tthis.y = a.y + b.y;\n\t\tthis.z = a.z + b.z;\n\t\tthis.w = a.w + b.w;\n\n\t\treturn this;\n\n\t}\n\n\taddScaledVector( v, s ) {\n\n\t\tthis.x += v.x * s;\n\t\tthis.y += v.y * s;\n\t\tthis.z += v.z * s;\n\t\tthis.w += v.w * s;\n\n\t\treturn this;\n\n\t}\n\n\tsub( v ) {\n\n\t\tthis.x -= v.x;\n\t\tthis.y -= v.y;\n\t\tthis.z -= v.z;\n\t\tthis.w -= v.w;\n\n\t\treturn this;\n\n\t}\n\n\tsubScalar( s ) {\n\n\t\tthis.x -= s;\n\t\tthis.y -= s;\n\t\tthis.z -= s;\n\t\tthis.w -= s;\n\n\t\treturn this;\n\n\t}\n\n\tsubVectors( a, b ) {\n\n\t\tthis.x = a.x - b.x;\n\t\tthis.y = a.y - b.y;\n\t\tthis.z = a.z - b.z;\n\t\tthis.w = a.w - b.w;\n\n\t\treturn this;\n\n\t}\n\n\tmultiply( v ) {\n\n\t\tthis.x *= v.x;\n\t\tthis.y *= v.y;\n\t\tthis.z *= v.z;\n\t\tthis.w *= v.w;\n\n\t\treturn this;\n\n\t}\n\n\tmultiplyScalar( scalar ) {\n\n\t\tthis.x *= scalar;\n\t\tthis.y *= scalar;\n\t\tthis.z *= scalar;\n\t\tthis.w *= scalar;\n\n\t\treturn this;\n\n\t}\n\n\tapplyMatrix4( m ) {\n\n\t\tconst x = this.x, y = this.y, z = this.z, w = this.w;\n\t\tconst e = m.elements;\n\n\t\tthis.x = e[ 0 ] * x + e[ 4 ] * y + e[ 8 ] * z + e[ 12 ] * w;\n\t\tthis.y = e[ 1 ] * x + e[ 5 ] * y + e[ 9 ] * z + e[ 13 ] * w;\n\t\tthis.z = e[ 2 ] * x + e[ 6 ] * y + e[ 10 ] * z + e[ 14 ] * w;\n\t\tthis.w = e[ 3 ] * x + e[ 7 ] * y + e[ 11 ] * z + e[ 15 ] * w;\n\n\t\treturn this;\n\n\t}\n\n\tdivide( v ) {\n\n\t\tthis.x /= v.x;\n\t\tthis.y /= v.y;\n\t\tthis.z /= v.z;\n\t\tthis.w /= v.w;\n\n\t\treturn this;\n\n\t}\n\n\tdivideScalar( scalar ) {\n\n\t\treturn this.multiplyScalar( 1 / scalar );\n\n\t}\n\n\tsetAxisAngleFromQuaternion( q ) {\n\n\t\t// http://www.euclideanspace.com/maths/geometry/rotations/conversions/quaternionToAngle/index.htm\n\n\t\t// q is assumed to be normalized\n\n\t\tthis.w = 2 * Math.acos( q.w );\n\n\t\tconst s = Math.sqrt( 1 - q.w * q.w );\n\n\t\tif ( s < 0.0001 ) {\n\n\t\t\tthis.x = 1;\n\t\t\tthis.y = 0;\n\t\t\tthis.z = 0;\n\n\t\t} else {\n\n\t\t\tthis.x = q.x / s;\n\t\t\tthis.y = q.y / s;\n\t\t\tthis.z = q.z / s;\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tsetAxisAngleFromRotationMatrix( m ) {\n\n\t\t// http://www.euclideanspace.com/maths/geometry/rotations/conversions/matrixToAngle/index.htm\n\n\t\t// assumes the upper 3x3 of m is a pure rotation matrix (i.e, unscaled)\n\n\t\tlet angle, x, y, z; // variables for result\n\t\tconst epsilon = 0.01,\t\t// margin to allow for rounding errors\n\t\t\tepsilon2 = 0.1,\t\t// margin to distinguish between 0 and 180 degrees\n\n\t\t\tte = m.elements,\n\n\t\t\tm11 = te[ 0 ], m12 = te[ 4 ], m13 = te[ 8 ],\n\t\t\tm21 = te[ 1 ], m22 = te[ 5 ], m23 = te[ 9 ],\n\t\t\tm31 = te[ 2 ], m32 = te[ 6 ], m33 = te[ 10 ];\n\n\t\tif ( ( Math.abs( m12 - m21 ) < epsilon ) &&\n\t\t ( Math.abs( m13 - m31 ) < epsilon ) &&\n\t\t ( Math.abs( m23 - m32 ) < epsilon ) ) {\n\n\t\t\t// singularity found\n\t\t\t// first check for identity matrix which must have +1 for all terms\n\t\t\t// in leading diagonal and zero in other terms\n\n\t\t\tif ( ( Math.abs( m12 + m21 ) < epsilon2 ) &&\n\t\t\t ( Math.abs( m13 + m31 ) < epsilon2 ) &&\n\t\t\t ( Math.abs( m23 + m32 ) < epsilon2 ) &&\n\t\t\t ( Math.abs( m11 + m22 + m33 - 3 ) < epsilon2 ) ) {\n\n\t\t\t\t// this singularity is identity matrix so angle = 0\n\n\t\t\t\tthis.set( 1, 0, 0, 0 );\n\n\t\t\t\treturn this; // zero angle, arbitrary axis\n\n\t\t\t}\n\n\t\t\t// otherwise this singularity is angle = 180\n\n\t\t\tangle = Math.PI;\n\n\t\t\tconst xx = ( m11 + 1 ) / 2;\n\t\t\tconst yy = ( m22 + 1 ) / 2;\n\t\t\tconst zz = ( m33 + 1 ) / 2;\n\t\t\tconst xy = ( m12 + m21 ) / 4;\n\t\t\tconst xz = ( m13 + m31 ) / 4;\n\t\t\tconst yz = ( m23 + m32 ) / 4;\n\n\t\t\tif ( ( xx > yy ) && ( xx > zz ) ) {\n\n\t\t\t\t// m11 is the largest diagonal term\n\n\t\t\t\tif ( xx < epsilon ) {\n\n\t\t\t\t\tx = 0;\n\t\t\t\t\ty = 0.707106781;\n\t\t\t\t\tz = 0.707106781;\n\n\t\t\t\t} else {\n\n\t\t\t\t\tx = Math.sqrt( xx );\n\t\t\t\t\ty = xy / x;\n\t\t\t\t\tz = xz / x;\n\n\t\t\t\t}\n\n\t\t\t} else if ( yy > zz ) {\n\n\t\t\t\t// m22 is the largest diagonal term\n\n\t\t\t\tif ( yy < epsilon ) {\n\n\t\t\t\t\tx = 0.707106781;\n\t\t\t\t\ty = 0;\n\t\t\t\t\tz = 0.707106781;\n\n\t\t\t\t} else {\n\n\t\t\t\t\ty = Math.sqrt( yy );\n\t\t\t\t\tx = xy / y;\n\t\t\t\t\tz = yz / y;\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\t// m33 is the largest diagonal term so base result on this\n\n\t\t\t\tif ( zz < epsilon ) {\n\n\t\t\t\t\tx = 0.707106781;\n\t\t\t\t\ty = 0.707106781;\n\t\t\t\t\tz = 0;\n\n\t\t\t\t} else {\n\n\t\t\t\t\tz = Math.sqrt( zz );\n\t\t\t\t\tx = xz / z;\n\t\t\t\t\ty = yz / z;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tthis.set( x, y, z, angle );\n\n\t\t\treturn this; // return 180 deg rotation\n\n\t\t}\n\n\t\t// as we have reached here there are no singularities so we can handle normally\n\n\t\tlet s = Math.sqrt( ( m32 - m23 ) * ( m32 - m23 ) +\n\t\t\t( m13 - m31 ) * ( m13 - m31 ) +\n\t\t\t( m21 - m12 ) * ( m21 - m12 ) ); // used to normalize\n\n\t\tif ( Math.abs( s ) < 0.001 ) s = 1;\n\n\t\t// prevent divide by zero, should not happen if matrix is orthogonal and should be\n\t\t// caught by singularity test above, but I've left it in just in case\n\n\t\tthis.x = ( m32 - m23 ) / s;\n\t\tthis.y = ( m13 - m31 ) / s;\n\t\tthis.z = ( m21 - m12 ) / s;\n\t\tthis.w = Math.acos( ( m11 + m22 + m33 - 1 ) / 2 );\n\n\t\treturn this;\n\n\t}\n\n\tsetFromMatrixPosition( m ) {\n\n\t\tconst e = m.elements;\n\n\t\tthis.x = e[ 12 ];\n\t\tthis.y = e[ 13 ];\n\t\tthis.z = e[ 14 ];\n\t\tthis.w = e[ 15 ];\n\n\t\treturn this;\n\n\t}\n\n\tmin( v ) {\n\n\t\tthis.x = Math.min( this.x, v.x );\n\t\tthis.y = Math.min( this.y, v.y );\n\t\tthis.z = Math.min( this.z, v.z );\n\t\tthis.w = Math.min( this.w, v.w );\n\n\t\treturn this;\n\n\t}\n\n\tmax( v ) {\n\n\t\tthis.x = Math.max( this.x, v.x );\n\t\tthis.y = Math.max( this.y, v.y );\n\t\tthis.z = Math.max( this.z, v.z );\n\t\tthis.w = Math.max( this.w, v.w );\n\n\t\treturn this;\n\n\t}\n\n\tclamp( min, max ) {\n\n\t\t// assumes min < max, componentwise\n\n\t\tthis.x = clamp( this.x, min.x, max.x );\n\t\tthis.y = clamp( this.y, min.y, max.y );\n\t\tthis.z = clamp( this.z, min.z, max.z );\n\t\tthis.w = clamp( this.w, min.w, max.w );\n\n\t\treturn this;\n\n\t}\n\n\tclampScalar( minVal, maxVal ) {\n\n\t\tthis.x = clamp( this.x, minVal, maxVal );\n\t\tthis.y = clamp( this.y, minVal, maxVal );\n\t\tthis.z = clamp( this.z, minVal, maxVal );\n\t\tthis.w = clamp( this.w, minVal, maxVal );\n\n\t\treturn this;\n\n\t}\n\n\tclampLength( min, max ) {\n\n\t\tconst length = this.length();\n\n\t\treturn this.divideScalar( length || 1 ).multiplyScalar( clamp( length, min, max ) );\n\n\t}\n\n\tfloor() {\n\n\t\tthis.x = Math.floor( this.x );\n\t\tthis.y = Math.floor( this.y );\n\t\tthis.z = Math.floor( this.z );\n\t\tthis.w = Math.floor( this.w );\n\n\t\treturn this;\n\n\t}\n\n\tceil() {\n\n\t\tthis.x = Math.ceil( this.x );\n\t\tthis.y = Math.ceil( this.y );\n\t\tthis.z = Math.ceil( this.z );\n\t\tthis.w = Math.ceil( this.w );\n\n\t\treturn this;\n\n\t}\n\n\tround() {\n\n\t\tthis.x = Math.round( this.x );\n\t\tthis.y = Math.round( this.y );\n\t\tthis.z = Math.round( this.z );\n\t\tthis.w = Math.round( this.w );\n\n\t\treturn this;\n\n\t}\n\n\troundToZero() {\n\n\t\tthis.x = Math.trunc( this.x );\n\t\tthis.y = Math.trunc( this.y );\n\t\tthis.z = Math.trunc( this.z );\n\t\tthis.w = Math.trunc( this.w );\n\n\t\treturn this;\n\n\t}\n\n\tnegate() {\n\n\t\tthis.x = - this.x;\n\t\tthis.y = - this.y;\n\t\tthis.z = - this.z;\n\t\tthis.w = - this.w;\n\n\t\treturn this;\n\n\t}\n\n\tdot( v ) {\n\n\t\treturn this.x * v.x + this.y * v.y + this.z * v.z + this.w * v.w;\n\n\t}\n\n\tlengthSq() {\n\n\t\treturn this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w;\n\n\t}\n\n\tlength() {\n\n\t\treturn Math.sqrt( this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w );\n\n\t}\n\n\tmanhattanLength() {\n\n\t\treturn Math.abs( this.x ) + Math.abs( this.y ) + Math.abs( this.z ) + Math.abs( this.w );\n\n\t}\n\n\tnormalize() {\n\n\t\treturn this.divideScalar( this.length() || 1 );\n\n\t}\n\n\tsetLength( length ) {\n\n\t\treturn this.normalize().multiplyScalar( length );\n\n\t}\n\n\tlerp( v, alpha ) {\n\n\t\tthis.x += ( v.x - this.x ) * alpha;\n\t\tthis.y += ( v.y - this.y ) * alpha;\n\t\tthis.z += ( v.z - this.z ) * alpha;\n\t\tthis.w += ( v.w - this.w ) * alpha;\n\n\t\treturn this;\n\n\t}\n\n\tlerpVectors( v1, v2, alpha ) {\n\n\t\tthis.x = v1.x + ( v2.x - v1.x ) * alpha;\n\t\tthis.y = v1.y + ( v2.y - v1.y ) * alpha;\n\t\tthis.z = v1.z + ( v2.z - v1.z ) * alpha;\n\t\tthis.w = v1.w + ( v2.w - v1.w ) * alpha;\n\n\t\treturn this;\n\n\t}\n\n\tequals( v ) {\n\n\t\treturn ( ( v.x === this.x ) && ( v.y === this.y ) && ( v.z === this.z ) && ( v.w === this.w ) );\n\n\t}\n\n\tfromArray( array, offset = 0 ) {\n\n\t\tthis.x = array[ offset ];\n\t\tthis.y = array[ offset + 1 ];\n\t\tthis.z = array[ offset + 2 ];\n\t\tthis.w = array[ offset + 3 ];\n\n\t\treturn this;\n\n\t}\n\n\ttoArray( array = [], offset = 0 ) {\n\n\t\tarray[ offset ] = this.x;\n\t\tarray[ offset + 1 ] = this.y;\n\t\tarray[ offset + 2 ] = this.z;\n\t\tarray[ offset + 3 ] = this.w;\n\n\t\treturn array;\n\n\t}\n\n\tfromBufferAttribute( attribute, index ) {\n\n\t\tthis.x = attribute.getX( index );\n\t\tthis.y = attribute.getY( index );\n\t\tthis.z = attribute.getZ( index );\n\t\tthis.w = attribute.getW( index );\n\n\t\treturn this;\n\n\t}\n\n\trandom() {\n\n\t\tthis.x = Math.random();\n\t\tthis.y = Math.random();\n\t\tthis.z = Math.random();\n\t\tthis.w = Math.random();\n\n\t\treturn this;\n\n\t}\n\n\t*[ Symbol.iterator ]() {\n\n\t\tyield this.x;\n\t\tyield this.y;\n\t\tyield this.z;\n\t\tyield this.w;\n\n\t}\n\n}\n\nexport { Vector4 };\n","import { Matrix3 } from './Matrix3.js';\nimport { Vector3 } from './Vector3.js';\n\nconst _vector1 = /*@__PURE__*/ new Vector3();\nconst _vector2 = /*@__PURE__*/ new Vector3();\nconst _normalMatrix = /*@__PURE__*/ new Matrix3();\n\nclass Plane {\n\n\tconstructor( normal = new Vector3( 1, 0, 0 ), constant = 0 ) {\n\n\t\tthis.isPlane = true;\n\n\t\t// normal is assumed to be normalized\n\n\t\tthis.normal = normal;\n\t\tthis.constant = constant;\n\n\t}\n\n\tset( normal, constant ) {\n\n\t\tthis.normal.copy( normal );\n\t\tthis.constant = constant;\n\n\t\treturn this;\n\n\t}\n\n\tsetComponents( x, y, z, w ) {\n\n\t\tthis.normal.set( x, y, z );\n\t\tthis.constant = w;\n\n\t\treturn this;\n\n\t}\n\n\tsetFromNormalAndCoplanarPoint( normal, point ) {\n\n\t\tthis.normal.copy( normal );\n\t\tthis.constant = - point.dot( this.normal );\n\n\t\treturn this;\n\n\t}\n\n\tsetFromCoplanarPoints( a, b, c ) {\n\n\t\tconst normal = _vector1.subVectors( c, b ).cross( _vector2.subVectors( a, b ) ).normalize();\n\n\t\t// Q: should an error be thrown if normal is zero (e.g. degenerate plane)?\n\n\t\tthis.setFromNormalAndCoplanarPoint( normal, a );\n\n\t\treturn this;\n\n\t}\n\n\tcopy( plane ) {\n\n\t\tthis.normal.copy( plane.normal );\n\t\tthis.constant = plane.constant;\n\n\t\treturn this;\n\n\t}\n\n\tnormalize() {\n\n\t\t// Note: will lead to a divide by zero if the plane is invalid.\n\n\t\tconst inverseNormalLength = 1.0 / this.normal.length();\n\t\tthis.normal.multiplyScalar( inverseNormalLength );\n\t\tthis.constant *= inverseNormalLength;\n\n\t\treturn this;\n\n\t}\n\n\tnegate() {\n\n\t\tthis.constant *= - 1;\n\t\tthis.normal.negate();\n\n\t\treturn this;\n\n\t}\n\n\tdistanceToPoint( point ) {\n\n\t\treturn this.normal.dot( point ) + this.constant;\n\n\t}\n\n\tdistanceToSphere( sphere ) {\n\n\t\treturn this.distanceToPoint( sphere.center ) - sphere.radius;\n\n\t}\n\n\tprojectPoint( point, target ) {\n\n\t\treturn target.copy( point ).addScaledVector( this.normal, - this.distanceToPoint( point ) );\n\n\t}\n\n\tintersectLine( line, target ) {\n\n\t\tconst direction = line.delta( _vector1 );\n\n\t\tconst denominator = this.normal.dot( direction );\n\n\t\tif ( denominator === 0 ) {\n\n\t\t\t// line is coplanar, return origin\n\t\t\tif ( this.distanceToPoint( line.start ) === 0 ) {\n\n\t\t\t\treturn target.copy( line.start );\n\n\t\t\t}\n\n\t\t\t// Unsure if this is the correct method to handle this case.\n\t\t\treturn null;\n\n\t\t}\n\n\t\tconst t = - ( line.start.dot( this.normal ) + this.constant ) / denominator;\n\n\t\tif ( t < 0 || t > 1 ) {\n\n\t\t\treturn null;\n\n\t\t}\n\n\t\treturn target.copy( line.start ).addScaledVector( direction, t );\n\n\t}\n\n\tintersectsLine( line ) {\n\n\t\t// Note: this tests if a line intersects the plane, not whether it (or its end-points) are coplanar with it.\n\n\t\tconst startSign = this.distanceToPoint( line.start );\n\t\tconst endSign = this.distanceToPoint( line.end );\n\n\t\treturn ( startSign < 0 && endSign > 0 ) || ( endSign < 0 && startSign > 0 );\n\n\t}\n\n\tintersectsBox( box ) {\n\n\t\treturn box.intersectsPlane( this );\n\n\t}\n\n\tintersectsSphere( sphere ) {\n\n\t\treturn sphere.intersectsPlane( this );\n\n\t}\n\n\tcoplanarPoint( target ) {\n\n\t\treturn target.copy( this.normal ).multiplyScalar( - this.constant );\n\n\t}\n\n\tapplyMatrix4( matrix, optionalNormalMatrix ) {\n\n\t\tconst normalMatrix = optionalNormalMatrix || _normalMatrix.getNormalMatrix( matrix );\n\n\t\tconst referencePoint = this.coplanarPoint( _vector1 ).applyMatrix4( matrix );\n\n\t\tconst normal = this.normal.applyMatrix3( normalMatrix ).normalize();\n\n\t\tthis.constant = - referencePoint.dot( normal );\n\n\t\treturn this;\n\n\t}\n\n\ttranslate( offset ) {\n\n\t\tthis.constant -= offset.dot( this.normal );\n\n\t\treturn this;\n\n\t}\n\n\tequals( plane ) {\n\n\t\treturn plane.normal.equals( this.normal ) && ( plane.constant === this.constant );\n\n\t}\n\n\tclone() {\n\n\t\treturn new this.constructor().copy( this );\n\n\t}\n\n}\n\nexport { Plane };\n","import { WebGLCoordinateSystem, WebGPUCoordinateSystem } from '../constants.js';\nimport { Vector3 } from './Vector3.js';\nimport { Sphere } from './Sphere.js';\nimport { Plane } from './Plane.js';\n\nconst _sphere = /*@__PURE__*/ new Sphere();\nconst _vector = /*@__PURE__*/ new Vector3();\n\nclass Frustum {\n\n\tconstructor( p0 = new Plane(), p1 = new Plane(), p2 = new Plane(), p3 = new Plane(), p4 = new Plane(), p5 = new Plane() ) {\n\n\t\tthis.planes = [ p0, p1, p2, p3, p4, p5 ];\n\n\t}\n\n\tset( p0, p1, p2, p3, p4, p5 ) {\n\n\t\tconst planes = this.planes;\n\n\t\tplanes[ 0 ].copy( p0 );\n\t\tplanes[ 1 ].copy( p1 );\n\t\tplanes[ 2 ].copy( p2 );\n\t\tplanes[ 3 ].copy( p3 );\n\t\tplanes[ 4 ].copy( p4 );\n\t\tplanes[ 5 ].copy( p5 );\n\n\t\treturn this;\n\n\t}\n\n\tcopy( frustum ) {\n\n\t\tconst planes = this.planes;\n\n\t\tfor ( let i = 0; i < 6; i ++ ) {\n\n\t\t\tplanes[ i ].copy( frustum.planes[ i ] );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tsetFromProjectionMatrix( m, coordinateSystem = WebGLCoordinateSystem ) {\n\n\t\tconst planes = this.planes;\n\t\tconst me = m.elements;\n\t\tconst me0 = me[ 0 ], me1 = me[ 1 ], me2 = me[ 2 ], me3 = me[ 3 ];\n\t\tconst me4 = me[ 4 ], me5 = me[ 5 ], me6 = me[ 6 ], me7 = me[ 7 ];\n\t\tconst me8 = me[ 8 ], me9 = me[ 9 ], me10 = me[ 10 ], me11 = me[ 11 ];\n\t\tconst me12 = me[ 12 ], me13 = me[ 13 ], me14 = me[ 14 ], me15 = me[ 15 ];\n\n\t\tplanes[ 0 ].setComponents( me3 - me0, me7 - me4, me11 - me8, me15 - me12 ).normalize();\n\t\tplanes[ 1 ].setComponents( me3 + me0, me7 + me4, me11 + me8, me15 + me12 ).normalize();\n\t\tplanes[ 2 ].setComponents( me3 + me1, me7 + me5, me11 + me9, me15 + me13 ).normalize();\n\t\tplanes[ 3 ].setComponents( me3 - me1, me7 - me5, me11 - me9, me15 - me13 ).normalize();\n\t\tplanes[ 4 ].setComponents( me3 - me2, me7 - me6, me11 - me10, me15 - me14 ).normalize();\n\n\t\tif ( coordinateSystem === WebGLCoordinateSystem ) {\n\n\t\t\tplanes[ 5 ].setComponents( me3 + me2, me7 + me6, me11 + me10, me15 + me14 ).normalize();\n\n\t\t} else if ( coordinateSystem === WebGPUCoordinateSystem ) {\n\n\t\t\tplanes[ 5 ].setComponents( me2, me6, me10, me14 ).normalize();\n\n\t\t} else {\n\n\t\t\tthrow new Error( 'THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: ' + coordinateSystem );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\tintersectsObject( object ) {\n\n\t\tif ( object.boundingSphere !== undefined ) {\n\n\t\t\tif ( object.boundingSphere === null ) object.computeBoundingSphere();\n\n\t\t\t_sphere.copy( object.boundingSphere ).applyMatrix4( object.matrixWorld );\n\n\t\t} else {\n\n\t\t\tconst geometry = object.geometry;\n\n\t\t\tif ( geometry.boundingSphere === null ) geometry.computeBoundingSphere();\n\n\t\t\t_sphere.copy( geometry.boundingSphere ).applyMatrix4( object.matrixWorld );\n\n\t\t}\n\n\t\treturn this.intersectsSphere( _sphere );\n\n\t}\n\n\tintersectsSprite( sprite ) {\n\n\t\t_sphere.center.set( 0, 0, 0 );\n\t\t_sphere.radius = 0.7071067811865476;\n\t\t_sphere.applyMatrix4( sprite.matrixWorld );\n\n\t\treturn this.intersectsSphere( _sphere );\n\n\t}\n\n\tintersectsSphere( sphere ) {\n\n\t\tconst planes = this.planes;\n\t\tconst center = sphere.center;\n\t\tconst negRadius = - sphere.radius;\n\n\t\tfor ( let i = 0; i < 6; i ++ ) {\n\n\t\t\tconst distance = planes[ i ].distanceToPoint( center );\n\n\t\t\tif ( distance < negRadius ) {\n\n\t\t\t\treturn false;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn true;\n\n\t}\n\n\tintersectsBox( box ) {\n\n\t\tconst planes = this.planes;\n\n\t\tfor ( let i = 0; i < 6; i ++ ) {\n\n\t\t\tconst plane = planes[ i ];\n\n\t\t\t// corner at max distance\n\n\t\t\t_vector.x = plane.normal.x > 0 ? box.max.x : box.min.x;\n\t\t\t_vector.y = plane.normal.y > 0 ? box.max.y : box.min.y;\n\t\t\t_vector.z = plane.normal.z > 0 ? box.max.z : box.min.z;\n\n\t\t\tif ( plane.distanceToPoint( _vector ) < 0 ) {\n\n\t\t\t\treturn false;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn true;\n\n\t}\n\n\tcontainsPoint( point ) {\n\n\t\tconst planes = this.planes;\n\n\t\tfor ( let i = 0; i < 6; i ++ ) {\n\n\t\t\tif ( planes[ i ].distanceToPoint( point ) < 0 ) {\n\n\t\t\t\treturn false;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn true;\n\n\t}\n\n\tclone() {\n\n\t\treturn new this.constructor().copy( this );\n\n\t}\n\n}\n\n\nexport { Frustum };\n","import { Matrix4 } from '../math/Matrix4.js';\nimport { Vector2 } from '../math/Vector2.js';\nimport { Vector3 } from '../math/Vector3.js';\nimport { Vector4 } from '../math/Vector4.js';\nimport { Frustum } from '../math/Frustum.js';\n\nconst _projScreenMatrix = /*@__PURE__*/ new Matrix4();\nconst _lightPositionWorld = /*@__PURE__*/ new Vector3();\nconst _lookTarget = /*@__PURE__*/ new Vector3();\n\nclass LightShadow {\n\n\tconstructor( camera ) {\n\n\t\tthis.camera = camera;\n\n\t\tthis.intensity = 1;\n\n\t\tthis.bias = 0;\n\t\tthis.normalBias = 0;\n\t\tthis.radius = 1;\n\t\tthis.blurSamples = 8;\n\n\t\tthis.mapSize = new Vector2( 512, 512 );\n\n\t\tthis.map = null;\n\t\tthis.mapPass = null;\n\t\tthis.matrix = new Matrix4();\n\n\t\tthis.autoUpdate = true;\n\t\tthis.needsUpdate = false;\n\n\t\tthis._frustum = new Frustum();\n\t\tthis._frameExtents = new Vector2( 1, 1 );\n\n\t\tthis._viewportCount = 1;\n\n\t\tthis._viewports = [\n\n\t\t\tnew Vector4( 0, 0, 1, 1 )\n\n\t\t];\n\n\t}\n\n\tgetViewportCount() {\n\n\t\treturn this._viewportCount;\n\n\t}\n\n\tgetFrustum() {\n\n\t\treturn this._frustum;\n\n\t}\n\n\tupdateMatrices( light ) {\n\n\t\tconst shadowCamera = this.camera;\n\t\tconst shadowMatrix = this.matrix;\n\n\t\t_lightPositionWorld.setFromMatrixPosition( light.matrixWorld );\n\t\tshadowCamera.position.copy( _lightPositionWorld );\n\n\t\t_lookTarget.setFromMatrixPosition( light.target.matrixWorld );\n\t\tshadowCamera.lookAt( _lookTarget );\n\t\tshadowCamera.updateMatrixWorld();\n\n\t\t_projScreenMatrix.multiplyMatrices( shadowCamera.projectionMatrix, shadowCamera.matrixWorldInverse );\n\t\tthis._frustum.setFromProjectionMatrix( _projScreenMatrix );\n\n\t\tshadowMatrix.set(\n\t\t\t0.5, 0.0, 0.0, 0.5,\n\t\t\t0.0, 0.5, 0.0, 0.5,\n\t\t\t0.0, 0.0, 0.5, 0.5,\n\t\t\t0.0, 0.0, 0.0, 1.0\n\t\t);\n\n\t\tshadowMatrix.multiply( _projScreenMatrix );\n\n\t}\n\n\tgetViewport( viewportIndex ) {\n\n\t\treturn this._viewports[ viewportIndex ];\n\n\t}\n\n\tgetFrameExtents() {\n\n\t\treturn this._frameExtents;\n\n\t}\n\n\tdispose() {\n\n\t\tif ( this.map ) {\n\n\t\t\tthis.map.dispose();\n\n\t\t}\n\n\t\tif ( this.mapPass ) {\n\n\t\t\tthis.mapPass.dispose();\n\n\t\t}\n\n\t}\n\n\tcopy( source ) {\n\n\t\tthis.camera = source.camera.clone();\n\n\t\tthis.intensity = source.intensity;\n\n\t\tthis.bias = source.bias;\n\t\tthis.radius = source.radius;\n\n\t\tthis.mapSize.copy( source.mapSize );\n\n\t\treturn this;\n\n\t}\n\n\tclone() {\n\n\t\treturn new this.constructor().copy( this );\n\n\t}\n\n\ttoJSON() {\n\n\t\tconst object = {};\n\n\t\tif ( this.intensity !== 1 ) object.intensity = this.intensity;\n\t\tif ( this.bias !== 0 ) object.bias = this.bias;\n\t\tif ( this.normalBias !== 0 ) object.normalBias = this.normalBias;\n\t\tif ( this.radius !== 1 ) object.radius = this.radius;\n\t\tif ( this.mapSize.x !== 512 || this.mapSize.y !== 512 ) object.mapSize = this.mapSize.toArray();\n\n\t\tobject.camera = this.camera.toJSON( false ).object;\n\t\tdelete object.camera.matrix;\n\n\t\treturn object;\n\n\t}\n\n}\n\nexport { LightShadow };\n","import { WebGLCoordinateSystem } from '../constants.js';\nimport { Matrix4 } from '../math/Matrix4.js';\nimport { Object3D } from '../core/Object3D.js';\n\nclass Camera extends Object3D {\n\n\tconstructor() {\n\n\t\tsuper();\n\n\t\tthis.isCamera = true;\n\n\t\tthis.type = 'Camera';\n\n\t\tthis.matrixWorldInverse = new Matrix4();\n\n\t\tthis.projectionMatrix = new Matrix4();\n\t\tthis.projectionMatrixInverse = new Matrix4();\n\n\t\tthis.coordinateSystem = WebGLCoordinateSystem;\n\n\t}\n\n\tcopy( source, recursive ) {\n\n\t\tsuper.copy( source, recursive );\n\n\t\tthis.matrixWorldInverse.copy( source.matrixWorldInverse );\n\n\t\tthis.projectionMatrix.copy( source.projectionMatrix );\n\t\tthis.projectionMatrixInverse.copy( source.projectionMatrixInverse );\n\n\t\tthis.coordinateSystem = source.coordinateSystem;\n\n\t\treturn this;\n\n\t}\n\n\tgetWorldDirection( target ) {\n\n\t\treturn super.getWorldDirection( target ).negate();\n\n\t}\n\n\tupdateMatrixWorld( force ) {\n\n\t\tsuper.updateMatrixWorld( force );\n\n\t\tthis.matrixWorldInverse.copy( this.matrixWorld ).invert();\n\n\t}\n\n\tupdateWorldMatrix( updateParents, updateChildren ) {\n\n\t\tsuper.updateWorldMatrix( updateParents, updateChildren );\n\n\t\tthis.matrixWorldInverse.copy( this.matrixWorld ).invert();\n\n\t}\n\n\tclone() {\n\n\t\treturn new this.constructor().copy( this );\n\n\t}\n\n}\n\nexport { Camera };\n","import { Camera } from './Camera.js';\nimport { RAD2DEG, DEG2RAD } from '../math/MathUtils.js';\nimport { Vector2 } from '../math/Vector2.js';\nimport { Vector3 } from '../math/Vector3.js';\n\nconst _v3 = /*@__PURE__*/ new Vector3();\nconst _minTarget = /*@__PURE__*/ new Vector2();\nconst _maxTarget = /*@__PURE__*/ new Vector2();\n\n\nclass PerspectiveCamera extends Camera {\n\n\tconstructor( fov = 50, aspect = 1, near = 0.1, far = 2000 ) {\n\n\t\tsuper();\n\n\t\tthis.isPerspectiveCamera = true;\n\n\t\tthis.type = 'PerspectiveCamera';\n\n\t\tthis.fov = fov;\n\t\tthis.zoom = 1;\n\n\t\tthis.near = near;\n\t\tthis.far = far;\n\t\tthis.focus = 10;\n\n\t\tthis.aspect = aspect;\n\t\tthis.view = null;\n\n\t\tthis.filmGauge = 35;\t// width of the film (default in millimeters)\n\t\tthis.filmOffset = 0;\t// horizontal film offset (same unit as gauge)\n\n\t\tthis.updateProjectionMatrix();\n\n\t}\n\n\tcopy( source, recursive ) {\n\n\t\tsuper.copy( source, recursive );\n\n\t\tthis.fov = source.fov;\n\t\tthis.zoom = source.zoom;\n\n\t\tthis.near = source.near;\n\t\tthis.far = source.far;\n\t\tthis.focus = source.focus;\n\n\t\tthis.aspect = source.aspect;\n\t\tthis.view = source.view === null ? null : Object.assign( {}, source.view );\n\n\t\tthis.filmGauge = source.filmGauge;\n\t\tthis.filmOffset = source.filmOffset;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the FOV by focal length in respect to the current .filmGauge.\n\t *\n\t * The default film gauge is 35, so that the focal length can be specified for\n\t * a 35mm (full frame) camera.\n\t *\n\t * @param {number} focalLength - Values for focal length and film gauge must have the same unit.\n\t */\n\tsetFocalLength( focalLength ) {\n\n\t\t/** see {@link http://www.bobatkins.com/photography/technical/field_of_view.html} */\n\t\tconst vExtentSlope = 0.5 * this.getFilmHeight() / focalLength;\n\n\t\tthis.fov = RAD2DEG * 2 * Math.atan( vExtentSlope );\n\t\tthis.updateProjectionMatrix();\n\n\t}\n\n\t/**\n\t * Calculates the focal length from the current .fov and .filmGauge.\n\t *\n\t * @returns {number}\n\t */\n\tgetFocalLength() {\n\n\t\tconst vExtentSlope = Math.tan( DEG2RAD * 0.5 * this.fov );\n\n\t\treturn 0.5 * this.getFilmHeight() / vExtentSlope;\n\n\t}\n\n\tgetEffectiveFOV() {\n\n\t\treturn RAD2DEG * 2 * Math.atan(\n\t\t\tMath.tan( DEG2RAD * 0.5 * this.fov ) / this.zoom );\n\n\t}\n\n\tgetFilmWidth() {\n\n\t\t// film not completely covered in portrait format (aspect < 1)\n\t\treturn this.filmGauge * Math.min( this.aspect, 1 );\n\n\t}\n\n\tgetFilmHeight() {\n\n\t\t// film not completely covered in landscape format (aspect > 1)\n\t\treturn this.filmGauge / Math.max( this.aspect, 1 );\n\n\t}\n\n\t/**\n\t * Computes the 2D bounds of the camera's viewable rectangle at a given distance along the viewing direction.\n\t * Sets minTarget and maxTarget to the coordinates of the lower-left and upper-right corners of the view rectangle.\n\t *\n\t * @param {number} distance\n\t * @param {Vector2} minTarget\n\t * @param {Vector2} maxTarget\n\t */\n\tgetViewBounds( distance, minTarget, maxTarget ) {\n\n\t\t_v3.set( - 1, - 1, 0.5 ).applyMatrix4( this.projectionMatrixInverse );\n\n\t\tminTarget.set( _v3.x, _v3.y ).multiplyScalar( - distance / _v3.z );\n\n\t\t_v3.set( 1, 1, 0.5 ).applyMatrix4( this.projectionMatrixInverse );\n\n\t\tmaxTarget.set( _v3.x, _v3.y ).multiplyScalar( - distance / _v3.z );\n\n\t}\n\n\t/**\n\t * Computes the width and height of the camera's viewable rectangle at a given distance along the viewing direction.\n\t *\n\t * @param {number} distance\n\t * @param {Vector2} target - Vector2 target used to store result where x is width and y is height.\n\t * @returns {Vector2}\n\t */\n\tgetViewSize( distance, target ) {\n\n\t\tthis.getViewBounds( distance, _minTarget, _maxTarget );\n\n\t\treturn target.subVectors( _maxTarget, _minTarget );\n\n\t}\n\n\t/**\n\t * Sets an offset in a larger frustum. This is useful for multi-window or\n\t * multi-monitor/multi-machine setups.\n\t *\n\t * For example, if you have 3x2 monitors and each monitor is 1920x1080 and\n\t * the monitors are in grid like this\n\t *\n\t * +---+---+---+\n\t * | A | B | C |\n\t * +---+---+---+\n\t * | D | E | F |\n\t * +---+---+---+\n\t *\n\t * then for each monitor you would call it like this\n\t *\n\t * const w = 1920;\n\t * const h = 1080;\n\t * const fullWidth = w * 3;\n\t * const fullHeight = h * 2;\n\t *\n\t * --A--\n\t * camera.setViewOffset( fullWidth, fullHeight, w * 0, h * 0, w, h );\n\t * --B--\n\t * camera.setViewOffset( fullWidth, fullHeight, w * 1, h * 0, w, h );\n\t * --C--\n\t * camera.setViewOffset( fullWidth, fullHeight, w * 2, h * 0, w, h );\n\t * --D--\n\t * camera.setViewOffset( fullWidth, fullHeight, w * 0, h * 1, w, h );\n\t * --E--\n\t * camera.setViewOffset( fullWidth, fullHeight, w * 1, h * 1, w, h );\n\t * --F--\n\t * camera.setViewOffset( fullWidth, fullHeight, w * 2, h * 1, w, h );\n\t *\n\t * Note there is no reason monitors have to be the same size or in a grid.\n\t *\n\t * @param {number} fullWidth\n\t * @param {number} fullHeight\n\t * @param {number} x\n\t * @param {number} y\n\t * @param {number} width\n\t * @param {number} height\n\t */\n\tsetViewOffset( fullWidth, fullHeight, x, y, width, height ) {\n\n\t\tthis.aspect = fullWidth / fullHeight;\n\n\t\tif ( this.view === null ) {\n\n\t\t\tthis.view = {\n\t\t\t\tenabled: true,\n\t\t\t\tfullWidth: 1,\n\t\t\t\tfullHeight: 1,\n\t\t\t\toffsetX: 0,\n\t\t\t\toffsetY: 0,\n\t\t\t\twidth: 1,\n\t\t\t\theight: 1\n\t\t\t};\n\n\t\t}\n\n\t\tthis.view.enabled = true;\n\t\tthis.view.fullWidth = fullWidth;\n\t\tthis.view.fullHeight = fullHeight;\n\t\tthis.view.offsetX = x;\n\t\tthis.view.offsetY = y;\n\t\tthis.view.width = width;\n\t\tthis.view.height = height;\n\n\t\tthis.updateProjectionMatrix();\n\n\t}\n\n\tclearViewOffset() {\n\n\t\tif ( this.view !== null ) {\n\n\t\t\tthis.view.enabled = false;\n\n\t\t}\n\n\t\tthis.updateProjectionMatrix();\n\n\t}\n\n\tupdateProjectionMatrix() {\n\n\t\tconst near = this.near;\n\t\tlet top = near * Math.tan( DEG2RAD * 0.5 * this.fov ) / this.zoom;\n\t\tlet height = 2 * top;\n\t\tlet width = this.aspect * height;\n\t\tlet left = - 0.5 * width;\n\t\tconst view = this.view;\n\n\t\tif ( this.view !== null && this.view.enabled ) {\n\n\t\t\tconst fullWidth = view.fullWidth,\n\t\t\t\tfullHeight = view.fullHeight;\n\n\t\t\tleft += view.offsetX * width / fullWidth;\n\t\t\ttop -= view.offsetY * height / fullHeight;\n\t\t\twidth *= view.width / fullWidth;\n\t\t\theight *= view.height / fullHeight;\n\n\t\t}\n\n\t\tconst skew = this.filmOffset;\n\t\tif ( skew !== 0 ) left += near * skew / this.getFilmWidth();\n\n\t\tthis.projectionMatrix.makePerspective( left, left + width, top, top - height, near, this.far, this.coordinateSystem );\n\n\t\tthis.projectionMatrixInverse.copy( this.projectionMatrix ).invert();\n\n\t}\n\n\ttoJSON( meta ) {\n\n\t\tconst data = super.toJSON( meta );\n\n\t\tdata.object.fov = this.fov;\n\t\tdata.object.zoom = this.zoom;\n\n\t\tdata.object.near = this.near;\n\t\tdata.object.far = this.far;\n\t\tdata.object.focus = this.focus;\n\n\t\tdata.object.aspect = this.aspect;\n\n\t\tif ( this.view !== null ) data.object.view = Object.assign( {}, this.view );\n\n\t\tdata.object.filmGauge = this.filmGauge;\n\t\tdata.object.filmOffset = this.filmOffset;\n\n\t\treturn data;\n\n\t}\n\n}\n\nexport { PerspectiveCamera };\n","import { LightShadow } from './LightShadow.js';\nimport { PerspectiveCamera } from '../cameras/PerspectiveCamera.js';\nimport { Matrix4 } from '../math/Matrix4.js';\nimport { Vector2 } from '../math/Vector2.js';\nimport { Vector3 } from '../math/Vector3.js';\nimport { Vector4 } from '../math/Vector4.js';\n\nconst _projScreenMatrix = /*@__PURE__*/ new Matrix4();\nconst _lightPositionWorld = /*@__PURE__*/ new Vector3();\nconst _lookTarget = /*@__PURE__*/ new Vector3();\n\nclass PointLightShadow extends LightShadow {\n\n\tconstructor() {\n\n\t\tsuper( new PerspectiveCamera( 90, 1, 0.5, 500 ) );\n\n\t\tthis.isPointLightShadow = true;\n\n\t\tthis._frameExtents = new Vector2( 4, 2 );\n\n\t\tthis._viewportCount = 6;\n\n\t\tthis._viewports = [\n\t\t\t// These viewports map a cube-map onto a 2D texture with the\n\t\t\t// following orientation:\n\t\t\t//\n\t\t\t// xzXZ\n\t\t\t// y Y\n\t\t\t//\n\t\t\t// X - Positive x direction\n\t\t\t// x - Negative x direction\n\t\t\t// Y - Positive y direction\n\t\t\t// y - Negative y direction\n\t\t\t// Z - Positive z direction\n\t\t\t// z - Negative z direction\n\n\t\t\t// positive X\n\t\t\tnew Vector4( 2, 1, 1, 1 ),\n\t\t\t// negative X\n\t\t\tnew Vector4( 0, 1, 1, 1 ),\n\t\t\t// positive Z\n\t\t\tnew Vector4( 3, 1, 1, 1 ),\n\t\t\t// negative Z\n\t\t\tnew Vector4( 1, 1, 1, 1 ),\n\t\t\t// positive Y\n\t\t\tnew Vector4( 3, 0, 1, 1 ),\n\t\t\t// negative Y\n\t\t\tnew Vector4( 1, 0, 1, 1 )\n\t\t];\n\n\t\tthis._cubeDirections = [\n\t\t\tnew Vector3( 1, 0, 0 ), new Vector3( - 1, 0, 0 ), new Vector3( 0, 0, 1 ),\n\t\t\tnew Vector3( 0, 0, - 1 ), new Vector3( 0, 1, 0 ), new Vector3( 0, - 1, 0 )\n\t\t];\n\n\t\tthis._cubeUps = [\n\t\t\tnew Vector3( 0, 1, 0 ), new Vector3( 0, 1, 0 ), new Vector3( 0, 1, 0 ),\n\t\t\tnew Vector3( 0, 1, 0 ), new Vector3( 0, 0, 1 ),\tnew Vector3( 0, 0, - 1 )\n\t\t];\n\n\t}\n\n\tupdateMatrices( light, viewportIndex = 0 ) {\n\n\t\tconst camera = this.camera;\n\t\tconst shadowMatrix = this.matrix;\n\n\t\tconst far = light.distance || camera.far;\n\n\t\tif ( far !== camera.far ) {\n\n\t\t\tcamera.far = far;\n\t\t\tcamera.updateProjectionMatrix();\n\n\t\t}\n\n\t\t_lightPositionWorld.setFromMatrixPosition( light.matrixWorld );\n\t\tcamera.position.copy( _lightPositionWorld );\n\n\t\t_lookTarget.copy( camera.position );\n\t\t_lookTarget.add( this._cubeDirections[ viewportIndex ] );\n\t\tcamera.up.copy( this._cubeUps[ viewportIndex ] );\n\t\tcamera.lookAt( _lookTarget );\n\t\tcamera.updateMatrixWorld();\n\n\t\tshadowMatrix.makeTranslation( - _lightPositionWorld.x, - _lightPositionWorld.y, - _lightPositionWorld.z );\n\n\t\t_projScreenMatrix.multiplyMatrices( camera.projectionMatrix, camera.matrixWorldInverse );\n\t\tthis._frustum.setFromProjectionMatrix( _projScreenMatrix );\n\n\t}\n\n}\n\nexport { PointLightShadow };\n"],"names":["Vector4","[object Object]","x","y","z","w","prototype","isVector4","this","width","value","height","scalar","index","Error","constructor","v","undefined","s","a","b","m","e","elements","multiplyScalar","q","Math","acos","sqrt","angle","te","m11","m12","m13","m21","m22","m23","m31","m32","m33","abs","set","PI","xx","yy","zz","xy","xz","yz","min","max","clamp","minVal","maxVal","length","divideScalar","floor","ceil","round","trunc","normalize","alpha","v1","v2","array","offset","attribute","getX","getY","getZ","getW","random","Symbol","iterator","_vector1","Vector3","_vector2","_normalMatrix","Matrix3","Plane","normal","constant","isPlane","copy","point","dot","c","subVectors","cross","setFromNormalAndCoplanarPoint","plane","inverseNormalLength","negate","sphere","distanceToPoint","center","radius","target","addScaledVector","line","direction","delta","denominator","start","t","startSign","endSign","end","box","intersectsPlane","matrix","optionalNormalMatrix","normalMatrix","getNormalMatrix","referencePoint","coplanarPoint","applyMatrix4","applyMatrix3","equals","_sphere","Sphere","_vector","Frustum","p0","p1","p2","p3","p4","p5","planes","frustum","i","coordinateSystem","WebGLCoordinateSystem","me","me0","me1","me2","me3","me4","me5","me6","me7","me8","me9","me10","me11","me12","me13","me14","me15","setComponents","WebGPUCoordinateSystem","object","boundingSphere","computeBoundingSphere","matrixWorld","geometry","intersectsSphere","sprite","negRadius","_projScreenMatrix","Matrix4","_lightPositionWorld","_lookTarget","Camera","Object3D","super","isCamera","type","matrixWorldInverse","projectionMatrix","projectionMatrixInverse","source","recursive","getWorldDirection","force","updateMatrixWorld","invert","updateParents","updateChildren","updateWorldMatrix","_v3","_minTarget","Vector2","_maxTarget","PerspectiveCamera","fov","aspect","near","far","isPerspectiveCamera","zoom","focus","view","filmGauge","filmOffset","updateProjectionMatrix","Object","assign","focalLength","vExtentSlope","getFilmHeight","RAD2DEG","atan","tan","DEG2RAD","distance","minTarget","maxTarget","getViewBounds","fullWidth","fullHeight","enabled","offsetX","offsetY","top","left","skew","getFilmWidth","makePerspective","meta","data","toJSON","PointLightShadow","camera","intensity","bias","normalBias","blurSamples","mapSize","map","mapPass","autoUpdate","needsUpdate","_frustum","_frameExtents","_viewportCount","_viewports","light","shadowCamera","shadowMatrix","setFromMatrixPosition","position","lookAt","multiplyMatrices","setFromProjectionMatrix","multiply","viewportIndex","dispose","clone","toArray","isPointLightShadow","_cubeDirections","_cubeUps","add","up","makeTranslation"],"mappings":"8xjBAEA,MAAMA,QAELC,YAAaC,EAAI,EAAGC,EAAI,EAAGC,EAAI,EAAGC,EAAI,GAErCL,QAAQM,UAAUC,WAAY,EAE9BC,KAAKN,EAAIA,EACTM,KAAKL,EAAIA,EACTK,KAAKJ,EAAIA,EACTI,KAAKH,EAAIA,EAIVI,YAEC,OAAOD,KAAKJ,EAIbK,UAAWC,GAEVF,KAAKJ,EAAIM,EAIVC,aAEC,OAAOH,KAAKH,EAIbM,WAAYD,GAEXF,KAAKH,EAAIK,EAIVT,IAAKC,EAAGC,EAAGC,EAAGC,GAOb,OALAG,KAAKN,EAAIA,EACTM,KAAKL,EAAIA,EACTK,KAAKJ,EAAIA,EACTI,KAAKH,EAAIA,EAEFG,KAIRP,UAAWW,GAOV,OALAJ,KAAKN,EAAIU,EACTJ,KAAKL,EAAIS,EACTJ,KAAKJ,EAAIQ,EACTJ,KAAKH,EAAIO,EAEFJ,KAIRP,KAAMC,GAIL,OAFAM,KAAKN,EAAIA,EAEFM,KAIRP,KAAME,GAIL,OAFAK,KAAKL,EAAIA,EAEFK,KAIRP,KAAMG,GAIL,OAFAI,KAAKJ,EAAIA,EAEFI,KAIRP,KAAMI,GAIL,OAFAG,KAAKH,EAAIA,EAEFG,KAIRP,aAAcY,EAAOH,GAEpB,OAASG,GAER,KAAK,EAAGL,KAAKN,EAAIQ,EAAO,MACxB,KAAK,EAAGF,KAAKL,EAAIO,EAAO,MACxB,KAAK,EAAGF,KAAKJ,EAAIM,EAAO,MACxB,KAAK,EAAGF,KAAKH,EAAIK,EAA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