@itwin/ecschema-rpcinterface-tests 5.15.0-dev.15 → 5.15.0-dev.17

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.
@@ -31736,7 +31736,8 @@ __webpack_require__.r(__webpack_exports__);
31736
31736
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
31737
31737
  /* harmony export */ EntityMetaData: () => (/* binding */ EntityMetaData),
31738
31738
  /* harmony export */ PrimitiveTypeCode: () => (/* binding */ PrimitiveTypeCode),
31739
- /* harmony export */ PropertyMetaData: () => (/* binding */ PropertyMetaData)
31739
+ /* harmony export */ PropertyMetaData: () => (/* binding */ PropertyMetaData),
31740
+ /* harmony export */ isPersisted: () => (/* binding */ isPersisted)
31740
31741
  /* harmony export */ });
31741
31742
  /* harmony import */ var _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @itwin/core-bentley */ "../../core/bentley/lib/esm/core-bentley.js");
31742
31743
  /* harmony import */ var _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @itwin/core-geometry */ "../../core/geometry/lib/esm/core-geometry.js");
@@ -31751,6 +31752,13 @@ __webpack_require__.r(__webpack_exports__);
31751
31752
 
31752
31753
 
31753
31754
 
31755
+ /** Tests whether an [[EntityProps]] has a valid `id`, narrowing its type to [[Persisted]] if it does.
31756
+ * @public @preview
31757
+ * @extensions
31758
+ */
31759
+ function isPersisted(entity) {
31760
+ return undefined !== entity.id && _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.Id64.isValidId64(entity.id);
31761
+ }
31754
31762
  /** The primitive types of an Entity property.
31755
31763
  * @beta
31756
31764
  */
@@ -33629,6 +33637,9 @@ var GeoCoordStatus;
33629
33637
  * Geoid separation data or vertical datum differential data (such as used by NGVD29 to NAVD88 conversion).
33630
33638
  * The horizontal coordinates returned are valid but the elevation ordinate will be returned unchanged or partially changed.
33631
33639
  * This status should be somehow reported so actions can be performed to provide the missing information.
33640
+ * A finite elevation, including one equal to the input elevation, is not evidence that vertical conversion succeeded.
33641
+ * Callers requiring converted elevations must reject this result. Horizontal-only callers may use XY while retaining
33642
+ * and reporting this status. A visual fallback must not be presented as a successful vertical conversion.
33632
33643
  */
33633
33644
  GeoCoordStatus[GeoCoordStatus["VerticalDatumConvertError"] = 26] = "VerticalDatumConvertError";
33634
33645
  /** General inner conversion engine error. Coordinates returned are invalid and should be discarded */
@@ -45884,6 +45895,7 @@ __webpack_require__.r(__webpack_exports__);
45884
45895
  /* harmony export */ isBinaryImageSource: () => (/* reexport safe */ _Image__WEBPACK_IMPORTED_MODULE_69__.isBinaryImageSource),
45885
45896
  /* harmony export */ isKnownFieldPropertyType: () => (/* reexport safe */ _internal_cross_package__WEBPACK_IMPORTED_MODULE_166__.isKnownFieldPropertyType),
45886
45897
  /* harmony export */ isKnownTileFormat: () => (/* reexport safe */ _tile_TileIO__WEBPACK_IMPORTED_MODULE_162__.isKnownTileFormat),
45898
+ /* harmony export */ isPersisted: () => (/* reexport safe */ _EntityProps__WEBPACK_IMPORTED_MODULE_34__.isPersisted),
45887
45899
  /* harmony export */ isPlacement2dProps: () => (/* reexport safe */ _ElementProps__WEBPACK_IMPORTED_MODULE_32__.isPlacement2dProps),
45888
45900
  /* harmony export */ isPlacement3dProps: () => (/* reexport safe */ _ElementProps__WEBPACK_IMPORTED_MODULE_32__.isPlacement3dProps),
45889
45901
  /* harmony export */ isPowerOfTwo: () => (/* reexport safe */ _Image__WEBPACK_IMPORTED_MODULE_69__.isPowerOfTwo),
@@ -56920,7 +56932,7 @@ class IModelReadRpcInterface extends _RpcInterface__WEBPACK_IMPORTED_MODULE_0__.
56920
56932
  /** The immutable name of the interface. */
56921
56933
  static interfaceName = "IModelReadRpcInterface";
56922
56934
  /** The semantic version of the interface. */
56923
- static interfaceVersion = "3.8.0";
56935
+ static interfaceVersion = "3.8.1";
56924
56936
  /*===========================================================================================
56925
56937
  NOTE: Any add/remove/change to the methods below requires an update of the interface version.
56926
56938
  NOTE: Please consult the README in this folder for the semantic versioning rules.
@@ -90768,30 +90780,63 @@ class CoordinateConverter {
90768
90780
  }
90769
90781
  }
90770
90782
  /** An object capable of communicating with the backend to convert between coordinates in a geographic coordinate system and coordinates in an [[IModelConnection]]'s own coordinate system.
90783
+ * Conversion results retain the backend's per-point status, including failed vertical conversions. Check each status
90784
+ * before using elevations; [[GeoCoordStatus.VerticalDatumConvertError]] does not provide a reliable converted Z.
90785
+ * Results, including failures, are cached in this converter. Loading grids does not invalidate those cached results.
90786
+ * To retry after resources become available, finish outstanding requests and acquire a fresh converter from
90787
+ * [[GeoServices.getConverter]] instead of reusing the retained instance.
90771
90788
  * @see [[GeoServices.getConverter]] to obtain a converter.
90772
90789
  * @see [GeographicCRS]($common) for more information about geographic coordinate reference systems.
90773
90790
  * @public
90774
90791
  */
