@itwin/ecschema-rpcinterface-tests 5.14.4 → 5.14.6

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.
@@ -161331,7 +161331,12 @@ var QuantityType;
161331
161331
  class AlternateUnitLabelsRegistry {
161332
161332
  _alternateLabelRegistry = new Map();
161333
161333
  addAlternateLabels(key, ...labels) {
161334
- [...labels].forEach((value) => this._alternateLabelRegistry.get(key)?.add(value));
161334
+ let entry = this._alternateLabelRegistry.get(key);
161335
+ if (!entry) {
161336
+ entry = new Set();
161337
+ this._alternateLabelRegistry.set(key, entry);
161338
+ }
161339
+ labels.forEach((value) => entry.add(value));
161335
161340
  }
161336
161341
  constructor(defaultAlternates) {
161337
161342
  if (defaultAlternates) {
@@ -162126,7 +162131,7 @@ class QuantityFormatter {
162126
162131
  const entry = this.quantityTypesRegistry.get(quantityKey);
162127
162132
  if (!entry)
162128
162133
  throw new Error(`Unable to find registered quantity type with key ${quantityKey}`);
162129
- return entry.generateParserSpec(this.getFormatPropsByQuantityTypeEntryAndSystem(entry, requestedSystem), this.unitsProvider);
162134
+ return entry.generateParserSpec(this.getFormatPropsByQuantityTypeEntryAndSystem(entry, requestedSystem), this.unitsProvider, this.alternateUnitLabelsProvider);
162130
162135
  }
162131
162136
  /** Asynchronous Call to get a ParserSpec for a QuantityType.
162132
162137
  * @param type One of the built-in quantity types supported.
@@ -162274,7 +162279,7 @@ class QuantityFormatter {
162274
162279
  const { persistenceUnitName, formatProps, formatName } = props;
162275
162280
  const persistenceUnitProps = await this._unitsProvider.findUnitByName(persistenceUnitName);
162276
162281
  const format = await _itwin_core_quantity__WEBPACK_IMPORTED_MODULE_1__.Format.createFromJSON(formatName ?? "temp", this._unitsProvider, formatProps);
162277
- return _itwin_core_quantity__WEBPACK_IMPORTED_MODULE_1__.ParserSpec.create(format, this._unitsProvider, persistenceUnitProps);
162282
+ return _itwin_core_quantity__WEBPACK_IMPORTED_MODULE_1__.ParserSpec.create(format, this._unitsProvider, persistenceUnitProps, this.alternateUnitLabelsProvider);
162278
162283
  }
162279
162284
  /**
162280
162285
  * @beta
@@ -162816,6 +162821,9 @@ const UNIT_EXTRA_DATA = [
162816
162821
  { name: "Units.CUB_US_SURVEY_FT", altDisplayLabels: ["cf"] },
162817
162822
  { name: "Units.CUB_YRD", altDisplayLabels: ["cy"] },
162818
162823
  { name: "Units.CUB_M", altDisplayLabels: ["cm"] },
162824
+ // Velocity ( base unit m/s )
162825
+ { name: "Units.KM_PER_HR", altDisplayLabels: ["kph", "kmh"] },
162826
+ { name: "Units.MPH", altDisplayLabels: ["mph"] },
162819
162827
  ];
162820
162828
 
162821
162829
 
@@ -296069,7 +296077,7 @@ __webpack_require__.r(__webpack_exports__);
296069
296077
  /* harmony export */ });
296070
296078
  /* 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");
296071
296079
  /* 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");
296072
- /* 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");
296080
+ /* 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.6/node_modules/i18next-http-backend/esm/index.js");
296073
296081
  /* harmony import */ var _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @itwin/core-bentley */ "../../core/bentley/lib/esm/core-bentley.js");
296074
296082
  /*---------------------------------------------------------------------------------------------
296075
296083
  * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
@@ -316784,7 +316792,16 @@ class Parser {
316784
316792
  // Don't add space when the wip token is empty.
316785
316793
  continue;
316786
316794
  }
316787
- if (isCharOperator) {
316795
+ // A slash directly between two label characters (e.g. "km/h") is part of the label, not a division.
316796
+ const nextCharCode = str.charCodeAt(i + 1);
316797
+ const isUnitLabelSlash = charCode === _Constants__WEBPACK_IMPORTED_MODULE_1__.QuantityConstants.CHAR_SLASH &&
316798
+ wipToken.length > 0 &&
316799
+ i + 1 < str.length &&
316800
+ !/\s/.test(str[i - 1]) &&
316801
+ !/\s/.test(str[i + 1]) &&
316802
+ !Parser.isDigitOrDecimalSeparator(nextCharCode, format) &&
316803
+ !isOperator(nextCharCode);
316804
+ if (isCharOperator && !isUnitLabelSlash) {
316788
316805
  if (wipToken.length > 0) {
316789
316806
  // There is a token is progress, process it now, before adding the new operator token.
316790
316807
  tokens.push(new ParseToken(wipToken));
@@ -332733,534 +332750,382 @@ const isSafeIterable = (thing) =>
332733
332750
 
332734
332751
  /***/ },
332735
332752
 
332736
- /***/ "../../common/temp/node_modules/.pnpm/i18next-http-backend@3.0.6/node_modules/i18next-http-backend/esm/index.js"
332753
+ /***/ "../../common/temp/node_modules/.pnpm/i18next-http-backend@4.0.6/node_modules/i18next-http-backend/esm/index.js"
332737
332754
  /*!**********************************************************************************************************************!*\
332738
- !*** ../../common/temp/node_modules/.pnpm/i18next-http-backend@3.0.6/node_modules/i18next-http-backend/esm/index.js ***!
332755
+ !*** ../../common/temp/node_modules/.pnpm/i18next-http-backend@4.0.6/node_modules/i18next-http-backend/esm/index.js ***!
332739
332756
  \**********************************************************************************************************************/
