@entropic-bond/localize-react 1.7.1 → 1.7.2

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,12 +1,13 @@
1
- const A = class A {
2
- constructor(o) {
3
- this._pendingPromise = void 0, this._table = void 0, this._table = void 0, this._pendingPromise = void 0, this._lang = o.locale || "en", this._localePath = o.localePath || "";
1
+ import { Component as u, useState as o, useEffect as f } from "react";
2
+ const i = class i {
3
+ constructor(e) {
4
+ this._pendingPromise = void 0, this._table = void 0, this._table = void 0, this._pendingPromise = void 0, this._lang = e.locale || "en", this._localePath = e.localePath || "";
4
5
  }
5
6
  static get instance() {
6
- return this._instance || (this._instance = new A(this._registeredConfig)), this._instance;
7
+ return this._instance || (this._instance = new i(this._registeredConfig)), this._instance;
7
8
  }
8
9
  static get currentLocale() {
9
- return A._registeredConfig.locale || A.instance._lang;
10
+ return i._registeredConfig.locale || i.instance._lang;
10
11
  }
11
12
  /**
12
13
  * Returns the plural form of a word
@@ -16,29 +17,29 @@ const A = class A {
16
17
  * @param pluralizer a map of words to their plural form or a function that returns the plural form
17
18
  * @returns the plural form of the word
18
19
  */
19
- pluralize(o, y = 0, _) {
20
- var W;
21
- if (y === 1)
22
- return o;
23
- let $;
24
- if (typeof _ != "function") {
25
- if ($ = _ == null ? void 0 : _[o], $)
26
- return $;
20
+ pluralize(e, t = 0, s) {
21
+ var h;
22
+ if (t === 1)
23
+ return e;
24
+ let n;
25
+ if (typeof s != "function") {
26
+ if (n = s == null ? void 0 : s[e], n)
27
+ return n;
27
28
  } else
28
- $ = _ == null ? void 0 : _(o, this._lang);
29
- let x = 0;
30
- const D = A._registeredRules[this._lang];
31
- for (; !$ && D && x < D.length; )
32
- $ = (W = D[x++]) == null ? void 0 : W.call(D, o, this._lang);
33
- return $ ?? o;
34
- }
35
- static config(o) {
29
+ n = s == null ? void 0 : s(e, this._lang);
30
+ let r = 0;
31
+ const l = i._registeredRules[this._lang];
32
+ for (; !n && l && r < l.length; )
33
+ n = (h = l[r++]) == null ? void 0 : h.call(l, e, this._lang);
34
+ return n ?? e;
35
+ }
36
+ static config(e) {
36
37
  this._registeredConfig = {
37
38
  ...this._registeredConfig,
38
- ...o
39
+ ...e
39
40
  }, this._instance = void 0;
40
41
  }
41
- async get(o) {
42
+ async get(e) {
42
43
  return this._table || (this._table = await this.fetchCache(
43
44
  async () => {
44
45
  try {
@@ -47,13 +48,13 @@ const A = class A {
47
48
  return (await fetch(this.getLocaleFilePath("en"))).json();
48
49
  }
49
50
  }
50
- )), this._table[o];
51
+ )), this._table[e];
51
52
  }
52
- fetchCache(o) {
53
- return this._pendingPromise || (this._pendingPromise = new Promise((y) => y(o()))), this._pendingPromise;
53
+ fetchCache(e) {
54
+ return this._pendingPromise || (this._pendingPromise = new Promise((t) => t(e()))), this._pendingPromise;
54
55
  }
55
- getLocaleFilePath(o) {
56
- return this._lang.indexOf("http") < 0 ? `${this._localePath}/${o || this._lang}.json` : this._lang;
56
+ getLocaleFilePath(e) {
57
+ return this._lang.indexOf("http") < 0 ? `${this._localePath}/${e || this._lang}.json` : this._lang;
57
58
  }
58
59
  /**
59
60
  * Registers a rule to pluralize words
@@ -61,1585 +62,86 @@ const A = class A {
61
62
  * @param rule a function that returns the plural form of a word
62
63
  * @param locale the locale to use the rule
63
64
  */
64
- static usePluralizerRule(o, y) {
65
- A._registeredRules[y] || (A._registeredRules[y] = []), !(A._registeredRules[y].indexOf(o) >= 0) && A._registeredRules[y].unshift(o);
65
+ static usePluralizerRule(e, t) {
66
+ i._registeredRules[t] || (i._registeredRules[t] = []), !(i._registeredRules[t].indexOf(e) >= 0) && i._registeredRules[t].unshift(e);
66
67
  }
67
68
  /**
68
69
  * Registers a rule to pluralize words
69
70
  * @deprecated use usePluralizerRule instead
70
71
  */
71
- static useRule(o, y) {
72
- return A.usePluralizerRule(o, y);
72
+ static useRule(e, t) {
73
+ return i.usePluralizerRule(e, t);
73
74
  }
74
75
  };
75
- A.defaultRules = {
76
+ i.defaultRules = {
76
77
  en: [
77
- (o) => o.slice(-1) === "f" ? o.slice(0, -1) + "ves" : o.slice(-1) === "o" ? o.slice(0, -1) + "oes" : o.slice(-1) === "x" ? o.slice(0, -1) + "xes" : o.slice(-1) === "h" ? o.slice(0, -1) + "hes" : o.slice(-1) === "s" ? o.slice(0, -1) + "ses" : o.slice(-1) === "y" ? o.slice(0, -1) + "ies" : o.slice(-1) === "z" ? o.slice(0, -1) + "zes" : o + "s"
78
+ (e) => e.slice(-1) === "f" ? e.slice(0, -1) + "ves" : e.slice(-1) === "o" ? e.slice(0, -1) + "oes" : e.slice(-1) === "x" ? e.slice(0, -1) + "xes" : e.slice(-1) === "h" ? e.slice(0, -1) + "hes" : e.slice(-1) === "s" ? e.slice(0, -1) + "ses" : e.slice(-1) === "y" ? e.slice(0, -1) + "ies" : e.slice(-1) === "z" ? e.slice(0, -1) + "zes" : e + "s"
78
79
  ],
79
80
  es: [
80
- (o) => o.slice(-1) === "l" ? o.slice(0, -1) + "les" : o.slice(-1) === "n" ? o.slice(0, -1) + "nes" : o.slice(-1) === "r" ? o.slice(0, -1) + "res" : o.slice(-1) === "z" ? o.slice(0, -1) + "ces" : o + "s"
81
+ (e) => e.slice(-1) === "l" ? e.slice(0, -1) + "les" : e.slice(-1) === "n" ? e.slice(0, -1) + "nes" : e.slice(-1) === "r" ? e.slice(0, -1) + "res" : e.slice(-1) === "z" ? e.slice(0, -1) + "ces" : e + "s"
81
82
  ]
82
- }, A._instance = void 0, A._registeredConfig = {}, A._registeredRules = A.defaultRules;
83
- let H = A;
84
- var Ye = { exports: {} }, p = {};
85
- /**
86
- * @license React
87
- * react.production.min.js
88
- *
89
- * Copyright (c) Facebook, Inc. and its affiliates.
90
- *
91
- * This source code is licensed under the MIT license found in the
92
- * LICENSE file in the root directory of this source tree.
93
- */
94
- var Pt;
95
- function Fr() {
96
- if (Pt)
97
- return p;
98
- Pt = 1;
99
- var T = Symbol.for("react.element"), o = Symbol.for("react.portal"), y = Symbol.for("react.fragment"), _ = Symbol.for("react.strict_mode"), $ = Symbol.for("react.profiler"), x = Symbol.for("react.provider"), D = Symbol.for("react.context"), W = Symbol.for("react.forward_ref"), oe = Symbol.for("react.suspense"), X = Symbol.for("react.memo"), q = Symbol.for("react.lazy"), G = Symbol.iterator;
100
- function ie(r) {
101
- return r === null || typeof r != "object" ? null : (r = G && r[G] || r["@@iterator"], typeof r == "function" ? r : null);
102
- }
103
- var M = { isMounted: function() {
104
- return !1;
105
- }, enqueueForceUpdate: function() {
106
- }, enqueueReplaceState: function() {
107
- }, enqueueSetState: function() {
108
- } }, K = Object.assign, pe = {};
109
- function V(r, u, d) {
110
- this.props = r, this.context = u, this.refs = pe, this.updater = d || M;
111
- }
112
- V.prototype.isReactComponent = {}, V.prototype.setState = function(r, u) {
113
- if (typeof r != "object" && typeof r != "function" && r != null)
114
- throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");
115
- this.updater.enqueueSetState(this, r, u, "setState");
116
- }, V.prototype.forceUpdate = function(r) {
117
- this.updater.enqueueForceUpdate(this, r, "forceUpdate");
118
- };
119
- function ve() {
120
- }
121
- ve.prototype = V.prototype;
122
- function Z(r, u, d) {
123
- this.props = r, this.context = u, this.refs = pe, this.updater = d || M;
124
- }
125
- var ee = Z.prototype = new ve();
126
- ee.constructor = Z, K(ee, V.prototype), ee.isPureReactComponent = !0;
127
- var U = Array.isArray, k = Object.prototype.hasOwnProperty, F = { current: null }, Y = { key: !0, ref: !0, __self: !0, __source: !0 };
128
- function Q(r, u, d) {
129
- var m, v = {}, b = null, O = null;
130
- if (u != null)
131
- for (m in u.ref !== void 0 && (O = u.ref), u.key !== void 0 && (b = "" + u.key), u)
132
- k.call(u, m) && !Y.hasOwnProperty(m) && (v[m] = u[m]);
133
- var R = arguments.length - 2;
134
- if (R === 1)
135
- v.children = d;
136
- else if (1 < R) {
137
- for (var E = Array(R), I = 0; I < R; I++)
138
- E[I] = arguments[I + 2];
139
- v.children = E;
140
- }
141
- if (r && r.defaultProps)
142
- for (m in R = r.defaultProps, R)
143
- v[m] === void 0 && (v[m] = R[m]);
144
- return { $$typeof: T, type: r, key: b, ref: O, props: v, _owner: F.current };
145
- }
146
- function he(r, u) {
147
- return { $$typeof: T, type: r.type, key: u, ref: r.ref, props: r.props, _owner: r._owner };
148
- }
149
- function ue(r) {
150
- return typeof r == "object" && r !== null && r.$$typeof === T;
151
- }
152
- function ke(r) {
153
- var u = { "=": "=0", ":": "=2" };
154
- return "$" + r.replace(/[=:]/g, function(d) {
155
- return u[d];
156
- });
157
- }
158
- var ye = /\/+/g;
159
- function se(r, u) {
160
- return typeof r == "object" && r !== null && r.key != null ? ke("" + r.key) : u.toString(36);
161
- }
162
- function te(r, u, d, m, v) {
163
- var b = typeof r;
164
- (b === "undefined" || b === "boolean") && (r = null);
165
- var O = !1;
166
- if (r === null)
167
- O = !0;
168
- else
169
- switch (b) {
170
- case "string":
171
- case "number":
172
- O = !0;
173
- break;
174
- case "object":
175
- switch (r.$$typeof) {
176
- case T:
177
- case o:
178
- O = !0;
179
- }
180
- }
181
- if (O)
182
- return O = r, v = v(O), r = m === "" ? "." + se(O, 0) : m, U(v) ? (d = "", r != null && (d = r.replace(ye, "$&/") + "/"), te(v, u, d, "", function(I) {
183
- return I;
184
- })) : v != null && (ue(v) && (v = he(v, d + (!v.key || O && O.key === v.key ? "" : ("" + v.key).replace(ye, "$&/") + "/") + r)), u.push(v)), 1;
185
- if (O = 0, m = m === "" ? "." : m + ":", U(r))
186
- for (var R = 0; R < r.length; R++) {
187
- b = r[R];
188
- var E = m + se(b, R);
189
- O += te(b, u, d, E, v);
190
- }
191
- else if (E = ie(r), typeof E == "function")
192
- for (r = E.call(r), R = 0; !(b = r.next()).done; )
193
- b = b.value, E = m + se(b, R++), O += te(b, u, d, E, v);
194
- else if (b === "object")
195
- throw u = String(r), Error("Objects are not valid as a React child (found: " + (u === "[object Object]" ? "object with keys {" + Object.keys(r).join(", ") + "}" : u) + "). If you meant to render a collection of children, use an array instead.");
196
- return O;
197
- }
198
- function N(r, u, d) {
199
- if (r == null)
200
- return r;
201
- var m = [], v = 0;
202
- return te(r, m, "", "", function(b) {
203
- return u.call(d, b, v++);
204
- }), m;
205
- }
206
- function z(r) {
207
- if (r._status === -1) {
208
- var u = r._result;
209
- u = u(), u.then(function(d) {
210
- (r._status === 0 || r._status === -1) && (r._status = 1, r._result = d);
211
- }, function(d) {
212
- (r._status === 0 || r._status === -1) && (r._status = 2, r._result = d);
213
- }), r._status === -1 && (r._status = 0, r._result = u);
214
- }
215
- if (r._status === 1)
216
- return r._result.default;
217
- throw r._result;
218
- }
219
- var l = { current: null }, J = { transition: null }, me = { ReactCurrentDispatcher: l, ReactCurrentBatchConfig: J, ReactCurrentOwner: F };
220
- return p.Children = { map: N, forEach: function(r, u, d) {
221
- N(r, function() {
222
- u.apply(this, arguments);
223
- }, d);
224
- }, count: function(r) {
225
- var u = 0;
226
- return N(r, function() {
227
- u++;
228
- }), u;
229
- }, toArray: function(r) {
230
- return N(r, function(u) {
231
- return u;
232
- }) || [];
233
- }, only: function(r) {
234
- if (!ue(r))
235
- throw Error("React.Children.only expected to receive a single React element child.");
236
- return r;
237
- } }, p.Component = V, p.Fragment = y, p.Profiler = $, p.PureComponent = Z, p.StrictMode = _, p.Suspense = oe, p.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = me, p.cloneElement = function(r, u, d) {
238
- if (r == null)
239
- throw Error("React.cloneElement(...): The argument must be a React element, but you passed " + r + ".");
240
- var m = K({}, r.props), v = r.key, b = r.ref, O = r._owner;
241
- if (u != null) {
242
- if (u.ref !== void 0 && (b = u.ref, O = F.current), u.key !== void 0 && (v = "" + u.key), r.type && r.type.defaultProps)
243
- var R = r.type.defaultProps;
244
- for (E in u)
245
- k.call(u, E) && !Y.hasOwnProperty(E) && (m[E] = u[E] === void 0 && R !== void 0 ? R[E] : u[E]);
246
- }
247
- var E = arguments.length - 2;
248
- if (E === 1)
249
- m.children = d;
250
- else if (1 < E) {
251
- R = Array(E);
252
- for (var I = 0; I < E; I++)
253
- R[I] = arguments[I + 2];
254
- m.children = R;
255
- }
256
- return { $$typeof: T, type: r.type, key: v, ref: b, props: m, _owner: O };
257
- }, p.createContext = function(r) {
258
- return r = { $$typeof: D, _currentValue: r, _currentValue2: r, _threadCount: 0, Provider: null, Consumer: null, _defaultValue: null, _globalName: null }, r.Provider = { $$typeof: x, _context: r }, r.Consumer = r;
259
- }, p.createElement = Q, p.createFactory = function(r) {
260
- var u = Q.bind(null, r);
261
- return u.type = r, u;
262
- }, p.createRef = function() {
263
- return { current: null };
264
- }, p.forwardRef = function(r) {
265
- return { $$typeof: W, render: r };
266
- }, p.isValidElement = ue, p.lazy = function(r) {
267
- return { $$typeof: q, _payload: { _status: -1, _result: r }, _init: z };
268
- }, p.memo = function(r, u) {
269
- return { $$typeof: X, type: r, compare: u === void 0 ? null : u };
270
- }, p.startTransition = function(r) {
271
- var u = J.transition;
272
- J.transition = {};
273
- try {
274
- r();
275
- } finally {
276
- J.transition = u;
277
- }
278
- }, p.unstable_act = function() {
279
- throw Error("act(...) is not supported in production builds of React.");
280
- }, p.useCallback = function(r, u) {
281
- return l.current.useCallback(r, u);
282
- }, p.useContext = function(r) {
283
- return l.current.useContext(r);
284
- }, p.useDebugValue = function() {
285
- }, p.useDeferredValue = function(r) {
286
- return l.current.useDeferredValue(r);
287
- }, p.useEffect = function(r, u) {
288
- return l.current.useEffect(r, u);
289
- }, p.useId = function() {
290
- return l.current.useId();
291
- }, p.useImperativeHandle = function(r, u, d) {
292
- return l.current.useImperativeHandle(r, u, d);
293
- }, p.useInsertionEffect = function(r, u) {
294
- return l.current.useInsertionEffect(r, u);
295
- }, p.useLayoutEffect = function(r, u) {
296
- return l.current.useLayoutEffect(r, u);
297
- }, p.useMemo = function(r, u) {
298
- return l.current.useMemo(r, u);
299
- }, p.useReducer = function(r, u, d) {
300
- return l.current.useReducer(r, u, d);
301
- }, p.useRef = function(r) {
302
- return l.current.useRef(r);
303
- }, p.useState = function(r) {
304
- return l.current.useState(r);
305
- }, p.useSyncExternalStore = function(r, u, d) {
306
- return l.current.useSyncExternalStore(r, u, d);
307
- }, p.useTransition = function() {
308
- return l.current.useTransition();
309
- }, p.version = "18.2.0", p;
310
- }
311
- var de = { exports: {} };
312
- /**
313
- * @license React
314
- * react.development.js
315
- *
316
- * Copyright (c) Facebook, Inc. and its affiliates.
317
- *
318
- * This source code is licensed under the MIT license found in the
319
- * LICENSE file in the root directory of this source tree.
320
- */
321
- de.exports;
322
- var Tt;
323
- function xr() {
324
- return Tt || (Tt = 1, function(T, o) {
325
- process.env.NODE_ENV !== "production" && function() {
326
- typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
327
- var y = "18.2.0", _ = Symbol.for("react.element"), $ = Symbol.for("react.portal"), x = Symbol.for("react.fragment"), D = Symbol.for("react.strict_mode"), W = Symbol.for("react.profiler"), oe = Symbol.for("react.provider"), X = Symbol.for("react.context"), q = Symbol.for("react.forward_ref"), G = Symbol.for("react.suspense"), ie = Symbol.for("react.suspense_list"), M = Symbol.for("react.memo"), K = Symbol.for("react.lazy"), pe = Symbol.for("react.offscreen"), V = Symbol.iterator, ve = "@@iterator";
328
- function Z(e) {
329
- if (e === null || typeof e != "object")
330
- return null;
331
- var t = V && e[V] || e[ve];
332
- return typeof t == "function" ? t : null;
333
- }
334
- var ee = {
335
- /**
336
- * @internal
337
- * @type {ReactComponent}
338
- */
339
- current: null
340
- }, U = {
341
- transition: null
342
- }, k = {
343
- current: null,
344
- // Used to reproduce behavior of `batchedUpdates` in legacy mode.
345
- isBatchingLegacy: !1,
346
- didScheduleLegacyUpdate: !1
347
- }, F = {
348
- /**
349
- * @internal
350
- * @type {ReactComponent}
351
- */
352
- current: null
353
- }, Y = {}, Q = null;
354
- function he(e) {
355
- Q = e;
356
- }
357
- Y.setExtraStackFrame = function(e) {
358
- Q = e;
359
- }, Y.getCurrentStack = null, Y.getStackAddendum = function() {
360
- var e = "";
361
- Q && (e += Q);
362
- var t = Y.getCurrentStack;
363
- return t && (e += t() || ""), e;
364
- };
365
- var ue = !1, ke = !1, ye = !1, se = !1, te = !1, N = {
366
- ReactCurrentDispatcher: ee,
367
- ReactCurrentBatchConfig: U,
368
- ReactCurrentOwner: F
369
- };
370
- N.ReactDebugCurrentFrame = Y, N.ReactCurrentActQueue = k;
371
- function z(e) {
372
- {
373
- for (var t = arguments.length, n = new Array(t > 1 ? t - 1 : 0), a = 1; a < t; a++)
374
- n[a - 1] = arguments[a];
375
- J("warn", e, n);
376
- }
377
- }
378
- function l(e) {
379
- {
380
- for (var t = arguments.length, n = new Array(t > 1 ? t - 1 : 0), a = 1; a < t; a++)
381
- n[a - 1] = arguments[a];
382
- J("error", e, n);
383
- }
384
- }
385
- function J(e, t, n) {
386
- {
387
- var a = N.ReactDebugCurrentFrame, i = a.getStackAddendum();
388
- i !== "" && (t += "%s", n = n.concat([i]));
389
- var c = n.map(function(s) {
390
- return String(s);
391
- });
392
- c.unshift("Warning: " + t), Function.prototype.apply.call(console[e], console, c);
393
- }
394
- }
395
- var me = {};
396
- function r(e, t) {
397
- {
398
- var n = e.constructor, a = n && (n.displayName || n.name) || "ReactClass", i = a + "." + t;
399
- if (me[i])
400
- return;
401
- l("Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.", t, a), me[i] = !0;
402
- }
403
- }
404
- var u = {
405
- /**
406
- * Checks whether or not this composite component is mounted.
407
- * @param {ReactClass} publicInstance The instance we want to test.
408
- * @return {boolean} True if mounted, false otherwise.
409
- * @protected
410
- * @final
411
- */
412
- isMounted: function(e) {
413
- return !1;
414
- },
415
- /**
416
- * Forces an update. This should only be invoked when it is known with
417
- * certainty that we are **not** in a DOM transaction.
418
- *
419
- * You may want to call this when you know that some deeper aspect of the
420
- * component's state has changed but `setState` was not called.
421
- *
422
- * This will not invoke `shouldComponentUpdate`, but it will invoke
423
- * `componentWillUpdate` and `componentDidUpdate`.
424
- *
425
- * @param {ReactClass} publicInstance The instance that should rerender.
426
- * @param {?function} callback Called after component is updated.
427
- * @param {?string} callerName name of the calling function in the public API.
428
- * @internal
429
- */
430
- enqueueForceUpdate: function(e, t, n) {
431
- r(e, "forceUpdate");
432
- },
433
- /**
434
- * Replaces all of the state. Always use this or `setState` to mutate state.
435
- * You should treat `this.state` as immutable.
436
- *
437
- * There is no guarantee that `this.state` will be immediately updated, so
438
- * accessing `this.state` after calling this method may return the old value.
439
- *
440
- * @param {ReactClass} publicInstance The instance that should rerender.
441
- * @param {object} completeState Next state.
442
- * @param {?function} callback Called after component is updated.
443
- * @param {?string} callerName name of the calling function in the public API.
444
- * @internal
445
- */
446
- enqueueReplaceState: function(e, t, n, a) {
447
- r(e, "replaceState");
448
- },
449
- /**
450
- * Sets a subset of the state. This only exists because _pendingState is
451
- * internal. This provides a merging strategy that is not available to deep
452
- * properties which is confusing. TODO: Expose pendingState or don't use it
453
- * during the merge.
454
- *
455
- * @param {ReactClass} publicInstance The instance that should rerender.
456
- * @param {object} partialState Next partial state to be merged with state.
457
- * @param {?function} callback Called after component is updated.
458
- * @param {?string} Name of the calling function in the public API.
459
- * @internal
460
- */
461
- enqueueSetState: function(e, t, n, a) {
462
- r(e, "setState");
463
- }
464
- }, d = Object.assign, m = {};
465
- Object.freeze(m);
466
- function v(e, t, n) {
467
- this.props = e, this.context = t, this.refs = m, this.updater = n || u;
468
- }
469
- v.prototype.isReactComponent = {}, v.prototype.setState = function(e, t) {
470
- if (typeof e != "object" && typeof e != "function" && e != null)
471
- throw new Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");
472
- this.updater.enqueueSetState(this, e, t, "setState");
473
- }, v.prototype.forceUpdate = function(e) {
474
- this.updater.enqueueForceUpdate(this, e, "forceUpdate");
475
- };
476
- {
477
- var b = {
478
- isMounted: ["isMounted", "Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."],
479
- replaceState: ["replaceState", "Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."]
480
- }, O = function(e, t) {
481
- Object.defineProperty(v.prototype, e, {
482
- get: function() {
483
- z("%s(...) is deprecated in plain JavaScript React classes. %s", t[0], t[1]);
484
- }
485
- });
486
- };
487
- for (var R in b)
488
- b.hasOwnProperty(R) && O(R, b[R]);
489
- }
490
- function E() {
491
- }
492
- E.prototype = v.prototype;
493
- function I(e, t, n) {
494
- this.props = e, this.context = t, this.refs = m, this.updater = n || u;
495
- }
496
- var je = I.prototype = new E();
497
- je.constructor = I, d(je, v.prototype), je.isPureReactComponent = !0;
498
- function kt() {
499
- var e = {
500
- current: null
501
- };
502
- return Object.seal(e), e;
503
- }
504
- var jt = Array.isArray;
505
- function ge(e) {
506
- return jt(e);
507
- }
508
- function At(e) {
509
- {
510
- var t = typeof Symbol == "function" && Symbol.toStringTag, n = t && e[Symbol.toStringTag] || e.constructor.name || "Object";
511
- return n;
512
- }
513
- }
514
- function $t(e) {
515
- try {
516
- return Be(e), !1;
517
- } catch {
518
- return !0;
519
- }
520
- }
521
- function Be(e) {
522
- return "" + e;
523
- }
524
- function _e(e) {
525
- if ($t(e))
526
- return l("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", At(e)), Be(e);
527
- }
528
- function It(e, t, n) {
529
- var a = e.displayName;
530
- if (a)
531
- return a;
532
- var i = t.displayName || t.name || "";
533
- return i !== "" ? n + "(" + i + ")" : n;
534
- }
535
- function He(e) {
536
- return e.displayName || "Context";
537
- }
538
- function B(e) {
539
- if (e == null)
540
- return null;
541
- if (typeof e.tag == "number" && l("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
542
- return e.displayName || e.name || null;
543
- if (typeof e == "string")
544
- return e;
545
- switch (e) {
546
- case x:
547
- return "Fragment";
548
- case $:
549
- return "Portal";
550
- case W:
551
- return "Profiler";
552
- case D:
553
- return "StrictMode";
554
- case G:
555
- return "Suspense";
556
- case ie:
557
- return "SuspenseList";
558
- }
559
- if (typeof e == "object")
560
- switch (e.$$typeof) {
561
- case X:
562
- var t = e;
563
- return He(t) + ".Consumer";
564
- case oe:
565
- var n = e;
566
- return He(n._context) + ".Provider";
567
- case q:
568
- return It(e, e.render, "ForwardRef");
569
- case M:
570
- var a = e.displayName || null;
571
- return a !== null ? a : B(e.type) || "Memo";
572
- case K: {
573
- var i = e, c = i._payload, s = i._init;
574
- try {
575
- return B(s(c));
576
- } catch {
577
- return null;
578
- }
579
- }
580
- }
581
- return null;
582
- }
583
- var ce = Object.prototype.hasOwnProperty, qe = {
584
- key: !0,
585
- ref: !0,
586
- __self: !0,
587
- __source: !0
588
- }, Ge, Ke, Ae;
589
- Ae = {};
590
- function Qe(e) {
591
- if (ce.call(e, "ref")) {
592
- var t = Object.getOwnPropertyDescriptor(e, "ref").get;
593
- if (t && t.isReactWarning)
594
- return !1;
595
- }
596
- return e.ref !== void 0;
597
- }
598
- function Je(e) {
599
- if (ce.call(e, "key")) {
600
- var t = Object.getOwnPropertyDescriptor(e, "key").get;
601
- if (t && t.isReactWarning)
602
- return !1;
603
- }
604
- return e.key !== void 0;
605
- }
606
- function Lt(e, t) {
607
- var n = function() {
608
- Ge || (Ge = !0, l("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", t));
609
- };
610
- n.isReactWarning = !0, Object.defineProperty(e, "key", {
611
- get: n,
612
- configurable: !0
613
- });
614
- }
615
- function Dt(e, t) {
616
- var n = function() {
617
- Ke || (Ke = !0, l("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", t));
618
- };
619
- n.isReactWarning = !0, Object.defineProperty(e, "ref", {
620
- get: n,
621
- configurable: !0
622
- });
623
- }
624
- function Ft(e) {
625
- if (typeof e.ref == "string" && F.current && e.__self && F.current.stateNode !== e.__self) {
626
- var t = B(F.current.type);
627
- Ae[t] || (l('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', t, e.ref), Ae[t] = !0);
628
- }
629
- }
630
- var $e = function(e, t, n, a, i, c, s) {
631
- var f = {
632
- // This tag allows us to uniquely identify this as a React Element
633
- $$typeof: _,
634
- // Built-in properties that belong on the element
635
- type: e,
636
- key: t,
637
- ref: n,
638
- props: s,
639
- // Record the component responsible for creating this element.
640
- _owner: c
641
- };
642
- return f._store = {}, Object.defineProperty(f._store, "validated", {
643
- configurable: !1,
644
- enumerable: !1,
645
- writable: !0,
646
- value: !1
647
- }), Object.defineProperty(f, "_self", {
648
- configurable: !1,
649
- enumerable: !1,
650
- writable: !1,
651
- value: a
652
- }), Object.defineProperty(f, "_source", {
653
- configurable: !1,
654
- enumerable: !1,
655
- writable: !1,
656
- value: i
657
- }), Object.freeze && (Object.freeze(f.props), Object.freeze(f)), f;
658
- };
659
- function xt(e, t, n) {
660
- var a, i = {}, c = null, s = null, f = null, h = null;
661
- if (t != null) {
662
- Qe(t) && (s = t.ref, Ft(t)), Je(t) && (_e(t.key), c = "" + t.key), f = t.__self === void 0 ? null : t.__self, h = t.__source === void 0 ? null : t.__source;
663
- for (a in t)
664
- ce.call(t, a) && !qe.hasOwnProperty(a) && (i[a] = t[a]);
665
- }
666
- var g = arguments.length - 2;
667
- if (g === 1)
668
- i.children = n;
669
- else if (g > 1) {
670
- for (var C = Array(g), S = 0; S < g; S++)
671
- C[S] = arguments[S + 2];
672
- Object.freeze && Object.freeze(C), i.children = C;
673
- }
674
- if (e && e.defaultProps) {
675
- var w = e.defaultProps;
676
- for (a in w)
677
- i[a] === void 0 && (i[a] = w[a]);
678
- }
679
- if (c || s) {
680
- var P = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
681
- c && Lt(i, P), s && Dt(i, P);
682
- }
683
- return $e(e, c, s, f, h, F.current, i);
684
- }
685
- function Nt(e, t) {
686
- var n = $e(e.type, t, e.ref, e._self, e._source, e._owner, e.props);
687
- return n;
688
- }
689
- function Mt(e, t, n) {
690
- if (e == null)
691
- throw new Error("React.cloneElement(...): The argument must be a React element, but you passed " + e + ".");
692
- var a, i = d({}, e.props), c = e.key, s = e.ref, f = e._self, h = e._source, g = e._owner;
693
- if (t != null) {
694
- Qe(t) && (s = t.ref, g = F.current), Je(t) && (_e(t.key), c = "" + t.key);
695
- var C;
696
- e.type && e.type.defaultProps && (C = e.type.defaultProps);
697
- for (a in t)
698
- ce.call(t, a) && !qe.hasOwnProperty(a) && (t[a] === void 0 && C !== void 0 ? i[a] = C[a] : i[a] = t[a]);
699
- }
700
- var S = arguments.length - 2;
701
- if (S === 1)
702
- i.children = n;
703
- else if (S > 1) {
704
- for (var w = Array(S), P = 0; P < S; P++)
705
- w[P] = arguments[P + 2];
706
- i.children = w;
707
- }
708
- return $e(e.type, c, s, f, h, g, i);
709
- }
710
- function re(e) {
711
- return typeof e == "object" && e !== null && e.$$typeof === _;
712
- }
713
- var Xe = ".", Vt = ":";
714
- function Ut(e) {
715
- var t = /[=:]/g, n = {
716
- "=": "=0",
717
- ":": "=2"
718
- }, a = e.replace(t, function(i) {
719
- return n[i];
720
- });
721
- return "$" + a;
722
- }
723
- var Ze = !1, Wt = /\/+/g;
724
- function et(e) {
725
- return e.replace(Wt, "$&/");
726
- }
727
- function Ie(e, t) {
728
- return typeof e == "object" && e !== null && e.key != null ? (_e(e.key), Ut("" + e.key)) : t.toString(36);
729
- }
730
- function be(e, t, n, a, i) {
731
- var c = typeof e;
732
- (c === "undefined" || c === "boolean") && (e = null);
733
- var s = !1;
734
- if (e === null)
735
- s = !0;
736
- else
737
- switch (c) {
738
- case "string":
739
- case "number":
740
- s = !0;
741
- break;
742
- case "object":
743
- switch (e.$$typeof) {
744
- case _:
745
- case $:
746
- s = !0;
747
- }
748
- }
749
- if (s) {
750
- var f = e, h = i(f), g = a === "" ? Xe + Ie(f, 0) : a;
751
- if (ge(h)) {
752
- var C = "";
753
- g != null && (C = et(g) + "/"), be(h, t, C, "", function(Dr) {
754
- return Dr;
755
- });
756
- } else
757
- h != null && (re(h) && (h.key && (!f || f.key !== h.key) && _e(h.key), h = Nt(
758
- h,
759
- // Keep both the (mapped) and old keys if they differ, just as
760
- // traverseAllChildren used to do for objects as children
761
- n + // $FlowFixMe Flow incorrectly thinks React.Portal doesn't have a key
762
- (h.key && (!f || f.key !== h.key) ? (
763
- // $FlowFixMe Flow incorrectly thinks existing element's key can be a number
764
- // eslint-disable-next-line react-internal/safe-string-coercion
765
- et("" + h.key) + "/"
766
- ) : "") + g
767
- )), t.push(h));
768
- return 1;
769
- }
770
- var S, w, P = 0, j = a === "" ? Xe : a + Vt;
771
- if (ge(e))
772
- for (var Te = 0; Te < e.length; Te++)
773
- S = e[Te], w = j + Ie(S, Te), P += be(S, t, n, w, i);
774
- else {
775
- var We = Z(e);
776
- if (typeof We == "function") {
777
- var St = e;
778
- We === St.entries && (Ze || z("Using Maps as children is not supported. Use an array of keyed ReactElements instead."), Ze = !0);
779
- for (var Ir = We.call(St), wt, Lr = 0; !(wt = Ir.next()).done; )
780
- S = wt.value, w = j + Ie(S, Lr++), P += be(S, t, n, w, i);
781
- } else if (c === "object") {
782
- var Ot = String(e);
783
- throw new Error("Objects are not valid as a React child (found: " + (Ot === "[object Object]" ? "object with keys {" + Object.keys(e).join(", ") + "}" : Ot) + "). If you meant to render a collection of children, use an array instead.");
784
- }
785
- }
786
- return P;
787
- }
788
- function Re(e, t, n) {
789
- if (e == null)
790
- return e;
791
- var a = [], i = 0;
792
- return be(e, a, "", "", function(c) {
793
- return t.call(n, c, i++);
794
- }), a;
795
- }
796
- function Yt(e) {
797
- var t = 0;
798
- return Re(e, function() {
799
- t++;
800
- }), t;
801
- }
802
- function zt(e, t, n) {
803
- Re(e, function() {
804
- t.apply(this, arguments);
805
- }, n);
806
- }
807
- function Bt(e) {
808
- return Re(e, function(t) {
809
- return t;
810
- }) || [];
811
- }
812
- function Ht(e) {
813
- if (!re(e))
814
- throw new Error("React.Children.only expected to receive a single React element child.");
815
- return e;
816
- }
817
- function qt(e) {
818
- var t = {
819
- $$typeof: X,
820
- // As a workaround to support multiple concurrent renderers, we categorize
821
- // some renderers as primary and others as secondary. We only expect
822
- // there to be two concurrent renderers at most: React Native (primary) and
823
- // Fabric (secondary); React DOM (primary) and React ART (secondary).
824
- // Secondary renderers store their context values on separate fields.
825
- _currentValue: e,
826
- _currentValue2: e,
827
- // Used to track how many concurrent renderers this context currently
828
- // supports within in a single renderer. Such as parallel server rendering.
829
- _threadCount: 0,
830
- // These are circular
831
- Provider: null,
832
- Consumer: null,
833
- // Add these to use same hidden class in VM as ServerContext
834
- _defaultValue: null,
835
- _globalName: null
836
- };
837
- t.Provider = {
838
- $$typeof: oe,
839
- _context: t
840
- };
841
- var n = !1, a = !1, i = !1;
842
- {
843
- var c = {
844
- $$typeof: X,
845
- _context: t
846
- };
847
- Object.defineProperties(c, {
848
- Provider: {
849
- get: function() {
850
- return a || (a = !0, l("Rendering <Context.Consumer.Provider> is not supported and will be removed in a future major release. Did you mean to render <Context.Provider> instead?")), t.Provider;
851
- },
852
- set: function(s) {
853
- t.Provider = s;
854
- }
855
- },
856
- _currentValue: {
857
- get: function() {
858
- return t._currentValue;
859
- },
860
- set: function(s) {
861
- t._currentValue = s;
862
- }
863
- },
864
- _currentValue2: {
865
- get: function() {
866
- return t._currentValue2;
867
- },
868
- set: function(s) {
869
- t._currentValue2 = s;
870
- }
871
- },
872
- _threadCount: {
873
- get: function() {
874
- return t._threadCount;
875
- },
876
- set: function(s) {
877
- t._threadCount = s;
878
- }
879
- },
880
- Consumer: {
881
- get: function() {
882
- return n || (n = !0, l("Rendering <Context.Consumer.Consumer> is not supported and will be removed in a future major release. Did you mean to render <Context.Consumer> instead?")), t.Consumer;
883
- }
884
- },
885
- displayName: {
886
- get: function() {
887
- return t.displayName;
888
- },
889
- set: function(s) {
890
- i || (z("Setting `displayName` on Context.Consumer has no effect. You should set it directly on the context with Context.displayName = '%s'.", s), i = !0);
891
- }
892
- }
893
- }), t.Consumer = c;
894
- }
895
- return t._currentRenderer = null, t._currentRenderer2 = null, t;
896
- }
897
- var le = -1, Le = 0, tt = 1, Gt = 2;
898
- function Kt(e) {
899
- if (e._status === le) {
900
- var t = e._result, n = t();
901
- if (n.then(function(c) {
902
- if (e._status === Le || e._status === le) {
903
- var s = e;
904
- s._status = tt, s._result = c;
905
- }
906
- }, function(c) {
907
- if (e._status === Le || e._status === le) {
908
- var s = e;
909
- s._status = Gt, s._result = c;
910
- }
911
- }), e._status === le) {
912
- var a = e;
913
- a._status = Le, a._result = n;
914
- }
915
- }
916
- if (e._status === tt) {
917
- var i = e._result;
918
- return i === void 0 && l(`lazy: Expected the result of a dynamic import() call. Instead received: %s
919
-
920
- Your code should look like:
921
- const MyComponent = lazy(() => import('./MyComponent'))
922
-
923
- Did you accidentally put curly braces around the import?`, i), "default" in i || l(`lazy: Expected the result of a dynamic import() call. Instead received: %s
924
-
925
- Your code should look like:
926
- const MyComponent = lazy(() => import('./MyComponent'))`, i), i.default;
927
- } else
928
- throw e._result;
929
- }
930
- function Qt(e) {
931
- var t = {
932
- // We use these fields to store the result.
933
- _status: le,
934
- _result: e
935
- }, n = {
936
- $$typeof: K,
937
- _payload: t,
938
- _init: Kt
939
- };
940
- {
941
- var a, i;
942
- Object.defineProperties(n, {
943
- defaultProps: {
944
- configurable: !0,
945
- get: function() {
946
- return a;
947
- },
948
- set: function(c) {
949
- l("React.lazy(...): It is not supported to assign `defaultProps` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it."), a = c, Object.defineProperty(n, "defaultProps", {
950
- enumerable: !0
951
- });
952
- }
953
- },
954
- propTypes: {
955
- configurable: !0,
956
- get: function() {
957
- return i;
958
- },
959
- set: function(c) {
960
- l("React.lazy(...): It is not supported to assign `propTypes` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it."), i = c, Object.defineProperty(n, "propTypes", {
961
- enumerable: !0
962
- });
963
- }
964
- }
965
- });
966
- }
967
- return n;
968
- }
969
- function Jt(e) {
970
- e != null && e.$$typeof === M ? l("forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...)).") : typeof e != "function" ? l("forwardRef requires a render function but was given %s.", e === null ? "null" : typeof e) : e.length !== 0 && e.length !== 2 && l("forwardRef render functions accept exactly two parameters: props and ref. %s", e.length === 1 ? "Did you forget to use the ref parameter?" : "Any additional parameter will be undefined."), e != null && (e.defaultProps != null || e.propTypes != null) && l("forwardRef render functions do not support propTypes or defaultProps. Did you accidentally pass a React component?");
971
- var t = {
972
- $$typeof: q,
973
- render: e
974
- };
975
- {
976
- var n;
977
- Object.defineProperty(t, "displayName", {
978
- enumerable: !1,
979
- configurable: !0,
980
- get: function() {
981
- return n;
982
- },
983
- set: function(a) {
984
- n = a, !e.name && !e.displayName && (e.displayName = a);
985
- }
986
- });
987
- }
988
- return t;
989
- }
990
- var rt;
991
- rt = Symbol.for("react.module.reference");
992
- function nt(e) {
993
- return !!(typeof e == "string" || typeof e == "function" || e === x || e === W || te || e === D || e === G || e === ie || se || e === pe || ue || ke || ye || typeof e == "object" && e !== null && (e.$$typeof === K || e.$$typeof === M || e.$$typeof === oe || e.$$typeof === X || e.$$typeof === q || // This needs to include all possible module reference object
994
- // types supported by any Flight configuration anywhere since
995
- // we don't know which Flight build this will end up being used
996
- // with.
997
- e.$$typeof === rt || e.getModuleId !== void 0));
998
- }
999
- function Xt(e, t) {
1000
- nt(e) || l("memo: The first argument must be a component. Instead received: %s", e === null ? "null" : typeof e);
1001
- var n = {
1002
- $$typeof: M,
1003
- type: e,
1004
- compare: t === void 0 ? null : t
1005
- };
1006
- {
1007
- var a;
1008
- Object.defineProperty(n, "displayName", {
1009
- enumerable: !1,
1010
- configurable: !0,
1011
- get: function() {
1012
- return a;
1013
- },
1014
- set: function(i) {
1015
- a = i, !e.name && !e.displayName && (e.displayName = i);
1016
- }
1017
- });
1018
- }
1019
- return n;
1020
- }
1021
- function L() {
1022
- var e = ee.current;
1023
- return e === null && l(`Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
1024
- 1. You might have mismatching versions of React and the renderer (such as React DOM)
1025
- 2. You might be breaking the Rules of Hooks
1026
- 3. You might have more than one copy of React in the same app
1027
- See https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.`), e;
1028
- }
1029
- function Zt(e) {
1030
- var t = L();
1031
- if (e._context !== void 0) {
1032
- var n = e._context;
1033
- n.Consumer === e ? l("Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be removed in a future major release. Did you mean to call useContext(Context) instead?") : n.Provider === e && l("Calling useContext(Context.Provider) is not supported. Did you mean to call useContext(Context) instead?");
1034
- }
1035
- return t.useContext(e);
1036
- }
1037
- function er(e) {
1038
- var t = L();
1039
- return t.useState(e);
1040
- }
1041
- function tr(e, t, n) {
1042
- var a = L();
1043
- return a.useReducer(e, t, n);
1044
- }
1045
- function rr(e) {
1046
- var t = L();
1047
- return t.useRef(e);
1048
- }
1049
- function nr(e, t) {
1050
- var n = L();
1051
- return n.useEffect(e, t);
1052
- }
1053
- function ar(e, t) {
1054
- var n = L();
1055
- return n.useInsertionEffect(e, t);
1056
- }
1057
- function or(e, t) {
1058
- var n = L();
1059
- return n.useLayoutEffect(e, t);
1060
- }
1061
- function ir(e, t) {
1062
- var n = L();
1063
- return n.useCallback(e, t);
1064
- }
1065
- function ur(e, t) {
1066
- var n = L();
1067
- return n.useMemo(e, t);
1068
- }
1069
- function sr(e, t, n) {
1070
- var a = L();
1071
- return a.useImperativeHandle(e, t, n);
1072
- }
1073
- function cr(e, t) {
1074
- {
1075
- var n = L();
1076
- return n.useDebugValue(e, t);
1077
- }
1078
- }
1079
- function lr() {
1080
- var e = L();
1081
- return e.useTransition();
1082
- }
1083
- function fr(e) {
1084
- var t = L();
1085
- return t.useDeferredValue(e);
1086
- }
1087
- function dr() {
1088
- var e = L();
1089
- return e.useId();
1090
- }
1091
- function pr(e, t, n) {
1092
- var a = L();
1093
- return a.useSyncExternalStore(e, t, n);
1094
- }
1095
- var fe = 0, at, ot, it, ut, st, ct, lt;
1096
- function ft() {
1097
- }
1098
- ft.__reactDisabledLog = !0;
1099
- function vr() {
1100
- {
1101
- if (fe === 0) {
1102
- at = console.log, ot = console.info, it = console.warn, ut = console.error, st = console.group, ct = console.groupCollapsed, lt = console.groupEnd;
1103
- var e = {
1104
- configurable: !0,
1105
- enumerable: !0,
1106
- value: ft,
1107
- writable: !0
1108
- };
1109
- Object.defineProperties(console, {
1110
- info: e,
1111
- log: e,
1112
- warn: e,
1113
- error: e,
1114
- group: e,
1115
- groupCollapsed: e,
1116
- groupEnd: e
1117
- });
1118
- }
1119
- fe++;
1120
- }
1121
- }
1122
- function hr() {
1123
- {
1124
- if (fe--, fe === 0) {
1125
- var e = {
1126
- configurable: !0,
1127
- enumerable: !0,
1128
- writable: !0
1129
- };
1130
- Object.defineProperties(console, {
1131
- log: d({}, e, {
1132
- value: at
1133
- }),
1134
- info: d({}, e, {
1135
- value: ot
1136
- }),
1137
- warn: d({}, e, {
1138
- value: it
1139
- }),
1140
- error: d({}, e, {
1141
- value: ut
1142
- }),
1143
- group: d({}, e, {
1144
- value: st
1145
- }),
1146
- groupCollapsed: d({}, e, {
1147
- value: ct
1148
- }),
1149
- groupEnd: d({}, e, {
1150
- value: lt
1151
- })
1152
- });
1153
- }
1154
- fe < 0 && l("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
1155
- }
1156
- }
1157
- var De = N.ReactCurrentDispatcher, Fe;
1158
- function Ee(e, t, n) {
1159
- {
1160
- if (Fe === void 0)
1161
- try {
1162
- throw Error();
1163
- } catch (i) {
1164
- var a = i.stack.trim().match(/\n( *(at )?)/);
1165
- Fe = a && a[1] || "";
1166
- }
1167
- return `
1168
- ` + Fe + e;
1169
- }
1170
- }
1171
- var xe = !1, Ce;
1172
- {
1173
- var yr = typeof WeakMap == "function" ? WeakMap : Map;
1174
- Ce = new yr();
1175
- }
1176
- function dt(e, t) {
1177
- if (!e || xe)
1178
- return "";
1179
- {
1180
- var n = Ce.get(e);
1181
- if (n !== void 0)
1182
- return n;
1183
- }
1184
- var a;
1185
- xe = !0;
1186
- var i = Error.prepareStackTrace;
1187
- Error.prepareStackTrace = void 0;
1188
- var c;
1189
- c = De.current, De.current = null, vr();
1190
- try {
1191
- if (t) {
1192
- var s = function() {
1193
- throw Error();
1194
- };
1195
- if (Object.defineProperty(s.prototype, "props", {
1196
- set: function() {
1197
- throw Error();
1198
- }
1199
- }), typeof Reflect == "object" && Reflect.construct) {
1200
- try {
1201
- Reflect.construct(s, []);
1202
- } catch (j) {
1203
- a = j;
1204
- }
1205
- Reflect.construct(e, [], s);
1206
- } else {
1207
- try {
1208
- s.call();
1209
- } catch (j) {
1210
- a = j;
1211
- }
1212
- e.call(s.prototype);
1213
- }
1214
- } else {
1215
- try {
1216
- throw Error();
1217
- } catch (j) {
1218
- a = j;
1219
- }
1220
- e();
1221
- }
1222
- } catch (j) {
1223
- if (j && a && typeof j.stack == "string") {
1224
- for (var f = j.stack.split(`
1225
- `), h = a.stack.split(`
1226
- `), g = f.length - 1, C = h.length - 1; g >= 1 && C >= 0 && f[g] !== h[C]; )
1227
- C--;
1228
- for (; g >= 1 && C >= 0; g--, C--)
1229
- if (f[g] !== h[C]) {
1230
- if (g !== 1 || C !== 1)
1231
- do
1232
- if (g--, C--, C < 0 || f[g] !== h[C]) {
1233
- var S = `
1234
- ` + f[g].replace(" at new ", " at ");
1235
- return e.displayName && S.includes("<anonymous>") && (S = S.replace("<anonymous>", e.displayName)), typeof e == "function" && Ce.set(e, S), S;
1236
- }
1237
- while (g >= 1 && C >= 0);
1238
- break;
1239
- }
1240
- }
1241
- } finally {
1242
- xe = !1, De.current = c, hr(), Error.prepareStackTrace = i;
1243
- }
1244
- var w = e ? e.displayName || e.name : "", P = w ? Ee(w) : "";
1245
- return typeof e == "function" && Ce.set(e, P), P;
1246
- }
1247
- function mr(e, t, n) {
1248
- return dt(e, !1);
1249
- }
1250
- function gr(e) {
1251
- var t = e.prototype;
1252
- return !!(t && t.isReactComponent);
1253
- }
1254
- function Se(e, t, n) {
1255
- if (e == null)
1256
- return "";
1257
- if (typeof e == "function")
1258
- return dt(e, gr(e));
1259
- if (typeof e == "string")
1260
- return Ee(e);
1261
- switch (e) {
1262
- case G:
1263
- return Ee("Suspense");
1264
- case ie:
1265
- return Ee("SuspenseList");
1266
- }
1267
- if (typeof e == "object")
1268
- switch (e.$$typeof) {
1269
- case q:
1270
- return mr(e.render);
1271
- case M:
1272
- return Se(e.type, t, n);
1273
- case K: {
1274
- var a = e, i = a._payload, c = a._init;
1275
- try {
1276
- return Se(c(i), t, n);
1277
- } catch {
1278
- }
1279
- }
1280
- }
1281
- return "";
1282
- }
1283
- var pt = {}, vt = N.ReactDebugCurrentFrame;
1284
- function we(e) {
1285
- if (e) {
1286
- var t = e._owner, n = Se(e.type, e._source, t ? t.type : null);
1287
- vt.setExtraStackFrame(n);
1288
- } else
1289
- vt.setExtraStackFrame(null);
1290
- }
1291
- function _r(e, t, n, a, i) {
1292
- {
1293
- var c = Function.call.bind(ce);
1294
- for (var s in e)
1295
- if (c(e, s)) {
1296
- var f = void 0;
1297
- try {
1298
- if (typeof e[s] != "function") {
1299
- var h = Error((a || "React class") + ": " + n + " type `" + s + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[s] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
1300
- throw h.name = "Invariant Violation", h;
1301
- }
1302
- f = e[s](t, s, a, n, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
1303
- } catch (g) {
1304
- f = g;
1305
- }
1306
- f && !(f instanceof Error) && (we(i), l("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", a || "React class", n, s, typeof f), we(null)), f instanceof Error && !(f.message in pt) && (pt[f.message] = !0, we(i), l("Failed %s type: %s", n, f.message), we(null));
1307
- }
1308
- }
1309
- }
1310
- function ne(e) {
1311
- if (e) {
1312
- var t = e._owner, n = Se(e.type, e._source, t ? t.type : null);
1313
- he(n);
1314
- } else
1315
- he(null);
1316
- }
1317
- var Ne;
1318
- Ne = !1;
1319
- function ht() {
1320
- if (F.current) {
1321
- var e = B(F.current.type);
1322
- if (e)
1323
- return `
1324
-
1325
- Check the render method of \`` + e + "`.";
1326
- }
1327
- return "";
1328
- }
1329
- function br(e) {
1330
- if (e !== void 0) {
1331
- var t = e.fileName.replace(/^.*[\\\/]/, ""), n = e.lineNumber;
1332
- return `
1333
-
1334
- Check your code at ` + t + ":" + n + ".";
1335
- }
1336
- return "";
1337
- }
1338
- function Rr(e) {
1339
- return e != null ? br(e.__source) : "";
1340
- }
1341
- var yt = {};
1342
- function Er(e) {
1343
- var t = ht();
1344
- if (!t) {
1345
- var n = typeof e == "string" ? e : e.displayName || e.name;
1346
- n && (t = `
1347
-
1348
- Check the top-level render call using <` + n + ">.");
1349
- }
1350
- return t;
1351
- }
1352
- function mt(e, t) {
1353
- if (!(!e._store || e._store.validated || e.key != null)) {
1354
- e._store.validated = !0;
1355
- var n = Er(t);
1356
- if (!yt[n]) {
1357
- yt[n] = !0;
1358
- var a = "";
1359
- e && e._owner && e._owner !== F.current && (a = " It was passed a child from " + B(e._owner.type) + "."), ne(e), l('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', n, a), ne(null);
1360
- }
1361
- }
1362
- }
1363
- function gt(e, t) {
1364
- if (typeof e == "object") {
1365
- if (ge(e))
1366
- for (var n = 0; n < e.length; n++) {
1367
- var a = e[n];
1368
- re(a) && mt(a, t);
1369
- }
1370
- else if (re(e))
1371
- e._store && (e._store.validated = !0);
1372
- else if (e) {
1373
- var i = Z(e);
1374
- if (typeof i == "function" && i !== e.entries)
1375
- for (var c = i.call(e), s; !(s = c.next()).done; )
1376
- re(s.value) && mt(s.value, t);
1377
- }
1378
- }
1379
- }
1380
- function _t(e) {
1381
- {
1382
- var t = e.type;
1383
- if (t == null || typeof t == "string")
1384
- return;
1385
- var n;
1386
- if (typeof t == "function")
1387
- n = t.propTypes;
1388
- else if (typeof t == "object" && (t.$$typeof === q || // Note: Memo only checks outer props here.
1389
- // Inner props are checked in the reconciler.
1390
- t.$$typeof === M))
1391
- n = t.propTypes;
1392
- else
1393
- return;
1394
- if (n) {
1395
- var a = B(t);
1396
- _r(n, e.props, "prop", a, e);
1397
- } else if (t.PropTypes !== void 0 && !Ne) {
1398
- Ne = !0;
1399
- var i = B(t);
1400
- l("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", i || "Unknown");
1401
- }
1402
- typeof t.getDefaultProps == "function" && !t.getDefaultProps.isReactClassApproved && l("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
1403
- }
1404
- }
1405
- function Cr(e) {
1406
- {
1407
- for (var t = Object.keys(e.props), n = 0; n < t.length; n++) {
1408
- var a = t[n];
1409
- if (a !== "children" && a !== "key") {
1410
- ne(e), l("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", a), ne(null);
1411
- break;
1412
- }
1413
- }
1414
- e.ref !== null && (ne(e), l("Invalid attribute `ref` supplied to `React.Fragment`."), ne(null));
1415
- }
1416
- }
1417
- function bt(e, t, n) {
1418
- var a = nt(e);
1419
- if (!a) {
1420
- var i = "";
1421
- (e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (i += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
1422
- var c = Rr(t);
1423
- c ? i += c : i += ht();
1424
- var s;
1425
- e === null ? s = "null" : ge(e) ? s = "array" : e !== void 0 && e.$$typeof === _ ? (s = "<" + (B(e.type) || "Unknown") + " />", i = " Did you accidentally export a JSX literal instead of a component?") : s = typeof e, l("React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", s, i);
1426
- }
1427
- var f = xt.apply(this, arguments);
1428
- if (f == null)
1429
- return f;
1430
- if (a)
1431
- for (var h = 2; h < arguments.length; h++)
1432
- gt(arguments[h], e);
1433
- return e === x ? Cr(f) : _t(f), f;
1434
- }
1435
- var Rt = !1;
1436
- function Sr(e) {
1437
- var t = bt.bind(null, e);
1438
- return t.type = e, Rt || (Rt = !0, z("React.createFactory() is deprecated and will be removed in a future major release. Consider using JSX or use React.createElement() directly instead.")), Object.defineProperty(t, "type", {
1439
- enumerable: !1,
1440
- get: function() {
1441
- return z("Factory.type is deprecated. Access the class directly before passing it to createFactory."), Object.defineProperty(this, "type", {
1442
- value: e
1443
- }), e;
1444
- }
1445
- }), t;
1446
- }
1447
- function wr(e, t, n) {
1448
- for (var a = Mt.apply(this, arguments), i = 2; i < arguments.length; i++)
1449
- gt(arguments[i], a.type);
1450
- return _t(a), a;
1451
- }
1452
- function Or(e, t) {
1453
- var n = U.transition;
1454
- U.transition = {};
1455
- var a = U.transition;
1456
- U.transition._updatedFibers = /* @__PURE__ */ new Set();
1457
- try {
1458
- e();
1459
- } finally {
1460
- if (U.transition = n, n === null && a._updatedFibers) {
1461
- var i = a._updatedFibers.size;
1462
- i > 10 && z("Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table."), a._updatedFibers.clear();
1463
- }
1464
- }
1465
- }
1466
- var Et = !1, Oe = null;
1467
- function Pr(e) {
1468
- if (Oe === null)
1469
- try {
1470
- var t = ("require" + Math.random()).slice(0, 7), n = T && T[t];
1471
- Oe = n.call(T, "timers").setImmediate;
1472
- } catch {
1473
- Oe = function(i) {
1474
- Et === !1 && (Et = !0, typeof MessageChannel > "u" && l("This browser does not have a MessageChannel implementation, so enqueuing tasks via await act(async () => ...) will fail. Please file an issue at https://github.com/facebook/react/issues if you encounter this warning."));
1475
- var c = new MessageChannel();
1476
- c.port1.onmessage = i, c.port2.postMessage(void 0);
1477
- };
1478
- }
1479
- return Oe(e);
1480
- }
1481
- var ae = 0, Ct = !1;
1482
- function Tr(e) {
1483
- {
1484
- var t = ae;
1485
- ae++, k.current === null && (k.current = []);
1486
- var n = k.isBatchingLegacy, a;
1487
- try {
1488
- if (k.isBatchingLegacy = !0, a = e(), !n && k.didScheduleLegacyUpdate) {
1489
- var i = k.current;
1490
- i !== null && (k.didScheduleLegacyUpdate = !1, Ue(i));
1491
- }
1492
- } catch (w) {
1493
- throw Pe(t), w;
1494
- } finally {
1495
- k.isBatchingLegacy = n;
1496
- }
1497
- if (a !== null && typeof a == "object" && typeof a.then == "function") {
1498
- var c = a, s = !1, f = {
1499
- then: function(w, P) {
1500
- s = !0, c.then(function(j) {
1501
- Pe(t), ae === 0 ? Me(j, w, P) : w(j);
1502
- }, function(j) {
1503
- Pe(t), P(j);
1504
- });
1505
- }
1506
- };
1507
- return !Ct && typeof Promise < "u" && Promise.resolve().then(function() {
1508
- }).then(function() {
1509
- s || (Ct = !0, l("You called act(async () => ...) without await. This could lead to unexpected testing behaviour, interleaving multiple act calls and mixing their scopes. You should - await act(async () => ...);"));
1510
- }), f;
1511
- } else {
1512
- var h = a;
1513
- if (Pe(t), ae === 0) {
1514
- var g = k.current;
1515
- g !== null && (Ue(g), k.current = null);
1516
- var C = {
1517
- then: function(w, P) {
1518
- k.current === null ? (k.current = [], Me(h, w, P)) : w(h);
1519
- }
1520
- };
1521
- return C;
1522
- } else {
1523
- var S = {
1524
- then: function(w, P) {
1525
- w(h);
1526
- }
1527
- };
1528
- return S;
1529
- }
1530
- }
1531
- }
1532
- }
1533
- function Pe(e) {
1534
- e !== ae - 1 && l("You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. "), ae = e;
1535
- }
1536
- function Me(e, t, n) {
1537
- {
1538
- var a = k.current;
1539
- if (a !== null)
1540
- try {
1541
- Ue(a), Pr(function() {
1542
- a.length === 0 ? (k.current = null, t(e)) : Me(e, t, n);
1543
- });
1544
- } catch (i) {
1545
- n(i);
1546
- }
1547
- else
1548
- t(e);
1549
- }
1550
- }
1551
- var Ve = !1;
1552
- function Ue(e) {
1553
- if (!Ve) {
1554
- Ve = !0;
1555
- var t = 0;
1556
- try {
1557
- for (; t < e.length; t++) {
1558
- var n = e[t];
1559
- do
1560
- n = n(!0);
1561
- while (n !== null);
1562
- }
1563
- e.length = 0;
1564
- } catch (a) {
1565
- throw e = e.slice(t + 1), a;
1566
- } finally {
1567
- Ve = !1;
1568
- }
1569
- }
1570
- }
1571
- var kr = bt, jr = wr, Ar = Sr, $r = {
1572
- map: Re,
1573
- forEach: zt,
1574
- count: Yt,
1575
- toArray: Bt,
1576
- only: Ht
1577
- };
1578
- o.Children = $r, o.Component = v, o.Fragment = x, o.Profiler = W, o.PureComponent = I, o.StrictMode = D, o.Suspense = G, o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = N, o.cloneElement = jr, o.createContext = qt, o.createElement = kr, o.createFactory = Ar, o.createRef = kt, o.forwardRef = Jt, o.isValidElement = re, o.lazy = Qt, o.memo = Xt, o.startTransition = Or, o.unstable_act = Tr, o.useCallback = ir, o.useContext = Zt, o.useDebugValue = cr, o.useDeferredValue = fr, o.useEffect = nr, o.useId = dr, o.useImperativeHandle = sr, o.useInsertionEffect = ar, o.useLayoutEffect = or, o.useMemo = ur, o.useReducer = tr, o.useRef = rr, o.useState = er, o.useSyncExternalStore = pr, o.useTransition = lr, o.version = y, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());
1579
- }();
1580
- }(de, de.exports)), de.exports;
1581
- }
1582
- process.env.NODE_ENV === "production" ? Ye.exports = Fr() : Ye.exports = xr();
1583
- var ze = Ye.exports;
1584
- function Nr(T, o = !1) {
1585
- return (y, _ = o) => {
1586
- if (!T)
1587
- return y;
1588
- const $ = y.split(".").reduce((x, D) => x[D], T);
1589
- if ($ === void 0 && _)
1590
- throw Error(`Translation for ${y} not found`);
1591
- return $ || y;
83
+ }, i._instance = void 0, i._registeredConfig = {}, i._registeredRules = i.defaultRules;
84
+ let a = i;
85
+ function g(c, e = !1) {
86
+ return (t, s = e) => {
87
+ if (!c)
88
+ return t;
89
+ const n = t.split(".").reduce((r, l) => r[l], c);
90
+ if (n === void 0 && s)
91
+ throw Error(`Translation for ${t} not found`);
92
+ return n || t;
1592
93
  };
1593
94
  }
1594
- function Mr(T, o, y = !1) {
1595
- return Nr(T, y)(o);
95
+ function m(c, e, t = !1) {
96
+ return g(c, t)(e);
1596
97
  }
1597
- class Vr extends ze.Component {
1598
- constructor(o) {
1599
- super(o), this.state = { locale: {} }, Promise.all([
1600
- H.instance.get(this.className()),
1601
- H.instance.get("Generic")
1602
- ]).then((y) => {
1603
- const _ = { ...y[0], ...y[1] };
1604
- this.setState({ locale: _ }), this.onLoadLocale(_);
98
+ class P extends u {
99
+ constructor(e) {
100
+ super(e), this.state = { locale: {} }, Promise.all([
101
+ a.instance.get(this.className()),
102
+ a.instance.get("Generic")
103
+ ]).then((t) => {
104
+ const s = { ...t[0], ...t[1] };
105
+ this.setState({ locale: s }), this.onLoadLocale(s);
1605
106
  });
1606
107
  }
1607
108
  /**
1608
109
  * Override this method to get a notification when the locale has been loaded
1609
110
  * @param locale the loaded locale
1610
111
  */
1611
- onLoadLocale(o) {
112
+ onLoadLocale(e) {
1612
113
  }
1613
114
  }
1614
- function Ur(T) {
1615
- return function(o) {
1616
- return class extends o {
115
+ function L(c) {
116
+ return function(e) {
117
+ return class extends e {
1617
118
  constructor() {
1618
119
  super(...arguments), this.state = { locale: {}, ...this.state }, this.loadLocale = Promise.all([
1619
- H.instance.get(T),
1620
- H.instance.get("Generic")
1621
- ]).then((y) => {
1622
- const _ = { ...y[0], ...y[1] };
1623
- this.setState({ locale: _ }), this.onLoadLocale && this.onLoadLocale(_);
120
+ a.instance.get(c),
121
+ a.instance.get("Generic")
122
+ ]).then((t) => {
123
+ const s = { ...t[0], ...t[1] };
124
+ this.setState({ locale: s }), this.onLoadLocale && this.onLoadLocale(s);
1624
125
  });
1625
126
  }
1626
127
  };
1627
128
  };
1628
129
  }
1629
- function Wr(T) {
1630
- const [o, y] = ze.useState({});
1631
- return ze.useEffect(() => {
130
+ function d(c) {
131
+ const [e, t] = o({});
132
+ return f(() => {
1632
133
  Promise.all([
1633
- H.instance.get(T),
1634
- H.instance.get("Generic")
1635
- ]).then((_) => y({ ..._[0], ..._[1] }));
1636
- }, []), o;
134
+ a.instance.get(c),
135
+ a.instance.get("Generic")
136
+ ]).then((s) => t({ ...s[0], ...s[1] }));
137
+ }, []), e;
1637
138
  }
1638
139
  export {
1639
- H as Locale,
1640
- Vr as LocalizedComponent,
1641
- Nr as createSafeLocalizerFor,
1642
- Ur as localize,
1643
- Mr as safeLocalize,
1644
- Wr as useLocale
140
+ a as Locale,
141
+ P as LocalizedComponent,
142
+ g as createSafeLocalizerFor,
143
+ L as localize,
144
+ m as safeLocalize,
145
+ d as useLocale
1645
146
  };
147
+ //# sourceMappingURL=entropic-bond-localize-react.js.map