90775
90792
  class GeoConverter {
90776
- _geoToIModel;
90777
- _iModelToGeo;
90793
+ _converters;
90794
+ _gcs;
90795
+ _options;
90778
90796
  /** Used for removing this converter from GeoServices' cache after all requests are completed.
90779
90797
  * @internal
90780
90798
  */
90781
90799
  onAllRequestsCompleted = new _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.BeEvent();
90782
90800
  /** @internal */
90783
90801
  constructor(opts) {
90802
+ this._options = opts;
90803
+ this._gcs = opts.getGcs?.();
90804
+ this._converters = this.createConverters();
90805
+ }
90806
+ createConverters() {
90807
+ const opts = this._options;
90784
90808
  const isIModelClosed = opts.isIModelClosed;
90785
- this._geoToIModel = new CoordinateConverter({
90786
- direction: "geoToIModel",
90787
- isIModelClosed,
90788
- requestPoints: async (geoCoords) => opts.toIModelCoords({ source: opts.datum, geoCoords }),
90789
- });
90790
- this._iModelToGeo = new CoordinateConverter({
90791
- direction: "iModelToGeo",
90792
- isIModelClosed,
90793
- requestPoints: async (iModelCoords) => opts.fromIModelCoords({ target: opts.datum, iModelCoords }),
90794
- });
90809
+ return {
90810
+ geoToIModel: new CoordinateConverter({
90811
+ direction: "geoToIModel",
90812
+ isIModelClosed,
90813
+ requestPoints: async (geoCoords) => opts.toIModelCoords({ source: opts.datum, geoCoords }),
90814
+ }),
90815
+ iModelToGeo: new CoordinateConverter({
90816
+ direction: "iModelToGeo",
90817
+ isIModelClosed,
90818
+ requestPoints: async (iModelCoords) => opts.fromIModelCoords({ target: opts.datum, iModelCoords }),
90819
+ }),
90820
+ };
90821
+ }
90822
+ refreshGcs() {
90823
+ const gcs = this._options.getGcs?.();
90824
+ if (gcs !== this._gcs) {
90825
+ this._gcs = gcs;
90826
+ this._converters = this.createConverters();
90827
+ }
90828
+ }
90829
+ async convert(points, direction) {
90830
+ for (;;) {
90831
+ this.refreshGcs();
90832
+ const converter = this._converters[direction];
90833
+ const result = await converter.convert(points);
90834
+ this.refreshGcs();
90835
+ if (converter !== this._converters[direction])
90836
+ continue;
90837
+ this.checkCompletion();
90838
+ return result;
90839
+ }
90795
90840
  }
90796
90841
  /** Convert the specified geographic coordinates into iModel coordinates. */
90797
90842
  async convertToIModelCoords(geoPoints) {
@@ -90805,8 +90850,7 @@ class GeoConverter {
90805
90850
  }
90806
90851
  /** @internal */
90807
90852
  async getIModelCoordinatesFromGeoCoordinates(geoPoints) {
90808
- const result = await this._geoToIModel.convert(geoPoints);
90809
- this.checkCompletion();
90853
+ const result = await this.convert(geoPoints, "geoToIModel");
90810
90854
  return {
90811
90855
  iModelCoords: result.points,
90812
90856
  fromCache: result.fromCache,
@@ -90814,20 +90858,20 @@ class GeoConverter {
90814
90858
  }
90815
90859
  /** @internal */
90816
90860
  async getGeoCoordinatesFromIModelCoordinates(iModelPoints) {
90817
- const result = await this._iModelToGeo.convert(iModelPoints);
90818
- this.checkCompletion();
90861
+ const result = await this.convert(iModelPoints, "iModelToGeo");
90819
90862
  return {
90820
90863
  geoCoords: result.points,
90821
90864
  fromCache: result.fromCache,
90822
90865
  };
90823
90866
  }
90824
90867
  checkCompletion() {
90825
- if (this._geoToIModel.isIdle && this._iModelToGeo.isIdle)
90868
+ if (this._converters.geoToIModel.isIdle && this._converters.iModelToGeo.isIdle)
90826
90869
  this.onAllRequestsCompleted.raiseEvent();
90827
90870
  }
90828
90871
  /** @internal */
90829
90872
  getCachedIModelCoordinatesFromGeoCoordinates(geoPoints) {
90830
- return this._geoToIModel.findCached(geoPoints);
90873
+ this.refreshGcs();
90874
+ return this._converters.geoToIModel.findCached(geoPoints);
90831
90875
  }
90832
90876
  }
90833
90877
  /** The Geographic Services available for an [[IModelConnection]].
@@ -90855,6 +90899,7 @@ class GeoServices {
90855
90899
  static createForIModel(iModel) {
90856
90900
  return new GeoServices({
90857
90901
  isIModelClosed: () => iModel.isClosed,
90902
+ getGcs: () => iModel.geographicCoordinateSystem,
90858
90903
  toIModelCoords: async (request) => {
90859
90904
  const rpc = _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.IModelReadRpcInterface.getClientForRouting(iModel.routingContext.token);
90860
90905
  const response = await rpc.getIModelCoordinatesFromGeoCoordinates(iModel.getRpcProps(), request);
@@ -92980,6 +93025,25 @@ class IModelConnection extends _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.I
92980
93025
  async generateElementMeshes(requestProps) {
92981
93026
  return _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.IModelReadRpcInterface.getClientForRouting(this.routingContext.token).generateElementMeshes(this.getRpcProps(), requestProps);
92982
93027
  }
93028
+ /** Constructs a point after validating raw ordinates, before JSON normalization can conceal NaN.
93029
+ * Omitted ordinates default to zero.
93030
+ * @throws IModelError with GeoServiceStatus.CSMapError if any supplied ordinate is non-finite.
93031
+ * @internal
93032
+ */
93033
+ static getFiniteGeoPoint(props) {
93034
+ const coordinates = Array.isArray(props) ? props : [props.x, props.y, props.z];
93035
+ for (let index = 0; index < 3; ++index) {
93036
+ // RPC marshaling converts NaN and infinities to null; reject null rather than defaulting it to zero.
93037
+ if (!Number.isFinite(coordinates[index] === undefined ? 0 : coordinates[index])) {
93038
+ _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.Logger.logError(loggerCategory, "Non-finite coordinate returned by geographic conversion", {
93039
+ ordinateIndex: index,
93040
+ coordinates: coordinates.map((ordinate) => String(ordinate)),
93041
+ });
93042
+ throw new _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.IModelError(_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.GeoServiceStatus.CSMapError, "Non-finite coordinate returned by geographic conversion");
93043
+ }
93044
+ }
93045
+ return _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_2__.Point3d.fromJSON(props);
93046
+ }
92983
93047
  /** Convert a point in this iModel's Spatial coordinates to a [[Cartographic]] using the Geographic location services for this IModelConnection.
92984
93048
  * @param spatial A point in the iModel's spatial coordinates
92985
93049
  * @param result If defined, use this for output
@@ -92998,7 +93062,7 @@ class IModelConnection extends _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.I
92998
93062
  const geoServiceStatus = (0,_itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.mapToGeoServiceStatus)(coordResponse.geoCoords[0].s);
92999
93063
  throw new _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.IModelError(geoServiceStatus, "Error converting spatial to cartographic");
93000
93064
  }
93001
- const longLatHeight = _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_2__.Point3d.fromJSON(coordResponse.geoCoords[0].p); // x is longitude in degrees, y is latitude in degrees, z is height in meters...
93065
+ const longLatHeight = IModelConnection.getFiniteGeoPoint(coordResponse.geoCoords[0].p); // x is longitude in degrees, y is latitude in degrees, z is height in meters...
93002
93066
  return _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.Cartographic.fromDegrees({ longitude: longLatHeight.x, latitude: longLatHeight.y, height: longLatHeight.z }, result);
93003
93067
  }
93004
93068
  /** Convert a point in this iModel's Spatial coordinates to a [[Cartographic]] using the Geographic location services for this IModelConnection or [[IModel.ecefLocation]].
@@ -93052,7 +93116,7 @@ class IModelConnection extends _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.I
93052
93116
  case _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.GeoCoordStatus.NoGCSDefined:
93053
93117
  throw new _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.IModelError(_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.GeoServiceStatus.NoGeoLocation, "iModel is not GeoLocated");
93054
93118
  case _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.GeoCoordStatus.Success:
93055
- const llh = _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_2__.Point3d.fromJSON(coord.p);
93119
+ const llh = IModelConnection.getFiniteGeoPoint(coord.p);
93056
93120
  return _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.Cartographic.fromDegrees({ longitude: llh.x, latitude: llh.y, height: llh.z });
93057
93121
  default:
93058
93122
  throw new _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.IModelError((0,_itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.mapToGeoServiceStatus)(coord.s), "Error converting spatial to cartographic");
@@ -93079,7 +93143,7 @@ class IModelConnection extends _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.I
93079
93143
  throw new _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.IModelError(geoServiceStatus, "Error converting cartographic to spatial");
93080
93144
  }
93081
93145
  result = result ? result : _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_2__.Point3d.createZero();
93082
- result.setFromJSON(coordResponse.iModelCoords[0].p);
93146
+ result.setFrom(IModelConnection.getFiniteGeoPoint(coordResponse.iModelCoords[0].p));
93083
93147
  return result;
93084
93148
  }
93085
93149
  /** Convert a [Cartographic]($common) to a point in this iModel's Spatial coordinates using a [[GeoConverter]] or[[IModel.ecefLocation]($common).
@@ -93129,7 +93193,7 @@ class IModelConnection extends _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.I
93129
93193
  case _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.GeoCoordStatus.NoGCSDefined:
93130
93194
  throw new _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.IModelError(_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.GeoServiceStatus.NoGeoLocation, "iModel is not GeoLocated");
93131
93195
  case _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.GeoCoordStatus.Success:
93132
- return _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_2__.Point3d.fromJSON(coord.p);
93196
+ return IModelConnection.getFiniteGeoPoint(coord.p);
93133
93197
  default:
93134
93198
  throw new _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.IModelError((0,_itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.mapToGeoServiceStatus)(coord.s), "Error converting cartographic to spatial");
93135
93199
  }
@@ -93465,7 +93529,7 @@ class SnapshotConnection extends IModelConnection {
93465
93529
  /** @internal */
93466
93530
  async getDictionaryModel() {
93467
93531
  const res = await this._iModel.models.queryProps({ from: "bis.DictionaryModel", wantPrivate: true });
93468
- if (res.length !== 1 || res[0].id === undefined)
93532
+ if (res.length !== 1)
93469
93533
  throw new _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.IModelError(_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.IModelStatus.BadModel, "bis.DictionaryModel");
93470
93534
  return res[0].id;
93471
93535
  }
@@ -117000,6 +117064,7 @@ const extensionExports = {
117000
117064
  imageBufferToPngDataUrl: _core_frontend__WEBPACK_IMPORTED_MODULE_1__.imageBufferToPngDataUrl,
117001
117065
  imageElementFromImageSource: _core_frontend__WEBPACK_IMPORTED_MODULE_1__.imageElementFromImageSource,
117002
117066
  imageElementFromUrl: _core_frontend__WEBPACK_IMPORTED_MODULE_1__.imageElementFromUrl,
117067
+ isPersisted: _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.isPersisted,
117003
117068
  queryTerrainElevationOffset: _core_frontend__WEBPACK_IMPORTED_MODULE_1__.queryTerrainElevationOffset,
117004
117069
  readElementGraphics: _core_frontend__WEBPACK_IMPORTED_MODULE_1__.readElementGraphics,
117005
117070
  readGltfGraphics: _core_frontend__WEBPACK_IMPORTED_MODULE_1__.readGltfGraphics,
@@ -154120,9 +154185,10 @@ __webpack_require__.r(__webpack_exports__);
154120
154185
  /* harmony import */ var _common_FrontendLoggerCategory__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../common/FrontendLoggerCategory */ "../../core/frontend/lib/esm/common/FrontendLoggerCategory.js");
154121
154186
  /* harmony import */ var _DisplayStyleState__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../DisplayStyleState */ "../../core/frontend/lib/esm/DisplayStyleState.js");
154122
154187
  /* harmony import */ var _IModelApp__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../IModelApp */ "../../core/frontend/lib/esm/IModelApp.js");
154123
- /* harmony import */ var _RealityDataSource__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../RealityDataSource */ "../../core/frontend/lib/esm/RealityDataSource.js");
154124
- /* harmony import */ var _common_internal_render_MeshPrimitives__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../common/internal/render/MeshPrimitives */ "../../core/frontend/lib/esm/common/internal/render/MeshPrimitives.js");
154125
- /* harmony import */ var _tile_internal__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../tile/internal */ "../../core/frontend/lib/esm/tile/internal.js");
154188
+ /* harmony import */ var _IModelConnection__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../IModelConnection */ "../../core/frontend/lib/esm/IModelConnection.js");
154189
+ /* harmony import */ var _RealityDataSource__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../RealityDataSource */ "../../core/frontend/lib/esm/RealityDataSource.js");
154190
+ /* harmony import */ var _common_internal_render_MeshPrimitives__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../common/internal/render/MeshPrimitives */ "../../core/frontend/lib/esm/common/internal/render/MeshPrimitives.js");
154191
+ /* harmony import */ var _tile_internal__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../tile/internal */ "../../core/frontend/lib/esm/tile/internal.js");
154126
154192
  /*---------------------------------------------------------------------------------------------
154127
154193
  * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
154128
154194
  * See LICENSE.md in the project root for license terms and full copyright notice.
@@ -154141,6 +154207,7 @@ __webpack_require__.r(__webpack_exports__);
154141
154207
 
154142
154208
 
154143
154209
 
154210
+
154144
154211
  const scratchRange = _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_2__.Range3d.create();
154145
154212
  const scratchWorldFrustum = new _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.Frustum();
154146
154213
  function compareSourceKeys(lhs, rhs) {
@@ -154204,7 +154271,7 @@ class OrbitGtTileTreeParams {
154204
154271
  id;
154205
154272
  modelId;
154206
154273
  iModel;
154207
- get priority() { return _tile_internal__WEBPACK_IMPORTED_MODULE_10__.TileLoadPriority.Context; }
154274
+ get priority() { return _tile_internal__WEBPACK_IMPORTED_MODULE_11__.TileLoadPriority.Context; }
154208
154275
  constructor(rdSourceKey, iModel, modelId, location) {
154209
154276
  this.location = location;
154210
154277
  const key = rdSourceKey;
@@ -154213,7 +154280,7 @@ class OrbitGtTileTreeParams {
154213
154280
  this.iModel = iModel;
154214
154281
  }
154215
154282
  }
154216
- class OrbitGtRootTile extends _tile_internal__WEBPACK_IMPORTED_MODULE_10__.Tile {
154283
+ class OrbitGtRootTile extends _tile_internal__WEBPACK_IMPORTED_MODULE_11__.Tile {
154217
154284
  _loadChildren(_resolve, _reject) { }
154218
154285
  async requestContent(_isCanceled) { return undefined; }
154219
154286
  get channel() { return _IModelApp__WEBPACK_IMPORTED_MODULE_7__.IModelApp.tileAdmin.channels.getForHttp("itwinjs-orbitgit"); }
@@ -154286,7 +154353,7 @@ class TileSortProjector {
154286
154353
  coordinate.z = point.z;
154287
154354
  }
154288
154355
  }
154289
- class OrbitGtTileGraphic extends _tile_internal__WEBPACK_IMPORTED_MODULE_10__.TileUsageMarker {
154356
+ class OrbitGtTileGraphic extends _tile_internal__WEBPACK_IMPORTED_MODULE_11__.TileUsageMarker {
154290
154357
  graphic;
154291
154358
  constructor(graphic, viewport, time) {
154292
154359
  super();
@@ -154297,7 +154364,7 @@ class OrbitGtTileGraphic extends _tile_internal__WEBPACK_IMPORTED_MODULE_10__.Ti
154297
154364
  this.graphic[Symbol.dispose]();
154298
154365
  }
154299
154366
  }
154300
- class OrbitGtTileTree extends _tile_internal__WEBPACK_IMPORTED_MODULE_10__.TileTree {
154367
+ class OrbitGtTileTree extends _tile_internal__WEBPACK_IMPORTED_MODULE_11__.TileTree {
154301
154368
  _dataManager;
154302
154369
  _centerOffset;
154303
154370
  _ecefTransform;
@@ -154313,7 +154380,7 @@ class OrbitGtTileTree extends _tile_internal__WEBPACK_IMPORTED_MODULE_10__.TileT
154313
154380
  this._dataManager = _dataManager;
154314
154381
  this._centerOffset = _centerOffset;
154315
154382
  this._ecefTransform = _ecefTransform;
154316
- this._layerHandler = new _tile_internal__WEBPACK_IMPORTED_MODULE_10__.LayerTileTreeHandler(this);
154383
+ this._layerHandler = new _tile_internal__WEBPACK_IMPORTED_MODULE_11__.LayerTileTreeHandler(this);
154317
154384
  this._tileParams = { contentId: "0", range: cloudRange, maximumSize: 256 };
154318
154385
  this.rootTile = new OrbitGtRootTile(this._tileParams, this);
154319
154386
  }
@@ -154383,7 +154450,7 @@ class OrbitGtTileTree extends _tile_internal__WEBPACK_IMPORTED_MODULE_10__.TileT
154383
154450
  range.high.addInPlace(this._centerOffset);
154384
154451
  const qParams = _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.QParams3d.fromRange(range, undefined, (tile.points8 != null) ? _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.Quantization.rangeScale8 : _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.Quantization.rangeScale16);
154385
154452
  const featureTable = new _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.FeatureTable(1, this.modelId, _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.BatchType.Primary);
154386
- const features = new _common_internal_render_MeshPrimitives__WEBPACK_IMPORTED_MODULE_9__.Mesh.Features(featureTable);
154453
+ const features = new _common_internal_render_MeshPrimitives__WEBPACK_IMPORTED_MODULE_10__.Mesh.Features(featureTable);
154387
154454
  const system = _IModelApp__WEBPACK_IMPORTED_MODULE_7__.IModelApp.renderSystem;
154388
154455
  const voxelSize = (range.high.x - range.low.x) / 64;
154389
154456
  features.add(new _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.Feature(this.modelId), 1);
@@ -154458,7 +154525,17 @@ async function computeVerticalDatumShift(geoOrigin, heightAsEllipsoidalDbZ, iMod
154458
154525
  _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.Logger.logWarning(_common_FrontendLoggerCategory__WEBPACK_IMPORTED_MODULE_5__.FrontendLoggerCategory.RealityData, `Failed to compute orthometric height correction for point cloud (status ${response.iModelCoords[0].s}); heights will be treated as ellipsoidal`);
154459
154526
  return 0;
154460
154527
  }
154461
- return _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_2__.Point3d.fromJSON(response.iModelCoords[0].p).z - heightAsEllipsoidalDbZ;
154528
+ try {
154529
+ const converted = _IModelConnection__WEBPACK_IMPORTED_MODULE_8__.IModelConnection.getFiniteGeoPoint(response.iModelCoords[0].p);
154530
+ const shift = converted.z - heightAsEllipsoidalDbZ;
154531
+ if (!Number.isFinite(shift))
154532
+ throw new Error("Non-finite orthometric height correction");
154533
+ return shift;
154534
+ }
154535
+ catch {
154536
+ _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.Logger.logWarning(_common_FrontendLoggerCategory__WEBPACK_IMPORTED_MODULE_5__.FrontendLoggerCategory.RealityData, "Non-finite orthometric height correction for point cloud; heights will be treated as ellipsoidal");
154537
+ return 0;
154538
+ }
154462
154539
  }
154463
154540
  catch (err) {
154464
154541
  _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.Logger.logError(_common_FrontendLoggerCategory__WEBPACK_IMPORTED_MODULE_5__.FrontendLoggerCategory.RealityData, err);
@@ -154488,7 +154565,7 @@ async function computeVerticalDatumShift(geoOrigin, heightAsEllipsoidalDbZ, iMod
154488
154565
  return isValidSASToken(props.sasToken);
154489
154566
  }
154490
154567
  async function createOrbitGtTileTree(rdSourceKey, iModel, modelId) {
154491
- const rdSource = await _RealityDataSource__WEBPACK_IMPORTED_MODULE_8__.RealityDataSource.fromKey(rdSourceKey, iModel.iTwinId);
154568
+ const rdSource = await _RealityDataSource__WEBPACK_IMPORTED_MODULE_9__.RealityDataSource.fromKey(rdSourceKey, iModel.iTwinId);
154492
154569
  const isContextShare = rdSourceKey.provider === _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.RealityDataProvider.ContextShare;
154493
154570
  const isTilestUrl = rdSourceKey.provider === _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.RealityDataProvider.TilesetUrl;
154494
154571
  let blobStringUrl;
@@ -154507,7 +154584,7 @@ async function computeVerticalDatumShift(geoOrigin, heightAsEllipsoidalDbZ, iMod
154507
154584
  blobStringUrl = rdSourceKey.id;
154508
154585
  }
154509
154586
  else {
154510
- const orbitGtBlobProps = _RealityDataSource__WEBPACK_IMPORTED_MODULE_8__.RealityDataSource.createOrbitGtBlobPropsFromKey(rdSourceKey);
154587
+ const orbitGtBlobProps = _RealityDataSource__WEBPACK_IMPORTED_MODULE_9__.RealityDataSource.createOrbitGtBlobPropsFromKey(rdSourceKey);
154511
154588
  if (orbitGtBlobProps === undefined)
154512
154589
  return undefined;
154513
154590
  if (!isValidOrbitGtBlobProps(orbitGtBlobProps))
@@ -154596,7 +154673,7 @@ async function computeVerticalDatumShift(geoOrigin, heightAsEllipsoidalDbZ, iMod
154596
154673
  /** Supplies a reality data [[TileTree]] from a URL. May be associated with a persistent [[GeometricModelState]], or attached at run-time via a [[ContextOrbitGtState]].
154597
154674
  * Exported strictly for tests.
154598
154675
  */
