@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
|
+
System.register(["./roomle-dependency-injection-39798155.legacy.js","./camera-behaviour-363a4e78.legacy.js","./main-thread-to-worker-32b45184.legacy.js","./Object3D-1f141c55.legacy.js","./default-light-setting-07ced87c.legacy.js","./external-objects-01d5a216.legacy.js"],(function(e,t){var n,i,o,s,r,a,l,h,c,d,u,g,m,p,_,f,C,v,b,w,y,M,P,I,x,O,k,S,E,D,A,j,H,R,L,V,B,T,F,G,z,K,U,W,q,N,Z,X,J,Y,Q,$,ee,te,ne,ie,oe,se,re,ae,le,he,ce,de,ue,ge,me,pe,_e,fe,Ce,ve,be,we,ye,Me,Pe,Ie,xe,Oe,ke,Se,Ee,De,Ae,je,He,Re,Le,Ve,Be,Te,Fe,Ge,ze,Ke,Ue,We,qe,Ne,Ze,Xe,Je,Ye,Qe,$e,et,tt,nt,it;return{setters:[function(e){n=e._,i=e.i,o=e.b,s=e.c,r=e.d,a=e.e,l=e.s,h=e.m,c=e.B,d=e.f,u=e.g,g=e.h,m=e.k,p=e.j,_=e.l,f=e.n,C=e.C,v=e.o,b=e.p,w=e.S,y=e.M,M=e.W,P=e.q,I=e.F,x=e.r,O=e.N,k=e.t,S=e.u,E=e.v,D=e.P,A=e.E,j=e.w,H=e.x,R=e.y,L=e.z,V=e.G,B=e.H,T=e.J,F=e.K,G=e.O,z=e.Q,K=e.T,U=e.U,W=e.V,q=e.X,N=e.Y,Z=e.Z,X=e.$,J=e.a0,Y=e.a1,Q=e.a2,$=e.A,ee=e.a3,te=e.a4,ne=e.a5,ie=e.a6,oe=e.a7},function(e){se=e.R,re=e.b,ae=e.S,le=e.P,he=e.c,ce=e.B,de=e.D,ue=e.C,ge=e.F,me=e.T},function(e){pe=e.x,_e=e.B,fe=e.Y,Ce=e.ak,ve=e.e,be=e.bM,we=e.k,ye=e._,Me=e.an,Pe=e.a0,Ie=e.H,xe=e.J,Oe=e.R,ke=e.aM,Se=e.a,Ee=e.bN,De=e.bO,Ae=e.V,je=e.Q,He=e.bK,Re=e.aK,Le=e.bP,Ve=e.bQ,Be=e.bR,Te=e.aN,Fe=e.ao,Ge=e.bS,ze=e.aL,Ke=e.bT,Ue=e.bU},function(e){We=e.c,qe=e.V,Ne=e.M,Ze=e.W,Xe=e.a,Je=e.S,Ye=e.b,Qe=e.d,$e=e.O,et=e.R,tt=e.D},function(e){nt=e.D},function(e){it=e.c}],execute:function(){class ot{constructor(e){this._mergeThreshold=3,this._componentsToMerge=new st,this._mergeInProgress=!1,this._components=new Map,this._previews=new Map,this._componentNumberOfPossibleChildren=new Map,this._creator_=e,this._getKernelAccess().addConfiguratorListener(this),this._componentFactory=se()}get materialQueue(){return this.getMeshGenerator().materialQueue}_getKernelAccess(){return o.lookup("planner-kernel-access",this._creator_)}_applyMeshTransform(e,t,n,i,o,r,a){if(i){const e=t.userData.transform=s(i);n&&(t.userData.transform=e),t.applyMatrix4(e)}this._applyMeshUVTransform(t,n,o,a),this._addMeshAnimations(e,t,r)}_applyMeshUVTransform(e,t,n,i){if(6!==(null==n?void 0:n.length)||r(n))t&&(t.uvTransform=void 0),i&&(e.geometry=i);else{const o=a(n);t&&(t.uvTransform=o);const s=null!=i?i:e.geometry;if(s&&s.attributes.uv){const t=s.clone();t.attributes.uv.applyMatrix4(o),e.geometry=t}}}_addMeshAnimations(e,t,n){var i;n||(t.userData.animations=void 0);const o=new Map,r=this.getComponent(e);for(const e in n){const a={matrix:s(n[e].matrix),visible:n[e].visibility,initial:n[e].initial};o.set(e,a);let h=a.initial;if(null==r?void 0:r.animationValues){const t=e.split(":");h=(null===(i=null==r?void 0:r.animationValues)||void 0===i?void 0:i.get(t[0]))===t[1]}if(h){if(t.userData.transform){const e=t.userData.transform.clone().multiply(a.matrix);l(t,e)}t.visible=a.visible}}t.userData.animationMatrixMap=o}_animateComponent(e,t,n,i,o){const s=t.split(":")[1];e.animateMeshes&&e.animateMeshes(s,n,i,o,this._invalidateRenderCallback)}updateAnimationParameters(e,t){const n=[];for(const e of t)e.key.startsWith("animation:")&&n.push(e);if(0===n.length)return;const i=Array.isArray(e)?e:[e];for(const e of i){const t=this.getComponentFromElementId(e);if(null==t?void 0:t.animationValues)for(const e of n){const n=e.key.split(":")[1],i=t.animationValues.get(n);i&&(e.value=i)}else if(t){t.animationValues=new Map;for(const e of n){const n=e.key.split(":")[1];t.animationValues.set(n,e.value)}}}}changeAnimationValue(e,t,n,i,o){const s=this.getComponentFromElementId(e);s&&(i?s.traverse(e=>{e.id&&this._changeAnimationValue(e,t,n,o)}):this._changeAnimationValue(s,t,n,o))}_changeAnimationValue(e,t,n,i){e.animationValues||(e.animationValues=new Map);const o=t.split(":")[1],s=e.animationValues.get(o);e.animationValues.set(o,n),this._animateComponent(e,t,s,n,i)}getComponentFromElementId(e){let t=this.getComponent(e);if(!t){const n=this._getKernelAccess().kernelInstance.getRootPlanComponentIdFromObjectId(e);t=this.getComponent(n)}return t||console.warn("component not found!",e),t}_addMeshToSubPart(e,t,n,i,o,s,r,a,l,h,c){const d=this._generateMesh(e,t,n,s,r,a,l,void 0,void 0,h);this._applyMeshTransform(e,d,null,i,o,c),this._subPartObject.add(d)}_addMeshToComponent(e,t,n,i,o,s,r,a,l,h,c,d,u){if(this._subPartGuard&&this._subPartGuard.info===e)return void this._addMeshToSubPart(e,null,i,null,null,r,a,l,h,d,u);const g=this.getComponent(e);if(!g)return;const m=this._componentFactory.isPreview(g),p=this._generateMesh(e,n,m?null:i,r,a,l,h,void 0,void 0,d);p.userData.meshId=t,p.userData.geometryId=n,p.userData.materialId=i,this._applyMeshTransform(e,p,p.userData,o,s,u),m&&p.layers.set(5),g&&g.addMesh(p),g.meshes.length>this._mergeThreshold&&this._componentsToMerge.set(e,g.meshes.length)}_changeMeshOfComponent(e,t,n,i,o,s,r,a){const l=this.getComponent(e);if(!l)return;const h=l.getMeshById(t);if(h){h.userData.geometryId!==n&&console.warn("Geometry of mesh has changed!"),h.userData.materialId=i,h.userData.materialAttributes=r;const t=h.material.clone();this._configuratorMeshGenerator.setMaterial(h,i,void 0,r).then(()=>{this._requestRenderSceneUpdateCallback&&this._requestRenderSceneUpdateCallback()}),t.opacity!==h.material.opacity&&this._requestRenderCallback&&this._requestRenderCallback(),o&&(h.position.set(0,0,0),h.scale.set(1,1,1),h.rotation.set(0,0,0));const l=this._configuratorMeshGenerator.getGeometry(n);this._applyMeshTransform(e,h,h.userData,o,s,a,l)}}_removeMeshFromComponent(e,t){const n=this.getComponent(e);n&&n.removeMeshById(t)}getComponent(e){let t=this._components.get(e);return t||(t=this._previews.get(e.toString()),t)?t:null}getNumberOfPossibleChildrenForComponent(e){if(this._componentNumberOfPossibleChildren.has(e))return this._componentNumberOfPossibleChildren.get(e);const t=this._getKernelAccess().kernelInstance.getPlanComponentPossibleChildren(e).length;return this._componentNumberOfPossibleChildren.set(e,t),t}tryToMergeComponents(){this._initData.moc||this._mergeInProgress||(this._mergeInProgress=!0,this._componentsToMerge.size,this._requestMergeComponents())}_requestMergeComponents(){window.requestIdleCallback(this._mergeNextComponent.bind(this))}_mergeNextComponent(){if(this._componentsToMerge.size>0){const e=this._componentsToMerge.largestValue();this._componentsToMerge.delete(e),this._mergeComponent(e),this._requestMergeComponents()}else this._mergeInProgress=!1,this._geometriesMerged&&this._geometriesMerged(),this._components.forEach(e=>{e.loadingMesh&&console.warn("component still has loading mesh: ",e.hash)})}_mergeComponent(e){const t=this._components.get(e);if(t&&!(t.meshes.length<=this._mergeThreshold))if(this._cacheHolder.componentCache.has(t.hash)){const e=this._cacheHolder.componentCache.get(t.hash).meshes;t.replaceMeshes(e)}else{const e=new Map,n=[],i=[];t.meshes.forEach(t=>{const o=t.userData.materialId;if(!o)return void console.warn("mesh has no material id set");if(!e.has(o)){const i=new pe(new _e,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=h([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),c.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 fe)}Editor3dComponentCreated(e,t,n,i,o){i&&(this._configuratorContext.rootComponentId=e);let s=null;this._components.has(e)?(s=this._components.get(e),s.removeAllMeshes()):(s=this._componentFactory.create(e,t,n,o,i),s.layers.set(3)),this._components.set(e,s),this._addComponent(s)}Editor3dComponentDocked(e,t,n,i,o){this.dockComponent(e,t,n,i,o)}Editor3dEndConstruction(e){if(this._subPartGuard&&this._subPartGuard.info===e)return void this._subPartGuard.resolve(this._subPartObject);const t=this._getKernelAccess().kernelInstance.getComponent(e),n=this._components.get(e);n&&(n.computeBoundingBox(t.boxForMeasurement),n.boundingBoxMesh&&this._listener&&this._listener.addComponentHandlers(n));let i=this._previews.get(e.toString());i&&i.computeBoundingBox(t.boxForMeasurement,!0)}Editor3dGeometryReady(e){const t=this._components.get(e);t&&t.loadingFinished()}Editor3dGeometryNotReady(e){const t=this._components.get(e);t&&t.loading()}Editor3dPlanObjectConstructionDone(e){const t=this._getKernelAccess().kernelInstance.getPlanObject(e),n=[t,this._getKernelAccess().kernelInstance.getFullPartList(),this._getKernelAccess().kernelInstance.getHashOfConfiguration(e),this._getKernelAccess().kernelInstance.getComponentId(t.rootPlanComponentId)];d.finishOperation(2,n),this._updatePlanObject(t,!1),this._listener&&this._listener.planObjectConstructionDone(t)}Editor3dPreviewConstructionDone(e,t){let n=!1;this._previews.forEach(e=>{null!==e.parent&&(this._listener&&(this._componentFactory.isPreviewLine(e)?this._listener.addPreviewLineHandlers(e):this._listener.addPreviewHandlers(e)),n=!0)}),this._listener&&this._listener.previewConstructionDone(this._components.get(e),n)}Editor3dSetPreviewLineAssociations(e,t){let n=this._previews.get(t.toString());if(n.clear(),!n)return;let i=this._componentFactory.createPreviewLine(n,this._creator_),o=this._components.get(this._configuratorContext.rootComponentId);for(let t=0;t<e.length;t++){let n;n=0===t?i:i.clonePreviewLine(t),n.name="Preview Line",n.parentDockId=e[t].parentDockId,n.parentId=e[t].parentId,n.childDockId=e[t].childDockId,n.childId=e[t].childId,n.docklineRotation=u(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===g&&(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 m(e.boxForMeasurement)}else if(this._configuratorContext.rootComponentId){const e=this._components.get(this._configuratorContext.rootComponentId);return(new Ce).setFromObject(e)}return null}getBoundingBoxOfGeometry(){if(this._configuratorContext.planObjectId){const e=this._getKernelAccess().kernelInstance.getPlanObject(this._configuratorContext.planObjectId);if(e&&e.boxOfGeometry)return m(e.boxOfGeometry)}else if(this._configuratorContext.rootComponentId){const e=this._components.get(this._configuratorContext.rootComponentId);return(new Ce).setFromObject(e)}return null}getBoundingBoxWithPreviews(){const e=this._components.get(this._configuratorContext.rootComponentId);return e?(new Ce).setFromObject(e):null}hasPreviews(){return this._previews.size>0}clearRootComponent(){var e;null===(e=this._components.get(this._configuratorContext.rootComponentId))||void 0===e||e.hoverOff()}debugSceneGraph(e){e?this._components.has(e)?this._components.get(e):this._previews.has(e.toString())&&this._previews.get(e.toString()):this._configuratorContext}getComponentsForIds(e){let t=[];return e.forEach(e=>{const n=this._components.get(e);n&&t.push(n)}),t}getComponents(){return Array.from(this._components.values())}getPreviews(){return Array.from(this._previews.values())}hasPreviewLines(){for(const e of this._previews.values())if(this._componentFactory.isPreviewLine(e))return!0;return!1}isPreviewLine(e){return this._componentFactory.isPreviewLine(e)}isPreview(e){return this._componentFactory.isPreview(e)}setGeometriesMergedListener(e){this._geometriesMerged=e}removeGeometriesMergedListener(){this._geometriesMerged=void 0}setMergeThreshold(e){this._mergeThreshold=e}_generateMesh(e=0,t=null,n,i,o,s,r,a,l,h){return this._configuratorMeshGenerator.generateMesh(e,t,n,i,o,s,r,!1,h)}_setMaterial(e,t,n){this._configuratorMeshGenerator.setMaterial(e,t)}constructComponents(e){this._getKernelAccess().kernelInstance.requestPlanObjectConstruction(e)}requestSubPartConstruction(e){return this._subPartGuard=new p(e),this._getKernelAccess().requestPlanComponentConstruction(e,!1),this._subPartGuard.wait()}getMeshGenerator(){return this._configuratorMeshGenerator}setRequestRenderCallback(e){this._requestRenderCallback=e}setRequestRenderSceneUpdateCallback(e){this._requestRenderSceneUpdateCallback=e}setInvalidateRenderCallback(e){this._invalidateRenderCallback=e}}e("a",ot),n([i],ot.prototype,"_configuratorMeshGenerator",void 0),n([i],ot.prototype,"_configuratorContext",void 0),n([i],ot.prototype,"_cacheHolder",void 0),n([i],ot.prototype,"_initData",void 0);class st extends Map{largestValue(){let e=this.entries().next().value[0],t=0;return this.forEach((n,i)=>{n>t&&(e=i,t=n)}),e}}var rt=function(){return ve((function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;we(this,e),e.prototype.isVector4=!0,this.x=t,this.y=n,this.z=i,this.w=o}),[{key:"width",get:function(){return this.z},set:function(e){this.z=e}},{key:"height",get:function(){return this.w},set:function(e){this.w=e}},{key:"set",value:function(e,t,n,i){return this.x=e,this.y=t,this.z=n,this.w=i,this}},{key:"setScalar",value:function(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}},{key:"setX",value:function(e){return this.x=e,this}},{key:"setY",value:function(e){return this.y=e,this}},{key:"setZ",value:function(e){return this.z=e,this}},{key:"setW",value:function(e){return this.w=e,this}},{key:"setComponent",value:function(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}},{key:"getComponent",value:function(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)}}},{key:"clone",value:function(){return new this.constructor(this.x,this.y,this.z,this.w)}},{key:"copy",value:function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=void 0!==e.w?e.w:1,this}},{key:"add",value:function(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}},{key:"addScalar",value:function(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}},{key:"addVectors",value:function(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}},{key:"addScaledVector",value:function(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}},{key:"sub",value:function(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}},{key:"subScalar",value:function(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}},{key:"subVectors",value:function(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}},{key:"multiply",value:function(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}},{key:"multiplyScalar",value:function(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}},{key:"applyMatrix4",value:function(e){var 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}},{key:"divide",value:function(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this.w/=e.w,this}},{key:"divideScalar",value:function(e){return this.multiplyScalar(1/e)}},{key:"setAxisAngleFromQuaternion",value:function(e){this.w=2*Math.acos(e.w);var 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}},{key:"setAxisAngleFromRotationMatrix",value:function(e){var t,n,i,o,s=e.elements,r=s[0],a=s[4],l=s[8],h=s[1],c=s[5],d=s[9],u=s[2],g=s[6],m=s[10];if(Math.abs(a-h)<.01&&Math.abs(l-u)<.01&&Math.abs(d-g)<.01){if(Math.abs(a+h)<.1&&Math.abs(l+u)<.1&&Math.abs(d+g)<.1&&Math.abs(r+c+m-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;var p=(r+1)/2,_=(c+1)/2,f=(m+1)/2,C=(a+h)/4,v=(l+u)/4,b=(d+g)/4;return p>_&&p>f?p<.01?(n=0,i=.707106781,o=.707106781):(i=C/(n=Math.sqrt(p)),o=v/n):_>f?_<.01?(n=.707106781,i=0,o=.707106781):(n=C/(i=Math.sqrt(_)),o=b/i):f<.01?(n=.707106781,i=.707106781,o=0):(n=v/(o=Math.sqrt(f)),i=b/o),this.set(n,i,o,t),this}var w=Math.sqrt((g-d)*(g-d)+(l-u)*(l-u)+(h-a)*(h-a));return Math.abs(w)<.001&&(w=1),this.x=(g-d)/w,this.y=(l-u)/w,this.z=(h-a)/w,this.w=Math.acos((r+c+m-1)/2),this}},{key:"setFromMatrixPosition",value:function(e){var t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this.w=t[15],this}},{key:"min",value:function(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}},{key:"max",value:function(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}},{key:"clamp",value:function(e,t){return this.x=We(this.x,e.x,t.x),this.y=We(this.y,e.y,t.y),this.z=We(this.z,e.z,t.z),this.w=We(this.w,e.w,t.w),this}},{key:"clampScalar",value:function(e,t){return this.x=We(this.x,e,t),this.y=We(this.y,e,t),this.z=We(this.z,e,t),this.w=We(this.w,e,t),this}},{key:"clampLength",value:function(e,t){var n=this.length();return this.divideScalar(n||1).multiplyScalar(We(n,e,t))}},{key:"floor",value:function(){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}},{key:"ceil",value:function(){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}},{key:"round",value:function(){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}},{key:"roundToZero",value:function(){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}},{key:"negate",value:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}},{key:"dot",value:function(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}},{key:"lengthSq",value:function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}},{key:"length",value:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}},{key:"manhattanLength",value:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}},{key:"normalize",value:function(){return this.divideScalar(this.length()||1)}},{key:"setLength",value:function(e){return this.normalize().multiplyScalar(e)}},{key:"lerp",value:function(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}},{key:"lerpVectors",value:function(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}},{key:"equals",value:function(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}},{key:"fromArray",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}},{key:"toArray",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}},{key:"fromBufferAttribute",value:function(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}},{key:"random",value:function(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}},{key:Symbol.iterator,value:be().mark((function e(){return be().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.x;case 2:return e.next=4,this.y;case 4:return e.next=6,this.z;case 6:return e.next=8,this.w;case 8:case"end":return e.stop()}}),e,this)}))}])}(),at=new qe,lt=new qe,ht=new Ne,ct=function(){return ve((function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new qe(1,0,0),n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;we(this,e),this.isPlane=!0,this.normal=t,this.constant=n}),[{key:"set",value:function(e,t){return this.normal.copy(e),this.constant=t,this}},{key:"setComponents",value:function(e,t,n,i){return this.normal.set(e,t,n),this.constant=i,this}},{key:"setFromNormalAndCoplanarPoint",value:function(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}},{key:"setFromCoplanarPoints",value:function(e,t,n){var i=at.subVectors(n,t).cross(lt.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(i,e),this}},{key:"copy",value:function(e){return this.normal.copy(e.normal),this.constant=e.constant,this}},{key:"normalize",value:function(){var e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}},{key:"negate",value:function(){return this.constant*=-1,this.normal.negate(),this}},{key:"distanceToPoint",value:function(e){return this.normal.dot(e)+this.constant}},{key:"distanceToSphere",value:function(e){return this.distanceToPoint(e.center)-e.radius}},{key:"projectPoint",value:function(e,t){return t.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}},{key:"intersectLine",value:function(e,t){var n=e.delta(at),i=this.normal.dot(n);if(0===i)return 0===this.distanceToPoint(e.start)?t.copy(e.start):null;var o=-(e.start.dot(this.normal)+this.constant)/i;return o<0||o>1?null:t.copy(e.start).addScaledVector(n,o)}},{key:"intersectsLine",value:function(e){var t=this.distanceToPoint(e.start),n=this.distanceToPoint(e.end);return t<0&&n>0||n<0&&t>0}},{key:"intersectsBox",value:function(e){return e.intersectsPlane(this)}},{key:"intersectsSphere",value:function(e){return e.intersectsPlane(this)}},{key:"coplanarPoint",value:function(e){return e.copy(this.normal).multiplyScalar(-this.constant)}},{key:"applyMatrix4",value:function(e,t){var n=t||ht.getNormalMatrix(e),i=this.coplanarPoint(at).applyMatrix4(e),o=this.normal.applyMatrix3(n).normalize();return this.constant=-i.dot(o),this}},{key:"translate",value:function(e){return this.constant-=e.dot(this.normal),this}},{key:"equals",value:function(e){return e.normal.equals(this.normal)&&e.constant===this.constant}},{key:"clone",value:function(){return(new this.constructor).copy(this)}}])}(),dt=new Je,ut=new qe,gt=function(){return ve((function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new ct,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new ct,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new ct,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new ct,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:new ct,r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:new ct;we(this,e),this.planes=[t,n,i,o,s,r]}),[{key:"set",value:function(e,t,n,i,o,s){var 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}},{key:"copy",value:function(e){for(var t=this.planes,n=0;n<6;n++)t[n].copy(e.planes[n]);return this}},{key:"setFromProjectionMatrix",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ze,n=this.planes,i=e.elements,o=i[0],s=i[1],r=i[2],a=i[3],l=i[4],h=i[5],c=i[6],d=i[7],u=i[8],g=i[9],m=i[10],p=i[11],_=i[12],f=i[13],C=i[14],v=i[15];if(n[0].setComponents(a-o,d-l,p-u,v-_).normalize(),n[1].setComponents(a+o,d+l,p+u,v+_).normalize(),n[2].setComponents(a+s,d+h,p+g,v+f).normalize(),n[3].setComponents(a-s,d-h,p-g,v-f).normalize(),n[4].setComponents(a-r,d-c,p-m,v-C).normalize(),t===Ze)n[5].setComponents(a+r,d+c,p+m,v+C).normalize();else{if(t!==Xe)throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+t);n[5].setComponents(r,c,m,C).normalize()}return this}},{key:"intersectsObject",value:function(e){if(void 0!==e.boundingSphere)null===e.boundingSphere&&e.computeBoundingSphere(),dt.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{var t=e.geometry;null===t.boundingSphere&&t.computeBoundingSphere(),dt.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(dt)}},{key:"intersectsSprite",value:function(e){return dt.center.set(0,0,0),dt.radius=.7071067811865476,dt.applyMatrix4(e.matrixWorld),this.intersectsSphere(dt)}},{key:"intersectsSphere",value:function(e){for(var t=this.planes,n=e.center,i=-e.radius,o=0;o<6;o++)if(t[o].distanceToPoint(n)<i)return!1;return!0}},{key:"intersectsBox",value:function(e){for(var t=this.planes,n=0;n<6;n++){var i=t[n];if(ut.x=i.normal.x>0?e.max.x:e.min.x,ut.y=i.normal.y>0?e.max.y:e.min.y,ut.z=i.normal.z>0?e.max.z:e.min.z,i.distanceToPoint(ut)<0)return!1}return!0}},{key:"containsPoint",value:function(e){for(var t=this.planes,n=0;n<6;n++)if(t[n].distanceToPoint(e)<0)return!1;return!0}},{key:"clone",value:function(){return(new this.constructor).copy(this)}}])}(),mt=new Ye,pt=new qe,_t=new qe,ft=function(){return ve((function e(t){we(this,e),this.camera=t,this.intensity=1,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new Qe(512,512),this.map=null,this.mapPass=null,this.matrix=new Ye,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new gt,this._frameExtents=new Qe(1,1),this._viewportCount=1,this._viewports=[new rt(0,0,1,1)]}),[{key:"getViewportCount",value:function(){return this._viewportCount}},{key:"getFrustum",value:function(){return this._frustum}},{key:"updateMatrices",value:function(e){var t=this.camera,n=this.matrix;pt.setFromMatrixPosition(e.matrixWorld),t.position.copy(pt),_t.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(_t),t.updateMatrixWorld(),mt.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(mt),n.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),n.multiply(mt)}},{key:"getViewport",value:function(e){return this._viewports[e]}},{key:"getFrameExtents",value:function(){return this._frameExtents}},{key:"dispose",value:function(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}},{key:"copy",value:function(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}},{key:"clone",value:function(){return(new this.constructor).copy(this)}},{key:"toJSON",value:function(){var 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}}])}(),Ct=function(e){function t(){var e;return we(this,t),(e=Pe(this,t)).isCamera=!0,e.type="Camera",e.matrixWorldInverse=new Ye,e.projectionMatrix=new Ye,e.projectionMatrixInverse=new Ye,e.coordinateSystem=Ze,e}return ye(t,e),ve(t,[{key:"copy",value:function(e,n){return Me(t,"copy",this,3)([e,n]),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this.coordinateSystem=e.coordinateSystem,this}},{key:"getWorldDirection",value:function(e){return Me(t,"getWorldDirection",this,3)([e]).negate()}},{key:"updateMatrixWorld",value:function(e){Me(t,"updateMatrixWorld",this,3)([e]),this.matrixWorldInverse.copy(this.matrixWorld).invert()}},{key:"updateWorldMatrix",value:function(e,n){Me(t,"updateWorldMatrix",this,3)([e,n]),this.matrixWorldInverse.copy(this.matrixWorld).invert()}},{key:"clone",value:function(){return(new this.constructor).copy(this)}}])}($e),vt=new qe,bt=new Qe,wt=new Qe,yt=function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:50,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.1,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:2e3;return we(this,t),(e=Pe(this,t)).isPerspectiveCamera=!0,e.type="PerspectiveCamera",e.fov=n,e.zoom=1,e.near=o,e.far=s,e.focus=10,e.aspect=i,e.view=null,e.filmGauge=35,e.filmOffset=0,e.updateProjectionMatrix(),e}return ye(t,e),ve(t,[{key:"copy",value:function(e,n){return Me(t,"copy",this,3)([e,n]),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}},{key:"setFocalLength",value:function(e){var t=.5*this.getFilmHeight()/e;this.fov=2*et*Math.atan(t),this.updateProjectionMatrix()}},{key:"getFocalLength",value:function(){var e=Math.tan(.5*tt*this.fov);return.5*this.getFilmHeight()/e}},{key:"getEffectiveFOV",value:function(){return 2*et*Math.atan(Math.tan(.5*tt*this.fov)/this.zoom)}},{key:"getFilmWidth",value:function(){return this.filmGauge*Math.min(this.aspect,1)}},{key:"getFilmHeight",value:function(){return this.filmGauge/Math.max(this.aspect,1)}},{key:"getViewBounds",value:function(e,t,n){vt.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),t.set(vt.x,vt.y).multiplyScalar(-e/vt.z),vt.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),n.set(vt.x,vt.y).multiplyScalar(-e/vt.z)}},{key:"getViewSize",value:function(e,t){return this.getViewBounds(e,bt,wt),t.subVectors(wt,bt)}},{key:"setViewOffset",value:function(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()}},{key:"clearViewOffset",value:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}},{key:"updateProjectionMatrix",value:function(){var e=this.near,t=e*Math.tan(.5*tt*this.fov)/this.zoom,n=2*t,i=this.aspect*n,o=-.5*i,s=this.view;if(null!==this.view&&this.view.enabled){var r=s.fullWidth,a=s.fullHeight;o+=s.offsetX*i/r,t-=s.offsetY*n/a,i*=s.width/r,n*=s.height/a}var l=this.filmOffset;0!==l&&(o+=e*l/this.getFilmWidth()),this.projectionMatrix.makePerspective(o,o+i,t,t-n,e,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}},{key:"toJSON",value:function(e){var n=Me(t,"toJSON",this,3)([e]);return n.object.fov=this.fov,n.object.zoom=this.zoom,n.object.near=this.near,n.object.far=this.far,n.object.focus=this.focus,n.object.aspect=this.aspect,null!==this.view&&(n.object.view=Object.assign({},this.view)),n.object.filmGauge=this.filmGauge,n.object.filmOffset=this.filmOffset,n}}])}(Ct),Mt=new Ye,Pt=new qe,It=new qe,xt=function(e){function t(){var e;return we(this,t),(e=Pe(this,t,[new yt(90,1,.5,500)])).isPointLightShadow=!0,e._frameExtents=new Qe(4,2),e._viewportCount=6,e._viewports=[new rt(2,1,1,1),new rt(0,1,1,1),new rt(3,1,1,1),new rt(1,1,1,1),new rt(3,0,1,1),new rt(1,0,1,1)],e._cubeDirections=[new qe(1,0,0),new qe(-1,0,0),new qe(0,0,1),new qe(0,0,-1),new qe(0,1,0),new qe(0,-1,0)],e._cubeUps=[new qe(0,1,0),new qe(0,1,0),new qe(0,1,0),new qe(0,1,0),new qe(0,0,1),new qe(0,0,-1)],e}return ye(t,e),ve(t,[{key:"updateMatrices",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.camera,i=this.matrix,o=e.distance||n.far;o!==n.far&&(n.far=o,n.updateProjectionMatrix()),Pt.setFromMatrixPosition(e.matrixWorld),n.position.copy(Pt),It.copy(n.position),It.add(this._cubeDirections[t]),n.up.copy(this._cubeUps[t]),n.lookAt(It),n.updateMatrixWorld(),i.makeTranslation(-Pt.x,-Pt.y,-Pt.z),Mt.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),this._frustum.setFromProjectionMatrix(Mt)}}])}(ft);class Ot extends Ie{get lightsOn(){return this._lightsOn}constructor(){super(),this.children=[],this._availableShadowMaps=[],this._lightsOn=!0;for(let e=0;e<1;e++){const e=new xe(90,1,.5,500),t=new xt(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 kt extends Oe{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 _(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=f();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 St=e("G","Ceiling Lights");class Et extends ot{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 Ie,this._constructionGroup.name="Construction",this._ceilingGroup=new Ie,this._ceilingGroup.name="Ceiling",this._floorGroup=new Ie,this._floorGroup.name="Floor",this._ceilingLightsGroup=new Ot,this._ceilingLightsGroup.name=St,this._lampLightsGroup=new Ie,this._lampLightsGroup.name="Lamp Lights",this._measurementLineGroup=new Ie,this._measurementLineGroup.name="Measurement Line",this._wallAtticsGroup=new Ie,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 C?this._handleConfiguratorConstructionPlanObjectViewModel(e):e instanceof v?this._handleConfiguratorPlanObjectViewModel(e):e instanceof b?this._handleConstructionPlanObjectViewModel(e):e instanceof w?this._handleStaticPlanObjectViewModel(e):e instanceof y?this._handleMeasurementLinePlanElementViewModel(e):e instanceof M?this._handleWallAtticPlanElementViewModel(e):e instanceof P?this._handleWallPlanElementViewModel(e):e instanceof I?this._handleFloorPlanElementViewModel(e):e instanceof x?this._handleCeilingPlanElementViewModel(e):e instanceof O&&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===ke.CAMERA_2D),this._configurableConstructionPlanObjectViewModels.push(e)}_handleConstructionPlanObjectViewModel(e){this._initData.edit&&this._plannerSceneEventHandler.addConstructionPlanObjectHandlers(e),e.setTopView(this._cameraType===ke.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===ke.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===ke.CAMERA_2D),this._wallAtticsPlanObjectViewModels.push(e),this._wallAtticsGroup.add(e.getContainer())}_handleWallPlanElementViewModel(e){this._initData.edit&&this._plannerSceneEventHandler.addWallHandlers(e),e.setTopView(this._cameraType===ke.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===ke.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(k(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 S(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 E(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 kt(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===ke.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 v&&(e.isRootComponent?n.addRootComponent(e):n.addChildEntityComponent(e),this._initData.edit&&(n instanceof C?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 m(e.getBounds())}catch(e){console.error(e)}const t=new Ce;t.expandByObject(this._constructionGroup);for(const e of this._staticPlanObjectViewModels)t.expandByObject(e.getContainer());for(const e of this._configurablePlanObjectViewModels)t.expandByObject(e.getContainer());for(const e of this._configurableConstructionPlanObjectViewModels)t.expandByObject(e.getContainer());return t}getBoundingBoxOfGeometry(){return this.getBoundingBox()}setPlannerSceneEventHandler(e){this._plannerSceneEventHandler=e}getStaticPlanObjectViewModels(){return this._staticPlanObjectViewModels}getConfigurablePlanObjectViewModels(){return this._configurablePlanObjectViewModels}getConfigurableConstructionPlanObjectViewModels(){return this._configurableConstructionPlanObjectViewModels}getConstructionPlanObjectViewModels(){return this._constructionPlanObjectViewModels}getWallPlanObjectViewModels(){return this._wallPlanObjectViewModels}getNodePlanObjectViewModels(){return this._nodePlanObjectViewModels}getFloorPlanObjectViewModels(){return this._floorPlanObjectViewModels}getMeasurementLineObjectViewModels(){return this._measurementLinePlanObjectViewModels}getWallAtticsObjectViewModels(){return this._wallAtticsPlanObjectViewModels}_generateMesh(e=0,t=null,n,i,o,s,r,a,l,h){return this._plannerMeshGenerator.generateMesh(e,t,n,i,o,s,r,a,l,h)}_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 D&&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 v&&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 C?this._removeObject(this._configurableConstructionPlanObjectViewModels,n):n instanceof v?(this._detachPlanObjectViewModelFromComponent(n),this._removeObject(this._configurablePlanObjectViewModels,n)):n instanceof b?this._removeObject(this._constructionPlanObjectViewModels,n):n instanceof w?this._removeObject(this._staticPlanObjectViewModels,n):n instanceof I?this._removeObject(this._floorPlanObjectViewModels,n):n instanceof P?this._removeObject(this._wallPlanObjectViewModels,n):n instanceof O?this._removeObject(this._nodePlanObjectViewModels,n):n instanceof y?this._removeObject(this._measurementLinePlanObjectViewModels,n):n instanceof M&&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 Ce;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===ke.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===ke.CAMERA_2D)),this._measurementLinePlanObjectViewModels.forEach(e=>e.setTopView(this._cameraType===ke.CAMERA_2D)),this._wallAtticsPlanObjectViewModels.forEach(e=>e.setTopView(this._cameraType===ke.CAMERA_2D)),this._nodePlanObjectViewModels.forEach(e=>e.setTopView(this._cameraType===ke.CAMERA_2D)),this._configurablePlanObjectViewModels.forEach(e=>e.setTopView(this._cameraType===ke.CAMERA_2D)),this._constructionPlanObjectViewModels.forEach(e=>t.push(e.setTopView(this._cameraType===ke.CAMERA_2D))),this._configurableConstructionPlanObjectViewModels.forEach(e=>t.push(e.setTopView(this._cameraType===ke.CAMERA_2D))),await Promise.all(t)}get cameraType(){return this._cameraType}setNodeZoom(e){e=Math.min(4,e),this._nodeZoom=e;for(const t of this._nodePlanObjectViewModels)t.setZoom(e);for(const t of this._measurementLinePlanObjectViewModels)t.getPoint1Draggable().scale.setScalar(e),t.getPoint2Draggable().scale.setScalar(e)}planCleared(){[this._configurablePlanObjectViewModels,this._configurableConstructionPlanObjectViewModels,this._staticPlanObjectViewModels,this._wallPlanObjectViewModels,this._measurementLinePlanObjectViewModels,this._nodePlanObjectViewModels,this._floorPlanObjectViewModels,this._constructionPlanObjectViewModels,this._wallAtticsPlanObjectViewModels].forEach(e=>{e.forEach(e=>e.remove()),e.length=0})}requestCatalogItem(e){}}e("P",Et),n([i],Et.prototype,"_plannerMeshGenerator",void 0),n([i],Et.prototype,"_roomlePlannerUiCallback",void 0);const Dt=e("b",{RAYCASTER_FLOOR:.8,FLOOR:.9,WALL:.95,DEFAULT:1,CONSTRUCTION:1,COMPONENT:2,PREVIEW:3,PREVIEW_LINE:4}),At=V(30);class jt extends A{constructor(e,t,n,i){super(),this._offset=new Se(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 Ee,this._raycaster.layers.disableAll(),this._inputManager=n,this._addInputListeners(n),this._planeBottom=new De(new Se(0,1,0)),this._planeFront=new De(new Se(0,0,1)),this._planeSide=new De(new Se(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 Ae(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:j((new Ce).setFromObject(e.object),(new Ce).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 Ae(e.x,e.y),this._camera);let t,n=new Se(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 Se(0,0,0),o=new Se(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>=-At&&n<=At?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 H(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 Se).y-this._rootComponentPosition.y,this._planeSide.constant=2*-e.boundingBox.getSize(new Se).x+e.boundingBox.getCenter(new Se).x,this._camera.userData.yaw>0&&(this._planeSide.constant*=-1),this._bounds&&(this._planeFront.constant=this._bounds.z/2+e.boundingBox.getCenter(new Se).z))}_calculateOffset(e){e&&e.boundingBox&&(this._offset.copy(e.boundingBox.getCenter(new Se)),this._offset.applyQuaternion(e.getWorldQuaternion(new je)))}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 pe&&e.geometry.computeBoundingBox()}}clear(){this._currentDrag&&R(this._currentDrag),this._currentHover&&R(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 De,n=new Se;return n.copy(this._camera.position).normalize(),t.setFromNormalAndCoplanarPoint(n,this._object.position),this._raycaster.setFromCamera(new Ae(e.positionRelative.x,e.positionRelative.y),this._camera),L(this._raycaster.ray.intersectPlane(t,new Se))}enableOnWallSnapping(){this._onWallSnapping=!0}disableOnWallSnapping(){this._onWallSnapping=!1}}class Ht extends A{constructor(e,t,n,i){super(),this._debug=!1,this._dragIn=!1,this._inputManager=i,this._raycastHelper=new jt(t,n,this._inputManager),this._creator_=e}isDragIn(){return this._dragIn}setDragIn(e,t){this._dragIn=e,e?this._inputManager.enableDragIn(t):this._raycastHelper.clear(),this._interaction()}}e("S",Ht);class Rt{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 Lt extends Ht{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 Rt({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 Rt({component:e,resetCamera:t,reason:n}))},this),this._addInputListeners(this._inputManager)}disable(){const e=new He;e.disableAll(),this._raycastHelper.setLayers(e),this._raycastHelper.disableEvents()}enable(){const e=new He;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:Dt.DEFAULT,roomleId:e.runtimeId}),e.meshes.forEach(t=>{this._addComponentHandlers(e,t,{hasListener:!0,priority:Dt.COMPONENT,roomleId:e.runtimeId})})}addComponentDragInHandler(e){this._dragIn&&(this._addComponentHandlers(e,e.boundingBoxMesh,{hasListener:!0,priority:Dt.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=Re(t.userData,{hasListener:!0,priority:Dt.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=Re(t.userData,{hasListener:!0,priority:Dt.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 Rt({preview:e}))}_clickPreviewLine(e){this._dragStartPosition&&(e.position.copy(this._dragStartPosition),this._dragStartPosition=null),this.dispatchEvent(7,new Rt({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 Rt({component:e,type:t})),this._hoveredComponent=e)}_hoverOff(e,t){this._cameraMoving||(this._debug&&e.runtimeId,e.hoverOff(),this._interaction(),this.dispatchEvent(2,new Rt({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 pe){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 Rt({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 Rt({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 Rt({component:e,preview:this._hoveredPreview})),this._interaction()}}_interaction(e){this.dispatchEvent(0,new Rt({forceRender:e}))}hasSelection(){return this._selectionHandler.hasSelection()}update(e,t,n){this._raycastHelper.update(e,t,n)}isDragIn(){return this._dragIn}isDragging(){return null!=this._draggedComponent}setRootComponentId(e){this._raycastHelper.setRootComponentId(e)}cancelSelection(e){return this._selectionHandler.setSelectionMode("standard"),this._selectionHandler.cancelSelection(e)}setSelectionMode(e){this._selectionHandler.setSelectionMode(e)}getSelectionMode(){return this._selectionHandler.getSelectionMode()}getSelectedRuntimeComponentIds(){return this._selectionHandler.getSelectedRuntimeComponentIds()}setCameraMoving(e){e&&this._hoveredComponent&&this._hoverOff(this._hoveredComponent,0),this._cameraMoving=e}setCamera(e){this._raycastHelper.setCamera(e)}setObject(e){this._raycastHelper.setObject(e)}}n([i],Lt.prototype,"_selectionHandler",void 0),n([i],Lt.prototype,"_configuratorUiCallbacks",void 0);class Vt extends A{constructor(e){super(),this._uiIntersectionMask=0,this.floorEnvironment=!1,this._camera=e}updateToBounds(e,t,n){let i=new Se(-e.x/2,0,-e.z/2),o=new Se(e.x/2,e.y,e.z/2);this._boundingBox=new Ce(i,o),this._clientWidth=t,this._clientHeight=n;let s=this._boundingBox.getSize(new Se);this._boxVertices=[],this._boxVertices.push(this._boundingBox.min),this._boxVertices.push(this._boundingBox.min.clone().add(new Se(s.x,0,0))),this._boxVertices.push(this._boundingBox.max),this._boxVertices.push(this._boundingBox.max.clone().sub(new Se(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=B(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 Bt extends re{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)}}e("c",Bt);class Tt extends ae{constructor(e,t,n){super(e,t,T.HSC,n),this._configuratorContext.baseContext="configurator",this._getViewModel().setListener(this),this._sceneEventHandler=new Lt(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 Se))}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),F.isProduction||(window.__RML__DEBUG__.SceneManager=this),this.enableConfiguratorEvents(),this._initOptionalModules(),this._offsetAnimationStart=Le(this._offsetAnimationStart.bind(this),250),this._offsetAnimationEnd=Ve(this._offsetAnimationEnd.bind(this),32)}async _initOptionalModules(){const{transparentHighlighting:e}=this._initData;if(e){const{default:e}=await t.import("./component-raycast-helper-91c67dd6.legacy.js");this._componentRaycastHelper=new e,this._componentRaycastHelper.init(this._scene,this.cameraBehaviour3d.cameraControl.getCamera())}}_changeCameraBehaviour(e){var t;super._changeCameraBehaviour(e),null===(t=this._componentRaycastHelper)||void 0===t||t.setCamera(this.cameraBehaviour3d.cameraControl.getCamera())}disableEvents(){this.disableConfiguratorEvents()}enableEvents(){"configurator"===this._configuratorContext.baseContext&&this.enableConfiguratorEvents()}enableConfiguratorEvents(){this._sceneEventHandler.enable()}disableConfiguratorEvents(){this._sceneEventHandler.disable()}_getViewModel(){return this._viewModel||(this._viewModel=o.lookup("configurator-view-model",this._creator_),this._viewModel.setRequestRenderCallback(()=>this._renderEverything()),this._viewModel.setRequestRenderSceneUpdateCallback(()=>{var e;return null===(e=this._roomleRenderer)||void 0===e?void 0:e.clearCache()}),this._viewModel.setInvalidateRenderCallback(()=>{var e;return null===(e=this._roomleRenderer)||void 0===e?void 0:e.forceShadowUpdates(!0)})),this._viewModel}_getKernelAccess(){return this._plannerKernelAccess}_showDockings(){var e,t,n;if(null===(e=this._roomleRenderer)||void 0===e||e.enableUiInteractionMode(),null===(n=null===(t=this._initData)||void 0===t?void 0:t.featureFlags)||void 0===n?void 0:n.pulsePreview){this._renderEverything();const e=setInterval(()=>this._renderEverything(),16);setTimeout(()=>clearInterval(e),(le+1)*he)}}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&&Be().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 Vt(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(G.createDynamicLightSettingSource(null,z.CAMERA)):this._lightSetting=new nt(this._scene,this._lightSetting)),this._requestRender(),t||this._setEnvironment(new ce(this._scene,this._environment,Te(this._initData.colors.DEFAULT_BACKGROUND))),this._getViewModel().materialQueue.registerCallback(()=>this._materialLoaded())}sceneCleared(e){this._internalClearScene(e)}display(e){this._scene.add(e),this.setRootComponentId(e.runtimeId),this._requestRender()}setRootComponentId(e){this._sceneEventHandler.setRootComponentId(e)}debugSceneGraph(e){this._getViewModel().debugSceneGraph(e),this._printObjectGraph(this._scene,"")}debugScene(){return this._scene}_printObjectGraph(e,t){e.material&&e.material.opacity,e.type,e.id,e.runtimeId,e.children.length>0&&e.children.forEach(e=>{let n=t+" ";this._printObjectGraph(e,n)})}clearScene(){var e,t;null===(e=this.configuratorCameraBehaviour)||void 0===e||e.resetCameraOnSceneClear(),this._internalClearScene(!1),null===(t=this._sceneEventHandler)||void 0===t||t.cancelSelection("reset_scene"),this._pluginSystem.clearScene(this._scene,this._uiScene)}planObjectConstructionDone(e){this._componentDimensioningHelper.reset(),this._componentDimensioningHelper.setCamera(this.cameraBehaviour3d.cameraControl.getCamera())}_internalClearScene(e){var t;this._scene.children.forEach(e=>{"Object3D"!==e.type&&"Mesh"!==e.type&&"Line"!==e.type||this._scene.remove(e)}),this._uiScene.children.forEach(e=>{this._uiScene.remove(e)}),this._getViewModel().sceneCleared(),null===(t=this._componentDimensioningHelper)||void 0===t||t.invalidateDimensioningsCache(),(e||this._memoryManager.shouldHardReset())&&(this._configuratorMeshGenerator.clear(),this._renderer.renderLists.dispose(),this._memoryManager.executedHardReset()),this._renderEverything()}async _waitForAssets(){await super._waitForAssets(),await this._externalMeshesAndMaterialsReady()}async preparePerspectiveImage(e={},t){var n,i;await this._externalMeshesAndMaterialsReady();const{showDimensions:o=!1}=e;this._cancelDockings(!0,null,!0,!0);const s=this.cameraBehaviour3d.cameraControl.getCamera().clone();s.resetOffset();let r=this._calculateBoundingBoxOfAllMeshes(0,o);null===(n=this._lightSetting)||void 0===n||n.removeFromScene();const a=!!this._dimensionHelper&&this._dimensionHelper.areDimensionsEnabled();a&&this._dimensionHelper.disableDimensions();const l=this.cameraBehaviour3d.cameraControl.getObjectRotation();if(o){await this._initDimensions(),await this._dimensionHelper.isInitialized();const e=-30+X(l);K.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 h=await this._imageRenderer.preparePerspectiveImage(this._scene,this._uiScene,s,r,e,l);return a?(this._dimensionHelper.enableDimensions(),this._dimensionHelper.moveCameraEnd(this.cameraBehaviour3d.cameraControl.getCamera().position)):o&&this._dimensionHelper.disableDimensions(),null===(i=this._lightSetting)||void 0===i||i.addToScene(),this._renderEverything(),h}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=K.getCameraTargetForBBox((new Ce).setFromObject(e));const s=U(this._scene);s.add(e);const r=await this._imageRenderer.preparePerspectiveImage(s,null,i,o,t);W(s),n(r)},i)})}_calculateBoundingBoxOfAllMeshes(e=0,t){let n=null;return n=t&&this._dimensionHelper?this._dimensionHelper.getBoundingBox():this._getViewModel().getBoundingBox(),K.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 Se),i=q(e),o=new Fe(0,i,0),s=e.getWorldPosition(new Se).clone().add(e.boundingBox.getCenter(new Se).applyEuler(o));const r=new Ae;this._renderer.getSize(r);const a={yaw:o.y,pitch:V(15),distance:N(n.x,n.y,n.z,this.cameraBehaviour3d.cameraControl.getCamera().fov,r.width,r.height)*de,targetX:s.x,targetY:s.y,targetZ:s.z,blockOtherTweens:!0};Ge(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 ue&&(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 B(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 ge||(this._environment=new ge(this._scene,this._environment,!0),this._uiIntersectionHelper.floorEnvironment=!0),new Promise((t,n)=>{this._environment.changeFloorMaterial(e,this._maxAnisotropy).then(()=>{this._requestRender(),t()},n)})}zoomIn(e){this.configuratorCameraBehaviour.externalApiZoomIn(e),this._renderEverything()}zoomOut(e){this.configuratorCameraBehaviour.externalApiZoomOut(e),this._renderEverything()}async showDimensions(){await this._initDimensions(),this._dimensionHelper.enableDimensions(),this._dimensionHelper.onDimensionsVisibilityChanged(e=>{e&&this._renderEverything(),this._configuratorUiCallbacks.onDimensionsVisibilityChange(e)}),this._configuratorUiCallbacks.onDimensionsVisibilityChange(!0),this._renderEverything()}async _initDimensions(e=!1){this._dimensionHelper||await t.import("./dimensioning-helper-bb3492c7.legacy.js").then(({default:e})=>{this._dimensionHelper=new e(this._creator_)}),this._dimensionHelper.setUiScene(this._uiScene),this._dimensionHelper.setObject(this._getViewModel().getComponent(this._configuratorContext.rootComponentId),this.cameraBehaviour3d.cameraControl.getObjectRotation());const n=this._getKernelAccess().kernelInstance.getPlanObject(this._configuratorContext.planObjectId);n&&n.boxForMeasurement&&this._dimensionHelper.updateSize(n.boxForMeasurement);let i=this.cameraBehaviour3d.cameraControl.getCamera().position;if(e){const e=m(n.boxForMeasurement);i.copy(e.getCenter(new Se)),i.y=e.getSize(new Se).y+1}this._dimensionHelper.moveCameraEnd(i)}hideDimensions(){this._dimensionHelper&&this._dimensionHelper.disableDimensions(),this._componentDimensioningHelper&&this._componentDimensioningHelper.hasComponentDimensions()&&this._componentDimensioningHelper.reset(),this._renderEverything()}async loadSceneSettings(e){await super.loadSceneSettings(e),this._uiIntersectionHelper.floorEnvironment=this._environment instanceof ge}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){c.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 Se(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 Bt){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 Se))),this._componentRaycastHelper&&this._componentRaycastHelper.checkPreviewVisibility(this._getViewModel())}configurationLoaded(e,t){e&&t&&this._sceneEventHandler.isDragIn()?(e.position.copy(new Se(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 Ce).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 Se)),type:"component",actions:o})}),this._getViewModel().getPreviews().forEach(t=>{const n=(new Ce).setFromObject(t);e.push({id:t.runtimeId,position:this.getScreenXY(n.getCenter(new Se)),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 Se);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===ze.ALWAYS||this._initData.highlighting!==ze.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(Z(),o,n);this._idbManager.setValue(a,i,this._idbManager.configStore)}_getInputManager(){return this._configuratorInputManager}createCameraControl(e,t){this._componentFactory=se();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 Se(0,.5,5)),this._changeCameraBehaviour(new Bt(new ue(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 Bt?this.cameraBehaviour:null}get cameraBehaviour3d(){return this.cameraBehaviour}_onCameraIdle(){return super._onCameraIdle()}_onCameraMove(){return super._onCameraMove()}getComponent(e){return this._plannerKernelAccess.kernelInstance.getComponent(e)}cameraBehaviourChanged(){var e;super.cameraBehaviourChanged(),null===(e=this._sceneEventHandler)||void 0===e||e.setCamera(this.cameraBehaviour.cameraControl.getCamera()),this._setCameraControlListeners()}_setCameraControlListeners(){this.cameraBehaviour3d&&(this.cameraBehaviour.cameraControl.addEventListener(0,()=>{this._configuratorUiCallbacks.onCameraPositionChanges(),this._sceneEventHandler.setCameraMoving(!0),this._requestRender()},this),this.cameraBehaviour.cameraControl.addEventListener(1,()=>{this._componentRaycastHelper&&this._componentRaycastHelper.checkComponentAndPreviewVisibility(this._sceneEventHandler,this._getViewModel()),this._requestRender()},this),this.cameraBehaviour.cameraControl.addEventListener(2,()=>{this._sceneEventHandler.setCameraMoving(!1),this._requestRender()},this),this.cameraBehaviour.cameraControl.addEventListener(5,({minZoom:e,maxZoom:t})=>{this._configuratorUiCallbacks.onZoomChange(e,t)},this),this.cameraBehaviour.cameraControl.addEventListener(3,()=>{this._configuratorUiCallbacks.onCameraPositionChanges(),this._requestRender()},this),this.cameraBehaviour.cameraControl.addEventListener(4,()=>{this._configuratorUiCallbacks.onCameraPositionChanges(),this._requestRender()},this),this.cameraBehaviour.cameraControl.addEventListener(7,()=>{var e;this._pluginSystem.moveCameraStart(this.cameraBehaviour.cameraControl.getCamera().position),null===(e=this._dimensionHelper)||void 0===e||e.moveCameraStart(this.cameraBehaviour.cameraControl.getCamera().position)},this),this.cameraBehaviour.cameraControl.addEventListener(8,()=>{var e;this._pluginSystem.moveCameraEnd(this.cameraBehaviour.cameraControl.getCamera().position),null===(e=this._dimensionHelper)||void 0===e||e.moveCameraEnd(this.cameraBehaviour.cameraControl.getCamera().position),this._updateComponentPosition()},this))}_shouldRenderUi(){var e;return super._shouldRenderUi()||(null===(e=this._dimensionHelper)||void 0===e?void 0:e.areDimensionsEnabled())}setEventHandlerObject(e){this._sceneEventHandler.setObject(e)}_readyForRender(){"configurator"===this._configuratorContext.baseContext&&(this._configuratorUiCallbacks.onReadyForRender(),this._globalCallback.onReadyForRender())}animateElement(e,t,n,i,o){const s="animation:"+t;this._viewModel.changeAnimationValue(e,s,n,i,o)}}e("C",Tt),n([i],Tt.prototype,"_configuratorInputManager",void 0),n([i],Tt.prototype,"_configuratorMeshGenerator",void 0),n([i],Tt.prototype,"_memoryManager",void 0),n([i],Tt.prototype,"_configuratorContext",void 0),n([i],Tt.prototype,"_componentDimensioningHelper",void 0),n([i],Tt.prototype,"_configuratorHistory",void 0),n([i],Tt.prototype,"_configuratorUiCallbacks",void 0),n([i],Tt.prototype,"_plannerKernelAccess",void 0),n([i],Tt.prototype,"_globalInitData",void 0);const Ft=(e,t)=>{let n=te(e,t);return 0!==n?n:(n=oe(e.label,t.label),0!==n?n:oe(e.id,t.id))},Gt=e=>(e.sort(Ft),e.forEach(e=>e.materials.sort(Ft)),e),zt=(e,t)=>{if("external"!==e.source)return t;const n=Ue(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 Kt{_isInitDone(){return this._isKernelReady&&this._isWebGlReady&&this._isPreloadReady}_checkInitDone(){this._isInitDone()&&(this._onInitDoneCollection.forEach(e=>e()),this._onInitDoneCollection=[])}_onInitDone(e){this._isInitDone()?e():this._onInitDoneCollection.push(e)}constructor(e,t){this._onInitDoneCollection=[],this._isKernelReady=!1,this._isWebGlReady=!1,this._isPreloadReady=!0,this._isLoadError=!1,this._isReloading=!1,this._needsSync=!1,this._creator_=e,this._activePlugins=t||[],this._configuratorKernelAccessCallback.addListener(this);const{dls:n,ls:i}=this._initData;(i||n)&&(this._initData.legacyLight=!0),this._initData.legacyLight&&(this._initData.envMapIntensity=.9);const o=this._errorHandler;o.subscribe(0,e=>this._configuratorUiCallbacks.onErrorDueToOffline(e)),o.subscribe(1,e=>this._configuratorUiCallbacks.onError(e)),o.subscribe(2,(e,t)=>this._configuratorUiCallbacks.onContentProblem({rapiPath:e,ids:t,message:"Could not load the ids"}))}exportCanvasScreenshot(e){return this._sceneManager.exportCanvasScreenshot(e)}initSceneManager(e){this._sceneManager=e||o.lookup("configurator-scene-manager",this._creator_)}getScene(){return this._sceneManager.getScene()}updateScene(){this._sceneManager.updateScene()}_loadWebGlLib(e,t){this._loadingWebGlSuccess(e,t)}_loadingWebGlSuccess(e,t){this.initSceneManager(),t&&this._sceneManager.changeOffset(t);const{initialFloorMaterial:n,dls:i,ls:o,stats:s}=this._initData,r=G.createDynamicLightSettingSource(i,o);s&&this.showStats(),this._sceneManager.enableHD(r),this._needsSync&&(this._needsSync=!1,this._plannerKernelAccess.requestSync(J,this._configuratorContext.planObjectId));const a=[this._scriptLoader.fetch(me,{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=Y(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(Q(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(zt(e,Gt(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(zt(e,Gt(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(),c.start("ui_load_configuration");const s=[];if(this._initData.applyCurrentGlobalParameters){const e=this._configuratorContext.planObjectId,t=this._configuratorContext.rootComponentParametersAsGlobal;s.push(this._plannerKernelAccess.getGlobalParameters(e,t))}Promise.all(s).then(([i])=>{const o=[d.waitFor(4),d.waitFor(2)];Promise.all(o).then(([e,[n,o,s,r]])=>{const a=[];i&&this._initData.applyCurrentGlobalParameters&&i.forEach(e=>a.push(this.setParameter(e,e.value,!0)));const l=this._rapiAccess.peekComponent(r);Promise.all(a).then(()=>{const n=[];a.length&&(n.push(this._plannerKernelAccess.getPartList()),n.push(this._plannerKernelAccess.getConfigurationHash(this._configuratorContext))),Promise.all(n).then(async n=>{const i=n&&n[0]?n[0]:o,r=n&&n[1]?n[1]:s,a=await this._plannerKernelAccess.addUiDataAndPriceToPartList(i,r);let h=e.errors;const c=h?ie(h):[];this._configuratorUiCallbacks.onPartListUpdate(a,window.btoa(s)),t({partList:a,hash:r,rootComponentLabel:l?l.label:"",errors:c})})})},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=Q(e)?this._rapiAccess.getPreloadForItem.bind(this._rapiAccess):this._rapiAccess.getPreloadForConfiguration.bind(this._rapiAccess),c.start("rapi_preloads");const n=()=>{const t=c.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===$.useHDGeometry?t():this._isReloading?n("Change of HD Geometry in progress"):(this._isReloading=!0,d.waitFor(3).then(([e,i])=>{this._reloadConfiguration(e,i,t,n)},n),$.useHDGeometry=e,void this._plannerKernelAccess.changeUseOfHDGeometry(this._configuratorContext,$.useHDGeometry)))}async _callOnPartListUpdate(){const{hash:e}=await d.waitFor(4),t=await this._plannerKernelAccess.getPartList(),n=await this._plannerKernelAccess.getConfigurationHash(this._configuratorContext),i=await this._plannerKernelAccess.addUiDataAndPriceToPartList(t,n);this._configuratorUiCallbacks.onPartListUpdate(i,window.btoa(e))}setOverrides(e){e&&(this._initData.setOverrides(e),this._globalInitData.setOverrides(e))}init(e,t){this.setOverrides(t);const{preloadHint:n,offset:i,startTag:o}=this._initData;return this._domHelper.setDomElement(e),n?this._preloadPackage(n):console.warn("No preload hint! Therefore no preload during init!!"),o&&this.getTagById(o,{include:["items"]}).then(e=>this._configuratorUiCallbacks.onOpenTag(e),e=>console.error(e)),this._loadWebGlLib(e,i),new Promise(this._initPromiseCallback.bind(this))}cancelSelection({reason:e,resetCamera:t}={}){this._sceneManager.cancelComponentSelection(null!=t&&t,e||"unknown")}enableHDGeometry(){return this._changeHDGeometry(!0)}disableHDGeometry(){return this._changeHDGeometry(!1)}changeOffset(e){this._sceneManager.changeOffset(e)}previewDockings(e,t,n){this._sceneManager.requestDockingsPreview(!0,e,t,n)}cancelDockings(){this._sceneManager.cancelDockings()}requestDeleteComponent(){this._sceneManager.requestDeleteSelectedComponent()}renderImage(e){return this._sceneManager.renderImage(e)}preparePerspectiveImage(e={}){return this._sceneManager.preparePerspectiveImage(e)}preparePartImage(e,t){let n={};return"number"==typeof t?n.size=t:(t||(t={}),"number"!=typeof t.size&&(t.size=256),n=t),this._sceneManager.preparePartImage(e,n)}async saveCurrentConfiguration(){var e;try{const t=await this._plannerKernelAccess.getConfigurationData(this._configuratorContext.planObjectId);if(null===(e=this._plannerKernelAccess.kernelInstance)||void 0===e?void 0:e.isExternalPlanObject(this._configuratorContext.planObjectId)){this._activePlugins.includes("external-objects")||console.warn("External objects are not enabled, expect unexpected behavior");const{image:e}=await this._sceneManager.preparePerspectiveImage();return{...t,id:it(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){c.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(c.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(ee(e)){if(!n&&!this._unitFormatter.isParseableUnitString(t,e))return o(new SyntaxError('Value "'+t+'" is not parseable'));const i=n?t:this._unitFormatter.parseValue(t,e),{valueFrom:s,valueTo:a}=e.validRange,l=this._unitFormatter.getAllowedDelta();if(!Number.isNaN(s)&&i<s-l)return o(new RangeError('Value "'+t+'" is too small, min-val "'+s+'"'));if(!Number.isNaN(a)&&i>a+l)return o(new RangeError('Value "'+t+'" is too big, max-val "'+a+'"'));t="Integer"===r&&"number"==typeof i?i.toFixed():i.toString()}this._sceneManager.cancelDockings(),this._dispatchSetParameter(s,r,t,i,o),this._sceneManager.saveConfigToIdb()})}setParameterOfPlanObject(e,t){return new Promise((n,i)=>{const{planObjectId:o,rootComponentId:s,rootComponentParametersAsGlobal:r}=this._configuratorContext,{type:a,key:l}=e;r?this._plannerKernelAccess.changeComponentParameter(s,l,a,t,n,i):this._plannerKernelAccess.changePlanObjectParameter(o,l,a,t,n,i)})}getParametersOfPlanObject(){const{planObjectId:e,rootComponentParametersAsGlobal:t}=this._configuratorContext;return this._plannerKernelAccess.getGlobalParameters(e,t)}setParameterOfRootComponent(e,t){return new Promise((n,i)=>{const{rootComponentId:o}=this._configuratorContext,{type:s,key:r}=e;this._plannerKernelAccess.changeComponentParameter(o,r,s,t,n,i)})}getParametersOfRootComponent(){const{planObjectId:e}=this._configuratorContext;return this._plannerKernelAccess.getGlobalParameters(e,!0)}enableMultiselect(){this._sceneManager.setSelectionMode("multiselect"),this._configuratorContext.selectionMode="multiselect"}disableMultiselect(){this._sceneManager.setSelectionMode("standard"),this._configuratorContext.selectionMode="standard"}getCurrentConfiguration(){return d.waitFor(1,()=>this._plannerKernelAccess.uiRequestConfiguration(this._configuratorContext.planObjectId))}loadComponentIntoKernel(e){return d.waitFor(0,()=>{let t=null;try{if(t=JSON.parse(e).id,!t)throw new Error("Component string has no ID")}catch(e){return this._configuratorUiCallbacks.onContentProblem({rapiPath:"components",ids:[t],message:"Component string is not a valid JSON or has no ID"}),void d.failOperation(0,e)}this._kernelIo.setMeta({componentId:t}),this._plannerKernelAccess.loadComponentIntoKernel(e,t)})}getShortUrlOfCurrentConfiguration(){return new Promise((e,t)=>{this.saveCurrentConfiguration().then(n=>navigator.onLine?this._rapiAccess.getShortUrl(n.id,3).then(t=>{const n=t.shortId,i=F.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(te),t.sort(te),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=c.getMeasure("kernel_is_ready");if(Array.isArray(e)&&1===e.length){const t=e[0],n=c.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(te),t.forEach(t=>{t.group?t.grouping=s[t.group]:t.grouping=null,this._unitFormatter.formatParameter(t),ne(t)&&Object.defineProperty(t,"groups",{get:()=>new Promise((n,s)=>{this._getMaterialGroups(t).then(t=>{this._isCorrectResponse(i,e)&&this._shouldBroadcastToUi(i)||o?n(t):s("Response does not match to ids")},s)})})}),t}async _getChildrenOf(e,t,n,i){const o=i(e,t,n);return await this._addAdditionalInfoToPossibleChildren(e,o,2,!1,!0)}async getChildrenOfPlanComponent(e,t=!1,n=!1){const i=this._plannerKernelAccess.kernelInstance.getChildrenOfPlanComponent.bind(this._plannerKernelAccess.kernelInstance);return this._getChildrenOf(e,t,n,i)}async getChildrenOfPlanObject(e=!1,t=!1){const{planObjectId:n}=this._configuratorContext,i=this._plannerKernelAccess.kernelInstance.getChildrenOfPlanObject.bind(this._plannerKernelAccess.kernelInstance);return this._getChildrenOf(n,e,t,i)}async _addAdditionalInfoToPossibleChildren(e,t,n,i=!0,o=!1){const{possibleChildren:s,defaultChild:r}=await this._getPossibleChildrenForKernelPossibleChildren(t,o),a=[],l=new Map,h=[];if(s.forEach(e=>{const t=e.tags;if(e.tags&&Array.isArray(e.tags)&&e.tags.length)for(let n=0,i=e.tags.length;n<i;n++){const i=t[n];-1===a.indexOf(i)&&a.push(i);let o=l.get(i);if(!o){const e=[];l.set(i,e),o=l.get(i)}o.push(e)}else h.push(e)}),this._isCorrectResponse(n,e)||!i){let e=[];try{e=(await this._rapiAccess.getTags(a)).map(e=>({...e,possibleChildren:l.get(e.id)}))}catch(t){console.error("Couldnt load tags of possible children"),console.error(t),e=[]}return e.sort(te),h.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:h}),{tags:e,defaultChild:r}}return null}async _getPossibleChildrenForKernelPossibleChildren(e,t=!1){const n=[],i=[];let o;const s=new Map,r=new Map;e.forEach(e=>{if(!e.possible&&!t)return;let a=e.itemId;e.itemId?(i.push(e.itemId),r.has(e.itemId)?r.get(e.itemId).push(e):r.set(e.itemId,[e])):(n.push(e.componentId),s.has(e.componentId)?s.get(e.componentId).push(e):s.set(e.componentId,[e]),a=e.componentId),e.isDefault&&!o&&(o=a)});const a=await Promise.all([this._rapiAccess.getComponents(n),this._rapiAccess.getItems(i)]),l=a[0],h=a[1],c=[];let d=null;return l.forEach(e=>{var t;e.isItem=!1,e.isComponent=!0;for(const n of null!==(t=s.get(e.id))&&void 0!==t?t:[]){const t=JSON.parse(JSON.stringify(e));t.group=n.group,t.possible=n.possible,t.id===o&&(t.isDefault=!0,d=t),c.push(t)}}),h.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),c.push(t)}}),c.sort(te),{possibleChildren:c,defaultChild:d}}getUnitFormatter(){return this._unitFormatter}getStorage(){return this._idbManager}getConfiguratorContext(){return this._configuratorContext}getComponent(e){return this._sceneManager.getComponent(e)}async getTools(){const e=o.lookup("roomle-tools-core",this._creator_);return await e.init(),e}exportImageFromCamera(e="image",t=!1){return this._sceneManager.exportImageFromCamera(e,t)}calcPartsPriceSum(e){return this._plannerKernelAccess.calcPartsPriceSum(e)}async generateProductionServiceExport(e=""){return this.generateHomagIxExport(0,e)}async generateTCExport(e=""){return this.generateHomagIxExport(0,e)}async generateIMOSiXExport(e=""){return this.generateHomagIxExport(1,e)}async generateHOMAGiXExport(e="",n={},i={},o={}){let s=await this.generateHomagIxExport(2,e);const{homagIxMockUpData:r}=await t.import("./imos-ix-poc-export-helper-ca5160da.legacy.js");return r(s,n,i,o)}async downloadHomagIxExportPoC(){const e=await this.generateHOMAGiXExport();Ke("IMOSiX.xml",e)}async generateHomagIxExport(e,n=""){const{generateExportHomagIxConfiguration:i}=await t.import("./imos-ix-poc-export-helper-ca5160da.legacy.js"),o=this._configuratorContext.planObjectId;i(o,e,this._plannerKernelAccess.configurationExporter,this._plannerKernelAccess.kernelInstance,n);try{return this._plannerKernelAccess.configurationExporter.setDefaultExportDataDefinition(n),Promise.resolve(JSON.parse(this._plannerKernelAccess.configurationExporter.generateExport(e,o,this._plannerKernelAccess.kernelInstance)))}catch(t){return console.error(t),Promise.reject("Could not create export JSON "+e)}}setEnvironmentMap(e){const{url:t,intensity:n,rotation:i,maxLightSources:o}=e;this._sceneManager.setEnvironmentMap(t,n,i,o)}enableEvents(){this._sceneManager.enableEvents()}disableEvents(){this._sceneManager.disableEvents()}enableDebugging(){const e={debugValueMapChange:e=>{this.callbacks.onValueMapChanged(e)}};this._plannerKernelAccess.addDebugClient(e)}}e("R",Kt),n([i],Kt.prototype,"_rapiAccess",void 0),n([i],Kt.prototype,"_dataSyncer",void 0),n([i],Kt.prototype,"_errorHandler",void 0),n([i],Kt.prototype,"_unitFormatter",void 0),n([i],Kt.prototype,"_idbManager",void 0),n([i],Kt.prototype,"_domHelper",void 0),n([i],Kt.prototype,"_configuratorUiCallbacks",void 0),n([i],Kt.prototype,"_configuratorKernelAccessCallback",void 0),n([i],Kt.prototype,"_lifeCycleManager",void 0),n([i],Kt.prototype,"_plannerKernelAccess",void 0),n([i],Kt.prototype,"_scriptLoader",void 0),n([i],Kt.prototype,"_configuratorContext",void 0),n([i],Kt.prototype,"_initData",void 0),n([i],Kt.prototype,"_globalInitData",void 0),n([i],Kt.prototype,"_globalCallback",void 0),n([i],Kt.prototype,"_kernelIo",void 0),n([i],Kt.prototype,"_configuratorHistory",void 0)}}}));
|
|
2
|
+
//# sourceMappingURL=roomle-configurator-2ab0523e.legacy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"roomle-configurator-2ab0523e.legacy.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","_createClass","x","arguments","length","undefined","y","z","w","_classCallCheck","prototype","isVector4","this","key","get","set","value","scalar","index","Error","constructor","v","s","a","b","m","e","elements","multiplyScalar","q","Math","acos","sqrt","angle","te","m11","m12","m13","m21","m22","m23","m31","m32","m33","abs","PI","xx","yy","zz","xy","xz","yz","min","max","clamp","minVal","maxVal","divideScalar","floor","ceil","round","trunc","normalize","alpha","v1","v2","array","offset","attribute","getX","getY","getZ","getW","random","Symbol","iterator","_regeneratorRuntime","mark","wrap","_context","prev","next","stop","_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","LightShadow","camera","intensity","bias","normalBias","blurSamples","mapSize","Vector2","map","mapPass","autoUpdate","needsUpdate","_frustum","_frameExtents","_viewportCount","_viewports","light","shadowCamera","shadowMatrix","setFromMatrixPosition","position","lookAt","updateMatrixWorld","multiplyMatrices","projectionMatrix","matrixWorldInverse","setFromProjectionMatrix","multiply","viewportIndex","dispose","source","clone","toArray","toJSON","Camera","_Object3D","_this","_callSuper","isCamera","type","projectionMatrixInverse","_inherits","recursive","_superPropGet","force","invert","updateParents","updateChildren","Object3D","_v3","_minTarget","_maxTarget","PerspectiveCamera","_Camera","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","width","height","enabled","offsetX","offsetY","top","left","skew","getFilmWidth","makePerspective","meta","data","PointLightShadow","_LightShadow","isPointLightShadow","_cubeDirections","_cubeUps","add","up","makeTranslation"],"mappings":"42gBAAuC,IAEjCA,GAAO,WAWX,OAAAC,IATD,SAAAD,IAA0C,IAA7BE,EAACC,UAAAC,OAAA,QAAAC,IAAAF,UAAA,GAAAA,UAAA,GAAG,EAAGG,EAACH,UAAAC,OAAA,QAAAC,IAAAF,UAAA,GAAAA,UAAA,GAAG,EAAGI,EAACJ,UAAAC,OAAA,QAAAC,IAAAF,UAAA,GAAAA,UAAA,GAAG,EAAGK,EAACL,UAAAC,OAAA,QAAAC,IAAAF,UAAA,GAAAA,UAAA,GAAG,EAACM,QAAAT,GAEtCA,EAAQU,UAAUC,WAAY,EAE9BC,KAAKV,EAAIA,EACTU,KAAKN,EAAIA,EACTM,KAAKL,EAAIA,EACTK,KAAKJ,EAAIA,IAET,CAAA,CAAAK,IAAA,QAAAC,IAED,WAEC,OAAOF,KAAKL,GAEZQ,IAED,SAAWC,GAEVJ,KAAKL,EAAIS,IAET,CAAAH,IAAA,SAAAC,IAED,WAEC,OAAOF,KAAK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