@itwin/ecschema-rpcinterface-tests 5.14.3 → 5.14.5

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.
@@ -296069,7 +296069,7 @@ __webpack_require__.r(__webpack_exports__);
296069
296069
  /* harmony export */ });
296070
296070
  /* 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
296071
  /* 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");
296072
+ /* 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
296073
  /* harmony import */ var _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @itwin/core-bentley */ "../../core/bentley/lib/esm/core-bentley.js");
296074
296074
  /*---------------------------------------------------------------------------------------------
296075
296075
  * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
@@ -332733,534 +332733,382 @@ const isSafeIterable = (thing) =>
332733
332733
 
332734
332734
  /***/ },
332735
332735
 
332736
- /***/ "../../common/temp/node_modules/.pnpm/i18next-http-backend@3.0.6/node_modules/i18next-http-backend/esm/index.js"
332736
+ /***/ "../../common/temp/node_modules/.pnpm/i18next-http-backend@4.0.6/node_modules/i18next-http-backend/esm/index.js"
332737
332737
  /*!**********************************************************************************************************************!*\
332738
- !*** ../../common/temp/node_modules/.pnpm/i18next-http-backend@3.0.6/node_modules/i18next-http-backend/esm/index.js ***!
332738
+ !*** ../../common/temp/node_modules/.pnpm/i18next-http-backend@4.0.6/node_modules/i18next-http-backend/esm/index.js ***!
332739
332739
  \**********************************************************************************************************************/
332740
332740
  (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
332741
332741
 
332742
332742
  "use strict";
332743
332743
  __webpack_require__.r(__webpack_exports__);
332744
332744
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
332745
- /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
332745
+ /* harmony export */ "default": () => (/* binding */ Backend)
332746
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__)
332965
- /* 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
- }
332747
+ //#region lib/utils.js
332748
+ const arr = [];
332749
+ arr.forEach;
332750
+ arr.slice;
332751
+ const UNSAFE_KEYS$1 = [
332752
+ "__proto__",
332753
+ "constructor",
332754
+ "prototype"
332755
+ ];
333174
332756
  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;
332757
+ if (typeof v !== "string") return false;
332758
+ if (v.length === 0 || v.length > 128) return false;
332759
+ if (UNSAFE_KEYS$1.indexOf(v) > -1) return false;
332760
+ if (v.indexOf("..") > -1) return false;
332761
+ if (v.indexOf("\\") > -1) return false;
332762
+ if (/[?#%:&=;\s]/.test(v)) return false;
332763
+ if (/[\x00-\x1F\x7F]/.test(v)) return false;
332764
+ return true;
333183
332765
  }
333184
332766
  function isSafeLangUrlSegment(v) {
333185
- if (!isSafeUrlSegmentBase(v)) return false;
333186
- if (v.indexOf('/') > -1) return false;
333187
- return true;
332767
+ if (!isSafeUrlSegmentBase(v)) return false;
332768
+ if (v.indexOf("/") > -1 || v.indexOf("@") > -1) return false;
332769
+ return true;
333188
332770
  }
333189
332771
  function isSafeNsUrlSegment(v) {
333190
- return isSafeUrlSegmentBase(v);
332772
+ if (!isSafeUrlSegmentBase(v)) return false;
332773
+ if (v.indexOf("//") > -1) return false;
332774
+ return true;
333191
332775
  }
333192
- var isSafeUrlSegment = isSafeLangUrlSegment;
333193
- var SAFETY_CHECK_BY_KEY = {
333194
- lng: isSafeLangUrlSegment,
333195
- ns: isSafeNsUrlSegment
332776
+ const SAFETY_CHECK_BY_KEY = {
332777
+ lng: isSafeLangUrlSegment,
332778
+ ns: isSafeNsUrlSegment
333196
332779
  };
333197
332780
  function sanitizeLogValue(v) {
333198
- if (typeof v !== 'string') return v;
333199
- return v.replace(/[\r\n\x00-\x1F\x7F]/g, ' ');
332781
+ if (typeof v !== "string") return v;
332782
+ return v.replace(/[\r\n\x00-\x1F\x7F]/g, " ");
333200
332783
  }
333201
332784
  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
- }
332785
+ if (typeof u !== "string" || u.length === 0) return u;
332786
+ try {
332787
+ const parsed = new URL(u);
332788
+ if (parsed.username || parsed.password) {
332789
+ parsed.username = "";
332790
+ parsed.password = "";
332791
+ return parsed.toString();
332792
+ }
332793
+ return u;
332794
+ } catch (e) {
332795
+ return u.replace(/(\/\/)[^/@\s]+@/g, "$1");
332796
+ }
333214
332797
  }
333215
332798
  function hasXMLHttpRequest() {
333216
- return typeof XMLHttpRequest === 'function' || (typeof XMLHttpRequest === "undefined" ? "undefined" : _typeof(XMLHttpRequest)) === 'object';
332799
+ return typeof XMLHttpRequest === "function" || typeof XMLHttpRequest === "object";
333217
332800
  }
332801
+ /**
332802
+ * Determine whether the given `maybePromise` is a Promise.
332803
+ *
332804
+ * @param {*} maybePromise
332805
+ *
332806
+ * @returns {Boolean}
332807
+ */
333218
332808
  function isPromise(maybePromise) {
333219
- return !!maybePromise && typeof maybePromise.then === 'function';
332809
+ return !!maybePromise && typeof maybePromise.then === "function";
333220
332810
  }