332740
332757
  (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
332741
332758
 
332742
332759
  "use strict";
332743
332760
  __webpack_require__.r(__webpack_exports__);
332744
332761
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
332745
- /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
332746
- /* harmony export */ });
332747
- /* 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");
332748
- /* 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");
332749
- 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); }
332750
- 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; }
332751
- 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; }
332752
- function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
332753
- 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); } }
332754
- function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
332755
- 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; }
332756
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
332757
- 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); }
332758
- ;
332759
-
332760
- var getDefaults = function getDefaults() {
332761
- return {
332762
- loadPath: '/locales/{{lng}}/{{ns}}.json',
332763
- addPath: '/locales/add/{{lng}}/{{ns}}',
332764
- parse: function parse(data) {
332765
- return JSON.parse(data);
332766
- },
332767
- stringify: JSON.stringify,
332768
- parsePayload: function parsePayload(namespace, key, fallbackValue) {
332769
- return _defineProperty({}, key, fallbackValue || '');
332770
- },
332771
- parseLoadPayload: function parseLoadPayload(languages, namespaces) {
332772
- return undefined;
332773
- },
332774
- request: _request_js__WEBPACK_IMPORTED_MODULE_1__["default"],
332775
- reloadInterval: typeof window !== 'undefined' ? false : 60 * 60 * 1000,
332776
- customHeaders: {},
332777
- queryStringParams: {},
332778
- crossDomain: false,
332779
- withCredentials: false,
332780
- overrideMimeType: false,
332781
- requestOptions: {
332782
- mode: 'cors',
332783
- credentials: 'same-origin',
332784
- cache: 'default'
332785
- }
332786
- };
332787
- };
332788
- var Backend = function () {
332789
- function Backend(services) {
332790
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
332791
- var allOptions = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
332792
- _classCallCheck(this, Backend);
332793
- this.services = services;
332794
- this.options = options;
332795
- this.allOptions = allOptions;
332796
- this.type = 'backend';
332797
- this.init(services, options, allOptions);
332798
- }
332799
- return _createClass(Backend, [{
332800
- key: "init",
332801
- value: function init(services) {
332802
- var _this = this;
332803
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
332804
- var allOptions = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
332805
- this.services = services;
332806
- this.options = _objectSpread(_objectSpread(_objectSpread({}, getDefaults()), this.options || {}), options);
332807
- this.allOptions = allOptions;
332808
- if (this.services && this.options.reloadInterval) {
332809
- var timer = setInterval(function () {
332810
- return _this.reload();
332811
- }, this.options.reloadInterval);
332812
- if (_typeof(timer) === 'object' && typeof timer.unref === 'function') timer.unref();
332813
- }
332814
- }
332815
- }, {
332816
- key: "readMulti",
332817
- value: function readMulti(languages, namespaces, callback) {
332818
- this._readAny(languages, languages, namespaces, namespaces, callback);
332819
- }
332820
- }, {
332821
- key: "read",
332822
- value: function read(language, namespace, callback) {
332823
- this._readAny([language], language, [namespace], namespace, callback);
332824
- }
332825
- }, {
332826
- key: "_readAny",
332827
- value: function _readAny(languages, loadUrlLanguages, namespaces, loadUrlNamespaces, callback) {
332828
- var _this2 = this;
332829
- var loadPath = this.options.loadPath;
332830
- if (typeof this.options.loadPath === 'function') {
332831
- loadPath = this.options.loadPath(languages, namespaces);
332832
- }
332833
- loadPath = (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.makePromise)(loadPath);
332834
- loadPath.then(function (resolvedLoadPath) {
332835
- if (!resolvedLoadPath) return callback(null, {});
332836
- var url = (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.interpolateUrl)(resolvedLoadPath, {
332837
- lng: languages.join('+'),
332838
- ns: namespaces.join('+')
332839
- });
332840
- if (url == null) {
332841
- var safeLngs = languages.map(_utils_js__WEBPACK_IMPORTED_MODULE_0__.sanitizeLogValue).join(', ');
332842
- var safeNss = namespaces.map(_utils_js__WEBPACK_IMPORTED_MODULE_0__.sanitizeLogValue).join(', ');
332843
- return callback(new Error('i18next-http-backend: unsafe lng/ns value — refusing to build request URL for languages=[' + safeLngs + '] namespaces=[' + safeNss + ']'), false);
332844
- }
332845
- _this2.loadUrl(url, callback, loadUrlLanguages, loadUrlNamespaces);
332846
- });
332847
- }
332848
- }, {
332849
- key: "loadUrl",
332850
- value: function loadUrl(url, callback, languages, namespaces) {
332851
- var _this3 = this;
332852
- var lng = typeof languages === 'string' ? [languages] : languages;
332853
- var ns = typeof namespaces === 'string' ? [namespaces] : namespaces;
332854
- var payload = this.options.parseLoadPayload(lng, ns);
332855
- var safeUrl = (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.sanitizeLogValue)((0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.redactUrlCredentials)(url));
332856
- this.options.request(this.options, url, payload, function (err, res) {
332857
- if (res && (res.status >= 500 && res.status < 600 || !res.status)) return callback('failed loading ' + safeUrl + '; status code: ' + res.status, true);
332858
- if (res && res.status >= 400 && res.status < 500) return callback('failed loading ' + safeUrl + '; status code: ' + res.status, false);
332859
- if (!res && err && err.message) {
332860
- var errorMessage = err.message.toLowerCase();
332861
- var isNetworkError = ['failed', 'fetch', 'network', 'load'].find(function (term) {
332862
- return errorMessage.indexOf(term) > -1;
332863
- });
332864
- if (isNetworkError) {
332865
- return callback('failed loading ' + safeUrl + ': ' + (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.sanitizeLogValue)(err.message), true);
332866
- }
332867
- }
332868
- if (err) return callback(err, false);
332869
- var ret, parseErr;
332870
- try {
332871
- if (typeof res.data === 'string') {
332872
- ret = _this3.options.parse(res.data, languages, namespaces);
332873
- } else {
332874
- ret = res.data;
332875
- }
332876
- } catch (e) {
332877
- parseErr = 'failed parsing ' + safeUrl + ' to json';
332878
- }
332879
- if (parseErr) return callback(parseErr, false);
332880
- callback(null, ret);
332881
- });
332882
- }
332883
- }, {
332884
- key: "create",
332885
- value: function create(languages, namespace, key, fallbackValue, callback) {
332886
- var _this4 = this;
332887
- if (!this.options.addPath) return;
332888
- if (typeof languages === 'string') languages = [languages];
332889
- var payload = this.options.parsePayload(namespace, key, fallbackValue);
332890
- var finished = 0;
332891
- var dataArray = [];
332892
- var resArray = [];
332893
- languages.forEach(function (lng) {
332894
- var addPath = _this4.options.addPath;
332895
- if (typeof _this4.options.addPath === 'function') {
332896
- addPath = _this4.options.addPath(lng, namespace);
332897
- }
332898
- var url = (0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.interpolateUrl)(addPath, {
332899
- lng: lng,
332900
- ns: namespace
332901
- });
332902
- if (url == null) {
332903
- finished += 1;
332904
- if (callback && finished === languages.length) callback(dataArray, resArray);
332905
- return;
332906
- }
332907
- _this4.options.request(_this4.options, url, payload, function (data, res) {
332908
- finished += 1;
332909
- dataArray.push(data);
332910
- resArray.push(res);
332911
- if (finished === languages.length) {
332912
- if (typeof callback === 'function') callback(dataArray, resArray);
332913
- }
332914
- });
332915
- });
332916
- }
332917
- }, {
332918
- key: "reload",
332919
- value: function reload() {
332920
- var _this5 = this;
332921
- var _this$services = this.services,
332922
- backendConnector = _this$services.backendConnector,
332923
- languageUtils = _this$services.languageUtils,
332924
- logger = _this$services.logger;
332925
- var currentLanguage = backendConnector.language;
332926
- if (currentLanguage && currentLanguage.toLowerCase() === 'cimode') return;
332927
- var toLoad = [];
332928
- var append = function append(lng) {
332929
- var lngs = languageUtils.toResolveHierarchy(lng);
332930
- lngs.forEach(function (l) {
332931
- if (toLoad.indexOf(l) < 0) toLoad.push(l);
332932
- });
332933
- };
332934
- append(currentLanguage);
332935
- if (this.allOptions.preload) this.allOptions.preload.forEach(function (l) {
332936
- return append(l);
332937
- });
332938
- toLoad.forEach(function (lng) {
332939
- _this5.allOptions.ns.forEach(function (ns) {
332940
- backendConnector.read(lng, ns, 'read', null, null, function (err, data) {
332941
- if (err) logger.warn("loading namespace ".concat(ns, " for language ").concat(lng, " failed"), err);
332942
- if (!err && data) logger.log("loaded namespace ".concat(ns, " for language ").concat(lng), data);
332943
- backendConnector.loaded("".concat(lng, "|").concat(ns), err, data);
332944
- });
332945
- });
332946
- });
332947
- }
332948
- }]);
332949
- }();
332950
- Backend.type = 'backend';
332951
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Backend);
332952
-
332953
- /***/ },
332954
-
332955
- /***/ "../../common/temp/node_modules/.pnpm/i18next-http-backend@3.0.6/node_modules/i18next-http-backend/esm/request.js"
332956
- /*!************************************************************************************************************************!*\
332957
- !*** ../../common/temp/node_modules/.pnpm/i18next-http-backend@3.0.6/node_modules/i18next-http-backend/esm/request.js ***!
332958
- \************************************************************************************************************************/
332959
- (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
332960
-
332961
- "use strict";
332962
- __webpack_require__.r(__webpack_exports__);
332963
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
332964
- /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
332762
+ /* harmony export */ "default": () => (/* binding */ Backend)
332965
332763
  /* harmony export */ });
