@open-kingdom/shared-frontend-data-access-logger 0.0.2-3 → 0.0.2-4
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.
- package/dist/index.js +420 -419
- package/dist/lib/logger.slice.d.ts +16 -2
- package/dist/lib/logger.slice.d.ts.map +1 -1
- package/package.json +5 -9
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function
|
|
1
|
+
function Et(e) {
|
|
2
2
|
if (typeof e != "object" || e === null)
|
|
3
3
|
return !1;
|
|
4
4
|
let t = e;
|
|
@@ -6,10 +6,10 @@ function wt(e) {
|
|
|
6
6
|
t = Object.getPrototypeOf(t);
|
|
7
7
|
return Object.getPrototypeOf(e) === t || Object.getPrototypeOf(e) === null;
|
|
8
8
|
}
|
|
9
|
-
function
|
|
10
|
-
return
|
|
9
|
+
function Ye(e) {
|
|
10
|
+
return Et(e) && "type" in e && typeof e.type == "string";
|
|
11
11
|
}
|
|
12
|
-
var
|
|
12
|
+
var Ge = /* @__PURE__ */ Symbol.for("immer-nothing"), Te = /* @__PURE__ */ Symbol.for("immer-draftable"), S = /* @__PURE__ */ Symbol.for("immer-state"), bt = process.env.NODE_ENV !== "production" ? [
|
|
13
13
|
// All error codes, starting by 0:
|
|
14
14
|
function(e) {
|
|
15
15
|
return `The plugin for '${e}' has not been loaded into Immer. To enable the plugin, import and call \`enable${e}()\` when initializing your application.`;
|
|
@@ -42,70 +42,75 @@ var Ye = Symbol.for("immer-nothing"), Ie = Symbol.for("immer-draftable"), S = Sy
|
|
|
42
42
|
] : [];
|
|
43
43
|
function k(e, ...t) {
|
|
44
44
|
if (process.env.NODE_ENV !== "production") {
|
|
45
|
-
const r =
|
|
45
|
+
const r = bt[e], n = T(r) ? r.apply(null, t) : r;
|
|
46
46
|
throw new Error(`[Immer] ${n}`);
|
|
47
47
|
}
|
|
48
48
|
throw new Error(
|
|
49
49
|
`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`
|
|
50
50
|
);
|
|
51
51
|
}
|
|
52
|
-
var P = Object, L = P.getPrototypeOf,
|
|
52
|
+
var P = Object, L = P.getPrototypeOf, X = "constructor", ie = "prototype", me = "configurable", Q = "enumerable", G = "writable", x = "value", M = (e) => !!e && !!e[S];
|
|
53
53
|
function D(e) {
|
|
54
|
-
return e ?
|
|
54
|
+
return e ? Je(e) || ce(e) || !!e[Te] || !!e[X]?.[Te] || ae(e) || ue(e) : !1;
|
|
55
55
|
}
|
|
56
|
-
var
|
|
57
|
-
function
|
|
58
|
-
if (!e || !
|
|
56
|
+
var Ct = P[ie][X].toString(), Ie = /* @__PURE__ */ new WeakMap();
|
|
57
|
+
function Je(e) {
|
|
58
|
+
if (!e || !Pe(e))
|
|
59
59
|
return !1;
|
|
60
60
|
const t = L(e);
|
|
61
61
|
if (t === null || t === P[ie])
|
|
62
62
|
return !0;
|
|
63
|
-
const r = P.hasOwnProperty.call(t,
|
|
63
|
+
const r = P.hasOwnProperty.call(t, X) && t[X];
|
|
64
64
|
if (r === Object)
|
|
65
65
|
return !0;
|
|
66
|
-
if (!
|
|
66
|
+
if (!T(r))
|
|
67
67
|
return !1;
|
|
68
|
-
let n =
|
|
69
|
-
return n === void 0 && (n = Function.toString.call(r),
|
|
68
|
+
let n = Ie.get(r);
|
|
69
|
+
return n === void 0 && (n = Function.toString.call(r), Ie.set(r, n)), n === Ct;
|
|
70
70
|
}
|
|
71
|
-
function
|
|
72
|
-
|
|
71
|
+
function se(e, t, r = !0) {
|
|
72
|
+
B(e) === 0 ? (r ? Reflect.ownKeys(e) : P.keys(e)).forEach((o) => {
|
|
73
73
|
t(o, e[o], e);
|
|
74
74
|
}) : e.forEach((n, o) => t(o, n, e));
|
|
75
75
|
}
|
|
76
|
-
function
|
|
76
|
+
function B(e) {
|
|
77
77
|
const t = e[S];
|
|
78
|
-
return t ? t.type_ :
|
|
78
|
+
return t ? t.type_ : ce(e) ? 1 : ae(e) ? 2 : ue(e) ? 3 : 0;
|
|
79
79
|
}
|
|
80
|
-
var Ae = (e, t, r =
|
|
80
|
+
var Ae = (e, t, r = B(e)) => r === 2 ? e.has(t) : P[ie].hasOwnProperty.call(e, t), ge = (e, t, r = B(e)) => (
|
|
81
81
|
// @ts-ignore
|
|
82
82
|
r === 2 ? e.get(t) : e[t]
|
|
83
|
-
),
|
|
83
|
+
), Z = (e, t, r, n = B(e)) => {
|
|
84
84
|
n === 2 ? e.set(t, r) : n === 3 ? e.add(r) : e[t] = r;
|
|
85
85
|
};
|
|
86
|
-
function
|
|
86
|
+
function St(e, t) {
|
|
87
87
|
return e === t ? e !== 0 || 1 / e === 1 / t : e !== e && t !== t;
|
|
88
88
|
}
|
|
89
|
-
var
|
|
90
|
-
function
|
|
91
|
-
|
|
92
|
-
|
|
89
|
+
var ce = Array.isArray, ae = (e) => e instanceof Map, ue = (e) => e instanceof Set, Pe = (e) => typeof e == "object", T = (e) => typeof e == "function", ye = (e) => typeof e == "boolean";
|
|
90
|
+
function Nt(e) {
|
|
91
|
+
const t = +e;
|
|
92
|
+
return Number.isInteger(t) && String(t) === e;
|
|
93
|
+
}
|
|
94
|
+
var R = (e) => e.copy_ || e.base_, Oe = (e) => e.modified_ ? e.copy_ : e.base_;
|
|
95
|
+
function ve(e, t) {
|
|
93
96
|
if (ae(e))
|
|
97
|
+
return new Map(e);
|
|
98
|
+
if (ue(e))
|
|
94
99
|
return new Set(e);
|
|
95
|
-
if (
|
|
100
|
+
if (ce(e))
|
|
96
101
|
return Array[ie].slice.call(e);
|
|
97
|
-
const r =
|
|
102
|
+
const r = Je(e);
|
|
98
103
|
if (t === !0 || t === "class_only" && !r) {
|
|
99
104
|
const n = P.getOwnPropertyDescriptors(e);
|
|
100
105
|
delete n[S];
|
|
101
106
|
let o = Reflect.ownKeys(n);
|
|
102
107
|
for (let i = 0; i < o.length; i++) {
|
|
103
108
|
const s = o[i], c = n[s];
|
|
104
|
-
c[
|
|
109
|
+
c[G] === !1 && (c[G] = !0, c[me] = !0), (c.get || c.set) && (n[s] = {
|
|
105
110
|
[me]: !0,
|
|
106
|
-
[
|
|
111
|
+
[G]: !0,
|
|
107
112
|
// could live with !!desc.set as well here...
|
|
108
|
-
[
|
|
113
|
+
[Q]: c[Q],
|
|
109
114
|
[x]: e[s]
|
|
110
115
|
});
|
|
111
116
|
}
|
|
@@ -118,35 +123,35 @@ function ge(e, t) {
|
|
|
118
123
|
return P.assign(o, e);
|
|
119
124
|
}
|
|
120
125
|
}
|
|
121
|
-
function
|
|
122
|
-
return
|
|
123
|
-
set:
|
|
124
|
-
add:
|
|
125
|
-
clear:
|
|
126
|
-
delete:
|
|
127
|
-
}), P.freeze(e), t &&
|
|
126
|
+
function De(e, t = !1) {
|
|
127
|
+
return le(e) || M(e) || !D(e) || (B(e) > 1 && P.defineProperties(e, {
|
|
128
|
+
set: q,
|
|
129
|
+
add: q,
|
|
130
|
+
clear: q,
|
|
131
|
+
delete: q
|
|
132
|
+
}), P.freeze(e), t && se(
|
|
128
133
|
e,
|
|
129
134
|
(r, n) => {
|
|
130
|
-
|
|
135
|
+
De(n, !0);
|
|
131
136
|
},
|
|
132
137
|
!1
|
|
133
138
|
)), e;
|
|
134
139
|
}
|
|
135
|
-
function
|
|
140
|
+
function kt() {
|
|
136
141
|
k(2);
|
|
137
142
|
}
|
|
138
|
-
var
|
|
139
|
-
[x]:
|
|
143
|
+
var q = {
|
|
144
|
+
[x]: kt
|
|
140
145
|
};
|
|
141
|
-
function
|
|
142
|
-
return e === null || !
|
|
146
|
+
function le(e) {
|
|
147
|
+
return e === null || !Pe(e) ? !0 : P.isFrozen(e);
|
|
143
148
|
}
|
|
144
|
-
var
|
|
145
|
-
function
|
|
146
|
-
const t =
|
|
149
|
+
var ee = "MapSet", we = "Patches", ze = "ArrayMethods", Xe = {};
|
|
150
|
+
function A(e) {
|
|
151
|
+
const t = Xe[e];
|
|
147
152
|
return t || k(0, e), t;
|
|
148
153
|
}
|
|
149
|
-
var
|
|
154
|
+
var Le = (e) => !!Xe[e], j, Qe = () => j, Pt = (e, t) => ({
|
|
150
155
|
drafts_: [],
|
|
151
156
|
parent_: e,
|
|
152
157
|
immer_: t,
|
|
@@ -156,27 +161,28 @@ var Nt = (e) => !!Je[e], $, Xe = () => $, kt = (e, t) => ({
|
|
|
156
161
|
unfinalizedDrafts_: 0,
|
|
157
162
|
handledSet_: /* @__PURE__ */ new Set(),
|
|
158
163
|
processedForPatches_: /* @__PURE__ */ new Set(),
|
|
159
|
-
mapSetPlugin_:
|
|
164
|
+
mapSetPlugin_: Le(ee) ? A(ee) : void 0,
|
|
165
|
+
arrayMethodsPlugin_: Le(ze) ? A(ze) : void 0
|
|
160
166
|
});
|
|
161
|
-
function
|
|
162
|
-
t && (e.patchPlugin_ =
|
|
163
|
-
}
|
|
164
|
-
function we(e) {
|
|
165
|
-
Ee(e), e.drafts_.forEach(Pt), e.drafts_ = null;
|
|
167
|
+
function Fe(e, t) {
|
|
168
|
+
t && (e.patchPlugin_ = A(we), e.patches_ = [], e.inversePatches_ = [], e.patchListener_ = t);
|
|
166
169
|
}
|
|
167
170
|
function Ee(e) {
|
|
168
|
-
e
|
|
171
|
+
be(e), e.drafts_.forEach(Ot), e.drafts_ = null;
|
|
172
|
+
}
|
|
173
|
+
function be(e) {
|
|
174
|
+
e === j && (j = e.parent_);
|
|
169
175
|
}
|
|
170
|
-
var
|
|
171
|
-
function
|
|
176
|
+
var Ve = (e) => j = Pt(j, e);
|
|
177
|
+
function Ot(e) {
|
|
172
178
|
const t = e[S];
|
|
173
179
|
t.type_ === 0 || t.type_ === 1 ? t.revoke_() : t.revoked_ = !0;
|
|
174
180
|
}
|
|
175
|
-
function
|
|
181
|
+
function xe(e, t) {
|
|
176
182
|
t.unfinalizedDrafts_ = t.drafts_.length;
|
|
177
183
|
const r = t.drafts_[0];
|
|
178
184
|
if (e !== void 0 && e !== r) {
|
|
179
|
-
r[S].modified_ && (
|
|
185
|
+
r[S].modified_ && (Ee(t), k(4)), D(e) && (e = je(t, e));
|
|
180
186
|
const { patchPlugin_: o } = t;
|
|
181
187
|
o && o.generateReplacementPatches_(
|
|
182
188
|
r[S].base_,
|
|
@@ -185,15 +191,15 @@ function Ve(e, t) {
|
|
|
185
191
|
);
|
|
186
192
|
} else
|
|
187
193
|
e = je(t, r);
|
|
188
|
-
return
|
|
194
|
+
return Dt(t, e, !0), Ee(t), t.patches_ && t.patchListener_(t.patches_, t.inversePatches_), e !== Ge ? e : void 0;
|
|
189
195
|
}
|
|
190
196
|
function je(e, t) {
|
|
191
|
-
if (
|
|
197
|
+
if (le(t))
|
|
192
198
|
return t;
|
|
193
199
|
const r = t[S];
|
|
194
200
|
if (!r)
|
|
195
|
-
return
|
|
196
|
-
if (!
|
|
201
|
+
return te(t, e.handledSet_, e);
|
|
202
|
+
if (!de(r, e))
|
|
197
203
|
return t;
|
|
198
204
|
if (!r.modified_)
|
|
199
205
|
return r.base_;
|
|
@@ -202,90 +208,90 @@ function je(e, t) {
|
|
|
202
208
|
if (n)
|
|
203
209
|
for (; n.length > 0; )
|
|
204
210
|
n.pop()(e);
|
|
205
|
-
|
|
211
|
+
tt(r, e);
|
|
206
212
|
}
|
|
207
213
|
return r.copy_;
|
|
208
214
|
}
|
|
209
|
-
function
|
|
210
|
-
!e.parent_ && e.immer_.autoFreeze_ && e.canAutoFreeze_ &&
|
|
215
|
+
function Dt(e, t, r = !1) {
|
|
216
|
+
!e.parent_ && e.immer_.autoFreeze_ && e.canAutoFreeze_ && De(t, r);
|
|
211
217
|
}
|
|
212
|
-
function
|
|
218
|
+
function Ze(e) {
|
|
213
219
|
e.finalized_ = !0, e.scope_.unfinalizedDrafts_--;
|
|
214
220
|
}
|
|
215
|
-
var
|
|
216
|
-
function
|
|
221
|
+
var de = (e, t) => e.scope_ === t, Rt = [];
|
|
222
|
+
function et(e, t, r, n) {
|
|
217
223
|
const o = R(e), i = e.type_;
|
|
218
|
-
if (n !== void 0 &&
|
|
219
|
-
|
|
224
|
+
if (n !== void 0 && ge(o, n, i) === t) {
|
|
225
|
+
Z(o, n, r, i);
|
|
220
226
|
return;
|
|
221
227
|
}
|
|
222
228
|
if (!e.draftLocations_) {
|
|
223
229
|
const c = e.draftLocations_ = /* @__PURE__ */ new Map();
|
|
224
|
-
|
|
225
|
-
if (
|
|
226
|
-
const
|
|
227
|
-
|
|
230
|
+
se(o, (u, l) => {
|
|
231
|
+
if (M(l)) {
|
|
232
|
+
const d = c.get(l) || [];
|
|
233
|
+
d.push(u), c.set(l, d);
|
|
228
234
|
}
|
|
229
235
|
});
|
|
230
236
|
}
|
|
231
|
-
const s = e.draftLocations_.get(t) ??
|
|
237
|
+
const s = e.draftLocations_.get(t) ?? Rt;
|
|
232
238
|
for (const c of s)
|
|
233
|
-
|
|
239
|
+
Z(o, c, r, i);
|
|
234
240
|
}
|
|
235
|
-
function
|
|
241
|
+
function Mt(e, t, r) {
|
|
236
242
|
e.callbacks_.push(function(o) {
|
|
237
243
|
const i = t;
|
|
238
|
-
if (!i || !
|
|
244
|
+
if (!i || !de(i, o))
|
|
239
245
|
return;
|
|
240
246
|
o.mapSetPlugin_?.fixSetContents(i);
|
|
241
|
-
const s =
|
|
242
|
-
|
|
247
|
+
const s = Oe(i);
|
|
248
|
+
et(e, i.draft_ ?? i, s, r), tt(i, o);
|
|
243
249
|
});
|
|
244
250
|
}
|
|
245
|
-
function
|
|
246
|
-
if (e.modified_ && !e.finalized_ && (e.type_ === 3 || (e.assigned_?.size ?? 0) > 0)) {
|
|
251
|
+
function tt(e, t) {
|
|
252
|
+
if (e.modified_ && !e.finalized_ && (e.type_ === 3 || e.type_ === 1 && e.allIndicesReassigned_ || (e.assigned_?.size ?? 0) > 0)) {
|
|
247
253
|
const { patchPlugin_: n } = t;
|
|
248
254
|
if (n) {
|
|
249
255
|
const o = n.getPath(e);
|
|
250
256
|
o && n.generatePatches_(e, o, t);
|
|
251
257
|
}
|
|
252
|
-
|
|
258
|
+
Ze(e);
|
|
253
259
|
}
|
|
254
260
|
}
|
|
255
261
|
function Tt(e, t, r) {
|
|
256
262
|
const { scope_: n } = e;
|
|
257
|
-
if (
|
|
263
|
+
if (M(r)) {
|
|
258
264
|
const o = r[S];
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
const s =
|
|
262
|
-
|
|
265
|
+
de(o, n) && o.callbacks_.push(function() {
|
|
266
|
+
J(e);
|
|
267
|
+
const s = Oe(o);
|
|
268
|
+
et(e, r, s, t);
|
|
263
269
|
});
|
|
264
270
|
} else D(r) && e.callbacks_.push(function() {
|
|
265
271
|
const i = R(e);
|
|
266
|
-
|
|
267
|
-
|
|
272
|
+
e.type_ === 3 ? i.has(r) && te(r, n.handledSet_, n) : ge(i, t, e.type_) === r && n.drafts_.length > 1 && (e.assigned_.get(t) ?? !1) === !0 && e.copy_ && te(
|
|
273
|
+
ge(e.copy_, t, e.type_),
|
|
268
274
|
n.handledSet_,
|
|
269
275
|
n
|
|
270
276
|
);
|
|
271
277
|
});
|
|
272
278
|
}
|
|
273
|
-
function
|
|
274
|
-
return !r.immer_.autoFreeze_ && r.unfinalizedDrafts_ < 1 ||
|
|
275
|
-
if (
|
|
279
|
+
function te(e, t, r) {
|
|
280
|
+
return !r.immer_.autoFreeze_ && r.unfinalizedDrafts_ < 1 || M(e) || t.has(e) || !D(e) || le(e) || (t.add(e), se(e, (n, o) => {
|
|
281
|
+
if (M(o)) {
|
|
276
282
|
const i = o[S];
|
|
277
|
-
if (
|
|
278
|
-
const s =
|
|
279
|
-
|
|
283
|
+
if (de(i, r)) {
|
|
284
|
+
const s = Oe(i);
|
|
285
|
+
Z(e, n, s, e.type_), Ze(i);
|
|
280
286
|
}
|
|
281
|
-
} else D(o) &&
|
|
287
|
+
} else D(o) && te(o, t, r);
|
|
282
288
|
})), e;
|
|
283
289
|
}
|
|
284
|
-
function
|
|
285
|
-
const r =
|
|
290
|
+
function It(e, t) {
|
|
291
|
+
const r = ce(e), n = {
|
|
286
292
|
type_: r ? 1 : 0,
|
|
287
293
|
// Track which produce call this is associated with.
|
|
288
|
-
scope_: t ? t.scope_ :
|
|
294
|
+
scope_: t ? t.scope_ : Qe(),
|
|
289
295
|
// True for both shallow and deep changes.
|
|
290
296
|
modified_: !1,
|
|
291
297
|
// Used during finalization.
|
|
@@ -308,27 +314,33 @@ function Mt(e, t) {
|
|
|
308
314
|
// `callbacks` actually gets assigned in `createProxy`
|
|
309
315
|
callbacks_: void 0
|
|
310
316
|
};
|
|
311
|
-
let o = n, i =
|
|
312
|
-
r && (o = [n], i =
|
|
317
|
+
let o = n, i = re;
|
|
318
|
+
r && (o = [n], i = $);
|
|
313
319
|
const { revoke: s, proxy: c } = Proxy.revocable(o, i);
|
|
314
320
|
return n.draft_ = c, n.revoke_ = s, [c, n];
|
|
315
321
|
}
|
|
316
|
-
var
|
|
322
|
+
var re = {
|
|
317
323
|
get(e, t) {
|
|
318
324
|
if (t === S)
|
|
319
325
|
return e;
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
326
|
+
let r = e.scope_.arrayMethodsPlugin_;
|
|
327
|
+
const n = e.type_ === 1 && typeof t == "string";
|
|
328
|
+
if (n && r?.isArrayOperationMethod(t))
|
|
329
|
+
return r.createMethodInterceptor(e, t);
|
|
330
|
+
const o = R(e);
|
|
331
|
+
if (!Ae(o, t, e.type_))
|
|
332
|
+
return At(e, o, t);
|
|
333
|
+
const i = o[t];
|
|
334
|
+
if (e.finalized_ || !D(i) || n && e.operationMethod && r?.isMutatingArrayMethod(
|
|
335
|
+
e.operationMethod
|
|
336
|
+
) && Nt(t))
|
|
337
|
+
return i;
|
|
338
|
+
if (i === _e(e.base_, t)) {
|
|
339
|
+
J(e);
|
|
340
|
+
const s = e.type_ === 1 ? +t : t, c = Se(e.scope_, i, e, s);
|
|
341
|
+
return e.copy_[s] = c;
|
|
330
342
|
}
|
|
331
|
-
return
|
|
343
|
+
return i;
|
|
332
344
|
},
|
|
333
345
|
has(e, t) {
|
|
334
346
|
return t in R(e);
|
|
@@ -337,32 +349,32 @@ var Re = {
|
|
|
337
349
|
return Reflect.ownKeys(R(e));
|
|
338
350
|
},
|
|
339
351
|
set(e, t, r) {
|
|
340
|
-
const n =
|
|
352
|
+
const n = rt(R(e), t);
|
|
341
353
|
if (n?.set)
|
|
342
354
|
return n.set.call(e.draft_, r), !0;
|
|
343
355
|
if (!e.modified_) {
|
|
344
|
-
const o =
|
|
356
|
+
const o = _e(R(e), t), i = o?.[S];
|
|
345
357
|
if (i && i.base_ === r)
|
|
346
358
|
return e.copy_[t] = r, e.assigned_.set(t, !1), !0;
|
|
347
|
-
if (
|
|
359
|
+
if (St(r, o) && (r !== void 0 || Ae(e.base_, t, e.type_)))
|
|
348
360
|
return !0;
|
|
349
|
-
|
|
361
|
+
J(e), Ce(e);
|
|
350
362
|
}
|
|
351
363
|
return e.copy_[t] === r && // special case: handle new props with value 'undefined'
|
|
352
364
|
(r !== void 0 || t in e.copy_) || // special case: NaN
|
|
353
365
|
Number.isNaN(r) && Number.isNaN(e.copy_[t]) || (e.copy_[t] = r, e.assigned_.set(t, !0), Tt(e, t, r)), !0;
|
|
354
366
|
},
|
|
355
367
|
deleteProperty(e, t) {
|
|
356
|
-
return
|
|
368
|
+
return J(e), _e(e.base_, t) !== void 0 || t in e.base_ ? (e.assigned_.set(t, !1), Ce(e)) : e.assigned_.delete(t), e.copy_ && delete e.copy_[t], !0;
|
|
357
369
|
},
|
|
358
370
|
// Note: We never coerce `desc.value` into an Immer draft, because we can't make
|
|
359
371
|
// the same guarantee in ES5 mode.
|
|
360
372
|
getOwnPropertyDescriptor(e, t) {
|
|
361
373
|
const r = R(e), n = Reflect.getOwnPropertyDescriptor(r, t);
|
|
362
374
|
return n && {
|
|
363
|
-
[
|
|
375
|
+
[G]: !0,
|
|
364
376
|
[me]: e.type_ !== 1 || t !== "length",
|
|
365
|
-
[
|
|
377
|
+
[Q]: n[Q],
|
|
366
378
|
[x]: r[t]
|
|
367
379
|
};
|
|
368
380
|
},
|
|
@@ -375,32 +387,33 @@ var Re = {
|
|
|
375
387
|
setPrototypeOf() {
|
|
376
388
|
k(12);
|
|
377
389
|
}
|
|
378
|
-
},
|
|
379
|
-
|
|
380
|
-
|
|
390
|
+
}, $ = {};
|
|
391
|
+
for (let e in re) {
|
|
392
|
+
let t = re[e];
|
|
393
|
+
$[e] = function() {
|
|
381
394
|
const r = arguments;
|
|
382
395
|
return r[0] = r[0][0], t.apply(this, r);
|
|
383
396
|
};
|
|
384
|
-
}
|
|
385
|
-
|
|
386
|
-
return process.env.NODE_ENV !== "production" && isNaN(parseInt(t)) && k(13),
|
|
397
|
+
}
|
|
398
|
+
$.deleteProperty = function(e, t) {
|
|
399
|
+
return process.env.NODE_ENV !== "production" && isNaN(parseInt(t)) && k(13), $.set.call(this, e, t, void 0);
|
|
387
400
|
};
|
|
388
|
-
|
|
389
|
-
return process.env.NODE_ENV !== "production" && t !== "length" && isNaN(parseInt(t)) && k(14),
|
|
401
|
+
$.set = function(e, t, r) {
|
|
402
|
+
return process.env.NODE_ENV !== "production" && t !== "length" && isNaN(parseInt(t)) && k(14), re.set.call(this, e[0], t, r, e[0]);
|
|
390
403
|
};
|
|
391
|
-
function
|
|
404
|
+
function _e(e, t) {
|
|
392
405
|
const r = e[S];
|
|
393
406
|
return (r ? R(r) : e)[t];
|
|
394
407
|
}
|
|
395
|
-
function
|
|
396
|
-
const n =
|
|
408
|
+
function At(e, t, r) {
|
|
409
|
+
const n = rt(t, r);
|
|
397
410
|
return n ? x in n ? n[x] : (
|
|
398
411
|
// This is a very special case, if the prop is a getter defined by the
|
|
399
412
|
// prototype, we should invoke it with the draft as context!
|
|
400
413
|
n.get?.call(e.draft_)
|
|
401
414
|
) : void 0;
|
|
402
415
|
}
|
|
403
|
-
function
|
|
416
|
+
function rt(e, t) {
|
|
404
417
|
if (!(t in e))
|
|
405
418
|
return;
|
|
406
419
|
let r = L(e);
|
|
@@ -411,11 +424,11 @@ function tt(e, t) {
|
|
|
411
424
|
r = L(r);
|
|
412
425
|
}
|
|
413
426
|
}
|
|
414
|
-
function
|
|
415
|
-
e.modified_ || (e.modified_ = !0, e.parent_ &&
|
|
427
|
+
function Ce(e) {
|
|
428
|
+
e.modified_ || (e.modified_ = !0, e.parent_ && Ce(e.parent_));
|
|
416
429
|
}
|
|
417
|
-
function
|
|
418
|
-
e.copy_ || (e.assigned_ = /* @__PURE__ */ new Map(), e.copy_ =
|
|
430
|
+
function J(e) {
|
|
431
|
+
e.copy_ || (e.assigned_ = /* @__PURE__ */ new Map(), e.copy_ = ve(
|
|
419
432
|
e.base_,
|
|
420
433
|
e.scope_.immer_.useStrictShallowCopy_
|
|
421
434
|
));
|
|
@@ -423,29 +436,29 @@ function Q(e) {
|
|
|
423
436
|
var zt = class {
|
|
424
437
|
constructor(e) {
|
|
425
438
|
this.autoFreeze_ = !0, this.useStrictShallowCopy_ = !1, this.useStrictIteration_ = !1, this.produce = (t, r, n) => {
|
|
426
|
-
if (
|
|
439
|
+
if (T(t) && !T(r)) {
|
|
427
440
|
const i = r;
|
|
428
441
|
r = t;
|
|
429
442
|
const s = this;
|
|
430
443
|
return function(u = i, ...l) {
|
|
431
|
-
return s.produce(u, (
|
|
444
|
+
return s.produce(u, (d) => r.call(this, d, ...l));
|
|
432
445
|
};
|
|
433
446
|
}
|
|
434
|
-
|
|
447
|
+
T(r) || k(6), n !== void 0 && !T(n) && k(7);
|
|
435
448
|
let o;
|
|
436
449
|
if (D(t)) {
|
|
437
|
-
const i =
|
|
450
|
+
const i = Ve(this), s = Se(i, t, void 0);
|
|
438
451
|
let c = !0;
|
|
439
452
|
try {
|
|
440
453
|
o = r(s), c = !1;
|
|
441
454
|
} finally {
|
|
442
|
-
c ?
|
|
455
|
+
c ? Ee(i) : be(i);
|
|
443
456
|
}
|
|
444
|
-
return
|
|
445
|
-
} else if (!t || !
|
|
446
|
-
if (o = r(t), o === void 0 && (o = t), o ===
|
|
457
|
+
return Fe(i, n), xe(o, i);
|
|
458
|
+
} else if (!t || !Pe(t)) {
|
|
459
|
+
if (o = r(t), o === void 0 && (o = t), o === Ge && (o = void 0), this.autoFreeze_ && De(o, !0), n) {
|
|
447
460
|
const i = [], s = [];
|
|
448
|
-
|
|
461
|
+
A(we).generateReplacementPatches_(t, o, {
|
|
449
462
|
patches_: i,
|
|
450
463
|
inversePatches_: s
|
|
451
464
|
}), n(i, s);
|
|
@@ -454,24 +467,24 @@ var zt = class {
|
|
|
454
467
|
} else
|
|
455
468
|
k(1, t);
|
|
456
469
|
}, this.produceWithPatches = (t, r) => {
|
|
457
|
-
if (
|
|
470
|
+
if (T(t))
|
|
458
471
|
return (s, ...c) => this.produceWithPatches(s, (u) => t(u, ...c));
|
|
459
472
|
let n, o;
|
|
460
473
|
return [this.produce(t, r, (s, c) => {
|
|
461
474
|
n = s, o = c;
|
|
462
475
|
}), n, o];
|
|
463
|
-
},
|
|
476
|
+
}, ye(e?.autoFreeze) && this.setAutoFreeze(e.autoFreeze), ye(e?.useStrictShallowCopy) && this.setUseStrictShallowCopy(e.useStrictShallowCopy), ye(e?.useStrictIteration) && this.setUseStrictIteration(e.useStrictIteration);
|
|
464
477
|
}
|
|
465
478
|
createDraft(e) {
|
|
466
|
-
D(e) || k(8),
|
|
467
|
-
const t =
|
|
468
|
-
return r[S].isManual_ = !0,
|
|
479
|
+
D(e) || k(8), M(e) && (e = Lt(e));
|
|
480
|
+
const t = Ve(this), r = Se(t, e, void 0);
|
|
481
|
+
return r[S].isManual_ = !0, be(t), r;
|
|
469
482
|
}
|
|
470
483
|
finishDraft(e, t) {
|
|
471
484
|
const r = e && e[S];
|
|
472
485
|
(!r || !r.isManual_) && k(9);
|
|
473
486
|
const { scope_: n } = r;
|
|
474
|
-
return
|
|
487
|
+
return Fe(n, t), xe(void 0, n);
|
|
475
488
|
}
|
|
476
489
|
/**
|
|
477
490
|
* Pass true to automatically freeze all copies created by Immer.
|
|
@@ -511,44 +524,44 @@ var zt = class {
|
|
|
511
524
|
}
|
|
512
525
|
}
|
|
513
526
|
r > -1 && (t = t.slice(r + 1));
|
|
514
|
-
const n =
|
|
515
|
-
return
|
|
527
|
+
const n = A(we).applyPatches_;
|
|
528
|
+
return M(e) ? n(e, t) : this.produce(
|
|
516
529
|
e,
|
|
517
530
|
(o) => n(o, t)
|
|
518
531
|
);
|
|
519
532
|
}
|
|
520
533
|
};
|
|
521
|
-
function
|
|
522
|
-
const [o, i] =
|
|
523
|
-
return (r?.scope_ ??
|
|
534
|
+
function Se(e, t, r, n) {
|
|
535
|
+
const [o, i] = ae(t) ? A(ee).proxyMap_(t, r) : ue(t) ? A(ee).proxySet_(t, r) : It(t, r);
|
|
536
|
+
return (r?.scope_ ?? Qe()).drafts_.push(o), i.callbacks_ = r?.callbacks_ ?? [], i.key_ = n, r && n !== void 0 ? Mt(r, i, n) : i.callbacks_.push(function(u) {
|
|
524
537
|
u.mapSetPlugin_?.fixSetContents(i);
|
|
525
538
|
const { patchPlugin_: l } = u;
|
|
526
539
|
i.modified_ && l && l.generatePatches_(i, [], u);
|
|
527
540
|
}), o;
|
|
528
541
|
}
|
|
529
|
-
function
|
|
530
|
-
return
|
|
542
|
+
function Lt(e) {
|
|
543
|
+
return M(e) || k(10, e), nt(e);
|
|
531
544
|
}
|
|
532
|
-
function
|
|
533
|
-
if (!D(e) ||
|
|
545
|
+
function nt(e) {
|
|
546
|
+
if (!D(e) || le(e))
|
|
534
547
|
return e;
|
|
535
548
|
const t = e[S];
|
|
536
549
|
let r, n = !0;
|
|
537
550
|
if (t) {
|
|
538
551
|
if (!t.modified_)
|
|
539
552
|
return t.base_;
|
|
540
|
-
t.finalized_ = !0, r =
|
|
553
|
+
t.finalized_ = !0, r = ve(e, t.scope_.immer_.useStrictShallowCopy_), n = t.scope_.immer_.shouldUseStrictIteration();
|
|
541
554
|
} else
|
|
542
|
-
r =
|
|
543
|
-
return
|
|
555
|
+
r = ve(e, !0);
|
|
556
|
+
return se(
|
|
544
557
|
r,
|
|
545
558
|
(o, i) => {
|
|
546
|
-
|
|
559
|
+
Z(r, o, nt(i));
|
|
547
560
|
},
|
|
548
561
|
n
|
|
549
562
|
), t && (t.finalized_ = !1), r;
|
|
550
563
|
}
|
|
551
|
-
var
|
|
564
|
+
var Ft = new zt(), ot = Ft.produce, Vt = (e, t, r) => {
|
|
552
565
|
if (t.length === 1 && t[0] === r) {
|
|
553
566
|
let n = !1;
|
|
554
567
|
try {
|
|
@@ -572,14 +585,14 @@ Ensure transformation logic is in the result function, and extraction logic is i
|
|
|
572
585
|
);
|
|
573
586
|
}
|
|
574
587
|
}
|
|
575
|
-
},
|
|
588
|
+
}, xt = (e, t, r) => {
|
|
576
589
|
const { memoize: n, memoizeOptions: o } = t, { inputSelectorResults: i, inputSelectorResultsCopy: s } = e, c = n(() => ({}), ...o);
|
|
577
590
|
if (!(c.apply(null, i) === c.apply(null, s))) {
|
|
578
591
|
let l;
|
|
579
592
|
try {
|
|
580
593
|
throw new Error();
|
|
581
|
-
} catch (
|
|
582
|
-
({ stack: l } =
|
|
594
|
+
} catch (d) {
|
|
595
|
+
({ stack: l } = d);
|
|
583
596
|
}
|
|
584
597
|
console.warn(
|
|
585
598
|
`An input selector returned a different result when passed same arguments.
|
|
@@ -598,15 +611,15 @@ Avoid returning a new reference inside your input selector, e.g.
|
|
|
598
611
|
inputStabilityCheck: "once",
|
|
599
612
|
identityFunctionCheck: "once"
|
|
600
613
|
};
|
|
601
|
-
function
|
|
614
|
+
function $t(e, t = `expected a function, instead received ${typeof e}`) {
|
|
602
615
|
if (typeof e != "function")
|
|
603
616
|
throw new TypeError(t);
|
|
604
617
|
}
|
|
605
|
-
function
|
|
618
|
+
function Bt(e, t = `expected an object, instead received ${typeof e}`) {
|
|
606
619
|
if (typeof e != "object")
|
|
607
620
|
throw new TypeError(t);
|
|
608
621
|
}
|
|
609
|
-
function
|
|
622
|
+
function Wt(e, t = "expected all items to be functions, instead received the following types: ") {
|
|
610
623
|
if (!e.every((r) => typeof r == "function")) {
|
|
611
624
|
const r = e.map(
|
|
612
625
|
(n) => typeof n == "function" ? `function ${n.name || "unnamed"}()` : typeof n
|
|
@@ -614,21 +627,21 @@ function Bt(e, t = "expected all items to be functions, instead received the fol
|
|
|
614
627
|
throw new TypeError(`${t}[${r}]`);
|
|
615
628
|
}
|
|
616
629
|
}
|
|
617
|
-
var
|
|
618
|
-
function
|
|
630
|
+
var $e = (e) => Array.isArray(e) ? e : [e];
|
|
631
|
+
function Ut(e) {
|
|
619
632
|
const t = Array.isArray(e[0]) ? e[0] : e;
|
|
620
|
-
return
|
|
633
|
+
return Wt(
|
|
621
634
|
t,
|
|
622
635
|
"createSelector expects all input-selectors to be functions, but received the following types: "
|
|
623
636
|
), t;
|
|
624
637
|
}
|
|
625
|
-
function
|
|
638
|
+
function Be(e, t) {
|
|
626
639
|
const r = [], { length: n } = e;
|
|
627
640
|
for (let o = 0; o < n; o++)
|
|
628
641
|
r.push(e[o].apply(null, t));
|
|
629
642
|
return r;
|
|
630
643
|
}
|
|
631
|
-
var
|
|
644
|
+
var qt = (e, t) => {
|
|
632
645
|
const { identityFunctionCheck: r, inputStabilityCheck: n } = {
|
|
633
646
|
...jt,
|
|
634
647
|
...t
|
|
@@ -636,31 +649,31 @@ var Ut = (e, t) => {
|
|
|
636
649
|
return {
|
|
637
650
|
identityFunctionCheck: {
|
|
638
651
|
shouldRun: r === "always" || r === "once" && e,
|
|
639
|
-
run:
|
|
652
|
+
run: Vt
|
|
640
653
|
},
|
|
641
654
|
inputStabilityCheck: {
|
|
642
655
|
shouldRun: n === "always" || n === "once" && e,
|
|
643
|
-
run:
|
|
656
|
+
run: xt
|
|
644
657
|
}
|
|
645
658
|
};
|
|
646
|
-
},
|
|
659
|
+
}, Kt = class {
|
|
647
660
|
constructor(e) {
|
|
648
661
|
this.value = e;
|
|
649
662
|
}
|
|
650
663
|
deref() {
|
|
651
664
|
return this.value;
|
|
652
665
|
}
|
|
653
|
-
},
|
|
654
|
-
function
|
|
666
|
+
}, Ht = typeof WeakRef < "u" ? WeakRef : Kt, Yt = 0, We = 1;
|
|
667
|
+
function K() {
|
|
655
668
|
return {
|
|
656
|
-
s:
|
|
669
|
+
s: Yt,
|
|
657
670
|
v: void 0,
|
|
658
671
|
o: null,
|
|
659
672
|
p: null
|
|
660
673
|
};
|
|
661
674
|
}
|
|
662
|
-
function
|
|
663
|
-
let r =
|
|
675
|
+
function it(e, t = {}) {
|
|
676
|
+
let r = K();
|
|
664
677
|
const { resultEqualityCheck: n } = t;
|
|
665
678
|
let o, i = 0;
|
|
666
679
|
function s() {
|
|
@@ -669,78 +682,78 @@ function ot(e, t = {}) {
|
|
|
669
682
|
for (let y = 0, w = u; y < w; y++) {
|
|
670
683
|
const a = arguments[y];
|
|
671
684
|
if (typeof a == "function" || typeof a == "object" && a !== null) {
|
|
672
|
-
let
|
|
673
|
-
|
|
674
|
-
const
|
|
675
|
-
|
|
685
|
+
let f = c.o;
|
|
686
|
+
f === null && (c.o = f = /* @__PURE__ */ new WeakMap());
|
|
687
|
+
const m = f.get(a);
|
|
688
|
+
m === void 0 ? (c = K(), f.set(a, c)) : c = m;
|
|
676
689
|
} else {
|
|
677
|
-
let
|
|
678
|
-
|
|
679
|
-
const
|
|
680
|
-
|
|
690
|
+
let f = c.p;
|
|
691
|
+
f === null && (c.p = f = /* @__PURE__ */ new Map());
|
|
692
|
+
const m = f.get(a);
|
|
693
|
+
m === void 0 ? (c = K(), f.set(a, c)) : c = m;
|
|
681
694
|
}
|
|
682
695
|
}
|
|
683
696
|
const l = c;
|
|
684
|
-
let
|
|
685
|
-
if (c.s ===
|
|
686
|
-
|
|
687
|
-
else if (
|
|
697
|
+
let d;
|
|
698
|
+
if (c.s === We)
|
|
699
|
+
d = c.v;
|
|
700
|
+
else if (d = e.apply(null, arguments), i++, n) {
|
|
688
701
|
const y = o?.deref?.() ?? o;
|
|
689
|
-
y != null && n(y,
|
|
702
|
+
y != null && n(y, d) && (d = y, i !== 0 && i--), o = typeof d == "object" && d !== null || typeof d == "function" ? new Ht(d) : d;
|
|
690
703
|
}
|
|
691
|
-
return l.s =
|
|
704
|
+
return l.s = We, l.v = d, d;
|
|
692
705
|
}
|
|
693
706
|
return s.clearCache = () => {
|
|
694
|
-
r =
|
|
707
|
+
r = K(), s.resetResultsCount();
|
|
695
708
|
}, s.resultsCount = () => i, s.resetResultsCount = () => {
|
|
696
709
|
i = 0;
|
|
697
710
|
}, s;
|
|
698
711
|
}
|
|
699
|
-
function
|
|
712
|
+
function Gt(e, ...t) {
|
|
700
713
|
const r = typeof e == "function" ? {
|
|
701
714
|
memoize: e,
|
|
702
715
|
memoizeOptions: t
|
|
703
716
|
} : e, n = (...o) => {
|
|
704
717
|
let i = 0, s = 0, c, u = {}, l = o.pop();
|
|
705
|
-
typeof l == "object" && (u = l, l = o.pop()),
|
|
718
|
+
typeof l == "object" && (u = l, l = o.pop()), $t(
|
|
706
719
|
l,
|
|
707
720
|
`createSelector expects an output function after the inputs, but received: [${typeof l}]`
|
|
708
721
|
);
|
|
709
|
-
const
|
|
722
|
+
const d = {
|
|
710
723
|
...r,
|
|
711
724
|
...u
|
|
712
725
|
}, {
|
|
713
726
|
memoize: y,
|
|
714
727
|
memoizeOptions: w = [],
|
|
715
|
-
argsMemoize: a =
|
|
716
|
-
argsMemoizeOptions:
|
|
717
|
-
devModeChecks:
|
|
718
|
-
} =
|
|
728
|
+
argsMemoize: a = it,
|
|
729
|
+
argsMemoizeOptions: f = [],
|
|
730
|
+
devModeChecks: m = {}
|
|
731
|
+
} = d, N = $e(w), v = $e(f), O = Ut(o), h = y(function() {
|
|
719
732
|
return i++, l.apply(
|
|
720
733
|
null,
|
|
721
734
|
arguments
|
|
722
735
|
);
|
|
723
736
|
}, ...N);
|
|
724
737
|
let p = !0;
|
|
725
|
-
const
|
|
738
|
+
const _ = a(function() {
|
|
726
739
|
s++;
|
|
727
|
-
const C =
|
|
740
|
+
const C = Be(
|
|
728
741
|
O,
|
|
729
742
|
arguments
|
|
730
743
|
);
|
|
731
744
|
if (c = h.apply(null, C), process.env.NODE_ENV !== "production") {
|
|
732
|
-
const { identityFunctionCheck: E, inputStabilityCheck:
|
|
745
|
+
const { identityFunctionCheck: E, inputStabilityCheck: V } = qt(p, m);
|
|
733
746
|
if (E.shouldRun && E.run(
|
|
734
747
|
l,
|
|
735
748
|
C,
|
|
736
749
|
c
|
|
737
|
-
),
|
|
738
|
-
const
|
|
750
|
+
), V.shouldRun) {
|
|
751
|
+
const he = Be(
|
|
739
752
|
O,
|
|
740
753
|
arguments
|
|
741
754
|
);
|
|
742
|
-
|
|
743
|
-
{ inputSelectorResults: C, inputSelectorResultsCopy:
|
|
755
|
+
V.run(
|
|
756
|
+
{ inputSelectorResults: C, inputSelectorResultsCopy: he },
|
|
744
757
|
{ memoize: y, memoizeOptions: N },
|
|
745
758
|
arguments
|
|
746
759
|
);
|
|
@@ -749,7 +762,7 @@ function Yt(e, ...t) {
|
|
|
749
762
|
}
|
|
750
763
|
return c;
|
|
751
764
|
}, ...v);
|
|
752
|
-
return Object.assign(
|
|
765
|
+
return Object.assign(_, {
|
|
753
766
|
resultFunc: l,
|
|
754
767
|
memoizedResultFunc: h,
|
|
755
768
|
dependencies: O,
|
|
@@ -770,9 +783,9 @@ function Yt(e, ...t) {
|
|
|
770
783
|
withTypes: () => n
|
|
771
784
|
}), n;
|
|
772
785
|
}
|
|
773
|
-
var fe = /* @__PURE__ */
|
|
786
|
+
var fe = /* @__PURE__ */ Gt(it), Jt = Object.assign(
|
|
774
787
|
(e, t = fe) => {
|
|
775
|
-
|
|
788
|
+
Bt(
|
|
776
789
|
e,
|
|
777
790
|
`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`
|
|
778
791
|
);
|
|
@@ -784,9 +797,9 @@ var fe = /* @__PURE__ */ Yt(ot), Gt = Object.assign(
|
|
|
784
797
|
(...i) => i.reduce((s, c, u) => (s[r[u]] = c, s), {})
|
|
785
798
|
);
|
|
786
799
|
},
|
|
787
|
-
{ withTypes: () =>
|
|
800
|
+
{ withTypes: () => Jt }
|
|
788
801
|
);
|
|
789
|
-
function
|
|
802
|
+
function F(e, t) {
|
|
790
803
|
function r(...n) {
|
|
791
804
|
if (t) {
|
|
792
805
|
let o = t(...n);
|
|
@@ -808,16 +821,16 @@ function V(e, t) {
|
|
|
808
821
|
payload: n[0]
|
|
809
822
|
};
|
|
810
823
|
}
|
|
811
|
-
return r.toString = () => `${e}`, r.type = e, r.match = (n) =>
|
|
824
|
+
return r.toString = () => `${e}`, r.type = e, r.match = (n) => Ye(n) && n.type === e, r;
|
|
812
825
|
}
|
|
813
|
-
function
|
|
814
|
-
return D(e) ?
|
|
826
|
+
function Ue(e) {
|
|
827
|
+
return D(e) ? ot(e, () => {
|
|
815
828
|
}) : e;
|
|
816
829
|
}
|
|
817
|
-
function
|
|
830
|
+
function H(e, t, r) {
|
|
818
831
|
return e.has(t) ? e.get(t) : e.set(t, r(t)).get(t);
|
|
819
832
|
}
|
|
820
|
-
function
|
|
833
|
+
function st(e) {
|
|
821
834
|
const t = {}, r = [];
|
|
822
835
|
let n;
|
|
823
836
|
const o = {
|
|
@@ -859,61 +872,61 @@ function it(e) {
|
|
|
859
872
|
};
|
|
860
873
|
return e(o), [t, r, n];
|
|
861
874
|
}
|
|
862
|
-
function
|
|
875
|
+
function Xt(e) {
|
|
863
876
|
return typeof e == "function";
|
|
864
877
|
}
|
|
865
|
-
function
|
|
878
|
+
function Qt(e, t) {
|
|
866
879
|
if (process.env.NODE_ENV !== "production" && typeof t == "object")
|
|
867
880
|
throw new Error(process.env.NODE_ENV === "production" ? g(8) : "The object notation for `createReducer` has been removed. Please use the 'builder callback' notation instead: https://redux-toolkit.js.org/api/createReducer");
|
|
868
|
-
let [r, n, o] =
|
|
869
|
-
if (
|
|
870
|
-
i = () =>
|
|
881
|
+
let [r, n, o] = st(t), i;
|
|
882
|
+
if (Xt(e))
|
|
883
|
+
i = () => Ue(e());
|
|
871
884
|
else {
|
|
872
|
-
const c =
|
|
885
|
+
const c = Ue(e);
|
|
873
886
|
i = () => c;
|
|
874
887
|
}
|
|
875
888
|
function s(c = i(), u) {
|
|
876
889
|
let l = [r[u.type], ...n.filter(({
|
|
877
|
-
matcher:
|
|
878
|
-
}) =>
|
|
879
|
-
reducer:
|
|
880
|
-
}) =>
|
|
881
|
-
return l.filter((
|
|
890
|
+
matcher: d
|
|
891
|
+
}) => d(u)).map(({
|
|
892
|
+
reducer: d
|
|
893
|
+
}) => d)];
|
|
894
|
+
return l.filter((d) => !!d).length === 0 && (l = [o]), l.reduce((d, y) => {
|
|
882
895
|
if (y)
|
|
883
|
-
if (
|
|
884
|
-
const a = y(
|
|
885
|
-
return a === void 0 ?
|
|
896
|
+
if (M(d)) {
|
|
897
|
+
const a = y(d, u);
|
|
898
|
+
return a === void 0 ? d : a;
|
|
886
899
|
} else {
|
|
887
|
-
if (D(
|
|
888
|
-
return
|
|
900
|
+
if (D(d))
|
|
901
|
+
return ot(d, (w) => y(w, u));
|
|
889
902
|
{
|
|
890
|
-
const w = y(
|
|
903
|
+
const w = y(d, u);
|
|
891
904
|
if (w === void 0) {
|
|
892
|
-
if (
|
|
893
|
-
return
|
|
905
|
+
if (d === null)
|
|
906
|
+
return d;
|
|
894
907
|
throw Error("A case reducer on a non-draftable value must not return undefined");
|
|
895
908
|
}
|
|
896
909
|
return w;
|
|
897
910
|
}
|
|
898
911
|
}
|
|
899
|
-
return
|
|
912
|
+
return d;
|
|
900
913
|
}, c);
|
|
901
914
|
}
|
|
902
915
|
return s.getInitialState = i, s;
|
|
903
916
|
}
|
|
904
|
-
var
|
|
917
|
+
var Zt = "ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW", er = (e = 21) => {
|
|
905
918
|
let t = "", r = e;
|
|
906
919
|
for (; r--; )
|
|
907
|
-
t +=
|
|
920
|
+
t += Zt[Math.random() * 64 | 0];
|
|
908
921
|
return t;
|
|
909
|
-
},
|
|
910
|
-
function
|
|
922
|
+
}, tr = /* @__PURE__ */ Symbol.for("rtk-slice-createasyncthunk");
|
|
923
|
+
function rr(e, t) {
|
|
911
924
|
return `${e}/${t}`;
|
|
912
925
|
}
|
|
913
|
-
function
|
|
926
|
+
function nr({
|
|
914
927
|
creators: e
|
|
915
928
|
} = {}) {
|
|
916
|
-
const t = e?.asyncThunk?.[
|
|
929
|
+
const t = e?.asyncThunk?.[tr];
|
|
917
930
|
return function(n) {
|
|
918
931
|
const {
|
|
919
932
|
name: o,
|
|
@@ -922,19 +935,19 @@ function rr({
|
|
|
922
935
|
if (!o)
|
|
923
936
|
throw new Error(process.env.NODE_ENV === "production" ? g(11) : "`name` is a required option for createSlice");
|
|
924
937
|
typeof process < "u" && process.env.NODE_ENV === "development" && n.initialState === void 0 && console.error("You must provide an `initialState` value that is not `undefined`. You may have misspelled `initialState`");
|
|
925
|
-
const s = (typeof n.reducers == "function" ? n.reducers(
|
|
938
|
+
const s = (typeof n.reducers == "function" ? n.reducers(sr()) : n.reducers) || {}, c = Object.keys(s), u = {
|
|
926
939
|
sliceCaseReducersByName: {},
|
|
927
940
|
sliceCaseReducersByType: {},
|
|
928
941
|
actionCreators: {},
|
|
929
942
|
sliceMatchers: []
|
|
930
943
|
}, l = {
|
|
931
944
|
addCase(h, p) {
|
|
932
|
-
const
|
|
933
|
-
if (!
|
|
945
|
+
const _ = typeof h == "string" ? h : h.type;
|
|
946
|
+
if (!_)
|
|
934
947
|
throw new Error(process.env.NODE_ENV === "production" ? g(12) : "`context.addCase` cannot be called with an empty action type");
|
|
935
|
-
if (
|
|
936
|
-
throw new Error(process.env.NODE_ENV === "production" ? g(13) : "`context.addCase` cannot be called with two reducers for the same action type: " +
|
|
937
|
-
return u.sliceCaseReducersByType[
|
|
948
|
+
if (_ in u.sliceCaseReducersByType)
|
|
949
|
+
throw new Error(process.env.NODE_ENV === "production" ? g(13) : "`context.addCase` cannot be called with two reducers for the same action type: " + _);
|
|
950
|
+
return u.sliceCaseReducersByType[_] = p, l;
|
|
938
951
|
},
|
|
939
952
|
addMatcher(h, p) {
|
|
940
953
|
return u.sliceMatchers.push({
|
|
@@ -950,83 +963,83 @@ function rr({
|
|
|
950
963
|
}
|
|
951
964
|
};
|
|
952
965
|
c.forEach((h) => {
|
|
953
|
-
const p = s[h],
|
|
966
|
+
const p = s[h], _ = {
|
|
954
967
|
reducerName: h,
|
|
955
|
-
type:
|
|
968
|
+
type: rr(o, h),
|
|
956
969
|
createNotation: typeof n.reducers == "function"
|
|
957
970
|
};
|
|
958
|
-
|
|
971
|
+
ar(p) ? lr(_, p, l, t) : cr(_, p, l);
|
|
959
972
|
});
|
|
960
|
-
function
|
|
973
|
+
function d() {
|
|
961
974
|
if (process.env.NODE_ENV !== "production" && typeof n.extraReducers == "object")
|
|
962
975
|
throw new Error(process.env.NODE_ENV === "production" ? g(14) : "The object notation for `createSlice.extraReducers` has been removed. Please use the 'builder callback' notation instead: https://redux-toolkit.js.org/api/createSlice");
|
|
963
|
-
const [h = {}, p = [],
|
|
976
|
+
const [h = {}, p = [], _ = void 0] = typeof n.extraReducers == "function" ? st(n.extraReducers) : [n.extraReducers], b = {
|
|
964
977
|
...h,
|
|
965
978
|
...u.sliceCaseReducersByType
|
|
966
979
|
};
|
|
967
|
-
return
|
|
980
|
+
return Qt(n.initialState, (C) => {
|
|
968
981
|
for (let E in b)
|
|
969
982
|
C.addCase(E, b[E]);
|
|
970
983
|
for (let E of u.sliceMatchers)
|
|
971
984
|
C.addMatcher(E.matcher, E.reducer);
|
|
972
985
|
for (let E of p)
|
|
973
986
|
C.addMatcher(E.matcher, E.reducer);
|
|
974
|
-
|
|
987
|
+
_ && C.addDefaultCase(_);
|
|
975
988
|
});
|
|
976
989
|
}
|
|
977
990
|
const y = (h) => h, w = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new WeakMap();
|
|
978
|
-
let
|
|
979
|
-
function
|
|
980
|
-
return
|
|
991
|
+
let f;
|
|
992
|
+
function m(h, p) {
|
|
993
|
+
return f || (f = d()), f(h, p);
|
|
981
994
|
}
|
|
982
995
|
function N() {
|
|
983
|
-
return
|
|
996
|
+
return f || (f = d()), f.getInitialState();
|
|
984
997
|
}
|
|
985
998
|
function v(h, p = !1) {
|
|
986
|
-
function
|
|
999
|
+
function _(C) {
|
|
987
1000
|
let E = C[h];
|
|
988
1001
|
if (typeof E > "u") {
|
|
989
1002
|
if (p)
|
|
990
|
-
E =
|
|
1003
|
+
E = H(a, _, N);
|
|
991
1004
|
else if (process.env.NODE_ENV !== "production")
|
|
992
1005
|
throw new Error(process.env.NODE_ENV === "production" ? g(15) : "selectSlice returned undefined for an uninjected slice reducer");
|
|
993
1006
|
}
|
|
994
1007
|
return E;
|
|
995
1008
|
}
|
|
996
1009
|
function b(C = y) {
|
|
997
|
-
const E =
|
|
998
|
-
return
|
|
999
|
-
const
|
|
1000
|
-
for (const [
|
|
1001
|
-
|
|
1002
|
-
return
|
|
1010
|
+
const E = H(w, p, () => /* @__PURE__ */ new WeakMap());
|
|
1011
|
+
return H(E, C, () => {
|
|
1012
|
+
const V = {};
|
|
1013
|
+
for (const [he, wt] of Object.entries(n.selectors ?? {}))
|
|
1014
|
+
V[he] = or(wt, C, () => H(a, C, N), p);
|
|
1015
|
+
return V;
|
|
1003
1016
|
});
|
|
1004
1017
|
}
|
|
1005
1018
|
return {
|
|
1006
1019
|
reducerPath: h,
|
|
1007
1020
|
getSelectors: b,
|
|
1008
1021
|
get selectors() {
|
|
1009
|
-
return b(
|
|
1022
|
+
return b(_);
|
|
1010
1023
|
},
|
|
1011
|
-
selectSlice:
|
|
1024
|
+
selectSlice: _
|
|
1012
1025
|
};
|
|
1013
1026
|
}
|
|
1014
1027
|
const O = {
|
|
1015
1028
|
name: o,
|
|
1016
|
-
reducer:
|
|
1029
|
+
reducer: m,
|
|
1017
1030
|
actions: u.actionCreators,
|
|
1018
1031
|
caseReducers: u.sliceCaseReducersByName,
|
|
1019
1032
|
getInitialState: N,
|
|
1020
1033
|
...v(i),
|
|
1021
1034
|
injectInto(h, {
|
|
1022
1035
|
reducerPath: p,
|
|
1023
|
-
...
|
|
1036
|
+
..._
|
|
1024
1037
|
} = {}) {
|
|
1025
1038
|
const b = p ?? i;
|
|
1026
1039
|
return h.inject({
|
|
1027
1040
|
reducerPath: b,
|
|
1028
|
-
reducer:
|
|
1029
|
-
},
|
|
1041
|
+
reducer: m
|
|
1042
|
+
}, _), {
|
|
1030
1043
|
...O,
|
|
1031
1044
|
...v(b, !0)
|
|
1032
1045
|
};
|
|
@@ -1035,7 +1048,7 @@ function rr({
|
|
|
1035
1048
|
return O;
|
|
1036
1049
|
};
|
|
1037
1050
|
}
|
|
1038
|
-
function
|
|
1051
|
+
function or(e, t, r, n) {
|
|
1039
1052
|
function o(i, ...s) {
|
|
1040
1053
|
let c = t(i);
|
|
1041
1054
|
if (typeof c > "u") {
|
|
@@ -1048,8 +1061,8 @@ function nr(e, t, r, n) {
|
|
|
1048
1061
|
}
|
|
1049
1062
|
return o.unwrapped = e, o;
|
|
1050
1063
|
}
|
|
1051
|
-
var
|
|
1052
|
-
function
|
|
1064
|
+
var ir = /* @__PURE__ */ nr();
|
|
1065
|
+
function sr() {
|
|
1053
1066
|
function e(t, r) {
|
|
1054
1067
|
return {
|
|
1055
1068
|
_reducerDefinitionType: "asyncThunk",
|
|
@@ -1080,27 +1093,27 @@ function ir() {
|
|
|
1080
1093
|
asyncThunk: e
|
|
1081
1094
|
};
|
|
1082
1095
|
}
|
|
1083
|
-
function
|
|
1096
|
+
function cr({
|
|
1084
1097
|
type: e,
|
|
1085
1098
|
reducerName: t,
|
|
1086
1099
|
createNotation: r
|
|
1087
1100
|
}, n, o) {
|
|
1088
1101
|
let i, s;
|
|
1089
1102
|
if ("reducer" in n) {
|
|
1090
|
-
if (r && !
|
|
1103
|
+
if (r && !ur(n))
|
|
1091
1104
|
throw new Error(process.env.NODE_ENV === "production" ? g(17) : "Please use the `create.preparedReducer` notation for prepared action creators with the `create` notation.");
|
|
1092
1105
|
i = n.reducer, s = n.prepare;
|
|
1093
1106
|
} else
|
|
1094
1107
|
i = n;
|
|
1095
|
-
o.addCase(e, i).exposeCaseReducer(t, i).exposeAction(t, s ?
|
|
1108
|
+
o.addCase(e, i).exposeCaseReducer(t, i).exposeAction(t, s ? F(e, s) : F(e));
|
|
1096
1109
|
}
|
|
1097
|
-
function
|
|
1110
|
+
function ar(e) {
|
|
1098
1111
|
return e._reducerDefinitionType === "asyncThunk";
|
|
1099
1112
|
}
|
|
1100
|
-
function
|
|
1113
|
+
function ur(e) {
|
|
1101
1114
|
return e._reducerDefinitionType === "reducerWithPrepare";
|
|
1102
1115
|
}
|
|
1103
|
-
function
|
|
1116
|
+
function lr({
|
|
1104
1117
|
type: e,
|
|
1105
1118
|
reducerName: t
|
|
1106
1119
|
}, r, n, o) {
|
|
@@ -1112,20 +1125,20 @@ function ur({
|
|
|
1112
1125
|
pending: c,
|
|
1113
1126
|
rejected: u,
|
|
1114
1127
|
settled: l,
|
|
1115
|
-
options:
|
|
1116
|
-
} = r, y = o(e, i,
|
|
1128
|
+
options: d
|
|
1129
|
+
} = r, y = o(e, i, d);
|
|
1117
1130
|
n.exposeAction(t, y), s && n.addCase(y.fulfilled, s), c && n.addCase(y.pending, c), u && n.addCase(y.rejected, u), l && n.addMatcher(y.settled, l), n.exposeCaseReducer(t, {
|
|
1118
|
-
fulfilled: s ||
|
|
1119
|
-
pending: c ||
|
|
1120
|
-
rejected: u ||
|
|
1121
|
-
settled: l ||
|
|
1131
|
+
fulfilled: s || Y,
|
|
1132
|
+
pending: c || Y,
|
|
1133
|
+
rejected: u || Y,
|
|
1134
|
+
settled: l || Y
|
|
1122
1135
|
});
|
|
1123
1136
|
}
|
|
1124
|
-
function
|
|
1137
|
+
function Y() {
|
|
1125
1138
|
}
|
|
1126
|
-
var
|
|
1139
|
+
var dr = "task", ct = "listener", at = "completed", Re = "cancelled", fr = `task-${Re}`, pr = `task-${at}`, Ne = `${ct}-${Re}`, hr = `${ct}-${at}`, pe = class {
|
|
1127
1140
|
constructor(e) {
|
|
1128
|
-
this.code = e, this.message = `${
|
|
1141
|
+
this.code = e, this.message = `${dr} ${Re} (reason: ${e})`;
|
|
1129
1142
|
}
|
|
1130
1143
|
name = "TaskAbortError";
|
|
1131
1144
|
message;
|
|
@@ -1133,38 +1146,26 @@ var lr = "task", st = "listener", ct = "completed", Te = "cancelled", fr = `task
|
|
|
1133
1146
|
if (typeof e != "function")
|
|
1134
1147
|
throw new TypeError(process.env.NODE_ENV === "production" ? g(32) : `${t} is not a function`);
|
|
1135
1148
|
}, ne = () => {
|
|
1136
|
-
},
|
|
1149
|
+
}, ut = (e, t = ne) => (e.catch(t), e), lt = (e, t) => (e.addEventListener("abort", t, {
|
|
1137
1150
|
once: !0
|
|
1138
|
-
}), () => e.removeEventListener("abort", t)), I = (e
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
enumerable: !0,
|
|
1142
|
-
value: t,
|
|
1143
|
-
configurable: !0,
|
|
1144
|
-
writable: !0
|
|
1145
|
-
}), e.abort(t));
|
|
1146
|
-
}, z = (e) => {
|
|
1147
|
-
if (e.aborted) {
|
|
1148
|
-
const {
|
|
1149
|
-
reason: t
|
|
1150
|
-
} = e;
|
|
1151
|
-
throw new de(t);
|
|
1152
|
-
}
|
|
1151
|
+
}), () => e.removeEventListener("abort", t)), I = (e) => {
|
|
1152
|
+
if (e.aborted)
|
|
1153
|
+
throw new pe(e.reason);
|
|
1153
1154
|
};
|
|
1154
|
-
function
|
|
1155
|
+
function dt(e, t) {
|
|
1155
1156
|
let r = ne;
|
|
1156
1157
|
return new Promise((n, o) => {
|
|
1157
|
-
const i = () => o(new
|
|
1158
|
+
const i = () => o(new pe(e.reason));
|
|
1158
1159
|
if (e.aborted) {
|
|
1159
1160
|
i();
|
|
1160
1161
|
return;
|
|
1161
1162
|
}
|
|
1162
|
-
r =
|
|
1163
|
+
r = lt(e, i), t.finally(() => r()).then(n, o);
|
|
1163
1164
|
}).finally(() => {
|
|
1164
1165
|
r = ne;
|
|
1165
1166
|
});
|
|
1166
1167
|
}
|
|
1167
|
-
var
|
|
1168
|
+
var yr = async (e, t) => {
|
|
1168
1169
|
try {
|
|
1169
1170
|
return await Promise.resolve(), {
|
|
1170
1171
|
status: "ok",
|
|
@@ -1172,65 +1173,65 @@ var hr = async (e, t) => {
|
|
|
1172
1173
|
};
|
|
1173
1174
|
} catch (r) {
|
|
1174
1175
|
return {
|
|
1175
|
-
status: r instanceof
|
|
1176
|
+
status: r instanceof pe ? "cancelled" : "rejected",
|
|
1176
1177
|
error: r
|
|
1177
1178
|
};
|
|
1178
1179
|
} finally {
|
|
1179
1180
|
t?.();
|
|
1180
1181
|
}
|
|
1181
|
-
}, oe = (e) => (t) =>
|
|
1182
|
+
}, oe = (e) => (t) => ut(dt(e, t).then((r) => (I(e), r))), ft = (e) => {
|
|
1182
1183
|
const t = oe(e);
|
|
1183
1184
|
return (r) => t(new Promise((n) => setTimeout(n, r)));
|
|
1184
1185
|
}, {
|
|
1185
|
-
assign:
|
|
1186
|
-
} = Object,
|
|
1187
|
-
const r = (n) =>
|
|
1186
|
+
assign: z
|
|
1187
|
+
} = Object, qe = {}, W = "listenerMiddleware", _r = (e, t) => {
|
|
1188
|
+
const r = (n) => lt(e, () => n.abort(e.reason));
|
|
1188
1189
|
return (n, o) => {
|
|
1189
1190
|
Me(n, "taskExecutor");
|
|
1190
1191
|
const i = new AbortController();
|
|
1191
1192
|
r(i);
|
|
1192
|
-
const s =
|
|
1193
|
-
|
|
1193
|
+
const s = yr(async () => {
|
|
1194
|
+
I(e), I(i.signal);
|
|
1194
1195
|
const c = await n({
|
|
1195
1196
|
pause: oe(i.signal),
|
|
1196
1197
|
delay: ft(i.signal),
|
|
1197
1198
|
signal: i.signal
|
|
1198
1199
|
});
|
|
1199
|
-
return
|
|
1200
|
-
}, () =>
|
|
1200
|
+
return I(i.signal), c;
|
|
1201
|
+
}, () => i.abort(pr));
|
|
1201
1202
|
return o?.autoJoin && t.push(s.catch(ne)), {
|
|
1202
1203
|
result: oe(e)(s),
|
|
1203
1204
|
cancel() {
|
|
1204
|
-
|
|
1205
|
+
i.abort(fr);
|
|
1205
1206
|
}
|
|
1206
1207
|
};
|
|
1207
1208
|
};
|
|
1208
1209
|
}, mr = (e, t) => {
|
|
1209
1210
|
const r = async (n, o) => {
|
|
1210
|
-
|
|
1211
|
+
I(t);
|
|
1211
1212
|
let i = () => {
|
|
1212
1213
|
};
|
|
1213
1214
|
const c = [new Promise((u, l) => {
|
|
1214
|
-
let
|
|
1215
|
+
let d = e({
|
|
1215
1216
|
predicate: n,
|
|
1216
1217
|
effect: (y, w) => {
|
|
1217
1218
|
w.unsubscribe(), u([y, w.getState(), w.getOriginalState()]);
|
|
1218
1219
|
}
|
|
1219
1220
|
});
|
|
1220
1221
|
i = () => {
|
|
1221
|
-
|
|
1222
|
+
d(), l();
|
|
1222
1223
|
};
|
|
1223
1224
|
})];
|
|
1224
1225
|
o != null && c.push(new Promise((u) => setTimeout(u, o, null)));
|
|
1225
1226
|
try {
|
|
1226
|
-
const u = await
|
|
1227
|
-
return
|
|
1227
|
+
const u = await dt(t, Promise.race(c));
|
|
1228
|
+
return I(t), u;
|
|
1228
1229
|
} finally {
|
|
1229
1230
|
i();
|
|
1230
1231
|
}
|
|
1231
1232
|
};
|
|
1232
|
-
return (n, o) =>
|
|
1233
|
-
},
|
|
1233
|
+
return (n, o) => ut(r(n, o));
|
|
1234
|
+
}, pt = (e) => {
|
|
1234
1235
|
let {
|
|
1235
1236
|
type: t,
|
|
1236
1237
|
actionCreator: r,
|
|
@@ -1239,7 +1240,7 @@ var hr = async (e, t) => {
|
|
|
1239
1240
|
effect: i
|
|
1240
1241
|
} = e;
|
|
1241
1242
|
if (t)
|
|
1242
|
-
o =
|
|
1243
|
+
o = F(t).match;
|
|
1243
1244
|
else if (r)
|
|
1244
1245
|
t = r.type, o = r.match;
|
|
1245
1246
|
else if (n)
|
|
@@ -1250,14 +1251,14 @@ var hr = async (e, t) => {
|
|
|
1250
1251
|
type: t,
|
|
1251
1252
|
effect: i
|
|
1252
1253
|
};
|
|
1253
|
-
},
|
|
1254
|
+
}, ht = /* @__PURE__ */ z((e) => {
|
|
1254
1255
|
const {
|
|
1255
1256
|
type: t,
|
|
1256
1257
|
predicate: r,
|
|
1257
1258
|
effect: n
|
|
1258
|
-
} =
|
|
1259
|
+
} = pt(e);
|
|
1259
1260
|
return {
|
|
1260
|
-
id:
|
|
1261
|
+
id: er(),
|
|
1261
1262
|
effect: n,
|
|
1262
1263
|
type: t,
|
|
1263
1264
|
predicate: r,
|
|
@@ -1267,23 +1268,23 @@ var hr = async (e, t) => {
|
|
|
1267
1268
|
}
|
|
1268
1269
|
};
|
|
1269
1270
|
}, {
|
|
1270
|
-
withTypes: () =>
|
|
1271
|
-
}),
|
|
1271
|
+
withTypes: () => ht
|
|
1272
|
+
}), Ke = (e, t) => {
|
|
1272
1273
|
const {
|
|
1273
1274
|
type: r,
|
|
1274
1275
|
effect: n,
|
|
1275
1276
|
predicate: o
|
|
1276
|
-
} =
|
|
1277
|
+
} = pt(t);
|
|
1277
1278
|
return Array.from(e.values()).find((i) => (typeof r == "string" ? i.type === r : i.predicate === o) && i.effect === n);
|
|
1278
|
-
},
|
|
1279
|
+
}, ke = (e) => {
|
|
1279
1280
|
e.pending.forEach((t) => {
|
|
1280
|
-
|
|
1281
|
+
t.abort(Ne);
|
|
1281
1282
|
});
|
|
1282
|
-
},
|
|
1283
|
+
}, gr = (e, t) => () => {
|
|
1283
1284
|
for (const r of t.keys())
|
|
1284
|
-
|
|
1285
|
+
ke(r);
|
|
1285
1286
|
e.clear();
|
|
1286
|
-
},
|
|
1287
|
+
}, He = (e, t, r) => {
|
|
1287
1288
|
try {
|
|
1288
1289
|
e(t, r);
|
|
1289
1290
|
} catch (n) {
|
|
@@ -1291,116 +1292,116 @@ var hr = async (e, t) => {
|
|
|
1291
1292
|
throw n;
|
|
1292
1293
|
}, 0);
|
|
1293
1294
|
}
|
|
1294
|
-
},
|
|
1295
|
-
withTypes: () => ht
|
|
1296
|
-
}), gr = /* @__PURE__ */ V(`${q}/removeAll`), yt = /* @__PURE__ */ A(/* @__PURE__ */ V(`${q}/remove`), {
|
|
1295
|
+
}, yt = /* @__PURE__ */ z(/* @__PURE__ */ F(`${W}/add`), {
|
|
1297
1296
|
withTypes: () => yt
|
|
1298
|
-
}), vr = (
|
|
1299
|
-
|
|
1297
|
+
}), vr = /* @__PURE__ */ F(`${W}/removeAll`), _t = /* @__PURE__ */ z(/* @__PURE__ */ F(`${W}/remove`), {
|
|
1298
|
+
withTypes: () => _t
|
|
1299
|
+
}), wr = (...e) => {
|
|
1300
|
+
console.error(`${W}/error`, ...e);
|
|
1300
1301
|
}, mt = (e = {}) => {
|
|
1301
1302
|
const t = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map(), n = (a) => {
|
|
1302
|
-
const
|
|
1303
|
-
r.set(a,
|
|
1303
|
+
const f = r.get(a) ?? 0;
|
|
1304
|
+
r.set(a, f + 1);
|
|
1304
1305
|
}, o = (a) => {
|
|
1305
|
-
const
|
|
1306
|
-
|
|
1306
|
+
const f = r.get(a) ?? 1;
|
|
1307
|
+
f === 1 ? r.delete(a) : r.set(a, f - 1);
|
|
1307
1308
|
}, {
|
|
1308
1309
|
extra: i,
|
|
1309
|
-
onError: s =
|
|
1310
|
+
onError: s = wr
|
|
1310
1311
|
} = e;
|
|
1311
1312
|
Me(s, "onError");
|
|
1312
|
-
const c = (a) => (a.unsubscribe = () => t.delete(a.id), t.set(a.id, a), (
|
|
1313
|
-
a.unsubscribe(),
|
|
1313
|
+
const c = (a) => (a.unsubscribe = () => t.delete(a.id), t.set(a.id, a), (f) => {
|
|
1314
|
+
a.unsubscribe(), f?.cancelActive && ke(a);
|
|
1314
1315
|
}), u = (a) => {
|
|
1315
|
-
const
|
|
1316
|
-
return c(
|
|
1316
|
+
const f = Ke(t, a) ?? ht(a);
|
|
1317
|
+
return c(f);
|
|
1317
1318
|
};
|
|
1318
|
-
|
|
1319
|
+
z(u, {
|
|
1319
1320
|
withTypes: () => u
|
|
1320
1321
|
});
|
|
1321
1322
|
const l = (a) => {
|
|
1322
|
-
const
|
|
1323
|
-
return
|
|
1323
|
+
const f = Ke(t, a);
|
|
1324
|
+
return f && (f.unsubscribe(), a.cancelActive && ke(f)), !!f;
|
|
1324
1325
|
};
|
|
1325
|
-
|
|
1326
|
+
z(l, {
|
|
1326
1327
|
withTypes: () => l
|
|
1327
1328
|
});
|
|
1328
|
-
const
|
|
1329
|
+
const d = async (a, f, m, N) => {
|
|
1329
1330
|
const v = new AbortController(), O = mr(u, v.signal), h = [];
|
|
1330
1331
|
try {
|
|
1331
1332
|
a.pending.add(v), n(a), await Promise.resolve(a.effect(
|
|
1332
|
-
|
|
1333
|
+
f,
|
|
1333
1334
|
// Use assign() rather than ... to avoid extra helper functions added to bundle
|
|
1334
|
-
|
|
1335
|
+
z({}, m, {
|
|
1335
1336
|
getOriginalState: N,
|
|
1336
|
-
condition: (p,
|
|
1337
|
+
condition: (p, _) => O(p, _).then(Boolean),
|
|
1337
1338
|
take: O,
|
|
1338
1339
|
delay: ft(v.signal),
|
|
1339
1340
|
pause: oe(v.signal),
|
|
1340
1341
|
extra: i,
|
|
1341
1342
|
signal: v.signal,
|
|
1342
|
-
fork:
|
|
1343
|
+
fork: _r(v.signal, h),
|
|
1343
1344
|
unsubscribe: a.unsubscribe,
|
|
1344
1345
|
subscribe: () => {
|
|
1345
1346
|
t.set(a.id, a);
|
|
1346
1347
|
},
|
|
1347
1348
|
cancelActiveListeners: () => {
|
|
1348
|
-
a.pending.forEach((p,
|
|
1349
|
-
p !== v && (
|
|
1349
|
+
a.pending.forEach((p, _, b) => {
|
|
1350
|
+
p !== v && (p.abort(Ne), b.delete(p));
|
|
1350
1351
|
});
|
|
1351
1352
|
},
|
|
1352
1353
|
cancel: () => {
|
|
1353
|
-
|
|
1354
|
+
v.abort(Ne), a.pending.delete(v);
|
|
1354
1355
|
},
|
|
1355
1356
|
throwIfCancelled: () => {
|
|
1356
|
-
|
|
1357
|
+
I(v.signal);
|
|
1357
1358
|
}
|
|
1358
1359
|
})
|
|
1359
1360
|
));
|
|
1360
1361
|
} catch (p) {
|
|
1361
|
-
p instanceof
|
|
1362
|
+
p instanceof pe || He(s, p, {
|
|
1362
1363
|
raisedBy: "effect"
|
|
1363
1364
|
});
|
|
1364
1365
|
} finally {
|
|
1365
|
-
await Promise.all(h),
|
|
1366
|
+
await Promise.all(h), v.abort(hr), o(a), a.pending.delete(v);
|
|
1366
1367
|
}
|
|
1367
|
-
}, y =
|
|
1368
|
+
}, y = gr(t, r);
|
|
1368
1369
|
return {
|
|
1369
|
-
middleware: (a) => (
|
|
1370
|
-
if (!
|
|
1371
|
-
return
|
|
1372
|
-
if (
|
|
1373
|
-
return u(
|
|
1374
|
-
if (
|
|
1370
|
+
middleware: (a) => (f) => (m) => {
|
|
1371
|
+
if (!Ye(m))
|
|
1372
|
+
return f(m);
|
|
1373
|
+
if (yt.match(m))
|
|
1374
|
+
return u(m.payload);
|
|
1375
|
+
if (vr.match(m)) {
|
|
1375
1376
|
y();
|
|
1376
1377
|
return;
|
|
1377
1378
|
}
|
|
1378
|
-
if (
|
|
1379
|
-
return l(
|
|
1379
|
+
if (_t.match(m))
|
|
1380
|
+
return l(m.payload);
|
|
1380
1381
|
let N = a.getState();
|
|
1381
1382
|
const v = () => {
|
|
1382
|
-
if (N ===
|
|
1383
|
-
throw new Error(process.env.NODE_ENV === "production" ? g(23) : `${
|
|
1383
|
+
if (N === qe)
|
|
1384
|
+
throw new Error(process.env.NODE_ENV === "production" ? g(23) : `${W}: getOriginalState can only be called synchronously`);
|
|
1384
1385
|
return N;
|
|
1385
1386
|
};
|
|
1386
1387
|
let O;
|
|
1387
1388
|
try {
|
|
1388
|
-
if (O =
|
|
1389
|
+
if (O = f(m), t.size > 0) {
|
|
1389
1390
|
const h = a.getState(), p = Array.from(t.values());
|
|
1390
|
-
for (const
|
|
1391
|
+
for (const _ of p) {
|
|
1391
1392
|
let b = !1;
|
|
1392
1393
|
try {
|
|
1393
|
-
b =
|
|
1394
|
+
b = _.predicate(m, h, N);
|
|
1394
1395
|
} catch (C) {
|
|
1395
|
-
b = !1,
|
|
1396
|
+
b = !1, He(s, C, {
|
|
1396
1397
|
raisedBy: "predicate"
|
|
1397
1398
|
});
|
|
1398
1399
|
}
|
|
1399
|
-
b &&
|
|
1400
|
+
b && d(_, m, a, v);
|
|
1400
1401
|
}
|
|
1401
1402
|
}
|
|
1402
1403
|
} finally {
|
|
1403
|
-
N =
|
|
1404
|
+
N = qe;
|
|
1404
1405
|
}
|
|
1405
1406
|
return O;
|
|
1406
1407
|
},
|
|
@@ -1412,11 +1413,11 @@ var hr = async (e, t) => {
|
|
|
1412
1413
|
function g(e) {
|
|
1413
1414
|
return `Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `;
|
|
1414
1415
|
}
|
|
1415
|
-
const
|
|
1416
|
+
const Er = {
|
|
1416
1417
|
logs: []
|
|
1417
|
-
},
|
|
1418
|
+
}, gt = ir({
|
|
1418
1419
|
name: "logger",
|
|
1419
|
-
initialState:
|
|
1420
|
+
initialState: Er,
|
|
1420
1421
|
reducers: {
|
|
1421
1422
|
addLog: (e, t) => {
|
|
1422
1423
|
const r = {
|
|
@@ -1430,19 +1431,19 @@ const wr = {
|
|
|
1430
1431
|
e.logs = [];
|
|
1431
1432
|
}
|
|
1432
1433
|
}
|
|
1433
|
-
}), { addLog:
|
|
1434
|
-
[
|
|
1434
|
+
}), { addLog: U, clearLogs: Sr } = gt.actions, Nr = gt.reducer, kr = (e) => U({ message: e, level: "info" }), Pr = (e) => U({ message: e, level: "warn" }), Or = (e) => U({ message: e, level: "error" }), br = "logger", Cr = (e) => e[br], vt = fe(
|
|
1435
|
+
[Cr],
|
|
1435
1436
|
(e) => e.logs
|
|
1436
|
-
), Or = fe(
|
|
1437
|
-
[gt, (e, t) => t],
|
|
1438
|
-
(e, t) => e.filter((r) => r.level === t)
|
|
1439
1437
|
), Dr = fe(
|
|
1440
|
-
[
|
|
1438
|
+
[vt, (e, t) => t],
|
|
1439
|
+
(e, t) => e.filter((r) => r.level === t)
|
|
1440
|
+
), Rr = fe(
|
|
1441
|
+
[vt, (e, t) => t],
|
|
1441
1442
|
(e, t) => t === 0 ? [] : e.slice(-t)
|
|
1442
|
-
),
|
|
1443
|
+
), Mr = () => {
|
|
1443
1444
|
const e = mt();
|
|
1444
1445
|
return e.startListening({
|
|
1445
|
-
actionCreator:
|
|
1446
|
+
actionCreator: U,
|
|
1446
1447
|
effect: (t, r) => {
|
|
1447
1448
|
const n = t.payload, { message: o, level: i } = n;
|
|
1448
1449
|
switch (i) {
|
|
@@ -1461,7 +1462,7 @@ const wr = {
|
|
|
1461
1462
|
}, Tr = (e) => {
|
|
1462
1463
|
const t = mt();
|
|
1463
1464
|
return t.startListening({
|
|
1464
|
-
actionCreator:
|
|
1465
|
+
actionCreator: U,
|
|
1465
1466
|
effect: async (r, n) => {
|
|
1466
1467
|
const o = r.payload;
|
|
1467
1468
|
try {
|
|
@@ -1473,18 +1474,18 @@ const wr = {
|
|
|
1473
1474
|
}), t.middleware;
|
|
1474
1475
|
};
|
|
1475
1476
|
export {
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1477
|
+
br as LoggerKey,
|
|
1478
|
+
U as addLog,
|
|
1479
|
+
Sr as clearLogs,
|
|
1480
|
+
Mr as createConsoleLoggerMiddleware,
|
|
1480
1481
|
Tr as createHttpLoggerMiddleware,
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1482
|
+
Or as logError,
|
|
1483
|
+
kr as logInfo,
|
|
1484
|
+
Pr as logWarn,
|
|
1485
|
+
Nr as loggerReducer,
|
|
1486
|
+
gt as loggerSlice,
|
|
1487
|
+
Cr as selectLoggerState,
|
|
1488
|
+
vt as selectLogs,
|
|
1489
|
+
Dr as selectLogsByLevel,
|
|
1490
|
+
Rr as selectRecentLogs
|
|
1490
1491
|
};
|