@thatopen/components 2.4.9 → 2.4.11

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/dist/index.cjs CHANGED
@@ -6609,7 +6609,7 @@ const _Components = class _Components {
6609
6609
  /**
6610
6610
  * The version of the @thatopen/components library.
6611
6611
  */
6612
- __publicField(_Components, "release", "2.4.9");
6612
+ __publicField(_Components, "release", "2.4.11");
6613
6613
  let Components = _Components;
6614
6614
  class SimpleWorld extends Base {
6615
6615
  constructor() {
@@ -7391,11 +7391,10 @@ class EventDispatcher {
7391
7391
  }
7392
7392
  }
7393
7393
  }
7394
- const VERSION = "2.7.3";
7394
+ var _a;
7395
+ const VERSION = "2.9.0";
7395
7396
  const TOUCH_DOLLY_FACTOR = 1 / 8;
7396
- const isBrowser = typeof window !== "undefined";
7397
- const isMac = isBrowser && /Mac/.test(navigator.platform);
7398
- const isPointerEventsNotSupported = !(isBrowser && "PointerEvent" in window);
7397
+ const isMac = /Mac/.test((_a = globalThis === null || globalThis === void 0 ? void 0 : globalThis.navigator) === null || _a === void 0 ? void 0 : _a.platform);
7399
7398
  let THREE;
7400
7399
  let _ORIGIN;
7401
7400
  let _AXIS_Y;
@@ -7699,37 +7698,6 @@ class CameraControls extends EventDispatcher {
7699
7698
  this._isDragging = true;
7700
7699
  startDragging(event);
7701
7700
  };
7702
- const onMouseDown = (event) => {
7703
- if (!this._enabled || !this._domElement || this._lockedPointer)
7704
- return;
7705
- if (this._interactiveArea.left !== 0 || this._interactiveArea.top !== 0 || this._interactiveArea.width !== 1 || this._interactiveArea.height !== 1) {
7706
- const elRect = this._domElement.getBoundingClientRect();
7707
- const left = event.clientX / elRect.width;
7708
- const top = event.clientY / elRect.height;
7709
- if (left < this._interactiveArea.left || left > this._interactiveArea.right || top < this._interactiveArea.top || top > this._interactiveArea.bottom)
7710
- return;
7711
- }
7712
- const mouseButton = (event.buttons & MOUSE_BUTTON.LEFT) === MOUSE_BUTTON.LEFT ? MOUSE_BUTTON.LEFT : (event.buttons & MOUSE_BUTTON.MIDDLE) === MOUSE_BUTTON.MIDDLE ? MOUSE_BUTTON.MIDDLE : (event.buttons & MOUSE_BUTTON.RIGHT) === MOUSE_BUTTON.RIGHT ? MOUSE_BUTTON.RIGHT : null;
7713
- if (mouseButton !== null) {
7714
- const zombiePointer = this._findPointerByMouseButton(mouseButton);
7715
- zombiePointer && this._disposePointer(zombiePointer);
7716
- }
7717
- const pointer = {
7718
- pointerId: 1,
7719
- clientX: event.clientX,
7720
- clientY: event.clientY,
7721
- deltaX: 0,
7722
- deltaY: 0,
7723
- mouseButton: (event.buttons & MOUSE_BUTTON.LEFT) === MOUSE_BUTTON.LEFT ? MOUSE_BUTTON.LEFT : (event.buttons & MOUSE_BUTTON.MIDDLE) === MOUSE_BUTTON.LEFT ? MOUSE_BUTTON.MIDDLE : (event.buttons & MOUSE_BUTTON.RIGHT) === MOUSE_BUTTON.LEFT ? MOUSE_BUTTON.RIGHT : null
7724
- };
7725
- this._activePointers.push(pointer);
7726
- this._domElement.ownerDocument.removeEventListener("mousemove", onMouseMove);
7727
- this._domElement.ownerDocument.removeEventListener("mouseup", onMouseUp);
7728
- this._domElement.ownerDocument.addEventListener("mousemove", onMouseMove);
7729
- this._domElement.ownerDocument.addEventListener("mouseup", onMouseUp);
7730
- this._isDragging = true;
7731
- startDragging(event);
7732
- };
7733
7701
  const onPointerMove2 = (event) => {
7734
7702
  if (event.cancelable)
7735
7703
  event.preventDefault();
@@ -7767,26 +7735,6 @@ class CameraControls extends EventDispatcher {
7767
7735
  }
7768
7736
  dragging();
7769
7737
  };
7770
- const onMouseMove = (event) => {
7771
- const pointer = this._lockedPointer || this._findPointerById(1);
7772
- if (!pointer)
7773
- return;
7774
- pointer.clientX = event.clientX;
7775
- pointer.clientY = event.clientY;
7776
- pointer.deltaX = event.movementX;
7777
- pointer.deltaY = event.movementY;
7778
- this._state = 0;
7779
- if (this._lockedPointer || (event.buttons & MOUSE_BUTTON.LEFT) === MOUSE_BUTTON.LEFT) {
7780
- this._state = this._state | this.mouseButtons.left;
7781
- }
7782
- if ((event.buttons & MOUSE_BUTTON.MIDDLE) === MOUSE_BUTTON.MIDDLE) {
7783
- this._state = this._state | this.mouseButtons.middle;
7784
- }
7785
- if ((event.buttons & MOUSE_BUTTON.RIGHT) === MOUSE_BUTTON.RIGHT) {
7786
- this._state = this._state | this.mouseButtons.right;
7787
- }
7788
- dragging();
7789
- };
7790
7738
  const onPointerUp2 = (event) => {
7791
7739
  const pointer = this._findPointerById(event.pointerId);
7792
7740
  if (pointer && pointer === this._lockedPointer)
@@ -7812,14 +7760,6 @@ class CameraControls extends EventDispatcher {
7812
7760
  }
7813
7761
  endDragging();
7814
7762
  };
7815
- const onMouseUp = () => {
7816
- const pointer = this._findPointerById(1);
7817
- if (pointer && pointer === this._lockedPointer)
7818
- return;
7819
- pointer && this._disposePointer(pointer);
7820
- this._state = ACTION.NONE;
7821
- endDragging();
7822
- };
7823
7763
  let lastScrollTimeStamp = -1;
7824
7764
  const onMouseWheel = (event) => {
7825
7765
  if (!this._domElement)
@@ -7877,13 +7817,11 @@ class CameraControls extends EventDispatcher {
7877
7817
  if (!this._domElement || !this._enabled)
7878
7818
  return;
7879
7819
  if (this.mouseButtons.right === CameraControls.ACTION.NONE) {
7880
- const pointerId = event instanceof PointerEvent ? event.pointerId : event instanceof MouseEvent ? 0 : 0;
7820
+ const pointerId = event instanceof PointerEvent ? event.pointerId : 0;
7881
7821
  const pointer = this._findPointerById(pointerId);
7882
7822
  pointer && this._disposePointer(pointer);
7883
7823
  this._domElement.ownerDocument.removeEventListener("pointermove", onPointerMove2, { passive: false });
7884
7824
  this._domElement.ownerDocument.removeEventListener("pointerup", onPointerUp2);
7885
- this._domElement.ownerDocument.removeEventListener("mousemove", onMouseMove);
7886
- this._domElement.ownerDocument.removeEventListener("mouseup", onMouseUp);
7887
7825
  return;
7888
7826
  }
7889
7827
  event.preventDefault();
@@ -7961,7 +7899,7 @@ class CameraControls extends EventDispatcher {
7961
7899
  return;
7962
7900
  this._dragNeedsUpdate = false;
7963
7901
  extractClientCoordFromEvent(this._activePointers, _v2$1);
7964
- const isPointerLockActive = this._domElement && document.pointerLockElement === this._domElement;
7902
+ const isPointerLockActive = this._domElement && this._domElement.ownerDocument.pointerLockElement === this._domElement;
7965
7903
  const lockedPointer = isPointerLockActive ? this._lockedPointer || this._activePointers[0] : null;
7966
7904
  const deltaX = lockedPointer ? -lockedPointer.deltaX : lastDragPosition.x - _v2$1.x;
7967
7905
  const deltaY = lockedPointer ? -lockedPointer.deltaY : lastDragPosition.y - _v2$1.y;
@@ -8017,9 +7955,7 @@ class CameraControls extends EventDispatcher {
8017
7955
  }
8018
7956
  if (this._activePointers.length === 0 && this._domElement) {
8019
7957
  this._domElement.ownerDocument.removeEventListener("pointermove", onPointerMove2, { passive: false });
8020
- this._domElement.ownerDocument.removeEventListener("mousemove", onMouseMove);
8021
7958
  this._domElement.ownerDocument.removeEventListener("pointerup", onPointerUp2);
8022
- this._domElement.ownerDocument.removeEventListener("mouseup", onMouseUp);
8023
7959
  this.dispatchEvent({ type: "controlend" });
8024
7960
  }
8025
7961
  };
@@ -8046,16 +7982,15 @@ class CameraControls extends EventDispatcher {
8046
7982
  startDragging();
8047
7983
  };
8048
7984
  this.unlockPointer = () => {
7985
+ var _a2, _b, _c;
8049
7986
  if (this._lockedPointer !== null) {
8050
7987
  this._disposePointer(this._lockedPointer);
8051
7988
  this._lockedPointer = null;
8052
7989
  }
8053
- document.exitPointerLock();
7990
+ (_a2 = this._domElement) === null || _a2 === void 0 ? void 0 : _a2.ownerDocument.exitPointerLock();
7991
+ (_b = this._domElement) === null || _b === void 0 ? void 0 : _b.ownerDocument.removeEventListener("pointerlockchange", onPointerLockChange);
7992
+ (_c = this._domElement) === null || _c === void 0 ? void 0 : _c.ownerDocument.removeEventListener("pointerlockerror", onPointerLockError);
8054
7993
  this.cancel();
8055
- if (!this._domElement)
8056
- return;
8057
- this._domElement.ownerDocument.removeEventListener("pointerlockchange", onPointerLockChange);
8058
- this._domElement.ownerDocument.removeEventListener("pointerlockerror", onPointerLockError);
8059
7994
  };
8060
7995
  const onPointerLockChange = () => {
8061
7996
  const isPointerLockActive = this._domElement && this._domElement.ownerDocument.pointerLockElement === this._domElement;
@@ -8071,7 +8006,6 @@ class CameraControls extends EventDispatcher {
8071
8006
  this._domElement.style.userSelect = "none";
8072
8007
  this._domElement.style.webkitUserSelect = "none";
8073
8008
  this._domElement.addEventListener("pointerdown", onPointerDown2);
8074
- isPointerEventsNotSupported && this._domElement.addEventListener("mousedown", onMouseDown);
8075
8009
  this._domElement.addEventListener("pointercancel", onPointerUp2);
8076
8010
  this._domElement.addEventListener("wheel", onMouseWheel, { passive: false });
8077
8011
  this._domElement.addEventListener("contextmenu", onContextMenu);
@@ -8083,14 +8017,11 @@ class CameraControls extends EventDispatcher {
8083
8017
  this._domElement.style.userSelect = "";
8084
8018
  this._domElement.style.webkitUserSelect = "";
8085
8019
  this._domElement.removeEventListener("pointerdown", onPointerDown2);
8086
- this._domElement.removeEventListener("mousedown", onMouseDown);
8087
8020
  this._domElement.removeEventListener("pointercancel", onPointerUp2);
8088
8021
  this._domElement.removeEventListener("wheel", onMouseWheel, { passive: false });
8089
8022
  this._domElement.removeEventListener("contextmenu", onContextMenu);
8090
8023
  this._domElement.ownerDocument.removeEventListener("pointermove", onPointerMove2, { passive: false });
8091
- this._domElement.ownerDocument.removeEventListener("mousemove", onMouseMove);
8092
8024
  this._domElement.ownerDocument.removeEventListener("pointerup", onPointerUp2);
8093
- this._domElement.ownerDocument.removeEventListener("mouseup", onMouseUp);
8094
8025
  this._domElement.ownerDocument.removeEventListener("pointerlockchange", onPointerLockChange);
8095
8026
  this._domElement.ownerDocument.removeEventListener("pointerlockerror", onPointerLockError);
8096
8027
  };
@@ -8522,7 +8453,7 @@ class CameraControls extends EventDispatcher {
8522
8453
  lookInDirectionOf(x, y, z, enableTransition = false) {
8523
8454
  const point = _v3A.set(x, y, z);
8524
8455
  const direction = point.sub(this._targetEnd).normalize();
8525
- const position = direction.multiplyScalar(-this._sphericalEnd.radius);
8456
+ const position = direction.multiplyScalar(-this._sphericalEnd.radius).add(this._targetEnd);
8526
8457
  return this.setPosition(position.x, position.y, position.z, enableTransition);
8527
8458
  }
8528
8459
  /**
@@ -8607,8 +8538,8 @@ class CameraControls extends EventDispatcher {
8607
8538
  */
8608
8539
  fitToSphere(sphereOrMesh, enableTransition) {
8609
8540
  const promises = [];
8610
- const isSphere = sphereOrMesh instanceof THREE.Sphere;
8611
- const boundingSphere = isSphere ? _sphere.copy(sphereOrMesh) : CameraControls.createBoundingSphere(sphereOrMesh, _sphere);
8541
+ const isObject3D = "isObject3D" in sphereOrMesh;
8542
+ const boundingSphere = isObject3D ? CameraControls.createBoundingSphere(sphereOrMesh, _sphere) : _sphere.copy(sphereOrMesh);
8612
8543
  promises.push(this.moveTo(boundingSphere.center.x, boundingSphere.center.y, boundingSphere.center.z, enableTransition));
8613
8544
  if (isPerspectiveCamera(this._camera)) {
8614
8545
  const distanceToFit = this.getDistanceToFitSphere(boundingSphere.radius);
@@ -8861,7 +8792,7 @@ class CameraControls extends EventDispatcher {
8861
8792
  * @category Methods
8862
8793
  */
8863
8794
  getSpherical(out, receiveEndValue = true) {
8864
- const _out = !!out && out instanceof THREE.Spherical ? out : new THREE.Spherical();
8795
+ const _out = out || new THREE.Spherical();
8865
8796
  return _out.copy(receiveEndValue ? this._sphericalEnd : this._spherical);
8866
8797
  }
8867
8798
  /**
@@ -8884,6 +8815,15 @@ class CameraControls extends EventDispatcher {
8884
8815
  this._sphericalEnd.theta += PI_2;
8885
8816
  this._spherical.theta += PI_2 * Math.round((this._sphericalEnd.theta - this._spherical.theta) / PI_2);
8886
8817
  }
8818
+ /**
8819
+ * stop all transitions.
8820
+ */
8821
+ stop() {
8822
+ this._focalOffset.copy(this._focalOffsetEnd);
8823
+ this._target.copy(this._targetEnd);
8824
+ this._spherical.copy(this._sphericalEnd);
8825
+ this._zoom = this._zoomEnd;
8826
+ }
8887
8827
  /**
8888
8828
  * Reset all rotation and position to defaults.
8889
8829
  * @param enableTransition
@@ -9404,14 +9344,14 @@ class SimpleCamera extends BaseCamera {
9404
9344
  * {@link Components.renderer}.
9405
9345
  */
9406
9346
  __publicField(this, "updateAspect", () => {
9407
- var _a;
9347
+ var _a2;
9408
9348
  if (!this.currentWorld || !this.currentWorld.renderer)
9409
9349
  return;
9410
9350
  if (this.three instanceof THREE__namespace.OrthographicCamera) {
9411
9351
  this.onAspectUpdated.trigger();
9412
9352
  return;
9413
9353
  }
9414
- if ((_a = this.currentWorld.renderer) == null ? void 0 : _a.isResizeable()) {
9354
+ if ((_a2 = this.currentWorld.renderer) == null ? void 0 : _a2.isResizeable()) {
9415
9355
  const size = this.currentWorld.renderer.getSize();
9416
9356
  this.three.aspect = size.width / size.height;
9417
9357
  this.three.updateProjectionMatrix();
@@ -12888,12 +12828,12 @@ const _Clipper = class _Clipper extends Component {
12888
12828
  return meshes;
12889
12829
  }
12890
12830
  createPlaneFromIntersection(world, intersect) {
12891
- var _a;
12831
+ var _a2;
12892
12832
  if (!world.renderer) {
12893
12833
  throw new Error("The given world must have a renderer!");
12894
12834
  }
12895
12835
  const constant = intersect.point.distanceTo(new THREE__namespace.Vector3(0, 0, 0));
12896
- const normal = (_a = intersect.face) == null ? void 0 : _a.normal;
12836
+ const normal = (_a2 = intersect.face) == null ? void 0 : _a2.normal;
12897
12837
  if (!constant || !normal) {
12898
12838
  return null;
12899
12839
  }
@@ -14801,7 +14741,7 @@ const IfcCategoryMap = {
14801
14741
  };
14802
14742
  class IfcPropertiesUtils {
14803
14743
  static async getUnits(group) {
14804
- var _a, _b, _c;
14744
+ var _a2, _b, _c;
14805
14745
  const { IFCUNITASSIGNMENT } = WEBIFC__namespace;
14806
14746
  const allUnitsSets = await group.getAllPropertiesOfType(IFCUNITASSIGNMENT);
14807
14747
  if (!allUnitsSets) {
@@ -14827,7 +14767,7 @@ class IfcPropertiesUtils {
14827
14767
  if (unit.Name.value === "FOOT") {
14828
14768
  unitValue = 0.3048;
14829
14769
  }
14830
- if (((_a = unit.Prefix) == null ? void 0 : _a.value) === "MILLI") {
14770
+ if (((_a2 = unit.Prefix) == null ? void 0 : _a2.value) === "MILLI") {
14831
14771
  factor = 1e-3;
14832
14772
  } else if (((_b = unit.Prefix) == null ? void 0 : _b.value) === "CENTI") {
14833
14773
  factor = 0.01;
@@ -14839,18 +14779,18 @@ class IfcPropertiesUtils {
14839
14779
  return 1;
14840
14780
  }
14841
14781
  static async findItemByGuid(model, guid) {
14842
- var _a;
14782
+ var _a2;
14843
14783
  const ids = model.getAllPropertiesIDs();
14844
14784
  for (const id of ids) {
14845
14785
  const property = await model.getProperties(id);
14846
- if (property && ((_a = property.GlobalId) == null ? void 0 : _a.value) === guid) {
14786
+ if (property && ((_a2 = property.GlobalId) == null ? void 0 : _a2.value) === guid) {
14847
14787
  return property;
14848
14788
  }
14849
14789
  }
14850
14790
  return null;
14851
14791
  }
14852
14792
  static async getRelationMap(model, relationType, onElementsFound) {
14853
- var _a;
14793
+ var _a2;
14854
14794
  const defaultCallback = async () => {
14855
14795
  };
14856
14796
  const _onElementsFound = onElementsFound ?? defaultCallback;
@@ -14870,7 +14810,7 @@ class IfcPropertiesUtils {
14870
14810
  );
14871
14811
  if (!(isRelation && relatingKey && relatedKey))
14872
14812
  continue;
14873
- const relating = await model.getProperties((_a = prop[relatingKey]) == null ? void 0 : _a.value);
14813
+ const relating = await model.getProperties((_a2 = prop[relatingKey]) == null ? void 0 : _a2.value);
14874
14814
  const related = prop[relatedKey];
14875
14815
  if (!relating || !related) {
14876
14816
  continue;
@@ -14918,7 +14858,7 @@ class IfcPropertiesUtils {
14918
14858
  return props.filter((prop) => prop !== null);
14919
14859
  }
14920
14860
  static async getPsetRel(model, psetID) {
14921
- var _a;
14861
+ var _a2;
14922
14862
  const prop = await model.getProperties(psetID);
14923
14863
  if (!prop) {
14924
14864
  return null;
@@ -14932,7 +14872,7 @@ class IfcPropertiesUtils {
14932
14872
  const allRels = Object.values(allPropsRels);
14933
14873
  let found = null;
14934
14874
  for (const rel of allRels) {
14935
- if (((_a = rel.RelatingPropertyDefinition) == null ? void 0 : _a.value) === psetID) {
14875
+ if (((_a2 = rel.RelatingPropertyDefinition) == null ? void 0 : _a2.value) === psetID) {
14936
14876
  found = rel.expressID;
14937
14877
  }
14938
14878
  }
@@ -14942,13 +14882,13 @@ class IfcPropertiesUtils {
14942
14882
  return IfcPropertiesUtils.getPsetRel(model, qsetID);
14943
14883
  }
14944
14884
  static async getEntityName(model, entityID) {
14945
- var _a;
14885
+ var _a2;
14946
14886
  const entity = await model.getProperties(entityID);
14947
14887
  if (!entity) {
14948
14888
  return { key: null, name: null };
14949
14889
  }
14950
14890
  const key = Object.keys(entity).find((key2) => key2.endsWith("Name")) ?? null;
14951
- const name = key ? (_a = entity[key]) == null ? void 0 : _a.value : null;
14891
+ const name = key ? (_a2 = entity[key]) == null ? void 0 : _a2.value : null;
14952
14892
  return { key, name };
14953
14893
  }
14954
14894
  static async getQuantityValue(model, quantityID) {
@@ -14979,7 +14919,7 @@ class IfcPropertiesUtils {
14979
14919
  return Object.keys(entity).includes(attribute);
14980
14920
  }
14981
14921
  static async groupEntitiesByType(model, expressIDs) {
14982
- var _a;
14922
+ var _a2;
14983
14923
  const categoriesMap = /* @__PURE__ */ new Map();
14984
14924
  for (const expressID of expressIDs) {
14985
14925
  const entity = await model.getProperties(expressID);
@@ -14990,7 +14930,7 @@ class IfcPropertiesUtils {
14990
14930
  const set = categoriesMap.get(key);
14991
14931
  if (!set)
14992
14932
  categoriesMap.set(key, /* @__PURE__ */ new Set());
14993
- (_a = categoriesMap.get(key)) == null ? void 0 : _a.add(expressID);
14933
+ (_a2 = categoriesMap.get(key)) == null ? void 0 : _a2.add(expressID);
14994
14934
  }
14995
14935
  return categoriesMap;
14996
14936
  }
@@ -16165,7 +16105,7 @@ class Units {
16165
16105
  matrix.copy(result);
16166
16106
  }
16167
16107
  setUp(webIfc) {
16168
- var _a, _b, _c;
16108
+ var _a2, _b, _c;
16169
16109
  this.factor = 1;
16170
16110
  const length = this.getLengthUnits(webIfc);
16171
16111
  if (!length) {
@@ -16179,7 +16119,7 @@ class Units {
16179
16119
  if (length.Name.value === "FOOT") {
16180
16120
  this.factor = 0.3048;
16181
16121
  }
16182
- if (((_a = length.Prefix) == null ? void 0 : _a.value) === "MILLI") {
16122
+ if (((_a2 = length.Prefix) == null ? void 0 : _a2.value) === "MILLI") {
16183
16123
  this.complement = 1e-3;
16184
16124
  } else if (((_b = length.Prefix) == null ? void 0 : _b.value) === "CENTI") {
16185
16125
  this.complement = 0.01;
@@ -16437,7 +16377,7 @@ class CivilReader {
16437
16377
  }
16438
16378
  class IfcMetadataReader {
16439
16379
  getNameInfo(webIfc) {
16440
- var _a;
16380
+ var _a2;
16441
16381
  const data = {};
16442
16382
  const { arguments: dataArguments } = webIfc.GetHeaderLine(0, WEBIFC__namespace.FILE_NAME) || {};
16443
16383
  if (!dataArguments)
@@ -16463,7 +16403,7 @@ class IfcMetadataReader {
16463
16403
  if (authorEmail == null ? void 0 : authorEmail.value)
16464
16404
  data.author.email = authorEmail.value;
16465
16405
  }
16466
- if (organization && ((_a = organization[0]) == null ? void 0 : _a.value)) {
16406
+ if (organization && ((_a2 = organization[0]) == null ? void 0 : _a2.value)) {
16467
16407
  data.organization = organization[0].value;
16468
16408
  }
16469
16409
  if (preprocessorVersion == null ? void 0 : preprocessorVersion.value) {
@@ -16478,13 +16418,13 @@ class IfcMetadataReader {
16478
16418
  return data;
16479
16419
  }
16480
16420
  getDescriptionInfo(webIfc) {
16481
- var _a;
16421
+ var _a2;
16482
16422
  const data = {};
16483
16423
  const { arguments: dataArguments } = webIfc.GetHeaderLine(0, WEBIFC__namespace.FILE_DESCRIPTION) || {};
16484
16424
  if (!dataArguments)
16485
16425
  return data;
16486
16426
  const [description, implementationLevel] = dataArguments;
16487
- if (Array.isArray(description) && ((_a = description[0]) == null ? void 0 : _a.value)) {
16427
+ if (Array.isArray(description) && ((_a2 = description[0]) == null ? void 0 : _a2.value)) {
16488
16428
  const viewDefinition = description[0].value.match(/\[([^\]]+)\]/);
16489
16429
  if (viewDefinition && viewDefinition[1]) {
16490
16430
  data.viewDefinition = viewDefinition[1];
@@ -22715,12 +22655,12 @@ class Comment {
22715
22655
  * @param value - The new comment text.
22716
22656
  */
22717
22657
  set comment(value) {
22718
- var _a;
22658
+ var _a2;
22719
22659
  const manager = this._components.get(BCFTopics);
22720
22660
  this._comment = value;
22721
22661
  this.modifiedDate = /* @__PURE__ */ new Date();
22722
22662
  this.modifiedAuthor = manager.config.author;
22723
- (_a = this.topic) == null ? void 0 : _a.comments.set(this.guid, this);
22663
+ (_a2 = this.topic) == null ? void 0 : _a2.comments.set(this.guid, this);
22724
22664
  }
22725
22665
  /**
22726
22666
  * Gets the comment text.
@@ -23603,12 +23543,12 @@ ${users}
23603
23543
  return comment;
23604
23544
  }
23605
23545
  getMarkupComments(markup, version) {
23606
- var _a;
23546
+ var _a2;
23607
23547
  let data;
23608
23548
  if (version === "2.1")
23609
23549
  data = markup.Comment;
23610
23550
  if (version === "3")
23611
- data = (_a = markup.Topic.Comments) == null ? void 0 : _a.Comment;
23551
+ data = (_a2 = markup.Topic.Comments) == null ? void 0 : _a2.Comment;
23612
23552
  if (!data)
23613
23553
  return [];
23614
23554
  data = Array.isArray(data) ? data : [data];
@@ -23617,36 +23557,36 @@ ${users}
23617
23557
  return array;
23618
23558
  }
23619
23559
  getMarkupLabels(markup, version) {
23620
- var _a;
23560
+ var _a2;
23621
23561
  let data;
23622
23562
  if (version === "2.1")
23623
23563
  data = markup.Topic.Labels;
23624
23564
  if (version === "3")
23625
- data = (_a = markup.Topic.Labels) == null ? void 0 : _a.Label;
23565
+ data = (_a2 = markup.Topic.Labels) == null ? void 0 : _a2.Label;
23626
23566
  if (!data)
23627
23567
  return [];
23628
23568
  const labels = Array.isArray(data) ? data : [data];
23629
23569
  return labels;
23630
23570
  }
23631
23571
  getMarkupViewpoints(markup, version) {
23632
- var _a;
23572
+ var _a2;
23633
23573
  let data;
23634
23574
  if (version === "2.1")
23635
23575
  data = markup.Viewpoints;
23636
23576
  if (version === "3")
23637
- data = (_a = markup.Topic.Viewpoints) == null ? void 0 : _a.ViewPoint;
23577
+ data = (_a2 = markup.Topic.Viewpoints) == null ? void 0 : _a2.ViewPoint;
23638
23578
  if (!data)
23639
23579
  return [];
23640
23580
  data = Array.isArray(data) ? data : [data];
23641
23581
  return data;
23642
23582
  }
23643
23583
  getMarkupRelatedTopics(markup, version) {
23644
- var _a;
23584
+ var _a2;
23645
23585
  let data;
23646
23586
  if (version === "2.1")
23647
23587
  data = markup.Topic.RelatedTopic;
23648
23588
  if (version === "3")
23649
- data = (_a = markup.Topic.RelatedTopics) == null ? void 0 : _a.RelatedTopic;
23589
+ data = (_a2 = markup.Topic.RelatedTopics) == null ? void 0 : _a2.RelatedTopic;
23650
23590
  if (!data)
23651
23591
  return [];
23652
23592
  const topics = Array.isArray(data) ? data : [data];
@@ -23663,7 +23603,7 @@ ${users}
23663
23603
  * @throws An error if the BCF version is not supported.
23664
23604
  */
23665
23605
  async load(data, world) {
23666
- var _a;
23606
+ var _a2;
23667
23607
  const {
23668
23608
  fallbackVersionOnImport,
23669
23609
  ignoreIncompleteTopicsOnImport,
@@ -23728,7 +23668,7 @@ ${users}
23728
23668
  ViewSetupHints = Components2.ViewSetupHints;
23729
23669
  }
23730
23670
  if (version === "3") {
23731
- ViewSetupHints = (_a = Components2.Visibility) == null ? void 0 : _a.ViewSetupHints;
23671
+ ViewSetupHints = (_a2 = Components2.Visibility) == null ? void 0 : _a2.ViewSetupHints;
23732
23672
  }
23733
23673
  if (ViewSetupHints) {
23734
23674
  if ("OpeningsVisible" in ViewSetupHints) {
@@ -25200,7 +25140,7 @@ const _Classifier = class _Classifier extends Component {
25200
25140
  * @throws Will throw an error if the fragment ID is not found.
25201
25141
  */
25202
25142
  async byPredefinedType(group) {
25203
- var _a;
25143
+ var _a2;
25204
25144
  if (!this.list.predefinedTypes) {
25205
25145
  this.list.predefinedTypes = {};
25206
25146
  }
@@ -25210,7 +25150,7 @@ const _Classifier = class _Classifier extends Component {
25210
25150
  const entity = await group.getProperties(id);
25211
25151
  if (!entity)
25212
25152
  continue;
25213
- const predefinedType = String((_a = entity.PredefinedType) == null ? void 0 : _a.value).toUpperCase();
25153
+ const predefinedType = String((_a2 = entity.PredefinedType) == null ? void 0 : _a2.value).toUpperCase();
25214
25154
  if (!currentTypes[predefinedType]) {
25215
25155
  currentTypes[predefinedType] = {
25216
25156
  map: {},
@@ -25313,7 +25253,7 @@ const _Classifier = class _Classifier extends Component {
25313
25253
  * @throws Will throw an error if the fragment ID is not found or if the model relations do not exist.
25314
25254
  */
25315
25255
  async bySpatialStructure(model, config = {}) {
25316
- var _a, _b;
25256
+ var _a2, _b;
25317
25257
  const indexer = this.components.get(IfcRelationsIndexer);
25318
25258
  const modelRelations = indexer.relationMaps[model.uuid];
25319
25259
  if (!modelRelations) {
@@ -25347,7 +25287,7 @@ const _Classifier = class _Classifier extends Component {
25347
25287
  if (!spatialRelAttrs) {
25348
25288
  continue;
25349
25289
  }
25350
- relName2 = (_a = spatialRelAttrs.Name) == null ? void 0 : _a.value;
25290
+ relName2 = (_a2 = spatialRelAttrs.Name) == null ? void 0 : _a2.value;
25351
25291
  }
25352
25292
  this.saveItem(model, systemName, relName2, expressID, id);
25353
25293
  }
@@ -26612,7 +26552,7 @@ class Viewpoint {
26612
26552
  }
26613
26553
  }
26614
26554
  async createComponentTags(from) {
26615
- var _a, _b;
26555
+ var _a2, _b;
26616
26556
  const fragments = this._components.get(FragmentsManager);
26617
26557
  const manager = this._components.get(BCFTopics);
26618
26558
  let tags = "";
@@ -26627,7 +26567,7 @@ class Viewpoint {
26627
26567
  const attrs = await model.getProperties(expressID);
26628
26568
  if (!attrs)
26629
26569
  continue;
26630
- const globalID = (_a = attrs.GlobalId) == null ? void 0 : _a.value;
26570
+ const globalID = (_a2 = attrs.GlobalId) == null ? void 0 : _a2.value;
26631
26571
  if (!globalID)
26632
26572
  continue;
26633
26573
  const tag = (_b = attrs.Tag) == null ? void 0 : _b.value;
@@ -27800,14 +27740,14 @@ class IDSAttribute extends IDSFacet {
27800
27740
  // All invalid cases have been treated as failures
27801
27741
  // FragmentsGroup do not hold some of the entities used in the tests
27802
27742
  async test(entities) {
27803
- var _a;
27743
+ var _a2;
27804
27744
  this.testResult = [];
27805
27745
  for (const _expressID in entities) {
27806
27746
  const expressID = Number(_expressID);
27807
27747
  const attrs = entities[expressID];
27808
27748
  const checks = [];
27809
27749
  const result2 = {
27810
- guid: (_a = attrs.GlobalId) == null ? void 0 : _a.value,
27750
+ guid: (_a2 = attrs.GlobalId) == null ? void 0 : _a2.value,
27811
27751
  expressID,
27812
27752
  pass: false,
27813
27753
  checks,
@@ -27901,7 +27841,7 @@ class IDSClassification extends IDSFacet {
27901
27841
  </classification>`;
27902
27842
  }
27903
27843
  async getEntities(model, collector = {}) {
27904
- var _a;
27844
+ var _a2;
27905
27845
  const result = [];
27906
27846
  const references = await model.getAllPropertiesOfType(
27907
27847
  WEBIFC__namespace.IFCCLASSIFICATIONREFERENCE
@@ -27916,7 +27856,7 @@ class IDSClassification extends IDSFacet {
27916
27856
  const attrs = await model.getProperties(classificationID);
27917
27857
  if (!attrs)
27918
27858
  continue;
27919
- const referencedSourceID = (_a = attrs.ReferencedSource) == null ? void 0 : _a.value;
27859
+ const referencedSourceID = (_a2 = attrs.ReferencedSource) == null ? void 0 : _a2.value;
27920
27860
  if (!referencedSourceID)
27921
27861
  continue;
27922
27862
  const classificationAttrs = await model.getProperties(referencedSourceID);
@@ -27953,14 +27893,14 @@ class IDSClassification extends IDSFacet {
27953
27893
  return result;
27954
27894
  }
27955
27895
  async test(entities, model) {
27956
- var _a;
27896
+ var _a2;
27957
27897
  this.testResult = [];
27958
27898
  for (const _expressID in entities) {
27959
27899
  const expressID = Number(_expressID);
27960
27900
  const attrs = entities[expressID];
27961
27901
  const checks = [];
27962
27902
  const result2 = {
27963
- guid: (_a = attrs.GlobalId) == null ? void 0 : _a.value,
27903
+ guid: (_a2 = attrs.GlobalId) == null ? void 0 : _a2.value,
27964
27904
  expressID,
27965
27905
  pass: false,
27966
27906
  checks,
@@ -28003,8 +27943,8 @@ class IDSClassification extends IDSFacet {
28003
27943
  return result;
28004
27944
  }
28005
27945
  async processReferencedSource(model, attrs) {
28006
- var _a;
28007
- const sourceID = (_a = attrs.ReferencedSource) == null ? void 0 : _a.value;
27946
+ var _a2;
27947
+ const sourceID = (_a2 = attrs.ReferencedSource) == null ? void 0 : _a2.value;
28008
27948
  if (!sourceID)
28009
27949
  return null;
28010
27950
  const sourceAttrs = await model.getProperties(sourceID);
@@ -28019,7 +27959,7 @@ class IDSClassification extends IDSFacet {
28019
27959
  return sourceAttrs;
28020
27960
  }
28021
27961
  async getSystems(model, expressID) {
28022
- var _a;
27962
+ var _a2;
28023
27963
  const result = [];
28024
27964
  const indexer = this.components.get(IfcRelationsIndexer);
28025
27965
  const ocurrenceAssociations = indexer.getEntityRelations(
@@ -28046,9 +27986,9 @@ class IDSClassification extends IDSFacet {
28046
27986
  }
28047
27987
  }
28048
27988
  const occurrenceSystems = result.map((attrs) => {
28049
- var _a2, _b, _c;
27989
+ var _a3, _b, _c;
28050
27990
  if (attrs.type === WEBIFC__namespace.IFCCLASSIFICATION) {
28051
- return (_a2 = attrs.Name) == null ? void 0 : _a2.value;
27991
+ return (_a3 = attrs.Name) == null ? void 0 : _a3.value;
28052
27992
  }
28053
27993
  if (attrs.type === WEBIFC__namespace.IFCCLASSIFICATIONREFERENCE) {
28054
27994
  return (_c = (_b = attrs.ReferencedSource) == null ? void 0 : _b.Name) == null ? void 0 : _c.value;
@@ -28070,7 +28010,7 @@ class IDSClassification extends IDSFacet {
28070
28010
  if (!attrs)
28071
28011
  continue;
28072
28012
  if (attrs.type === WEBIFC__namespace.IFCCLASSIFICATION) {
28073
- if (occurrenceSystems.includes((_a = attrs.Name) == null ? void 0 : _a.value))
28013
+ if (occurrenceSystems.includes((_a2 = attrs.Name) == null ? void 0 : _a2.value))
28074
28014
  continue;
28075
28015
  result.push(attrs);
28076
28016
  }
@@ -28087,9 +28027,9 @@ class IDSClassification extends IDSFacet {
28087
28027
  return result;
28088
28028
  }
28089
28029
  getSystemName(attrs) {
28090
- var _a, _b, _c, _d;
28030
+ var _a2, _b, _c, _d;
28091
28031
  if (attrs.type === WEBIFC__namespace.IFCCLASSIFICATION) {
28092
- return (_a = attrs.Name) == null ? void 0 : _a.value;
28032
+ return (_a2 = attrs.Name) == null ? void 0 : _a2.value;
28093
28033
  }
28094
28034
  if (attrs.type === WEBIFC__namespace.IFCCLASSIFICATIONREFERENCE) {
28095
28035
  if (((_b = attrs.ReferencedSource) == null ? void 0 : _b.type) === WEBIFC__namespace.IFCCLASSIFICATIONREFERENCE) {
@@ -28145,11 +28085,11 @@ class IDSClassification extends IDSFacet {
28145
28085
  return !!identifier;
28146
28086
  }
28147
28087
  evalURI(attrs, checks) {
28148
- var _a;
28088
+ var _a2;
28149
28089
  if (!this.uri)
28150
28090
  return true;
28151
28091
  const result = this.evalRequirement(
28152
- (_a = attrs.Location) == null ? void 0 : _a.value,
28092
+ (_a2 = attrs.Location) == null ? void 0 : _a2.value,
28153
28093
  {
28154
28094
  type: "simple",
28155
28095
  parameter: this.uri
@@ -28221,14 +28161,14 @@ class IDSEntity extends IDSFacet {
28221
28161
  return result;
28222
28162
  }
28223
28163
  async test(entities, model) {
28224
- var _a;
28164
+ var _a2;
28225
28165
  this.testResult = [];
28226
28166
  for (const _expressID in entities) {
28227
28167
  const expressID = Number(_expressID);
28228
28168
  const attrs = entities[expressID];
28229
28169
  const checks = [];
28230
28170
  const result = {
28231
- guid: (_a = attrs.GlobalId) == null ? void 0 : _a.value,
28171
+ guid: (_a2 = attrs.GlobalId) == null ? void 0 : _a2.value,
28232
28172
  expressID,
28233
28173
  pass: false,
28234
28174
  checks,
@@ -28247,12 +28187,12 @@ class IDSEntity extends IDSFacet {
28247
28187
  return result;
28248
28188
  }
28249
28189
  async evalPredefinedType(model, attrs, checks) {
28250
- var _a, _b, _c, _d;
28190
+ var _a2, _b, _c, _d;
28251
28191
  if (!this.predefinedType)
28252
28192
  return null;
28253
28193
  const indexer = this.components.get(IfcRelationsIndexer);
28254
28194
  const isRequirementUserDefined = typeof this.predefinedType.parameter === "string" && this.predefinedType.parameter === "USERDEFINED";
28255
- let value = (_a = attrs.PredefinedType) == null ? void 0 : _a.value;
28195
+ let value = (_a2 = attrs.PredefinedType) == null ? void 0 : _a2.value;
28256
28196
  if (value === "USERDEFINED" && !isRequirementUserDefined) {
28257
28197
  const attrNames = Object.keys(attrs);
28258
28198
  const result2 = attrNames.find(
@@ -28324,7 +28264,7 @@ class IDSProperty extends IDSFacet {
28324
28264
  </property>`;
28325
28265
  }
28326
28266
  async getEntities(model, collector = {}) {
28327
- var _a, _b;
28267
+ var _a2, _b;
28328
28268
  let sets = {};
28329
28269
  const psets = await model.getAllPropertiesOfType(WEBIFC__namespace.IFCPROPERTYSET);
28330
28270
  sets = { ...sets, ...psets };
@@ -28338,7 +28278,7 @@ class IDSProperty extends IDSFacet {
28338
28278
  const attrs = await model.getProperties(setID);
28339
28279
  if (!attrs)
28340
28280
  continue;
28341
- const nameMatches = ((_a = attrs.Name) == null ? void 0 : _a.value) === this.propertySet.parameter;
28281
+ const nameMatches = ((_a2 = attrs.Name) == null ? void 0 : _a2.value) === this.propertySet.parameter;
28342
28282
  if (!nameMatches)
28343
28283
  continue;
28344
28284
  let propsListName;
@@ -28387,14 +28327,14 @@ class IDSProperty extends IDSFacet {
28387
28327
  return [];
28388
28328
  }
28389
28329
  async test(entities, model) {
28390
- var _a;
28330
+ var _a2;
28391
28331
  this.testResult = [];
28392
28332
  for (const _expressID in entities) {
28393
28333
  const expressID = Number(_expressID);
28394
28334
  const attrs = entities[expressID];
28395
28335
  const checks = [];
28396
28336
  const result2 = {
28397
- guid: (_a = attrs.GlobalId) == null ? void 0 : _a.value,
28337
+ guid: (_a2 = attrs.GlobalId) == null ? void 0 : _a2.value,
28398
28338
  expressID,
28399
28339
  pass: false,
28400
28340
  checks,
@@ -28439,12 +28379,12 @@ class IDSProperty extends IDSFacet {
28439
28379
  }
28440
28380
  const items = set.Properties;
28441
28381
  const matchingItems = items.filter((item) => {
28442
- var _a2;
28382
+ var _a3;
28443
28383
  if (this._unsupportedTypes.includes(item.type)) {
28444
28384
  return false;
28445
28385
  }
28446
28386
  const result3 = this.evalRequirement(
28447
- ((_a2 = item.Name) == null ? void 0 : _a2.value) ?? null,
28387
+ ((_a3 = item.Name) == null ? void 0 : _a3.value) ?? null,
28448
28388
  this.baseName,
28449
28389
  "BaseName"
28450
28390
  );
@@ -28493,7 +28433,7 @@ class IDSProperty extends IDSFacet {
28493
28433
  );
28494
28434
  }
28495
28435
  async simplifyPset(model, attrs, propsListName) {
28496
- var _a;
28436
+ var _a2;
28497
28437
  const props = [];
28498
28438
  const list = attrs[propsListName];
28499
28439
  if (!list)
@@ -28504,7 +28444,7 @@ class IDSProperty extends IDSFacet {
28504
28444
  props.push(propAttrs);
28505
28445
  }
28506
28446
  const attrsClone = {
28507
- Name: (_a = attrs.Name) == null ? void 0 : _a.value,
28447
+ Name: (_a2 = attrs.Name) == null ? void 0 : _a2.value,
28508
28448
  Properties: props,
28509
28449
  type: attrs.type
28510
28450
  };
@@ -28531,7 +28471,7 @@ class IDSProperty extends IDSFacet {
28531
28471
  return sets;
28532
28472
  }
28533
28473
  async getPsets(model, expressID) {
28534
- var _a;
28474
+ var _a2;
28535
28475
  const typePsets = await this.getTypePsets(model, expressID);
28536
28476
  const indexer = this.components.get(IfcRelationsIndexer);
28537
28477
  const definitions = indexer.getEntityRelations(
@@ -28559,7 +28499,7 @@ class IDSProperty extends IDSFacet {
28559
28499
  );
28560
28500
  if (typePset) {
28561
28501
  for (const prop of typePset.Properties) {
28562
- const name = (_a = prop.Name) == null ? void 0 : _a.value;
28502
+ const name = (_a2 = prop.Name) == null ? void 0 : _a2.value;
28563
28503
  const existingProp = occurencePset.Properties.find(
28564
28504
  ({ Name }) => Name.value === name
28565
28505
  );