mp-front-cli 0.0.54 → 0.0.55

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.
@@ -1,17 +1,18 @@
1
1
  var ve = Object.defineProperty;
2
- var we = (i, e, t) => e in i ? ve(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t;
3
- var $ = (i, e, t) => (we(i, typeof e != "symbol" ? e + "" : e, t), t);
4
- import { C as Re, f as pe } from "./custom-header-eeb04e28.js";
5
- import { S as ht } from "./custom-header-eeb04e28.js";
6
- import { MessageHandler as ne, LoadingHandler as M } from "./mp-front-cli-utils-rxjs.es.js";
7
- import { RxSubjectManager as dt } from "./mp-front-cli-utils-rxjs.es.js";
8
- import { t as Ne } from "./index-df4e0539.js";
2
+ var we = (i, t, e) => t in i ? ve(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
3
+ var $ = (i, t, e) => (we(i, typeof t != "symbol" ? t + "" : t, e), e);
4
+ import { C as Ne, f as q } from "./custom-header-db08aa72.js";
5
+ import { S as dt } from "./custom-header-db08aa72.js";
6
+ import { MessageHandler as ie, LoadingHandler as M } from "./mp-front-cli-utils-rxjs.es.js";
7
+ import { RxSubjectManager as mt } from "./mp-front-cli-utils-rxjs.es.js";
8
+ import { t as Re } from "./index-df4e0539.js";
9
9
  import { CustomLogger as Pe } from "./mp-front-cli-logger.es.js";
10
- import { of as w, switchMap as N, forkJoin as ie, catchError as me, EMPTY as ye, filter as be } from "rxjs";
11
- import { C as $e, c as re } from "./custom-encrypter-1573699a.js";
12
- import { C as Ce } from "./custom-encoder-05d6a9f1.js";
10
+ import { of as N, switchMap as R, forkJoin as re, catchError as me, EMPTY as ye, filter as xe } from "rxjs";
11
+ import { C as $e, v as ae } from "./custom-encrypter-e3901c44.js";
12
+ import { C as Ee } from "./custom-encoder-70a77460.js";
13
13
  import "crypto";
14
- const Ee = {
14
+ import "./v4-8464ab21.js";
15
+ const Ce = {
15
16
  type: "logger",
16
17
  log(i) {
17
18
  this.output("log", i);
@@ -22,50 +23,50 @@ const Ee = {
22
23
  error(i) {
23
24
  this.output("error", i);
24
25
  },
25
- output(i, e) {
26
- console && console[i] && console[i].apply(console, e);
26
+ output(i, t) {
27
+ console && console[i] && console[i].apply(console, t);
27
28
  }
28
29
  };
29
30
  class z {
30
- constructor(e) {
31
- let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
32
- this.init(e, t);
31
+ constructor(t) {
32
+ let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
33
+ this.init(t, e);
33
34
  }
34
- init(e) {
35
- let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
36
- this.prefix = t.prefix || "i18next:", this.logger = e || Ee, this.options = t, this.debug = t.debug;
35
+ init(t) {
36
+ let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
37
+ this.prefix = e.prefix || "i18next:", this.logger = t || Ce, this.options = e, this.debug = e.debug;
37
38
  }
38
39
  log() {
39
- for (var e = arguments.length, t = new Array(e), s = 0; s < e; s++)
40
- t[s] = arguments[s];
41
- return this.forward(t, "log", "", !0);
40
+ for (var t = arguments.length, e = new Array(t), s = 0; s < t; s++)
41
+ e[s] = arguments[s];
42
+ return this.forward(e, "log", "", !0);
42
43
  }
43
44
  warn() {
44
- for (var e = arguments.length, t = new Array(e), s = 0; s < e; s++)
45
- t[s] = arguments[s];
46
- return this.forward(t, "warn", "", !0);
45
+ for (var t = arguments.length, e = new Array(t), s = 0; s < t; s++)
46
+ e[s] = arguments[s];
47
+ return this.forward(e, "warn", "", !0);
47
48
  }
48
49
  error() {
49
- for (var e = arguments.length, t = new Array(e), s = 0; s < e; s++)
50
- t[s] = arguments[s];
51
- return this.forward(t, "error", "");
50
+ for (var t = arguments.length, e = new Array(t), s = 0; s < t; s++)
51
+ e[s] = arguments[s];
52
+ return this.forward(e, "error", "");
52
53
  }
53
54
  deprecate() {
54
- for (var e = arguments.length, t = new Array(e), s = 0; s < e; s++)
55
- t[s] = arguments[s];
56
- return this.forward(t, "warn", "WARNING DEPRECATED: ", !0);
55
+ for (var t = arguments.length, e = new Array(t), s = 0; s < t; s++)
56
+ e[s] = arguments[s];
57
+ return this.forward(e, "warn", "WARNING DEPRECATED: ", !0);
57
58
  }
58
- forward(e, t, s, n) {
59
- return n && !this.debug ? null : (typeof e[0] == "string" && (e[0] = `${s}${this.prefix} ${e[0]}`), this.logger[t](e));
59
+ forward(t, e, s, n) {
60
+ return n && !this.debug ? null : (typeof t[0] == "string" && (t[0] = `${s}${this.prefix} ${t[0]}`), this.logger[e](t));
60
61
  }
61
- create(e) {
62
+ create(t) {
62
63
  return new z(this.logger, {
63
- prefix: `${this.prefix}:${e}:`,
64
+ prefix: `${this.prefix}:${t}:`,
64
65
  ...this.options
65
66
  });
66
67
  }
67
- clone(e) {
68
- return e = e || this.options, e.prefix = e.prefix || this.prefix, new z(this.logger, e);
68
+ clone(t) {
69
+ return t = t || this.options, t.prefix = t.prefix || this.prefix, new z(this.logger, t);
69
70
  }
70
71
  }
71
72
  var P = new z();
@@ -73,99 +74,99 @@ class Q {
73
74
  constructor() {
74
75
  this.observers = {};
75
76
  }
76
- on(e, t) {
77
- return e.split(" ").forEach((s) => {
78
- this.observers[s] = this.observers[s] || [], this.observers[s].push(t);
77
+ on(t, e) {
78
+ return t.split(" ").forEach((s) => {
79
+ this.observers[s] = this.observers[s] || [], this.observers[s].push(e);
79
80
  }), this;
80
81
  }
81
- off(e, t) {
82
- if (this.observers[e]) {
83
- if (!t) {
84
- delete this.observers[e];
82
+ off(t, e) {
83
+ if (this.observers[t]) {
84
+ if (!e) {
85
+ delete this.observers[t];
85
86
  return;
86
87
  }
87
- this.observers[e] = this.observers[e].filter((s) => s !== t);
88
+ this.observers[t] = this.observers[t].filter((s) => s !== e);
88
89
  }
89
90
  }
90
- emit(e) {
91
- for (var t = arguments.length, s = new Array(t > 1 ? t - 1 : 0), n = 1; n < t; n++)
91
+ emit(t) {
92
+ for (var e = arguments.length, s = new Array(e > 1 ? e - 1 : 0), n = 1; n < e; n++)
92
93
  s[n - 1] = arguments[n];
93
- this.observers[e] && [].concat(this.observers[e]).forEach((a) => {
94
+ this.observers[t] && [].concat(this.observers[t]).forEach((a) => {
94
95
  a(...s);
95
96
  }), this.observers["*"] && [].concat(this.observers["*"]).forEach((a) => {
96
- a.apply(a, [e, ...s]);
97
+ a.apply(a, [t, ...s]);
97
98
  });
98
99
  }
99
100
  }
100
101
  function U() {
101
- let i, e;
102
- const t = new Promise((s, n) => {
103
- i = s, e = n;
102
+ let i, t;
103
+ const e = new Promise((s, n) => {
104
+ i = s, t = n;
104
105
  });
105
- return t.resolve = i, t.reject = e, t;
106
+ return e.resolve = i, e.reject = t, e;
106
107
  }
107
- function ae(i) {
108
+ function oe(i) {
108
109
  return i == null ? "" : "" + i;
109
110
  }
110
- function je(i, e, t) {
111
+ function je(i, t, e) {
111
112
  i.forEach((s) => {
112
- e[s] && (t[s] = e[s]);
113
+ t[s] && (e[s] = t[s]);
113
114
  });
114
115
  }
115
- function q(i, e, t) {
116
+ function _(i, t, e) {
116
117
  function s(a) {
117
118
  return a && a.indexOf("###") > -1 ? a.replace(/###/g, ".") : a;
118
119
  }
119
120
  function n() {
120
121
  return !i || typeof i == "string";
121
122
  }
122
- const r = typeof e != "string" ? [].concat(e) : e.split(".");
123
+ const r = typeof t != "string" ? [].concat(t) : t.split(".");
123
124
  for (; r.length > 1; ) {
124
125
  if (n())
125
126
  return {};
126
127
  const a = s(r.shift());
127
- !i[a] && t && (i[a] = new t()), Object.prototype.hasOwnProperty.call(i, a) ? i = i[a] : i = {};
128
+ !i[a] && e && (i[a] = new e()), Object.prototype.hasOwnProperty.call(i, a) ? i = i[a] : i = {};
128
129
  }
129
130
  return n() ? {} : {
130
131
  obj: i,
131
132
  k: s(r.shift())
132
133
  };
133
134
  }
134
- function oe(i, e, t) {
135
+ function le(i, t, e) {
135
136
  const {
136
137
  obj: s,
137
138
  k: n
138
- } = q(i, e, Object);
139
- s[n] = t;
139
+ } = _(i, t, Object);
140
+ s[n] = e;
140
141
  }
141
- function ke(i, e, t, s) {
142
+ function ke(i, t, e, s) {
142
143
  const {
143
144
  obj: n,
144
145
  k: r
145
- } = q(i, e, Object);
146
- n[r] = n[r] || [], s && (n[r] = n[r].concat(t)), s || n[r].push(t);
146
+ } = _(i, t, Object);
147
+ n[r] = n[r] || [], s && (n[r] = n[r].concat(e)), s || n[r].push(e);
147
148
  }
148
- function W(i, e) {
149
+ function W(i, t) {
149
150
  const {
150
- obj: t,
151
+ obj: e,
151
152
  k: s
152
- } = q(i, e);
153
- if (t)
154
- return t[s];
153
+ } = _(i, t);
154
+ if (e)
155
+ return e[s];
155
156
  }
156
- function Fe(i, e, t) {
157
- const s = W(i, t);
158
- return s !== void 0 ? s : W(e, t);
157
+ function De(i, t, e) {
158
+ const s = W(i, e);
159
+ return s !== void 0 ? s : W(t, e);
159
160
  }
160
- function xe(i, e, t) {
161
- for (const s in e)
162
- s !== "__proto__" && s !== "constructor" && (s in i ? typeof i[s] == "string" || i[s] instanceof String || typeof e[s] == "string" || e[s] instanceof String ? t && (i[s] = e[s]) : xe(i[s], e[s], t) : i[s] = e[s]);
161
+ function be(i, t, e) {
162
+ for (const s in t)
163
+ s !== "__proto__" && s !== "constructor" && (s in i ? typeof i[s] == "string" || i[s] instanceof String || typeof t[s] == "string" || t[s] instanceof String ? e && (i[s] = t[s]) : be(i[s], t[s], e) : i[s] = t[s]);
163
164
  return i;
164
165
  }
165
166
  function j(i) {
166
167
  return i.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
167
168
  }
168
- var Ae = {
169
+ var Fe = {
169
170
  "&": "&amp;",
170
171
  "<": "&lt;",
171
172
  ">": "&gt;",
@@ -173,50 +174,50 @@ var Ae = {
173
174
  "'": "&#39;",
174
175
  "/": "&#x2F;"
175
176
  };
176
- function De(i) {
177
- return typeof i == "string" ? i.replace(/[&<>"'\/]/g, (e) => Ae[e]) : i;
177
+ function Ae(i) {
178
+ return typeof i == "string" ? i.replace(/[&<>"'\/]/g, (t) => Fe[t]) : i;
178
179
  }
179
180
  const Ie = [" ", ",", "?", "!", ";"];
180
- function Ue(i, e, t) {
181
- e = e || "", t = t || "";
182
- const s = Ie.filter((a) => e.indexOf(a) < 0 && t.indexOf(a) < 0);
181
+ function Ue(i, t, e) {
182
+ t = t || "", e = e || "";
183
+ const s = Ie.filter((a) => t.indexOf(a) < 0 && e.indexOf(a) < 0);
183
184
  if (s.length === 0)
184
185
  return !0;
185
186
  const n = new RegExp(`(${s.map((a) => a === "?" ? "\\?" : a).join("|")})`);
186
187
  let r = !n.test(i);
187
188
  if (!r) {
188
- const a = i.indexOf(t);
189
+ const a = i.indexOf(e);
189
190
  a > 0 && !n.test(i.substring(0, a)) && (r = !0);
190
191
  }
191
192
  return r;
192
193
  }
193
- function Y(i, e) {
194
- let t = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : ".";
194
+ function Y(i, t) {
195
+ let e = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : ".";
195
196
  if (!i)
196
197
  return;
197
- if (i[e])
198
- return i[e];
199
- const s = e.split(t);
198
+ if (i[t])
199
+ return i[t];
200
+ const s = t.split(e);
200
201
  let n = i;
201
202
  for (let r = 0; r < s.length; ++r) {
202
203
  if (!n || typeof n[s[r]] == "string" && r + 1 < s.length)
203
204
  return;
204
205
  if (n[s[r]] === void 0) {
205
- let a = 2, l = s.slice(r, r + a).join(t), o = n[l];
206
+ let a = 2, l = s.slice(r, r + a).join(e), o = n[l];
206
207
  for (; o === void 0 && s.length > r + a; )
207
- a++, l = s.slice(r, r + a).join(t), o = n[l];
208
+ a++, l = s.slice(r, r + a).join(e), o = n[l];
208
209
  if (o === void 0)
209
210
  return;
210
211
  if (o === null)
211
212
  return null;
212
- if (e.endsWith(l)) {
213
+ if (t.endsWith(l)) {
213
214
  if (typeof o == "string")
214
215
  return o;
215
216
  if (l && typeof o[l] == "string")
216
217
  return o[l];
217
218
  }
218
- const f = s.slice(r + a).join(t);
219
- return f ? Y(o, f, t) : void 0;
219
+ const f = s.slice(r + a).join(e);
220
+ return f ? Y(o, f, e) : void 0;
220
221
  }
221
222
  n = n[s[r]];
222
223
  }
@@ -225,75 +226,75 @@ function Y(i, e) {
225
226
  function G(i) {
226
227
  return i && i.indexOf("_") > 0 ? i.replace("_", "-") : i;
227
228
  }
228
- class le extends Q {
229
- constructor(e) {
230
- let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {
229
+ class ue extends Q {
230
+ constructor(t) {
231
+ let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {
231
232
  ns: ["translation"],
232
233
  defaultNS: "translation"
233
234
  };
234
- super(), this.data = e || {}, this.options = t, this.options.keySeparator === void 0 && (this.options.keySeparator = "."), this.options.ignoreJSONStructure === void 0 && (this.options.ignoreJSONStructure = !0);
235
+ super(), this.data = t || {}, this.options = e, this.options.keySeparator === void 0 && (this.options.keySeparator = "."), this.options.ignoreJSONStructure === void 0 && (this.options.ignoreJSONStructure = !0);
235
236
  }
236
- addNamespaces(e) {
237
- this.options.ns.indexOf(e) < 0 && this.options.ns.push(e);
237
+ addNamespaces(t) {
238
+ this.options.ns.indexOf(t) < 0 && this.options.ns.push(t);
238
239
  }
239
- removeNamespaces(e) {
240
- const t = this.options.ns.indexOf(e);
241
- t > -1 && this.options.ns.splice(t, 1);
240
+ removeNamespaces(t) {
241
+ const e = this.options.ns.indexOf(t);
242
+ e > -1 && this.options.ns.splice(e, 1);
242
243
  }
243
- getResource(e, t, s) {
244
+ getResource(t, e, s) {
244
245
  let n = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
245
246
  const r = n.keySeparator !== void 0 ? n.keySeparator : this.options.keySeparator, a = n.ignoreJSONStructure !== void 0 ? n.ignoreJSONStructure : this.options.ignoreJSONStructure;
246
- let l = [e, t];
247
- s && typeof s != "string" && (l = l.concat(s)), s && typeof s == "string" && (l = l.concat(r ? s.split(r) : s)), e.indexOf(".") > -1 && (l = e.split("."));
247
+ let l = [t, e];
248
+ s && typeof s != "string" && (l = l.concat(s)), s && typeof s == "string" && (l = l.concat(r ? s.split(r) : s)), t.indexOf(".") > -1 && (l = t.split("."));
248
249
  const o = W(this.data, l);
249
- return o || !a || typeof s != "string" ? o : Y(this.data && this.data[e] && this.data[e][t], s, r);
250
+ return o || !a || typeof s != "string" ? o : Y(this.data && this.data[t] && this.data[t][e], s, r);
250
251
  }
251
- addResource(e, t, s, n) {
252
+ addResource(t, e, s, n) {
252
253
  let r = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : {
253
254
  silent: !1
254
255
  };
255
256
  const a = r.keySeparator !== void 0 ? r.keySeparator : this.options.keySeparator;
256
- let l = [e, t];
257
- s && (l = l.concat(a ? s.split(a) : s)), e.indexOf(".") > -1 && (l = e.split("."), n = t, t = l[1]), this.addNamespaces(t), oe(this.data, l, n), r.silent || this.emit("added", e, t, s, n);
257
+ let l = [t, e];
258
+ s && (l = l.concat(a ? s.split(a) : s)), t.indexOf(".") > -1 && (l = t.split("."), n = e, e = l[1]), this.addNamespaces(e), le(this.data, l, n), r.silent || this.emit("added", t, e, s, n);
258
259
  }
259
- addResources(e, t, s) {
260
+ addResources(t, e, s) {
260
261
  let n = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {
261
262
  silent: !1
262
263
  };
263
264
  for (const r in s)
264
- (typeof s[r] == "string" || Object.prototype.toString.apply(s[r]) === "[object Array]") && this.addResource(e, t, r, s[r], {
265
+ (typeof s[r] == "string" || Object.prototype.toString.apply(s[r]) === "[object Array]") && this.addResource(t, e, r, s[r], {
265
266
  silent: !0
266
267
  });
267
- n.silent || this.emit("added", e, t, s);
268
+ n.silent || this.emit("added", t, e, s);
268
269
  }
269
- addResourceBundle(e, t, s, n, r) {
270
+ addResourceBundle(t, e, s, n, r) {
270
271
  let a = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : {
271
272
  silent: !1
272
- }, l = [e, t];
273
- e.indexOf(".") > -1 && (l = e.split("."), n = s, s = t, t = l[1]), this.addNamespaces(t);
273
+ }, l = [t, e];
274
+ t.indexOf(".") > -1 && (l = t.split("."), n = s, s = e, e = l[1]), this.addNamespaces(e);
274
275
  let o = W(this.data, l) || {};
275
- n ? xe(o, s, r) : o = {
276
+ n ? be(o, s, r) : o = {
276
277
  ...o,
277
278
  ...s
278
- }, oe(this.data, l, o), a.silent || this.emit("added", e, t, s);
279
+ }, le(this.data, l, o), a.silent || this.emit("added", t, e, s);
279
280
  }
280
- removeResourceBundle(e, t) {
281
- this.hasResourceBundle(e, t) && delete this.data[e][t], this.removeNamespaces(t), this.emit("removed", e, t);
281
+ removeResourceBundle(t, e) {
282
+ this.hasResourceBundle(t, e) && delete this.data[t][e], this.removeNamespaces(e), this.emit("removed", t, e);
282
283
  }
283
- hasResourceBundle(e, t) {
284
- return this.getResource(e, t) !== void 0;
284
+ hasResourceBundle(t, e) {
285
+ return this.getResource(t, e) !== void 0;
285
286
  }
286
- getResourceBundle(e, t) {
287
- return t || (t = this.options.defaultNS), this.options.compatibilityAPI === "v1" ? {
288
- ...this.getResource(e, t)
289
- } : this.getResource(e, t);
287
+ getResourceBundle(t, e) {
288
+ return e || (e = this.options.defaultNS), this.options.compatibilityAPI === "v1" ? {
289
+ ...this.getResource(t, e)
290
+ } : this.getResource(t, e);
290
291
  }
291
- getDataByLanguage(e) {
292
- return this.data[e];
292
+ getDataByLanguage(t) {
293
+ return this.data[t];
293
294
  }
294
- hasLanguageSomeTranslations(e) {
295
- const t = this.getDataByLanguage(e);
296
- return !!(t && Object.keys(t) || []).find((n) => t[n] && Object.keys(t[n]).length > 0);
295
+ hasLanguageSomeTranslations(t) {
296
+ const e = this.getDataByLanguage(t);
297
+ return !!(e && Object.keys(e) || []).find((n) => e[n] && Object.keys(e[n]).length > 0);
297
298
  }
298
299
  toJSON() {
299
300
  return this.data;
@@ -304,71 +305,71 @@ var Se = {
304
305
  addPostProcessor(i) {
305
306
  this.processors[i.name] = i;
306
307
  },
307
- handle(i, e, t, s, n) {
308
+ handle(i, t, e, s, n) {
308
309
  return i.forEach((r) => {
309
- this.processors[r] && (e = this.processors[r].process(e, t, s, n));
310
- }), e;
310
+ this.processors[r] && (t = this.processors[r].process(t, e, s, n));
311
+ }), t;
311
312
  }
312
313
  };
313
- const ue = {};
314
+ const fe = {};
314
315
  class Z extends Q {
315
- constructor(e) {
316
- let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
317
- super(), je(["resourceStore", "languageUtils", "pluralResolver", "interpolator", "backendConnector", "i18nFormat", "utils"], e, this), this.options = t, this.options.keySeparator === void 0 && (this.options.keySeparator = "."), this.logger = P.create("translator");
316
+ constructor(t) {
317
+ let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
318
+ super(), je(["resourceStore", "languageUtils", "pluralResolver", "interpolator", "backendConnector", "i18nFormat", "utils"], t, this), this.options = e, this.options.keySeparator === void 0 && (this.options.keySeparator = "."), this.logger = P.create("translator");
318
319
  }
319
- changeLanguage(e) {
320
- e && (this.language = e);
320
+ changeLanguage(t) {
321
+ t && (this.language = t);
321
322
  }
322
- exists(e) {
323
- let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {
323
+ exists(t) {
324
+ let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {
324
325
  interpolation: {}
325
326
  };
326
- if (e == null)
327
+ if (t == null)
327
328
  return !1;
328
- const s = this.resolve(e, t);
329
+ const s = this.resolve(t, e);
329
330
  return s && s.res !== void 0;
330
331
  }
331
- extractFromKey(e, t) {
332
- let s = t.nsSeparator !== void 0 ? t.nsSeparator : this.options.nsSeparator;
332
+ extractFromKey(t, e) {
333
+ let s = e.nsSeparator !== void 0 ? e.nsSeparator : this.options.nsSeparator;
333
334
  s === void 0 && (s = ":");
334
- const n = t.keySeparator !== void 0 ? t.keySeparator : this.options.keySeparator;
335
- let r = t.ns || this.options.defaultNS || [];
336
- const a = s && e.indexOf(s) > -1, l = !this.options.userDefinedKeySeparator && !t.keySeparator && !this.options.userDefinedNsSeparator && !t.nsSeparator && !Ue(e, s, n);
335
+ const n = e.keySeparator !== void 0 ? e.keySeparator : this.options.keySeparator;
336
+ let r = e.ns || this.options.defaultNS || [];
337
+ const a = s && t.indexOf(s) > -1, l = !this.options.userDefinedKeySeparator && !e.keySeparator && !this.options.userDefinedNsSeparator && !e.nsSeparator && !Ue(t, s, n);
337
338
  if (a && !l) {
338
- const o = e.match(this.interpolator.nestingRegexp);
339
+ const o = t.match(this.interpolator.nestingRegexp);
339
340
  if (o && o.length > 0)
340
341
  return {
341
- key: e,
342
+ key: t,
342
343
  namespaces: r
343
344
  };
344
- const f = e.split(s);
345
- (s !== n || s === n && this.options.ns.indexOf(f[0]) > -1) && (r = f.shift()), e = f.join(n);
345
+ const f = t.split(s);
346
+ (s !== n || s === n && this.options.ns.indexOf(f[0]) > -1) && (r = f.shift()), t = f.join(n);
346
347
  }
347
348
  return typeof r == "string" && (r = [r]), {
348
- key: e,
349
+ key: t,
349
350
  namespaces: r
350
351
  };
351
352
  }
352
- translate(e, t, s) {
353
- if (typeof t != "object" && this.options.overloadTranslationOptionHandler && (t = this.options.overloadTranslationOptionHandler(arguments)), typeof t == "object" && (t = {
354
- ...t
355
- }), t || (t = {}), e == null)
353
+ translate(t, e, s) {
354
+ if (typeof e != "object" && this.options.overloadTranslationOptionHandler && (e = this.options.overloadTranslationOptionHandler(arguments)), typeof e == "object" && (e = {
355
+ ...e
356
+ }), e || (e = {}), t == null)
356
357
  return "";
357
- Array.isArray(e) || (e = [String(e)]);
358
- const n = t.returnDetails !== void 0 ? t.returnDetails : this.options.returnDetails, r = t.keySeparator !== void 0 ? t.keySeparator : this.options.keySeparator, {
358
+ Array.isArray(t) || (t = [String(t)]);
359
+ const n = e.returnDetails !== void 0 ? e.returnDetails : this.options.returnDetails, r = e.keySeparator !== void 0 ? e.keySeparator : this.options.keySeparator, {
359
360
  key: a,
360
361
  namespaces: l
361
- } = this.extractFromKey(e[e.length - 1], t), o = l[l.length - 1], f = t.lng || this.language, g = t.appendNamespaceToCIMode || this.options.appendNamespaceToCIMode;
362
+ } = this.extractFromKey(t[t.length - 1], e), o = l[l.length - 1], f = e.lng || this.language, g = e.appendNamespaceToCIMode || this.options.appendNamespaceToCIMode;
362
363
  if (f && f.toLowerCase() === "cimode") {
363
364
  if (g) {
364
- const y = t.nsSeparator || this.options.nsSeparator;
365
+ const y = e.nsSeparator || this.options.nsSeparator;
365
366
  return n ? {
366
367
  res: `${o}${y}${a}`,
367
368
  usedKey: a,
368
369
  exactUsedKey: a,
369
370
  usedLng: f,
370
371
  usedNS: o,
371
- usedParams: this.getUsedParamsDetails(t)
372
+ usedParams: this.getUsedParamsDetails(e)
372
373
  } : `${o}${y}${a}`;
373
374
  }
374
375
  return n ? {
@@ -377,77 +378,77 @@ class Z extends Q {
377
378
  exactUsedKey: a,
378
379
  usedLng: f,
379
380
  usedNS: o,
380
- usedParams: this.getUsedParamsDetails(t)
381
+ usedParams: this.getUsedParamsDetails(e)
381
382
  } : a;
382
383
  }
383
- const h = this.resolve(e, t);
384
+ const h = this.resolve(t, e);
384
385
  let u = h && h.res;
385
- const d = h && h.usedKey || a, c = h && h.exactUsedKey || a, p = Object.prototype.toString.apply(u), m = ["[object Number]", "[object Function]", "[object RegExp]"], L = t.joinArrays !== void 0 ? t.joinArrays : this.options.joinArrays, x = !this.i18nFormat || this.i18nFormat.handleAsObject;
386
- if (x && u && (typeof u != "string" && typeof u != "boolean" && typeof u != "number") && m.indexOf(p) < 0 && !(typeof L == "string" && p === "[object Array]")) {
387
- if (!t.returnObjects && !this.options.returnObjects) {
386
+ const d = h && h.usedKey || a, c = h && h.exactUsedKey || a, p = Object.prototype.toString.apply(u), m = ["[object Number]", "[object Function]", "[object RegExp]"], O = e.joinArrays !== void 0 ? e.joinArrays : this.options.joinArrays, b = !this.i18nFormat || this.i18nFormat.handleAsObject;
387
+ if (b && u && (typeof u != "string" && typeof u != "boolean" && typeof u != "number") && m.indexOf(p) < 0 && !(typeof O == "string" && p === "[object Array]")) {
388
+ if (!e.returnObjects && !this.options.returnObjects) {
388
389
  this.options.returnedObjectHandler || this.logger.warn("accessing an object - but returnObjects options is not enabled!");
389
390
  const y = this.options.returnedObjectHandler ? this.options.returnedObjectHandler(d, u, {
390
- ...t,
391
+ ...e,
391
392
  ns: l
392
393
  }) : `key '${a} (${this.language})' returned an object instead of string.`;
393
- return n ? (h.res = y, h.usedParams = this.getUsedParamsDetails(t), h) : y;
394
+ return n ? (h.res = y, h.usedParams = this.getUsedParamsDetails(e), h) : y;
394
395
  }
395
396
  if (r) {
396
- const y = p === "[object Array]", O = y ? [] : {}, R = y ? c : d;
397
+ const y = p === "[object Array]", L = y ? [] : {}, w = y ? c : d;
397
398
  for (const S in u)
398
399
  if (Object.prototype.hasOwnProperty.call(u, S)) {
399
- const K = `${R}${r}${S}`;
400
- O[S] = this.translate(K, {
401
- ...t,
400
+ const V = `${w}${r}${S}`;
401
+ L[S] = this.translate(V, {
402
+ ...e,
402
403
  joinArrays: !1,
403
404
  ns: l
404
- }), O[S] === K && (O[S] = u[S]);
405
+ }), L[S] === V && (L[S] = u[S]);
405
406
  }
406
- u = O;
407
+ u = L;
407
408
  }
408
- } else if (x && typeof L == "string" && p === "[object Array]")
409
- u = u.join(L), u && (u = this.extendTranslation(u, e, t, s));
409
+ } else if (b && typeof O == "string" && p === "[object Array]")
410
+ u = u.join(O), u && (u = this.extendTranslation(u, t, e, s));
410
411
  else {
411
- let y = !1, O = !1;
412
- const R = t.count !== void 0 && typeof t.count != "string", S = Z.hasDefaultValue(t), K = R ? this.pluralResolver.getSuffix(f, t.count, t) : "", Le = t.ordinal && R ? this.pluralResolver.getSuffix(f, t.count, {
412
+ let y = !1, L = !1;
413
+ const w = e.count !== void 0 && typeof e.count != "string", S = Z.hasDefaultValue(e), V = w ? this.pluralResolver.getSuffix(f, e.count, e) : "", Oe = e.ordinal && w ? this.pluralResolver.getSuffix(f, e.count, {
413
414
  ordinal: !1
414
- }) : "", ee = R && !t.ordinal && t.count === 0 && this.pluralResolver.shouldUseIntlApi(), F = ee && t[`defaultValue${this.options.pluralSeparator}zero`] || t[`defaultValue${K}`] || t[`defaultValue${Le}`] || t.defaultValue;
415
- !this.isValidLookup(u) && S && (y = !0, u = F), this.isValidLookup(u) || (O = !0, u = a);
416
- const Oe = (t.missingKeyNoValueFallbackToKey || this.options.missingKeyNoValueFallbackToKey) && O ? void 0 : u, A = S && F !== u && this.options.updateMissing;
417
- if (O || y || A) {
418
- if (this.logger.log(A ? "updateKey" : "missingKey", f, o, a, A ? F : u), r) {
415
+ }) : "", te = w && !e.ordinal && e.count === 0 && this.pluralResolver.shouldUseIntlApi(), D = te && e[`defaultValue${this.options.pluralSeparator}zero`] || e[`defaultValue${V}`] || e[`defaultValue${Oe}`] || e.defaultValue;
416
+ !this.isValidLookup(u) && S && (y = !0, u = D), this.isValidLookup(u) || (L = !0, u = a);
417
+ const Le = (e.missingKeyNoValueFallbackToKey || this.options.missingKeyNoValueFallbackToKey) && L ? void 0 : u, F = S && D !== u && this.options.updateMissing;
418
+ if (L || y || F) {
419
+ if (this.logger.log(F ? "updateKey" : "missingKey", f, o, a, F ? D : u), r) {
419
420
  const v = this.resolve(a, {
420
- ...t,
421
+ ...e,
421
422
  keySeparator: !1
422
423
  });
423
424
  v && v.res && this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.");
424
425
  }
425
- let D = [];
426
- const B = this.languageUtils.getFallbackCodes(this.options.fallbackLng, t.lng || this.language);
427
- if (this.options.saveMissingTo === "fallback" && B && B[0])
428
- for (let v = 0; v < B.length; v++)
429
- D.push(B[v]);
426
+ let A = [];
427
+ const K = this.languageUtils.getFallbackCodes(this.options.fallbackLng, e.lng || this.language);
428
+ if (this.options.saveMissingTo === "fallback" && K && K[0])
429
+ for (let v = 0; v < K.length; v++)
430
+ A.push(K[v]);
430
431
  else
431
- this.options.saveMissingTo === "all" ? D = this.languageUtils.toResolveHierarchy(t.lng || this.language) : D.push(t.lng || this.language);
432
- const te = (v, E, I) => {
433
- const se = S && I !== u ? I : Oe;
434
- this.options.missingKeyHandler ? this.options.missingKeyHandler(v, o, E, se, A, t) : this.backendConnector && this.backendConnector.saveMissing && this.backendConnector.saveMissing(v, o, E, se, A, t), this.emit("missingKey", v, o, E, u);
432
+ this.options.saveMissingTo === "all" ? A = this.languageUtils.toResolveHierarchy(e.lng || this.language) : A.push(e.lng || this.language);
433
+ const se = (v, C, I) => {
434
+ const ne = S && I !== u ? I : Le;
435
+ this.options.missingKeyHandler ? this.options.missingKeyHandler(v, o, C, ne, F, e) : this.backendConnector && this.backendConnector.saveMissing && this.backendConnector.saveMissing(v, o, C, ne, F, e), this.emit("missingKey", v, o, C, u);
435
436
  };
436
- this.options.saveMissing && (this.options.saveMissingPlurals && R ? D.forEach((v) => {
437
- const E = this.pluralResolver.getSuffixes(v, t);
438
- ee && t[`defaultValue${this.options.pluralSeparator}zero`] && E.indexOf(`${this.options.pluralSeparator}zero`) < 0 && E.push(`${this.options.pluralSeparator}zero`), E.forEach((I) => {
439
- te([v], a + I, t[`defaultValue${I}`] || F);
437
+ this.options.saveMissing && (this.options.saveMissingPlurals && w ? A.forEach((v) => {
438
+ const C = this.pluralResolver.getSuffixes(v, e);
439
+ te && e[`defaultValue${this.options.pluralSeparator}zero`] && C.indexOf(`${this.options.pluralSeparator}zero`) < 0 && C.push(`${this.options.pluralSeparator}zero`), C.forEach((I) => {
440
+ se([v], a + I, e[`defaultValue${I}`] || D);
440
441
  });
441
- }) : te(D, a, F));
442
+ }) : se(A, a, D));
442
443
  }
443
- u = this.extendTranslation(u, e, t, h, s), O && u === a && this.options.appendNamespaceToMissingKey && (u = `${o}:${a}`), (O || y) && this.options.parseMissingKeyHandler && (this.options.compatibilityAPI !== "v1" ? u = this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey ? `${o}:${a}` : a, y ? u : void 0) : u = this.options.parseMissingKeyHandler(u));
444
+ u = this.extendTranslation(u, t, e, h, s), L && u === a && this.options.appendNamespaceToMissingKey && (u = `${o}:${a}`), (L || y) && this.options.parseMissingKeyHandler && (this.options.compatibilityAPI !== "v1" ? u = this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey ? `${o}:${a}` : a, y ? u : void 0) : u = this.options.parseMissingKeyHandler(u));
444
445
  }
445
- return n ? (h.res = u, h.usedParams = this.getUsedParamsDetails(t), h) : u;
446
+ return n ? (h.res = u, h.usedParams = this.getUsedParamsDetails(e), h) : u;
446
447
  }
447
- extendTranslation(e, t, s, n, r) {
448
+ extendTranslation(t, e, s, n, r) {
448
449
  var a = this;
449
450
  if (this.i18nFormat && this.i18nFormat.parse)
450
- e = this.i18nFormat.parse(e, {
451
+ t = this.i18nFormat.parse(t, {
451
452
  ...this.options.interpolation.defaultVariables,
452
453
  ...s
453
454
  }, s.lng || this.language || n.usedLng, n.usedNS, n.usedKey, {
@@ -461,65 +462,65 @@ class Z extends Q {
461
462
  ...s.interpolation
462
463
  }
463
464
  });
464
- const f = typeof e == "string" && (s && s.interpolation && s.interpolation.skipOnVariables !== void 0 ? s.interpolation.skipOnVariables : this.options.interpolation.skipOnVariables);
465
+ const f = typeof t == "string" && (s && s.interpolation && s.interpolation.skipOnVariables !== void 0 ? s.interpolation.skipOnVariables : this.options.interpolation.skipOnVariables);
465
466
  let g;
466
467
  if (f) {
467
- const u = e.match(this.interpolator.nestingRegexp);
468
+ const u = t.match(this.interpolator.nestingRegexp);
468
469
  g = u && u.length;
469
470
  }
470
471
  let h = s.replace && typeof s.replace != "string" ? s.replace : s;
471
472
  if (this.options.interpolation.defaultVariables && (h = {
472
473
  ...this.options.interpolation.defaultVariables,
473
474
  ...h
474
- }), e = this.interpolator.interpolate(e, h, s.lng || this.language, s), f) {
475
- const u = e.match(this.interpolator.nestingRegexp), d = u && u.length;
475
+ }), t = this.interpolator.interpolate(t, h, s.lng || this.language, s), f) {
476
+ const u = t.match(this.interpolator.nestingRegexp), d = u && u.length;
476
477
  g < d && (s.nest = !1);
477
478
  }
478
- !s.lng && this.options.compatibilityAPI !== "v1" && n && n.res && (s.lng = n.usedLng), s.nest !== !1 && (e = this.interpolator.nest(e, function() {
479
+ !s.lng && this.options.compatibilityAPI !== "v1" && n && n.res && (s.lng = n.usedLng), s.nest !== !1 && (t = this.interpolator.nest(t, function() {
479
480
  for (var u = arguments.length, d = new Array(u), c = 0; c < u; c++)
480
481
  d[c] = arguments[c];
481
- return r && r[0] === d[0] && !s.context ? (a.logger.warn(`It seems you are nesting recursively key: ${d[0]} in key: ${t[0]}`), null) : a.translate(...d, t);
482
+ return r && r[0] === d[0] && !s.context ? (a.logger.warn(`It seems you are nesting recursively key: ${d[0]} in key: ${e[0]}`), null) : a.translate(...d, e);
482
483
  }, s)), s.interpolation && this.interpolator.reset();
483
484
  }
484
485
  const l = s.postProcess || this.options.postProcess, o = typeof l == "string" ? [l] : l;
485
- return e != null && o && o.length && s.applyPostProcessor !== !1 && (e = Se.handle(o, e, t, this.options && this.options.postProcessPassResolved ? {
486
+ return t != null && o && o.length && s.applyPostProcessor !== !1 && (t = Se.handle(o, t, e, this.options && this.options.postProcessPassResolved ? {
486
487
  i18nResolved: {
487
488
  ...n,
488
489
  usedParams: this.getUsedParamsDetails(s)
489
490
  },
490
491
  ...s
491
- } : s, this)), e;
492
+ } : s, this)), t;
492
493
  }
493
- resolve(e) {
494
- let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, s, n, r, a, l;
495
- return typeof e == "string" && (e = [e]), e.forEach((o) => {
494
+ resolve(t) {
495
+ let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, s, n, r, a, l;
496
+ return typeof t == "string" && (t = [t]), t.forEach((o) => {
496
497
  if (this.isValidLookup(s))
497
498
  return;
498
- const f = this.extractFromKey(o, t), g = f.key;
499
+ const f = this.extractFromKey(o, e), g = f.key;
499
500
  n = g;
500
501
  let h = f.namespaces;
501
502
  this.options.fallbackNS && (h = h.concat(this.options.fallbackNS));
502
- const u = t.count !== void 0 && typeof t.count != "string", d = u && !t.ordinal && t.count === 0 && this.pluralResolver.shouldUseIntlApi(), c = t.context !== void 0 && (typeof t.context == "string" || typeof t.context == "number") && t.context !== "", p = t.lngs ? t.lngs : this.languageUtils.toResolveHierarchy(t.lng || this.language, t.fallbackLng);
503
+ const u = e.count !== void 0 && typeof e.count != "string", d = u && !e.ordinal && e.count === 0 && this.pluralResolver.shouldUseIntlApi(), c = e.context !== void 0 && (typeof e.context == "string" || typeof e.context == "number") && e.context !== "", p = e.lngs ? e.lngs : this.languageUtils.toResolveHierarchy(e.lng || this.language, e.fallbackLng);
503
504
  h.forEach((m) => {
504
- this.isValidLookup(s) || (l = m, !ue[`${p[0]}-${m}`] && this.utils && this.utils.hasLoadedNamespace && !this.utils.hasLoadedNamespace(l) && (ue[`${p[0]}-${m}`] = !0, this.logger.warn(`key "${n}" for languages "${p.join(", ")}" won't get resolved as namespace "${l}" was not yet loaded`, "This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")), p.forEach((L) => {
505
+ this.isValidLookup(s) || (l = m, !fe[`${p[0]}-${m}`] && this.utils && this.utils.hasLoadedNamespace && !this.utils.hasLoadedNamespace(l) && (fe[`${p[0]}-${m}`] = !0, this.logger.warn(`key "${n}" for languages "${p.join(", ")}" won't get resolved as namespace "${l}" was not yet loaded`, "This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")), p.forEach((O) => {
505
506
  if (this.isValidLookup(s))
506
507
  return;
507
- a = L;
508
- const x = [g];
508
+ a = O;
509
+ const b = [g];
509
510
  if (this.i18nFormat && this.i18nFormat.addLookupKeys)
510
- this.i18nFormat.addLookupKeys(x, g, L, m, t);
511
+ this.i18nFormat.addLookupKeys(b, g, O, m, e);
511
512
  else {
512
513
  let y;
513
- u && (y = this.pluralResolver.getSuffix(L, t.count, t));
514
- const O = `${this.options.pluralSeparator}zero`, R = `${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;
515
- if (u && (x.push(g + y), t.ordinal && y.indexOf(R) === 0 && x.push(g + y.replace(R, this.options.pluralSeparator)), d && x.push(g + O)), c) {
516
- const S = `${g}${this.options.contextSeparator}${t.context}`;
517
- x.push(S), u && (x.push(S + y), t.ordinal && y.indexOf(R) === 0 && x.push(S + y.replace(R, this.options.pluralSeparator)), d && x.push(S + O));
514
+ u && (y = this.pluralResolver.getSuffix(O, e.count, e));
515
+ const L = `${this.options.pluralSeparator}zero`, w = `${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;
516
+ if (u && (b.push(g + y), e.ordinal && y.indexOf(w) === 0 && b.push(g + y.replace(w, this.options.pluralSeparator)), d && b.push(g + L)), c) {
517
+ const S = `${g}${this.options.contextSeparator}${e.context}`;
518
+ b.push(S), u && (b.push(S + y), e.ordinal && y.indexOf(w) === 0 && b.push(S + y.replace(w, this.options.pluralSeparator)), d && b.push(S + L));
518
519
  }
519
520
  }
520
- let V;
521
- for (; V = x.pop(); )
522
- this.isValidLookup(s) || (r = V, s = this.getResource(L, m, V, t));
521
+ let B;
522
+ for (; B = b.pop(); )
523
+ this.isValidLookup(s) || (r = B, s = this.getResource(O, m, B, e));
523
524
  }));
524
525
  });
525
526
  }), {
@@ -530,33 +531,33 @@ class Z extends Q {
530
531
  usedNS: l
531
532
  };
532
533
  }
533
- isValidLookup(e) {
534
- return e !== void 0 && !(!this.options.returnNull && e === null) && !(!this.options.returnEmptyString && e === "");
534
+ isValidLookup(t) {
535
+ return t !== void 0 && !(!this.options.returnNull && t === null) && !(!this.options.returnEmptyString && t === "");
535
536
  }
536
- getResource(e, t, s) {
537
+ getResource(t, e, s) {
537
538
  let n = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
538
- return this.i18nFormat && this.i18nFormat.getResource ? this.i18nFormat.getResource(e, t, s, n) : this.resourceStore.getResource(e, t, s, n);
539
+ return this.i18nFormat && this.i18nFormat.getResource ? this.i18nFormat.getResource(t, e, s, n) : this.resourceStore.getResource(t, e, s, n);
539
540
  }
540
541
  getUsedParamsDetails() {
541
- let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
542
- const t = ["defaultValue", "ordinal", "context", "replace", "lng", "lngs", "fallbackLng", "ns", "keySeparator", "nsSeparator", "returnObjects", "returnDetails", "joinArrays", "postProcess", "interpolation"], s = e.replace && typeof e.replace != "string";
543
- let n = s ? e.replace : e;
544
- if (s && typeof e.count < "u" && (n.count = e.count), this.options.interpolation.defaultVariables && (n = {
542
+ let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
543
+ const e = ["defaultValue", "ordinal", "context", "replace", "lng", "lngs", "fallbackLng", "ns", "keySeparator", "nsSeparator", "returnObjects", "returnDetails", "joinArrays", "postProcess", "interpolation"], s = t.replace && typeof t.replace != "string";
544
+ let n = s ? t.replace : t;
545
+ if (s && typeof t.count < "u" && (n.count = t.count), this.options.interpolation.defaultVariables && (n = {
545
546
  ...this.options.interpolation.defaultVariables,
546
547
  ...n
547
548
  }), !s) {
548
549
  n = {
549
550
  ...n
550
551
  };
551
- for (const r of t)
552
+ for (const r of e)
552
553
  delete n[r];
553
554
  }
554
555
  return n;
555
556
  }
556
- static hasDefaultValue(e) {
557
- const t = "defaultValue";
558
- for (const s in e)
559
- if (Object.prototype.hasOwnProperty.call(e, s) && t === s.substring(0, t.length) && e[s] !== void 0)
557
+ static hasDefaultValue(t) {
558
+ const e = "defaultValue";
559
+ for (const s in t)
560
+ if (Object.prototype.hasOwnProperty.call(t, s) && e === s.substring(0, e.length) && t[s] !== void 0)
560
561
  return !0;
561
562
  return !1;
562
563
  }
@@ -564,71 +565,71 @@ class Z extends Q {
564
565
  function X(i) {
565
566
  return i.charAt(0).toUpperCase() + i.slice(1);
566
567
  }
567
- class fe {
568
- constructor(e) {
569
- this.options = e, this.supportedLngs = this.options.supportedLngs || !1, this.logger = P.create("languageUtils");
568
+ class ge {
569
+ constructor(t) {
570
+ this.options = t, this.supportedLngs = this.options.supportedLngs || !1, this.logger = P.create("languageUtils");
570
571
  }
571
- getScriptPartFromCode(e) {
572
- if (e = G(e), !e || e.indexOf("-") < 0)
572
+ getScriptPartFromCode(t) {
573
+ if (t = G(t), !t || t.indexOf("-") < 0)
573
574
  return null;
574
- const t = e.split("-");
575
- return t.length === 2 || (t.pop(), t[t.length - 1].toLowerCase() === "x") ? null : this.formatLanguageCode(t.join("-"));
575
+ const e = t.split("-");
576
+ return e.length === 2 || (e.pop(), e[e.length - 1].toLowerCase() === "x") ? null : this.formatLanguageCode(e.join("-"));
576
577
  }
577
- getLanguagePartFromCode(e) {
578
- if (e = G(e), !e || e.indexOf("-") < 0)
579
- return e;
580
- const t = e.split("-");
581
- return this.formatLanguageCode(t[0]);
582
- }
583
- formatLanguageCode(e) {
584
- if (typeof e == "string" && e.indexOf("-") > -1) {
585
- const t = ["hans", "hant", "latn", "cyrl", "cans", "mong", "arab"];
586
- let s = e.split("-");
587
- return this.options.lowerCaseLng ? s = s.map((n) => n.toLowerCase()) : s.length === 2 ? (s[0] = s[0].toLowerCase(), s[1] = s[1].toUpperCase(), t.indexOf(s[1].toLowerCase()) > -1 && (s[1] = X(s[1].toLowerCase()))) : s.length === 3 && (s[0] = s[0].toLowerCase(), s[1].length === 2 && (s[1] = s[1].toUpperCase()), s[0] !== "sgn" && s[2].length === 2 && (s[2] = s[2].toUpperCase()), t.indexOf(s[1].toLowerCase()) > -1 && (s[1] = X(s[1].toLowerCase())), t.indexOf(s[2].toLowerCase()) > -1 && (s[2] = X(s[2].toLowerCase()))), s.join("-");
578
+ getLanguagePartFromCode(t) {
579
+ if (t = G(t), !t || t.indexOf("-") < 0)
580
+ return t;
581
+ const e = t.split("-");
582
+ return this.formatLanguageCode(e[0]);
583
+ }
584
+ formatLanguageCode(t) {
585
+ if (typeof t == "string" && t.indexOf("-") > -1) {
586
+ const e = ["hans", "hant", "latn", "cyrl", "cans", "mong", "arab"];
587
+ let s = t.split("-");
588
+ return this.options.lowerCaseLng ? s = s.map((n) => n.toLowerCase()) : s.length === 2 ? (s[0] = s[0].toLowerCase(), s[1] = s[1].toUpperCase(), e.indexOf(s[1].toLowerCase()) > -1 && (s[1] = X(s[1].toLowerCase()))) : s.length === 3 && (s[0] = s[0].toLowerCase(), s[1].length === 2 && (s[1] = s[1].toUpperCase()), s[0] !== "sgn" && s[2].length === 2 && (s[2] = s[2].toUpperCase()), e.indexOf(s[1].toLowerCase()) > -1 && (s[1] = X(s[1].toLowerCase())), e.indexOf(s[2].toLowerCase()) > -1 && (s[2] = X(s[2].toLowerCase()))), s.join("-");
588
589
  }
589
- return this.options.cleanCode || this.options.lowerCaseLng ? e.toLowerCase() : e;
590
+ return this.options.cleanCode || this.options.lowerCaseLng ? t.toLowerCase() : t;
590
591
  }
591
- isSupportedCode(e) {
592
- return (this.options.load === "languageOnly" || this.options.nonExplicitSupportedLngs) && (e = this.getLanguagePartFromCode(e)), !this.supportedLngs || !this.supportedLngs.length || this.supportedLngs.indexOf(e) > -1;
592
+ isSupportedCode(t) {
593
+ return (this.options.load === "languageOnly" || this.options.nonExplicitSupportedLngs) && (t = this.getLanguagePartFromCode(t)), !this.supportedLngs || !this.supportedLngs.length || this.supportedLngs.indexOf(t) > -1;
593
594
  }
594
- getBestMatchFromCodes(e) {
595
- if (!e)
595
+ getBestMatchFromCodes(t) {
596
+ if (!t)
596
597
  return null;
597
- let t;
598
- return e.forEach((s) => {
599
- if (t)
598
+ let e;
599
+ return t.forEach((s) => {
600
+ if (e)
600
601
  return;
601
602
  const n = this.formatLanguageCode(s);
602
- (!this.options.supportedLngs || this.isSupportedCode(n)) && (t = n);
603
- }), !t && this.options.supportedLngs && e.forEach((s) => {
604
- if (t)
603
+ (!this.options.supportedLngs || this.isSupportedCode(n)) && (e = n);
604
+ }), !e && this.options.supportedLngs && t.forEach((s) => {
605
+ if (e)
605
606
  return;
606
607
  const n = this.getLanguagePartFromCode(s);
607
608
  if (this.isSupportedCode(n))
608
- return t = n;
609
- t = this.options.supportedLngs.find((r) => {
609
+ return e = n;
610
+ e = this.options.supportedLngs.find((r) => {
610
611
  if (r === n)
611
612
  return r;
612
613
  if (!(r.indexOf("-") < 0 && n.indexOf("-") < 0) && r.indexOf(n) === 0)
613
614
  return r;
614
615
  });
615
- }), t || (t = this.getFallbackCodes(this.options.fallbackLng)[0]), t;
616
+ }), e || (e = this.getFallbackCodes(this.options.fallbackLng)[0]), e;
616
617
  }
617
- getFallbackCodes(e, t) {
618
- if (!e)
619
- return [];
620
- if (typeof e == "function" && (e = e(t)), typeof e == "string" && (e = [e]), Object.prototype.toString.apply(e) === "[object Array]")
621
- return e;
618
+ getFallbackCodes(t, e) {
622
619
  if (!t)
623
- return e.default || [];
624
- let s = e[t];
625
- return s || (s = e[this.getScriptPartFromCode(t)]), s || (s = e[this.formatLanguageCode(t)]), s || (s = e[this.getLanguagePartFromCode(t)]), s || (s = e.default), s || [];
620
+ return [];
621
+ if (typeof t == "function" && (t = t(e)), typeof t == "string" && (t = [t]), Object.prototype.toString.apply(t) === "[object Array]")
622
+ return t;
623
+ if (!e)
624
+ return t.default || [];
625
+ let s = t[e];
626
+ return s || (s = t[this.getScriptPartFromCode(e)]), s || (s = t[this.formatLanguageCode(e)]), s || (s = t[this.getLanguagePartFromCode(e)]), s || (s = t.default), s || [];
626
627
  }
627
- toResolveHierarchy(e, t) {
628
- const s = this.getFallbackCodes(t || this.options.fallbackLng || [], e), n = [], r = (a) => {
628
+ toResolveHierarchy(t, e) {
629
+ const s = this.getFallbackCodes(e || this.options.fallbackLng || [], t), n = [], r = (a) => {
629
630
  a && (this.isSupportedCode(a) ? n.push(a) : this.logger.warn(`rejecting language code not found in supportedLngs: ${a}`));
630
631
  };
631
- return typeof e == "string" && (e.indexOf("-") > -1 || e.indexOf("_") > -1) ? (this.options.load !== "languageOnly" && r(this.formatLanguageCode(e)), this.options.load !== "languageOnly" && this.options.load !== "currentOnly" && r(this.getScriptPartFromCode(e)), this.options.load !== "currentOnly" && r(this.getLanguagePartFromCode(e))) : typeof e == "string" && r(this.formatLanguageCode(e)), s.forEach((a) => {
632
+ return typeof t == "string" && (t.indexOf("-") > -1 || t.indexOf("_") > -1) ? (this.options.load !== "languageOnly" && r(this.formatLanguageCode(t)), this.options.load !== "languageOnly" && this.options.load !== "currentOnly" && r(this.getScriptPartFromCode(t)), this.options.load !== "currentOnly" && r(this.getLanguagePartFromCode(t))) : typeof t == "string" && r(this.formatLanguageCode(t)), s.forEach((a) => {
632
633
  n.indexOf(a) < 0 && r(this.formatLanguageCode(a));
633
634
  }), n;
634
635
  }
@@ -725,7 +726,7 @@ let Te = [{
725
726
  lngs: ["he", "iw"],
726
727
  nr: [1, 2, 20, 21],
727
728
  fc: 22
728
- }], Ve = {
729
+ }], Be = {
729
730
  1: function(i) {
730
731
  return +(i > 1);
731
732
  },
@@ -793,7 +794,7 @@ let Te = [{
793
794
  return i == 1 ? 0 : i == 2 ? 1 : (i < 0 || i > 10) && i % 10 == 0 ? 2 : 3;
794
795
  }
795
796
  };
796
- const Ke = ["v1", "v2", "v3"], Be = ["v4"], ge = {
797
+ const Ve = ["v1", "v2", "v3"], Ke = ["v4"], he = {
797
798
  zero: 0,
798
799
  one: 1,
799
800
  two: 2,
@@ -803,94 +804,94 @@ const Ke = ["v1", "v2", "v3"], Be = ["v4"], ge = {
803
804
  };
804
805
  function Me() {
805
806
  const i = {};
806
- return Te.forEach((e) => {
807
- e.lngs.forEach((t) => {
808
- i[t] = {
809
- numbers: e.nr,
810
- plurals: Ve[e.fc]
807
+ return Te.forEach((t) => {
808
+ t.lngs.forEach((e) => {
809
+ i[e] = {
810
+ numbers: t.nr,
811
+ plurals: Be[t.fc]
811
812
  };
812
813
  });
813
814
  }), i;
814
815
  }
815
816
  class He {
816
- constructor(e) {
817
- let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
818
- this.languageUtils = e, this.options = t, this.logger = P.create("pluralResolver"), (!this.options.compatibilityJSON || Be.includes(this.options.compatibilityJSON)) && (typeof Intl > "u" || !Intl.PluralRules) && (this.options.compatibilityJSON = "v3", this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")), this.rules = Me();
817
+ constructor(t) {
818
+ let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
819
+ this.languageUtils = t, this.options = e, this.logger = P.create("pluralResolver"), (!this.options.compatibilityJSON || Ke.includes(this.options.compatibilityJSON)) && (typeof Intl > "u" || !Intl.PluralRules) && (this.options.compatibilityJSON = "v3", this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")), this.rules = Me();
819
820
  }
820
- addRule(e, t) {
821
- this.rules[e] = t;
821
+ addRule(t, e) {
822
+ this.rules[t] = e;
822
823
  }
823
- getRule(e) {
824
- let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
824
+ getRule(t) {
825
+ let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
825
826
  if (this.shouldUseIntlApi())
826
827
  try {
827
- return new Intl.PluralRules(G(e === "dev" ? "en" : e), {
828
- type: t.ordinal ? "ordinal" : "cardinal"
828
+ return new Intl.PluralRules(G(t === "dev" ? "en" : t), {
829
+ type: e.ordinal ? "ordinal" : "cardinal"
829
830
  });
830
831
  } catch {
831
832
  return;
832
833
  }
833
- return this.rules[e] || this.rules[this.languageUtils.getLanguagePartFromCode(e)];
834
+ return this.rules[t] || this.rules[this.languageUtils.getLanguagePartFromCode(t)];
834
835
  }
835
- needsPlural(e) {
836
- let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
837
- const s = this.getRule(e, t);
836
+ needsPlural(t) {
837
+ let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
838
+ const s = this.getRule(t, e);
838
839
  return this.shouldUseIntlApi() ? s && s.resolvedOptions().pluralCategories.length > 1 : s && s.numbers.length > 1;
839
840
  }
840
- getPluralFormsOfKey(e, t) {
841
+ getPluralFormsOfKey(t, e) {
841
842
  let s = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
842
- return this.getSuffixes(e, s).map((n) => `${t}${n}`);
843
+ return this.getSuffixes(t, s).map((n) => `${e}${n}`);
843
844
  }
844
- getSuffixes(e) {
845
- let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
846
- const s = this.getRule(e, t);
847
- return s ? this.shouldUseIntlApi() ? s.resolvedOptions().pluralCategories.sort((n, r) => ge[n] - ge[r]).map((n) => `${this.options.prepend}${t.ordinal ? `ordinal${this.options.prepend}` : ""}${n}`) : s.numbers.map((n) => this.getSuffix(e, n, t)) : [];
845
+ getSuffixes(t) {
846
+ let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
847
+ const s = this.getRule(t, e);
848
+ return s ? this.shouldUseIntlApi() ? s.resolvedOptions().pluralCategories.sort((n, r) => he[n] - he[r]).map((n) => `${this.options.prepend}${e.ordinal ? `ordinal${this.options.prepend}` : ""}${n}`) : s.numbers.map((n) => this.getSuffix(t, n, e)) : [];
848
849
  }
849
- getSuffix(e, t) {
850
+ getSuffix(t, e) {
850
851
  let s = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
851
- const n = this.getRule(e, s);
852
- return n ? this.shouldUseIntlApi() ? `${this.options.prepend}${s.ordinal ? `ordinal${this.options.prepend}` : ""}${n.select(t)}` : this.getSuffixRetroCompatible(n, t) : (this.logger.warn(`no plural rule found for: ${e}`), "");
852
+ const n = this.getRule(t, s);
853
+ return n ? this.shouldUseIntlApi() ? `${this.options.prepend}${s.ordinal ? `ordinal${this.options.prepend}` : ""}${n.select(e)}` : this.getSuffixRetroCompatible(n, e) : (this.logger.warn(`no plural rule found for: ${t}`), "");
853
854
  }
854
- getSuffixRetroCompatible(e, t) {
855
- const s = e.noAbs ? e.plurals(t) : e.plurals(Math.abs(t));
856
- let n = e.numbers[s];
857
- this.options.simplifyPluralSuffix && e.numbers.length === 2 && e.numbers[0] === 1 && (n === 2 ? n = "plural" : n === 1 && (n = ""));
855
+ getSuffixRetroCompatible(t, e) {
856
+ const s = t.noAbs ? t.plurals(e) : t.plurals(Math.abs(e));
857
+ let n = t.numbers[s];
858
+ this.options.simplifyPluralSuffix && t.numbers.length === 2 && t.numbers[0] === 1 && (n === 2 ? n = "plural" : n === 1 && (n = ""));
858
859
  const r = () => this.options.prepend && n.toString() ? this.options.prepend + n.toString() : n.toString();
859
- return this.options.compatibilityJSON === "v1" ? n === 1 ? "" : typeof n == "number" ? `_plural_${n.toString()}` : r() : this.options.compatibilityJSON === "v2" || this.options.simplifyPluralSuffix && e.numbers.length === 2 && e.numbers[0] === 1 ? r() : this.options.prepend && s.toString() ? this.options.prepend + s.toString() : s.toString();
860
+ return this.options.compatibilityJSON === "v1" ? n === 1 ? "" : typeof n == "number" ? `_plural_${n.toString()}` : r() : this.options.compatibilityJSON === "v2" || this.options.simplifyPluralSuffix && t.numbers.length === 2 && t.numbers[0] === 1 ? r() : this.options.prepend && s.toString() ? this.options.prepend + s.toString() : s.toString();
860
861
  }
861
862
  shouldUseIntlApi() {
862
- return !Ke.includes(this.options.compatibilityJSON);
863
+ return !Ve.includes(this.options.compatibilityJSON);
863
864
  }
864
865
  }
865
- function he(i, e, t) {
866
- let s = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : ".", n = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : !0, r = Fe(i, e, t);
867
- return !r && n && typeof t == "string" && (r = Y(i, t, s), r === void 0 && (r = Y(e, t, s))), r;
866
+ function ce(i, t, e) {
867
+ let s = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : ".", n = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : !0, r = De(i, t, e);
868
+ return !r && n && typeof e == "string" && (r = Y(i, e, s), r === void 0 && (r = Y(t, e, s))), r;
868
869
  }
869
870
  class Je {
870
871
  constructor() {
871
- let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
872
- this.logger = P.create("interpolator"), this.options = e, this.format = e.interpolation && e.interpolation.format || ((t) => t), this.init(e);
872
+ let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
873
+ this.logger = P.create("interpolator"), this.options = t, this.format = t.interpolation && t.interpolation.format || ((e) => e), this.init(t);
873
874
  }
874
875
  init() {
875
- let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
876
- e.interpolation || (e.interpolation = {
876
+ let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
877
+ t.interpolation || (t.interpolation = {
877
878
  escapeValue: !0
878
879
  });
879
- const t = e.interpolation;
880
- this.escape = t.escape !== void 0 ? t.escape : De, this.escapeValue = t.escapeValue !== void 0 ? t.escapeValue : !0, this.useRawValueToEscape = t.useRawValueToEscape !== void 0 ? t.useRawValueToEscape : !1, this.prefix = t.prefix ? j(t.prefix) : t.prefixEscaped || "{{", this.suffix = t.suffix ? j(t.suffix) : t.suffixEscaped || "}}", this.formatSeparator = t.formatSeparator ? t.formatSeparator : t.formatSeparator || ",", this.unescapePrefix = t.unescapeSuffix ? "" : t.unescapePrefix || "-", this.unescapeSuffix = this.unescapePrefix ? "" : t.unescapeSuffix || "", this.nestingPrefix = t.nestingPrefix ? j(t.nestingPrefix) : t.nestingPrefixEscaped || j("$t("), this.nestingSuffix = t.nestingSuffix ? j(t.nestingSuffix) : t.nestingSuffixEscaped || j(")"), this.nestingOptionsSeparator = t.nestingOptionsSeparator ? t.nestingOptionsSeparator : t.nestingOptionsSeparator || ",", this.maxReplaces = t.maxReplaces ? t.maxReplaces : 1e3, this.alwaysFormat = t.alwaysFormat !== void 0 ? t.alwaysFormat : !1, this.resetRegExp();
880
+ const e = t.interpolation;
881
+ this.escape = e.escape !== void 0 ? e.escape : Ae, this.escapeValue = e.escapeValue !== void 0 ? e.escapeValue : !0, this.useRawValueToEscape = e.useRawValueToEscape !== void 0 ? e.useRawValueToEscape : !1, this.prefix = e.prefix ? j(e.prefix) : e.prefixEscaped || "{{", this.suffix = e.suffix ? j(e.suffix) : e.suffixEscaped || "}}", this.formatSeparator = e.formatSeparator ? e.formatSeparator : e.formatSeparator || ",", this.unescapePrefix = e.unescapeSuffix ? "" : e.unescapePrefix || "-", this.unescapeSuffix = this.unescapePrefix ? "" : e.unescapeSuffix || "", this.nestingPrefix = e.nestingPrefix ? j(e.nestingPrefix) : e.nestingPrefixEscaped || j("$t("), this.nestingSuffix = e.nestingSuffix ? j(e.nestingSuffix) : e.nestingSuffixEscaped || j(")"), this.nestingOptionsSeparator = e.nestingOptionsSeparator ? e.nestingOptionsSeparator : e.nestingOptionsSeparator || ",", this.maxReplaces = e.maxReplaces ? e.maxReplaces : 1e3, this.alwaysFormat = e.alwaysFormat !== void 0 ? e.alwaysFormat : !1, this.resetRegExp();
881
882
  }
882
883
  reset() {
883
884
  this.options && this.init(this.options);
884
885
  }
885
886
  resetRegExp() {
886
- const e = `${this.prefix}(.+?)${this.suffix}`;
887
- this.regexp = new RegExp(e, "g");
888
- const t = `${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`;
889
- this.regexpUnescape = new RegExp(t, "g");
887
+ const t = `${this.prefix}(.+?)${this.suffix}`;
888
+ this.regexp = new RegExp(t, "g");
889
+ const e = `${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`;
890
+ this.regexpUnescape = new RegExp(e, "g");
890
891
  const s = `${this.nestingPrefix}(.+?)${this.nestingSuffix}`;
891
892
  this.nestingRegexp = new RegExp(s, "g");
892
893
  }
893
- interpolate(e, t, s, n) {
894
+ interpolate(t, e, s, n) {
894
895
  let r, a, l;
895
896
  const o = this.options && this.options.interpolation && this.options.interpolation.defaultVariables || {};
896
897
  function f(c) {
@@ -898,17 +899,17 @@ class Je {
898
899
  }
899
900
  const g = (c) => {
900
901
  if (c.indexOf(this.formatSeparator) < 0) {
901
- const x = he(t, o, c, this.options.keySeparator, this.options.ignoreJSONStructure);
902
- return this.alwaysFormat ? this.format(x, void 0, s, {
902
+ const b = ce(e, o, c, this.options.keySeparator, this.options.ignoreJSONStructure);
903
+ return this.alwaysFormat ? this.format(b, void 0, s, {
903
904
  ...n,
904
- ...t,
905
+ ...e,
905
906
  interpolationkey: c
906
- }) : x;
907
+ }) : b;
907
908
  }
908
- const p = c.split(this.formatSeparator), m = p.shift().trim(), L = p.join(this.formatSeparator).trim();
909
- return this.format(he(t, o, m, this.options.keySeparator, this.options.ignoreJSONStructure), L, s, {
909
+ const p = c.split(this.formatSeparator), m = p.shift().trim(), O = p.join(this.formatSeparator).trim();
910
+ return this.format(ce(e, o, m, this.options.keySeparator, this.options.ignoreJSONStructure), O, s, {
910
911
  ...n,
911
- ...t,
912
+ ...e,
912
913
  interpolationkey: m
913
914
  });
914
915
  };
@@ -921,28 +922,28 @@ class Je {
921
922
  regex: this.regexp,
922
923
  safeValue: (c) => this.escapeValue ? f(this.escape(c)) : f(c)
923
924
  }].forEach((c) => {
924
- for (l = 0; r = c.regex.exec(e); ) {
925
+ for (l = 0; r = c.regex.exec(t); ) {
925
926
  const p = r[1].trim();
926
927
  if (a = g(p), a === void 0)
927
928
  if (typeof h == "function") {
928
- const L = h(e, r, n);
929
- a = typeof L == "string" ? L : "";
929
+ const O = h(t, r, n);
930
+ a = typeof O == "string" ? O : "";
930
931
  } else if (n && Object.prototype.hasOwnProperty.call(n, p))
931
932
  a = "";
932
933
  else if (u) {
933
934
  a = r[0];
934
935
  continue;
935
936
  } else
936
- this.logger.warn(`missed to pass in variable ${p} for interpolating ${e}`), a = "";
937
+ this.logger.warn(`missed to pass in variable ${p} for interpolating ${t}`), a = "";
937
938
  else
938
- typeof a != "string" && !this.useRawValueToEscape && (a = ae(a));
939
+ typeof a != "string" && !this.useRawValueToEscape && (a = oe(a));
939
940
  const m = c.safeValue(a);
940
- if (e = e.replace(r[0], m), u ? (c.regex.lastIndex += a.length, c.regex.lastIndex -= r[0].length) : c.regex.lastIndex = 0, l++, l >= this.maxReplaces)
941
+ if (t = t.replace(r[0], m), u ? (c.regex.lastIndex += a.length, c.regex.lastIndex -= r[0].length) : c.regex.lastIndex = 0, l++, l >= this.maxReplaces)
941
942
  break;
942
943
  }
943
- }), e;
944
+ }), t;
944
945
  }
945
- nest(e, t) {
946
+ nest(t, e) {
946
947
  let s = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, n, r, a;
947
948
  function l(o, f) {
948
949
  const g = this.nestingOptionsSeparator;
@@ -963,7 +964,7 @@ class Je {
963
964
  }
964
965
  return delete a.defaultValue, o;
965
966
  }
966
- for (; n = this.nestingRegexp.exec(e); ) {
967
+ for (; n = this.nestingRegexp.exec(t); ) {
967
968
  let o = [];
968
969
  a = {
969
970
  ...s
@@ -973,95 +974,95 @@ class Je {
973
974
  const g = n[1].split(this.formatSeparator).map((h) => h.trim());
974
975
  n[1] = g.shift(), o = g, f = !0;
975
976
  }
976
- if (r = t(l.call(this, n[1].trim(), a), a), r && n[0] === e && typeof r != "string")
977
+ if (r = e(l.call(this, n[1].trim(), a), a), r && n[0] === t && typeof r != "string")
977
978
  return r;
978
- typeof r != "string" && (r = ae(r)), r || (this.logger.warn(`missed to resolve ${n[1]} for nesting ${e}`), r = ""), f && (r = o.reduce((g, h) => this.format(g, h, s.lng, {
979
+ typeof r != "string" && (r = oe(r)), r || (this.logger.warn(`missed to resolve ${n[1]} for nesting ${t}`), r = ""), f && (r = o.reduce((g, h) => this.format(g, h, s.lng, {
979
980
  ...s,
980
981
  interpolationkey: n[1].trim()
981
- }), r.trim())), e = e.replace(n[0], r), this.regexp.lastIndex = 0;
982
+ }), r.trim())), t = t.replace(n[0], r), this.regexp.lastIndex = 0;
982
983
  }
983
- return e;
984
+ return t;
984
985
  }
985
986
  }
986
987
  function ze(i) {
987
- let e = i.toLowerCase().trim();
988
- const t = {};
988
+ let t = i.toLowerCase().trim();
989
+ const e = {};
989
990
  if (i.indexOf("(") > -1) {
990
991
  const s = i.split("(");
991
- e = s[0].toLowerCase().trim();
992
+ t = s[0].toLowerCase().trim();
992
993
  const n = s[1].substring(0, s[1].length - 1);
993
- e === "currency" && n.indexOf(":") < 0 ? t.currency || (t.currency = n.trim()) : e === "relativetime" && n.indexOf(":") < 0 ? t.range || (t.range = n.trim()) : n.split(";").forEach((a) => {
994
+ t === "currency" && n.indexOf(":") < 0 ? e.currency || (e.currency = n.trim()) : t === "relativetime" && n.indexOf(":") < 0 ? e.range || (e.range = n.trim()) : n.split(";").forEach((a) => {
994
995
  if (!a)
995
996
  return;
996
997
  const [l, ...o] = a.split(":"), f = o.join(":").trim().replace(/^'+|'+$/g, "");
997
- t[l.trim()] || (t[l.trim()] = f), f === "false" && (t[l.trim()] = !1), f === "true" && (t[l.trim()] = !0), isNaN(f) || (t[l.trim()] = parseInt(f, 10));
998
+ e[l.trim()] || (e[l.trim()] = f), f === "false" && (e[l.trim()] = !1), f === "true" && (e[l.trim()] = !0), isNaN(f) || (e[l.trim()] = parseInt(f, 10));
998
999
  });
999
1000
  }
1000
1001
  return {
1001
- formatName: e,
1002
- formatOptions: t
1002
+ formatName: t,
1003
+ formatOptions: e
1003
1004
  };
1004
1005
  }
1005
1006
  function k(i) {
1006
- const e = {};
1007
+ const t = {};
1007
1008
  return function(s, n, r) {
1008
1009
  const a = n + JSON.stringify(r);
1009
- let l = e[a];
1010
- return l || (l = i(G(n), r), e[a] = l), l(s);
1010
+ let l = t[a];
1011
+ return l || (l = i(G(n), r), t[a] = l), l(s);
1011
1012
  };
1012
1013
  }
1013
1014
  class We {
1014
1015
  constructor() {
1015
- let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
1016
- this.logger = P.create("formatter"), this.options = e, this.formats = {
1017
- number: k((t, s) => {
1018
- const n = new Intl.NumberFormat(t, {
1016
+ let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
1017
+ this.logger = P.create("formatter"), this.options = t, this.formats = {
1018
+ number: k((e, s) => {
1019
+ const n = new Intl.NumberFormat(e, {
1019
1020
  ...s
1020
1021
  });
1021
1022
  return (r) => n.format(r);
1022
1023
  }),
1023
- currency: k((t, s) => {
1024
- const n = new Intl.NumberFormat(t, {
1024
+ currency: k((e, s) => {
1025
+ const n = new Intl.NumberFormat(e, {
1025
1026
  ...s,
1026
1027
  style: "currency"
1027
1028
  });
1028
1029
  return (r) => n.format(r);
1029
1030
  }),
1030
- datetime: k((t, s) => {
1031
- const n = new Intl.DateTimeFormat(t, {
1031
+ datetime: k((e, s) => {
1032
+ const n = new Intl.DateTimeFormat(e, {
1032
1033
  ...s
1033
1034
  });
1034
1035
  return (r) => n.format(r);
1035
1036
  }),
1036
- relativetime: k((t, s) => {
1037
- const n = new Intl.RelativeTimeFormat(t, {
1037
+ relativetime: k((e, s) => {
1038
+ const n = new Intl.RelativeTimeFormat(e, {
1038
1039
  ...s
1039
1040
  });
1040
1041
  return (r) => n.format(r, s.range || "day");
1041
1042
  }),
1042
- list: k((t, s) => {
1043
- const n = new Intl.ListFormat(t, {
1043
+ list: k((e, s) => {
1044
+ const n = new Intl.ListFormat(e, {
1044
1045
  ...s
1045
1046
  });
1046
1047
  return (r) => n.format(r);
1047
1048
  })
1048
- }, this.init(e);
1049
+ }, this.init(t);
1049
1050
  }
1050
- init(e) {
1051
+ init(t) {
1051
1052
  const s = (arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {
1052
1053
  interpolation: {}
1053
1054
  }).interpolation;
1054
1055
  this.formatSeparator = s.formatSeparator ? s.formatSeparator : s.formatSeparator || ",";
1055
1056
  }
1056
- add(e, t) {
1057
- this.formats[e.toLowerCase().trim()] = t;
1057
+ add(t, e) {
1058
+ this.formats[t.toLowerCase().trim()] = e;
1058
1059
  }
1059
- addCached(e, t) {
1060
- this.formats[e.toLowerCase().trim()] = k(t);
1060
+ addCached(t, e) {
1061
+ this.formats[t.toLowerCase().trim()] = k(e);
1061
1062
  }
1062
- format(e, t, s) {
1063
+ format(t, e, s) {
1063
1064
  let n = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
1064
- return t.split(this.formatSeparator).reduce((l, o) => {
1065
+ return e.split(this.formatSeparator).reduce((l, o) => {
1065
1066
  const {
1066
1067
  formatName: f,
1067
1068
  formatOptions: g
@@ -1082,22 +1083,22 @@ class We {
1082
1083
  } else
1083
1084
  this.logger.warn(`there was no format function for ${f}`);
1084
1085
  return l;
1085
- }, e);
1086
+ }, t);
1086
1087
  }
1087
1088
  }
1088
- function Ye(i, e) {
1089
- i.pending[e] !== void 0 && (delete i.pending[e], i.pendingCount--);
1089
+ function Ye(i, t) {
1090
+ i.pending[t] !== void 0 && (delete i.pending[t], i.pendingCount--);
1090
1091
  }
1091
1092
  class Ge extends Q {
1092
- constructor(e, t, s) {
1093
+ constructor(t, e, s) {
1093
1094
  let n = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
1094
- super(), this.backend = e, this.store = t, this.services = s, this.languageUtils = s.languageUtils, this.options = n, this.logger = P.create("backendConnector"), this.waitingReads = [], this.maxParallelReads = n.maxParallelReads || 10, this.readingCalls = 0, this.maxRetries = n.maxRetries >= 0 ? n.maxRetries : 5, this.retryTimeout = n.retryTimeout >= 1 ? n.retryTimeout : 350, this.state = {}, this.queue = [], this.backend && this.backend.init && this.backend.init(s, n.backend, n);
1095
+ super(), this.backend = t, this.store = e, this.services = s, this.languageUtils = s.languageUtils, this.options = n, this.logger = P.create("backendConnector"), this.waitingReads = [], this.maxParallelReads = n.maxParallelReads || 10, this.readingCalls = 0, this.maxRetries = n.maxRetries >= 0 ? n.maxRetries : 5, this.retryTimeout = n.retryTimeout >= 1 ? n.retryTimeout : 350, this.state = {}, this.queue = [], this.backend && this.backend.init && this.backend.init(s, n.backend, n);
1095
1096
  }
1096
- queueLoad(e, t, s, n) {
1097
+ queueLoad(t, e, s, n) {
1097
1098
  const r = {}, a = {}, l = {}, o = {};
1098
- return e.forEach((f) => {
1099
+ return t.forEach((f) => {
1099
1100
  let g = !0;
1100
- t.forEach((h) => {
1101
+ e.forEach((h) => {
1101
1102
  const u = `${f}|${h}`;
1102
1103
  !s.reload && this.store.hasResourceBundle(f, h) ? this.state[u] = 2 : this.state[u] < 0 || (this.state[u] === 1 ? a[u] === void 0 && (a[u] = !0) : (this.state[u] = 1, g = !1, a[u] === void 0 && (a[u] = !0), r[u] === void 0 && (r[u] = !0), o[h] === void 0 && (o[h] = !0)));
1103
1104
  }), g || (l[f] = !0);
@@ -1114,12 +1115,12 @@ class Ge extends Q {
1114
1115
  toLoadNamespaces: Object.keys(o)
1115
1116
  };
1116
1117
  }
1117
- loaded(e, t, s) {
1118
- const n = e.split("|"), r = n[0], a = n[1];
1119
- t && this.emit("failedLoading", r, a, t), s && this.store.addResourceBundle(r, a, s), this.state[e] = t ? -1 : 2;
1118
+ loaded(t, e, s) {
1119
+ const n = t.split("|"), r = n[0], a = n[1];
1120
+ e && this.emit("failedLoading", r, a, e), s && this.store.addResourceBundle(r, a, s), this.state[t] = e ? -1 : 2;
1120
1121
  const l = {};
1121
1122
  this.queue.forEach((o) => {
1122
- ke(o.loaded, [r], a), Ye(o, e), t && o.errors.push(t), o.pendingCount === 0 && !o.done && (Object.keys(o.loaded).forEach((f) => {
1123
+ ke(o.loaded, [r], a), Ye(o, t), e && o.errors.push(e), o.pendingCount === 0 && !o.done && (Object.keys(o.loaded).forEach((f) => {
1123
1124
  l[f] || (l[f] = {});
1124
1125
  const g = o.loaded[f];
1125
1126
  g.length && g.forEach((h) => {
@@ -1128,14 +1129,14 @@ class Ge extends Q {
1128
1129
  }), o.done = !0, o.errors.length ? o.callback(o.errors) : o.callback());
1129
1130
  }), this.emit("loaded", l), this.queue = this.queue.filter((o) => !o.done);
1130
1131
  }
1131
- read(e, t, s) {
1132
+ read(t, e, s) {
1132
1133
  let n = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : 0, r = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : this.retryTimeout, a = arguments.length > 5 ? arguments[5] : void 0;
1133
- if (!e.length)
1134
+ if (!t.length)
1134
1135
  return a(null, {});
1135
1136
  if (this.readingCalls >= this.maxParallelReads) {
1136
1137
  this.waitingReads.push({
1137
- lng: e,
1138
- ns: t,
1138
+ lng: t,
1139
+ ns: e,
1139
1140
  fcName: s,
1140
1141
  tried: n,
1141
1142
  wait: r,
@@ -1151,7 +1152,7 @@ class Ge extends Q {
1151
1152
  }
1152
1153
  if (f && g && n < this.maxRetries) {
1153
1154
  setTimeout(() => {
1154
- this.read.call(this, e, t, s, n + 1, r * 2, a);
1155
+ this.read.call(this, t, e, s, n + 1, r * 2, a);
1155
1156
  }, r);
1156
1157
  return;
1157
1158
  }
@@ -1159,47 +1160,47 @@ class Ge extends Q {
1159
1160
  }, o = this.backend[s].bind(this.backend);
1160
1161
  if (o.length === 2) {
1161
1162
  try {
1162
- const f = o(e, t);
1163
+ const f = o(t, e);
1163
1164
  f && typeof f.then == "function" ? f.then((g) => l(null, g)).catch(l) : l(null, f);
1164
1165
  } catch (f) {
1165
1166
  l(f);
1166
1167
  }
1167
1168
  return;
1168
1169
  }
1169
- return o(e, t, l);
1170
+ return o(t, e, l);
1170
1171
  }
1171
- prepareLoading(e, t) {
1172
+ prepareLoading(t, e) {
1172
1173
  let s = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, n = arguments.length > 3 ? arguments[3] : void 0;
1173
1174
  if (!this.backend)
1174
1175
  return this.logger.warn("No backend was added via i18next.use. Will not load resources."), n && n();
1175
- typeof e == "string" && (e = this.languageUtils.toResolveHierarchy(e)), typeof t == "string" && (t = [t]);
1176
- const r = this.queueLoad(e, t, s, n);
1176
+ typeof t == "string" && (t = this.languageUtils.toResolveHierarchy(t)), typeof e == "string" && (e = [e]);
1177
+ const r = this.queueLoad(t, e, s, n);
1177
1178
  if (!r.toLoad.length)
1178
1179
  return r.pending.length || n(), null;
1179
1180
  r.toLoad.forEach((a) => {
1180
1181
  this.loadOne(a);
1181
1182
  });
1182
1183
  }
1183
- load(e, t, s) {
1184
- this.prepareLoading(e, t, {}, s);
1184
+ load(t, e, s) {
1185
+ this.prepareLoading(t, e, {}, s);
1185
1186
  }
1186
- reload(e, t, s) {
1187
- this.prepareLoading(e, t, {
1187
+ reload(t, e, s) {
1188
+ this.prepareLoading(t, e, {
1188
1189
  reload: !0
1189
1190
  }, s);
1190
1191
  }
1191
- loadOne(e) {
1192
- let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "";
1193
- const s = e.split("|"), n = s[0], r = s[1];
1192
+ loadOne(t) {
1193
+ let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "";
1194
+ const s = t.split("|"), n = s[0], r = s[1];
1194
1195
  this.read(n, r, "read", void 0, void 0, (a, l) => {
1195
- a && this.logger.warn(`${t}loading namespace ${r} for language ${n} failed`, a), !a && l && this.logger.log(`${t}loaded namespace ${r} for language ${n}`, l), this.loaded(e, a, l);
1196
+ a && this.logger.warn(`${e}loading namespace ${r} for language ${n} failed`, a), !a && l && this.logger.log(`${e}loaded namespace ${r} for language ${n}`, l), this.loaded(t, a, l);
1196
1197
  });
1197
1198
  }
1198
- saveMissing(e, t, s, n, r) {
1199
+ saveMissing(t, e, s, n, r) {
1199
1200
  let a = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : {}, l = arguments.length > 6 && arguments[6] !== void 0 ? arguments[6] : () => {
1200
1201
  };
1201
- if (this.services.utils && this.services.utils.hasLoadedNamespace && !this.services.utils.hasLoadedNamespace(t)) {
1202
- this.logger.warn(`did not save key "${s}" as the namespace "${t}" was not yet loaded`, "This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");
1202
+ if (this.services.utils && this.services.utils.hasLoadedNamespace && !this.services.utils.hasLoadedNamespace(e)) {
1203
+ this.logger.warn(`did not save key "${s}" as the namespace "${e}" was not yet loaded`, "This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");
1203
1204
  return;
1204
1205
  }
1205
1206
  if (!(s == null || s === "")) {
@@ -1211,18 +1212,18 @@ class Ge extends Q {
1211
1212
  if (f.length < 6)
1212
1213
  try {
1213
1214
  let g;
1214
- f.length === 5 ? g = f(e, t, s, n, o) : g = f(e, t, s, n), g && typeof g.then == "function" ? g.then((h) => l(null, h)).catch(l) : l(null, g);
1215
+ f.length === 5 ? g = f(t, e, s, n, o) : g = f(t, e, s, n), g && typeof g.then == "function" ? g.then((h) => l(null, h)).catch(l) : l(null, g);
1215
1216
  } catch (g) {
1216
1217
  l(g);
1217
1218
  }
1218
1219
  else
1219
- f(e, t, s, n, l, o);
1220
+ f(t, e, s, n, l, o);
1220
1221
  }
1221
- !e || !e[0] || this.store.addResource(e[0], t, s, n);
1222
+ !t || !t[0] || this.store.addResource(t[0], e, s, n);
1222
1223
  }
1223
1224
  }
1224
1225
  }
1225
- function ce() {
1226
+ function de() {
1226
1227
  return {
1227
1228
  debug: !1,
1228
1229
  initImmediate: !0,
@@ -1256,15 +1257,15 @@ function ce() {
1256
1257
  parseMissingKeyHandler: !1,
1257
1258
  appendNamespaceToMissingKey: !1,
1258
1259
  appendNamespaceToCIMode: !1,
1259
- overloadTranslationOptionHandler: function(e) {
1260
- let t = {};
1261
- if (typeof e[1] == "object" && (t = e[1]), typeof e[1] == "string" && (t.defaultValue = e[1]), typeof e[2] == "string" && (t.tDescription = e[2]), typeof e[2] == "object" || typeof e[3] == "object") {
1262
- const s = e[3] || e[2];
1260
+ overloadTranslationOptionHandler: function(t) {
1261
+ let e = {};
1262
+ if (typeof t[1] == "object" && (e = t[1]), typeof t[1] == "string" && (e.defaultValue = t[1]), typeof t[2] == "string" && (e.tDescription = t[2]), typeof t[2] == "object" || typeof t[3] == "object") {
1263
+ const s = t[3] || t[2];
1263
1264
  Object.keys(s).forEach((n) => {
1264
- t[n] = s[n];
1265
+ e[n] = s[n];
1265
1266
  });
1266
1267
  }
1267
- return t;
1268
+ return e;
1268
1269
  },
1269
1270
  interpolation: {
1270
1271
  escapeValue: !0,
@@ -1281,42 +1282,42 @@ function ce() {
1281
1282
  }
1282
1283
  };
1283
1284
  }
1284
- function de(i) {
1285
+ function pe(i) {
1285
1286
  return typeof i.ns == "string" && (i.ns = [i.ns]), typeof i.fallbackLng == "string" && (i.fallbackLng = [i.fallbackLng]), typeof i.fallbackNS == "string" && (i.fallbackNS = [i.fallbackNS]), i.supportedLngs && i.supportedLngs.indexOf("cimode") < 0 && (i.supportedLngs = i.supportedLngs.concat(["cimode"])), i;
1286
1287
  }
1287
1288
  function H() {
1288
1289
  }
1289
1290
  function Ze(i) {
1290
- Object.getOwnPropertyNames(Object.getPrototypeOf(i)).forEach((t) => {
1291
- typeof i[t] == "function" && (i[t] = i[t].bind(i));
1291
+ Object.getOwnPropertyNames(Object.getPrototypeOf(i)).forEach((e) => {
1292
+ typeof i[e] == "function" && (i[e] = i[e].bind(i));
1292
1293
  });
1293
1294
  }
1294
1295
  class T extends Q {
1295
1296
  constructor() {
1296
- let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, t = arguments.length > 1 ? arguments[1] : void 0;
1297
- if (super(), this.options = de(e), this.services = {}, this.logger = P, this.modules = {
1297
+ let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, e = arguments.length > 1 ? arguments[1] : void 0;
1298
+ if (super(), this.options = pe(t), this.services = {}, this.logger = P, this.modules = {
1298
1299
  external: []
1299
- }, Ze(this), t && !this.isInitialized && !e.isClone) {
1300
+ }, Ze(this), e && !this.isInitialized && !t.isClone) {
1300
1301
  if (!this.options.initImmediate)
1301
- return this.init(e, t), this;
1302
+ return this.init(t, e), this;
1302
1303
  setTimeout(() => {
1303
- this.init(e, t);
1304
+ this.init(t, e);
1304
1305
  }, 0);
1305
1306
  }
1306
1307
  }
1307
1308
  init() {
1308
- var e = this;
1309
- let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, s = arguments.length > 1 ? arguments[1] : void 0;
1310
- typeof t == "function" && (s = t, t = {}), !t.defaultNS && t.defaultNS !== !1 && t.ns && (typeof t.ns == "string" ? t.defaultNS = t.ns : t.ns.indexOf("translation") < 0 && (t.defaultNS = t.ns[0]));
1311
- const n = ce();
1309
+ var t = this;
1310
+ let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, s = arguments.length > 1 ? arguments[1] : void 0;
1311
+ typeof e == "function" && (s = e, e = {}), !e.defaultNS && e.defaultNS !== !1 && e.ns && (typeof e.ns == "string" ? e.defaultNS = e.ns : e.ns.indexOf("translation") < 0 && (e.defaultNS = e.ns[0]));
1312
+ const n = de();
1312
1313
  this.options = {
1313
1314
  ...n,
1314
1315
  ...this.options,
1315
- ...de(t)
1316
+ ...pe(e)
1316
1317
  }, this.options.compatibilityAPI !== "v1" && (this.options.interpolation = {
1317
1318
  ...n.interpolation,
1318
1319
  ...this.options.interpolation
1319
- }), t.keySeparator !== void 0 && (this.options.userDefinedKeySeparator = t.keySeparator), t.nsSeparator !== void 0 && (this.options.userDefinedNsSeparator = t.nsSeparator);
1320
+ }), e.keySeparator !== void 0 && (this.options.userDefinedKeySeparator = e.keySeparator), e.nsSeparator !== void 0 && (this.options.userDefinedNsSeparator = e.nsSeparator);
1320
1321
  function r(g) {
1321
1322
  return g ? typeof g == "function" ? new g() : g : null;
1322
1323
  }
@@ -1324,8 +1325,8 @@ class T extends Q {
1324
1325
  this.modules.logger ? P.init(r(this.modules.logger), this.options) : P.init(null, this.options);
1325
1326
  let g;
1326
1327
  this.modules.formatter ? g = this.modules.formatter : typeof Intl < "u" && (g = We);
1327
- const h = new fe(this.options);
1328
- this.store = new le(this.options.resources, this.options);
1328
+ const h = new ge(this.options);
1329
+ this.store = new ue(this.options.resources, this.options);
1329
1330
  const u = this.services;
1330
1331
  u.logger = P, u.resourceStore = this.store, u.languageUtils = h, u.pluralResolver = new He(h, {
1331
1332
  prepend: this.options.pluralSeparator,
@@ -1336,11 +1337,11 @@ class T extends Q {
1336
1337
  }, u.backendConnector = new Ge(r(this.modules.backend), u.resourceStore, u, this.options), u.backendConnector.on("*", function(d) {
1337
1338
  for (var c = arguments.length, p = new Array(c > 1 ? c - 1 : 0), m = 1; m < c; m++)
1338
1339
  p[m - 1] = arguments[m];
1339
- e.emit(d, ...p);
1340
+ t.emit(d, ...p);
1340
1341
  }), this.modules.languageDetector && (u.languageDetector = r(this.modules.languageDetector), u.languageDetector.init && u.languageDetector.init(u, this.options.detection, this.options)), this.modules.i18nFormat && (u.i18nFormat = r(this.modules.i18nFormat), u.i18nFormat.init && u.i18nFormat.init(this)), this.translator = new Z(this.services, this.options), this.translator.on("*", function(d) {
1341
1342
  for (var c = arguments.length, p = new Array(c > 1 ? c - 1 : 0), m = 1; m < c; m++)
1342
1343
  p[m - 1] = arguments[m];
1343
- e.emit(d, ...p);
1344
+ t.emit(d, ...p);
1344
1345
  }), this.modules.external.forEach((d) => {
1345
1346
  d.init && d.init(this);
1346
1347
  });
@@ -1351,11 +1352,11 @@ class T extends Q {
1351
1352
  }
1352
1353
  !this.services.languageDetector && !this.options.lng && this.logger.warn("init: no languageDetector is used and no lng is defined"), ["getResource", "hasResourceBundle", "getResourceBundle", "getDataByLanguage"].forEach((g) => {
1353
1354
  this[g] = function() {
1354
- return e.store[g](...arguments);
1355
+ return t.store[g](...arguments);
1355
1356
  };
1356
1357
  }), ["addResource", "addResources", "addResourceBundle", "removeResourceBundle"].forEach((g) => {
1357
1358
  this[g] = function() {
1358
- return e.store[g](...arguments), e;
1359
+ return t.store[g](...arguments), t;
1359
1360
  };
1360
1361
  });
1361
1362
  const o = U(), f = () => {
@@ -1368,10 +1369,10 @@ class T extends Q {
1368
1369
  };
1369
1370
  return this.options.resources || !this.options.initImmediate ? f() : setTimeout(f, 0), o;
1370
1371
  }
1371
- loadResources(e) {
1372
+ loadResources(t) {
1372
1373
  let s = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : H;
1373
- const n = typeof e == "string" ? e : this.language;
1374
- if (typeof e == "function" && (s = e), !this.options.resources || this.options.partialBundledLanguages) {
1374
+ const n = typeof t == "string" ? t : this.language;
1375
+ if (typeof t == "function" && (s = t), !this.options.resources || this.options.partialBundledLanguages) {
1375
1376
  if (n && n.toLowerCase() === "cimode" && (!this.options.preload || this.options.preload.length === 0))
1376
1377
  return s();
1377
1378
  const r = [], a = (l) => {
@@ -1387,52 +1388,52 @@ class T extends Q {
1387
1388
  } else
1388
1389
  s(null);
1389
1390
  }
1390
- reloadResources(e, t, s) {
1391
+ reloadResources(t, e, s) {
1391
1392
  const n = U();
1392
- return e || (e = this.languages), t || (t = this.options.ns), s || (s = H), this.services.backendConnector.reload(e, t, (r) => {
1393
+ return t || (t = this.languages), e || (e = this.options.ns), s || (s = H), this.services.backendConnector.reload(t, e, (r) => {
1393
1394
  n.resolve(), s(r);
1394
1395
  }), n;
1395
1396
  }
1396
- use(e) {
1397
- if (!e)
1397
+ use(t) {
1398
+ if (!t)
1398
1399
  throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");
1399
- if (!e.type)
1400
+ if (!t.type)
1400
1401
  throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");
1401
- return e.type === "backend" && (this.modules.backend = e), (e.type === "logger" || e.log && e.warn && e.error) && (this.modules.logger = e), e.type === "languageDetector" && (this.modules.languageDetector = e), e.type === "i18nFormat" && (this.modules.i18nFormat = e), e.type === "postProcessor" && Se.addPostProcessor(e), e.type === "formatter" && (this.modules.formatter = e), e.type === "3rdParty" && this.modules.external.push(e), this;
1402
+ return t.type === "backend" && (this.modules.backend = t), (t.type === "logger" || t.log && t.warn && t.error) && (this.modules.logger = t), t.type === "languageDetector" && (this.modules.languageDetector = t), t.type === "i18nFormat" && (this.modules.i18nFormat = t), t.type === "postProcessor" && Se.addPostProcessor(t), t.type === "formatter" && (this.modules.formatter = t), t.type === "3rdParty" && this.modules.external.push(t), this;
1402
1403
  }
1403
- setResolvedLanguage(e) {
1404
- if (!(!e || !this.languages) && !(["cimode", "dev"].indexOf(e) > -1))
1405
- for (let t = 0; t < this.languages.length; t++) {
1406
- const s = this.languages[t];
1404
+ setResolvedLanguage(t) {
1405
+ if (!(!t || !this.languages) && !(["cimode", "dev"].indexOf(t) > -1))
1406
+ for (let e = 0; e < this.languages.length; e++) {
1407
+ const s = this.languages[e];
1407
1408
  if (!(["cimode", "dev"].indexOf(s) > -1) && this.store.hasLanguageSomeTranslations(s)) {
1408
1409
  this.resolvedLanguage = s;
1409
1410
  break;
1410
1411
  }
1411
1412
  }
1412
1413
  }
1413
- changeLanguage(e, t) {
1414
+ changeLanguage(t, e) {
1414
1415
  var s = this;
1415
- this.isLanguageChangingTo = e;
1416
+ this.isLanguageChangingTo = t;
1416
1417
  const n = U();
1417
- this.emit("languageChanging", e);
1418
+ this.emit("languageChanging", t);
1418
1419
  const r = (o) => {
1419
1420
  this.language = o, this.languages = this.services.languageUtils.toResolveHierarchy(o), this.resolvedLanguage = void 0, this.setResolvedLanguage(o);
1420
1421
  }, a = (o, f) => {
1421
1422
  f ? (r(f), this.translator.changeLanguage(f), this.isLanguageChangingTo = void 0, this.emit("languageChanged", f), this.logger.log("languageChanged", f)) : this.isLanguageChangingTo = void 0, n.resolve(function() {
1422
1423
  return s.t(...arguments);
1423
- }), t && t(o, function() {
1424
+ }), e && e(o, function() {
1424
1425
  return s.t(...arguments);
1425
1426
  });
1426
1427
  }, l = (o) => {
1427
- !e && !o && this.services.languageDetector && (o = []);
1428
+ !t && !o && this.services.languageDetector && (o = []);
1428
1429
  const f = typeof o == "string" ? o : this.services.languageUtils.getBestMatchFromCodes(o);
1429
1430
  f && (this.language || r(f), this.translator.language || this.translator.changeLanguage(f), this.services.languageDetector && this.services.languageDetector.cacheUserLanguage && this.services.languageDetector.cacheUserLanguage(f)), this.loadResources(f, (g) => {
1430
1431
  a(g, f);
1431
1432
  });
1432
1433
  };
1433
- return !e && this.services.languageDetector && !this.services.languageDetector.async ? l(this.services.languageDetector.detect()) : !e && this.services.languageDetector && this.services.languageDetector.async ? this.services.languageDetector.detect.length === 0 ? this.services.languageDetector.detect().then(l) : this.services.languageDetector.detect(l) : l(e), n;
1434
+ return !t && this.services.languageDetector && !this.services.languageDetector.async ? l(this.services.languageDetector.detect()) : !t && this.services.languageDetector && this.services.languageDetector.async ? this.services.languageDetector.detect.length === 0 ? this.services.languageDetector.detect().then(l) : this.services.languageDetector.detect(l) : l(t), n;
1434
1435
  }
1435
- getFixedT(e, t, s) {
1436
+ getFixedT(t, e, s) {
1436
1437
  var n = this;
1437
1438
  const r = function(a, l) {
1438
1439
  let o;
@@ -1449,7 +1450,7 @@ class T extends Q {
1449
1450
  let d;
1450
1451
  return o.keyPrefix && Array.isArray(a) ? d = a.map((c) => `${o.keyPrefix}${u}${c}`) : d = o.keyPrefix ? `${o.keyPrefix}${u}${a}` : a, n.t(d, o);
1451
1452
  };
1452
- return typeof e == "string" ? r.lng = e : r.lngs = e, r.ns = t, r.keyPrefix = s, r;
1453
+ return typeof t == "string" ? r.lng = t : r.lngs = t, r.ns = e, r.keyPrefix = s, r;
1453
1454
  }
1454
1455
  t() {
1455
1456
  return this.translator && this.translator.translate(...arguments);
@@ -1457,75 +1458,75 @@ class T extends Q {
1457
1458
  exists() {
1458
1459
  return this.translator && this.translator.exists(...arguments);
1459
1460
  }
1460
- setDefaultNamespace(e) {
1461
- this.options.defaultNS = e;
1461
+ setDefaultNamespace(t) {
1462
+ this.options.defaultNS = t;
1462
1463
  }
1463
- hasLoadedNamespace(e) {
1464
- let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
1464
+ hasLoadedNamespace(t) {
1465
+ let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
1465
1466
  if (!this.isInitialized)
1466
1467
  return this.logger.warn("hasLoadedNamespace: i18next was not initialized", this.languages), !1;
1467
1468
  if (!this.languages || !this.languages.length)
1468
1469
  return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty", this.languages), !1;
1469
- const s = t.lng || this.resolvedLanguage || this.languages[0], n = this.options ? this.options.fallbackLng : !1, r = this.languages[this.languages.length - 1];
1470
+ const s = e.lng || this.resolvedLanguage || this.languages[0], n = this.options ? this.options.fallbackLng : !1, r = this.languages[this.languages.length - 1];
1470
1471
  if (s.toLowerCase() === "cimode")
1471
1472
  return !0;
1472
1473
  const a = (l, o) => {
1473
1474
  const f = this.services.backendConnector.state[`${l}|${o}`];
1474
1475
  return f === -1 || f === 2;
1475
1476
  };
1476
- if (t.precheck) {
1477
- const l = t.precheck(this, a);
1477
+ if (e.precheck) {
1478
+ const l = e.precheck(this, a);
1478
1479
  if (l !== void 0)
1479
1480
  return l;
1480
1481
  }
1481
- return !!(this.hasResourceBundle(s, e) || !this.services.backendConnector.backend || this.options.resources && !this.options.partialBundledLanguages || a(s, e) && (!n || a(r, e)));
1482
+ return !!(this.hasResourceBundle(s, t) || !this.services.backendConnector.backend || this.options.resources && !this.options.partialBundledLanguages || a(s, t) && (!n || a(r, t)));
1482
1483
  }
1483
- loadNamespaces(e, t) {
1484
+ loadNamespaces(t, e) {
1484
1485
  const s = U();
1485
- return this.options.ns ? (typeof e == "string" && (e = [e]), e.forEach((n) => {
1486
+ return this.options.ns ? (typeof t == "string" && (t = [t]), t.forEach((n) => {
1486
1487
  this.options.ns.indexOf(n) < 0 && this.options.ns.push(n);
1487
1488
  }), this.loadResources((n) => {
1488
- s.resolve(), t && t(n);
1489
- }), s) : (t && t(), Promise.resolve());
1489
+ s.resolve(), e && e(n);
1490
+ }), s) : (e && e(), Promise.resolve());
1490
1491
  }
1491
- loadLanguages(e, t) {
1492
+ loadLanguages(t, e) {
1492
1493
  const s = U();
1493
- typeof e == "string" && (e = [e]);
1494
- const n = this.options.preload || [], r = e.filter((a) => n.indexOf(a) < 0);
1494
+ typeof t == "string" && (t = [t]);
1495
+ const n = this.options.preload || [], r = t.filter((a) => n.indexOf(a) < 0);
1495
1496
  return r.length ? (this.options.preload = n.concat(r), this.loadResources((a) => {
1496
- s.resolve(), t && t(a);
1497
- }), s) : (t && t(), Promise.resolve());
1497
+ s.resolve(), e && e(a);
1498
+ }), s) : (e && e(), Promise.resolve());
1498
1499
  }
1499
- dir(e) {
1500
- if (e || (e = this.resolvedLanguage || (this.languages && this.languages.length > 0 ? this.languages[0] : this.language)), !e)
1500
+ dir(t) {
1501
+ if (t || (t = this.resolvedLanguage || (this.languages && this.languages.length > 0 ? this.languages[0] : this.language)), !t)
1501
1502
  return "rtl";
1502
- const t = ["ar", "shu", "sqr", "ssh", "xaa", "yhd", "yud", "aao", "abh", "abv", "acm", "acq", "acw", "acx", "acy", "adf", "ads", "aeb", "aec", "afb", "ajp", "apc", "apd", "arb", "arq", "ars", "ary", "arz", "auz", "avl", "ayh", "ayl", "ayn", "ayp", "bbz", "pga", "he", "iw", "ps", "pbt", "pbu", "pst", "prp", "prd", "ug", "ur", "ydd", "yds", "yih", "ji", "yi", "hbo", "men", "xmn", "fa", "jpr", "peo", "pes", "prs", "dv", "sam", "ckb"], s = this.services && this.services.languageUtils || new fe(ce());
1503
- return t.indexOf(s.getLanguagePartFromCode(e)) > -1 || e.toLowerCase().indexOf("-arab") > 1 ? "rtl" : "ltr";
1503
+ const e = ["ar", "shu", "sqr", "ssh", "xaa", "yhd", "yud", "aao", "abh", "abv", "acm", "acq", "acw", "acx", "acy", "adf", "ads", "aeb", "aec", "afb", "ajp", "apc", "apd", "arb", "arq", "ars", "ary", "arz", "auz", "avl", "ayh", "ayl", "ayn", "ayp", "bbz", "pga", "he", "iw", "ps", "pbt", "pbu", "pst", "prp", "prd", "ug", "ur", "ydd", "yds", "yih", "ji", "yi", "hbo", "men", "xmn", "fa", "jpr", "peo", "pes", "prs", "dv", "sam", "ckb"], s = this.services && this.services.languageUtils || new ge(de());
1504
+ return e.indexOf(s.getLanguagePartFromCode(t)) > -1 || t.toLowerCase().indexOf("-arab") > 1 ? "rtl" : "ltr";
1504
1505
  }
1505
1506
  static createInstance() {
1506
- let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, t = arguments.length > 1 ? arguments[1] : void 0;
1507
- return new T(e, t);
1507
+ let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, e = arguments.length > 1 ? arguments[1] : void 0;
1508
+ return new T(t, e);
1508
1509
  }
1509
1510
  cloneInstance() {
1510
- let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : H;
1511
- const s = e.forkResourceStore;
1512
- s && delete e.forkResourceStore;
1511
+ let t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : H;
1512
+ const s = t.forkResourceStore;
1513
+ s && delete t.forkResourceStore;
1513
1514
  const n = {
1514
1515
  ...this.options,
1515
- ...e,
1516
+ ...t,
1516
1517
  isClone: !0
1517
1518
  }, r = new T(n);
1518
- return (e.debug !== void 0 || e.prefix !== void 0) && (r.logger = r.logger.clone(e)), ["store", "services", "language"].forEach((l) => {
1519
+ return (t.debug !== void 0 || t.prefix !== void 0) && (r.logger = r.logger.clone(t)), ["store", "services", "language"].forEach((l) => {
1519
1520
  r[l] = this[l];
1520
1521
  }), r.services = {
1521
1522
  ...this.services
1522
1523
  }, r.services.utils = {
1523
1524
  hasLoadedNamespace: r.hasLoadedNamespace.bind(r)
1524
- }, s && (r.store = new le(this.store.data, n), r.services.resourceStore = r.store), r.translator = new Z(r.services, n), r.translator.on("*", function(l) {
1525
+ }, s && (r.store = new ue(this.store.data, n), r.services.resourceStore = r.store), r.translator = new Z(r.services, n), r.translator.on("*", function(l) {
1525
1526
  for (var o = arguments.length, f = new Array(o > 1 ? o - 1 : 0), g = 1; g < o; g++)
1526
1527
  f[g - 1] = arguments[g];
1527
1528
  r.emit(l, ...f);
1528
- }), r.init(n, t), r.translator.options = n, r.translator.backendConnector.services.utils = {
1529
+ }), r.init(n, e), r.translator.options = n, r.translator.backendConnector.services.utils = {
1529
1530
  hasLoadedNamespace: r.hasLoadedNamespace.bind(r)
1530
1531
  }, r;
1531
1532
  }
@@ -1539,30 +1540,30 @@ class T extends Q {
1539
1540
  };
1540
1541
  }
1541
1542
  }
1542
- const b = T.createInstance();
1543
- b.createInstance = T.createInstance;
1544
- b.createInstance;
1545
- b.dir;
1546
- b.init;
1547
- b.loadResources;
1548
- b.reloadResources;
1549
- b.use;
1550
- b.changeLanguage;
1551
- b.getFixedT;
1552
- const J = b.t;
1553
- b.exists;
1554
- b.setDefaultNamespace;
1555
- b.hasLoadedNamespace;
1556
- b.loadNamespaces;
1557
- b.loadLanguages;
1543
+ const x = T.createInstance();
1544
+ x.createInstance = T.createInstance;
1545
+ x.createInstance;
1546
+ x.dir;
1547
+ x.init;
1548
+ x.loadResources;
1549
+ x.reloadResources;
1550
+ x.use;
1551
+ x.changeLanguage;
1552
+ x.getFixedT;
1553
+ const J = x.t;
1554
+ x.exists;
1555
+ x.setDefaultNamespace;
1556
+ x.hasLoadedNamespace;
1557
+ x.loadNamespaces;
1558
+ x.loadLanguages;
1558
1559
  const Qe = {
1559
1560
  es: {
1560
1561
  translation: {
1561
- ...Ne
1562
+ ...Re
1562
1563
  }
1563
1564
  }
1564
1565
  };
1565
- b.init({
1566
+ x.init({
1566
1567
  resources: Qe,
1567
1568
  lng: "es",
1568
1569
  // language to use, more information here: https://www.i18next.com/overview/configuration-options#languages-namespaces-resources
@@ -1575,7 +1576,7 @@ b.init({
1575
1576
  },
1576
1577
  debug: !1
1577
1578
  });
1578
- const C = {
1579
+ const E = {
1579
1580
  // EXAMPLE ERROR
1580
1581
  "MP-001": {
1581
1582
  code: 400,
@@ -1613,70 +1614,70 @@ const C = {
1613
1614
  level: "warning"
1614
1615
  }
1615
1616
  };
1616
- class _ extends Pe {
1617
- get(e = "default", t) {
1617
+ class ee extends Pe {
1618
+ get(t = "default", e) {
1618
1619
  var r, a;
1619
- if (e instanceof Error)
1620
- return this.logError(e.message), {
1621
- ...C.internalError,
1622
- title: J(C.internalError.title),
1623
- message: J(C.internalError.message),
1624
- uuid: t
1620
+ if (t instanceof Error)
1621
+ return this.logError(t.message), {
1622
+ ...E.internalError,
1623
+ title: J(E.internalError.title),
1624
+ message: J(E.internalError.message),
1625
+ uuid: e
1625
1626
  };
1626
- const s = typeof e == "string" ? e : e.code ?? e.errorType, n = typeof e == "string" ? {} : { ...e };
1627
+ const s = typeof t == "string" ? t : t.code ?? t.errorType, n = typeof t == "string" ? {} : { ...t };
1627
1628
  return {
1628
- ...C[s] ?? C.default,
1629
+ ...E[s] ?? E.default,
1629
1630
  title: J(
1630
- ((r = C[s]) == null ? void 0 : r.title) ?? C.default.title,
1631
+ ((r = E[s]) == null ? void 0 : r.title) ?? E.default.title,
1631
1632
  n
1632
1633
  ),
1633
1634
  message: J(
1634
- ((a = C[s]) == null ? void 0 : a.message) ?? C.default.message,
1635
+ ((a = E[s]) == null ? void 0 : a.message) ?? E.default.message,
1635
1636
  n
1636
1637
  ),
1637
- uuid: t
1638
+ uuid: e
1638
1639
  };
1639
1640
  }
1640
1641
  }
1641
- class ot extends $e {
1642
+ class ut extends $e {
1642
1643
  constructor() {
1643
1644
  super(...arguments);
1644
1645
  $(this, "uuid", "");
1645
1646
  $(this, "session", null);
1646
1647
  }
1647
- setSession(t) {
1648
- this.session = t;
1648
+ setSession(e) {
1649
+ this.session = e;
1649
1650
  }
1650
1651
  getSession() {
1651
1652
  return this.session;
1652
1653
  }
1653
- returnData(t, s, n) {
1654
+ returnData(e, s, n) {
1654
1655
  const r = this.encode(s, n);
1655
- t.status(200).json(r);
1656
+ e.status(200).json(r);
1656
1657
  }
1657
- returnError(t, s) {
1658
- return s != null && s.uuid ? t.status(520).json(s) : t.status(520).json(new _().get(s, this.uuid));
1658
+ returnError(e, s) {
1659
+ return s != null && s.uuid ? e.status(520).json(s) : e.status(520).json(new ee().get(s, this.uuid));
1659
1660
  }
1660
- get(t) {
1661
+ get(e) {
1661
1662
  return this.logDebug("get ApiMiddleware"), (s, n) => {
1662
1663
  var r;
1663
- this.logDebug("return ApiMiddleware"), this.uuid = (r = s == null ? void 0 : s.body) == null ? void 0 : r.uuid, w(s).pipe(
1664
- N(
1665
- (a) => ie({
1666
- params: w(this.decode(a.body)),
1667
- headers: w(a.headers)
1664
+ this.logDebug("return ApiMiddleware"), this.uuid = (r = s == null ? void 0 : s.body) == null ? void 0 : r.uuid, N(s).pipe(
1665
+ R(
1666
+ (a) => re({
1667
+ params: N(this.decode(a.body)),
1668
+ headers: N(a.headers)
1668
1669
  })
1669
1670
  ),
1670
- N(
1671
- ({ params: a, headers: l }) => ie({
1672
- response: t(a, this.uuid, l),
1673
- headers: w(l),
1674
- params: w(a)
1671
+ R(
1672
+ ({ params: a, headers: l }) => re({
1673
+ response: e(a, this.uuid, l),
1674
+ headers: N(l),
1675
+ params: N(a)
1675
1676
  })
1676
1677
  ),
1677
- N(({ params: a, response: l, headers: o }) => (this.logDebug(
1678
+ R(({ params: a, response: l, headers: o }) => (this.logDebug(
1678
1679
  `ApiMiddleware \x1B[37m <URL>: \x1B[33m ${s.url} \x1B[37m <HEADERS>: \x1B[33m ${JSON.stringify(o)} \x1B[37m <UUID> \x1B[33m ${s.body.uuid} \x1B[37m <PARAMS> \x1B[33m ${JSON.stringify(a)} \x1B[37m <RESPONSE>: \x1B[33m ${JSON.stringify(l)}`
1679
- ), w(l))),
1680
+ ), N(l))),
1680
1681
  me((a) => {
1681
1682
  var l;
1682
1683
  return this.logError(
@@ -1691,90 +1692,116 @@ class ot extends $e {
1691
1692
  };
1692
1693
  }
1693
1694
  }
1694
- class lt extends Re {
1695
- constructor(t, s) {
1695
+ const Xe = process.env.ID_FRONT ?? "NOT_AVAILABLE";
1696
+ class ft extends Ne {
1697
+ constructor(e, s) {
1696
1698
  super();
1697
1699
  $(this, "apiUrl");
1698
1700
  $(this, "method");
1699
- this.apiUrl = t, this.method = s ?? "POST";
1700
- }
1701
- errorHandler(t, s) {
1702
- if (t != null && t.errors)
1703
- throw new _().get(t.errors[0], s);
1704
- return !(t != null && t.errors);
1701
+ this.apiUrl = e, this.method = s ?? "POST";
1702
+ }
1703
+ errorHandler(e, s) {
1704
+ if (e != null && e.errors)
1705
+ throw new ee().get(e.errors[0], s);
1706
+ return !(e != null && e.errors);
1707
+ }
1708
+ formatParams(e) {
1709
+ return JSON.stringify({
1710
+ data: {
1711
+ type: Xe,
1712
+ attributes: e
1713
+ }
1714
+ });
1705
1715
  }
1706
- fetchData(t, s) {
1707
- return w(t).pipe(
1708
- N(
1709
- (n) => this.getHeaders().pipe(N((r) => w({ params: n, headers: r })))
1710
- ),
1711
- N(
1712
- ({ params: n, headers: r }) => pe(this.apiUrl, {
1713
- method: this.method,
1714
- headers: r,
1715
- body: this.method === "GET" ? null : JSON.stringify(n),
1716
- selector: (a) => a.json()
1716
+ fetchData(e = {}, s) {
1717
+ return this.getHeaders().pipe(
1718
+ R(
1719
+ (n) => q(this.apiUrl, {
1720
+ method: "POST",
1721
+ headers: n,
1722
+ body: this.formatParams(e),
1723
+ selector: (r) => r.json()
1717
1724
  }).pipe(
1718
- N((a) => (this.logDebug(
1725
+ R((r) => (this.logDebug(
1719
1726
  `FetchServiceBE \x1B[37m <URL>: \x1B[33m ${this.apiUrl} \x1B[37m <UUID>: \x1B[33m ${s} \x1B[37m <HEADERS>: \x1B[33m ${JSON.stringify(
1720
- r
1721
- )} \x1B[37m <BODY>: \x1B[33m ${JSON.stringify(
1722
1727
  n
1723
- )} \x1B[37m <RESPONSE>: \x1B[33m ${JSON.stringify(a)} \x1B[33m`
1724
- ), w(a)))
1728
+ )} \x1B[37m <BODY>: \x1B[33m ${JSON.stringify(
1729
+ e
1730
+ )} \x1B[37m <RESPONSE>: \x1B[33m ${JSON.stringify(r)} \x1B[33m`
1731
+ ), N(r)))
1725
1732
  )
1726
1733
  ),
1727
- be((n) => this.errorHandler(n, s))
1734
+ xe((n) => this.errorHandler(n, s))
1735
+ );
1736
+ }
1737
+ fetchCustomData(e = {}, s) {
1738
+ return this.getHeaders().pipe(
1739
+ R(
1740
+ (n) => q(this.apiUrl, {
1741
+ method: this.method,
1742
+ headers: n,
1743
+ body: this.method === "GET" ? null : JSON.stringify(e),
1744
+ selector: (r) => r.json()
1745
+ }).pipe(
1746
+ R((r) => (this.logDebug(
1747
+ `FetchServiceBE \x1B[37m <URL>: \x1B[33m ${this.apiUrl} \x1B[37m \x1B[37m <METHOD>: \x1B[33m ${this.method} <UUID>: \x1B[33m ${s} \x1B[37m <HEADERS>: \x1B[33m ${JSON.stringify(
1748
+ n
1749
+ )} \x1B[37m <BODY>: \x1B[33m ${JSON.stringify(
1750
+ e
1751
+ )} \x1B[37m <RESPONSE>: \x1B[33m ${JSON.stringify(r)} \x1B[33m`
1752
+ ), N(r)))
1753
+ )
1754
+ )
1728
1755
  );
1729
1756
  }
1730
1757
  }
1731
- class ut extends Ce {
1732
- constructor(t, s = "POST", n = {}) {
1758
+ class gt extends Ee {
1759
+ constructor(e, s = "POST", n = {}) {
1733
1760
  super();
1734
1761
  $(this, "apiUrl");
1735
1762
  $(this, "method");
1736
1763
  $(this, "headers");
1737
1764
  $(this, "isLoadingEnabled", !0);
1738
- this.apiUrl = t, this.method = s, this.headers = {
1765
+ this.apiUrl = e, this.method = s, this.headers = {
1739
1766
  "Content-Type": "application/json",
1740
1767
  ...n
1741
1768
  };
1742
1769
  }
1743
- setIsLoadingEnabled(t) {
1744
- this.isLoadingEnabled = t;
1770
+ setIsLoadingEnabled(e) {
1771
+ this.isLoadingEnabled = e;
1745
1772
  }
1746
- errorHandler(t) {
1747
- return t.code && (ne.getInstance().setSubject(t), M.getInstance().setSubject(!1)), !t.code;
1773
+ errorHandler(e) {
1774
+ return e.code && (ie.getInstance().setSubject(e), M.getInstance().setSubject(!1)), !e.code;
1748
1775
  }
1749
- fetchData(t = {}) {
1750
- const s = (/* @__PURE__ */ new Date()).toISOString(), n = re.v5(s, re.v5.URL), r = this.encode({ ...t }, n);
1776
+ fetchData(e = {}) {
1777
+ const s = (/* @__PURE__ */ new Date()).toISOString(), n = ae(s, ae.URL), r = this.encode({ ...e }, n);
1751
1778
  M.getInstance().setSubject(this.isLoadingEnabled);
1752
1779
  const l = new URLSearchParams(window.location.search).get("flow") ?? "N/A";
1753
- return pe(this.apiUrl, {
1780
+ return q(this.apiUrl, {
1754
1781
  method: this.method,
1755
1782
  headers: { ...this.headers, flow: l },
1756
1783
  body: r,
1757
1784
  selector: (o) => o.json()
1758
1785
  }).pipe(
1759
- N((o) => w(this.decode(o))),
1760
- N((o) => (this.logDebug(
1761
- `FetchServiceFE <URL>: ${this.apiUrl} <HEADERS>: ${JSON.stringify(this.headers)} <PARAMS> ${JSON.stringify(t)} <BODY> ${r} <RESPONSE>: ${JSON.stringify(o)}`
1762
- ), w(o))),
1763
- be(this.errorHandler),
1764
- N((o) => (M.getInstance().setSubject(!1), w(o))),
1765
- me((o) => (M.getInstance().setSubject(!1), ne.getInstance().setSubject(
1766
- new _().get(o, n)
1786
+ R((o) => N(this.decode(o))),
1787
+ R((o) => (this.logDebug(
1788
+ `FetchServiceFE <URL>: ${this.apiUrl} <HEADERS>: ${JSON.stringify(this.headers)} <PARAMS> ${JSON.stringify(e)} <BODY> ${r} <RESPONSE>: ${JSON.stringify(o)}`
1789
+ ), N(o))),
1790
+ xe(this.errorHandler),
1791
+ R((o) => (M.getInstance().setSubject(!1), N(o))),
1792
+ me((o) => (M.getInstance().setSubject(!1), ie.getInstance().setSubject(
1793
+ new ee().get(o, n)
1767
1794
  ), ye))
1768
1795
  );
1769
1796
  }
1770
1797
  }
1771
1798
  export {
1772
- ot as ApiMiddleware,
1773
- _ as ErrorCatalog,
1774
- lt as FetchServiceBE,
1775
- ut as FetchServiceFE,
1799
+ ut as ApiMiddleware,
1800
+ ee as ErrorCatalog,
1801
+ ft as FetchServiceBE,
1802
+ gt as FetchServiceFE,
1776
1803
  M as LoadingHandler,
1777
- ne as MessageHandler,
1778
- dt as RxSubjectManager,
1779
- ht as ServiceToken
1804
+ ie as MessageHandler,
1805
+ mt as RxSubjectManager,
1806
+ dt as ServiceToken
1780
1807
  };