154599
- class OrbitGtTreeReference extends _tile_internal__WEBPACK_IMPORTED_MODULE_10__.RealityModelTileTree.Reference {
154676
+ class OrbitGtTreeReference extends _tile_internal__WEBPACK_IMPORTED_MODULE_11__.RealityModelTileTree.Reference {
154600
154677
  treeOwner;
154601
154678
  _rdSourceKey;
154602
154679
  _modelId;
@@ -154609,11 +154686,11 @@ class OrbitGtTreeReference extends _tile_internal__WEBPACK_IMPORTED_MODULE_10__.
154609
154686
  this._rdSourceKey = props.rdSourceKey;
154610
154687
  }
154611
154688
  else if (props.orbitGtBlob) {
154612
- this._rdSourceKey = _RealityDataSource__WEBPACK_IMPORTED_MODULE_8__.RealityDataSource.createKeyFromOrbitGtBlobProps(props.orbitGtBlob);
154689
+ this._rdSourceKey = _RealityDataSource__WEBPACK_IMPORTED_MODULE_9__.RealityDataSource.createKeyFromOrbitGtBlobProps(props.orbitGtBlob);
154613
154690
  }
154614
154691
  else {
154615
154692
  // TODO: Maybe we should throw an exception
154616
- this._rdSourceKey = _RealityDataSource__WEBPACK_IMPORTED_MODULE_8__.RealityDataSource.createKeyFromBlobUrl("", _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.RealityDataProvider.OrbitGtBlob, _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.RealityDataFormat.OPC);
154693
+ this._rdSourceKey = _RealityDataSource__WEBPACK_IMPORTED_MODULE_9__.RealityDataSource.createKeyFromBlobUrl("", _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.RealityDataProvider.OrbitGtBlob, _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.RealityDataFormat.OPC);
154617
154694
  }
154618
154695
  // ###TODO find compatible model Id
154619
154696
  let modelId = props.modelId;
@@ -296435,7 +296512,7 @@ __webpack_require__.r(__webpack_exports__);
296435
296512
  /* harmony export */ });
296436
296513
  /* harmony import */ var i18next__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! i18next */ "../../common/temp/node_modules/.pnpm/i18next@21.10.0/node_modules/i18next/dist/esm/i18next.js");
296437
296514
  /* harmony import */ var i18next_browser_languagedetector__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! i18next-browser-languagedetector */ "../../common/temp/node_modules/.pnpm/i18next-browser-languagedetector@6.1.8/node_modules/i18next-browser-languagedetector/dist/esm/i18nextBrowserLanguageDetector.js");
296438
- /* harmony import */ var i18next_http_backend__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! i18next-http-backend */ "../../common/temp/node_modules/.pnpm/i18next-http-backend@3.0.6/node_modules/i18next-http-backend/esm/index.js");
296515
+ /* harmony import */ var i18next_http_backend__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! i18next-http-backend */ "../../common/temp/node_modules/.pnpm/i18next-http-backend@4.0.5/node_modules/i18next-http-backend/esm/index.js");
296439
296516
  /* harmony import */ var _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @itwin/core-bentley */ "../../core/bentley/lib/esm/core-bentley.js");
296440
296517
  /*---------------------------------------------------------------------------------------------
296441
296518
  * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
@@ -333113,534 +333190,377 @@ const isSafeIterable = (thing) =>
333113
333190
 
333114
333191
  /***/ },
333115
333192
 
333116
- /***/ "../../common/temp/node_modules/.pnpm/i18next-http-backend@3.0.6/node_modules/i18next-http-backend/esm/index.js"
333193
+ /***/ "../../common/temp/node_modules/.pnpm/i18next-http-backend@4.0.5/node_modules/i18next-http-backend/esm/index.js"
333117
333194
  /*!**********************************************************************************************************************!*\
333118
- !*** ../../common/temp/node_modules/.pnpm/i18next-http-backend@3.0.6/node_modules/i18next-http-backend/esm/index.js ***!
333195
+ !*** ../../common/temp/node_modules/.pnpm/i18next-http-backend@4.0.5/node_modules/i18next-http-backend/esm/index.js ***!
333119
333196
  \**********************************************************************************************************************/
333120
333197
  (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
333121
333198
 
333122
333199
  "use strict";
333123
333200
  __webpack_require__.r(__webpack_exports__);
333124
333201
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
333125
- /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
333202
+ /* harmony export */ "default": () => (/* binding */ Backend)
333126
333203
  /* harmony export */ });
