@roomle/web-sdk 2.70.0-alpha.7 → 2.70.0-alpha.8
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/{TextGeometry-9c63883e.js → TextGeometry-1f9a5413.js} +2 -2
- package/lib/{TextGeometry-9c63883e.js.map → TextGeometry-1f9a5413.js.map} +1 -1
- package/lib/{TextGeometry-22809d6e.nomodule.js → TextGeometry-270a3996.nomodule.js} +2 -2
- package/lib/{TextGeometry-22809d6e.nomodule.js.map → TextGeometry-270a3996.nomodule.js.map} +1 -1
- package/lib/{banana-for-scale-4f38a3b3.js → banana-for-scale-2f220824.js} +2 -2
- package/lib/{banana-for-scale-4f38a3b3.js.map → banana-for-scale-2f220824.js.map} +1 -1
- package/lib/{banana-for-scale-1031ea37.nomodule.js → banana-for-scale-a1b28b55.nomodule.js} +2 -2
- package/lib/{banana-for-scale-1031ea37.nomodule.js.map → banana-for-scale-a1b28b55.nomodule.js.map} +1 -1
- package/lib/{budgeteer-measure-8682bae0.js → budgeteer-measure-41b9cd52.js} +2 -2
- package/lib/{budgeteer-measure-8682bae0.js.map → budgeteer-measure-41b9cd52.js.map} +1 -1
- package/lib/budgeteer-measure.nomodule.js +1 -1
- package/lib/camera-behaviour-152f3965.js +2 -0
- package/lib/camera-behaviour-152f3965.js.map +1 -0
- package/lib/camera-behaviour-510b2914.nomodule.js +2 -0
- package/lib/camera-behaviour-510b2914.nomodule.js.map +1 -0
- package/lib/{component-dimensioning-986a384d.nomodule.js → component-dimensioning-a2a1575f.nomodule.js} +2 -2
- package/lib/component-dimensioning-a2a1575f.nomodule.js.map +1 -0
- package/lib/{component-dimensioning-339798db.js → component-dimensioning-dc970add.js} +2 -2
- package/lib/component-dimensioning-dc970add.js.map +1 -0
- package/lib/component-raycast-helper-98c7ea75.js +2 -0
- package/lib/component-raycast-helper-98c7ea75.js.map +1 -0
- package/lib/component-raycast-helper-db211262.nomodule.js +2 -0
- package/lib/component-raycast-helper-db211262.nomodule.js.map +1 -0
- package/lib/configurator-b9f1a342.nomodule.js +2 -0
- package/lib/configurator-b9f1a342.nomodule.js.map +1 -0
- package/lib/configurator-d18eebaf.js +2 -0
- package/lib/configurator-d18eebaf.js.map +1 -0
- package/lib/configurator-main-c1770888.js +2 -0
- package/lib/configurator-main-c1770888.js.map +1 -0
- package/lib/configurator-main.nomodule.js +1 -1
- package/lib/{continuous-drawing-helper-8a3e0e97.nomodule.js → continuous-drawing-helper-050a88a8.nomodule.js} +2 -2
- package/lib/continuous-drawing-helper-050a88a8.nomodule.js.map +1 -0
- package/lib/{continuous-drawing-helper-afce61ab.js → continuous-drawing-helper-8bc1129a.js} +2 -2
- package/lib/continuous-drawing-helper-8bc1129a.js.map +1 -0
- package/lib/default-light-setting-701866d7.js +2 -0
- package/lib/default-light-setting-701866d7.js.map +1 -0
- package/lib/default-light-setting-998bc8a2.nomodule.js +2 -0
- package/lib/default-light-setting-998bc8a2.nomodule.js.map +1 -0
- package/lib/definitions/common-core/src/cameracontrol/camera-behaviour-state.d.ts +8 -0
- package/lib/definitions/common-core/src/cameracontrol/camera-behaviour.d.ts +14 -0
- package/lib/definitions/common-core/src/cameracontrol/camera-control-3d.d.ts +1 -0
- package/lib/definitions/common-core/src/cameracontrol/camera-control.d.ts +1 -0
- package/lib/definitions/common-core/src/cameracontrol/configurator-camera-behaviour.d.ts +21 -0
- package/lib/definitions/common-core/src/cameracontrol/glb-viewer-camera-behaviour.d.ts +7 -0
- package/lib/definitions/common-core/src/cameracontrol/material-viewer-camera-behaviour.d.ts +5 -0
- package/lib/definitions/common-core/src/cameracontrol/planner-2d-camera-behaviour.d.ts +15 -0
- package/lib/definitions/common-core/src/cameracontrol/planner-3d-camera-behaviour.d.ts +17 -0
- package/lib/definitions/common-core/src/cameracontrol/planner-camera-behaviour.d.ts +14 -0
- package/lib/definitions/common-core/src/cameracontrol/planner-fp-camera-behaviour.d.ts +14 -0
- package/lib/definitions/common-core/src/utils/common-utils.d.ts +6 -0
- package/lib/definitions/common-core/src/webgl/image-renderer.d.ts +1 -0
- package/lib/definitions/common-core/src/webgl/scene-manager.d.ts +10 -7
- package/lib/definitions/configurator-core/src/roomle-configurator.d.ts +0 -1
- package/lib/definitions/configurator-core/src/utils/component-raycast-helper.d.ts +1 -0
- package/lib/definitions/configurator-core/src/webgl/configurator-scene-manager.d.ts +12 -11
- package/lib/definitions/glb-viewer-core/src/webgl/glb-viewer-scene-manager.d.ts +2 -0
- package/lib/definitions/planner-core/src/webgl/planner-scene-manager.d.ts +11 -11
- package/lib/{dimensioning-helper-33920736.js → dimensioning-helper-536acbc5.js} +2 -2
- package/lib/{dimensioning-helper-33920736.js.map → dimensioning-helper-536acbc5.js.map} +1 -1
- package/lib/{dimensioning-helper-1c271ac1.nomodule.js → dimensioning-helper-96c4407e.nomodule.js} +2 -2
- package/lib/{dimensioning-helper-1c271ac1.nomodule.js.map → dimensioning-helper-96c4407e.nomodule.js.map} +1 -1
- package/lib/glb-viewer-01ce04fe.nomodule.js +2 -0
- package/lib/{glb-viewer-e9927fe6.nomodule.js.map → glb-viewer-01ce04fe.nomodule.js.map} +1 -1
- package/lib/glb-viewer-394c707d.js +2 -0
- package/lib/{glb-viewer-8efd5328.js.map → glb-viewer-394c707d.js.map} +1 -1
- package/lib/glb-viewer-camera-behaviour-6493fd42.js +2 -0
- package/lib/glb-viewer-camera-behaviour-6493fd42.js.map +1 -0
- package/lib/glb-viewer-camera-behaviour-fde73c18.nomodule.js +2 -0
- package/lib/glb-viewer-camera-behaviour-fde73c18.nomodule.js.map +1 -0
- package/lib/glb-viewer-main-d031b69b.js +2 -0
- package/lib/glb-viewer-main-d031b69b.js.map +1 -0
- package/lib/glb-viewer-main.nomodule.js +1 -1
- package/lib/legacy/{TextGeometry-98b17031.legacy.js → TextGeometry-c0ae932c.legacy.js} +2 -2
- package/lib/legacy/{TextGeometry-98b17031.legacy.js.map → TextGeometry-c0ae932c.legacy.js.map} +1 -1
- package/lib/legacy/{banana-for-scale-bbc9f6d7.legacy.js → banana-for-scale-42179567.legacy.js} +2 -2
- package/lib/legacy/{banana-for-scale-bbc9f6d7.legacy.js.map → banana-for-scale-42179567.legacy.js.map} +1 -1
- package/lib/legacy/budgeteer-measure.legacy.js +1 -1
- package/lib/legacy/camera-behaviour-12bf66b1.legacy.js +2 -0
- package/lib/legacy/camera-behaviour-12bf66b1.legacy.js.map +1 -0
- package/lib/legacy/{component-dimensioning-64c72cb3.legacy.js → component-dimensioning-500eddfe.legacy.js} +2 -2
- package/lib/legacy/component-dimensioning-500eddfe.legacy.js.map +1 -0
- package/lib/legacy/component-raycast-helper-b58fb547.legacy.js +2 -0
- package/lib/legacy/component-raycast-helper-b58fb547.legacy.js.map +1 -0
- package/lib/legacy/configurator-a319db55.legacy.js +2 -0
- package/lib/legacy/configurator-a319db55.legacy.js.map +1 -0
- package/lib/legacy/configurator-main.legacy.js +1 -1
- package/lib/legacy/{continuous-drawing-helper-65a73633.legacy.js → continuous-drawing-helper-b59b2e3b.legacy.js} +2 -2
- package/lib/legacy/continuous-drawing-helper-b59b2e3b.legacy.js.map +1 -0
- package/lib/legacy/default-light-setting-894d1404.legacy.js +2 -0
- package/lib/legacy/default-light-setting-894d1404.legacy.js.map +1 -0
- package/lib/legacy/{dimensioning-helper-c15b8df2.legacy.js → dimensioning-helper-f6ac8c56.legacy.js} +2 -2
- package/lib/legacy/{dimensioning-helper-c15b8df2.legacy.js.map → dimensioning-helper-f6ac8c56.legacy.js.map} +1 -1
- package/lib/legacy/glb-viewer-446d3bac.legacy.js +2 -0
- package/lib/legacy/{glb-viewer-f053973c.legacy.js.map → glb-viewer-446d3bac.legacy.js.map} +1 -1
- package/lib/legacy/glb-viewer-camera-behaviour-27f99511.legacy.js +2 -0
- package/lib/legacy/glb-viewer-camera-behaviour-27f99511.legacy.js.map +1 -0
- package/lib/legacy/glb-viewer-main.legacy.js +1 -1
- package/lib/legacy/{main-thread-to-worker-fd41ac1a.legacy.js → main-thread-to-worker-b6add17c.legacy.js} +3 -3
- package/lib/legacy/{main-thread-to-worker-fd41ac1a.legacy.js.map → main-thread-to-worker-b6add17c.legacy.js.map} +1 -1
- package/lib/legacy/material-viewer-d003e6d1.legacy.js +2 -0
- package/lib/legacy/material-viewer-d003e6d1.legacy.js.map +1 -0
- package/lib/legacy/material-viewer-main.legacy.js +1 -1
- package/lib/legacy/planner-b8a0e3fc.legacy.js +2 -0
- package/lib/legacy/{planner-6478ac63.legacy.js.map → planner-b8a0e3fc.legacy.js.map} +1 -1
- package/lib/legacy/planner-main.legacy.js +1 -1
- package/lib/legacy/{query-params-helper-8cebf03e.legacy.js → query-params-helper-a1e13324.legacy.js} +2 -2
- package/lib/legacy/query-params-helper-a1e13324.legacy.js.map +1 -0
- package/lib/legacy/roomle-configurator-9aaf9f85.legacy.js +2 -0
- package/lib/legacy/roomle-configurator-9aaf9f85.legacy.js.map +1 -0
- package/lib/legacy/{roomle-dependency-injection-85d9c55c.legacy.js → roomle-dependency-injection-4023fe40.legacy.js} +3 -3
- package/lib/legacy/{roomle-dependency-injection-85d9c55c.legacy.js.map → roomle-dependency-injection-4023fe40.legacy.js.map} +1 -1
- package/lib/legacy/roomle-sdk.legacy.js +1 -1
- package/lib/legacy/{script-loader-e0ac631b.legacy.js → script-loader-f80cbdd3.legacy.js} +2 -2
- package/lib/legacy/script-loader-f80cbdd3.legacy.js.map +1 -0
- package/lib/legacy/{stats-helper-98211cf9.legacy.js → stats-helper-78c9a3b5.legacy.js} +2 -2
- package/lib/legacy/stats-helper-78c9a3b5.legacy.js.map +1 -0
- package/lib/legacy/{tools-core-b14cd303.legacy.js → tools-core-c0680579.legacy.js} +2 -2
- package/lib/legacy/tools-core-c0680579.legacy.js.map +1 -0
- package/lib/{main-thread-to-worker-052750d8.js → main-thread-to-worker-2003c1d9.js} +2 -2
- package/lib/{main-thread-to-worker-052750d8.js.map → main-thread-to-worker-2003c1d9.js.map} +1 -1
- package/lib/{main-thread-to-worker-285afcc7.nomodule.js → main-thread-to-worker-4d246b8d.nomodule.js} +2 -2
- package/lib/{main-thread-to-worker-285afcc7.nomodule.js.map → main-thread-to-worker-4d246b8d.nomodule.js.map} +1 -1
- package/lib/material-viewer-bde3d81b.nomodule.js +2 -0
- package/lib/material-viewer-bde3d81b.nomodule.js.map +1 -0
- package/lib/material-viewer-fc2707dd.js +2 -0
- package/lib/material-viewer-fc2707dd.js.map +1 -0
- package/lib/material-viewer-main-2fe0a62e.js +2 -0
- package/lib/material-viewer-main-2fe0a62e.js.map +1 -0
- package/lib/material-viewer-main.nomodule.js +1 -1
- package/lib/planner-3fcfe328.js +2 -0
- package/lib/{planner-44a3ac8d.js.map → planner-3fcfe328.js.map} +1 -1
- package/lib/planner-9c9e9ebf.nomodule.js +2 -0
- package/lib/{planner-bfc01b4c.nomodule.js.map → planner-9c9e9ebf.nomodule.js.map} +1 -1
- package/lib/planner-dummy-app.js +1 -1
- package/lib/planner-dummy-app.js.map +1 -1
- package/lib/planner-dummy.html +1 -0
- package/lib/planner-main-4bb772b8.js +2 -0
- package/lib/planner-main-4bb772b8.js.map +1 -0
- package/lib/planner-main.nomodule.js +1 -1
- package/lib/{query-params-helper-32a044de.js → query-params-helper-8d88a29e.js} +2 -2
- package/lib/query-params-helper-8d88a29e.js.map +1 -0
- package/lib/{query-params-helper-887400ad.nomodule.js → query-params-helper-bf0b71cd.nomodule.js} +2 -2
- package/lib/query-params-helper-bf0b71cd.nomodule.js.map +1 -0
- package/lib/roomle-configurator-41a3faa0.js +2 -0
- package/lib/roomle-configurator-41a3faa0.js.map +1 -0
- package/lib/roomle-configurator-5517851a.nomodule.js +2 -0
- package/lib/roomle-configurator-5517851a.nomodule.js.map +1 -0
- package/lib/{roomle-dependency-injection-d22f5f7b.js → roomle-dependency-injection-9001109d.js} +3 -3
- package/lib/{roomle-dependency-injection-d22f5f7b.js.map → roomle-dependency-injection-9001109d.js.map} +1 -1
- package/lib/{roomle-dependency-injection-7cca6f7d.nomodule.js → roomle-dependency-injection-9ceffa50.nomodule.js} +3 -3
- package/lib/{roomle-dependency-injection-7cca6f7d.nomodule.js.map → roomle-dependency-injection-9ceffa50.nomodule.js.map} +1 -1
- package/lib/{roomle-sdk-d311d2b6.js → roomle-sdk-d74e16ec.js} +2 -2
- package/lib/roomle-sdk-d74e16ec.js.map +1 -0
- package/lib/roomle-sdk.nomodule.js +1 -1
- package/lib/{script-loader-6bbdf4a1.nomodule.js → script-loader-4c75ff92.nomodule.js} +2 -2
- package/lib/script-loader-4c75ff92.nomodule.js.map +1 -0
- package/lib/{script-loader-6eec4640.js → script-loader-8a74aea8.js} +2 -2
- package/lib/script-loader-8a74aea8.js.map +1 -0
- package/lib/{stats-helper-f0604290.js → stats-helper-3708d4f9.js} +2 -2
- package/lib/stats-helper-3708d4f9.js.map +1 -0
- package/lib/{stats-helper-37488d9f.nomodule.js → stats-helper-89760893.nomodule.js} +2 -2
- package/lib/stats-helper-89760893.nomodule.js.map +1 -0
- package/lib/{tools-core-e6b4d85b.nomodule.js → tools-core-50092b0e.nomodule.js} +2 -2
- package/lib/tools-core-50092b0e.nomodule.js.map +1 -0
- package/lib/{tools-core-08dc84da.js → tools-core-9f14130e.js} +2 -2
- package/lib/tools-core-9f14130e.js.map +1 -0
- package/package.json +2 -2
- package/lib/component-dimensioning-339798db.js.map +0 -1
- package/lib/component-dimensioning-986a384d.nomodule.js.map +0 -1
- package/lib/component-raycast-helper-21fa8594.js +0 -2
- package/lib/component-raycast-helper-21fa8594.js.map +0 -1
- package/lib/component-raycast-helper-eaff5fc1.nomodule.js +0 -2
- package/lib/component-raycast-helper-eaff5fc1.nomodule.js.map +0 -1
- package/lib/configurator-79fa0ff7.js +0 -2
- package/lib/configurator-79fa0ff7.js.map +0 -1
- package/lib/configurator-951eec6f.nomodule.js +0 -2
- package/lib/configurator-951eec6f.nomodule.js.map +0 -1
- package/lib/configurator-main-74732111.js +0 -2
- package/lib/configurator-main-74732111.js.map +0 -1
- package/lib/continuous-drawing-helper-8a3e0e97.nomodule.js.map +0 -1
- package/lib/continuous-drawing-helper-afce61ab.js.map +0 -1
- package/lib/default-light-setting-8cf51c50.js +0 -2
- package/lib/default-light-setting-8cf51c50.js.map +0 -1
- package/lib/default-light-setting-e94e862e.nomodule.js +0 -2
- package/lib/default-light-setting-e94e862e.nomodule.js.map +0 -1
- package/lib/glb-viewer-8efd5328.js +0 -2
- package/lib/glb-viewer-e9927fe6.nomodule.js +0 -2
- package/lib/glb-viewer-main-84d740e9.js +0 -2
- package/lib/glb-viewer-main-84d740e9.js.map +0 -1
- package/lib/legacy/component-dimensioning-64c72cb3.legacy.js.map +0 -1
- package/lib/legacy/component-raycast-helper-7ff762fb.legacy.js +0 -2
- package/lib/legacy/component-raycast-helper-7ff762fb.legacy.js.map +0 -1
- package/lib/legacy/configurator-c0799fdf.legacy.js +0 -2
- package/lib/legacy/configurator-c0799fdf.legacy.js.map +0 -1
- package/lib/legacy/continuous-drawing-helper-65a73633.legacy.js.map +0 -1
- package/lib/legacy/default-light-setting-05b1581d.legacy.js +0 -2
- package/lib/legacy/default-light-setting-05b1581d.legacy.js.map +0 -1
- package/lib/legacy/glb-viewer-f053973c.legacy.js +0 -2
- package/lib/legacy/material-viewer-7a1be594.legacy.js +0 -2
- package/lib/legacy/material-viewer-7a1be594.legacy.js.map +0 -1
- package/lib/legacy/planner-6478ac63.legacy.js +0 -2
- package/lib/legacy/query-params-helper-8cebf03e.legacy.js.map +0 -1
- package/lib/legacy/roomle-configurator-5e6fe9e5.legacy.js +0 -2
- package/lib/legacy/roomle-configurator-5e6fe9e5.legacy.js.map +0 -1
- package/lib/legacy/scene-manager-e3b3fce1.legacy.js +0 -2
- package/lib/legacy/scene-manager-e3b3fce1.legacy.js.map +0 -1
- package/lib/legacy/script-loader-e0ac631b.legacy.js.map +0 -1
- package/lib/legacy/stats-helper-98211cf9.legacy.js.map +0 -1
- package/lib/legacy/tools-core-b14cd303.legacy.js.map +0 -1
- package/lib/material-viewer-16487bf6.nomodule.js +0 -2
- package/lib/material-viewer-16487bf6.nomodule.js.map +0 -1
- package/lib/material-viewer-d2e1ff7a.js +0 -2
- package/lib/material-viewer-d2e1ff7a.js.map +0 -1
- package/lib/material-viewer-main-309890cc.js +0 -2
- package/lib/material-viewer-main-309890cc.js.map +0 -1
- package/lib/planner-44a3ac8d.js +0 -2
- package/lib/planner-bfc01b4c.nomodule.js +0 -2
- package/lib/planner-main-f05908a9.js +0 -2
- package/lib/planner-main-f05908a9.js.map +0 -1
- package/lib/query-params-helper-32a044de.js.map +0 -1
- package/lib/query-params-helper-887400ad.nomodule.js.map +0 -1
- package/lib/roomle-configurator-8b10fc46.nomodule.js +0 -2
- package/lib/roomle-configurator-8b10fc46.nomodule.js.map +0 -1
- package/lib/roomle-configurator-db2763e9.js +0 -2
- package/lib/roomle-configurator-db2763e9.js.map +0 -1
- package/lib/roomle-sdk-d311d2b6.js.map +0 -1
- package/lib/scene-manager-048834f4.nomodule.js +0 -2
- package/lib/scene-manager-048834f4.nomodule.js.map +0 -1
- package/lib/scene-manager-6d3a180f.js +0 -2
- package/lib/scene-manager-6d3a180f.js.map +0 -1
- package/lib/script-loader-6bbdf4a1.nomodule.js.map +0 -1
- package/lib/script-loader-6eec4640.js.map +0 -1
- package/lib/stats-helper-37488d9f.nomodule.js.map +0 -1
- package/lib/stats-helper-f0604290.js.map +0 -1
- package/lib/tools-core-08dc84da.js.map +0 -1
- package/lib/tools-core-e6b4d85b.nomodule.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dimensioning-helper-
|
|
1
|
+
{"version":3,"file":"dimensioning-helper-536acbc5.js","sources":["../../packages/configurator-core/public/fonts/rubik_regular_sub.json"],"sourcesContent":["export default \"static/rubik_regular_sub-2dd2d5cca49018c5.json\""],"names":[],"mappings":"wnIAAe"}
|
package/lib/{dimensioning-helper-1c271ac1.nomodule.js → dimensioning-helper-96c4407e.nomodule.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
System.register(["./roomle-dependency-injection-
|
|
2
|
-
//# sourceMappingURL=dimensioning-helper-
|
|
1
|
+
System.register(["./roomle-dependency-injection-9ceffa50.nomodule.js","./main-thread-to-worker-4d246b8d.nomodule.js","./TextGeometry-270a3996.nomodule.js"],(function(t){var e,i,s,n,h,o,a,_,d,l,r,m,p,u,x,c,g,w,y,b;return{setters:[function(t){e=t.n,i=t._,s=t.i,n=t.ag,h=t.aC},function(t){o=t.O,a=t.a,_=t.h,d=t.w,l=t.bo,r=t.B,m=t.z,p=t.Q,u=t.b9,x=t.u,c=t.G,g=t.b,w=t.a_,y=t.ad},function(t){b=t.T}],execute:function(){const B="component_dimensioning_plane_material",T="component_dimensioning_text_material";class z extends o{constructor(t){super(),this._label="",this._parameters={font:null,size:.1,height:.001,curveSegments:2,bevelEnabled:!0,bevelThickness:.001,bevelSize:.001},this.topDown=!1,this._parameters.font=t,this._position=new a,this._initMaterials(),this._init(),this._update()}_initMaterials(){this._cacheHolder.materialCache.has(B)?this._planeMaterial=this._cacheHolder.materialCache.get(B):(this._planeMaterial=new _({color:16777215,side:d,opacity:.8,transparent:!0}),this._cacheHolder.materialCache.set(B,this._planeMaterial)),this._cacheHolder.materialCache.has(T)?this._textMaterial=this._cacheHolder.materialCache.get(T):(this._textMaterial=new l({color:3618615}),this._cacheHolder.materialCache.set(T,this._textMaterial))}_init(){let t=new r;this._text=new m(t,this._textMaterial),this._text.userData.ignoreComponentRaycast=!0,this._text.name="text with background text "+this._label,this._plane=new m(t,this._planeMaterial),this._plane.userData.ignoreComponentRaycast=!0,this._plane.name="text with background plane "+this._label,this._textGeometry=new b(this._label,this._parameters),this._textGeometry.computeBoundingBox(),this._text.geometry=this._textGeometry,this.add(this._text),this.add(this._plane)}update(t,e,i,s){this._position.copy(t),this._dimensioningType=e,this._cameraPosition=s,this._label=i;const n=this._cameraPosition.distanceTo(this._text.position),h=Math.max(.01,n/100),o=Math.max(5e-4,n/5e3);this._parameters.bevelThickness=o,this._parameters.bevelSize=o,this._parameters.size=h,this._textGeometry=new b(this._label,this._parameters),this._textGeometry.computeBoundingBox(),this._text.geometry=this._textGeometry,this._update()}_update(){if(this.topDown){let t=new p;t.setFromAxisAngle(new a(-1,0,0),Math.PI/2),this._updateText(this._textGeometry,t,new a)}else if(this._updateText(this._textGeometry,new p,new a),this._cameraPosition){const t=Math.atan2(this._cameraPosition.x-this._position.x,this._cameraPosition.z-this._position.z);this._text.rotation.y=t,this._plane.rotation.y=t}}_updateText(t,e,i){let s=new a;s.copy(this._position),i.x*=this._getXSign(),s.add(i);let n=t.boundingBox.getSize(new a);t.center(),this._text.position.copy(s),this._text.quaternion.copy(e);let h=new u(n.x+.02,n.y+.02,32);h.center(),this._plane.geometry=h,this._plane.position.copy(s),this._plane.quaternion.copy(e)}_getXSign(){return!this._cameraPosition||this._cameraPosition.x>=0?1:-1}dispose(){e(this)}}i([s],z.prototype,"_cacheHolder",void 0);class L{constructor(t){this._cameraPosition=new a,this._textUpdated=!1,this._topDimensions=!1,this._initialized=new n,this._enabled=!1,this._dimensionsVisible=!1,this._creator_=t,this._lineMaterial=new x({color:3618615,linewidth:2});let e=new r;this._widthLine=new c(e,this._lineMaterial),this._widthLine.userData.ignoreComponentRaycast=!0,this._widthLine.name="dimension width line",this._heightLine=new c(e,this._lineMaterial),this._heightLine.userData.ignoreComponentRaycast=!0,this._heightLine.name="dimension height line",this._depthLine=new c(e,this._lineMaterial),this._depthLine.userData.ignoreComponentRaycast=!0,this._depthLine.name="dimension depth line",this._planeMaterial=new _({color:16777215,side:d,opacity:.8,transparent:!0}),h.loadFont("static/rubik_regular_sub-2dd2d5cca49018c5.json").then(t=>{this._font=t,this._loaded()})}_loaded(){this.update(!1),this.addToScene(this._scene,this._uiScene),this._initialized.resolve()}_performUpdate(t){this._enabled&&(this._lineBounds||t)&&this._font&&(this._updateHeight(),this._updateWidth(),this._updateDepth())}_updateWidth(){let t=new r,e=this._getWidthEdge(),i=[e.start.x,e.start.y,e.start.z,e.end.x,e.end.y,e.end.z];t.setAttribute("position",new g(new Float32Array(i),3)),this._widthLine.geometry.dispose(),this._widthLine.geometry=t;let s=e.getCenter(new a);this._widthText||(this._widthText=new z(this._font)),this._widthText.topDown=this._topDimensions;const n=this._unitFormatter.formatMMValueToUnitString(1e3*this._dimensions.x);this._widthText.update(s,0,n,this._cameraPosition)}_updateHeight(){let t=new r,e=this._getHeightEdge(),i=[e.start.x,e.start.y,e.start.z,e.end.x,e.end.y,e.end.z];t.setAttribute("position",new g(new Float32Array(i),3)),this._heightLine.geometry.dispose(),this._heightLine.geometry=t;let s=e.getCenter(new a);this._heightText||(this._heightText=new z(this._font)),this._heightText.topDown=this._topDimensions;const n=this._unitFormatter.formatMMValueToUnitString(1e3*this._dimensions.y);this._heightText.update(s,1,n,this._cameraPosition)}_updateDepth(){let t=new r,e=this._getDepthEdge(),i=[e.start.x,e.start.y,e.start.z,e.end.x,e.end.y,e.end.z];t.setAttribute("position",new g(new Float32Array(i),3)),this._depthLine.geometry.dispose(),this._depthLine.geometry=t;let s=e.getCenter(new a);this._depthText||(this._depthText=new z(this._font)),this._depthText.topDown=this._topDimensions;const n=this._unitFormatter.formatMMValueToUnitString(1e3*this._dimensions.z);this._depthText.update(s,2,n,this._cameraPosition)}updateBounds(t){if(!t)return;this._dimensions=t.getSize(new a),this._lineBounds=t.clone();let e=this._lineBounds.min.y<0?this._lineBounds.min.y:0;e-=.01,this._lineBounds.expandByVector(new a(.05,e,.05)),this._textUpdated=!1,this.update()}update(t=!1){this._enabled&&!this._dimensionsVisible&&(this._dimensionsVisible=!0,this._visibilityChangedCallback()),this._performUpdate(t)}addToScene(t,e){this._widthText&&this._widthLine&&this._heightText&&this._heightLine&&this._heightText&&this._heightLine&&(t.add(this._widthLine),e.add(this._widthText),t.add(this._heightLine),e.add(this._heightText),t.add(this._depthLine),e.add(this._depthText))}removeFromScene(t,e){t.remove(this._widthLine),e.remove(this._widthText),t.remove(this._heightLine),e.remove(this._heightText),t.remove(this._depthLine),e.remove(this._depthText)}_getWidthEdge(){return this._cameraPosition.z>=0?new w(new a(this._lineBounds.min.x,this._lineBounds.min.y,this._lineBounds.max.z),new a(this._lineBounds.max.x,this._lineBounds.min.y,this._lineBounds.max.z)):new w(new a(this._lineBounds.min.x,this._lineBounds.min.y,this._lineBounds.min.z),new a(this._lineBounds.max.x,this._lineBounds.min.y,this._lineBounds.min.z))}_getDepthEdge(){return this._cameraPosition.x>=0?new w(new a(this._lineBounds.max.x,this._lineBounds.min.y,this._lineBounds.min.z),new a(this._lineBounds.max.x,this._lineBounds.min.y,this._lineBounds.max.z)):new w(new a(this._lineBounds.min.x,this._lineBounds.min.y,this._lineBounds.min.z),new a(this._lineBounds.min.x,this._lineBounds.min.y,this._lineBounds.max.z))}_getHeightEdge(){return this._cameraPosition.x>=0&&this._cameraPosition.z>=0?new w(new a(this._lineBounds.max.x,this._lineBounds.min.y,this._lineBounds.max.z),new a(this._lineBounds.max.x,this._lineBounds.max.y,this._lineBounds.max.z)):this._cameraPosition.x<0&&this._cameraPosition.z>=0?new w(new a(this._lineBounds.min.x,this._lineBounds.min.y,this._lineBounds.max.z),new a(this._lineBounds.min.x,this._lineBounds.max.y,this._lineBounds.max.z)):this._cameraPosition.x>=0&&this._cameraPosition.z<0?new w(new a(this._lineBounds.max.x,this._lineBounds.min.y,this._lineBounds.min.z),new a(this._lineBounds.max.x,this._lineBounds.max.y,this._lineBounds.min.z)):new w(new a(this._lineBounds.min.x,this._lineBounds.min.y,this._lineBounds.min.z),new a(this._lineBounds.min.x,this._lineBounds.max.y,this._lineBounds.min.z))}onDimensionsVisibilityChanged(t){this._onChange=t}enableTopDimensions(){this.enableDimensions(),this._topDimensions=!0,this._heightLine.visible=!1,this._heightText.visible=!1,this.update(!0)}disableTopDimensions(){this._topDimensions=!1,this._heightLine.visible=!0,this._heightText.visible=!0,this.disableDimensions()}enableDimensions(){this._enabled=!0,this.update(!0),this.addToScene(this._scene,this._uiScene)}disableDimensions(){this._enabled=!1,this._dimensionsVisible&&(this._dimensionsVisible=!1,this._visibilityChangedCallback()),this.removeFromScene(this._scene,this._uiScene)}_visibilityChangedCallback(){this._onChange&&this._onChange(this._dimensionsVisible)}_clear(){this._lineMaterial.dispose(),this._planeMaterial.dispose(),this._widthLine.geometry.dispose(),this._heightLine.geometry.dispose(),this._depthLine.geometry.dispose(),this._heightText.dispose(),this._heightText.dispose(),this._depthText.dispose()}getBoundingBox(){const t=new y;return t.expandByObject(this._widthLine),t.expandByObject(this._widthText),t.expandByObject(this._heightLine),t.expandByObject(this._heightText),t.expandByObject(this._depthLine),t.expandByObject(this._depthText),t}setVisibility(t){this._heightLine&&this._widthLine&&this._depthLine&&this._heightText&&this._widthText&&this._depthText&&(this._heightLine.visible=t,this._heightText.visible=t,this._widthLine.visible=t,this._widthText.visible=t,this._depthLine.visible=t,this._depthText.visible=t)}moveCameraStart(t){this.setVisibility(!1),this._cameraPosition=t,this.update()}moveCameraEnd(t){this.setVisibility(!0),this._cameraPosition=t,this.update()}clearScene(t){this._clear()}setScene(t){this._scene=t}setUiScene(t){this._uiScene=t}needsUiScene(){return!0}isInitialized(){return this._initialized.wait()}areDimensionsEnabled(){return this._enabled}}t("default",L),i([s],L.prototype,"_unitFormatter",void 0)}}}));
|
|
2
|
+
//# sourceMappingURL=dimensioning-helper-96c4407e.nomodule.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dimensioning-helper-
|
|
1
|
+
{"version":3,"file":"dimensioning-helper-96c4407e.nomodule.js","sources":["../../packages/configurator-core/public/fonts/rubik_regular_sub.json"],"sourcesContent":["export default \"static/rubik_regular_sub-2dd2d5cca49018c5.json\""],"names":[],"mappings":"6oHAAe"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
System.register(["./script-loader-4c75ff92.nomodule.js","./roomle-dependency-injection-9ceffa50.nomodule.js","./camera-behaviour-510b2914.nomodule.js","./main-thread-to-worker-4d246b8d.nomodule.js","./default-light-setting-998bc8a2.nomodule.js","./glb-viewer-camera-behaviour-fde73c18.nomodule.js","./query-params-helper-bf0b71cd.nomodule.js"],(function(e){var t,r,i,n,s,a,o,h,c,d,l,u,m,_,p,g,w,v,b,f,S,C,L,M,B,y,I,x,G,j,E,O,F;return{setters:[function(e){t=e.S,r=e.M},function(e){i=e.as,n=e.D,s=e.L,a=e.R,o=e.Q,h=e._,c=e.i,d=e.e,l=e.j,u=e.k,m=e.n,_=e.b},function(e){p=e.C,g=e.L,w=e.S,v=e.T},function(e){b=e.a,f=e.ad,S=e.ag,C=e.Q,L=e.A,M=e.C,B=e.aE,y=e.aO,I=e.bw,x=e.i,G=e.bk,j=e.N,E=e.bL},function(e){O=e.D},function(e){F=e.G},function(){}],execute:function(){const D=[new n("script-loader",t),new n("glb-input-manager",class extends i{},1),new n("logger",s),new n("rapi-access",a)];class P extends p{constructor(){super(...arguments),this.shouldIgnoreStandardBehavior=!1}adjust(e,t,r,i,n){let s=new b(-e.x/2,0,-e.z/2),a=new b(e.x/2,e.y,e.z/2);this._boundingBox=new f(s,a);let o=new S(-Math.PI/2+i,r,0,"ZYX"),h=(new C).setFromEuler(o);this._camera.updateProjectionMatrix(),this._camera.quaternion.copy(h),this._camera.position.copy(t)}_update(e){this.shouldIgnoreStandardBehavior?this._saveYawAndPitch():super._update(e)}animateCamera(e){return!!this.shouldIgnoreStandardBehavior||super.animateCamera(e)}}class z extends g{constructor(e,t){super(e,t),this._params={ambientLight:{color:"#ffffff"}},this._ambientLight=new L(new M(this._params.ambientLight.color),.5),this.addToScene()}addToScene(){this._scene.add(this._ambientLight)}removeFromScene(){this._scene.remove(this._ambientLight)}reload(){this.removeFromScene(),this.addToScene()}showGUI(){let e=o();if(e&&this._ambientLight){let t=e.addFolder("Ambient Light");t.add(this._ambientLight,"visible"),t.add(this._ambientLight,"intensity").min(0).max(5).step(.1),t.addColor(this._params.ambientLight,"color").onChange(e=>{this._ambientLight.color=new M(e)})}}}class k extends w{constructor(e,t){super(e,t,d.GLB,B.CAMERA_3D),this._itemsCount=0,this._standardSceneBackgroundColor=this._scene.background,this._initData.legacyLight&&(this._renderer.capabilities.maxTextures>8?this.loadDynamicLightSetting(l.createDynamicLightSettingSource(null,u.CAMERA)):(console.warn("this device has a maximum of 8 texture units thus we are using a simpler light setting"),this._lightSetting=new z(this._scene)))}createCameraControl(e,t){this._changeCameraBehaviour(new F(new P(this._creator_,this._getInputManager(),new b(-1,1,1)),this._cameraBehaviourState))}_getInputManager(){return this._glbInputManager}async loadStaticItem(e,t){const r=await this._rapiAccess.getItem(e);if(r.configuration)return Promise.reject();const i=y(r);return i?this.loadGLB(i,!0,void 0,t):Promise.reject(new Error("GLB Url not detected"))}loadGLB(e,t=!0,r=new b(1,1,1),i){return this.clearScene(),new Promise((n,s)=>{this._loadGLB(e,new b(0,0,0),0,void 0,r,void 0,void 0,i).then(e=>{this._currentGLB=e,this._scene.add(this._currentGLB);let r=(new f).setFromObject(this._currentGLB);t&&this.cameraBehaviour.cameraControl instanceof P&&this.glbViewerCameraBehaviour.updateCameraOnItemLoaded(r),this._updateBounds(r,null,!0),n()},s)})}preparePerspectiveImage(e,t,r){return new Promise(i=>{var n,s;t||(t=1e3),r||(r=1e3),e||((e=new I({antialias:!0})).setSize(t,r),e.outputColorSpace=x,e.autoClear=!1,e.shadowMap.enabled=!0,e.shadowMap.type=G);let a=this.cameraBehaviour.cameraControl.getCamera().clone();a instanceof j&&(a.aspect=t/r,a.updateProjectionMatrix()),null===(n=this._lightSetting)||void 0===n||n.removeFromScene();let o=new O(this._scene);e.render(this._scene,a);let h=e.domElement.toDataURL();e.domElement.toBlob(e=>{i({image:h,width:t,height:r,blob:e})},"image/png"),o.removeFromScene(),null===(s=this._lightSetting)||void 0===s||s.addToScene()})}adjustCamera(e,t,r,i){if(this.cameraBehaviour.cameraControl instanceof P){let n=(new f).setFromObject(this._scene).getSize(new b);this.cameraBehaviour.cameraControl.adjust(n,e,t,r,i),this._requestRender()}}onStart(e){this._itemsCount=e,this._scene.background=null,this.cameraBehaviour.cameraControl instanceof P&&(this.cameraBehaviour.cameraControl.shouldIgnoreStandardBehavior=!0)}onElementFinished(e){this._itemsCount,Math.round(100/this._itemsCount*e)}onFinished(e){this._scene.background=this._standardSceneBackgroundColor,this.cameraBehaviour.cameraControl instanceof P&&(this.cameraBehaviour.cameraControl.shouldIgnoreStandardBehavior=!1)}clearScene(){this._currentGLB&&(this._scene.remove(this._currentGLB),m(this._currentGLB),this._currentGLB=null),super.clearScene()}enableHD(){super.enableHD()}sceneChanged(){}getBounds(){return this._currentGLB?(new f).setFromObject(this._currentGLB):null}get glbViewerCameraBehaviour(){return this.cameraBehaviour}getGeometryBounds(){return null}}h([c],k.prototype,"_glbInputManager",void 0),h([c],k.prototype,"_rapiAccess",void 0);class A{constructor(e,t,r){this._prefix="https://furniture.roomle.com/3d/glb/",this._listeners=new Set,this._finishedItems=0,this._sceneManager=e,this._renderer=new I({antialias:!0,alpha:!0}),this._width=t,this._height=r,this._renderer.setSize(t,r),this._renderer.setClearColor(16777215,0),this._renderer.outputColorSpace=x}addListener(e){this._listeners.add(e)}removeListener(e){this._listeners.delete(e)}start(e){return this._entries=[],e.forEach(e=>{this._entries.push(this._transform(e))}),this._finishedItems=0,this._listeners.forEach(e=>e.onStart(this._entries.length)),this._zip=new window.JSZip,this._doNextEntry(),new Promise(e=>{this._resolve=e})}_transform(e){return{name:e.path.replace(".glb",".png"),url:this._prefix+e.path,position:new b(e.camera.position.x,e.camera.position.z,-e.camera.position.y),fov:2*e.camera.fieldOfView,yaw:e.camera.rotation.z,pitch:e.camera.rotation.x}}_doNextEntry(){0===this._entries.length?(this._listeners.forEach(e=>e.onFinished(this._zip)),this._resolve(this._zip)):this._processEntry(this._entries[0])}_processEntry(e){this._sceneManager.loadGLB(e.url,!1,void 0).then(()=>{this._sceneManager.adjustCamera(e.position,e.yaw,e.pitch,e.fov),this._sceneManager.preparePerspectiveImage(this._renderer,this._width,this._height).then(t=>{this._entryFinished(e,t)})})}_entryFinished(e,t){let r=this._entries.indexOf(e);r>-1&&this._entries.splice(r,1),this._finishedItems++,this._listeners.forEach(e=>e.onElementFinished(this._finishedItems)),this._zip.file(e.name,t.blob),this._doNextEntry()}}class U{constructor(e){this._currentIdOrUrl=null,this._creator_=e}setCameraOffset(e){this._sceneManager.setCameraOffset(e)}getCameraOffset(){return this._sceneManager.getCameraOffset()}init(e,t){return this.setOverrides(t),this._domHelper.setDomElement(e),this._sceneManager?(this._lifeCycleManager.resume(),Promise.resolve()):new Promise(this._initPromiseCallback.bind(this))}_initPromiseCallback(e,t){Promise.all([this._scriptLoader.fetch(v,{id:"tween-js"})]).then(()=>{this._sceneManager=new k(this._creator_,{left:0,top:1,right:1,bottom:0}),this._sceneManager.enableHD(),e()})}clearScene(){this._sceneManager.clearScene()}loadGLB(e,t=1,r){return this._currentIdOrUrl=e,this._rapiAccess.trackView(e),this._sceneManager.loadGLB(e,!0,new b(t,t,t),r)}loadStaticItem(e,t){return this._currentIdOrUrl=e,this._rapiAccess.trackView(e),this._sceneManager.loadStaticItem(e,t)}getCurrentId(){return this._currentIdOrUrl}loadSceneSetting(e){return this._sceneManager.loadSceneSettings(e)}preparePerspectiveImage(){return this._sceneManager.preparePerspectiveImage()}processRenderList(e,t=320,r=320){let i=JSON.parse(e);this._scriptLoader.fetch("static/jszip.min-c96375d50e72b199.js",{id:"jszip-js"}).then(()=>{let e=new A(this._sceneManager,t,r);e.addListener(this._sceneManager),e.start(i.items).then(t=>{t.generateAsync({type:"blob"}).then(t=>{E("content.zip",URL.createObjectURL(t)),e.removeListener(this._sceneManager)})})})}setOverrides(e){e&&(this._initData.setOverrides(e),this._globalInitData.setOverrides(e))}updateSize(){this._sceneManager.updateCamera()}getMain(){}resumeTest(e){this._domHelper.setDomElement(e),this._lifeCycleManager.resume()}pauseTest(){this._lifeCycleManager.pause()}showGUI(){this._sceneManager.showGUI()}get callbacks(){return{}}getScene(){return this._sceneManager.getScene()}updateScene(){this._sceneManager.updateScene()}getUnitFormatter(){return this._unitFormatter}getStorage(){return this._idbManager}setEnvironmentMap(e){const{url:t,intensity:r,rotation:i,maxLightSources:n}=e;this._sceneManager.setEnvironmentMap(t,r,i,n)}}h([c],U.prototype,"_rapiAccess",void 0),h([c],U.prototype,"_domHelper",void 0),h([c],U.prototype,"_scriptLoader",void 0),h([c],U.prototype,"_lifeCycleManager",void 0),h([c],U.prototype,"_initData",void 0),h([c],U.prototype,"_globalInitData",void 0),h([c],U.prototype,"_unitFormatter",void 0),h([c],U.prototype,"_idbManager",void 0),e("GlbViewer",class extends r{setupGlobals(){}setupDependencies(){_.setup(D),this.lookup("logger",this._context)}cleanUpGlobals(){throw new Error("Method not implemented.")}cleanUpDependencies(){throw new Error("Method not implemented.")}bootFinished(){this._viewer=new U(this._context),window.RoomleGLBViewer||(window.RoomleGLBViewer=this._viewer)}getApi(){return this._viewer}getContextName(){return"glb-viewer"}})}}}));
|
|
2
|
+
//# sourceMappingURL=glb-viewer-01ce04fe.nomodule.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"glb-viewer-
|
|
1
|
+
{"version":3,"file":"glb-viewer-01ce04fe.nomodule.js","sources":["../../node_modules/jszip/dist/jszip.min.js"],"sourcesContent":["export default \"static/jszip.min-c96375d50e72b199.js\""],"names":[],"mappings":"g8OAAe"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{S as ScriptLoader,M as Main}from"./script-loader-8a74aea8.js";import{as as InputManager,D as DependencyInjectionAssignment,L as Logger,R as RapiAccess,Q as getGUI,_ as __decorate,i as inject,e as CANVAS_ID,j as DynamicLightSettingLoader,k as PREDEFINED_LIGHTSETTING,n as dispose,b as RoomleDependencyInjection}from"./roomle-dependency-injection-9001109d.js";import{C as CameraControl3D,L as LightSetting,S as SceneManager,T as TWEEN_FILE_NAME}from"./camera-behaviour-152f3965.js";import{a as Vector3,ad as Box3,ag as Euler,Q as Quaternion,A as AmbientLight,C as Color,aE as CAMERA_TYPE,aO as getGlbUrl,bw as WebGLRenderer,i as SRGBColorSpace,bk as BasicShadowMap,N as PerspectiveCamera,bL as download}from"./main-thread-to-worker-2003c1d9.js";import{D as DefaultLightSetting}from"./default-light-setting-701866d7.js";import{G as GlbViewerCameraBehaviour}from"./glb-viewer-camera-behaviour-6493fd42.js";import"./query-params-helper-8d88a29e.js";const INJECTABLES=[new DependencyInjectionAssignment("script-loader",ScriptLoader),new DependencyInjectionAssignment("glb-input-manager",class extends InputManager{},1),new DependencyInjectionAssignment("logger",Logger),new DependencyInjectionAssignment("rapi-access",RapiAccess)];class AdjustableCameraControl3D extends CameraControl3D{constructor(){super(...arguments),this.shouldIgnoreStandardBehavior=!1}adjust(e,t,r,i,a){let n=new Vector3(-e.x/2,0,-e.z/2),s=new Vector3(e.x/2,e.y,e.z/2);this._boundingBox=new Box3(n,s);let o=new Euler(-Math.PI/2+i,r,0,"ZYX"),c=(new Quaternion).setFromEuler(o);this._camera.updateProjectionMatrix(),this._camera.quaternion.copy(c),this._camera.position.copy(t)}_update(e){this.shouldIgnoreStandardBehavior?this._saveYawAndPitch():super._update(e)}animateCamera(e){return!!this.shouldIgnoreStandardBehavior||super.animateCamera(e)}}class GLBViewerLightSetting extends LightSetting{constructor(e,t){super(e,t),this._params={ambientLight:{color:"#ffffff"}},this._ambientLight=new AmbientLight(new Color(this._params.ambientLight.color),.5),this.addToScene()}addToScene(){this._scene.add(this._ambientLight)}removeFromScene(){this._scene.remove(this._ambientLight)}reload(){this.removeFromScene(),this.addToScene()}showGUI(){let e=getGUI();if(e&&this._ambientLight){let t=e.addFolder("Ambient Light");t.add(this._ambientLight,"visible"),t.add(this._ambientLight,"intensity").min(0).max(5).step(.1),t.addColor(this._params.ambientLight,"color").onChange(e=>{this._ambientLight.color=new Color(e)})}}}class GLBViewerSceneManager extends SceneManager{constructor(e,t){super(e,t,CANVAS_ID.GLB,CAMERA_TYPE.CAMERA_3D),this._itemsCount=0,this._standardSceneBackgroundColor=this._scene.background,this._initData.legacyLight&&(this._renderer.capabilities.maxTextures>8?this.loadDynamicLightSetting(DynamicLightSettingLoader.createDynamicLightSettingSource(null,PREDEFINED_LIGHTSETTING.CAMERA)):(console.warn("this device has a maximum of 8 texture units thus we are using a simpler light setting"),this._lightSetting=new GLBViewerLightSetting(this._scene)))}createCameraControl(e,t){this._changeCameraBehaviour(new GlbViewerCameraBehaviour(new AdjustableCameraControl3D(this._creator_,this._getInputManager(),new Vector3(-1,1,1)),this._cameraBehaviourState))}_getInputManager(){return this._glbInputManager}async loadStaticItem(e,t){const r=await this._rapiAccess.getItem(e);if(r.configuration)return Promise.reject();const i=getGlbUrl(r);return i?this.loadGLB(i,!0,void 0,t):Promise.reject(new Error("GLB Url not detected"))}loadGLB(e,t=!0,r=new Vector3(1,1,1),i){return this.clearScene(),new Promise((a,n)=>{this._loadGLB(e,new Vector3(0,0,0),0,void 0,r,void 0,void 0,i).then(e=>{this._currentGLB=e,this._scene.add(this._currentGLB);let r=(new Box3).setFromObject(this._currentGLB);t&&this.cameraBehaviour.cameraControl instanceof AdjustableCameraControl3D&&this.glbViewerCameraBehaviour.updateCameraOnItemLoaded(r),this._updateBounds(r,null,!0),a()},n)})}preparePerspectiveImage(e,t,r){return new Promise(i=>{var a,n;t||(t=1e3),r||(r=1e3),e||((e=new WebGLRenderer({antialias:!0})).setSize(t,r),e.outputColorSpace=SRGBColorSpace,e.autoClear=!1,e.shadowMap.enabled=!0,e.shadowMap.type=BasicShadowMap);let s=this.cameraBehaviour.cameraControl.getCamera().clone();s instanceof PerspectiveCamera&&(s.aspect=t/r,s.updateProjectionMatrix()),null===(a=this._lightSetting)||void 0===a||a.removeFromScene();let o=new DefaultLightSetting(this._scene);e.render(this._scene,s);let c=e.domElement.toDataURL();e.domElement.toBlob(e=>{i({image:c,width:t,height:r,blob:e})},"image/png"),o.removeFromScene(),null===(n=this._lightSetting)||void 0===n||n.addToScene()})}adjustCamera(e,t,r,i){if(this.cameraBehaviour.cameraControl instanceof AdjustableCameraControl3D){let a=(new Box3).setFromObject(this._scene).getSize(new Vector3);this.cameraBehaviour.cameraControl.adjust(a,e,t,r,i),this._requestRender()}}onStart(e){this._itemsCount=e,this._scene.background=null,this.cameraBehaviour.cameraControl instanceof AdjustableCameraControl3D&&(this.cameraBehaviour.cameraControl.shouldIgnoreStandardBehavior=!0)}onElementFinished(e){this._itemsCount,Math.round(100/this._itemsCount*e)}onFinished(e){this._scene.background=this._standardSceneBackgroundColor,this.cameraBehaviour.cameraControl instanceof AdjustableCameraControl3D&&(this.cameraBehaviour.cameraControl.shouldIgnoreStandardBehavior=!1)}clearScene(){this._currentGLB&&(this._scene.remove(this._currentGLB),dispose(this._currentGLB),this._currentGLB=null),super.clearScene()}enableHD(){super.enableHD()}sceneChanged(){}getBounds(){return this._currentGLB?(new Box3).setFromObject(this._currentGLB):null}get glbViewerCameraBehaviour(){return this.cameraBehaviour}getGeometryBounds(){return null}}__decorate([inject],GLBViewerSceneManager.prototype,"_glbInputManager",void 0),__decorate([inject],GLBViewerSceneManager.prototype,"_rapiAccess",void 0);class GLBRenderWorker{constructor(e,t,r){this._prefix="https://furniture.roomle.com/3d/glb/",this._listeners=new Set,this._finishedItems=0,this._sceneManager=e,this._renderer=new WebGLRenderer({antialias:!0,alpha:!0}),this._width=t,this._height=r,this._renderer.setSize(t,r),this._renderer.setClearColor(16777215,0),this._renderer.outputColorSpace=SRGBColorSpace}addListener(e){this._listeners.add(e)}removeListener(e){this._listeners.delete(e)}start(e){return this._entries=[],e.forEach(e=>{this._entries.push(this._transform(e))}),this._finishedItems=0,this._listeners.forEach(e=>e.onStart(this._entries.length)),this._zip=new window.JSZip,this._doNextEntry(),new Promise(e=>{this._resolve=e})}_transform(e){return{name:e.path.replace(".glb",".png"),url:this._prefix+e.path,position:new Vector3(e.camera.position.x,e.camera.position.z,-e.camera.position.y),fov:2*e.camera.fieldOfView,yaw:e.camera.rotation.z,pitch:e.camera.rotation.x}}_doNextEntry(){0===this._entries.length?(this._listeners.forEach(e=>e.onFinished(this._zip)),this._resolve(this._zip)):this._processEntry(this._entries[0])}_processEntry(e){this._sceneManager.loadGLB(e.url,!1,void 0).then(()=>{this._sceneManager.adjustCamera(e.position,e.yaw,e.pitch,e.fov),this._sceneManager.preparePerspectiveImage(this._renderer,this._width,this._height).then(t=>{this._entryFinished(e,t)})})}_entryFinished(e,t){let r=this._entries.indexOf(e);r>-1&&this._entries.splice(r,1),this._finishedItems++,this._listeners.forEach(e=>e.onElementFinished(this._finishedItems)),this._zip.file(e.name,t.blob),this._doNextEntry()}}class RoomleGLBViewer{constructor(e){this._currentIdOrUrl=null,this._creator_=e}setCameraOffset(e){this._sceneManager.setCameraOffset(e)}getCameraOffset(){return this._sceneManager.getCameraOffset()}init(e,t){return this.setOverrides(t),this._domHelper.setDomElement(e),this._sceneManager?(this._lifeCycleManager.resume(),Promise.resolve()):new Promise(this._initPromiseCallback.bind(this))}_initPromiseCallback(e,t){Promise.all([this._scriptLoader.fetch(TWEEN_FILE_NAME,{id:"tween-js"})]).then(()=>{this._sceneManager=new GLBViewerSceneManager(this._creator_,{left:0,top:1,right:1,bottom:0}),this._sceneManager.enableHD(),e()})}clearScene(){this._sceneManager.clearScene()}loadGLB(e,t=1,r){return this._currentIdOrUrl=e,this._rapiAccess.trackView(e),this._sceneManager.loadGLB(e,!0,new Vector3(t,t,t),r)}loadStaticItem(e,t){return this._currentIdOrUrl=e,this._rapiAccess.trackView(e),this._sceneManager.loadStaticItem(e,t)}getCurrentId(){return this._currentIdOrUrl}loadSceneSetting(e){return this._sceneManager.loadSceneSettings(e)}preparePerspectiveImage(){return this._sceneManager.preparePerspectiveImage()}processRenderList(e,t=320,r=320){let i=JSON.parse(e);this._scriptLoader.fetch("static/jszip.min-c96375d50e72b199.js",{id:"jszip-js"}).then(()=>{let e=new GLBRenderWorker(this._sceneManager,t,r);e.addListener(this._sceneManager),e.start(i.items).then(t=>{t.generateAsync({type:"blob"}).then(t=>{download("content.zip",URL.createObjectURL(t)),e.removeListener(this._sceneManager)})})})}setOverrides(e){e&&(this._initData.setOverrides(e),this._globalInitData.setOverrides(e))}updateSize(){this._sceneManager.updateCamera()}getMain(){}resumeTest(e){this._domHelper.setDomElement(e),this._lifeCycleManager.resume()}pauseTest(){this._lifeCycleManager.pause()}showGUI(){this._sceneManager.showGUI()}get callbacks(){return{}}getScene(){return this._sceneManager.getScene()}updateScene(){this._sceneManager.updateScene()}getUnitFormatter(){return this._unitFormatter}getStorage(){return this._idbManager}setEnvironmentMap(e){const{url:t,intensity:r,rotation:i,maxLightSources:a}=e;this._sceneManager.setEnvironmentMap(t,r,i,a)}}__decorate([inject],RoomleGLBViewer.prototype,"_rapiAccess",void 0),__decorate([inject],RoomleGLBViewer.prototype,"_domHelper",void 0),__decorate([inject],RoomleGLBViewer.prototype,"_scriptLoader",void 0),__decorate([inject],RoomleGLBViewer.prototype,"_lifeCycleManager",void 0),__decorate([inject],RoomleGLBViewer.prototype,"_initData",void 0),__decorate([inject],RoomleGLBViewer.prototype,"_globalInitData",void 0),__decorate([inject],RoomleGLBViewer.prototype,"_unitFormatter",void 0),__decorate([inject],RoomleGLBViewer.prototype,"_idbManager",void 0);class GlbViewer extends Main{setupGlobals(){}setupDependencies(){RoomleDependencyInjection.setup(INJECTABLES),this.lookup("logger",this._context)}cleanUpGlobals(){throw new Error("Method not implemented.")}cleanUpDependencies(){throw new Error("Method not implemented.")}bootFinished(){this._viewer=new RoomleGLBViewer(this._context),window.RoomleGLBViewer||(window.RoomleGLBViewer=this._viewer)}getApi(){return this._viewer}getContextName(){return"glb-viewer"}}export{GlbViewer};
|
|
2
|
+
//# sourceMappingURL=glb-viewer-394c707d.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"glb-viewer-
|
|
1
|
+
{"version":3,"file":"glb-viewer-394c707d.js","sources":["../../node_modules/jszip/dist/jszip.min.js"],"sourcesContent":["export default \"static/jszip.min-c96375d50e72b199.js\""],"names":[],"mappings":"s7QAAe"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{b as CameraBehaviour}from"./camera-behaviour-152f3965.js";import{a as Vector3}from"./main-thread-to-worker-2003c1d9.js";class GlbViewerCameraBehaviour extends CameraBehaviour{get cameraControl(){return this._cameraControl}updateCameraOnItemLoaded(e){this.cameraControl.updateAndReset(e.getSize(new Vector3),e.getCenter(new Vector3),void 0,void 0,0,!1)}}export{GlbViewerCameraBehaviour as G};
|
|
2
|
+
//# sourceMappingURL=glb-viewer-camera-behaviour-6493fd42.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"glb-viewer-camera-behaviour-6493fd42.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
System.register(["./camera-behaviour-510b2914.nomodule.js","./main-thread-to-worker-4d246b8d.nomodule.js"],(function(e){var t,n;return{setters:[function(e){t=e.b},function(e){n=e.a}],execute:function(){e("G",class extends t{get cameraControl(){return this._cameraControl}updateCameraOnItemLoaded(e){this.cameraControl.updateAndReset(e.getSize(new n),e.getCenter(new n),void 0,void 0,0,!1)}})}}}));
|
|
2
|
+
//# sourceMappingURL=glb-viewer-camera-behaviour-fde73c18.nomodule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"glb-viewer-camera-behaviour-fde73c18.nomodule.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{GlbViewer}from"./glb-viewer-394c707d.js";import"./script-loader-8a74aea8.js";import"./query-params-helper-8d88a29e.js";import"./main-thread-to-worker-2003c1d9.js";import"./roomle-dependency-injection-9001109d.js";import"./camera-behaviour-152f3965.js";import"./default-light-setting-701866d7.js";import"./glb-viewer-camera-behaviour-6493fd42.js";(new GlbViewer).boot();
|
|
2
|
+
//# sourceMappingURL=glb-viewer-main-d031b69b.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"glb-viewer-main-d031b69b.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
System.register(["./glb-viewer-
|
|
1
|
+
System.register(["./glb-viewer-01ce04fe.nomodule.js","./script-loader-4c75ff92.nomodule.js","./query-params-helper-bf0b71cd.nomodule.js","./main-thread-to-worker-4d246b8d.nomodule.js","./roomle-dependency-injection-9ceffa50.nomodule.js","./camera-behaviour-510b2914.nomodule.js","./default-light-setting-998bc8a2.nomodule.js","./glb-viewer-camera-behaviour-fde73c18.nomodule.js"],(function(){var e;return{setters:[function(n){e=n.GlbViewer},function(){},function(){},function(){},function(){},function(){},function(){},function(){}],execute:function(){(new e).boot()}}}));
|
|
2
2
|
//# sourceMappingURL=glb-viewer-main.nomodule.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
System.register(["./main-thread-to-worker-
|
|
2
|
-
//# sourceMappingURL=TextGeometry-
|
|
1
|
+
System.register(["./main-thread-to-worker-b6add17c.legacy.js"],(function(e){var t,i,n,r,v,a;return{setters:[function(e){t=e._,i=e.e,n=e.f,r=e.b$,v=e.h,a=e.c0}],execute:function(){e("T",function(e){t(l,e);var a=i(l);function l(e){var t,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n(this,l);var v=i.font;if(void 0===v)t=a.call(this);else{var o=v.generateShapes(e,i.size);i.depth=void 0!==i.height?i.height:50,void 0===i.bevelThickness&&(i.bevelThickness=10),void 0===i.bevelSize&&(i.bevelSize=8),void 0===i.bevelEnabled&&(i.bevelEnabled=!1),t=a.call(this,o,i)}return t.type="TextGeometry",r(t)}return v(l)}(a))}}}));
|
|
2
|
+
//# sourceMappingURL=TextGeometry-c0ae932c.legacy.js.map
|
package/lib/legacy/{TextGeometry-98b17031.legacy.js.map → TextGeometry-c0ae932c.legacy.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextGeometry-
|
|
1
|
+
{"version":3,"file":"TextGeometry-c0ae932c.legacy.js","sources":["../../../node_modules/three/examples/jsm/geometries/TextGeometry.js"],"sourcesContent":["/**\n * Text = 3D Text\n *\n * parameters = {\n * font: <THREE.Font>, // font\n *\n * size: <float>, // size of the text\n * height: <float>, // thickness to extrude text\n * curveSegments: <int>, // number of points on the curves\n *\n * bevelEnabled: <bool>, // turn on bevel\n * bevelThickness: <float>, // how deep into text bevel goes\n * bevelSize: <float>, // how far from text outline (including bevelOffset) is bevel\n * bevelOffset: <float> // how far from text outline does bevel start\n * }\n */\n\nimport {\n\tExtrudeGeometry\n} from 'three';\n\nclass TextGeometry extends ExtrudeGeometry {\n\n\tconstructor( text, parameters = {} ) {\n\n\t\tconst font = parameters.font;\n\n\t\tif ( font === undefined ) {\n\n\t\t\tsuper(); // generate default extrude geometry\n\n\t\t} else {\n\n\t\t\tconst shapes = font.generateShapes( text, parameters.size );\n\n\t\t\t// translate parameters to ExtrudeGeometry API\n\n\t\t\tparameters.depth = parameters.height !== undefined ? parameters.height : 50;\n\n\t\t\t// defaults\n\n\t\t\tif ( parameters.bevelThickness === undefined ) parameters.bevelThickness = 10;\n\t\t\tif ( parameters.bevelSize === undefined ) parameters.bevelSize = 8;\n\t\t\tif ( parameters.bevelEnabled === undefined ) parameters.bevelEnabled = false;\n\n\t\t\tsuper( shapes, parameters );\n\n\t\t}\n\n\t\tthis.type = 'TextGeometry';\n\n\t}\n\n}\n\n\nexport { TextGeometry };\n"],"names":["exports","_ExtrudeGeometry","_inherits","TextGeometry","_super","_createSuper","text","_this","parameters","arguments","length","undefined","_classCallCheck","font","call","shapes","generateShapes","size","depth","height","bevelThickness","bevelSize","bevelEnabled","type","_possibleConstructorReturn","_createClass","ExtrudeGeometry"],"mappings":"mLAqBkBA,EAAA,aAAAC,GAAAC,EAAAC,EAAAF,GAAA,IAAAG,EAAAC,EAAAF,GAEjB,SAAAA,EAAaG,GAAwB,IAAAC,EAAlBC,EAAUC,UAAAC,OAAA,QAAAC,IAAAF,UAAA,GAAAA,UAAA,GAAG,GAAEG,OAAAT,GAEjC,IAAMU,EAAOL,EAAWK,KAExB,QAAcF,IAATE,EAEJN,EAAAH,EAAAU,eAEM,CAEN,IAAMC,EAASF,EAAKG,eAAgBV,EAAME,EAAWS,MAIrDT,EAAWU,WAA8BP,IAAtBH,EAAWW,OAAuBX,EAAWW,OAAS,QAItCR,IAA9BH,EAAWY,iBAA+BZ,EAAWY,eAAiB,SAC7CT,IAAzBH,EAAWa,YAA0Bb,EAAWa,UAAY,QAChCV,IAA5BH,EAAWc,eAA6Bd,EAAWc,cAAe,GAEvEf,EAAAH,EAAAU,KAAOC,KAAAA,EAAQP,GAIW,OAA3BD,EAAKgB,KAAO,eAAeC,EAAAjB,GAE3B,OAAAkB,EAAAtB,IA9ByBuB"}
|
package/lib/legacy/{banana-for-scale-bbc9f6d7.legacy.js → banana-for-scale-42179567.legacy.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
System.register(["./roomle-dependency-injection-
|
|
2
|
-
//# sourceMappingURL=banana-for-scale-
|
|
1
|
+
System.register(["./roomle-dependency-injection-4023fe40.legacy.js","./main-thread-to-worker-b6add17c.legacy.js"],(function(e){var n,t,a,s,i;return{setters:[function(e){n=e.aD,t=e._,a=e.i},function(e){s=e.g,i=e.a}],execute:function(){class c extends n{setScene(e){this._scene=e,this._staticItemLoader.loadGLB(s()+"static/banana_div2-1351c98ec2986be1.glb").then(e=>{this._banana=e.scene,this.updateBounds(null)})}updateBounds(e){if(e&&(this._bounds=e),this._bounds){if(this._banana){const e=this._bounds.getSize(new i),n=this._bounds.getCenter(new i).clone();n.x-=e.x/2+.18,n.z+=e.z/2+.05,n.y=0;let t=.03;this._banana.scale.copy(new i(t,t,t)),this._banana.rotation.y=.6,this._banana.position.copy(n)}this._scene.children.includes(this._banana)||this.addToScene()}}clearScene(e,n){super.clearScene(e,n),this.removeFromScene()}addToScene(){this._scene&&this._banana&&this._scene.add(this._banana)}removeFromScene(){this._scene&&this._banana&&this._scene.remove(this._banana)}}e("default",c),t([a],c.prototype,"_staticItemLoader",void 0)}}}));
|
|
2
|
+
//# sourceMappingURL=banana-for-scale-42179567.legacy.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"banana-for-scale-
|
|
1
|
+
{"version":3,"file":"banana-for-scale-42179567.legacy.js","sources":["../../../packages/configurator-core/public/geometry/banana_div2.glb"],"sourcesContent":["export default \"static/banana_div2-1351c98ec2986be1.glb\""],"names":[],"mappings":"yTAAe"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
System.register(["./main-thread-to-worker-
|
|
1
|
+
System.register(["./main-thread-to-worker-b6add17c.legacy.js","./query-params-helper-a1e13324.legacy.js"],(function(){var e,r,t;return{setters:[function(t){e=t.M,r=t.g},function(e){t=e.g}],execute:function(){new class{_addIframe(){const e="website-to-measure";if(document.getElementById(e))return void console.error("Iframe already added! Check how this can happen");const r=t();if(!r.checkUrl)return void console.error("CAN NOT MEASURE WITHOUT A URL, add checkUrl queryParam. To encode call BudgeteerMeasure.encodeUrl(url: string)");let o=this.decodeUrl(r.checkUrl);const i=window.location.origin;if(!o.startsWith(i))return void console.error("CAN ONLY MEASURE SAME ORIGIN PLEASE CHECK",{origin:i,src:o});const n=t(o),a=Object.keys(n).length?"&":"?";n._measureTraffic||(o+=a+"_measureTraffic=true");const s=document.createElement("iframe");s.id=e,s.src=o,document.body.appendChild(s)}_isAlreadyActive(){return navigator.serviceWorker.controller&&-1!==navigator.serviceWorker.controller.scriptURL.indexOf("budgeteer.sw")&&"activated"===navigator.serviceWorker.controller.state}_handleActiveSw(){this._mainThreadToWorker.setEventPoster(navigator.serviceWorker.controller),this._addIframe(),this._alreadyAdded=!0}constructor(){this._inLimbo=!1,this._alreadyAdded=!1,window.addEventListener("beforeunload",()=>this._inLimbo=!0),this._mainThreadToWorker=new e(this,navigator.serviceWorker),this._isAlreadyActive()?this._handleActiveSw():navigator.serviceWorker.register(r()+"static/budgeteer.sw-a4a226d2fc19672e.js",{scope:"../../"}).then(e=>{this._isAlreadyActive()&&this._handleActiveSw()},e=>console.error("Budgeteer registration failed: ",e)),navigator.serviceWorker.addEventListener("controllerchange",()=>this._mainThreadToWorker.setEventPoster(navigator.serviceWorker.controller)),window.BudgeteerMeasure={encodeUrl:this.encodeUrl}}encodeUrl(e){return encodeURIComponent(e)}decodeUrl(e){return decodeURIComponent(e)}onCommand(e){if(!this._inLimbo)switch(e){case 6:this._alreadyAdded||this._addIframe()}}}}}}));
|
|
2
2
|
//# sourceMappingURL=budgeteer-measure.legacy.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
System.register(["./roomle-dependency-injection-4023fe40.legacy.js","./main-thread-to-worker-b6add17c.legacy.js"],(function(t,e){var i,n,s,a,r,o,h,c,d,_,l,m,u,g,p,v,y,f,w,C,b,P,x,S,M,L,E,D,I,k,T,R,B,z,A,O,F,U,q,G,H,N,j,Z,W,K,Y,V,X,J,Q,$,tt,et,it,nt,st,at,rt,ot,ht,ct,dt,_t,lt,mt,ut,gt,pt,vt,yt,ft,wt,Ct,bt,Pt,xt;return{setters:[function(t){i=t._,n=t.i,s=t.E,a=t.t,r=t.H,o=t.J,h=t.K,c=t.p,d=t.s,_=t.M,l=t.N,m=t.O,u=t.Q,g=t.S,p=t.T,v=t.U,y=t.V,f=t.W,w=t.X,C=t.Y,b=t.Z,P=t.n,x=t.j,S=t.r},function(t){M=t.a,L=t.bK,E=t.Y,D=t.V,I=t.bL,k=t.al,T=t.ak,R=t.ap,B=t.Q,z=t.aK,A=t.O,O=t.J,F=t.bN,U=t.bO,q=t.bP,G=t.ad,H=t.bQ,N=t.C,j=t.v,Z=t.E,W=t.b1,K=t.S,Y=t.A,V=t.D,X=t.R,J=t._,Q=t.e,$=t.f,tt=t.bR,et=t.ax,it=t.h,nt=t.bj,st=t.k,at=t.bS,rt=t.y,ot=t.B,ht=t.K,ct=t.bT,dt=t.aw,_t=t.az,lt=t.aq,mt=t.ag,ut=t.au,gt=t.aX,pt=t.b7,vt=t.bU,yt=t.bM,ft=t.b2,wt=t.bG,Ct=t.l,bt=t.bx,Pt=t.bV,xt=t.bW}],execute:function(){t("T","static/Tween-d57ee5d181fce582.js");class St extends s{constructor(t,e,i){if(super(),this._tweenEnd=null,this._cameraStandingStill=!0,this._pitch=a(10),this._yaw=a(-30),this._distance=-1,this._locked=!1,this._inputListeners=[],this._lerpEnabled=!0,this._creator_=t,this._inputManager=e,this._initInputListener(),this._addInputListeners(),this._cameraPosition=new M,this._targetPosition=new M,i?this._cameraPosition.copy(i):this._cameraPosition=new M(0,.5,3),this._initData.debug){const t=this.getDebugCameraPosition();t&&this._setCurrentCameraParameters(t)}let n=this._domHelper.getClientDimensions();this._width=n.x,this._height=n.y,this._dispatchCameraIdle=L(this._dispatchCameraIdle.bind(this),32)}getCamera(){return this._getCamera()}_addInputListeners(){this._inputListeners.forEach(t=>{this._inputManager.addEventListener(t.key,t.fun,this)})}_removeInputListeners(){this._inputListeners.forEach(t=>{this._inputManager.removeEventListener(t.key,t.fun)}),this._inputListeners=[]}cleanUp(){this._removeInputListeners()}animateCamera(t){let e=this._cameraPosition;if(!e||r(e,this.getCamera().position))return this._cameraStandingStill||(this._cameraStandingStill=!0,setTimeout(()=>this._dispatchCameraIdle(),16),this._initData.debug&&this.saveDebugCameraPosition()),!1;if(this._cameraStandingStill&&this.dispatchEvent(7,3),this._cameraStandingStill=!1,!this._lerpEnabled||this._tweenEnd||this._initData.e2e)this.getCamera().position.copy(e);else{let i=this.getCamera().position.clone();const n=Math.min(10*t,1);i.lerp(e,n),this.getCamera().position.copy(i)}return!0}getDebugCameraPosition(){return JSON.parse(localStorage.getItem("debug_camera_position"))}saveDebugCameraPosition(){localStorage.setItem("debug_camera_position",JSON.stringify(this.getCurrentCameraParameters()))}_dispatchCameraIdle(){this.dispatchEvent(8,3)}_tweenCameraParameter(t,e,i=!1){return this._initData.e2e?(this.dispatchEvent(0,3),this.dispatchEvent(1,3),this._yaw=e.yaw,this._pitch=e.pitch,this._distance=e.distance,this._setCameraNear(),this._update(new M(e.targetX,e.targetY,e.targetZ),i),this.dispatchEvent(2,3),Promise.resolve()):new Promise(n=>{if(e.yaw-t.yaw<=-Math.PI?t.yaw-=2*Math.PI:e.yaw-t.yaw>=Math.PI&&(t.yaw+=2*Math.PI),window.TWEEN){if(null!==this._tweenEnd&&this._tweenEnd.blockOtherTweens)return;this._tweenEnd=e,new TWEEN.Tween(t).to(e,400).easing(TWEEN.Easing.Sinusoidal.In).onUpdate(()=>{this.dispatchEvent(1,3),this._yaw=t.yaw,this._pitch=t.pitch,this._distance=t.distance,this._setCameraNear(),this._update(new M(t.targetX,t.targetY,t.targetZ),i)}).onComplete(()=>{this.dispatchEvent(2,3),this._dispatchCameraIdle(),this._tweenEnd=null,n()}).start(),this.dispatchEvent(0,3)}})}_setCameraNear(){const t=this.getCamera();if(t instanceof E){const e=Math.max(.1,this._distance/6);t.near=e}}getCurrentCameraParameters(){const t=this._targetPosition.clone();return{yaw:this._yaw,pitch:this._pitch,distance:this._distance,targetX:t.x,targetY:t.y,targetZ:t.z}}_setCurrentCameraParameters(t){this._yaw=t.yaw,this._pitch=t.pitch,this._distance=t.distance,this._targetPosition.copy(new M(t.targetX,t.targetY,t.targetZ))}_rotateHorizontal(t){this._yaw-=t,this._yaw<-Math.PI?this._yaw+=2*Math.PI:this._yaw>Math.PI&&(this._yaw-=2*Math.PI)}_rotateVertical(t){this._pitch+=t,this._pitch<-Math.PI?this._pitch+=2*Math.PI:this._pitch>Math.PI&&(this._pitch-=2*Math.PI)}saveState(t){if(t||!this._stateSaved){let t=this._yaw,e=this._pitch,i=this._distance,n=this._targetPosition.clone();if(this._stateSaved={yaw:t,pitch:e,distance:i,targetX:n.x,targetY:n.y,targetZ:n.z,blockOtherTweens:!0},this._getCamera().fov){let t=this._getCamera();this._stateSaved.fov=t.fov,this._stateSaved.near=t.near,this._stateSaved.far=t.far}return this._stateSaved}return null}resetToState(){if(this._stateSaved){this._stateSaved.blockOtherTweens=!1;let t=this._targetPosition.clone();this._tweenCameraParameter({yaw:this._yaw,pitch:this._pitch,distance:this._distance,targetX:t.x,targetY:t.y,targetZ:t.z},this._stateSaved,!0)}this._stateSaved=null}setToState(t,e){this._tweenCameraParameter(t,e,!0)}hasSavedState(){return null!=this._stateSaved}lock(){this._locked=!0}unlock(){this._locked=!1}isLocked(){return this._locked}getTargetPosition(){return this._targetPosition}_saveYawAndPitch(){this._getCamera().userData.yaw=this._yaw,this._getCamera().userData.pitch=this._pitch}getInputPosition(t){const{x:e,y:i}=this._domHelper.getClientDimensions();return new M(t.x/e*2-1,-t.y/i*2+1,.5)}addLightContainer(t){t.name="lights";const e=this._getCamera(),i=e.children.find(t=>"lights"===t.name);i&&e.remove(i),e.add(t)}checkNearFarDistance(t){if(!t)return;const e=this._cameraPosition.distanceTo(t),i=this._getCamera();i instanceof E&&e>i.far&&(i.far=e+1)}setBounds(t){this._boundingBox=t}get domHelper(){return this._domHelper}}t("a",St),i([n],St.prototype,"_domHelper",void 0),i([n],St.prototype,"_initData",void 0);class Mt{constructor(t,e){this.minZoom=!1,this.maxZoom=!1,this.minZoom=t,this.maxZoom=e}}t("Z",Mt),t("D",2.725);class Lt extends St{constructor(t,e,i,n){super(t,e,i),this._bounds=new M,this._scale=1,this._state=0,this._zoomSpeed=Math.pow(.95,3),this.minDistance=0,this.maxDistance=5,this.minPolarAngle=a(0),this.maxPolarAngle=a(85),this._objectRotation=0,this.minAzimuthAngle=Number.NEGATIVE_INFINITY,this.maxAzimuthAngle=Number.POSITIVE_INFINITY,this._zoomDistance=.1,this._userInteraction=!1,this._currentZoomHash="",this._maxZoomedIn=!1,this._maxZoomedOut=!1,this._panningEnabled=!1,this._targetPositionIsPanned=!1,n?this._camera=n:this._initCamera(),this._camera.fov=30,this._targetPosition||(this._targetPosition=new M(0,0,0),this._targetPositionIsPanned=!1);const{cameraRestriction:s,zoomDistance:r,minVerticalCameraAngle:o,maxVerticalCameraAngle:h,minHorizontalCameraAngle:c,maxHorizontalCameraAngle:d}=this._initData;if(r&&(this._zoomDistance=r/100),void 0!==o&&(this.minPolarAngle=a(o<0?o:-1*o)),void 0!==h&&(this.maxPolarAngle=a(h)),void 0!==c&&(this.minAzimuthAngle=a(c<0?c:-1*c)),void 0!==d&&(this.maxAzimuthAngle=a(d)),void 0!==s){let t=Math.abs(a(s));this.minAzimuthAngle=-t,this.maxAzimuthAngle=t,this.maxPolarAngle=Math.min(t,a(85))}this._update()}_getCamera(){return this._camera||this._initCamera(),this._camera}getCamera(){return super.getCamera()}_initCamera(){this._camera=new E,this._camera.fov=30,this._camera.aspect=this._width/this._height,this._camera.near=.1,this._camera.far=100,this._camera.updateProjectionMatrix(),this._camera.layers.set(3),this._camera.layers.enable(1),this._camera.layers.enable(2),this._camera.layers.enable(6),this._camera.layers.enable(5)}setObjectRotation(t){this._objectRotation=t}getObjectRotation(){return this._objectRotation}updateCamera(){let{x:t,y:e}=this._domHelper.getClientDimensions();this._camera.aspect=t/e,this._camera.updateProjectionMatrix()}animateCamera(t){if(!super.animateCamera(t))return!1;let e=this._targetPosition;return!!e&&(this.getCamera().lookAt(e),!0)}_initInputListener(){this._inputListeners.push({key:3,fun:()=>{this._state=1}}),this._inputListeners.push({key:6,fun:t=>{var e,i;1!==this._state||this._locked||(this._userInteraction=!0,!(void 0!==(null===(e=t.event)||void 0===e?void 0:e.shiftKey)&&(null===(i=t.event)||void 0===i?void 0:i.shiftKey))&&this._panningEnabled&&this.disablePanning(),this._move(new D(t.position.x,t.position.y),t.type))}}),this._inputListeners.push({key:11,fun:t=>{1===this._state||this._locked||(this._userInteraction=!0,this._pan(new D(t.position.x,t.position.y),t.type))}}),this._inputListeners.push({key:4,fun:t=>{1===this._state&&this.dispatchEvent(2,t.type),this._state=0,this._orbitPosition=null,this._lerpEnabled=!0}}),this._inputListeners.push({key:7,fun:({event:t})=>{this._maxZoomedIn||(t&&(t.preventDefault(),t.stopPropagation()),this.zoomIn())}}),this._inputListeners.push({key:8,fun:({event:t})=>{this._maxZoomedOut||(t&&(t.preventDefault(),t.stopPropagation()),this.zoomOut())}})}_panTargetPosition(t){const e=t.clone().sub(this._orbitPosition),i=this._domHelper.element,n=this._targetPosition.project(this._camera),s=Math.max(2,4*(1-this._distance/this.maxDistance));n.x=n.x-e.x/i.clientHeight*s,n.y=n.y+e.y/i.clientHeight*s,this._targetPositionIsPanned=!0,this._targetPosition.copy(n.unproject(this._camera))}_pan(t,e){this._lerpEnabled=!1,this._orbitPosition||(this._orbitPosition=new D(t.x,t.y),this.dispatchEvent(0,e)),this._panTargetPosition(t),o(this._orbitPosition,t)||this.dispatchEvent(1,e),this._orbitPosition.copy(t),this._update()}_move(t,e){this._orbitPosition||(this._orbitPosition=new D(t.x,t.y),this.dispatchEvent(0,e));const i=t.clone().sub(this._orbitPosition),n=this._domHelper.element;this._panningEnabled?this._panTargetPosition(t):(this._rotateHorizontal(2*Math.PI*i.x/n.clientWidth*1),this._rotateVertical(2*Math.PI*i.y/n.clientHeight*1)),o(this._orbitPosition,t)||this.dispatchEvent(1,e),this._orbitPosition.copy(t),this._update()}checkBoundsAndPlaceCamera(t,e=!0){this._boundingBox&&h(t,this._boundingBox)<=0?this.setBounds(t):this.zoomToFitBounds(t,e)}adjustToBoundsWithoutChangingDistance(t){this.setBounds(t);const e=t.getSize(new M);if(this._initData.debug||e.x+e.y+e.z===0)return;const i=this.getCurrentCameraParameters(),n=t.getCenter(new M);this._setDistanceAndRangesBasedOnBounds(e,!1);const s={yaw:i.yaw,pitch:i.pitch,distance:this._distance,targetX:n.x,targetY:n.y,targetZ:n.z};I(i,s)||this._tweenCameraParameter(i,s,!1)}zoomToFitBounds(t,e=!0){this.setBounds(t);const i=t.getSize(new M);if(this._initData.debug||i.x+i.y+i.z===0)return;const n=this.getCurrentCameraParameters(),s=t.getCenter(new M),a=this._setDistanceAndRangesBasedOnBounds(i);this._checkZoomDistance(t,a);const r={yaw:e?this._yaw:n.yaw,pitch:e?this._pitch:n.pitch,distance:a,targetX:s.x,targetY:s.y,targetZ:s.z};I(n,r)||this._tweenCameraParameter(n,r,!1)}updateToBounds(t,e,i=!0,n){if(this.setBounds(t),this._initData.debug)return;const s=t.getCenter(new M);n?(this._targetPosition=n.clone(),this._targetPositionIsPanned=!1):this._targetPositionIsPanned||(this._targetPosition=new M(s.x,s.y,s.z));const a=this.getCurrentCameraParameters(),r=t.getSize(new M);if(i){const i=this._setDistanceAndRangesBasedOnBounds(r);this._distance=i,this._checkZoomDistance(t,i),this._userInteraction?this._tweenCameraParameter(a,{yaw:this._yaw,pitch:this._pitch,distance:this._distance,targetX:this._targetPosition.x,targetY:this._targetPosition.y,targetZ:this._targetPosition.z},e):this._update()}else this._setDistanceAndRangesBasedOnBounds(r,!1);this._update()}_checkZoomDistance(t,e){const i=t.getBoundingSphere(new k);e-i.radius<this._zoomDistance&&(console.warn("the initial camera position is closer than the zoomDistance param, zoomDistance is set to initial camera position."),this._zoomDistance=e-i.radius)}_setDistanceAndRangesBasedOnBounds(t,e=!0){const{offsetWidth:i,offsetHeight:n}=this._getOffset();this._bounds.copy(t);const{cameraSpacing:s}=this._initData;t.addScalar(s/100),this.minDistance=Math.sqrt(t.x*t.x+t.y*t.y+t.z*t.z);const a=Math.max(t.x,t.y),{x:r,y:o}=this._getMargin(i,n),h=c(t.x+r,t.y+o,t.z,this._camera.fov,i,n);return this._distance<h&&e&&(this._distance=h),this.maxDistance=h+a,this.maxDistance<2&&(this.maxDistance=2),this._camera.far=5*this.maxDistance,this._setCameraNear(),h}_getIdealDistance(){const{offsetWidth:t,offsetHeight:e}=this._getOffset(),{x:i,y:n}=this._getMargin(t,e);return c(this._bounds.x+i,this._bounds.y+n,this._bounds.z,this._camera.fov,t,e)}_getOffset(){const t=this._domHelper.getClientDimensions(),e=t.x,i=t.y;return{offsetWidth:this._camera.offset?e-e*this._camera.offset.left-e*(1-this._camera.offset.right):e,offsetHeight:this._camera.offset?i-i*this._camera.offset.bottom-i*(1-this._camera.offset.top):i}}_getMargin(t,e){let i=this._bounds.x/2,n=this._bounds.y/2;return t>1080&&(i+=this._bounds.x<.3?.2:0,i+=this._bounds.x*(t/1080-1)),e>1080&&(i+=this._bounds.y<.3?.2:0,n+=this._bounds.y*(e/1080-1)),{x:i,y:n}}reset(t,e,i,n,s=!0){const r=t.getSize(new M);if(r){if(e)this._targetPosition.copy(e);else{const e=t.getCenter(new M);this._targetPosition.copy(e)}const o=this.getCurrentCameraParameters();if(i||(i=-30),n||(n=10),i+=d(this._objectRotation),this._initData.debug)return this._distance=this._setDistanceAndRangesBasedOnBounds(r),this._update(this._targetPosition),void this._setDistanceAndRangesBasedOnBounds(r);const h=this._setDistanceAndRangesBasedOnBounds(r),c=a(n),_=a(i);let l=this._targetPosition.clone();s?this._tweenCameraParameter(o,{yaw:_,pitch:c,distance:h,targetX:l.x,targetY:l.y,targetZ:l.z},!0):(this._pitch=c,this._yaw=_,this._distance=h,this._update(this._targetPosition))}else console.warn("you cant reset without bounds!")}updateAndReset(t,e,i,n,s,r=!0){const o=new M(-t.x/2,0,-t.z/2),h=new M(t.x/2,t.y,t.z/2);if(this._boundingBox=new T(o,h),s&&t.addScalar(s),e?this._targetPosition.copy(e):(this._targetPosition=new M(0,t.y/2,0),this._targetPositionIsPanned=!1),-1===this._distance){const e=this._setDistanceAndRangesBasedOnBounds(t);this._distance=Math.max(2,e)}const c=this.getCurrentCameraParameters();i||(i=-30),n||(n=10),i+=d(this._objectRotation),this._pitch=a(n),this._yaw=a(i),this._setDistanceAndRangesBasedOnBounds(t);let _=this._targetPosition.clone();r?this._tweenCameraParameter(c,{yaw:this._yaw,pitch:this._pitch,distance:this.maxDistance,targetX:_.x,targetY:_.y,targetZ:_.z},!0):this._update(this._targetPosition)}_update(t,e){this._initData.debug?this._pitch=Math.max(a(-89),Math.min(a(89),this._pitch)):(this._yaw=Math.max(this.minAzimuthAngle,Math.min(this.maxAzimuthAngle,this._yaw)),this._pitch=Math.max(this.minPolarAngle,Math.min(this.maxPolarAngle,this._pitch))),this._saveYawAndPitch();const i=new R(-this._pitch,this._yaw,0,"ZYX"),n=(new B).setFromEuler(i),s=new M(0,0,-1);s.applyQuaternion(n),this._distance*=this._scale,this._initData.debug||(this._distance=Math.min(this.maxDistance,this._distance)),t&&this._targetPosition.copy(t);const r=this._targetPosition.clone().sub(s.multiplyScalar(this._distance));if(this._initData.debug)this._cameraPosition.copy(r),this._zoomChanged(!1,!1);else if(e)this._cameraPosition.copy(r);else{const t=this._getCameraSphere(r);null!=this._boundingBox&&this._boundingBox.intersectsSphere(t)&&this._scale>=1?this._distance+=.1:null==this._boundingBox||this._boundingBox.intersectsSphere(t)?this._zoomChanged(!1,!0):(this._cameraPosition.copy(r),this._distance===this.maxDistance?this._zoomChanged(!0,!1):this._zoomChanged(!1,!1))}this._scale=1}_zoomChanged(t,e){let i=t+""+e;0===this._currentZoomHash.length||this._currentZoomHash!==i?(this.dispatchEvent(5,new Mt(t,e)),this._currentZoomHash=i):t||e||this.dispatchEvent(5,new Mt(t,e)),this._maxZoomedIn=e,this._maxZoomedOut=t}zoomTo(t){return this._tweenCameraParameter(this.getCurrentCameraParameters(),t,!0)}_getCameraSphere(t){const e=Math.max(this._bounds.x,this._bounds.y),i=Math.max(e/10,this._zoomDistance);return new k(t,i)}zoomIn(t){this._lerpEnabled=!0,this._scale*=t?Math.pow(.95,t):this._zoomSpeed,this._setCameraNear(),this._update(),this.dispatchEvent(3)}zoomOut(t){this._lerpEnabled=!0,this._scale/=t?Math.pow(.95,t):this._zoomSpeed,this._setCameraNear(),this._update(),this.dispatchEvent(4)}clear(){this._userInteraction=!1,this._initData.debug||(this._distance=-1,this._targetPosition=new M(0,0,0),this._targetPositionIsPanned=!1)}async moveCamera(t){const{x:e,y:i,z:n}=this._boundingBox.getCenter(new M);t.targetX=t.targetX||e,t.targetY=t.targetY||i,t.targetZ=t.targetZ||n,t.distance=t.distance||this._getIdealDistance();const s=this.getCurrentCameraParameters(),a=z(JSON.parse(JSON.stringify(s)),t);return this._tweenCameraParameter(s,a,!0)}enablePanning(){this._lerpEnabled=!1,this._panningEnabled=!0}disablePanning(){this._lerpEnabled=!1,this._panningEnabled=!1}getKernelZoomFactor(){const t=this.maxDistance;return 1-this._distance/(t-2)+.2}}t("C",Lt);class Et{constructor(t,e){this._scene=t,e&&(e.removeFromScene(),e.cleanUp())}updateCamera(t){}reload(){this.removeFromScene(),this.addToScene()}updateBounds(t,e){this._bounds=t}cleanUp(){this._scene=null}}class Dt{constructor(t){this._innerSize=1,this._outerSize=100,this._plane=new A,this._plane.rotation.x=-Math.PI/2;const e=_.createMeshStandardMaterial({});this._innerPlaneMesh=new O,this._innerPlaneMesh.layers.set(2),this._innerPlaneMesh.material=e,this._innerPlaneMesh.receiveShadow=!0,this._outerPlaneMesh=new O,this._outerPlaneMesh.layers.set(2),this._outerPlaneMesh.material=e,this._outerPlaneMesh.receiveShadow=!0,this._plane.add(this._innerPlaneMesh),this._plane.add(this._outerPlaneMesh),this._innerSize=1,this._outerSize=t,this._updatePlane(this._innerSize,this._outerSize)}getRootNode(){return this._plane}getInnerPlane(){return this._innerPlaneMesh}getOuterPlane(){return this._outerPlaneMesh}updateSize(t){this._innerSize=t,this._updatePlane(this._innerSize,this._outerSize)}_updatePlane(t,e){const i=new F;i.moveTo(-t/2,-t/2),i.lineTo(-t/2,t/2),i.lineTo(t/2,t/2),i.lineTo(t/2,-t/2),i.lineTo(-t/2,-t/2);const n=new F;n.moveTo(-e/2,-e/2),n.lineTo(-e/2,e/2),n.lineTo(e/2,e/2),n.lineTo(e/2,-e/2),n.lineTo(-e/2,-e/2);const s=new U;s.moveTo(-t/2,-t/2),s.lineTo(-t/2,t/2),s.lineTo(t/2,t/2),s.lineTo(t/2,-t/2),s.lineTo(-t/2,-t/2),n.holes.push(s);const a=new q(i);this._innerPlaneMesh.geometry&&this._innerPlaneMesh.geometry.dispose(),this._innerPlaneMesh.geometry=a;const r=new q(n);this._outerPlaneMesh.geometry&&this._outerPlaneMesh.geometry.dispose(),this._outerPlaneMesh.geometry=r;const o=a.attributes.uv.clone();a.setAttribute("uv2",o);const h=a.attributes.uv2.array;for(let t=0;t<h.length;++t)h[t]+=.5}}class It extends Et{constructor(t,e,i){super(t,e),this._longestSide=2,this._bakedShadowPlane=new Dt(100),this._fog=i||!1,this._textureLoader=new G,this.addToScene()}needsBounds(){return!0}needsCamera(){return this._fog}needsRotation(){return!1}updateBounds(t){return super.updateBounds(t),this._longestSide=Math.max(t.x,t.z),this._update(),!0}updateCamera(t){this._cameraDistance=t.position.distanceTo(new M(0,0,0)),this._update()}_update(){this._fog&&this._updateFog()}_updateFog(){let t=this._longestSide/2;this._scene.fog=new H(16185078,this._cameraDistance+t+3,this._cameraDistance+t+3+1),this._scene.background=new N(16185078)}_updateFloor(){if(this._floorMaterial)this._bakedShadowPlane.getOuterPlane().material=this._floorMaterial,this._bakedShadowPlane.getInnerPlane().material=this._floorMaterial;else{let t=this._width/1e3,e=this._height/1e3;this._repeatable&&(this._floorTexture.wrapS=j,this._floorTexture.wrapT=j,this._floorTexture.repeat.set(100/t,100/e));let i=_.createMeshStandardMaterial({map:this._floorTexture,side:Z});this._bakedShadowPlane.getInnerPlane().material=i,this._bakedShadowPlane.getOuterPlane().material=i}}addToScene(){this._scene&&this._scene.add(this._bakedShadowPlane.getRootNode())}removeFromScene(){this._scene.remove(this._bakedShadowPlane.getRootNode())}setFloorMaterial(t,e,i,n){return this._width=e,this._height=i,this._repeatable=n,this._floorPromise=new Promise((e,i)=>{this._textureLoader.load(t,t=>{this._floorTexture=t,e()},null,i)}),new Promise((t,e)=>{this._floorPromise.then(()=>{this._updateFloor(),this._update(),t()},e)})}changeFloorMaterial(t,e){this._floorPromise=new Promise((i,n)=>{this._floorMaterial=l(t),this._rapiAccess.getTexturesOf(t).then(t=>{if(t.length>0){let s=[];t.forEach(t=>{s.push(m(this._dataSyncer.requestAsset(t.image,!0),t,this._floorMaterial,e,1,1))}),Promise.all(s).then(()=>{setTimeout(()=>i(),0)},n)}else setTimeout(()=>i(),0)})});let i=[this._floorPromise];return new Promise((t,e)=>{Promise.all(i).then(()=>{this._updateFloor(),this._update(),t()},e)})}showGUI(){this._floorMaterial?this._addGUI():this._floorPromise&&this._floorPromise.then(()=>this._addGUI())}_addGUI(){let t=u();if(!t)return;let e=t.addFolder("Floor");e.add(this._floorMaterial,"roughness").min(0).max(1).step(.01),e.add(this._floorMaterial,"reflectivity").min(0).max(1).step(.01),e.add(this._floorMaterial,"clearCoat").min(0).max(1).step(.01),e.add(this._floorMaterial,"clearCoatRoughness").min(0).max(1).step(.01),e.add(this._floorMaterial,"opacity").min(0).max(1).step(.01),e.add(this._floorMaterial,"metalness").min(0).max(1).step(.01),e.add(this._floorMaterial,"bumpScale").min(0).max(1).step(.01)}}t("F",It),i([n],It.prototype,"_rapiAccess",void 0),i([n],It.prototype,"_dataSyncer",void 0);const kt=Math.PI/4;class Tt extends St{constructor(t,e,i,n){super(t,e,i),this._state=0,this._rotationSpeed=1,this._keyMap=new Map,this.minPolarAngle=a(-60),this.maxPolarAngle=a(60),this._camera=n||new E,this._camera.fov=70,this._camera.aspect=this._width/this._height,this._camera.near=.1,this._camera.far=100,this._camera.updateProjectionMatrix(),this._camera.layers.set(3),this._camera.layers.enable(1),this._camera.layers.enable(2),this._camera.layers.enable(6),this._camera.layers.enable(5),i?this._camera.position.set(i.x,1.5,i.z):this._camera.position.set(0,1.5,0),this._cameraPosition=new M,this._cameraPosition.copy(this._camera.position),this._cameraRotation=new B,this._pitch=0,this._yaw=0;let s=new R(-this._pitch,this._yaw,0,"ZYX");this._cameraRotation.setFromEuler(s),window.addEventListener("gamepadconnected",this._gamepadConnected.bind(this)),window.addEventListener("gamepaddisconnected",this._gamepadDisconnected.bind(this))}_gamepadConnected(t){this.startButtonPressListener()}_gamepadDisconnected(t){window.cancelAnimationFrame(this._listenerLoopAnimationFrame)}startButtonPressListener(){this._listenerLoopAnimationFrame=window.requestAnimationFrame(()=>{this.buttonPressListener()})}buttonPressListener(){let t=navigator.getGamepads()[0];this._checkRightStick(t),this._checkLeftStick(t),this._checkButtons(t),this._processKeyMap(this._keyMap,.001),this.startButtonPressListener()}_checkRightStick(t){let e=t.axes[2],i=t.axes[3];Math.abs(e)>.2&&(this._rotateHorizontal(.01*kt*e),this._update(),this.dispatchEvent(1)),Math.abs(i)>.2&&(this._rotateVertical(.01*kt*i),this._update(),this.dispatchEvent(1))}_checkLeftStick(t){let e=t.axes[0],i=t.axes[1];Math.abs(i)>.2?i<0?this._keyMap.set(87,!0):this._keyMap.set(83,!0):t.buttons&&t.buttons[12]&&t.buttons[12].pressed?this._keyMap.set(87,!0):t.buttons&&t.buttons[13]&&t.buttons[13].pressed?this._keyMap.set(83,!0):(this._keyMap.set(87,!1),this._keyMap.set(83,!1)),Math.abs(e)>.2?e<0?this._keyMap.set(65,!0):this._keyMap.set(68,!0):(this._keyMap.set(65,!1),this._keyMap.set(68,!1))}_checkButtons(t){t.buttons&&t.buttons[6]&&t.buttons[6].pressed?this._keyMap.set(16,!0):this._keyMap.set(16,!1),t.buttons&&t.buttons[14]&&t.buttons[14].pressed?(this._keyMap.set(37,!0),this.dispatchEvent(1)):this._keyMap.set(37,!1),t.buttons&&t.buttons[15]&&t.buttons[15].pressed?(this._keyMap.set(39,!0),this.dispatchEvent(1)):this._keyMap.set(39,!1)}animateCamera(t){let e=this._cameraPosition,i=this._cameraRotation,n=this.getCamera(),s=r(e,n.position),a=g(i,n.quaternion);if(!e||s&&a)return!1;let o=this.getCamera().position.clone(),h=Math.min(10*t,1);o.lerp(e,h),this.getCamera().position.copy(o);let c=this.getCamera().quaternion.clone(),d=Math.min(5*t,1);c.slerp(i,d),this.getCamera().setRotationFromQuaternion(c);let _=!1;return this._keyMap.forEach(t=>{t&&(_=!0)}),_&&this._processKeyMap(this._keyMap,t),!0}_getCamera(){return this._camera}_initInputListener(){this._onKeyChanged=this._onKeyChanged.bind(this),window.addEventListener("keyup",this._onKeyChanged,!1),window.addEventListener("keydown",this._onKeyChanged,!1),this._inputListeners.push({key:3,fun:t=>{this._down(t)}}),this._inputListeners.push({key:6,fun:t=>{this._move(t)}}),this._inputListeners.push({key:4,fun:t=>{this._up(t)}})}_removeInputListener(){window.removeEventListener("keyup",this._onKeyChanged,!1),window.removeEventListener("keydown",this._onKeyChanged,!1)}_down(t){this._downPosition=t.position,this._position=t.position,this._state=1,2===t.type&&window.setTimeout(this._onLongDown.bind(this),350),2===t.type?this._rotationSpeed=.6:this._rotationSpeed=1}_move(t){this._position=t.position,1!==this._state||this._locked||this._orbit(new D(t.position.x,t.position.y)),2!==this._state||this._locked||(this._orbit(new D(t.position.x,t.position.y)),this._moveForward())}_up(t){1===this._state&&this.dispatchEvent(2),2===this._state&&this._keyMap.set(87,!1),this._state=0,this._orbitPosition=null}_onLongDown(){p(this._downPosition,this._position)<v&&1===this._state&&(this._state=2,this._orbit(new D(this._position.x,this._position.y)),this._moveForward())}_update(t){let e=new R(-this._pitch,this._yaw,0,"ZYX");this._cameraRotation.setFromEuler(e)}updateCamera(){let{x:t,y:e}=this._domHelper.getClientDimensions();this._camera.aspect=t/e,this._camera.updateProjectionMatrix()}_onKeyChanged(t){this._keyMap.set(t.keyCode,"keydown"===t.type),this.dispatchEvent(6),this._processKeyMap(this._keyMap,.001)&&t.preventDefault()}_processKeyMap(t,e){e=Math.min(e,.1);let i=new M(0,0,0),n=!1;return this._processUpDown(t,i,e),t.get(65)&&(i.x=-1*e),t.get(68)&&(i.x=1*e),t.get(37)&&(this._rotateHorizontal(-kt*this._rotationSpeed*e),n=!0),t.get(39)&&(this._rotateHorizontal(kt*this._rotationSpeed*e),n=!0),t.get(16)&&(i.x*=3,i.z*=3),!(0===i.x&&0===i.y&&0===i.z&&!n||(i.applyQuaternion(this.getCamera().quaternion),this._cameraPosition.add(new M(i.x,0,i.z)),this._update(),0))}_processUpDown(t,e,i){(t.get(87)||t.get(38))&&(e.z=-1*i),(t.get(83)||t.get(40))&&(e.z=1*i)}_orbit(t){this._orbitPosition||(this._orbitPosition=new D(t.x,t.y),this.dispatchEvent(0));let e=t.clone().sub(this._orbitPosition),i=this._domHelper.element instanceof Document?this._domHelper.element.body:this._domHelper.element;e.multiplyScalar(-1),this._rotateHorizontal(2*Math.PI*e.x/i.clientWidth*1),this._rotateVertical(2*Math.PI*e.y/i.clientHeight*1),o(this._orbitPosition,t)||this.dispatchEvent(1),this._orbitPosition.copy(t),this._update()}_moveForward(){this._keyMap.set(87,!0),this._processKeyMap(this._keyMap,.001)}_rotateVertical(t){let e=this._pitch+t;e>this.maxPolarAngle||e<this.minPolarAngle||(this._pitch=e,this._pitch<-Math.PI?this._pitch+=2*Math.PI:this._pitch>Math.PI&&(this._pitch-=2*Math.PI),this._saveYawAndPitch())}getKernelZoomFactor(){return this._camera.zoom}cleanUp(){super.cleanUp(),this._removeInputListener()}}t("c",Tt);class Rt extends Et{constructor(t,e,i,n,s){if(super(t,e),this._color=i,this._oldBackground=t.background,n&&s){this._canvas=n,this._style=document.createElement("style");let t='background-image: url("'+s+'"); background-size: cover;';this._style.innerText=".rml-scene-background {"+t+"}",this._canvas.appendChild(this._style)}}needsBounds(){return!0}needsCamera(){return!1}needsRotation(){return!1}addToScene(){this._scene&&this._color&&(this._scene.background=this._color),this._canvas&&this._canvas.classList&&(this._scene.background=null,this._canvas.classList.add("rml-scene-background"))}removeFromScene(){this._oldBackground&&(this._scene.background=this._oldBackground),this._canvas&&this._canvas.classList.remove("rml-scene-background")}showGUI(){}}t("B",Rt);class Bt{parse(t,e,i,n,s){let a=JSON.parse(n);return a.environment?this.load(t,e,i,a,s):null}load(t,e,i,n,s){let a,r=n.environment;if(!r)return console.warn("No environment set in scene settings"),Promise.resolve(null);switch(r.type){case"color":a=new Promise(e=>e(new Rt(t,i,new N(r.details.color))));break;case"image":a=new Promise(n=>n(new Rt(t,i,null,e,r.details.imageUrl)));break;case"floor":a=new Promise(e=>{this._rapiAccess.getMaterial(r.details.material).then(n=>{let a=void 0===r.details.fog||r.details.fog,o=new It(t,i,a);o.changeFloorMaterial(n,s).then(()=>{e(o)})})});break;default:console.warn("Could not load environment, return old environment"),a=new Promise(t=>t(i))}return a}}i([n],Bt.prototype,"_rapiAccess",void 0);class zt{constructor(t,e){this._scene=t,e&&e.removeFromScene()}needsBounds(){return!1}updateBounds(t){}getCameraContainer(){return this._cameraContainer||(this._cameraContainer=new A),this._cameraContainer}}t("L",zt);class At extends zt{constructor(t,e){super(t,e),this._lights=[]}needsBounds(){return!0}updateBounds(t){if(this._cameraLight){const e=this._cameraLight,i=new M;t.getSize(i);const n=1.5*Math.max(Math.max(i.x,i.y),i.z);this._boundingSize=n,e.shadow.camera.top=n/2,e.shadow.camera.bottom=-n/2,e.shadow.camera.left=-n/2,e.shadow.camera.right=n/2,e.shadow.camera.updateProjectionMatrix()}}loadFromJSON(t){return new Promise(e=>{this._lights=this._dynamicLightSettingLoader.parse(t),this.addToScene(),e()})}loadFromObject(t){return new Promise(e=>{(null==t?void 0:t.lights)||e(),this._lights=this._dynamicLightSettingLoader.load(t),this._lights.forEach((t,e)=>{t.userData.movesWithCamera&&(this._cameraLight=t,this._lights.splice(e,1))}),this.addToScene(),e()})}loadFromURL(t){return new Promise((e,i)=>{fetch(new Request(t,{method:"GET"})).then(W).then(t=>this.loadFromObject(t).then(e,i))})}addToScene(){this._lights.forEach(t=>{this._scene.add(t)}),this._cameraLight&&this._scene.add(this._cameraLight)}update(t,e){if(!this._cameraLight)return;let i=new M;t.getWorldDirection(i),i.multiplyScalar(-this._boundingSize);let n=e.clone().add(i);this._cameraLight.position.copy(n)}removeFromScene(){this._lights.forEach(t=>{this._scene.remove(t)}),this._cameraLight&&this._scene.remove(this._cameraLight)}reload(){this.removeFromScene(),this.addToScene()}showGUI(){let t=u();this._cameraLight&&this._addToGUI(t,this._cameraLight),this._lights.forEach(e=>{this._addToGUI(t,e)})}_addToGUI(t,e){t&&(e instanceof K&&this._addSpotLightToGUI(t,e),e instanceof Y&&this._addAmbientLightToGUI(t,e),e instanceof V&&this._addDirectionalLightToGUI(t,e),e instanceof X&&this._addRectAreaLightToGUI(t,e))}_addRectAreaLightToGUI(t,e){let i=t.addFolder(e.name),n={name:e.name,color:"#"+e.color.getHexString(),intensity:e.intensity*(e.width*e.height)};i.add(e,"visible"),i.add(n,"intensity").min(10).max(400).step(10).onChange(t=>{e.intensity=t/(e.width*e.height)}),i.add(e,"castShadow"),i.addColor(n,"color").onChange(t=>{e.color=new N(t)}),i.add(e.position,"x").min(-10).max(10).step(.1).onChange(()=>{e.lookAt(new M(0,0,0))}),i.add(e.position,"y").min(-10).max(10).step(.1).onChange(()=>{e.lookAt(new M(0,0,0))}),i.add(e.position,"z").min(-10).max(10).step(.1).onChange(()=>{e.lookAt(new M(0,0,0))})}_addSpotLightToGUI(t,e){let i=t.addFolder(e.name),n={name:e.name,color:"#"+e.color.getHexString(),angle:180*e.angle/Math.PI};i.add(e,"visible"),i.add(e,"intensity").min(0).max(5).step(.1),i.add(e,"penumbra").min(0).max(1).step(.1),i.addColor(n,"color").onChange(t=>{e.color=new N(t)}),i.add(n,"angle").min(10).max(180).step(1).onChange(t=>{e.angle=t*Math.PI/180}),i.add(e.position,"x").min(-10).max(10).step(.1).onChange(()=>{e.lookAt(new M(0,0,0))}),i.add(e.position,"y").min(-10).max(10).step(.1).onChange(()=>{e.lookAt(new M(0,0,0))}),i.add(e.position,"z").min(-10).max(10).step(.1).onChange(()=>{e.lookAt(new M(0,0,0))})}_addAmbientLightToGUI(t,e){let i={name:e.name,color:"#"+e.color.getHexString()},n=t.addFolder(e.name);n.add(e,"visible"),n.add(e,"intensity").min(0).max(5).step(.1),n.addColor(i,"color").onChange(t=>{e.color=new N(t)})}_addDirectionalLightToGUI(t,e){let i=t.addFolder(e.name),n={name:e.name,color:"#"+e.color.getHexString()};i.add(e,"visible"),i.add(e,"intensity").min(0).max(5).step(.1),i.addColor(n,"color").onChange(t=>{e.color=new N(t)}),i.add(e,"castShadow"),i.add(e.position,"x").min(-10).max(10).step(.1).onChange(()=>{e.lookAt(new M(0,0,0))}),i.add(e.position,"y").min(-10).max(10).step(.1).onChange(()=>{e.lookAt(new M(0,0,0))}),i.add(e.position,"z").min(-10).max(10).step(.1).onChange(()=>{e.lookAt(new M(0,0,0))})}}i([n],At.prototype,"_dynamicLightSettingLoader",void 0);var Ot=function(t){J(i,t);var e=Q(i);function i(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};$(this,i);var s=t.isCubeTexture,a=[s?"#define ENVMAP_TYPE_CUBE":""],r="\n\t\t\tvarying vec3 vWorldPosition;\n\n\t\t\tvoid main() {\n\n\t\t\t\tvec4 worldPosition = ( modelMatrix * vec4( position, 1.0 ) );\n\t\t\t\tvWorldPosition = worldPosition.xyz;\n\n\t\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n\t\t\t}\n\t\t\t",o=a.join("\n")+"\n\n\t\t\t\tvarying vec3 vWorldPosition;\n\n\t\t\t\tuniform float radius;\n\t\t\t\tuniform float height;\n\t\t\t\tuniform float angle;\n\n\t\t\t\t#ifdef ENVMAP_TYPE_CUBE\n\n\t\t\t\t\tuniform samplerCube map;\n\n\t\t\t\t#else\n\n\t\t\t\t\tuniform sampler2D map;\n\n\t\t\t\t#endif\n\n\t\t\t\t// From: https://www.shadertoy.com/view/4tsBD7\n\t\t\t\tfloat diskIntersectWithBackFaceCulling( vec3 ro, vec3 rd, vec3 c, vec3 n, float r ) \n\t\t\t\t{\n\n\t\t\t\t\tfloat d = dot ( rd, n );\n\n\t\t\t\t\tif( d > 0.0 ) { return 1e6; }\n\n\t\t\t\t\tvec3 o = ro - c;\n\t\t\t\t\tfloat t = - dot( n, o ) / d;\n\t\t\t\t\tvec3 q = o + rd * t;\n\n\t\t\t\t\treturn ( dot( q, q ) < r * r ) ? t : 1e6;\n\n\t\t\t\t}\n\n\t\t\t\t// From: https://www.iquilezles.org/www/articles/intersectors/intersectors.htm\n\t\t\t\tfloat sphereIntersect( vec3 ro, vec3 rd, vec3 ce, float ra ) {\n\n\t\t\t\t\tvec3 oc = ro - ce;\n\t\t\t\t\tfloat b = dot( oc, rd );\n\t\t\t\t\tfloat c = dot( oc, oc ) - ra * ra;\n\t\t\t\t\tfloat h = b * b - c;\n\n\t\t\t\t\tif( h < 0.0 ) { return -1.0; }\n\n\t\t\t\t\th = sqrt( h );\n\n\t\t\t\t\treturn - b + h;\n\n\t\t\t\t}\n\n\t\t\t\tvec3 project() {\n\n\t\t\t\t\tvec3 p = normalize( vWorldPosition );\n\t\t\t\t\tvec3 camPos = cameraPosition;\n\t\t\t\t\tcamPos.y -= height;\n\n\t\t\t\t\tfloat intersection = sphereIntersect( camPos, p, vec3( 0.0 ), radius );\n\t\t\t\t\tif( intersection > 0.0 ) {\n\n\t\t\t\t\t\tvec3 h = vec3( 0.0, - height, 0.0 );\n\t\t\t\t\t\tfloat intersection2 = diskIntersectWithBackFaceCulling( camPos, p, h, vec3( 0.0, 1.0, 0.0 ), radius );\n\t\t\t\t\t\tp = ( camPos + min( intersection, intersection2 ) * p ) / radius;\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tp = vec3( 0.0, 1.0, 0.0 );\n\n\t\t\t\t\t}\n\n\t\t\t\t\treturn p;\n\n\t\t\t\t}\n\n\t\t\t\t#include <common>\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvec3 projectedWorldPosition = project();\n\n\t\t\t\t\t#ifdef ENVMAP_TYPE_CUBE\n\n\t\t\t\t\t\tvec3 outcolor = textureCube( map, projectedWorldPosition ).rgb;\n\n\t\t\t\t\t#else\n\n\t\t\t\t\t\tvec3 direction = normalize( projectedWorldPosition );\n\t\t\t\t\t\tvec2 uv = equirectUv( direction );\n\t\t\t\t\t\tvec3 outcolor = texture2D( map, uv ).rgb;\n\n\t\t\t\t\t#endif\n\n\t\t\t\t\tgl_FragColor = vec4( outcolor, 1.0 );\n\n\t\t\t\t\t#include <tonemapping_fragment>\n\t\t\t\t\t#include <colorspace_fragment>\n\n\t\t\t\t}\n\t\t\t\t",h={map:{value:t},height:{value:n.height||15},radius:{value:n.radius||100}},c=new tt(1,16),d=new et({uniforms:h,fragmentShader:o,vertexShader:r,side:Z});return e.call(this,c,d)}return it(i,[{key:"radius",get:function(){return this.material.uniforms.radius.value},set:function(t){this.material.uniforms.radius.value=t}},{key:"height",get:function(){return this.material.uniforms.height.value},set:function(t){this.material.uniforms.height.value=t}}]),i}(O);class Ft extends Et{constructor(t,e,i){super(t,e),this.updateEnvironmentTexture(i)}updateEnvironmentTexture(t){t&&(this._environmentTexture=t,this._skybox=new Ot(this._environmentTexture),this._skybox.name="Ground projected skybox",this._skybox.scale.setScalar(100)),this.reload()}needsBounds(){return!1}needsCamera(){return!1}needsRotation(){return!1}addToScene(){this._scene&&this._skybox&&this._scene.add(this._skybox)}removeFromScene(){this._scene&&this._skybox&&this._scene.remove(this._skybox)}showGUI(t){let e=u();if(!e)return;let i=e.addFolder("Ground Projected Environment");i.add(this._skybox,"height").min(10).max(100).step(.1).onChange(t),i.add(this._skybox,"radius").min(20).max(200).step(.1).onChange(t)}}class Ut{constructor(t){this._lightSourceDetector=t}static createPlane(t,e){const i=new nt(2,1),n=null!=e?e:new st({color:12632256,side:Z}),s=new O(i,n);return s.position.z=-.1,t.add(s),s}createDebugScene(t,e){this._scene=t,this._createLightGraphInMap(this._lightSourceDetector.sampleUVs,this._lightSourceDetector.lightSamples,this._lightSourceDetector.lightGraph,e)}_createLightGraphInMap(t,e,i,n){const s=[],a=[];for(let t=0;t<this._lightSourceDetector.lightGraph.noOfNodes;++t)0===i.adjacent[t].length?s.push(e[t]):a.push(e[t]);const r=s.map(t=>t.uv),o=a.map(t=>t.uv),h=t.filter(t=>!r.includes(t)&&!o.includes(t));this._createSamplePointsInMap(h,.005,16711680),this._createSamplePointsInMap(r,.01,255),this._createSamplePointsInMap(o,.01,65280),this._createClusterLinesInMap(this._lightSourceDetector.lightSamples,this._lightSourceDetector.lightGraph.edges,128);const c=this._lightSourceDetector.lightSources.map(t=>t.uv);this._createSamplePointsInMap(c,.015,16776960);let d=this._lightSourceDetector.lightSources;void 0!==n&&n>=0&&n<d.length&&(d=d.slice(0,n)),this._createCirclesInMap(d,8421376)}_createSamplePointsInMap(t,e,i){const n=new at(e,8,4),s=new st({color:i});t.forEach(t=>{var e;const i=new O(n,s);i.position.copy(this._uvToMapPosition(t)),i.name="samplePoint",null===(e=this._scene)||void 0===e||e.add(i)})}_createCirclesInMap(t,e){const i=new st({color:e,transparent:!0,opacity:.5});t.forEach(t=>{var e;const n=new at(t.size,8,4),s=new O(n,i);s.position.copy(this._uvToMapPosition(t.uv)),s.name="samplePoint",null===(e=this._scene)||void 0===e||e.add(s)})}_createClusterLinesInMap(t,e,i){var n;const s=new rt({color:i}),a=[];e.forEach(e=>{for(let i=1;i<e.length;i++){const n=t[e[0]].uv,s=t[e[i]].uv;if(a.push(this._uvToMapPosition(n)),Math.abs(n.x-s.x)>.5){const t=(n.y+s.y)/2,e=n.x<s.x?0:1;a.push(this._uvToMapPosition(new D(e,t))),a.push(this._uvToMapPosition(new D(1-e,t)))}a.push(this._uvToMapPosition(s))}});const r=(new ot).setFromPoints(a),o=new ht(r,s);o.name="clusterLine",null===(n=this._scene)||void 0===n||n.add(o)}_uvToMapPosition(t){return new M(2*t.x-1,t.y-.5,0)}}class qt extends ct{constructor(t){super(t),this._extendedEquirectMaterial=this._createEquirectMaterial()}fromEquirectangularTexture(t,e){var i,n;const s=null!==(i=null==e?void 0:e.rotation)&&void 0!==i?i:0,a=null!==(n=null==e?void 0:e.intensity)&&void 0!==n?n:1;return this._extendedEquirectMaterial.uniforms.intensity.value=a,this._extendedEquirectMaterial.uniforms.rotationMatrix.value.set(Math.cos(s),0,-Math.sin(s),0,1,0,Math.sin(s),0,Math.cos(s)),super.fromEquirectangular(t)}_createEquirectMaterial(){const t=new et({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null},intensity:{value:1},rotationMatrix:{value:new dt}},vertexShader:Gt,fragmentShader:Ht,blending:_t,depthTest:!1,depthWrite:!1});return this._equirectMaterial=t,t}}const Gt="\nprecision mediump float;\nprecision mediump int;\nattribute float faceIndex;\nvarying vec3 vOutputDirection;\nuniform mat3 rotationMatrix;\n\n// RH coordinate system; PMREM face-indexing convention\nvec3 getDirection( vec2 uv, float face ) {\n uv = 2.0 * uv - 1.0;\n vec3 direction = vec3( uv, 1.0 );\n if ( face == 0.0 ) {\n direction = direction.zyx; // ( 1, v, u ) pos x\n } else if ( face == 1.0 ) {\n direction = direction.xzy;\n direction.xz *= -1.0; // ( -u, 1, -v ) pos y\n } else if ( face == 2.0 ) {\n direction.x *= -1.0; // ( -u, v, 1 ) pos z\n } else if ( face == 3.0 ) {\n direction = direction.zyx;\n direction.xz *= -1.0; // ( -1, v, -u ) neg x\n } else if ( face == 4.0 ) {\n direction = direction.xzy;\n direction.xy *= -1.0; // ( -u, -1, v ) neg y\n } else if ( face == 5.0 ) {\n direction.z *= -1.0; // ( u, v, -1 ) neg z\n }\n return direction;\n}\n\nvoid main() {\n vOutputDirection = rotationMatrix * getDirection(uv, faceIndex);\n gl_Position = vec4(position, 1.0);\n}\n",Ht="\nprecision mediump float;\nprecision mediump int;\nvarying vec3 vOutputDirection;\nuniform sampler2D envMap;\nuniform float intensity;\n\n#include <common>\n\nvoid main() { \n vec3 outputDirection = normalize(vOutputDirection);\n vec2 uv = equirectUv(outputDirection);\n gl_FragColor = vec4(texture2D(envMap, uv).rgb * intensity, 1.0);\n}\n";class Nt{}class jt{get lightSources(){return this._lightSources}set rotation(t){this._rotation!==t&&(this._rotation=t,this.needsUpdate=!0)}set intensity(t){this._intensity!==t&&(this._intensity=t,this.needsUpdate=!0)}set maxNoOfLightSources(t){this._maxNoOfLightSources!==t&&(this._maxNoOfLightSources=t,this.needsUpdate=!0)}get maxNoOfLightSources(){return this._maxNoOfLightSources}constructor(t,e){var i,n;this.needsUpdate=!0,this._lightSources=[],t instanceof Nt?this.environmentSceneGenerator=t:t instanceof lt?this.cubeTexture=t:t instanceof mt&&(this.equirectangularTexture=t),(null==e?void 0:e.textureData)&&(this.textureData=null==e?void 0:e.textureData),this._rotation=null!==(i=null==e?void 0:e.rotation)&&void 0!==i?i:0,this._intensity=null!==(n=null==e?void 0:e.intensity)&&void 0!==n?n:1,void 0!==(null==e?void 0:e.maxNoOfLightSources)&&(this._maxNoOfLightSources=e.maxNoOfLightSources),this._parameters=e,this._environment=t}clone(){return new jt(this._environment,this._parameters)}createNewEnvironment(t){const e=this._createPmremTexture(t),i=this._detectLightSources(t,e);return this._lightSources=i.lightSources,null!=e?e:null}_getTextureOffset(){const t=this._rotation/(2*Math.PI)%1;return new D(t,0)}_createPmremTexture(t){const e=new qt(t);let i;if(this.equirectangularTexture)this.equirectangularTexture.offset.copy(this._getTextureOffset()),i=e.fromEquirectangularTexture(this.equirectangularTexture,{rotation:this._rotation,intensity:this._intensity});else if(this.cubeTexture)i=e.fromCubemap(this.cubeTexture);else if(this.environmentSceneGenerator){const t=this.environmentSceneGenerator.generateScene(this._intensity,this._rotation);i=e.fromScene(t,.04)}return this._debugScene=void 0,this.needsUpdate=!1,null==i?void 0:i.texture}_detectLightSources(t,e){const i=new y;return this.equirectangularTexture&&0===this.rotation?i.detectLightSources(t,this.equirectangularTexture,this.textureData):e&&i.detectLightSources(t,e),i}createDebugScene(t,e,i){const n=null!=i?i:-1;if(this._debugScene&&n===this._debugScene.userData.maximumNumberOfLightSources)return this._debugScene;this._debugScene=new ut;const s=new f(!0,!1);s.setSourceTexture(e.environment),Ut.createPlane(this._debugScene,s);const a=this._detectLightSources(t,e.environment);return new Ut(a).createDebugScene(this._debugScene,n),this._debugScene.userData.maximumNumberOfLightSources=n,this._debugScene}}class Zt extends Nt{constructor(t={}){super(),this._parameters={},this._parameters=t}generateScene(t,e){const i=new Wt({...this._parameters,lightIntensity:t*(this._parameters.lightIntensity||1),topLightIntensity:t*(this._parameters.topLightIntensity||1),sidLightIntensity:t*(this._parameters.sidLightIntensity||1)});return i.rotation.y=e,i}}class Wt extends ut{constructor(t={}){var e;super(),this._type=null!==(e=null==t?void 0:t.type)&&void 0!==e?e:"all_around",this._topLightIntensity=(null==t?void 0:t.topLightIntensity)||(null==t?void 0:t.lightIntensity)||1,this._sideLightIntensity=(null==t?void 0:t.sidLightIntensity)||(null==t?void 0:t.lightIntensity)||1,this._sideReflectorIntensity=(null==t?void 0:t.sidLightIntensity)||(null==t?void 0:t.lightIntensity)||1;const i="front"===this._type?.7:0;this._ambientLightIntensity=(null==t?void 0:t.ambientLightIntensity)||i,this._colorVariation=(null==t?void 0:t.colorVariation)||.5,this._lightGeometry=new gt,this._lightGeometry.deleteAttribute("uv"),this._reflectorLightGeometry=new pt(.7,.4,2,32),this._reflectorLightGeometry.deleteAttribute("uv"),this.generateScene(this)}generateScene(t){switch(this._type){default:case"all_around":this._createAllAroundSceneLight(t);break;case"front":this._createFrontSceneLight(t)}}dispose(){const t=new Set;this.traverse(e=>{e.isMesh&&(t.add(e.geometry),t.add(e.material))});for(const e of t)e.dispose()}_createAllAroundSceneLight(t){const e=this._ambientLightIntensity;this.background=new N(e,e,e),this._createTopLight(t,6,1);for(let e=0;e<6;e++){const i=e*Math.PI*2/6,n=Math.sin(i),s=Math.cos(i);e%2==0?this._createReflector(t,new D(n,s),3,1,.8,.2):this._createSideLight(t,new D(n,s),(e-1)/2,15,1.1,.33,1)}}_createFrontSceneLight(t){const e=this._ambientLightIntensity;this.background=new N(e,e,e),this._createTopLight(t,10,.7);for(let e=0;e<6;e++){const i=e*Math.PI*2/6,n=Math.sin(i),s=Math.cos(i);if(0===e){this._createReflector(t,new D(n,s),1.1,.6,.8,-.4);for(let i=0;i<2;i++){const n=(e-.3+.6*i)*Math.PI*2/6,s=Math.sin(n),a=Math.cos(n);this._createSideLight(t,new D(s,a),(e-1)/2,50,1.2,.7,.8)}}else this._createReflector(t,new D(n,s),1.1,.7,1.4,0)}}_createAreaLightMaterial(t,e,i){const n=new st;return n.color.set(t,null!=e?e:t,null!=i?i:t),n}_createTopLight(t,e,i){const n=new O(this._lightGeometry,this._createAreaLightMaterial(e*this._topLightIntensity));n.position.set(0,20,0),n.scale.set(5*i,.1,5*i),t.add(n)}_createSideLight(t,e,i,n,s,a,r){for(let o=0;o<3;o++){const h=n*this._sideLightIntensity,c=new O(this._lightGeometry,this._createAreaLightMaterial((o+i)%3==0?h:h*(1-this._colorVariation),(o+i)%3==1?h:h*(1-this._colorVariation),(o+i)%3==2?h:h*(1-this._colorVariation))),d=(1===o?-e.y:2===o?e.y:0)/Math.sqrt(2),_=0===o?0:1,l=(1===o?e.x:2===o?-e.x:0)/Math.sqrt(2);c.position.set(e.x*r*15+1.1*d*s,15*a+1.1*_*s,e.y*r*15+1.1*l*s),c.rotation.set(0,Math.atan2(e.x,e.y),0),c.scale.setScalar(s),t.add(c)}}_createReflector(t,e,i,n,s,a){const r=new O(this._reflectorLightGeometry,this._createAreaLightMaterial(i*this._sideReflectorIntensity));r.position.set(15*e.x,10*a,15*e.y),r.scale.set(10*n,10*s,10*n),t.add(r)}}class Kt{get cameraBehaviour(){return this._cameraBehaviour}onBeforeRender(){}constructor(t,e,i,n){this._depthWriteMaterial=new st({colorWrite:!1}),this._maxAnisotropy=1,this._clock=new vt,this._delta=0,this._renderListener=null,this._stopRendering=!1,this._forceRender=!1,this._lastChange=Date.now(),this._running=!1,this._perspectiveOffsetCamera=null,this._orthographicOffsetCamera=null,this._onAfterRender=()=>{},this._creator_=t,this._canvasID=i,this._renderListener=()=>{this._requestRender()},this.createCameraControl(yt(n),e),this._setupScene(e,!1),this._lifeCycleManager.addEventListener(this)}addEventListener(t){throw new Error("Method not implemented.")}removeEventListener(t){throw new Error("Method not implemented.")}_changeCameraBehaviour(t){this._cameraBehaviour&&(this.cameraBehaviour.cameraControl&&this.cameraBehaviour.cameraControl.cleanUp(),this.cameraBehaviour.cameraControl instanceof Tt&&(this._getInputManager().removeEventListener(7,this._renderListener),this._getInputManager().removeEventListener(8,this._renderListener))),this._cameraBehaviour=t,this._cameraBehaviour.setCameraChangeListener(this.onCameraChanged),t.cameraControl instanceof Tt&&(this._getInputManager().addEventListener(7,this._renderListener,this),this._getInputManager().addEventListener(8,this._renderListener,this)),this.cameraBehaviourChanged()}onCameraChanged(){}cameraBehaviourChanged(){}_addCameraControlListener(){this.cameraBehaviour.cameraControl.addEventListener(0,()=>{var t;null===(t=this._roomleRenderer)||void 0===t||t.movingCameraStarts(),this._requestRender()},this),this.cameraBehaviour.cameraControl.addEventListener(1,this._requestRender,this),this.cameraBehaviour.cameraControl.addEventListener(2,()=>{var t;null===(t=this._roomleRenderer)||void 0===t||t.movingCameraStops(),this._requestRender()},this),this.cameraBehaviour.cameraControl.addEventListener(6,this._requestRender,this)}_renderEverything(){var t;this._roomleRenderer&&(this._forceRender=!0,null===(t=this._roomleRenderer)||void 0===t||t.forceShadowUpdates(!1)),this._requestRender()}_renderWithoutShadowsAndAO(){this._roomleRenderer&&(this._forceRender=!0),this._requestRender()}_requestRender(){if(!this._renderer||this._stopRendering)return;const t=()=>{var e,i;this._delta=this._clock.getDelta(),this._animateCamera(),this.cameraBehaviour.cameraControl.getCamera().layers.mask=65535,this._renderLoopFunction&&(this._renderLoopFunction(),this._renderLoopFunction=null),this.onBeforeRender(),this._roomleRenderer?(null===(e=this._statsHelper)||void 0===e||e.updateRenderInfo(this._roomleRenderer.renderer.info),this._roomleRenderer.render(this._scene,this.cameraBehaviour.cameraControl.getCamera()),this._forceRender=!1,this._shouldRenderUi()&&this._renderUi()):(null===(i=this._statsHelper)||void 0===i||i.updateRenderInfo(this._renderer.info),this._renderer.render(this._scene,this.cameraBehaviour.cameraControl.getCamera())),this._onAfterRender(),window.TWEEN&&TWEEN.update(),this._lastChange+3e3<Date.now()||this._stopRendering?this._running=!1:(this._running=!0,requestAnimationFrame(t))};this._lastChange=Date.now(),this._running||this._stopRendering||(this._running=!0,requestAnimationFrame(t))}_shouldRenderUi(){return this._pluginSystem&&this._pluginSystem.needsUiScene()}_renderUi(){const t=this._scene.background?this._scene.background.clone():null;this._scene.overrideMaterial=this._depthWriteMaterial,this._scene.background=null,this._renderer.render(this._scene,this.cameraBehaviour.cameraControl.getCamera()),this._scene.overrideMaterial=null;const e=this._renderer.autoClear;this._renderer.autoClear=!1,this._renderer.clearDepth(),this._renderer.render(this._uiScene,this.cameraBehaviour.cameraControl.getCamera()),this._renderer.autoClear=e,this._scene.background=t}_animateCamera(){this.cameraBehaviour.cameraControl&&(this.cameraBehaviour.cameraControl.animateCamera(this._delta)||!this.shouldClearShadowsAndAO()||this._forceRender)&&this._lightSetting instanceof At&&this.cameraBehaviour.cameraControl.getCamera()instanceof E&&this._lightSetting.update(this.cameraBehaviour.cameraControl.getCamera(),this.cameraBehaviour.cameraControl.getTargetPosition()),this._environment&&this._environment.needsCamera()&&this.cameraBehaviour.cameraControl instanceof Lt&&this._environment.updateCamera(this.cameraBehaviour.cameraControl.getCamera())}shouldClearShadowsAndAO(){return!1}_setupScene(t,e){var i;const{x:n,y:s}=this._domHelper.getClientDimensions();this._scene=new ut,this._uiScene=new ut,(e=e||!1)||(this._scene.background=ft(this._initData.colors.DEFAULT_BACKGROUND)),this._renderer=new wt({antialias:!this._initData.e2e,alpha:!0});const a=this._initData.autoQuality?Math.min(window.devicePixelRatio,1.5):window.devicePixelRatio;this._renderer.setPixelRatio(a),this._renderer.setSize(n,s),this._renderer.outputColorSpace=Ct,this._renderer.autoClear=!1,this._renderer.shadowMap.enabled=!0,this._renderer.shadowMap.type=bt,this._maxAnisotropy=this._renderer.capabilities.getMaxAnisotropy(),this._initData.e2e||(this._roomleRenderer=new w(this._renderer,n,s),this._roomleRenderer.setQualityMap(C),this._roomleRenderer.setAutoQuality(this._initData.autoQuality),this._roomleRenderer.setShadingType(this._initData.shading),this._roomleRenderer.setCustomShadingParameters(this._initData.customShading),null===(i=this._roomleRenderer)||void 0===i||i.setSize(n,s)),this._renderer.domElement.classList.add(this._canvasID),this._domHelper.element.appendChild(this._renderer.domElement),this._getInputManager().addEvents(this._renderer.domElement),this._hdrEnvironmentLoader.registerEnvironmentChangedCallback(t=>{this._setEnvMap(t)}),this._initData.legacyLight?this.loadEnvMap("static/legacy_env-d5810ec5057d4716.exr"):this._initData.sceneLight?this._setDefaultEnvironmentScene():this.loadEnvMap(this._initData.envMapUrl),this._requestRender(),window.addEventListener("resize",this,!1),window.addEventListener("keydown",this,!1),window.addEventListener("keyup",this,!1),document.addEventListener("visibilitychange",this),this._pluginSystem.init(this._scene,this._uiScene,this.cameraBehaviour.cameraControl.getCamera().position),this._addCameraControlListener(),this.sceneChanged()}async loadEnvMap(t){await this._hdrEnvironmentLoader.loadUrl(this._renderer,t)}_setDefaultEnvironmentScene(){const t=this._initData.sceneLight;this._scene.userData.environmentDefinition=new jt(new Zt({type:t}),{rotation:this._initData.envMapRotation,intensity:this._initData.envMapIntensity,maxNoOfLightSources:this._initData.maxLightSources}),this._scene.userData.shadowFromEnvironment=!0,this._requestRender()}_setEnvMap(t){const{url:e,environmentMap:i}=t;this._scene.environment=i,this._scene.userData.environmentDefinition=new jt(i,{rotation:this._initData.envMapRotation,intensity:this._initData.legacyLight?.9:this._initData.envMapIntensity,maxNoOfLightSources:this._initData.maxLightSources}),this._scene.userData.shadowFromEnvironment=!this._initData.legacyLight,this._environment instanceof Ft&&this._environment.updateEnvironmentTexture(i),e!==b||this._initData.e2e||window.requestIdleCallback(this.loadEnvMap.bind(this,"static/default_1k-2aa6d42244d30fb1.exr")),this._requestRender()}_tabVisible(){this.updateCamera(!1)}_releaseKeystrokeStates(){const t=["Shift","Meta","Control","Escape"];for(const e of t){const t=new KeyboardEvent("keyup",{key:e});this._onKeyUp(t,!0)}}updateCamera(t=!0){var e;const{x:i,y:n}=this._domHelper.getClientDimensions();null===(e=this._roomleRenderer)||void 0===e||e.setSize(i,n),this.cameraBehaviour.cameraControl.updateCamera(),this._renderEverything()}_onWindowResize(){const t=this._getInputManager();t&&t.updateSize(),this.updateCamera(),this._requestRender()}_isPartOfScene(t){return"Object3D"===t.type||"Mesh"===t.type||"GLB"===t.type||"GLTF"===t.type||"Group"===t.type}cleanUp(){this._getInputManager().removeEventListener(7,this._renderListener),this._getInputManager().removeEventListener(8,this._renderListener),this.cameraBehaviour.cameraControl&&this.cameraBehaviour.cameraControl.cleanUp(),this._stopRendering=!0}clearScene(){let t=[];this._scene.children.forEach(e=>{this._isPartOfScene(e)&&t.push(e)}),t.forEach(t=>{P(t),this._scene.remove(t)}),this._renderer.renderLists.dispose()}enableHD(t){this._renderer.capabilities.maxTextures>8&&t&&this.loadDynamicLightSetting(t),this._requestRender()}_loadGLTF(t,e,i,n,s,a,r){return new Promise((o,h)=>{this._staticItemLoader.loadGLTF(t,e,i,n,s,a,null,r).then(t=>{o(t.scene)},h)})}_loadGLB(t,e,i,n,s,a,r,o){return new Promise((h,c)=>{this._staticItemLoader.loadGLB(t,e,i,n,s,a,r,o).then(t=>{h(t.scene)},c)})}showGUI(){if(this._initData.disableDebugGUI)return;const t=document.createElement("style");t.innerText=".dg.main{position:absolute;z-index:999;top:0;left:0;}",document.head.appendChild(t);let e=u(!1);e&&(this._domHelper.element.appendChild(e.domElement),this._guiLoaded())}_guiLoaded(){let t=u();if(!t)return;const e=t.addFolder("Scene Parameter"),i={intensity:this._initData.envMapIntensity,rotation:this._initData.envMapRotation};e.add(i,"intensity",0,4,.01).name("env map intensity").onChange(t=>{this.changeEnvironmentMapIntensity(t),this._requestRender()}),e.add(i,"rotation",0,2*Math.PI,.01).name("env map rotation").onChange(t=>{this._scene.userData.environmentDefinition.rotation=t,this._requestRender()}),this._lightSetting&&this._lightSetting.showGUI(),this._roomleRenderer&&this._roomleRenderer.showGUI(()=>this._requestRender()),this._environment&&this._environment.showGUI(()=>this._requestRender()),this._addGUIListener(t)}_addGUIListener(t){let e=t.__folders;Object.keys(e).forEach(t=>{let i=e[t];i.__folders&&Object.keys(i.__folders).forEach(t=>{let e=i.__folders[t];this._addGUIListener(e)}),i.__controllers&&i.__controllers.forEach(t=>{t.onFinishChange(()=>{this._guiParamChanged()})})})}_guiParamChanged(){this._renderEverything()}showStats(){e.import("./stats-helper-78c9a3b5.legacy.js").then(t=>this._statsHelper=new t.default)}_onKeyDown(t){}_onKeyUp(t,e=!1){}pause(){this._getInputManager().removeEvents(this._renderer.domElement),window.removeEventListener("resize",this,!1),window.removeEventListener("keydown",this,!1),window.removeEventListener("keyup",this,!1),document.removeEventListener("visibilitychange",this)}resume(){this._renderer.domElement.classList.add(this._canvasID),this._domHelper.element.appendChild(this._renderer.domElement),this._getInputManager().addEvents(this._renderer.domElement),window.addEventListener("resize",this,!1),window.addEventListener("keydown",this,!1),window.addEventListener("keyup",this,!1),document.addEventListener("visibilitychange",this),this.updateCamera()}destroy(){this.pause(),this.cleanUp()}handleEvent(t){switch(t.type){case"resize":this._onWindowResize();break;case"keydown":if(t.target&&(t.target instanceof HTMLInputElement||t.target instanceof HTMLTextAreaElement))break;this._onKeyDown(t);break;case"keyup":if(t.target&&(t.target instanceof HTMLInputElement||t.target instanceof HTMLTextAreaElement))break;this._onKeyUp(t);break;case"visibilitychange":this._tabVisible(),this._releaseKeystrokeStates()}}async loadSceneSettings(t){let e,i;return e=t.environment?new Promise(e=>{(new Bt).load(this._scene,this._renderer.domElement,this._environment,t,this._maxAnisotropy).then(t=>{this._setEnvironment(t),e()})}):Promise.resolve(),t.lights?(this._lightSetting=new At(this._scene,this._lightSetting),i=this._lightSetting.loadFromObject(t)):i=Promise.resolve(),new Promise((t,n)=>{Promise.all([e,i]).then(()=>{this._renderEverything(),t()},n)})}setBackgroundColor(t){this._setEnvironment(new Rt(this._scene,this._environment,new N(t)))}setBackgroundImage(t){this._setEnvironment(new Rt(this._scene,this._environment,null,this._renderer.domElement,t))}_setEnvironment(t){this._environment=t,this._renderEverything()}async loadDynamicLightSetting(t){this._lightSetting=new At(this._scene,this._lightSetting);let e=!1;if(t.url)await this._lightSetting.loadFromURL(t.url),e=!0;else if(t.json)await this._lightSetting.loadFromJSON(t.json),e=!0;else if(t.object)await this._lightSetting.loadFromObject(t.object),e=!0;else if(t.ls){const i=x.createDynamicLightSettingSource(null,t.ls);await this._lightSetting.loadFromURL(i.url),e=!0}if(!e)throw new Error("No dynamic light setting source set");this._requestRender()}getScene(){return this._scene}updateScene(){var t;this._updateBounds(this.getBounds(),this.getGeometryBounds()),null===(t=this._roomleRenderer)||void 0===t||t.forceShadowUpdates(!0),this._renderEverything()}_updateBounds(t,e,i=!1){var n;if(!t)return;const s=null!=e?e:t;this.updateEnvironment(s,i),this._lightSetting&&this._lightSetting.needsBounds()&&this._lightSetting.updateBounds(t),null===(n=this._roomleRenderer)||void 0===n||n.updateBounds(s),this._requestRender(),this._pluginSystem.updateBounds(t)}setCameraOffset(t){const e=this.cameraBehaviour.cameraControl.getCamera(),i=e||e;(null==i?void 0:i.offset)?(i.offset=t,this._renderEverything()):console.warn("Cannot set offset, current camera does not support it")}getCameraOffset(){var t,e;const i=null===(e=null===(t=this.cameraBehaviour)||void 0===t?void 0:t.cameraControl)||void 0===e?void 0:e.getCamera(),n=i||i;return(null==n?void 0:n.offset)?JSON.parse(JSON.stringify(n.offset)):{left:0,top:0,right:1,bottom:1}}getOrthographicOffsetCamera(){if(!this._orthographicOffsetCamera){const t=this.getCameraOffset(),e=this._domHelper.getClientDimensions(),i=5;let n=e.x/e.y*i,s=i;const a=S();this._orthographicOffsetCamera=a.createOrthographicCamera(n/-2,n/2,s/2,s/-2,1,1e3,t),this._orthographicOffsetCamera.position.set(0,10,0),this._orthographicOffsetCamera.lookAt(new M(0,0,0))}return this._orthographicOffsetCamera}getPerspectiveOffsetCamera(){if(!this._perspectiveOffsetCamera){const t=this.getCameraOffset(),e=this._domHelper.getClientDimensions(),i=e.x,n=e.y,s=S();this._perspectiveOffsetCamera=s.createPerspectiveCamera(30,i/n,.1,20,t)}return this._perspectiveOffsetCamera}updateEnvironment(t,e=!1){var i;if(t&&this._environment&&this._environment.needsBounds()){const i=t.getSize(new M);(i.x+i.y+i.z!==0||e)&&this._environment.updateBounds(t.getSize(new M),e)}null===(i=this._roomleRenderer)||void 0===i||i.updateBounds(t)}_onCameraIdle(){return!0}_onCameraMove(){return!0}exportImageFromCamera(t){this._onAfterRender=()=>{const e=this._renderer.domElement.toDataURL("image/jpeg",1),{left:i,right:n,top:s,bottom:a}=this.getCameraOffset(),r=n-i,o=s-a;if(1===r&&1===o)return Pt(t,e),void(this._onAfterRender=()=>{});const h=new Image;h.src=e,h.onload=()=>{const{naturalWidth:e,naturalHeight:n}=h,a=document.createElement("canvas");a.width=e*r,a.height=n*o;const c=a.getContext("2d"),d=e*i*-1,_=n*(1-s)*-1;c.drawImage(h,d,_),c.save(),Pt(t,a.toDataURL("image/jpeg",1)),this._onAfterRender=()=>{}}},this._requestRender()}changeEnvironmentMapIntensity(t){this._scene.userData.environmentDefinition.intensity=t}lockCamera(){this.cameraBehaviour.cameraControl.lock()}unlockCamera(){this.cameraBehaviour.cameraControl.unlock()}setEnvironmentMap(t,e,i,n){void 0!==t&&this._hdrEnvironmentLoader.loadUrl(this._renderer,t),void 0!==e&&(this._scene.userData.environmentDefinition.intensity=e),void 0!==i&&(this._scene.userData.environmentDefinition.rotation=i),void 0!==n&&(this._scene.userData.environmentDefinition.maxNoOfLightSources=n,this._roomleRenderer.forceShadowUpdates(!1)),this._requestRender()}}t("S",Kt),i([n],Kt.prototype,"_domHelper",void 0),i([n],Kt.prototype,"_scriptLoader",void 0),i([n],Kt.prototype,"_lifeCycleManager",void 0),i([n],Kt.prototype,"_staticItemLoader",void 0),i([n],Kt.prototype,"_hdrEnvironmentLoader",void 0),i([n],Kt.prototype,"_initData",void 0),i([n],Kt.prototype,"_idbManager",void 0),i([n],Kt.prototype,"_pluginSystem",void 0),i([n],Kt.prototype,"_imageRenderer",void 0),i([n],Kt.prototype,"_cameraBehaviourState",void 0),t("b",class{constructor(t,e){return this._debug=!1,this._state=null,this._cameraChangeListener=null,this._cameraControl=t,this._state=e,this._debug?xt(this,"CameraBehaviour"):this}get state(){return this._state}setCameraChangeListener(t){this._cameraChangeListener=t}removeCameraChangeListener(){this._cameraChangeListener=null}_onCameraChanged(){this._cameraChangeListener&&this._cameraChangeListener()}})}}}));
|
|
2
|
+
//# sourceMappingURL=camera-behaviour-12bf66b1.legacy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"camera-behaviour-12bf66b1.legacy.js","sources":["../../../packages/three-build/src/Tween.js","../../../node_modules/three/examples/jsm/objects/GroundProjectedSkybox.js","../../../packages/common-core/public/textures/env/legacy_env.exr","../../../packages/common-core/public/textures/env/default_1k.exr"],"sourcesContent":["export default \"static/Tween-d57ee5d181fce582.js\"","import { Mesh, IcosahedronGeometry, ShaderMaterial, DoubleSide } from 'three';\n\n/**\n * Ground projected env map adapted from @react-three/drei.\n * https://github.com/pmndrs/drei/blob/master/src/core/Environment.tsx\n */\nclass GroundProjectedSkybox extends Mesh {\n\n\tconstructor( texture, options = {} ) {\n\n\t\tconst isCubeMap = texture.isCubeTexture;\n\n\t\tconst defines = [\n\t\t\tisCubeMap ? '#define ENVMAP_TYPE_CUBE' : ''\n\t\t];\n\n\t\tconst vertexShader = /* glsl */ `\n\t\t\tvarying vec3 vWorldPosition;\n\n\t\t\tvoid main() {\n\n\t\t\t\tvec4 worldPosition = ( modelMatrix * vec4( position, 1.0 ) );\n\t\t\t\tvWorldPosition = worldPosition.xyz;\n\n\t\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n\t\t\t}\n\t\t\t`;\n\t\tconst fragmentShader = defines.join( '\\n' ) + /* glsl */ `\n\n\t\t\t\tvarying vec3 vWorldPosition;\n\n\t\t\t\tuniform float radius;\n\t\t\t\tuniform float height;\n\t\t\t\tuniform float angle;\n\n\t\t\t\t#ifdef ENVMAP_TYPE_CUBE\n\n\t\t\t\t\tuniform samplerCube map;\n\n\t\t\t\t#else\n\n\t\t\t\t\tuniform sampler2D map;\n\n\t\t\t\t#endif\n\n\t\t\t\t// From: https://www.shadertoy.com/view/4tsBD7\n\t\t\t\tfloat diskIntersectWithBackFaceCulling( vec3 ro, vec3 rd, vec3 c, vec3 n, float r ) \n\t\t\t\t{\n\n\t\t\t\t\tfloat d = dot ( rd, n );\n\n\t\t\t\t\tif( d > 0.0 ) { return 1e6; }\n\n\t\t\t\t\tvec3 o = ro - c;\n\t\t\t\t\tfloat t = - dot( n, o ) / d;\n\t\t\t\t\tvec3 q = o + rd * t;\n\n\t\t\t\t\treturn ( dot( q, q ) < r * r ) ? t : 1e6;\n\n\t\t\t\t}\n\n\t\t\t\t// From: https://www.iquilezles.org/www/articles/intersectors/intersectors.htm\n\t\t\t\tfloat sphereIntersect( vec3 ro, vec3 rd, vec3 ce, float ra ) {\n\n\t\t\t\t\tvec3 oc = ro - ce;\n\t\t\t\t\tfloat b = dot( oc, rd );\n\t\t\t\t\tfloat c = dot( oc, oc ) - ra * ra;\n\t\t\t\t\tfloat h = b * b - c;\n\n\t\t\t\t\tif( h < 0.0 ) { return -1.0; }\n\n\t\t\t\t\th = sqrt( h );\n\n\t\t\t\t\treturn - b + h;\n\n\t\t\t\t}\n\n\t\t\t\tvec3 project() {\n\n\t\t\t\t\tvec3 p = normalize( vWorldPosition );\n\t\t\t\t\tvec3 camPos = cameraPosition;\n\t\t\t\t\tcamPos.y -= height;\n\n\t\t\t\t\tfloat intersection = sphereIntersect( camPos, p, vec3( 0.0 ), radius );\n\t\t\t\t\tif( intersection > 0.0 ) {\n\n\t\t\t\t\t\tvec3 h = vec3( 0.0, - height, 0.0 );\n\t\t\t\t\t\tfloat intersection2 = diskIntersectWithBackFaceCulling( camPos, p, h, vec3( 0.0, 1.0, 0.0 ), radius );\n\t\t\t\t\t\tp = ( camPos + min( intersection, intersection2 ) * p ) / radius;\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tp = vec3( 0.0, 1.0, 0.0 );\n\n\t\t\t\t\t}\n\n\t\t\t\t\treturn p;\n\n\t\t\t\t}\n\n\t\t\t\t#include <common>\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvec3 projectedWorldPosition = project();\n\n\t\t\t\t\t#ifdef ENVMAP_TYPE_CUBE\n\n\t\t\t\t\t\tvec3 outcolor = textureCube( map, projectedWorldPosition ).rgb;\n\n\t\t\t\t\t#else\n\n\t\t\t\t\t\tvec3 direction = normalize( projectedWorldPosition );\n\t\t\t\t\t\tvec2 uv = equirectUv( direction );\n\t\t\t\t\t\tvec3 outcolor = texture2D( map, uv ).rgb;\n\n\t\t\t\t\t#endif\n\n\t\t\t\t\tgl_FragColor = vec4( outcolor, 1.0 );\n\n\t\t\t\t\t#include <tonemapping_fragment>\n\t\t\t\t\t#include <colorspace_fragment>\n\n\t\t\t\t}\n\t\t\t\t`;\n\n\t\tconst uniforms = {\n\t\t\tmap: { value: texture },\n\t\t\theight: { value: options.height || 15 },\n\t\t\tradius: { value: options.radius || 100 },\n\t\t};\n\n\t\tconst geometry = new IcosahedronGeometry( 1, 16 );\n\t\tconst material = new ShaderMaterial( {\n\t\t\tuniforms,\n\t\t\tfragmentShader,\n\t\t\tvertexShader,\n\t\t\tside: DoubleSide,\n\t\t} );\n\n\t\tsuper( geometry, material );\n\n\t}\n\n\tset radius( radius ) {\n\n\t\tthis.material.uniforms.radius.value = radius;\n\n\t}\n\n\tget radius() {\n\n\t\treturn this.material.uniforms.radius.value;\n\n\t}\n\n\tset height( height ) {\n\n\t\tthis.material.uniforms.height.value = height;\n\n\t}\n\n\tget height() {\n\n\t\treturn this.material.uniforms.height.value;\n\n\t}\n\n}\n\nexport { GroundProjectedSkybox };\n","export default \"static/legacy_env-d5810ec5057d4716.exr\"","export default \"static/default_1k-2aa6d42244d30fb1.exr\""],"names":["exports","GroundProjectedSkybox","_Mesh","_inherits","_super","_createSuper","texture","options","arguments","length","undefined","_classCallCheck","isCubeMap","isCubeTexture","defines","vertexShader","fragmentShader","join","uniforms","map","value","height","radius","geometry","IcosahedronGeometry","material","ShaderMaterial","side","DoubleSide","call","_createClass","key","get","this","set","Mesh"],"mappings":"43BAAAA,EAAA,IAAe,2u9BCEf,IAIMC,YAAqBC,GAAAC,EAAAF,EAAAC,GAAA,IAAAE,EAAAC,EAAAJ,GAE1B,SAAAA,EAAaK,GAAwB,IAAfC,EAAOC,UAAAC,OAAA,QAAAC,IAAAF,UAAA,GAAAA,UAAA,GAAG,GAAEG,OAAAV,GAEjC,IAAMW,EAAYN,EAAQO,cAEpBC,EAAU,CACfF,EAAY,2BAA6B,IAGpCG,EAWJ,4RACIC,EAAiBF,EAAQG,KAAM,MAiGlC,6yEAEGC,EAAW,CAChBC,IAAK,CAAEC,MAAOd,GACde,OAAQ,CAAED,MAAOb,EAAQc,QAAU,IACnCC,OAAQ,CAAEF,MAAOb,EAAQe,QAAU,MAG9BC,EAAW,IAAIC,GAAqB,EAAG,IACvCC,EAAW,IAAIC,GAAgB,CACpCR,SAAAA,EACAF,eAAAA,EACAD,aAAAA,EACAY,KAAMC,IACH,OAAAxB,EAAAyB,KAEGN,KAAAA,EAAUE,GAoBjB,OAlBAK,GAAA7B,EAAA,CAAA,CAAA8B,IAAA,SAAAC,IAQD,WAEC,OAAOC,KAAKR,SAASP,SAASI,OAAOF,OAErCc,IAVD,SAAYZ,GAEXW,KAAKR,SAASP,SAASI,OAAOF,MAAQE,IAEtC,CAAAS,IAAA,SAAAC,IAcD,WAEC,OAAOC,KAAKR,SAASP,SAASG,OAAOD,OAErCc,IAVD,SAAYb,GAEXY,KAAKR,SAASP,SAASG,OAAOD,MAAQC,MAEtCpB,GA3JkCkC,80fCNrB,05CCAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
System.register(["./roomle-dependency-injection-
|
|
2
|
-
//# sourceMappingURL=component-dimensioning-
|
|
1
|
+
System.register(["./roomle-dependency-injection-4023fe40.legacy.js","./main-thread-to-worker-b6add17c.legacy.js","./TextGeometry-c0ae932c.legacy.js"],(function(e){var i,t,n,s,o,a,h,_,d,l,r,g,c,m,w,p;return{setters:[function(e){i=e._,t=e.i},function(e){n=e.O,s=e.a,o=e.y,a=e.k,h=e.E,_=e.bu,d=e.B,l=e.N,r=e.J,g=e.b,c=e.Q,m=e.b8,w=e.bj},function(e){p=e.T}],execute:function(){const y="component_dimensioning_line_material",x="component_dimensioning_plane_material",u="component_dimensioning_text_material";class v extends n{constructor(e,i,t,n){super(),this._center=i.getCenter(new s),this._size=i.getSize(new s),this._origin=this._center.clone().sub(this._size.clone().multiplyScalar(.5)),this._dimensioning=e,this._level=this._dimensioning.maxLevel-this._dimensioning.level,this._font=t,this._cameraPosition=n,this._init()}_initMaterials(){this._cacheHolder.materialCache.has(y)?this._lineMaterial=this._cacheHolder.materialCache.get(y):(this._lineMaterial=new o({color:3618615}),this._cacheHolder.materialCache.set(y,this._lineMaterial)),this._cacheHolder.materialCache.has(x)?this._planeMaterial=this._cacheHolder.materialCache.get(x):(this._planeMaterial=new a({color:16777215,side:h,opacity:.8,transparent:!0}),this._cacheHolder.materialCache.set(x,this._planeMaterial)),this._cacheHolder.materialCache.has(u)?this._textMaterial=this._cacheHolder.materialCache.get(u):(this._textMaterial=new _({color:3618615}),this._cacheHolder.materialCache.set(u,this._textMaterial))}_init(){this._initMaterials();let e=new d;this._line=new l(e,this._lineMaterial),this._line.name="component dimension line "+this._dimensioning.type.value,this._text=new r(e,this._textMaterial),this._text.name="component dimension text "+this._dimensioning.type.value,this._plane=new r(e,this._planeMaterial),this._plane.name="component dimension plane "+this._dimensioning.type.value;let i,t=new d,n=Math.round(Math.max(this._size.y,this._size.x,this._size.z)),o=Math.abs(this._dimensioning.to-this._dimensioning.from),a=.025+(n<4?0:.005*n);o<.3&&(a*=.5+o);let h={font:this._font,size:a,height:.001,curveSegments:2,bevelEnabled:!0,bevelThickness:.001,bevelSize:.001},_=this._dimensioning.label?this._dimensioning.label:this._unitFormatter.formatMMValueToUnitString(1e3*o),m=new p(_,h);m.computeBoundingBox();let w=m.boundingBox.getSize(new s).y;0===this._dimensioning.type.value&&(i=this._getXEdge(w),this._addXEdgeSideLines(w)),1===this._dimensioning.type.value&&(i=this._getYEdge(w),this._addYEdgeSideLines(w)),2===this._dimensioning.type.value&&(i=this._getZEdge(w),this._addZEdgeSideLines(w));let y=[i.start.x,i.start.y,i.start.z,i.end.x,i.end.y,i.end.z];if(t.setAttribute("position",new g(new Float32Array(y),3)),this._line.geometry.dispose(),this._line.geometry=t,this.add(this._line),this._text.geometry=m,0===this._dimensioning.type.value&&this._addText(i,m,new c,new s(0,.04,0)),1===this._dimensioning.type.value){let e=new c,t=this._getXSign()>0?Math.PI/2:Math.PI/2*3;e.setFromAxisAngle(new s(0,0,1),t),this._addText(i,m,e,new s(.04,0,0))}if(2===this._dimensioning.type.value){let e=this._getXSign()>0?Math.PI/2:Math.PI/2*3,t=(new c).setFromAxisAngle(new s(-1,0,0),Math.PI/2),n=(new c).setFromAxisAngle(new s(0,0,1),e);this._addText(i,m,t.multiply(n),new s(.04,0,0))}}_getXEdge(e){let i=this._size.y+.05+(.06+e)*this._level;const t=new s(0,this._origin.y,this._origin.z);let n=t.clone().add(new s(this._dimensioning.from,i,0)),o=t.clone().add(new s(this._dimensioning.to,i,0));return new m(n,o)}_addXEdgeSideLines(e){let i=this._size.y+.05+(.06+e)*(this._level-.5),t=this._size.y+.05+(.06+e)*this._level;const n=new s(0,this._origin.y,this._origin.z);let o=n.clone().add(new s(this._dimensioning.from,i,0)),a=n.clone().add(new s(this._dimensioning.from,t,0)),h=n.clone().add(new s(this._dimensioning.to,i,0)),_=n.clone().add(new s(this._dimensioning.to,t,0));this._addLine(o,a),this._addLine(h,_)}_getZEdge(e){let i=(this._getXSign()>0?this._size.x:0)+.05+(.06+e)*this._level;i*=this._getXSign();const t=new s(this._origin.x,this._origin.y,0);let n=t.clone().add(new s(i,0,this._dimensioning.from)),o=t.clone().add(new s(i,0,this._dimensioning.to));return new m(n,o)}_addZEdgeSideLines(e){let i=this._getXSign()>0?this._size.x:0,t=i+.05+(.06+e)*(this._level-.5),n=i+.05+(.06+e)*this._level;t*=this._getXSign(),n*=this._getXSign();const o=new s(this._origin.x,this._origin.y,0);let a=o.clone().add(new s(t,0,this._dimensioning.from)),h=o.clone().add(new s(n,0,this._dimensioning.from)),_=o.clone().add(new s(t,0,this._dimensioning.to)),d=o.clone().add(new s(n,0,this._dimensioning.to));this._addLine(a,h),this._addLine(_,d)}_getYEdge(e){let i=(this._getXSign()>0?this._size.x:0)+.05+(.06+e)*this._level;i*=this._getXSign();const t=new s(this._origin.x,0,this._origin.z);let n=t.clone().add(new s(i,this._dimensioning.from,0)),o=t.clone().add(new s(i,this._dimensioning.to,0));return new m(n,o)}_addYEdgeSideLines(e){let i=this._getXSign()>0?this._size.x:0,t=i+.05+(.06+e)*(this._level-.5),n=i+.05+(.06+e)*this._level;t*=this._getXSign(),n*=this._getXSign();const o=new s(this._origin.x,0,this._origin.z);let a=o.clone().add(new s(t,this._dimensioning.from,0)),h=o.clone().add(new s(n,this._dimensioning.from,0)),_=o.clone().add(new s(t,this._dimensioning.to,0)),d=o.clone().add(new s(n,this._dimensioning.to,0));this._addLine(a,h),this._addLine(_,d)}_addLine(e,i){let t=new d,n=[e.x,e.y,e.z,i.x,i.y,i.z];t.setAttribute("position",new g(new Float32Array(n),3)),this.add(new l(t,this._lineMaterial))}_addText(e,i,t,n){let o=e.getCenter(new s);n.x*=this._getXSign(),o.add(n);let a=i.boundingBox.getSize(new s);i.center(),this._text.position.copy(o),this._text.quaternion.copy(t),this.add(this._text);let h=new w(a.x+.02,a.y+.02,32);h.center(),this._plane.geometry=h,this._plane.position.copy(o),this._plane.quaternion.copy(t),this.add(this._plane)}_getXSign(){return this._cameraPosition.x>=0?1:-1}}e("default",v),i([t],v.prototype,"_cacheHolder",void 0),i([t],v.prototype,"_unitFormatter",void 0)}}}));
|
|
2
|
+
//# sourceMappingURL=component-dimensioning-500eddfe.legacy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component-dimensioning-500eddfe.legacy.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
System.register(["./main-thread-to-worker-b6add17c.legacy.js","./roomle-dependency-injection-4023fe40.legacy.js"],(function(e){var t,i,n,s,a,r,c,o,l;return{setters:[function(e){t=e.bH,i=e.bX,n=e.J,s=e.z,a=e.ak,r=e.a,c=e.bY,o=e.o},function(e){l=e.$}],execute:function(){e("default",class{constructor(){this._nonTransparentComponent=null,this._raycaster=new t,this._raycaster.near=.1,this._raycaster.layers.enable(3)}init(e,t){this._scene=e,this._camera=t,this.checkComponentVisibility=i(this.checkComponentVisibility,100).bind(this),this.checkPreviewVisibility=i(this.checkPreviewVisibility,100).bind(this)}setCamera(e){this._camera=e}changeMaterialsOnSelect(e,t,i=!1){t!==this._nonTransparentComponent&&(this._nonTransparentComponent=t,this._changeMaterialsOnSelect(e,t,i))}_changeMaterialsOnSelect(e,t,i=!1){if(e.children.length>0&&e.children.forEach(s=>{const a=t&&e.id===t.id||i,r=!(s instanceof n);this._changeMaterialsOnSelect(s,t,(!a||!r)&&a)}),t)e instanceof n&&e.material instanceof s&&!e.userData.oldMaterial&&(e.userData.oldMaterial=e.material,e.material=e.material.clone(),i||l(e,{opacity:.2,transparent:!0}));else if(e.userData.oldMaterial&&e instanceof n&&e.material instanceof s){const{opacity:t,transparent:i}=e.userData.oldMaterial;l(e,{opacity:t,transparent:i}),e.userData.oldMaterial=void 0}}isComponentVisible(e){const t=[];e.traverse(e=>t.push(e.uuid));const i=(new a).setFromObject(e).getCenter(new r),n=(new r).subVectors(i,this._camera.position).normalize();this._raycaster.set(this._camera.position,n),this._raycaster.far=this._camera.position.distanceTo(i);const s=[];return this._raycaster.intersectObjects(this._scene.children,!0).forEach(e=>{e.object.material.visible&&(t.includes(e.object.uuid)||e.object.userData.ignoreComponentRaycast||s.push(e))}),0===s.length}checkComponentAndPreviewVisibility(e,t){e.hasSelection()?this.checkComponentVisibility(e,t):t.hasPreviews()?this.checkPreviewVisibility(t):this.changeMaterialsOnSelect(this._scene,null)}checkComponentVisibility(e,t){if(!e.hasSelection())return;const i=t.getComponentsForIds(e.getSelectedRuntimeComponentIds());if(i.length>1)return;const n=i[0];this.isComponentVisible(n)?this.changeMaterialsOnSelect(this._scene,null):this.changeMaterialsOnSelect(this._scene,n)}areAllPreviewsVisible(e){if(!e.hasPreviews())return!0;const t=e.getPreviews();return 0===t.length||t.map(e=>this.isComponentVisible(e)).reduce((e,t)=>e&&t)}areAllComponentsInFrustum(e){if(0===e.length)return!0;const t=new c,i=(new o).multiplyMatrices(this._camera.projectionMatrix,this._camera.matrixWorldInverse),n=new a;return t.setFromProjectionMatrix(i),e.map(e=>(e=>{const i=n.setFromObject(e).getCenter(new r);return t.containsPoint(i)})(e)).reduce((e,t)=>e&&t)}checkPreviewVisibility(e){e.hasPreviewLines()||(this.areAllPreviewsVisible(e)?this.changeMaterialsOnSelect(this._scene,null):this.changeMaterialsOnSelect(this._scene,{id:-1}))}})}}}));
|
|
2
|
+
//# sourceMappingURL=component-raycast-helper-b58fb547.legacy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component-raycast-helper-b58fb547.legacy.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
System.register(["./script-loader-f80cbdd3.legacy.js","./roomle-dependency-injection-4023fe40.legacy.js","./camera-behaviour-12bf66b1.legacy.js","./component-raycast-helper-b58fb547.legacy.js","./roomle-configurator-9aaf9f85.legacy.js","./query-params-helper-a1e13324.legacy.js","./main-thread-to-worker-b6add17c.legacy.js","./default-light-setting-894d1404.legacy.js"],(function(e){var n,o,t,a,r,c,i,s,l,u,p,g,f,d;return{setters:[function(e){n=e.S,o=e.M},function(e){t=e.D,a=e.L,r=e.R,c=e.a,i=e.C,s=e.b,l=e.A},function(e){u=e.C,p=e.a},function(e){g=e.default},function(e){f=e.C,d=e.R},function(){},function(){},function(){}],execute:function(){const h=[new t("logger",a),new t("rapi-access",r),new t("script-loader",n),new t("camera-control-3d",u),new t("camera-control",p),new t("data-syncer",c),new t("configurator-scene-manager",f,1),new t("configurator-view-model",i,1),new t("component-raycast-helper",g,0)];e("Configurator",class extends o{setupDependencies(){s.setup(h),this.lookup("planner-kernel-access",this._context).init(1),this.lookup("rapi-access",this._context),this.lookup("script-loader",this._context),this.lookup("logger",this._context)}cleanUpGlobals(){delete window.RoomleConfigurator}cleanUpDependencies(){const e=this.lookup("script-loader"),n=this.lookup("rapi-access");this.lookup("dom-helper");const o=this.lookup("configurator-scene-manager");e&&e.cleanUp(),n&&n.cleanUp(),o&&o.cleanUp()}setupGlobals(e){const{kernelInstance:n,kernelContainer:o,planObjectId:t}=e||{};l.init({kernelInstance:n,kernelContainer:o,planObjectId:t})}getApi(){return this._configurator}bootFinished(){this._configurator=new d(this._context),this._configurator.getMain=()=>this,window.RoomleConfigurator||(window.RoomleConfigurator=this._configurator)}getContextName(){return"configurator"}})}}}));
|
|
2
|
+
//# sourceMappingURL=configurator-a319db55.legacy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"configurator-a319db55.legacy.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
System.register(["./configurator-
|
|
1
|
+
System.register(["./configurator-a319db55.legacy.js","./script-loader-f80cbdd3.legacy.js","./query-params-helper-a1e13324.legacy.js","./main-thread-to-worker-b6add17c.legacy.js","./roomle-dependency-injection-4023fe40.legacy.js","./camera-behaviour-12bf66b1.legacy.js","./component-raycast-helper-b58fb547.legacy.js","./roomle-configurator-9aaf9f85.legacy.js","./default-light-setting-894d1404.legacy.js"],(function(){var e;return{setters:[function(n){e=n.Configurator},function(){},function(){},function(){},function(){},function(){},function(){},function(){},function(){}],execute:function(){(new e).boot(),window.requestIdleCallback||(window.requestIdleCallback=e=>setTimeout(()=>{let n=Date.now();e({didTimeout:!1,timeRemaining:()=>Math.max(0,50-(Date.now()-n))})},1)),window.cancelIdleCallback||(window.cancelIdleCallback=window.cancelIdleCallback||function(e){clearTimeout(e)})}}}));
|
|
2
2
|
//# sourceMappingURL=configurator-main.legacy.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
System.register(["./roomle-dependency-injection-
|
|
2
|
-
//# sourceMappingURL=continuous-drawing-helper-
|
|
1
|
+
System.register(["./roomle-dependency-injection-4023fe40.legacy.js","./main-thread-to-worker-b6add17c.legacy.js"],(function(e){var i,t,r,s,n;return{setters:[function(e){i=e.a6},function(e){t=e.ba,r=e.k,s=e.E,n=e.J}],execute:function(){e("default",class{constructor(){this._currentInnerRadius=0}init(e,i,t){this._drawingGroup=e,this._continuousDrawingManager=i,this._kernelZoomFactor=t,this.update()}update(){this._initCircle(),this._updateCircle()}_initCircle(){if(this._circleMesh)return;const e=70/this._kernelZoomFactor/1e3,i=new t(e,e+e/50,32),c=new r({color:10066329,side:s});this._circleMesh=new n(i,c),this._circleMesh.name="Circle",this._circleMesh.rotation.set(Math.PI/2,0,0),this._circleMesh.visible=this._continuousDrawingManager.shouldShowCircle(),this._drawingGroup.add(this._circleMesh)}_updateCircle(){if(!this._circleMesh)return;const e=70/this._kernelZoomFactor/1e3;if(e!==this._currentInnerRadius){const i=e+e/50;this._circleMesh.geometry=new t(e,i,32)}const r=i(this._continuousDrawingManager.getStartPoint());r.y=5,this._circleMesh.position.copy(r),this._circleMesh.visible=this._continuousDrawingManager.shouldShowCircle(),this._currentInnerRadius=e}setKernelZoomFactor(e){this._kernelZoomFactor=e}endDrawing(){this._drawingGroup.remove(this._circleMesh),this._circleMesh=null}})}}}));
|
|
2
|
+
//# sourceMappingURL=continuous-drawing-helper-b59b2e3b.legacy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"continuous-drawing-helper-b59b2e3b.legacy.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
System.register(["./camera-behaviour-12bf66b1.legacy.js","./roomle-dependency-injection-4023fe40.legacy.js","./main-thread-to-worker-b6add17c.legacy.js"],(function(i){var t,a,e,n,o,s,h;return{setters:[function(i){t=i.L},function(i){a=i.Q},function(i){e=i.D,n=i.C,o=i.V,s=i.a,h=i.A}],execute:function(){i("D",class extends t{constructor(i,t){super(i,t),this._params={ambientLight:{color:"#ffffff"},mainDirLight:{position:{x:-3,y:4,z:4},color:"#ffffff"},secondDirLight:{position:{x:3,y:4,z:3},color:"#ffffff"}},this._mainDirectionalLight=new e(new n(this._params.mainDirLight.color),.8),this._mainDirectionalLight.position.set(this._params.mainDirLight.position.x,this._params.mainDirLight.position.y,this._params.mainDirLight.position.z),this._mainDirectionalLight.layers.set(1),this._mainDirectionalLight.castShadow=!0,this._mainDirectionalLight.shadow.camera.near=.1,this._mainDirectionalLight.shadow.camera.far=100,this._mainDirectionalLight.shadow.mapSize=new o(1024,1024),this._mainDirectionalLight.visible=!0,this._mainDirectionalLight.lookAt(new s(0,0,0)),this._secondDirectionalLight=new e(new n(this._params.secondDirLight.color),.2),this._secondDirectionalLight.position.set(this._params.secondDirLight.position.x,this._params.secondDirLight.position.y,this._params.secondDirLight.position.z),this._secondDirectionalLight.layers.set(1),this._secondDirectionalLight.castShadow=!1,this._secondDirectionalLight.shadow.camera.near=.1,this._secondDirectionalLight.shadow.camera.far=100,this._secondDirectionalLight.shadow.mapSize=new o(1024,1024),this._secondDirectionalLight.visible=!0,this._secondDirectionalLight.lookAt(new s(0,0,0)),this._ambientLight=new h(new n(this._params.ambientLight.color),.5),this._ambientLight.layers.set(1),this.addToScene()}needsBounds(){return!0}updateBounds(i){const t=i.getSize(new s),a=Math.max(Math.max(t.x,t.y),t.z)+1,e=a/2;this._mainDirectionalLight.shadow.camera.top=e,this._mainDirectionalLight.shadow.camera.bottom=-e,this._mainDirectionalLight.shadow.camera.left=-e,this._mainDirectionalLight.shadow.camera.right=e,this._mainDirectionalLight.shadow.camera.near=.01,this._mainDirectionalLight.shadow.camera.far=4*a,this._mainDirectionalLight.shadow.camera.updateProjectionMatrix(),this._secondDirectionalLight.shadow.camera.top=e,this._secondDirectionalLight.shadow.camera.bottom=-e,this._secondDirectionalLight.shadow.camera.left=-e,this._secondDirectionalLight.shadow.camera.right=e,this._secondDirectionalLight.shadow.camera.near=.01,this._secondDirectionalLight.shadow.camera.far=4*a,this._secondDirectionalLight.shadow.camera.updateProjectionMatrix()}addToScene(){this._scene.add(this._mainDirectionalLight),this._scene.add(this._secondDirectionalLight),this._scene.add(this._ambientLight)}removeFromScene(){this._scene.remove(this._mainDirectionalLight),this._scene.remove(this._secondDirectionalLight),this._scene.remove(this._ambientLight)}reload(){this.removeFromScene(),this.addToScene()}showGUI(){let i=a();if(i){if(this._ambientLight){let t=i.addFolder("Ambient Light");t.add(this._ambientLight,"visible"),t.add(this._ambientLight,"intensity").min(0).max(5).step(.1),t.addColor(this._params.ambientLight,"color").onChange(i=>this._ambientLight.color=new n(i))}if(this._mainDirectionalLight){let t=i.addFolder("Main Directional Light");t.add(this._mainDirectionalLight,"visible"),t.add(this._mainDirectionalLight,"intensity").min(0).max(10).step(.1),t.add(this._mainDirectionalLight,"castShadow"),t.addColor(this._params.mainDirLight,"color").onChange(i=>this._mainDirectionalLight.color=new n(i)),t.add(this._mainDirectionalLight.position,"x").min(-10).max(10).step(.1).onChange(()=>this._mainDirectionalLight.lookAt(new s(0,0,0))),t.add(this._mainDirectionalLight.position,"y").min(-10).max(50).step(.1).onChange(()=>this._mainDirectionalLight.lookAt(new s(0,0,0))),t.add(this._mainDirectionalLight.position,"z").min(-10).max(10).step(.1).onChange(()=>this._mainDirectionalLight.lookAt(new s(0,0,0)))}if(this._secondDirectionalLight){let t=i.addFolder("Second Directional Light");t.add(this._secondDirectionalLight,"visible"),t.add(this._secondDirectionalLight,"intensity").min(0).max(10).step(.1),t.add(this._secondDirectionalLight,"castShadow"),t.addColor(this._params.mainDirLight,"color").onChange(i=>this._mainDirectionalLight.color=new n(i)),t.add(this._secondDirectionalLight.position,"x").min(-10).max(10).step(.1).onChange(()=>this._mainDirectionalLight.lookAt(new s(0,0,0))),t.add(this._secondDirectionalLight.position,"y").min(-10).max(50).step(.1).onChange(()=>this._mainDirectionalLight.lookAt(new s(0,0,0))),t.add(this._secondDirectionalLight.position,"z").min(-10).max(10).step(.1).onChange(()=>this._mainDirectionalLight.lookAt(new s(0,0,0)))}}}})}}}));
|
|
2
|
+
//# sourceMappingURL=default-light-setting-894d1404.legacy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"default-light-setting-894d1404.legacy.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
package/lib/legacy/{dimensioning-helper-c15b8df2.legacy.js → dimensioning-helper-f6ac8c56.legacy.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
System.register(["./roomle-dependency-injection-
|
|
2
|
-
//# sourceMappingURL=dimensioning-helper-
|
|
1
|
+
System.register(["./roomle-dependency-injection-4023fe40.legacy.js","./main-thread-to-worker-b6add17c.legacy.js","./TextGeometry-c0ae932c.legacy.js"],(function(t){var e,i,s,n,h,a,o,_,d,l,r,m,p,x,c,u,g,w,y,b;return{setters:[function(t){e=t.n,i=t._,s=t.i,n=t.ag,h=t.aC},function(t){a=t.O,o=t.a,_=t.k,d=t.E,l=t.bu,r=t.B,m=t.J,p=t.Q,x=t.bj,c=t.y,u=t.N,g=t.b,w=t.b8,y=t.ak},function(t){b=t.T}],execute:function(){const B="component_dimensioning_plane_material",T="component_dimensioning_text_material";class z extends a{constructor(t){super(),this._label="",this._parameters={font:null,size:.1,height:.001,curveSegments:2,bevelEnabled:!0,bevelThickness:.001,bevelSize:.001},this.topDown=!1,this._parameters.font=t,this._position=new o,this._initMaterials(),this._init(),this._update()}_initMaterials(){this._cacheHolder.materialCache.has(B)?this._planeMaterial=this._cacheHolder.materialCache.get(B):(this._planeMaterial=new _({color:16777215,side:d,opacity:.8,transparent:!0}),this._cacheHolder.materialCache.set(B,this._planeMaterial)),this._cacheHolder.materialCache.has(T)?this._textMaterial=this._cacheHolder.materialCache.get(T):(this._textMaterial=new l({color:3618615}),this._cacheHolder.materialCache.set(T,this._textMaterial))}_init(){let t=new r;this._text=new m(t,this._textMaterial),this._text.userData.ignoreComponentRaycast=!0,this._text.name="text with background text "+this._label,this._plane=new m(t,this._planeMaterial),this._plane.userData.ignoreComponentRaycast=!0,this._plane.name="text with background plane "+this._label,this._textGeometry=new b(this._label,this._parameters),this._textGeometry.computeBoundingBox(),this._text.geometry=this._textGeometry,this.add(this._text),this.add(this._plane)}update(t,e,i,s){this._position.copy(t),this._dimensioningType=e,this._cameraPosition=s,this._label=i;const n=this._cameraPosition.distanceTo(this._text.position),h=Math.max(.01,n/100),a=Math.max(5e-4,n/5e3);this._parameters.bevelThickness=a,this._parameters.bevelSize=a,this._parameters.size=h,this._textGeometry=new b(this._label,this._parameters),this._textGeometry.computeBoundingBox(),this._text.geometry=this._textGeometry,this._update()}_update(){if(this.topDown){let t=new p;t.setFromAxisAngle(new o(-1,0,0),Math.PI/2),this._updateText(this._textGeometry,t,new o)}else if(this._updateText(this._textGeometry,new p,new o),this._cameraPosition){const t=Math.atan2(this._cameraPosition.x-this._position.x,this._cameraPosition.z-this._position.z);this._text.rotation.y=t,this._plane.rotation.y=t}}_updateText(t,e,i){let s=new o;s.copy(this._position),i.x*=this._getXSign(),s.add(i);let n=t.boundingBox.getSize(new o);t.center(),this._text.position.copy(s),this._text.quaternion.copy(e);let h=new x(n.x+.02,n.y+.02,32);h.center(),this._plane.geometry=h,this._plane.position.copy(s),this._plane.quaternion.copy(e)}_getXSign(){return!this._cameraPosition||this._cameraPosition.x>=0?1:-1}dispose(){e(this)}}i([s],z.prototype,"_cacheHolder",void 0);class L{constructor(t){this._cameraPosition=new o,this._textUpdated=!1,this._topDimensions=!1,this._initialized=new n,this._enabled=!1,this._dimensionsVisible=!1,this._creator_=t,this._lineMaterial=new c({color:3618615,linewidth:2});let e=new r;this._widthLine=new u(e,this._lineMaterial),this._widthLine.userData.ignoreComponentRaycast=!0,this._widthLine.name="dimension width line",this._heightLine=new u(e,this._lineMaterial),this._heightLine.userData.ignoreComponentRaycast=!0,this._heightLine.name="dimension height line",this._depthLine=new u(e,this._lineMaterial),this._depthLine.userData.ignoreComponentRaycast=!0,this._depthLine.name="dimension depth line",this._planeMaterial=new _({color:16777215,side:d,opacity:.8,transparent:!0}),h.loadFont("static/rubik_regular_sub-2dd2d5cca49018c5.json").then(t=>{this._font=t,this._loaded()})}_loaded(){this.update(!1),this.addToScene(this._scene,this._uiScene),this._initialized.resolve()}_performUpdate(t){this._enabled&&(this._lineBounds||t)&&this._font&&(this._updateHeight(),this._updateWidth(),this._updateDepth())}_updateWidth(){let t=new r,e=this._getWidthEdge(),i=[e.start.x,e.start.y,e.start.z,e.end.x,e.end.y,e.end.z];t.setAttribute("position",new g(new Float32Array(i),3)),this._widthLine.geometry.dispose(),this._widthLine.geometry=t;let s=e.getCenter(new o);this._widthText||(this._widthText=new z(this._font)),this._widthText.topDown=this._topDimensions;const n=this._unitFormatter.formatMMValueToUnitString(1e3*this._dimensions.x);this._widthText.update(s,0,n,this._cameraPosition)}_updateHeight(){let t=new r,e=this._getHeightEdge(),i=[e.start.x,e.start.y,e.start.z,e.end.x,e.end.y,e.end.z];t.setAttribute("position",new g(new Float32Array(i),3)),this._heightLine.geometry.dispose(),this._heightLine.geometry=t;let s=e.getCenter(new o);this._heightText||(this._heightText=new z(this._font)),this._heightText.topDown=this._topDimensions;const n=this._unitFormatter.formatMMValueToUnitString(1e3*this._dimensions.y);this._heightText.update(s,1,n,this._cameraPosition)}_updateDepth(){let t=new r,e=this._getDepthEdge(),i=[e.start.x,e.start.y,e.start.z,e.end.x,e.end.y,e.end.z];t.setAttribute("position",new g(new Float32Array(i),3)),this._depthLine.geometry.dispose(),this._depthLine.geometry=t;let s=e.getCenter(new o);this._depthText||(this._depthText=new z(this._font)),this._depthText.topDown=this._topDimensions;const n=this._unitFormatter.formatMMValueToUnitString(1e3*this._dimensions.z);this._depthText.update(s,2,n,this._cameraPosition)}updateBounds(t){if(!t)return;this._dimensions=t.getSize(new o),this._lineBounds=t.clone();let e=this._lineBounds.min.y<0?this._lineBounds.min.y:0;e-=.01,this._lineBounds.expandByVector(new o(.05,e,.05)),this._textUpdated=!1,this.update()}update(t=!1){this._enabled&&!this._dimensionsVisible&&(this._dimensionsVisible=!0,this._visibilityChangedCallback()),this._performUpdate(t)}addToScene(t,e){this._widthText&&this._widthLine&&this._heightText&&this._heightLine&&this._heightText&&this._heightLine&&(t.add(this._widthLine),e.add(this._widthText),t.add(this._heightLine),e.add(this._heightText),t.add(this._depthLine),e.add(this._depthText))}removeFromScene(t,e){t.remove(this._widthLine),e.remove(this._widthText),t.remove(this._heightLine),e.remove(this._heightText),t.remove(this._depthLine),e.remove(this._depthText)}_getWidthEdge(){return this._cameraPosition.z>=0?new w(new o(this._lineBounds.min.x,this._lineBounds.min.y,this._lineBounds.max.z),new o(this._lineBounds.max.x,this._lineBounds.min.y,this._lineBounds.max.z)):new w(new o(this._lineBounds.min.x,this._lineBounds.min.y,this._lineBounds.min.z),new o(this._lineBounds.max.x,this._lineBounds.min.y,this._lineBounds.min.z))}_getDepthEdge(){return this._cameraPosition.x>=0?new w(new o(this._lineBounds.max.x,this._lineBounds.min.y,this._lineBounds.min.z),new o(this._lineBounds.max.x,this._lineBounds.min.y,this._lineBounds.max.z)):new w(new o(this._lineBounds.min.x,this._lineBounds.min.y,this._lineBounds.min.z),new o(this._lineBounds.min.x,this._lineBounds.min.y,this._lineBounds.max.z))}_getHeightEdge(){return this._cameraPosition.x>=0&&this._cameraPosition.z>=0?new w(new o(this._lineBounds.max.x,this._lineBounds.min.y,this._lineBounds.max.z),new o(this._lineBounds.max.x,this._lineBounds.max.y,this._lineBounds.max.z)):this._cameraPosition.x<0&&this._cameraPosition.z>=0?new w(new o(this._lineBounds.min.x,this._lineBounds.min.y,this._lineBounds.max.z),new o(this._lineBounds.min.x,this._lineBounds.max.y,this._lineBounds.max.z)):this._cameraPosition.x>=0&&this._cameraPosition.z<0?new w(new o(this._lineBounds.max.x,this._lineBounds.min.y,this._lineBounds.min.z),new o(this._lineBounds.max.x,this._lineBounds.max.y,this._lineBounds.min.z)):new w(new o(this._lineBounds.min.x,this._lineBounds.min.y,this._lineBounds.min.z),new o(this._lineBounds.min.x,this._lineBounds.max.y,this._lineBounds.min.z))}onDimensionsVisibilityChanged(t){this._onChange=t}enableTopDimensions(){this.enableDimensions(),this._topDimensions=!0,this._heightLine.visible=!1,this._heightText.visible=!1,this.update(!0)}disableTopDimensions(){this._topDimensions=!1,this._heightLine.visible=!0,this._heightText.visible=!0,this.disableDimensions()}enableDimensions(){this._enabled=!0,this.update(!0),this.addToScene(this._scene,this._uiScene)}disableDimensions(){this._enabled=!1,this._dimensionsVisible&&(this._dimensionsVisible=!1,this._visibilityChangedCallback()),this.removeFromScene(this._scene,this._uiScene)}_visibilityChangedCallback(){this._onChange&&this._onChange(this._dimensionsVisible)}_clear(){this._lineMaterial.dispose(),this._planeMaterial.dispose(),this._widthLine.geometry.dispose(),this._heightLine.geometry.dispose(),this._depthLine.geometry.dispose(),this._heightText.dispose(),this._heightText.dispose(),this._depthText.dispose()}getBoundingBox(){const t=new y;return t.expandByObject(this._widthLine),t.expandByObject(this._widthText),t.expandByObject(this._heightLine),t.expandByObject(this._heightText),t.expandByObject(this._depthLine),t.expandByObject(this._depthText),t}setVisibility(t){this._heightLine&&this._widthLine&&this._depthLine&&this._heightText&&this._widthText&&this._depthText&&(this._heightLine.visible=t,this._heightText.visible=t,this._widthLine.visible=t,this._widthText.visible=t,this._depthLine.visible=t,this._depthText.visible=t)}moveCameraStart(t){this.setVisibility(!1),this._cameraPosition=t,this.update()}moveCameraEnd(t){this.setVisibility(!0),this._cameraPosition=t,this.update()}clearScene(t){this._clear()}setScene(t){this._scene=t}setUiScene(t){this._uiScene=t}needsUiScene(){return!0}isInitialized(){return this._initialized.wait()}areDimensionsEnabled(){return this._enabled}}t("default",L),i([s],L.prototype,"_unitFormatter",void 0)}}}));
|
|
2
|
+
//# sourceMappingURL=dimensioning-helper-f6ac8c56.legacy.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dimensioning-helper-
|
|
1
|
+
{"version":3,"file":"dimensioning-helper-f6ac8c56.legacy.js","sources":["../../../packages/configurator-core/public/fonts/rubik_regular_sub.json"],"sourcesContent":["export default \"static/rubik_regular_sub-2dd2d5cca49018c5.json\""],"names":[],"mappings":"uoHAAe"}
|