@inweb/viewer-three 26.8.0 → 26.8.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/dist/plugins/components/RoomEnvironmentComponent.js +75 -40
  2. package/dist/plugins/components/RoomEnvironmentComponent.js.map +1 -1
  3. package/dist/plugins/components/RoomEnvironmentComponent.min.js +1 -1
  4. package/dist/plugins/components/StatsPanelComponent.js +1 -1
  5. package/dist/plugins/components/StatsPanelComponent.js.map +1 -1
  6. package/dist/plugins/components/StatsPanelComponent.min.js +1 -1
  7. package/dist/plugins/components/StatsPanelComponent.module.js +1 -1
  8. package/dist/plugins/components/StatsPanelComponent.module.js.map +1 -1
  9. package/dist/plugins/loaders/GLTFCloudLoader.js +225 -94
  10. package/dist/plugins/loaders/GLTFCloudLoader.js.map +1 -1
  11. package/dist/plugins/loaders/GLTFCloudLoader.min.js +1 -1
  12. package/dist/plugins/loaders/IFCXLoader.js +1977 -881
  13. package/dist/plugins/loaders/IFCXLoader.js.map +1 -1
  14. package/dist/plugins/loaders/IFCXLoader.min.js +1 -1
  15. package/dist/plugins/loaders/IFCXLoader.module.js +477 -154
  16. package/dist/plugins/loaders/IFCXLoader.module.js.map +1 -1
  17. package/dist/viewer-three.js +31149 -5503
  18. package/dist/viewer-three.js.map +1 -1
  19. package/dist/viewer-three.min.js +3 -3
  20. package/dist/viewer-three.module.js +406 -298
  21. package/dist/viewer-three.module.js.map +1 -1
  22. package/lib/Viewer/Viewer.d.ts +17 -3
  23. package/lib/Viewer/commands/SetDefaultViewPosition.d.ts +6 -6
  24. package/lib/Viewer/components/HighlighterComponent.d.ts +5 -4
  25. package/lib/Viewer/components/SelectionComponent.d.ts +1 -1
  26. package/lib/Viewer/loaders/DynamicGltfLoader/DynamicModelImpl.d.ts +3 -1
  27. package/lib/Viewer/models/IModelImpl.d.ts +27 -0
  28. package/lib/Viewer/models/ModelImpl.d.ts +27 -0
  29. package/lib/Viewer/scenes/Helpers.d.ts +7 -0
  30. package/lib/index.d.ts +2 -1
  31. package/package.json +9 -9
  32. package/plugins/components/StatsPanelComponent.ts +1 -1
  33. package/plugins/loaders/IFCX/IFCXLoader.ts +4 -7
  34. package/plugins/loaders/IFCX/render.js +686 -181
  35. package/plugins/loaders/IFCXCloudLoader.ts +1 -1
  36. package/src/Viewer/Viewer.ts +124 -48
  37. package/src/Viewer/commands/SetDefaultViewPosition.ts +8 -8
  38. package/src/Viewer/components/CameraComponent.ts +20 -16
  39. package/src/Viewer/components/ExtentsComponent.ts +1 -0
  40. package/src/Viewer/components/HighlighterComponent.ts +78 -80
  41. package/src/Viewer/components/LightComponent.ts +10 -4
  42. package/src/Viewer/components/ResizeCanvasComponent.ts +1 -0
  43. package/src/Viewer/components/SelectionComponent.ts +1 -1
  44. package/src/Viewer/helpers/WCSHelper.ts +8 -5
  45. package/src/Viewer/loaders/DynamicGltfLoader/DynamicGltfLoader.js +33 -16
  46. package/src/Viewer/loaders/DynamicGltfLoader/DynamicModelImpl.ts +12 -5
  47. package/src/Viewer/loaders/DynamicGltfLoader/GltfStructure.js +100 -20
  48. package/src/Viewer/loaders/GLTFCloudDynamicLoader.ts +4 -2
  49. package/src/Viewer/loaders/GLTFFileLoader.ts +1 -1
  50. package/src/Viewer/models/IModelImpl.ts +67 -0
  51. package/src/Viewer/models/ModelImpl.ts +214 -0
  52. package/src/Viewer/postprocessing/SSAARenderPass.js +245 -0
  53. package/src/Viewer/scenes/Helpers.ts +42 -0
  54. package/src/index.ts +2 -1