333127
- /* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils.js */ "../../common/temp/node_modules/.pnpm/i18next-http-backend@3.0.6/node_modules/i18next-http-backend/esm/utils.js");
333128
- /* harmony import */ var _request_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./request.js */ "../../common/temp/node_modules/.pnpm/i18next-http-backend@3.0.6/node_modules/i18next-http-backend/esm/request.js");
333129
- function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
333130
- function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
333131
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
333132
- function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
333133
- function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
333134
- function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
333135
- function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
333136
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
333137
- function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
333138
- ;
333139
-
333140
- var getDefaults = function getDefaults() {
333141
- return {
333142
- loadPath: '/locales/{{lng}}/{{ns}}.json',
333143
- addPath: '/locales/add/{{lng}}/{{ns}}',
333144
- parse: function parse(data) {
333145
- return JSON.parse(data);
333146
- },
333147
- stringify: JSON.stringify,
333148
- parsePayload: function parsePayload(namespace, key, fallbackValue) {
333149
- return _defineProperty({}, key, fallbackValue || '');
333150
- },
333151
- parseLoadPayload: function parseLoadPayload(languages, namespaces) {
333152
- return undefined;
333153
- },
333154
- request: _request_js__WEBPACK_IMPORTED_MODULE_1__["default"],
333155
- reloadInterval: typeof window !== 'undefined' ? false : 60 * 60 * 1000,
333156
- customHeaders: {},
333157
- queryStringParams: {},
333158
- crossDomain: false,
333159
- withCredentials: false,
333160
- overrideMimeType: false,
333161
- requestOptions: {
333162
- mode: 'cors',
333163
- credentials: 'same-origin',
333164
- cache: 'default'
333165
- }
333166
- };
333167
- };
333168
- var Backend = function () {
333169
- function Backend(services) {
333170
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
333171
- var allOptions = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
333172
- _classCallCheck(this, Backend);
333173
- this.services = services;
333174
- this.options = options;
333175
- this.allOptions = allOptions;
333176
- this.type = 'backend';
333177
- this.init(services, options, allOptions);
333178
- }
333179
- return _createClass(Backend, [{
333180
- key: "init",
333181
- value: function init(services) {
333182
- var _this = this;
333183
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
333184
- var allOptions = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
333185
- this.services = services;
333186
- this.options = _objectSpread(_objectSpread(_objectSpread({}, getDefaults()), this.options || {}), options);
333187
- this.allOptions = allOptions;
333188
- if (this.services && this.options.reloadInterval) {
333189
- var timer = setInterval(function () {
333190
- return _this.reload();
333191
- }, this.options.reloadInterval);
333192
- if (_typeof(timer) === 'object' && typeof timer.unref === 'function') timer.unref();
333193
- }
333194
- }
333195
- }, {
333196
- key: "readMulti",
333197
- value: function readMulti(languages, namespaces, callback) {
333198
- this._readAny(languages, languages, namespaces, namespaces, callback);
333199
- }
333200
- }, {
333201
- key: "read",
333202
- value: function read(language, namespace, callback) {
333203
- this._readAny([language], language, [namespace], namespace, callback);
333204
- }
333205
- }, {
333206
- key: "_readAny",
333207
- value: function _readAny(languages, loadUrlLanguages, namespaces, loadUrlNamespaces, callback) {
333208
- var _this2 = this;
333209
- var loadPath = this.options.loadPath;
333210
- if (typeof this.options.loadPath === 'function') {
333211
- loadPath = this.options.loadPath(languages, namespaces);
333212
- }
333213
- loadPath = (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.makePromise)(loadPath);
333214
- loadPath.then(function (resolvedLoadPath) {
333215
- if (!resolvedLoadPath) return callback(null, {});
333216
- var url = (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.interpolateUrl)(resolvedLoadPath, {
333217
- lng: languages.join('+'),
333218
- ns: namespaces.join('+')
333219
- });
333220
- if (url == null) {
333221
- var safeLngs = languages.map(_utils_js__WEBPACK_IMPORTED_MODULE_0__.sanitizeLogValue).join(', ');
333222
- var safeNss = namespaces.map(_utils_js__WEBPACK_IMPORTED_MODULE_0__.sanitizeLogValue).join(', ');
333223
- return callback(new Error('i18next-http-backend: unsafe lng/ns value — refusing to build request URL for languages=[' + safeLngs + '] namespaces=[' + safeNss + ']'), false);
333224
- }
333225
- _this2.loadUrl(url, callback, loadUrlLanguages, loadUrlNamespaces);
333226
- });
333227
- }
333228
- }, {
333229
- key: "loadUrl",
333230
- value: function loadUrl(url, callback, languages, namespaces) {
333231
- var _this3 = this;
333232
- var lng = typeof languages === 'string' ? [languages] : languages;
333233
- var ns = typeof namespaces === 'string' ? [namespaces] : namespaces;
333234
- var payload = this.options.parseLoadPayload(lng, ns);
333235
- var safeUrl = (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.sanitizeLogValue)((0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.redactUrlCredentials)(url));
333236
- this.options.request(this.options, url, payload, function (err, res) {
333237
- if (res && (res.status >= 500 && res.status < 600 || !res.status)) return callback('failed loading ' + safeUrl + '; status code: ' + res.status, true);
333238
- if (res && res.status >= 400 && res.status < 500) return callback('failed loading ' + safeUrl + '; status code: ' + res.status, false);
333239
- if (!res && err && err.message) {
333240
- var errorMessage = err.message.toLowerCase();
333241
- var isNetworkError = ['failed', 'fetch', 'network', 'load'].find(function (term) {
333242
- return errorMessage.indexOf(term) > -1;
333243
- });
333244
- if (isNetworkError) {
333245
- return callback('failed loading ' + safeUrl + ': ' + (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.sanitizeLogValue)(err.message), true);
333246
- }
333247
- }
333248
- if (err) return callback(err, false);
333249
- var ret, parseErr;
333250
- try {
333251
- if (typeof res.data === 'string') {
333252
- ret = _this3.options.parse(res.data, languages, namespaces);
333253
- } else {
333254
- ret = res.data;
333255
- }
333256
- } catch (e) {
333257
- parseErr = 'failed parsing ' + safeUrl + ' to json';
333258
- }
333259
- if (parseErr) return callback(parseErr, false);
333260
- callback(null, ret);
333261
- });
333262
- }
333263
- }, {
333264
- key: "create",
333265
- value: function create(languages, namespace, key, fallbackValue, callback) {
333266
- var _this4 = this;
333267
- if (!this.options.addPath) return;
333268
- if (typeof languages === 'string') languages = [languages];
333269
- var payload = this.options.parsePayload(namespace, key, fallbackValue);
333270
- var finished = 0;
333271
- var dataArray = [];
333272
- var resArray = [];
333273
- languages.forEach(function (lng) {
333274
- var addPath = _this4.options.addPath;
333275
- if (typeof _this4.options.addPath === 'function') {
333276
- addPath = _this4.options.addPath(lng, namespace);
333277
- }
333278
- var url = (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.interpolateUrl)(addPath, {
333279
- lng: lng,
333280
- ns: namespace
333281
- });
333282
- if (url == null) {
333283
- finished += 1;
333284
- if (callback && finished === languages.length) callback(dataArray, resArray);
333285
- return;
333286
- }
333287
- _this4.options.request(_this4.options, url, payload, function (data, res) {
333288
- finished += 1;
333289
- dataArray.push(data);
333290
- resArray.push(res);
333291
- if (finished === languages.length) {
333292
- if (typeof callback === 'function') callback(dataArray, resArray);
333293
- }
333294
- });
333295
- });
333296
- }
333297
- }, {
333298
- key: "reload",
333299
- value: function reload() {
333300
- var _this5 = this;
333301
- var _this$services = this.services,
333302
- backendConnector = _this$services.backendConnector,
333303
- languageUtils = _this$services.languageUtils,
333304
- logger = _this$services.logger;
333305
- var currentLanguage = backendConnector.language;
333306
- if (currentLanguage && currentLanguage.toLowerCase() === 'cimode') return;
333307
- var toLoad = [];
333308
- var append = function append(lng) {
333309
- var lngs = languageUtils.toResolveHierarchy(lng);
333310
- lngs.forEach(function (l) {
333311
- if (toLoad.indexOf(l) < 0) toLoad.push(l);
333312
- });
333313
- };
333314
- append(currentLanguage);
333315
- if (this.allOptions.preload) this.allOptions.preload.forEach(function (l) {
333316
- return append(l);
333317
- });
333318
- toLoad.forEach(function (lng) {
333319
- _this5.allOptions.ns.forEach(function (ns) {
333320
- backendConnector.read(lng, ns, 'read', null, null, function (err, data) {
333321
- if (err) logger.warn("loading namespace ".concat(ns, " for language ").concat(lng, " failed"), err);
333322
- if (!err && data) logger.log("loaded namespace ".concat(ns, " for language ").concat(lng), data);
333323
- backendConnector.loaded("".concat(lng, "|").concat(ns), err, data);
333324
- });
333325
- });
333326
- });
333327
- }
333328
- }]);
333329
- }();
333330
- Backend.type = 'backend';
333331
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Backend);
333332
-
333333
- /***/ },
333334
-
333335
- /***/ "../../common/temp/node_modules/.pnpm/i18next-http-backend@3.0.6/node_modules/i18next-http-backend/esm/request.js"
333336
- /*!************************************************************************************************************************!*\
333337
- !*** ../../common/temp/node_modules/.pnpm/i18next-http-backend@3.0.6/node_modules/i18next-http-backend/esm/request.js ***!
333338
- \************************************************************************************************************************/
333339
- (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
333340
-
333341
- "use strict";
333342
- __webpack_require__.r(__webpack_exports__);
333343
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
333344
- /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
333345
- /* harmony export */ });
333346
- /* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils.js */ "../../common/temp/node_modules/.pnpm/i18next-http-backend@3.0.6/node_modules/i18next-http-backend/esm/utils.js");
333347
- function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
333348
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
333349
- function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
333350
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
333351
- function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
333352
- function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
333353
- ;
333354
- var fetchApi = typeof fetch === 'function' ? fetch : undefined;
333355
- if (typeof __webpack_require__.g !== 'undefined' && __webpack_require__.g.fetch) {
333356
- fetchApi = __webpack_require__.g.fetch;
333357
- } else if (typeof window !== 'undefined' && window.fetch) {
333358
- fetchApi = window.fetch;
333359
- }
333360
- var XmlHttpRequestApi;
333361
- if ((0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.hasXMLHttpRequest)()) {
333362
- if (typeof __webpack_require__.g !== 'undefined' && __webpack_require__.g.XMLHttpRequest) {
333363
- XmlHttpRequestApi = __webpack_require__.g.XMLHttpRequest;
333364
- } else if (typeof window !== 'undefined' && window.XMLHttpRequest) {
333365
- XmlHttpRequestApi = window.XMLHttpRequest;
333366
- }
333367
- }
333368
- var ActiveXObjectApi;
333369
- if (typeof ActiveXObject === 'function') {
333370
- if (typeof __webpack_require__.g !== 'undefined' && __webpack_require__.g.ActiveXObject) {
333371
- ActiveXObjectApi = __webpack_require__.g.ActiveXObject;
333372
- } else if (typeof window !== 'undefined' && window.ActiveXObject) {
333373
- ActiveXObjectApi = window.ActiveXObject;
333374
- }
333375
- }
333376
- if (typeof fetchApi !== 'function') fetchApi = undefined;
333377
- if (!fetchApi && !XmlHttpRequestApi && !ActiveXObjectApi) {
333378
- try {
333379
- __webpack_require__.e(/*! import() */ "vendors-common_temp_node_modules_pnpm_cross-fetch_4_1_0_node_modules_cross-fetch_dist_browser-44272f").then(() => (__webpack_require__.t(/*! cross-fetch */ "../../common/temp/node_modules/.pnpm/cross-fetch@4.1.0/node_modules/cross-fetch/dist/browser-ponyfill.js", 19))).then(function (mod) {
333380
- fetchApi = mod.default;
333381
- }).catch(function () {});
333382
- } catch (e) {}
333383
- }
333384
- var UNSAFE_KEYS = ['__proto__', 'constructor', 'prototype'];
333385
- var addQueryString = function addQueryString(url, params) {
333386
- if (params && _typeof(params) === 'object') {
333387
- var queryString = '';
333388
- for (var _i = 0, _Object$keys = Object.keys(params); _i < _Object$keys.length; _i++) {
333389
- var paramName = _Object$keys[_i];
333390
- if (UNSAFE_KEYS.indexOf(paramName) > -1) continue;
333391
- queryString += '&' + encodeURIComponent(paramName) + '=' + encodeURIComponent(params[paramName]);
333392
- }
333393
- if (!queryString) return url;
333394
- url = url + (url.indexOf('?') !== -1 ? '&' : '?') + queryString.slice(1);
333395
- }
333396
- return url;
333397
- };
333398
- var fetchIt = function fetchIt(url, fetchOptions, callback, altFetch) {
333399
- var resolver = function resolver(response) {
333400
- if (!response.ok) return callback(response.statusText || 'Error', {
333401
- status: response.status
333402
- });
333403
- response.text().then(function (data) {
333404
- callback(null, {
333405
- status: response.status,
333406
- data: data
333407
- });
333408
- }).catch(callback);
333409
- };
333410
- if (altFetch) {
333411
- var altResponse = altFetch(url, fetchOptions);
333412
- if (altResponse instanceof Promise) {
333413
- altResponse.then(resolver).catch(callback);
333414
- return;
333415
- }
333416
- }
333417
- if (typeof fetch === 'function') {
333418
- fetch(url, fetchOptions).then(resolver).catch(callback);
333419
- } else {
333420
- fetchApi(url, fetchOptions).then(resolver).catch(callback);
333421
- }
333422
- };
333423
- var requestWithFetch = function requestWithFetch(options, url, payload, callback) {
333424
- if (options.queryStringParams) {
333425
- url = addQueryString(url, options.queryStringParams);
333426
- }
333427
- var headers = _objectSpread({}, typeof options.customHeaders === 'function' ? options.customHeaders() : options.customHeaders);
333428
- if (typeof window === 'undefined' && typeof __webpack_require__.g !== 'undefined' && typeof __webpack_require__.g.process !== 'undefined' && __webpack_require__.g.process.versions && __webpack_require__.g.process.versions.node) {
333429
- headers['User-Agent'] = "i18next-http-backend (node/".concat(__webpack_require__.g.process.version, "; ").concat(__webpack_require__.g.process.platform, " ").concat(__webpack_require__.g.process.arch, ")");
333430
- }
333431
- if (payload) headers['Content-Type'] = 'application/json';
333432
- var reqOptions = typeof options.requestOptions === 'function' ? options.requestOptions(payload) : options.requestOptions;
333433
- var fetchOptions = _objectSpread({
333434
- method: payload ? 'POST' : 'GET',
333435
- body: payload ? options.stringify(payload) : undefined,
333436
- headers: headers
333437
- }, options._omitFetchOptions ? {} : reqOptions);
333438
- var altFetch = typeof options.alternateFetch === 'function' && options.alternateFetch.length >= 1 ? options.alternateFetch : undefined;
333439
- try {
333440
- fetchIt(url, fetchOptions, callback, altFetch);
333441
- } catch (e) {
333442
- if (!reqOptions || Object.keys(reqOptions).length === 0 || !e.message || e.message.indexOf('not implemented') < 0) {
333443
- return callback(e);
333444
- }
333445
- try {
333446
- Object.keys(reqOptions).forEach(function (opt) {
333447
- delete fetchOptions[opt];
333448
- });
333449
- fetchIt(url, fetchOptions, callback, altFetch);
333450
- options._omitFetchOptions = true;
333451
- } catch (err) {
333452
- callback(err);
333453
- }
333454
- }
333455
- };
333456
- var requestWithXmlHttpRequest = function requestWithXmlHttpRequest(options, url, payload, callback) {
333457
- if (payload && _typeof(payload) === 'object') {
333458
- payload = addQueryString('', payload).slice(1);
333459
- }
333460
- if (options.queryStringParams) {
333461
- url = addQueryString(url, options.queryStringParams);
333462
- }
333463
- try {
333464
- var x = XmlHttpRequestApi ? new XmlHttpRequestApi() : new ActiveXObjectApi('MSXML2.XMLHTTP.3.0');
333465
- x.open(payload ? 'POST' : 'GET', url, 1);
333466
- if (!options.crossDomain) {
333467
- x.setRequestHeader('X-Requested-With', 'XMLHttpRequest');
333468
- }
333469
- x.withCredentials = !!options.withCredentials;
333470
- if (payload) {
333471
- x.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
333472
- }
333473
- if (x.overrideMimeType) {
333474
- x.overrideMimeType('application/json');
333475
- }
333476
- var h = options.customHeaders;
333477
- h = typeof h === 'function' ? h() : h;
333478
- if (h) {
333479
- for (var _i2 = 0, _Object$keys2 = Object.keys(h); _i2 < _Object$keys2.length; _i2++) {
333480
- var i = _Object$keys2[_i2];
333481
- if (UNSAFE_KEYS.indexOf(i) > -1) continue;
333482
- x.setRequestHeader(i, h[i]);
333483
- }
333484
- }
333485
- x.onreadystatechange = function () {
333486
- x.readyState > 3 && callback(x.status >= 400 ? x.statusText : null, {
333487
- status: x.status,
333488
- data: x.responseText
333489
- });
333490
- };
333491
- x.send(payload);
333492
- } catch (e) {
333493
- console && console.log(e);
333494
- }
333495
- };
333496
- var request = function request(options, url, payload, callback) {
333497
- if (typeof payload === 'function') {
333498
- callback = payload;
333499
- payload = undefined;
333500
- }
333501
- callback = callback || function () {};
333502
- if (fetchApi && url.indexOf('file:') !== 0) {
333503
- return requestWithFetch(options, url, payload, callback);
333504
- }
333505
- if ((0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.hasXMLHttpRequest)() || typeof ActiveXObject === 'function') {
333506
- return requestWithXmlHttpRequest(options, url, payload, callback);
333507
- }
333508
- callback(new Error('No fetch and no xhr implementation found!'));
333509
- };
333510
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (request);
333511
-
333512
- /***/ },
333513
-
333514
- /***/ "../../common/temp/node_modules/.pnpm/i18next-http-backend@3.0.6/node_modules/i18next-http-backend/esm/utils.js"
333515
- /*!**********************************************************************************************************************!*\
333516
- !*** ../../common/temp/node_modules/.pnpm/i18next-http-backend@3.0.6/node_modules/i18next-http-backend/esm/utils.js ***!
333517
- \**********************************************************************************************************************/
333518
- (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
333519
-
333520
- "use strict";
333521
- __webpack_require__.r(__webpack_exports__);
333522
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
333523
- /* harmony export */ defaults: () => (/* binding */ defaults),
333524
- /* harmony export */ hasXMLHttpRequest: () => (/* binding */ hasXMLHttpRequest),
333525
- /* harmony export */ interpolate: () => (/* binding */ interpolate),
333526
- /* harmony export */ interpolateUrl: () => (/* binding */ interpolateUrl),
333527
- /* harmony export */ isSafeLangUrlSegment: () => (/* binding */ isSafeLangUrlSegment),
333528
- /* harmony export */ isSafeNsUrlSegment: () => (/* binding */ isSafeNsUrlSegment),
333529
- /* harmony export */ isSafeUrlSegment: () => (/* binding */ isSafeUrlSegment),
333530
- /* harmony export */ makePromise: () => (/* binding */ makePromise),
333531
- /* harmony export */ redactUrlCredentials: () => (/* binding */ redactUrlCredentials),
333532
- /* harmony export */ sanitizeLogValue: () => (/* binding */ sanitizeLogValue)
333533
- /* harmony export */ });
333534
- function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
333535
- function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
333536
- function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
333537
- function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
333538
- var arr = [];
333539
- var each = arr.forEach;
333540
- var slice = arr.slice;
333541
- var UNSAFE_KEYS = ['__proto__', 'constructor', 'prototype'];
333542
- function defaults(obj) {
333543
- each.call(slice.call(arguments, 1), function (source) {
333544
- if (source) {
333545
- for (var _i = 0, _Object$keys = Object.keys(source); _i < _Object$keys.length; _i++) {
333546
- var prop = _Object$keys[_i];
333547
- if (UNSAFE_KEYS.indexOf(prop) > -1) continue;
333548
- if (obj[prop] === undefined) obj[prop] = source[prop];
333549
- }
333550
- }
333551
- });
333552
- return obj;
333553
- }
333204
+ //#region lib/utils.js
333205
+ const arr = [];
333206
+ arr.forEach;
333207
+ arr.slice;
333208
+ const UNSAFE_KEYS$1 = [
333209
+ "__proto__",
333210
+ "constructor",
333211
+ "prototype"
333212
+ ];
333554
333213
  function isSafeUrlSegmentBase(v) {
333555
- if (typeof v !== 'string') return false;
333556
- if (v.length === 0 || v.length > 128) return false;
333557
- if (UNSAFE_KEYS.indexOf(v) > -1) return false;
333558
- if (v.indexOf('..') > -1) return false;
333559
- if (v.indexOf('\\') > -1) return false;
333560
- if (/[?#%\s@]/.test(v)) return false;
333561
- if (/[\x00-\x1F\x7F]/.test(v)) return false;
333562
- return true;
333214
+ if (typeof v !== "string") return false;
333215
+ if (v.length === 0 || v.length > 128) return false;
333216
+ if (UNSAFE_KEYS$1.indexOf(v) > -1) return false;
333217
+ if (v.indexOf("..") > -1) return false;
333218
+ if (v.indexOf("\\") > -1) return false;
333219
+ if (/[?#%:&=;\s]/.test(v)) return false;
333220
+ if (/[\x00-\x1F\x7F]/.test(v)) return false;
333221
+ return true;
333563
333222
  }
333564
333223
  function isSafeLangUrlSegment(v) {
333565
- if (!isSafeUrlSegmentBase(v)) return false;
333566
- if (v.indexOf('/') > -1) return false;
333567
- return true;
333224
+ if (!isSafeUrlSegmentBase(v)) return false;
333225
+ if (v.indexOf("/") > -1 || v.indexOf("@") > -1) return false;
333226
+ return true;
333568
333227
  }
333569
333228
  function isSafeNsUrlSegment(v) {
333570
- return isSafeUrlSegmentBase(v);
333229
+ if (!isSafeUrlSegmentBase(v)) return false;
333230
+ if (v.indexOf("//") > -1) return false;
333231
+ return true;
333571
333232
  }
333572
- var isSafeUrlSegment = isSafeLangUrlSegment;
333573
- var SAFETY_CHECK_BY_KEY = {
333574
- lng: isSafeLangUrlSegment,
333575
- ns: isSafeNsUrlSegment
333233
+ const SAFETY_CHECK_BY_KEY = {
333234
+ lng: isSafeLangUrlSegment,
333235
+ ns: isSafeNsUrlSegment
333576
333236
  };
333577
333237
  function sanitizeLogValue(v) {
333578
- if (typeof v !== 'string') return v;
333579
- return v.replace(/[\r\n\x00-\x1F\x7F]/g, ' ');
333238
+ if (typeof v !== "string") return v;
333239
+ return v.replace(/[\r\n\x00-\x1F\x7F]/g, " ");
333580
333240
  }
333581
333241
  function redactUrlCredentials(u) {
333582
- if (typeof u !== 'string' || u.length === 0) return u;
333583
- try {
333584
- var parsed = new URL(u);
333585
- if (parsed.username || parsed.password) {
333586
- parsed.username = '';
333587
- parsed.password = '';
333588
- return parsed.toString();
333589
- }
333590
- return u;
333591
- } catch (e) {
333592
- return u.replace(/(\/\/)[^/@\s]+@/g, '$1');
333593
- }
333242
+ if (typeof u !== "string" || u.length === 0) return u;
333243
+ try {
333244
+ const parsed = new URL(u);
333245
+ if (parsed.username || parsed.password) {
333246
+ parsed.username = "";
333247
+ parsed.password = "";
333248
+ return parsed.toString();
333249
+ }
333250
+ return u;
333251
+ } catch (e) {
333252
+ return u.replace(/(\/\/)[^/@\s]+@/g, "$1");
333253
+ }
333594
333254
  }
333595
333255
  function hasXMLHttpRequest() {
333596
- return typeof XMLHttpRequest === 'function' || (typeof XMLHttpRequest === "undefined" ? "undefined" : _typeof(XMLHttpRequest)) === 'object';
333256
+ return typeof XMLHttpRequest === "function" || typeof XMLHttpRequest === "object";
333597
333257
  }
333258
+ /**
333259
+ * Determine whether the given `maybePromise` is a Promise.
333260
+ *
333261
+ * @param {*} maybePromise
333262
+ *
333263
+ * @returns {Boolean}
333264
+ */
333598
333265
  function isPromise(maybePromise) {
333599
- return !!maybePromise && typeof maybePromise.then === 'function';
333266
+ return !!maybePromise && typeof maybePromise.then === "function";
333600
333267
  }
333268
+ /**
333269
+ * Convert any value to a Promise than will resolve to this value.
333270
+ *
333271
+ * @param {*} maybePromise
333272
+ *
333273
+ * @returns {Promise}
333274
+ */
333601
333275
  function makePromise(maybePromise) {
333602
- if (isPromise(maybePromise)) {
333603
- return maybePromise;
333604
- }
333605
- return Promise.resolve(maybePromise);
333606
- }
333607
- var interpolationRegexp = /\{\{(.+?)\}\}/g;
333608
- function interpolate(str, data) {
333609
- return str.replace(interpolationRegexp, function (match, key) {
333610
- var k = key.trim();
333611
- if (UNSAFE_KEYS.indexOf(k) > -1) return match;
333612
- var value = data[k];
333613
- return value != null ? value : match;
333614
- });
333276
+ if (isPromise(maybePromise)) return maybePromise;
333277
+ return Promise.resolve(maybePromise);
333615
333278
  }
333279
+ const interpolationRegexp = /\{\{(.+?)\}\}/g;
333280
+ const LEADING_DOUBLE_SLASH = /^[/\\]{2}/;
333616
333281
  function interpolateUrl(str, data) {
333617
- var unsafe = false;
333618
- var result = str.replace(interpolationRegexp, function (match, key) {
333619
- var k = key.trim();
333620
- if (UNSAFE_KEYS.indexOf(k) > -1) return match;
333621
- var value = data[k];
333622
- if (value == null) return match;
333623
- var check = SAFETY_CHECK_BY_KEY[k] || isSafeLangUrlSegment;
333624
- var segments = String(value).split('+');
333625
- var _iterator = _createForOfIteratorHelper(segments),
333626
- _step;
333627
- try {
333628
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
333629
- var seg = _step.value;
333630
- if (!check(seg)) {
333631
- unsafe = true;
333632
- return match;
333633
- }
333634
- }
333635
- } catch (err) {
333636
- _iterator.e(err);
333637
- } finally {
333638
- _iterator.f();
333639
- }
333640
- return segments.join('+');
333641
- });
333642
- return unsafe ? null : result;
333643
- }
333282
+ let unsafe = false;
333283
+ const result = str.replace(interpolationRegexp, (match, key) => {
333284
+ const k = key.trim();
333285
+ if (UNSAFE_KEYS$1.indexOf(k) > -1) return match;
333286
+ const value = data[k];
333287
+ if (value == null) return match;
333288
+ const check = SAFETY_CHECK_BY_KEY[k] || isSafeLangUrlSegment;
333289
+ const segments = String(value).split("+");
333290
+ for (const seg of segments) if (!check(seg)) {
333291
+ unsafe = true;
333292
+ return match;
333293
+ }
333294
+ return segments.join("+");
333295
+ });
333296
+ if (unsafe) return null;
333297
+ if (LEADING_DOUBLE_SLASH.test(result) && !LEADING_DOUBLE_SLASH.test(str)) return null;
333298
+ return result;
333299
+ }
333300
+ //#endregion
333301
+ //#region lib/request.js
333302
+ const g = typeof globalThis !== "undefined" ? globalThis : typeof __webpack_require__.g !== "undefined" ? __webpack_require__.g : typeof window !== "undefined" ? window : void 0;
333303
+ let fetchApi;
333304
+ if (typeof fetch === "function") fetchApi = fetch;
333305
+ else if (g && typeof g.fetch === "function") fetchApi = g.fetch;
333306
+ const XmlHttpRequestApi = hasXMLHttpRequest() && g ? g.XMLHttpRequest : void 0;
333307
+ const ActiveXObjectApi = typeof ActiveXObject === "function" && g ? g.ActiveXObject : void 0;
333308
+ const UNSAFE_KEYS = [
333309
+ "__proto__",
333310
+ "constructor",
333311
+ "prototype"
333312
+ ];
333313
+ const addQueryString = (url, params) => {
333314
+ if (params && typeof params === "object") {
333315
+ let queryString = "";
333316
+ for (const paramName of Object.keys(params)) {
333317
+ if (UNSAFE_KEYS.indexOf(paramName) > -1) continue;
333318
+ queryString += "&" + encodeURIComponent(paramName) + "=" + encodeURIComponent(params[paramName]);
333319
+ }
333320
+ if (!queryString) return url;
333321
+ url = url + (url.indexOf("?") !== -1 ? "&" : "?") + queryString.slice(1);
333322
+ }
333323
+ return url;
333324
+ };
333325
+ const fetchIt = (url, fetchOptions, callback, altFetch) => {
333326
+ const resolver = (response) => {
333327
+ if (!response.ok) return callback(response.statusText || "Error", { status: response.status });
333328
+ response.text().then((data) => {
333329
+ callback(null, {
333330
+ status: response.status,
333331
+ data
333332
+ });
333333
+ }).catch(callback);
333334
+ };
333335
+ if (altFetch) {
333336
+ const altResponse = altFetch(url, fetchOptions);
333337
+ if (altResponse instanceof Promise) {
333338
+ altResponse.then(resolver).catch(callback);
333339
+ return;
333340
+ }
333341
+ }
333342
+ if (typeof fetch === "function") fetch(url, fetchOptions).then(resolver).catch(callback);
333343
+ else fetchApi(url, fetchOptions).then(resolver).catch(callback);
333344
+ };
333345
+ const requestWithFetch = (options, url, payload, callback) => {
333346
+ if (options.queryStringParams) url = addQueryString(url, options.queryStringParams);
333347
+ const headers = { ...typeof options.customHeaders === "function" ? options.customHeaders() : options.customHeaders };
333348
+ if (typeof window === "undefined" && typeof __webpack_require__.g !== "undefined" && typeof __webpack_require__.g.process !== "undefined" && __webpack_require__.g.process.versions && __webpack_require__.g.process.versions.node) headers["User-Agent"] = `i18next-http-backend (node/${__webpack_require__.g.process.version}; ${__webpack_require__.g.process.platform} ${__webpack_require__.g.process.arch})`;
333349
+ if (payload) headers["Content-Type"] = "application/json";
333350
+ const reqOptions = typeof options.requestOptions === "function" ? options.requestOptions(payload) : options.requestOptions;
333351
+ const fetchOptions = {
333352
+ method: payload ? "POST" : "GET",
333353
+ body: payload ? options.stringify(payload) : void 0,
333354
+ headers,
333355
+ ...options._omitFetchOptions ? {} : reqOptions
333356
+ };
333357
+ const altFetch = typeof options.alternateFetch === "function" && options.alternateFetch.length >= 1 ? options.alternateFetch : void 0;
333358
+ try {
333359
+ fetchIt(url, fetchOptions, callback, altFetch);
333360
+ } catch (e) {
333361
+ if (!reqOptions || Object.keys(reqOptions).length === 0 || !e.message || e.message.indexOf("not implemented") < 0) return callback(e);
333362
+ try {
333363
+ Object.keys(reqOptions).forEach((opt) => {
333364
+ delete fetchOptions[opt];
333365
+ });
333366
+ fetchIt(url, fetchOptions, callback, altFetch);
333367
+ options._omitFetchOptions = true;
333368
+ } catch (err) {
333369
+ callback(err);
333370
+ }
333371
+ }
333372
+ };
333373
+ const requestWithXmlHttpRequest = (options, url, payload, callback) => {
333374
+ if (payload && typeof payload === "object") payload = addQueryString("", payload).slice(1);
333375
+ if (options.queryStringParams) url = addQueryString(url, options.queryStringParams);
333376
+ try {
333377
+ const x = XmlHttpRequestApi ? new XmlHttpRequestApi() : new ActiveXObjectApi("MSXML2.XMLHTTP.3.0");
333378
+ x.open(payload ? "POST" : "GET", url, 1);
333379
+ if (!options.crossDomain) x.setRequestHeader("X-Requested-With", "XMLHttpRequest");
333380
+ x.withCredentials = !!options.withCredentials;
333381
+ if (payload) x.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
333382
+ if (x.overrideMimeType) x.overrideMimeType("application/json");
333383
+ let h = options.customHeaders;
333384
+ h = typeof h === "function" ? h() : h;
333385
+ if (h) for (const i of Object.keys(h)) {
333386
+ if (UNSAFE_KEYS.indexOf(i) > -1) continue;
333387
+ x.setRequestHeader(i, h[i]);
333388
+ }
333389
+ x.onreadystatechange = () => {
333390
+ x.readyState > 3 && callback(x.status >= 400 ? x.statusText : null, {
333391
+ status: x.status,
333392
+ data: x.responseText
333393
+ });
333394
+ };
333395
+ x.send(payload);
333396
+ } catch (e) {
333397
+ console && console.log(e);
333398
+ }
333399
+ };
333400
+ const request = (options, url, payload, callback) => {
333401
+ if (typeof payload === "function") {
333402
+ callback = payload;
333403
+ payload = void 0;
333404
+ }
333405
+ callback = callback || (() => {});
333406
+ if (fetchApi && url.indexOf("file:") !== 0) return requestWithFetch(options, url, payload, callback);
333407
+ if (hasXMLHttpRequest() || typeof ActiveXObject === "function") return requestWithXmlHttpRequest(options, url, payload, callback);
333408
+ callback(/* @__PURE__ */ new Error("No fetch and no xhr implementation found!"));
333409
+ };
333410
+ //#endregion
333411
+ //#region lib/index.js
333412
+ const getDefaults = () => {
333413
+ return {
333414
+ loadPath: "/locales/{{lng}}/{{ns}}.json",
333415
+ addPath: "/locales/add/{{lng}}/{{ns}}",
333416
+ parse: (data) => JSON.parse(data),
333417
+ stringify: JSON.stringify,
333418
+ parsePayload: (namespace, key, fallbackValue) => ({ [key]: fallbackValue || "" }),
333419
+ parseLoadPayload: (languages, namespaces) => void 0,
333420
+ request,
333421
+ reloadInterval: typeof window !== "undefined" ? false : 3600 * 1e3,
333422
+ customHeaders: {},
333423
+ queryStringParams: {},
333424
+ crossDomain: false,
333425
+ withCredentials: false,
333426
+ overrideMimeType: false,
333427
+ requestOptions: {
333428
+ mode: "cors",
333429
+ credentials: "same-origin",
333430
+ cache: "default"
333431
+ }
333432
+ };
333433
+ };
333434
+ var Backend = class {
333435
+ constructor(services, options = {}, allOptions = {}) {
333436
+ this.services = services;
333437
+ this.options = options;
333438
+ this.allOptions = allOptions;
333439
+ this.type = "backend";
333440
+ this.init(services, options, allOptions);
333441
+ }
333442
+ init(services, options = {}, allOptions = {}) {
333443
+ this.services = services;
333444
+ this.options = {
333445
+ ...getDefaults(),
333446
+ ...this.options || {},
333447
+ ...options
333448
+ };
333449
+ this.allOptions = allOptions;
333450
+ if (this.services && this.options.reloadInterval) {
333451
+ const timer = setInterval(() => this.reload(), this.options.reloadInterval);
333452
+ if (typeof timer === "object" && typeof timer.unref === "function") timer.unref();
333453
+ }
333454
+ }
333455
+ readMulti(languages, namespaces, callback) {
333456
+ this._readAny(languages, languages, namespaces, namespaces, callback);
333457
+ }
333458
+ read(language, namespace, callback) {
333459
+ this._readAny([language], language, [namespace], namespace, callback);
333460
+ }
333461
+ _readAny(languages, loadUrlLanguages, namespaces, loadUrlNamespaces, callback) {
333462
+ let loadPath = this.options.loadPath;
333463
+ if (typeof this.options.loadPath === "function") loadPath = this.options.loadPath(languages, namespaces);
333464
+ loadPath = makePromise(loadPath);
333465
+ loadPath.then((resolvedLoadPath) => {
333466
+ if (!resolvedLoadPath) return callback(null, {});
333467
+ const url = interpolateUrl(resolvedLoadPath, {
333468
+ lng: languages.join("+"),
333469
+ ns: namespaces.join("+")
333470
+ });
333471
+ if (url == null) {
333472
+ const safeLngs = languages.map(sanitizeLogValue).join(", ");
333473
+ const safeNss = namespaces.map(sanitizeLogValue).join(", ");
333474
+ return callback(/* @__PURE__ */ new Error("i18next-http-backend: unsafe lng/ns value — refusing to build request URL for languages=[" + safeLngs + "] namespaces=[" + safeNss + "]"), false);
333475
+ }
333476
+ this.loadUrl(url, callback, loadUrlLanguages, loadUrlNamespaces);
333477
+ }, (err) => callback(err, false));
333478
+ }
333479
+ loadUrl(url, callback, languages, namespaces) {
333480
+ const lng = typeof languages === "string" ? [languages] : languages;
333481
+ const ns = typeof namespaces === "string" ? [namespaces] : namespaces;
333482
+ const payload = this.options.parseLoadPayload(lng, ns);
333483
+ const safeUrl = sanitizeLogValue(redactUrlCredentials(url));
333484
+ this.options.request(this.options, url, payload, (err, res) => {
333485
+ if (res && (res.status >= 500 && res.status < 600 || !res.status)) return callback("failed loading " + safeUrl + "; status code: " + res.status, true);
333486
+ if (res && res.status >= 400 && res.status < 500) return callback("failed loading " + safeUrl + "; status code: " + res.status, false);
333487
+ if (!res && err && err.message) {
333488
+ const errorMessage = err.message.toLowerCase();
333489
+ if ([
333490
+ "failed",
333491
+ "fetch",
333492
+ "network",
333493
+ "load"
333494
+ ].find((term) => errorMessage.indexOf(term) > -1)) return callback("failed loading " + safeUrl + ": " + sanitizeLogValue(err.message), true);
333495
+ }
333496
+ if (err) return callback(err, false);
333497
+ let ret, parseErr;
333498
+ try {
333499
+ if (typeof res.data === "string") ret = this.options.parse(res.data, languages, namespaces);
333500
+ else ret = res.data;
333501
+ } catch (e) {
333502
+ parseErr = "failed parsing " + safeUrl + " to json";
333503
+ }
333504
+ if (parseErr) return callback(parseErr, false);
333505
+ callback(null, ret);
333506
+ });
333507
+ }
333508
+ create(languages, namespace, key, fallbackValue, callback) {
333509
+ if (!this.options.addPath) return;
333510
+ if (typeof languages === "string") languages = [languages];
333511
+ const payload = this.options.parsePayload(namespace, key, fallbackValue);
333512
+ let finished = 0;
333513
+ const dataArray = [];
333514
+ const resArray = [];
333515
+ languages.forEach((lng) => {
333516
+ let addPath = this.options.addPath;
333517
+ if (typeof this.options.addPath === "function") addPath = this.options.addPath(lng, namespace);
333518
+ const url = interpolateUrl(addPath, {
333519
+ lng,
333520
+ ns: namespace
333521
+ });
333522
+ if (url == null) {
333523
+ finished += 1;
333524
+ if (callback && finished === languages.length) callback(dataArray, resArray);
333525
+ return;
333526
+ }
333527
+ this.options.request(this.options, url, payload, (data, res) => {
333528
+ finished += 1;
333529
+ dataArray.push(data);
333530
+ resArray.push(res);
333531
+ if (finished === languages.length) {
333532
+ if (typeof callback === "function") callback(dataArray, resArray);
333533
+ }
333534
+ });
333535
+ });
333536
+ }
333537
+ reload() {
333538
+ const { backendConnector, languageUtils, logger } = this.services;
333539
+ const currentLanguage = backendConnector.language;
333540
+ if (currentLanguage && currentLanguage.toLowerCase() === "cimode") return;
333541
+ const toLoad = [];
333542
+ const append = (lng) => {
333543
+ languageUtils.toResolveHierarchy(lng).forEach((l) => {
333544
+ if (toLoad.indexOf(l) < 0) toLoad.push(l);
333545
+ });
333546
+ };
333547
+ append(currentLanguage);
333548
+ if (this.allOptions.preload) this.allOptions.preload.forEach((l) => append(l));
333549
+ toLoad.forEach((lng) => {
333550
+ this.allOptions.ns.forEach((ns) => {
333551
+ backendConnector.read(lng, ns, "read", null, null, (err, data) => {
333552
+ if (err) logger.warn(`loading namespace ${ns} for language ${lng} failed`, err);
333553
+ if (!err && data) logger.log(`loaded namespace ${ns} for language ${lng}`, data);
333554
+ backendConnector.loaded(`${lng}|${ns}`, err, data);
333555
+ });
333556
+ });
333557
+ });
333558
+ }
333559
+ };
333560
+ Backend.type = "backend";
333561
+ //#endregion
333562
+
333563
+
333644
333564
 
333645
333565
  /***/ },
333646
333566
 
@@ -337709,7 +337629,7 @@ class WMS {
337709
337629
  (module) {
337710
337630
 
337711
337631
  "use strict";
337712
- module.exports = /*#__PURE__*/JSON.parse('{"name":"@itwin/core-frontend","version":"5.15.0-dev.15","description":"iTwin.js frontend components","main":"lib/cjs/core-frontend.js","module":"lib/esm/core-frontend.js","typings":"lib/cjs/core-frontend","license":"MIT","scripts":{"build":"npm run -s copy:public && npm run -s build:cjs && npm run -s build:esm && npm run -s build:workers && npm run -s copy:draco","build:cjs":"npm run -s copy:js:cjs && tsc 1>&2 --outDir lib/cjs","build:esm":"npm run -s copy:js:esm && tsc 1>&2 --module ES2022 --outDir lib/esm","clean":"rimraf -g lib .rush/temp/package-deps*.json","copy:public":"cpx \\"./src/public/**/*\\" ./lib/public","copy:js:cjs":"cpx \\"./src/**/*.js\\" ./lib/cjs","copy:js:esm":"cpx \\"./src/**/*.js\\" ./lib/esm","copy:draco":"cpx \\"./node_modules/@loaders.gl/draco/dist/libs/*\\" ./lib/public/scripts","docs":"betools docs --json=../../generated-docs/core/core-frontend/file.json --tsIndexFile=./core-frontend.ts --onlyJson --excludes=webgl/**/*,**/map/*.d.ts,**/tile/*.d.ts,**/*-css.ts && npm run -s extract","extract":"betools extract --fileExt=ts --extractFrom=./src/test/example-code --recursive --out=../../generated-docs/extract","extract-api":"betools extract-api --entry=core-frontend && npm run extract-extension-api","extract-extension-api":"eslint --no-inline-config -c extraction.eslint.config.js \\"./src/**/*.ts\\" 1>&2","lint":"eslint \\"./src/**/*.ts\\" 1>&2","lint-fix":"eslint --fix -f visualstudio \\"./src/**/*.ts\\" 1>&2","lint-deprecation":"eslint --fix -f visualstudio --no-inline-config -c ../../common/config/eslint/eslint.config.deprecation-policy.js \\"./src/**/*.ts\\"","pseudolocalize":"betools pseudolocalize --englishDir ./src/public/locales/en --out ./public/locales/en-PSEUDO","test":"npm run build:test-worker && vitest --run","cover":"npm run build:test-worker && vitest --run","build:test-worker":"vite build --config ./src/test/worker/vite.config.mts 1>&2","build:workers":"rimraf lib/workers/webpack && vite build --config ./src/workers/ImdlParser/vite.config.mts 1>&2"},"repository":{"type":"git","url":"https://github.com/iTwin/itwinjs-core.git","directory":"core/frontend"},"keywords":["Bentley","BIM","iModel","digital-twin","iTwin"],"author":{"name":"Bentley Systems, Inc.","url":"http://www.bentley.com"},"peerDependencies":{"@itwin/appui-abstract":"workspace:*","@itwin/core-bentley":"workspace:*","@itwin/core-common":"workspace:*","@itwin/core-geometry":"workspace:*","@itwin/core-orbitgt":"workspace:*","@itwin/core-quantity":"workspace:*","@itwin/ecschema-metadata":"workspace:*","@itwin/ecschema-rpcinterface-common":"workspace:*"},"//devDependencies":["NOTE: All peerDependencies should also be listed as devDependencies since peerDependencies are not considered by npm install","NOTE: All tools used by scripts in this package must be listed as devDependencies"],"devDependencies":{"@bentley/aec-units-schema":"^1.0.3","@bentley/formats-schema":"^1.0.0","@bentley/units-schema":"^1.0.12","@itwin/appui-abstract":"workspace:*","@itwin/build-tools":"workspace:*","@itwin/core-bentley":"workspace:*","@itwin/core-common":"workspace:*","@itwin/core-geometry":"workspace:*","@itwin/core-orbitgt":"workspace:*","@itwin/core-quantity":"workspace:*","@itwin/ecschema-metadata":"workspace:*","@itwin/ecschema-rpcinterface-common":"workspace:*","@itwin/object-storage-core":"^3.0.4","@itwin/eslint-plugin":"^6.0.0","@types/node":"~20.17.0","@types/sinon":"^17.0.2","@vitest/browser-playwright":"^4.1.10","@vitest/coverage-v8":"^4.1.10","cpx2":"^8.0.0","eslint":"^9.31.0","playwright":"~1.56.1","rimraf":"^6.0.1","sinon":"^17.0.2","typescript":"~5.6.2","vite":"^6.4.4","vitest":"^4.1.10"},"//dependencies":["NOTE: these dependencies should be only for things that DO NOT APPEAR IN THE API","NOTE: core-frontend should remain UI technology agnostic, so no react/angular dependencies are allowed"],"dependencies":{"@itwin/core-i18n":"workspace:*","@itwin/webgl-compatibility":"workspace:*","@loaders.gl/core":"^4.4.5","@loaders.gl/draco":"^4.4.5","fuse.js":"^3.3.0","wms-capabilities":"0.6.0"}}');
337632
+ module.exports = /*#__PURE__*/JSON.parse('{"name":"@itwin/core-frontend","version":"5.15.0-dev.17","description":"iTwin.js frontend components","main":"lib/cjs/core-frontend.js","module":"lib/esm/core-frontend.js","typings":"lib/cjs/core-frontend","license":"MIT","scripts":{"build":"npm run -s copy:public && npm run -s build:cjs && npm run -s build:esm && npm run -s build:workers && npm run -s copy:draco","build:cjs":"npm run -s copy:js:cjs && tsc 1>&2 --outDir lib/cjs","build:esm":"npm run -s copy:js:esm && tsc 1>&2 --module ES2022 --outDir lib/esm","clean":"rimraf -g lib .rush/temp/package-deps*.json","copy:public":"cpx \\"./src/public/**/*\\" ./lib/public","copy:js:cjs":"cpx \\"./src/**/*.js\\" ./lib/cjs","copy:js:esm":"cpx \\"./src/**/*.js\\" ./lib/esm","copy:draco":"cpx \\"./node_modules/@loaders.gl/draco/dist/libs/*\\" ./lib/public/scripts","docs":"betools docs --json=../../generated-docs/core/core-frontend/file.json --tsIndexFile=./core-frontend.ts --onlyJson --excludes=webgl/**/*,**/map/*.d.ts,**/tile/*.d.ts,**/*-css.ts && npm run -s extract","extract":"betools extract --fileExt=ts --extractFrom=./src/test/example-code --recursive --out=../../generated-docs/extract","extract-api":"betools extract-api --entry=core-frontend && npm run extract-extension-api","extract-extension-api":"eslint --no-inline-config -c extraction.eslint.config.js \\"./src/**/*.ts\\" 1>&2","lint":"eslint \\"./src/**/*.ts\\" 1>&2","lint-fix":"eslint --fix -f visualstudio \\"./src/**/*.ts\\" 1>&2","lint-deprecation":"eslint --fix -f visualstudio --no-inline-config -c ../../common/config/eslint/eslint.config.deprecation-policy.js \\"./src/**/*.ts\\"","pseudolocalize":"betools pseudolocalize --englishDir ./src/public/locales/en --out ./public/locales/en-PSEUDO","test":"npm run build:test-worker && vitest --run","cover":"npm run build:test-worker && vitest --run","build:test-worker":"vite build --config ./src/test/worker/vite.config.mts 1>&2","build:workers":"rimraf lib/workers/webpack && vite build --config ./src/workers/ImdlParser/vite.config.mts 1>&2"},"repository":{"type":"git","url":"https://github.com/iTwin/itwinjs-core.git","directory":"core/frontend"},"keywords":["Bentley","BIM","iModel","digital-twin","iTwin"],"author":{"name":"Bentley Systems, Inc.","url":"http://www.bentley.com"},"peerDependencies":{"@itwin/appui-abstract":"workspace:*","@itwin/core-bentley":"workspace:*","@itwin/core-common":"workspace:*","@itwin/core-geometry":"workspace:*","@itwin/core-orbitgt":"workspace:*","@itwin/core-quantity":"workspace:*","@itwin/ecschema-metadata":"workspace:*","@itwin/ecschema-rpcinterface-common":"workspace:*"},"//devDependencies":["NOTE: All peerDependencies should also be listed as devDependencies since peerDependencies are not considered by npm install","NOTE: All tools used by scripts in this package must be listed as devDependencies"],"devDependencies":{"@bentley/aec-units-schema":"^1.0.3","@bentley/formats-schema":"^1.0.0","@bentley/units-schema":"^1.0.12","@itwin/appui-abstract":"workspace:*","@itwin/build-tools":"workspace:*","@itwin/core-bentley":"workspace:*","@itwin/core-common":"workspace:*","@itwin/core-geometry":"workspace:*","@itwin/core-orbitgt":"workspace:*","@itwin/core-quantity":"workspace:*","@itwin/ecschema-metadata":"workspace:*","@itwin/ecschema-rpcinterface-common":"workspace:*","@itwin/object-storage-core":"^3.0.4","@itwin/eslint-plugin":"^6.0.0","@types/node":"~20.17.0","@types/sinon":"^17.0.2","@vitest/browser-playwright":"^4.1.10","@vitest/coverage-v8":"^4.1.10","cpx2":"^8.0.0","eslint":"^9.31.0","playwright":"~1.56.1","rimraf":"^6.0.1","sinon":"^17.0.2","typescript":"~5.6.2","vite":"^6.4.4","vitest":"^4.1.10"},"//dependencies":["NOTE: these dependencies should be only for things that DO NOT APPEAR IN THE API","NOTE: core-frontend should remain UI technology agnostic, so no react/angular dependencies are allowed"],"dependencies":{"@itwin/core-i18n":"workspace:*","@itwin/webgl-compatibility":"workspace:*","@loaders.gl/core":"^4.4.5","@loaders.gl/draco":"^4.4.5","fuse.js":"^3.3.0","wms-capabilities":"0.6.0"}}');
337713
337633
 
337714
337634
  /***/ },
337715
337635
 
@@ -337770,36 +337690,6 @@ module.exports = /*#__PURE__*/JSON.parse('{"version":"01.00.00","sourceEcSchemaV
337770
337690
  /******/ return getter;
337771
337691
  /******/ };
337772
337692
  /******/
337773
- /******/ /* webpack/runtime/create fake namespace object */
337774
- /******/ (() => {
337775
- /******/ const getProto = Object.getPrototypeOf;
337776
- /******/ let leafPrototypes;
337777
- /******/ // create a fake namespace object
337778
- /******/ // mode & 1: value is a module id, require it
337779
- /******/ // mode & 2: merge all properties of value into the ns
337780
- /******/ // mode & 4: return value when already ns object
337781
- /******/ // mode & 16: return value when it's Promise-like
337782
- /******/ // mode & 8|1: behave like require
337783
- /******/ __webpack_require__.t = function(value, mode) {
337784
- /******/ if(mode & 1) value = this(value);
337785
- /******/ if(mode & 8) return value;
337786
- /******/ if(typeof value === 'object' && value) {
337787
- /******/ if((mode & 4) && value.__esModule) return value;
337788
- /******/ if((mode & 16) && typeof value.then === 'function') return value;
337789
- /******/ }
337790
- /******/ const ns = Object.create(null);
337791
- /******/ __webpack_require__.r(ns);
337792
- /******/ const def = {};
337793
- /******/ leafPrototypes = leafPrototypes || [null, getProto({}), getProto([]), getProto(getProto)];
337794
- /******/ for(var current = mode & 2 && value; (typeof current == 'object' || typeof current == 'function') && !~leafPrototypes.indexOf(current); current = getProto(current)) {
337795
- /******/ Object.getOwnPropertyNames(current).forEach((key) => (def[key] = () => (value[key])));
337796
- /******/ }
337797
- /******/ def['default'] = () => (value);
337798
- /******/ __webpack_require__.d(ns, def);
337799
- /******/ return ns;
337800
- /******/ };
337801
- /******/ })();
337802
- /******/
337803
337693
  /******/ /* webpack/runtime/define property getters */
337804
337694
  /******/ // define getter/value functions for harmony exports
337805
337695
  /******/ __webpack_require__.d = (exports, definition) => {