@coinbase/cdp-core 0.0.46 → 0.0.47

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.
Files changed (63) hide show
  1. package/dist/esm/index.web101.js +19 -77
  2. package/dist/esm/index.web102.js +9 -9
  3. package/dist/esm/index.web103.js +19 -20
  4. package/dist/esm/index.web104.js +93 -9
  5. package/dist/esm/index.web105.js +19 -18
  6. package/dist/esm/index.web106.js +105 -81
  7. package/dist/esm/index.web107.js +78 -20
  8. package/dist/esm/index.web108.js +9 -117
  9. package/dist/esm/index.web11.js +4 -4
  10. package/dist/esm/index.web110.js +18 -13
  11. package/dist/esm/index.web111.js +27 -35
  12. package/dist/esm/index.web112.js +7 -41
  13. package/dist/esm/index.web113.js +11 -18
  14. package/dist/esm/index.web114.js +13 -28
  15. package/dist/esm/index.web115.js +10 -8
  16. package/dist/esm/index.web116.js +17 -11
  17. package/dist/esm/index.web117.js +80 -12
  18. package/dist/esm/index.web118.js +13 -10
  19. package/dist/esm/index.web119.js +36 -17
  20. package/dist/esm/index.web120.js +40 -79
  21. package/dist/esm/index.web16.js +1 -1
  22. package/dist/esm/index.web31.js +149 -940
  23. package/dist/esm/index.web32.js +48 -2
  24. package/dist/esm/index.web33.js +244 -43
  25. package/dist/esm/index.web34.js +55 -27
  26. package/dist/esm/index.web35.js +940 -149
  27. package/dist/esm/index.web36.js +2 -48
  28. package/dist/esm/index.web37.js +43 -244
  29. package/dist/esm/index.web38.js +27 -55
  30. package/dist/esm/index.web89.js +6 -6
  31. package/dist/esm/index.web98.js +1 -1
  32. package/dist/web/index.web101.js +19 -77
  33. package/dist/web/index.web102.js +9 -9
  34. package/dist/web/index.web103.js +19 -20
  35. package/dist/web/index.web104.js +93 -9
  36. package/dist/web/index.web105.js +19 -18
  37. package/dist/web/index.web106.js +105 -81
  38. package/dist/web/index.web107.js +78 -20
  39. package/dist/web/index.web108.js +9 -117
  40. package/dist/web/index.web11.js +4 -4
  41. package/dist/web/index.web110.js +18 -13
  42. package/dist/web/index.web111.js +27 -35
  43. package/dist/web/index.web112.js +7 -41
  44. package/dist/web/index.web113.js +11 -18
  45. package/dist/web/index.web114.js +13 -28
  46. package/dist/web/index.web115.js +10 -8
  47. package/dist/web/index.web116.js +17 -11
  48. package/dist/web/index.web117.js +80 -12
  49. package/dist/web/index.web118.js +13 -10
  50. package/dist/web/index.web119.js +36 -17
  51. package/dist/web/index.web120.js +40 -79
  52. package/dist/web/index.web16.js +1 -1
  53. package/dist/web/index.web31.js +149 -940
  54. package/dist/web/index.web32.js +48 -2
  55. package/dist/web/index.web33.js +244 -43
  56. package/dist/web/index.web34.js +55 -27
  57. package/dist/web/index.web35.js +940 -149
  58. package/dist/web/index.web36.js +2 -48
  59. package/dist/web/index.web37.js +43 -244
  60. package/dist/web/index.web38.js +27 -55
  61. package/dist/web/index.web89.js +6 -6
  62. package/dist/web/index.web98.js +1 -1
  63. package/package.json +2 -2
