@open-kingdom/shared-frontend-data-access-notifications 0.0.2-0 → 0.0.2-3
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 +619 -578
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function
|
|
1
|
+
function Xe(e) {
|
|
2
2
|
if (typeof e != "object" || e === null)
|
|
3
3
|
return !1;
|
|
4
4
|
let t = e;
|
|
@@ -6,10 +6,10 @@ function Te(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 Je(e) {
|
|
10
|
+
return Xe(e) && "type" in e && typeof e.type == "string";
|
|
11
11
|
}
|
|
12
|
-
var
|
|
12
|
+
var Me = Symbol.for("immer-nothing"), ve = Symbol.for("immer-draftable"), w = Symbol.for("immer-state"), Qe = 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,230 +42,257 @@ var we = Symbol.for("immer-nothing"), ue = Symbol.for("immer-draftable"), E = Sy
|
|
|
42
42
|
] : [];
|
|
43
43
|
function N(e, ...t) {
|
|
44
44
|
if (process.env.NODE_ENV !== "production") {
|
|
45
|
-
const n =
|
|
45
|
+
const n = Qe[e], r = k(n) ? n.apply(null, t) : n;
|
|
46
46
|
throw new Error(`[Immer] ${r}`);
|
|
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
|
|
53
|
-
function
|
|
54
|
-
return !!e
|
|
52
|
+
var v = Object, I = v.getPrototypeOf, G = "constructor", Q = "prototype", ae = "configurable", H = "enumerable", K = "writable", A = "value", O = (e) => !!e && !!e[w];
|
|
53
|
+
function D(e) {
|
|
54
|
+
return e ? Fe(e) || Z(e) || !!e[ve] || !!e[G]?.[ve] || ee(e) || te(e) : !1;
|
|
55
55
|
}
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
var je = Object.prototype.constructor.toString(), ae = /* @__PURE__ */ new WeakMap();
|
|
60
|
-
function Ne(e) {
|
|
61
|
-
if (!e || typeof e != "object")
|
|
56
|
+
var Ze = v[Q][G].toString(), Ce = /* @__PURE__ */ new WeakMap();
|
|
57
|
+
function Fe(e) {
|
|
58
|
+
if (!e || !_e(e))
|
|
62
59
|
return !1;
|
|
63
|
-
const t =
|
|
64
|
-
if (t === null || t ===
|
|
60
|
+
const t = I(e);
|
|
61
|
+
if (t === null || t === v[Q])
|
|
65
62
|
return !0;
|
|
66
|
-
const n =
|
|
63
|
+
const n = v.hasOwnProperty.call(t, G) && t[G];
|
|
67
64
|
if (n === Object)
|
|
68
65
|
return !0;
|
|
69
|
-
if (
|
|
66
|
+
if (!k(n))
|
|
70
67
|
return !1;
|
|
71
|
-
let r =
|
|
72
|
-
return r === void 0 && (r = Function.toString.call(n),
|
|
73
|
-
}
|
|
74
|
-
function B(e, t, n = !0) {
|
|
75
|
-
q(e) === 0 ? (n ? Reflect.ownKeys(e) : Object.keys(e)).forEach((o) => {
|
|
76
|
-
t(o, e[o], e);
|
|
77
|
-
}) : e.forEach((r, o) => t(o, r, e));
|
|
68
|
+
let r = Ce.get(n);
|
|
69
|
+
return r === void 0 && (r = Function.toString.call(n), Ce.set(n, r)), r === Ze;
|
|
78
70
|
}
|
|
79
|
-
function
|
|
80
|
-
|
|
81
|
-
|
|
71
|
+
function j(e, t, n = !0) {
|
|
72
|
+
$(e) === 0 ? (n ? Reflect.ownKeys(e) : v.keys(e)).forEach((i) => {
|
|
73
|
+
t(i, e[i], e);
|
|
74
|
+
}) : e.forEach((r, i) => t(i, r, e));
|
|
82
75
|
}
|
|
83
|
-
function
|
|
84
|
-
|
|
76
|
+
function $(e) {
|
|
77
|
+
const t = e[w];
|
|
78
|
+
return t ? t.type_ : Z(e) ? 1 : ee(e) ? 2 : te(e) ? 3 : 0;
|
|
85
79
|
}
|
|
86
|
-
|
|
87
|
-
|
|
80
|
+
var Se = (e, t, n = $(e)) => n === 2 ? e.has(t) : v[Q].hasOwnProperty.call(e, t), ue = (e, t, n = $(e)) => (
|
|
81
|
+
// @ts-ignore
|
|
82
|
+
n === 2 ? e.get(t) : e[t]
|
|
83
|
+
), X = (e, t, n, r = $(e)) => {
|
|
88
84
|
r === 2 ? e.set(t, n) : r === 3 ? e.add(n) : e[t] = n;
|
|
89
|
-
}
|
|
90
|
-
function
|
|
85
|
+
};
|
|
86
|
+
function et(e, t) {
|
|
91
87
|
return e === t ? e !== 0 || 1 / e === 1 / t : e !== e && t !== t;
|
|
92
88
|
}
|
|
93
|
-
function
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
function G(e) {
|
|
97
|
-
return e instanceof Set;
|
|
98
|
-
}
|
|
99
|
-
function O(e) {
|
|
100
|
-
return e.copy_ || e.base_;
|
|
101
|
-
}
|
|
102
|
-
function L(e, t) {
|
|
103
|
-
if (A(e))
|
|
89
|
+
var Z = Array.isArray, ee = (e) => e instanceof Map, te = (e) => e instanceof Set, _e = (e) => typeof e == "object", k = (e) => typeof e == "function", ce = (e) => typeof e == "boolean", R = (e) => e.copy_ || e.base_, me = (e) => e.modified_ ? e.copy_ : e.base_;
|
|
90
|
+
function fe(e, t) {
|
|
91
|
+
if (ee(e))
|
|
104
92
|
return new Map(e);
|
|
105
|
-
if (
|
|
93
|
+
if (te(e))
|
|
106
94
|
return new Set(e);
|
|
107
|
-
if (
|
|
108
|
-
return Array.
|
|
109
|
-
const n =
|
|
95
|
+
if (Z(e))
|
|
96
|
+
return Array[Q].slice.call(e);
|
|
97
|
+
const n = Fe(e);
|
|
110
98
|
if (t === !0 || t === "class_only" && !n) {
|
|
111
|
-
const r =
|
|
112
|
-
delete r[
|
|
113
|
-
let
|
|
114
|
-
for (let
|
|
115
|
-
const c = o
|
|
116
|
-
s
|
|
117
|
-
|
|
118
|
-
|
|
99
|
+
const r = v.getOwnPropertyDescriptors(e);
|
|
100
|
+
delete r[w];
|
|
101
|
+
let i = Reflect.ownKeys(r);
|
|
102
|
+
for (let o = 0; o < i.length; o++) {
|
|
103
|
+
const c = i[o], s = r[c];
|
|
104
|
+
s[K] === !1 && (s[K] = !0, s[ae] = !0), (s.get || s.set) && (r[c] = {
|
|
105
|
+
[ae]: !0,
|
|
106
|
+
[K]: !0,
|
|
119
107
|
// could live with !!desc.set as well here...
|
|
120
|
-
|
|
121
|
-
|
|
108
|
+
[H]: s[H],
|
|
109
|
+
[A]: e[c]
|
|
122
110
|
});
|
|
123
111
|
}
|
|
124
|
-
return
|
|
112
|
+
return v.create(I(e), r);
|
|
125
113
|
} else {
|
|
126
|
-
const r =
|
|
114
|
+
const r = I(e);
|
|
127
115
|
if (r !== null && n)
|
|
128
116
|
return { ...e };
|
|
129
|
-
const
|
|
130
|
-
return
|
|
117
|
+
const i = v.create(r);
|
|
118
|
+
return v.assign(i, e);
|
|
131
119
|
}
|
|
132
120
|
}
|
|
133
|
-
function
|
|
134
|
-
return
|
|
135
|
-
set:
|
|
136
|
-
add:
|
|
137
|
-
clear:
|
|
138
|
-
delete:
|
|
139
|
-
}),
|
|
121
|
+
function ge(e, t = !1) {
|
|
122
|
+
return ne(e) || O(e) || ($(e) > 1 && v.defineProperties(e, {
|
|
123
|
+
set: U,
|
|
124
|
+
add: U,
|
|
125
|
+
clear: U,
|
|
126
|
+
delete: U
|
|
127
|
+
}), v.freeze(e), t && j(
|
|
128
|
+
e,
|
|
129
|
+
(n, r) => {
|
|
130
|
+
ge(r, !0);
|
|
131
|
+
},
|
|
132
|
+
!1
|
|
133
|
+
)), e;
|
|
140
134
|
}
|
|
141
|
-
function
|
|
135
|
+
function tt() {
|
|
142
136
|
N(2);
|
|
143
137
|
}
|
|
144
|
-
var
|
|
145
|
-
|
|
138
|
+
var U = {
|
|
139
|
+
[A]: tt
|
|
146
140
|
};
|
|
147
|
-
function
|
|
148
|
-
return e === null ||
|
|
141
|
+
function ne(e) {
|
|
142
|
+
return e === null || !_e(e) ? !0 : v.isFrozen(e);
|
|
149
143
|
}
|
|
150
|
-
var
|
|
151
|
-
function
|
|
152
|
-
const t =
|
|
144
|
+
var J = "MapSet", le = "Patches", Ae = {};
|
|
145
|
+
function M(e) {
|
|
146
|
+
const t = Ae[e];
|
|
153
147
|
return t || N(0, e), t;
|
|
154
148
|
}
|
|
155
|
-
var
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
}
|
|
170
|
-
function fe(e, t) {
|
|
171
|
-
t && (k("Patches"), e.patches_ = [], e.inversePatches_ = [], e.patchListener_ = t);
|
|
172
|
-
}
|
|
173
|
-
function ee(e) {
|
|
174
|
-
te(e), e.drafts_.forEach($e), e.drafts_ = null;
|
|
149
|
+
var nt = (e) => !!Ae[e], x, xe = () => x, rt = (e, t) => ({
|
|
150
|
+
drafts_: [],
|
|
151
|
+
parent_: e,
|
|
152
|
+
immer_: t,
|
|
153
|
+
// Whenever the modified draft contains a draft from another scope, we
|
|
154
|
+
// need to prevent auto-freezing so the unowned draft can be finalized.
|
|
155
|
+
canAutoFreeze_: !0,
|
|
156
|
+
unfinalizedDrafts_: 0,
|
|
157
|
+
handledSet_: /* @__PURE__ */ new Set(),
|
|
158
|
+
processedForPatches_: /* @__PURE__ */ new Set(),
|
|
159
|
+
mapSetPlugin_: nt(J) ? M(J) : void 0
|
|
160
|
+
});
|
|
161
|
+
function be(e, t) {
|
|
162
|
+
t && (e.patchPlugin_ = M(le), e.patches_ = [], e.inversePatches_ = [], e.patchListener_ = t);
|
|
175
163
|
}
|
|
176
|
-
function
|
|
177
|
-
e
|
|
164
|
+
function de(e) {
|
|
165
|
+
pe(e), e.drafts_.forEach(it), e.drafts_ = null;
|
|
178
166
|
}
|
|
179
|
-
function
|
|
180
|
-
|
|
167
|
+
function pe(e) {
|
|
168
|
+
e === x && (x = e.parent_);
|
|
181
169
|
}
|
|
182
|
-
|
|
183
|
-
|
|
170
|
+
var De = (e) => x = rt(x, e);
|
|
171
|
+
function it(e) {
|
|
172
|
+
const t = e[w];
|
|
184
173
|
t.type_ === 0 || t.type_ === 1 ? t.revoke_() : t.revoked_ = !0;
|
|
185
174
|
}
|
|
186
|
-
function
|
|
175
|
+
function Re(e, t) {
|
|
187
176
|
t.unfinalizedDrafts_ = t.drafts_.length;
|
|
188
177
|
const n = t.drafts_[0];
|
|
189
|
-
|
|
190
|
-
n[
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
178
|
+
if (e !== void 0 && e !== n) {
|
|
179
|
+
n[w].modified_ && (de(t), N(4)), D(e) && (e = Oe(t, e));
|
|
180
|
+
const { patchPlugin_: i } = t;
|
|
181
|
+
i && i.generateReplacementPatches_(
|
|
182
|
+
n[w].base_,
|
|
183
|
+
e,
|
|
184
|
+
t
|
|
185
|
+
);
|
|
186
|
+
} else
|
|
187
|
+
e = Oe(t, n);
|
|
188
|
+
return ot(t, e, !0), de(t), t.patches_ && t.patchListener_(t.patches_, t.inversePatches_), e !== Me ? e : void 0;
|
|
195
189
|
}
|
|
196
|
-
function
|
|
197
|
-
if (
|
|
190
|
+
function Oe(e, t) {
|
|
191
|
+
if (ne(t))
|
|
198
192
|
return t;
|
|
199
|
-
const
|
|
200
|
-
if (!
|
|
201
|
-
return
|
|
202
|
-
|
|
203
|
-
(i, c) => pe(e, o, t, i, c, n),
|
|
204
|
-
r
|
|
205
|
-
), t;
|
|
206
|
-
if (o.scope_ !== e)
|
|
193
|
+
const n = t[w];
|
|
194
|
+
if (!n)
|
|
195
|
+
return we(t, e.handledSet_, e);
|
|
196
|
+
if (!re(n, e))
|
|
207
197
|
return t;
|
|
208
|
-
if (!
|
|
209
|
-
return
|
|
210
|
-
if (!
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
(f, a) => pe(
|
|
217
|
-
e,
|
|
218
|
-
o,
|
|
219
|
-
i,
|
|
220
|
-
f,
|
|
221
|
-
a,
|
|
222
|
-
n,
|
|
223
|
-
s
|
|
224
|
-
),
|
|
225
|
-
r
|
|
226
|
-
), K(e, i, !1), n && e.patches_ && k("Patches").generatePatches_(
|
|
227
|
-
o,
|
|
228
|
-
n,
|
|
229
|
-
e.patches_,
|
|
230
|
-
e.inversePatches_
|
|
231
|
-
);
|
|
198
|
+
if (!n.modified_)
|
|
199
|
+
return n.base_;
|
|
200
|
+
if (!n.finalized_) {
|
|
201
|
+
const { callbacks_: r } = n;
|
|
202
|
+
if (r)
|
|
203
|
+
for (; r.length > 0; )
|
|
204
|
+
r.pop()(e);
|
|
205
|
+
$e(n, e);
|
|
232
206
|
}
|
|
233
|
-
return
|
|
207
|
+
return n.copy_;
|
|
208
|
+
}
|
|
209
|
+
function ot(e, t, n = !1) {
|
|
210
|
+
!e.parent_ && e.immer_.autoFreeze_ && e.canAutoFreeze_ && ge(t, n);
|
|
234
211
|
}
|
|
235
|
-
function
|
|
236
|
-
|
|
212
|
+
function Ve(e) {
|
|
213
|
+
e.finalized_ = !0, e.scope_.unfinalizedDrafts_--;
|
|
214
|
+
}
|
|
215
|
+
var re = (e, t) => e.scope_ === t, ct = [];
|
|
216
|
+
function je(e, t, n, r) {
|
|
217
|
+
const i = R(e), o = e.type_;
|
|
218
|
+
if (r !== void 0 && ue(i, r, o) === t) {
|
|
219
|
+
X(i, r, n, o);
|
|
237
220
|
return;
|
|
238
|
-
|
|
239
|
-
if (!
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
221
|
+
}
|
|
222
|
+
if (!e.draftLocations_) {
|
|
223
|
+
const s = e.draftLocations_ = /* @__PURE__ */ new Map();
|
|
224
|
+
j(i, (f, u) => {
|
|
225
|
+
if (O(u)) {
|
|
226
|
+
const a = s.get(u) || [];
|
|
227
|
+
a.push(f), s.set(u, a);
|
|
228
|
+
}
|
|
229
|
+
});
|
|
230
|
+
}
|
|
231
|
+
const c = e.draftLocations_.get(t) ?? ct;
|
|
232
|
+
for (const s of c)
|
|
233
|
+
X(i, s, n, o);
|
|
234
|
+
}
|
|
235
|
+
function st(e, t, n) {
|
|
236
|
+
e.callbacks_.push(function(i) {
|
|
237
|
+
const o = t;
|
|
238
|
+
if (!o || !re(o, i))
|
|
239
|
+
return;
|
|
240
|
+
i.mapSetPlugin_?.fixSetContents(o);
|
|
241
|
+
const c = me(o);
|
|
242
|
+
je(e, o.draft_ ?? o, c, n), $e(o, i);
|
|
243
|
+
});
|
|
244
|
+
}
|
|
245
|
+
function $e(e, t) {
|
|
246
|
+
if (e.modified_ && !e.finalized_ && (e.type_ === 3 || (e.assigned_?.size ?? 0) > 0)) {
|
|
247
|
+
const { patchPlugin_: r } = t;
|
|
248
|
+
if (r) {
|
|
249
|
+
const i = r.getPath(e);
|
|
250
|
+
i && r.generatePatches_(e, i, t);
|
|
252
251
|
}
|
|
252
|
+
Ve(e);
|
|
253
253
|
}
|
|
254
254
|
}
|
|
255
|
-
function
|
|
256
|
-
|
|
255
|
+
function at(e, t, n) {
|
|
256
|
+
const { scope_: r } = e;
|
|
257
|
+
if (O(n)) {
|
|
258
|
+
const i = n[w];
|
|
259
|
+
re(i, r) && i.callbacks_.push(function() {
|
|
260
|
+
Y(e);
|
|
261
|
+
const c = me(i);
|
|
262
|
+
je(e, n, c, t);
|
|
263
|
+
});
|
|
264
|
+
} else D(n) && e.callbacks_.push(function() {
|
|
265
|
+
const o = R(e);
|
|
266
|
+
ue(o, t, e.type_) === n && r.drafts_.length > 1 && (e.assigned_.get(t) ?? !1) === !0 && e.copy_ && we(
|
|
267
|
+
ue(e.copy_, t, e.type_),
|
|
268
|
+
r.handledSet_,
|
|
269
|
+
r
|
|
270
|
+
);
|
|
271
|
+
});
|
|
272
|
+
}
|
|
273
|
+
function we(e, t, n) {
|
|
274
|
+
return !n.immer_.autoFreeze_ && n.unfinalizedDrafts_ < 1 || O(e) || t.has(e) || !D(e) || ne(e) || (t.add(e), j(e, (r, i) => {
|
|
275
|
+
if (O(i)) {
|
|
276
|
+
const o = i[w];
|
|
277
|
+
if (re(o, n)) {
|
|
278
|
+
const c = me(o);
|
|
279
|
+
X(e, r, c, e.type_), Ve(o);
|
|
280
|
+
}
|
|
281
|
+
} else D(i) && we(i, t, n);
|
|
282
|
+
})), e;
|
|
257
283
|
}
|
|
258
|
-
function
|
|
259
|
-
const n =
|
|
284
|
+
function ut(e, t) {
|
|
285
|
+
const n = Z(e), r = {
|
|
260
286
|
type_: n ? 1 : 0,
|
|
261
287
|
// Track which produce call this is associated with.
|
|
262
|
-
scope_: t ? t.scope_ :
|
|
288
|
+
scope_: t ? t.scope_ : xe(),
|
|
263
289
|
// True for both shallow and deep changes.
|
|
264
290
|
modified_: !1,
|
|
265
291
|
// Used during finalization.
|
|
266
292
|
finalized_: !1,
|
|
267
293
|
// Track which properties have been assigned (true) or deleted (false).
|
|
268
|
-
|
|
294
|
+
// actually instantiated in `prepareCopy()`
|
|
295
|
+
assigned_: void 0,
|
|
269
296
|
// The parent draft state.
|
|
270
297
|
parent_: t,
|
|
271
298
|
// The base state.
|
|
@@ -277,161 +304,174 @@ function We(e, t) {
|
|
|
277
304
|
copy_: null,
|
|
278
305
|
// Called by the `produce` function.
|
|
279
306
|
revoke_: null,
|
|
280
|
-
isManual_: !1
|
|
307
|
+
isManual_: !1,
|
|
308
|
+
// `callbacks` actually gets assigned in `createProxy`
|
|
309
|
+
callbacks_: void 0
|
|
281
310
|
};
|
|
282
|
-
let
|
|
283
|
-
n && (
|
|
284
|
-
const { revoke: c, proxy: s } = Proxy.revocable(
|
|
285
|
-
return r.draft_ = s, r.revoke_ = c, s;
|
|
311
|
+
let i = r, o = Ee;
|
|
312
|
+
n && (i = [r], o = V);
|
|
313
|
+
const { revoke: c, proxy: s } = Proxy.revocable(i, o);
|
|
314
|
+
return r.draft_ = s, r.revoke_ = c, [s, r];
|
|
286
315
|
}
|
|
287
|
-
var
|
|
316
|
+
var Ee = {
|
|
288
317
|
get(e, t) {
|
|
289
|
-
if (t ===
|
|
318
|
+
if (t === w)
|
|
290
319
|
return e;
|
|
291
|
-
const n =
|
|
292
|
-
if (!
|
|
293
|
-
return
|
|
320
|
+
const n = R(e);
|
|
321
|
+
if (!Se(n, t, e.type_))
|
|
322
|
+
return ft(e, n, t);
|
|
294
323
|
const r = n[t];
|
|
295
|
-
|
|
324
|
+
if (e.finalized_ || !D(r))
|
|
325
|
+
return r;
|
|
326
|
+
if (r === se(e.base_, t)) {
|
|
327
|
+
Y(e);
|
|
328
|
+
const i = e.type_ === 1 ? +t : t, o = ye(e.scope_, r, e, i);
|
|
329
|
+
return e.copy_[i] = o;
|
|
330
|
+
}
|
|
331
|
+
return r;
|
|
296
332
|
},
|
|
297
333
|
has(e, t) {
|
|
298
|
-
return t in
|
|
334
|
+
return t in R(e);
|
|
299
335
|
},
|
|
300
336
|
ownKeys(e) {
|
|
301
|
-
return Reflect.ownKeys(
|
|
337
|
+
return Reflect.ownKeys(R(e));
|
|
302
338
|
},
|
|
303
339
|
set(e, t, n) {
|
|
304
|
-
const r =
|
|
340
|
+
const r = Be(R(e), t);
|
|
305
341
|
if (r?.set)
|
|
306
342
|
return r.set.call(e.draft_, n), !0;
|
|
307
343
|
if (!e.modified_) {
|
|
308
|
-
const
|
|
309
|
-
if (
|
|
310
|
-
return e.copy_[t] = n, e.assigned_
|
|
311
|
-
if (
|
|
344
|
+
const i = se(R(e), t), o = i?.[w];
|
|
345
|
+
if (o && o.base_ === n)
|
|
346
|
+
return e.copy_[t] = n, e.assigned_.set(t, !1), !0;
|
|
347
|
+
if (et(n, i) && (n !== void 0 || Se(e.base_, t, e.type_)))
|
|
312
348
|
return !0;
|
|
313
|
-
|
|
349
|
+
Y(e), he(e);
|
|
314
350
|
}
|
|
315
351
|
return e.copy_[t] === n && // special case: handle new props with value 'undefined'
|
|
316
352
|
(n !== void 0 || t in e.copy_) || // special case: NaN
|
|
317
|
-
Number.isNaN(n) && Number.isNaN(e.copy_[t]) || (e.copy_[t] = n, e.assigned_
|
|
353
|
+
Number.isNaN(n) && Number.isNaN(e.copy_[t]) || (e.copy_[t] = n, e.assigned_.set(t, !0), at(e, t, n)), !0;
|
|
318
354
|
},
|
|
319
355
|
deleteProperty(e, t) {
|
|
320
|
-
return
|
|
356
|
+
return Y(e), se(e.base_, t) !== void 0 || t in e.base_ ? (e.assigned_.set(t, !1), he(e)) : e.assigned_.delete(t), e.copy_ && delete e.copy_[t], !0;
|
|
321
357
|
},
|
|
322
358
|
// Note: We never coerce `desc.value` into an Immer draft, because we can't make
|
|
323
359
|
// the same guarantee in ES5 mode.
|
|
324
360
|
getOwnPropertyDescriptor(e, t) {
|
|
325
|
-
const n =
|
|
361
|
+
const n = R(e), r = Reflect.getOwnPropertyDescriptor(n, t);
|
|
326
362
|
return r && {
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
363
|
+
[K]: !0,
|
|
364
|
+
[ae]: e.type_ !== 1 || t !== "length",
|
|
365
|
+
[H]: r[H],
|
|
366
|
+
[A]: n[t]
|
|
331
367
|
};
|
|
332
368
|
},
|
|
333
369
|
defineProperty() {
|
|
334
370
|
N(11);
|
|
335
371
|
},
|
|
336
372
|
getPrototypeOf(e) {
|
|
337
|
-
return
|
|
373
|
+
return I(e.base_);
|
|
338
374
|
},
|
|
339
375
|
setPrototypeOf() {
|
|
340
376
|
N(12);
|
|
341
377
|
}
|
|
342
|
-
},
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
378
|
+
}, V = {};
|
|
379
|
+
j(Ee, (e, t) => {
|
|
380
|
+
V[e] = function() {
|
|
381
|
+
const n = arguments;
|
|
382
|
+
return n[0] = n[0][0], t.apply(this, n);
|
|
346
383
|
};
|
|
347
384
|
});
|
|
348
|
-
|
|
349
|
-
return process.env.NODE_ENV !== "production" && isNaN(parseInt(t)) && N(13),
|
|
385
|
+
V.deleteProperty = function(e, t) {
|
|
386
|
+
return process.env.NODE_ENV !== "production" && isNaN(parseInt(t)) && N(13), V.set.call(this, e, t, void 0);
|
|
350
387
|
};
|
|
351
|
-
|
|
352
|
-
return process.env.NODE_ENV !== "production" && t !== "length" && isNaN(parseInt(t)) && N(14),
|
|
388
|
+
V.set = function(e, t, n) {
|
|
389
|
+
return process.env.NODE_ENV !== "production" && t !== "length" && isNaN(parseInt(t)) && N(14), Ee.set.call(this, e[0], t, n, e[0]);
|
|
353
390
|
};
|
|
354
|
-
function
|
|
355
|
-
const n = e[
|
|
356
|
-
return (n ?
|
|
391
|
+
function se(e, t) {
|
|
392
|
+
const n = e[w];
|
|
393
|
+
return (n ? R(n) : e)[t];
|
|
357
394
|
}
|
|
358
|
-
function
|
|
359
|
-
const r =
|
|
360
|
-
return r ?
|
|
395
|
+
function ft(e, t, n) {
|
|
396
|
+
const r = Be(t, n);
|
|
397
|
+
return r ? A in r ? r[A] : (
|
|
361
398
|
// This is a very special case, if the prop is a getter defined by the
|
|
362
399
|
// prototype, we should invoke it with the draft as context!
|
|
363
400
|
r.get?.call(e.draft_)
|
|
364
401
|
) : void 0;
|
|
365
402
|
}
|
|
366
|
-
function
|
|
403
|
+
function Be(e, t) {
|
|
367
404
|
if (!(t in e))
|
|
368
405
|
return;
|
|
369
|
-
let n =
|
|
406
|
+
let n = I(e);
|
|
370
407
|
for (; n; ) {
|
|
371
408
|
const r = Object.getOwnPropertyDescriptor(n, t);
|
|
372
409
|
if (r)
|
|
373
410
|
return r;
|
|
374
|
-
n =
|
|
411
|
+
n = I(n);
|
|
375
412
|
}
|
|
376
413
|
}
|
|
377
|
-
function
|
|
378
|
-
e.modified_ || (e.modified_ = !0, e.parent_ &&
|
|
414
|
+
function he(e) {
|
|
415
|
+
e.modified_ || (e.modified_ = !0, e.parent_ && he(e.parent_));
|
|
379
416
|
}
|
|
380
|
-
function
|
|
381
|
-
e.copy_ || (e.copy_ =
|
|
417
|
+
function Y(e) {
|
|
418
|
+
e.copy_ || (e.assigned_ = /* @__PURE__ */ new Map(), e.copy_ = fe(
|
|
382
419
|
e.base_,
|
|
383
420
|
e.scope_.immer_.useStrictShallowCopy_
|
|
384
421
|
));
|
|
385
422
|
}
|
|
386
|
-
var
|
|
423
|
+
var lt = class {
|
|
387
424
|
constructor(e) {
|
|
388
|
-
this.autoFreeze_ = !0, this.useStrictShallowCopy_ = !1, this.useStrictIteration_ = !
|
|
389
|
-
if (
|
|
390
|
-
const
|
|
425
|
+
this.autoFreeze_ = !0, this.useStrictShallowCopy_ = !1, this.useStrictIteration_ = !1, this.produce = (t, n, r) => {
|
|
426
|
+
if (k(t) && !k(n)) {
|
|
427
|
+
const o = n;
|
|
391
428
|
n = t;
|
|
392
429
|
const c = this;
|
|
393
|
-
return function(f =
|
|
394
|
-
return c.produce(f, (
|
|
430
|
+
return function(f = o, ...u) {
|
|
431
|
+
return c.produce(f, (a) => n.call(this, a, ...u));
|
|
395
432
|
};
|
|
396
433
|
}
|
|
397
|
-
|
|
398
|
-
let
|
|
399
|
-
if (
|
|
400
|
-
const
|
|
434
|
+
k(n) || N(6), r !== void 0 && !k(r) && N(7);
|
|
435
|
+
let i;
|
|
436
|
+
if (D(t)) {
|
|
437
|
+
const o = De(this), c = ye(o, t, void 0);
|
|
401
438
|
let s = !0;
|
|
402
439
|
try {
|
|
403
|
-
|
|
440
|
+
i = n(c), s = !1;
|
|
404
441
|
} finally {
|
|
405
|
-
s ?
|
|
442
|
+
s ? de(o) : pe(o);
|
|
406
443
|
}
|
|
407
|
-
return
|
|
408
|
-
} else if (!t ||
|
|
409
|
-
if (
|
|
410
|
-
const
|
|
411
|
-
|
|
444
|
+
return be(o, r), Re(i, o);
|
|
445
|
+
} else if (!t || !_e(t)) {
|
|
446
|
+
if (i = n(t), i === void 0 && (i = t), i === Me && (i = void 0), this.autoFreeze_ && ge(i, !0), r) {
|
|
447
|
+
const o = [], c = [];
|
|
448
|
+
M(le).generateReplacementPatches_(t, i, {
|
|
449
|
+
patches_: o,
|
|
450
|
+
inversePatches_: c
|
|
451
|
+
}), r(o, c);
|
|
412
452
|
}
|
|
413
|
-
return
|
|
453
|
+
return i;
|
|
414
454
|
} else
|
|
415
455
|
N(1, t);
|
|
416
456
|
}, this.produceWithPatches = (t, n) => {
|
|
417
|
-
if (
|
|
457
|
+
if (k(t))
|
|
418
458
|
return (c, ...s) => this.produceWithPatches(c, (f) => t(f, ...s));
|
|
419
|
-
let r,
|
|
459
|
+
let r, i;
|
|
420
460
|
return [this.produce(t, n, (c, s) => {
|
|
421
|
-
r = c,
|
|
422
|
-
}), r,
|
|
423
|
-
},
|
|
461
|
+
r = c, i = s;
|
|
462
|
+
}), r, i];
|
|
463
|
+
}, ce(e?.autoFreeze) && this.setAutoFreeze(e.autoFreeze), ce(e?.useStrictShallowCopy) && this.setUseStrictShallowCopy(e.useStrictShallowCopy), ce(e?.useStrictIteration) && this.setUseStrictIteration(e.useStrictIteration);
|
|
424
464
|
}
|
|
425
465
|
createDraft(e) {
|
|
426
|
-
|
|
427
|
-
const t =
|
|
428
|
-
return n[
|
|
466
|
+
D(e) || N(8), O(e) && (e = dt(e));
|
|
467
|
+
const t = De(this), n = ye(t, e, void 0);
|
|
468
|
+
return n[w].isManual_ = !0, pe(t), n;
|
|
429
469
|
}
|
|
430
470
|
finishDraft(e, t) {
|
|
431
|
-
const n = e && e[
|
|
471
|
+
const n = e && e[w];
|
|
432
472
|
(!n || !n.isManual_) && N(9);
|
|
433
473
|
const { scope_: r } = n;
|
|
434
|
-
return
|
|
474
|
+
return be(r, t), Re(void 0, r);
|
|
435
475
|
}
|
|
436
476
|
/**
|
|
437
477
|
* Pass true to automatically freeze all copies created by Immer.
|
|
@@ -464,80 +504,82 @@ var Ue = class {
|
|
|
464
504
|
applyPatches(e, t) {
|
|
465
505
|
let n;
|
|
466
506
|
for (n = t.length - 1; n >= 0; n--) {
|
|
467
|
-
const
|
|
468
|
-
if (
|
|
469
|
-
e =
|
|
507
|
+
const i = t[n];
|
|
508
|
+
if (i.path.length === 0 && i.op === "replace") {
|
|
509
|
+
e = i.value;
|
|
470
510
|
break;
|
|
471
511
|
}
|
|
472
512
|
}
|
|
473
513
|
n > -1 && (t = t.slice(n + 1));
|
|
474
|
-
const r =
|
|
475
|
-
return
|
|
514
|
+
const r = M(le).applyPatches_;
|
|
515
|
+
return O(e) ? r(e, t) : this.produce(
|
|
476
516
|
e,
|
|
477
|
-
(
|
|
517
|
+
(i) => r(i, t)
|
|
478
518
|
);
|
|
479
519
|
}
|
|
480
520
|
};
|
|
481
|
-
function
|
|
482
|
-
const
|
|
483
|
-
return (
|
|
521
|
+
function ye(e, t, n, r) {
|
|
522
|
+
const [i, o] = ee(t) ? M(J).proxyMap_(t, n) : te(t) ? M(J).proxySet_(t, n) : ut(t, n);
|
|
523
|
+
return (n?.scope_ ?? xe()).drafts_.push(i), o.callbacks_ = n?.callbacks_ ?? [], o.key_ = r, n && r !== void 0 ? st(n, o, r) : o.callbacks_.push(function(f) {
|
|
524
|
+
f.mapSetPlugin_?.fixSetContents(o);
|
|
525
|
+
const { patchPlugin_: u } = f;
|
|
526
|
+
o.modified_ && u && u.generatePatches_(o, [], f);
|
|
527
|
+
}), i;
|
|
484
528
|
}
|
|
485
|
-
function
|
|
486
|
-
return
|
|
529
|
+
function dt(e) {
|
|
530
|
+
return O(e) || N(10, e), Ue(e);
|
|
487
531
|
}
|
|
488
|
-
function
|
|
489
|
-
if (!
|
|
532
|
+
function Ue(e) {
|
|
533
|
+
if (!D(e) || ne(e))
|
|
490
534
|
return e;
|
|
491
|
-
const t = e[
|
|
535
|
+
const t = e[w];
|
|
492
536
|
let n, r = !0;
|
|
493
537
|
if (t) {
|
|
494
538
|
if (!t.modified_)
|
|
495
539
|
return t.base_;
|
|
496
|
-
t.finalized_ = !0, n =
|
|
540
|
+
t.finalized_ = !0, n = fe(e, t.scope_.immer_.useStrictShallowCopy_), r = t.scope_.immer_.shouldUseStrictIteration();
|
|
497
541
|
} else
|
|
498
|
-
n =
|
|
499
|
-
return
|
|
542
|
+
n = fe(e, !0);
|
|
543
|
+
return j(
|
|
500
544
|
n,
|
|
501
|
-
(
|
|
502
|
-
|
|
545
|
+
(i, o) => {
|
|
546
|
+
X(n, i, Ue(o));
|
|
503
547
|
},
|
|
504
548
|
r
|
|
505
549
|
), t && (t.finalized_ = !1), n;
|
|
506
550
|
}
|
|
507
|
-
var
|
|
508
|
-
oe
|
|
509
|
-
), Ge = (e, t, n) => {
|
|
551
|
+
var pt = new lt(), We = pt.produce, ht = (e, t, n) => {
|
|
510
552
|
if (t.length === 1 && t[0] === n) {
|
|
511
553
|
let r = !1;
|
|
512
554
|
try {
|
|
513
|
-
const
|
|
514
|
-
e(
|
|
555
|
+
const i = {};
|
|
556
|
+
e(i) === i && (r = !0);
|
|
515
557
|
} catch {
|
|
516
558
|
}
|
|
517
559
|
if (r) {
|
|
518
|
-
let
|
|
560
|
+
let i;
|
|
519
561
|
try {
|
|
520
562
|
throw new Error();
|
|
521
|
-
} catch (
|
|
522
|
-
({ stack:
|
|
563
|
+
} catch (o) {
|
|
564
|
+
({ stack: i } = o);
|
|
523
565
|
}
|
|
524
566
|
console.warn(
|
|
525
567
|
`The result function returned its own inputs without modification. e.g
|
|
526
568
|
\`createSelector([state => state.todos], todos => todos)\`
|
|
527
569
|
This could lead to inefficient memoization and unnecessary re-renders.
|
|
528
570
|
Ensure transformation logic is in the result function, and extraction logic is in the input selectors.`,
|
|
529
|
-
{ stack:
|
|
571
|
+
{ stack: i }
|
|
530
572
|
);
|
|
531
573
|
}
|
|
532
574
|
}
|
|
533
|
-
},
|
|
534
|
-
const { memoize: r, memoizeOptions:
|
|
535
|
-
if (!(s.apply(null,
|
|
536
|
-
let
|
|
575
|
+
}, yt = (e, t, n) => {
|
|
576
|
+
const { memoize: r, memoizeOptions: i } = t, { inputSelectorResults: o, inputSelectorResultsCopy: c } = e, s = r(() => ({}), ...i);
|
|
577
|
+
if (!(s.apply(null, o) === s.apply(null, c))) {
|
|
578
|
+
let u;
|
|
537
579
|
try {
|
|
538
580
|
throw new Error();
|
|
539
|
-
} catch (
|
|
540
|
-
({ stack:
|
|
581
|
+
} catch (a) {
|
|
582
|
+
({ stack: u } = a);
|
|
541
583
|
}
|
|
542
584
|
console.warn(
|
|
543
585
|
`An input selector returned a different result when passed same arguments.
|
|
@@ -546,25 +588,25 @@ Avoid returning a new reference inside your input selector, e.g.
|
|
|
546
588
|
\`createSelector([state => state.todos.map(todo => todo.id)], todoIds => todoIds.length)\``,
|
|
547
589
|
{
|
|
548
590
|
arguments: n,
|
|
549
|
-
firstInputs:
|
|
591
|
+
firstInputs: o,
|
|
550
592
|
secondInputs: c,
|
|
551
|
-
stack:
|
|
593
|
+
stack: u
|
|
552
594
|
}
|
|
553
595
|
);
|
|
554
596
|
}
|
|
555
|
-
},
|
|
597
|
+
}, _t = {
|
|
556
598
|
inputStabilityCheck: "once",
|
|
557
599
|
identityFunctionCheck: "once"
|
|
558
600
|
};
|
|
559
|
-
function
|
|
601
|
+
function mt(e, t = `expected a function, instead received ${typeof e}`) {
|
|
560
602
|
if (typeof e != "function")
|
|
561
603
|
throw new TypeError(t);
|
|
562
604
|
}
|
|
563
|
-
function
|
|
605
|
+
function gt(e, t = `expected an object, instead received ${typeof e}`) {
|
|
564
606
|
if (typeof e != "object")
|
|
565
607
|
throw new TypeError(t);
|
|
566
608
|
}
|
|
567
|
-
function
|
|
609
|
+
function wt(e, t = "expected all items to be functions, instead received the following types: ") {
|
|
568
610
|
if (!e.every((n) => typeof n == "function")) {
|
|
569
611
|
const n = e.map(
|
|
570
612
|
(r) => typeof r == "function" ? `function ${r.name || "unnamed"}()` : typeof r
|
|
@@ -572,153 +614,153 @@ function Qe(e, t = "expected all items to be functions, instead received the fol
|
|
|
572
614
|
throw new TypeError(`${t}[${n}]`);
|
|
573
615
|
}
|
|
574
616
|
}
|
|
575
|
-
var
|
|
576
|
-
function
|
|
617
|
+
var Pe = (e) => Array.isArray(e) ? e : [e];
|
|
618
|
+
function Et(e) {
|
|
577
619
|
const t = Array.isArray(e[0]) ? e[0] : e;
|
|
578
|
-
return
|
|
620
|
+
return wt(
|
|
579
621
|
t,
|
|
580
622
|
"createSelector expects all input-selectors to be functions, but received the following types: "
|
|
581
623
|
), t;
|
|
582
624
|
}
|
|
583
|
-
function
|
|
625
|
+
function ke(e, t) {
|
|
584
626
|
const n = [], { length: r } = e;
|
|
585
|
-
for (let
|
|
586
|
-
n.push(e[
|
|
627
|
+
for (let i = 0; i < r; i++)
|
|
628
|
+
n.push(e[i].apply(null, t));
|
|
587
629
|
return n;
|
|
588
630
|
}
|
|
589
|
-
var
|
|
631
|
+
var Nt = (e, t) => {
|
|
590
632
|
const { identityFunctionCheck: n, inputStabilityCheck: r } = {
|
|
591
|
-
...
|
|
633
|
+
..._t,
|
|
592
634
|
...t
|
|
593
635
|
};
|
|
594
636
|
return {
|
|
595
637
|
identityFunctionCheck: {
|
|
596
638
|
shouldRun: n === "always" || n === "once" && e,
|
|
597
|
-
run:
|
|
639
|
+
run: ht
|
|
598
640
|
},
|
|
599
641
|
inputStabilityCheck: {
|
|
600
642
|
shouldRun: r === "always" || r === "once" && e,
|
|
601
|
-
run:
|
|
643
|
+
run: yt
|
|
602
644
|
}
|
|
603
645
|
};
|
|
604
|
-
},
|
|
646
|
+
}, vt = class {
|
|
605
647
|
constructor(e) {
|
|
606
648
|
this.value = e;
|
|
607
649
|
}
|
|
608
650
|
deref() {
|
|
609
651
|
return this.value;
|
|
610
652
|
}
|
|
611
|
-
},
|
|
612
|
-
function
|
|
653
|
+
}, Ct = typeof WeakRef < "u" ? WeakRef : vt, St = 0, Te = 1;
|
|
654
|
+
function W() {
|
|
613
655
|
return {
|
|
614
|
-
s:
|
|
656
|
+
s: St,
|
|
615
657
|
v: void 0,
|
|
616
658
|
o: null,
|
|
617
659
|
p: null
|
|
618
660
|
};
|
|
619
661
|
}
|
|
620
|
-
function
|
|
621
|
-
let n =
|
|
662
|
+
function Le(e, t = {}) {
|
|
663
|
+
let n = W();
|
|
622
664
|
const { resultEqualityCheck: r } = t;
|
|
623
|
-
let
|
|
665
|
+
let i, o = 0;
|
|
624
666
|
function c() {
|
|
625
667
|
let s = n;
|
|
626
668
|
const { length: f } = arguments;
|
|
627
|
-
for (let p = 0,
|
|
669
|
+
for (let p = 0, C = f; p < C; p++) {
|
|
628
670
|
const g = arguments[p];
|
|
629
671
|
if (typeof g == "function" || typeof g == "object" && g !== null) {
|
|
630
|
-
let
|
|
631
|
-
|
|
632
|
-
const
|
|
633
|
-
|
|
672
|
+
let h = s.o;
|
|
673
|
+
h === null && (s.o = h = /* @__PURE__ */ new WeakMap());
|
|
674
|
+
const S = h.get(g);
|
|
675
|
+
S === void 0 ? (s = W(), h.set(g, s)) : s = S;
|
|
634
676
|
} else {
|
|
635
|
-
let
|
|
636
|
-
|
|
637
|
-
const
|
|
638
|
-
|
|
677
|
+
let h = s.p;
|
|
678
|
+
h === null && (s.p = h = /* @__PURE__ */ new Map());
|
|
679
|
+
const S = h.get(g);
|
|
680
|
+
S === void 0 ? (s = W(), h.set(g, s)) : s = S;
|
|
639
681
|
}
|
|
640
682
|
}
|
|
641
|
-
const
|
|
642
|
-
let
|
|
643
|
-
if (s.s ===
|
|
644
|
-
|
|
645
|
-
else if (
|
|
646
|
-
const p =
|
|
647
|
-
p != null && r(p,
|
|
683
|
+
const u = s;
|
|
684
|
+
let a;
|
|
685
|
+
if (s.s === Te)
|
|
686
|
+
a = s.v;
|
|
687
|
+
else if (a = e.apply(null, arguments), o++, r) {
|
|
688
|
+
const p = i?.deref?.() ?? i;
|
|
689
|
+
p != null && r(p, a) && (a = p, o !== 0 && o--), i = typeof a == "object" && a !== null || typeof a == "function" ? new Ct(a) : a;
|
|
648
690
|
}
|
|
649
|
-
return
|
|
691
|
+
return u.s = Te, u.v = a, a;
|
|
650
692
|
}
|
|
651
693
|
return c.clearCache = () => {
|
|
652
|
-
n =
|
|
653
|
-
}, c.resultsCount = () =>
|
|
654
|
-
|
|
694
|
+
n = W(), c.resetResultsCount();
|
|
695
|
+
}, c.resultsCount = () => o, c.resetResultsCount = () => {
|
|
696
|
+
o = 0;
|
|
655
697
|
}, c;
|
|
656
698
|
}
|
|
657
|
-
function
|
|
699
|
+
function bt(e, ...t) {
|
|
658
700
|
const n = typeof e == "function" ? {
|
|
659
701
|
memoize: e,
|
|
660
702
|
memoizeOptions: t
|
|
661
|
-
} : e, r = (...
|
|
662
|
-
let
|
|
663
|
-
typeof
|
|
664
|
-
|
|
665
|
-
`createSelector expects an output function after the inputs, but received: [${typeof
|
|
703
|
+
} : e, r = (...i) => {
|
|
704
|
+
let o = 0, c = 0, s, f = {}, u = i.pop();
|
|
705
|
+
typeof u == "object" && (f = u, u = i.pop()), mt(
|
|
706
|
+
u,
|
|
707
|
+
`createSelector expects an output function after the inputs, but received: [${typeof u}]`
|
|
666
708
|
);
|
|
667
|
-
const
|
|
709
|
+
const a = {
|
|
668
710
|
...n,
|
|
669
711
|
...f
|
|
670
712
|
}, {
|
|
671
713
|
memoize: p,
|
|
672
|
-
memoizeOptions:
|
|
673
|
-
argsMemoize: g =
|
|
674
|
-
argsMemoizeOptions:
|
|
675
|
-
devModeChecks:
|
|
676
|
-
} =
|
|
677
|
-
return
|
|
714
|
+
memoizeOptions: C = [],
|
|
715
|
+
argsMemoize: g = Le,
|
|
716
|
+
argsMemoizeOptions: h = [],
|
|
717
|
+
devModeChecks: S = {}
|
|
718
|
+
} = a, T = Pe(C), B = Pe(h), z = Et(i), l = p(function() {
|
|
719
|
+
return o++, u.apply(
|
|
678
720
|
null,
|
|
679
721
|
arguments
|
|
680
722
|
);
|
|
681
|
-
}, ...
|
|
723
|
+
}, ...T);
|
|
682
724
|
let d = !0;
|
|
683
|
-
const
|
|
725
|
+
const y = g(function() {
|
|
684
726
|
c++;
|
|
685
|
-
const
|
|
686
|
-
|
|
727
|
+
const E = ke(
|
|
728
|
+
z,
|
|
687
729
|
arguments
|
|
688
730
|
);
|
|
689
|
-
if (s = l.apply(null,
|
|
690
|
-
const { identityFunctionCheck:
|
|
691
|
-
if (
|
|
692
|
-
|
|
693
|
-
|
|
731
|
+
if (s = l.apply(null, E), process.env.NODE_ENV !== "production") {
|
|
732
|
+
const { identityFunctionCheck: _, inputStabilityCheck: F } = Nt(d, S);
|
|
733
|
+
if (_.shouldRun && _.run(
|
|
734
|
+
u,
|
|
735
|
+
E,
|
|
694
736
|
s
|
|
695
|
-
),
|
|
696
|
-
const
|
|
697
|
-
|
|
737
|
+
), F.shouldRun) {
|
|
738
|
+
const oe = ke(
|
|
739
|
+
z,
|
|
698
740
|
arguments
|
|
699
741
|
);
|
|
700
|
-
|
|
701
|
-
{ inputSelectorResults:
|
|
702
|
-
{ memoize: p, memoizeOptions:
|
|
742
|
+
F.run(
|
|
743
|
+
{ inputSelectorResults: E, inputSelectorResultsCopy: oe },
|
|
744
|
+
{ memoize: p, memoizeOptions: T },
|
|
703
745
|
arguments
|
|
704
746
|
);
|
|
705
747
|
}
|
|
706
748
|
d && (d = !1);
|
|
707
749
|
}
|
|
708
750
|
return s;
|
|
709
|
-
}, ...
|
|
710
|
-
return Object.assign(
|
|
711
|
-
resultFunc:
|
|
751
|
+
}, ...B);
|
|
752
|
+
return Object.assign(y, {
|
|
753
|
+
resultFunc: u,
|
|
712
754
|
memoizedResultFunc: l,
|
|
713
|
-
dependencies:
|
|
755
|
+
dependencies: z,
|
|
714
756
|
dependencyRecomputations: () => c,
|
|
715
757
|
resetDependencyRecomputations: () => {
|
|
716
758
|
c = 0;
|
|
717
759
|
},
|
|
718
760
|
lastResult: () => s,
|
|
719
|
-
recomputations: () =>
|
|
761
|
+
recomputations: () => o,
|
|
720
762
|
resetRecomputations: () => {
|
|
721
|
-
|
|
763
|
+
o = 0;
|
|
722
764
|
},
|
|
723
765
|
memoize: p,
|
|
724
766
|
argsMemoize: g
|
|
@@ -728,36 +770,36 @@ function rt(e, ...t) {
|
|
|
728
770
|
withTypes: () => r
|
|
729
771
|
}), r;
|
|
730
772
|
}
|
|
731
|
-
var
|
|
732
|
-
(e, t =
|
|
733
|
-
|
|
773
|
+
var P = /* @__PURE__ */ bt(Le), Dt = Object.assign(
|
|
774
|
+
(e, t = P) => {
|
|
775
|
+
gt(
|
|
734
776
|
e,
|
|
735
777
|
`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`
|
|
736
778
|
);
|
|
737
779
|
const n = Object.keys(e), r = n.map(
|
|
738
|
-
(
|
|
780
|
+
(o) => e[o]
|
|
739
781
|
);
|
|
740
782
|
return t(
|
|
741
783
|
r,
|
|
742
|
-
(...
|
|
784
|
+
(...o) => o.reduce((c, s, f) => (c[n[f]] = s, c), {})
|
|
743
785
|
);
|
|
744
786
|
},
|
|
745
|
-
{ withTypes: () =>
|
|
787
|
+
{ withTypes: () => Dt }
|
|
746
788
|
);
|
|
747
|
-
function
|
|
789
|
+
function ze(e, t) {
|
|
748
790
|
function n(...r) {
|
|
749
791
|
if (t) {
|
|
750
|
-
let
|
|
751
|
-
if (!
|
|
752
|
-
throw new Error(process.env.NODE_ENV === "production" ?
|
|
792
|
+
let i = t(...r);
|
|
793
|
+
if (!i)
|
|
794
|
+
throw new Error(process.env.NODE_ENV === "production" ? m(0) : "prepareAction did not return an object");
|
|
753
795
|
return {
|
|
754
796
|
type: e,
|
|
755
|
-
payload:
|
|
756
|
-
..."meta" in
|
|
757
|
-
meta:
|
|
797
|
+
payload: i.payload,
|
|
798
|
+
..."meta" in i && {
|
|
799
|
+
meta: i.meta
|
|
758
800
|
},
|
|
759
|
-
..."error" in
|
|
760
|
-
error:
|
|
801
|
+
..."error" in i && {
|
|
802
|
+
error: i.error
|
|
761
803
|
}
|
|
762
804
|
};
|
|
763
805
|
}
|
|
@@ -766,244 +808,243 @@ function _e(e, t) {
|
|
|
766
808
|
payload: r[0]
|
|
767
809
|
};
|
|
768
810
|
}
|
|
769
|
-
return n.toString = () => `${e}`, n.type = e, n.match = (r) =>
|
|
811
|
+
return n.toString = () => `${e}`, n.type = e, n.match = (r) => Je(r) && r.type === e, n;
|
|
770
812
|
}
|
|
771
|
-
function
|
|
772
|
-
return
|
|
813
|
+
function Ie(e) {
|
|
814
|
+
return D(e) ? We(e, () => {
|
|
773
815
|
}) : e;
|
|
774
816
|
}
|
|
775
|
-
function
|
|
817
|
+
function L(e, t, n) {
|
|
776
818
|
return e.has(t) ? e.get(t) : e.set(t, n(t)).get(t);
|
|
777
819
|
}
|
|
778
|
-
function
|
|
820
|
+
function qe(e) {
|
|
779
821
|
const t = {}, n = [];
|
|
780
822
|
let r;
|
|
781
|
-
const
|
|
782
|
-
addCase(
|
|
823
|
+
const i = {
|
|
824
|
+
addCase(o, c) {
|
|
783
825
|
if (process.env.NODE_ENV !== "production") {
|
|
784
826
|
if (n.length > 0)
|
|
785
|
-
throw new Error(process.env.NODE_ENV === "production" ?
|
|
827
|
+
throw new Error(process.env.NODE_ENV === "production" ? m(26) : "`builder.addCase` should only be called before calling `builder.addMatcher`");
|
|
786
828
|
if (r)
|
|
787
|
-
throw new Error(process.env.NODE_ENV === "production" ?
|
|
829
|
+
throw new Error(process.env.NODE_ENV === "production" ? m(27) : "`builder.addCase` should only be called before calling `builder.addDefaultCase`");
|
|
788
830
|
}
|
|
789
|
-
const s = typeof
|
|
831
|
+
const s = typeof o == "string" ? o : o.type;
|
|
790
832
|
if (!s)
|
|
791
|
-
throw new Error(process.env.NODE_ENV === "production" ?
|
|
833
|
+
throw new Error(process.env.NODE_ENV === "production" ? m(28) : "`builder.addCase` cannot be called with an empty action type");
|
|
792
834
|
if (s in t)
|
|
793
|
-
throw new Error(process.env.NODE_ENV === "production" ?
|
|
794
|
-
return t[s] = c,
|
|
835
|
+
throw new Error(process.env.NODE_ENV === "production" ? m(29) : `\`builder.addCase\` cannot be called with two reducers for the same action type '${s}'`);
|
|
836
|
+
return t[s] = c, i;
|
|
795
837
|
},
|
|
796
|
-
addAsyncThunk(
|
|
838
|
+
addAsyncThunk(o, c) {
|
|
797
839
|
if (process.env.NODE_ENV !== "production" && r)
|
|
798
|
-
throw new Error(process.env.NODE_ENV === "production" ?
|
|
799
|
-
return c.pending && (t[
|
|
800
|
-
matcher:
|
|
840
|
+
throw new Error(process.env.NODE_ENV === "production" ? m(43) : "`builder.addAsyncThunk` should only be called before calling `builder.addDefaultCase`");
|
|
841
|
+
return c.pending && (t[o.pending.type] = c.pending), c.rejected && (t[o.rejected.type] = c.rejected), c.fulfilled && (t[o.fulfilled.type] = c.fulfilled), c.settled && n.push({
|
|
842
|
+
matcher: o.settled,
|
|
801
843
|
reducer: c.settled
|
|
802
|
-
}),
|
|
844
|
+
}), i;
|
|
803
845
|
},
|
|
804
|
-
addMatcher(
|
|
846
|
+
addMatcher(o, c) {
|
|
805
847
|
if (process.env.NODE_ENV !== "production" && r)
|
|
806
|
-
throw new Error(process.env.NODE_ENV === "production" ?
|
|
848
|
+
throw new Error(process.env.NODE_ENV === "production" ? m(30) : "`builder.addMatcher` should only be called before calling `builder.addDefaultCase`");
|
|
807
849
|
return n.push({
|
|
808
|
-
matcher:
|
|
850
|
+
matcher: o,
|
|
809
851
|
reducer: c
|
|
810
|
-
}),
|
|
852
|
+
}), i;
|
|
811
853
|
},
|
|
812
|
-
addDefaultCase(
|
|
854
|
+
addDefaultCase(o) {
|
|
813
855
|
if (process.env.NODE_ENV !== "production" && r)
|
|
814
|
-
throw new Error(process.env.NODE_ENV === "production" ?
|
|
815
|
-
return r =
|
|
856
|
+
throw new Error(process.env.NODE_ENV === "production" ? m(31) : "`builder.addDefaultCase` can only be called once");
|
|
857
|
+
return r = o, i;
|
|
816
858
|
}
|
|
817
859
|
};
|
|
818
|
-
return e(
|
|
860
|
+
return e(i), [t, n, r];
|
|
819
861
|
}
|
|
820
|
-
|
|
821
|
-
function it(e) {
|
|
862
|
+
function Rt(e) {
|
|
822
863
|
return typeof e == "function";
|
|
823
864
|
}
|
|
824
|
-
function
|
|
865
|
+
function Ot(e, t) {
|
|
825
866
|
if (process.env.NODE_ENV !== "production" && typeof t == "object")
|
|
826
|
-
throw new Error(process.env.NODE_ENV === "production" ?
|
|
827
|
-
let [n, r,
|
|
828
|
-
if (
|
|
829
|
-
|
|
867
|
+
throw new Error(process.env.NODE_ENV === "production" ? m(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 [n, r, i] = qe(t), o;
|
|
869
|
+
if (Rt(e))
|
|
870
|
+
o = () => Ie(e());
|
|
830
871
|
else {
|
|
831
|
-
const s =
|
|
832
|
-
|
|
872
|
+
const s = Ie(e);
|
|
873
|
+
o = () => s;
|
|
833
874
|
}
|
|
834
|
-
function c(s =
|
|
835
|
-
let
|
|
836
|
-
matcher:
|
|
837
|
-
}) =>
|
|
838
|
-
reducer:
|
|
839
|
-
}) =>
|
|
840
|
-
return
|
|
875
|
+
function c(s = o(), f) {
|
|
876
|
+
let u = [n[f.type], ...r.filter(({
|
|
877
|
+
matcher: a
|
|
878
|
+
}) => a(f)).map(({
|
|
879
|
+
reducer: a
|
|
880
|
+
}) => a)];
|
|
881
|
+
return u.filter((a) => !!a).length === 0 && (u = [i]), u.reduce((a, p) => {
|
|
841
882
|
if (p)
|
|
842
|
-
if (
|
|
843
|
-
const g = p(
|
|
844
|
-
return g === void 0 ?
|
|
883
|
+
if (O(a)) {
|
|
884
|
+
const g = p(a, f);
|
|
885
|
+
return g === void 0 ? a : g;
|
|
845
886
|
} else {
|
|
846
|
-
if (
|
|
847
|
-
return
|
|
887
|
+
if (D(a))
|
|
888
|
+
return We(a, (C) => p(C, f));
|
|
848
889
|
{
|
|
849
|
-
const
|
|
850
|
-
if (
|
|
851
|
-
if (
|
|
852
|
-
return
|
|
890
|
+
const C = p(a, f);
|
|
891
|
+
if (C === void 0) {
|
|
892
|
+
if (a === null)
|
|
893
|
+
return a;
|
|
853
894
|
throw Error("A case reducer on a non-draftable value must not return undefined");
|
|
854
895
|
}
|
|
855
|
-
return
|
|
896
|
+
return C;
|
|
856
897
|
}
|
|
857
898
|
}
|
|
858
|
-
return
|
|
899
|
+
return a;
|
|
859
900
|
}, s);
|
|
860
901
|
}
|
|
861
|
-
return c.getInitialState =
|
|
902
|
+
return c.getInitialState = o, c;
|
|
862
903
|
}
|
|
863
|
-
var
|
|
864
|
-
function
|
|
904
|
+
var Pt = /* @__PURE__ */ Symbol.for("rtk-slice-createasyncthunk");
|
|
905
|
+
function kt(e, t) {
|
|
865
906
|
return `${e}/${t}`;
|
|
866
907
|
}
|
|
867
|
-
function
|
|
908
|
+
function Tt({
|
|
868
909
|
creators: e
|
|
869
910
|
} = {}) {
|
|
870
|
-
const t = e?.asyncThunk?.[
|
|
911
|
+
const t = e?.asyncThunk?.[Pt];
|
|
871
912
|
return function(r) {
|
|
872
913
|
const {
|
|
873
|
-
name:
|
|
874
|
-
reducerPath:
|
|
914
|
+
name: i,
|
|
915
|
+
reducerPath: o = i
|
|
875
916
|
} = r;
|
|
876
|
-
if (!
|
|
877
|
-
throw new Error(process.env.NODE_ENV === "production" ?
|
|
917
|
+
if (!i)
|
|
918
|
+
throw new Error(process.env.NODE_ENV === "production" ? m(11) : "`name` is a required option for createSlice");
|
|
878
919
|
typeof process < "u" && process.env.NODE_ENV === "development" && r.initialState === void 0 && console.error("You must provide an `initialState` value that is not `undefined`. You may have misspelled `initialState`");
|
|
879
|
-
const c = (typeof r.reducers == "function" ? r.reducers(
|
|
920
|
+
const c = (typeof r.reducers == "function" ? r.reducers(Mt()) : r.reducers) || {}, s = Object.keys(c), f = {
|
|
880
921
|
sliceCaseReducersByName: {},
|
|
881
922
|
sliceCaseReducersByType: {},
|
|
882
923
|
actionCreators: {},
|
|
883
924
|
sliceMatchers: []
|
|
884
|
-
},
|
|
925
|
+
}, u = {
|
|
885
926
|
addCase(l, d) {
|
|
886
|
-
const
|
|
887
|
-
if (!
|
|
888
|
-
throw new Error(process.env.NODE_ENV === "production" ?
|
|
889
|
-
if (
|
|
890
|
-
throw new Error(process.env.NODE_ENV === "production" ?
|
|
891
|
-
return f.sliceCaseReducersByType[
|
|
927
|
+
const y = typeof l == "string" ? l : l.type;
|
|
928
|
+
if (!y)
|
|
929
|
+
throw new Error(process.env.NODE_ENV === "production" ? m(12) : "`context.addCase` cannot be called with an empty action type");
|
|
930
|
+
if (y in f.sliceCaseReducersByType)
|
|
931
|
+
throw new Error(process.env.NODE_ENV === "production" ? m(13) : "`context.addCase` cannot be called with two reducers for the same action type: " + y);
|
|
932
|
+
return f.sliceCaseReducersByType[y] = d, u;
|
|
892
933
|
},
|
|
893
934
|
addMatcher(l, d) {
|
|
894
935
|
return f.sliceMatchers.push({
|
|
895
936
|
matcher: l,
|
|
896
937
|
reducer: d
|
|
897
|
-
}),
|
|
938
|
+
}), u;
|
|
898
939
|
},
|
|
899
940
|
exposeAction(l, d) {
|
|
900
|
-
return f.actionCreators[l] = d,
|
|
941
|
+
return f.actionCreators[l] = d, u;
|
|
901
942
|
},
|
|
902
943
|
exposeCaseReducer(l, d) {
|
|
903
|
-
return f.sliceCaseReducersByName[l] = d,
|
|
944
|
+
return f.sliceCaseReducersByName[l] = d, u;
|
|
904
945
|
}
|
|
905
946
|
};
|
|
906
947
|
s.forEach((l) => {
|
|
907
|
-
const d = c[l],
|
|
948
|
+
const d = c[l], y = {
|
|
908
949
|
reducerName: l,
|
|
909
|
-
type:
|
|
950
|
+
type: kt(i, l),
|
|
910
951
|
createNotation: typeof r.reducers == "function"
|
|
911
952
|
};
|
|
912
|
-
|
|
953
|
+
At(d) ? Vt(y, d, u, t) : Ft(y, d, u);
|
|
913
954
|
});
|
|
914
|
-
function
|
|
955
|
+
function a() {
|
|
915
956
|
if (process.env.NODE_ENV !== "production" && typeof r.extraReducers == "object")
|
|
916
|
-
throw new Error(process.env.NODE_ENV === "production" ?
|
|
917
|
-
const [l = {}, d = [],
|
|
957
|
+
throw new Error(process.env.NODE_ENV === "production" ? m(14) : "The object notation for `createSlice.extraReducers` has been removed. Please use the 'builder callback' notation instead: https://redux-toolkit.js.org/api/createSlice");
|
|
958
|
+
const [l = {}, d = [], y = void 0] = typeof r.extraReducers == "function" ? qe(r.extraReducers) : [r.extraReducers], b = {
|
|
918
959
|
...l,
|
|
919
960
|
...f.sliceCaseReducersByType
|
|
920
961
|
};
|
|
921
|
-
return
|
|
922
|
-
for (let
|
|
923
|
-
|
|
924
|
-
for (let
|
|
925
|
-
|
|
926
|
-
for (let
|
|
927
|
-
|
|
928
|
-
|
|
962
|
+
return Ot(r.initialState, (E) => {
|
|
963
|
+
for (let _ in b)
|
|
964
|
+
E.addCase(_, b[_]);
|
|
965
|
+
for (let _ of f.sliceMatchers)
|
|
966
|
+
E.addMatcher(_.matcher, _.reducer);
|
|
967
|
+
for (let _ of d)
|
|
968
|
+
E.addMatcher(_.matcher, _.reducer);
|
|
969
|
+
y && E.addDefaultCase(y);
|
|
929
970
|
});
|
|
930
971
|
}
|
|
931
|
-
const p = (l) => l,
|
|
932
|
-
let
|
|
933
|
-
function
|
|
934
|
-
return
|
|
972
|
+
const p = (l) => l, C = /* @__PURE__ */ new Map(), g = /* @__PURE__ */ new WeakMap();
|
|
973
|
+
let h;
|
|
974
|
+
function S(l, d) {
|
|
975
|
+
return h || (h = a()), h(l, d);
|
|
935
976
|
}
|
|
936
|
-
function
|
|
937
|
-
return
|
|
977
|
+
function T() {
|
|
978
|
+
return h || (h = a()), h.getInitialState();
|
|
938
979
|
}
|
|
939
|
-
function
|
|
940
|
-
function
|
|
941
|
-
let
|
|
942
|
-
if (typeof
|
|
980
|
+
function B(l, d = !1) {
|
|
981
|
+
function y(E) {
|
|
982
|
+
let _ = E[l];
|
|
983
|
+
if (typeof _ > "u") {
|
|
943
984
|
if (d)
|
|
944
|
-
|
|
985
|
+
_ = L(g, y, T);
|
|
945
986
|
else if (process.env.NODE_ENV !== "production")
|
|
946
|
-
throw new Error(process.env.NODE_ENV === "production" ?
|
|
987
|
+
throw new Error(process.env.NODE_ENV === "production" ? m(15) : "selectSlice returned undefined for an uninjected slice reducer");
|
|
947
988
|
}
|
|
948
|
-
return
|
|
989
|
+
return _;
|
|
949
990
|
}
|
|
950
|
-
function
|
|
951
|
-
const
|
|
952
|
-
return
|
|
953
|
-
const
|
|
954
|
-
for (const [
|
|
955
|
-
|
|
956
|
-
return
|
|
991
|
+
function b(E = p) {
|
|
992
|
+
const _ = L(C, d, () => /* @__PURE__ */ new WeakMap());
|
|
993
|
+
return L(_, E, () => {
|
|
994
|
+
const F = {};
|
|
995
|
+
for (const [oe, He] of Object.entries(r.selectors ?? {}))
|
|
996
|
+
F[oe] = zt(He, E, () => L(g, E, T), d);
|
|
997
|
+
return F;
|
|
957
998
|
});
|
|
958
999
|
}
|
|
959
1000
|
return {
|
|
960
1001
|
reducerPath: l,
|
|
961
|
-
getSelectors:
|
|
1002
|
+
getSelectors: b,
|
|
962
1003
|
get selectors() {
|
|
963
|
-
return
|
|
1004
|
+
return b(y);
|
|
964
1005
|
},
|
|
965
|
-
selectSlice:
|
|
1006
|
+
selectSlice: y
|
|
966
1007
|
};
|
|
967
1008
|
}
|
|
968
|
-
const
|
|
969
|
-
name:
|
|
970
|
-
reducer:
|
|
1009
|
+
const z = {
|
|
1010
|
+
name: i,
|
|
1011
|
+
reducer: S,
|
|
971
1012
|
actions: f.actionCreators,
|
|
972
1013
|
caseReducers: f.sliceCaseReducersByName,
|
|
973
|
-
getInitialState:
|
|
974
|
-
...
|
|
1014
|
+
getInitialState: T,
|
|
1015
|
+
...B(o),
|
|
975
1016
|
injectInto(l, {
|
|
976
1017
|
reducerPath: d,
|
|
977
|
-
...
|
|
1018
|
+
...y
|
|
978
1019
|
} = {}) {
|
|
979
|
-
const
|
|
1020
|
+
const b = d ?? o;
|
|
980
1021
|
return l.inject({
|
|
981
|
-
reducerPath:
|
|
982
|
-
reducer:
|
|
983
|
-
},
|
|
984
|
-
...
|
|
985
|
-
...
|
|
1022
|
+
reducerPath: b,
|
|
1023
|
+
reducer: S
|
|
1024
|
+
}, y), {
|
|
1025
|
+
...z,
|
|
1026
|
+
...B(b, !0)
|
|
986
1027
|
};
|
|
987
1028
|
}
|
|
988
1029
|
};
|
|
989
|
-
return
|
|
1030
|
+
return z;
|
|
990
1031
|
};
|
|
991
1032
|
}
|
|
992
|
-
function
|
|
993
|
-
function o
|
|
994
|
-
let s = t(
|
|
1033
|
+
function zt(e, t, n, r) {
|
|
1034
|
+
function i(o, ...c) {
|
|
1035
|
+
let s = t(o);
|
|
995
1036
|
if (typeof s > "u") {
|
|
996
1037
|
if (r)
|
|
997
1038
|
s = n();
|
|
998
1039
|
else if (process.env.NODE_ENV !== "production")
|
|
999
|
-
throw new Error(process.env.NODE_ENV === "production" ?
|
|
1040
|
+
throw new Error(process.env.NODE_ENV === "production" ? m(16) : "selectState returned undefined for an uninjected slice reducer");
|
|
1000
1041
|
}
|
|
1001
1042
|
return e(s, ...c);
|
|
1002
1043
|
}
|
|
1003
|
-
return
|
|
1044
|
+
return i.unwrapped = e, i;
|
|
1004
1045
|
}
|
|
1005
|
-
var
|
|
1006
|
-
function
|
|
1046
|
+
var It = /* @__PURE__ */ Tt();
|
|
1047
|
+
function Mt() {
|
|
1007
1048
|
function e(t, n) {
|
|
1008
1049
|
return {
|
|
1009
1050
|
_reducerDefinitionType: "asyncThunk",
|
|
@@ -1034,60 +1075,60 @@ function dt() {
|
|
|
1034
1075
|
asyncThunk: e
|
|
1035
1076
|
};
|
|
1036
1077
|
}
|
|
1037
|
-
function
|
|
1078
|
+
function Ft({
|
|
1038
1079
|
type: e,
|
|
1039
1080
|
reducerName: t,
|
|
1040
1081
|
createNotation: n
|
|
1041
|
-
}, r,
|
|
1042
|
-
let
|
|
1082
|
+
}, r, i) {
|
|
1083
|
+
let o, c;
|
|
1043
1084
|
if ("reducer" in r) {
|
|
1044
|
-
if (n && !
|
|
1045
|
-
throw new Error(process.env.NODE_ENV === "production" ?
|
|
1046
|
-
|
|
1085
|
+
if (n && !xt(r))
|
|
1086
|
+
throw new Error(process.env.NODE_ENV === "production" ? m(17) : "Please use the `create.preparedReducer` notation for prepared action creators with the `create` notation.");
|
|
1087
|
+
o = r.reducer, c = r.prepare;
|
|
1047
1088
|
} else
|
|
1048
|
-
|
|
1049
|
-
|
|
1089
|
+
o = r;
|
|
1090
|
+
i.addCase(e, o).exposeCaseReducer(t, o).exposeAction(t, c ? ze(e, c) : ze(e));
|
|
1050
1091
|
}
|
|
1051
|
-
function
|
|
1092
|
+
function At(e) {
|
|
1052
1093
|
return e._reducerDefinitionType === "asyncThunk";
|
|
1053
1094
|
}
|
|
1054
|
-
function
|
|
1095
|
+
function xt(e) {
|
|
1055
1096
|
return e._reducerDefinitionType === "reducerWithPrepare";
|
|
1056
1097
|
}
|
|
1057
|
-
function
|
|
1098
|
+
function Vt({
|
|
1058
1099
|
type: e,
|
|
1059
1100
|
reducerName: t
|
|
1060
|
-
}, n, r,
|
|
1061
|
-
if (!
|
|
1062
|
-
throw new Error(process.env.NODE_ENV === "production" ?
|
|
1101
|
+
}, n, r, i) {
|
|
1102
|
+
if (!i)
|
|
1103
|
+
throw new Error(process.env.NODE_ENV === "production" ? m(18) : "Cannot use `create.asyncThunk` in the built-in `createSlice`. Use `buildCreateSlice({ creators: { asyncThunk: asyncThunkCreator } })` to create a customised version of `createSlice`.");
|
|
1063
1104
|
const {
|
|
1064
|
-
payloadCreator:
|
|
1105
|
+
payloadCreator: o,
|
|
1065
1106
|
fulfilled: c,
|
|
1066
1107
|
pending: s,
|
|
1067
1108
|
rejected: f,
|
|
1068
|
-
settled:
|
|
1069
|
-
options:
|
|
1070
|
-
} = n, p =
|
|
1071
|
-
r.exposeAction(t, p), c && r.addCase(p.fulfilled, c), s && r.addCase(p.pending, s), f && r.addCase(p.rejected, f),
|
|
1072
|
-
fulfilled: c ||
|
|
1073
|
-
pending: s ||
|
|
1074
|
-
rejected: f ||
|
|
1075
|
-
settled:
|
|
1109
|
+
settled: u,
|
|
1110
|
+
options: a
|
|
1111
|
+
} = n, p = i(e, o, a);
|
|
1112
|
+
r.exposeAction(t, p), c && r.addCase(p.fulfilled, c), s && r.addCase(p.pending, s), f && r.addCase(p.rejected, f), u && r.addMatcher(p.settled, u), r.exposeCaseReducer(t, {
|
|
1113
|
+
fulfilled: c || q,
|
|
1114
|
+
pending: s || q,
|
|
1115
|
+
rejected: f || q,
|
|
1116
|
+
settled: u || q
|
|
1076
1117
|
});
|
|
1077
1118
|
}
|
|
1078
|
-
function
|
|
1119
|
+
function q() {
|
|
1079
1120
|
}
|
|
1080
|
-
function
|
|
1121
|
+
function m(e) {
|
|
1081
1122
|
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. `;
|
|
1082
1123
|
}
|
|
1083
|
-
const
|
|
1124
|
+
const jt = {
|
|
1084
1125
|
maxNotifications: 5,
|
|
1085
1126
|
autoDismiss: !0,
|
|
1086
1127
|
dismissTimeout: 5e3
|
|
1087
|
-
},
|
|
1128
|
+
}, $t = {
|
|
1088
1129
|
notifications: [],
|
|
1089
|
-
config:
|
|
1090
|
-
},
|
|
1130
|
+
config: jt
|
|
1131
|
+
}, Bt = (e, t) => {
|
|
1091
1132
|
const n = {
|
|
1092
1133
|
...t.payload,
|
|
1093
1134
|
id: Date.now().toString(),
|
|
@@ -1098,73 +1139,73 @@ const _t = {
|
|
|
1098
1139
|
0,
|
|
1099
1140
|
e.config.maxNotifications
|
|
1100
1141
|
));
|
|
1101
|
-
},
|
|
1142
|
+
}, Ut = (e, t) => {
|
|
1102
1143
|
const n = e.notifications.find((r) => r.id === t.payload);
|
|
1103
1144
|
n && (n.dismissed = !0);
|
|
1104
|
-
},
|
|
1145
|
+
}, Wt = (e, t) => {
|
|
1105
1146
|
e.notifications = e.notifications.filter(
|
|
1106
1147
|
(n) => n.id !== t.payload
|
|
1107
1148
|
);
|
|
1108
|
-
},
|
|
1149
|
+
}, Lt = (e) => {
|
|
1109
1150
|
e.notifications = [];
|
|
1110
|
-
},
|
|
1151
|
+
}, qt = (e, t) => {
|
|
1111
1152
|
e.config = { ...e.config, ...t.payload };
|
|
1112
|
-
},
|
|
1153
|
+
}, Ke = It({
|
|
1113
1154
|
name: "notifications",
|
|
1114
|
-
initialState:
|
|
1155
|
+
initialState: $t,
|
|
1115
1156
|
reducers: {
|
|
1116
|
-
addNotification:
|
|
1117
|
-
dismissNotification:
|
|
1118
|
-
removeNotification:
|
|
1119
|
-
clearNotifications:
|
|
1120
|
-
updateConfig:
|
|
1157
|
+
addNotification: Bt,
|
|
1158
|
+
dismissNotification: Ut,
|
|
1159
|
+
removeNotification: Wt,
|
|
1160
|
+
clearNotifications: Lt,
|
|
1161
|
+
updateConfig: qt
|
|
1121
1162
|
}
|
|
1122
1163
|
}), {
|
|
1123
|
-
addNotification:
|
|
1124
|
-
dismissNotification:
|
|
1125
|
-
removeNotification:
|
|
1126
|
-
clearNotifications:
|
|
1127
|
-
updateConfig:
|
|
1128
|
-
} =
|
|
1129
|
-
[
|
|
1164
|
+
addNotification: ie,
|
|
1165
|
+
dismissNotification: Yt,
|
|
1166
|
+
removeNotification: Gt,
|
|
1167
|
+
clearNotifications: Ht,
|
|
1168
|
+
updateConfig: Xt
|
|
1169
|
+
} = Ke.actions, Jt = Ke.reducer, Qt = (e) => ie({ message: e, type: "success" }), Zt = (e) => ie({ message: e, type: "warning" }), en = (e) => ie({ message: e, type: "error" }), tn = (e, t) => ie({ message: e, type: t }), Kt = "notifications", Ye = (e) => e[Kt], Ne = P(
|
|
1170
|
+
[Ye],
|
|
1130
1171
|
(e) => e.notifications
|
|
1131
|
-
),
|
|
1132
|
-
[
|
|
1172
|
+
), Ge = P(
|
|
1173
|
+
[Ne],
|
|
1133
1174
|
(e) => e.filter((t) => !t.dismissed)
|
|
1134
|
-
),
|
|
1135
|
-
[
|
|
1175
|
+
), nn = (e) => P(
|
|
1176
|
+
[Ne],
|
|
1136
1177
|
(t) => t.filter((n) => n.type === e)
|
|
1137
|
-
),
|
|
1138
|
-
[
|
|
1178
|
+
), rn = (e) => P(
|
|
1179
|
+
[Ge],
|
|
1139
1180
|
(t) => t.filter((n) => n.type === e)
|
|
1140
|
-
),
|
|
1141
|
-
[
|
|
1181
|
+
), on = P(
|
|
1182
|
+
[Ne],
|
|
1142
1183
|
(e) => e.length
|
|
1143
|
-
),
|
|
1144
|
-
[
|
|
1184
|
+
), cn = P(
|
|
1185
|
+
[Ge],
|
|
1145
1186
|
(e) => e.length
|
|
1146
|
-
),
|
|
1147
|
-
[
|
|
1187
|
+
), sn = P(
|
|
1188
|
+
[Ye],
|
|
1148
1189
|
(e) => e.config
|
|
1149
1190
|
);
|
|
1150
1191
|
export {
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1192
|
+
Kt as NotificationKey,
|
|
1193
|
+
ie as addNotification,
|
|
1194
|
+
Ht as clearNotifications,
|
|
1195
|
+
Yt as dismissNotification,
|
|
1196
|
+
Jt as notificationReducer,
|
|
1197
|
+
Gt as removeNotification,
|
|
1198
|
+
cn as selectActiveNotificationCount,
|
|
1199
|
+
Ge as selectActiveNotifications,
|
|
1200
|
+
rn as selectActiveNotificationsByType,
|
|
1201
|
+
Ne as selectAllNotifications,
|
|
1202
|
+
sn as selectNotificationConfig,
|
|
1203
|
+
on as selectNotificationCount,
|
|
1204
|
+
nn as selectNotificationsByType,
|
|
1205
|
+
Ye as selectNotificationsState,
|
|
1206
|
+
en as showErrorNotification,
|
|
1207
|
+
tn as showNotification,
|
|
1208
|
+
Qt as showSuccessNotification,
|
|
1209
|
+
Zt as showWarningNotification,
|
|
1210
|
+
Xt as updateConfig
|
|
1170
1211
|
};
|