332966
- /* 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");
332967
- 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; }
332968
- 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; }
332969
- 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; }
332970
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
332971
- 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); }
332972
- 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); }
332973
- ;
332974
- var fetchApi = typeof fetch === 'function' ? fetch : undefined;
332975
- if (typeof __webpack_require__.g !== 'undefined' && __webpack_require__.g.fetch) {
332976
- fetchApi = __webpack_require__.g.fetch;
332977
- } else if (typeof window !== 'undefined' && window.fetch) {
332978
- fetchApi = window.fetch;
332979
- }
332980
- var XmlHttpRequestApi;
332981
- if ((0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.hasXMLHttpRequest)()) {
332982
- if (typeof __webpack_require__.g !== 'undefined' && __webpack_require__.g.XMLHttpRequest) {
332983
- XmlHttpRequestApi = __webpack_require__.g.XMLHttpRequest;
332984
- } else if (typeof window !== 'undefined' && window.XMLHttpRequest) {
332985
- XmlHttpRequestApi = window.XMLHttpRequest;
332986
- }
332987
- }
332988
- var ActiveXObjectApi;
332989
- if (typeof ActiveXObject === 'function') {
332990
- if (typeof __webpack_require__.g !== 'undefined' && __webpack_require__.g.ActiveXObject) {
332991
- ActiveXObjectApi = __webpack_require__.g.ActiveXObject;
332992
- } else if (typeof window !== 'undefined' && window.ActiveXObject) {
332993
- ActiveXObjectApi = window.ActiveXObject;
332994
- }
332995
- }
332996
- if (typeof fetchApi !== 'function') fetchApi = undefined;
332997
- if (!fetchApi && !XmlHttpRequestApi && !ActiveXObjectApi) {
332998
- try {
332999
- __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) {
333000
- fetchApi = mod.default;
333001
- }).catch(function () {});
333002
- } catch (e) {}
333003
- }
333004
- var UNSAFE_KEYS = ['__proto__', 'constructor', 'prototype'];
333005
- var addQueryString = function addQueryString(url, params) {
333006
- if (params && _typeof(params) === 'object') {
333007
- var queryString = '';
333008
- for (var _i = 0, _Object$keys = Object.keys(params); _i < _Object$keys.length; _i++) {
333009
- var paramName = _Object$keys[_i];
333010
- if (UNSAFE_KEYS.indexOf(paramName) > -1) continue;
333011
- queryString += '&' + encodeURIComponent(paramName) + '=' + encodeURIComponent(params[paramName]);
333012
- }
333013
- if (!queryString) return url;
333014
- url = url + (url.indexOf('?') !== -1 ? '&' : '?') + queryString.slice(1);
333015
- }
333016
- return url;
333017
- };
333018
- var fetchIt = function fetchIt(url, fetchOptions, callback, altFetch) {
333019
- var resolver = function resolver(response) {
333020
- if (!response.ok) return callback(response.statusText || 'Error', {
333021
- status: response.status
333022
- });
333023
- response.text().then(function (data) {
333024
- callback(null, {
333025
- status: response.status,
333026
- data: data
333027
- });
333028
- }).catch(callback);
333029
- };
333030
- if (altFetch) {
333031
- var altResponse = altFetch(url, fetchOptions);
333032
- if (altResponse instanceof Promise) {
333033
- altResponse.then(resolver).catch(callback);
333034
- return;
333035
- }
333036
- }
333037
- if (typeof fetch === 'function') {
333038
- fetch(url, fetchOptions).then(resolver).catch(callback);
333039
- } else {
333040
- fetchApi(url, fetchOptions).then(resolver).catch(callback);
333041
- }
333042
- };
333043
- var requestWithFetch = function requestWithFetch(options, url, payload, callback) {
333044
- if (options.queryStringParams) {
333045
- url = addQueryString(url, options.queryStringParams);
333046
- }
333047
- var headers = _objectSpread({}, typeof options.customHeaders === 'function' ? options.customHeaders() : options.customHeaders);
333048
- 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) {
333049
- 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, ")");
333050
- }
333051
- if (payload) headers['Content-Type'] = 'application/json';
333052
- var reqOptions = typeof options.requestOptions === 'function' ? options.requestOptions(payload) : options.requestOptions;
333053
- var fetchOptions = _objectSpread({
333054
- method: payload ? 'POST' : 'GET',
333055
- body: payload ? options.stringify(payload) : undefined,
333056
- headers: headers
333057
- }, options._omitFetchOptions ? {} : reqOptions);
333058
- var altFetch = typeof options.alternateFetch === 'function' && options.alternateFetch.length >= 1 ? options.alternateFetch : undefined;
333059
- try {
333060
- fetchIt(url, fetchOptions, callback, altFetch);
333061
- } catch (e) {
333062
- if (!reqOptions || Object.keys(reqOptions).length === 0 || !e.message || e.message.indexOf('not implemented') < 0) {
333063
- return callback(e);
333064
- }
333065
- try {
333066
- Object.keys(reqOptions).forEach(function (opt) {
333067
- delete fetchOptions[opt];
333068
- });
333069
- fetchIt(url, fetchOptions, callback, altFetch);
333070
- options._omitFetchOptions = true;
333071
- } catch (err) {
333072
- callback(err);
333073
- }
333074
- }
333075
- };
333076
- var requestWithXmlHttpRequest = function requestWithXmlHttpRequest(options, url, payload, callback) {
333077
- if (payload && _typeof(payload) === 'object') {
333078
- payload = addQueryString('', payload).slice(1);
333079
- }
333080
- if (options.queryStringParams) {
333081
- url = addQueryString(url, options.queryStringParams);
333082
- }
333083
- try {
333084
- var x = XmlHttpRequestApi ? new XmlHttpRequestApi() : new ActiveXObjectApi('MSXML2.XMLHTTP.3.0');
333085
- x.open(payload ? 'POST' : 'GET', url, 1);
333086
- if (!options.crossDomain) {
333087
- x.setRequestHeader('X-Requested-With', 'XMLHttpRequest');
333088
- }
333089
- x.withCredentials = !!options.withCredentials;
333090
- if (payload) {
333091
- x.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
333092
- }
333093
- if (x.overrideMimeType) {
333094
- x.overrideMimeType('application/json');
333095
- }
333096
- var h = options.customHeaders;
333097
- h = typeof h === 'function' ? h() : h;
333098
- if (h) {
333099
- for (var _i2 = 0, _Object$keys2 = Object.keys(h); _i2 < _Object$keys2.length; _i2++) {
333100
- var i = _Object$keys2[_i2];
333101
- if (UNSAFE_KEYS.indexOf(i) > -1) continue;
333102
- x.setRequestHeader(i, h[i]);
333103
- }
333104
- }
333105
- x.onreadystatechange = function () {
333106
- x.readyState > 3 && callback(x.status >= 400 ? x.statusText : null, {
333107
- status: x.status,
333108
- data: x.responseText
333109
- });
333110
- };
333111
- x.send(payload);
333112
- } catch (e) {
333113
- console && console.log(e);
333114
- }
333115
- };
333116
- var request = function request(options, url, payload, callback) {
333117
- if (typeof payload === 'function') {
333118
- callback = payload;
333119
- payload = undefined;
333120
- }
333121
- callback = callback || function () {};
333122
- if (fetchApi && url.indexOf('file:') !== 0) {
333123
- return requestWithFetch(options, url, payload, callback);
333124
- }
333125
- if ((0,_utils_js__WEBPACK_IMPORTED_MODULE_0__.hasXMLHttpRequest)() || typeof ActiveXObject === 'function') {
333126
- return requestWithXmlHttpRequest(options, url, payload, callback);
333127
- }
333128
- callback(new Error('No fetch and no xhr implementation found!'));
333129
- };
333130
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (request);
333131
-
333132
- /***/ },
333133
-
333134
- /***/ "../../common/temp/node_modules/.pnpm/i18next-http-backend@3.0.6/node_modules/i18next-http-backend/esm/utils.js"
333135
- /*!**********************************************************************************************************************!*\
333136
- !*** ../../common/temp/node_modules/.pnpm/i18next-http-backend@3.0.6/node_modules/i18next-http-backend/esm/utils.js ***!
333137
- \**********************************************************************************************************************/
333138
- (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
333139
-
333140
- "use strict";
333141
- __webpack_require__.r(__webpack_exports__);
333142
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
333143
- /* harmony export */ defaults: () => (/* binding */ defaults),
333144
- /* harmony export */ hasXMLHttpRequest: () => (/* binding */ hasXMLHttpRequest),
333145
- /* harmony export */ interpolate: () => (/* binding */ interpolate),
333146
- /* harmony export */ interpolateUrl: () => (/* binding */ interpolateUrl),
333147
- /* harmony export */ isSafeLangUrlSegment: () => (/* binding */ isSafeLangUrlSegment),
333148
- /* harmony export */ isSafeNsUrlSegment: () => (/* binding */ isSafeNsUrlSegment),
333149
- /* harmony export */ isSafeUrlSegment: () => (/* binding */ isSafeUrlSegment),
333150
- /* harmony export */ makePromise: () => (/* binding */ makePromise),
333151
- /* harmony export */ redactUrlCredentials: () => (/* binding */ redactUrlCredentials),
333152
- /* harmony export */ sanitizeLogValue: () => (/* binding */ sanitizeLogValue)
333153
- /* harmony export */ });
333154
- 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; } } }; }
333155
- 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; } }
333156
- 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; }
333157
- 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); }
333158
- var arr = [];
333159
- var each = arr.forEach;
333160
- var slice = arr.slice;
333161
- var UNSAFE_KEYS = ['__proto__', 'constructor', 'prototype'];
333162
- function defaults(obj) {
333163
- each.call(slice.call(arguments, 1), function (source) {
333164
- if (source) {
333165
- for (var _i = 0, _Object$keys = Object.keys(source); _i < _Object$keys.length; _i++) {
333166
- var prop = _Object$keys[_i];
333167
- if (UNSAFE_KEYS.indexOf(prop) > -1) continue;
333168
- if (obj[prop] === undefined) obj[prop] = source[prop];
333169
- }
333170
- }
333171
- });
333172
- return obj;
333173
- }
332764
+ //#region lib/utils.js
332765
+ const arr = [];
332766
+ arr.forEach;
332767
+ arr.slice;
332768
+ const UNSAFE_KEYS$1 = [
332769
+ "__proto__",
332770
+ "constructor",
332771
+ "prototype"
332772
+ ];
333174
332773
  function isSafeUrlSegmentBase(v) {
333175
- if (typeof v !== 'string') return false;
333176
- if (v.length === 0 || v.length > 128) return false;
333177
- if (UNSAFE_KEYS.indexOf(v) > -1) return false;
333178
- if (v.indexOf('..') > -1) return false;
333179
- if (v.indexOf('\\') > -1) return false;
333180
- if (/[?#%\s@]/.test(v)) return false;
333181
- if (/[\x00-\x1F\x7F]/.test(v)) return false;
333182
- return true;
332774
+ if (typeof v !== "string") return false;
332775
+ if (v.length === 0 || v.length > 128) return false;
332776
+ if (UNSAFE_KEYS$1.indexOf(v) > -1) return false;
332777
+ if (v.indexOf("..") > -1) return false;
332778
+ if (v.indexOf("\\") > -1) return false;
332779
+ if (/[?#%:&=;\s]/.test(v)) return false;
332780
+ if (/[\x00-\x1F\x7F]/.test(v)) return false;
332781
+ return true;
333183
332782
  }
333184
332783
  function isSafeLangUrlSegment(v) {
333185
- if (!isSafeUrlSegmentBase(v)) return false;
333186
- if (v.indexOf('/') > -1) return false;
333187
- return true;
332784
+ if (!isSafeUrlSegmentBase(v)) return false;
332785
+ if (v.indexOf("/") > -1 || v.indexOf("@") > -1) return false;
332786
+ return true;
333188
332787
  }
333189
332788
  function isSafeNsUrlSegment(v) {
333190
- return isSafeUrlSegmentBase(v);
332789
+ if (!isSafeUrlSegmentBase(v)) return false;
332790
+ if (v.indexOf("//") > -1) return false;
332791
+ return true;
333191
332792
  }
333192
- var isSafeUrlSegment = isSafeLangUrlSegment;
333193
- var SAFETY_CHECK_BY_KEY = {
333194
- lng: isSafeLangUrlSegment,
333195
- ns: isSafeNsUrlSegment
332793
+ const SAFETY_CHECK_BY_KEY = {
332794
+ lng: isSafeLangUrlSegment,
332795
+ ns: isSafeNsUrlSegment
333196
332796
  };
333197
332797
  function sanitizeLogValue(v) {
333198
- if (typeof v !== 'string') return v;
333199
- return v.replace(/[\r\n\x00-\x1F\x7F]/g, ' ');
332798
+ if (typeof v !== "string") return v;
332799
+ return v.replace(/[\r\n\x00-\x1F\x7F]/g, " ");
333200
332800
  }
333201
332801
  function redactUrlCredentials(u) {
333202
- if (typeof u !== 'string' || u.length === 0) return u;
333203
- try {
333204
- var parsed = new URL(u);
333205
- if (parsed.username || parsed.password) {
333206
- parsed.username = '';
333207
- parsed.password = '';
333208
- return parsed.toString();
333209
- }
333210
- return u;
333211
- } catch (e) {
333212
- return u.replace(/(\/\/)[^/@\s]+@/g, '$1');
333213
- }
332802
+ if (typeof u !== "string" || u.length === 0) return u;
332803
+ try {
332804
+ const parsed = new URL(u);
332805
+ if (parsed.username || parsed.password) {
332806
+ parsed.username = "";
332807
+ parsed.password = "";
332808
+ return parsed.toString();
332809
+ }
332810
+ return u;
332811
+ } catch (e) {
332812
+ return u.replace(/(\/\/)[^/@\s]+@/g, "$1");
332813
+ }
333214
332814
  }
333215
332815
  function hasXMLHttpRequest() {
333216
- return typeof XMLHttpRequest === 'function' || (typeof XMLHttpRequest === "undefined" ? "undefined" : _typeof(XMLHttpRequest)) === 'object';
332816
+ return typeof XMLHttpRequest === "function" || typeof XMLHttpRequest === "object";
333217
332817
  }
332818
+ /**
332819
+ * Determine whether the given `maybePromise` is a Promise.
332820
+ *
332821
+ * @param {*} maybePromise
332822
+ *
332823
+ * @returns {Boolean}
332824
+ */
333218
332825
  function isPromise(maybePromise) {
333219
- return !!maybePromise && typeof maybePromise.then === 'function';
332826
+ return !!maybePromise && typeof maybePromise.then === "function";
333220
332827
  }
332828
+ /**
332829
+ * Convert any value to a Promise than will resolve to this value.
332830
+ *
332831
+ * @param {*} maybePromise
332832
+ *
332833
+ * @returns {Promise}
332834
+ */
333221
332835
  function makePromise(maybePromise) {
333222
- if (isPromise(maybePromise)) {
333223
- return maybePromise;
333224
- }
333225
- return Promise.resolve(maybePromise);
333226
- }
333227
- var interpolationRegexp = /\{\{(.+?)\}\}/g;
333228
- function interpolate(str, data) {
333229
- return str.replace(interpolationRegexp, function (match, key) {
333230
- var k = key.trim();
333231
- if (UNSAFE_KEYS.indexOf(k) > -1) return match;
333232
- var value = data[k];
333233
- return value != null ? value : match;
333234
- });
332836
+ if (isPromise(maybePromise)) return maybePromise;
332837
+ return Promise.resolve(maybePromise);
333235
332838
  }
332839
+ const interpolationRegexp = /\{\{(.+?)\}\}/g;
332840
+ const LEADING_DOUBLE_SLASH = /^[/\\]{2}/;
333236
332841
  function interpolateUrl(str, data) {
333237
- var unsafe = false;
333238
- var result = str.replace(interpolationRegexp, function (match, key) {
333239
- var k = key.trim();
333240
- if (UNSAFE_KEYS.indexOf(k) > -1) return match;
333241
- var value = data[k];
333242
- if (value == null) return match;
333243
- var check = SAFETY_CHECK_BY_KEY[k] || isSafeLangUrlSegment;
333244
- var segments = String(value).split('+');
333245
- var _iterator = _createForOfIteratorHelper(segments),
333246
- _step;
333247
- try {
333248
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
333249
- var seg = _step.value;
333250
- if (!check(seg)) {
333251
- unsafe = true;
333252
- return match;
333253
- }
333254
- }
333255
- } catch (err) {
333256
- _iterator.e(err);
333257
- } finally {
333258
- _iterator.f();
333259
- }
333260
- return segments.join('+');
333261
- });
333262
- return unsafe ? null : result;
333263
- }
332842
+ let unsafe = false;
332843
+ const result = str.replace(interpolationRegexp, (match, key) => {
332844
+ const k = key.trim();
332845
+ if (UNSAFE_KEYS$1.indexOf(k) > -1) return match;
332846
+ const value = data[k];
332847
+ if (value == null) return match;
332848
+ const check = SAFETY_CHECK_BY_KEY[k] || isSafeLangUrlSegment;
332849
+ const segments = String(value).split("+");
332850
+ for (const seg of segments) if (!check(seg)) {
332851
+ unsafe = true;
332852
+ return match;
332853
+ }
332854
+ return segments.join("+");
332855
+ });
332856
+ if (unsafe) return null;
332857
+ if (LEADING_DOUBLE_SLASH.test(result) && !LEADING_DOUBLE_SLASH.test(str)) return null;
332858
+ return result;
332859
+ }
332860
+ //#endregion
332861
+ //#region lib/request.js
332862
+ const g = typeof globalThis !== "undefined" ? globalThis : typeof __webpack_require__.g !== "undefined" ? __webpack_require__.g : typeof window !== "undefined" ? window : void 0;
332863
+ let fetchApi;
332864
+ if (typeof fetch === "function") fetchApi = fetch;
332865
+ else if (g && typeof g.fetch === "function") fetchApi = g.fetch;
332866
+ const XmlHttpRequestApi = hasXMLHttpRequest() && g ? g.XMLHttpRequest : void 0;
332867
+ const ActiveXObjectApi = typeof ActiveXObject === "function" && g ? g.ActiveXObject : void 0;
332868
+ const UNSAFE_KEYS = [
332869
+ "__proto__",
332870
+ "constructor",
332871
+ "prototype"
332872
+ ];
332873
+ const addQueryString = (url, params) => {
332874
+ if (params && typeof params === "object") {
332875
+ let queryString = "";
332876
+ for (const paramName of Object.keys(params)) {
332877
+ if (UNSAFE_KEYS.indexOf(paramName) > -1) continue;
332878
+ queryString += "&" + encodeURIComponent(paramName) + "=" + encodeURIComponent(params[paramName]);
332879
+ }
332880
+ if (!queryString) return url;
332881
+ url = url + (url.indexOf("?") !== -1 ? "&" : "?") + queryString.slice(1);
332882
+ }
332883
+ return url;
332884
+ };
332885
+ const fetchIt = (url, fetchOptions, callback, altFetch) => {
332886
+ const resolver = (response) => {
332887
+ if (!response.ok) return callback(response.statusText || "Error", { status: response.status });
332888
+ response.text().then((data) => {
332889
+ callback(null, {
332890
+ status: response.status,
332891
+ data
332892
+ });
332893
+ }).catch(callback);
332894
+ };
332895
+ if (altFetch) {
332896
+ const altResponse = altFetch(url, fetchOptions);
332897
+ if (altResponse instanceof Promise) {
332898
+ altResponse.then(resolver).catch(callback);
332899
+ return;
332900
+ }
332901
+ }
332902
+ if (typeof fetch === "function") fetch(url, fetchOptions).then(resolver).catch(callback);
332903
+ else fetchApi(url, fetchOptions).then(resolver).catch(callback);
332904
+ };
332905
+ const requestWithFetch = (options, url, payload, callback) => {
332906
+ if (options.queryStringParams) url = addQueryString(url, options.queryStringParams);
332907
+ const headers = { ...typeof options.customHeaders === "function" ? options.customHeaders() : options.customHeaders };
332908
+ 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})`;
332909
+ if (payload) headers["Content-Type"] = "application/json";
332910
+ const reqOptions = typeof options.requestOptions === "function" ? options.requestOptions(payload) : options.requestOptions;
332911
+ const fetchOptions = {
332912
+ method: payload ? "POST" : "GET",
332913
+ body: payload ? options.stringify(payload) : void 0,
332914
+ headers,
332915
+ ...options._omitFetchOptions ? {} : reqOptions
332916
+ };
332917
+ const altFetch = typeof options.alternateFetch === "function" && options.alternateFetch.length >= 1 ? options.alternateFetch : void 0;
332918
+ try {
332919
+ fetchIt(url, fetchOptions, callback, altFetch);
332920
+ } catch (e) {
332921
+ if (!reqOptions || Object.keys(reqOptions).length === 0 || !e.message || e.message.indexOf("not implemented") < 0) return callback(e);
332922
+ try {
332923
+ Object.keys(reqOptions).forEach((opt) => {
332924
+ delete fetchOptions[opt];
332925
+ });
332926
+ fetchIt(url, fetchOptions, callback, altFetch);
332927
+ options._omitFetchOptions = true;
332928
+ } catch (err) {
332929
+ callback(err);
332930
+ }
332931
+ }
332932
+ };
332933
+ const requestWithXmlHttpRequest = (options, url, payload, callback) => {
332934
+ if (payload && typeof payload === "object") payload = addQueryString("", payload).slice(1);
332935
+ if (options.queryStringParams) url = addQueryString(url, options.queryStringParams);
332936
+ let completed = false;
332937
+ try {
332938
+ const x = XmlHttpRequestApi ? new XmlHttpRequestApi() : new ActiveXObjectApi("MSXML2.XMLHTTP.3.0");
332939
+ x.open(payload ? "POST" : "GET", url, 1);
332940
+ if (!options.crossDomain) x.setRequestHeader("X-Requested-With", "XMLHttpRequest");
332941
+ x.withCredentials = !!options.withCredentials;
332942
+ if (payload) x.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
332943
+ if (x.overrideMimeType) x.overrideMimeType("application/json");
332944
+ let h = options.customHeaders;
332945
+ h = typeof h === "function" ? h() : h;
332946
+ if (h) for (const i of Object.keys(h)) {
332947
+ if (UNSAFE_KEYS.indexOf(i) > -1) continue;
332948
+ x.setRequestHeader(i, h[i]);
332949
+ }
332950
+ x.onreadystatechange = () => {
332951
+ if (x.readyState > 3) {
332952
+ completed = true;
332953
+ callback(x.status >= 400 ? x.statusText : null, {
332954
+ status: x.status,
332955
+ data: x.responseText
332956
+ });
332957
+ }
332958
+ };
332959
+ x.send(payload);
332960
+ } catch (e) {
332961
+ if (completed) throw e;
332962
+ callback(e);
332963
+ }
332964
+ };
332965
+ const request = (options, url, payload, callback) => {
332966
+ if (typeof payload === "function") {
332967
+ callback = payload;
332968
+ payload = void 0;
332969
+ }
332970
+ callback = callback || (() => {});
332971
+ if (fetchApi && url.indexOf("file:") !== 0) return requestWithFetch(options, url, payload, callback);
332972
+ if (hasXMLHttpRequest() || typeof ActiveXObject === "function") return requestWithXmlHttpRequest(options, url, payload, callback);
332973
+ callback(/* @__PURE__ */ new Error("No fetch and no xhr implementation found!"));
332974
+ };
332975
+ //#endregion
332976
+ //#region lib/index.js
332977
+ const getDefaults = () => {
332978
+ return {
332979
+ loadPath: "/locales/{{lng}}/{{ns}}.json",
332980
+ addPath: "/locales/add/{{lng}}/{{ns}}",
332981
+ parse: (data) => JSON.parse(data),
332982
+ stringify: JSON.stringify,
332983
+ parsePayload: (namespace, key, fallbackValue) => ({ [key]: fallbackValue || "" }),
332984
+ parseLoadPayload: (languages, namespaces) => void 0,
332985
+ request,
332986
+ reloadInterval: typeof window !== "undefined" ? false : 3600 * 1e3,
332987
+ customHeaders: {},
332988
+ queryStringParams: {},
332989
+ crossDomain: false,
332990
+ withCredentials: false,
332991
+ overrideMimeType: false,
332992
+ requestOptions: {
332993
+ mode: "cors",
332994
+ credentials: "same-origin",
332995
+ cache: "default"
332996
+ }
332997
+ };
332998
+ };
332999
+ var Backend = class {
333000
+ constructor(services, options = {}, allOptions = {}) {
333001
+ this.services = services;
333002
+ this.options = options;
333003
+ this.allOptions = allOptions;
333004
+ this.type = "backend";
333005
+ this.init(services, options, allOptions);
333006
+ }
333007
+ init(services, options = {}, allOptions = {}) {
333008
+ this.services = services;
333009
+ this.options = {
333010
+ ...getDefaults(),
333011
+ ...this.options || {},
333012
+ ...options
333013
+ };
333014
+ this.allOptions = allOptions;
333015
+ if (this.services && this.options.reloadInterval) {
333016
+ const timer = setInterval(() => this.reload(), this.options.reloadInterval);
333017
+ if (typeof timer === "object" && typeof timer.unref === "function") timer.unref();
333018
+ }
333019
+ }
333020
+ readMulti(languages, namespaces, callback) {
333021
+ this._readAny(languages, languages, namespaces, namespaces, callback);
333022
+ }
333023
+ read(language, namespace, callback) {
333024
+ this._readAny([language], language, [namespace], namespace, callback);
333025
+ }
333026
+ _readAny(languages, loadUrlLanguages, namespaces, loadUrlNamespaces, callback) {
333027
+ let loadPath = this.options.loadPath;
333028
+ if (typeof this.options.loadPath === "function") loadPath = this.options.loadPath(languages, namespaces);
333029
+ loadPath = makePromise(loadPath);
333030
+ loadPath.then((resolvedLoadPath) => {
333031
+ if (!resolvedLoadPath) return callback(null, {});
333032
+ const url = interpolateUrl(resolvedLoadPath, {
333033
+ lng: languages.join("+"),
333034
+ ns: namespaces.join("+")
333035
+ });
333036
+ if (url == null) {
333037
+ const safeLngs = languages.map(sanitizeLogValue).join(", ");
333038
+ const safeNss = namespaces.map(sanitizeLogValue).join(", ");
333039
+ return callback(/* @__PURE__ */ new Error("i18next-http-backend: unsafe lng/ns value — refusing to build request URL for languages=[" + safeLngs + "] namespaces=[" + safeNss + "]"), false);
333040
+ }
333041
+ this.loadUrl(url, callback, loadUrlLanguages, loadUrlNamespaces);
333042
+ }, (err) => callback(err, false));
333043
+ }
333044
+ loadUrl(url, callback, languages, namespaces) {
333045
+ const lng = typeof languages === "string" ? [languages] : languages;
333046
+ const ns = typeof namespaces === "string" ? [namespaces] : namespaces;
333047
+ const payload = this.options.parseLoadPayload(lng, ns);
333048
+ const safeUrl = sanitizeLogValue(redactUrlCredentials(url));
333049
+ this.options.request(this.options, url, payload, (err, res) => {
333050
+ if (res && (res.status >= 500 && res.status < 600 || !res.status)) return callback("failed loading " + safeUrl + "; status code: " + res.status, true);
333051
+ if (res && res.status >= 400 && res.status < 500) return callback("failed loading " + safeUrl + "; status code: " + res.status, false);
333052
+ if (!res && err && err.message) {
333053
+ const errorMessage = err.message.toLowerCase();
333054
+ if ([
333055
+ "failed",
333056
+ "fetch",
333057
+ "network",
333058
+ "load"
333059
+ ].find((term) => errorMessage.indexOf(term) > -1)) return callback("failed loading " + safeUrl + ": " + sanitizeLogValue(err.message), true);
333060
+ }
333061
+ if (err) return callback(err, false);
333062
+ let ret, parseErr;
333063
+ try {
333064
+ if (typeof res.data === "string") ret = this.options.parse(res.data, languages, namespaces);
333065
+ else ret = res.data;
333066
+ } catch (e) {
333067
+ parseErr = "failed parsing " + safeUrl + " to json";
333068
+ }
333069
+ if (parseErr) return callback(parseErr, false);
333070
+ callback(null, ret);
333071
+ });
333072
+ }
333073
+ create(languages, namespace, key, fallbackValue, callback) {
333074
+ if (!this.options.addPath) return;
333075
+ if (typeof languages === "string") languages = [languages];
333076
+ const payload = this.options.parsePayload(namespace, key, fallbackValue);
333077
+ let finished = 0;
333078
+ const dataArray = [];
333079
+ const resArray = [];
333080
+ languages.forEach((lng) => {
333081
+ let addPath = this.options.addPath;
333082
+ if (typeof this.options.addPath === "function") addPath = this.options.addPath(lng, namespace);
333083
+ const url = interpolateUrl(addPath, {
333084
+ lng,
333085
+ ns: namespace
333086
+ });
333087
+ if (url == null) {
333088
+ finished += 1;
333089
+ if (callback && finished === languages.length) callback(dataArray, resArray);
333090
+ return;
333091
+ }
333092
+ this.options.request(this.options, url, payload, (data, res) => {
333093
+ finished += 1;
333094
+ dataArray.push(data);
333095
+ resArray.push(res);
333096
+ if (finished === languages.length) {
333097
+ if (typeof callback === "function") callback(dataArray, resArray);
333098
+ }
333099
+ });
333100
+ });
333101
+ }
333102
+ reload() {
333103
+ const { backendConnector, languageUtils, logger } = this.services;
333104
+ const currentLanguage = backendConnector.language;
333105
+ if (currentLanguage && currentLanguage.toLowerCase() === "cimode") return;
333106
+ const toLoad = [];
333107
+ const append = (lng) => {
333108
+ languageUtils.toResolveHierarchy(lng).forEach((l) => {
333109
+ if (toLoad.indexOf(l) < 0) toLoad.push(l);
333110
+ });
333111
+ };
333112
+ append(currentLanguage);
333113
+ if (this.allOptions.preload) this.allOptions.preload.forEach((l) => append(l));
333114
+ toLoad.forEach((lng) => {
333115
+ this.allOptions.ns.forEach((ns) => {
333116
+ backendConnector.read(lng, ns, "read", null, null, (err, data) => {
333117
+ if (err) logger.warn(`loading namespace ${ns} for language ${lng} failed`, err);
333118
+ if (!err && data) logger.log(`loaded namespace ${ns} for language ${lng}`, data);
333119
+ backendConnector.loaded(`${lng}|${ns}`, err, data);
333120
+ });
333121
+ });
333122
+ });
333123
+ }
333124
+ };
333125
+ Backend.type = "backend";
333126
+ //#endregion
333127
+
333128
+
333264
333129
 
333265
333130
  /***/ },
333266
333131
 
@@ -337329,7 +337194,7 @@ class WMS {
337329
337194
  (module) {
337330
337195
 
337331
337196
  "use strict";
337332
- module.exports = /*#__PURE__*/JSON.parse('{"name":"@itwin/core-frontend","version":"5.14.4","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.11","@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"}}');
337197
+ module.exports = /*#__PURE__*/JSON.parse('{"name":"@itwin/core-frontend","version":"5.14.6","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.11","@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"}}');
337333
337198
 
337334
337199
  /***/ },
337335
337200
 
@@ -337390,36 +337255,6 @@ module.exports = /*#__PURE__*/JSON.parse('{"version":"01.00.00","sourceEcSchemaV
337390
337255
  /******/ return getter;
337391
337256
  /******/ };
337392
337257
  /******/
337393
- /******/ /* webpack/runtime/create fake namespace object */
337394
- /******/ (() => {
337395
- /******/ const getProto = Object.getPrototypeOf;
337396
- /******/ let leafPrototypes;
337397
- /******/ // create a fake namespace object
337398
- /******/ // mode & 1: value is a module id, require it
337399
- /******/ // mode & 2: merge all properties of value into the ns
337400
- /******/ // mode & 4: return value when already ns object
337401
- /******/ // mode & 16: return value when it's Promise-like
337402
- /******/ // mode & 8|1: behave like require
337403
- /******/ __webpack_require__.t = function(value, mode) {
337404
- /******/ if(mode & 1) value = this(value);
337405
- /******/ if(mode & 8) return value;
337406
- /******/ if(typeof value === 'object' && value) {
337407
- /******/ if((mode & 4) && value.__esModule) return value;
337408
- /******/ if((mode & 16) && typeof value.then === 'function') return value;
337409
- /******/ }
337410
- /******/ const ns = Object.create(null);
337411
- /******/ __webpack_require__.r(ns);
337412
- /******/ const def = {};
337413
- /******/ leafPrototypes = leafPrototypes || [null, getProto({}), getProto([]), getProto(getProto)];
337414
- /******/ for(var current = mode & 2 && value; (typeof current == 'object' || typeof current == 'function') && !~leafPrototypes.indexOf(current); current = getProto(current)) {
337415
- /******/ Object.getOwnPropertyNames(current).forEach((key) => (def[key] = () => (value[key])));
337416
- /******/ }
337417
- /******/ def['default'] = () => (value);
337418
- /******/ __webpack_require__.d(ns, def);
337419
- /******/ return ns;
337420
- /******/ };
337421
- /******/ })();
337422
- /******/
337423
337258
  /******/ /* webpack/runtime/define property getters */
337424
337259
  /******/ // define getter/value functions for harmony exports
337425
337260
  /******/ __webpack_require__.d = (exports, definition) => {