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