332811
+ /**
332812
+ * Convert any value to a Promise than will resolve to this value.
332813
+ *
332814
+ * @param {*} maybePromise
332815
+ *
332816
+ * @returns {Promise}
332817
+ */
333221
332818
  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
- });
332819
+ if (isPromise(maybePromise)) return maybePromise;
332820
+ return Promise.resolve(maybePromise);
333235
332821
  }
332822
+ const interpolationRegexp = /\{\{(.+?)\}\}/g;
332823
+ const LEADING_DOUBLE_SLASH = /^[/\\]{2}/;
333236
332824
  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
- }
332825
+ let unsafe = false;
332826
+ const result = str.replace(interpolationRegexp, (match, key) => {
332827
+ const k = key.trim();
332828
+ if (UNSAFE_KEYS$1.indexOf(k) > -1) return match;
332829
+ const value = data[k];
332830
+ if (value == null) return match;
332831
+ const check = SAFETY_CHECK_BY_KEY[k] || isSafeLangUrlSegment;
332832
+ const segments = String(value).split("+");
332833
+ for (const seg of segments) if (!check(seg)) {
332834
+ unsafe = true;
332835
+ return match;
332836
+ }
332837
+ return segments.join("+");
332838
+ });
332839
+ if (unsafe) return null;
332840
+ if (LEADING_DOUBLE_SLASH.test(result) && !LEADING_DOUBLE_SLASH.test(str)) return null;
332841
+ return result;
332842
+ }
332843
+ //#endregion
332844
+ //#region lib/request.js
332845
+ const g = typeof globalThis !== "undefined" ? globalThis : typeof __webpack_require__.g !== "undefined" ? __webpack_require__.g : typeof window !== "undefined" ? window : void 0;
332846
+ let fetchApi;
332847
+ if (typeof fetch === "function") fetchApi = fetch;
332848
+ else if (g && typeof g.fetch === "function") fetchApi = g.fetch;
332849
+ const XmlHttpRequestApi = hasXMLHttpRequest() && g ? g.XMLHttpRequest : void 0;
332850
+ const ActiveXObjectApi = typeof ActiveXObject === "function" && g ? g.ActiveXObject : void 0;
332851
+ const UNSAFE_KEYS = [
332852
+ "__proto__",
332853
+ "constructor",
332854
+ "prototype"
332855
+ ];
332856
+ const addQueryString = (url, params) => {
332857
+ if (params && typeof params === "object") {
332858
+ let queryString = "";
332859
+ for (const paramName of Object.keys(params)) {
332860
+ if (UNSAFE_KEYS.indexOf(paramName) > -1) continue;
332861
+ queryString += "&" + encodeURIComponent(paramName) + "=" + encodeURIComponent(params[paramName]);
332862
+ }
332863
+ if (!queryString) return url;
332864
+ url = url + (url.indexOf("?") !== -1 ? "&" : "?") + queryString.slice(1);
332865
+ }
332866
+ return url;
332867
+ };
332868
+ const fetchIt = (url, fetchOptions, callback, altFetch) => {
332869
+ const resolver = (response) => {
332870
+ if (!response.ok) return callback(response.statusText || "Error", { status: response.status });
332871
+ response.text().then((data) => {
332872
+ callback(null, {
332873
+ status: response.status,
332874
+ data
332875
+ });
332876
+ }).catch(callback);
332877
+ };
332878
+ if (altFetch) {
332879
+ const altResponse = altFetch(url, fetchOptions);
332880
+ if (altResponse instanceof Promise) {
332881
+ altResponse.then(resolver).catch(callback);
332882
+ return;
332883
+ }
332884
+ }
332885
+ if (typeof fetch === "function") fetch(url, fetchOptions).then(resolver).catch(callback);
332886
+ else fetchApi(url, fetchOptions).then(resolver).catch(callback);
332887
+ };
332888
+ const requestWithFetch = (options, url, payload, callback) => {
332889
+ if (options.queryStringParams) url = addQueryString(url, options.queryStringParams);
332890
+ const headers = { ...typeof options.customHeaders === "function" ? options.customHeaders() : options.customHeaders };
332891
+ 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})`;
332892
+ if (payload) headers["Content-Type"] = "application/json";
332893
+ const reqOptions = typeof options.requestOptions === "function" ? options.requestOptions(payload) : options.requestOptions;
332894
+ const fetchOptions = {
332895
+ method: payload ? "POST" : "GET",
332896
+ body: payload ? options.stringify(payload) : void 0,
332897
+ headers,
332898
+ ...options._omitFetchOptions ? {} : reqOptions
332899
+ };
332900
+ const altFetch = typeof options.alternateFetch === "function" && options.alternateFetch.length >= 1 ? options.alternateFetch : void 0;
332901
+ try {
332902
+ fetchIt(url, fetchOptions, callback, altFetch);
332903
+ } catch (e) {
332904
+ if (!reqOptions || Object.keys(reqOptions).length === 0 || !e.message || e.message.indexOf("not implemented") < 0) return callback(e);
332905
+ try {
332906
+ Object.keys(reqOptions).forEach((opt) => {
332907
+ delete fetchOptions[opt];
332908
+ });
332909
+ fetchIt(url, fetchOptions, callback, altFetch);
332910
+ options._omitFetchOptions = true;
332911
+ } catch (err) {
332912
+ callback(err);
332913
+ }
332914
+ }
332915
+ };
332916
+ const requestWithXmlHttpRequest = (options, url, payload, callback) => {
332917
+ if (payload && typeof payload === "object") payload = addQueryString("", payload).slice(1);
332918
+ if (options.queryStringParams) url = addQueryString(url, options.queryStringParams);
332919
+ let completed = false;
332920
+ try {
332921
+ const x = XmlHttpRequestApi ? new XmlHttpRequestApi() : new ActiveXObjectApi("MSXML2.XMLHTTP.3.0");
332922
+ x.open(payload ? "POST" : "GET", url, 1);
332923
+ if (!options.crossDomain) x.setRequestHeader("X-Requested-With", "XMLHttpRequest");
332924
+ x.withCredentials = !!options.withCredentials;
332925
+ if (payload) x.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
332926
+ if (x.overrideMimeType) x.overrideMimeType("application/json");
332927
+ let h = options.customHeaders;
332928
+ h = typeof h === "function" ? h() : h;
332929
+ if (h) for (const i of Object.keys(h)) {
332930
+ if (UNSAFE_KEYS.indexOf(i) > -1) continue;
332931
+ x.setRequestHeader(i, h[i]);
332932
+ }
332933
+ x.onreadystatechange = () => {
332934
+ if (x.readyState > 3) {
332935
+ completed = true;
332936
+ callback(x.status >= 400 ? x.statusText : null, {
332937
+ status: x.status,
332938
+ data: x.responseText
332939
+ });
332940
+ }
332941
+ };
332942
+ x.send(payload);
332943
+ } catch (e) {
332944
+ if (completed) throw e;
332945
+ callback(e);
332946
+ }
332947
+ };
332948
+ const request = (options, url, payload, callback) => {
332949
+ if (typeof payload === "function") {
332950
+ callback = payload;
332951
+ payload = void 0;
332952
+ }
332953
+ callback = callback || (() => {});
332954
+ if (fetchApi && url.indexOf("file:") !== 0) return requestWithFetch(options, url, payload, callback);
332955
+ if (hasXMLHttpRequest() || typeof ActiveXObject === "function") return requestWithXmlHttpRequest(options, url, payload, callback);
332956
+ callback(/* @__PURE__ */ new Error("No fetch and no xhr implementation found!"));
332957
+ };
332958
+ //#endregion
332959
+ //#region lib/index.js
332960
+ const getDefaults = () => {
332961
+ return {
332962
+ loadPath: "/locales/{{lng}}/{{ns}}.json",
332963
+ addPath: "/locales/add/{{lng}}/{{ns}}",
332964
+ parse: (data) => JSON.parse(data),
332965
+ stringify: JSON.stringify,
332966
+ parsePayload: (namespace, key, fallbackValue) => ({ [key]: fallbackValue || "" }),
332967
+ parseLoadPayload: (languages, namespaces) => void 0,
332968
+ request,
332969
+ reloadInterval: typeof window !== "undefined" ? false : 3600 * 1e3,
332970
+ customHeaders: {},
332971
+ queryStringParams: {},
332972
+ crossDomain: false,
332973
+ withCredentials: false,
332974
+ overrideMimeType: false,
332975
+ requestOptions: {
332976
+ mode: "cors",
332977
+ credentials: "same-origin",
332978
+ cache: "default"
332979
+ }
332980
+ };
332981
+ };
332982
+ var Backend = class {
332983
+ constructor(services, options = {}, allOptions = {}) {
332984
+ this.services = services;
332985
+ this.options = options;
332986
+ this.allOptions = allOptions;
332987
+ this.type = "backend";
332988
+ this.init(services, options, allOptions);
332989
+ }
332990
+ init(services, options = {}, allOptions = {}) {
332991
+ this.services = services;
332992
+ this.options = {
332993
+ ...getDefaults(),
332994
+ ...this.options || {},
332995
+ ...options
332996
+ };
332997
+ this.allOptions = allOptions;
332998
+ if (this.services && this.options.reloadInterval) {
332999
+ const timer = setInterval(() => this.reload(), this.options.reloadInterval);
333000
+ if (typeof timer === "object" && typeof timer.unref === "function") timer.unref();
333001
+ }
333002
+ }
333003
+ readMulti(languages, namespaces, callback) {
333004
+ this._readAny(languages, languages, namespaces, namespaces, callback);
333005
+ }
333006
+ read(language, namespace, callback) {
333007
+ this._readAny([language], language, [namespace], namespace, callback);
333008
+ }
333009
+ _readAny(languages, loadUrlLanguages, namespaces, loadUrlNamespaces, callback) {
333010
+ let loadPath = this.options.loadPath;
333011
+ if (typeof this.options.loadPath === "function") loadPath = this.options.loadPath(languages, namespaces);
333012
+ loadPath = makePromise(loadPath);
333013
+ loadPath.then((resolvedLoadPath) => {
333014
+ if (!resolvedLoadPath) return callback(null, {});
333015
+ const url = interpolateUrl(resolvedLoadPath, {
333016
+ lng: languages.join("+"),
333017
+ ns: namespaces.join("+")
333018
+ });
333019
+ if (url == null) {
333020
+ const safeLngs = languages.map(sanitizeLogValue).join(", ");
333021
+ const safeNss = namespaces.map(sanitizeLogValue).join(", ");
333022
+ return callback(/* @__PURE__ */ new Error("i18next-http-backend: unsafe lng/ns value — refusing to build request URL for languages=[" + safeLngs + "] namespaces=[" + safeNss + "]"), false);
333023
+ }
333024
+ this.loadUrl(url, callback, loadUrlLanguages, loadUrlNamespaces);
333025
+ }, (err) => callback(err, false));
333026
+ }
333027
+ loadUrl(url, callback, languages, namespaces) {
333028
+ const lng = typeof languages === "string" ? [languages] : languages;
333029
+ const ns = typeof namespaces === "string" ? [namespaces] : namespaces;
333030
+ const payload = this.options.parseLoadPayload(lng, ns);
333031
+ const safeUrl = sanitizeLogValue(redactUrlCredentials(url));
333032
+ this.options.request(this.options, url, payload, (err, res) => {
333033
+ if (res && (res.status >= 500 && res.status < 600 || !res.status)) return callback("failed loading " + safeUrl + "; status code: " + res.status, true);
333034
+ if (res && res.status >= 400 && res.status < 500) return callback("failed loading " + safeUrl + "; status code: " + res.status, false);
333035
+ if (!res && err && err.message) {
333036
+ const errorMessage = err.message.toLowerCase();
333037
+ if ([
333038
+ "failed",
333039
+ "fetch",
333040
+ "network",
333041
+ "load"
333042
+ ].find((term) => errorMessage.indexOf(term) > -1)) return callback("failed loading " + safeUrl + ": " + sanitizeLogValue(err.message), true);
333043
+ }
333044
+ if (err) return callback(err, false);
333045
+ let ret, parseErr;
333046
+ try {
333047
+ if (typeof res.data === "string") ret = this.options.parse(res.data, languages, namespaces);
333048
+ else ret = res.data;
333049
+ } catch (e) {
333050
+ parseErr = "failed parsing " + safeUrl + " to json";
333051
+ }
333052
+ if (parseErr) return callback(parseErr, false);
333053
+ callback(null, ret);
333054
+ });
333055
+ }
333056
+ create(languages, namespace, key, fallbackValue, callback) {
333057
+ if (!this.options.addPath) return;
333058
+ if (typeof languages === "string") languages = [languages];
333059
+ const payload = this.options.parsePayload(namespace, key, fallbackValue);
333060
+ let finished = 0;
333061
+ const dataArray = [];
333062
+ const resArray = [];
333063
+ languages.forEach((lng) => {
333064
+ let addPath = this.options.addPath;
333065
+ if (typeof this.options.addPath === "function") addPath = this.options.addPath(lng, namespace);
333066
+ const url = interpolateUrl(addPath, {
333067
+ lng,
333068
+ ns: namespace
333069
+ });
333070
+ if (url == null) {
333071
+ finished += 1;
333072
+ if (callback && finished === languages.length) callback(dataArray, resArray);
333073
+ return;
333074
+ }
333075
+ this.options.request(this.options, url, payload, (data, res) => {
333076
+ finished += 1;
333077
+ dataArray.push(data);
333078
+ resArray.push(res);
333079
+ if (finished === languages.length) {
333080
+ if (typeof callback === "function") callback(dataArray, resArray);
333081
+ }
333082
+ });
333083
+ });
333084
+ }
333085
+ reload() {
333086
+ const { backendConnector, languageUtils, logger } = this.services;
333087
+ const currentLanguage = backendConnector.language;
333088
+ if (currentLanguage && currentLanguage.toLowerCase() === "cimode") return;
333089
+ const toLoad = [];
333090
+ const append = (lng) => {
333091
+ languageUtils.toResolveHierarchy(lng).forEach((l) => {
333092
+ if (toLoad.indexOf(l) < 0) toLoad.push(l);
333093
+ });
333094
+ };
333095
+ append(currentLanguage);
333096
+ if (this.allOptions.preload) this.allOptions.preload.forEach((l) => append(l));
333097
+ toLoad.forEach((lng) => {
333098
+ this.allOptions.ns.forEach((ns) => {
333099
+ backendConnector.read(lng, ns, "read", null, null, (err, data) => {
333100
+ if (err) logger.warn(`loading namespace ${ns} for language ${lng} failed`, err);
333101
+ if (!err && data) logger.log(`loaded namespace ${ns} for language ${lng}`, data);
333102
+ backendConnector.loaded(`${lng}|${ns}`, err, data);
333103
+ });
333104
+ });
333105
+ });
333106
+ }
333107
+ };
333108
+ Backend.type = "backend";
333109
+ //#endregion
333110
+
333111
+
333264
333112
 
333265
333113
  /***/ },
333266
333114
 
@@ -337329,7 +337177,7 @@ class WMS {
337329
337177
  (module) {
337330
337178
 
337331
337179
  "use strict";
337332
- module.exports = /*#__PURE__*/JSON.parse('{"name":"@itwin/core-frontend","version":"5.14.3","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.3","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"}}');
337180
+ module.exports = /*#__PURE__*/JSON.parse('{"name":"@itwin/core-frontend","version":"5.14.5","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
337181
 
337334
337182
  /***/ },
337335
337183
 
@@ -337390,36 +337238,6 @@ module.exports = /*#__PURE__*/JSON.parse('{"version":"01.00.00","sourceEcSchemaV
337390
337238
  /******/ return getter;
337391
337239
  /******/ };
337392
337240
  /******/
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
337241
  /******/ /* webpack/runtime/define property getters */
337424
337242
  /******/ // define getter/value functions for harmony exports
337425
337243
  /******/ __webpack_require__.d = (exports, definition) => {