@itwin/core-i18n 5.15.0-dev.7 → 5.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -15011,6 +15011,7 @@ function assert(condition, message) {
15011
15011
  "use strict";
15012
15012
  __webpack_require__.r(__webpack_exports__);
15013
15013
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
15014
+ /* harmony export */ BeAsyncEvent: () => (/* binding */ BeAsyncEvent),
15014
15015
  /* harmony export */ BeEvent: () => (/* binding */ BeEvent),
15015
15016
  /* harmony export */ BeEventList: () => (/* binding */ BeEventList),
15016
15017
  /* harmony export */ BeUiEvent: () => (/* binding */ BeUiEvent),
@@ -15098,8 +15099,13 @@ class BeEvent {
15098
15099
  dropped = true;
15099
15100
  }
15100
15101
  else {
15102
+ const listener = context.listener;
15103
+ if (context.once) {
15104
+ context.listener = undefined;
15105
+ dropped = true;
15106
+ }
15101
15107
  try {
15102
- context.listener.apply(context.scope, args);
15108
+ listener.apply(context.scope, args);
15103
15109
  }
15104
15110
  catch (e) {
15105
15111
  _UnexpectedErrors__WEBPACK_IMPORTED_MODULE_0__.UnexpectedErrors.handle(e);
@@ -15108,10 +15114,6 @@ class BeEvent {
15108
15114
  // listener was removed during its own callback
15109
15115
  dropped = true;
15110
15116
  }
15111
- else if (context.once) {
15112
- context.listener = undefined;
15113
- dropped = true;
15114
- }
15115
15117
  }
15116
15118
  }
15117
15119
  this._emitDepth--;
@@ -15155,8 +15157,6 @@ class BeUiEvent extends BeEvent {
15155
15157
  */
15156
15158
  class BeUnorderedEvent {
15157
15159
  _listeners = new Set();
15158
- _emitDepth = 0;
15159
- _hasTombstones = false;
15160
15160
  /** The number of listeners currently subscribed to the event.
15161
15161
  * @note During `raiseEvent()`, this may include listeners that have been removed or are one-shot
15162
15162
  * but are awaiting deferred cleanup. The count is accurate outside of `raiseEvent()`.
@@ -15186,43 +15186,26 @@ class BeUnorderedEvent {
15186
15186
  }
15187
15187
  /** Remove a specific context entry, deferring during emit. */
15188
15188
  _removeCtx(ctx) {
15189
- if (this._emitDepth > 0) {
15190
- ctx.listener = undefined; // tombstone for deferred cleanup
15191
- this._hasTombstones = true;
15192
- }
15193
- else {
15194
- this._listeners.delete(ctx);
15195
- }
15189
+ this._listeners.delete(ctx);
15196
15190
  }
15197
15191
  /**
15198
15192
  * Raises the event by calling each registered listener with the supplied arguments.
15199
15193
  * @param args This method takes any number of parameters and passes them through to the listeners.
15200
15194
  */
15201
15195
  raiseEvent(...args) {
15202
- this._emitDepth++;
15203
15196
  for (const ctx of this._listeners) {
15204
15197
  if (!ctx.listener) {
15205
15198
  continue;
15206
15199
  }
15200
+ if (ctx.once) {
15201
+ this._listeners.delete(ctx);
15202
+ }
15207
15203
  try {
15208
15204
  ctx.listener.apply(ctx.scope, args);
15209
15205
  }
15210
15206
  catch (e) {
15211
15207
  _UnexpectedErrors__WEBPACK_IMPORTED_MODULE_0__.UnexpectedErrors.handle(e);
15212
15208
  }
15213
- if (ctx.listener && ctx.once) {
15214
- ctx.listener = undefined;
15215
- this._hasTombstones = true;
15216
- }
15217
- }
15218
- this._emitDepth--;
15219
- // Only clean up tombstoned entries when we're back at the outermost emit
15220
- if (this._hasTombstones && this._emitDepth === 0) {
15221
- this._hasTombstones = false;
15222
- for (const ctx of this._listeners) {
15223
- if (ctx.listener === undefined)
15224
- this._listeners.delete(ctx);
15225
- }
15226
15209
  }
15227
15210
  }
15228
15211
  /** Clear all listeners from this BeUnorderedEvent.
@@ -15238,6 +15221,108 @@ class BeUnorderedUiEvent extends BeUnorderedEvent {
15238
15221
  /** Raises event with single strongly typed argument. */
15239
15222
  emit(args) { this.raiseEvent(args); }
15240
15223
  }
15224
+ /**
15225
+ * Manages a set of *listeners* for a particular event and notifies them when the event is raised.
15226
+ * Each listener is async (return a Promise<void>). The listeners may be invoked in series
15227
+ * or concurrently depending on the configuration of the instance.
15228
+ *
15229
+ * Like [[BeUnorderedEvent]], this class uses a `Set` internally to support more performant removal
15230
+ * of old listeners. When a listener is removed during emit, it is marked for deferred removal instead
15231
+ * of mutating the set immediately. Despite the "unordered" implication, items in a `Set` are enumerated
15232
+ * in insertion order, which means that this class invokes the listeners in insertion order.
15233
+ *
15234
+ * Listeners are managed exclusively through the disposal closure returned by [[addListener]] and
15235
+ * [[addOnce]]. There is no `removeListener` or `has` method — callers must capture the returned
15236
+ * closure to unsubscribe.
15237
+ * @beta
15238
+ */
15239
+ class BeAsyncEvent {
15240
+ _listeners = new Set();
15241
+ _concurrent = false;
15242
+ _promiseRejectionIsUnexpected = false;
15243
+ constructor(options) {
15244
+ if (options?.concurrent)
15245
+ this._concurrent = true;
15246
+ if (options?.promiseRejectionIsUnexpected)
15247
+ this._promiseRejectionIsUnexpected = true;
15248
+ }
15249
+ /** The number of listeners currently subscribed to the event.
15250
+ * @note During `raiseEvent()`, this may include listeners that have been removed or are one-shot
15251
+ * but are awaiting deferred cleanup. The count is accurate outside of `raiseEvent()`.
15252
+ */
15253
+ get numberOfListeners() { return this._listeners.size; }
15254
+ /**
15255
+ * Registers a Listener to be executed whenever this event is raised.
15256
+ * @param listener The function to be executed when the event is raised.
15257
+ * @param scope An optional object scope to serve as the 'this' pointer when listener is invoked.
15258
+ * @returns A function that will remove this event listener in O(1).
15259
+ */
15260
+ addListener(listener, scope) {
15261
+ const ctx = { listener, scope, once: false };
15262
+ this._listeners.add(ctx);
15263
+ return () => this._removeCtx(ctx);
15264
+ }
15265
+ /**
15266
+ * Registers a callback function to be executed *only once* when the event is raised.
15267
+ * @param listener The function to be executed once when the event is raised.
15268
+ * @param scope An optional object scope to serve as the `this` pointer in which the listener function will execute.
15269
+ * @returns A function that will remove this event listener in O(1).
15270
+ */
15271
+ addOnce(listener, scope) {
15272
+ const ctx = { listener, scope, once: true };
15273
+ this._listeners.add(ctx);
15274
+ return () => this._removeCtx(ctx);
15275
+ }
15276
+ /** Remove a specific context entry, deferring during emit. */
15277
+ _removeCtx(ctx) {
15278
+ this._listeners.delete(ctx);
15279
+ }
15280
+ /**
15281
+ * Raises the event by calling each registered listener with the supplied arguments.
15282
+ *
15283
+ * See [[BeAsyncEventOptions]] for options that control the behavior of this method.
15284
+ *
15285
+ * @param args This method takes any number of parameters and passes them through to the listeners.
15286
+ * @returns A Promise that settles when the event invocation is complete.
15287
+ */
15288
+ async raiseEvent(...args) {
15289
+ const promises = [];
15290
+ // Wrapper to ensure that an exception thrown immediately by a listener is captured as a rejected promise rather than
15291
+ // allowed to propagate as an exception. A well-behaved Promise-returning function should never throw, but
15292
+ // this defends against the poorly-behaved ones. In Node 23+ we could use `Promise.try` instead.
15293
+ const invoke = async (ctx, args) => {
15294
+ if (!ctx.listener)
15295
+ return;
15296
+ await ctx.listener.apply(ctx.scope, args);
15297
+ };
15298
+ for (const ctx of this._listeners) {
15299
+ if (!ctx.listener)
15300
+ continue;
15301
+ if (ctx.once) {
15302
+ // Set guarantees this is safe during iteration.
15303
+ this._listeners.delete(ctx);
15304
+ }
15305
+ let promise = invoke(ctx, args);
15306
+ if (this._promiseRejectionIsUnexpected)
15307
+ promise = promise.catch(reason => _UnexpectedErrors__WEBPACK_IMPORTED_MODULE_0__.UnexpectedErrors.handle(reason));
15308
+ if (this._concurrent)
15309
+ promises.push(promise);
15310
+ else
15311
+ await promise;
15312
+ }
15313
+ if (this._concurrent) {
15314
+ const result = await Promise.allSettled(promises);
15315
+ const firstRejection = result.find(r => r.status === "rejected");
15316
+ if (firstRejection)
15317
+ throw firstRejection.reason;
15318
+ }
15319
+ }
15320
+ /** Clear all listeners from this BeAsyncEvent.
15321
+ * @note If called during `raiseEvent`, remaining listeners in the current iteration are skipped
15322
+ * immediately rather than being tombstoned.
15323
+ */
15324
+ clear() { this._listeners.clear(); }
15325
+ }
15241
15326
  /**
15242
15327
  * A list of BeEvent objects, accessible by an event name.
15243
15328
  * This class may be used instead of explicitly declaring each BeEvent as a member of a containing class.
@@ -17794,16 +17879,18 @@ var Id64;
17794
17879
  Id64.getFirst = getFirst;
17795
17880
  /** Return the number of [[Id64String]]s represented by an [[Id64Arg]]. */
17796
17881
  function sizeOf(arg) {
17797
- return typeof arg === "string" ? 1 : (Array.isArray(arg) ? arg.length : arg.size);
17882
+ return typeof arg === "string" ? 1 : "size" in arg ? arg.size : arg.length;
17798
17883
  }
17799
17884
  Id64.sizeOf = sizeOf;
17800
17885
  /** Returns true if the [[Id64Arg]] contains the specified Id. */
17801
17886
  function has(arg, id) {
17802
- if (typeof arg === "string")
17887
+ if (typeof arg === "string") {
17803
17888
  return arg === id;
17804
- if (Array.isArray(arg))
17805
- return -1 !== arg.indexOf(id);
17806
- return arg.has(id);
17889
+ }
17890
+ if ("has" in arg) {
17891
+ return arg.has(id);
17892
+ }
17893
+ return -1 !== arg.indexOf(id);
17807
17894
  }
17808
17895
  Id64.has = has;
17809
17896
  /** The string representation of an invalid Id. */
@@ -21873,6 +21960,7 @@ class YieldManager {
21873
21960
  __webpack_require__.r(__webpack_exports__);
21874
21961
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
21875
21962
  /* harmony export */ AbandonedError: () => (/* reexport safe */ _OneAtATimeAction__WEBPACK_IMPORTED_MODULE_22__.AbandonedError),
21963
+ /* harmony export */ BeAsyncEvent: () => (/* reexport safe */ _BeEvent__WEBPACK_IMPORTED_MODULE_2__.BeAsyncEvent),
21876
21964
  /* harmony export */ BeDuration: () => (/* reexport safe */ _Time__WEBPACK_IMPORTED_MODULE_30__.BeDuration),
21877
21965
  /* harmony export */ BeEvent: () => (/* reexport safe */ _BeEvent__WEBPACK_IMPORTED_MODULE_2__.BeEvent),
21878
21966
  /* harmony export */ BeEventList: () => (/* reexport safe */ _BeEvent__WEBPACK_IMPORTED_MODULE_2__.BeEventList),
@@ -22325,7 +22413,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
22325
22413
  exports.ITwinLocalization = void 0;
22326
22414
  const i18next_1 = __importDefault(__webpack_require__(/*! i18next */ "../../common/temp/node_modules/.pnpm/i18next@21.10.0/node_modules/i18next/dist/cjs/i18next.js"));
22327
22415
  const i18next_browser_languagedetector_1 = __importDefault(__webpack_require__(/*! i18next-browser-languagedetector */ "../../common/temp/node_modules/.pnpm/i18next-browser-languagedetector@6.1.8/node_modules/i18next-browser-languagedetector/dist/cjs/i18nextBrowserLanguageDetector.js"));
22328
- const i18next_http_backend_1 = __importDefault(__webpack_require__(/*! i18next-http-backend */ "../../common/temp/node_modules/.pnpm/i18next-http-backend@3.0.6/node_modules/i18next-http-backend/esm/index.js"));
22416
+ const i18next_http_backend_1 = __importDefault(__webpack_require__(/*! i18next-http-backend */ "../../common/temp/node_modules/.pnpm/i18next-http-backend@4.0.5/node_modules/i18next-http-backend/esm/index.js"));
22329
22417
  const core_bentley_1 = __webpack_require__(/*! @itwin/core-bentley */ "../bentley/lib/esm/core-bentley.js");
22330
22418
  const DEFAULT_MAX_RETRIES = 1; // a low number prevents wasted time and potential timeouts when requesting localization files throws an error
22331
22419
  /** Supplies localizations for iTwin.js
@@ -22807,534 +22895,377 @@ module.exports = _unsupportedIterableToArray, module.exports.__esModule = true,
22807
22895
 
22808
22896
  /***/ },
22809
22897
 
22810
- /***/ "../../common/temp/node_modules/.pnpm/i18next-http-backend@3.0.6/node_modules/i18next-http-backend/esm/index.js"
22898
+ /***/ "../../common/temp/node_modules/.pnpm/i18next-http-backend@4.0.5/node_modules/i18next-http-backend/esm/index.js"
22811
22899
  /*!**********************************************************************************************************************!*\
22812
- !*** ../../common/temp/node_modules/.pnpm/i18next-http-backend@3.0.6/node_modules/i18next-http-backend/esm/index.js ***!
22900
+ !*** ../../common/temp/node_modules/.pnpm/i18next-http-backend@4.0.5/node_modules/i18next-http-backend/esm/index.js ***!
22813
22901
  \**********************************************************************************************************************/
22814
22902
  (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
22815
22903
 
22816
22904
  "use strict";
22817
22905
  __webpack_require__.r(__webpack_exports__);
22818
22906
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
22819
- /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
22907
+ /* harmony export */ "default": () => (/* binding */ Backend)
22820
22908
  /* harmony export */ });
22821
- /* 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");
22822
- /* 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");
22823
- 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); }
22824
- 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; }
22825
- 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; }
22826
- function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
22827
- 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); } }
22828
- function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
22829
- 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; }
22830
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
22831
- 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); }
22832
- ;
22833
-
22834
- var getDefaults = function getDefaults() {
22835
- return {
22836
- loadPath: '/locales/{{lng}}/{{ns}}.json',
22837
- addPath: '/locales/add/{{lng}}/{{ns}}',
22838
- parse: function parse(data) {
22839
- return JSON.parse(data);
22840
- },
22841
- stringify: JSON.stringify,
22842
- parsePayload: function parsePayload(namespace, key, fallbackValue) {
22843
- return _defineProperty({}, key, fallbackValue || '');
22844
- },
22845
- parseLoadPayload: function parseLoadPayload(languages, namespaces) {
22846
- return undefined;
22847
- },
22848
- request: _request_js__WEBPACK_IMPORTED_MODULE_1__["default"],
22849
- reloadInterval: typeof window !== 'undefined' ? false : 60 * 60 * 1000,
22850
- customHeaders: {},
22851
- queryStringParams: {},
22852
- crossDomain: false,
22853
- withCredentials: false,
22854
- overrideMimeType: false,
22855
- requestOptions: {
22856
- mode: 'cors',
22857
- credentials: 'same-origin',
22858
- cache: 'default'
22859
- }
22860
- };
22861
- };
22862
- var Backend = function () {
22863
- function Backend(services) {
22864
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
22865
- var allOptions = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
22866
- _classCallCheck(this, Backend);
22867
- this.services = services;
22868
- this.options = options;
22869
- this.allOptions = allOptions;
22870
- this.type = 'backend';
22871
- this.init(services, options, allOptions);
22872
- }
22873
- return _createClass(Backend, [{
22874
- key: "init",
22875
- value: function init(services) {
22876
- var _this = this;
22877
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
22878
- var allOptions = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
22879
- this.services = services;
22880
- this.options = _objectSpread(_objectSpread(_objectSpread({}, getDefaults()), this.options || {}), options);
22881
- this.allOptions = allOptions;
22882
- if (this.services && this.options.reloadInterval) {
22883
- var timer = setInterval(function () {
22884
- return _this.reload();
22885
- }, this.options.reloadInterval);
22886
- if (_typeof(timer) === 'object' && typeof timer.unref === 'function') timer.unref();
22887
- }
22888
- }
22889
- }, {
22890
- key: "readMulti",
22891
- value: function readMulti(languages, namespaces, callback) {
22892
- this._readAny(languages, languages, namespaces, namespaces, callback);
22893
- }
22894
- }, {
22895
- key: "read",
22896
- value: function read(language, namespace, callback) {
22897
- this._readAny([language], language, [namespace], namespace, callback);
22898
- }
22899
- }, {
22900
- key: "_readAny",
22901
- value: function _readAny(languages, loadUrlLanguages, namespaces, loadUrlNamespaces, callback) {
22902
- var _this2 = this;
22903
- var loadPath = this.options.loadPath;
22904
- if (typeof this.options.loadPath === 'function') {
22905
- loadPath = this.options.loadPath(languages, namespaces);
22906
- }
22907
- loadPath = (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.makePromise)(loadPath);
22908
- loadPath.then(function (resolvedLoadPath) {
22909
- if (!resolvedLoadPath) return callback(null, {});
22910
- var url = (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.interpolateUrl)(resolvedLoadPath, {
22911
- lng: languages.join('+'),
22912
- ns: namespaces.join('+')
22913
- });
22914
- if (url == null) {
22915
- var safeLngs = languages.map(_utils_js__WEBPACK_IMPORTED_MODULE_0__.sanitizeLogValue).join(', ');
22916
- var safeNss = namespaces.map(_utils_js__WEBPACK_IMPORTED_MODULE_0__.sanitizeLogValue).join(', ');
22917
- return callback(new Error('i18next-http-backend: unsafe lng/ns value — refusing to build request URL for languages=[' + safeLngs + '] namespaces=[' + safeNss + ']'), false);
22918
- }
22919
- _this2.loadUrl(url, callback, loadUrlLanguages, loadUrlNamespaces);
22920
- });
22921
- }
22922
- }, {
22923
- key: "loadUrl",
22924
- value: function loadUrl(url, callback, languages, namespaces) {
22925
- var _this3 = this;
22926
- var lng = typeof languages === 'string' ? [languages] : languages;
22927
- var ns = typeof namespaces === 'string' ? [namespaces] : namespaces;
22928
- var payload = this.options.parseLoadPayload(lng, ns);
22929
- var safeUrl = (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.sanitizeLogValue)((0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.redactUrlCredentials)(url));
22930
- this.options.request(this.options, url, payload, function (err, res) {
22931
- if (res && (res.status >= 500 && res.status < 600 || !res.status)) return callback('failed loading ' + safeUrl + '; status code: ' + res.status, true);
22932
- if (res && res.status >= 400 && res.status < 500) return callback('failed loading ' + safeUrl + '; status code: ' + res.status, false);
22933
- if (!res && err && err.message) {
22934
- var errorMessage = err.message.toLowerCase();
22935
- var isNetworkError = ['failed', 'fetch', 'network', 'load'].find(function (term) {
22936
- return errorMessage.indexOf(term) > -1;
22937
- });
22938
- if (isNetworkError) {
22939
- return callback('failed loading ' + safeUrl + ': ' + (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.sanitizeLogValue)(err.message), true);
22940
- }
22941
- }
22942
- if (err) return callback(err, false);
22943
- var ret, parseErr;
22944
- try {
22945
- if (typeof res.data === 'string') {
22946
- ret = _this3.options.parse(res.data, languages, namespaces);
22947
- } else {
22948
- ret = res.data;
22949
- }
22950
- } catch (e) {
22951
- parseErr = 'failed parsing ' + safeUrl + ' to json';
22952
- }
22953
- if (parseErr) return callback(parseErr, false);
22954
- callback(null, ret);
22955
- });
22956
- }
22957
- }, {
22958
- key: "create",
22959
- value: function create(languages, namespace, key, fallbackValue, callback) {
22960
- var _this4 = this;
22961
- if (!this.options.addPath) return;
22962
- if (typeof languages === 'string') languages = [languages];
22963
- var payload = this.options.parsePayload(namespace, key, fallbackValue);
22964
- var finished = 0;
22965
- var dataArray = [];
22966
- var resArray = [];
22967
- languages.forEach(function (lng) {
22968
- var addPath = _this4.options.addPath;
22969
- if (typeof _this4.options.addPath === 'function') {
22970
- addPath = _this4.options.addPath(lng, namespace);
22971
- }
22972
- var url = (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.interpolateUrl)(addPath, {
22973
- lng: lng,
22974
- ns: namespace
22975
- });
22976
- if (url == null) {
22977
- finished += 1;
22978
- if (callback && finished === languages.length) callback(dataArray, resArray);
22979
- return;
22980
- }
22981
- _this4.options.request(_this4.options, url, payload, function (data, res) {
22982
- finished += 1;
22983
- dataArray.push(data);
22984
- resArray.push(res);
22985
- if (finished === languages.length) {
22986
- if (typeof callback === 'function') callback(dataArray, resArray);
22987
- }
22988
- });
22989
- });
22990
- }
22991
- }, {
22992
- key: "reload",
22993
- value: function reload() {
22994
- var _this5 = this;
22995
- var _this$services = this.services,
22996
- backendConnector = _this$services.backendConnector,
22997
- languageUtils = _this$services.languageUtils,
22998
- logger = _this$services.logger;
22999
- var currentLanguage = backendConnector.language;
23000
- if (currentLanguage && currentLanguage.toLowerCase() === 'cimode') return;
23001
- var toLoad = [];
23002
- var append = function append(lng) {
23003
- var lngs = languageUtils.toResolveHierarchy(lng);
23004
- lngs.forEach(function (l) {
23005
- if (toLoad.indexOf(l) < 0) toLoad.push(l);
23006
- });
23007
- };
23008
- append(currentLanguage);
23009
- if (this.allOptions.preload) this.allOptions.preload.forEach(function (l) {
23010
- return append(l);
23011
- });
23012
- toLoad.forEach(function (lng) {
23013
- _this5.allOptions.ns.forEach(function (ns) {
23014
- backendConnector.read(lng, ns, 'read', null, null, function (err, data) {
23015
- if (err) logger.warn("loading namespace ".concat(ns, " for language ").concat(lng, " failed"), err);
23016
- if (!err && data) logger.log("loaded namespace ".concat(ns, " for language ").concat(lng), data);
23017
- backendConnector.loaded("".concat(lng, "|").concat(ns), err, data);
23018
- });
23019
- });
23020
- });
23021
- }
23022
- }]);
23023
- }();
23024
- Backend.type = 'backend';
23025
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Backend);
23026
-
23027
- /***/ },
23028
-
23029
- /***/ "../../common/temp/node_modules/.pnpm/i18next-http-backend@3.0.6/node_modules/i18next-http-backend/esm/request.js"
23030
- /*!************************************************************************************************************************!*\
23031
- !*** ../../common/temp/node_modules/.pnpm/i18next-http-backend@3.0.6/node_modules/i18next-http-backend/esm/request.js ***!
23032
- \************************************************************************************************************************/
23033
- (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
23034
-
23035
- "use strict";
23036
- __webpack_require__.r(__webpack_exports__);
23037
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
23038
- /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
23039
- /* harmony export */ });
23040
- /* 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");
23041
- 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; }
23042
- 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; }
23043
- 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; }
23044
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
23045
- 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); }
23046
- 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); }
23047
- ;
23048
- var fetchApi = typeof fetch === 'function' ? fetch : undefined;
23049
- if (typeof __webpack_require__.g !== 'undefined' && __webpack_require__.g.fetch) {
23050
- fetchApi = __webpack_require__.g.fetch;
23051
- } else if (typeof window !== 'undefined' && window.fetch) {
23052
- fetchApi = window.fetch;
23053
- }
23054
- var XmlHttpRequestApi;
23055
- if ((0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.hasXMLHttpRequest)()) {
23056
- if (typeof __webpack_require__.g !== 'undefined' && __webpack_require__.g.XMLHttpRequest) {
23057
- XmlHttpRequestApi = __webpack_require__.g.XMLHttpRequest;
23058
- } else if (typeof window !== 'undefined' && window.XMLHttpRequest) {
23059
- XmlHttpRequestApi = window.XMLHttpRequest;
23060
- }
23061
- }
23062
- var ActiveXObjectApi;
23063
- if (typeof ActiveXObject === 'function') {
23064
- if (typeof __webpack_require__.g !== 'undefined' && __webpack_require__.g.ActiveXObject) {
23065
- ActiveXObjectApi = __webpack_require__.g.ActiveXObject;
23066
- } else if (typeof window !== 'undefined' && window.ActiveXObject) {
23067
- ActiveXObjectApi = window.ActiveXObject;
23068
- }
23069
- }
23070
- if (typeof fetchApi !== 'function') fetchApi = undefined;
23071
- if (!fetchApi && !XmlHttpRequestApi && !ActiveXObjectApi) {
23072
- try {
23073
- __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) {
23074
- fetchApi = mod.default;
23075
- }).catch(function () {});
23076
- } catch (e) {}
23077
- }
23078
- var UNSAFE_KEYS = ['__proto__', 'constructor', 'prototype'];
23079
- var addQueryString = function addQueryString(url, params) {
23080
- if (params && _typeof(params) === 'object') {
23081
- var queryString = '';
23082
- for (var _i = 0, _Object$keys = Object.keys(params); _i < _Object$keys.length; _i++) {
23083
- var paramName = _Object$keys[_i];
23084
- if (UNSAFE_KEYS.indexOf(paramName) > -1) continue;
23085
- queryString += '&' + encodeURIComponent(paramName) + '=' + encodeURIComponent(params[paramName]);
23086
- }
23087
- if (!queryString) return url;
23088
- url = url + (url.indexOf('?') !== -1 ? '&' : '?') + queryString.slice(1);
23089
- }
23090
- return url;
23091
- };
23092
- var fetchIt = function fetchIt(url, fetchOptions, callback, altFetch) {
23093
- var resolver = function resolver(response) {
23094
- if (!response.ok) return callback(response.statusText || 'Error', {
23095
- status: response.status
23096
- });
23097
- response.text().then(function (data) {
23098
- callback(null, {
23099
- status: response.status,
23100
- data: data
23101
- });
23102
- }).catch(callback);
23103
- };
23104
- if (altFetch) {
23105
- var altResponse = altFetch(url, fetchOptions);
23106
- if (altResponse instanceof Promise) {
23107
- altResponse.then(resolver).catch(callback);
23108
- return;
23109
- }
23110
- }
23111
- if (typeof fetch === 'function') {
23112
- fetch(url, fetchOptions).then(resolver).catch(callback);
23113
- } else {
23114
- fetchApi(url, fetchOptions).then(resolver).catch(callback);
23115
- }
23116
- };
23117
- var requestWithFetch = function requestWithFetch(options, url, payload, callback) {
23118
- if (options.queryStringParams) {
23119
- url = addQueryString(url, options.queryStringParams);
23120
- }
23121
- var headers = _objectSpread({}, typeof options.customHeaders === 'function' ? options.customHeaders() : options.customHeaders);
23122
- 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) {
23123
- 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, ")");
23124
- }
23125
- if (payload) headers['Content-Type'] = 'application/json';
23126
- var reqOptions = typeof options.requestOptions === 'function' ? options.requestOptions(payload) : options.requestOptions;
23127
- var fetchOptions = _objectSpread({
23128
- method: payload ? 'POST' : 'GET',
23129
- body: payload ? options.stringify(payload) : undefined,
23130
- headers: headers
23131
- }, options._omitFetchOptions ? {} : reqOptions);
23132
- var altFetch = typeof options.alternateFetch === 'function' && options.alternateFetch.length >= 1 ? options.alternateFetch : undefined;
23133
- try {
23134
- fetchIt(url, fetchOptions, callback, altFetch);
23135
- } catch (e) {
23136
- if (!reqOptions || Object.keys(reqOptions).length === 0 || !e.message || e.message.indexOf('not implemented') < 0) {
23137
- return callback(e);
23138
- }
23139
- try {
23140
- Object.keys(reqOptions).forEach(function (opt) {
23141
- delete fetchOptions[opt];
23142
- });
23143
- fetchIt(url, fetchOptions, callback, altFetch);
23144
- options._omitFetchOptions = true;
23145
- } catch (err) {
23146
- callback(err);
23147
- }
23148
- }
23149
- };
23150
- var requestWithXmlHttpRequest = function requestWithXmlHttpRequest(options, url, payload, callback) {
23151
- if (payload && _typeof(payload) === 'object') {
23152
- payload = addQueryString('', payload).slice(1);
23153
- }
23154
- if (options.queryStringParams) {
23155
- url = addQueryString(url, options.queryStringParams);
23156
- }
23157
- try {
23158
- var x = XmlHttpRequestApi ? new XmlHttpRequestApi() : new ActiveXObjectApi('MSXML2.XMLHTTP.3.0');
23159
- x.open(payload ? 'POST' : 'GET', url, 1);
23160
- if (!options.crossDomain) {
23161
- x.setRequestHeader('X-Requested-With', 'XMLHttpRequest');
23162
- }
23163
- x.withCredentials = !!options.withCredentials;
23164
- if (payload) {
23165
- x.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
23166
- }
23167
- if (x.overrideMimeType) {
23168
- x.overrideMimeType('application/json');
23169
- }
23170
- var h = options.customHeaders;
23171
- h = typeof h === 'function' ? h() : h;
23172
- if (h) {
23173
- for (var _i2 = 0, _Object$keys2 = Object.keys(h); _i2 < _Object$keys2.length; _i2++) {
23174
- var i = _Object$keys2[_i2];
23175
- if (UNSAFE_KEYS.indexOf(i) > -1) continue;
23176
- x.setRequestHeader(i, h[i]);
23177
- }
23178
- }
23179
- x.onreadystatechange = function () {
23180
- x.readyState > 3 && callback(x.status >= 400 ? x.statusText : null, {
23181
- status: x.status,
23182
- data: x.responseText
23183
- });
23184
- };
23185
- x.send(payload);
23186
- } catch (e) {
23187
- console && console.log(e);
23188
- }
23189
- };
23190
- var request = function request(options, url, payload, callback) {
23191
- if (typeof payload === 'function') {
23192
- callback = payload;
23193
- payload = undefined;
23194
- }
23195
- callback = callback || function () {};
23196
- if (fetchApi && url.indexOf('file:') !== 0) {
23197
- return requestWithFetch(options, url, payload, callback);
23198
- }
23199
- if ((0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.hasXMLHttpRequest)() || typeof ActiveXObject === 'function') {
23200
- return requestWithXmlHttpRequest(options, url, payload, callback);
23201
- }
23202
- callback(new Error('No fetch and no xhr implementation found!'));
23203
- };
23204
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (request);
23205
-
23206
- /***/ },
23207
-
23208
- /***/ "../../common/temp/node_modules/.pnpm/i18next-http-backend@3.0.6/node_modules/i18next-http-backend/esm/utils.js"
23209
- /*!**********************************************************************************************************************!*\
23210
- !*** ../../common/temp/node_modules/.pnpm/i18next-http-backend@3.0.6/node_modules/i18next-http-backend/esm/utils.js ***!
23211
- \**********************************************************************************************************************/
23212
- (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
23213
-
23214
- "use strict";
23215
- __webpack_require__.r(__webpack_exports__);
23216
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
23217
- /* harmony export */ defaults: () => (/* binding */ defaults),
23218
- /* harmony export */ hasXMLHttpRequest: () => (/* binding */ hasXMLHttpRequest),
23219
- /* harmony export */ interpolate: () => (/* binding */ interpolate),
23220
- /* harmony export */ interpolateUrl: () => (/* binding */ interpolateUrl),
23221
- /* harmony export */ isSafeLangUrlSegment: () => (/* binding */ isSafeLangUrlSegment),
23222
- /* harmony export */ isSafeNsUrlSegment: () => (/* binding */ isSafeNsUrlSegment),
23223
- /* harmony export */ isSafeUrlSegment: () => (/* binding */ isSafeUrlSegment),
23224
- /* harmony export */ makePromise: () => (/* binding */ makePromise),
23225
- /* harmony export */ redactUrlCredentials: () => (/* binding */ redactUrlCredentials),
23226
- /* harmony export */ sanitizeLogValue: () => (/* binding */ sanitizeLogValue)
23227
- /* harmony export */ });
23228
- 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; } } }; }
23229
- 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; } }
23230
- 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; }
23231
- 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); }
23232
- var arr = [];
23233
- var each = arr.forEach;
23234
- var slice = arr.slice;
23235
- var UNSAFE_KEYS = ['__proto__', 'constructor', 'prototype'];
23236
- function defaults(obj) {
23237
- each.call(slice.call(arguments, 1), function (source) {
23238
- if (source) {
23239
- for (var _i = 0, _Object$keys = Object.keys(source); _i < _Object$keys.length; _i++) {
23240
- var prop = _Object$keys[_i];
23241
- if (UNSAFE_KEYS.indexOf(prop) > -1) continue;
23242
- if (obj[prop] === undefined) obj[prop] = source[prop];
23243
- }
23244
- }
23245
- });
23246
- return obj;
23247
- }
22909
+ //#region lib/utils.js
22910
+ const arr = [];
22911
+ arr.forEach;
22912
+ arr.slice;
22913
+ const UNSAFE_KEYS$1 = [
22914
+ "__proto__",
22915
+ "constructor",
22916
+ "prototype"
22917
+ ];
23248
22918
  function isSafeUrlSegmentBase(v) {
23249
- if (typeof v !== 'string') return false;
23250
- if (v.length === 0 || v.length > 128) return false;
23251
- if (UNSAFE_KEYS.indexOf(v) > -1) return false;
23252
- if (v.indexOf('..') > -1) return false;
23253
- if (v.indexOf('\\') > -1) return false;
23254
- if (/[?#%\s@]/.test(v)) return false;
23255
- if (/[\x00-\x1F\x7F]/.test(v)) return false;
23256
- return true;
22919
+ if (typeof v !== "string") return false;
22920
+ if (v.length === 0 || v.length > 128) return false;
22921
+ if (UNSAFE_KEYS$1.indexOf(v) > -1) return false;
22922
+ if (v.indexOf("..") > -1) return false;
22923
+ if (v.indexOf("\\") > -1) return false;
22924
+ if (/[?#%:&=;\s]/.test(v)) return false;
22925
+ if (/[\x00-\x1F\x7F]/.test(v)) return false;
22926
+ return true;
23257
22927
  }
23258
22928
  function isSafeLangUrlSegment(v) {
23259
- if (!isSafeUrlSegmentBase(v)) return false;
23260
- if (v.indexOf('/') > -1) return false;
23261
- return true;
22929
+ if (!isSafeUrlSegmentBase(v)) return false;
22930
+ if (v.indexOf("/") > -1 || v.indexOf("@") > -1) return false;
22931
+ return true;
23262
22932
  }
23263
22933
  function isSafeNsUrlSegment(v) {
23264
- return isSafeUrlSegmentBase(v);
22934
+ if (!isSafeUrlSegmentBase(v)) return false;
22935
+ if (v.indexOf("//") > -1) return false;
22936
+ return true;
23265
22937
  }
23266
- var isSafeUrlSegment = isSafeLangUrlSegment;
23267
- var SAFETY_CHECK_BY_KEY = {
23268
- lng: isSafeLangUrlSegment,
23269
- ns: isSafeNsUrlSegment
22938
+ const SAFETY_CHECK_BY_KEY = {
22939
+ lng: isSafeLangUrlSegment,
22940
+ ns: isSafeNsUrlSegment
23270
22941
  };
23271
22942
  function sanitizeLogValue(v) {
23272
- if (typeof v !== 'string') return v;
23273
- return v.replace(/[\r\n\x00-\x1F\x7F]/g, ' ');
22943
+ if (typeof v !== "string") return v;
22944
+ return v.replace(/[\r\n\x00-\x1F\x7F]/g, " ");
23274
22945
  }
23275
22946
  function redactUrlCredentials(u) {
23276
- if (typeof u !== 'string' || u.length === 0) return u;
23277
- try {
23278
- var parsed = new URL(u);
23279
- if (parsed.username || parsed.password) {
23280
- parsed.username = '';
23281
- parsed.password = '';
23282
- return parsed.toString();
23283
- }
23284
- return u;
23285
- } catch (e) {
23286
- return u.replace(/(\/\/)[^/@\s]+@/g, '$1');
23287
- }
22947
+ if (typeof u !== "string" || u.length === 0) return u;
22948
+ try {
22949
+ const parsed = new URL(u);
22950
+ if (parsed.username || parsed.password) {
22951
+ parsed.username = "";
22952
+ parsed.password = "";
22953
+ return parsed.toString();
22954
+ }
22955
+ return u;
22956
+ } catch (e) {
22957
+ return u.replace(/(\/\/)[^/@\s]+@/g, "$1");
22958
+ }
23288
22959
  }
23289
22960
  function hasXMLHttpRequest() {
23290
- return typeof XMLHttpRequest === 'function' || (typeof XMLHttpRequest === "undefined" ? "undefined" : _typeof(XMLHttpRequest)) === 'object';
22961
+ return typeof XMLHttpRequest === "function" || typeof XMLHttpRequest === "object";
23291
22962
  }
22963
+ /**
22964
+ * Determine whether the given `maybePromise` is a Promise.
22965
+ *
22966
+ * @param {*} maybePromise
22967
+ *
22968
+ * @returns {Boolean}
22969
+ */
23292
22970
  function isPromise(maybePromise) {
23293
- return !!maybePromise && typeof maybePromise.then === 'function';
22971
+ return !!maybePromise && typeof maybePromise.then === "function";
23294
22972
  }
22973
+ /**
22974
+ * Convert any value to a Promise than will resolve to this value.
22975
+ *
22976
+ * @param {*} maybePromise
22977
+ *
22978
+ * @returns {Promise}
22979
+ */
23295
22980
  function makePromise(maybePromise) {
23296
- if (isPromise(maybePromise)) {
23297
- return maybePromise;
23298
- }
23299
- return Promise.resolve(maybePromise);
23300
- }
23301
- var interpolationRegexp = /\{\{(.+?)\}\}/g;
23302
- function interpolate(str, data) {
23303
- return str.replace(interpolationRegexp, function (match, key) {
23304
- var k = key.trim();
23305
- if (UNSAFE_KEYS.indexOf(k) > -1) return match;
23306
- var value = data[k];
23307
- return value != null ? value : match;
23308
- });
22981
+ if (isPromise(maybePromise)) return maybePromise;
22982
+ return Promise.resolve(maybePromise);
23309
22983
  }
22984
+ const interpolationRegexp = /\{\{(.+?)\}\}/g;
22985
+ const LEADING_DOUBLE_SLASH = /^[/\\]{2}/;
23310
22986
  function interpolateUrl(str, data) {
23311
- var unsafe = false;
23312
- var result = str.replace(interpolationRegexp, function (match, key) {
23313
- var k = key.trim();
23314
- if (UNSAFE_KEYS.indexOf(k) > -1) return match;
23315
- var value = data[k];
23316
- if (value == null) return match;
23317
- var check = SAFETY_CHECK_BY_KEY[k] || isSafeLangUrlSegment;
23318
- var segments = String(value).split('+');
23319
- var _iterator = _createForOfIteratorHelper(segments),
23320
- _step;
23321
- try {
23322
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
23323
- var seg = _step.value;
23324
- if (!check(seg)) {
23325
- unsafe = true;
23326
- return match;
23327
- }
23328
- }
23329
- } catch (err) {
23330
- _iterator.e(err);
23331
- } finally {
23332
- _iterator.f();
23333
- }
23334
- return segments.join('+');
23335
- });
23336
- return unsafe ? null : result;
22987
+ let unsafe = false;
22988
+ const result = str.replace(interpolationRegexp, (match, key) => {
22989
+ const k = key.trim();
22990
+ if (UNSAFE_KEYS$1.indexOf(k) > -1) return match;
22991
+ const value = data[k];
22992
+ if (value == null) return match;
22993
+ const check = SAFETY_CHECK_BY_KEY[k] || isSafeLangUrlSegment;
22994
+ const segments = String(value).split("+");
22995
+ for (const seg of segments) if (!check(seg)) {
22996
+ unsafe = true;
22997
+ return match;
22998
+ }
22999
+ return segments.join("+");
23000
+ });
23001
+ if (unsafe) return null;
23002
+ if (LEADING_DOUBLE_SLASH.test(result) && !LEADING_DOUBLE_SLASH.test(str)) return null;
23003
+ return result;
23337
23004
  }
23005
+ //#endregion
23006
+ //#region lib/request.js
23007
+ const g = typeof globalThis !== "undefined" ? globalThis : typeof __webpack_require__.g !== "undefined" ? __webpack_require__.g : typeof window !== "undefined" ? window : void 0;
23008
+ let fetchApi;
23009
+ if (typeof fetch === "function") fetchApi = fetch;
23010
+ else if (g && typeof g.fetch === "function") fetchApi = g.fetch;
23011
+ const XmlHttpRequestApi = hasXMLHttpRequest() && g ? g.XMLHttpRequest : void 0;
23012
+ const ActiveXObjectApi = typeof ActiveXObject === "function" && g ? g.ActiveXObject : void 0;
23013
+ const UNSAFE_KEYS = [
23014
+ "__proto__",
23015
+ "constructor",
23016
+ "prototype"
23017
+ ];
23018
+ const addQueryString = (url, params) => {
23019
+ if (params && typeof params === "object") {
23020
+ let queryString = "";
23021
+ for (const paramName of Object.keys(params)) {
23022
+ if (UNSAFE_KEYS.indexOf(paramName) > -1) continue;
23023
+ queryString += "&" + encodeURIComponent(paramName) + "=" + encodeURIComponent(params[paramName]);
23024
+ }
23025
+ if (!queryString) return url;
23026
+ url = url + (url.indexOf("?") !== -1 ? "&" : "?") + queryString.slice(1);
23027
+ }
23028
+ return url;
23029
+ };
23030
+ const fetchIt = (url, fetchOptions, callback, altFetch) => {
23031
+ const resolver = (response) => {
23032
+ if (!response.ok) return callback(response.statusText || "Error", { status: response.status });
23033
+ response.text().then((data) => {
23034
+ callback(null, {
23035
+ status: response.status,
23036
+ data
23037
+ });
23038
+ }).catch(callback);
23039
+ };
23040
+ if (altFetch) {
23041
+ const altResponse = altFetch(url, fetchOptions);
23042
+ if (altResponse instanceof Promise) {
23043
+ altResponse.then(resolver).catch(callback);
23044
+ return;
23045
+ }
23046
+ }
23047
+ if (typeof fetch === "function") fetch(url, fetchOptions).then(resolver).catch(callback);
23048
+ else fetchApi(url, fetchOptions).then(resolver).catch(callback);
23049
+ };
23050
+ const requestWithFetch = (options, url, payload, callback) => {
23051
+ if (options.queryStringParams) url = addQueryString(url, options.queryStringParams);
23052
+ const headers = { ...typeof options.customHeaders === "function" ? options.customHeaders() : options.customHeaders };
23053
+ 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})`;
23054
+ if (payload) headers["Content-Type"] = "application/json";
23055
+ const reqOptions = typeof options.requestOptions === "function" ? options.requestOptions(payload) : options.requestOptions;
23056
+ const fetchOptions = {
23057
+ method: payload ? "POST" : "GET",
23058
+ body: payload ? options.stringify(payload) : void 0,
23059
+ headers,
23060
+ ...options._omitFetchOptions ? {} : reqOptions
23061
+ };
23062
+ const altFetch = typeof options.alternateFetch === "function" && options.alternateFetch.length >= 1 ? options.alternateFetch : void 0;
23063
+ try {
23064
+ fetchIt(url, fetchOptions, callback, altFetch);
23065
+ } catch (e) {
23066
+ if (!reqOptions || Object.keys(reqOptions).length === 0 || !e.message || e.message.indexOf("not implemented") < 0) return callback(e);
23067
+ try {
23068
+ Object.keys(reqOptions).forEach((opt) => {
23069
+ delete fetchOptions[opt];
23070
+ });
23071
+ fetchIt(url, fetchOptions, callback, altFetch);
23072
+ options._omitFetchOptions = true;
23073
+ } catch (err) {
23074
+ callback(err);
23075
+ }
23076
+ }
23077
+ };
23078
+ const requestWithXmlHttpRequest = (options, url, payload, callback) => {
23079
+ if (payload && typeof payload === "object") payload = addQueryString("", payload).slice(1);
23080
+ if (options.queryStringParams) url = addQueryString(url, options.queryStringParams);
23081
+ try {
23082
+ const x = XmlHttpRequestApi ? new XmlHttpRequestApi() : new ActiveXObjectApi("MSXML2.XMLHTTP.3.0");
23083
+ x.open(payload ? "POST" : "GET", url, 1);
23084
+ if (!options.crossDomain) x.setRequestHeader("X-Requested-With", "XMLHttpRequest");
23085
+ x.withCredentials = !!options.withCredentials;
23086
+ if (payload) x.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
23087
+ if (x.overrideMimeType) x.overrideMimeType("application/json");
23088
+ let h = options.customHeaders;
23089
+ h = typeof h === "function" ? h() : h;
23090
+ if (h) for (const i of Object.keys(h)) {
23091
+ if (UNSAFE_KEYS.indexOf(i) > -1) continue;
23092
+ x.setRequestHeader(i, h[i]);
23093
+ }
23094
+ x.onreadystatechange = () => {
23095
+ x.readyState > 3 && callback(x.status >= 400 ? x.statusText : null, {
23096
+ status: x.status,
23097
+ data: x.responseText
23098
+ });
23099
+ };
23100
+ x.send(payload);
23101
+ } catch (e) {
23102
+ console && console.log(e);
23103
+ }
23104
+ };
23105
+ const request = (options, url, payload, callback) => {
23106
+ if (typeof payload === "function") {
23107
+ callback = payload;
23108
+ payload = void 0;
23109
+ }
23110
+ callback = callback || (() => {});
23111
+ if (fetchApi && url.indexOf("file:") !== 0) return requestWithFetch(options, url, payload, callback);
23112
+ if (hasXMLHttpRequest() || typeof ActiveXObject === "function") return requestWithXmlHttpRequest(options, url, payload, callback);
23113
+ callback(/* @__PURE__ */ new Error("No fetch and no xhr implementation found!"));
23114
+ };
23115
+ //#endregion
23116
+ //#region lib/index.js
23117
+ const getDefaults = () => {
23118
+ return {
23119
+ loadPath: "/locales/{{lng}}/{{ns}}.json",
23120
+ addPath: "/locales/add/{{lng}}/{{ns}}",
23121
+ parse: (data) => JSON.parse(data),
23122
+ stringify: JSON.stringify,
23123
+ parsePayload: (namespace, key, fallbackValue) => ({ [key]: fallbackValue || "" }),
23124
+ parseLoadPayload: (languages, namespaces) => void 0,
23125
+ request,
23126
+ reloadInterval: typeof window !== "undefined" ? false : 3600 * 1e3,
23127
+ customHeaders: {},
23128
+ queryStringParams: {},
23129
+ crossDomain: false,
23130
+ withCredentials: false,
23131
+ overrideMimeType: false,
23132
+ requestOptions: {
23133
+ mode: "cors",
23134
+ credentials: "same-origin",
23135
+ cache: "default"
23136
+ }
23137
+ };
23138
+ };
23139
+ var Backend = class {
23140
+ constructor(services, options = {}, allOptions = {}) {
23141
+ this.services = services;
23142
+ this.options = options;
23143
+ this.allOptions = allOptions;
23144
+ this.type = "backend";
23145
+ this.init(services, options, allOptions);
23146
+ }
23147
+ init(services, options = {}, allOptions = {}) {
23148
+ this.services = services;
23149
+ this.options = {
23150
+ ...getDefaults(),
23151
+ ...this.options || {},
23152
+ ...options
23153
+ };
23154
+ this.allOptions = allOptions;
23155
+ if (this.services && this.options.reloadInterval) {
23156
+ const timer = setInterval(() => this.reload(), this.options.reloadInterval);
23157
+ if (typeof timer === "object" && typeof timer.unref === "function") timer.unref();
23158
+ }
23159
+ }
23160
+ readMulti(languages, namespaces, callback) {
23161
+ this._readAny(languages, languages, namespaces, namespaces, callback);
23162
+ }
23163
+ read(language, namespace, callback) {
23164
+ this._readAny([language], language, [namespace], namespace, callback);
23165
+ }
23166
+ _readAny(languages, loadUrlLanguages, namespaces, loadUrlNamespaces, callback) {
23167
+ let loadPath = this.options.loadPath;
23168
+ if (typeof this.options.loadPath === "function") loadPath = this.options.loadPath(languages, namespaces);
23169
+ loadPath = makePromise(loadPath);
23170
+ loadPath.then((resolvedLoadPath) => {
23171
+ if (!resolvedLoadPath) return callback(null, {});
23172
+ const url = interpolateUrl(resolvedLoadPath, {
23173
+ lng: languages.join("+"),
23174
+ ns: namespaces.join("+")
23175
+ });
23176
+ if (url == null) {
23177
+ const safeLngs = languages.map(sanitizeLogValue).join(", ");
23178
+ const safeNss = namespaces.map(sanitizeLogValue).join(", ");
23179
+ return callback(/* @__PURE__ */ new Error("i18next-http-backend: unsafe lng/ns value — refusing to build request URL for languages=[" + safeLngs + "] namespaces=[" + safeNss + "]"), false);
23180
+ }
23181
+ this.loadUrl(url, callback, loadUrlLanguages, loadUrlNamespaces);
23182
+ }, (err) => callback(err, false));
23183
+ }
23184
+ loadUrl(url, callback, languages, namespaces) {
23185
+ const lng = typeof languages === "string" ? [languages] : languages;
23186
+ const ns = typeof namespaces === "string" ? [namespaces] : namespaces;
23187
+ const payload = this.options.parseLoadPayload(lng, ns);
23188
+ const safeUrl = sanitizeLogValue(redactUrlCredentials(url));
23189
+ this.options.request(this.options, url, payload, (err, res) => {
23190
+ if (res && (res.status >= 500 && res.status < 600 || !res.status)) return callback("failed loading " + safeUrl + "; status code: " + res.status, true);
23191
+ if (res && res.status >= 400 && res.status < 500) return callback("failed loading " + safeUrl + "; status code: " + res.status, false);
23192
+ if (!res && err && err.message) {
23193
+ const errorMessage = err.message.toLowerCase();
23194
+ if ([
23195
+ "failed",
23196
+ "fetch",
23197
+ "network",
23198
+ "load"
23199
+ ].find((term) => errorMessage.indexOf(term) > -1)) return callback("failed loading " + safeUrl + ": " + sanitizeLogValue(err.message), true);
23200
+ }
23201
+ if (err) return callback(err, false);
23202
+ let ret, parseErr;
23203
+ try {
23204
+ if (typeof res.data === "string") ret = this.options.parse(res.data, languages, namespaces);
23205
+ else ret = res.data;
23206
+ } catch (e) {
23207
+ parseErr = "failed parsing " + safeUrl + " to json";
23208
+ }
23209
+ if (parseErr) return callback(parseErr, false);
23210
+ callback(null, ret);
23211
+ });
23212
+ }
23213
+ create(languages, namespace, key, fallbackValue, callback) {
23214
+ if (!this.options.addPath) return;
23215
+ if (typeof languages === "string") languages = [languages];
23216
+ const payload = this.options.parsePayload(namespace, key, fallbackValue);
23217
+ let finished = 0;
23218
+ const dataArray = [];
23219
+ const resArray = [];
23220
+ languages.forEach((lng) => {
23221
+ let addPath = this.options.addPath;
23222
+ if (typeof this.options.addPath === "function") addPath = this.options.addPath(lng, namespace);
23223
+ const url = interpolateUrl(addPath, {
23224
+ lng,
23225
+ ns: namespace
23226
+ });
23227
+ if (url == null) {
23228
+ finished += 1;
23229
+ if (callback && finished === languages.length) callback(dataArray, resArray);
23230
+ return;
23231
+ }
23232
+ this.options.request(this.options, url, payload, (data, res) => {
23233
+ finished += 1;
23234
+ dataArray.push(data);
23235
+ resArray.push(res);
23236
+ if (finished === languages.length) {
23237
+ if (typeof callback === "function") callback(dataArray, resArray);
23238
+ }
23239
+ });
23240
+ });
23241
+ }
23242
+ reload() {
23243
+ const { backendConnector, languageUtils, logger } = this.services;
23244
+ const currentLanguage = backendConnector.language;
23245
+ if (currentLanguage && currentLanguage.toLowerCase() === "cimode") return;
23246
+ const toLoad = [];
23247
+ const append = (lng) => {
23248
+ languageUtils.toResolveHierarchy(lng).forEach((l) => {
23249
+ if (toLoad.indexOf(l) < 0) toLoad.push(l);
23250
+ });
23251
+ };
23252
+ append(currentLanguage);
23253
+ if (this.allOptions.preload) this.allOptions.preload.forEach((l) => append(l));
23254
+ toLoad.forEach((lng) => {
23255
+ this.allOptions.ns.forEach((ns) => {
23256
+ backendConnector.read(lng, ns, "read", null, null, (err, data) => {
23257
+ if (err) logger.warn(`loading namespace ${ns} for language ${lng} failed`, err);
23258
+ if (!err && data) logger.log(`loaded namespace ${ns} for language ${lng}`, data);
23259
+ backendConnector.loaded(`${lng}|${ns}`, err, data);
23260
+ });
23261
+ });
23262
+ });
23263
+ }
23264
+ };
23265
+ Backend.type = "backend";
23266
+ //#endregion
23267
+
23268
+
23338
23269
 
23339
23270
  /***/ }
23340
23271
 
@@ -23370,40 +23301,7 @@ function interpolateUrl(str, data) {
23370
23301
  /******/ return module.exports;
23371
23302
  /******/ }
23372
23303
  /******/
23373
- /******/ // expose the modules object (__webpack_modules__)
23374
- /******/ __webpack_require__.m = __webpack_modules__;
23375
- /******/
23376
23304
  /************************************************************************/
23377
- /******/ /* webpack/runtime/create fake namespace object */
23378
- /******/ (() => {
23379
- /******/ const getProto = Object.getPrototypeOf;
23380
- /******/ let leafPrototypes;
23381
- /******/ // create a fake namespace object
23382
- /******/ // mode & 1: value is a module id, require it
23383
- /******/ // mode & 2: merge all properties of value into the ns
23384
- /******/ // mode & 4: return value when already ns object
23385
- /******/ // mode & 16: return value when it's Promise-like
23386
- /******/ // mode & 8|1: behave like require
23387
- /******/ __webpack_require__.t = function(value, mode) {
23388
- /******/ if(mode & 1) value = this(value);
23389
- /******/ if(mode & 8) return value;
23390
- /******/ if(typeof value === 'object' && value) {
23391
- /******/ if((mode & 4) && value.__esModule) return value;
23392
- /******/ if((mode & 16) && typeof value.then === 'function') return value;
23393
- /******/ }
23394
- /******/ const ns = Object.create(null);
23395
- /******/ __webpack_require__.r(ns);
23396
- /******/ const def = {};
23397
- /******/ leafPrototypes = leafPrototypes || [null, getProto({}), getProto([]), getProto(getProto)];
23398
- /******/ for(var current = mode & 2 && value; (typeof current == 'object' || typeof current == 'function') && !~leafPrototypes.indexOf(current); current = getProto(current)) {
23399
- /******/ Object.getOwnPropertyNames(current).forEach((key) => (def[key] = () => (value[key])));
23400
- /******/ }
23401
- /******/ def['default'] = () => (value);
23402
- /******/ __webpack_require__.d(ns, def);
23403
- /******/ return ns;
23404
- /******/ };
23405
- /******/ })();
23406
- /******/
23407
23305
  /******/ /* webpack/runtime/define property getters */
23408
23306
  /******/ // define getter/value functions for harmony exports
23409
23307
  /******/ __webpack_require__.d = (exports, definition) => {
@@ -23414,20 +23312,6 @@ function interpolateUrl(str, data) {
23414
23312
  /******/ }
23415
23313
  /******/ };
23416
23314
  /******/
23417
- /******/ /* webpack/runtime/ensure chunk */
23418
- /******/ __webpack_require__.f = {};
23419
- /******/ // This file contains only the entry chunk.
23420
- /******/ // The chunk loading function for additional chunks
23421
- /******/ __webpack_require__.e = (chunkId) => {
23422
- /******/ const promises = [];
23423
- /******/ __webpack_require__.f.j(chunkId, promises);
23424
- /******/ return Promise.all(promises);
23425
- /******/ };
23426
- /******/
23427
- /******/ /* webpack/runtime/get javascript chunk filename */
23428
- /******/ // This function allow to reference async chunks
23429
- /******/ __webpack_require__.u = (chunkId) => (chunkId + ".bundled-tests.js");
23430
- /******/
23431
23315
  /******/ /* webpack/runtime/global */
23432
23316
  /******/ __webpack_require__.g = (function() {
23433
23317
  /******/ if (typeof globalThis === 'object') return globalThis;
@@ -23441,51 +23325,6 @@ function interpolateUrl(str, data) {
23441
23325
  /******/ /* webpack/runtime/hasOwnProperty shorthand */
23442
23326
  /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop));
23443
23327
  /******/
23444
- /******/ /* webpack/runtime/load script */
23445
- /******/ (() => {
23446
- /******/ const inProgress = {};
23447
- /******/ const dataWebpackPrefix = "@itwin/core-i18n:";
23448
- /******/ // loadScript function to load a script via script tag
23449
- /******/ __webpack_require__.l = (url, done, key, chunkId) => {
23450
- /******/ if(inProgress[url]) { inProgress[url].push(done); return; }
23451
- /******/ let script, needAttach;
23452
- /******/ if(key !== undefined) {
23453
- /******/ const scripts = document.getElementsByTagName("script");
23454
- /******/ for(var i = 0; i < scripts.length; i++) {
23455
- /******/ const s = scripts[i];
23456
- /******/ if(s.getAttribute("src") == url || s.getAttribute("data-webpack") == dataWebpackPrefix + key) { script = s; break; }
23457
- /******/ }
23458
- /******/ }
23459
- /******/ if(!script) {
23460
- /******/ needAttach = true;
23461
- /******/ script = document.createElement('script');
23462
- /******/
23463
- /******/ script.charset = 'utf-8';
23464
- /******/ if (__webpack_require__.nc) {
23465
- /******/ script.setAttribute("nonce", __webpack_require__.nc);
23466
- /******/ }
23467
- /******/ script.setAttribute("data-webpack", dataWebpackPrefix + key);
23468
- /******/
23469
- /******/ script.src = url;
23470
- /******/ }
23471
- /******/ inProgress[url] = [done];
23472
- /******/ const onScriptComplete = (prev, event) => {
23473
- /******/ // avoid mem leaks in IE.
23474
- /******/ script.onerror = script.onload = null;
23475
- /******/ clearTimeout(timeout);
23476
- /******/ const doneFns = inProgress[url];
23477
- /******/ delete inProgress[url];
23478
- /******/ script.parentNode?.removeChild(script);
23479
- /******/ doneFns?.forEach((fn) => (fn(event)));
23480
- /******/ if(prev) return prev(event);
23481
- /******/ }
23482
- /******/ const timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);
23483
- /******/ script.onerror = onScriptComplete.bind(null, script.onerror);
23484
- /******/ script.onload = onScriptComplete.bind(null, script.onload);
23485
- /******/ needAttach && document.head.appendChild(script);
23486
- /******/ };
23487
- /******/ })();
23488
- /******/
23489
23328
  /******/ /* webpack/runtime/make namespace object */
23490
23329
  /******/ // define __esModule on exports
23491
23330
  /******/ __webpack_require__.r = (exports) => {
@@ -23493,118 +23332,6 @@ function interpolateUrl(str, data) {
23493
23332
  /******/ Object.defineProperty(exports, '__esModule', { value: true });
23494
23333
  /******/ };
23495
23334
  /******/
23496
- /******/ /* webpack/runtime/publicPath */
23497
- /******/ (() => {
23498
- /******/ let scriptUrl;
23499
- /******/ if (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + "";
23500
- /******/ const document = __webpack_require__.g.document;
23501
- /******/ if (!scriptUrl && document) {
23502
- /******/ if (document.currentScript?.tagName.toUpperCase() === 'SCRIPT')
23503
- /******/ scriptUrl = document.currentScript.src;
23504
- /******/ if (!scriptUrl) {
23505
- /******/ const scripts = document.getElementsByTagName("script");
23506
- /******/ if(scripts.length) {
23507
- /******/ let i = scripts.length - 1;
23508
- /******/ while (i > -1 && (!scriptUrl || !/^https?:/.test(scriptUrl))) scriptUrl = scripts[i--].src;
23509
- /******/ }
23510
- /******/ }
23511
- /******/ }
23512
- /******/ // When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration
23513
- /******/ // or pass an empty string ("") and set the __webpack_public_path__ variable from your code to use your own logic.
23514
- /******/ if (!scriptUrl) throw new Error("Automatic publicPath is not supported in this browser");
23515
- /******/ scriptUrl = scriptUrl.replace(/^blob:|[?#].*$/g, "").replace(/\/[^/]+$/, "/");
23516
- /******/ __webpack_require__.p = scriptUrl;
23517
- /******/ })();
23518
- /******/
23519
- /******/ /* webpack/runtime/jsonp chunk loading */
23520
- /******/ (() => {
23521
- /******/ // no baseURI
23522
- /******/
23523
- /******/ // object to store loaded and loading chunks
23524
- /******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched
23525
- /******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded
23526
- /******/ const installedChunks = {
23527
- /******/ "main": 0
23528
- /******/ };
23529
- /******/
23530
- /******/ __webpack_require__.f.j = (chunkId, promises) => {
23531
- /******/ // JSONP chunk loading for javascript
23532
- /******/ let installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined;
23533
- /******/ if(installedChunkData !== 0) { // 0 means "already installed".
23534
- /******/
23535
- /******/ // a Promise means "currently loading".
23536
- /******/ if(installedChunkData) {
23537
- /******/ promises.push(installedChunkData[2]);
23538
- /******/ } else {
23539
- /******/ if(true) { // all chunks have JS
23540
- /******/ // setup Promise in chunk cache
23541
- /******/ const promise = new Promise((resolve, reject) => (installedChunkData = installedChunks[chunkId] = [resolve, reject]));
23542
- /******/ promises.push(installedChunkData[2] = promise);
23543
- /******/
23544
- /******/ // create error before stack unwound to get useful stacktrace later
23545
- /******/ const error = new Error();
23546
- /******/ const loadingEnded = (event) => {
23547
- /******/ if(__webpack_require__.o(installedChunks, chunkId)) {
23548
- /******/ installedChunkData = installedChunks[chunkId];
23549
- /******/ if(installedChunkData !== 0) installedChunks[chunkId] = undefined;
23550
- /******/ if(installedChunkData) {
23551
- /******/ const errorType = event && (event.type === 'load' ? 'missing' : event.type);
23552
- /******/ const realSrc = event && event.target && event.target.src;
23553
- /******/ error.message = 'Loading chunk ' + chunkId + ' failed.\n(' + errorType + ': ' + realSrc + ')';
23554
- /******/ error.name = 'ChunkLoadError';
23555
- /******/ error.type = errorType;
23556
- /******/ error.request = realSrc;
23557
- /******/ error.event = event;
23558
- /******/ installedChunkData[1](error);
23559
- /******/ }
23560
- /******/ }
23561
- /******/ };
23562
- /******/ __webpack_require__.l(__webpack_require__.p + __webpack_require__.u(chunkId), loadingEnded, "chunk-" + chunkId, chunkId);
23563
- /******/ }
23564
- /******/ }
23565
- /******/ }
23566
- /******/ };
23567
- /******/
23568
- /******/ // no prefetching
23569
- /******/
23570
- /******/ // no preloaded
23571
- /******/
23572
- /******/ // no HMR
23573
- /******/
23574
- /******/ // no HMR manifest
23575
- /******/
23576
- /******/ // no on chunks loaded
23577
- /******/
23578
- /******/ // install a JSONP callback for chunk loading
23579
- /******/ const webpackJsonpCallback = (parentChunkLoadingFunction, data) => {
23580
- /******/ let [chunkIds, moreModules, runtime] = data;
23581
- /******/ // add "moreModules" to the modules object,
23582
- /******/ // then flag all "chunkIds" as loaded and fire callback
23583
- /******/ var moduleId, chunkId, i = 0;
23584
- /******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) {
23585
- /******/ for(moduleId in moreModules) {
23586
- /******/ if(__webpack_require__.o(moreModules, moduleId)) {
23587
- /******/ __webpack_require__.m[moduleId] = moreModules[moduleId];
23588
- /******/ }
23589
- /******/ }
23590
- /******/ if(runtime) var result = runtime(__webpack_require__);
23591
- /******/ }
23592
- /******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data);
23593
- /******/ for(;i < chunkIds.length; i++) {
23594
- /******/ chunkId = chunkIds[i];
23595
- /******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {
23596
- /******/ installedChunks[chunkId][0]();
23597
- /******/ }
23598
- /******/ installedChunks[chunkId] = 0;
23599
- /******/ }
23600
- /******/
23601
- /******/ }
23602
- /******/
23603
- /******/ const chunkLoadingGlobal = self["webpackChunk_itwin_core_i18n"] = self["webpackChunk_itwin_core_i18n"] || [];
23604
- /******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));
23605
- /******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));
23606
- /******/ })();
23607
- /******/
23608
23335
  /************************************************************************/
23609
23336
  let __webpack_exports__ = {};
23610
23337
  // This entry needs to be wrapped in an IIFE because it needs to be in strict mode.