@@ -1,953 +1,162 @@
1
- import { __exports as N } from "./index.web32.js";
2
- import { __require as Fr } from "./index.web33.js";
3
- import { __require as Ur } from "./index.web34.js";
4
- /*!
5
- * The buffer module from node.js, for the browser.
6
- *
7
- * @author Feross Aboukhadijeh <https://feross.org>
8
- * @license MIT
9
- */
10
- var Z;
11
- function Sr() {
12
- return Z ? N : (Z = 1, function(d) {
13
- const R = Fr(), m = Ur(), k = typeof Symbol == "function" && typeof Symbol.for == "function" ? Symbol.for("nodejs.util.inspect.custom") : null;
14
- d.Buffer = u, d.SlowBuffer = nr, d.INSPECT_MAX_BYTES = 50;
15
- const U = 2147483647;
16
- d.kMaxLength = U, u.TYPED_ARRAY_SUPPORT = Q(), !u.TYPED_ARRAY_SUPPORT && typeof console < "u" && typeof console.error == "function" && console.error(
17
- "This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."
18
- );
19
- function Q() {
20
- try {
21
- const i = new Uint8Array(1), r = { foo: function() {
22
- return 42;
23
- } };
24
- return Object.setPrototypeOf(r, Uint8Array.prototype), Object.setPrototypeOf(i, r), i.foo() === 42;
25
- } catch {
26
- return !1;
27
- }
28
- }
29
- Object.defineProperty(u.prototype, "parent", {
30
- enumerable: !0,
31
- get: function() {
32
- if (u.isBuffer(this))
33
- return this.buffer;
34
- }
35
- }), Object.defineProperty(u.prototype, "offset", {
36
- enumerable: !0,
37
- get: function() {
38
- if (u.isBuffer(this))
39
- return this.byteOffset;
40
- }
41
- });
42
- function B(i) {
43
- if (i > U)
44
- throw new RangeError('The value "' + i + '" is invalid for option "size"');
45
- const r = new Uint8Array(i);
46
- return Object.setPrototypeOf(r, u.prototype), r;
47
- }
48
- function u(i, r, t) {
49
- if (typeof i == "number") {
50
- if (typeof r == "string")
51
- throw new TypeError(
52
- 'The "string" argument must be of type string. Received type number'
53
- );
54
- return T(i);
55
- }
56
- return P(i, r, t);
57
- }
58
- u.poolSize = 8192;
59
- function P(i, r, t) {
60
- if (typeof i == "string")
61
- return rr(i, r);
62
- if (ArrayBuffer.isView(i))
63
- return tr(i);
64
- if (i == null)
65
- throw new TypeError(
66
- "The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof i
67
- );
68
- if (w(i, ArrayBuffer) || i && w(i.buffer, ArrayBuffer) || typeof SharedArrayBuffer < "u" && (w(i, SharedArrayBuffer) || i && w(i.buffer, SharedArrayBuffer)))
69
- return S(i, r, t);
70
- if (typeof i == "number")
71
- throw new TypeError(
72
- 'The "value" argument must not be of type number. Received type number'
73
- );
74
- const n = i.valueOf && i.valueOf();
75
- if (n != null && n !== i)
76
- return u.from(n, r, t);
77
- const e = ir(i);
78
- if (e) return e;
79
- if (typeof Symbol < "u" && Symbol.toPrimitive != null && typeof i[Symbol.toPrimitive] == "function")
80
- return u.from(i[Symbol.toPrimitive]("string"), r, t);
81
- throw new TypeError(
82
- "The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof i
83
- );
84
- }
85
- u.from = function(i, r, t) {
86
- return P(i, r, t);
87
- }, Object.setPrototypeOf(u.prototype, Uint8Array.prototype), Object.setPrototypeOf(u, Uint8Array);
88
- function $(i) {
89
- if (typeof i != "number")
90
- throw new TypeError('"size" argument must be of type number');
91
- if (i < 0)
92
- throw new RangeError('The value "' + i + '" is invalid for option "size"');
93
- }
94
- function v(i, r, t) {
95
- return $(i), i <= 0 ? B(i) : r !== void 0 ? typeof t == "string" ? B(i).fill(r, t) : B(i).fill(r) : B(i);
96
- }
97
- u.alloc = function(i, r, t) {
98
- return v(i, r, t);
99
- };
100
- function T(i) {
101
- return $(i), B(i < 0 ? 0 : C(i) | 0);
102
- }
103
- u.allocUnsafe = function(i) {
104
- return T(i);
105
- }, u.allocUnsafeSlow = function(i) {
106
- return T(i);
107
- };
108
- function rr(i, r) {
109
- if ((typeof r != "string" || r === "") && (r = "utf8"), !u.isEncoding(r))
110
- throw new TypeError("Unknown encoding: " + r);
111
- const t = M(i, r) | 0;
112
- let n = B(t);
113
- const e = n.write(i, r);
114
- return e !== t && (n = n.slice(0, e)), n;
115
- }
116
- function _(i) {
117
- const r = i.length < 0 ? 0 : C(i.length) | 0, t = B(r);
118
- for (let n = 0; n < r; n += 1)
119
- t[n] = i[n] & 255;
120
- return t;
121
- }
122
- function tr(i) {
123
- if (w(i, Uint8Array)) {
124
- const r = new Uint8Array(i);
125
- return S(r.buffer, r.byteOffset, r.byteLength);
126
- }
127
- return _(i);
128
- }
129
- function S(i, r, t) {
130
- if (r < 0 || i.byteLength < r)
131
- throw new RangeError('"offset" is outside of buffer bounds');
132
- if (i.byteLength < r + (t || 0))
133
- throw new RangeError('"length" is outside of buffer bounds');
134
- let n;
135
- return r === void 0 && t === void 0 ? n = new Uint8Array(i) : t === void 0 ? n = new Uint8Array(i, r) : n = new Uint8Array(i, r, t), Object.setPrototypeOf(n, u.prototype), n;
136
- }
137
- function ir(i) {
138
- if (u.isBuffer(i)) {
139
- const r = C(i.length) | 0, t = B(r);
140
- return t.length === 0 || i.copy(t, 0, 0, r), t;
141
- }
142
- if (i.length !== void 0)
143
- return typeof i.length != "number" || D(i.length) ? B(0) : _(i);
144
- if (i.type === "Buffer" && Array.isArray(i.data))
145
- return _(i.data);
146
- }
147
- function C(i) {
148
- if (i >= U)
149
- throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + U.toString(16) + " bytes");
150
- return i | 0;
151
- }
152
- function nr(i) {
153
- return +i != i && (i = 0), u.alloc(+i);
154
- }
155
- u.isBuffer = function(r) {
156
- return r != null && r._isBuffer === !0 && r !== u.prototype;
157
- }, u.compare = function(r, t) {
158
- if (w(r, Uint8Array) && (r = u.from(r, r.offset, r.byteLength)), w(t, Uint8Array) && (t = u.from(t, t.offset, t.byteLength)), !u.isBuffer(r) || !u.isBuffer(t))
159
- throw new TypeError(
160
- 'The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array'
161
- );
162
- if (r === t) return 0;
163
- let n = r.length, e = t.length;
164
- for (let o = 0, h = Math.min(n, e); o < h; ++o)
165
- if (r[o] !== t[o]) {
166
- n = r[o], e = t[o];
167
- break;
168
- }
169
- return n < e ? -1 : e < n ? 1 : 0;
170
- }, u.isEncoding = function(r) {
171
- switch (String(r).toLowerCase()) {
172
- case "hex":
173
- case "utf8":
174
- case "utf-8":
175
- case "ascii":
176
- case "latin1":
177
- case "binary":
178
- case "base64":
179
- case "ucs2":
180
- case "ucs-2":
181
- case "utf16le":
182
- case "utf-16le":
183
- return !0;
184
- default:
185
- return !1;
186
- }
187
- }, u.concat = function(r, t) {
188
- if (!Array.isArray(r))
189
- throw new TypeError('"list" argument must be an Array of Buffers');
190
- if (r.length === 0)
191
- return u.alloc(0);
192
- let n;
193
- if (t === void 0)
194
- for (t = 0, n = 0; n < r.length; ++n)
195
- t += r[n].length;
196
- const e = u.allocUnsafe(t);
197
- let o = 0;
198
- for (n = 0; n < r.length; ++n) {
199
- let h = r[n];
200
- if (w(h, Uint8Array))
201
- o + h.length > e.length ? (u.isBuffer(h) || (h = u.from(h)), h.copy(e, o)) : Uint8Array.prototype.set.call(
202
- e,
203
- h,
204
- o
205
- );
206
- else if (u.isBuffer(h))
207
- h.copy(e, o);
208
- else
209
- throw new TypeError('"list" argument must be an Array of Buffers');
210
- o += h.length;
211
- }
212
- return e;
213
- };
214
- function M(i, r) {
215
- if (u.isBuffer(i))
216
- return i.length;
217
- if (ArrayBuffer.isView(i) || w(i, ArrayBuffer))
218
- return i.byteLength;
219
- if (typeof i != "string")
220
- throw new TypeError(
221
- 'The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type ' + typeof i
222
- );
223
- const t = i.length, n = arguments.length > 2 && arguments[2] === !0;
224
- if (!n && t === 0) return 0;
225
- let e = !1;
226
- for (; ; )
227
- switch (r) {
228
- case "ascii":
229
- case "latin1":
230
- case "binary":
231
- return t;
232
- case "utf8":
233
- case "utf-8":
234
- return L(i).length;
235
- case "ucs2":
236
- case "ucs-2":
237
- case "utf16le":
238
- case "utf-16le":
239
- return t * 2;
240
- case "hex":
241
- return t >>> 1;
242
- case "base64":
243
- return K(i).length;
244
- default:
245
- if (e)
246
- return n ? -1 : L(i).length;
247
- r = ("" + r).toLowerCase(), e = !0;
248
- }
249
- }
250
- u.byteLength = M;
251
- function er(i, r, t) {
252
- let n = !1;
253
- if ((r === void 0 || r < 0) && (r = 0), r > this.length || ((t === void 0 || t > this.length) && (t = this.length), t <= 0) || (t >>>= 0, r >>>= 0, t <= r))
254
- return "";
255
- for (i || (i = "utf8"); ; )
256
- switch (i) {
257
- case "hex":
258
- return ar(this, r, t);
259
- case "utf8":
260
- case "utf-8":
261
- return G(this, r, t);
262
- case "ascii":
263
- return sr(this, r, t);
264
- case "latin1":
265
- case "binary":
266
- return yr(this, r, t);
267
- case "base64":
268
- return pr(this, r, t);
269
- case "ucs2":
270
- case "ucs-2":
271
- case "utf16le":
272
- case "utf-16le":
273
- return wr(this, r, t);
274
- default:
275
- if (n) throw new TypeError("Unknown encoding: " + i);
276
- i = (i + "").toLowerCase(), n = !0;
277
- }
278
- }
279
- u.prototype._isBuffer = !0;
280
- function E(i, r, t) {
281
- const n = i[r];
282
- i[r] = i[t], i[t] = n;
283
- }
284
- u.prototype.swap16 = function() {
285
- const r = this.length;
286
- if (r % 2 !== 0)
287
- throw new RangeError("Buffer size must be a multiple of 16-bits");
288
- for (let t = 0; t < r; t += 2)
289
- E(this, t, t + 1);
290
- return this;
291
- }, u.prototype.swap32 = function() {
292
- const r = this.length;
293
- if (r % 4 !== 0)
294
- throw new RangeError("Buffer size must be a multiple of 32-bits");
295
- for (let t = 0; t < r; t += 4)
296
- E(this, t, t + 3), E(this, t + 1, t + 2);
297
- return this;
298
- }, u.prototype.swap64 = function() {
299
- const r = this.length;
300
- if (r % 8 !== 0)
301
- throw new RangeError("Buffer size must be a multiple of 64-bits");
302
- for (let t = 0; t < r; t += 8)
303
- E(this, t, t + 7), E(this, t + 1, t + 6), E(this, t + 2, t + 5), E(this, t + 3, t + 4);
304
- return this;
305
- }, u.prototype.toString = function() {
306
- const r = this.length;
307
- return r === 0 ? "" : arguments.length === 0 ? G(this, 0, r) : er.apply(this, arguments);
308
- }, u.prototype.toLocaleString = u.prototype.toString, u.prototype.equals = function(r) {
309
- if (!u.isBuffer(r)) throw new TypeError("Argument must be a Buffer");
310
- return this === r ? !0 : u.compare(this, r) === 0;
311
- }, u.prototype.inspect = function() {
312
- let r = "";
313
- const t = d.INSPECT_MAX_BYTES;
314
- return r = this.toString("hex", 0, t).replace(/(.{2})/g, "$1 ").trim(), this.length > t && (r += " ... "), "<Buffer " + r + ">";
315
- }, k && (u.prototype[k] = u.prototype.inspect), u.prototype.compare = function(r, t, n, e, o) {
316
- if (w(r, Uint8Array) && (r = u.from(r, r.offset, r.byteLength)), !u.isBuffer(r))
317
- throw new TypeError(
318
- 'The "target" argument must be one of type Buffer or Uint8Array. Received type ' + typeof r
319
- );
320
- if (t === void 0 && (t = 0), n === void 0 && (n = r ? r.length : 0), e === void 0 && (e = 0), o === void 0 && (o = this.length), t < 0 || n > r.length || e < 0 || o > this.length)
321
- throw new RangeError("out of range index");
322
- if (e >= o && t >= n)
323
- return 0;
324
- if (e >= o)
325
- return -1;
326
- if (t >= n)
327
- return 1;
328
- if (t >>>= 0, n >>>= 0, e >>>= 0, o >>>= 0, this === r) return 0;
329
- let h = o - e, f = n - t;
330
- const l = Math.min(h, f), p = this.slice(e, o), s = r.slice(t, n);
331
- for (let c = 0; c < l; ++c)
332
- if (p[c] !== s[c]) {
333
- h = p[c], f = s[c];
334
- break;
335
- }
336
- return h < f ? -1 : f < h ? 1 : 0;
337
- };
338
- function O(i, r, t, n, e) {
339
- if (i.length === 0) return -1;
340
- if (typeof t == "string" ? (n = t, t = 0) : t > 2147483647 ? t = 2147483647 : t < -2147483648 && (t = -2147483648), t = +t, D(t) && (t = e ? 0 : i.length - 1), t < 0 && (t = i.length + t), t >= i.length) {
341
- if (e) return -1;
342
- t = i.length - 1;
343
- } else if (t < 0)
344
- if (e) t = 0;
345
- else return -1;
346
- if (typeof r == "string" && (r = u.from(r, n)), u.isBuffer(r))
347
- return r.length === 0 ? -1 : q(i, r, t, n, e);
348
- if (typeof r == "number")
349
- return r = r & 255, typeof Uint8Array.prototype.indexOf == "function" ? e ? Uint8Array.prototype.indexOf.call(i, r, t) : Uint8Array.prototype.lastIndexOf.call(i, r, t) : q(i, [r], t, n, e);
350
- throw new TypeError("val must be string, number or Buffer");
351
- }
352
- function q(i, r, t, n, e) {
353
- let o = 1, h = i.length, f = r.length;
354
- if (n !== void 0 && (n = String(n).toLowerCase(), n === "ucs2" || n === "ucs-2" || n === "utf16le" || n === "utf-16le")) {
355
- if (i.length < 2 || r.length < 2)
356
- return -1;
357
- o = 2, h /= 2, f /= 2, t /= 2;
358
- }
359
- function l(s, c) {
360
- return o === 1 ? s[c] : s.readUInt16BE(c * o);
361
- }
362
- let p;
363
- if (e) {
364
- let s = -1;
365
- for (p = t; p < h; p++)
366
- if (l(i, p) === l(r, s === -1 ? 0 : p - s)) {
367
- if (s === -1 && (s = p), p - s + 1 === f) return s * o;
368
- } else
369
- s !== -1 && (p -= p - s), s = -1;
370
- } else
371
- for (t + f > h && (t = h - f), p = t; p >= 0; p--) {
372
- let s = !0;
373
- for (let c = 0; c < f; c++)
374
- if (l(i, p + c) !== l(r, c)) {
375
- s = !1;
376
- break;
377
- }
378
- if (s) return p;
379
- }
380
- return -1;
381
- }
382
- u.prototype.includes = function(r, t, n) {
383
- return this.indexOf(r, t, n) !== -1;
384
- }, u.prototype.indexOf = function(r, t, n) {
385
- return O(this, r, t, n, !0);
386
- }, u.prototype.lastIndexOf = function(r, t, n) {
387
- return O(this, r, t, n, !1);
388
- };
389
- function or(i, r, t, n) {
390
- t = Number(t) || 0;
391
- const e = i.length - t;
392
- n ? (n = Number(n), n > e && (n = e)) : n = e;
393
- const o = r.length;
394
- n > o / 2 && (n = o / 2);
395
- let h;
396
- for (h = 0; h < n; ++h) {
397
- const f = parseInt(r.substr(h * 2, 2), 16);
398
- if (D(f)) return h;
399
- i[t + h] = f;
400
- }
401
- return h;
402
- }
403
- function ur(i, r, t, n) {
404
- return A(L(r, i.length - t), i, t, n);
405
- }
406
- function hr(i, r, t, n) {
407
- return A(mr(r), i, t, n);
408
- }
409
- function fr(i, r, t, n) {
410
- return A(K(r), i, t, n);
411
- }
412
- function cr(i, r, t, n) {
413
- return A(gr(r, i.length - t), i, t, n);
414
- }
415
- u.prototype.write = function(r, t, n, e) {
416
- if (t === void 0)
417
- e = "utf8", n = this.length, t = 0;
418
- else if (n === void 0 && typeof t == "string")
419
- e = t, n = this.length, t = 0;
420
- else if (isFinite(t))
421
- t = t >>> 0, isFinite(n) ? (n = n >>> 0, e === void 0 && (e = "utf8")) : (e = n, n = void 0);
422
- else
423
- throw new Error(
424
- "Buffer.write(string, encoding, offset[, length]) is no longer supported"
425
- );
426
- const o = this.length - t;
427
- if ((n === void 0 || n > o) && (n = o), r.length > 0 && (n < 0 || t < 0) || t > this.length)
428
- throw new RangeError("Attempt to write outside buffer bounds");
429
- e || (e = "utf8");
430
- let h = !1;
431
- for (; ; )
432
- switch (e) {
433
- case "hex":
434
- return or(this, r, t, n);
435
- case "utf8":
436
- case "utf-8":
437
- return ur(this, r, t, n);
438
- case "ascii":
439
- case "latin1":
440
- case "binary":
441
- return hr(this, r, t, n);
442
- case "base64":
443
- return fr(this, r, t, n);
444
- case "ucs2":
445
- case "ucs-2":
446
- case "utf16le":
447
- case "utf-16le":
448
- return cr(this, r, t, n);
449
- default:
450
- if (h) throw new TypeError("Unknown encoding: " + e);
451
- e = ("" + e).toLowerCase(), h = !0;
1
+ const H = (m) => (h, n, r) => {
2
+ const s = r.subscribe;
3
+ return r.subscribe = (c, i, a) => {
4
+ let l = c;
5
+ if (i) {
6
+ const g = a?.equalityFn || Object.is;
7
+ let v = c(r.getState());
8
+ l = (f) => {
9
+ const u = c(f);
10
+ if (!g(v, u)) {
11
+ const y = v;
12
+ i(v = u, y);
452
13
  }
453
- }, u.prototype.toJSON = function() {
454
- return {
455
- type: "Buffer",
456
- data: Array.prototype.slice.call(this._arr || this, 0)
457
- };
458
- };
459
- function pr(i, r, t) {
460
- return r === 0 && t === i.length ? R.fromByteArray(i) : R.fromByteArray(i.slice(r, t));
461
- }
462
- function G(i, r, t) {
463
- t = Math.min(i.length, t);
464
- const n = [];
465
- let e = r;
466
- for (; e < t; ) {
467
- const o = i[e];
468
- let h = null, f = o > 239 ? 4 : o > 223 ? 3 : o > 191 ? 2 : 1;
469
- if (e + f <= t) {
470
- let l, p, s, c;
471
- switch (f) {
472
- case 1:
473
- o < 128 && (h = o);
474
- break;
475
- case 2:
476
- l = i[e + 1], (l & 192) === 128 && (c = (o & 31) << 6 | l & 63, c > 127 && (h = c));
477
- break;
478
- case 3:
479
- l = i[e + 1], p = i[e + 2], (l & 192) === 128 && (p & 192) === 128 && (c = (o & 15) << 12 | (l & 63) << 6 | p & 63, c > 2047 && (c < 55296 || c > 57343) && (h = c));
480
- break;
481
- case 4:
482
- l = i[e + 1], p = i[e + 2], s = i[e + 3], (l & 192) === 128 && (p & 192) === 128 && (s & 192) === 128 && (c = (o & 15) << 18 | (l & 63) << 12 | (p & 63) << 6 | s & 63, c > 65535 && c < 1114112 && (h = c));
483
- }
484
- }
485
- h === null ? (h = 65533, f = 1) : h > 65535 && (h -= 65536, n.push(h >>> 10 & 1023 | 55296), h = 56320 | h & 1023), n.push(h), e += f;
486
- }
487
- return lr(n);
488
- }
489
- const Y = 4096;
490
- function lr(i) {
491
- const r = i.length;
492
- if (r <= Y)
493
- return String.fromCharCode.apply(String, i);
494
- let t = "", n = 0;
495
- for (; n < r; )
496
- t += String.fromCharCode.apply(
497
- String,
498
- i.slice(n, n += Y)
499
- );
500
- return t;
501
- }
502
- function sr(i, r, t) {
503
- let n = "";
504
- t = Math.min(i.length, t);
505
- for (let e = r; e < t; ++e)
506
- n += String.fromCharCode(i[e] & 127);
507
- return n;
508
- }
509
- function yr(i, r, t) {
510
- let n = "";
511
- t = Math.min(i.length, t);
512
- for (let e = r; e < t; ++e)
513
- n += String.fromCharCode(i[e]);
514
- return n;
515
- }
516
- function ar(i, r, t) {
517
- const n = i.length;
518
- (!r || r < 0) && (r = 0), (!t || t < 0 || t > n) && (t = n);
519
- let e = "";
520
- for (let o = r; o < t; ++o)
521
- e += Ir[i[o]];
522
- return e;
523
- }
524
- function wr(i, r, t) {
525
- const n = i.slice(r, t);
526
- let e = "";
527
- for (let o = 0; o < n.length - 1; o += 2)
528
- e += String.fromCharCode(n[o] + n[o + 1] * 256);
529
- return e;
530
- }
531
- u.prototype.slice = function(r, t) {
532
- const n = this.length;
533
- r = ~~r, t = t === void 0 ? n : ~~t, r < 0 ? (r += n, r < 0 && (r = 0)) : r > n && (r = n), t < 0 ? (t += n, t < 0 && (t = 0)) : t > n && (t = n), t < r && (t = r);
534
- const e = this.subarray(r, t);
535
- return Object.setPrototypeOf(e, u.prototype), e;
536
- };
537
- function y(i, r, t) {
538
- if (i % 1 !== 0 || i < 0) throw new RangeError("offset is not uint");
539
- if (i + r > t) throw new RangeError("Trying to access beyond buffer length");
540
- }
541
- u.prototype.readUintLE = u.prototype.readUIntLE = function(r, t, n) {
542
- r = r >>> 0, t = t >>> 0, n || y(r, t, this.length);
543
- let e = this[r], o = 1, h = 0;
544
- for (; ++h < t && (o *= 256); )
545
- e += this[r + h] * o;
546
- return e;
547
- }, u.prototype.readUintBE = u.prototype.readUIntBE = function(r, t, n) {
548
- r = r >>> 0, t = t >>> 0, n || y(r, t, this.length);
549
- let e = this[r + --t], o = 1;
550
- for (; t > 0 && (o *= 256); )
551
- e += this[r + --t] * o;
552
- return e;
553
- }, u.prototype.readUint8 = u.prototype.readUInt8 = function(r, t) {
554
- return r = r >>> 0, t || y(r, 1, this.length), this[r];
555
- }, u.prototype.readUint16LE = u.prototype.readUInt16LE = function(r, t) {
556
- return r = r >>> 0, t || y(r, 2, this.length), this[r] | this[r + 1] << 8;
557
- }, u.prototype.readUint16BE = u.prototype.readUInt16BE = function(r, t) {
558
- return r = r >>> 0, t || y(r, 2, this.length), this[r] << 8 | this[r + 1];
559
- }, u.prototype.readUint32LE = u.prototype.readUInt32LE = function(r, t) {
560
- return r = r >>> 0, t || y(r, 4, this.length), (this[r] | this[r + 1] << 8 | this[r + 2] << 16) + this[r + 3] * 16777216;
561
- }, u.prototype.readUint32BE = u.prototype.readUInt32BE = function(r, t) {
562
- return r = r >>> 0, t || y(r, 4, this.length), this[r] * 16777216 + (this[r + 1] << 16 | this[r + 2] << 8 | this[r + 3]);
563
- }, u.prototype.readBigUInt64LE = x(function(r) {
564
- r = r >>> 0, I(r, "offset");
565
- const t = this[r], n = this[r + 7];
566
- (t === void 0 || n === void 0) && F(r, this.length - 8);
567
- const e = t + this[++r] * 2 ** 8 + this[++r] * 2 ** 16 + this[++r] * 2 ** 24, o = this[++r] + this[++r] * 2 ** 8 + this[++r] * 2 ** 16 + n * 2 ** 24;
568
- return BigInt(e) + (BigInt(o) << BigInt(32));
569
- }), u.prototype.readBigUInt64BE = x(function(r) {
570
- r = r >>> 0, I(r, "offset");
571
- const t = this[r], n = this[r + 7];
572
- (t === void 0 || n === void 0) && F(r, this.length - 8);
573
- const e = t * 2 ** 24 + this[++r] * 2 ** 16 + this[++r] * 2 ** 8 + this[++r], o = this[++r] * 2 ** 24 + this[++r] * 2 ** 16 + this[++r] * 2 ** 8 + n;
574
- return (BigInt(e) << BigInt(32)) + BigInt(o);
575
- }), u.prototype.readIntLE = function(r, t, n) {
576
- r = r >>> 0, t = t >>> 0, n || y(r, t, this.length);
577
- let e = this[r], o = 1, h = 0;
578
- for (; ++h < t && (o *= 256); )
579
- e += this[r + h] * o;
580
- return o *= 128, e >= o && (e -= Math.pow(2, 8 * t)), e;
581
- }, u.prototype.readIntBE = function(r, t, n) {
582
- r = r >>> 0, t = t >>> 0, n || y(r, t, this.length);
583
- let e = t, o = 1, h = this[r + --e];
584
- for (; e > 0 && (o *= 256); )
585
- h += this[r + --e] * o;
586
- return o *= 128, h >= o && (h -= Math.pow(2, 8 * t)), h;
587
- }, u.prototype.readInt8 = function(r, t) {
588
- return r = r >>> 0, t || y(r, 1, this.length), this[r] & 128 ? (255 - this[r] + 1) * -1 : this[r];
589
- }, u.prototype.readInt16LE = function(r, t) {
590
- r = r >>> 0, t || y(r, 2, this.length);
591
- const n = this[r] | this[r + 1] << 8;
592
- return n & 32768 ? n | 4294901760 : n;
593
- }, u.prototype.readInt16BE = function(r, t) {
594
- r = r >>> 0, t || y(r, 2, this.length);
595
- const n = this[r + 1] | this[r] << 8;
596
- return n & 32768 ? n | 4294901760 : n;
597
- }, u.prototype.readInt32LE = function(r, t) {
598
- return r = r >>> 0, t || y(r, 4, this.length), this[r] | this[r + 1] << 8 | this[r + 2] << 16 | this[r + 3] << 24;
599
- }, u.prototype.readInt32BE = function(r, t) {
600
- return r = r >>> 0, t || y(r, 4, this.length), this[r] << 24 | this[r + 1] << 16 | this[r + 2] << 8 | this[r + 3];
601
- }, u.prototype.readBigInt64LE = x(function(r) {
602
- r = r >>> 0, I(r, "offset");
603
- const t = this[r], n = this[r + 7];
604
- (t === void 0 || n === void 0) && F(r, this.length - 8);
605
- const e = this[r + 4] + this[r + 5] * 2 ** 8 + this[r + 6] * 2 ** 16 + (n << 24);
606
- return (BigInt(e) << BigInt(32)) + BigInt(t + this[++r] * 2 ** 8 + this[++r] * 2 ** 16 + this[++r] * 2 ** 24);
607
- }), u.prototype.readBigInt64BE = x(function(r) {
608
- r = r >>> 0, I(r, "offset");
609
- const t = this[r], n = this[r + 7];
610
- (t === void 0 || n === void 0) && F(r, this.length - 8);
611
- const e = (t << 24) + // Overflow
612
- this[++r] * 2 ** 16 + this[++r] * 2 ** 8 + this[++r];
613
- return (BigInt(e) << BigInt(32)) + BigInt(this[++r] * 2 ** 24 + this[++r] * 2 ** 16 + this[++r] * 2 ** 8 + n);
614
- }), u.prototype.readFloatLE = function(r, t) {
615
- return r = r >>> 0, t || y(r, 4, this.length), m.read(this, r, !0, 23, 4);
616
- }, u.prototype.readFloatBE = function(r, t) {
617
- return r = r >>> 0, t || y(r, 4, this.length), m.read(this, r, !1, 23, 4);
618
- }, u.prototype.readDoubleLE = function(r, t) {
619
- return r = r >>> 0, t || y(r, 8, this.length), m.read(this, r, !0, 52, 8);
620
- }, u.prototype.readDoubleBE = function(r, t) {
621
- return r = r >>> 0, t || y(r, 8, this.length), m.read(this, r, !1, 52, 8);
622
- };
623
- function a(i, r, t, n, e, o) {
624
- if (!u.isBuffer(i)) throw new TypeError('"buffer" argument must be a Buffer instance');
625
- if (r > e || r < o) throw new RangeError('"value" argument is out of bounds');
626
- if (t + n > i.length) throw new RangeError("Index out of range");
627
- }
628
- u.prototype.writeUintLE = u.prototype.writeUIntLE = function(r, t, n, e) {
629
- if (r = +r, t = t >>> 0, n = n >>> 0, !e) {
630
- const f = Math.pow(2, 8 * n) - 1;
631
- a(this, r, t, n, f, 0);
632
- }
633
- let o = 1, h = 0;
634
- for (this[t] = r & 255; ++h < n && (o *= 256); )
635
- this[t + h] = r / o & 255;
636
- return t + n;
637
- }, u.prototype.writeUintBE = u.prototype.writeUIntBE = function(r, t, n, e) {
638
- if (r = +r, t = t >>> 0, n = n >>> 0, !e) {
639
- const f = Math.pow(2, 8 * n) - 1;
640
- a(this, r, t, n, f, 0);
641
- }
642
- let o = n - 1, h = 1;
643
- for (this[t + o] = r & 255; --o >= 0 && (h *= 256); )
644
- this[t + o] = r / h & 255;
645
- return t + n;
646
- }, u.prototype.writeUint8 = u.prototype.writeUInt8 = function(r, t, n) {
647
- return r = +r, t = t >>> 0, n || a(this, r, t, 1, 255, 0), this[t] = r & 255, t + 1;
648
- }, u.prototype.writeUint16LE = u.prototype.writeUInt16LE = function(r, t, n) {
649
- return r = +r, t = t >>> 0, n || a(this, r, t, 2, 65535, 0), this[t] = r & 255, this[t + 1] = r >>> 8, t + 2;
650
- }, u.prototype.writeUint16BE = u.prototype.writeUInt16BE = function(r, t, n) {
651
- return r = +r, t = t >>> 0, n || a(this, r, t, 2, 65535, 0), this[t] = r >>> 8, this[t + 1] = r & 255, t + 2;
652
- }, u.prototype.writeUint32LE = u.prototype.writeUInt32LE = function(r, t, n) {
653
- return r = +r, t = t >>> 0, n || a(this, r, t, 4, 4294967295, 0), this[t + 3] = r >>> 24, this[t + 2] = r >>> 16, this[t + 1] = r >>> 8, this[t] = r & 255, t + 4;
654
- }, u.prototype.writeUint32BE = u.prototype.writeUInt32BE = function(r, t, n) {
655
- return r = +r, t = t >>> 0, n || a(this, r, t, 4, 4294967295, 0), this[t] = r >>> 24, this[t + 1] = r >>> 16, this[t + 2] = r >>> 8, this[t + 3] = r & 255, t + 4;
656
- };
657
- function W(i, r, t, n, e) {
658
- H(r, n, e, i, t, 7);
659
- let o = Number(r & BigInt(4294967295));
660
- i[t++] = o, o = o >> 8, i[t++] = o, o = o >> 8, i[t++] = o, o = o >> 8, i[t++] = o;
661
- let h = Number(r >> BigInt(32) & BigInt(4294967295));
662
- return i[t++] = h, h = h >> 8, i[t++] = h, h = h >> 8, i[t++] = h, h = h >> 8, i[t++] = h, t;
663
- }
664
- function V(i, r, t, n, e) {
665
- H(r, n, e, i, t, 7);
666
- let o = Number(r & BigInt(4294967295));
667
- i[t + 7] = o, o = o >> 8, i[t + 6] = o, o = o >> 8, i[t + 5] = o, o = o >> 8, i[t + 4] = o;
668
- let h = Number(r >> BigInt(32) & BigInt(4294967295));
669
- return i[t + 3] = h, h = h >> 8, i[t + 2] = h, h = h >> 8, i[t + 1] = h, h = h >> 8, i[t] = h, t + 8;
670
- }
671
- u.prototype.writeBigUInt64LE = x(function(r, t = 0) {
672
- return W(this, r, t, BigInt(0), BigInt("0xffffffffffffffff"));
673
- }), u.prototype.writeBigUInt64BE = x(function(r, t = 0) {
674
- return V(this, r, t, BigInt(0), BigInt("0xffffffffffffffff"));
675
- }), u.prototype.writeIntLE = function(r, t, n, e) {
676
- if (r = +r, t = t >>> 0, !e) {
677
- const l = Math.pow(2, 8 * n - 1);
678
- a(this, r, t, n, l - 1, -l);
679
- }
680
- let o = 0, h = 1, f = 0;
681
- for (this[t] = r & 255; ++o < n && (h *= 256); )
682
- r < 0 && f === 0 && this[t + o - 1] !== 0 && (f = 1), this[t + o] = (r / h >> 0) - f & 255;
683
- return t + n;
684
- }, u.prototype.writeIntBE = function(r, t, n, e) {
685
- if (r = +r, t = t >>> 0, !e) {
686
- const l = Math.pow(2, 8 * n - 1);
687
- a(this, r, t, n, l - 1, -l);
14
+ }, a?.fireImmediately && i(v, v);
15
+ }
16
+ return s(l);
17
+ }, m(h, n, r);
18
+ }, R = H;
19
+ function F(m, h) {
20
+ let n;
21
+ try {
22
+ n = m();
23
+ } catch {
24
+ return;
25
+ }
26
+ return {
27
+ getItem: (s) => {
28
+ var e;
29
+ const c = (a) => a === null ? null : JSON.parse(a, void 0), i = (e = n.getItem(s)) != null ? e : null;
30
+ return i instanceof Promise ? i.then(c) : c(i);
31
+ },
32
+ setItem: (s, e) => n.setItem(s, JSON.stringify(e, void 0)),
33
+ removeItem: (s) => n.removeItem(s)
34
+ };
35
+ }
36
+ const p = (m) => (h) => {
37
+ try {
38
+ const n = m(h);
39
+ return n instanceof Promise ? n : {
40
+ then(r) {
41
+ return p(r)(n);
42
+ },
43
+ catch(r) {
44
+ return this;
688
45
  }
689
- let o = n - 1, h = 1, f = 0;
690
- for (this[t + o] = r & 255; --o >= 0 && (h *= 256); )
691
- r < 0 && f === 0 && this[t + o + 1] !== 0 && (f = 1), this[t + o] = (r / h >> 0) - f & 255;
692
- return t + n;
693
- }, u.prototype.writeInt8 = function(r, t, n) {
694
- return r = +r, t = t >>> 0, n || a(this, r, t, 1, 127, -128), r < 0 && (r = 255 + r + 1), this[t] = r & 255, t + 1;
695
- }, u.prototype.writeInt16LE = function(r, t, n) {
696
- return r = +r, t = t >>> 0, n || a(this, r, t, 2, 32767, -32768), this[t] = r & 255, this[t + 1] = r >>> 8, t + 2;
697
- }, u.prototype.writeInt16BE = function(r, t, n) {
698
- return r = +r, t = t >>> 0, n || a(this, r, t, 2, 32767, -32768), this[t] = r >>> 8, this[t + 1] = r & 255, t + 2;
699
- }, u.prototype.writeInt32LE = function(r, t, n) {
700
- return r = +r, t = t >>> 0, n || a(this, r, t, 4, 2147483647, -2147483648), this[t] = r & 255, this[t + 1] = r >>> 8, this[t + 2] = r >>> 16, this[t + 3] = r >>> 24, t + 4;
701
- }, u.prototype.writeInt32BE = function(r, t, n) {
702
- return r = +r, t = t >>> 0, n || a(this, r, t, 4, 2147483647, -2147483648), r < 0 && (r = 4294967295 + r + 1), this[t] = r >>> 24, this[t + 1] = r >>> 16, this[t + 2] = r >>> 8, this[t + 3] = r & 255, t + 4;
703
- }, u.prototype.writeBigInt64LE = x(function(r, t = 0) {
704
- return W(this, r, t, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff"));
705
- }), u.prototype.writeBigInt64BE = x(function(r, t = 0) {
706
- return V(this, r, t, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff"));
707
- });
708
- function X(i, r, t, n, e, o) {
709
- if (t + n > i.length) throw new RangeError("Index out of range");
710
- if (t < 0) throw new RangeError("Index out of range");
711
- }
712
- function j(i, r, t, n, e) {
713
- return r = +r, t = t >>> 0, e || X(i, r, t, 4), m.write(i, r, t, n, 23, 4), t + 4;
714
- }
715
- u.prototype.writeFloatLE = function(r, t, n) {
716
- return j(this, r, t, !0, n);
717
- }, u.prototype.writeFloatBE = function(r, t, n) {
718
- return j(this, r, t, !1, n);
719
46
  };
720
- function J(i, r, t, n, e) {
721
- return r = +r, t = t >>> 0, e || X(i, r, t, 8), m.write(i, r, t, n, 52, 8), t + 8;
722
- }
723
- u.prototype.writeDoubleLE = function(r, t, n) {
724
- return J(this, r, t, !0, n);
725
- }, u.prototype.writeDoubleBE = function(r, t, n) {
726
- return J(this, r, t, !1, n);
727
- }, u.prototype.copy = function(r, t, n, e) {
728
- if (!u.isBuffer(r)) throw new TypeError("argument should be a Buffer");
729
- if (n || (n = 0), !e && e !== 0 && (e = this.length), t >= r.length && (t = r.length), t || (t = 0), e > 0 && e < n && (e = n), e === n || r.length === 0 || this.length === 0) return 0;
730
- if (t < 0)
731
- throw new RangeError("targetStart out of bounds");
732
- if (n < 0 || n >= this.length) throw new RangeError("Index out of range");
733
- if (e < 0) throw new RangeError("sourceEnd out of bounds");
734
- e > this.length && (e = this.length), r.length - t < e - n && (e = r.length - t + n);
735
- const o = e - n;
736
- return this === r && typeof Uint8Array.prototype.copyWithin == "function" ? this.copyWithin(t, n, e) : Uint8Array.prototype.set.call(
737
- r,
738
- this.subarray(n, e),
739
- t
740
- ), o;
741
- }, u.prototype.fill = function(r, t, n, e) {
742
- if (typeof r == "string") {
743
- if (typeof t == "string" ? (e = t, t = 0, n = this.length) : typeof n == "string" && (e = n, n = this.length), e !== void 0 && typeof e != "string")
744
- throw new TypeError("encoding must be a string");
745
- if (typeof e == "string" && !u.isEncoding(e))
746
- throw new TypeError("Unknown encoding: " + e);
747
- if (r.length === 1) {
748
- const h = r.charCodeAt(0);
749
- (e === "utf8" && h < 128 || e === "latin1") && (r = h);
750
- }
751
- } else typeof r == "number" ? r = r & 255 : typeof r == "boolean" && (r = Number(r));
752
- if (t < 0 || this.length < t || this.length < n)
753
- throw new RangeError("Out of range index");
754
- if (n <= t)
47
+ } catch (n) {
48
+ return {
49
+ then(r) {
755
50
  return this;
756
- t = t >>> 0, n = n === void 0 ? this.length : n >>> 0, r || (r = 0);
757
- let o;
758
- if (typeof r == "number")
759
- for (o = t; o < n; ++o)
760
- this[o] = r;
761
- else {
762
- const h = u.isBuffer(r) ? r : u.from(r, e), f = h.length;
763
- if (f === 0)
764
- throw new TypeError('The value "' + r + '" is invalid for argument "value"');
765
- for (o = 0; o < n - t; ++o)
766
- this[o + t] = h[o % f];
51
+ },
52
+ catch(r) {
53
+ return p(r)(n);
767
54
  }
768
- return this;
769
55
  };
770
- const g = {};
771
- function b(i, r, t) {
772
- g[i] = class extends t {
773
- constructor() {
774
- super(), Object.defineProperty(this, "message", {
775
- value: r.apply(this, arguments),
776
- writable: !0,
777
- configurable: !0
778
- }), this.name = `${this.name} [${i}]`, this.stack, delete this.name;
779
- }
780
- get code() {
781
- return i;
782
- }
783
- set code(e) {
784
- Object.defineProperty(this, "code", {
785
- configurable: !0,
786
- enumerable: !0,
787
- value: e,
788
- writable: !0
789
- });
790
- }
791
- toString() {
792
- return `${this.name} [${i}]: ${this.message}`;
793
- }
794
- };
795
- }
796
- b(
797
- "ERR_BUFFER_OUT_OF_BOUNDS",
798
- function(i) {
799
- return i ? `${i} is outside of buffer bounds` : "Attempt to access memory outside buffer bounds";
56
+ }
57
+ }, O = (m, h) => (n, r, s) => {
58
+ let e = {
59
+ storage: F(() => localStorage),
60
+ partialize: (t) => t,
61
+ version: 0,
62
+ merge: (t, S) => ({
63
+ ...S,
64
+ ...t
65
+ }),
66
+ ...h
67
+ }, c = !1;
68
+ const i = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ new Set();
69
+ let l = e.storage;
70
+ if (!l)
71
+ return m(
72
+ (...t) => {
73
+ console.warn(
74
+ `[zustand persist middleware] Unable to update item '${e.name}', the given storage is currently unavailable.`
75
+ ), n(...t);
800
76
  },
801
- RangeError
802
- ), b(
803
- "ERR_INVALID_ARG_TYPE",
804
- function(i, r) {
805
- return `The "${i}" argument must be of type number. Received type ${typeof r}`;
806
- },
807
- TypeError
808
- ), b(
809
- "ERR_OUT_OF_RANGE",
810
- function(i, r, t) {
811
- let n = `The value of "${i}" is out of range.`, e = t;
812
- return Number.isInteger(t) && Math.abs(t) > 2 ** 32 ? e = z(String(t)) : typeof t == "bigint" && (e = String(t), (t > BigInt(2) ** BigInt(32) || t < -(BigInt(2) ** BigInt(32))) && (e = z(e)), e += "n"), n += ` It must be ${r}. Received ${e}`, n;
813
- },
814
- RangeError
77
+ r,
78
+ s
815
79
  );
816
- function z(i) {
817
- let r = "", t = i.length;
818
- const n = i[0] === "-" ? 1 : 0;
819
- for (; t >= n + 4; t -= 3)
820
- r = `_${i.slice(t - 3, t)}${r}`;
821
- return `${i.slice(0, t)}${r}`;
822
- }
823
- function Br(i, r, t) {
824
- I(r, "offset"), (i[r] === void 0 || i[r + t] === void 0) && F(r, i.length - (t + 1));
825
- }
826
- function H(i, r, t, n, e, o) {
827
- if (i > t || i < r) {
828
- const h = typeof r == "bigint" ? "n" : "";
829
- let f;
830
- throw r === 0 || r === BigInt(0) ? f = `>= 0${h} and < 2${h} ** ${(o + 1) * 8}${h}` : f = `>= -(2${h} ** ${(o + 1) * 8 - 1}${h}) and < 2 ** ${(o + 1) * 8 - 1}${h}`, new g.ERR_OUT_OF_RANGE("value", f, i);
831
- }
832
- Br(n, e, o);
833
- }
834
- function I(i, r) {
835
- if (typeof i != "number")
836
- throw new g.ERR_INVALID_ARG_TYPE(r, "number", i);
837
- }
838
- function F(i, r, t) {
839
- throw Math.floor(i) !== i ? (I(i, t), new g.ERR_OUT_OF_RANGE("offset", "an integer", i)) : r < 0 ? new g.ERR_BUFFER_OUT_OF_BOUNDS() : new g.ERR_OUT_OF_RANGE(
840
- "offset",
841
- `>= 0 and <= ${r}`,
842
- i
843
- );
844
- }
845
- const xr = /[^+/0-9A-Za-z-_]/g;
846
- function Er(i) {
847
- if (i = i.split("=")[0], i = i.trim().replace(xr, ""), i.length < 2) return "";
848
- for (; i.length % 4 !== 0; )
849
- i = i + "=";
850
- return i;
851
- }
852
- function L(i, r) {
853
- r = r || 1 / 0;
854
- let t;
855
- const n = i.length;
856
- let e = null;
857
- const o = [];
858
- for (let h = 0; h < n; ++h) {
859
- if (t = i.charCodeAt(h), t > 55295 && t < 57344) {
860
- if (!e) {
861
- if (t > 56319) {
862
- (r -= 3) > -1 && o.push(239, 191, 189);
863
- continue;
864
- } else if (h + 1 === n) {
865
- (r -= 3) > -1 && o.push(239, 191, 189);
866
- continue;
867
- }
868
- e = t;
869
- continue;
870
- }
871
- if (t < 56320) {
872
- (r -= 3) > -1 && o.push(239, 191, 189), e = t;
873
- continue;
80
+ const g = () => {
81
+ const t = e.partialize({ ...r() });
82
+ return l.setItem(e.name, {
83
+ state: t,
84
+ version: e.version
85
+ });
86
+ }, v = s.setState;
87
+ s.setState = (t, S) => {
88
+ v(t, S), g();
89
+ };
90
+ const f = m(
91
+ (...t) => {
92
+ n(...t), g();
93
+ },
94
+ r,
95
+ s
96
+ );
97
+ s.getInitialState = () => f;
98
+ let u;
99
+ const y = () => {
100
+ var t, S;
101
+ if (!l) return;
102
+ c = !1, i.forEach((o) => {
103
+ var d;
104
+ return o((d = r()) != null ? d : f);
105
+ });
106
+ const b = ((S = e.onRehydrateStorage) == null ? void 0 : S.call(e, (t = r()) != null ? t : f)) || void 0;
107
+ return p(l.getItem.bind(l))(e.name).then((o) => {
108
+ if (o)
109
+ if (typeof o.version == "number" && o.version !== e.version) {
110
+ if (e.migrate) {
111
+ const d = e.migrate(
112
+ o.state,
113
+ o.version
114
+ );
115
+ return d instanceof Promise ? d.then((I) => [!0, I]) : [!0, d];
874
116
  }
875
- t = (e - 55296 << 10 | t - 56320) + 65536;
876
- } else e && (r -= 3) > -1 && o.push(239, 191, 189);
877
- if (e = null, t < 128) {
878
- if ((r -= 1) < 0) break;
879
- o.push(t);
880
- } else if (t < 2048) {
881
- if ((r -= 2) < 0) break;
882
- o.push(
883
- t >> 6 | 192,
884
- t & 63 | 128
885
- );
886
- } else if (t < 65536) {
887
- if ((r -= 3) < 0) break;
888
- o.push(
889
- t >> 12 | 224,
890
- t >> 6 & 63 | 128,
891
- t & 63 | 128
892
- );
893
- } else if (t < 1114112) {
894
- if ((r -= 4) < 0) break;
895
- o.push(
896
- t >> 18 | 240,
897
- t >> 12 & 63 | 128,
898
- t >> 6 & 63 | 128,
899
- t & 63 | 128
117
+ console.error(
118
+ "State loaded from storage couldn't be migrated since no migrate function was provided"
900
119
  );
901
120
  } else
902
- throw new Error("Invalid code point");
903
- }
904
- return o;
905
- }
906
- function mr(i) {
907
- const r = [];
908
- for (let t = 0; t < i.length; ++t)
909
- r.push(i.charCodeAt(t) & 255);
910
- return r;
911
- }
912
- function gr(i, r) {
913
- let t, n, e;
914
- const o = [];
915
- for (let h = 0; h < i.length && !((r -= 2) < 0); ++h)
916
- t = i.charCodeAt(h), n = t >> 8, e = t % 256, o.push(e), o.push(n);
917
- return o;
918
- }
919
- function K(i) {
920
- return R.toByteArray(Er(i));
921
- }
922
- function A(i, r, t, n) {
923
- let e;
924
- for (e = 0; e < n && !(e + t >= r.length || e >= i.length); ++e)
925
- r[e + t] = i[e];
926
- return e;
927
- }
928
- function w(i, r) {
929
- return i instanceof r || i != null && i.constructor != null && i.constructor.name != null && i.constructor.name === r.name;
930
- }
931
- function D(i) {
932
- return i !== i;
933
- }
934
- const Ir = function() {
935
- const i = "0123456789abcdef", r = new Array(256);
936
- for (let t = 0; t < 16; ++t) {
937
- const n = t * 16;
938
- for (let e = 0; e < 16; ++e)
939
- r[n + e] = i[t] + i[e];
940
- }
941
- return r;
942
- }();
943
- function x(i) {
944
- return typeof BigInt > "u" ? dr : i;
945
- }
946
- function dr() {
947
- throw new Error("BigInt not supported");
948
- }
949
- }(N), N);
950
- }
121
+ return [!1, o.state];
122
+ return [!1, void 0];
123
+ }).then((o) => {
124
+ var d;
125
+ const [I, _] = o;
126
+ if (u = e.merge(
127
+ _,
128
+ (d = r()) != null ? d : f
129
+ ), n(u, !0), I)
130
+ return g();
131
+ }).then(() => {
132
+ b?.(u, void 0), u = r(), c = !0, a.forEach((o) => o(u));
133
+ }).catch((o) => {
134
+ b?.(void 0, o);
135
+ });
136
+ };
137
+ return s.persist = {
138
+ setOptions: (t) => {
139
+ e = {
140
+ ...e,
141
+ ...t
142
+ }, t.storage && (l = t.storage);
143
+ },
144
+ clearStorage: () => {
145
+ l?.removeItem(e.name);
146
+ },
147
+ getOptions: () => e,
148
+ rehydrate: () => y(),
149
+ hasHydrated: () => c,
150
+ onHydrate: (t) => (i.add(t), () => {
151
+ i.delete(t);
152
+ }),
153
+ onFinishHydration: (t) => (a.add(t), () => {
154
+ a.delete(t);
155
+ })
156
+ }, e.skipHydration || y(), u || f;
157
+ }, w = O;
951
158
  export {
952
- Sr as __require
159
+ F as createJSONStorage,
160
+ w as persist,
161
+ R as subscribeWithSelector
953
162
  };