use-abcd 0.1.1 → 0.2.0
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/README.md +48 -29
- package/dist/useCrud.d.ts +89 -65
- package/dist/useCrud.js +1252 -1240
- package/package.json +1 -1
package/dist/useCrud.js
CHANGED
|
@@ -1,72 +1,72 @@
|
|
|
1
|
-
import { useRef as
|
|
2
|
-
var
|
|
3
|
-
function
|
|
4
|
-
var t =
|
|
1
|
+
import { useRef as pn, useMemo as K, useSyncExternalStore as dn, useCallback as C, useEffect as hn } from "react";
|
|
2
|
+
var xt = typeof global == "object" && global && global.Object === Object && global, yn = typeof self == "object" && self && self.Object === Object && self, F = xt || yn || Function("return this")(), G = F.Symbol, $t = Object.prototype, bn = $t.hasOwnProperty, gn = $t.toString, te = G ? G.toStringTag : void 0;
|
|
3
|
+
function mn(e) {
|
|
4
|
+
var t = bn.call(e, te), n = e[te];
|
|
5
5
|
try {
|
|
6
|
-
e[
|
|
7
|
-
var
|
|
6
|
+
e[te] = void 0;
|
|
7
|
+
var r = !0;
|
|
8
8
|
} catch {
|
|
9
9
|
}
|
|
10
|
-
var i =
|
|
11
|
-
return
|
|
10
|
+
var i = gn.call(e);
|
|
11
|
+
return r && (t ? e[te] = n : delete e[te]), i;
|
|
12
12
|
}
|
|
13
|
-
var
|
|
14
|
-
function
|
|
15
|
-
return
|
|
13
|
+
var vn = Object.prototype, wn = vn.toString;
|
|
14
|
+
function _n(e) {
|
|
15
|
+
return wn.call(e);
|
|
16
16
|
}
|
|
17
|
-
var
|
|
18
|
-
function
|
|
19
|
-
return e == null ? e === void 0 ?
|
|
17
|
+
var On = "[object Null]", Sn = "[object Undefined]", nt = G ? G.toStringTag : void 0;
|
|
18
|
+
function J(e) {
|
|
19
|
+
return e == null ? e === void 0 ? Sn : On : nt && nt in Object(e) ? mn(e) : _n(e);
|
|
20
20
|
}
|
|
21
|
-
function
|
|
21
|
+
function V(e) {
|
|
22
22
|
return e != null && typeof e == "object";
|
|
23
23
|
}
|
|
24
|
-
var
|
|
25
|
-
function
|
|
26
|
-
return typeof e == "symbol" ||
|
|
24
|
+
var An = "[object Symbol]";
|
|
25
|
+
function Ue(e) {
|
|
26
|
+
return typeof e == "symbol" || V(e) && J(e) == An;
|
|
27
27
|
}
|
|
28
|
-
function
|
|
29
|
-
for (var
|
|
30
|
-
i[
|
|
28
|
+
function jt(e, t) {
|
|
29
|
+
for (var n = -1, r = e == null ? 0 : e.length, i = Array(r); ++n < r; )
|
|
30
|
+
i[n] = t(e[n], n, e);
|
|
31
31
|
return i;
|
|
32
32
|
}
|
|
33
|
-
var T = Array.isArray,
|
|
34
|
-
function
|
|
33
|
+
var T = Array.isArray, rt = G ? G.prototype : void 0, it = rt ? rt.toString : void 0;
|
|
34
|
+
function It(e) {
|
|
35
35
|
if (typeof e == "string")
|
|
36
36
|
return e;
|
|
37
37
|
if (T(e))
|
|
38
|
-
return
|
|
39
|
-
if (
|
|
40
|
-
return
|
|
38
|
+
return jt(e, It) + "";
|
|
39
|
+
if (Ue(e))
|
|
40
|
+
return it ? it.call(e) : "";
|
|
41
41
|
var t = e + "";
|
|
42
42
|
return t == "0" && 1 / e == -1 / 0 ? "-0" : t;
|
|
43
43
|
}
|
|
44
|
-
function
|
|
44
|
+
function ae(e) {
|
|
45
45
|
var t = typeof e;
|
|
46
46
|
return e != null && (t == "object" || t == "function");
|
|
47
47
|
}
|
|
48
|
-
function
|
|
48
|
+
function Ke(e) {
|
|
49
49
|
return e;
|
|
50
50
|
}
|
|
51
|
-
var
|
|
52
|
-
function
|
|
53
|
-
if (!
|
|
51
|
+
var En = "[object AsyncFunction]", Mn = "[object Function]", Tn = "[object GeneratorFunction]", Pn = "[object Proxy]";
|
|
52
|
+
function zt(e) {
|
|
53
|
+
if (!ae(e))
|
|
54
54
|
return !1;
|
|
55
|
-
var t =
|
|
56
|
-
return t ==
|
|
55
|
+
var t = J(e);
|
|
56
|
+
return t == Mn || t == Tn || t == En || t == Pn;
|
|
57
57
|
}
|
|
58
|
-
var
|
|
59
|
-
var e = /[^.]+$/.exec(
|
|
58
|
+
var Se = F["__core-js_shared__"], ot = (function() {
|
|
59
|
+
var e = /[^.]+$/.exec(Se && Se.keys && Se.keys.IE_PROTO || "");
|
|
60
60
|
return e ? "Symbol(src)_1." + e : "";
|
|
61
61
|
})();
|
|
62
|
-
function
|
|
63
|
-
return !!
|
|
62
|
+
function Cn(e) {
|
|
63
|
+
return !!ot && ot in e;
|
|
64
64
|
}
|
|
65
|
-
var
|
|
66
|
-
function
|
|
65
|
+
var Rn = Function.prototype, xn = Rn.toString;
|
|
66
|
+
function X(e) {
|
|
67
67
|
if (e != null) {
|
|
68
68
|
try {
|
|
69
|
-
return
|
|
69
|
+
return xn.call(e);
|
|
70
70
|
} catch {
|
|
71
71
|
}
|
|
72
72
|
try {
|
|
@@ -76,1147 +76,1159 @@ function Y(e) {
|
|
|
76
76
|
}
|
|
77
77
|
return "";
|
|
78
78
|
}
|
|
79
|
-
var
|
|
80
|
-
"^" +
|
|
79
|
+
var $n = /[\\^$.*+?()[\]{}|]/g, jn = /^\[object .+?Constructor\]$/, In = Function.prototype, zn = Object.prototype, Dn = In.toString, Fn = zn.hasOwnProperty, Ln = RegExp(
|
|
80
|
+
"^" + Dn.call(Fn).replace($n, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
|
|
81
81
|
);
|
|
82
|
-
function
|
|
83
|
-
if (!
|
|
82
|
+
function Nn(e) {
|
|
83
|
+
if (!ae(e) || Cn(e))
|
|
84
84
|
return !1;
|
|
85
|
-
var t =
|
|
86
|
-
return t.test(
|
|
85
|
+
var t = zt(e) ? Ln : jn;
|
|
86
|
+
return t.test(X(e));
|
|
87
87
|
}
|
|
88
|
-
function
|
|
88
|
+
function Un(e, t) {
|
|
89
89
|
return e?.[t];
|
|
90
90
|
}
|
|
91
|
-
function
|
|
92
|
-
var
|
|
93
|
-
return
|
|
91
|
+
function Z(e, t) {
|
|
92
|
+
var n = Un(e, t);
|
|
93
|
+
return Nn(n) ? n : void 0;
|
|
94
94
|
}
|
|
95
|
-
var
|
|
95
|
+
var Te = Z(F, "WeakMap"), st = (function() {
|
|
96
96
|
try {
|
|
97
|
-
var e =
|
|
97
|
+
var e = Z(Object, "defineProperty");
|
|
98
98
|
return e({}, "", {}), e;
|
|
99
99
|
} catch {
|
|
100
100
|
}
|
|
101
|
-
})(),
|
|
102
|
-
function
|
|
103
|
-
var
|
|
104
|
-
return t = t ??
|
|
101
|
+
})(), Kn = 9007199254740991, Bn = /^(?:0|[1-9]\d*)$/;
|
|
102
|
+
function Be(e, t) {
|
|
103
|
+
var n = typeof e;
|
|
104
|
+
return t = t ?? Kn, !!t && (n == "number" || n != "symbol" && Bn.test(e)) && e > -1 && e % 1 == 0 && e < t;
|
|
105
105
|
}
|
|
106
|
-
function
|
|
107
|
-
t == "__proto__" &&
|
|
106
|
+
function Gn(e, t, n) {
|
|
107
|
+
t == "__proto__" && st ? st(e, t, {
|
|
108
108
|
configurable: !0,
|
|
109
109
|
enumerable: !0,
|
|
110
|
-
value:
|
|
110
|
+
value: n,
|
|
111
111
|
writable: !0
|
|
112
|
-
}) : e[t] =
|
|
112
|
+
}) : e[t] = n;
|
|
113
113
|
}
|
|
114
|
-
function
|
|
114
|
+
function Ge(e, t) {
|
|
115
115
|
return e === t || e !== e && t !== t;
|
|
116
116
|
}
|
|
117
|
-
var
|
|
118
|
-
function
|
|
119
|
-
var
|
|
120
|
-
(!(
|
|
117
|
+
var Hn = Object.prototype, Wn = Hn.hasOwnProperty;
|
|
118
|
+
function Vn(e, t, n) {
|
|
119
|
+
var r = e[t];
|
|
120
|
+
(!(Wn.call(e, t) && Ge(r, n)) || n === void 0 && !(t in e)) && Gn(e, t, n);
|
|
121
121
|
}
|
|
122
|
-
var
|
|
123
|
-
function
|
|
124
|
-
return typeof e == "number" && e > -1 && e % 1 == 0 && e <=
|
|
122
|
+
var qn = 9007199254740991;
|
|
123
|
+
function He(e) {
|
|
124
|
+
return typeof e == "number" && e > -1 && e % 1 == 0 && e <= qn;
|
|
125
125
|
}
|
|
126
|
-
function
|
|
127
|
-
return e != null &&
|
|
126
|
+
function ve(e) {
|
|
127
|
+
return e != null && He(e.length) && !zt(e);
|
|
128
128
|
}
|
|
129
|
-
var
|
|
130
|
-
function
|
|
131
|
-
var t = e && e.constructor,
|
|
132
|
-
return e ===
|
|
129
|
+
var Yn = Object.prototype;
|
|
130
|
+
function Jn(e) {
|
|
131
|
+
var t = e && e.constructor, n = typeof t == "function" && t.prototype || Yn;
|
|
132
|
+
return e === n;
|
|
133
133
|
}
|
|
134
|
-
function
|
|
135
|
-
for (var
|
|
136
|
-
n
|
|
137
|
-
return
|
|
134
|
+
function Xn(e, t) {
|
|
135
|
+
for (var n = -1, r = Array(e); ++n < e; )
|
|
136
|
+
r[n] = t(n);
|
|
137
|
+
return r;
|
|
138
138
|
}
|
|
139
|
-
var
|
|
140
|
-
function
|
|
141
|
-
return
|
|
139
|
+
var Zn = "[object Arguments]";
|
|
140
|
+
function at(e) {
|
|
141
|
+
return V(e) && J(e) == Zn;
|
|
142
142
|
}
|
|
143
|
-
var
|
|
143
|
+
var Dt = Object.prototype, Qn = Dt.hasOwnProperty, kn = Dt.propertyIsEnumerable, Ft = at(/* @__PURE__ */ (function() {
|
|
144
144
|
return arguments;
|
|
145
|
-
})()) ?
|
|
146
|
-
return
|
|
145
|
+
})()) ? at : function(e) {
|
|
146
|
+
return V(e) && Qn.call(e, "callee") && !kn.call(e, "callee");
|
|
147
147
|
};
|
|
148
|
-
function
|
|
148
|
+
function er() {
|
|
149
149
|
return !1;
|
|
150
150
|
}
|
|
151
|
-
var
|
|
152
|
-
g[
|
|
153
|
-
g[
|
|
154
|
-
function
|
|
155
|
-
return
|
|
151
|
+
var Lt = typeof exports == "object" && exports && !exports.nodeType && exports, ct = Lt && typeof module == "object" && module && !module.nodeType && module, tr = ct && ct.exports === Lt, ft = tr ? F.Buffer : void 0, nr = ft ? ft.isBuffer : void 0, Pe = nr || er, rr = "[object Arguments]", ir = "[object Array]", or = "[object Boolean]", sr = "[object Date]", ar = "[object Error]", cr = "[object Function]", fr = "[object Map]", ur = "[object Number]", lr = "[object Object]", pr = "[object RegExp]", dr = "[object Set]", hr = "[object String]", yr = "[object WeakMap]", br = "[object ArrayBuffer]", gr = "[object DataView]", mr = "[object Float32Array]", vr = "[object Float64Array]", wr = "[object Int8Array]", _r = "[object Int16Array]", Or = "[object Int32Array]", Sr = "[object Uint8Array]", Ar = "[object Uint8ClampedArray]", Er = "[object Uint16Array]", Mr = "[object Uint32Array]", g = {};
|
|
152
|
+
g[mr] = g[vr] = g[wr] = g[_r] = g[Or] = g[Sr] = g[Ar] = g[Er] = g[Mr] = !0;
|
|
153
|
+
g[rr] = g[ir] = g[br] = g[or] = g[gr] = g[sr] = g[ar] = g[cr] = g[fr] = g[ur] = g[lr] = g[pr] = g[dr] = g[hr] = g[yr] = !1;
|
|
154
|
+
function Tr(e) {
|
|
155
|
+
return V(e) && He(e.length) && !!g[J(e)];
|
|
156
156
|
}
|
|
157
|
-
function
|
|
157
|
+
function Pr(e) {
|
|
158
158
|
return function(t) {
|
|
159
159
|
return e(t);
|
|
160
160
|
};
|
|
161
161
|
}
|
|
162
|
-
var
|
|
162
|
+
var Nt = typeof exports == "object" && exports && !exports.nodeType && exports, oe = Nt && typeof module == "object" && module && !module.nodeType && module, Cr = oe && oe.exports === Nt, Ae = Cr && xt.process, ut = (function() {
|
|
163
163
|
try {
|
|
164
|
-
var e =
|
|
165
|
-
return e ||
|
|
164
|
+
var e = oe && oe.require && oe.require("util").types;
|
|
165
|
+
return e || Ae && Ae.binding && Ae.binding("util");
|
|
166
166
|
} catch {
|
|
167
167
|
}
|
|
168
|
-
})(),
|
|
169
|
-
function
|
|
170
|
-
var
|
|
168
|
+
})(), lt = ut && ut.isTypedArray, Ut = lt ? Pr(lt) : Tr, Rr = Object.prototype, xr = Rr.hasOwnProperty;
|
|
169
|
+
function $r(e, t) {
|
|
170
|
+
var n = T(e), r = !n && Ft(e), i = !n && !r && Pe(e), o = !n && !r && !i && Ut(e), s = n || r || i || o, c = s ? Xn(e.length, String) : [], a = c.length;
|
|
171
171
|
for (var f in e)
|
|
172
|
-
|
|
172
|
+
xr.call(e, f) && !(s && // Safari 9 has enumerable `arguments.length` in strict mode.
|
|
173
173
|
(f == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
|
|
174
174
|
i && (f == "offset" || f == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
|
|
175
|
-
|
|
176
|
-
|
|
175
|
+
o && (f == "buffer" || f == "byteLength" || f == "byteOffset") || // Skip index properties.
|
|
176
|
+
Be(f, a))) && c.push(f);
|
|
177
177
|
return c;
|
|
178
178
|
}
|
|
179
|
-
function
|
|
180
|
-
return function(
|
|
181
|
-
return e(t(
|
|
179
|
+
function jr(e, t) {
|
|
180
|
+
return function(n) {
|
|
181
|
+
return e(t(n));
|
|
182
182
|
};
|
|
183
183
|
}
|
|
184
|
-
var
|
|
185
|
-
function
|
|
186
|
-
if (!
|
|
187
|
-
return
|
|
184
|
+
var Ir = jr(Object.keys, Object), zr = Object.prototype, Dr = zr.hasOwnProperty;
|
|
185
|
+
function Kt(e) {
|
|
186
|
+
if (!Jn(e))
|
|
187
|
+
return Ir(e);
|
|
188
188
|
var t = [];
|
|
189
|
-
for (var
|
|
190
|
-
|
|
189
|
+
for (var n in Object(e))
|
|
190
|
+
Dr.call(e, n) && n != "constructor" && t.push(n);
|
|
191
191
|
return t;
|
|
192
192
|
}
|
|
193
|
-
function
|
|
194
|
-
return
|
|
193
|
+
function We(e) {
|
|
194
|
+
return ve(e) ? $r(e) : Kt(e);
|
|
195
195
|
}
|
|
196
|
-
var
|
|
197
|
-
function
|
|
196
|
+
var Fr = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, Lr = /^\w*$/;
|
|
197
|
+
function Ve(e, t) {
|
|
198
198
|
if (T(e))
|
|
199
199
|
return !1;
|
|
200
|
-
var
|
|
201
|
-
return
|
|
200
|
+
var n = typeof e;
|
|
201
|
+
return n == "number" || n == "symbol" || n == "boolean" || e == null || Ue(e) ? !0 : Lr.test(e) || !Fr.test(e) || t != null && e in Object(t);
|
|
202
202
|
}
|
|
203
|
-
var
|
|
204
|
-
function
|
|
205
|
-
this.__data__ =
|
|
203
|
+
var ce = Z(Object, "create");
|
|
204
|
+
function Nr() {
|
|
205
|
+
this.__data__ = ce ? ce(null) : {}, this.size = 0;
|
|
206
206
|
}
|
|
207
|
-
function
|
|
207
|
+
function Ur(e) {
|
|
208
208
|
var t = this.has(e) && delete this.__data__[e];
|
|
209
209
|
return this.size -= t ? 1 : 0, t;
|
|
210
210
|
}
|
|
211
|
-
var
|
|
212
|
-
function
|
|
211
|
+
var Kr = "__lodash_hash_undefined__", Br = Object.prototype, Gr = Br.hasOwnProperty;
|
|
212
|
+
function Hr(e) {
|
|
213
213
|
var t = this.__data__;
|
|
214
|
-
if (
|
|
215
|
-
var
|
|
216
|
-
return
|
|
214
|
+
if (ce) {
|
|
215
|
+
var n = t[e];
|
|
216
|
+
return n === Kr ? void 0 : n;
|
|
217
217
|
}
|
|
218
|
-
return
|
|
218
|
+
return Gr.call(t, e) ? t[e] : void 0;
|
|
219
219
|
}
|
|
220
|
-
var
|
|
221
|
-
function
|
|
220
|
+
var Wr = Object.prototype, Vr = Wr.hasOwnProperty;
|
|
221
|
+
function qr(e) {
|
|
222
222
|
var t = this.__data__;
|
|
223
|
-
return
|
|
223
|
+
return ce ? t[e] !== void 0 : Vr.call(t, e);
|
|
224
224
|
}
|
|
225
|
-
var
|
|
226
|
-
function
|
|
227
|
-
var
|
|
228
|
-
return this.size += this.has(e) ? 0 : 1,
|
|
225
|
+
var Yr = "__lodash_hash_undefined__";
|
|
226
|
+
function Jr(e, t) {
|
|
227
|
+
var n = this.__data__;
|
|
228
|
+
return this.size += this.has(e) ? 0 : 1, n[e] = ce && t === void 0 ? Yr : t, this;
|
|
229
229
|
}
|
|
230
|
-
function
|
|
231
|
-
var t = -1,
|
|
232
|
-
for (this.clear(); ++t <
|
|
233
|
-
var
|
|
234
|
-
this.set(
|
|
230
|
+
function q(e) {
|
|
231
|
+
var t = -1, n = e == null ? 0 : e.length;
|
|
232
|
+
for (this.clear(); ++t < n; ) {
|
|
233
|
+
var r = e[t];
|
|
234
|
+
this.set(r[0], r[1]);
|
|
235
235
|
}
|
|
236
236
|
}
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
function
|
|
237
|
+
q.prototype.clear = Nr;
|
|
238
|
+
q.prototype.delete = Ur;
|
|
239
|
+
q.prototype.get = Hr;
|
|
240
|
+
q.prototype.has = qr;
|
|
241
|
+
q.prototype.set = Jr;
|
|
242
|
+
function Xr() {
|
|
243
243
|
this.__data__ = [], this.size = 0;
|
|
244
244
|
}
|
|
245
|
-
function
|
|
246
|
-
for (var
|
|
247
|
-
if (
|
|
248
|
-
return
|
|
245
|
+
function we(e, t) {
|
|
246
|
+
for (var n = e.length; n--; )
|
|
247
|
+
if (Ge(e[n][0], t))
|
|
248
|
+
return n;
|
|
249
249
|
return -1;
|
|
250
250
|
}
|
|
251
|
-
var
|
|
252
|
-
function
|
|
253
|
-
var t = this.__data__,
|
|
254
|
-
if (
|
|
251
|
+
var Zr = Array.prototype, Qr = Zr.splice;
|
|
252
|
+
function kr(e) {
|
|
253
|
+
var t = this.__data__, n = we(t, e);
|
|
254
|
+
if (n < 0)
|
|
255
255
|
return !1;
|
|
256
|
-
var
|
|
257
|
-
return
|
|
256
|
+
var r = t.length - 1;
|
|
257
|
+
return n == r ? t.pop() : Qr.call(t, n, 1), --this.size, !0;
|
|
258
258
|
}
|
|
259
|
-
function
|
|
260
|
-
var t = this.__data__,
|
|
261
|
-
return
|
|
259
|
+
function ei(e) {
|
|
260
|
+
var t = this.__data__, n = we(t, e);
|
|
261
|
+
return n < 0 ? void 0 : t[n][1];
|
|
262
262
|
}
|
|
263
|
-
function
|
|
264
|
-
return
|
|
263
|
+
function ti(e) {
|
|
264
|
+
return we(this.__data__, e) > -1;
|
|
265
265
|
}
|
|
266
|
-
function
|
|
267
|
-
var
|
|
268
|
-
return
|
|
266
|
+
function ni(e, t) {
|
|
267
|
+
var n = this.__data__, r = we(n, e);
|
|
268
|
+
return r < 0 ? (++this.size, n.push([e, t])) : n[r][1] = t, this;
|
|
269
269
|
}
|
|
270
270
|
function L(e) {
|
|
271
|
-
var t = -1,
|
|
272
|
-
for (this.clear(); ++t <
|
|
273
|
-
var
|
|
274
|
-
this.set(
|
|
271
|
+
var t = -1, n = e == null ? 0 : e.length;
|
|
272
|
+
for (this.clear(); ++t < n; ) {
|
|
273
|
+
var r = e[t];
|
|
274
|
+
this.set(r[0], r[1]);
|
|
275
275
|
}
|
|
276
276
|
}
|
|
277
|
-
L.prototype.clear =
|
|
278
|
-
L.prototype.delete =
|
|
279
|
-
L.prototype.get =
|
|
280
|
-
L.prototype.has =
|
|
281
|
-
L.prototype.set =
|
|
282
|
-
var
|
|
283
|
-
function
|
|
277
|
+
L.prototype.clear = Xr;
|
|
278
|
+
L.prototype.delete = kr;
|
|
279
|
+
L.prototype.get = ei;
|
|
280
|
+
L.prototype.has = ti;
|
|
281
|
+
L.prototype.set = ni;
|
|
282
|
+
var fe = Z(F, "Map");
|
|
283
|
+
function ri() {
|
|
284
284
|
this.size = 0, this.__data__ = {
|
|
285
|
-
hash: new
|
|
286
|
-
map: new (
|
|
287
|
-
string: new
|
|
285
|
+
hash: new q(),
|
|
286
|
+
map: new (fe || L)(),
|
|
287
|
+
string: new q()
|
|
288
288
|
};
|
|
289
289
|
}
|
|
290
|
-
function
|
|
290
|
+
function ii(e) {
|
|
291
291
|
var t = typeof e;
|
|
292
292
|
return t == "string" || t == "number" || t == "symbol" || t == "boolean" ? e !== "__proto__" : e === null;
|
|
293
293
|
}
|
|
294
|
-
function
|
|
295
|
-
var
|
|
296
|
-
return
|
|
294
|
+
function _e(e, t) {
|
|
295
|
+
var n = e.__data__;
|
|
296
|
+
return ii(t) ? n[typeof t == "string" ? "string" : "hash"] : n.map;
|
|
297
297
|
}
|
|
298
|
-
function
|
|
299
|
-
var t =
|
|
298
|
+
function oi(e) {
|
|
299
|
+
var t = _e(this, e).delete(e);
|
|
300
300
|
return this.size -= t ? 1 : 0, t;
|
|
301
301
|
}
|
|
302
|
-
function
|
|
303
|
-
return
|
|
302
|
+
function si(e) {
|
|
303
|
+
return _e(this, e).get(e);
|
|
304
304
|
}
|
|
305
|
-
function
|
|
306
|
-
return
|
|
305
|
+
function ai(e) {
|
|
306
|
+
return _e(this, e).has(e);
|
|
307
307
|
}
|
|
308
|
-
function
|
|
309
|
-
var
|
|
310
|
-
return
|
|
308
|
+
function ci(e, t) {
|
|
309
|
+
var n = _e(this, e), r = n.size;
|
|
310
|
+
return n.set(e, t), this.size += n.size == r ? 0 : 1, this;
|
|
311
311
|
}
|
|
312
312
|
function N(e) {
|
|
313
|
-
var t = -1,
|
|
314
|
-
for (this.clear(); ++t <
|
|
315
|
-
var
|
|
316
|
-
this.set(
|
|
313
|
+
var t = -1, n = e == null ? 0 : e.length;
|
|
314
|
+
for (this.clear(); ++t < n; ) {
|
|
315
|
+
var r = e[t];
|
|
316
|
+
this.set(r[0], r[1]);
|
|
317
317
|
}
|
|
318
318
|
}
|
|
319
|
-
N.prototype.clear =
|
|
320
|
-
N.prototype.delete =
|
|
321
|
-
N.prototype.get =
|
|
322
|
-
N.prototype.has =
|
|
323
|
-
N.prototype.set =
|
|
324
|
-
var
|
|
325
|
-
function
|
|
319
|
+
N.prototype.clear = ri;
|
|
320
|
+
N.prototype.delete = oi;
|
|
321
|
+
N.prototype.get = si;
|
|
322
|
+
N.prototype.has = ai;
|
|
323
|
+
N.prototype.set = ci;
|
|
324
|
+
var fi = "Expected a function";
|
|
325
|
+
function qe(e, t) {
|
|
326
326
|
if (typeof e != "function" || t != null && typeof t != "function")
|
|
327
|
-
throw new TypeError(
|
|
328
|
-
var
|
|
329
|
-
var
|
|
330
|
-
if (
|
|
331
|
-
return
|
|
332
|
-
var
|
|
333
|
-
return
|
|
327
|
+
throw new TypeError(fi);
|
|
328
|
+
var n = function() {
|
|
329
|
+
var r = arguments, i = t ? t.apply(this, r) : r[0], o = n.cache;
|
|
330
|
+
if (o.has(i))
|
|
331
|
+
return o.get(i);
|
|
332
|
+
var s = e.apply(this, r);
|
|
333
|
+
return n.cache = o.set(i, s) || o, s;
|
|
334
334
|
};
|
|
335
|
-
return
|
|
336
|
-
}
|
|
337
|
-
|
|
338
|
-
var
|
|
339
|
-
function
|
|
340
|
-
var t =
|
|
341
|
-
return
|
|
342
|
-
}),
|
|
335
|
+
return n.cache = new (qe.Cache || N)(), n;
|
|
336
|
+
}
|
|
337
|
+
qe.Cache = N;
|
|
338
|
+
var ui = 500;
|
|
339
|
+
function li(e) {
|
|
340
|
+
var t = qe(e, function(r) {
|
|
341
|
+
return n.size === ui && n.clear(), r;
|
|
342
|
+
}), n = t.cache;
|
|
343
343
|
return t;
|
|
344
344
|
}
|
|
345
|
-
var
|
|
345
|
+
var pi = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, di = /\\(\\)?/g, hi = li(function(e) {
|
|
346
346
|
var t = [];
|
|
347
|
-
return e.charCodeAt(0) === 46 && t.push(""), e.replace(
|
|
348
|
-
t.push(i ?
|
|
347
|
+
return e.charCodeAt(0) === 46 && t.push(""), e.replace(pi, function(n, r, i, o) {
|
|
348
|
+
t.push(i ? o.replace(di, "$1") : r || n);
|
|
349
349
|
}), t;
|
|
350
350
|
});
|
|
351
|
-
function
|
|
352
|
-
return e == null ? "" :
|
|
351
|
+
function yi(e) {
|
|
352
|
+
return e == null ? "" : It(e);
|
|
353
353
|
}
|
|
354
|
-
function
|
|
355
|
-
return T(e) ? e :
|
|
354
|
+
function Ye(e, t) {
|
|
355
|
+
return T(e) ? e : Ve(e, t) ? [e] : hi(yi(e));
|
|
356
356
|
}
|
|
357
|
-
function
|
|
358
|
-
if (typeof e == "string" ||
|
|
357
|
+
function le(e) {
|
|
358
|
+
if (typeof e == "string" || Ue(e))
|
|
359
359
|
return e;
|
|
360
360
|
var t = e + "";
|
|
361
361
|
return t == "0" && 1 / e == -1 / 0 ? "-0" : t;
|
|
362
362
|
}
|
|
363
|
-
function
|
|
364
|
-
t =
|
|
365
|
-
for (var
|
|
366
|
-
e = e[
|
|
367
|
-
return
|
|
368
|
-
}
|
|
369
|
-
function
|
|
370
|
-
var
|
|
371
|
-
return
|
|
372
|
-
}
|
|
373
|
-
function
|
|
374
|
-
for (var
|
|
375
|
-
e[i +
|
|
363
|
+
function Bt(e, t) {
|
|
364
|
+
t = Ye(t, e);
|
|
365
|
+
for (var n = 0, r = t.length; e != null && n < r; )
|
|
366
|
+
e = e[le(t[n++])];
|
|
367
|
+
return n && n == r ? e : void 0;
|
|
368
|
+
}
|
|
369
|
+
function bi(e, t, n) {
|
|
370
|
+
var r = e == null ? void 0 : Bt(e, t);
|
|
371
|
+
return r === void 0 ? n : r;
|
|
372
|
+
}
|
|
373
|
+
function gi(e, t) {
|
|
374
|
+
for (var n = -1, r = t.length, i = e.length; ++n < r; )
|
|
375
|
+
e[i + n] = t[n];
|
|
376
376
|
return e;
|
|
377
377
|
}
|
|
378
|
-
var
|
|
379
|
-
function
|
|
380
|
-
return
|
|
378
|
+
var mi = "\\ud800-\\udfff", vi = "\\u0300-\\u036f", wi = "\\ufe20-\\ufe2f", _i = "\\u20d0-\\u20ff", Oi = vi + wi + _i, Si = "\\ufe0e\\ufe0f", Ai = "\\u200d", Ei = RegExp("[" + Ai + mi + Oi + Si + "]");
|
|
379
|
+
function Mi(e) {
|
|
380
|
+
return Ei.test(e);
|
|
381
381
|
}
|
|
382
|
-
function
|
|
382
|
+
function Ti() {
|
|
383
383
|
this.__data__ = new L(), this.size = 0;
|
|
384
384
|
}
|
|
385
|
-
function
|
|
386
|
-
var t = this.__data__,
|
|
387
|
-
return this.size = t.size,
|
|
385
|
+
function Pi(e) {
|
|
386
|
+
var t = this.__data__, n = t.delete(e);
|
|
387
|
+
return this.size = t.size, n;
|
|
388
388
|
}
|
|
389
|
-
function
|
|
389
|
+
function Ci(e) {
|
|
390
390
|
return this.__data__.get(e);
|
|
391
391
|
}
|
|
392
|
-
function
|
|
392
|
+
function Ri(e) {
|
|
393
393
|
return this.__data__.has(e);
|
|
394
394
|
}
|
|
395
|
-
var
|
|
396
|
-
function
|
|
397
|
-
var
|
|
398
|
-
if (
|
|
399
|
-
var
|
|
400
|
-
if (!
|
|
401
|
-
return
|
|
402
|
-
|
|
395
|
+
var xi = 200;
|
|
396
|
+
function $i(e, t) {
|
|
397
|
+
var n = this.__data__;
|
|
398
|
+
if (n instanceof L) {
|
|
399
|
+
var r = n.__data__;
|
|
400
|
+
if (!fe || r.length < xi - 1)
|
|
401
|
+
return r.push([e, t]), this.size = ++n.size, this;
|
|
402
|
+
n = this.__data__ = new N(r);
|
|
403
403
|
}
|
|
404
|
-
return
|
|
404
|
+
return n.set(e, t), this.size = n.size, this;
|
|
405
405
|
}
|
|
406
406
|
function I(e) {
|
|
407
407
|
var t = this.__data__ = new L(e);
|
|
408
408
|
this.size = t.size;
|
|
409
409
|
}
|
|
410
|
-
I.prototype.clear =
|
|
411
|
-
I.prototype.delete =
|
|
412
|
-
I.prototype.get =
|
|
413
|
-
I.prototype.has =
|
|
414
|
-
I.prototype.set =
|
|
415
|
-
function
|
|
416
|
-
for (var
|
|
417
|
-
var
|
|
418
|
-
t(
|
|
410
|
+
I.prototype.clear = Ti;
|
|
411
|
+
I.prototype.delete = Pi;
|
|
412
|
+
I.prototype.get = Ci;
|
|
413
|
+
I.prototype.has = Ri;
|
|
414
|
+
I.prototype.set = $i;
|
|
415
|
+
function ji(e, t) {
|
|
416
|
+
for (var n = -1, r = e == null ? 0 : e.length, i = 0, o = []; ++n < r; ) {
|
|
417
|
+
var s = e[n];
|
|
418
|
+
t(s, n, e) && (o[i++] = s);
|
|
419
419
|
}
|
|
420
|
-
return
|
|
420
|
+
return o;
|
|
421
421
|
}
|
|
422
|
-
function
|
|
422
|
+
function Ii() {
|
|
423
423
|
return [];
|
|
424
424
|
}
|
|
425
|
-
var
|
|
426
|
-
return e == null ? [] : (e = Object(e),
|
|
427
|
-
return
|
|
425
|
+
var zi = Object.prototype, Di = zi.propertyIsEnumerable, pt = Object.getOwnPropertySymbols, Fi = pt ? function(e) {
|
|
426
|
+
return e == null ? [] : (e = Object(e), ji(pt(e), function(t) {
|
|
427
|
+
return Di.call(e, t);
|
|
428
428
|
}));
|
|
429
|
-
} :
|
|
430
|
-
function
|
|
431
|
-
var
|
|
432
|
-
return T(e) ?
|
|
433
|
-
}
|
|
434
|
-
function
|
|
435
|
-
return
|
|
436
|
-
}
|
|
437
|
-
var
|
|
438
|
-
(
|
|
439
|
-
var t =
|
|
440
|
-
if (
|
|
441
|
-
switch (
|
|
442
|
-
case
|
|
429
|
+
} : Ii;
|
|
430
|
+
function Li(e, t, n) {
|
|
431
|
+
var r = t(e);
|
|
432
|
+
return T(e) ? r : gi(r, n(e));
|
|
433
|
+
}
|
|
434
|
+
function dt(e) {
|
|
435
|
+
return Li(e, We, Fi);
|
|
436
|
+
}
|
|
437
|
+
var Ce = Z(F, "DataView"), Re = Z(F, "Promise"), xe = Z(F, "Set"), ht = "[object Map]", Ni = "[object Object]", yt = "[object Promise]", bt = "[object Set]", gt = "[object WeakMap]", mt = "[object DataView]", Ui = X(Ce), Ki = X(fe), Bi = X(Re), Gi = X(xe), Hi = X(Te), j = J;
|
|
438
|
+
(Ce && j(new Ce(new ArrayBuffer(1))) != mt || fe && j(new fe()) != ht || Re && j(Re.resolve()) != yt || xe && j(new xe()) != bt || Te && j(new Te()) != gt) && (j = function(e) {
|
|
439
|
+
var t = J(e), n = t == Ni ? e.constructor : void 0, r = n ? X(n) : "";
|
|
440
|
+
if (r)
|
|
441
|
+
switch (r) {
|
|
442
|
+
case Ui:
|
|
443
|
+
return mt;
|
|
444
|
+
case Ki:
|
|
443
445
|
return ht;
|
|
444
|
-
case
|
|
445
|
-
return
|
|
446
|
-
case
|
|
447
|
-
return
|
|
448
|
-
case
|
|
449
|
-
return
|
|
450
|
-
case Ni:
|
|
451
|
-
return dt;
|
|
446
|
+
case Bi:
|
|
447
|
+
return yt;
|
|
448
|
+
case Gi:
|
|
449
|
+
return bt;
|
|
450
|
+
case Hi:
|
|
451
|
+
return gt;
|
|
452
452
|
}
|
|
453
453
|
return t;
|
|
454
454
|
});
|
|
455
|
-
var
|
|
456
|
-
function
|
|
457
|
-
|
|
455
|
+
var vt = F.Uint8Array;
|
|
456
|
+
function wt(e) {
|
|
457
|
+
for (var t = -1, n = e == null ? 0 : e.length, r = 0, i = []; ++t < n; ) {
|
|
458
|
+
var o = e[t];
|
|
459
|
+
o && (i[r++] = o);
|
|
460
|
+
}
|
|
461
|
+
return i;
|
|
462
|
+
}
|
|
463
|
+
var Wi = "__lodash_hash_undefined__";
|
|
464
|
+
function Vi(e) {
|
|
465
|
+
return this.__data__.set(e, Wi), this;
|
|
458
466
|
}
|
|
459
|
-
function
|
|
467
|
+
function qi(e) {
|
|
460
468
|
return this.__data__.has(e);
|
|
461
469
|
}
|
|
462
|
-
function
|
|
463
|
-
var t = -1,
|
|
464
|
-
for (this.__data__ = new N(); ++t <
|
|
470
|
+
function be(e) {
|
|
471
|
+
var t = -1, n = e == null ? 0 : e.length;
|
|
472
|
+
for (this.__data__ = new N(); ++t < n; )
|
|
465
473
|
this.add(e[t]);
|
|
466
474
|
}
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
function
|
|
470
|
-
for (var
|
|
471
|
-
if (t(e[
|
|
475
|
+
be.prototype.add = be.prototype.push = Vi;
|
|
476
|
+
be.prototype.has = qi;
|
|
477
|
+
function Gt(e, t) {
|
|
478
|
+
for (var n = -1, r = e == null ? 0 : e.length; ++n < r; )
|
|
479
|
+
if (t(e[n], n, e))
|
|
472
480
|
return !0;
|
|
473
481
|
return !1;
|
|
474
482
|
}
|
|
475
|
-
function
|
|
483
|
+
function Yi(e, t) {
|
|
476
484
|
return e.has(t);
|
|
477
485
|
}
|
|
478
|
-
var
|
|
479
|
-
function
|
|
480
|
-
var
|
|
481
|
-
if (c != a && !(
|
|
486
|
+
var Ji = 1, Xi = 2;
|
|
487
|
+
function Ht(e, t, n, r, i, o) {
|
|
488
|
+
var s = n & Ji, c = e.length, a = t.length;
|
|
489
|
+
if (c != a && !(s && a > c))
|
|
482
490
|
return !1;
|
|
483
|
-
var f =
|
|
491
|
+
var f = o.get(e), u = o.get(t);
|
|
484
492
|
if (f && u)
|
|
485
493
|
return f == t && u == e;
|
|
486
|
-
var l = -1,
|
|
487
|
-
for (
|
|
488
|
-
var
|
|
489
|
-
if (
|
|
490
|
-
var
|
|
491
|
-
if (
|
|
492
|
-
if (
|
|
494
|
+
var l = -1, p = !0, d = n & Xi ? new be() : void 0;
|
|
495
|
+
for (o.set(e, t), o.set(t, e); ++l < c; ) {
|
|
496
|
+
var b = e[l], w = t[l];
|
|
497
|
+
if (r)
|
|
498
|
+
var _ = s ? r(w, b, l, t, e, o) : r(b, w, l, e, t, o);
|
|
499
|
+
if (_ !== void 0) {
|
|
500
|
+
if (_)
|
|
493
501
|
continue;
|
|
494
|
-
|
|
502
|
+
p = !1;
|
|
495
503
|
break;
|
|
496
504
|
}
|
|
497
|
-
if (
|
|
498
|
-
if (!
|
|
499
|
-
if (!
|
|
500
|
-
return
|
|
505
|
+
if (d) {
|
|
506
|
+
if (!Gt(t, function(O, m) {
|
|
507
|
+
if (!Yi(d, m) && (b === O || i(b, O, n, r, o)))
|
|
508
|
+
return d.push(m);
|
|
501
509
|
})) {
|
|
502
|
-
|
|
510
|
+
p = !1;
|
|
503
511
|
break;
|
|
504
512
|
}
|
|
505
|
-
} else if (!(
|
|
506
|
-
|
|
513
|
+
} else if (!(b === w || i(b, w, n, r, o))) {
|
|
514
|
+
p = !1;
|
|
507
515
|
break;
|
|
508
516
|
}
|
|
509
517
|
}
|
|
510
|
-
return
|
|
518
|
+
return o.delete(e), o.delete(t), p;
|
|
511
519
|
}
|
|
512
|
-
function
|
|
513
|
-
var t = -1,
|
|
514
|
-
return e.forEach(function(
|
|
515
|
-
|
|
516
|
-
}),
|
|
520
|
+
function Zi(e) {
|
|
521
|
+
var t = -1, n = Array(e.size);
|
|
522
|
+
return e.forEach(function(r, i) {
|
|
523
|
+
n[++t] = [i, r];
|
|
524
|
+
}), n;
|
|
517
525
|
}
|
|
518
|
-
function
|
|
519
|
-
var t = -1,
|
|
520
|
-
return e.forEach(function(
|
|
521
|
-
|
|
522
|
-
}),
|
|
526
|
+
function Qi(e) {
|
|
527
|
+
var t = -1, n = Array(e.size);
|
|
528
|
+
return e.forEach(function(r) {
|
|
529
|
+
n[++t] = r;
|
|
530
|
+
}), n;
|
|
523
531
|
}
|
|
524
|
-
var
|
|
525
|
-
function
|
|
526
|
-
switch (
|
|
527
|
-
case
|
|
532
|
+
var ki = 1, eo = 2, to = "[object Boolean]", no = "[object Date]", ro = "[object Error]", io = "[object Map]", oo = "[object Number]", so = "[object RegExp]", ao = "[object Set]", co = "[object String]", fo = "[object Symbol]", uo = "[object ArrayBuffer]", lo = "[object DataView]", _t = G ? G.prototype : void 0, Ee = _t ? _t.valueOf : void 0;
|
|
533
|
+
function po(e, t, n, r, i, o, s) {
|
|
534
|
+
switch (n) {
|
|
535
|
+
case lo:
|
|
528
536
|
if (e.byteLength != t.byteLength || e.byteOffset != t.byteOffset)
|
|
529
537
|
return !1;
|
|
530
538
|
e = e.buffer, t = t.buffer;
|
|
531
|
-
case
|
|
532
|
-
return !(e.byteLength != t.byteLength || !
|
|
533
|
-
case
|
|
534
|
-
case
|
|
535
|
-
case
|
|
536
|
-
return
|
|
537
|
-
case
|
|
539
|
+
case uo:
|
|
540
|
+
return !(e.byteLength != t.byteLength || !o(new vt(e), new vt(t)));
|
|
541
|
+
case to:
|
|
542
|
+
case no:
|
|
543
|
+
case oo:
|
|
544
|
+
return Ge(+e, +t);
|
|
545
|
+
case ro:
|
|
538
546
|
return e.name == t.name && e.message == t.message;
|
|
539
|
-
case
|
|
540
|
-
case
|
|
547
|
+
case so:
|
|
548
|
+
case co:
|
|
541
549
|
return e == t + "";
|
|
542
|
-
case
|
|
543
|
-
var c =
|
|
544
|
-
case
|
|
545
|
-
var a =
|
|
546
|
-
if (c || (c =
|
|
550
|
+
case io:
|
|
551
|
+
var c = Zi;
|
|
552
|
+
case ao:
|
|
553
|
+
var a = r & ki;
|
|
554
|
+
if (c || (c = Qi), e.size != t.size && !a)
|
|
547
555
|
return !1;
|
|
548
|
-
var f =
|
|
556
|
+
var f = s.get(e);
|
|
549
557
|
if (f)
|
|
550
558
|
return f == t;
|
|
551
|
-
|
|
552
|
-
var u =
|
|
553
|
-
return
|
|
554
|
-
case
|
|
555
|
-
if (
|
|
556
|
-
return
|
|
559
|
+
r |= eo, s.set(e, t);
|
|
560
|
+
var u = Ht(c(e), c(t), r, i, o, s);
|
|
561
|
+
return s.delete(e), u;
|
|
562
|
+
case fo:
|
|
563
|
+
if (Ee)
|
|
564
|
+
return Ee.call(e) == Ee.call(t);
|
|
557
565
|
}
|
|
558
566
|
return !1;
|
|
559
567
|
}
|
|
560
|
-
var
|
|
561
|
-
function
|
|
562
|
-
var
|
|
563
|
-
if (a != u && !
|
|
568
|
+
var ho = 1, yo = Object.prototype, bo = yo.hasOwnProperty;
|
|
569
|
+
function go(e, t, n, r, i, o) {
|
|
570
|
+
var s = n & ho, c = dt(e), a = c.length, f = dt(t), u = f.length;
|
|
571
|
+
if (a != u && !s)
|
|
564
572
|
return !1;
|
|
565
573
|
for (var l = a; l--; ) {
|
|
566
|
-
var
|
|
567
|
-
if (!(
|
|
574
|
+
var p = c[l];
|
|
575
|
+
if (!(s ? p in t : bo.call(t, p)))
|
|
568
576
|
return !1;
|
|
569
577
|
}
|
|
570
|
-
var
|
|
571
|
-
if (
|
|
572
|
-
return
|
|
573
|
-
var
|
|
574
|
-
|
|
575
|
-
for (var
|
|
576
|
-
|
|
577
|
-
var
|
|
578
|
-
if (
|
|
579
|
-
var A =
|
|
580
|
-
if (!(A === void 0 ?
|
|
581
|
-
|
|
578
|
+
var d = o.get(e), b = o.get(t);
|
|
579
|
+
if (d && b)
|
|
580
|
+
return d == t && b == e;
|
|
581
|
+
var w = !0;
|
|
582
|
+
o.set(e, t), o.set(t, e);
|
|
583
|
+
for (var _ = s; ++l < a; ) {
|
|
584
|
+
p = c[l];
|
|
585
|
+
var O = e[p], m = t[p];
|
|
586
|
+
if (r)
|
|
587
|
+
var A = s ? r(m, O, p, t, e, o) : r(O, m, p, e, t, o);
|
|
588
|
+
if (!(A === void 0 ? O === m || i(O, m, n, r, o) : A)) {
|
|
589
|
+
w = !1;
|
|
582
590
|
break;
|
|
583
591
|
}
|
|
584
|
-
|
|
592
|
+
_ || (_ = p == "constructor");
|
|
585
593
|
}
|
|
586
|
-
if (
|
|
587
|
-
var
|
|
588
|
-
|
|
594
|
+
if (w && !_) {
|
|
595
|
+
var H = e.constructor, y = t.constructor;
|
|
596
|
+
H != y && "constructor" in e && "constructor" in t && !(typeof H == "function" && H instanceof H && typeof y == "function" && y instanceof y) && (w = !1);
|
|
589
597
|
}
|
|
590
|
-
return
|
|
591
|
-
}
|
|
592
|
-
var
|
|
593
|
-
function
|
|
594
|
-
var
|
|
595
|
-
a = a ==
|
|
596
|
-
var u = a ==
|
|
597
|
-
if (
|
|
598
|
-
if (!
|
|
598
|
+
return o.delete(e), o.delete(t), w;
|
|
599
|
+
}
|
|
600
|
+
var mo = 1, Ot = "[object Arguments]", St = "[object Array]", de = "[object Object]", vo = Object.prototype, At = vo.hasOwnProperty;
|
|
601
|
+
function wo(e, t, n, r, i, o) {
|
|
602
|
+
var s = T(e), c = T(t), a = s ? St : j(e), f = c ? St : j(t);
|
|
603
|
+
a = a == Ot ? de : a, f = f == Ot ? de : f;
|
|
604
|
+
var u = a == de, l = f == de, p = a == f;
|
|
605
|
+
if (p && Pe(e)) {
|
|
606
|
+
if (!Pe(t))
|
|
599
607
|
return !1;
|
|
600
|
-
|
|
608
|
+
s = !0, u = !1;
|
|
601
609
|
}
|
|
602
|
-
if (
|
|
603
|
-
return
|
|
604
|
-
if (!(
|
|
605
|
-
var
|
|
606
|
-
if (
|
|
607
|
-
var
|
|
608
|
-
return
|
|
610
|
+
if (p && !u)
|
|
611
|
+
return o || (o = new I()), s || Ut(e) ? Ht(e, t, n, r, i, o) : po(e, t, a, n, r, i, o);
|
|
612
|
+
if (!(n & mo)) {
|
|
613
|
+
var d = u && At.call(e, "__wrapped__"), b = l && At.call(t, "__wrapped__");
|
|
614
|
+
if (d || b) {
|
|
615
|
+
var w = d ? e.value() : e, _ = b ? t.value() : t;
|
|
616
|
+
return o || (o = new I()), i(w, _, n, r, o);
|
|
609
617
|
}
|
|
610
618
|
}
|
|
611
|
-
return
|
|
619
|
+
return p ? (o || (o = new I()), go(e, t, n, r, i, o)) : !1;
|
|
612
620
|
}
|
|
613
|
-
function
|
|
614
|
-
return e === t ? !0 : e == null || t == null || !
|
|
621
|
+
function Oe(e, t, n, r, i) {
|
|
622
|
+
return e === t ? !0 : e == null || t == null || !V(e) && !V(t) ? e !== e && t !== t : wo(e, t, n, r, Oe, i);
|
|
615
623
|
}
|
|
616
|
-
var
|
|
617
|
-
function
|
|
618
|
-
var i =
|
|
624
|
+
var _o = 1, Oo = 2;
|
|
625
|
+
function So(e, t, n, r) {
|
|
626
|
+
var i = n.length, o = i;
|
|
619
627
|
if (e == null)
|
|
620
|
-
return !
|
|
628
|
+
return !o;
|
|
621
629
|
for (e = Object(e); i--; ) {
|
|
622
|
-
var
|
|
623
|
-
if (
|
|
630
|
+
var s = n[i];
|
|
631
|
+
if (s[2] ? s[1] !== e[s[0]] : !(s[0] in e))
|
|
624
632
|
return !1;
|
|
625
633
|
}
|
|
626
|
-
for (; ++i <
|
|
627
|
-
|
|
628
|
-
var c =
|
|
629
|
-
if (
|
|
634
|
+
for (; ++i < o; ) {
|
|
635
|
+
s = n[i];
|
|
636
|
+
var c = s[0], a = e[c], f = s[1];
|
|
637
|
+
if (s[2]) {
|
|
630
638
|
if (a === void 0 && !(c in e))
|
|
631
639
|
return !1;
|
|
632
640
|
} else {
|
|
633
641
|
var u = new I(), l;
|
|
634
|
-
if (!(l === void 0 ?
|
|
642
|
+
if (!(l === void 0 ? Oe(f, a, _o | Oo, r, u) : l))
|
|
635
643
|
return !1;
|
|
636
644
|
}
|
|
637
645
|
}
|
|
638
646
|
return !0;
|
|
639
647
|
}
|
|
640
|
-
function
|
|
641
|
-
return e === e && !
|
|
648
|
+
function Wt(e) {
|
|
649
|
+
return e === e && !ae(e);
|
|
642
650
|
}
|
|
643
|
-
function
|
|
644
|
-
for (var t =
|
|
645
|
-
var
|
|
646
|
-
t[
|
|
651
|
+
function Ao(e) {
|
|
652
|
+
for (var t = We(e), n = t.length; n--; ) {
|
|
653
|
+
var r = t[n], i = e[r];
|
|
654
|
+
t[n] = [r, i, Wt(i)];
|
|
647
655
|
}
|
|
648
656
|
return t;
|
|
649
657
|
}
|
|
650
|
-
function
|
|
651
|
-
return function(
|
|
652
|
-
return
|
|
658
|
+
function Vt(e, t) {
|
|
659
|
+
return function(n) {
|
|
660
|
+
return n == null ? !1 : n[e] === t && (t !== void 0 || e in Object(n));
|
|
653
661
|
};
|
|
654
662
|
}
|
|
655
|
-
function
|
|
656
|
-
var t =
|
|
657
|
-
return t.length == 1 && t[0][2] ?
|
|
658
|
-
return
|
|
663
|
+
function Eo(e) {
|
|
664
|
+
var t = Ao(e);
|
|
665
|
+
return t.length == 1 && t[0][2] ? Vt(t[0][0], t[0][1]) : function(n) {
|
|
666
|
+
return n === e || So(n, e, t);
|
|
659
667
|
};
|
|
660
668
|
}
|
|
661
|
-
function
|
|
669
|
+
function Mo(e, t) {
|
|
662
670
|
return e != null && t in Object(e);
|
|
663
671
|
}
|
|
664
|
-
function
|
|
665
|
-
t =
|
|
666
|
-
for (var
|
|
667
|
-
var
|
|
668
|
-
if (!(
|
|
672
|
+
function To(e, t, n) {
|
|
673
|
+
t = Ye(t, e);
|
|
674
|
+
for (var r = -1, i = t.length, o = !1; ++r < i; ) {
|
|
675
|
+
var s = le(t[r]);
|
|
676
|
+
if (!(o = e != null && n(e, s)))
|
|
669
677
|
break;
|
|
670
|
-
e = e[
|
|
678
|
+
e = e[s];
|
|
671
679
|
}
|
|
672
|
-
return
|
|
680
|
+
return o || ++r != i ? o : (i = e == null ? 0 : e.length, !!i && He(i) && Be(s, i) && (T(e) || Ft(e)));
|
|
673
681
|
}
|
|
674
|
-
function
|
|
675
|
-
return e != null &&
|
|
682
|
+
function Po(e, t) {
|
|
683
|
+
return e != null && To(e, t, Mo);
|
|
676
684
|
}
|
|
677
|
-
var
|
|
678
|
-
function
|
|
679
|
-
return
|
|
680
|
-
var
|
|
681
|
-
return
|
|
685
|
+
var Co = 1, Ro = 2;
|
|
686
|
+
function xo(e, t) {
|
|
687
|
+
return Ve(e) && Wt(t) ? Vt(le(e), t) : function(n) {
|
|
688
|
+
var r = bi(n, e);
|
|
689
|
+
return r === void 0 && r === t ? Po(n, e) : Oe(t, r, Co | Ro);
|
|
682
690
|
};
|
|
683
691
|
}
|
|
684
|
-
function
|
|
692
|
+
function qt(e) {
|
|
685
693
|
return function(t) {
|
|
686
694
|
return t?.[e];
|
|
687
695
|
};
|
|
688
696
|
}
|
|
689
|
-
function
|
|
697
|
+
function $o(e) {
|
|
690
698
|
return function(t) {
|
|
691
|
-
return
|
|
699
|
+
return Bt(t, e);
|
|
692
700
|
};
|
|
693
701
|
}
|
|
694
|
-
function
|
|
695
|
-
return
|
|
702
|
+
function jo(e) {
|
|
703
|
+
return Ve(e) ? qt(le(e)) : $o(e);
|
|
696
704
|
}
|
|
697
|
-
function
|
|
698
|
-
return typeof e == "function" ? e : e == null ?
|
|
705
|
+
function Yt(e) {
|
|
706
|
+
return typeof e == "function" ? e : e == null ? Ke : typeof e == "object" ? T(e) ? xo(e[0], e[1]) : Eo(e) : jo(e);
|
|
699
707
|
}
|
|
700
|
-
function
|
|
701
|
-
return function(t,
|
|
702
|
-
for (var i = -1,
|
|
703
|
-
var a =
|
|
704
|
-
if (
|
|
708
|
+
function Io(e) {
|
|
709
|
+
return function(t, n, r) {
|
|
710
|
+
for (var i = -1, o = Object(t), s = r(t), c = s.length; c--; ) {
|
|
711
|
+
var a = s[++i];
|
|
712
|
+
if (n(o[a], a, o) === !1)
|
|
705
713
|
break;
|
|
706
714
|
}
|
|
707
715
|
return t;
|
|
708
716
|
};
|
|
709
717
|
}
|
|
710
|
-
var
|
|
711
|
-
function
|
|
712
|
-
return e &&
|
|
713
|
-
}
|
|
714
|
-
function
|
|
715
|
-
return function(
|
|
716
|
-
if (
|
|
717
|
-
return
|
|
718
|
-
if (!
|
|
719
|
-
return e(
|
|
720
|
-
for (var i =
|
|
718
|
+
var zo = Io();
|
|
719
|
+
function Do(e, t) {
|
|
720
|
+
return e && zo(e, t, We);
|
|
721
|
+
}
|
|
722
|
+
function Fo(e, t) {
|
|
723
|
+
return function(n, r) {
|
|
724
|
+
if (n == null)
|
|
725
|
+
return n;
|
|
726
|
+
if (!ve(n))
|
|
727
|
+
return e(n, r);
|
|
728
|
+
for (var i = n.length, o = -1, s = Object(n); ++o < i && r(s[o], o, s) !== !1; )
|
|
721
729
|
;
|
|
722
|
-
return
|
|
730
|
+
return n;
|
|
723
731
|
};
|
|
724
732
|
}
|
|
725
|
-
var
|
|
726
|
-
function
|
|
727
|
-
var
|
|
728
|
-
return
|
|
729
|
-
|
|
730
|
-
}),
|
|
733
|
+
var Jt = Fo(Do);
|
|
734
|
+
function Lo(e, t) {
|
|
735
|
+
var n = -1, r = ve(e) ? Array(e.length) : [];
|
|
736
|
+
return Jt(e, function(i, o, s) {
|
|
737
|
+
r[++n] = t(i, o, s);
|
|
738
|
+
}), r;
|
|
739
|
+
}
|
|
740
|
+
function No(e, t) {
|
|
741
|
+
var n = T(e) ? jt : Lo;
|
|
742
|
+
return n(e, Yt(t));
|
|
731
743
|
}
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
return
|
|
744
|
+
var Uo = "[object String]";
|
|
745
|
+
function Ko(e) {
|
|
746
|
+
return typeof e == "string" || !T(e) && V(e) && J(e) == Uo;
|
|
735
747
|
}
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
return typeof e == "string" || !T(e) && W(e) && X(e) == Is;
|
|
748
|
+
function Bo(e, t) {
|
|
749
|
+
return Oe(e, t);
|
|
739
750
|
}
|
|
740
|
-
|
|
741
|
-
|
|
751
|
+
var Go = Array.prototype, Ho = Go.join;
|
|
752
|
+
function Et(e, t) {
|
|
753
|
+
return e == null ? "" : Ho.call(e, t);
|
|
742
754
|
}
|
|
743
|
-
function
|
|
744
|
-
if (!
|
|
755
|
+
function Wo(e, t, n, r) {
|
|
756
|
+
if (!ae(e))
|
|
745
757
|
return e;
|
|
746
|
-
t =
|
|
747
|
-
for (var i = -1,
|
|
748
|
-
var a =
|
|
758
|
+
t = Ye(t, e);
|
|
759
|
+
for (var i = -1, o = t.length, s = o - 1, c = e; c != null && ++i < o; ) {
|
|
760
|
+
var a = le(t[i]), f = n;
|
|
749
761
|
if (a === "__proto__" || a === "constructor" || a === "prototype")
|
|
750
762
|
return e;
|
|
751
|
-
if (i !=
|
|
763
|
+
if (i != s) {
|
|
752
764
|
var u = c[a];
|
|
753
|
-
f = void 0, f === void 0 && (f =
|
|
765
|
+
f = void 0, f === void 0 && (f = ae(u) ? u : Be(t[i + 1]) ? [] : {});
|
|
754
766
|
}
|
|
755
|
-
|
|
767
|
+
Vn(c, a, f), c = c[a];
|
|
756
768
|
}
|
|
757
769
|
return e;
|
|
758
770
|
}
|
|
759
|
-
var
|
|
760
|
-
function
|
|
761
|
-
for (var t =
|
|
771
|
+
var Vo = qt("length"), Xt = "\\ud800-\\udfff", qo = "\\u0300-\\u036f", Yo = "\\ufe20-\\ufe2f", Jo = "\\u20d0-\\u20ff", Xo = qo + Yo + Jo, Zo = "\\ufe0e\\ufe0f", Qo = "[" + Xt + "]", $e = "[" + Xo + "]", je = "\\ud83c[\\udffb-\\udfff]", ko = "(?:" + $e + "|" + je + ")", Zt = "[^" + Xt + "]", Qt = "(?:\\ud83c[\\udde6-\\uddff]){2}", kt = "[\\ud800-\\udbff][\\udc00-\\udfff]", es = "\\u200d", en = ko + "?", tn = "[" + Zo + "]?", ts = "(?:" + es + "(?:" + [Zt, Qt, kt].join("|") + ")" + tn + en + ")*", ns = tn + en + ts, rs = "(?:" + [Zt + $e + "?", $e, Qt, kt, Qo].join("|") + ")", Mt = RegExp(je + "(?=" + je + ")|" + rs + ns, "g");
|
|
772
|
+
function is(e) {
|
|
773
|
+
for (var t = Mt.lastIndex = 0; Mt.test(e); )
|
|
762
774
|
++t;
|
|
763
775
|
return t;
|
|
764
776
|
}
|
|
765
|
-
function
|
|
766
|
-
return
|
|
777
|
+
function os(e) {
|
|
778
|
+
return Mi(e) ? is(e) : Vo(e);
|
|
767
779
|
}
|
|
768
|
-
function
|
|
769
|
-
return e == null ? e :
|
|
780
|
+
function ss(e, t, n) {
|
|
781
|
+
return e == null ? e : Wo(e, t, n);
|
|
770
782
|
}
|
|
771
|
-
var
|
|
772
|
-
function
|
|
783
|
+
var as = "[object Map]", cs = "[object Set]";
|
|
784
|
+
function Ie(e) {
|
|
773
785
|
if (e == null)
|
|
774
786
|
return 0;
|
|
775
|
-
if (
|
|
776
|
-
return
|
|
787
|
+
if (ve(e))
|
|
788
|
+
return Ko(e) ? os(e) : e.length;
|
|
777
789
|
var t = j(e);
|
|
778
|
-
return t ==
|
|
790
|
+
return t == as || t == cs ? e.size : Kt(e).length;
|
|
779
791
|
}
|
|
780
|
-
function
|
|
781
|
-
var
|
|
782
|
-
return
|
|
783
|
-
return
|
|
784
|
-
}), !!
|
|
792
|
+
function fs(e, t) {
|
|
793
|
+
var n;
|
|
794
|
+
return Jt(e, function(r, i, o) {
|
|
795
|
+
return n = t(r, i, o), !n;
|
|
796
|
+
}), !!n;
|
|
785
797
|
}
|
|
786
|
-
function
|
|
787
|
-
var
|
|
788
|
-
return
|
|
798
|
+
function us(e, t, n) {
|
|
799
|
+
var r = T(e) ? Gt : fs;
|
|
800
|
+
return r(e, Yt(t));
|
|
789
801
|
}
|
|
790
|
-
const
|
|
802
|
+
const v = {
|
|
791
803
|
Remove: "remove",
|
|
792
804
|
Replace: "replace",
|
|
793
805
|
Add: "add"
|
|
794
|
-
},
|
|
806
|
+
}, nn = Symbol.for("__MUTATIVE_PROXY_DRAFT__"), ls = Symbol("__MUTATIVE_RAW_RETURN_SYMBOL__"), he = Symbol.iterator, M = {
|
|
795
807
|
mutable: "mutable",
|
|
796
808
|
immutable: "immutable"
|
|
797
|
-
},
|
|
798
|
-
function
|
|
809
|
+
}, Je = {};
|
|
810
|
+
function se(e, t) {
|
|
799
811
|
return e instanceof Map ? e.has(t) : Object.prototype.hasOwnProperty.call(e, t);
|
|
800
812
|
}
|
|
801
|
-
function
|
|
813
|
+
function Tt(e, t) {
|
|
802
814
|
if (t in e) {
|
|
803
|
-
let
|
|
804
|
-
for (;
|
|
805
|
-
const
|
|
806
|
-
if (
|
|
807
|
-
return
|
|
808
|
-
|
|
815
|
+
let n = Reflect.getPrototypeOf(e);
|
|
816
|
+
for (; n; ) {
|
|
817
|
+
const r = Reflect.getOwnPropertyDescriptor(n, t);
|
|
818
|
+
if (r)
|
|
819
|
+
return r;
|
|
820
|
+
n = Reflect.getPrototypeOf(n);
|
|
809
821
|
}
|
|
810
822
|
}
|
|
811
823
|
}
|
|
812
|
-
function
|
|
824
|
+
function Xe(e) {
|
|
813
825
|
return Object.getPrototypeOf(e) === Set.prototype;
|
|
814
826
|
}
|
|
815
|
-
function
|
|
827
|
+
function Ze(e) {
|
|
816
828
|
return Object.getPrototypeOf(e) === Map.prototype;
|
|
817
829
|
}
|
|
818
|
-
function
|
|
830
|
+
function E(e) {
|
|
819
831
|
var t;
|
|
820
832
|
return (t = e.copy) !== null && t !== void 0 ? t : e.original;
|
|
821
833
|
}
|
|
822
|
-
function
|
|
823
|
-
return !!
|
|
834
|
+
function Y(e) {
|
|
835
|
+
return !!h(e);
|
|
824
836
|
}
|
|
825
|
-
function
|
|
826
|
-
return typeof e != "object" ? null : e?.[
|
|
837
|
+
function h(e) {
|
|
838
|
+
return typeof e != "object" ? null : e?.[nn];
|
|
827
839
|
}
|
|
828
|
-
function
|
|
840
|
+
function Qe(e) {
|
|
829
841
|
var t;
|
|
830
|
-
const
|
|
831
|
-
return
|
|
842
|
+
const n = h(e);
|
|
843
|
+
return n ? (t = n.copy) !== null && t !== void 0 ? t : n.original : e;
|
|
832
844
|
}
|
|
833
|
-
function
|
|
845
|
+
function R(e, t) {
|
|
834
846
|
if (!e || typeof e != "object")
|
|
835
847
|
return !1;
|
|
836
|
-
let
|
|
837
|
-
return Object.getPrototypeOf(e) === Object.prototype || Array.isArray(e) || e instanceof Map || e instanceof Set || !!t?.mark && ((
|
|
848
|
+
let n;
|
|
849
|
+
return Object.getPrototypeOf(e) === Object.prototype || Array.isArray(e) || e instanceof Map || e instanceof Set || !!t?.mark && ((n = t.mark(e, M)) === M.immutable || typeof n == "function");
|
|
838
850
|
}
|
|
839
|
-
function
|
|
851
|
+
function rn(e, t = []) {
|
|
840
852
|
if (Object.hasOwnProperty.call(e, "key")) {
|
|
841
|
-
const
|
|
842
|
-
if (
|
|
853
|
+
const n = e.parent.copy, r = h(D(n, e.key));
|
|
854
|
+
if (r !== null && r?.original !== e.original)
|
|
843
855
|
return null;
|
|
844
|
-
const i = e.parent.type === 3,
|
|
845
|
-
if (!(i &&
|
|
856
|
+
const i = e.parent.type === 3, o = i ? Array.from(e.parent.setMap.keys()).indexOf(e.key) : e.key;
|
|
857
|
+
if (!(i && n.size > o || se(n, o)))
|
|
846
858
|
return null;
|
|
847
|
-
t.push(
|
|
859
|
+
t.push(o);
|
|
848
860
|
}
|
|
849
861
|
if (e.parent)
|
|
850
|
-
return
|
|
862
|
+
return rn(e.parent, t);
|
|
851
863
|
t.reverse();
|
|
852
864
|
try {
|
|
853
|
-
|
|
865
|
+
ps(e.copy, t);
|
|
854
866
|
} catch {
|
|
855
867
|
return null;
|
|
856
868
|
}
|
|
857
869
|
return t;
|
|
858
870
|
}
|
|
859
|
-
function
|
|
871
|
+
function Q(e) {
|
|
860
872
|
return Array.isArray(e) ? 1 : e instanceof Map ? 2 : e instanceof Set ? 3 : 0;
|
|
861
873
|
}
|
|
862
874
|
function D(e, t) {
|
|
863
|
-
return
|
|
875
|
+
return Q(e) === 2 ? e.get(t) : e[t];
|
|
864
876
|
}
|
|
865
|
-
function
|
|
866
|
-
|
|
877
|
+
function pe(e, t, n) {
|
|
878
|
+
Q(e) === 2 ? e.set(t, n) : e[t] = n;
|
|
867
879
|
}
|
|
868
|
-
function
|
|
869
|
-
const
|
|
870
|
-
return (
|
|
880
|
+
function Me(e, t) {
|
|
881
|
+
const n = h(e);
|
|
882
|
+
return (n ? E(n) : e)[t];
|
|
871
883
|
}
|
|
872
884
|
function z(e, t) {
|
|
873
885
|
return e === t ? e !== 0 || 1 / e === 1 / t : e !== e && t !== t;
|
|
874
886
|
}
|
|
875
|
-
function
|
|
887
|
+
function ze(e) {
|
|
876
888
|
if (e)
|
|
877
889
|
for (; e.finalities.revoke.length > 0; )
|
|
878
890
|
e.finalities.revoke.pop()();
|
|
879
891
|
}
|
|
880
|
-
function
|
|
881
|
-
return t ? e : [""].concat(e).map((
|
|
882
|
-
const
|
|
883
|
-
return
|
|
892
|
+
function W(e, t) {
|
|
893
|
+
return t ? e : [""].concat(e).map((n) => {
|
|
894
|
+
const r = `${n}`;
|
|
895
|
+
return r.indexOf("/") === -1 && r.indexOf("~") === -1 ? r : r.replace(/~/g, "~0").replace(/\//g, "~1");
|
|
884
896
|
}).join("/");
|
|
885
897
|
}
|
|
886
|
-
function
|
|
887
|
-
for (let
|
|
888
|
-
const
|
|
889
|
-
if (e = D(
|
|
898
|
+
function ps(e, t) {
|
|
899
|
+
for (let n = 0; n < t.length - 1; n += 1) {
|
|
900
|
+
const r = t[n];
|
|
901
|
+
if (e = D(Q(e) === 3 ? Array.from(e) : e, r), typeof e != "object")
|
|
890
902
|
throw new Error(`Cannot resolve patch at '${t.join("/")}'.`);
|
|
891
903
|
}
|
|
892
904
|
return e;
|
|
893
905
|
}
|
|
894
|
-
function
|
|
906
|
+
function ds(e) {
|
|
895
907
|
const t = Object.create(Object.getPrototypeOf(e));
|
|
896
|
-
return Reflect.ownKeys(e).forEach((
|
|
897
|
-
let
|
|
898
|
-
if (
|
|
899
|
-
t[
|
|
908
|
+
return Reflect.ownKeys(e).forEach((n) => {
|
|
909
|
+
let r = Reflect.getOwnPropertyDescriptor(e, n);
|
|
910
|
+
if (r.enumerable && r.configurable && r.writable) {
|
|
911
|
+
t[n] = e[n];
|
|
900
912
|
return;
|
|
901
913
|
}
|
|
902
|
-
|
|
914
|
+
r.writable || (r.writable = !0, r.configurable = !0), (r.get || r.set) && (r = {
|
|
903
915
|
configurable: !0,
|
|
904
916
|
writable: !0,
|
|
905
|
-
enumerable:
|
|
906
|
-
value: e[
|
|
907
|
-
}), Reflect.defineProperty(t,
|
|
917
|
+
enumerable: r.enumerable,
|
|
918
|
+
value: e[n]
|
|
919
|
+
}), Reflect.defineProperty(t, n, r);
|
|
908
920
|
}), t;
|
|
909
921
|
}
|
|
910
|
-
const
|
|
911
|
-
function
|
|
912
|
-
let
|
|
922
|
+
const hs = Object.prototype.propertyIsEnumerable;
|
|
923
|
+
function on(e, t) {
|
|
924
|
+
let n;
|
|
913
925
|
if (Array.isArray(e))
|
|
914
926
|
return Array.prototype.concat.call(e);
|
|
915
927
|
if (e instanceof Set) {
|
|
916
|
-
if (!
|
|
917
|
-
const
|
|
918
|
-
return new
|
|
928
|
+
if (!Xe(e)) {
|
|
929
|
+
const r = Object.getPrototypeOf(e).constructor;
|
|
930
|
+
return new r(e.values());
|
|
919
931
|
}
|
|
920
932
|
return Set.prototype.difference ? Set.prototype.difference.call(e, /* @__PURE__ */ new Set()) : new Set(e.values());
|
|
921
933
|
} else if (e instanceof Map) {
|
|
922
|
-
if (!
|
|
923
|
-
const
|
|
924
|
-
return new
|
|
934
|
+
if (!Ze(e)) {
|
|
935
|
+
const r = Object.getPrototypeOf(e).constructor;
|
|
936
|
+
return new r(e);
|
|
925
937
|
}
|
|
926
938
|
return new Map(e);
|
|
927
|
-
} else if (t?.mark && (
|
|
928
|
-
if (
|
|
929
|
-
return
|
|
930
|
-
if (typeof
|
|
939
|
+
} else if (t?.mark && (n = t.mark(e, M), n !== void 0) && n !== M.mutable) {
|
|
940
|
+
if (n === M.immutable)
|
|
941
|
+
return ds(e);
|
|
942
|
+
if (typeof n == "function") {
|
|
931
943
|
if (t.enablePatches || t.enableAutoFreeze)
|
|
932
944
|
throw new Error("You can't use mark and patches or auto freeze together.");
|
|
933
|
-
return
|
|
945
|
+
return n();
|
|
934
946
|
}
|
|
935
|
-
throw new Error(`Unsupported mark result: ${
|
|
947
|
+
throw new Error(`Unsupported mark result: ${n}`);
|
|
936
948
|
} else if (typeof e == "object" && Object.getPrototypeOf(e) === Object.prototype) {
|
|
937
|
-
const
|
|
949
|
+
const r = {};
|
|
938
950
|
return Object.keys(e).forEach((i) => {
|
|
939
|
-
|
|
951
|
+
r[i] = e[i];
|
|
940
952
|
}), Object.getOwnPropertySymbols(e).forEach((i) => {
|
|
941
|
-
|
|
942
|
-
}),
|
|
953
|
+
hs.call(e, i) && (r[i] = e[i]);
|
|
954
|
+
}), r;
|
|
943
955
|
} else
|
|
944
956
|
throw new Error("Please check mark() to ensure that it is a stable marker draftable function.");
|
|
945
957
|
}
|
|
946
958
|
function S(e) {
|
|
947
|
-
e.copy || (e.copy =
|
|
959
|
+
e.copy || (e.copy = on(e.original, e.options));
|
|
948
960
|
}
|
|
949
|
-
function
|
|
950
|
-
if (!
|
|
951
|
-
return
|
|
961
|
+
function re(e) {
|
|
962
|
+
if (!R(e))
|
|
963
|
+
return Qe(e);
|
|
952
964
|
if (Array.isArray(e))
|
|
953
|
-
return e.map(
|
|
965
|
+
return e.map(re);
|
|
954
966
|
if (e instanceof Map) {
|
|
955
|
-
const
|
|
956
|
-
|
|
957
|
-
|
|
967
|
+
const n = Array.from(e.entries()).map(([r, i]) => [
|
|
968
|
+
r,
|
|
969
|
+
re(i)
|
|
958
970
|
]);
|
|
959
|
-
if (!
|
|
960
|
-
const
|
|
961
|
-
return new n
|
|
971
|
+
if (!Ze(e)) {
|
|
972
|
+
const r = Object.getPrototypeOf(e).constructor;
|
|
973
|
+
return new r(n);
|
|
962
974
|
}
|
|
963
|
-
return new Map(
|
|
975
|
+
return new Map(n);
|
|
964
976
|
}
|
|
965
977
|
if (e instanceof Set) {
|
|
966
|
-
const
|
|
967
|
-
if (!
|
|
968
|
-
const
|
|
969
|
-
return new n
|
|
978
|
+
const n = Array.from(e).map(re);
|
|
979
|
+
if (!Xe(e)) {
|
|
980
|
+
const r = Object.getPrototypeOf(e).constructor;
|
|
981
|
+
return new r(n);
|
|
970
982
|
}
|
|
971
|
-
return new Set(
|
|
983
|
+
return new Set(n);
|
|
972
984
|
}
|
|
973
985
|
const t = Object.create(Object.getPrototypeOf(e));
|
|
974
|
-
for (const
|
|
975
|
-
t[
|
|
986
|
+
for (const n in e)
|
|
987
|
+
t[n] = re(e[n]);
|
|
976
988
|
return t;
|
|
977
989
|
}
|
|
978
|
-
function
|
|
979
|
-
return
|
|
990
|
+
function ye(e) {
|
|
991
|
+
return Y(e) ? re(e) : e;
|
|
980
992
|
}
|
|
981
993
|
function x(e) {
|
|
982
994
|
var t;
|
|
983
995
|
e.assignedMap = (t = e.assignedMap) !== null && t !== void 0 ? t : /* @__PURE__ */ new Map(), e.operated || (e.operated = !0, e.parent && x(e.parent));
|
|
984
996
|
}
|
|
985
|
-
function
|
|
997
|
+
function Pt() {
|
|
986
998
|
throw new Error("Cannot modify frozen object");
|
|
987
999
|
}
|
|
988
|
-
function
|
|
1000
|
+
function k(e, t, n, r, i) {
|
|
989
1001
|
{
|
|
990
|
-
|
|
991
|
-
const
|
|
992
|
-
if (
|
|
993
|
-
const c =
|
|
994
|
-
if (
|
|
995
|
-
throw
|
|
1002
|
+
n = n ?? /* @__PURE__ */ new WeakMap(), r = r ?? [], i = i ?? [];
|
|
1003
|
+
const s = n.has(e) ? n.get(e) : e;
|
|
1004
|
+
if (r.length > 0) {
|
|
1005
|
+
const c = r.indexOf(s);
|
|
1006
|
+
if (s && typeof s == "object" && c !== -1)
|
|
1007
|
+
throw r[0] === s ? new Error("Forbids circular reference") : new Error(`Forbids circular reference: ~/${i.slice(0, c).map((a, f) => {
|
|
996
1008
|
if (typeof a == "symbol")
|
|
997
1009
|
return `[${a.toString()}]`;
|
|
998
|
-
const u =
|
|
1010
|
+
const u = r[f];
|
|
999
1011
|
return typeof a == "object" && (u instanceof Map || u instanceof Set) ? Array.from(u.keys()).indexOf(a) : a;
|
|
1000
1012
|
}).join("/")}`);
|
|
1001
|
-
|
|
1013
|
+
r.push(s), i.push(t);
|
|
1002
1014
|
} else
|
|
1003
|
-
|
|
1015
|
+
r.push(s);
|
|
1004
1016
|
}
|
|
1005
|
-
if (Object.isFrozen(e) ||
|
|
1006
|
-
|
|
1017
|
+
if (Object.isFrozen(e) || Y(e)) {
|
|
1018
|
+
r.pop(), i.pop();
|
|
1007
1019
|
return;
|
|
1008
1020
|
}
|
|
1009
|
-
switch (
|
|
1021
|
+
switch (Q(e)) {
|
|
1010
1022
|
case 2:
|
|
1011
1023
|
for (const [c, a] of e)
|
|
1012
|
-
|
|
1013
|
-
e.set = e.clear = e.delete =
|
|
1024
|
+
k(c, c, n, r, i), k(a, c, n, r, i);
|
|
1025
|
+
e.set = e.clear = e.delete = Pt;
|
|
1014
1026
|
break;
|
|
1015
1027
|
case 3:
|
|
1016
1028
|
for (const c of e)
|
|
1017
|
-
|
|
1018
|
-
e.add = e.clear = e.delete =
|
|
1029
|
+
k(c, c, n, r, i);
|
|
1030
|
+
e.add = e.clear = e.delete = Pt;
|
|
1019
1031
|
break;
|
|
1020
1032
|
case 1:
|
|
1021
1033
|
Object.freeze(e);
|
|
1022
|
-
let
|
|
1034
|
+
let s = 0;
|
|
1023
1035
|
for (const c of e)
|
|
1024
|
-
|
|
1036
|
+
k(c, s, n, r, i), s += 1;
|
|
1025
1037
|
break;
|
|
1026
1038
|
default:
|
|
1027
1039
|
Object.freeze(e), Object.keys(e).forEach((c) => {
|
|
1028
1040
|
const a = e[c];
|
|
1029
|
-
|
|
1041
|
+
k(a, c, n, r, i);
|
|
1030
1042
|
});
|
|
1031
1043
|
}
|
|
1032
|
-
|
|
1044
|
+
r.pop(), i.pop();
|
|
1033
1045
|
}
|
|
1034
|
-
function
|
|
1035
|
-
const
|
|
1036
|
-
if (
|
|
1037
|
-
Reflect.ownKeys(e).forEach((
|
|
1038
|
-
t(
|
|
1046
|
+
function ke(e, t) {
|
|
1047
|
+
const n = Q(e);
|
|
1048
|
+
if (n === 0)
|
|
1049
|
+
Reflect.ownKeys(e).forEach((r) => {
|
|
1050
|
+
t(r, e[r], e);
|
|
1039
1051
|
});
|
|
1040
|
-
else if (
|
|
1041
|
-
let
|
|
1052
|
+
else if (n === 1) {
|
|
1053
|
+
let r = 0;
|
|
1042
1054
|
for (const i of e)
|
|
1043
|
-
t(
|
|
1055
|
+
t(r, i, e), r += 1;
|
|
1044
1056
|
} else
|
|
1045
|
-
e.forEach((
|
|
1057
|
+
e.forEach((r, i) => t(i, r, e));
|
|
1046
1058
|
}
|
|
1047
|
-
function
|
|
1048
|
-
if (
|
|
1059
|
+
function sn(e, t, n) {
|
|
1060
|
+
if (Y(e) || !R(e, n) || t.has(e) || Object.isFrozen(e))
|
|
1049
1061
|
return;
|
|
1050
|
-
const
|
|
1051
|
-
if (t.add(e),
|
|
1062
|
+
const r = e instanceof Set, i = r ? /* @__PURE__ */ new Map() : void 0;
|
|
1063
|
+
if (t.add(e), ke(e, (o, s) => {
|
|
1052
1064
|
var c;
|
|
1053
|
-
if (
|
|
1054
|
-
const a =
|
|
1065
|
+
if (Y(s)) {
|
|
1066
|
+
const a = h(s);
|
|
1055
1067
|
S(a);
|
|
1056
1068
|
const f = !((c = a.assignedMap) === null || c === void 0) && c.size || a.operated ? a.copy : a.original;
|
|
1057
|
-
|
|
1069
|
+
pe(r ? i : e, o, f);
|
|
1058
1070
|
} else
|
|
1059
|
-
|
|
1071
|
+
sn(s, t, n);
|
|
1060
1072
|
}), i) {
|
|
1061
|
-
const
|
|
1062
|
-
|
|
1063
|
-
|
|
1073
|
+
const o = e, s = Array.from(o);
|
|
1074
|
+
o.clear(), s.forEach((c) => {
|
|
1075
|
+
o.add(i.has(c) ? i.get(c) : c);
|
|
1064
1076
|
});
|
|
1065
1077
|
}
|
|
1066
1078
|
}
|
|
1067
|
-
function
|
|
1068
|
-
const
|
|
1069
|
-
e.finalities.revoke.length > 1 && e.assignedMap.get(t) &&
|
|
1079
|
+
function ys(e, t) {
|
|
1080
|
+
const n = e.type === 3 ? e.setMap : e.copy;
|
|
1081
|
+
e.finalities.revoke.length > 1 && e.assignedMap.get(t) && n && sn(D(n, t), e.finalities.handledSet, e.options);
|
|
1070
1082
|
}
|
|
1071
|
-
function
|
|
1083
|
+
function De(e) {
|
|
1072
1084
|
e.type === 3 && e.copy && (e.copy.clear(), e.setMap.forEach((t) => {
|
|
1073
|
-
e.copy.add(
|
|
1085
|
+
e.copy.add(Qe(t));
|
|
1074
1086
|
}));
|
|
1075
1087
|
}
|
|
1076
|
-
function
|
|
1088
|
+
function Fe(e, t, n, r) {
|
|
1077
1089
|
if (e.operated && e.assignedMap && e.assignedMap.size > 0 && !e.finalized) {
|
|
1078
|
-
if (
|
|
1079
|
-
const
|
|
1080
|
-
|
|
1090
|
+
if (n && r) {
|
|
1091
|
+
const o = rn(e);
|
|
1092
|
+
o && t(e, o, n, r);
|
|
1081
1093
|
}
|
|
1082
1094
|
e.finalized = !0;
|
|
1083
1095
|
}
|
|
1084
1096
|
}
|
|
1085
|
-
function
|
|
1086
|
-
const i =
|
|
1087
|
-
i && (i.callbacks || (i.callbacks = []), i.callbacks.push((
|
|
1097
|
+
function et(e, t, n, r) {
|
|
1098
|
+
const i = h(n);
|
|
1099
|
+
i && (i.callbacks || (i.callbacks = []), i.callbacks.push((o, s) => {
|
|
1088
1100
|
var c;
|
|
1089
1101
|
const a = e.type === 3 ? e.setMap : e.copy;
|
|
1090
|
-
if (z(D(a, t),
|
|
1102
|
+
if (z(D(a, t), n)) {
|
|
1091
1103
|
let f = i.original;
|
|
1092
|
-
i.copy && (f = i.copy),
|
|
1104
|
+
i.copy && (f = i.copy), De(e), Fe(e, r, o, s), e.options.enableAutoFreeze && (e.options.updatedValues = (c = e.options.updatedValues) !== null && c !== void 0 ? c : /* @__PURE__ */ new WeakMap(), e.options.updatedValues.set(f, i.original)), pe(a, t, f);
|
|
1093
1105
|
}
|
|
1094
|
-
}), e.options.enableAutoFreeze && i.finalities !== e.finalities && (e.options.enableAutoFreeze = !1)),
|
|
1095
|
-
const
|
|
1096
|
-
z(D(
|
|
1106
|
+
}), e.options.enableAutoFreeze && i.finalities !== e.finalities && (e.options.enableAutoFreeze = !1)), R(n, e.options) && e.finalities.draft.push(() => {
|
|
1107
|
+
const o = e.type === 3 ? e.setMap : e.copy;
|
|
1108
|
+
z(D(o, t), n) && ys(e, t);
|
|
1097
1109
|
});
|
|
1098
1110
|
}
|
|
1099
|
-
function
|
|
1100
|
-
let { original:
|
|
1101
|
-
a.length <
|
|
1102
|
-
for (let f = 0; f <
|
|
1103
|
-
if (
|
|
1104
|
-
const u = t.concat([f]), l =
|
|
1105
|
-
|
|
1106
|
-
op:
|
|
1111
|
+
function bs(e, t, n, r, i) {
|
|
1112
|
+
let { original: o, assignedMap: s, options: c } = e, a = e.copy;
|
|
1113
|
+
a.length < o.length && ([o, a] = [a, o], [n, r] = [r, n]);
|
|
1114
|
+
for (let f = 0; f < o.length; f += 1)
|
|
1115
|
+
if (s.get(f.toString()) && a[f] !== o[f]) {
|
|
1116
|
+
const u = t.concat([f]), l = W(u, i);
|
|
1117
|
+
n.push({
|
|
1118
|
+
op: v.Replace,
|
|
1107
1119
|
path: l,
|
|
1108
1120
|
// If it is a draft, it needs to be deep cloned, and it may also be non-draft.
|
|
1109
|
-
value:
|
|
1110
|
-
}),
|
|
1111
|
-
op:
|
|
1121
|
+
value: ye(a[f])
|
|
1122
|
+
}), r.push({
|
|
1123
|
+
op: v.Replace,
|
|
1112
1124
|
path: l,
|
|
1113
1125
|
// If it is a draft, it needs to be deep cloned, and it may also be non-draft.
|
|
1114
|
-
value:
|
|
1126
|
+
value: ye(o[f])
|
|
1115
1127
|
});
|
|
1116
1128
|
}
|
|
1117
|
-
for (let f =
|
|
1118
|
-
const u = t.concat([f]), l =
|
|
1119
|
-
|
|
1120
|
-
op:
|
|
1129
|
+
for (let f = o.length; f < a.length; f += 1) {
|
|
1130
|
+
const u = t.concat([f]), l = W(u, i);
|
|
1131
|
+
n.push({
|
|
1132
|
+
op: v.Add,
|
|
1121
1133
|
path: l,
|
|
1122
1134
|
// If it is a draft, it needs to be deep cloned, and it may also be non-draft.
|
|
1123
|
-
value:
|
|
1135
|
+
value: ye(a[f])
|
|
1124
1136
|
});
|
|
1125
1137
|
}
|
|
1126
|
-
if (
|
|
1138
|
+
if (o.length < a.length) {
|
|
1127
1139
|
const { arrayLengthAssignment: f = !0 } = c.enablePatches;
|
|
1128
1140
|
if (f) {
|
|
1129
|
-
const u = t.concat(["length"]), l =
|
|
1130
|
-
|
|
1131
|
-
op:
|
|
1141
|
+
const u = t.concat(["length"]), l = W(u, i);
|
|
1142
|
+
r.push({
|
|
1143
|
+
op: v.Replace,
|
|
1132
1144
|
path: l,
|
|
1133
|
-
value:
|
|
1145
|
+
value: o.length
|
|
1134
1146
|
});
|
|
1135
1147
|
} else
|
|
1136
|
-
for (let u = a.length;
|
|
1137
|
-
const l = t.concat([u - 1]),
|
|
1138
|
-
|
|
1139
|
-
op:
|
|
1140
|
-
path:
|
|
1148
|
+
for (let u = a.length; o.length < u; u -= 1) {
|
|
1149
|
+
const l = t.concat([u - 1]), p = W(l, i);
|
|
1150
|
+
r.push({
|
|
1151
|
+
op: v.Remove,
|
|
1152
|
+
path: p
|
|
1141
1153
|
});
|
|
1142
1154
|
}
|
|
1143
1155
|
}
|
|
1144
1156
|
}
|
|
1145
|
-
function
|
|
1146
|
-
|
|
1147
|
-
const f = D(e, a), u =
|
|
1148
|
-
if (z(f, u) && l ===
|
|
1157
|
+
function gs({ original: e, copy: t, assignedMap: n }, r, i, o, s) {
|
|
1158
|
+
n.forEach((c, a) => {
|
|
1159
|
+
const f = D(e, a), u = ye(D(t, a)), l = c ? se(e, a) ? v.Replace : v.Add : v.Remove;
|
|
1160
|
+
if (z(f, u) && l === v.Replace)
|
|
1149
1161
|
return;
|
|
1150
|
-
const
|
|
1151
|
-
i.push(l ===
|
|
1162
|
+
const p = r.concat(a), d = W(p, s);
|
|
1163
|
+
i.push(l === v.Remove ? { op: l, path: d } : { op: l, path: d, value: u }), o.push(l === v.Add ? { op: v.Remove, path: d } : l === v.Remove ? { op: v.Add, path: d, value: f } : { op: v.Replace, path: d, value: f });
|
|
1152
1164
|
});
|
|
1153
1165
|
}
|
|
1154
|
-
function
|
|
1155
|
-
let
|
|
1166
|
+
function ms({ original: e, copy: t }, n, r, i, o) {
|
|
1167
|
+
let s = 0;
|
|
1156
1168
|
e.forEach((c) => {
|
|
1157
1169
|
if (!t.has(c)) {
|
|
1158
|
-
const a =
|
|
1159
|
-
|
|
1160
|
-
op:
|
|
1170
|
+
const a = n.concat([s]), f = W(a, o);
|
|
1171
|
+
r.push({
|
|
1172
|
+
op: v.Remove,
|
|
1161
1173
|
path: f,
|
|
1162
1174
|
value: c
|
|
1163
1175
|
}), i.unshift({
|
|
1164
|
-
op:
|
|
1176
|
+
op: v.Add,
|
|
1165
1177
|
path: f,
|
|
1166
1178
|
value: c
|
|
1167
1179
|
});
|
|
1168
1180
|
}
|
|
1169
|
-
|
|
1170
|
-
}),
|
|
1181
|
+
s += 1;
|
|
1182
|
+
}), s = 0, t.forEach((c) => {
|
|
1171
1183
|
if (!e.has(c)) {
|
|
1172
|
-
const a =
|
|
1173
|
-
|
|
1174
|
-
op:
|
|
1184
|
+
const a = n.concat([s]), f = W(a, o);
|
|
1185
|
+
r.push({
|
|
1186
|
+
op: v.Add,
|
|
1175
1187
|
path: f,
|
|
1176
1188
|
value: c
|
|
1177
1189
|
}), i.unshift({
|
|
1178
|
-
op:
|
|
1190
|
+
op: v.Remove,
|
|
1179
1191
|
path: f,
|
|
1180
1192
|
value: c
|
|
1181
1193
|
});
|
|
1182
1194
|
}
|
|
1183
|
-
|
|
1195
|
+
s += 1;
|
|
1184
1196
|
});
|
|
1185
1197
|
}
|
|
1186
|
-
function
|
|
1198
|
+
function ue(e, t, n, r) {
|
|
1187
1199
|
const { pathAsArray: i = !0 } = e.options.enablePatches;
|
|
1188
1200
|
switch (e.type) {
|
|
1189
1201
|
case 0:
|
|
1190
1202
|
case 2:
|
|
1191
|
-
return
|
|
1203
|
+
return gs(e, t, n, r, i);
|
|
1192
1204
|
case 1:
|
|
1193
|
-
return
|
|
1205
|
+
return bs(e, t, n, r, i);
|
|
1194
1206
|
case 3:
|
|
1195
|
-
return
|
|
1207
|
+
return ms(e, t, n, r, i);
|
|
1196
1208
|
}
|
|
1197
1209
|
}
|
|
1198
|
-
const
|
|
1199
|
-
if (typeof e == "object" && e !== null && (!
|
|
1210
|
+
const ge = (e, t, n = !1) => {
|
|
1211
|
+
if (typeof e == "object" && e !== null && (!R(e, t) || n))
|
|
1200
1212
|
throw new Error("Strict mode: Mutable data cannot be accessed directly, please use 'unsafe(callback)' wrap.");
|
|
1201
|
-
},
|
|
1213
|
+
}, Le = {
|
|
1202
1214
|
get size() {
|
|
1203
|
-
return
|
|
1215
|
+
return E(h(this)).size;
|
|
1204
1216
|
},
|
|
1205
1217
|
has(e) {
|
|
1206
|
-
return
|
|
1218
|
+
return E(h(this)).has(e);
|
|
1207
1219
|
},
|
|
1208
1220
|
set(e, t) {
|
|
1209
|
-
const
|
|
1210
|
-
return (!
|
|
1221
|
+
const n = h(this), r = E(n);
|
|
1222
|
+
return (!r.has(e) || !z(r.get(e), t)) && (S(n), x(n), n.assignedMap.set(e, !0), n.copy.set(e, t), et(n, e, t, ue)), this;
|
|
1211
1223
|
},
|
|
1212
1224
|
delete(e) {
|
|
1213
1225
|
if (!this.has(e))
|
|
1214
1226
|
return !1;
|
|
1215
|
-
const t =
|
|
1227
|
+
const t = h(this);
|
|
1216
1228
|
return S(t), x(t), t.original.has(e) ? t.assignedMap.set(e, !1) : t.assignedMap.delete(e), t.copy.delete(e), !0;
|
|
1217
1229
|
},
|
|
1218
1230
|
clear() {
|
|
1219
|
-
const e =
|
|
1231
|
+
const e = h(this);
|
|
1220
1232
|
if (this.size) {
|
|
1221
1233
|
S(e), x(e), e.assignedMap = /* @__PURE__ */ new Map();
|
|
1222
1234
|
for (const [t] of e.original)
|
|
@@ -1225,32 +1237,32 @@ const ye = (e, t, r = !1) => {
|
|
|
1225
1237
|
}
|
|
1226
1238
|
},
|
|
1227
1239
|
forEach(e, t) {
|
|
1228
|
-
const
|
|
1229
|
-
|
|
1240
|
+
const n = h(this);
|
|
1241
|
+
E(n).forEach((r, i) => {
|
|
1230
1242
|
e.call(t, this.get(i), i, this);
|
|
1231
1243
|
});
|
|
1232
1244
|
},
|
|
1233
1245
|
get(e) {
|
|
1234
|
-
var t,
|
|
1235
|
-
const
|
|
1236
|
-
if (
|
|
1246
|
+
var t, n;
|
|
1247
|
+
const r = h(this), i = E(r).get(e), o = ((n = (t = r.options).mark) === null || n === void 0 ? void 0 : n.call(t, i, M)) === M.mutable;
|
|
1248
|
+
if (r.options.strict && ge(i, r.options, o), o || r.finalized || !R(i, r.options) || i !== r.original.get(e))
|
|
1237
1249
|
return i;
|
|
1238
|
-
const
|
|
1250
|
+
const s = Je.createDraft({
|
|
1239
1251
|
original: i,
|
|
1240
|
-
parentDraft:
|
|
1252
|
+
parentDraft: r,
|
|
1241
1253
|
key: e,
|
|
1242
|
-
finalities:
|
|
1243
|
-
options:
|
|
1254
|
+
finalities: r.finalities,
|
|
1255
|
+
options: r.options
|
|
1244
1256
|
});
|
|
1245
|
-
return S(
|
|
1257
|
+
return S(r), r.copy.set(e, s), s;
|
|
1246
1258
|
},
|
|
1247
1259
|
keys() {
|
|
1248
|
-
return
|
|
1260
|
+
return E(h(this)).keys();
|
|
1249
1261
|
},
|
|
1250
1262
|
values() {
|
|
1251
1263
|
const e = this.keys();
|
|
1252
1264
|
return {
|
|
1253
|
-
[
|
|
1265
|
+
[he]: () => this.values(),
|
|
1254
1266
|
next: () => {
|
|
1255
1267
|
const t = e.next();
|
|
1256
1268
|
return t.done ? t : {
|
|
@@ -1263,93 +1275,93 @@ const ye = (e, t, r = !1) => {
|
|
|
1263
1275
|
entries() {
|
|
1264
1276
|
const e = this.keys();
|
|
1265
1277
|
return {
|
|
1266
|
-
[
|
|
1278
|
+
[he]: () => this.entries(),
|
|
1267
1279
|
next: () => {
|
|
1268
1280
|
const t = e.next();
|
|
1269
1281
|
if (t.done)
|
|
1270
1282
|
return t;
|
|
1271
|
-
const
|
|
1283
|
+
const n = this.get(t.value);
|
|
1272
1284
|
return {
|
|
1273
1285
|
done: !1,
|
|
1274
|
-
value: [t.value,
|
|
1286
|
+
value: [t.value, n]
|
|
1275
1287
|
};
|
|
1276
1288
|
}
|
|
1277
1289
|
};
|
|
1278
1290
|
},
|
|
1279
|
-
[
|
|
1291
|
+
[he]() {
|
|
1280
1292
|
return this.entries();
|
|
1281
1293
|
}
|
|
1282
|
-
},
|
|
1283
|
-
var
|
|
1284
|
-
const
|
|
1285
|
-
if (
|
|
1286
|
-
return
|
|
1287
|
-
const
|
|
1288
|
-
let c = e.setMap.get(
|
|
1289
|
-
const a =
|
|
1290
|
-
if (e.options.strict &&
|
|
1291
|
-
const u =
|
|
1292
|
-
original:
|
|
1294
|
+
}, vs = Reflect.ownKeys(Le), Ct = (e, t, { isValuesIterator: n }) => () => {
|
|
1295
|
+
var r, i;
|
|
1296
|
+
const o = t.next();
|
|
1297
|
+
if (o.done)
|
|
1298
|
+
return o;
|
|
1299
|
+
const s = o.value;
|
|
1300
|
+
let c = e.setMap.get(s);
|
|
1301
|
+
const a = h(c), f = ((i = (r = e.options).mark) === null || i === void 0 ? void 0 : i.call(r, c, M)) === M.mutable;
|
|
1302
|
+
if (e.options.strict && ge(s, e.options, f), !f && !a && R(s, e.options) && !e.finalized && e.original.has(s)) {
|
|
1303
|
+
const u = Je.createDraft({
|
|
1304
|
+
original: s,
|
|
1293
1305
|
parentDraft: e,
|
|
1294
|
-
key:
|
|
1306
|
+
key: s,
|
|
1295
1307
|
finalities: e.finalities,
|
|
1296
1308
|
options: e.options
|
|
1297
1309
|
});
|
|
1298
|
-
e.setMap.set(
|
|
1310
|
+
e.setMap.set(s, u), c = u;
|
|
1299
1311
|
} else a && (c = a.proxy);
|
|
1300
1312
|
return {
|
|
1301
1313
|
done: !1,
|
|
1302
|
-
value:
|
|
1314
|
+
value: n ? c : [c, c]
|
|
1303
1315
|
};
|
|
1304
|
-
},
|
|
1316
|
+
}, me = {
|
|
1305
1317
|
get size() {
|
|
1306
|
-
return
|
|
1318
|
+
return h(this).setMap.size;
|
|
1307
1319
|
},
|
|
1308
1320
|
has(e) {
|
|
1309
|
-
const t =
|
|
1321
|
+
const t = h(this);
|
|
1310
1322
|
if (t.setMap.has(e))
|
|
1311
1323
|
return !0;
|
|
1312
1324
|
S(t);
|
|
1313
|
-
const
|
|
1314
|
-
return !!(
|
|
1325
|
+
const n = h(e);
|
|
1326
|
+
return !!(n && t.setMap.has(n.original));
|
|
1315
1327
|
},
|
|
1316
1328
|
add(e) {
|
|
1317
|
-
const t =
|
|
1318
|
-
return this.has(e) || (S(t), x(t), t.assignedMap.set(e, !0), t.setMap.set(e, e),
|
|
1329
|
+
const t = h(this);
|
|
1330
|
+
return this.has(e) || (S(t), x(t), t.assignedMap.set(e, !0), t.setMap.set(e, e), et(t, e, e, ue)), this;
|
|
1319
1331
|
},
|
|
1320
1332
|
delete(e) {
|
|
1321
1333
|
if (!this.has(e))
|
|
1322
1334
|
return !1;
|
|
1323
|
-
const t =
|
|
1335
|
+
const t = h(this);
|
|
1324
1336
|
S(t), x(t);
|
|
1325
|
-
const
|
|
1326
|
-
return
|
|
1337
|
+
const n = h(e);
|
|
1338
|
+
return n && t.setMap.has(n.original) ? (t.assignedMap.set(n.original, !1), t.setMap.delete(n.original)) : (!n && t.setMap.has(e) ? t.assignedMap.set(e, !1) : t.assignedMap.delete(e), t.setMap.delete(e));
|
|
1327
1339
|
},
|
|
1328
1340
|
clear() {
|
|
1329
1341
|
if (!this.size)
|
|
1330
1342
|
return;
|
|
1331
|
-
const e =
|
|
1343
|
+
const e = h(this);
|
|
1332
1344
|
S(e), x(e);
|
|
1333
1345
|
for (const t of e.original)
|
|
1334
1346
|
e.assignedMap.set(t, !1);
|
|
1335
1347
|
e.setMap.clear();
|
|
1336
1348
|
},
|
|
1337
1349
|
values() {
|
|
1338
|
-
const e =
|
|
1350
|
+
const e = h(this);
|
|
1339
1351
|
S(e);
|
|
1340
1352
|
const t = e.setMap.keys();
|
|
1341
1353
|
return {
|
|
1342
1354
|
[Symbol.iterator]: () => this.values(),
|
|
1343
|
-
next:
|
|
1355
|
+
next: Ct(e, t, { isValuesIterator: !0 })
|
|
1344
1356
|
};
|
|
1345
1357
|
},
|
|
1346
1358
|
entries() {
|
|
1347
|
-
const e =
|
|
1359
|
+
const e = h(this);
|
|
1348
1360
|
S(e);
|
|
1349
1361
|
const t = e.setMap.keys();
|
|
1350
1362
|
return {
|
|
1351
1363
|
[Symbol.iterator]: () => this.entries(),
|
|
1352
|
-
next:
|
|
1364
|
+
next: Ct(e, t, {
|
|
1353
1365
|
isValuesIterator: !1
|
|
1354
1366
|
})
|
|
1355
1367
|
};
|
|
@@ -1357,17 +1369,17 @@ const ye = (e, t, r = !1) => {
|
|
|
1357
1369
|
keys() {
|
|
1358
1370
|
return this.values();
|
|
1359
1371
|
},
|
|
1360
|
-
[
|
|
1372
|
+
[he]() {
|
|
1361
1373
|
return this.values();
|
|
1362
1374
|
},
|
|
1363
1375
|
forEach(e, t) {
|
|
1364
|
-
const
|
|
1365
|
-
let
|
|
1366
|
-
for (; !
|
|
1367
|
-
e.call(t,
|
|
1376
|
+
const n = this.values();
|
|
1377
|
+
let r = n.next();
|
|
1378
|
+
for (; !r.done; )
|
|
1379
|
+
e.call(t, r.value, r.value, this), r = n.next();
|
|
1368
1380
|
}
|
|
1369
1381
|
};
|
|
1370
|
-
Set.prototype.difference && Object.assign(
|
|
1382
|
+
Set.prototype.difference && Object.assign(me, {
|
|
1371
1383
|
intersection(e) {
|
|
1372
1384
|
return Set.prototype.intersection.call(new Set(this.values()), e);
|
|
1373
1385
|
},
|
|
@@ -1390,86 +1402,86 @@ Set.prototype.difference && Object.assign(be, {
|
|
|
1390
1402
|
return Set.prototype.isDisjointFrom.call(new Set(this.values()), e);
|
|
1391
1403
|
}
|
|
1392
1404
|
});
|
|
1393
|
-
const
|
|
1394
|
-
get(e, t,
|
|
1395
|
-
var
|
|
1396
|
-
const
|
|
1397
|
-
if (
|
|
1398
|
-
return
|
|
1399
|
-
if (t ===
|
|
1405
|
+
const ws = Reflect.ownKeys(me), an = /* @__PURE__ */ new WeakSet(), cn = {
|
|
1406
|
+
get(e, t, n) {
|
|
1407
|
+
var r, i;
|
|
1408
|
+
const o = (r = e.copy) === null || r === void 0 ? void 0 : r[t];
|
|
1409
|
+
if (o && an.has(o))
|
|
1410
|
+
return o;
|
|
1411
|
+
if (t === nn)
|
|
1400
1412
|
return e;
|
|
1401
|
-
let
|
|
1413
|
+
let s;
|
|
1402
1414
|
if (e.options.mark) {
|
|
1403
|
-
const f = t === "size" && (e.original instanceof Map || e.original instanceof Set) ? Reflect.get(e.original, t) : Reflect.get(e.original, t,
|
|
1404
|
-
if (
|
|
1405
|
-
return e.options.strict &&
|
|
1415
|
+
const f = t === "size" && (e.original instanceof Map || e.original instanceof Set) ? Reflect.get(e.original, t) : Reflect.get(e.original, t, n);
|
|
1416
|
+
if (s = e.options.mark(f, M), s === M.mutable)
|
|
1417
|
+
return e.options.strict && ge(f, e.options, !0), f;
|
|
1406
1418
|
}
|
|
1407
|
-
const c =
|
|
1408
|
-
if (c instanceof Map &&
|
|
1419
|
+
const c = E(e);
|
|
1420
|
+
if (c instanceof Map && vs.includes(t)) {
|
|
1409
1421
|
if (t === "size")
|
|
1410
|
-
return Object.getOwnPropertyDescriptor(
|
|
1411
|
-
const f =
|
|
1422
|
+
return Object.getOwnPropertyDescriptor(Le, "size").get.call(e.proxy);
|
|
1423
|
+
const f = Le[t];
|
|
1412
1424
|
if (f)
|
|
1413
1425
|
return f.bind(e.proxy);
|
|
1414
1426
|
}
|
|
1415
|
-
if (c instanceof Set &&
|
|
1427
|
+
if (c instanceof Set && ws.includes(t)) {
|
|
1416
1428
|
if (t === "size")
|
|
1417
|
-
return Object.getOwnPropertyDescriptor(
|
|
1418
|
-
const f =
|
|
1429
|
+
return Object.getOwnPropertyDescriptor(me, "size").get.call(e.proxy);
|
|
1430
|
+
const f = me[t];
|
|
1419
1431
|
if (f)
|
|
1420
1432
|
return f.bind(e.proxy);
|
|
1421
1433
|
}
|
|
1422
|
-
if (!
|
|
1423
|
-
const f =
|
|
1434
|
+
if (!se(c, t)) {
|
|
1435
|
+
const f = Tt(c, t);
|
|
1424
1436
|
return f ? "value" in f ? f.value : (
|
|
1425
1437
|
// !case: support for getter
|
|
1426
1438
|
(i = f.get) === null || i === void 0 ? void 0 : i.call(e.proxy)
|
|
1427
1439
|
) : void 0;
|
|
1428
1440
|
}
|
|
1429
1441
|
const a = c[t];
|
|
1430
|
-
if (e.options.strict &&
|
|
1442
|
+
if (e.options.strict && ge(a, e.options), e.finalized || !R(a, e.options))
|
|
1431
1443
|
return a;
|
|
1432
|
-
if (a ===
|
|
1433
|
-
if (S(e), e.copy[t] =
|
|
1444
|
+
if (a === Me(e.original, t)) {
|
|
1445
|
+
if (S(e), e.copy[t] = tt({
|
|
1434
1446
|
original: e.original[t],
|
|
1435
1447
|
parentDraft: e,
|
|
1436
1448
|
key: e.type === 1 ? Number(t) : t,
|
|
1437
1449
|
finalities: e.finalities,
|
|
1438
1450
|
options: e.options
|
|
1439
|
-
}), typeof
|
|
1440
|
-
const f =
|
|
1451
|
+
}), typeof s == "function") {
|
|
1452
|
+
const f = h(e.copy[t]);
|
|
1441
1453
|
return S(f), x(f), f.copy;
|
|
1442
1454
|
}
|
|
1443
1455
|
return e.copy[t];
|
|
1444
1456
|
}
|
|
1445
1457
|
return a;
|
|
1446
1458
|
},
|
|
1447
|
-
set(e, t,
|
|
1448
|
-
var
|
|
1459
|
+
set(e, t, n) {
|
|
1460
|
+
var r;
|
|
1449
1461
|
if (e.type === 3 || e.type === 2)
|
|
1450
1462
|
throw new Error("Map/Set draft does not support any property assignment.");
|
|
1451
1463
|
let i;
|
|
1452
1464
|
if (e.type === 1 && t !== "length" && !(Number.isInteger(i = Number(t)) && i >= 0 && (t === 0 || i === 0 || String(i) === String(t))))
|
|
1453
1465
|
throw new Error("Only supports setting array indices and the 'length' property.");
|
|
1454
|
-
const
|
|
1455
|
-
if (
|
|
1456
|
-
return
|
|
1457
|
-
const
|
|
1458
|
-
return c && z(c.original,
|
|
1466
|
+
const o = Tt(E(e), t);
|
|
1467
|
+
if (o?.set)
|
|
1468
|
+
return o.set.call(e.proxy, n), !0;
|
|
1469
|
+
const s = Me(E(e), t), c = h(s);
|
|
1470
|
+
return c && z(c.original, n) ? (e.copy[t] = n, e.assignedMap = (r = e.assignedMap) !== null && r !== void 0 ? r : /* @__PURE__ */ new Map(), e.assignedMap.set(t, !1), !0) : (z(n, s) && (n !== void 0 || se(e.original, t)) || (S(e), x(e), se(e.original, t) && z(n, e.original[t]) ? e.assignedMap.delete(t) : e.assignedMap.set(t, !0), e.copy[t] = n, et(e, t, n, ue)), !0);
|
|
1459
1471
|
},
|
|
1460
1472
|
has(e, t) {
|
|
1461
|
-
return t in
|
|
1473
|
+
return t in E(e);
|
|
1462
1474
|
},
|
|
1463
1475
|
ownKeys(e) {
|
|
1464
|
-
return Reflect.ownKeys(
|
|
1476
|
+
return Reflect.ownKeys(E(e));
|
|
1465
1477
|
},
|
|
1466
1478
|
getOwnPropertyDescriptor(e, t) {
|
|
1467
|
-
const
|
|
1468
|
-
return
|
|
1479
|
+
const n = E(e), r = Reflect.getOwnPropertyDescriptor(n, t);
|
|
1480
|
+
return r && {
|
|
1469
1481
|
writable: !0,
|
|
1470
1482
|
configurable: e.type !== 1 || t !== "length",
|
|
1471
|
-
enumerable:
|
|
1472
|
-
value:
|
|
1483
|
+
enumerable: r.enumerable,
|
|
1484
|
+
value: n[t]
|
|
1473
1485
|
};
|
|
1474
1486
|
},
|
|
1475
1487
|
getPrototypeOf(e) {
|
|
@@ -1482,483 +1494,520 @@ const ho = Reflect.ownKeys(be), rr = /* @__PURE__ */ new WeakSet(), nr = {
|
|
|
1482
1494
|
throw new Error("Cannot call 'defineProperty()' on drafts");
|
|
1483
1495
|
},
|
|
1484
1496
|
deleteProperty(e, t) {
|
|
1485
|
-
var
|
|
1486
|
-
return e.type === 1 ?
|
|
1497
|
+
var n;
|
|
1498
|
+
return e.type === 1 ? cn.set.call(this, e, t, void 0, e.proxy) : (Me(e.original, t) !== void 0 || t in e.original ? (S(e), x(e), e.assignedMap.set(t, !1)) : (e.assignedMap = (n = e.assignedMap) !== null && n !== void 0 ? n : /* @__PURE__ */ new Map(), e.assignedMap.delete(t)), e.copy && delete e.copy[t], !0);
|
|
1487
1499
|
}
|
|
1488
1500
|
};
|
|
1489
|
-
function
|
|
1490
|
-
const { original: t, parentDraft:
|
|
1491
|
-
type:
|
|
1501
|
+
function tt(e) {
|
|
1502
|
+
const { original: t, parentDraft: n, key: r, finalities: i, options: o } = e, s = Q(t), c = {
|
|
1503
|
+
type: s,
|
|
1492
1504
|
finalized: !1,
|
|
1493
|
-
parent:
|
|
1505
|
+
parent: n,
|
|
1494
1506
|
original: t,
|
|
1495
1507
|
copy: null,
|
|
1496
1508
|
proxy: null,
|
|
1497
1509
|
finalities: i,
|
|
1498
|
-
options:
|
|
1510
|
+
options: o,
|
|
1499
1511
|
// Mapping of draft Set items to their corresponding draft values.
|
|
1500
|
-
setMap:
|
|
1512
|
+
setMap: s === 3 ? new Map(t.entries()) : void 0
|
|
1501
1513
|
};
|
|
1502
|
-
(
|
|
1503
|
-
const { proxy: a, revoke: f } = Proxy.revocable(
|
|
1504
|
-
if (i.revoke.push(f),
|
|
1505
|
-
const u =
|
|
1506
|
-
u.finalities.draft.push((l,
|
|
1507
|
-
var
|
|
1508
|
-
const
|
|
1509
|
-
let
|
|
1510
|
-
const
|
|
1511
|
-
if (
|
|
1512
|
-
let A =
|
|
1513
|
-
|
|
1514
|
+
(r || "key" in e) && (c.key = r);
|
|
1515
|
+
const { proxy: a, revoke: f } = Proxy.revocable(s === 1 ? Object.assign([], c) : c, cn);
|
|
1516
|
+
if (i.revoke.push(f), an.add(a), c.proxy = a, n) {
|
|
1517
|
+
const u = n;
|
|
1518
|
+
u.finalities.draft.push((l, p) => {
|
|
1519
|
+
var d, b;
|
|
1520
|
+
const w = h(a);
|
|
1521
|
+
let _ = u.type === 3 ? u.setMap : u.copy;
|
|
1522
|
+
const O = D(_, r), m = h(O);
|
|
1523
|
+
if (m) {
|
|
1524
|
+
let A = m.original;
|
|
1525
|
+
m.operated && (A = Qe(O)), De(m), Fe(m, ue, l, p), u.options.enableAutoFreeze && (u.options.updatedValues = (d = u.options.updatedValues) !== null && d !== void 0 ? d : /* @__PURE__ */ new WeakMap(), u.options.updatedValues.set(A, m.original)), pe(_, r, A);
|
|
1514
1526
|
}
|
|
1515
|
-
(
|
|
1516
|
-
A(l,
|
|
1527
|
+
(b = w.callbacks) === null || b === void 0 || b.forEach((A) => {
|
|
1528
|
+
A(l, p);
|
|
1517
1529
|
});
|
|
1518
1530
|
});
|
|
1519
1531
|
} else {
|
|
1520
|
-
const u =
|
|
1521
|
-
u.finalities.draft.push((l,
|
|
1522
|
-
|
|
1532
|
+
const u = h(a);
|
|
1533
|
+
u.finalities.draft.push((l, p) => {
|
|
1534
|
+
De(u), Fe(u, ue, l, p);
|
|
1523
1535
|
});
|
|
1524
1536
|
}
|
|
1525
1537
|
return a;
|
|
1526
1538
|
}
|
|
1527
|
-
|
|
1528
|
-
function
|
|
1529
|
-
var
|
|
1530
|
-
const
|
|
1531
|
-
if (
|
|
1532
|
-
for (;
|
|
1533
|
-
|
|
1534
|
-
const f = a ? t[0] :
|
|
1535
|
-
return
|
|
1539
|
+
Je.createDraft = tt;
|
|
1540
|
+
function _s(e, t, n, r, i) {
|
|
1541
|
+
var o;
|
|
1542
|
+
const s = h(e), c = (o = s?.original) !== null && o !== void 0 ? o : e, a = !!t.length;
|
|
1543
|
+
if (s?.operated)
|
|
1544
|
+
for (; s.finalities.draft.length > 0; )
|
|
1545
|
+
s.finalities.draft.pop()(n, r);
|
|
1546
|
+
const f = a ? t[0] : s ? s.operated ? s.copy : s.original : e;
|
|
1547
|
+
return s && ze(s), i && k(f, f, s?.options.updatedValues), [
|
|
1536
1548
|
f,
|
|
1537
|
-
|
|
1538
|
-
|
|
1549
|
+
n && a ? [{ op: v.Replace, path: [], value: t[0] }] : n,
|
|
1550
|
+
r && a ? [{ op: v.Replace, path: [], value: c }] : r
|
|
1539
1551
|
];
|
|
1540
1552
|
}
|
|
1541
|
-
function
|
|
1542
|
-
var
|
|
1543
|
-
const
|
|
1553
|
+
function Os(e, t) {
|
|
1554
|
+
var n;
|
|
1555
|
+
const r = {
|
|
1544
1556
|
draft: [],
|
|
1545
1557
|
revoke: [],
|
|
1546
1558
|
handledSet: /* @__PURE__ */ new WeakSet()
|
|
1547
1559
|
};
|
|
1548
|
-
let i,
|
|
1549
|
-
t.enablePatches && (i = [],
|
|
1550
|
-
const c = ((
|
|
1560
|
+
let i, o;
|
|
1561
|
+
t.enablePatches && (i = [], o = []);
|
|
1562
|
+
const c = ((n = t.mark) === null || n === void 0 ? void 0 : n.call(t, e, M)) === M.mutable || !R(e, t) ? e : tt({
|
|
1551
1563
|
original: e,
|
|
1552
1564
|
parentDraft: null,
|
|
1553
|
-
finalities:
|
|
1565
|
+
finalities: r,
|
|
1554
1566
|
options: t
|
|
1555
1567
|
});
|
|
1556
1568
|
return [
|
|
1557
1569
|
c,
|
|
1558
1570
|
(a = []) => {
|
|
1559
|
-
const [f, u, l] =
|
|
1571
|
+
const [f, u, l] = _s(c, a, i, o, t.enableAutoFreeze);
|
|
1560
1572
|
return t.enablePatches ? [f, u, l] : f;
|
|
1561
1573
|
}
|
|
1562
1574
|
];
|
|
1563
1575
|
}
|
|
1564
|
-
function
|
|
1565
|
-
const { rootDraft: t, value:
|
|
1566
|
-
|
|
1567
|
-
const a =
|
|
1576
|
+
function Ne(e) {
|
|
1577
|
+
const { rootDraft: t, value: n, useRawReturn: r = !1, isRoot: i = !0 } = e;
|
|
1578
|
+
ke(n, (o, s, c) => {
|
|
1579
|
+
const a = h(s);
|
|
1568
1580
|
if (a && t && a.finalities === t.finalities) {
|
|
1569
1581
|
e.isContainDraft = !0;
|
|
1570
1582
|
const f = a.original;
|
|
1571
1583
|
if (c instanceof Set) {
|
|
1572
1584
|
const u = Array.from(c);
|
|
1573
|
-
c.clear(), u.forEach((l) => c.add(
|
|
1585
|
+
c.clear(), u.forEach((l) => c.add(o === l ? f : l));
|
|
1574
1586
|
} else
|
|
1575
|
-
|
|
1576
|
-
} else typeof
|
|
1577
|
-
}), i && (e.isContainDraft || console.warn("The return value does not contain any draft, please use 'rawReturn()' to wrap the return value to improve performance."),
|
|
1587
|
+
pe(c, o, f);
|
|
1588
|
+
} else typeof s == "object" && s !== null && (e.value = s, e.isRoot = !1, Ne(e));
|
|
1589
|
+
}), i && (e.isContainDraft || console.warn("The return value does not contain any draft, please use 'rawReturn()' to wrap the return value to improve performance."), r && console.warn("The return value contains drafts, please don't use 'rawReturn()' to wrap the return value."));
|
|
1578
1590
|
}
|
|
1579
|
-
function
|
|
1591
|
+
function fn(e) {
|
|
1580
1592
|
var t;
|
|
1581
|
-
const
|
|
1582
|
-
if (!
|
|
1593
|
+
const n = h(e);
|
|
1594
|
+
if (!R(e, n?.options))
|
|
1583
1595
|
return e;
|
|
1584
|
-
const
|
|
1585
|
-
if (
|
|
1586
|
-
return
|
|
1596
|
+
const r = Q(e);
|
|
1597
|
+
if (n && !n.operated)
|
|
1598
|
+
return n.original;
|
|
1587
1599
|
let i;
|
|
1588
|
-
function
|
|
1589
|
-
i =
|
|
1600
|
+
function o() {
|
|
1601
|
+
i = r === 2 ? Ze(e) ? new Map(e) : new (Object.getPrototypeOf(e)).constructor(e) : r === 3 ? Array.from(n.setMap.values()) : on(e, n?.options);
|
|
1590
1602
|
}
|
|
1591
|
-
if (
|
|
1592
|
-
|
|
1603
|
+
if (n) {
|
|
1604
|
+
n.finalized = !0;
|
|
1593
1605
|
try {
|
|
1594
|
-
|
|
1606
|
+
o();
|
|
1595
1607
|
} finally {
|
|
1596
|
-
|
|
1608
|
+
n.finalized = !1;
|
|
1597
1609
|
}
|
|
1598
1610
|
} else
|
|
1599
1611
|
i = e;
|
|
1600
|
-
if (
|
|
1601
|
-
if (
|
|
1612
|
+
if (ke(i, (s, c) => {
|
|
1613
|
+
if (n && z(D(n.original, s), c))
|
|
1602
1614
|
return;
|
|
1603
|
-
const a =
|
|
1604
|
-
a !== c && (i === e &&
|
|
1605
|
-
}),
|
|
1606
|
-
const
|
|
1607
|
-
return
|
|
1615
|
+
const a = fn(c);
|
|
1616
|
+
a !== c && (i === e && o(), pe(i, s, a));
|
|
1617
|
+
}), r === 3) {
|
|
1618
|
+
const s = (t = n?.original) !== null && t !== void 0 ? t : i;
|
|
1619
|
+
return Xe(s) ? new Set(i) : new (Object.getPrototypeOf(s)).constructor(i);
|
|
1608
1620
|
}
|
|
1609
1621
|
return i;
|
|
1610
1622
|
}
|
|
1611
|
-
function
|
|
1612
|
-
if (!
|
|
1623
|
+
function Rt(e) {
|
|
1624
|
+
if (!Y(e))
|
|
1613
1625
|
throw new Error(`current() is only used for Draft, parameter: ${e}`);
|
|
1614
|
-
return
|
|
1626
|
+
return fn(e);
|
|
1615
1627
|
}
|
|
1616
|
-
const
|
|
1617
|
-
var
|
|
1618
|
-
if (typeof
|
|
1619
|
-
return function(
|
|
1620
|
-
return t(
|
|
1628
|
+
const Ss = (e) => function t(n, r, i) {
|
|
1629
|
+
var o, s, c;
|
|
1630
|
+
if (typeof n == "function" && typeof r != "function")
|
|
1631
|
+
return function(y, ...$) {
|
|
1632
|
+
return t(y, (U) => n.call(this, U, ...$), r);
|
|
1621
1633
|
};
|
|
1622
|
-
const a =
|
|
1634
|
+
const a = n, f = r;
|
|
1623
1635
|
let u = i;
|
|
1624
|
-
if (typeof
|
|
1636
|
+
if (typeof r != "function" && (u = r), u !== void 0 && Object.prototype.toString.call(u) !== "[object Object]")
|
|
1625
1637
|
throw new Error(`Invalid options: ${u}, 'options' should be an object.`);
|
|
1626
1638
|
u = Object.assign(Object.assign({}, e), u);
|
|
1627
|
-
const l =
|
|
1639
|
+
const l = Y(a) ? Rt(a) : a, p = Array.isArray(u.mark) ? ((y, $) => {
|
|
1628
1640
|
for (const U of u.mark) {
|
|
1629
1641
|
if (typeof U != "function")
|
|
1630
1642
|
throw new Error(`Invalid mark: ${U}, 'mark' should be a function.`);
|
|
1631
|
-
const
|
|
1632
|
-
if (
|
|
1633
|
-
return
|
|
1643
|
+
const ee = U(y, $);
|
|
1644
|
+
if (ee)
|
|
1645
|
+
return ee;
|
|
1634
1646
|
}
|
|
1635
|
-
}) : u.mark,
|
|
1647
|
+
}) : u.mark, d = (o = u.enablePatches) !== null && o !== void 0 ? o : !1, b = (s = u.strict) !== null && s !== void 0 ? s : !1, _ = {
|
|
1636
1648
|
enableAutoFreeze: (c = u.enableAutoFreeze) !== null && c !== void 0 ? c : !1,
|
|
1637
|
-
mark:
|
|
1638
|
-
strict:
|
|
1639
|
-
enablePatches:
|
|
1649
|
+
mark: p,
|
|
1650
|
+
strict: b,
|
|
1651
|
+
enablePatches: d
|
|
1640
1652
|
};
|
|
1641
|
-
if (!
|
|
1653
|
+
if (!R(l, _) && typeof l == "object" && l !== null)
|
|
1642
1654
|
throw new Error("Invalid base state: create() only supports plain objects, arrays, Set, Map or using mark() to mark the state as immutable.");
|
|
1643
|
-
const [
|
|
1644
|
-
if (typeof
|
|
1645
|
-
if (!
|
|
1655
|
+
const [O, m] = Os(l, _);
|
|
1656
|
+
if (typeof r != "function") {
|
|
1657
|
+
if (!R(l, _))
|
|
1646
1658
|
throw new Error("Invalid base state: create() only supports plain objects, arrays, Set, Map or using mark() to mark the state as immutable.");
|
|
1647
|
-
return [
|
|
1659
|
+
return [O, m];
|
|
1648
1660
|
}
|
|
1649
1661
|
let A;
|
|
1650
1662
|
try {
|
|
1651
|
-
A = f(
|
|
1652
|
-
} catch (
|
|
1653
|
-
throw
|
|
1663
|
+
A = f(O);
|
|
1664
|
+
} catch (y) {
|
|
1665
|
+
throw ze(h(O)), y;
|
|
1654
1666
|
}
|
|
1655
|
-
const
|
|
1656
|
-
const $ =
|
|
1657
|
-
if (!
|
|
1658
|
-
if (
|
|
1667
|
+
const H = (y) => {
|
|
1668
|
+
const $ = h(O);
|
|
1669
|
+
if (!Y(y)) {
|
|
1670
|
+
if (y !== void 0 && !z(y, O) && $?.operated)
|
|
1659
1671
|
throw new Error("Either the value is returned as a new non-draft value, or only the draft is modified without returning any value.");
|
|
1660
|
-
const
|
|
1661
|
-
if (
|
|
1662
|
-
const
|
|
1663
|
-
return
|
|
1672
|
+
const ee = y?.[ls];
|
|
1673
|
+
if (ee) {
|
|
1674
|
+
const ln = ee[0];
|
|
1675
|
+
return _.strict && typeof y == "object" && y !== null && Ne({
|
|
1664
1676
|
rootDraft: $,
|
|
1665
|
-
value:
|
|
1677
|
+
value: y,
|
|
1666
1678
|
useRawReturn: !0
|
|
1667
|
-
}),
|
|
1679
|
+
}), m([ln]);
|
|
1668
1680
|
}
|
|
1669
|
-
if (
|
|
1670
|
-
return typeof
|
|
1681
|
+
if (y !== void 0)
|
|
1682
|
+
return typeof y == "object" && y !== null && Ne({ rootDraft: $, value: y }), m([y]);
|
|
1671
1683
|
}
|
|
1672
|
-
if (
|
|
1673
|
-
return
|
|
1674
|
-
const U =
|
|
1675
|
-
if (
|
|
1684
|
+
if (y === O || y === void 0)
|
|
1685
|
+
return m([]);
|
|
1686
|
+
const U = h(y);
|
|
1687
|
+
if (_ === U.options) {
|
|
1676
1688
|
if (U.operated)
|
|
1677
1689
|
throw new Error("Cannot return a modified child draft.");
|
|
1678
|
-
return
|
|
1690
|
+
return m([Rt(y)]);
|
|
1679
1691
|
}
|
|
1680
|
-
return
|
|
1692
|
+
return m([y]);
|
|
1681
1693
|
};
|
|
1682
|
-
return A instanceof Promise ? A.then(
|
|
1683
|
-
throw
|
|
1684
|
-
}) :
|
|
1685
|
-
},
|
|
1694
|
+
return A instanceof Promise ? A.then(H, (y) => {
|
|
1695
|
+
throw ze(h(O)), y;
|
|
1696
|
+
}) : H(A);
|
|
1697
|
+
}, P = Ss();
|
|
1686
1698
|
Object.prototype.constructor.toString();
|
|
1687
|
-
const
|
|
1688
|
-
let
|
|
1689
|
-
let t = "",
|
|
1699
|
+
const As = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
|
|
1700
|
+
let Es = (e = 21) => {
|
|
1701
|
+
let t = "", n = crypto.getRandomValues(new Uint8Array(e |= 0));
|
|
1690
1702
|
for (; e--; )
|
|
1691
|
-
t +=
|
|
1703
|
+
t += As[n[e] & 63];
|
|
1692
1704
|
return t;
|
|
1693
1705
|
};
|
|
1694
|
-
class
|
|
1706
|
+
class Ms {
|
|
1695
1707
|
age = 0;
|
|
1696
1708
|
capacity = 0;
|
|
1697
1709
|
storage = /* @__PURE__ */ new Map();
|
|
1698
|
-
constructor(t = 0,
|
|
1699
|
-
this.age = t, this.capacity =
|
|
1710
|
+
constructor(t = 0, n = 0) {
|
|
1711
|
+
this.age = t, this.capacity = n;
|
|
1700
1712
|
}
|
|
1701
1713
|
invalidate() {
|
|
1702
1714
|
this.storage.clear();
|
|
1703
1715
|
}
|
|
1704
|
-
reset(t,
|
|
1705
|
-
this.invalidate(), this.age = t, this.capacity =
|
|
1716
|
+
reset(t, n) {
|
|
1717
|
+
this.invalidate(), this.age = t, this.capacity = n;
|
|
1706
1718
|
}
|
|
1707
1719
|
get(t) {
|
|
1708
1720
|
if (this.capacity === 0) return;
|
|
1709
|
-
const
|
|
1710
|
-
if (
|
|
1711
|
-
if (Date.now() -
|
|
1721
|
+
const n = this.storage.get(t);
|
|
1722
|
+
if (n)
|
|
1723
|
+
if (Date.now() - n.ts > this.age) {
|
|
1712
1724
|
this.storage.delete(t);
|
|
1713
1725
|
return;
|
|
1714
1726
|
} else
|
|
1715
|
-
return
|
|
1727
|
+
return n.data;
|
|
1716
1728
|
}
|
|
1717
|
-
put(t,
|
|
1718
|
-
if (this.capacity > 0 && this.storage.set(t, { data:
|
|
1719
|
-
const
|
|
1720
|
-
this.storage.delete(
|
|
1729
|
+
put(t, n) {
|
|
1730
|
+
if (this.capacity > 0 && this.storage.set(t, { data: n, ts: Date.now() }), this.storage.size > this.capacity) {
|
|
1731
|
+
const r = [...this.storage.keys()].at(0);
|
|
1732
|
+
this.storage.delete(r);
|
|
1721
1733
|
}
|
|
1722
1734
|
}
|
|
1723
1735
|
remove(t) {
|
|
1724
1736
|
this.storage.delete(t);
|
|
1725
1737
|
}
|
|
1726
|
-
withCache = async (t,
|
|
1727
|
-
const
|
|
1728
|
-
return
|
|
1738
|
+
withCache = async (t, n) => {
|
|
1739
|
+
const r = this.get(t);
|
|
1740
|
+
return r || n().then((i) => (this.put(t, i), i));
|
|
1729
1741
|
};
|
|
1730
1742
|
}
|
|
1731
|
-
|
|
1732
|
-
|
|
1743
|
+
const ie = "CANCEL_RECOVERABLE", ne = "CANCELLED_BY_USER", Ts = (e) => {
|
|
1744
|
+
const t = pn(e);
|
|
1745
|
+
return K(() => (Bo(e, t.current) || (t.current = e), t.current), [e]);
|
|
1746
|
+
};
|
|
1747
|
+
function Ps(e, t, n) {
|
|
1748
|
+
return new Promise((r, i) => {
|
|
1749
|
+
const o = setTimeout(() => {
|
|
1750
|
+
t.removeEventListener("abort", s), r("WAIT_COMPLETE");
|
|
1751
|
+
}, e), s = () => {
|
|
1752
|
+
n?.(), clearTimeout(o), i(ie);
|
|
1753
|
+
};
|
|
1754
|
+
t.addEventListener("abort", s);
|
|
1755
|
+
});
|
|
1756
|
+
}
|
|
1757
|
+
const un = Object.freeze({
|
|
1758
|
+
items: /* @__PURE__ */ new Map(),
|
|
1759
|
+
context: {},
|
|
1760
|
+
fetchState: {
|
|
1761
|
+
isLoading: !1,
|
|
1762
|
+
errors: [],
|
|
1763
|
+
metadata: {}
|
|
1764
|
+
}
|
|
1765
|
+
});
|
|
1766
|
+
class B {
|
|
1767
|
+
constructor(t = "<none>", n) {
|
|
1768
|
+
this.id = t, this.config = n, this.setItems([]);
|
|
1769
|
+
const { caching: { age: r = 0, capacity: i = 0 } = { age: 0, capacity: 0 }, context: o } = n;
|
|
1770
|
+
this.state.context = o, this.fetchCache.reset(r, i);
|
|
1771
|
+
}
|
|
1733
1772
|
batched = !1;
|
|
1734
|
-
state =
|
|
1735
|
-
items: /* @__PURE__ */ new Map(),
|
|
1736
|
-
fetchState: {
|
|
1737
|
-
isLoading: !1,
|
|
1738
|
-
errors: [],
|
|
1739
|
-
metadata: {}
|
|
1740
|
-
}
|
|
1741
|
-
};
|
|
1742
|
-
options = { initialData: [] };
|
|
1773
|
+
state = un;
|
|
1743
1774
|
subscribers = /* @__PURE__ */ new Set();
|
|
1744
1775
|
controllers = /* @__PURE__ */ new Map();
|
|
1745
1776
|
fetchController = new AbortController();
|
|
1746
|
-
fetchCache = new
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
const { initialData: n = [], caching: i } = r;
|
|
1750
|
-
this.setItems(n), this.fetchCache.reset(i?.age || 0, i?.capacity || 0);
|
|
1751
|
-
}
|
|
1752
|
-
getCacheKey(t) {
|
|
1753
|
-
return `[${this.id}, ${JSON.stringify(t)}]`;
|
|
1754
|
-
}
|
|
1755
|
-
customLog = (t = "log", ...r) => {
|
|
1756
|
-
};
|
|
1757
|
-
wait = (t, r) => new Promise((n, i) => {
|
|
1758
|
-
const s = () => {
|
|
1759
|
-
this.customLog("delay", "Fetch operation canceled due to debounce re-entry"), i("DEBOUNCE_CANCELLED");
|
|
1760
|
-
};
|
|
1761
|
-
r.addEventListener("abort", s), setTimeout(() => {
|
|
1762
|
-
r.removeEventListener("abort", s), n("");
|
|
1763
|
-
}, t);
|
|
1764
|
-
});
|
|
1765
|
-
batch = (t) => {
|
|
1766
|
-
this.batched = !0, t(), this.batched = !1, this.notify();
|
|
1767
|
-
};
|
|
1768
|
-
setItems = (t) => {
|
|
1769
|
-
const r = /* @__PURE__ */ new Map();
|
|
1770
|
-
t.forEach((n) => {
|
|
1771
|
-
r.set(n.id, {
|
|
1772
|
-
data: n,
|
|
1773
|
-
state: "idle",
|
|
1774
|
-
optimistic: !1,
|
|
1775
|
-
errors: []
|
|
1776
|
-
});
|
|
1777
|
-
}), this.state = R(this.state, (n) => {
|
|
1778
|
-
n.items = r;
|
|
1779
|
-
}), this.notify();
|
|
1780
|
-
};
|
|
1781
|
-
setMetadata = (t) => {
|
|
1782
|
-
this.state = R(this.state, (r) => {
|
|
1783
|
-
r.fetchState.metadata = t;
|
|
1784
|
-
}), this.notify();
|
|
1785
|
-
};
|
|
1786
|
-
remove = (t) => {
|
|
1787
|
-
this.state = R(this.state, (r) => {
|
|
1788
|
-
r.items.delete(t);
|
|
1789
|
-
}), this.notify();
|
|
1790
|
-
};
|
|
1791
|
-
updateItem = (t) => {
|
|
1792
|
-
this.state = R(this.state, (r) => {
|
|
1793
|
-
const n = r.items.get(t.id);
|
|
1794
|
-
n && (Qs(n, "data", t), this.notify());
|
|
1795
|
-
});
|
|
1796
|
-
};
|
|
1797
|
-
clearFetchCache = (t) => {
|
|
1798
|
-
this.fetchCache.remove(this.getCacheKey(t));
|
|
1799
|
-
};
|
|
1800
|
-
startFetch = () => {
|
|
1801
|
-
this.fetchController.abort(), this.state = R(this.state, (t) => {
|
|
1802
|
-
t.fetchState.isLoading = !0;
|
|
1803
|
-
}), this.fetchController = new AbortController(), this.notify();
|
|
1804
|
-
};
|
|
1805
|
-
endFetch = (t = []) => {
|
|
1806
|
-
this.state = R(this.state, (r) => {
|
|
1807
|
-
r.fetchState.isLoading = !1, r.fetchState.errors = t;
|
|
1808
|
-
}), this.notify();
|
|
1809
|
-
};
|
|
1810
|
-
executeFetch = async (t, r) => {
|
|
1811
|
-
const n = this.getCacheKey(t);
|
|
1777
|
+
fetchCache = new Ms();
|
|
1778
|
+
executeFetch = async (t) => {
|
|
1779
|
+
const { fetch: n } = this.config, r = this.getCacheKey();
|
|
1812
1780
|
this.startFetch();
|
|
1813
1781
|
try {
|
|
1814
1782
|
let i = null;
|
|
1815
|
-
|
|
1783
|
+
n ? i = await this.fetchCache.withCache(r, async () => (await Ps(this.config.debounce || 0, this.fetchController.signal, () => {
|
|
1784
|
+
this.customLog("delay", "Fetch operation canceled due to debounce re-entry");
|
|
1785
|
+
}), this.customLog("fetch execution", "Executing fetch function"), n({
|
|
1816
1786
|
signal: this.fetchController.signal,
|
|
1817
1787
|
context: t
|
|
1818
1788
|
}))) : i = { items: [], metadata: {} }, this.batch(() => {
|
|
1819
|
-
this.setItems(i.items), this.setMetadata(i.metadata), this.endFetch();
|
|
1789
|
+
this.setItems(i.items), this.setMetadata(i.metadata), this.setContext(t), this.endFetch();
|
|
1820
1790
|
});
|
|
1821
1791
|
} catch (i) {
|
|
1822
|
-
if (i === "
|
|
1823
|
-
return;
|
|
1824
|
-
if (i.name === "AbortError") {
|
|
1792
|
+
if (i.name === "AbortError" || i === ie) {
|
|
1825
1793
|
this.customLog("fetch exception", "Fetch operation was cancelled by client"), this.endFetch();
|
|
1826
1794
|
return;
|
|
1827
1795
|
}
|
|
1796
|
+
if (i === ne) {
|
|
1797
|
+
this.endFetch();
|
|
1798
|
+
return;
|
|
1799
|
+
}
|
|
1828
1800
|
this.batch(() => {
|
|
1829
1801
|
this.endFetch([i.message]), this.setItems([]);
|
|
1830
1802
|
});
|
|
1831
1803
|
}
|
|
1832
1804
|
};
|
|
1833
|
-
executeRemove = async (t
|
|
1834
|
-
const i = this.startTransition({
|
|
1835
|
-
id: t.
|
|
1836
|
-
input: t
|
|
1805
|
+
executeRemove = async (t) => {
|
|
1806
|
+
const { context: n } = this.state, { remove: r } = this.config, i = this.startTransition({
|
|
1807
|
+
id: t.id,
|
|
1808
|
+
input: t,
|
|
1837
1809
|
state: "delete"
|
|
1838
1810
|
});
|
|
1839
|
-
if (
|
|
1811
|
+
if (r)
|
|
1840
1812
|
try {
|
|
1841
|
-
await
|
|
1842
|
-
} catch (
|
|
1843
|
-
if (
|
|
1844
|
-
|
|
1845
|
-
const c = o.items.get(t.data.id);
|
|
1846
|
-
c && (c.state = "idle", c.action = void 0, c.errors = []);
|
|
1847
|
-
}), this.notify(), s;
|
|
1813
|
+
await r(t, { signal: i.signal, context: n }), this.remove(t.id), this.startTransition({ id: t.id, state: "idle" });
|
|
1814
|
+
} catch (o) {
|
|
1815
|
+
if (o.name === "AbortError" || o === ie || o === ne)
|
|
1816
|
+
return;
|
|
1848
1817
|
this.startTransition({
|
|
1849
|
-
id: t.
|
|
1850
|
-
input: t
|
|
1818
|
+
id: t.id,
|
|
1819
|
+
input: t,
|
|
1851
1820
|
state: "delete",
|
|
1852
|
-
errors: [
|
|
1821
|
+
errors: [o.message]
|
|
1853
1822
|
});
|
|
1854
1823
|
}
|
|
1855
1824
|
else
|
|
1856
|
-
this.
|
|
1857
|
-
|
|
1825
|
+
this.batch(() => {
|
|
1826
|
+
this.remove(t.id), this.startTransition({ id: t.id, fromState: "delete", state: "idle" });
|
|
1827
|
+
});
|
|
1828
|
+
this.fetchCache.remove(this.getCacheKey());
|
|
1858
1829
|
};
|
|
1859
|
-
executeUpdate = async (
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1830
|
+
executeUpdate = async ({
|
|
1831
|
+
item: t,
|
|
1832
|
+
updater: n = Ke,
|
|
1833
|
+
isOptimistic: r = !1,
|
|
1834
|
+
skipSave: i = !1,
|
|
1835
|
+
tag: o = void 0
|
|
1836
|
+
// for multiple parallel updates use tags
|
|
1837
|
+
}) => {
|
|
1838
|
+
const { context: s } = this.state, { update: c } = this.config, a = t.id;
|
|
1839
|
+
if (this.state.items.has(a)) {
|
|
1840
|
+
const f = this.state.items.get(a).data, u = P(f, n), l = this.startTransition({
|
|
1841
|
+
id: a,
|
|
1842
|
+
input: u,
|
|
1865
1843
|
state: "update",
|
|
1866
|
-
isOptimistic:
|
|
1844
|
+
isOptimistic: r,
|
|
1845
|
+
tag: o
|
|
1867
1846
|
});
|
|
1868
|
-
if (
|
|
1847
|
+
if (r && this.updateItem(u), c && !i)
|
|
1869
1848
|
try {
|
|
1870
|
-
await
|
|
1871
|
-
} catch (
|
|
1872
|
-
if (
|
|
1873
|
-
|
|
1849
|
+
await c(u, { signal: l.signal, context: s }), this.updateItem(u), this.startTransition({ id: a, state: "idle", fromState: "update", tag: o });
|
|
1850
|
+
} catch (p) {
|
|
1851
|
+
if (p.name === "AbortError" || p === ie)
|
|
1852
|
+
return;
|
|
1853
|
+
if (p === ne) {
|
|
1854
|
+
this.batch(() => {
|
|
1855
|
+
this.updateItem(f), this.startTransition({ id: u.id, state: "idle", fromState: "update", tag: o });
|
|
1856
|
+
});
|
|
1874
1857
|
return;
|
|
1875
1858
|
}
|
|
1876
1859
|
this.startTransition({
|
|
1877
|
-
id:
|
|
1878
|
-
input:
|
|
1879
|
-
state: "
|
|
1880
|
-
errors: [
|
|
1860
|
+
id: a,
|
|
1861
|
+
input: u,
|
|
1862
|
+
state: "update",
|
|
1863
|
+
errors: [p.message],
|
|
1864
|
+
tag: o
|
|
1881
1865
|
});
|
|
1882
1866
|
}
|
|
1883
1867
|
else
|
|
1884
|
-
this.updateItem(
|
|
1885
|
-
this.fetchCache.remove(this.getCacheKey(
|
|
1868
|
+
this.updateItem(u), this.startTransition({ id: a, state: "changed", tag: o });
|
|
1869
|
+
this.fetchCache.remove(this.getCacheKey());
|
|
1886
1870
|
}
|
|
1887
1871
|
};
|
|
1888
|
-
executeCreate = async (t
|
|
1889
|
-
const i = `create_${
|
|
1890
|
-
this.state =
|
|
1872
|
+
executeCreate = async (t) => {
|
|
1873
|
+
const { context: n } = this.state, { create: r } = this.config, i = `create_${Es(8)}`, o = { ...t, id: i }, s = (a) => {
|
|
1874
|
+
this.state = P(this.state, (f) => {
|
|
1891
1875
|
const u = {
|
|
1892
|
-
data: { ...
|
|
1893
|
-
errors:
|
|
1876
|
+
data: { ...t, id: i },
|
|
1877
|
+
errors: /* @__PURE__ */ new Map(),
|
|
1894
1878
|
optimistic: !0,
|
|
1895
1879
|
// always true for create
|
|
1896
|
-
|
|
1897
|
-
action: ["create", s]
|
|
1880
|
+
transitions: /* @__PURE__ */ new Map([["default", ["create", t, Date.now()]]])
|
|
1898
1881
|
};
|
|
1899
|
-
f.items.set(
|
|
1882
|
+
f.items.set(i, u);
|
|
1900
1883
|
}), this.notify();
|
|
1901
1884
|
};
|
|
1902
|
-
|
|
1885
|
+
s();
|
|
1903
1886
|
const c = this.startTransition({
|
|
1904
1887
|
id: i,
|
|
1905
|
-
input:
|
|
1888
|
+
input: o,
|
|
1906
1889
|
state: "create",
|
|
1907
1890
|
isOptimistic: !0,
|
|
1908
1891
|
errors: []
|
|
1909
1892
|
});
|
|
1910
|
-
if (
|
|
1893
|
+
if (r)
|
|
1911
1894
|
try {
|
|
1912
|
-
const { id: a } = await
|
|
1895
|
+
const { id: a } = await r(t, {
|
|
1913
1896
|
signal: c.signal,
|
|
1914
|
-
context:
|
|
1897
|
+
context: n
|
|
1915
1898
|
});
|
|
1916
|
-
if (
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
})
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
}
|
|
1927
|
-
o(a), this.startTransition({ id: a, state: "idle" });
|
|
1899
|
+
if (!a)
|
|
1900
|
+
throw new Error("create action must return id of the created item");
|
|
1901
|
+
const f = /* @__PURE__ */ new Map();
|
|
1902
|
+
this.state.items.forEach((u, l) => {
|
|
1903
|
+
l === i ? (f.delete(i), f.set(a, {
|
|
1904
|
+
...u,
|
|
1905
|
+
data: { ...u.data, id: a }
|
|
1906
|
+
})) : f.set(l, u);
|
|
1907
|
+
}), this.state = P(this.state, (u) => {
|
|
1908
|
+
u.items = f;
|
|
1909
|
+
}), this.startTransition({ id: a, state: "idle", fromState: "create" });
|
|
1928
1910
|
} catch (a) {
|
|
1929
|
-
if (a.name === "AbortError")
|
|
1930
|
-
|
|
1911
|
+
if (a.name === "AbortError" || a === ie)
|
|
1912
|
+
return;
|
|
1913
|
+
if (a === ne) {
|
|
1914
|
+
this.remove(i);
|
|
1931
1915
|
return;
|
|
1932
1916
|
}
|
|
1933
1917
|
this.startTransition({
|
|
1934
1918
|
id: i,
|
|
1935
|
-
input:
|
|
1919
|
+
input: o,
|
|
1936
1920
|
state: "create",
|
|
1937
1921
|
errors: [a.message]
|
|
1938
1922
|
});
|
|
1939
1923
|
}
|
|
1940
1924
|
else
|
|
1941
|
-
|
|
1942
|
-
this.fetchCache.remove(this.getCacheKey(
|
|
1925
|
+
s(), this.startTransition({ id: i, state: "idle" });
|
|
1926
|
+
this.fetchCache.remove(this.getCacheKey());
|
|
1943
1927
|
};
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
}
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1928
|
+
getCacheKey() {
|
|
1929
|
+
const { context: t } = this.state;
|
|
1930
|
+
return `[${this.id}, ${JSON.stringify(t)}]`;
|
|
1931
|
+
}
|
|
1932
|
+
getControlerId = (t, n) => Et(wt([t, n === "default" ? null : n]), ":");
|
|
1933
|
+
customLog = (t = "log", ...n) => {
|
|
1934
|
+
};
|
|
1935
|
+
batch = (t) => {
|
|
1936
|
+
this.batched = !0, t(), this.batched = !1, this.notify();
|
|
1937
|
+
};
|
|
1938
|
+
setItems = (t) => {
|
|
1939
|
+
if (new Set(No(t, "id")).size !== Ie(t))
|
|
1940
|
+
throw new Error("Missing `id` prop on one or more items");
|
|
1941
|
+
const r = /* @__PURE__ */ new Map();
|
|
1942
|
+
t.forEach((i) => {
|
|
1943
|
+
i.id = `${i.id}`, r.set(i.id, {
|
|
1944
|
+
data: i,
|
|
1945
|
+
optimistic: !1,
|
|
1946
|
+
errors: /* @__PURE__ */ new Map(),
|
|
1947
|
+
transitions: /* @__PURE__ */ new Map()
|
|
1948
|
+
});
|
|
1949
|
+
}), this.state = P(this.state, (i) => {
|
|
1950
|
+
i.items = r;
|
|
1951
|
+
}), this.notify();
|
|
1952
|
+
};
|
|
1953
|
+
setMetadata = (t) => {
|
|
1954
|
+
this.state = P(this.state, (n) => {
|
|
1955
|
+
n.fetchState.metadata = t;
|
|
1956
|
+
}), this.notify();
|
|
1957
|
+
};
|
|
1958
|
+
setContext = (t) => {
|
|
1959
|
+
this.state = P(this.state, (n) => {
|
|
1960
|
+
n.context = t;
|
|
1961
|
+
}), this.notify();
|
|
1962
|
+
};
|
|
1963
|
+
remove = (t) => {
|
|
1964
|
+
this.state = P(this.state, (n) => {
|
|
1965
|
+
n.items.delete(t);
|
|
1966
|
+
}), this.notify();
|
|
1967
|
+
};
|
|
1968
|
+
updateItem = (t) => {
|
|
1969
|
+
this.state = P(this.state, (n) => {
|
|
1970
|
+
const r = n.items.get(t.id);
|
|
1971
|
+
r && (ss(r, "data", t), this.notify());
|
|
1972
|
+
});
|
|
1973
|
+
};
|
|
1974
|
+
clearFetchCache = () => {
|
|
1975
|
+
this.fetchCache.remove(this.getCacheKey());
|
|
1976
|
+
};
|
|
1977
|
+
startFetch = () => {
|
|
1978
|
+
this.fetchController.abort(), this.state = P(this.state, (t) => {
|
|
1979
|
+
t.fetchState.isLoading = !0;
|
|
1980
|
+
}), this.fetchController = new AbortController(), this.notify();
|
|
1981
|
+
};
|
|
1982
|
+
endFetch = (t = []) => {
|
|
1983
|
+
this.state = P(this.state, (n) => {
|
|
1984
|
+
n.fetchState.isLoading = !1, n.fetchState.errors = t;
|
|
1985
|
+
}), this.notify();
|
|
1956
1986
|
};
|
|
1957
1987
|
cancelFetch = () => {
|
|
1958
1988
|
this.fetchController.abort();
|
|
1959
1989
|
};
|
|
1960
|
-
cancelOperation = (t) => {
|
|
1961
|
-
this.
|
|
1990
|
+
cancelOperation = (t, n) => {
|
|
1991
|
+
const r = this.getControlerId(t, n);
|
|
1992
|
+
this.controllers.get(r)?.abort(ne);
|
|
1993
|
+
};
|
|
1994
|
+
startTransition = ({
|
|
1995
|
+
id: t,
|
|
1996
|
+
input: n = void 0,
|
|
1997
|
+
state: r,
|
|
1998
|
+
fromState: i = r,
|
|
1999
|
+
// only required for parallel updates
|
|
2000
|
+
isOptimistic: o = !1,
|
|
2001
|
+
errors: s = [],
|
|
2002
|
+
tag: c = "default"
|
|
2003
|
+
}) => {
|
|
2004
|
+
const a = new AbortController(), f = this.getControlerId(t, c);
|
|
2005
|
+
return this.state.items.has(t) && (this.controllers.get(f)?.abort(), this.controllers.set(f, a), this.state = P(this.state, (u) => {
|
|
2006
|
+
const l = u.items.get(t);
|
|
2007
|
+
l.optimistic = o;
|
|
2008
|
+
const p = Et(wt([i, c === "default" ? null : c]), ":");
|
|
2009
|
+
r === "idle" ? l.errors.delete(p) : Ie(s) > 0 && l.errors.set(p, s), r === "idle" ? l.transitions.delete(c) : l.transitions.set(c, [r, n, Date.now()]);
|
|
2010
|
+
}), this.notify()), a;
|
|
1962
2011
|
};
|
|
1963
2012
|
notify = () => {
|
|
1964
2013
|
this.subscribers.forEach((t) => {
|
|
@@ -1971,153 +2020,116 @@ class K {
|
|
|
1971
2020
|
});
|
|
1972
2021
|
static instances = /* @__PURE__ */ new Map();
|
|
1973
2022
|
static createStore(t) {
|
|
1974
|
-
const { id:
|
|
1975
|
-
return
|
|
2023
|
+
const { id: n } = t;
|
|
2024
|
+
return B.instances.has(n) || B.instances.set(n, new B(n, t)), B.instances.get(n);
|
|
1976
2025
|
}
|
|
1977
2026
|
}
|
|
1978
|
-
|
|
1979
|
-
const t =
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
p.clearFetchCache(r), p.executeFetch(r, t.current.fetch);
|
|
1991
|
-
}, [r, n]), o = P(
|
|
1992
|
-
(p) => {
|
|
1993
|
-
n().executeCreate(r, p, t.current.create);
|
|
1994
|
-
},
|
|
1995
|
-
[r, n]
|
|
1996
|
-
), c = P(
|
|
1997
|
-
(p, h) => {
|
|
1998
|
-
n().executeUpdate(p, r, h, void 0, !0);
|
|
1999
|
-
},
|
|
2000
|
-
[r, n]
|
|
2001
|
-
), a = P(
|
|
2002
|
-
(p) => {
|
|
2003
|
-
const h = n();
|
|
2004
|
-
h.getSnapshot().items.get(p.data.id) && t.current.update ? h.executeUpdate(p, r, Ct, t.current.update) : h.customLog("save", "Non existent item or update function does not exist in config");
|
|
2005
|
-
},
|
|
2006
|
-
[r, n]
|
|
2007
|
-
), f = P(
|
|
2008
|
-
(p, h, w = !1) => {
|
|
2009
|
-
n().executeUpdate(p, r, h, t.current.update, w);
|
|
2027
|
+
function Rs(e) {
|
|
2028
|
+
const t = B.createStore(e), n = dn(
|
|
2029
|
+
t.subscribe,
|
|
2030
|
+
t.getSnapshot,
|
|
2031
|
+
e.getServerSnapshot || (() => un)
|
|
2032
|
+
), r = Ts(e.context), i = C(() => {
|
|
2033
|
+
t.clearFetchCache(), t.executeFetch(r);
|
|
2034
|
+
}, [t, r]), o = C(() => {
|
|
2035
|
+
t.cancelFetch();
|
|
2036
|
+
}, [t]), s = C(
|
|
2037
|
+
(d, b) => {
|
|
2038
|
+
t.cancelOperation(d, b);
|
|
2010
2039
|
},
|
|
2011
|
-
[
|
|
2012
|
-
),
|
|
2013
|
-
(
|
|
2014
|
-
|
|
2040
|
+
[t]
|
|
2041
|
+
), c = C(
|
|
2042
|
+
(d) => {
|
|
2043
|
+
t.executeCreate(d);
|
|
2015
2044
|
},
|
|
2016
|
-
[
|
|
2017
|
-
),
|
|
2018
|
-
(
|
|
2019
|
-
|
|
2020
|
-
if (p.action) {
|
|
2021
|
-
const [w, v] = p.action;
|
|
2022
|
-
switch (w) {
|
|
2023
|
-
case "create":
|
|
2024
|
-
h.executeCreate(r, v, t.current.create);
|
|
2025
|
-
break;
|
|
2026
|
-
case "delete":
|
|
2027
|
-
h.executeRemove(
|
|
2028
|
-
{ data: v, state: "idle", errors: [], optimistic: !1 },
|
|
2029
|
-
r,
|
|
2030
|
-
t.current.remove
|
|
2031
|
-
);
|
|
2032
|
-
break;
|
|
2033
|
-
case "update":
|
|
2034
|
-
h.executeUpdate(
|
|
2035
|
-
{ data: v, state: "idle", optimistic: !1, errors: [] },
|
|
2036
|
-
r,
|
|
2037
|
-
() => v,
|
|
2038
|
-
t.current.update
|
|
2039
|
-
);
|
|
2040
|
-
break;
|
|
2041
|
-
}
|
|
2042
|
-
h.executeRemove(p, r, t.current.remove);
|
|
2043
|
-
}
|
|
2045
|
+
[t]
|
|
2046
|
+
), a = C(
|
|
2047
|
+
(d) => {
|
|
2048
|
+
t.executeRemove(d);
|
|
2044
2049
|
},
|
|
2045
|
-
[
|
|
2046
|
-
),
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
(p) => {
|
|
2050
|
-
n().cancelOperation(p);
|
|
2050
|
+
[t]
|
|
2051
|
+
), f = C(
|
|
2052
|
+
(d) => {
|
|
2053
|
+
t.executeFetch(d);
|
|
2051
2054
|
},
|
|
2052
|
-
[
|
|
2055
|
+
[t]
|
|
2053
2056
|
);
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
update: f,
|
|
2059
|
-
change: c,
|
|
2060
|
-
save: a,
|
|
2061
|
-
retry: l,
|
|
2062
|
-
remove: u,
|
|
2063
|
-
cancelFetch: y,
|
|
2064
|
-
cancelOperation: m
|
|
2065
|
-
};
|
|
2066
|
-
}
|
|
2067
|
-
function So(e) {
|
|
2068
|
-
const t = le(
|
|
2069
|
-
() => K.createStore({
|
|
2070
|
-
id: e.id,
|
|
2071
|
-
initialData: [],
|
|
2072
|
-
caching: e.caching,
|
|
2073
|
-
debounce: e.debounce
|
|
2074
|
-
}),
|
|
2075
|
-
[e.id, e.caching, e.debounce]
|
|
2076
|
-
), { fetch: r, create: n, update: i, change: s, save: o, retry: c, remove: a, cancelOperation: f, cancelFetch: u } = _o(e), l = ar(t.subscribe, t.getSnapshot, e.getServerSnapshot), y = sr(e.context);
|
|
2077
|
-
cr(() => {
|
|
2078
|
-
r();
|
|
2079
|
-
}, [e.id, y]);
|
|
2080
|
-
const m = le(() => js([...l.items.values()], (h) => ({
|
|
2081
|
-
...h,
|
|
2082
|
-
id: h.data.id
|
|
2083
|
-
})), [l.items]), p = le(
|
|
2057
|
+
hn(() => {
|
|
2058
|
+
f(r);
|
|
2059
|
+
}, [f, r]);
|
|
2060
|
+
const u = K(() => [...n.items.values()], [n.items]), l = Ie(n.fetchState.errors) > 0 || us(u, (d) => d.errors.size > 0), p = K(
|
|
2084
2061
|
() => ({
|
|
2085
|
-
itemsById:
|
|
2086
|
-
items:
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
change: s,
|
|
2094
|
-
retry: c,
|
|
2095
|
-
save: o,
|
|
2062
|
+
itemsById: n.items,
|
|
2063
|
+
items: u,
|
|
2064
|
+
fetchState: n.fetchState,
|
|
2065
|
+
hasError: l,
|
|
2066
|
+
cancelFetch: o,
|
|
2067
|
+
cancelOperation: s,
|
|
2068
|
+
refetch: i,
|
|
2069
|
+
create: c,
|
|
2096
2070
|
remove: a,
|
|
2097
|
-
|
|
2098
|
-
cancelOperation: f
|
|
2071
|
+
store: t
|
|
2099
2072
|
}),
|
|
2100
2073
|
[
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
2074
|
+
t,
|
|
2075
|
+
n.items,
|
|
2076
|
+
n.fetchState,
|
|
2077
|
+
u,
|
|
2078
|
+
o,
|
|
2079
|
+
s,
|
|
2107
2080
|
i,
|
|
2108
2081
|
c,
|
|
2109
|
-
s,
|
|
2110
|
-
o,
|
|
2111
2082
|
a,
|
|
2112
|
-
|
|
2113
|
-
f
|
|
2083
|
+
l
|
|
2114
2084
|
]
|
|
2115
2085
|
);
|
|
2116
2086
|
return t.customLog("snapshot", p), p;
|
|
2117
2087
|
}
|
|
2088
|
+
function xs(e, t) {
|
|
2089
|
+
const n = B.instances.get(e), r = K(() => t.data, [t.data]), i = K(() => t.transitions, [t.transitions]), o = C(
|
|
2090
|
+
(d, { tag: b, isOptimistic: w = !1 } = {}) => {
|
|
2091
|
+
n.executeUpdate({ item: r, updater: d, tag: b, isOptimistic: w });
|
|
2092
|
+
},
|
|
2093
|
+
[r, n]
|
|
2094
|
+
), s = C(() => {
|
|
2095
|
+
n.executeRemove(r);
|
|
2096
|
+
}, [r, n]), c = C(
|
|
2097
|
+
(d, b) => {
|
|
2098
|
+
n.executeUpdate({ item: r, updater: d, isOptimistic: !0, skipSave: !0, tag: b });
|
|
2099
|
+
},
|
|
2100
|
+
[r, n]
|
|
2101
|
+
), a = C(() => {
|
|
2102
|
+
n.executeUpdate({ item: r, updater: Ke, isOptimistic: !1 });
|
|
2103
|
+
}, [r, n]), f = C(
|
|
2104
|
+
(d) => {
|
|
2105
|
+
n.cancelOperation(r.id, d);
|
|
2106
|
+
},
|
|
2107
|
+
[n, r.id]
|
|
2108
|
+
), u = K(() => {
|
|
2109
|
+
const d = /* @__PURE__ */ new Set();
|
|
2110
|
+
return i.forEach((b, w) => {
|
|
2111
|
+
const [_] = b;
|
|
2112
|
+
d.add(`${_}${w === "default" ? "" : `:${w}`}`);
|
|
2113
|
+
}), d;
|
|
2114
|
+
}, [i]), l = K(() => t.errors.size > 0, [t.errors]), p = K(() => t.errors.size, [t.errors]);
|
|
2115
|
+
return [
|
|
2116
|
+
r,
|
|
2117
|
+
{
|
|
2118
|
+
update: o,
|
|
2119
|
+
change: c,
|
|
2120
|
+
save: a,
|
|
2121
|
+
remove: s,
|
|
2122
|
+
cancel: f,
|
|
2123
|
+
errors: t.errors,
|
|
2124
|
+
errorCount: p,
|
|
2125
|
+
hasError: l,
|
|
2126
|
+
states: u,
|
|
2127
|
+
itemWithState: t,
|
|
2128
|
+
store: n
|
|
2129
|
+
}
|
|
2130
|
+
];
|
|
2131
|
+
}
|
|
2118
2132
|
export {
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
_o as useCrudOperations,
|
|
2122
|
-
sr as useMemoDeepEquals
|
|
2133
|
+
Rs as useCrud,
|
|
2134
|
+
xs as useItemState
|
|
2123
2135
|
};
|