@@ -5,10 +5,25 @@
5
5
  })(this, (function (three, viewerThree) { 'use strict';
6
6
 
7
7
  /**
8
- * https://github.com/google/model-viewer/blob/master/packages/model-viewer/src/three-components/EnvironmentScene.ts
8
+ * This class represents a scene with a basic room setup that can be used as
9
+ * input for {@link PMREMGenerator#fromScene}. The resulting PMREM represents the room's
10
+ * lighting and can be used for Image Based Lighting by assigning it to {@link Scene#environment}
11
+ * or directly as an environment map to PBR materials.
12
+ *
13
+ * The implementation is based on the [EnvironmentScene](https://github.com/google/model-viewer/blob/master/packages/model-viewer/src/three-components/EnvironmentScene.ts)
14
+ * component from the `model-viewer` project.
15
+ *
16
+ * ```js
17
+ * const environment = new RoomEnvironment();
18
+ * const pmremGenerator = new THREE.PMREMGenerator( renderer );
19
+ *
20
+ * const envMap = pmremGenerator.fromScene( environment ).texture;
21
+ * scene.environment = envMap;
22
+ * ```
23
+ *
24
+ * @augments Scene
25
+ * @three_import import { RoomEnvironment } from 'three/addons/environments/RoomEnvironment.js';
9
26
  */
10
-
11
-
12
27
  class RoomEnvironment extends three.Scene {
13
28
 
14
29
  constructor() {
@@ -30,41 +45,52 @@
30
45
  room.scale.set( 31.713, 28.305, 28.591 );
31
46
  this.add( room );
32
47
 
33
- const box1 = new three.Mesh( geometry, boxMaterial );
34
- box1.position.set( -10.906, 2.009, 1.846 );
35
- box1.rotation.set( 0, -0.195, 0 );
36
- box1.scale.set( 2.328, 7.905, 4.651 );
37
- this.add( box1 );
38
-
39
- const box2 = new three.Mesh( geometry, boxMaterial );
40
- box2.position.set( -5.607, -0.754, -0.758 );
41
- box2.rotation.set( 0, 0.994, 0 );
42
- box2.scale.set( 1.970, 1.534, 3.955 );
43
- this.add( box2 );
44
-
45
- const box3 = new three.Mesh( geometry, boxMaterial );
46
- box3.position.set( 6.167, 0.857, 7.803 );
47
- box3.rotation.set( 0, 0.561, 0 );
48
- box3.scale.set( 3.927, 6.285, 3.687 );
49
- this.add( box3 );
50
-
51
- const box4 = new three.Mesh( geometry, boxMaterial );
52
- box4.position.set( -2.017, 0.018, 6.124 );
53
- box4.rotation.set( 0, 0.333, 0 );
54
- box4.scale.set( 2.002, 4.566, 2.064 );
55
- this.add( box4 );
56
-
57
- const box5 = new three.Mesh( geometry, boxMaterial );
58
- box5.position.set( 2.291, -0.756, -2.621 );
59
- box5.rotation.set( 0, -0.286, 0 );
60
- box5.scale.set( 1.546, 1.552, 1.496 );
61
- this.add( box5 );
62
-
63
- const box6 = new three.Mesh( geometry, boxMaterial );
64
- box6.position.set( -2.193, -0.369, -5.547 );
65
- box6.rotation.set( 0, 0.516, 0 );
66
- box6.scale.set( 3.875, 3.487, 2.986 );
67
- this.add( box6 );
48
+ const boxes = new three.InstancedMesh( geometry, boxMaterial, 6 );
49
+ const transform = new three.Object3D();
50
+
51
+ // box1
52
+ transform.position.set( -10.906, 2.009, 1.846 );
53
+ transform.rotation.set( 0, -0.195, 0 );
54
+ transform.scale.set( 2.328, 7.905, 4.651 );
55
+ transform.updateMatrix();
56
+ boxes.setMatrixAt( 0, transform.matrix );
57
+
58
+ // box2
59
+ transform.position.set( -5.607, -0.754, -0.758 );
60
+ transform.rotation.set( 0, 0.994, 0 );
61
+ transform.scale.set( 1.970, 1.534, 3.955 );
62
+ transform.updateMatrix();
63
+ boxes.setMatrixAt( 1, transform.matrix );
64
+
65
+ // box3
66
+ transform.position.set( 6.167, 0.857, 7.803 );
67
+ transform.rotation.set( 0, 0.561, 0 );
68
+ transform.scale.set( 3.927, 6.285, 3.687 );
69
+ transform.updateMatrix();
70
+ boxes.setMatrixAt( 2, transform.matrix );
71
+
72
+ // box4
73
+ transform.position.set( -2.017, 0.018, 6.124 );
74
+ transform.rotation.set( 0, 0.333, 0 );
75
+ transform.scale.set( 2.002, 4.566, 2.064 );
76
+ transform.updateMatrix();
77
+ boxes.setMatrixAt( 3, transform.matrix );
78
+
79
+ // box5
80
+ transform.position.set( 2.291, -0.756, -2.621 );
81
+ transform.rotation.set( 0, -0.286, 0 );
82
+ transform.scale.set( 1.546, 1.552, 1.496 );
83
+ transform.updateMatrix();
84
+ boxes.setMatrixAt( 4, transform.matrix );
85
+
86
+ // box6
87
+ transform.position.set( -2.193, -0.369, -5.547 );
88
+ transform.rotation.set( 0, 0.516, 0 );
89
+ transform.scale.set( 3.875, 3.487, 2.986 );
90
+ transform.updateMatrix();
91
+ boxes.setMatrixAt( 5, transform.matrix );
92
+
93
+ this.add( boxes );
68
94
 
69
95
 
70
96
  // -x right
@@ -105,6 +131,10 @@
105
131
 
106
132
  }
107
133
 
134
+ /**
135
+ * Frees internal resources. This method should be called
136
+ * when the environment is no longer required.
137
+ */
108
138
  dispose() {
109
139
 
110
140
  const resources = new Set();
@@ -132,8 +162,13 @@
132
162
 
133
163
  function createAreaLightMaterial( intensity ) {
134
164
 
135
- const material = new three.MeshBasicMaterial();
136
- material.color.setScalar( intensity );
165
+ // create an emissive-only material. see #31348
166
+ const material = new three.MeshLambertMaterial( {
167
+ color: 0x000000,
168
+ emissive: 0xffffff,
169
+ emissiveIntensity: intensity
170
+ } );
171
+
137
172
  return material;
138
173
 
139
174
  }
@@ -1 +1 @@
1
- {"version":3,"file":"RoomEnvironmentComponent.js","sources":["../../../../../node_modules/three/examples/jsm/environments/RoomEnvironment.js","../../../plugins/components/RoomEnvironmentComponent.ts"],"sourcesContent":["/**\n * https://github.com/google/model-viewer/blob/master/packages/model-viewer/src/three-components/EnvironmentScene.ts\n */\n\nimport {\n \tBackSide,\n \tBoxGeometry,\n \tMesh,\n\tMeshBasicMaterial,\n \tMeshStandardMaterial,\n \tPointLight,\n \tScene,\n} from 'three';\n\nclass RoomEnvironment extends Scene {\n\n\tconstructor() {\n\n\t\tsuper();\n\n\t\tconst geometry = new BoxGeometry();\n\t\tgeometry.deleteAttribute( 'uv' );\n\n\t\tconst roomMaterial = new MeshStandardMaterial( { side: BackSide } );\n\t\tconst boxMaterial = new MeshStandardMaterial();\n\n\t\tconst mainLight = new PointLight( 0xffffff, 900, 28, 2 );\n\t\tmainLight.position.set( 0.418, 16.199, 0.300 );\n\t\tthis.add( mainLight );\n\n\t\tconst room = new Mesh( geometry, roomMaterial );\n\t\troom.position.set( - 0.757, 13.219, 0.717 );\n\t\troom.scale.set( 31.713, 28.305, 28.591 );\n\t\tthis.add( room );\n\n\t\tconst box1 = new Mesh( geometry, boxMaterial );\n\t\tbox1.position.set( - 10.906, 2.009, 1.846 );\n\t\tbox1.rotation.set( 0, - 0.195, 0 );\n\t\tbox1.scale.set( 2.328, 7.905, 4.651 );\n\t\tthis.add( box1 );\n\n\t\tconst box2 = new Mesh( geometry, boxMaterial );\n\t\tbox2.position.set( - 5.607, - 0.754, - 0.758 );\n\t\tbox2.rotation.set( 0, 0.994, 0 );\n\t\tbox2.scale.set( 1.970, 1.534, 3.955 );\n\t\tthis.add( box2 );\n\n\t\tconst box3 = new Mesh( geometry, boxMaterial );\n\t\tbox3.position.set( 6.167, 0.857, 7.803 );\n\t\tbox3.rotation.set( 0, 0.561, 0 );\n\t\tbox3.scale.set( 3.927, 6.285, 3.687 );\n\t\tthis.add( box3 );\n\n\t\tconst box4 = new Mesh( geometry, boxMaterial );\n\t\tbox4.position.set( - 2.017, 0.018, 6.124 );\n\t\tbox4.rotation.set( 0, 0.333, 0 );\n\t\tbox4.scale.set( 2.002, 4.566, 2.064 );\n\t\tthis.add( box4 );\n\n\t\tconst box5 = new Mesh( geometry, boxMaterial );\n\t\tbox5.position.set( 2.291, - 0.756, - 2.621 );\n\t\tbox5.rotation.set( 0, - 0.286, 0 );\n\t\tbox5.scale.set( 1.546, 1.552, 1.496 );\n\t\tthis.add( box5 );\n\n\t\tconst box6 = new Mesh( geometry, boxMaterial );\n\t\tbox6.position.set( - 2.193, - 0.369, - 5.547 );\n\t\tbox6.rotation.set( 0, 0.516, 0 );\n\t\tbox6.scale.set( 3.875, 3.487, 2.986 );\n\t\tthis.add( box6 );\n\n\n\t\t// -x right\n\t\tconst light1 = new Mesh( geometry, createAreaLightMaterial( 50 ) );\n\t\tlight1.position.set( - 16.116, 14.37, 8.208 );\n\t\tlight1.scale.set( 0.1, 2.428, 2.739 );\n\t\tthis.add( light1 );\n\n\t\t// -x left\n\t\tconst light2 = new Mesh( geometry, createAreaLightMaterial( 50 ) );\n\t\tlight2.position.set( - 16.109, 18.021, - 8.207 );\n\t\tlight2.scale.set( 0.1, 2.425, 2.751 );\n\t\tthis.add( light2 );\n\n\t\t// +x\n\t\tconst light3 = new Mesh( geometry, createAreaLightMaterial( 17 ) );\n\t\tlight3.position.set( 14.904, 12.198, - 1.832 );\n\t\tlight3.scale.set( 0.15, 4.265, 6.331 );\n\t\tthis.add( light3 );\n\n\t\t// +z\n\t\tconst light4 = new Mesh( geometry, createAreaLightMaterial( 43 ) );\n\t\tlight4.position.set( - 0.462, 8.89, 14.520 );\n\t\tlight4.scale.set( 4.38, 5.441, 0.088 );\n\t\tthis.add( light4 );\n\n\t\t// -z\n\t\tconst light5 = new Mesh( geometry, createAreaLightMaterial( 20 ) );\n\t\tlight5.position.set( 3.235, 11.486, - 12.541 );\n\t\tlight5.scale.set( 2.5, 2.0, 0.1 );\n\t\tthis.add( light5 );\n\n\t\t// +y\n\t\tconst light6 = new Mesh( geometry, createAreaLightMaterial( 100 ) );\n\t\tlight6.position.set( 0.0, 20.0, 0.0 );\n\t\tlight6.scale.set( 1.0, 0.1, 1.0 );\n\t\tthis.add( light6 );\n\n\t}\n\n\tdispose() {\n\n\t\tconst resources = new Set();\n\n\t\tthis.traverse( ( object ) => {\n\n\t\t\tif ( object.isMesh ) {\n\n\t\t\t\tresources.add( object.geometry );\n\t\t\t\tresources.add( object.material );\n\n\t\t\t}\n\n\t\t} );\n\n\t\tfor ( const resource of resources ) {\n\n\t\t\tresource.dispose();\n\n\t\t}\n\n\t}\n\n}\n\nfunction createAreaLightMaterial( intensity ) {\n\n\tconst material = new MeshBasicMaterial();\n\tmaterial.color.setScalar( intensity );\n\treturn material;\n\n}\n\nexport { RoomEnvironment };\n","///////////////////////////////////////////////////////////////////////////////\n// Copyright (C) 2002-2025, Open Design Alliance (the \"Alliance\").\n// All rights reserved.\n//\n// This software and its documentation and related materials are owned by\n// the Alliance. The software may only be incorporated into application\n// programs owned by members of the Alliance, subject to a signed\n// Membership Agreement and Supplemental Software License Agreement with the\n// Alliance. The structure and organization of this software are the valuable\n// trade secrets of the Alliance and its suppliers. The software is also\n// protected by copyright law and international treaty provisions. Application\n// programs incorporating this software must include the following statement\n// with their copyright notices:\n//\n// This application incorporates Open Design Alliance software pursuant to a\n// license agreement with Open Design Alliance.\n// Open Design Alliance Copyright (C) 2002-2025 by Open Design Alliance.\n// All rights reserved.\n//\n// By use of this software, its documentation or related materials, you\n// acknowledge and accept the above terms.\n///////////////////////////////////////////////////////////////////////////////\n\nimport { PMREMGenerator } from \"three\";\nimport { RoomEnvironment } from \"three/examples/jsm/environments/RoomEnvironment.js\";\nimport { IComponent, components, Viewer } from \"@inweb/viewer-three\";\n\nclass RoomEnvironmentComponent implements IComponent {\n protected viewer: Viewer;\n\n constructor(viewer: Viewer) {\n this.viewer = viewer;\n\n const environment = new RoomEnvironment();\n const pmremGenerator = new PMREMGenerator(this.viewer.renderer);\n\n this.viewer.scene.environment = pmremGenerator.fromScene(environment).texture;\n\n environment.dispose();\n }\n\n dispose() {\n this.viewer.scene.environment = undefined;\n }\n}\n\ncomponents.registerComponent(\"LightComponent\", (viewer) => new RoomEnvironmentComponent(viewer));\n"],"names":["Scene","BoxGeometry","MeshStandardMaterial","BackSide","PointLight","Mesh","MeshBasicMaterial","PMREMGenerator","components"],"mappings":";;;;;;CAAA;CACA;CACA;;;CAYA,MAAM,eAAe,SAASA,WAAK,CAAC;;CAEpC,CAAC,WAAW,GAAG;;CAEf,EAAE,KAAK,EAAE;;CAET,EAAE,MAAM,QAAQ,GAAG,IAAIC,iBAAW,EAAE;CACpC,EAAE,QAAQ,CAAC,eAAe,EAAE,IAAI,EAAE;;CAElC,EAAE,MAAM,YAAY,GAAG,IAAIC,0BAAoB,EAAE,EAAE,IAAI,EAAEC,cAAQ,EAAE,EAAE;CACrE,EAAE,MAAM,WAAW,GAAG,IAAID,0BAAoB,EAAE;;CAEhD,EAAE,MAAM,SAAS,GAAG,IAAIE,gBAAU,EAAE,QAAQ,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC,EAAE;CAC1D,EAAE,SAAS,CAAC,QAAQ,CAAC,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE;CAChD,EAAE,IAAI,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C,GAAG,QAAQ,CAAC,OAAO,EAAE;;CAErB;;CAEA;;CAEA;;CAEA,SAAS,uBAAuB,EAAE,SAAS,GAAG;;CAE9C,CAAC,MAAM,QAAQ,GAAG,IAAIC,uBAAiB,EAAE;CACzC,CAAC,QAAQ,CAAC,KAAK,CAAC,SAAS,EAAE,SAAS,EAAE;CACtC,CAAC,OAAO,QAAQ;;CAEhB;;CC7IA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CAMA,MAAM,wBAAwB,CAAA;CAG5B,IAAA,WAAA,CAAY,MAAc,EAAA;CACxB,QAAA,IAAI,CAAC,MAAM,GAAG,MAAM;CAEpB,QAAA,MAAM,WAAW,GAAG,IAAI,eAAe,EAAE;SACzC,MAAM,cAAc,GAAG,IAAIC,oBAAc,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC;CAE/D,QAAA,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,WAAW,GAAG,cAAc,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC,OAAO;SAE7E,WAAW,CAAC,OAAO,EAAE;;KAGvB,OAAO,GAAA;SACL,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,WAAW,GAAG,SAAS;;CAE5C;AAEDC,uBAAU,CAAC,iBAAiB,CAAC,gBAAgB,EAAE,CAAC,MAAM,KAAK,IAAI,wBAAwB,CAAC,MAAM,CAAC,CAAC;;;;;;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"RoomEnvironmentComponent.js","sources":["../../../../../node_modules/three/examples/jsm/environments/RoomEnvironment.js","../../../plugins/components/RoomEnvironmentComponent.ts"],"sourcesContent":["import {\n \tBackSide,\n \tBoxGeometry,\n \tInstancedMesh,\n \tMesh,\n\tMeshLambertMaterial,\n \tMeshStandardMaterial,\n \tPointLight,\n \tScene,\n \tObject3D,\n} from 'three';\n\n/**\n * This class represents a scene with a basic room setup that can be used as\n * input for {@link PMREMGenerator#fromScene}. The resulting PMREM represents the room's\n * lighting and can be used for Image Based Lighting by assigning it to {@link Scene#environment}\n * or directly as an environment map to PBR materials.\n *\n * The implementation is based on the [EnvironmentScene](https://github.com/google/model-viewer/blob/master/packages/model-viewer/src/three-components/EnvironmentScene.ts)\n * component from the `model-viewer` project.\n *\n * ```js\n * const environment = new RoomEnvironment();\n * const pmremGenerator = new THREE.PMREMGenerator( renderer );\n *\n * const envMap = pmremGenerator.fromScene( environment ).texture;\n * scene.environment = envMap;\n * ```\n *\n * @augments Scene\n * @three_import import { RoomEnvironment } from 'three/addons/environments/RoomEnvironment.js';\n */\nclass RoomEnvironment extends Scene {\n\n\tconstructor() {\n\n\t\tsuper();\n\n\t\tconst geometry = new BoxGeometry();\n\t\tgeometry.deleteAttribute( 'uv' );\n\n\t\tconst roomMaterial = new MeshStandardMaterial( { side: BackSide } );\n\t\tconst boxMaterial = new MeshStandardMaterial();\n\n\t\tconst mainLight = new PointLight( 0xffffff, 900, 28, 2 );\n\t\tmainLight.position.set( 0.418, 16.199, 0.300 );\n\t\tthis.add( mainLight );\n\n\t\tconst room = new Mesh( geometry, roomMaterial );\n\t\troom.position.set( - 0.757, 13.219, 0.717 );\n\t\troom.scale.set( 31.713, 28.305, 28.591 );\n\t\tthis.add( room );\n\n\t\tconst boxes = new InstancedMesh( geometry, boxMaterial, 6 );\n\t\tconst transform = new Object3D();\n\n\t\t// box1\n\t\ttransform.position.set( - 10.906, 2.009, 1.846 );\n\t\ttransform.rotation.set( 0, - 0.195, 0 );\n\t\ttransform.scale.set( 2.328, 7.905, 4.651 );\n\t\ttransform.updateMatrix();\n\t\tboxes.setMatrixAt( 0, transform.matrix );\n\n\t\t// box2\n\t\ttransform.position.set( - 5.607, - 0.754, - 0.758 );\n\t\ttransform.rotation.set( 0, 0.994, 0 );\n\t\ttransform.scale.set( 1.970, 1.534, 3.955 );\n\t\ttransform.updateMatrix();\n\t\tboxes.setMatrixAt( 1, transform.matrix );\n\n\t\t// box3\n\t\ttransform.position.set( 6.167, 0.857, 7.803 );\n\t\ttransform.rotation.set( 0, 0.561, 0 );\n\t\ttransform.scale.set( 3.927, 6.285, 3.687 );\n\t\ttransform.updateMatrix();\n\t\tboxes.setMatrixAt( 2, transform.matrix );\n\n\t\t// box4\n\t\ttransform.position.set( - 2.017, 0.018, 6.124 );\n\t\ttransform.rotation.set( 0, 0.333, 0 );\n\t\ttransform.scale.set( 2.002, 4.566, 2.064 );\n\t\ttransform.updateMatrix();\n\t\tboxes.setMatrixAt( 3, transform.matrix );\n\n\t\t// box5\n\t\ttransform.position.set( 2.291, - 0.756, - 2.621 );\n\t\ttransform.rotation.set( 0, - 0.286, 0 );\n\t\ttransform.scale.set( 1.546, 1.552, 1.496 );\n\t\ttransform.updateMatrix();\n\t\tboxes.setMatrixAt( 4, transform.matrix );\n\n\t\t// box6\n\t\ttransform.position.set( - 2.193, - 0.369, - 5.547 );\n\t\ttransform.rotation.set( 0, 0.516, 0 );\n\t\ttransform.scale.set( 3.875, 3.487, 2.986 );\n\t\ttransform.updateMatrix();\n\t\tboxes.setMatrixAt( 5, transform.matrix );\n\n\t\tthis.add( boxes );\n\n\n\t\t// -x right\n\t\tconst light1 = new Mesh( geometry, createAreaLightMaterial( 50 ) );\n\t\tlight1.position.set( - 16.116, 14.37, 8.208 );\n\t\tlight1.scale.set( 0.1, 2.428, 2.739 );\n\t\tthis.add( light1 );\n\n\t\t// -x left\n\t\tconst light2 = new Mesh( geometry, createAreaLightMaterial( 50 ) );\n\t\tlight2.position.set( - 16.109, 18.021, - 8.207 );\n\t\tlight2.scale.set( 0.1, 2.425, 2.751 );\n\t\tthis.add( light2 );\n\n\t\t// +x\n\t\tconst light3 = new Mesh( geometry, createAreaLightMaterial( 17 ) );\n\t\tlight3.position.set( 14.904, 12.198, - 1.832 );\n\t\tlight3.scale.set( 0.15, 4.265, 6.331 );\n\t\tthis.add( light3 );\n\n\t\t// +z\n\t\tconst light4 = new Mesh( geometry, createAreaLightMaterial( 43 ) );\n\t\tlight4.position.set( - 0.462, 8.89, 14.520 );\n\t\tlight4.scale.set( 4.38, 5.441, 0.088 );\n\t\tthis.add( light4 );\n\n\t\t// -z\n\t\tconst light5 = new Mesh( geometry, createAreaLightMaterial( 20 ) );\n\t\tlight5.position.set( 3.235, 11.486, - 12.541 );\n\t\tlight5.scale.set( 2.5, 2.0, 0.1 );\n\t\tthis.add( light5 );\n\n\t\t// +y\n\t\tconst light6 = new Mesh( geometry, createAreaLightMaterial( 100 ) );\n\t\tlight6.position.set( 0.0, 20.0, 0.0 );\n\t\tlight6.scale.set( 1.0, 0.1, 1.0 );\n\t\tthis.add( light6 );\n\n\t}\n\n\t/**\n\t * Frees internal resources. This method should be called\n\t * when the environment is no longer required.\n\t */\n\tdispose() {\n\n\t\tconst resources = new Set();\n\n\t\tthis.traverse( ( object ) => {\n\n\t\t\tif ( object.isMesh ) {\n\n\t\t\t\tresources.add( object.geometry );\n\t\t\t\tresources.add( object.material );\n\n\t\t\t}\n\n\t\t} );\n\n\t\tfor ( const resource of resources ) {\n\n\t\t\tresource.dispose();\n\n\t\t}\n\n\t}\n\n}\n\nfunction createAreaLightMaterial( intensity ) {\n\n\t// create an emissive-only material. see #31348\n\tconst material = new MeshLambertMaterial( {\n\t\tcolor: 0x000000,\n\t\temissive: 0xffffff,\n\t\temissiveIntensity: intensity\n\t} );\n\n\treturn material;\n\n}\n\nexport { RoomEnvironment };\n","///////////////////////////////////////////////////////////////////////////////\n// Copyright (C) 2002-2025, Open Design Alliance (the \"Alliance\").\n// All rights reserved.\n//\n// This software and its documentation and related materials are owned by\n// the Alliance. The software may only be incorporated into application\n// programs owned by members of the Alliance, subject to a signed\n// Membership Agreement and Supplemental Software License Agreement with the\n// Alliance. The structure and organization of this software are the valuable\n// trade secrets of the Alliance and its suppliers. The software is also\n// protected by copyright law and international treaty provisions. Application\n// programs incorporating this software must include the following statement\n// with their copyright notices:\n//\n// This application incorporates Open Design Alliance software pursuant to a\n// license agreement with Open Design Alliance.\n// Open Design Alliance Copyright (C) 2002-2025 by Open Design Alliance.\n// All rights reserved.\n//\n// By use of this software, its documentation or related materials, you\n// acknowledge and accept the above terms.\n///////////////////////////////////////////////////////////////////////////////\n\nimport { PMREMGenerator } from \"three\";\nimport { RoomEnvironment } from \"three/examples/jsm/environments/RoomEnvironment.js\";\nimport { IComponent, components, Viewer } from \"@inweb/viewer-three\";\n\nclass RoomEnvironmentComponent implements IComponent {\n protected viewer: Viewer;\n\n constructor(viewer: Viewer) {\n this.viewer = viewer;\n\n const environment = new RoomEnvironment();\n const pmremGenerator = new PMREMGenerator(this.viewer.renderer);\n\n this.viewer.scene.environment = pmremGenerator.fromScene(environment).texture;\n\n environment.dispose();\n }\n\n dispose() {\n this.viewer.scene.environment = undefined;\n }\n}\n\ncomponents.registerComponent(\"LightComponent\", (viewer) => new RoomEnvironmentComponent(viewer));\n"],"names":["Scene","BoxGeometry","MeshStandardMaterial","BackSide","PointLight","Mesh","InstancedMesh","Object3D","MeshLambertMaterial","PMREMGenerator","components"],"mappings":";;;;;;CAYA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA,MAAM,eAAe,SAASA,WAAK,CAAC;;CAEpC,CAAC,WAAW,GAAG;;CAEf,EAAE,KAAK,EAAE;;CAET,EAAE,MAAM,QAAQ,GAAG,IAAIC,iBAAW,EAAE;CACpC,EAAE,QAAQ,CAAC,eAAe,EAAE,IAAI,EAAE;;CAElC,EAAE,MAAM,YAAY,GAAG,IAAIC,0BAAoB,EAAE,EAAE,IAAI,EAAEC,cAAQ,EAAE,EAAE;CACrE,EAAE,MAAM,WAAW,GAAG,IAAID,0BAAoB,EAAE;;CAEhD,EAAE,MAAM,SAAS,GAAG,IAAIE,gBAAU,EAAE,QAAQ,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC,EAAE;CAC1D,EAAE,SAAS,CAAC,QAAQ,C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google_ignoreList":[0]}
@@ -1 +1 @@
1
- !function(e,s){"object"==typeof exports&&"undefined"!=typeof module?s(require("three"),require("@inweb/viewer-three")):"function"==typeof define&&define.amd?define(["three","@inweb/viewer-three"],s):s((e="undefined"!=typeof globalThis?globalThis:e||self).THREE,e.ODA.Three)}(this,(function(e,s){"use strict";class t extends e.Scene{constructor(){super();const s=new e.BoxGeometry;s.deleteAttribute("uv");const t=new e.MeshStandardMaterial({side:e.BackSide}),o=new e.MeshStandardMaterial,i=new e.PointLight(16777215,900,28,2);i.position.set(.418,16.199,.3),this.add(i);const a=new e.Mesh(s,t);a.position.set(-.757,13.219,.717),a.scale.set(31.713,28.305,28.591),this.add(a);const d=new e.Mesh(s,o);d.position.set(-10.906,2.009,1.846),d.rotation.set(0,-.195,0),d.scale.set(2.328,7.905,4.651),this.add(d);const r=new e.Mesh(s,o);r.position.set(-5.607,-.754,-.758),r.rotation.set(0,.994,0),r.scale.set(1.97,1.534,3.955),this.add(r);const c=new e.Mesh(s,o);c.position.set(6.167,.857,7.803),c.rotation.set(0,.561,0),c.scale.set(3.927,6.285,3.687),this.add(c);const h=new e.Mesh(s,o);h.position.set(-2.017,.018,6.124),h.rotation.set(0,.333,0),h.scale.set(2.002,4.566,2.064),this.add(h);const w=new e.Mesh(s,o);w.position.set(2.291,-.756,-2.621),w.rotation.set(0,-.286,0),w.scale.set(1.546,1.552,1.496),this.add(w);const l=new e.Mesh(s,o);l.position.set(-2.193,-.369,-5.547),l.rotation.set(0,.516,0),l.scale.set(3.875,3.487,2.986),this.add(l);const p=new e.Mesh(s,n(50));p.position.set(-16.116,14.37,8.208),p.scale.set(.1,2.428,2.739),this.add(p);const M=new e.Mesh(s,n(50));M.position.set(-16.109,18.021,-8.207),M.scale.set(.1,2.425,2.751),this.add(M);const f=new e.Mesh(s,n(17));f.position.set(14.904,12.198,-1.832),f.scale.set(.15,4.265,6.331),this.add(f);const u=new e.Mesh(s,n(43));u.position.set(-.462,8.89,14.52),u.scale.set(4.38,5.441,.088),this.add(u);const m=new e.Mesh(s,n(20));m.position.set(3.235,11.486,-12.541),m.scale.set(2.5,2,.1),this.add(m);const v=new e.Mesh(s,n(100));v.position.set(0,20,0),v.scale.set(1,.1,1),this.add(v)}dispose(){const e=new Set;this.traverse((s=>{s.isMesh&&(e.add(s.geometry),e.add(s.material))}));for(const s of e)s.dispose()}}function n(s){const t=new e.MeshBasicMaterial;return t.color.setScalar(s),t}class o{constructor(s){this.viewer=s;const n=new t,o=new e.PMREMGenerator(this.viewer.renderer);this.viewer.scene.environment=o.fromScene(n).texture,n.dispose()}dispose(){this.viewer.scene.environment=void 0}}s.components.registerComponent("LightComponent",(e=>new o(e)))}));
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(require("three"),require("@inweb/viewer-three")):"function"==typeof define&&define.amd?define(["three","@inweb/viewer-three"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).THREE,e.ODA.Three)}(this,(function(e,t){"use strict";class s extends e.Scene{constructor(){super();const t=new e.BoxGeometry;t.deleteAttribute("uv");const s=new e.MeshStandardMaterial({side:e.BackSide}),n=new e.MeshStandardMaterial,o=new e.PointLight(16777215,900,28,2);o.position.set(.418,16.199,.3),this.add(o);const a=new e.Mesh(t,s);a.position.set(-.757,13.219,.717),a.scale.set(31.713,28.305,28.591),this.add(a);const r=new e.InstancedMesh(t,n,6),d=new e.Object3D;d.position.set(-10.906,2.009,1.846),d.rotation.set(0,-.195,0),d.scale.set(2.328,7.905,4.651),d.updateMatrix(),r.setMatrixAt(0,d.matrix),d.position.set(-5.607,-.754,-.758),d.rotation.set(0,.994,0),d.scale.set(1.97,1.534,3.955),d.updateMatrix(),r.setMatrixAt(1,d.matrix),d.position.set(6.167,.857,7.803),d.rotation.set(0,.561,0),d.scale.set(3.927,6.285,3.687),d.updateMatrix(),r.setMatrixAt(2,d.matrix),d.position.set(-2.017,.018,6.124),d.rotation.set(0,.333,0),d.scale.set(2.002,4.566,2.064),d.updateMatrix(),r.setMatrixAt(3,d.matrix),d.position.set(2.291,-.756,-2.621),d.rotation.set(0,-.286,0),d.scale.set(1.546,1.552,1.496),d.updateMatrix(),r.setMatrixAt(4,d.matrix),d.position.set(-2.193,-.369,-5.547),d.rotation.set(0,.516,0),d.scale.set(3.875,3.487,2.986),d.updateMatrix(),r.setMatrixAt(5,d.matrix),this.add(r);const c=new e.Mesh(t,i(50));c.position.set(-16.116,14.37,8.208),c.scale.set(.1,2.428,2.739),this.add(c);const h=new e.Mesh(t,i(50));h.position.set(-16.109,18.021,-8.207),h.scale.set(.1,2.425,2.751),this.add(h);const p=new e.Mesh(t,i(17));p.position.set(14.904,12.198,-1.832),p.scale.set(.15,4.265,6.331),this.add(p);const M=new e.Mesh(t,i(43));M.position.set(-.462,8.89,14.52),M.scale.set(4.38,5.441,.088),this.add(M);const l=new e.Mesh(t,i(20));l.position.set(3.235,11.486,-12.541),l.scale.set(2.5,2,.1),this.add(l);const w=new e.Mesh(t,i(100));w.position.set(0,20,0),w.scale.set(1,.1,1),this.add(w)}dispose(){const e=new Set;this.traverse((t=>{t.isMesh&&(e.add(t.geometry),e.add(t.material))}));for(const t of e)t.dispose()}}function i(t){return new e.MeshLambertMaterial({color:0,emissive:16777215,emissiveIntensity:t})}class n{constructor(t){this.viewer=t;const i=new s,n=new e.PMREMGenerator(this.viewer.renderer);this.viewer.scene.environment=n.fromScene(i).texture,i.dispose()}dispose(){this.viewer.scene.environment=void 0}}t.components.registerComponent("LightComponent",(e=>new n(e)))}));
@@ -195,8 +195,8 @@
195
195
  class StatsPanelComponent {
196
196
  constructor(viewer) {
197
197
  this.updateStats = () => {
198
+ this.viewer.render(null, true);
198
199
  this.stats.update();
199
- this.viewer.update();
200
200
  };
201
201
  this.stats = new Stats();
202
202
  this.stats.dom.style.position = "absolute";
@@ -1 +1 @@
1
- {"version":3,"file":"StatsPanelComponent.js","sources":["../../../../../node_modules/three/examples/jsm/libs/stats.module.js","../../../plugins/components/StatsPanelComponent.ts"],"sourcesContent":["var Stats = function () {\n\n\tvar mode = 0;\n\n\tvar container = document.createElement( 'div' );\n\tcontainer.style.cssText = 'position:fixed;top:0;left:0;cursor:pointer;opacity:0.9;z-index:10000';\n\tcontainer.addEventListener( 'click', function ( event ) {\n\n\t\tevent.preventDefault();\n\t\tshowPanel( ++ mode % container.children.length );\n\n\t}, false );\n\n\t//\n\n\tfunction addPanel( panel ) {\n\n\t\tcontainer.appendChild( panel.dom );\n\t\treturn panel;\n\n\t}\n\n\tfunction showPanel( id ) {\n\n\t\tfor ( var i = 0; i < container.children.length; i ++ ) {\n\n\t\t\tcontainer.children[ i ].style.display = i === id ? 'block' : 'none';\n\n\t\t}\n\n\t\tmode = id;\n\n\t}\n\n\t//\n\n\tvar beginTime = ( performance || Date ).now(), prevTime = beginTime, frames = 0;\n\n\tvar fpsPanel = addPanel( new Stats.Panel( 'FPS', '#0ff', '#002' ) );\n\tvar msPanel = addPanel( new Stats.Panel( 'MS', '#0f0', '#020' ) );\n\n\tif ( self.performance && self.performance.memory ) {\n\n\t\tvar memPanel = addPanel( new Stats.Panel( 'MB', '#f08', '#201' ) );\n\n\t}\n\n\tshowPanel( 0 );\n\n\treturn {\n\n\t\tREVISION: 16,\n\n\t\tdom: container,\n\n\t\taddPanel: addPanel,\n\t\tshowPanel: showPanel,\n\n\t\tbegin: function () {\n\n\t\t\tbeginTime = ( performance || Date ).now();\n\n\t\t},\n\n\t\tend: function () {\n\n\t\t\tframes ++;\n\n\t\t\tvar time = ( performance || Date ).now();\n\n\t\t\tmsPanel.update( time - beginTime, 200 );\n\n\t\t\tif ( time >= prevTime + 1000 ) {\n\n\t\t\t\tfpsPanel.update( ( frames * 1000 ) / ( time - prevTime ), 100 );\n\n\t\t\t\tprevTime = time;\n\t\t\t\tframes = 0;\n\n\t\t\t\tif ( memPanel ) {\n\n\t\t\t\t\tvar memory = performance.memory;\n\t\t\t\t\tmemPanel.update( memory.usedJSHeapSize / 1048576, memory.jsHeapSizeLimit / 1048576 );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\treturn time;\n\n\t\t},\n\n\t\tupdate: function () {\n\n\t\t\tbeginTime = this.end();\n\n\t\t},\n\n\t\t// Backwards Compatibility\n\n\t\tdomElement: container,\n\t\tsetMode: showPanel\n\n\t};\n\n};\n\nStats.Panel = function ( name, fg, bg ) {\n\n\tvar min = Infinity, max = 0, round = Math.round;\n\tvar PR = round( window.devicePixelRatio || 1 );\n\n\tvar WIDTH = 80 * PR, HEIGHT = 48 * PR,\n\t\tTEXT_X = 3 * PR, TEXT_Y = 2 * PR,\n\t\tGRAPH_X = 3 * PR, GRAPH_Y = 15 * PR,\n\t\tGRAPH_WIDTH = 74 * PR, GRAPH_HEIGHT = 30 * PR;\n\n\tvar canvas = document.createElement( 'canvas' );\n\tcanvas.width = WIDTH;\n\tcanvas.height = HEIGHT;\n\tcanvas.style.cssText = 'width:80px;height:48px';\n\n\tvar context = canvas.getContext( '2d' );\n\tcontext.font = 'bold ' + ( 9 * PR ) + 'px Helvetica,Arial,sans-serif';\n\tcontext.textBaseline = 'top';\n\n\tcontext.fillStyle = bg;\n\tcontext.fillRect( 0, 0, WIDTH, HEIGHT );\n\n\tcontext.fillStyle = fg;\n\tcontext.fillText( name, TEXT_X, TEXT_Y );\n\tcontext.fillRect( GRAPH_X, GRAPH_Y, GRAPH_WIDTH, GRAPH_HEIGHT );\n\n\tcontext.fillStyle = bg;\n\tcontext.globalAlpha = 0.9;\n\tcontext.fillRect( GRAPH_X, GRAPH_Y, GRAPH_WIDTH, GRAPH_HEIGHT );\n\n\treturn {\n\n\t\tdom: canvas,\n\n\t\tupdate: function ( value, maxValue ) {\n\n\t\t\tmin = Math.min( min, value );\n\t\t\tmax = Math.max( max, value );\n\n\t\t\tcontext.fillStyle = bg;\n\t\t\tcontext.globalAlpha = 1;\n\t\t\tcontext.fillRect( 0, 0, WIDTH, GRAPH_Y );\n\t\t\tcontext.fillStyle = fg;\n\t\t\tcontext.fillText( round( value ) + ' ' + name + ' (' + round( min ) + '-' + round( max ) + ')', TEXT_X, TEXT_Y );\n\n\t\t\tcontext.drawImage( canvas, GRAPH_X + PR, GRAPH_Y, GRAPH_WIDTH - PR, GRAPH_HEIGHT, GRAPH_X, GRAPH_Y, GRAPH_WIDTH - PR, GRAPH_HEIGHT );\n\n\t\t\tcontext.fillRect( GRAPH_X + GRAPH_WIDTH - PR, GRAPH_Y, PR, GRAPH_HEIGHT );\n\n\t\t\tcontext.fillStyle = bg;\n\t\t\tcontext.globalAlpha = 0.9;\n\t\t\tcontext.fillRect( GRAPH_X + GRAPH_WIDTH - PR, GRAPH_Y, PR, round( ( 1 - ( value / maxValue ) ) * GRAPH_HEIGHT ) );\n\n\t\t}\n\n\t};\n\n};\n\nexport default Stats;\n","///////////////////////////////////////////////////////////////////////////////\n// Copyright (C) 2002-2025, Open Design Alliance (the \"Alliance\").\n// All rights reserved.\n//\n// This software and its documentation and related materials are owned by\n// the Alliance. The software may only be incorporated into application\n// programs owned by members of the Alliance, subject to a signed\n// Membership Agreement and Supplemental Software License Agreement with the\n// Alliance. The structure and organization of this software are the valuable\n// trade secrets of the Alliance and its suppliers. The software is also\n// protected by copyright law and international treaty provisions. Application\n// programs incorporating this software must include the following statement\n// with their copyright notices:\n//\n// This application incorporates Open Design Alliance software pursuant to a\n// license agreement with Open Design Alliance.\n// Open Design Alliance Copyright (C) 2002-2025 by Open Design Alliance.\n// All rights reserved.\n//\n// By use of this software, its documentation or related materials, you\n// acknowledge and accept the above terms.\n///////////////////////////////////////////////////////////////////////////////\n\nimport Stats from \"three/examples/jsm/libs/stats.module.js\";\nimport { IComponent, components, Viewer } from \"@inweb/viewer-three\";\n\nclass StatsPanelComponent implements IComponent {\n protected viewer: Viewer;\n protected stats: Stats;\n\n constructor(viewer: Viewer) {\n this.stats = new Stats();\n this.stats.dom.style.position = \"absolute\";\n viewer.canvas.parentElement.appendChild(this.stats.dom);\n\n this.viewer = viewer;\n this.viewer.on(\"animate\", this.updateStats);\n }\n\n dispose() {\n this.viewer.off(\"animate\", this.updateStats);\n\n this.stats.dom.remove();\n this.stats = undefined;\n }\n\n updateStats = () => {\n this.stats.update();\n this.viewer.update();\n };\n}\n\ncomponents.registerComponent(\"StatsPanelComponent\", (viewer) => new StatsPanelComponent(viewer));\n"],"names":["components"],"mappings":";;;;;;CAAA,IAAI,KAAK,GAAG,YAAY;;CAExB,CAAC,IAAI,IAAI,GAAG,CAAC;;CAEb,CAAC,IAAI,SAAS,GAAG,QAAQ,CAAC,aAAa,EAAE,KAAK,EAAE;CAChD,CAAC,SAAS,CAAC,KAAK,CAAC,OAAO,GAAG,sEAAsE;CACjG,CAAC,SAAS,CAAC,gBAAgB,EAAE,OAAO,EAAE,WAAW,KAAK,GAAG;;CAEzD,EAAE,KAAK,CAAC,cAAc,EAAE;CACxB,EAAE,SAAS,EAAE,GAAG,IAAI,GAAG,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE;;CAElD,EAAE,EAAE,KAAK,EAAE;;CAEX;;CAEA,CAAC,SAAS,QAAQ,EAAE,KAAK,GAAG;;CAE5B,EAAE,SAAS,CAAC,WAAW,EAAE,KAAK,CAAC,GAAG,EAAE;CACpC,EAAE,OAAO,KAAK;;CAEd;;CAEA,CAAC,SAAS,SAAS,EAAE,EAAE,GAAG;;CAE1B,EAAE,MAAM,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC,GAAG,GAAG;;CAEzD,GAAG,SAAS,CAAC,QAAQ,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC,OAAO,GAAG,CAAC,KAAK,EAAE,GAAG,OAAO,GAAG,MAAM;;CAEtE;;CAEA,EAAE,IAAI,GAAG,EAAE;;CAEX;;CAEA;;CAEA,CAAC,IAAI,SAAS,GAAG,EAAE,WAAW,IAAI,IAAI,GAAG,GAAG,EAAE,EAAE,QAAQ,GAAG,SAAS,EAAE,MAAM,GAAG,CAAC;;CAEhF,CAAC,IAAI,QAAQ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,GAAG,MAAM;SACpB,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,SAAS,EAAE,IAAI,CAAC,WAAW,CAAC;;KAG7C,OAAO,GAAA;SACL,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,SAAS,EAAE,IAAI,CAAC,WAAW,CAAC;CAE5C,QAAA,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,EAAE;CACvB,QAAA,IAAI,CAAC,KAAK,GAAG,SAAS;;CAOzB;AAEDA,uBAAU,CAAC,iBAAiB,CAAC,qBAAqB,EAAE,CAAC,MAAM,KAAK,IAAI,mBAAmB,CAAC,MAAM,CAAC,CAAC;;;;;;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"StatsPanelComponent.js","sources":["../../../../../node_modules/three/examples/jsm/libs/stats.module.js","../../../plugins/components/StatsPanelComponent.ts"],"sourcesContent":["var Stats = function () {\n\n\tvar mode = 0;\n\n\tvar container = document.createElement( 'div' );\n\tcontainer.style.cssText = 'position:fixed;top:0;left:0;cursor:pointer;opacity:0.9;z-index:10000';\n\tcontainer.addEventListener( 'click', function ( event ) {\n\n\t\tevent.preventDefault();\n\t\tshowPanel( ++ mode % container.children.length );\n\n\t}, false );\n\n\t//\n\n\tfunction addPanel( panel ) {\n\n\t\tcontainer.appendChild( panel.dom );\n\t\treturn panel;\n\n\t}\n\n\tfunction showPanel( id ) {\n\n\t\tfor ( var i = 0; i < container.children.length; i ++ ) {\n\n\t\t\tcontainer.children[ i ].style.display = i === id ? 'block' : 'none';\n\n\t\t}\n\n\t\tmode = id;\n\n\t}\n\n\t//\n\n\tvar beginTime = ( performance || Date ).now(), prevTime = beginTime, frames = 0;\n\n\tvar fpsPanel = addPanel( new Stats.Panel( 'FPS', '#0ff', '#002' ) );\n\tvar msPanel = addPanel( new Stats.Panel( 'MS', '#0f0', '#020' ) );\n\n\tif ( self.performance && self.performance.memory ) {\n\n\t\tvar memPanel = addPanel( new Stats.Panel( 'MB', '#f08', '#201' ) );\n\n\t}\n\n\tshowPanel( 0 );\n\n\treturn {\n\n\t\tREVISION: 16,\n\n\t\tdom: container,\n\n\t\taddPanel: addPanel,\n\t\tshowPanel: showPanel,\n\n\t\tbegin: function () {\n\n\t\t\tbeginTime = ( performance || Date ).now();\n\n\t\t},\n\n\t\tend: function () {\n\n\t\t\tframes ++;\n\n\t\t\tvar time = ( performance || Date ).now();\n\n\t\t\tmsPanel.update( time - beginTime, 200 );\n\n\t\t\tif ( time >= prevTime + 1000 ) {\n\n\t\t\t\tfpsPanel.update( ( frames * 1000 ) / ( time - prevTime ), 100 );\n\n\t\t\t\tprevTime = time;\n\t\t\t\tframes = 0;\n\n\t\t\t\tif ( memPanel ) {\n\n\t\t\t\t\tvar memory = performance.memory;\n\t\t\t\t\tmemPanel.update( memory.usedJSHeapSize / 1048576, memory.jsHeapSizeLimit / 1048576 );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\treturn time;\n\n\t\t},\n\n\t\tupdate: function () {\n\n\t\t\tbeginTime = this.end();\n\n\t\t},\n\n\t\t// Backwards Compatibility\n\n\t\tdomElement: container,\n\t\tsetMode: showPanel\n\n\t};\n\n};\n\nStats.Panel = function ( name, fg, bg ) {\n\n\tvar min = Infinity, max = 0, round = Math.round;\n\tvar PR = round( window.devicePixelRatio || 1 );\n\n\tvar WIDTH = 80 * PR, HEIGHT = 48 * PR,\n\t\tTEXT_X = 3 * PR, TEXT_Y = 2 * PR,\n\t\tGRAPH_X = 3 * PR, GRAPH_Y = 15 * PR,\n\t\tGRAPH_WIDTH = 74 * PR, GRAPH_HEIGHT = 30 * PR;\n\n\tvar canvas = document.createElement( 'canvas' );\n\tcanvas.width = WIDTH;\n\tcanvas.height = HEIGHT;\n\tcanvas.style.cssText = 'width:80px;height:48px';\n\n\tvar context = canvas.getContext( '2d' );\n\tcontext.font = 'bold ' + ( 9 * PR ) + 'px Helvetica,Arial,sans-serif';\n\tcontext.textBaseline = 'top';\n\n\tcontext.fillStyle = bg;\n\tcontext.fillRect( 0, 0, WIDTH, HEIGHT );\n\n\tcontext.fillStyle = fg;\n\tcontext.fillText( name, TEXT_X, TEXT_Y );\n\tcontext.fillRect( GRAPH_X, GRAPH_Y, GRAPH_WIDTH, GRAPH_HEIGHT );\n\n\tcontext.fillStyle = bg;\n\tcontext.globalAlpha = 0.9;\n\tcontext.fillRect( GRAPH_X, GRAPH_Y, GRAPH_WIDTH, GRAPH_HEIGHT );\n\n\treturn {\n\n\t\tdom: canvas,\n\n\t\tupdate: function ( value, maxValue ) {\n\n\t\t\tmin = Math.min( min, value );\n\t\t\tmax = Math.max( max, value );\n\n\t\t\tcontext.fillStyle = bg;\n\t\t\tcontext.globalAlpha = 1;\n\t\t\tcontext.fillRect( 0, 0, WIDTH, GRAPH_Y );\n\t\t\tcontext.fillStyle = fg;\n\t\t\tcontext.fillText( round( value ) + ' ' + name + ' (' + round( min ) + '-' + round( max ) + ')', TEXT_X, TEXT_Y );\n\n\t\t\tcontext.drawImage( canvas, GRAPH_X + PR, GRAPH_Y, GRAPH_WIDTH - PR, GRAPH_HEIGHT, GRAPH_X, GRAPH_Y, GRAPH_WIDTH - PR, GRAPH_HEIGHT );\n\n\t\t\tcontext.fillRect( GRAPH_X + GRAPH_WIDTH - PR, GRAPH_Y, PR, GRAPH_HEIGHT );\n\n\t\t\tcontext.fillStyle = bg;\n\t\t\tcontext.globalAlpha = 0.9;\n\t\t\tcontext.fillRect( GRAPH_X + GRAPH_WIDTH - PR, GRAPH_Y, PR, round( ( 1 - ( value / maxValue ) ) * GRAPH_HEIGHT ) );\n\n\t\t}\n\n\t};\n\n};\n\nexport default Stats;\n","///////////////////////////////////////////////////////////////////////////////\n// Copyright (C) 2002-2025, Open Design Alliance (the \"Alliance\").\n// All rights reserved.\n//\n// This software and its documentation and related materials are owned by\n// the Alliance. The software may only be incorporated into application\n// programs owned by members of the Alliance, subject to a signed\n// Membership Agreement and Supplemental Software License Agreement with the\n// Alliance. The structure and organization of this software are the valuable\n// trade secrets of the Alliance and its suppliers. The software is also\n// protected by copyright law and international treaty provisions. Application\n// programs incorporating this software must include the following statement\n// with their copyright notices:\n//\n// This application incorporates Open Design Alliance software pursuant to a\n// license agreement with Open Design Alliance.\n// Open Design Alliance Copyright (C) 2002-2025 by Open Design Alliance.\n// All rights reserved.\n//\n// By use of this software, its documentation or related materials, you\n// acknowledge and accept the above terms.\n///////////////////////////////////////////////////////////////////////////////\n\nimport Stats from \"three/examples/jsm/libs/stats.module.js\";\nimport { IComponent, components, Viewer } from \"@inweb/viewer-three\";\n\nclass StatsPanelComponent implements IComponent {\n protected viewer: Viewer;\n protected stats: Stats;\n\n constructor(viewer: Viewer) {\n this.stats = new Stats();\n this.stats.dom.style.position = \"absolute\";\n viewer.canvas.parentElement.appendChild(this.stats.dom);\n\n this.viewer = viewer;\n this.viewer.on(\"animate\", this.updateStats);\n }\n\n dispose() {\n this.viewer.off(\"animate\", this.updateStats);\n\n this.stats.dom.remove();\n this.stats = undefined;\n }\n\n updateStats = () => {\n this.viewer.render(null, true);\n this.stats.update();\n };\n}\n\ncomponents.registerComponent(\"StatsPanelComponent\", (viewer) => new StatsPanelComponent(viewer));\n"],"names":["components"],"mappings":";;;;;;CAAA,IAAI,KAAK,GAAG,YAAY;;CAExB,CAAC,IAAI,IAAI,GAAG,CAAC;;CAEb,CAAC,IAAI,SAAS,GAAG,QAAQ,CAAC,aAAa,EAAE,KAAK,EAAE;CAChD,CAAC,SAAS,CAAC,KAAK,CAAC,OAAO,GAAG,sEAAsE;CACjG,CAAC,SAAS,CAAC,gBAAgB,EAAE,OAAO,EAAE,WAAW,KAAK,GAAG;;CAEzD,EAAE,KAAK,CAAC,cAAc,EAAE;CACxB,EAAE,SAAS,EAAE,GAAG,IAAI,GAAG,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE;;CAElD,EAAE,EAAE,KAAK,EAAE;;CAEX;;CAEA,CAAC,SAAS,QAAQ,EAAE,KAAK,GAAG;;CAE5B,EAAE,SAAS,CAAC,WAAW,EA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A;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CAKA,MAAM,mBAAmB,CAAA;CAIvB,IAAA,WAAA,CAAY,MAAc,EAAA;SAgB1B,IAAW,CAAA,WAAA,GAAG,MAAK;aACjB,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC;CAC9B,YAAA,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE;CACrB,SAAC;CAlBC,QAAA,IAAI,CAAC,KAAK,GAAG,IAAI,KAAK,EAAE;SACxB,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,QAAQ,GAAG,UAAU;CAC1C,QAAA,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC;CAEvD,QAAA,IAAI,CAAC,MAAM,GAAG,MAAM;SACpB,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,SAAS,EAAE,IAAI,CAAC,WAAW,CAAC;;KAG7C,OAAO,GAAA;SACL,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,SAAS,EAAE,IAAI,CAAC,WAAW,CAAC;CAE5C,QAAA,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,EAAE;CACvB,QAAA,IAAI,CAAC,KAAK,GAAG,SAAS;;CAOzB;AAEDA,uBAAU,CAAC,iBAAiB,CAAC,qBAAqB,EAAE,CAAC,MAAM,KAAK,IAAI,mBAAmB,CAAC,MAAM,CAAC,CAAC;;;;;;","x_google_ignoreList":[0]}
@@ -1 +1 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(require("@inweb/viewer-three")):"function"==typeof define&&define.amd?define(["@inweb/viewer-three"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).ODA.Three)}(this,(function(e){"use strict";var t=function(){var e=0,n=document.createElement("div");function i(e){return n.appendChild(e.dom),e}function a(t){for(var i=0;i<n.children.length;i++)n.children[i].style.display=i===t?"block":"none";e=t}n.style.cssText="position:fixed;top:0;left:0;cursor:pointer;opacity:0.9;z-index:10000",n.addEventListener("click",(function(t){t.preventDefault(),a(++e%n.children.length)}),!1);var l=(performance||Date).now(),o=l,s=0,r=i(new t.Panel("FPS","#0ff","#002")),f=i(new t.Panel("MS","#0f0","#020"));if(self.performance&&self.performance.memory)var d=i(new t.Panel("MB","#f08","#201"));return a(0),{REVISION:16,dom:n,addPanel:i,showPanel:a,begin:function(){l=(performance||Date).now()},end:function(){s++;var e=(performance||Date).now();if(f.update(e-l,200),e>=o+1e3&&(r.update(1e3*s/(e-o),100),o=e,s=0,d)){var t=performance.memory;d.update(t.usedJSHeapSize/1048576,t.jsHeapSizeLimit/1048576)}return e},update:function(){l=this.end()},domElement:n,setMode:a}};t.Panel=function(e,t,n){var i=1/0,a=0,l=Math.round,o=l(window.devicePixelRatio||1),s=80*o,r=48*o,f=3*o,d=2*o,c=3*o,p=15*o,h=74*o,u=30*o,m=document.createElement("canvas");m.width=s,m.height=r,m.style.cssText="width:80px;height:48px";var v=m.getContext("2d");return v.font="bold "+9*o+"px Helvetica,Arial,sans-serif",v.textBaseline="top",v.fillStyle=n,v.fillRect(0,0,s,r),v.fillStyle=t,v.fillText(e,f,d),v.fillRect(c,p,h,u),v.fillStyle=n,v.globalAlpha=.9,v.fillRect(c,p,h,u),{dom:m,update:function(r,w){i=Math.min(i,r),a=Math.max(a,r),v.fillStyle=n,v.globalAlpha=1,v.fillRect(0,0,s,p),v.fillStyle=t,v.fillText(l(r)+" "+e+" ("+l(i)+"-"+l(a)+")",f,d),v.drawImage(m,c+o,p,h-o,u,c,p,h-o,u),v.fillRect(c+h-o,p,o,u),v.fillStyle=n,v.globalAlpha=.9,v.fillRect(c+h-o,p,o,l((1-r/w)*u))}}};class n{constructor(e){this.updateStats=()=>{this.stats.update(),this.viewer.update()},this.stats=new t,this.stats.dom.style.position="absolute",e.canvas.parentElement.appendChild(this.stats.dom),this.viewer=e,this.viewer.on("animate",this.updateStats)}dispose(){this.viewer.off("animate",this.updateStats),this.stats.dom.remove(),this.stats=void 0}}e.components.registerComponent("StatsPanelComponent",(e=>new n(e)))}));
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(require("@inweb/viewer-three")):"function"==typeof define&&define.amd?define(["@inweb/viewer-three"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).ODA.Three)}(this,(function(e){"use strict";var t=function(){var e=0,n=document.createElement("div");function i(e){return n.appendChild(e.dom),e}function l(t){for(var i=0;i<n.children.length;i++)n.children[i].style.display=i===t?"block":"none";e=t}n.style.cssText="position:fixed;top:0;left:0;cursor:pointer;opacity:0.9;z-index:10000",n.addEventListener("click",(function(t){t.preventDefault(),l(++e%n.children.length)}),!1);var a=(performance||Date).now(),o=a,s=0,r=i(new t.Panel("FPS","#0ff","#002")),f=i(new t.Panel("MS","#0f0","#020"));if(self.performance&&self.performance.memory)var d=i(new t.Panel("MB","#f08","#201"));return l(0),{REVISION:16,dom:n,addPanel:i,showPanel:l,begin:function(){a=(performance||Date).now()},end:function(){s++;var e=(performance||Date).now();if(f.update(e-a,200),e>=o+1e3&&(r.update(1e3*s/(e-o),100),o=e,s=0,d)){var t=performance.memory;d.update(t.usedJSHeapSize/1048576,t.jsHeapSizeLimit/1048576)}return e},update:function(){a=this.end()},domElement:n,setMode:l}};t.Panel=function(e,t,n){var i=1/0,l=0,a=Math.round,o=a(window.devicePixelRatio||1),s=80*o,r=48*o,f=3*o,d=2*o,c=3*o,p=15*o,h=74*o,u=30*o,m=document.createElement("canvas");m.width=s,m.height=r,m.style.cssText="width:80px;height:48px";var v=m.getContext("2d");return v.font="bold "+9*o+"px Helvetica,Arial,sans-serif",v.textBaseline="top",v.fillStyle=n,v.fillRect(0,0,s,r),v.fillStyle=t,v.fillText(e,f,d),v.fillRect(c,p,h,u),v.fillStyle=n,v.globalAlpha=.9,v.fillRect(c,p,h,u),{dom:m,update:function(r,w){i=Math.min(i,r),l=Math.max(l,r),v.fillStyle=n,v.globalAlpha=1,v.fillRect(0,0,s,p),v.fillStyle=t,v.fillText(a(r)+" "+e+" ("+a(i)+"-"+a(l)+")",f,d),v.drawImage(m,c+o,p,h-o,u,c,p,h-o,u),v.fillRect(c+h-o,p,o,u),v.fillStyle=n,v.globalAlpha=.9,v.fillRect(c+h-o,p,o,a((1-r/w)*u))}}};class n{constructor(e){this.updateStats=()=>{this.viewer.render(null,!0),this.stats.update()},this.stats=new t,this.stats.dom.style.position="absolute",e.canvas.parentElement.appendChild(this.stats.dom),this.viewer=e,this.viewer.on("animate",this.updateStats)}dispose(){this.viewer.off("animate",this.updateStats),this.stats.dom.remove(),this.stats=void 0}}e.components.registerComponent("StatsPanelComponent",(e=>new n(e)))}));
@@ -5,8 +5,8 @@ import { components } from "@inweb/viewer-three";
5
5
  class StatsPanelComponent {
6
6
  constructor(viewer) {
7
7
  this.updateStats = () => {
8
+ this.viewer.render(null, true);
8
9
  this.stats.update();
9
- this.viewer.update();
10
10
  };
11
11
  this.stats = new Stats;
12
12
  this.stats.dom.style.position = "absolute";
@@ -1 +1 @@
1
- {"version":3,"file":"StatsPanelComponent.module.js","sources":["../../../plugins/components/StatsPanelComponent.ts"],"sourcesContent":["///////////////////////////////////////////////////////////////////////////////\n// Copyright (C) 2002-2025, Open Design Alliance (the \"Alliance\").\n// All rights reserved.\n//\n// This software and its documentation and related materials are owned by\n// the Alliance. The software may only be incorporated into application\n// programs owned by members of the Alliance, subject to a signed\n// Membership Agreement and Supplemental Software License Agreement with the\n// Alliance. The structure and organization of this software are the valuable\n// trade secrets of the Alliance and its suppliers. The software is also\n// protected by copyright law and international treaty provisions. Application\n// programs incorporating this software must include the following statement\n// with their copyright notices:\n//\n// This application incorporates Open Design Alliance software pursuant to a\n// license agreement with Open Design Alliance.\n// Open Design Alliance Copyright (C) 2002-2025 by Open Design Alliance.\n// All rights reserved.\n//\n// By use of this software, its documentation or related materials, you\n// acknowledge and accept the above terms.\n///////////////////////////////////////////////////////////////////////////////\n\nimport Stats from \"three/examples/jsm/libs/stats.module.js\";\nimport { IComponent, components, Viewer } from \"@inweb/viewer-three\";\n\nclass StatsPanelComponent implements IComponent {\n protected viewer: Viewer;\n protected stats: Stats;\n\n constructor(viewer: Viewer) {\n this.stats = new Stats();\n this.stats.dom.style.position = \"absolute\";\n viewer.canvas.parentElement.appendChild(this.stats.dom);\n\n this.viewer = viewer;\n this.viewer.on(\"animate\", this.updateStats);\n }\n\n dispose() {\n this.viewer.off(\"animate\", this.updateStats);\n\n this.stats.dom.remove();\n this.stats = undefined;\n }\n\n updateStats = () => {\n this.stats.update();\n this.viewer.update();\n };\n}\n\ncomponents.registerComponent(\"StatsPanelComponent\", (viewer) => new StatsPanelComponent(viewer));\n"],"names":["StatsPanelComponent","constructor","viewer","this","updateStats","stats","update","Stats","dom","style","position","canvas","parentElement","appendChild","on","dispose","off","remove","undefined","components","registerComponent"],"mappings":";;;;AA0BA,MAAMA;IAIJ,WAAAC,CAAYC;QAgBZC,KAAWC,cAAG;YACZD,KAAKE,MAAMC;YACXH,KAAKD,OAAOI;AAAQ;QAjBpBH,KAAKE,QAAQ,IAAIE;QACjBJ,KAAKE,MAAMG,IAAIC,MAAMC,WAAW;QAChCR,OAAOS,OAAOC,cAAcC,YAAYV,KAAKE,MAAMG;QAEnDL,KAAKD,SAASA;QACdC,KAAKD,OAAOY,GAAG,WAAWX,KAAKC;;IAGjC,OAAAW;QACEZ,KAAKD,OAAOc,IAAI,WAAWb,KAAKC;QAEhCD,KAAKE,MAAMG,IAAIS;QACfd,KAAKE,QAAQa;;;;AASjBC,WAAWC,kBAAkB,wBAAwBlB,UAAW,IAAIF,oBAAoBE"}
1
+ {"version":3,"file":"StatsPanelComponent.module.js","sources":["../../../plugins/components/StatsPanelComponent.ts"],"sourcesContent":["///////////////////////////////////////////////////////////////////////////////\n// Copyright (C) 2002-2025, Open Design Alliance (the \"Alliance\").\n// All rights reserved.\n//\n// This software and its documentation and related materials are owned by\n// the Alliance. The software may only be incorporated into application\n// programs owned by members of the Alliance, subject to a signed\n// Membership Agreement and Supplemental Software License Agreement with the\n// Alliance. The structure and organization of this software are the valuable\n// trade secrets of the Alliance and its suppliers. The software is also\n// protected by copyright law and international treaty provisions. Application\n// programs incorporating this software must include the following statement\n// with their copyright notices:\n//\n// This application incorporates Open Design Alliance software pursuant to a\n// license agreement with Open Design Alliance.\n// Open Design Alliance Copyright (C) 2002-2025 by Open Design Alliance.\n// All rights reserved.\n//\n// By use of this software, its documentation or related materials, you\n// acknowledge and accept the above terms.\n///////////////////////////////////////////////////////////////////////////////\n\nimport Stats from \"three/examples/jsm/libs/stats.module.js\";\nimport { IComponent, components, Viewer } from \"@inweb/viewer-three\";\n\nclass StatsPanelComponent implements IComponent {\n protected viewer: Viewer;\n protected stats: Stats;\n\n constructor(viewer: Viewer) {\n this.stats = new Stats();\n this.stats.dom.style.position = \"absolute\";\n viewer.canvas.parentElement.appendChild(this.stats.dom);\n\n this.viewer = viewer;\n this.viewer.on(\"animate\", this.updateStats);\n }\n\n dispose() {\n this.viewer.off(\"animate\", this.updateStats);\n\n this.stats.dom.remove();\n this.stats = undefined;\n }\n\n updateStats = () => {\n this.viewer.render(null, true);\n this.stats.update();\n };\n}\n\ncomponents.registerComponent(\"StatsPanelComponent\", (viewer) => new StatsPanelComponent(viewer));\n"],"names":["StatsPanelComponent","constructor","viewer","this","updateStats","render","stats","update","Stats","dom","style","position","canvas","parentElement","appendChild","on","dispose","off","remove","undefined","components","registerComponent"],"mappings":";;;;AA0BA,MAAMA;IAIJ,WAAAC,CAAYC;QAgBZC,KAAWC,cAAG;YACZD,KAAKD,OAAOG,OAAO,MAAM;YACzBF,KAAKG,MAAMC;AAAQ;QAjBnBJ,KAAKG,QAAQ,IAAIE;QACjBL,KAAKG,MAAMG,IAAIC,MAAMC,WAAW;QAChCT,OAAOU,OAAOC,cAAcC,YAAYX,KAAKG,MAAMG;QAEnDN,KAAKD,SAASA;QACdC,KAAKD,OAAOa,GAAG,WAAWZ,KAAKC;;IAGjC,OAAAY;QACEb,KAAKD,OAAOe,IAAI,WAAWd,KAAKC;QAEhCD,KAAKG,MAAMG,IAAIS;QACff,KAAKG,QAAQa;;;;AASjBC,WAAWC,kBAAkB,wBAAwBnB,UAAW,IAAIF,oBAAoBE"}